Let’s start with a minimal node template and add fromLinkable et al:
myDiagram.nodeTemplate =
$(go.Node, "Auto",
{
fromLinkable: true, toLinkable: true, cursor: "pointer"
},
$(go.Shape,
{ fill: "white" },
new go.Binding("fill", "color")),
$(go.TextBlock,
{ margin: 8 },
new go.Binding("text"))
);
As you should expect, the whole node is now “linkable”, so the LinkingTool runs on a mouse down and drag, and the DraggingTool doesn’t get a chance to run.
Change the Shape to be the port:
myDiagram.nodeTemplate =
$(go.Node, "Auto",
$(go.Shape,
{ fill: "white", portId: "", fromLinkable: true, toLinkable: true, cursor: "pointer" },
new go.Binding("fill", "color")),
$(go.TextBlock,
{ margin: 8, editable: true },
new go.Binding("text").makeTwoWay())
);
And now the user can drag the text in order to drag the node, but the user can start drawing a link from the Shape.
Or if you really want the whole node to be a port:
myDiagram.nodeTemplate =
$(go.Node, "Auto",
{
fromLinkable: true, toLinkable: true, cursor: "pointer"
},
$(go.Shape,
{ fill: "white" },
new go.Binding("fill", "color")),
$(go.TextBlock,
{ margin: 8, fromLinkable: false, toLinkable: false, cursor: "auto" },
new go.Binding("text"))
);