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

FamilyWhat you can buildGuide
SequenceParticipants, messages, grouped frames and explicit finite scenarios.Mermaid sequence
SwimlaneResponsibility bands and directed interactions in four directions.Mermaid swimlane-beta
ZenUMLAnnotated interactions, exceptions and typed participant symbols.Mermaid ZenUML
ArchitectureGroups, services, ports and connections with offline exploration.Mermaid architecture
BPMNPortable documents, process and collaboration SVG, supplied or automatic geometry.BPMN and animation
RegexRailroad diagrams for patterns, with optional externally supplied match evidence.PlantUML regex
EBNFGrammar railroads, rule references and externally supplied parse evidence.PlantUML EBNF
JSON and YAMLData trees with themed SVG and offline structural exploration.PlantUML data blocks
A review workflow with responsibility bands and a return interaction
A native swimlane diagram rendered by diagrams.mbt. Read the source or open its offline player.

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.

Source on GitHub · Contribute documentation and examples