Expanding the nodes on Searching but the node is already collapsed

Hi Walter,

I am using Layered digraph layout. In this I am using Expand and Collapse using Custom Expand Collapse
functionalities.
I want to search the node based on label or any other node data. I have also implemented that using orgChartStatic Example.

What my need here is, that when the node was collapsed and the user was searching the collapsed node, I have to expand the node branch.

In the above image second node (AP-3 was collapsed).
I am searching the Kids node and that have to expand on search like below screenshot.

Note : Even if I search K, it would expand the all nodes having K letter.

Please help me out this.

Are you using scrollToPart? CommandHandler | GoJS API
That will automatically expand trees and groups as needed.

That command is invoked by the space key, so if you have done something like that Org Chart static sample, the user can already cycle through all highlighted nodes by hitting the space bar repeatedly.

I have used layereddigraph layout and it’s not worked.
But now changed to tree layout and implemented scrollToPart. Worked as expected.

Can you please tell me the difference between tree and layereddigraph layout?

LayeredDigraphLayout works on any graph, not just on trees. With the custom expand/collapse functionality, the CommandHandler.scrollToPart command doesn’t know how to make a node visible, so you will have to do whatever is needed to make the node visible.

In that example, the command cannot decide which node to expand such that the desired node becomes visible.

Thanks Walter…