Viewer size in canvas

Hi, I have a question on defining the size of the rendered diagram inside a canvas.
Lets Say I have a canvas
this.viewer = new bpmn({
container: ‘#canvas

the canvas has the size of let’s say height: 70px and witdh: 150px.

How can I get the viewer to render the full diagramm wihtin the above sizes. I know, it might not be very well readable, but it would helpt to recorgnize it.


Hi Gerald,

you can check the source code of the starter diagram.

     // access viewer components
     var canvas = bpmnViewer.get('canvas');

     // zoom to fit full viewport

The canvas.zoom method is what you are probably looking for.