Force nodes to not overlap?

I’ve been searching the documentation but can’t find if there’s a way to keep nodes from overlapping. We have an existing Java Swing app which saves node coordinates in the database. Our HTML5 GoJS app has larger nodes and some customer’s diagrams will look bad and overlap. Since we will be giving the nodes coordinates when putting on the diagram, we want to a way to tell the diagram to not overlap even if we give coordinates. Is this possible? I would also like a way to define how close to each each node is allowed to be.

If you are specifying the Part.location or Part.position, whether by setting or by binding, then the library has to respect that.

Perhaps you want to limit the size of each node to avoid such overlaps? The easiest solution would be to specify the desiredSize and have the Node.type be Panel.Viewbox. On the other hand, you might not have saved the size of each node, so I can imagine this might be hard to do correctly. I suppose you could have the nodes occupy their natural size and then your custom Layout could programmatically adjust the scale or each node to make sure it does not overlap any other node on the right or bottom sides.

Our Java app is over 10 years old and we are giving the nodes a more modern look and why they’re bigger. It’s a little complicated as some nodes will have coordinates and/or sizes defined and others won’t. Would there be an easy way programmatically after the diagram is drawn to rearrange the nodes w/o overlapping?

I’m not sure what you are intending, but most of the Layouts will ensure that nodes do not overlap each other. Of course that’s true in our Java implementation, JGo, too, but I don’t know that you were using JGo.

And if you had some sort of partly automatic layout and partly manual layout in your Java app, I suppose you could do the same thing in GoJS.