Center a node while in a group

Hi,
My diagram could contain lots of elements, where some of them are groups.
If the user wants to search for a particular node i use the

diagram.centerRect(node.actualBounds);
diagram.select(node);

Yet, if the node is in a group (could be nested groups), and the node location is outside the diagram bounds (namely the node position is (1000,1000) while the diagram div width and height are width:800px; height:800px).
even if i programmatic expand the group, gojs does not center the node.
The user has to scroll down to position (1000,1000) to see it.
By the way, if the group is already expanded, gojs does jump to the node location and it is seen.
Please advise.

Yes, you need to expand any collapsed containing groups and expand any collapsed tree parent nodes. We should create or modify a sample to do all that.

I wonder if we should extend the behavior of CommandHandler | GoJS API to do all that.

I tried to call scrollToPart.
Same behavior…
Any workaround ?
Are you going to issue a fix sometimes ?

Expanding subgraphs and trees is not a feature of CommandHandler.scrollToPart and certainly not of Diagram.scrollToRect.

You need to do those expansions yourself. And you need to tell it to scroll after the node is visible and any layout has completed. This is obviously true when animation is involved, but is true even if animation is disabled.

This last requirement – that the expansions have been completed before scrolling to the node – is what requires some programming and that I am considering as a future extension of the behavior of CommandHandler.scrollToPart. One way to implement that is to scroll in a “LayoutCompleted” DiagramEvent listener.