-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Network] GUI Manipulation, node level doesn't update visually #3220
Comments
It didn't work for me either in chromium. When I remove this line from options:
...all is well, also in firefox. Hey, I know that network! Great example BTW. |
Adding a new node appears to work fine. So the problem is in the update. Digging in... I believe it's the following:
Thus, the logical thing to do is to force the recalculation on the update as well. However, it's a bit overkill to do this on every arbitrary change in the node data; I propose to add a check on update if option |
Fix for almende#3220 On change of data of an existing node, the level is checked for changes. If changed, for a recalculation of the hierarchical layout. The fix does not explicitly check for hierarchical layout; this should not be a problem. The added code can be used to add further node fields which may trigger recalculation of layout.
Fix has been submitted. It was pretty straightforward after preceding analysis. |
* Update hierarchy when node level changes Fix for #3220 On change of data of an existing node, the level is checked for changes. If changed, for a recalculation of the hierarchical layout. The fix does not explicitly check for hierarchical layout; this should not be a problem. The added code can be used to add further node fields which may trigger recalculation of layout. * Changes due to review
* Update hierarchy when node level changes Fix for almende#3220 On change of data of an existing node, the level is checked for changes. If changed, for a recalculation of the hierarchical layout. The fix does not explicitly check for hierarchical layout; this should not be a problem. The added code can be used to add further node fields which may trigger recalculation of layout. * Changes due to review
I have a Network with a hierarchical tree. I added the GUI buttons to add and edit the nodes, however when I edit a node and I change its level, the node doesn't move to that level, visually. As a workaround I call
network.clustering.updateClusteredNode(data.id, {level : theNewLevel});
after the callback to update the node and that does make the node appear in its new position.Here's a fiddle that shows the issue: https://jsfiddle.net/y2kwv76v/3/
Edit a node changing its level and you'll see it won't move.
After that, click on the button "Use workaround" and the node will go to the right level.
For some reason the fiddle only works on Chrome...
The text was updated successfully, but these errors were encountered: