const $ = go.GraphObject.make;
this.diagram = $(go.Diagram, {
"undoManager.isEnabled": true,
"grid.visible": this.showGrid,
"grid.gridCellSize": new go.Size(25, 25),
model: $(go.GraphLinksModel, {
linkKeyProperty: "key",
}),
});
here is my diagram code above
linkFromPortIdProperty: “fromPort”,
linkToPortIdProperty: “toPort”,
i have removed these 2 lines as when i adjust the location of diagram it automatically choses the port based on space and direction, but in that case link object doesnt contain which port its connected
so thats its becoming hard to identify which port its connected
here is my
const activityNodePorts = [
{ portId: "T", align: go.Spot.TopCenter, output: true, input: true },
{ portId: "L", align: go.Spot.LeftCenter, output: true, input: true },
{ portId: "R", align: go.Spot.RightCenter, output: true, input: true },
{ portId: "B", align: go.Spot.BottomCenter, output: true, input: true },
];
makePort function is mentioned below
$(go.Shape, "Circle", {
alignment: item.align,
portId: item.portId,
fromLinkable: item.output,
toLinkable: item.input,
cursor: "pointer",
fill: "transparent",
desiredSize: new go.Size(7, 7),
stroke: null,
});
My motive is find out which port its conncted to…and also when the user moves the node in all direction its changes its port dynamically for better viewable diagram.