I’m not entirely sure what you want, but here’s an example that shows a diagram which highlights links when both the fromNode and toNode of that link are in the Diagram’s selection:
Then the links have a data binding with their label text:
new go.Binding("text", "isHighlighted", function (h, obj) {
return h ? obj.part.data.from : ""
}).ofObject()
You wrote a comment in your binding:
//key binds to the "key" property in the json
new go.Binding("text", "isHighlighted", function (h) { return h ? "key" : ""}))
But that’s not what your code is doing. Your code is returning the string “key” instead of looking at the link data for a data.key. Links also, by default, do not have key properties assigned.
Awesome, thanks a lot! Works great. I was just wanting to bind to the “weight” property in the links array so when a node was selected it showed the percentages…makes more sense I think when there are links crossing each other the labels sit on top of one another…I just changed to “obj.part.data.weight”. Thanks again