Hi jhardy,
here I am changing category according to your sample but a link isnt refreshing.
here is my Link template
this.diagram.linkTemplateMap.add('subRedLink',
$(SubRedLinkPath,
{
adjusting: go.Link.End,
corner: 15
},
$(go.Shape, shapeStyle(), // the link path shape
{ isPanelMain: true, strokeWidth: 5 }), {
selectionAdornmentTemplate:
$(go.Adornment,
$(go.Shape,
{ isPanelMain: true, stroke: 'dodgerblue', strokeWidth: 10 })
)
}
));
and this is a subRedLink class with extended link class
import * as go from 'gojs';
export class SubRedLinkPath extends go.Link {
constructor() {
super();
go.Link.call(this);
}
computePoints() {
if (this.data.redlinkid) {
const start = this.getLinkPointFromPoint(this.fromNode,
this.fromPort, this.fromPort.getDocumentPoint(go.Spot.Center), new go.Point(0, 0), true);
const end = this.getLinkPointFromPoint(this.toNode,
this.toPort, this.toPort.getDocumentPoint(go.Spot.Center), new go.Point(0, 0), false);
let redLink;
this.clearPoints();
this.diagram.links.each(link => {
if (link.data.uuid === this.data.redlinkid) {
redLink = link;
}
});
this.points.push(start);
redLink.points.each(element => {
this.points.push(element);
});
this.points.push(end);
}
return true;
}
}
question is when I am changing category of link it should be take this template and take effects on link points.