Scroll to selected node

Hi ,

I have a filter , which will show all the node list.(lets say drop-down list) on select of node from the list , it will highlight the nodes which have same name in charts.

Is there any way to scroll to the selected node ?

Take a look at the Org Chart (static) sample, Org Chart Static and try searching for some string in the sample’s search box.

Note how a set of nodes are highlighted. GoJS Highlighting -- Northwoods Software

Note how the code centers the viewport on the first highlighted node. Diagram | GoJS API

Note how the user can scroll to each highlighted node sequentially by pressing the space key. CommandHandler | GoJS API

I have tried with following :

  1. myDiagram.scrollToPart(
  2. myDiagram.commandHandler.scrollToPart();

None of them is scrolling to the selected node or highlighted node.
Can you share any sample eg:

Doesn’t the Org Chart (static) sample demonstrate exactly what I said it does?

If the chosen Part is close to the edge of the Diagram.documentBounds, it might not be possible to scroll far enough to actually center the Part in the viewport. But it will be within the viewport.

I have tried to implement using findNodesByExample, which is not working for me.

So, I have tried with the selected node itself, still not scrolling to the position where the node is located.
eg: diagram.centerRect (node.actualBounds) which is returning the below .

From the org chart example it seems to be returning
Any samples with scroll to feature for the selected or highlighted node ?

One problem that I just noticed in your code: you should not have any Parts in your model data. Or any references to GraphObjects or Diagram or Layer or Tool or CommandHandler.