{"_id":"@bptlab/openbpt-modeler-petri-net","_rev":"3-6ca7aa248c3d69e150c90a713c727615","name":"@bptlab/openbpt-modeler-petri-net","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@bptlab/openbpt-modeler-petri-net","version":"1.0.0","keywords":["Petri net","modeler","modeling","pnml","diagram-js"],"author":{"name":"Maximilian König"},"license":"MIT","_id":"@bptlab/openbpt-modeler-petri-net@1.0.0","maintainers":[{"name":"maximiliankoenig","email":"maximilian.koenig@hpi.de"},{"name":"bpt-lab","email":"bptlab@hpi.de"},{"name":"t-lichtenstein","email":"lichtenstein-t@web.de"}],"homepage":"https://github.com/MaximilianKoenig/ptn-js#readme","bugs":{"url":"https://github.com/MaximilianKoenig/ptn-js/issues"},"dist":{"shasum":"88f9b3fec5b2c15a6537c253dca44082a265e56f","tarball":"https://registry.npmjs.org/@bptlab/openbpt-modeler-petri-net/-/openbpt-modeler-petri-net-1.0.0.tgz","fileCount":99,"integrity":"sha512-6gxCBlIFKXXc39r928XTi3DIeYZ+9/cKZa649lMjZFtS8LT9rcb6coLsKtnBfYhtD9Q+KciQFJRgZobS0RN7Zg==","signatures":[{"sig":"MEUCIQCsBdSaalRMTKUPVES8KQce8CC4UrcUTer/OC2OXdBKtQIgLdGJQe7sKXSKxK/z1YlfGoPFFE8i3+AIssb7nFGglbU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":243680},"main":"index.js","gitHead":"27cf6655c1a794a425a7d7498283a278f11ab412","scripts":{"lint":"eslint . --ext .js","format":"prettier --write .","lint:fix":"eslint . --ext .js --fix"},"_npmUser":{"name":"maximiliankoenig","email":"maximilian.koenig@hpi.de"},"repository":{"url":"git+https://github.com/MaximilianKoenig/ptn-js.git","type":"git"},"_npmVersion":"11.4.2","description":"Petri net modeling tool based on diagram-js for viewing and editing Petri nets in the browser. Supports the import and export of .pnml files.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ids":"^1.0.5","jquery":"^3.7.1","moddle":"^7.2.0","min-dom":"^5.1.1","inherits":"^2.0.4","min-dash":"^4.2.3","tiny-svg":"^4.1.3","bpmn-font":"^0.12.1","diagram-js":"^15.3.0","moddle-xml":"^11.0.0","object-refs":"^0.4.0","pnml-moddle-converter":"^1.0.1","diagram-js-direct-editing":"^3.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.35.0","prettier":"^3.6.2","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/openbpt-modeler-petri-net_1.0.0_1758026464076_0.30729611797254286","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bptlab/openbpt-modeler-petri-net","version":"1.0.1","keywords":["Petri net","modeler","modeling","pnml","diagram-js"],"author":{"name":"Maximilian König"},"license":"MIT","_id":"@bptlab/openbpt-modeler-petri-net@1.0.1","maintainers":[{"name":"maximiliankoenig","email":"maximilian.koenig@hpi.de"},{"name":"bpt-lab","email":"bptlab@hpi.de"},{"name":"t-lichtenstein","email":"lichtenstein-t@web.de"}],"homepage":"https://github.com/MaximilianKoenig/ptn-js#readme","bugs":{"url":"https://github.com/MaximilianKoenig/ptn-js/issues"},"dist":{"shasum":"485f06c31188a557d974834db1501b51fd55c81b","tarball":"https://registry.npmjs.org/@bptlab/openbpt-modeler-petri-net/-/openbpt-modeler-petri-net-1.0.1.tgz","fileCount":99,"integrity":"sha512-lNXyfPRfIdGoBPAYyXJ0jJOB6pvy6f+UtOhCIszh6SkTQkoD9SWGHJSbPvgQ/Gg8Oh2p5WaEc7GeUhty+q+gPw==","signatures":[{"sig":"MEUCIDJV4wMfY8ANkjA8wgXNE5JqbyLfOslQRbnRaAnD/kw1AiEA4rZjByJOLp/1XMRgiBx6yHK/tgYO45Eqp3ThjraoCFY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":243661},"main":"index.js","gitHead":"cb4c577073c0360e0c813d12f0086193cf701d0a","scripts":{"lint":"eslint . --ext .js","format":"prettier --write .","lint:fix":"eslint . --ext .js --fix"},"_npmUser":{"name":"maximiliankoenig","email":"maximilian.koenig@hpi.de"},"repository":{"url":"git+https://github.com/MaximilianKoenig/ptn-js.git","type":"git"},"_npmVersion":"11.4.2","description":"Petri net modeling tool based on diagram-js for viewing and editing Petri nets in the browser. Supports the import and export of .pnml files.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"ids":"^1.0.5","jquery":"^3.7.1","moddle":"^7.2.0","min-dom":"^5.1.1","inherits":"^2.0.4","min-dash":"^4.2.3","tiny-svg":"^4.1.3","bpmn-font":"^0.12.1","diagram-js":"^15.3.0","moddle-xml":"^11.0.0","object-refs":"^0.4.0","pnml-moddle-converter":"^1.0.1","diagram-js-direct-editing":"^3.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.35.0","prettier":"^3.6.2","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/openbpt-modeler-petri-net_1.0.1_1758029346534_0.1862789358558654","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bptlab/openbpt-modeler-petri-net","version":"1.0.2","description":"Petri net modeling tool based on diagram-js for viewing and editing Petri nets in the browser. Supports the import and export of .pnml files.","repository":{"type":"git","url":"git+https://github.com/MaximilianKoenig/ptn-js.git"},"publishConfig":{"access":"public"},"author":{"name":"Maximilian König"},"license":"MIT","keywords":["Petri net","modeler","modeling","pnml","diagram-js"],"main":"index.js","scripts":{"lint":"eslint . --ext .js","lint:fix":"eslint . --ext .js --fix","format":"prettier --write ."},"dependencies":{"bpmn-font":"^0.12.1","diagram-js":"^15.5.0","diagram-js-direct-editing":"^3.2.0","ids":"^1.0.5","inherits":"^2.0.4","jquery":"^3.7.1","min-dash":"^4.2.3","min-dom":"^5.1.2","moddle":"^7.2.0","moddle-xml":"^11.0.0","object-refs":"^0.4.0","pnml-moddle-converter":"^1.0.2","tiny-svg":"^4.1.4"},"devDependencies":{"eslint":"^9.39.2","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","prettier":"^3.7.4"},"_id":"@bptlab/openbpt-modeler-petri-net@1.0.2","gitHead":"077d0cc316075bc0caaa2549fd9c3e4b2ff3e885","bugs":{"url":"https://github.com/MaximilianKoenig/ptn-js/issues"},"homepage":"https://github.com/MaximilianKoenig/ptn-js#readme","_nodeVersion":"22.14.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-u1E1ywuk6hlewyrUYuLEg9FRPfoUeB6KTOVNDwmnKBQSUgiwV4+igvkZyKrjgj39K+dw41WEY0tvzIFU/0Pt9A==","shasum":"814d3e1652a347902ce482c57a1dcaa1b8a67c5d","tarball":"https://registry.npmjs.org/@bptlab/openbpt-modeler-petri-net/-/openbpt-modeler-petri-net-1.0.2.tgz","fileCount":99,"unpackedSize":243661,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICi4coNCbEZc6lwkLaauucIhFxPl8EQd0jYMafYi79hxAiB7eUwDf3kPDFMUtBnRR4kp0WYFDfzfKKVjVK3k3PSxxg=="}]},"_npmUser":{"name":"maximiliankoenig","email":"maximilian.koenig@hpi.de"},"directories":{},"maintainers":[{"name":"maximiliankoenig","email":"maximilian.koenig@hpi.de"},{"name":"bpt-lab","email":"bptlab@hpi.de"},{"name":"t-lichtenstein","email":"lichtenstein-t@web.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openbpt-modeler-petri-net_1.0.2_1767889229044_0.7250728871295191"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-16T12:41:03.942Z","modified":"2026-01-08T16:20:29.456Z","1.0.0":"2025-09-16T12:41:04.251Z","1.0.1":"2025-09-16T13:29:06.741Z","1.0.2":"2026-01-08T16:20:29.218Z"},"bugs":{"url":"https://github.com/MaximilianKoenig/ptn-js/issues"},"author":{"name":"Maximilian König"},"license":"MIT","homepage":"https://github.com/MaximilianKoenig/ptn-js#readme","keywords":["Petri net","modeler","modeling","pnml","diagram-js"],"repository":{"type":"git","url":"git+https://github.com/MaximilianKoenig/ptn-js.git"},"description":"Petri net modeling tool based on diagram-js for viewing and editing Petri nets in the browser. Supports the import and export of .pnml files.","maintainers":[{"name":"maximiliankoenig","email":"maximilian.koenig@hpi.de"},{"name":"bpt-lab","email":"bptlab@hpi.de"},{"name":"t-lichtenstein","email":"lichtenstein-t@web.de"}],"readme":"# ptn-js\r\n\r\nPetri net modeling tool for viewing and editing Petri nets in the browser. Supports the import and export of .pnml files according to the [PNML standard](https://www.pnml.org/). Currently, only place transition nets are supported.\r\n\r\nThe tool is based on [diagram-js](https://github.com/bpmn-io/diagram-js) and took inspiration from [bpmn-js](https://github.com/bpmn-io/bpmn-js) and [fcm-js](https://github.com/bptlab/fCM-design-support).\r\n\r\n## Usage\r\n\r\nThe modeler is available as an npm package.\r\nIf you want to embed the modeler into your project, install the package as a dependency to your node project using:\r\n\r\n```bash\r\nnpm i --save ptn-js\r\n```\r\n\r\nTo integrate the modeler, create a ptn-js instance, bind it to the canvas, and import a model or create a new one.\r\n\r\n```javascript\r\nimport PnModeler from 'ptn-js/lib/Modeler';\r\nimport \"ptn-js/assets/pn-js.css\";\r\n\r\nconst xml = '...'; // your Petri net XML\r\nconst canvas = '...'; // the HTML element the modeler should use as canvas\r\nconst modeler = new PnModeler({\r\n  container: canvas,\r\n  keyboard: [\r\n    bindTo: canvas\r\n  ]\r\n});\r\n\r\nawait modeler.importXML(xml);\r\n// await modeler.createNew(); Alternatively, this creates an empty diagram\r\n// await modeler.importPNML(pnml); Or you can import a .pnml file\r\n\r\nconst xmlExport = (await modeler.saveXML()).xml;\r\nconst pnmlExport = await modeler.savePNML();\r\n```\r\n\r\nAn example can be found [here](https://github.com/MaximilianKoenig/ptn-js-demo).\r\n","readmeFilename":"README.md"}