How to avoid links get overlapping nodes

I have used “LayeredDigraph” layout…In link template i have added “routing: go.Link.AvoidsNodes” and it is working properly in the most cases.I have given option of layout column spacing…but sometimes when we changed column spacing line gets overlap on nodes…I do not understand why this is happening…because if we changed spacing again it works fine…bt at particular spacing number it shows this.
Second Issue is i want to increase spacing between links…linkSpacing property is not working…

Diagram 1: Column spacing and layer spacing both are “39”…Line overlapping on node filtration…

Diagram 2: Column spacing and layer spacing both are “33”…Line shows properly…

The layout does not know about label Nodes – it just ignores them. Also, in general layouts do not route Links with routing==AvoidsNodes.

Have you specified fromSpot or toSpot on the link label Node? If you select that orange Link and look at it in the debugger, what is its Link.toSpot value? Have you tried setting LayeredDigraphLayout.setsPortSpots to false?

Hii Walter,
I have already set “LayeredDigraphLayout.setsPortSpots” to false. And I have not understood your comment about Link Label Node…I just want to clear that “Filtration” is not “Link label”… it is just a text on the node.All links from diagram not having any labels.

The apparent problem is that the label Node on the Link (which is not seen, but which is the .toNode of the orange Link from “Hot Water Pressure Tank”) is too close to the “Filtration” Node. That makes the AvoidsNodes routing think that there’s not enough room for an AvoidsNodes LInk to be routed between those two Nodes. So the route just goes through the “Filtration” Node because it thinks it needs to come from that direction anyway.

In the other case, there is enough room for the AvoidsNodes Link to be routed, so everything is OK.

What I don’t understand is why the AvoidsNodes routing doesn’t realize that it could go around and connect from the left side. That seems like a bug. It will take some time before we figure it out and fix it.

I don’t think this is something we can safely modify in version 1.7.*. However we will make some small changes that may reduce the amount of node crossings without preventing them.

In your particular app, I wonder if there might be some way to customize your LayeredDigraphLayout.commitLinks method to adjust the end point of those Links that connect to other Links. Your override could call the base method and then look carefully whether any target label Nodes are too close to any other regular Nodes. For such a label Node, you could adjust its position upward or downward to be between “layers”, so that any Link connecting with that label Node would not be likely to overlap any regular Nodes.