UNPKG

2.18 kBMarkdownView Raw
1# cmmn-js - CMMN 1.1 for the web
2
3[![Build Status](https://travis-ci.org/bpmn-io/cmmn-js.svg?branch=develop)](https://travis-ci.org/bpmn-io/cmmn-js)
4
5View and edit CMMN 1.1 diagrams in the browser.
6
7
8## Installation
9
10Use the library [pre-packaged](https://github.com/bpmn-io/cmmn-js-examples/tree/master/pre-packaged)
11or include it [via npm](https://github.com/bpmn-io/cmmn-js-examples/tree/master/bundling)
12into your node-style web-application.
13
14## Usage
15
16To get started, create a [cmmn-js](https://github.com/bpmn-io/cmmn-js) instance
17and render [CMMN 1.1 diagrams](http://www.omg.org/spec/CMMN/1.1/) in the browser:
18
19```javascript
20var xml; // my CMMN 1.1 xml
21var viewer = new CmmnJS({
22 container: 'body'
23});
24
25viewer.importXML(xml, function(err) {
26
27 if (err) {
28 console.log('error rendering', err);
29 } else {
30 console.log('rendered');
31 }
32});
33```
34
35Checkout our [examples](https://github.com/bpmn-io/cmmn-js-examples) for many
36more supported usage scenarios.
37
38
39### Dynamic Attach/Detach
40
41You may attach or detach the viewer dynamically to any element on the page, too:
42
43```javascript
44var viewer = new CmmnJS();
45
46// attach it to some element
47viewer.attachTo('#container');
48
49// detach the panel
50viewer.detach();
51```
52
53
54## Resources
55
56* [Demo](http://demo.bpmn.io/cmmn)
57* [Issues](https://github.com/bpmn-io/cmmn-js/issues)
58* [Examples](https://github.com/bpmn-io/cmmn-js-examples)
59* [Forum](https://forum.bpmn.io)
60
61
62## Building the Project
63
64Perform the following steps to build the library, including running all tests:
65
66```
67cd cmmn-js
68npm install
69npm run all
70```
71
72You may need to perform [additional project setup](./docs/project/SETUP.md) when
73building the latest development snapshot.
74
75Please checkout our [contributing guidelines](./.github/CONTRIBUTING.md) if you plan to
76file an issue or pull request.
77
78
79## Related
80
81cmmn-js builds on top of a few additional powerful tools:
82
83* [cmmn-moddle](https://github.com/bpmn-io/cmmn-moddle): Read / write support for CMMN 1.1 XML in the browsers
84* [diagram-js](https://github.com/bpmn-io/diagram-js): Diagram rendering and editing toolkit
85
86
87## License
88
89Use under the terms of the [bpmn.io license](http://bpmn.io/license).