Is this layout/behaviour possible?

I am trying to simulate a certain node behaviour which is better explained by the pictures attached.

Here I have a root node and a subnode, and between the two I have a bunch of other nodes, When the collapse button is clicked on the subnode, these nodes should collapse into the subnode and the user should be able to see the subnode connected to the root node.

Is this possible ? If so how do I go about it ?

The node with the text ‘Erosion’ is the subnode, the Orange/Red node is the root node and the nodes in between them are visible in the pic below -

This is what I want to happen when I click the collapse button on the ‘Erosion’ subnode -

It looks like your definition of “Collapse” is to actually prune the two nodes out of the path and connect the Offshore node to the Erosion node.

No, we don’t support that behavior with any code we provide, but you could write your own Collapse and Expand for the “Erosion” node to do that. Look at TreeApp to see what it does.

One difference here is that your Collapse is going to have to play some games with links. Hide the vertical bar nodes and their links first, then somehow make the link from Erosion to Offshore.

I think the easiest way to do this would be to have an “extra” link between Erosion and Offshore that is hidden when expanded, and visible when collapsed.

Thanks, I thought along the same lines but getting the layout to appear correctly with the vertical bar nodes in between the “Erosion” and “Offshore” nodes while having the “Offshore” node connected to the vertical bar nodes would complicate things mainly with drawing the layout…

Also, adjusting the length of the invisible link between the “Erosion” and “Offshore” nodes when expanded to properly accommodate for the vertical bar nodes in between would be difficult to perform with the layouts I think ?

You’d want to do the layout after every expand/collapse, I think.

Just do the layout with the visible nodes at the time… Layout allows you to prune the Network to a specific set of nodes.

<span =“Apple-style-span” style=": rgb248, 248, 252; ">Look at the DataSetDemo sample and do what it does where it prunes the invisible nodes out of the LayoutNetwork.