redfish4ktc / bpmn-visualization-js

A TypeScript library to visualize process execution data on BPMN diagrams

Home Page:https://process-analytics.github.io/bpmn-visualization-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BPMN Visualization


bpmn-visualization is a TypeScript library for visualizing process execution data on BPMN diagrams with:

  • additional display options for execution data (highlight some transitions, counters, and more)
  • interactive capacities (mouse hover, click)

๐ŸŽฎ Demo and examples

Please check the โฉ live environment.
You will find there basic usage as well as detailed examples showing possible rendering customizations.

๐ŸŽจ Features

The bpmn-visualization is in early development stage and is subject to change prior to the 1.0.0 release.

Already available features:

Planned features:

  • Library extension points

๐Ÿคฉ Why using bpmn-visualization?

  • โœจ True opensource license without watermark display
  • โšก๏ธ Strong identity: the only BPMN viewer with a woman icon in the User Tasks
  • ๐ŸŽธ Fully documented and with a lot of integration examples
  • ๐Ÿ‘“ Highly customizable rendering in a simple way
  • ๐Ÿ”ฅ TypeScript support
  • ๐ŸŽฏ Battle tested: high test coverage, thousands of tests, including tests on all supported browsers for Linux, macOS and Windows

๐ŸŒ Browsers Support

We do our best to support recent versions of major browsers

Chrome Chrome Firefox Firefox Safari Safari Edge Edge
โœ”๏ธ โœ”๏ธ โœ”๏ธ โœ”๏ธ

Notes:

  • Internet Explorer and Legacy Edge will never be supported.
  • Chromium based browsers should work (automatic tests are run with Chromium canary releases). In particular, the following browsers are known working with bpmn-visualization@0.23.0:
    • Brave 1.36.119
    • Chromium 100.0.4863.0
    • Opera 85.0.4341.18
  • The library may work with the other browsers. They must at least support ES6.

โ™ป๏ธ Usage

The library is available from NPM.
We support various module formats such as:

  • IIFE: dist/bpmn-visualization.js
  • ESM: dist/bpmn-visualization.esm.js
  • CommonJS: dist/bpmn-visualization.cjs.js

๐Ÿ“Œ Project usage

  • Install the dependency in your package.json file:
npm i bpmn-visualization
import { BpmnVisualization } from 'bpmn-visualization';

let bpmnContent; // your BPMN 2.0 XML content
// initialize BpmnVisualization and load the diagram
// 'bpmn-container' is the id of the HTMLElement that renders the BPMN Diagram
const bpmnVisualization = new BpmnVisualization({ container: 'bpmn-container' });
bpmnVisualization.load(bpmnContent);

You can set the BPMN content using one of the following ways:

  • Copy/Paste directly the XML content in a variable
  • Load it from an url, like this example
  • Load from your computer, like the demo example

๐Ÿ“œ TypeScript Support

bpmn-visualization provides type definitions, so the integration should work out of the box in TypeScript projects.

Depending on the build system used by the TypeScript project, it may get the following type errors

  • error TS2688: Cannot find type definition file for 'typed-mxgraph'
  • error TS7016: Could not find a declaration file for module 'mxgraph'

In this case,

  • Declare the typed-mxgraph types in the tsconfig.json as in the following (see the typeRoots documentation for more explanations) ๐Ÿ‘‡
{
  "compilerOptions": {
    "typeRoots": [
      "node_modules/@types",
      "node_modules/@typed-mxgraph"
    ]
  }
}

Alternatively, you can set skipLibCheck to true in the tsconfig.json file, but this limits the definition checks. For more details, see the skipLibCheck documentation.

Advanced users that want to extend the mxGraph integration must add typed-mxgraph to typeRoots.

For more details, see the TypeScript projects in the bpmn-visualization-examples repository.

๐Ÿ’  Browser usage

  • In the HTML page:
    • Load bpmn-visualization (replace {version} by the recent version)
    • Define the container that displays the BPMN diagram, here bpmn-container
    <script src="https://cdn.jsdelivr.net/npm/bpmn-visualization@{version}/dist/bpmn-visualization.min.js"></script>
    ...
    <div id="bpmn-container"></div>
  • Put this Javascript snippet within the HTML page
    let bpmnContent; // your BPMN 2.0 XML content
    // initialize BpmnVisualization and load the diagram
    const bpmnVisualization = new bpmnvisu.BpmnVisualization({ container: 'bpmn-container'});
    bpmnVisualization.load(bpmnContent);

๐Ÿ‘ค User documentation

The User documentation (with the feature list & the public API) is available in the documentation site.

โš’๏ธ More

๐Ÿ’ก Want to know more about bpmn-visualization usage and extensibility? Have a look at the โฉ live examples site.

For more technical details and how-to, go to the bpmn-visualization-examples repository.

๐Ÿ”ง Contributing

To contribute to bpmn-visualization, fork and clone this repository locally and commit your code on a separate branch.
Please write tests for your code before opening a pull-request:

npm run test  # run all unit & e2e tests

You can find more detail in our Contributing guide. Participation in this open source project is subject to a Code of Conduct.

โœจ A BIG thanks to all our contributors ๐Ÿ™‚

๐Ÿ“ƒ License

bpmn-visualization is released under the Apache 2.0 license.
Copyright ยฉ 2020-present, Bonitasoft S.A.

Some BPMN icons used by bpmn-visualization are derived from existing projects. See the BPMN Support documentation for more details:

โšก Powered by

statically.io logo

statically.io (demo and examples live environments)

surge.sh logo

surge.sh (demo and documentation preview environments)

About

A TypeScript library to visualize process execution data on BPMN diagrams

https://process-analytics.github.io/bpmn-visualization-js/

License:Apache License 2.0


Languages

Language:TypeScript 91.7%Language:JavaScript 4.5%Language:HTML 3.7%Language:CSS 0.1%Language:Shell 0.0%