Restricting links from intersecting nodes

the port position should be in go.spot.Default but the arrow head of link should be restricted in border of the node

image

How is the port defined, and how is it used in its containing Panel?

$(go.Node, "Spot", getNodeProperties(),
      new go.Binding("location", "data", getLoc),
      $(go.Panel, "Auto",
        getShapeForNode("RoundedRectangle"),
        $(go.Panel, "Vertical", { alignment: go.Spot.Center, },
          getIconForNode(), getTextForNode(4)
        )
      ),

     >makePort("in", " ", go.Spot.Default),
      makePort("out", "1", go.Spot.Bottom),
      makePort("exception", "2", go.Spot.Right)
    );

Thanks for the Node definition, but what does makePort return? And which one of the three is the one you are asking about?

const makePort = (name: string, pid: string, spot: go.Spot): go.GraphObject => {
    return $(go.Shape, "Circle",
      {
        name: name,
        portId: pid,
        fromLinkable: name !== "in",
        toLinkable: name === "in",
        alignment: spot,
        fromSpot: spot,
        toSpot: spot,
        stroke: name === "exception" ? "red" : "black",
        fill: "#dddddd",
        desiredSize: new go.Size(6, 6),
        cursor: "pointer",
        strokeWidth: 1.5,
        opacity: 0
      })

  }

If you want the whole node to act as the port rather than a 6x6 transparent shape in the middle of the node, then instead of calling makePort for “in”, set portId to " " on the “RoundedRectangle” Shape, or on that “Auto” Panel. And set toLinkable to true.

Thank you ,It works