Skip to content Skip to sidebar Skip to footer

D3 Svg Transition Issue After Deleting Few Nodes

I am facing a weird issue in this jsfiddle. If I delete few existing nodes and add new nodes later, the transition of nodes doesn't stay the same. This scenario is working fine :

Solution 1:

The issue looks like that when you delete a node, you're creating a new reference to links that is not in sync with your force layout:

links = links.filter...

To fix this, you can simply add: force.links(links); to the line after it to update the force layout's reference.

Updated fiddle: https://jsfiddle.net/r1tcj0mf/16/

Post a Comment for "D3 Svg Transition Issue After Deleting Few Nodes"