Avoid link overlapping on nodes

I created a diagram with a ForceDirectedLayout with a basic link template layout and I’m trying to avoid that sometimes a link overlaps the node as you can see in this image:

What do I have to set in order to avoid this behaviour?

Thanks
Giorgio

In general, there is no way to guarantee that with ForceDirectedLayout no links will intersect with any nodes. Depending on the size of the nodes, the interconnectivity with links, and the properties of the ForceDirectedLayout, even some nodes might overlap each other.

If you want all links to be drawn behind all nodes, you could set:

{ layerName: "Background" }

on your Link template.

Hi Walter,
thanks for your help, I hope that this solution will satisfy the customer.
I was following this documentation GoJS Layers -- Northwoods Software trying to alternate background and foreground, but as you showed setting background on the link template was enough.

Thanks
Giorgio