You don’t have a third Node present to be able to tell if the Link is being routed to avoid crossing over other nodes. AvoidsNodes
routing does not include avoiding the two connected nodes. Imagine that the ports were inside their respective nodes even more than they are now. It would be impossible for the route to connect with the port without crossing over some piece of the node.
But you can fix the problem by setting GraphObject.fromSpot and toSpot on the port object created by makePort
. For example, for those ports on the left side of the node, set both spots to go.Spot.Left
.