Highlighting not connected nodes in a tree

Hi, I’m trying to highlight some nodes that contains a concrete word. The problem is that every example of highlighting I found is based on connected nodes or mouse events (mouseEnter, mouseLeave) but I need to change the color of the matching nodes by clicking a button outside the canvas. So my real problem is: how can I traverse all the nodes in the diagram for checking that property and finally changing their color?

I can traverse the json specified in “nodeDataArray”: nodes, but I can not change their style directly. Any idea??

Thanks in advance!

Yes, you can do what you suggest. But it would be easier to iterate through the Diagram.nodes to look at their Node.data.

Consider instead using Diagram.findNodesByExample, Diagram | GoJS API. There is an example of this in the Org Chart (static) sample: Org Chart Static. Look at the searchDiagram function.

Thanks! It is very useful!