Hi,
When using brush at link stroke, is it able to achieve effects like below, i.e, brush at each stroke dash?
Currently I’m only be able to brush at whole link stroke.
var $ = go.GraphObject.make;
myDiagram.nodeTemplate =
$(go.Node, "Auto",
new go.Binding("location", "loc", go.Point.parse),
$(go.Shape, "RoundedRectangle", {
fill: "lightgray"
}),
$(go.TextBlock, {
margin: 5
},
new go.Binding("text", "key"))
);
var brush = new go.Brush(go.Brush.Linear);
brush.addColorStop(0, "transparent");
brush.addColorStop(1, "blue");
myDiagram.linkTemplate =
$(go.Link, {
routing: go.Link.AvoidsNodes,
curve: go.Link.JumpGap,
corner: 10,
reshapable: true,
toShortLength: 7
},
new go.Binding("points").makeTwoWay(),
// mark each Shape to get the link geometry with isPanelMain: true
$(go.Shape, {
isPanelMain: true,
stroke: "transparent",
strokeWidth: 5
}),
// $(go.Shape, {
// isPanelMain: true,
// stroke: "gray",
// strokeWidth: 3
// }),
$(go.Shape, {
isPanelMain: true,
stroke: brush,
strokeWidth: 3,
name: "PIPE",
strokeDashArray: [10, 10]
}),
$(go.Shape, {
toArrow: "Triangle",
fill: "black",
stroke: null
})
);
var nodeDataArray = [{
key: "Alpha",
loc: "0 0"
}, {
key: "Beta",
loc: "100 50"
}];
var linkDataArray = [{
from: "Alpha",
to: "Beta"
}];
myDiagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);
Thanks in advance,
Jinxin