Automatically adjust layer spacing based on with width of parent node in treeview

I’m using a virtualized treeview to draw a tree with large number of nodes. The node has a minimum size of (220, NaN) and the layout layer spacing is 165. Link definition: {routing = Orthogonal, fromSpot = BottomCenter and toSpot = LeftCenter}. The links are drawn fine when node width is less than 220px, but it overlaps the child nodes when the parent node’s width exceeds 220px (see picture below)..
I cannot set a maximum node size and adjust the layer spacing to account for the largest node. Setting the link routing to AvoidNodes won’t work either as the vertical lines would appear bent at different positions.

Is there a way to force the treeview to treat the layer spacing value as a minimum value and horizontally shift the child nodes based on the width of their parent node?


Depending on how you have defined your TreeLayout, you might want to use TreeLayout | GoJS API (or the “alternate…” property).

That worked! Thanks Walter.