Links Overlapping On Nodes Issue

On top of orange device and green device now there are no overlaps. But there are more overlaps on top of blue color devices
.

Please check the below images:

diagram2
diagram1

Could you please make the first screenshot available in higher resolution? It’s just a thumbnail, so I can’t see the details.

Please find the image:

We have only these kind of overlapping issues Walter, Everything else is fine.

I’ll see if we can easily make some improvements there. This may take a while…

Yeah, Please check and help us Walter. Thanks.

Did you set any properties on the AvoidsLinksRouter?
If you did, try not doing so.

I will check and let you know Walter. Thank you so much.

Also, have you tried increasing the Node.avoidableMargin?

We are not assigning any properties to AvoidsLinksRouter. We tried setting Node.avoidableMargin but there were overlaps, so we removed it again.

I was suggesting that you use AvoidsNodes Link.routing and a Node.avoidableMargin that is 20 or so.

But I do not understand why your links are spread out so far from each other when AvoidsLinksRouter.linkSpacing is 4, the default value. Unless you have modified that code, coincident link segments should be spaced 4 units apart, but your screenshots show them much farther apart.

Some one else worked on this Walter. I am new here. I found below code in AvoidsLinksRouter.js file function
AvoidsLinksRouter() {
this.linkSpacing = 30;
this.maxIterations = 100;
this._segs = [];
this._list = new go.List();
}

Oh, so the code was modified. Try setting it to 4, and increasing the avoidableMargin on the nodes.

Hi Walter,
Is there any way to find out whether the links are crossing over the node. If we get true then we will adjust the node in X axis to go away from the overlapping links.

For a given node, you could call:

const parts = node.diagram.findPartsIn(node.actualBounds, true, false);
parts.each(p => {
  if (p instanceof go.Link) {
    // now p is a Link that crosses over the node
  }
});

Thanks Walter. We will check and come back.

Hi Walter,
Please check below 2 images, In second image we have moved the first green color device to left side of the connected node and the links are showing in some zigzag manner. In the first image we have moved the device to little bit right, Now the connections are fine. Even though if we move a device to the left side of the connected node connections should look clearly, Can you pls help on this?
Capture1
Capture

That is on our list of features to add to the router, but I will not be able to work on it today or very soon.

A post was split to a new topic: Showing more information at each port

Try the new AvoidsLinksRouter that is in version 3.0 of GoJS.