In's and outs at same port

Hi there,

Is there a way to prevent having arrows in and arrows out of the same port spot, so for example port Top is for all Ins and Left, Right, Bottom are for all the outs ? Sometimes when an autolayout executes it will connect ins and outs on the same port.

Thanks in advance, if you need more info, let me know!

So your nodes have four separate ports, with four different portIds, at different locations within each node?

The fromLinkable and toLinkable properties control whether the user can draw a new link or reconnect an existing link coming out of and going into a port, respectively.

Layouts do not reconnect any links, so as long as there are no links with Link.fromPort being the “Top” port, the routing of all links after a layout will not cause any to appear connected with the “Top” port. And the same for no links going into the other three ports.

However, if you do not have separate ports at distinct locations on each node, then ambiguity after a layout is certainly possible. That is because the layouts that form layers of nodes also default to setting Link.fromSpot and toSpot. Please read: https://gojs.net/latest/intro/connectionPoints.html#SomeLayoutsSetLinkSpots