I am stuck with the diagram.toolManager.linkingTool.temporaryLink. It always starts the links in the center of the node. My custom Link class does what I want, but how can I use it for the temporaryLink ?
I want the temporarylink also to behave like my “final” link (i.e. use the shortest path at a given x-location, see the fat blue arrow).
I meant that you need to either need to set the category for LinkingBaseTool | GoJS API and LinkingBaseTool | GoJS API, or you need to make the Link.getLinkPoint override smarter to treat the temporary nodes used during the linking operation in the way that you want.
Uncaught TypeError: Cannot read property 'mh' of undefined
at H.<anonymous> (go-debug.js:1610)
If I set the temporaryFromNode.category in the doActivate(), I also get the same error.
When / where should I set the category?
I could make Link.getLinkPoint smarter, but it is not executed while temporaryLink is drawn.
The LinkingBaseTool.temporaryLink isn’t a modeled Part – there is no Link.data and data Bindings won’t work.
But you could make a copy of any Link that is in the Diagram.linkTemplateMap and assign it to LinkingBaseTool.temporaryLink whenever the tool isn’t running. And maybe sometimes when it is – that wasn’t something that we designed for, so I don’t know when you can exchange it for another instance of Link.