I want to apply effects (basically just a change in the fill) to all nodes which are not part of the diagram’s selection, but only when the diagram has at least one node selected. I’ve tried binding to isSelected…
new go.Binding('fill', 'isSelected', (selected, obj: go.Part) => {
const shouldHighlight = // ... logic for highlighting
return shouldHighlight ? getHighlightColor(myColor, obj.part) : myColor
}).ofObject()
…which seems to fire when the node itself has its selection changed, but not when other nodes’ selection changes. What’s an appropriate way to apply these highlights to a node when the selection of another node changes?
Do I need to keep track in the diagram’s ChangedSelection
handler and apply changes to the model that I can then bind to? Or is there a better way?
thanks!