Synchronized scrolling in GOJS

Question: Is it possible to synchronise scrolling between two diagrams.

Scenario: I have 2 divs on the same page each containing a diagram. Their contents must be vertically aligned. The diagram bounds may exceed the size of the div therefore the diagrams will need to scroll. For vertical scrolling I will set only one diagram to show a vertical scroll bar. When this diagram is scrolled I require the other to be scrolled such that it feels simultaneous to the user.

Any tips ? I searched the Form in GOJS category for synchronized scrolling but received no hits. Thanks.

Implement a “ViewportBoundsChanged” DiagramEvent listener to change the Diagram.position of the other Diagram. If you implement a listener in both diagrams you may need to implement a check to make sure you don’t cause undesirable recursion.

Thanks Walter, perfect answer.