BPMN-IO issue: Cannot attach diagram to Canvas

Hi
I try to display a diagram using BpmnViewer from bpmn.io.
If I use

   <div class="content" id="js-drop-zone">
      <div id="diagramCanvas"></div>
   </div>

with

var BpmnViewer = window.BpmnJS; var viewer = new BpmnViewer({ container: '#diagramCanvas' });

everything works fine and the diagram is getting displayed.

But than I read the follwoing blog https://bpmn.io/blog/posts/2017-bpmn-js-0-20.html where it was mentioned, that the viewer can now be attached to any element in the DOM.
So I tried to attach the viewer to a canvas, but all I get is an empty area

My code is:

  <canvas id="canvas" width="800" height="500" style="border:1px solid #000000;"></canvas>

and

var BpmnViewer = window.BpmnJS; // create detached var viewer = new BpmnViewer(); // attach it to some element viewer.attachTo('#canvas');

Where is my mistake?
Thanks and best regards, Roland

Hi Roland,

Please ask this on https://forum.bpmn.io.

Cheers,
Thorben

Ok
sorry about the confusion
see: https://forum.bpmn.io/t/bpmn-io-issue-cannot-attach-diagram-to-canvas/1648

1 Like