Then in your code configure it to use the flowchart stencil editor set:
import*asmjsdefrom"@markerjs/mjs-diagram/editor"; import*asflowchartfrom"@markerjs/mjs-diagram/stencilsets/flowchart/flowchart"; ... consteditor = document.getElementById("mjsDiaEditor"); editor.stencilEditorSet = flowchart.flowchartStencilEditorSet; editor.addEventListener("saveclick", (ev) => { // process the created diagram // the diagram state (configuration) is in ev.detail.state });
The
editor
module contains everything pertaining to diagram editing.The core class here is DiagramEditor. It represents the editor web component.
Example
Here's a basic scenario for adding a Flowchart editor on your page.
In the markup part add the diagram editor web component:
Then in your code configure it to use the flowchart stencil editor set: