I tried to according to the demo:http://gojs.net/latest/samples/draggableLink.html make a line
Routing makes ‘relinkingTool’ overly flexible;
I want to restrict the direction of this line, in the case of dragging;
Is there any way to solve the problem? This question has been annoying for me for a long time;
As you have seen, the LinkReshapingTool already sets those properties the way that you want.
The only problem is that the two handles at the ends of the link are not reshaping handles but are relinking handles added by the RelinkingTool. If you really do not want to support relinking (i.e. reconnecting a link to a different port) you’ll need to turn off those two properties I told you about above. If you want to substitute reshaping handles at the ends of the links, you would need to override LinkReshapingTool.updateAdornments to add such handles at the ends of the link.
I’m sorry, but I don’t have an example of this. However there are several examples of customizing the LinkReshapingTool to get different kinds of reshaping handles: