DgrmJS Example
This is a minimalistic example of using the DgrmJS library.
View example on-line.
DgrmJS is a JavaScript library for creating SVG diagram editors.
DgrmJS GitHub.
This example shows, how to
- Install DgrmJS library from npm.
- Create a shape with one In-Connector and one Out-Connector.
- Add shapes to diagram, update shape, delete shape from diagram.
- Connect shapes with code.
- Subscribe to diagram events.
Run example
Clone repository.
Install dependencies:
npm i
Run:
npm run start
How to create the same project yourself
Create directory for the project. Go to project directory.
Init node project:
npm init
Install DgrmJs library from npm:
npm i dgrm
This example uses Live Server as development http server.
Install 'Live Server':
npm install --save-dev live-server
Add 'start' script to the package.json:
"scripts": {
"start": "live-server"
},
Add index.html file to the project directory.
Run:
npm run start