The Shape.pathPattern object, Shape | GoJS API, may be shared by many Shapes and thus that GraphObject does not support data binding.
But as Custom Relationships demonstrates, you could data bind Shape.pathPattern itself to your “xx” property by using a conversion function that returns one of a limited set of Shapes.
function changeLinkColor() {
diagram.startTransaction(“changeLinkColor”);
var links = diagram.findLinksByExample({ from: “4”, to: “1”});
var it = links.iterator;
while (it.next()) {
var item = it.value;
diagram.model.setDataProperty(item.data, “color”, “black”);
}
diagram.commitTransaction(“changeLinkColor”);
}
As seen, i’m trying to change on of the link color to black, but it does not work.
Please advise.
Tany
As I said, you won’t be able to use bindings with the path pattern. What you could do instead is set a new path pattern with the stroke you want. The drawback is that the more you do this, the worse performance could become since there would need to be more path patterns in memory.