How to center the BPMN graph in the viewer?

Hello, there are some problems with my BPMN after using the following methods.

viewer.get(‘canvas’).zoom(‘fit-viewport’);

In this way, the BPMN diagram can indeed be rendered entirely in the container.
But the BPMN is too far to the left. How can we make the BPMN diagram in the container center left and right?

I haven’t found a way for a long time. I really need help. Thank you very much.

How far is too far? Screenshots would help a lot.

It’s not a matter of how far.What matters is how I can center the BPMN diagram.I mean the left-right one.t’s not like this:
viewer.get(‘canvas’).zoom(‘fit-viewport’);
Thank you for your reply。

this.modeler.get(‘canvas’).zoom(‘fit-viewport’, ‘auto’);

image

node_module/diagram-js/lib/core/Canvas.js 860 lines

Thank you very much. I solved it.