How to use the bpmn-js/lib/NavigatedViewer function in bpmn-js

To help you get started, we’ve selected a few bpmn-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github evanyangg / vue-bpmn-modeler / packages / BpmnViewer / src / BpmnViewer.vue View on Github external
mounted() {
    this.taskList = this.taskData
    let bpmnViewer = new BpmnViewer({ container: this.$refs["canvas"] });
    let _self = this;
    bpmnViewer.importXML(this.xmlData, function(err) {
      if (err) {
        console.log('加载失败', err);
      } else {
        let canvas = bpmnViewer.get('canvas');
        canvas.zoom('fit-viewport')
        if (_self.taskList && _self.taskList.length > 0) {
          // let overlays = bpmnViewer.get('overlays');
          // let overlayHtml = document.createElement('div');
          // overlays.add('StartEvent_1', {
          //   position: {
          //     top: 0,
          //     right: 0,
          //   },
          //   html: overlayHtml
github bpmn-io / bpmn-js-examples / commenting / app / app.js View on Github external
import $ from 'jquery';


// require the viewer, make sure you added it to your project
// dependencies via npm install --save-dev bpmn-js
import BpmnViewer from 'bpmn-js/lib/NavigatedViewer';

import EmbeddedComments from 'bpmn-js-embedded-comments';

var viewer = new BpmnViewer({
  container: '#canvas',
  additionalModules: [
    EmbeddedComments
  ]
});


function openDiagram(diagram) {

  viewer.importXML(diagram, function(err) {
    if (err) {

      alert('could not import BPMN 2.0 XML, see console');
      return console.log('could not import BPMN 2.0 XML', err);
    }
github bpmn-io / bpmn-js-examples / overlays / app / app.js View on Github external
// we use stringify to inline an example XML document.
import qrDiagram from '../resources/qr-code.bpmn';

import BpmnViewer from 'bpmn-js/lib/NavigatedViewer';


var bpmnViewer = new BpmnViewer({
  container: '#canvas',
  /* uncomment to configure defaults for all overlays
  overlays: {
    defaults: {
      show: { minZoom: 1 },
      scale: true
    }
  }
  */
});


// import qr diagram

bpmnViewer.importXML(qrDiagram, function(err) {
github onap / so / so-monitoring / so-monitoring-ui / src / main / frontend / src / app / details / details.component.ts View on Github external
async ngOnInit() {
    this.bpmnViewer = new Viewer({
      container: '.canvas'
    });
    this.route.params.subscribe(
      async params => {
        this.processInstanceID = params.id as string;
        console.log("Will GET BpmnInfraRequest instance using id: " + this.processInstanceID);
        await this.getProcInstance(this.processInstanceID);

        this.getVarInst(this.processInstanceID);
      });
  }
github bpmn-io / bpmn-js-example-angular / bpmn-js-app / src / app / diagram / diagram.component.ts View on Github external
constructor(private http: HttpClient) {

    this.bpmnJS = new BpmnJS();

    this.bpmnJS.on('import.done', ({ error }) => {
      if (!error) {
        this.bpmnJS.get('canvas').zoom('fit-viewport');
      }
    });
  }