How is it possible to link node to itself?


#1

I’m evaluating GoJS library and got stuck with linking a node to itself. Let’s consider the following example as starting point.

Here we can connect nodes by drawing link from one node to another node and this works fine.But my case is the linking a node to another port of the same node such as in the following picture(red link):

How can I adjust this example to achieve my goal?


#2

The default validation rules prevent users from drawing reflexive links. But you can change that by setting some properties. Please read https://gojs.net/latest/intro/validation.html and in particular https://gojs.net/latest/intro/validation.html#LinkableSelfNodeProperties.