Go JS Diagram Position Focus

Hi When ever i draw diagram the position of the node is loading to center after saved. I have save the node with location as well.I have tried the below approach

res.diagramNodeData.forEach((node) =>
{
DiagramHelper.savedNodePositions.set(node, node.Location);
});

in the diagram helper i am setting like this
public static savedNodePositions: go.Map<go.Node, go.Point> = new go.Map<go.Node, go.Point>();

But it didnt work for me , could you pls help me on this.

Has the diagram been scrolled?

Could you please check the value of Diagram.position before saving and after loading?

If those have changed and you want to save it in the model, look at the Draggable Link sample, Draggable Link
Examine the saveDiagramProperties and loadDiagramProperties functions and when they are called. Due to initial loading side-effects it’s important to set Diagram.initialPosition before actually loading the model, so that it has the desired scroll position after the load has completed.

Yes walter. The diagram scrolled.
before saving


After save it got scrolled like this

i am saving the locations in the Location property in the node object

So, what happens when you do as I suggested?

Without setting the position coudn’t make it. How i can set the view port of the diagram, set the position of the diagram. After initializing the pane position how can i update or reloading it while changing the diagram data.

That is all demonstrated in the Draggable Link sample that I referenced:
Draggable Link