Flipping angle of link direction on the toNode

Hi,

I am working with a group on my GoJS canvas that has nodes inside of it. I want to have a link from the node, to the port of the group. The issue is, the direction of the link is coming from outside of the group (refer to highlighted link in screenshot). How can I change the direction of the link to come from inside of the group?

Could you tell use your port settings, and link template?

Also note that in GoJS 3.1 (currently in Beta, soon to be released) we’ve improved linking from Nodes to their containing groups. Compare how these act:

GoJS 3.0: https://codepen.io/simonsarris/pen/OPMVaOL?editors=1010

GoJS 3.1 Beta: https://codepen.io/simonsarris/pen/JoGderv?editors=1010

(you can also see which version is which via the watermarks on the canvas)

On the group template I have:

toSpot: go.Spot.Right,
fromSpot: go.Spot.Right,

and this is the link template I am using:

const getLinkTemplate = () =>
      $(
        go.Link,
        {
          name: 'LINK',
          routing: go.Routing.AvoidsNodes,
          corner: 10,
          fromEndSegmentLength: 20,
          toEndSegmentLength: 20,
          deletable: false,
          movable: false,
        },
        $(
          go.Shape, // a thick transparent link shape
          {
            isPanelMain: true,
            strokeWidth: 10,
            stroke: 'transparent',
          }
        ),
        $(go.Shape, {
          isPanelMain: true,
          strokeWidth: 2,
          stroke: LINK_COLOR,
        }),
        $(go.Shape, { toArrow: 'Standard', stroke: LINK_COLOR, fill: LINK_COLOR })
      );

You may need to set avoidable: false on your Group template. But otherwise this is one of the scenarios we’ve tried to improve with 3.1, and you should swap it in and see if it improves how it works for your case.

3.0:

3.1 Beta:

Though I wonder if we could improve it further. I wonder if in 3.1, the link starts on the left side erroneously because the whole port is behind it (the shape) when it should instead consider the port spot.

Using version 3.1 did fix the link direction problem, but we still were seeing issues with the links crossing each other. We ended up getting approved for a different design, so we’re abandoning the concept of linking the node to the containing group altogether. Thanks for the help.