I have two Collapsible Force Trees for same nodes.
I haven't seen an example that we can transit from one tree to another with nodes transition and edges reconstruction in d3js.
Is there any way to do that?
Another relevant question, could we initialize the position of each node for forced-directed graph?
EDIT: Here is an example. I have two trees, the link is one, and I have another tree with same molecules but different tree structure. I am thinking it will be nice if I can animate between different trees for same molecules or entities.
In principle, these are the steps to follow.
tick
handler for a force layout with a transitionI've implemented an example of this here. I uses two sets of data and two force layouts. At first, only the nodes and links of the first force layout are displayed and the second only runs in the background. Then, the first is stopped and I follow the steps outlined above.
This isn't going to satisfy all requirements (e.g. with respect to how nodes should transition), but can be used as a starting point for such an implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With