The shortest length of a line

I created an effect that automatically adds a node to a line by dragging it onto it
like this:https://gojs.net/latest/samples/flowgrammer.html
However, if the distance between two nodes is short, it will be crowded after dragging
1643019307(1)
1643019324(1)
So I wonder if there is a way to give the line a minimum length, lengthen the line after dragging in nodes, and change the position of other nodes when there are more nodes behind it

The length of the links depends on the positions of the nodes. If the user does not move the nodes manually and you do not move the nodes programmatically when splicing in that node, then it is normal to depend on an automatic layout. What have you set the Diagram.layout property to?