Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control automatic node rendering #553

Closed
wants to merge 3 commits into from
Closed

Control automatic node rendering #553

wants to merge 3 commits into from

Conversation

u-874
Copy link

@u-874 u-874 commented Feb 3, 2016

Added functionality to pause and reenable automatic node rendering. This
feature is useful when many changes to the tree (its nodes) are made at
once (e.g. initial loading) and rendering slows down the process. I was
able to reduce the initial loading time of 30000 nodes from nearly
endless (I stopped after 20 minutes) to about 30 seconds.

TLDR:

fancytree.setRenderingPaused(true);

// Add thousands of nodes to the tree
// ...

fancytree.setRenderingPaused(false);
fancytree.render();

u-874 added 2 commits February 3, 2016 14:15
Added functionality to pause and reenable automatic node rendering. This
feature is useful when many changes to the tree (its nodes) are made at
once (e.g. initial loading) and rendering slows down the process. I was
able to reduce the initial loading time of 30000 nodes from nearly
endless (I stopped after 20 minutes) to about 30 seconds.
Fixed a merge error (wrong order)
@u-874 u-874 closed this Feb 3, 2016
@u-874
Copy link
Author

u-874 commented Feb 3, 2016

Fixed merge error

@u-874 u-874 reopened this Feb 3, 2016
@u-874 u-874 closed this Feb 3, 2016
Removed trailing whitespace
@u-874
Copy link
Author

u-874 commented Feb 3, 2016

Fixed lint error.

@u-874 u-874 reopened this Feb 3, 2016
@mar10
Copy link
Owner

mar10 commented Feb 10, 2016

Thanks, I will look into it if I find some time.
Anyway it would be good to have tests for it (benchmarks) so we can compare different approaches.
Dynatree had something like tree.enableUpdate(enable) that returned the previous state, which makes it easier to restore in nested calls. It also forced a redraw on enableUpdate(true).
See http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html

Instead (or additionally) to suppress rendering, we should also benchmark performance, when the tree root element is detached while adding nodes (see https://api.jquery.com/detach/)

@mar10
Copy link
Owner

mar10 commented Jun 18, 2016

Closing in favor of a general feature request - #607
thanks!

@mar10 mar10 closed this Jun 18, 2016
@mar10
Copy link
Owner

mar10 commented Jun 28, 2016

@u-874 could you explain a bit, what operations were slow?
Did you use the table table extension or some other plugins?
How did you add nodes, and how many?

@mar10 mar10 added the waiting label Jun 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants