How to improve node dragging

9 times out of 10 when I want to drag around a node, it creates a link from that node instead.
This is because in order to drag the node, I have to select it exactly in the center.

I already created transparent ports on each side of the node that can be used to create links from. So I don’t need to be able to create a link when clicking on the node itselft.

I could not find where this is configured. Can you point me into the right direction ?

Do you have fromLinkable/toLinkable set to true on another element within your node template? Maybe you want to read through the intro page on ports.

In my node template I have the following:

 $(go.Panel, 'Auto',
          $(go.Shape, new go.Binding('figure', 'figure'), {
            name: 'SHAPE',
            desiredSize: new go.Size(120, 60), minSize: new go.Size(60, 40),

            portId: '',
            fromLinkable: true, fromLinkableSelfNode: true, fromLinkableDuplicates: true,
            toLinkable: true, toLinkableSelfNode: true, toLinkableDuplicates: true,
            cursor: 'pointer'
          },

If I set fromLinkable and toLinkable to false, indeed I no longer have the problem. However I want to keep the ability to drag a link to a node. I tried setting only fromLinkable to false, but this gives a weird behavior because I can create an outbound link from the node.

So how do keep the ability to drag a node onto a node but not from a node (only from the ports) ?

You could set LinkingTool.direction to ForwardsOnly if you don’t want links starting from the to node.

1 Like

perfect :)