Disable diagram movement on scrollToPart

Hi,
I am trying to select a node at random from my tree table, but when the ScrollToPart on the selected Node I am seeing two issues -

ezgif-5-23db6bfe7f

  1. The diagram moves/jumps position
    I set "animationManager.isEnabled": false, but the position still changes
  2. When I select a node - I want the selection adornment to be over the entire row,

Here’s my code

function selectAtRandom() {
            const nda = myDiagram.model.nodeDataArray;
            const data = nda[Math.floor(Math.random() * (nda.length - 1)) + 1];
            if (data) {
                console.log(data);
                const node = myDiagram.findNodeForData(data);
                myDiagram.select(node);
                myDiagram.commandHandler.scrollToPart(node);
                //Doesn't animate and move node to center but also doesn't expand necessary node
                //myDiagram.scrollToRect(node);
                //myDiagram.centerRect(node);

            }
        }

Regards

Yes, CommandHandler.scrollToPart CommandHandler | GoJS API is documented to call Diagram.centerRect, which means it tries to scroll so that Part is centered in the viewport.

I suppose you want to call Diagram.scrollToRect instead. Be sure that the argument to methods whose names end with “Rect” is actually a Rect, not a Node or any kind of GraphObject. You can call GraphObject.getDocumentBounds to get a Rect in document coordinates. For Parts such as Nodes, the result will be the same as its actualBounds.