how to limit the scroll of the diagram?


#1

I need to limit the scroll of the diagram to prevent it from leaving the canvas as seen in the image.

Captura

I checked the MoveCanvas module of diagram-js but I’m not finding the solution. Any ideas?


#2

MoveCanvas is not the right place. Have a look at Canvas#scroll and probably also Canvas#viewbox.