Join two disconnected links to obtain one link

Hi, we are evaluating GoJs to build a model graphic builder.

The library looks great, but we want to know if this use case could be supported.

1- The user creates nodes that contains input and output links disconnected, i.e., without source and target nodes.
2- The user selects one of the disconnected link and drags it to the start point of one disconnected link in the other node.
3- As result, the two links should join in a only one link.


I suggest that you start with the Draggable Link sample, Draggable Link.

Now you may not be interested in dragging links, in which case you don’t need to set DraggingTool.dragsLink to true. But you will see that links do not need to be connected with ports at either or at both ends. Furthermore, because isUnconnectedLinkValid is true on both the LinkingTool and the RelinkingTool, users can draw a new link from a port and not have to connect it with a port, and users can reconnect a selected link to another port or to no port at all.

(Additionally, if you want users to be able to draw a new link with a mouse-down-and-drag in the background, see the DisconnectedLinkingTool at A tool to create a line - #10 by walter)

Being able to reconnect a link to the unconnected end of a link (that presumably is going in the “same” direction) should be quite possible, but I don’t have that code for you.