Temporarylink fromSport and toSpot dynamic?

Can gojs temporarylink also make fromSport and toSpot dynamic?


can we make these values ​​dynamic according to the point of linking?

Depends on what you want to do, and when. Either set https://gojs.net/latest/api/symbols/LinkingBaseTool.html#portTargeted or override https://gojs.net/latest/api/symbols/LinkingBaseTool.html#copyPortProperties and https://gojs.net/latest/api/symbols/LinkingBaseTool.html#setNoTargetPortProperties.

I’m trying to override copyPortProperties but I get an error

copyPortProperties is protected and only accessible through and instance error

How to use copyPortProperties ?

        class TestTool extends go.LinkingBaseTool {
            // new data properties (fields) get declared and initialized here

            constructor() {

            public copyPortProperties() {

        TestTool .prototype.copyPortProperties();

This would be equivalent to what you’ve tried to write:

class TestTool extends go.LinkingTool {
  protected copyPortProperties(realnode: Node | null, realport: GraphObject | null, tempnode: Node,
                               tempport: GraphObject, toend: boolean): void {
    super.copyPortProperties(realnode, realport, tempnode, tempport, toend);

Then to install your new LinkingTool:

$(go.Diagram, . . .,
  { . . .,
    linkingTool: new TestTool()

Thanks for your help walter.