Switching between tree
and force
layouts.
tree
and force
layouts use both the node & link layout structure. d3.layout.tree()
implicitly converts a node list with children into a link array. force
introduces px
and py
into the node objects, which we remove when switching to the tree layout. Otherwise, when switching to the force layout once more, the already existing px
and py
would cause intial confusion and a non-smooth transition.