When I change the link route
and hide the node (node.visible = false) and then show it (node.visible = true),
the link route will be recalculated.
Is there a way to change this behavior?
You could save those link routes and restore them after making the node visible. There are some implementation complications, though.
Or you could make the node’s and links’ GraphObject.opacity zero. This is what I recommend. You probably also want to set Part.selectable and GraphObject.pickable to false, depending on the reason for hiding the node and connected links.
First, I hope you already understand that the reason for having gaps there normally is due to Link.curve having been set to go.Link.JumpGap.
But the functionality for deciding whether or not to insert a “jump” into the geometry of a link path doesn’t consider the opacity of the link or link path.
What happens when you make the link not visible instead of setting opacity to zero?