Problem in arranging overlapping nodes

This is about functionality to arrange overlapping nodes.

SendToBack & BringToFront

I am using zOrder binding to achieve this.
Suppose node1 has zOrder:1 & node2 has zOrder:2. To bring node1 in front, i am increasing its zOrder to 2.
This does not work, both nodes has same zOrder. Only if i increase zOrder again to 3, i achieve the result.

How to achieve the desired result, in one action ?

Thanks !

Or is there a way to get list of all overlapping nodes, for a given node ?

You can call Diagram.findObjectsIn using your Node.actualBounds, looking for partial overlaps.

Use function(obj) { return obj.part; } as the navig parameter. Use a predicate that accurately classifies those nodes that you care about – e.g. must be an instanceof go.Node if you want to ignore all Links.

1 Like

Since v2.0 it is easier to call Diagram.findPartsIn.