myDiagram.toolManager.linkReshapingTool.handleArchetype =
goObject(go.Shape, "Circle",
{ width: 10, height: 10 },
new go.Binding('fill','element_color')
);
I tried to do it, but it didn’t work.
myDiagram.toolManager.linkReshapingTool.handleArchetype =
goObject(go.Shape, "Circle",
{ width: 10, height: 10 },
new go.Binding('fill','element_color')
);
I tried to do it, but it didn’t work.
I don’t think having Bindings on tool handle archetypes is supposed to work. But when I tried it, it seems to work for the first one but not for others.
myDiagram.toolManager.linkReshapingTool.handleArchetype =
$(go.Shape, "Circle",
{ width: 10, height: 10, fill: "white" },
new go.Binding('fill', 'element_color')
);
myDiagram.model = new go.GraphLinksModel(
[
{ key: 1, text: "Alpha", color: "lightblue" },
{ key: 2, text: "Beta", color: "orange" },
{ key: 3, text: "Gamma", color: "lightgreen" },
{ key: 4, text: "Delta", color: "pink" }
],
[
{ from: 1, to: 2, element_color: "cyan" },
{ from: 1, to: 3, element_color: "red" },
{ from: 2, to: 2, element_color: "lightgreen" },
{ from: 3, to: 4, element_color: "yellow" },
{ from: 4, to: 1 }
]);
After changing the Link.routing to be go.Link.Orthgonal
, in order to show reshaping handles at all:
Note how the first reshape handle has the expected fill color from the data.element_color
property, but not the second one which has the default “white” fill.
So I’m sorry, but you’re asking for a new feature that is not implemented in version 1.7.