Skip to content

Commit

Permalink
[REFACTOR] Projects use the exported mxgraph object (#449)
Browse files Browse the repository at this point in the history
Avoid redefining the mxgraph context object in the projects. Use th object exported by bpmn-visualization as of version 0.30.0.
  • Loading branch information
tbouffard authored Feb 6, 2023
1 parent 5c385a1 commit b267ea7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 28 deletions.
4 changes: 1 addition & 3 deletions projects/typescript-vanilla-with-parcel/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { BpmnVisualization, FitType } from "bpmn-visualization";
import { mxgraph, BpmnVisualization, FitType } from "bpmn-visualization";
// BPMN diagram content conveniently retrieved with parcel (as string)
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from "bundle-text:./diagram.bpmn";
import "./styles.css";
// put this import after the 'BpmnVisualization' import to ensure mxGraph is correctly configured by bpmn-visualization
import { mxgraph } from "./mxgraph-initializer";

// 'bpmn-visualization' API documentation: https://process-analytics.github.io/bpmn-visualization-js/api/index.html
const bpmnVisualization = new BpmnVisualization({
Expand Down
11 changes: 0 additions & 11 deletions projects/typescript-vanilla-with-parcel/src/mxgraph-initializer.ts

This file was deleted.

4 changes: 1 addition & 3 deletions projects/typescript-vanilla-with-vitejs/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import './style.css'
// this is simple example of the BPMN diagram, loaded as string. The '?.raw' extension support is provided by Vite.
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from './diagram.bpmn?raw'
import { BpmnVisualization } from 'bpmn-visualization';
// put this import after the 'BpmnVisualization' import to ensure mxGraph is correctly configured by bpmn-visualization
import { mxgraph } from "./mxgraph-initializer";
import { mxgraph, BpmnVisualization } from 'bpmn-visualization';

// instantiate BpmnVisualization, pass the container HTMLElement - present in index.html
const bpmnVisualization = new BpmnVisualization({
Expand Down
11 changes: 0 additions & 11 deletions projects/typescript-vanilla-with-vitejs/src/mxgraph-initializer.ts

This file was deleted.

0 comments on commit b267ea7

Please sign in to comment.