Nodes without position information overlapping

I’m attempting to layout nodes, using the tree layout, based on the data I get from a server. I successfully get all nodes and link information. The majority of the nodes have x and y coordinates which are positioned correctly. Once these nodes are positioned I set the isLayoutPositioned attribute to false in order to keeps these nodes in place.

A few of the nodes do not have any x and y coordinates. I would like gojs to automatically place these nodes within the diagram with the links and separated. (Note: I’m not setting the isLayoutPositined value to false). The issue I’m encountering is that all these nodes are placed on top of each other with all the links. I need these nodes to be separated on the diagram. Any suggestions are welcomed.

So you are using TreeLayout. One thing you could do is set TreeLayout.arrangement to go.TreeLayout.ArrangementFixedRoots. Then for each node that is not positioned, if there is a parent node that is positioned, set its Part.isLayoutPositioned to true. That will cause the TreeLayout to leave the root nodes where they are but using the links that come out of there that connect with nodes that need positioning to be positioned relative to the root node.

You might also need to set isLayoutPositioned to true on sibling nodes and their descendants that already have positions.