There are several possible answers to your question, depending on the effects that you want. The most general is to make the whole node the port, so that links connecting with the bottom of the node will start or end at the bottom of the TextBlock.
If you don’t mind some criticism, I’d like to point out some problems.
First, please run with go-debug.js
while developing, so that you can catch some of the errors in the Output window of the debugger.
new go.Spot(-1, -1)
is quite invalid. Using go-debug.js
will catch such errors.
You have a bunch of Panels that seem completely unnecessary. In general a Panel should hold at least two elements, although “Viewbox” is an exception. Why have an “Auto” Panel surrounding only a “Vertical” Panel? What’s the point of a “Horizontal” Panel holding a single TextBlock?
Minor issues include unnecessary settings on the Node of name: "MainNode"
, selectable: true
, isPanelMain: true
, opacity: 1
, and zOrder: 1
.
Having all of the Bindings use an empty string as the source is suspicious. I suspect it is at least a lot slower than it needs to be. Maybe you should read about sub-bindings at Binding to a property of a property.
Binding isActionable seems suspicious to me. What are you trying to accomplish by setting isActionable?
A bunch more of the Bindings seem unnecessary, too, but that’s just my guess.
Setting stroke: "transparent"
on the TextBlock also seems suspicious to me – it’s odd to have the text not be seen unless the Binding gives it a stroke color.