Diagrams
28 diagram engines rendered inline. Write syntax in a code fence, see the result immediately.
Overview
AgentsInFlow ships with 28 diagram engines that render directly inside the editor. Diagrams work everywhere content appears: ticket descriptions, notes, dashboard widgets, and assistant chat. Each engine has its own syntax, but the workflow is always the same — wrap your diagram code in a fenced code block tagged with the engine name, and the rendered diagram appears inline.
All 28 diagram types support zoom — pinch, scroll-wheel, and click-to-expand — across every context: dashboard widgets, markdown editors, ticket details, and file editors.
Architecture & Structure
Nine engines cover system design, UML, and database modeling.
| Engine | Code fence tag | Best for |
|---|---|---|
| Structurizr DSL | structurizr | C4 models (context, container, component, code) |
| PlantUML C4 | c4plantuml | C4 models with PlantUML syntax |
| D2 | d2 | General-purpose architecture with auto-layout |
| Graphviz | graphviz | Dependency graphs, call graphs, DAGs |
| PlantUML | plantuml | Class, component, and deployment diagrams |
| UMlet | umlet | Quick UML sketches — class, activity, state |
| Nomnoml | nomnoml | Simple class and object diagrams |
| ERD | erd | Entity-relationship diagrams |
| DBML | dbml | Database schema modeling with constraints |
Behavioral & Flow
Four engines for sequences, flowcharts, business processes, and activity workflows.
| Engine | Code fence tag | Best for |
|---|---|---|
| Mermaid | mermaid | Flowcharts, sequence diagrams, state machines, Gantt charts |
| BPMN | bpmn | Business process modeling — swimlanes, gateways, events |
| Actdiag | actdiag | Activity diagrams with step-by-step workflows |
| Seqdiag | seqdiag | Sequence diagrams with focused, simple syntax |
Network & Infrastructure
Four engines for network topology, packet layouts, server racks, and block diagrams.
| Engine | Code fence tag | Best for |
|---|---|---|
| Nwdiag | nwdiag | Network topology — hosts, subnets, connections |
| Packetdiag | packetdiag | Packet structure and protocol field layouts |
| Rackdiag | rackdiag | Server rack layouts and hardware placement |
| Blockdiag | blockdiag | Block diagrams for system overviews |
Hardware & Electrical
Four engines for timing diagrams, byte layouts, HDL symbols, and wiring harnesses.
| Engine | Code fence tag | Best for |
|---|---|---|
| WaveDrom | wavedrom | Digital timing diagrams and waveforms |
| Bytefield | bytefield | Binary data structure and protocol byte layouts |
| Symbolator | symbolator | HDL symbol diagrams from VHDL/Verilog |
| WireViz | wireviz | Wiring harness and cable assembly docs |
Visual & Freeform
Five engines for hand-drawn sketches, ASCII art conversion, and precise technical illustrations.
| Engine | Code fence tag | Best for |
|---|---|---|
| Excalidraw | excalidraw | Hand-drawn style — whiteboard sketches, freeform layouts |
| Svgbob | svgbob | ASCII art to SVG — quick inline diagrams from text art |
| Pikchr | pikchr | Precise technical diagrams with explicit positioning |
| Ditaa | ditaa | ASCII art to diagram — boxes and arrows from text |
| TikZ | tikz | Publication-quality technical and mathematical diagrams |
Data Visualization
Three engines for statistical charts and data-driven graphics. ECharts is the preferred engine for charts — see Editor & Diagrams for interactive chart widget details.
| Engine | Code fence tag | Best for |
|---|---|---|
| Apache ECharts | echarts | Bar, line, pie, scatter, area, donut charts (preferred) |
| Vega | vega | Complex data visualizations with full grammar of graphics |
| Vega-Lite | vegalite | Concise statistical charts — bar, line, scatter, heatmap |
Writing Diagram Syntax
Create a fenced code block and set the language tag to the engine name. The renderer picks it up automatically.
Mermaid — Flowchart
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[End]
C --> D
```D2 — Architecture
```d2
web: Web Server
api: API Gateway
db: PostgreSQL
web -> api: REST
api -> db: queries
```PlantUML — Sequence
```plantuml
@startuml
Client -> Server: Request
Server -> Database: Query
Database --> Server: Result
Server --> Client: Response
@enduml
```Graphviz — Dependency Graph
```graphviz
digraph {
rankdir=LR
A -> B -> C
A -> D -> C
}
```The app canvas uses a dark background. All diagram engines automatically apply dark-safe themes so lines, text, and labels remain readable.
Live Preview
Diagrams render inline as you type. The editor detects the code fence language tag, compiles the source through the matching engine, and replaces the code block with the rendered SVG or canvas output. Editing the source updates the preview in real time.
Open a code fence block and set the language tag (e.g. mermaid)
Write or paste your diagram syntax
Close the code fence — the rendered diagram appears immediately
Click the diagram to toggle back to source for editing
Diagrams in Tickets & Dashboards
Diagrams are not limited to the editor. They render anywhere markdown content is displayed.
Ticket Descriptions
Add a diagram code fence to any ticket description or note. When the ticket is viewed on the Kanban board or in the inspector, the diagram renders inline with full zoom support.
Dashboard Widgets
Dashboard widgets accept diagram content directly. Create a widget with the diagram content type, specify the engine language and source, and the diagram renders inside the widget grid. Widgets are resizable and the diagram scales accordingly.
Assistant Chat
AI assistants can generate diagrams directly in chat responses. When an assistant produces a code fence with a recognized engine tag, the diagram renders inline in the conversation. This is useful for architecture discussions, flow explanations, and design reviews.
Diagrams in dashboard widgets and ticket descriptions support the same zoom and interaction controls as the editor. See Work Management for ticket details and Editor & Diagrams for editor-specific features.
Selecting the Right Engine
Use this quick reference to pick the best engine for your task.
| Use case | Recommended engine |
|---|---|
| System architecture (containers, services) | structurizr |
| Code-level structure (classes, modules) | plantuml |
| Sequence / async flows | mermaid |
| State machines | mermaid or plantuml |
| Database schema | erd or dbml |
| Dependency / call graphs | graphviz |
| Network topology | nwdiag |
| Quick sketch / whiteboard | excalidraw |
| Statistical charts / metrics | echarts |
| Complex data grammar | vegalite |
Exporting Diagrams
Every rendered diagram can be exported for use outside AgentsInFlow. Right-click (or long-press on touch) a rendered diagram to open the context menu.
- Copy as SVG — vector output, ideal for documents and presentations
- Copy as PNG — raster output for quick sharing in chat or email
- Copy source — copies the raw diagram syntax to your clipboard
- Save to file — exports the diagram as an SVG or PNG file to disk