Can I change the position of diagram programmatically?

I want to synchronize with the scrollbar of an external div.
So, I wrote the following code.

const s1 = document.getElementById('externalDiv')
s1.addEventListener('scroll', () => {
     myDiagram.position.x = s1.scrollLeft
})

I seem to be able to change the internal position.x, but it doesn’t seem to be working in the display.
Do I need to call a method to redraw?

I would be very happy if you could give me some hints.

You have to set the Diagram.position property.

myDiagram.position = new go.Point(s1.scrollLeft, myDiagram.position.y);

I was on a long vacation. I’m sorry for the late reply.
I have been able to get it working with the code you gave me.
Thank you very much.