Creates a new instance of the Diagram Viewer.
Readonly
settingsDiagram settings.
Zoom level steps the interactive zoom controls go through.
Configures auto-scaling behavior.
none
- no auto-scalingdown
(default) - auto-scales the diagram down when it doesn't fit into the controlup
- auto-scales the diagram to the largest size fitting into the control but not smaller than 100%both
- keeps diagram at maximum size that fits into the control1.1.0
Returns whether diagram stencils should fade in after loading
1.2.0
Sets whether diagram stencils should fade in after loading
1.2.0
Returns currently active StencilSet.
Sets current StencilSet.
Returns whether toolbar is visible (enabled)
1.2.0
Sets whether toolbar is visible (enabled)
1.2.0
Gets the current zoom level of the control (1 is 100%).
Set the zoom level of the contrl (1 is 100%).
Optional
options: boolean | AddEventListenerOptionsOptional
options: boolean | AddEventListenerOptionsOptional
options: boolean | EventListenerOptionsOptional
options: boolean | EventListenerOptionsDisplays a previously saved diagram.
Make sure to set the correct corresponding stencilSet before
calling show()
.
diagram configration object.
Generated using TypeDoc
DiagramViewer is the main diagram viewing web component of the MJS Diagram library.
You add an instance of DiagramViewer to your page to display dynamic and interactive diagrams created either with DiagramEditor or in code.
You can add it in your HTML markup as a custom element with something like this:
Or you can add it in code.
One important thing to set when the component loads is the StencilSet you want to use.
Here we add a Flowchart stencil set:
You display previously saved or created state by passing it to the show method.
See
Check out MJS Diagram docs and demos for more details.