Enable option for gradual expanding of large children arrays
angular-tree-control has good performance on large data-sets partially because it onlyrenders children when the parent is toggled open. But it is very slow when a parent has many children (I have on the order of 500 in some instances). On top of that, when I use ng-include for each of the children labels, it causes the browser to freeze for >5 seconds while angular is compiling all 500 of the children nodes
This commit adds a 3 extra options that allow for better rendering. They are turned off by default so original behavior remains the default. The 3 options are:
enableIntervalToggle: //allow for gradual rendering of the children. false by default
childrenTimeInterval: //how many ms between renders
childrenLimitInterval: //how many children to add for each render
For Example, if these were the option values:
enableIntervalToggle: true
childrenTimeInterval: 10
childrenLimitInterval: 10
when a parent node is expanded, it will append 10 children nodes every 10 ms. This will not freeze the screen, and allow the user to still interact with stuff while the children are being added.
I call it enableIntervalToggle because it adds children nodes on an interval when the parent is toggled open.
Bravo on this pull request!! Just stumbled on it today as we've been having lots of problems loading large trees. After some trial and error with the childrenTimeInterval and childrenLimitInterval settings, we have trees loading steadily, providing visual cue to the user while still remaining responsive enough if the user wishes to do something else while the tree finishes loading. Good stuff!