Comparing version 0.1.1 to 0.1.2
@@ -865,3 +865,3 @@ var bpmnModule = require('../di').defaultModule; | ||
}); | ||
return task; | ||
@@ -1128,3 +1128,2 @@ }, | ||
} | ||
console.log(source); | ||
} | ||
@@ -1414,3 +1413,2 @@ } | ||
'AdhocMarker': function(p, data, position) { | ||
console.log(data); | ||
var loopPath = pathMap.getScaledPath('MARKER_ADHOC', { | ||
@@ -1417,0 +1415,0 @@ xScaleFactor: 1, |
@@ -20,5 +20,8 @@ var Diagram = require('diagram-js'), | ||
function getSvgNode(diagram) { | ||
function getSvgContents(diagram) { | ||
var paper = diagram.get('canvas').getPaper(); | ||
return paper.node; | ||
var outerNode = paper.node.parentNode; | ||
var svg = outerNode.innerHTML; | ||
return svg.replace(/^<svg[^>]>|<\/svg>$/, ''); | ||
} | ||
@@ -135,6 +138,5 @@ | ||
var svgNode = getSvgNode(this.diagram); | ||
var svg = svgNode.innerHTML; | ||
var svgContents = getSvgContents(this.diagram); | ||
svg = SVG_HEADER + svg + SVG_FOOTER; | ||
var svg = SVG_HEADER + svgContents + SVG_FOOTER; | ||
@@ -141,0 +143,0 @@ done(null, svg); |
{ | ||
"name": "bpmn-js", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A bpmn 2.0 toolkit and web modeler", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -9,2 +9,31 @@ # bpmn-js - BPMN 2.0 diagrams for the web | ||
## Usage | ||
Get the library via [npm](http://npmjs.org) | ||
``` | ||
npm install --save bpmn-js | ||
``` | ||
Use it in your project | ||
```javascript | ||
var BpmnViewer = require('bpmn-js').Viewer; | ||
var xml; // my BPMN 2.0 xml | ||
var viewer = new BpmnViewer({ container: 'body' }); | ||
viewer.importXML(xml, function(err) { | ||
if (err) { | ||
console.log('error rendering', err); | ||
} else { | ||
console.log('rendered'); | ||
} | ||
}); | ||
``` | ||
Make sure to bundle the project for the browser, e.g. by using [browserify](http://browserify.org). | ||
## Resources | ||
@@ -11,0 +40,0 @@ |
@@ -91,2 +91,5 @@ var fs = require('fs'); | ||
// ensure correct rendering of SVG contents | ||
expect(svg.indexOf('undefined')).toBe(-1); | ||
done(); | ||
@@ -93,0 +96,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
809324
3464
52