AlexeyBoiko / DgrmJS

Dgrm.net - flowchart editor. Works on desktop, phone and tablet. Has no dependency. Pure JavaScript.
https://dgrm.net
Apache License 2.0
913 stars 83 forks source link

DgrmJS dispatch events, developers can use these events to implement their own logic, for example, make a JSON description of the workflow? #31

Closed chinsenglow closed 1 year ago

chinsenglow commented 1 year ago

From your write up, it says

https://medium.com/codex/javascript-svg-diagram-editor-which-weighs-6-5-less-than-bootstrap-open-source-library-b753feaaf835

DgrmJS dispatch events, like ‘shape is selected’ or ‘shape is connecting to another shape’. Developers can use these events to implement their own logic, for example, make a JSON description of the workflow.

Can please help to give an sample code on how to use these events? Can please help to give an sample code on how to implement own logic to generate json description of the workflow?

AlexeyBoiko commented 1 year ago

Thanks for your interest in the dgrm.

how to use these events?

It is old article, now there are no events.

For json serialization please see https://github.com/AlexeyBoiko/DgrmJS/blob/main/src/diagram/dgrm-serialization.js

Please note: source code in this repo is different from https://app.dgrm.net/ . app.dgrm.net has pro features like "undo/redo".