diagrams.mbt
Read diagram source. Build typed models. Render SVG and offline players.
A MoonBit library for Mermaid sequence, swimlane, ZenUML and architecture diagrams, BPMN documents, and native PlantUML regex, EBNF, JSON and YAML blocks.
Get started with Mermaid · Explore the gallery · Read the docs · Diagram families · Browse the API
Diagram families
| Family | What you can build | Guide |
|---|---|---|
| Sequence | Participants, messages, grouped frames and explicit finite scenarios. | Mermaid sequence |
| Swimlane | Responsibility bands and directed interactions in four directions. | Mermaid swimlane-beta |
| ZenUML | Annotated interactions, exceptions and typed participant symbols. | Mermaid ZenUML |
| Architecture | Groups, services, ports and connections with offline exploration. | Mermaid architecture |
| BPMN | Portable documents, process and collaboration SVG, supplied or automatic geometry. | BPMN and animation |
| Regex | Railroad diagrams for patterns, with optional externally supplied match evidence. | PlantUML regex |
| EBNF | Grammar railroads, rule references and externally supplied parse evidence. | PlantUML EBNF |
| JSON and YAML | Data trees with themed SVG and offline structural exploration. | PlantUML data blocks |
Portable models and output
The libraries build for wasm, wasm-gc, JavaScript and native targets. SVG output needs no scripts. Offline players add playback and bounded structural exploration without a server.
Diagram illustration does not execute a process or simulate BPMN tokens. Regex and EBNF traces describe evidence supplied by an external engine. Choreography and conversation documents are retained and validated; their rendering is deferred.
General PlantUML diagrams, Draw.io and Graphviz DOT are planned. The design overview explains the document, model and rendering boundaries.