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.

Gerald

Hi Gerald,

you can check the source code of the starter diagram.
(view-source:https://rawgit.com/bpmn-io/bpmn-js-examples/master/starter/viewer.html)

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

     // zoom to fit full viewport
     canvas.zoom('fit-viewport');

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

Fabian