How to move a node at center of viewport?

I’m using genogram sample.

this’s my code:

const node = diagram.findNodeForKey(-43);

The node don’t center in the viewport. It should position the entry exactly center of viewport. Please help me for this case.

It might be that it cannot scroll far enough to put that particular node in the center of the viewport.

Please read:

So I have no way if I don’t change the scale value for this case, right?

A post was split to a new topic: Animating scrolling

Didn’t you read, setting Diagram.padding?
Or, setting Diagram.scrollMode or Diagram.scrollMargin?

I set Diagram.scrollMode is Diagram.InfiniteScroll. It worked. Thanks for your support.