1) Link template
linkTemplate: this.$(
go.Link,
{
toPortChanged: functionBlockCreation.updateLinkColor,
locationSpot: go.Spot.Center,
routing: go.Link.AvoidsNodes,
curve: go.Link.JumpOver,
corner: 3,
selectionAdorned: false, // Links are not adorned when selected so that their color remains visible.
shadowOffset: new go.Point(0, 0),
shadowBlur: 5,
shadowColor: "blue",
reshapable: true,
resegmentable: false,
relinkableFrom: true,
relinkableTo: true,
isLayoutPositioned: false,
zOrder: 10,
segmentFraction: 0.5,
layerName: "Background"
},
new go.Binding("isShadowed", "isSelected").ofObject(),
this.$(
go.Shape,
{ name: "SHAPE", strokeWidth: 1.5, stroke: Colors.connectionPurple },
new go.Binding(
"stroke",
"isHighlighted",
functionBlockCreation.strokeColorLink
).ofObject(),
new go.Binding("strokeWidth", "isHighlighted", function (h) {
if(h){
return px13;
}else{
return px15;
}
}).ofObject()
),
new go.Binding("points").makeTwoWay(),
{contextMenu:new ContextMenuList().linkDataDeleteMenu()}
),
this is the link template we are using
2) port properties
this.$(
go.Shape,
{
figure: shape,
name: dataType,
width: width,
height: height,
strokeWidth: 1,
fill: fillColor,
stroke: color,
alignment: go.Spot.Center,
alignmentFocus: go.Spot.Center,
toLinkable: true,
fromLinkable: true,
fromSpot: go.Spot.Left || go.Spot.right, // this will change based on the port location either it is on right or left
toSpot: go.Spot.Left || go.Spot.right,, // this will change based on the port location either it is on right or left
angle: rotation,
portId: portId,
cursor: "pointer",
},
new go.Binding("figure", "figureType").makeTwoWay(),
new go.Binding("fill", fillColor),
new go.Binding("stroke", "Portcolor").makeTwoWay()
);
3) AV-100 is the textBlock and it is part of node itself not port
and its a normal go.TextBlock with these Properties
this.$(
go.TextBlock,
"Label", {
visible: false,
font: font,
width: width,
alignmentFocus: alignmentFocus, //go.Spot.Right,
stroke: stroke,
text: parameterValue,
editable: editable,
background: "#252525",
position: new go.Point(top, bottom),
textAlign: "end",
alignment: alignment
},