Undesired link design


this is my diagram and i want my node should have one port outgoing source of link


there is one incoming link towards the group after that if we expand the group then link should distribute on specific node. In my case links are distributed already before the group expand.

const myDiagram = new go.Diagram(“myDiagramDiv1”,
{
padding: 20, // extra space when scrolled all the way
“draggingTool.isGridSnapEnabled”: true,
handlesDragDropForTopLevelParts: true,
initialAutoScale: go.Diagram.Uniform,
layout: $(go.CircularLayout, {spacing:150, isInitial: true, isOngoing: true}),
“undoManager.isEnabled”: true,
“SelectionGrouped”: e => {
const grp = e.subject;
const b = e.diagram.computePartsBounds(grp.memberParts);
grp.location = b.center;
grp.findExternalLinksConnected().each(l => l.invalidateRoute());
},
});

	  myDiagram.linkTemplate =
    $(go.Link,
      {
        layerName: "Foreground",
        routing: go.Link.AvoidsNodes, 
        corner: 10,
        fromShortLength: 0, 
        toShortLength: 10, 
        relinkableFrom: false, 
        relinkableTo: false,
        reshapable: false, 
        resegmentable: true,
        curve: go.Link.JumpGap
        
      },
    
      
      $(go.Shape, { strokeWidth: 2 },
        new go.Binding("stroke", "color"),
        new go.Binding("strokeWidth", "thickness"),
        new go.Binding("strokeDashArray", "dash")),
      $(go.Shape, 
        { segmentIndex: -1, 
          segmentOffset: new go.Point(-5, 6),
          segmentOrientation: go.Link.OrientPlus90,
          alignmentFocus: go.Spot.Right,
          figure: "triangle",
          width: 12, 
          height: 12, 
          strokeWidth: 0
        },
        new go.Binding("fill", "color"),
      ),
     
    );

When a Group is collapsed, Links connecting with its now hidden member Nodes connect instead with the Group’s default port. By default that is the whole Group itself, but perhaps you have set portId to the empty string on some element of the Group template.

So if you want all links coming into a collapsed group to connect at a particular spot, set toSpot on the Group.port object in the group template. Similarly, set fromSpot on the group port if you want to control where links come out of a collapsed group.