# open-diagram: the docs and the pages of https://open-diagram.dev, as Markdown --- # Quick start Install open-diagram and draw your first diagram. ## Install ```bash pip install open-diagram ``` For the newest unreleased code: `pip install git+https://github.com/lukendeasy/open-diagram`. open-diagram needs Python 3.10 or later. pip installs the two packages it uses, fontTools and the MCP toolkit, for you. To make PNG files it also needs Google Chrome, Chromium or Microsoft Edge. If yours is not in the usual place, set the `CHROME` environment variable to its path. The SVG is always written, browser or not. For AI apps that use MCP, such as Claude Code: `claude mcp add open-diagram -- uvx open-diagram mcp`. Claude Desktop, Cursor, Amp, the agent skill and the apps it has been tested with are in [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md), with [a block to paste into your project's AGENTS.md](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md#tell-your-coding-agent-about-open-diagram) so your coding agent knows how to draw and check a diagram. ## Draw a diagram ```python from open_diagram import Diagram, Panel, Tile d = Diagram("How a search request is answered", tag="EXAMPLE") app = d.add(Panel("Web app", ["Search box", "Results page", "Filters"], footer="Owner: Web team")) api = d.right_of(app, Panel("Search API", [Tile("Checks access"), Tile("Caches results", status="building")], footer="Owner: Platform team"), align="center") index = d.right_of(api, Panel("Search index", ["Product text", Tile("Spelling fixes", status="planned")], status="planned"), align="center") d.link(app, api) d.link(api, index, kind="planned", label="new") d.save("quickstart") # writes quickstart.svg and quickstart.png ``` ![The quick start diagram](https://raw.githubusercontent.com/lukendeasy/open-diagram/main/docs/images/quickstart.png) The key at the top lists only the statuses and line kinds the picture uses. --- # Python Build a diagram from blocks, place them, and set its colors and sizes with a theme. ## Building blocks | Block | What it draws | | --- | --- | | `Panel(title, *sections, sub=, status=, step=, footer=, tone=)` | The main box: a colored header, sections stacked inside, an optional footer such as "Owner: Data team" | | `Tiles(items, cols=, label=)` | A grid of tiles with one cell size. A plain list of labels inside a `Panel` becomes `Tiles` | | `Tile(label, sub=, status=, icon=)` | One small box. `icon` takes a PNG or SVG file you supply; for AWS, Azure and Google Cloud, see [Cloud service icons](agents.md#cloud-service-icons) | | `Resource(label, icon=, sub=, icon_size=64, border=)` | A standalone cloud resource: large icon above its workload label and service name, with no panel or raised tile | | `Card(title, rows, intro=)` | A worked example: rows of name and value | | `Graph(nodes, links, at)` | Things on a grid, joined by labelled lines. The build reports labels that touch nodes | | `Row(*sections)` | Sections side by side inside a panel | | `Text(text)` | A wrapped paragraph | | `Note(title, *lines)` | A boxed note for the top right, such as "Draft" | | Diagram method | What it does | | --- | --- | | `Diagram(title, subtitle=, tag=, note=, theme=, legend=, steps=, routing=)` | Start a picture. `routing="orthogonal"` draws every line as straight runs that meet at right angles; the default, `"curved"`, draws smooth curves | | `add(block, x, y)` | Place a block at a position | | `right_of(ref, block, align=)` and `below(ref, block, align=)` | Place a block next to another, with the theme's gap | | `columns([[...], [...]])` and `stack([...])` | Place columns left to right, each one top to bottom | | `ring(blocks, center=[...])` | Place blocks around a circle, with optional blocks in the middle; returns both lists | | `group(label, members, sub=)` | A shaded, dashed area around some blocks | | `enclosure(label, members, border=, sub=, pad=, fill=, stroke=, style=, tone=)` | A boundary around resources or nested enclosures; `style="panel"` adds the original sloped lid and a filled header; borders are `solid`, `dashed` or `dotted`, independent of deployment state | | `link(a, b, kind=, label=, start=, end=, via_x=, via_y=, dash=, routing=)` | An arrow. `kind="planned"` is dotted. `dash` optionally overrides the stroke style. `start="auto"` and `end="auto"` pick the sides that face each other. `via_y` routes it through a lane, for example above everything. `routing` sets curved or right-angle for this line only | | `save(path)` | Write the SVG and PNG, print a summary, raise `LayoutError` if there are problems | | `render()` | Return the SVG text and a report without writing files | | `describe()` | Return what the picture says in plain words | | `set_statuses({name: state})` | Set states by panel title, id or tile label, for example from a file | ## Right-angle lines `Diagram(..., routing="orthogonal")` draws every line as straight runs that meet at right angles, with slightly rounded corners. When two blocks face each other and their sides overlap, the line runs straight across. Lines that would share the same gap each get their own track, 12 px apart, ordered so they cross as little as possible. The layout checks work the same way for both kinds of line. ## Statuses, colors and sizes Panels have light gray headers and yellow step numbers (charcoal instead when any panel uses the yellow `accent` header, so yellow keeps one meaning). Each panel has a sloped top and each tile a raised edge, for a light 3D look; `Theme(lid=0, depth=0)` turns it off. `tone="accent"` gives a panel a soft yellow header, and `tone="dark"` a charcoal one. Header text turns white by itself on a dark header. Statuses are shown by color and by word: Live, Being built, In trial, Planned and Retiring. Change them, or anything else, with a `Theme`: ```python from open_diagram import Diagram, Status, Theme theme = Theme(tones={"default": "#2B3036", "neutral": "#6A7078", "accent": "#FFC83D", "dark": "#111418"}) theme.statuses["pilot"] = Status("Pilot", stroke="#8E24AA", fill="#F6EDF9", dash="dashed") d = Diagram("My picture", theme=theme) ``` ## The picture explains itself `d.describe()`, or `open-diagram describe`, returns what the picture says in plain words: each block and its tiles with their states, the groups, every line and its label, and the key. The same text goes into the SVG as its description, so screen readers can read it. An agent can compare it with the request without looking at the picture. ```text - Processing [step 1]: Upload checks; Transcoding; GPU encoding (being built); Auto captions (planned). Owner: Media team - Video record -> Recommendations (connection to build) ``` --- # JSON Describe a diagram as plain data, from any language or agent. A small example: ```json { "title": "How an email is delivered", "columns": [ [{"id": "app", "title": "Mail app", "tiles": ["Write", "Send"], "cols": 1}], [{"id": "out", "title": "Sending server", "tiles": ["Queue", {"label": "Digital signature", "status": "building"}]}] ], "links": [{"from": "app", "to": "out"}] } ``` ![The JSON email example](https://raw.githubusercontent.com/lukendeasy/open-diagram/main/docs/images/email_delivery.png) | Part | Keys | | --- | --- | | Top level | `title` (required); one layout: `columns` (a list of columns, each a list of panels), `ring` (panels around a circle, with optional `center` and `start_angle`) or `panels` (each with `x` and `y`), or `resources` (alone or with `panels`); `enclosures`; `subtitle`, `tag`, `note` (`title`, `lines`), `steps` (`[[1, "First"]]`), `steps_label`, `gap`, `row_gap`, `valign`, `groups`, `links`, `statuses`, `theme`, `routing` (`curved`, the default, or `orthogonal`: straight runs that meet at right angles), `legend` (`false` hides the key) | | Panel | `title` (required), `id`, `sub`, `status`, `step`, `footer`, `tone`, `width`, `x` and `y` (in `panels` only), `tiles` with `cols` and `label`, or `sections` (each `{"tiles": [...]}`, `{"text": "..."}`, `{"card": {...}}`, `{"graph": {...}}` or `{"row": [...]}`) | | Tile | a string, or `{"label", "sub", "status", "icon"}` | | Resource | a large icon with its label under it: `label`, `x` and `y` (required), `id`, `sub` (the service name), `icon`, `icon_size`, `max_width`, `border` | | Enclosure | a box around resources, panels or other enclosures: `label` and `members` (required), `id`, `sub`, `pad`, `border` (`solid`, `dashed`, `dotted`), `style` (`outline` or `panel`), `fill`, `stroke`, `tone`; listed from the inside out | | Icon | a name inside an icon folder, such as `aws/s3`: the built-in icons, the JSON file's own folder, or a folder given with `--icons`. Full paths and `..` are refused | | Link | `from` and `to` (panel or resource ids), `kind` (`flow` or `planned`), `label`, `start` and `end` (a side, or `auto` for the side facing the other panel: the default in `ring` and `panels`), `lane` (`top` or `bottom`, to route around the picture), `via_x`, `via_y`, `cross_ok`, `dash` (`solid`, `dashed` or `dotted`, independent of state), `routing` (`curved` or `orthogonal`, for this link only) | | Group | `label`, `members` (panel ids), `sub` | Every mistake names its place, for example `columns[0][0].tiles[2]: unknown key(s) 'colour'`. From Python, use `from_spec(data)`. The full example is [`examples/email_delivery.json`](https://github.com/lukendeasy/open-diagram/blob/main/examples/email_delivery.json). ## Rings and free placement Cycles read best as a ring. Use `"ring"` instead of `"columns"`, optionally with panels in the `"center"`; links then leave from the sides that face each other. For any other shape, use `"panels"` and give each panel an `x` and `y`. In Python, the same is `d.ring(blocks, center=[...])` and `d.add(block, x, y)`, with `link(a, b, start="auto", end="auto")`. ![A release cycle drawn with the ring layout](https://raw.githubusercontent.com/lukendeasy/open-diagram/main/docs/images/release_cycle.png) The example is [`examples/release_cycle.json`](https://github.com/lukendeasy/open-diagram/blob/main/examples/release_cycle.json). --- # Mermaid Draw a Mermaid flowchart you already have, and see what changes. open-diagram lays the flowchart out again, with the same measuring and checks as any other diagram: ```bash open-diagram draw signup_flow.mmd ``` ![A Mermaid flowchart drawn by open-diagram](https://raw.githubusercontent.com/lukendeasy/open-diagram/main/docs/images/signup_flow.png) It reads `flowchart` and `graph` in any direction, nodes of any bracket shape, chains, `&`, edge labels, and front-matter titles. Dotted edges (`-.->`) become planned connections. Each top-level `subgraph` becomes a shaded group with its own band, so groups never cover other nodes. A class named like a state (`A:::building`, or `class A,B planned`) sets that state. Lines that skip a step or point backwards travel above or below the picture. From Python, use `from_mermaid(text)`. The example is [`examples/signup_flow.mmd`](https://github.com/lukendeasy/open-diagram/blob/main/examples/signup_flow.mmd). ## What carries over - `flowchart` and `graph`, with `LR`, `RL`, `TD`, `TB` or `BT`. `RL` and `BT` are drawn as the mirror image of `LR` and `TD`. - Nodes in any bracket shape, with or without quotes. - Chains (`A --> B --> C`) and `&` (`A & B --> C`). - Line labels: `-->|text|`, `-- text -->`, `-. text .->` and `== text ==>`. - Dotted lines (`-.->`) become connections still to build, drawn dotted. - Each top-level `subgraph` … `end` becomes a shaded group. - A class named after a state sets that state: `A:::building` or `class A,B planned`. The states are live, building, trial, planned and retiring. - A `title:` in the front matter. Without one the title is “Flowchart”, and `--title` sets it. - Mermaid's `curve` setting. `step`, `stepBefore` and `stepAfter` draw right-angle lines; any other curve draws smooth curves. It is read from the front matter (`config:` › `flowchart:` › `curve: step`) or from a `%%{init: {"flowchart": {"curve": "step"}}}%%` line. From Python, `from_mermaid(text, routing="orthogonal")` does the same. - `%%` comments, and `;` between statements. ## What changes - Every node is drawn as the same box. Diamonds, circles and other shapes are not kept. - `
` becomes a space, so a label written on several lines is drawn as one line, wrapped to fit. - Thick lines (`==>`), lines with no arrowhead (`---`), circle and cross ends (`--o`, `--x`) and two-way arrows (`<-->`) are all drawn as ordinary one-way arrows. - A subgraph inside another subgraph is merged into the outer one. - Class names that are not states are ignored, and so are styling lines: `classDef`, `style`, `linkStyle`, `click` and `direction`. - Markdown strings and icons such as `fa:fa-car` are shown exactly as typed. - open-diagram chooses the layout. Boxes go in steps by their longest path, and lines that skip a step or point backwards run in a lane above or below the picture. ## What it does not read - Other Mermaid diagram types, such as `sequenceDiagram`. The command stops and names the line. - The newer shape syntax, `A@{ shape: … }`. The command stops and names the node. - D2 files. open-diagram has no D2 reader. --- # Command line Draw, check and describe diagrams from a terminal or a CI job. ```bash open-diagram draw plan.json # writes plan.svg and plan.png; exits with 1 if the layout has problems open-diagram check docs/*.json # checks without writing files, for scripts and CI open-diagram describe plan.json # prints what the picture says, in plain words open-diagram new # lists the templates; `open-diagram new azure_web_app` writes one to start from open-diagram mcp # runs as an MCP server for AI apps; see docs/agents.md ``` Each command takes a JSON description (`.json`), a Mermaid flowchart (`.mmd` or `.mermaid`), or a Python script with a `build()` function that returns a `Diagram` (`.py`). Add `--statuses states.json` to set states by name before drawing, and `--icons FOLDER` to use your own icons in JSON. ## Keep diagrams from going stale Add this GitHub Action and every push checks your diagrams, or redraws them, and fails if a layout problem appears: ```yaml # .github/workflows/diagrams.yml name: diagrams on: [push, pull_request] jobs: diagrams: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: lukendeasy/open-diagram@v0.6.2 with: files: docs/diagrams/*.json docs/diagrams/*.mmd statuses: docs/states.json # optional; keep it outside the folders that files matches mode: check # or draw, to write SVG and PNG next to each file ``` Keep states in a small file, such as `{"Fraud checks": "live", "Parcel lockers": "building"}`. When work ships, change one word; the pictures follow. Names match panel titles, panel ids and tile labels, and `live` returns a part to the default look. From Python, use `d.set_statuses(...)`. Keep the states file out of the folders that `files` matches, or the Action reads it as a diagram and stops with `unknown key(s)`. One states file applies to every file in the run, so every name in it must be a part of each diagram: a name that one diagram lacks stops the run with `no panel or tile is named ...`. --- # AI agents Let Claude Code, Claude Desktop, Cursor or Amp draw diagrams and fix their layout problems. ## MCP server open-diagram can run as an MCP server: a small program that AI apps start on your computer, so the AI can draw diagrams as one of its own actions. Nothing is hosted and nothing leaves your computer. It accepts JSON and Mermaid only, never Python, and writes files only inside one output folder. The commands below use [uv](https://docs.astral.sh/uv/), which fetches open-diagram and the Python it needs (3.10 or later) the first time. **Claude Code** ```bash claude mcp add open-diagram -- uvx open-diagram mcp ``` **Claude Desktop** (`claude_desktop_config.json`) **or Cursor** (`~/.cursor/mcp.json`) ```json { "mcpServers": { "open-diagram": { "command": "uvx", "args": ["open-diagram", "mcp", "--out", "/Users/you/Documents/open-diagram"] } } } ``` **Amp** ```bash amp mcp add open-diagram -- uvx open-diagram mcp ``` Without uv: `pip install open-diagram`, then use `open-diagram` as the command and `mcp` as its first argument. Setups made before 0.6.2 with `--from "open-diagram[mcp]" open-diagram-mcp` keep working. uv keeps a copy of what it downloaded; to pick up a new release, add `--refresh` once after `uvx`. | Action | What the AI gets | | --- | --- | | `format_guide` | A JSON example to copy, every key, Mermaid support, and how to fix each kind of problem | | `check` | The layout problems, without writing files, so it can fix and retry quickly | | `draw` | Writes the SVG and PNG, and returns the problems, the file paths, the plain-words description and the picture itself | | `describe` | What the picture says, in plain words | | `template` | The list of templates, or one template as JSON to start from | Icons come only from the built-in icons and from folders you name with `--icons` (or the `OPEN_DIAGRAM_ICONS` environment variable), never from a path the AI writes. Files go to `--out`, else the `OPEN_DIAGRAM_OUT` environment variable, else an `open-diagram` folder where the app starts the server (or in your home folder if that one cannot be written). ### Tested with Tested on November 25, 2026, with open-diagram 0.6.2 on macOS, using the setup lines above. | App | Version | What was checked | | --- | --- | --- | | Claude Code | 2.1.332 | Claude called `format_guide`, `check` and `draw`; the SVG and PNG were written with 0 layout problems | | Claude Desktop | 6.28899.6 | The app found `uvx`, started the server and received its list of actions | | Cursor | 3.32.4 | Cursor connected and listed all 5 actions | | Amp | 0.0.1788357228 | Amp connected and listed all 5 actions | In Amp, a server added to one folder's settings (`amp mcp add --workspace`) also needs `amp mcp approve open-diagram`. ## Agent skill The folder [`skills/open-diagram/`](https://github.com/lukendeasy/open-diagram/tree/main/skills/open-diagram) is an Agent Skill: instructions an agent loads when it needs them. Install it with the [skills](https://skills.sh) tool, without cloning this repo: ```bash npx skills add lukendeasy/open-diagram --skill open-diagram --agent claude-code ``` That puts it in `.claude/skills/` in the current folder. Add `-g` to install it for all your projects, or name another app after `--agent`. In a copy of this repo you can also copy the folder yourself: ```bash cp -r skills/open-diagram ~/.claude/skills/ ``` Tested on November 25, 2026, with skills 1.9.0 and Claude Code 2.1.332: the installed file matched this repo's, and Claude Code loaded it from the folder the tool wrote. Then ask for a picture in plain words, for example: "Draw a systems map of our checkout, warehouse and reporting, with what is live and what is planned." The skill tells the agent to plan the columns, write the script, run it, fix each named problem, and look at the PNG before it answers. ## Tell your coding agent about open-diagram Coding agents read `AGENTS.md` (or `CLAUDE.md`) at the top of your project before they start. Paste this block into yours, so an agent that draws a diagram uses open-diagram and fixes every layout problem it names: ```markdown ## Diagrams This project draws its diagrams with open-diagram. - Install it with `pip install open-diagram`. - Without installing, put `uvx` in front of each command: `uvx open-diagram check FILE`. - FILE is `.json`, `.mmd` (Mermaid), or `.py` (a script whose `build()` returns a `Diagram`). Docs, as Markdown: - Format guide: https://open-diagram.dev/for-agents/format-guide.md - JSON: https://open-diagram.dev/docs/json.md - Python: https://open-diagram.dev/docs/python.md - Mermaid: https://open-diagram.dev/docs/mermaid.md - Layout problems: https://open-diagram.dev/problems.md - All docs in one file: https://open-diagram.dev/llms-full.txt For each diagram: 1. Run `open-diagram check FILE`. 2. Fix every problem it names. 3. Run the check again. Repeat until it reports `0 layout problem(s)`. 4. Run `open-diagram describe FILE`. Compare the text with the request. 5. Run `open-diagram draw FILE`. It writes the SVG and PNG next to FILE. 6. Tell the user where the SVG and PNG are. ``` Agents changing the library itself should start with this repo's own [AGENTS.md](https://github.com/lukendeasy/open-diagram/blob/main/AGENTS.md), which is a different file. ## Cloud service icons The [`cloud-icons/`](https://github.com/lukendeasy/open-diagram/tree/main/cloud-icons) folder has one file each for [AWS](https://github.com/lukendeasy/open-diagram/blob/main/cloud-icons/aws.json), [Azure](https://github.com/lukendeasy/open-diagram/blob/main/cloud-icons/azure.json) and [Google Cloud](https://github.com/lukendeasy/open-diagram/blob/main/cloud-icons/gcp.json). Each file lists service keys, such as `s3` or `lambda`, with the web address of that service's SVG icon. AWS also includes `mwaa`, `glue` and `athena` for ETL diagrams. Every address points to one fixed version of the icon file, so later changes to the icon collection do not change your diagrams. A third party, theSVG, hosts the files; once downloaded, they work offline. The [cloud-icons skill](https://github.com/lukendeasy/open-diagram/blob/main/skills/cloud-icons/SKILL.md) tells an agent how to pick icons, download them, and pass each file to `Resource(icon=...)` or `Tile(icon=...)`. The finished SVG and PNG contain the icons themselves, so you can share them without the icon links. JSON and the MCP server take icons by name (`"icon": "aws/s3"`) from the built-in icons or from a folder you add with `--icons`; Mermaid does not take icons. For Claude Code, copy the skill into your skills folder: ```bash cp -r skills/cloud-icons ~/.claude/skills/ ``` The icon lists stay in your copy of this repo. If you run the skill's example from another folder, set its `ICON_DIR` to the `cloud-icons/` folder in your copy. The icons belong to Amazon, Microsoft and Google, and keep their own terms; this project's MIT license does not cover them. The skill links each provider's terms and says how to credit the icons when you share a diagram. --- # Templates Start from a finished cloud diagram, keep its shape, and replace its words. Every template here is a JSON file, so it works the same way from the command line, from an AI agent over MCP, in Python, and in any other language that can write JSON. | Template | Purpose | Preview | | --- | --- | --- | | [aws_etl.json](aws_etl.json) | Data ingestion on AWS in six numbered sections, from orchestration to dashboards | [PNG](../docs/images/aws_etl.png) | | [aws_architecture.json](aws_architecture.json) | An AWS account, network and subnets around an API, a function, a database and storage | [PNG](../docs/images/aws_architecture.png) | | [azure_web_app.json](azure_web_app.json) | A web app on Azure behind Front Door, with its database and cache inside a virtual network | [PNG](../docs/images/azure_web_app.png) | | [gcp_event_pipeline.json](gcp_event_pipeline.json) | An event pipeline on Google Cloud from Pub/Sub to a warehouse and a forecast model | [PNG](../docs/images/gcp_event_pipeline.png) | ## Start from a template ```sh open-diagram new # list the templates open-diagram new azure_web_app # write azure_web_app.json here open-diagram draw azure_web_app.json # draw it; the icons come with the package ``` An agent connected over MCP calls the `template` tool to get the same JSON, edits it, then calls `check` and `draw`. Change the `label` of each resource to your own words and keep its `sub`, which names the cloud service under its icon. Move a resource by changing its `x` and `y`. Run `open-diagram check` after each change: it names every overlap, crossing line and cramped label. ## The standard Every template meets these rules. The tests in `tests/test_cloud.py` check each rule marked "tested", so a pull request that breaks one fails. 1. **One JSON file per template** in this folder, named in lowercase words joined by underscores. (tested) 2. **Listed in the table above**, with its purpose in plain words and a link to its preview. The website's Templates page reads this table. (tested) 3. **No layout problems**, and no text smaller than 10 px. (tested) 4. **Fits on one screen or slide**: no wider than 2,000 px and no taller than 1,400 px. A picture larger than that has to be shrunk to be seen whole, and its text stops being readable. (tested) 5. **The same picture every time**, matching the committed preview in `docs/images/.svg` and `.png`. (tested) 6. **Works offline.** Every icon is a file in `assets/`; drawing a template never uses the network. (tested) 7. **The service name sits under each icon**, in the resource's `sub`. Azure's icon terms ask for the product name next to the icon, and it tells a reader what each picture is. (tested) 8. **Icons are the providers' own files, unchanged**, each folder with its source, version and license in [assets/README.md](assets/README.md). (tested: every icon folder has a section there) 9. **A made-up workload.** Real cloud service names are fine; real company names, people and data are not. Say so in a note or a subtitle. Colors, borders and the style of each box are up to the template. ## What a template is made of A template uses the `resources` layout: each resource is placed where you say, with `x` and `y` in pixels. ```json { "title": "Web app on Azure", "resources": [ {"id": "web", "label": "Web app", "sub": "Azure App Service", "icon": "azure/app-service", "x": 0, "y": 0}, {"id": "db", "label": "Orders database", "sub": "Azure SQL Database", "icon": "azure/sql-database", "x": 320, "y": 0} ], "enclosures": [ {"id": "data", "label": "Data subnet", "members": ["db"], "border": "dotted"}, {"id": "vnet", "label": "Virtual network", "members": ["web", "data"], "border": "dashed"} ], "links": [{"from": "web", "to": "db", "label": "SQL"}] } ``` - **Resource:** `label` (required), `x` and `y` (required), `id`, `sub`, `icon`, `icon_size` (default 64), `max_width` (default 180), `border` (`solid`, `dashed` or `dotted`). - **Enclosure:** a box around resources or other enclosures. `label` and `members` (required), `id`, `sub`, `pad` (default 24), `border` (default `dashed`), `fill` (`none` for see-through), `stroke`, `style` (`outline`, or `panel` for the sloped lid and filled header), `tone` (a header color for `panel`). List enclosures from the inside out: an enclosure must come before any enclosure that holds it. - **Icon:** a name inside an icon folder, such as `aws/s3`. The built-in folder is `assets/`. A JSON file can also use icons in its own folder, and `--icons FOLDER` adds another folder. Full paths and `..` are refused, so a diagram description can never read other files on the computer. - **Links** between resources work as they do between panels. Use `kind` with `dash` for a second kind of line, for example `{"kind": "control", "dash": "dashed"}`, and name it in `theme.link_labels`. Resources can share a picture with panels: give both `x` and `y` and use the `panels` layout alongside `resources`. ## From Python The same pieces exist in Python. `Resource` is a large icon with its label and service name under it; `d.enclosure()` draws a box around resources or other enclosures. ```python from open_diagram import Diagram, Resource, Theme d = Diagram("My cloud resources", theme=Theme(link_labels={"flow": "Data flow"})) a = d.add(Resource("API extractor", sub="AWS Lambda", icon="assets/aws/lambda.svg")) b = d.right_of(a, Resource("Raw data", sub="Amazon S3", icon="assets/aws/s3.svg")) d.link(a, b, label="objects") extract = d.enclosure("Extraction", [a], border="dashed") d.enclosure("Cloud account", [extract, b], border="solid", pad=40) ``` To load a template and change it in Python: `from open_diagram.spec import load_spec; d = load_spec("aws_etl.json")`. `d.enclosure(label, members, sub=..., pad=24, border="dashed", fill=..., stroke=..., style="outline", tone=...)` returns an enclosure that a later enclosure can hold. `style="panel", tone="accent"` reuses the panels' sloped lid and filled header. The lid, header, subtitle and nested enclosures all count toward the measured size, so the layout checks see the whole box. Border style says nothing about whether a resource is planned or live; `d.group()` keeps its shaded look. ## Add a template 1. Write `templates/.json` with a made-up workload. Put any new icons in `assets//`, unchanged, and add their source and license to `assets/README.md`. 2. Run `open-diagram check templates/.json` until it reports 0 problems. 3. Draw the preview: `open-diagram draw templates/.json -o docs/images/`. Look at the PNG. 4. Add a row to the table above, then run `python3 -m unittest discover -s tests`. More provider icons, with links to each file, are listed in [cloud-icons/](../cloud-icons/); the [cloud-icons skill](../skills/cloud-icons/SKILL.md) downloads them. --- # Layout problems What each problem message means, and how to fix it. Run `open-diagram check FILE` (works for `.json`, `.mmd` and `.py`) or run the script; `save()` writes the files, prints a summary, then raises `LayoutError` listing every problem. Fix them all and run again until it says `0 layout problem(s)`. Use the first row whose words the message contains; the more specific rows come first. | Message contains | Fix | | --- | --- | | `sits on the title of group` | Give the line a different start or end side, route it through a lane, or move the group's blocks | | `group ... overlaps` | Add the block to the group, or move it out of the group's area | | `groups ... overlap` | Move one group's blocks so the two shaded areas no longer cross, or put one group wholly inside the other | | `graph: the label ... touches` | Spread the nodes in `at`, or shorten the label | | `graph: the labels ... touch` | Spread the nodes in `at`, or shorten one of the labels | | `overlap` or `px apart` | Move one block, raise `gap` or `row_gap`, or place it with `right_of()` / `below()` | | `crosses` | Route the line through a lane (`lane`, `via_y` or `via_x`), change `start` and `end` sides, or move a block. Use `cross_ok` only when the line should pass behind | | `label ... sits on` | Shorten the label, or widen the gap between the two columns | | `facing away` | Use `start="auto", end="auto"`, choose other sides, or route the line through a lane | | `graph: the line ... runs through` | Move a node so the straight line between the pair is clear | | `needs N px` | Give the block more width, or shorten the words | | `smallest text` | Do not shrink text below the theme minimum; shorten the words instead | JSON and Mermaid mistakes name their place (`columns[1][0].tiles[2]`, `line 7`); fix that spot. --- # AWS architecture diagram with VPC and subnets, from JSON Anyone who draws systems on AWS can start from this 24-line JSON template, which uses AWS's own icons. ![Cloud resources and connectivity](https://open-diagram.dev/images/pages/diagrams-aws-architecture-1.svg) Cloud resources and connectivity. Drawn by open-diagram 0.6.2 from `templates/aws_architecture.json`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/templates/aws_architecture.json The picture as text: ```text Cloud resources and connectivity Large resource icons inside account, network and subnet enclosures. Solid lines: service connectivity. Blocks, left to right: - Public API (Amazon API Gateway) - Application function (VPC-connected Lambda) - Application database (Amazon RDS) - Object storage (Amazon S3) Groups: - Application subnet: Application function - Database subnet: Application database - VPC: Application function, Application database - AWS account: Public API, Application function, Application database, Object storage Lines: - Public API -> Application function, labeled "invoke" - Application function -> Application database, labeled "SQL" - Application function -> Object storage, labeled "objects" Note: Illustrative workload. Fictional account; no deployed resources Border styles are independently selectable ``` ## What does this AWS diagram show? A public API on Amazon API Gateway invokes a function on Lambda, which sends SQL to an RDS database and objects to S3. The function and the database each have a subnet, a section of the network. Both subnets sit inside the VPC, the account's private network. ## What is the template made of? ```json { "title": "Cloud resources and connectivity", "tag": "TEMPLATE", "subtitle": "Large resource icons inside account, network and subnet enclosures.", "note": {"title": "Illustrative workload", "lines": ["Fictional account; no deployed resources", "Border styles are independently selectable"]}, "theme": {"link_labels": {"flow": "Service connectivity"}}, "resources": [ {"id": "gateway", "label": "Public API", "sub": "Amazon API Gateway", "icon": "aws/api-gateway", "x": 0, "y": 240}, {"id": "function", "label": "Application function", "sub": "VPC-connected Lambda", "icon": "aws/lambda", "x": 320, "y": 240}, {"id": "database", "label": "Application database", "sub": "Amazon RDS", "icon": "aws/rds", "x": 620, "y": 240}, {"id": "objects", "label": "Object storage", "sub": "Amazon S3", "icon": "aws/s3", "x": 940, "y": 240} ], "enclosures": [ {"id": "app", "label": "Application subnet", "members": ["function"], "border": "dotted", "fill": "#FFFFFF"}, {"id": "data", "label": "Database subnet", "members": ["database"], "border": "dotted", "fill": "#FFFFFF"}, {"id": "vpc", "label": "VPC", "members": ["app", "data"], "pad": 24, "border": "dashed", "fill": "#FFFFFF"}, {"id": "account", "label": "AWS account", "members": ["gateway", "vpc", "objects"], "border": "solid", "pad": 40, "fill": "#FFFFFF", "stroke": "#3F454C"} ], "links": [ {"from": "gateway", "to": "function", "label": "invoke"}, {"from": "function", "to": "database", "label": "SQL"}, {"from": "function", "to": "objects", "label": "objects", "start": "right", "end": "top", "via_y": 185} ] } ``` - `resources` are the services. Each has a `label` in your words, a `sub` naming the AWS service, an `icon` such as `aws/s3`, and an `x` and `y` in pixels. - `enclosures` are the boxes around them, listed from the inside out: the two subnets, the VPC, then the account. - Each enclosure sets its own `border`: dotted for the subnets, dashed for the VPC, solid for the account. Border style does not show whether a part is live or planned. - `theme.link_labels` names the one kind of line in the key. - `via_y` sets the height at which the `objects` line passes over the database subnet. ## How do I start from this template? 1. Install open-diagram: `pip install open-diagram`. 2. Run `open-diagram new aws_architecture`. It writes `aws_architecture.json` in the current folder. 3. Change each `label` to your own words, and keep each `sub`. 4. To move a resource, change its `x` and `y`. 5. Run `open-diagram check aws_architecture.json`. It names every overlap, crossing line and cramped label. 6. Run `open-diagram draw aws_architecture.json`. The icons come with the package, so drawing works offline. An AI agent connected to the MCP server gets the same JSON from the `template` tool. ## Where do the icons come from, and may I use them? They are Amazon Web Services' architecture icons, unchanged, from one fixed version of theSVG catalog, which lists them as CC BY-ND 2.0. Amazon owns the artwork and its trademarks, and AWS's guidance is at [aws.amazon.com/architecture/icons](https://aws.amazon.com/architecture/icons/). open-diagram's MIT license does not cover the icons. Keep their credits, source links and license notices when you share the pictures. For a service with no built-in icon, the cloud icons guide shows how to download one. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/aws-architecture.html See also: - [AWS, Azure and Google Cloud icons in architecture diagrams](https://open-diagram.dev/guides/cloud-icons.md) - [AWS ETL data pipeline diagram template, as JSON](https://open-diagram.dev/diagrams/aws-etl-pipeline.md) - [Azure web app architecture diagram template, as JSON](https://open-diagram.dev/diagrams/azure-web-app.md) - [Google Cloud event pipeline diagram template, as JSON](https://open-diagram.dev/diagrams/gcp-event-pipeline.md) --- # AWS ETL data pipeline diagram template, as JSON For data teams on AWS, this template shows how data reaches the reports, in six numbered sections with AWS's own icons. The work is often called ETL: extract the data, transform it, and load it where people can query it. ![AWS Data Ingestion with MWAA](https://open-diagram.dev/images/pages/diagrams-aws-etl-pipeline-1.svg) AWS Data Ingestion with MWAA. Drawn by open-diagram 0.6.2 from `templates/aws_etl.json`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/templates/aws_etl.json The picture as text: ```text AWS Data Ingestion with MWAA Solid lines: data and metadata. Dashed lines: mwaa task control. Blocks, left to right: - ETL orchestration (Amazon MWAA) - API extractor (AWS Lambda) - SaaS extractor (AWS Lambda) - Database extractor (AWS Lambda) - Raw landing (Amazon S3) - Transform + validate (AWS Glue) - Table metadata (Glue Data Catalog) - Curated Parquet (Amazon S3) - Analytics SQL (Amazon Athena) - Business dashboards (Amazon QuickSight) Groups: - 01 Orchestrate: ETL orchestration - 02 Extract: API extractor, SaaS extractor, Database extractor - 03 Land: Raw landing - 04 Transform: Transform + validate - 05 Curate + catalog: Curated Parquet, Table metadata - 06 Query + visualize: Analytics SQL, Business dashboards - AWS account / Data platform (Logical service sections; networking and IAM omitted): ETL orchestration, API extractor, SaaS extractor, Database extractor, Raw landing, Transform + validate, Curated Parquet, Table metadata, Analytics SQL, Business dashboards Lines: - API extractor -> Raw landing - SaaS extractor -> Raw landing - Database extractor -> Raw landing - Raw landing -> Transform + validate, labeled "read" - Transform + validate -> Curated Parquet, labeled "Parquet" - Curated Parquet -> Analytics SQL, labeled "query" - Analytics SQL -> Business dashboards, labeled "results" - Curated Parquet -> Table metadata, labeled "register" - Table metadata -> Analytics SQL, labeled "schema" - ETL orchestration -> API extractor (dashed line) - ETL orchestration -> SaaS extractor (dashed line) - ETL orchestration -> Database extractor (dashed line) - ETL orchestration -> Transform + validate, labeled "after extraction" (dashed line) ``` ## What does this ETL diagram show? Three extractors on AWS Lambda take data from an API, an online software service and a database, and save it raw in S3. AWS Glue transforms and validates it and writes Parquet files, a file format for tables, back to S3, where the Glue Data Catalog registers them. Athena queries them, and QuickSight turns the results into dashboards. Amazon MWAA directs each extractor, and the transform "after extraction". ## What makes this template different from the others? It has two kinds of line, and its sections are drawn as panels. - Solid lines carry data and metadata, and dashed lines carry task control. `theme.link_labels` names both kinds, and each control line has `"kind": "control", "dash": "dashed"`. - Each numbered section is an enclosure with `"style": "panel"`, which gives it the sloped top and filled header of an open-diagram panel, here in soft yellow. - The theme sets a cream page, and `"legend": false` turns the key off. - Each control line runs at its own `via_x` distance, so they do not overlap. Three run down the left; the one to the Glue transform leaves on the right. This cut-down version keeps the key on, so it explains the dashed line: ```json { "title": "Two sections of an ETL picture", "theme": {"link_labels": {"flow": "Data", "control": "Task control"}}, "resources": [ {"id": "mwaa", "label": "ETL orchestration", "sub": "Amazon MWAA", "icon": "aws/mwaa", "x": 0, "y": 0}, {"id": "api", "label": "API extractor", "sub": "AWS Lambda", "icon": "aws/lambda", "x": 0, "y": 240}, {"id": "raw", "label": "Raw landing", "sub": "Amazon S3", "icon": "aws/s3", "x": 300, "y": 240} ], "enclosures": [ {"id": "extract", "label": "01 Extract", "members": ["api"], "border": "solid", "style": "panel", "tone": "accent"}, {"id": "land", "label": "02 Land", "members": ["raw"], "border": "solid", "style": "panel", "tone": "accent"} ], "links": [ {"from": "mwaa", "to": "api", "kind": "control", "dash": "dashed", "start": "left", "end": "left", "via_x": -36}, {"from": "api", "to": "raw", "label": "objects"} ] } ``` ![Two sections of an ETL picture](https://open-diagram.dev/images/pages/diagrams-aws-etl-pipeline-2.svg) The check: 0 layout problems ## How do I start from this template? After `pip install open-diagram`: 1. Run `open-diagram new aws_etl`. It writes `aws_etl.json` in the current folder, and replaces an existing file only if you add `--force`. 2. Change each `label` to your own words, and keep each `sub`. 3. Run `open-diagram check aws_etl.json`. If it names a resource, change that resource's `x` and `y`. 4. Run `open-diagram draw aws_etl.json`. ## Where do the icons come from, and may I use them? They are Amazon Web Services' architecture icons, unchanged, from one fixed version of theSVG catalog, which lists them as CC BY-ND 2.0. QuickSight is missing from that version, so its icon is a PNG from the AWS Labs 2025 icon release, with that project's license file beside it. Amazon owns the artwork and its trademarks. open-diagram's MIT license does not cover the icons. Keep their credits, source links and license notices when you share the pictures. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/aws-etl-pipeline.html See also: - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md) - [Google Cloud event pipeline diagram template, as JSON](https://open-diagram.dev/diagrams/gcp-event-pipeline.md) - [AWS, Azure and Google Cloud icons in architecture diagrams](https://open-diagram.dev/guides/cloud-icons.md) --- # Azure web app architecture diagram template, as JSON If you draw web apps on Microsoft Azure, start from this 28-line JSON template with Azure's own icons. ![Web app on Azure](https://open-diagram.dev/images/pages/diagrams-azure-web-app-1.svg) Web app on Azure. Drawn by open-diagram 0.6.2 from `templates/azure_web_app.json`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/templates/azure_web_app.json The picture as text: ```text Web app on Azure A public site behind Front Door, with the app and its data inside one virtual network. Solid lines: requests and data. Blocks, left to right: - Public entry (Azure Front Door) - App secrets (Azure Key Vault) - Web app (Azure App Service) - Uploaded files (Azure Blob Storage) - Orders database (Azure SQL Database) - Session cache (Azure Cache for Redis) Groups: - App subnet: Web app - Data subnet: Orders database, Session cache - Virtual network: Web app, Orders database, Session cache - Resource group: Public entry, Web app, Orders database, Session cache, App secrets, Uploaded files Lines: - Public entry -> Web app, labeled "HTTPS" - Web app -> Orders database, labeled "SQL" - Web app -> Session cache, labeled "sessions" - Web app -> App secrets, labeled "secrets" - Web app -> Uploaded files, labeled "files" Note: Fictional workload. No deployed resources Replace the labels; keep each service name under its icon ``` ## What does this Azure diagram show? Requests enter through Azure Front Door and reach the web app on App Service over HTTPS. The web app keeps orders in an Azure SQL database and sessions in Azure Cache for Redis. It gets its secrets from Key Vault, above it, and keeps uploaded files in Blob Storage, below it. The web app has its own subnet, a section of the network, and the database and cache share another. Both subnets sit inside the virtual network, and everything sits inside one resource group, Azure's container for the parts of one system. ## What is the template made of? ```json { "title": "Web app on Azure", "tag": "TEMPLATE", "subtitle": "A public site behind Front Door, with the app and its data inside one virtual network.", "note": {"title": "Fictional workload", "lines": ["No deployed resources", "Replace the labels; keep each service name under its icon"]}, "theme": {"link_labels": {"flow": "Requests and data"}}, "resources": [ {"id": "edge", "label": "Public entry", "sub": "Azure Front Door", "icon": "azure/front-door", "x": 0, "y": 300}, {"id": "web", "label": "Web app", "sub": "Azure App Service", "icon": "azure/app-service", "x": 330, "y": 300}, {"id": "db", "label": "Orders database", "sub": "Azure SQL Database", "icon": "azure/sql-database", "x": 660, "y": 200}, {"id": "cache", "label": "Session cache", "sub": "Azure Cache for Redis", "icon": "azure/cache-for-redis", "x": 660, "y": 400}, {"id": "secrets", "label": "App secrets", "sub": "Azure Key Vault", "icon": "azure/key-vault", "x": 330, "y": -90}, {"id": "files", "label": "Uploaded files", "sub": "Azure Blob Storage", "icon": "azure/block-blob", "x": 330, "y": 660} ], "enclosures": [ {"id": "app", "label": "App subnet", "members": ["web"], "border": "dotted", "fill": "#FFFFFF", "pad": 40}, {"id": "data", "label": "Data subnet", "members": ["db", "cache"], "border": "dotted", "fill": "#FFFFFF"}, {"id": "vnet", "label": "Virtual network", "members": ["app", "data"], "border": "dashed", "fill": "#FFFFFF"}, {"id": "group", "label": "Resource group", "members": ["edge", "vnet", "secrets", "files"], "border": "solid", "pad": 40, "fill": "#FFFFFF"} ], "links": [ {"from": "edge", "to": "web", "label": "HTTPS"}, {"from": "web", "to": "db", "label": "SQL"}, {"from": "web", "to": "cache", "label": "sessions"}, {"from": "web", "to": "secrets", "label": "secrets", "start": "top", "end": "bottom"}, {"from": "web", "to": "files", "label": "files", "start": "bottom", "end": "top"} ] } ``` - Six `resources`, each with a `label` in your words, a `sub` naming the Azure service, an `icon`, and an `x` and `y` in pixels. - Four `enclosures`, listed from the inside out: the two subnets, the virtual network around both, then the resource group. - Five `links`. The lines to Key Vault and Blob Storage set `start` and `end`, so they leave the top and bottom of the web app. ## How do I start from this template? After `pip install open-diagram`, run `open-diagram new azure_web_app` to write `azure_web_app.json` in the current folder. Change the labels and keep each `sub`, then run `open-diagram check azure_web_app.json` and `open-diagram draw azure_web_app.json`. The [templates reference](../docs/templates.html) covers moving resources and the other steps. An AI agent connected to the MCP server gets the same JSON from the `template` tool. ## Where do the icons come from, and may I use them? They are Microsoft's Azure architecture icons, unchanged, from one fixed version of theSVG catalog, which lists their license as MIT. Microsoft owns the artwork, and open-diagram's MIT license does not cover it. [Microsoft's terms](https://learn.microsoft.com/en-us/azure/architecture/icons/) allow the icons in architecture diagrams. They ask that the icons are not cropped, flipped, rotated or reshaped, and that the product name appears next to each one, which is what each `sub` does. Keep the credits and source links when you share the pictures. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/azure-web-app.html See also: - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md) - [Google Cloud event pipeline diagram template, as JSON](https://open-diagram.dev/diagrams/gcp-event-pipeline.md) - [AWS, Azure and Google Cloud icons in architecture diagrams](https://open-diagram.dev/guides/cloud-icons.md) --- # Business process map of a furniture store, drawn from Python This page is for people who map how a business runs. Its process map follows Pinemoor Home, an invented furniture store, from order to doorstep, with the state and owner of every part, drawn from one Python script. ![Pinemoor Home: from order to doorstep](https://open-diagram.dev/images/pages/diagrams-business-process-map-1.svg) Pinemoor Home: from order to doorstep. Drawn by open-diagram 0.6.2 from `examples/business_map.py`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/business_map.py The picture as text: ```text Pinemoor Home: from order to doorstep What runs today, what is being built, and what comes next States shown: Live, Being built, In trial, Planned, Retiring. Solid lines: data flows today. Dotted lines: connection to build. Rollout: 1. Fraud checks in checkout (Checkout); 2. One record for each order (Order record); 3. Book returns online (Returns). Blocks, left to right: - Where orders come from (Four ways in): Website; Mobile app; Showroom tablets (retiring); Marketplace listings (in trial). Owner: Digital team - Checkout [step 1]: Basket; Payments; Fraud checks (being built); Buy now, pay later (planned). Owner: Payments team - Order record [step 2, being built] (Every order kept in one place): map: Customer places Order; Order paid by Payment; Order includes Item; Order ships as Delivery; Item may come back as Return. example 'Example: order 10482': Customer Online account; Items Sofa, two cushions; Paid by Card, in full; Delivery Two-person, Tuesday. Owner: Platform team - Fulfilment: Warehouse: Pick and pack; Stock counts. Delivery: Two-person delivery; Same-day vans (in trial); Parcel lockers (planned). Owner: Operations - Returns [step 3, planned]: Book a collection; Refund on pickup. Owner: Not yet named - Reporting: Daily sales; Stock cover; Demand forecast (in trial). Owner: Finance - Customer service: Order lookup; Delivery changes; Chat assistant (being built). Owner: Service team Groups: - Order platform (Run by the platform team): Checkout, Order record Lines: - Where orders come from -> Checkout - Checkout -> Order record - Order record -> Fulfilment - Order record -> Returns (connection to build) - Fulfilment -> Reporting - Fulfilment -> Customer service, labeled "updates" - Returns -> Reporting (connection to build) - Where orders come from -> Reporting, labeled "Web traffic, sent nightly" - Where orders come from -> Customer service, labeled "Marketplace questions come straight to service" Note: Example. Pinemoor Home is an invented company. Every system, owner and status is made up. ``` ## What does this business map show? Orders come in four ways and pass through checkout and the order record, which share a shaded group run by the platform team. Fulfilment splits into Warehouse and Delivery. Returns is planned, and its owner line reads "Not yet named". The order record panel shows the data twice: a small map of customer, order, item, payment, delivery and return, and beside it order 10482 with made-up values. ## Is it the same code as a software map? Yes. `business_map.py` has the same structure as `systems_map.py`, the systems map example: four columns, one group, the same blocks, two lanes. Only the words differ. ## How do I keep the statuses current? Put them in a small file and pass it when you draw. When work ships, change one word in the file, and leave the script alone. ```json {"Fraud checks": "live", "Parcel lockers": "building"} ``` ```bash open-diagram draw business_map.py --statuses states.json ``` Names match panel titles, panel ids and tile labels, and `live` returns a part to the plain look. A misspelled name stops the command before anything is drawn: ```text error: no panel or tile is named 'Parcel locker' ``` ## How do I make my own? After `pip install open-diagram`, copy `examples/business_map.py` and replace the words with your own teams, steps and owners. Where nobody owns a part yet, write "Owner: Not yet named", as Returns does, so the gap shows. Then run `open-diagram check business_map.py` and `open-diagram draw business_map.py`. ## When is a business process map useful? When several teams need one view of how an order or a request moves from a customer to a result. The numbered rollout adds what changes next, in order. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/business-process-map.html See also: - [Systems map diagram with live and planned parts, from Python](https://open-diagram.dev/diagrams/systems-map.md) - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md) - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md) --- # Card payment flow diagram, drawn from Python If you explain card payments, this example follows one simplified in-store payment, from tap to approval and settlement, in a 34-line Python script. ![What happens when you tap a card](https://open-diagram.dev/images/pages/diagrams-card-payment-flow-1.svg) What happens when you tap a card. Drawn by open-diagram 0.6.2 from `examples/card_payment.py`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/card_payment.py The picture as text: ```text What happens when you tap a card Simplified: one in-store payment, start to finish States shown: Live. Solid lines: data flows today. Order: 1. Tap (Shopper); 2. Ask the card's bank (Card network); 3. Approve or decline (Card's bank); 4. Money moves later (Shop's bank). Blocks, left to right: - Shopper [step 1]: Card; Phone wallet - Shop: Card reader; Checkout system - Shop's bank [step 4] (The acquirer): Payment processor; Fraud screening - Card network [step 2]: Routes the request; Network rules - Card's bank [step 3] (The issuer): Checks the balance; Fraud checks; Approves or declines Lines: - Shopper -> Shop, labeled "tap" - Shop -> Shop's bank - Shop's bank -> Card network - Card network -> Card's bank - Card's bank -> Shop, labeled "The answer comes back the same way, in seconds" - Card's bank -> Shop's bank, labeled "Money moves later, in a batch" ``` ## Who asks whom, and when does the money move? Five parties sit in a row. The request travels left to right, the answer comes back along the top in seconds, and the money moves later, in a batch, along the bottom. Numbered steps give the order of events, which differs from the order on the page. The two banks have subtitles in the payment industry's terms: "The acquirer" and "The issuer". ## Which building blocks draw it? ```python """What happens when you tap a card in a shop, simplified. Run: python3 examples/card_payment.py""" import os from open_diagram import Diagram, Panel, Tiles HERE = os.path.dirname(os.path.abspath(__file__)) STEPS = [(1, "Tap"), (2, "Ask the card's bank"), (3, "Approve or decline"), (4, "Money moves later")] def build() -> Diagram: d = Diagram("What happens when you tap a card", subtitle="Simplified: one in-store payment, start to finish", tag="EXAMPLE", steps=STEPS, steps_label="Order") (shopper,), (shop,), (acquirer,), (network,), (issuer,) = d.columns([ [Panel("Shopper", Tiles(["Card", "Phone wallet"], cols=1), step=1)], [Panel("Shop", Tiles(["Card reader", "Checkout system"], cols=1))], [Panel("Shop's bank", Tiles(["Payment processor", "Fraud screening"], cols=1), sub="The acquirer", step=4)], [Panel("Card network", Tiles(["Routes the request", "Network rules"], cols=1), step=2)], [Panel("Card's bank", Tiles(["Checks the balance", "Fraud checks", "Approves or declines"], cols=1), sub="The issuer", step=3)], ], gap=64, valign="center") d.link(shopper, shop, label="tap") d.link(shop, acquirer) d.link(acquirer, network) d.link(network, issuer) top = min(p.y for p in d.placed) - 56 bottom = max(p.bottom for p in d.placed) + 44 d.link(issuer, shop, start="top", end="top", via_y=top, label="The answer comes back the same way, in seconds") d.link(issuer, acquirer, start="bottom", end="bottom", via_y=bottom, label="Money moves later, in a batch") return d if __name__ == "__main__": build().save(os.path.join(HERE, "..", "docs", "images", "card_payment")) ``` - `d.columns()` places the five panels, 64 px apart, centred against the tallest. - `step=` on four panels, with `steps=` and `steps_label="Order"` on the `Diagram`, draws the numbered key. - `sub="The acquirer"` adds a subtitle under a panel title. - The two return lines use `via_y`. The script reads where the panels landed from `d.placed`, then sets one lane 56 px above the highest panel and one 44 px below the lowest. ## Why do the return lines go around the panels? A line drawn straight back from the card's bank to the shop would pass through the panels between them. The check names each crossing, as in this shorter script: ```python from open_diagram import Diagram, Panel, Tiles def build(): d = Diagram("What happens when you tap a card") (shop,), (acquirer,), (network,), (issuer,) = d.columns([ [Panel("Shop", Tiles(["Card reader", "Checkout system"], cols=1))], [Panel("Shop's bank", Tiles(["Payment processor", "Fraud screening"], cols=1))], [Panel("Card network", Tiles(["Routes the request", "Network rules"], cols=1))], [Panel("Card's bank", Tiles(["Checks the balance", "Approves or declines"], cols=1))], ], gap=64) d.link(shop, acquirer) d.link(acquirer, network) d.link(network, issuer) d.link(issuer, shop, start="left", end="right", label="The answer comes back") return d ``` ![What happens when you tap a card](https://open-diagram.dev/images/pages/diagrams-card-payment-flow-3.svg) The check: 4 layout problem(s) ```text line 'Card's bank' -> 'Shop' crosses 'Shop's bank'; route it with via_x/via_y, move a block, or pass cross_ok=True line 'Card's bank' -> 'Shop' crosses 'Card network'; route it with via_x/via_y, move a block, or pass cross_ok=True the label 'The answer comes back' on line 'Card's bank' -> 'Shop' sits on 'Shop's bank' the label 'The answer comes back' on line 'Card's bank' -> 'Shop' sits on 'Card network' ``` Each message names the line, the panel in its way and the fixes to try. The example takes the first: `start="top", end="top"` and a `via_y` above every panel. ## How do I make my own? Install open-diagram with `pip install open-diagram`, copy `examples/card_payment.py`, and change the parties, tiles and steps to your own flow. Run `open-diagram check card_payment.py` and fix each crossing it names, then `open-diagram draw card_payment.py` to write the SVG and PNG. ## When is this kind of flow useful? For any request that goes out through several parties and comes back, such as a payment or a bounced email. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/card-payment-flow.html See also: - [CI/CD release pipeline diagram, drawn from Python](https://open-diagram.dev/diagrams/ci-cd-release-pipeline.md) - [Email delivery flow diagram, written as JSON](https://open-diagram.dev/diagrams/email-delivery-flow.md) - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md) --- # CI/CD release pipeline diagram, drawn from Python This page shows engineering teams a release pipeline, from pull request to production, that open-diagram draws from a 34-line Python script. A release pipeline, often called CI/CD, is the set of automatic steps that build, test and ship each code change. ![From pull request to production](https://open-diagram.dev/images/pages/diagrams-ci-cd-release-pipeline-1.svg) From pull request to production. Drawn by open-diagram 0.6.2 from `examples/pipeline.py`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/pipeline.py The picture as text: ```text From pull request to production States shown: Live, Being built, In trial, Planned. Solid lines: data flows today. This quarter: 1. Cache every build (Build); 2. Scan every image (Checks); 3. Release to 5% first (Release). Blocks, left to right: - Code: Pull request; Code review. Owner: Every team - Build [step 1]: Compile; Unit tests; Container image; Build cache (being built). Owner: Build team - Checks [step 2]: Integration tests; Security scan (being built); Load test (planned). Owner: Quality team - Release [step 3]: Staging; Canary, 5% of users (in trial); Production. Owner: Platform team Lines: - Code -> Build - Build -> Checks - Checks -> Release - Release -> Code, labeled "If errors rise: roll back and tell the author" ``` ## What does this pipeline diagram show? Four stages run left to right, each with the team that owns it. The line along the bottom is the way back when errors rise. The key numbers three changes for this quarter. Two are being built. The third, a canary release that sends a new version to 5% of users first, is in trial. ## Which building blocks draw it? ```python """A release pipeline, from pull request to production, with a rollback lane underneath. Run: python3 examples/pipeline.py""" import os from open_diagram import Diagram, Panel, Tile, Tiles HERE = os.path.dirname(os.path.abspath(__file__)) STEPS = [(1, "Cache every build"), (2, "Scan every image"), (3, "Release to 5% first")] def build() -> Diagram: d = Diagram("From pull request to production", tag="EXAMPLE", steps=STEPS, steps_label="This quarter") (code,), (build_,), (checks,), (release,) = d.columns([ [Panel("Code", Tiles(["Pull request", "Code review"], cols=1), footer="Owner: Every team")], [Panel("Build", Tiles(["Compile", "Unit tests", "Container image", Tile("Build cache", status="building")], cols=1), step=1, footer="Owner: Build team")], [Panel("Checks", Tiles(["Integration tests", Tile("Security scan", status="building"), Tile("Load test", status="planned")], cols=1), step=2, footer="Owner: Quality team")], [Panel("Release", Tiles(["Staging", Tile("Canary, 5% of users", status="trial"), "Production"], cols=1), step=3, footer="Owner: Platform team")], ], gap=72, valign="center") d.link(code, build_) d.link(build_, checks) d.link(checks, release) bottom = max(p.bottom for p in d.placed) + 44 d.link(release, code, start="bottom", end="bottom", via_y=bottom, label="If errors rise: roll back and tell the author") return d if __name__ == "__main__": build().save(os.path.join(HERE, "..", "docs", "images", "pipeline")) ``` - `d.columns()` places one panel per stage. `valign="center"` centres each against the tallest. - `Tiles([...], cols=1)` stacks each stage's tiles in one column. - `Tile("Load test", status="planned")` marks one tile. - `steps=` and `steps_label="This quarter"` on the `Diagram`, with `step=` on three panels, number the changes. - The rollback line uses `via_y`, 44 px below the lowest panel, so it runs in a lane that crosses no stage. ## Can the diagram be checked on every push? Yes. Keep the file next to the code and add open-diagram's GitHub Action to the workflow. On every push it checks or redraws the diagrams, and fails if a layout problem appears. It takes JSON and Mermaid files, and Python files with a `build()` function. ## Can I write it in JSON? Yes, and it is shorter. `"lane": "bottom"` takes the place of `via_y`: ```json { "title": "From pull request to production", "columns": [ [{"id": "code", "title": "Code", "tiles": ["Pull request", "Code review"], "cols": 1}], [{"id": "build", "title": "Build", "tiles": ["Compile", "Unit tests", {"label": "Build cache", "status": "building"}], "cols": 1}], [{"id": "checks", "title": "Checks", "tiles": ["Integration tests", {"label": "Load test", "status": "planned"}], "cols": 1}], [{"id": "release", "title": "Release", "tiles": ["Staging", {"label": "Canary, 5% of users", "status": "trial"}, "Production"], "cols": 1}] ], "gap": 72, "links": [ {"from": "code", "to": "build"}, {"from": "build", "to": "checks"}, {"from": "checks", "to": "release"}, {"from": "release", "to": "code", "lane": "bottom", "label": "If errors rise: roll back"} ] } ``` ![From pull request to production](https://open-diagram.dev/images/pages/diagrams-ci-cd-release-pipeline-3.svg) The check: 0 layout problems ## How do I make my own? After `pip install open-diagram`, copy `examples/pipeline.py`, or the JSON above, into your repository and rename the stages and tiles. Run `open-diagram check pipeline.py`, then `open-diagram draw pipeline.py`. When a change ships, delete its tile's `status`, or keep statuses in a separate file and draw with `--statuses`. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/ci-cd-release-pipeline.html See also: - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md) - [Card payment flow diagram, drawn from Python](https://open-diagram.dev/diagrams/card-payment-flow.md) - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md) --- # Concept map of how git stores a project, drawn from Python This page is for anyone who explains how things connect, such as the parts of a data model. Its concept map, drawn from a 34-line Python script, shows how git, a tool that keeps the history of a project's files, stores a project. ![How git stores a project](https://open-diagram.dev/images/pages/diagrams-concept-map-1.svg) How git stores a project. Drawn by open-diagram 0.6.2 from `examples/concept_map.py`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/concept_map.py The picture as text: ```text How git stores a project Blocks, left to right: - Objects and how they connect (Each object is named by a hash of its contents): map: Branch points to Commit; Tag points to Commit; Commit follows Parent commit; Commit saves Tree; Tree lists file Blob; Tree lists folder Subfolder tree. example 'Example: one commit': Snapshot Tree 9c1e4a; Parent Commit 52f0b7; Message Fix sign-in on phones; Branch main points here ``` ## What does this concept map show? Seven objects and six labelled lines, from branch to commit to tree. Git calls a file a blob, and a subfolder is a tree too. Each object is named by a hash of its contents, a short code worked out from the contents themselves. The card on the right is a worked example: one commit, with made-up values. ## Which building blocks draw it? ```python """A map of how git stores a project: its objects and how they point to each other, with one worked example. Run: python3 examples/concept_map.py""" import os from open_diagram import Card, Diagram, Graph, Panel, Row HERE = os.path.dirname(os.path.abspath(__file__)) MAP = Graph( nodes={"branch": "Branch", "tag": "Tag", "commit": "Commit", "parent": "Parent commit", "tree": "Tree", "blob": "Blob", "subtree": "Subfolder tree"}, links=[("branch", "commit", "points to"), ("tag", "commit", "points to"), ("commit", "parent", "follows"), ("commit", "tree", "saves"), ("tree", "blob", "lists file"), ("tree", "subtree", "lists folder")], at={"branch": (0, 0), "commit": (1.5, 0), "tree": (3, 0), "blob": (4.5, 0), "tag": (0, 2), "parent": (1.5, 2), "subtree": (4.5, 2)}, ) EXAMPLE = Card("Example: one commit", [ ("Snapshot", "Tree 9c1e4a"), ("Parent", "Commit 52f0b7"), ("Message", "Fix sign-in on phones"), ("Branch", "main points here"), ], intro="One commit, as git stores it:") def build() -> Diagram: d = Diagram("How git stores a project", tag="EXAMPLE") d.add(Panel("Objects and how they connect", Row(MAP, EXAMPLE), sub="Each object is named by a hash of its contents")) return d if __name__ == "__main__": build().save(os.path.join(HERE, "..", "docs", "images", "concept_map")) ``` - `Graph(nodes, links, at)` draws the map. `nodes` gives each object a key and a label. `links` lists pairs, each with an optional label. - `at` places each node on a grid as `(column, row)`. Columns are 132 px apart and rows 58 px, and fractions are allowed: 1.5 is halfway between columns 1 and 2. - `Card(title, rows, intro=)` draws the worked example as rows of names and values. - `Row(MAP, EXAMPLE)` puts the map and the card side by side in one `Panel`. Lines in a `Graph` have no arrowheads, so the labels carry the meaning. ## Can I write a concept map in JSON? Yes. A panel's `sections` can contain a `graph`, a `card` and a `row`, with the same parts as in Python: ```json { "title": "How a library lends a book", "columns": [[{ "title": "Things and how they connect", "sections": [{"row": [ {"graph": { "nodes": {"member": "Member", "loan": "Loan", "copy": "Copy", "book": "Book"}, "links": [["member", "loan", "takes out"], ["loan", "copy", "covers"], ["copy", "book", "is a copy of"]], "at": {"member": [0, 0], "loan": [1.5, 0], "copy": [1.5, 2], "book": [3, 2]} }}, {"card": {"title": "Example: loan 3317", "rows": [["Member", "Card 0042"], ["Copy", "Shelf B, copy 2"], ["Due", "In 21 days"]]}} ]}] }]] } ``` ![How a library lends a book](https://open-diagram.dev/images/pages/diagrams-concept-map-3.svg) The check: 0 layout problems ## What if two nodes are too close? The check names the label and each node it touches. Move Loan from column 1.5 to 0.8 and "takes out" has no room: ```json { "title": "How a library lends a book", "columns": [[{ "title": "Things and how they connect", "sections": [{"graph": { "nodes": {"member": "Member", "loan": "Loan", "copy": "Copy", "book": "Book"}, "links": [["member", "loan", "takes out"], ["loan", "copy", "covers"], ["copy", "book", "is a copy of"]], "at": {"member": [0, 0], "loan": [0.8, 0], "copy": [1.5, 2], "book": [3, 2]} }}] }]] } ``` ![How a library lends a book](https://open-diagram.dev/images/pages/diagrams-concept-map-4.svg) The check: 2 layout problem(s) ```text graph: the label 'takes out' touches the node 'Member' graph: the label 'takes out' touches the node 'Loan' ``` Spread the nodes in `at`, or shorten the label. ## How do I make my own? Copy `examples/concept_map.py`, or the JSON above, under your own name. Write your nodes and links, and give each node a place in `at`. Then install open-diagram with `pip install open-diagram` and run `open-diagram check` and `open-diagram draw` on the file. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/concept-map.html See also: - [Systems map diagram with live and planned parts, from Python](https://open-diagram.dev/diagrams/systems-map.md) - [Business process map of a furniture store, drawn from Python](https://open-diagram.dev/diagrams/business-process-map.md) - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md) --- # Email delivery flow diagram, written as JSON For anyone who wants a flow diagram without writing Python, this page draws email delivery from JSON: plain data that any programming language or AI agent can produce. ![How an email is delivered](https://open-diagram.dev/images/pages/diagrams-email-delivery-flow-1.svg) How an email is delivered. Drawn by open-diagram 0.6.2 from `examples/email_delivery.json`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/email_delivery.json The picture as text: ```text How an email is delivered Written as JSON: no Python needed. Draw it with: open-diagram draw examples/email_delivery.json States shown: Live, Being built, In trial, Planned. Solid lines: data flows today. This year: 1. Sign every message (Sending server); 2. Check every link (Receiving server). Blocks, left to right: - Mail app: Write; Attach files; Send - Sending server [step 1] (The sender's provider): Queue; Digital signature (being built); Retry if busy - Receiving server [step 2] (The recipient's provider): Check the sender; Spam filter; Link scanner (planned) - Inbox: Phone; Laptop; Smartwatch (in trial) Lines: - Mail app -> Sending server - Sending server -> Receiving server, labeled "over the internet" - Receiving server -> Inbox - Receiving server -> Sending server, labeled "If delivery fails, a bounce message goes back" ``` ## How does an email reach the inbox? It passes from the mail app through two servers, the sender's provider and the recipient's. If delivery fails, a bounce message goes back along the bottom. The key numbers two changes planned for this year. ## What does the JSON look like? The whole file is 23 lines: ```json { "title": "How an email is delivered", "subtitle": "Written as JSON: no Python needed. Draw it with: open-diagram draw examples/email_delivery.json", "tag": "EXAMPLE", "steps": [[1, "Sign every message"], [2, "Check every link"]], "steps_label": "This year", "columns": [ [{"id": "app", "title": "Mail app", "tiles": ["Write", "Attach files", "Send"], "cols": 1}], [{"id": "out", "title": "Sending server", "sub": "The sender's provider", "step": 1, "tiles": ["Queue", {"label": "Digital signature", "status": "building"}, "Retry if busy"], "cols": 1}], [{"id": "in", "title": "Receiving server", "sub": "The recipient's provider", "step": 2, "tiles": ["Check the sender", "Spam filter", {"label": "Link scanner", "status": "planned"}], "cols": 1}], [{"id": "inbox", "title": "Inbox", "tiles": ["Phone", "Laptop", {"label": "Smartwatch", "status": "trial"}], "cols": 1, "tone": "neutral"}] ], "gap": 130, "links": [ {"from": "app", "to": "out"}, {"from": "out", "to": "in", "label": "over the internet"}, {"from": "in", "to": "inbox"}, {"from": "in", "to": "out", "lane": "bottom", "label": "If delivery fails, a bounce message goes back"} ] } ``` - `columns` is a list of columns, each a list of panels. - Each panel has an `id`, which the `links` use. - A tile is a plain string, or an object with a `label` and a `status`. - `"lane": "bottom"` sends the bounce line under the panels. - `"gap": 130` leaves room between the servers for the label "over the internet". At 100, the label sits on a panel and the check says so. ## Why JSON instead of Python? More tools can write it. The MCP server, which lets AI apps such as Claude Code and Cursor draw diagrams, accepts JSON and Mermaid only, never Python. Python is still needed for positions worked out while the script runs. ## What happens when the JSON has a mistake? open-diagram names the place. Misspell a key, say `colour` on the digital signature tile, and the check stops with: ```text error: columns[1][0].tiles[1]: unknown key(s) 'colour'; allowed: icon, label, status, sub ``` That is the second column, first panel, second tile. A missing title, or a link to an unknown id, is named the same way. ## How do I make my own? Open the example in the editor and change it in your browser. Or, after `pip install open-diagram`, copy `examples/email_delivery.json`, change the titles, tiles and links, and run `open-diagram check email_delivery.json` and `open-diagram draw email_delivery.json`. The [JSON guide](../guides/json-from-any-language.html) shows how to write the file from your own code. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/email-delivery-flow.html See also: - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md) - [Card payment flow diagram, drawn from Python](https://open-diagram.dev/diagrams/card-payment-flow.md) - [Release cycle diagram as a ring, written as JSON](https://open-diagram.dev/diagrams/release-cycle-ring-diagram.md) --- # Google Cloud event pipeline diagram template, as JSON This page is for anyone who draws an event pipeline on Google Cloud. Its template is 29 lines of JSON with Google Cloud's own icons. ![Event pipeline on Google Cloud](https://open-diagram.dev/images/pages/diagrams-gcp-event-pipeline-1.svg) Event pipeline on Google Cloud. Drawn by open-diagram 0.6.2 from `templates/gcp_event_pipeline.json`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/templates/gcp_event_pipeline.json The picture as text: ```text Event pipeline on Google Cloud Order events go from Pub/Sub through Cloud Run into storage, a warehouse and a forecast model. Solid lines: events and data. Blocks, left to right: - Order events (Pub/Sub) - Event processor (Cloud Run) - Address check (Cloud Functions) - Raw events (Cloud Storage) - Orders warehouse (BigQuery) - Demand forecast (Vertex AI) Groups: - 01 Ingest: Order events - 02 Process: Event processor, Address check - 03 Store: Raw events, Orders warehouse - 04 Predict: Demand forecast - Google Cloud project (Networking and access rules left out): Order events, Event processor, Address check, Raw events, Orders warehouse, Demand forecast Lines: - Order events -> Event processor, labeled "push" - Event processor -> Address check, labeled "address" - Event processor -> Raw events, labeled "JSON" - Address check -> Orders warehouse, labeled "rows" - Orders warehouse -> Demand forecast, labeled "training data" Note: Fictional workload. No deployed resources Replace the labels; keep each service name under its icon ``` ## What does this Google Cloud diagram show? Order events arrive in Pub/Sub, which pushes them to an event processor on Cloud Run. The processor writes raw events to Cloud Storage as JSON and sends addresses to a check on Cloud Functions. Rows go from the check to an orders warehouse in BigQuery, and training data from there to a demand forecast on Vertex AI. Four numbered sections read left to right, inside a dashed box for the Google Cloud project. ## What is the template made of? ```json { "title": "Event pipeline on Google Cloud", "tag": "TEMPLATE", "subtitle": "Order events go from Pub/Sub through Cloud Run into storage, a warehouse and a forecast model.", "note": {"title": "Fictional workload", "lines": ["No deployed resources", "Replace the labels; keep each service name under its icon"]}, "theme": {"link_labels": {"flow": "Events and data"}}, "resources": [ {"id": "events", "label": "Order events", "sub": "Pub/Sub", "icon": "gcp/pub-sub", "x": 0, "y": 100}, {"id": "process", "label": "Event processor", "sub": "Cloud Run", "icon": "gcp/cloud-run", "x": 320, "y": 100}, {"id": "check", "label": "Address check", "sub": "Cloud Functions", "icon": "gcp/cloud-functions", "x": 320, "y": 340}, {"id": "raw", "label": "Raw events", "sub": "Cloud Storage", "icon": "gcp/cloud-storage", "x": 640, "y": 100}, {"id": "warehouse", "label": "Orders warehouse", "sub": "BigQuery", "icon": "gcp/bigquery", "x": 640, "y": 340}, {"id": "forecast", "label": "Demand forecast", "sub": "Vertex AI", "icon": "gcp/vertex-ai", "x": 960, "y": 340} ], "enclosures": [ {"id": "ingest", "label": "01 Ingest", "members": ["events"], "border": "solid", "style": "panel"}, {"id": "processing", "label": "02 Process", "members": ["process", "check"], "border": "solid", "style": "panel"}, {"id": "store", "label": "03 Store", "members": ["raw", "warehouse"], "border": "solid", "style": "panel"}, {"id": "predict", "label": "04 Predict", "members": ["forecast"], "border": "solid", "style": "panel"}, {"id": "project", "label": "Google Cloud project", "members": ["ingest", "processing", "store", "predict"], "sub": "Networking and access rules left out", "pad": 40, "border": "dashed"} ], "links": [ {"from": "events", "to": "process", "label": "push"}, {"from": "process", "to": "check", "label": "address", "start": "bottom", "end": "top"}, {"from": "process", "to": "raw", "label": "JSON"}, {"from": "check", "to": "warehouse", "label": "rows"}, {"from": "warehouse", "to": "forecast", "label": "training data"} ] } ``` - Six `resources`, each with a `label` in your words, a `sub` naming the Google Cloud service, an `icon`, and an `x` and `y` in pixels. - Four numbered enclosures with `"style": "panel"`, which gives each section the sloped top and gray header of an open-diagram panel. - A fifth enclosure, the project, contains the other four, so it comes last: enclosures are listed from the inside out. - The line to the address check sets `"start": "bottom", "end": "top"`, so it drops straight down inside the Process section. ## How do I start from this template? After `pip install open-diagram`, run `open-diagram new gcp_event_pipeline` to write `gcp_event_pipeline.json` in the current folder. Change each `label`, and keep each `sub`. To add a resource, copy one, give it a new `id`, `x` and `y`, and add its `id` to a section's `members`. Then run `open-diagram check gcp_event_pipeline.json` and `open-diagram draw gcp_event_pipeline.json`. An AI agent connected to the MCP server gets the same JSON from the `template` tool. ## Where do the icons come from, and may I use them? They are Google's icons for Google Cloud, unchanged, from one fixed version of theSVG catalog, which lists their license as Apache-2.0. Google owns the artwork, and the source is [cloud.google.com/icons](https://cloud.google.com/icons). open-diagram's MIT license does not cover the icons. Keep their credits, source links and license notices when you share the pictures. The six icons in this template are the only built-in Google Cloud icons. The cloud icons guide shows how to download others. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/gcp-event-pipeline.html See also: - [AWS ETL data pipeline diagram template, as JSON](https://open-diagram.dev/diagrams/aws-etl-pipeline.md) - [Azure web app architecture diagram template, as JSON](https://open-diagram.dev/diagrams/azure-web-app.md) - [AWS, Azure and Google Cloud icons in architecture diagrams](https://open-diagram.dev/guides/cloud-icons.md) --- # Incident response process diagram, drawn from Python This example is for teams who want their outage steps, and who owns each one, on one page. It shows an invented team's process, from the first alert to the lessons learned, drawn from a 34-line Python script. ![When the site goes down: from alert to lesson learned](https://open-diagram.dev/images/pages/diagrams-incident-response-process-1.svg) When the site goes down: from alert to lesson learned. Drawn by open-diagram 0.6.2 from `examples/incident_response.py`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/incident_response.py The picture as text: ```text When the site goes down: from alert to lesson learned States shown: Live, Being built, In trial, Planned. Solid lines: data flows today. Blocks, left to right: - Detect: Error-rate alerts; Uptime checks; Unusual traffic (in trial). Owner: Reliability team - Respond: Page the on-call engineer; Open an incident channel; Assign roles automatically (being built). Owner: On-call rotation - Fix: Roll back; Add servers; Turn off a feature - Tell people: Status page; Support team; Email affected users (planned) - Learn: Timeline; Blameless review; Follow-up tasks. Owner: Incident lead Lines: - Detect -> Respond - Respond -> Fix - Respond -> Tell people, labeled "every 30 min" - Fix -> Learn - Tell people -> Learn, labeled "what users saw" Note: Example. An invented team's process. Every tool and status is made up. ``` ## What happens, and in what order? Detect, respond, fix, learn, left to right. Fix and Tell people share a column: both start from Respond and lead to Learn. Three parts are not live yet: unusual traffic alerts are in trial, assigning roles automatically is being built, and emailing affected users is planned. ## Which building blocks draw it? ```python """How an invented team handles an outage, from the first alert to the lessons learned. Run: python3 examples/incident_response.py""" import os from open_diagram import Diagram, Note, Panel, Tile, Tiles HERE = os.path.dirname(os.path.abspath(__file__)) def build() -> Diagram: d = Diagram("When the site goes down: from alert to lesson learned", tag="EXAMPLE", note=Note("Example", "An invented team's process.", "Every tool and status is made up.")) (detect,), (respond,), (fix, tell), (learn,) = d.columns([ [Panel("Detect", Tiles(["Error-rate alerts", "Uptime checks", Tile("Unusual traffic", status="trial")], cols=1), footer="Owner: Reliability team")], [Panel("Respond", Tiles(["Page the on-call engineer", "Open an incident channel", Tile("Assign roles automatically", status="building")], cols=1), footer="Owner: On-call rotation")], [Panel("Fix", Tiles(["Roll back", "Add servers", "Turn off a feature"], cols=1)), Panel("Tell people", Tiles(["Status page", "Support team", Tile("Email affected users", status="planned")], cols=1), tone="neutral")], [Panel("Learn", Tiles(["Timeline", "Blameless review", "Follow-up tasks"], cols=1), tone="accent", footer="Owner: Incident lead")], ], gap=136, row_gap=32, valign="center") d.link(detect, respond) d.link(respond, fix) d.link(respond, tell, label="every 30 min") d.link(fix, learn) d.link(tell, learn, label="what users saw") return d if __name__ == "__main__": build().save(os.path.join(HERE, "..", "docs", "images", "incident_response")) ``` - `d.columns()` places four columns. The third has two panels, Fix above Tell people, `row_gap=32` apart. - `valign="center"` centres the one-panel columns against the taller third column. - `label="every 30 min"` puts a label on a line. - `tone="accent"` gives Learn its yellow header. - `footer="Owner: Incident lead"` names who runs a step. Fix and Tell people have no owner line. ## Why are the columns so far apart? The line labels need the room. Move the columns closer and each label lands on a panel, as in this shorter script with `gap=64`: ```python from open_diagram import Diagram, Panel, Tiles def build(): d = Diagram("When the site goes down") (respond,), (fix, tell), (learn,) = d.columns([ [Panel("Respond", Tiles(["Page the on-call engineer", "Open an incident channel"], cols=1))], [Panel("Fix", Tiles(["Roll back", "Add servers"], cols=1)), Panel("Tell people", Tiles(["Status page", "Support team"], cols=1))], [Panel("Learn", Tiles(["Timeline", "Blameless review"], cols=1))], ], gap=64, row_gap=32) d.link(respond, fix) d.link(respond, tell, label="every 30 min") d.link(fix, learn) d.link(tell, learn, label="what users saw") return d ``` ![When the site goes down](https://open-diagram.dev/images/pages/diagrams-incident-response-process-3.svg) The check: 4 layout problem(s) ```text the label 'every 30 min' on line 'Respond' -> 'Tell people' sits on 'Respond' the label 'every 30 min' on line 'Respond' -> 'Tell people' sits on 'Tell people' the label 'what users saw' on line 'Tell people' -> 'Learn' sits on 'Tell people' the label 'what users saw' on line 'Tell people' -> 'Learn' sits on 'Learn' ``` Widen the gap or shorten the labels. With `gap=136`, as in the example, the same script reports 0 layout problems. ## How do I make my own? Copy `examples/incident_response.py` and change the steps, tiles and owners to your team's process. With open-diagram installed (`pip install open-diagram`), run `open-diagram check incident_response.py` and `open-diagram draw incident_response.py`. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/incident-response-process.html See also: - [CI/CD release pipeline diagram, drawn from Python](https://open-diagram.dev/diagrams/ci-cd-release-pipeline.md) - [Business process map of a furniture store, drawn from Python](https://open-diagram.dev/diagrams/business-process-map.md) - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md) --- # Architecture diagram examples drawn with open-diagram Each page below shows one kind of diagram, from a systems map to an AWS, Azure or Google Cloud architecture, with the file that draws it. The site's build draws every example and template fresh with the current release of open-diagram, and stops if any of them reports a layout problem. open-diagram is free and MIT licensed. Pick the page closest to the picture you need, then start your own from its Python, JSON or Mermaid file. Some pages also show a deliberate mistake and the messages the check prints for it. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams.html Pages: - [Systems map diagram with live and planned parts, from Python](https://open-diagram.dev/diagrams/systems-map.md): A systems map of an invented video platform, drawn from one Python script, with statuses, owners, a group, rollout steps and lanes. - [Business process map of a furniture store, drawn from Python](https://open-diagram.dev/diagrams/business-process-map.md): A business process map of an invented furniture store, from order to doorstep, drawn from Python with statuses, owners and rollout steps. - [Layered architecture diagram with a side panel, from Python](https://open-diagram.dev/diagrams/layered-architecture.md): A layered architecture diagram of a web product, from the people who use it down to its data, with a side panel, drawn from Python. - [CI/CD release pipeline diagram, drawn from Python](https://open-diagram.dev/diagrams/ci-cd-release-pipeline.md): A CI/CD release pipeline diagram, pull request to production with a rollback lane, drawn from Python; a GitHub Action can check it on every push. - [Card payment flow diagram, drawn from Python](https://open-diagram.dev/diagrams/card-payment-flow.md): A card payment flow diagram, from tap to approval and settlement, drawn from Python, with numbered steps and return paths in lanes. - [Email delivery flow diagram, written as JSON](https://open-diagram.dev/diagrams/email-delivery-flow.md): An email delivery flow diagram, from mail app to inbox with a bounce path, written as JSON so any language or AI agent can produce it. - [Sign-up flow diagram drawn from a Mermaid flowchart](https://open-diagram.dev/diagrams/signup-flow-from-mermaid.md): A sign-up flow drawn from a Mermaid flowchart file. What open-diagram keeps, what it changes, and how to get right-angle lines. - [Release cycle diagram as a ring, written as JSON](https://open-diagram.dev/diagrams/release-cycle-ring-diagram.md): A release cycle drawn as a ring, with product goals in the middle, written as JSON. How the ring layout places panels and joins them. - [Incident response process diagram, drawn from Python](https://open-diagram.dev/diagrams/incident-response-process.md): An incident response process diagram, from the first alert to the lessons learned, drawn from Python with owners, statuses and line labels. - [Smart home system diagram, from sensor to phone, in Python](https://open-diagram.dev/diagrams/smart-home-system.md): A smart home system diagram, from room sensors to a phone app, drawn from Python, with a planned overnight update path and statuses. - [Concept map of how git stores a project, drawn from Python](https://open-diagram.dev/diagrams/concept-map.md): A concept map of how git stores a project, its objects and the links between them, with one worked example, drawn from Python or JSON. - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md): An AWS architecture diagram template with an account, a VPC and subnets around API Gateway, Lambda, RDS and S3, as JSON with AWS icons. - [AWS ETL data pipeline diagram template, as JSON](https://open-diagram.dev/diagrams/aws-etl-pipeline.md): An AWS ETL data pipeline diagram template in six numbered sections, from MWAA orchestration to QuickSight dashboards, as JSON with AWS icons. - [Azure web app architecture diagram template, as JSON](https://open-diagram.dev/diagrams/azure-web-app.md): An Azure web app architecture diagram template, Front Door to App Service with SQL, Redis cache, Key Vault and Blob Storage, as JSON. - [Google Cloud event pipeline diagram template, as JSON](https://open-diagram.dev/diagrams/gcp-event-pipeline.md): A Google Cloud event pipeline diagram template, from Pub/Sub through Cloud Run to BigQuery and Vertex AI, as JSON with Google Cloud icons. --- # Layered architecture diagram with a side panel, from Python If you explain a product as a stack of layers, this page shows one drawn from 32 lines of Python. The example is an invented web product, from the people at the top to the data at the bottom, with a side panel for sign-in. ![A web product, top to bottom](https://open-diagram.dev/images/pages/diagrams-layered-architecture-1.svg) A web product, top to bottom. Drawn by open-diagram 0.6.2 from `examples/layers.py`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/layers.py The picture as text: ```text A web product, top to bottom States shown: Live, Being built, In trial, Planned, Retiring. Solid lines: data flows today. Dotted lines: connection to build. Blocks, left to right: - People: Shoppers; Store staff; Partners - Apps: Website; Mobile app; Staff tablets (retiring) - Services: Search; Orders; Payments; Notifications (being built) - Data: Main database; Search index; Event log (planned) - Sign-in and access: Single sign-on; Passkeys (in trial); Audit log. Owner: Security team Lines: - People -> Apps - Apps -> Services - Services -> Data - Sign-in and access -> Apps (connection to build) - Sign-in and access -> Services (connection to build) ``` ## What does this layered diagram show? Four layers, each one wide panel, joined top to bottom by lines. The dotted lines from the Sign-in and access panel to Apps and Services are connections still to build. ## When is a layered diagram useful? When the question is what sits on what. Anything that serves several layers at once, such as sign-in, goes beside the stack, so the stack stays one column. ## Which building blocks draw it? ```python """Stacked layers with a side panel: a web product from the people who use it down to its data. Run: python3 examples/layers.py""" import os from open_diagram import Diagram, Panel, Tile, Tiles HERE = os.path.dirname(os.path.abspath(__file__)) LAYERS = [ ("People", ["Shoppers", "Store staff", "Partners"], "accent"), ("Apps", ["Website", "Mobile app", Tile("Staff tablets", status="retiring")], "default"), ("Services", ["Search", "Orders", "Payments", Tile("Notifications", status="building")], "default"), ("Data", ["Main database", "Search index", Tile("Event log", status="planned")], "neutral"), ] def build() -> Diagram: d = Diagram("A web product, top to bottom", tag="EXAMPLE") layers = d.stack([Panel(name, Tiles(items, cols=len(items)), tone=tone) for name, items, tone in LAYERS], gap=36) for upper, lower in zip(layers, layers[1:]): d.link(upper, lower, start="bottom", end="top") side = Panel("Sign-in and access", Tiles(["Single sign-on", Tile("Passkeys", status="trial"), "Audit log"], cols=1), footer="Owner: Security team") middle = (layers[1].y + layers[2].bottom) / 2 access = d.add(side, layers[0].right + 96, middle - side.measure(d.theme)[1] / 2) d.link(access, layers[1], start="left", end="right", kind="planned") d.link(access, layers[2], start="left", end="right", kind="planned") return d if __name__ == "__main__": build().save(os.path.join(HERE, "..", "docs", "images", "layers")) ``` - `d.stack()` places the layers top to bottom, all as wide as the widest. - `Tiles(items, cols=len(items))` puts each layer's tiles in one row. - `tone="accent"` gives People its soft yellow header. - `start="bottom", end="top"` joins the bottom of one layer to the top of the next. - `d.add(side, x, y)` places the side panel 96 px right of the stack, centred between Apps and Services. `side.measure(d.theme)` gives its size before it goes on the page. - `kind="planned"` makes the two side lines dotted. To add a layer, add one line to `LAYERS`. The loop that joins the layers includes it. ## How do I write it as JSON? JSON has no `stack`, but one column of panels draws the same way. Put the side panel in a second column, and it is centred on the whole stack. ```json { "title": "A web product, top to bottom", "columns": [ [{"id": "people", "title": "People", "tone": "accent", "tiles": ["Shoppers", "Store staff", "Partners"], "cols": 3}, {"id": "apps", "title": "Apps", "tiles": ["Website", "Mobile app"], "cols": 3}, {"id": "services", "title": "Services", "tiles": ["Search", "Orders", "Payments"], "cols": 3}, {"id": "data", "title": "Data", "tiles": ["Main database", {"label": "Event log", "status": "planned"}], "cols": 3}], [{"id": "access", "title": "Sign-in and access", "tiles": ["Single sign-on", "Audit log"], "cols": 1}] ], "row_gap": 36, "gap": 96, "links": [ {"from": "people", "to": "apps", "start": "bottom", "end": "top"}, {"from": "apps", "to": "services", "start": "bottom", "end": "top"}, {"from": "services", "to": "data", "start": "bottom", "end": "top"}, {"from": "access", "to": "services", "start": "left", "end": "right", "kind": "planned"} ] } ``` ![A web product, top to bottom](https://open-diagram.dev/images/pages/diagrams-layered-architecture-3.svg) The check: 0 layout problems ## How do I make my own? After `pip install open-diagram`, copy `examples/layers.py` and change the names, tiles and tones in the `LAYERS` list. Then run `open-diagram check layers.py` and `open-diagram draw layers.py`. The [Python reference](../docs/python.html) lists every block. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/layered-architecture.html See also: - [Systems map diagram with live and planned parts, from Python](https://open-diagram.dev/diagrams/systems-map.md) - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md) - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md) --- # Release cycle diagram as a ring, written as JSON Teams who work in a loop can draw it as a ring. This page's example is an invented product team's release cycle, with its goals in the middle, in a 25-line JSON file. ![A product team's release cycle](https://open-diagram.dev/images/pages/diagrams-release-cycle-ring-diagram-1.svg) A product team's release cycle. Drawn by open-diagram 0.6.2 from `examples/release_cycle.json`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/release_cycle.json The picture as text: ```text A product team's release cycle Written as JSON with the ring layout. Draw it with: open-diagram draw examples/release_cycle.json States shown: Live, Being built, In trial. Solid lines: data flows today. Blocks, left to right: - Learn: Customer calls; Team retro - Measure: Usage; Error alerts (being built) - Plan: Roadmap; Pick the next bet - Product goals: Keep customers; Grow usage - Ship: Staged rollout; Release notes - Build: Write code; Code review - Test: Automated tests; Beta group (in trial) Lines: - Plan -> Build - Build -> Test - Test -> Ship - Ship -> Measure - Measure -> Learn - Learn -> Plan, labeled "next cycle" ``` ## What does this ring diagram show? Six stages around a circle. The line from Learn back to Plan, labelled "next cycle", closes the loop. ## When is a ring better than columns? When the last step leads back to the first. In columns, that line runs the width of the picture in a lane, as the rollback line does in the release pipeline example. In a ring it is one more short line between neighbours. ## How does the ring layout work? Write `"ring"` where a flow would have `"columns"`, and list the panels in order: ```json { "title": "A product team's release cycle", "subtitle": "Written as JSON with the ring layout. Draw it with: open-diagram draw examples/release_cycle.json", "tag": "EXAMPLE", "ring": [ {"id": "plan", "title": "Plan", "tiles": ["Roadmap", "Pick the next bet"], "cols": 1}, {"id": "build", "title": "Build", "tiles": ["Write code", "Code review"], "cols": 1}, {"id": "test", "title": "Test", "tiles": ["Automated tests", {"label": "Beta group", "status": "trial"}], "cols": 1}, {"id": "ship", "title": "Ship", "tiles": ["Staged rollout", "Release notes"], "cols": 1}, {"id": "measure", "title": "Measure", "tiles": ["Usage", {"label": "Error alerts", "status": "building"}], "cols": 1}, {"id": "learn", "title": "Learn", "tiles": ["Customer calls", "Team retro"], "cols": 1} ], "center": [ {"id": "goals", "title": "Product goals", "tone": "accent", "tiles": ["Keep customers", "Grow usage"], "cols": 1} ], "gap": 84, "links": [ {"from": "plan", "to": "build"}, {"from": "build", "to": "test"}, {"from": "test", "to": "ship"}, {"from": "ship", "to": "measure"}, {"from": "measure", "to": "learn"}, {"from": "learn", "to": "plan", "label": "next cycle"} ] } ``` - The first panel goes at the top and the rest follow clockwise. `start_angle` moves the starting point. The default, -90, is the top. - The ring grows until every panel is at least `gap` from every other, here 84 px, and from the panels in `center`. - `center` lists the middle panels. `"tone": "accent"` gives Product goals its yellow header. - Each line leaves and enters on the sides where its two panels face each other, so no link needs a `start` or `end`. ## How do I draw a ring from Python? `d.ring()` takes the ring panels and the centre panels and returns both lists. Join each panel to the next, and the last back to the first: ```python from open_diagram import Diagram, Panel, Tile def build(): d = Diagram("A product team's release cycle") ring, (goals,) = d.ring( [Panel("Plan", ["Roadmap"]), Panel("Build", ["Write code"]), Panel("Test", [Tile("Beta group", status="trial")]), Panel("Ship", ["Staged rollout"]), Panel("Learn", ["Customer calls"])], center=[Panel("Product goals", ["Keep customers"], tone="accent")]) for a, b in zip(ring, ring[1:] + ring[:1]): d.link(a, b, start="auto", end="auto") return d ``` ![A product team's release cycle](https://open-diagram.dev/images/pages/diagrams-release-cycle-ring-diagram-3.svg) The check: 0 layout problems A plain list of words in a `Panel`, such as `["Roadmap"]`, becomes its tiles. ## How do I make my own? Open the example in the editor, or copy `examples/release_cycle.json`. Rename the stages, change their tiles, and add or remove panels: the ring resizes. After `pip install open-diagram`, `open-diagram check release_cycle.json` and `open-diagram draw release_cycle.json` check and draw your copy. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/release-cycle-ring-diagram.html See also: - [Email delivery flow diagram, written as JSON](https://open-diagram.dev/diagrams/email-delivery-flow.md) - [CI/CD release pipeline diagram, drawn from Python](https://open-diagram.dev/diagrams/ci-cd-release-pipeline.md) - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md) --- # Sign-up flow diagram drawn from a Mermaid flowchart If you already write flowcharts in Mermaid, a text format for diagrams, this page shows what open-diagram does with one. The example is a 20-line sign-up flow, drawn with `open-diagram draw signup_flow.mmd` and checked like any other diagram. ![How a new account is created](https://open-diagram.dev/images/pages/diagrams-signup-flow-from-mermaid-1.svg) How a new account is created. Drawn by open-diagram 0.6.2 from `examples/signup_flow.mmd`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/signup_flow.mmd The picture as text: ```text How a new account is created States shown: Live, Being built, Planned. Solid lines: data flows today. Dotted lines: connection to build. Blocks, left to right: - Sign-up form - Check details - Create account - Send welcome email - Set up profile (being built) - Start free trial (planned) - Ready to use Groups: - Account service: Create account, Send welcome email, Set up profile, Start free trial Lines: - Sign-up form -> Check details - Check details -> Create account, labeled "valid" - Check details -> Sign-up form, labeled "try again" - Create account -> Send welcome email - Create account -> Set up profile - Create account -> Start free trial (connection to build) - Send welcome email -> Ready to use - Set up profile -> Ready to use - Sign-up form -> Ready to use ``` ## What does open-diagram read from the file? ```mermaid --- title: How a new account is created --- %% Drawn from Mermaid: open-diagram draw examples/signup_flow.mmd flowchart LR form[Sign-up form] --> check{Check details} check -->|valid| create[Create account] check -->|try again| form create --> email[Send welcome email] create --> profile[Set up profile]:::building create -.-> trial[Start free trial]:::planned email --> ready([Ready to use]) profile --> ready form --> ready subgraph service [Account service] create email profile trial end ``` - The `title:` in the front matter becomes the diagram title. - `-->|valid|` becomes a line labelled "valid". - `-.->` becomes a dotted line, a connection still to build. - `:::building` and `:::planned` set a status. The statuses are live, building, trial, planned and retiring. - The `subgraph` becomes the shaded Account service group. - Lines that point backwards or skip a step run above or below the picture. Here both run above: the line back to the form, and the line from the form to "Ready to use". ## What changes from Mermaid's own drawing? open-diagram chooses the layout, and every node becomes the same box, so the diamond around "Check details" is gone. Thick lines, two-way arrows and lines with no arrowhead become ordinary arrows. Styling lines such as `classDef` and `style` are ignored. Other diagram types, such as `sequenceDiagram`, and the newer shape syntax, `A@{ shape: … }`, stop the command with the line number: ```text error: line 1: expected 'flowchart LR' or 'graph TD' first, got 'sequenceDiagram' ``` If a picture needs those, keep it in Mermaid. ## How do I get right-angle lines? Set Mermaid's `curve` to `step` in the front matter. open-diagram then draws straight runs that meet at right angles: ```mermaid --- title: How a new account is created config: flowchart: curve: step --- flowchart LR form[Sign-up form] --> check{Check details} check -->|valid| create[Create account] check -->|try again| form create --> email[Send welcome email] create -.-> trial[Start free trial]:::planned email --> ready([Ready to use]) ``` ![How a new account is created](https://open-diagram.dev/images/pages/diagrams-signup-flow-from-mermaid-3.svg) The check: 0 layout problems A `%%{init: {"flowchart": {"curve": "step"}}}%%` line does the same. ## How do I draw my own flowchart? 1. Install open-diagram: `pip install open-diagram`. 2. Save your flowchart as a `.mmd` file, or open the example in the editor and change it in your browser. 3. Run `open-diagram check yourfile.mmd`. If it names a line of the file, fix that line. 4. Run `open-diagram draw yourfile.mmd` to write the SVG and PNG. Mermaid files take no icons. For icons, move the diagram to JSON or Python. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/signup-flow-from-mermaid.html See also: - [Convert a Mermaid flowchart to a checked SVG and PNG](https://open-diagram.dev/guides/convert-mermaid.md) - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md) - [Email delivery flow diagram, written as JSON](https://open-diagram.dev/diagrams/email-delivery-flow.md) --- # Smart home system diagram, from sensor to phone, in Python This invented smart home system, from the devices in each room to the apps on a phone, is for anyone who explains a connected-device product. open-diagram draws it from a 35-line Python script. ![A smart home, from sensor to phone](https://open-diagram.dev/images/pages/diagrams-smart-home-system-1.svg) A smart home, from sensor to phone. Drawn by open-diagram 0.6.2 from `examples/smart_home.py`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/smart_home.py The picture as text: ```text A smart home, from sensor to phone States shown: Live, Being built, In trial, Retiring. Solid lines: data flows today. Dotted lines: connection to build. Blocks, left to right: - Devices (In every room): Thermostat; Door lock; Lights; Motion sensors - Home hub (Talks to every device): Device pairing; Local rules; Works offline (being built) - Cloud: Device registry; Usage history; Firmware updates (being built). Owner: Platform team - Apps: Phone app; Voice assistants (in trial); Web dashboard (retiring). Owner: Apps team Lines: - Devices -> Home hub - Home hub -> Cloud - Cloud -> Apps - Apps -> Home hub, labeled "At home, the phone talks to the hub directly" - Cloud -> Devices (connection to build), labeled "New firmware sent to devices at night" Note: Example. An invented product. Every part and status is made up. ``` ## Which way does the data go? Left to right, from the devices to the home hub, the cloud and the apps. Two lines take shortcuts in lanes. Along the top, the phone talks to the hub directly when it is at home. Along the bottom, a dotted line marks a firmware path still to build. Working offline and firmware updates are being built. ## Which building blocks draw it? ```python """An invented smart home system, from the sensors in each room to the apps on a phone. Run: python3 examples/smart_home.py""" import os from open_diagram import Diagram, Note, Panel, Tile, Tiles HERE = os.path.dirname(os.path.abspath(__file__)) def build() -> Diagram: d = Diagram("A smart home, from sensor to phone", tag="EXAMPLE", note=Note("Example", "An invented product.", "Every part and status is made up.")) (devices,), (hub,), (cloud,), (apps,) = d.columns([ [Panel("Devices", Tiles(["Thermostat", "Door lock", "Lights", "Motion sensors"], cols=2), sub="In every room")], [Panel("Home hub", Tiles(["Device pairing", "Local rules", Tile("Works offline", status="building")], cols=1), sub="Talks to every device")], [Panel("Cloud", Tiles(["Device registry", "Usage history", Tile("Firmware updates", status="building")], cols=1), footer="Owner: Platform team")], [Panel("Apps", Tiles(["Phone app", Tile("Voice assistants", status="trial"), Tile("Web dashboard", status="retiring")], cols=1), tone="neutral", footer="Owner: Apps team")], ], gap=80, valign="center") d.link(devices, hub) d.link(hub, cloud) d.link(cloud, apps) top = min(p.y for p in d.placed) - 56 bottom = max(p.bottom for p in d.placed) + 44 d.link(apps, hub, start="top", end="top", via_y=top, label="At home, the phone talks to the hub directly") d.link(cloud, devices, start="bottom", end="bottom", via_y=bottom, kind="planned", label="New firmware sent to devices at night") return d if __name__ == "__main__": build().save(os.path.join(HERE, "..", "docs", "images", "smart_home")) ``` - `d.columns()` places one panel per column, 80 px apart, centred against the tallest. - `Tiles([...], cols=2)` puts the four devices in a two-by-two grid. The other panels use one column. - `sub="In every room"` adds a line under a panel title. - Both shortcut lines use `via_y`. The script reads the panels' positions from `d.placed` and sets one lane above them and one below. - `kind="planned"` makes the firmware line dotted, in its lane. ## How do I show that a part has shipped? Change its status in the script, or keep statuses in a separate file and draw with `--statuses`. When the two tiles being built ship: ```json {"Firmware updates": "live", "Works offline": "live"} ``` ```bash open-diagram draw smart_home.py --statuses states.json ``` Both tiles take the plain look, and "Being built" drops out of the key. A status file changes panels and tiles only, so the firmware line stays dotted until the script changes it. ## How do I make my own? Copy `examples/smart_home.py` and put in your own devices, services and apps. Install open-diagram with `pip install open-diagram`, then run `open-diagram check smart_home.py` and `open-diagram draw smart_home.py`. ## When is this kind of diagram useful? When a product has parts in the home and parts online, and a reader needs to know which path the data takes. The lanes show the exceptions without crossing the main flow. Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/smart-home-system.html See also: - [Systems map diagram with live and planned parts, from Python](https://open-diagram.dev/diagrams/systems-map.md) - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md) - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md) --- # Systems map diagram with live and planned parts, from Python This page is for anyone who needs a whole system in one picture. Its systems map shows Quillfin Video, an invented video platform, with the owner and state of every part, drawn from one Python script. ![Quillfin Video: from upload to screen](https://open-diagram.dev/images/pages/diagrams-systems-map-1.svg) Quillfin Video: from upload to screen. Drawn by open-diagram 0.6.2 from `examples/systems_map.py`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/examples/systems_map.py The picture as text: ```text Quillfin Video: from upload to screen What runs today, what is being built, and what comes next States shown: Live, Being built, In trial, Planned, Retiring. Solid lines: data flows today. Dotted lines: connection to build. Rollout: 1. Encode on GPUs (Processing); 2. One record for each video (Video record); 3. Recommendations (Recommendations). Blocks, left to right: - Where videos come from (Four ways in): Creator app; Web uploader; Partner API; Live streams (in trial). Owner: Creator team - Processing [step 1]: Upload checks; Transcoding; GPU encoding (being built); Auto captions (planned). Owner: Media team - Video record [step 2, being built] (Everything known about each video): map: Channel publishes Video; Video encoded as Rendition; Video has Caption; Video watched in View; Caption written in Language. example 'Example: video 7Q4M': Length 12 min 40 s; Renditions 1080p, 720p, 480p; Captions English, Spanish; Status Ready to play. Owner: Media team - Storage: Files: Original files; Renditions. Records: Metadata database; Search index (in trial); Cold archive (planned). Owner: Platform team - Recommendations [step 3, planned]: Watch history; Ranking model. Owner: Not yet named - Player apps: Web; Phones; TV (being built). Owner: Apps team - Service health: Playback errors; Start-up time; Old dashboards (retiring). Owner: Reliability team Groups: - Media pipeline (Run by the media team): Processing, Video record Lines: - Where videos come from -> Processing - Processing -> Video record - Video record -> Storage - Video record -> Recommendations (connection to build) - Storage -> Player apps - Storage -> Service health, labeled "logs" - Recommendations -> Player apps (connection to build) - Where videos come from -> Player apps, labeled "Live streams skip processing" - Where videos come from -> Service health, labeled "Upload failures go straight to service health" Note: Example. Quillfin Video is an invented company. Every system, owner and status is made up. ``` ## What does this systems map show? A video's path from upload to screen, in four columns. Recommendations is planned, so its panel and both of its lines are dotted. Two lines skip the columns, one along the top and one along the bottom. ## When is a systems map useful? When a team needs one answer, for every part, to "is this live?" and "who runs it?". As work ships, keep the statuses in a small file: change one word and redraw, without touching the script. ## Which building blocks draw it? Seven panels, placed in four columns by `d.columns()`. - `Panel` is each box. `footer=` adds the owner line, `step=` the numbered circle, and `status=` marks the whole panel. - `Tiles` lays out the small boxes in a grid: `cols=2` for two columns, `label="Files"` to name a section. - `Tile("GPU encoding", status="building")` gives one tile a status. The key lists only the statuses the picture uses. - `Graph` and `Card`, side by side in a `Row`, fill the Video record panel with a small map and one worked example. - `d.group()` draws the shaded Media pipeline area. - `d.link()` draws each line, and `kind="planned"` makes it dotted. `via_y` sends a line through a lane: a clear strip above or below the panels. - `steps=` on the `Diagram` writes the rollout key, and `Note` the box at the top right. ## How do I make my own? 1. Install open-diagram: `pip install open-diagram`. 2. Copy `examples/systems_map.py` and replace the words with your own systems, owners and statuses. 3. Run `open-diagram check systems_map.py`. Each message names the parts and a fix. 4. Run `open-diagram draw systems_map.py` to write the SVG and PNG. ## Can I write it without Python? Yes, in [JSON](../guides/json-from-any-language.html), plain data that any language or AI agent can produce. In this short version, `"lane": "top"` takes the place of `via_y`: ```json { "title": "Quillfin Video, the short version", "steps": [[1, "Encode on GPUs"]], "steps_label": "Rollout", "columns": [ [{"id": "in", "title": "Where videos come from", "tiles": ["Creator app", {"label": "Live streams", "status": "trial"}], "cols": 1}], [{"id": "proc", "title": "Processing", "step": 1, "tiles": ["Upload checks", {"label": "GPU encoding", "status": "building"}], "cols": 1}, {"id": "rec", "title": "Recommendations", "status": "planned", "tiles": ["Watch history"], "cols": 1}], [{"id": "apps", "title": "Player apps", "tiles": ["Web", "Phones"], "cols": 1, "footer": "Owner: Apps team"}] ], "groups": [{"label": "Media pipeline", "members": ["proc", "rec"]}], "links": [ {"from": "in", "to": "proc"}, {"from": "proc", "to": "apps"}, {"from": "rec", "to": "apps", "kind": "planned"}, {"from": "in", "to": "apps", "lane": "top", "label": "Live streams skip processing"} ] } ``` ![Quillfin Video, the short version](https://open-diagram.dev/images/pages/diagrams-systems-map-2.svg) The check: 0 layout problems Updated November 25, 2026. Web page: https://open-diagram.dev/diagrams/systems-map.html See also: - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md) - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md) - [Business process map of a furniture store, drawn from Python](https://open-diagram.dev/diagrams/business-process-map.md) - [Layered architecture diagram with a side panel, from Python](https://open-diagram.dev/diagrams/layered-architecture.md) --- # open-diagram vs archify for architecture diagrams This page is for people choosing between archify and open-diagram, two tools that check the layout of every diagram they draw. It shows one flow drawn by both, and what each hands back. ## What is the difference? archify is an agent skill: your AI agent writes archify's JSON from your description or your code, and archify builds a self-contained, interactive HTML page. open-diagram is a Python library that writes SVG files, which stay sharp at any size, and PNG files. It also reads JSON and Mermaid, and runs from the command line or as an MCP server, a small program that lets an AI app such as Claude Code call it. ## How do the two draw the same flow? Each tool drew the same photo upload flow from its own JSON file, with default settings. ![The photo upload flow drawn by archify](https://open-diagram.dev/images/compare/archify.png) archify. Made in 0.28 s. Its layout checks passed. [Source](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.architecture.json) ![The photo upload flow drawn by open-diagram](https://open-diagram.dev/images/compare/open-diagram.png) open-diagram. Made in 0.59 s. 0 layout problems. [Source](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.json) archify 3.3.0 and open-diagram 0.5.0, timed on one Mac on November 23, 2026, median of five runs. The archify file asks for automatic placement; the open-diagram file sets the columns, a lane above the boxes and the ends of one line. Both files are in the library's [docs/compare](https://github.com/lukendeasy/open-diagram/tree/main/docs/compare) folder. ## When should you pick archify? Pick archify when the reader will explore the diagram. Its output is one HTML file you open in a browser, with node details and path exploration built in. It exports PNG, WebP and JPG images, prints to PDF, and records a story video at 1080p. archify draws more kinds of diagram. It lists ten: architecture, workflow, sequence, data flow, lifecycle, entity relationship (ERD), class, tree, timeline and waterfall. It can also answer a question as a one-page explainer. Before delivery, "schema, layout, HTML/SVG, route, and label-to-route clearance checks must all pass". It installs as a skill for Claude Code, Codex, Cursor and other agents, and it is free and open source under Apache 2.0. ## When does open-diagram fit better? Pick open-diagram when you need a picture file: an SVG or PNG for a README, a slide or a document. Its SVG draws text as shapes, so the picture looks the same in a browser, PowerPoint, Keynote or Figma. A person can write the diagram too, in Python or JSON by hand, or as a Mermaid flowchart they already have. The check reports each problem as a sentence that names the parts: ```text 'Storage' and 'Recommendations' are only 9 px apart (minimum 16) ``` It also works in AI apps that use MCP rather than skills, because open-diagram has both: an MCP server that runs on your computer, and an agent skill. A GitHub Action checks the diagrams on every push, fails if a layout problem appears, and can redraw them. open-diagram is free and MIT licensed. ## Can I move from archify to open-diagram? Only by hand: open-diagram does not read archify's JSON. Each component becomes a panel, open-diagram's box, with its sublabel as the panel's text, and each connection becomes a link. The [docs/compare](https://github.com/lukendeasy/open-diagram/tree/main/docs/compare) folder has the photo upload flow in both formats, side by side. ## How do they compare on input, output, license and price? | | open-diagram | archify | | --- | --- | --- | | Input | Python, JSON, Mermaid flowcharts | JSON written by your agent | | Layout | You choose the columns; it spaces the boxes and routes the lines | Automatic when the JSON sets `layout.mode` to `"auto"` | | Checks layout | Yes, and names each problem | Yes: schema, layout, HTML/SVG, route and label clearance | | Output | SVG, PNG | Self-contained HTML page; PNG, WebP, JPG, PDF by printing, video | | MCP server | Yes, runs on your computer | Not in its docs | | Agent skill | Yes | Yes | | License | MIT | Apache-2.0, with historical MIT grants | | Price | Free | Free | Sources: open-diagram's [README](https://github.com/lukendeasy/open-diagram#readme), [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md) and [command line](https://github.com/lukendeasy/open-diagram/blob/main/docs/cli.md) docs. archify's [repository](https://github.com/tt-a1i/archify) for every archify fact: version 3.3.2 was current on the day checked. "Not in its docs" means the linked page does not mention it. Checked November 25, 2026 Updated November 25, 2026. Web page: https://open-diagram.dev/compare/archify.html See also: - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md) --- # open-diagram vs D2 for architecture diagrams This page is for people weighing D2's own diagram language against open-diagram for an architecture diagram written as text. It times both on one flow. ## What is the difference? D2 has three layout engines and exports to SVG (a picture file that stays sharp at any size), PNG, PDF, PowerPoint, GIF and plain text. open-diagram reads Python, JSON or a Mermaid flowchart, measures every label from the font, and checks the finished layout. ## How do the two draw the same flow? Each tool drew the same photo upload flow from its own file, with default settings. ![The photo upload flow drawn by D2](https://open-diagram.dev/images/compare/d2.png) D2. Made in 0.017 s. [Source](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.d2) ![The photo upload flow drawn by open-diagram](https://open-diagram.dev/images/compare/open-diagram.png) open-diagram. Made in 0.59 s. 0 layout problems. [Source](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.json) D2 0.9.0 and open-diagram 0.5.0, timed on one Mac on November 23, 2026, median of five runs. The open-diagram file sets the columns, a lane above the boxes and the ends of one line; the D2 file leaves placement to D2. Both files are in the library's [docs/compare](https://github.com/lukendeasy/open-diagram/tree/main/docs/compare) folder. ## When should you pick D2? Pick D2 when speed matters. It drew this flow in 0.017 s; open-diagram took 0.59 s. D2 also writes PNG without a browser, where open-diagram needs Chrome, Chromium or Edge. The flow takes 27 lines of D2, against 183 lines of formatted JSON for open-diagram. For slides, its docs suggest the PowerPoint and GIF exports for diagrams built in layers, scenarios or steps. You choose the layout engine: dagre (the default), ELK, or TALA, which its makers designed for software architecture diagrams. TALA is closed source and needs a license for commercial use. Without one, it draws a watermark. Try D2 in a browser at [play.d2lang.com](https://play.d2lang.com). ## When does open-diagram fit better? Pick open-diagram when an AI agent writes the diagram. After each draft, `open-diagram check` names every overlap, cramped gap and line through a box, and the agent fixes what was named. Its MCP server, a small program that lets an AI app such as Claude Code call open-diagram, runs on your computer. Each box, called a panel, can carry more than a name: sections of text, tiles (small boxes inside it), an owner, and a state such as live, being built or planned. The key lists only the states in use. Any programming language can write the JSON, and four templates for AWS, Azure and Google Cloud give a finished start. open-diagram is free and MIT licensed. ## Can I move from D2 to open-diagram? Only by hand: open-diagram has no D2 reader. Each D2 shape becomes a panel, each container a group, and each `->` a link with the same label. A dashed line becomes a link of kind `planned`. The [docs/compare](https://github.com/lukendeasy/open-diagram/tree/main/docs/compare) folder has the photo upload flow as `photo-upload.d2` and as `photo-upload.json`, to read side by side. ## How do they compare on input, output, license and price? | | open-diagram | D2 | | --- | --- | --- | | Input | Python, JSON, Mermaid flowcharts | D2 text | | Layout | You choose the columns; it spaces the boxes and routes the lines | Automatic, with three engines: dagre (default), ELK, TALA | | Checks layout | Yes, and names each problem | Not in its docs | | Output | SVG, PNG | SVG, PNG, PDF, PowerPoint, GIF, ASCII text | | MCP server | Yes, runs on your computer | Not in its docs | | License | MIT | MPL-2.0 | | Price | Free | Free. TALA "requires a license for any commercial use" | Sources: open-diagram's [README](https://github.com/lukendeasy/open-diagram#readme), [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md) and [JSON](https://github.com/lukendeasy/open-diagram/blob/main/docs/json.md) docs. D2's [home page](https://d2lang.com/) and [repository](https://github.com/terrastruct/d2) (license, engines, playground), [exports](https://d2lang.com/tour/exports/) (formats, PNG without a browser, slides), [layouts](https://d2lang.com/tour/layouts/) and the [TALA repository](https://github.com/terrastruct/TALA) (license terms, watermark). "Not in its docs" means the linked pages do not mention it. Checked November 25, 2026 Updated November 25, 2026. Web page: https://open-diagram.dev/compare/d2.html See also: - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md) - [open-diagram vs PlantUML for architecture diagrams](https://open-diagram.dev/compare/plantuml.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) --- # open-diagram vs draw.io for architecture diagrams This page is for people who build architecture diagrams by hand in draw.io. It shows what open-diagram draws from a text file instead, and when draw.io stays the better tool. ## What is the difference? draw.io is an editor: you drag each shape onto a page and put it where you want. open-diagram has no page. You write the diagram in Python, JSON or a Mermaid flowchart, and it spaces the boxes, routes the lines and checks the result. ## What does open-diagram draw from a text file? This photo upload flow comes from one [JSON file](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.json) that lists the boxes in columns, then the groups and the lines. ![The photo upload flow drawn by open-diagram](https://open-diagram.dev/images/compare/open-diagram.png) open-diagram. Made in 0.59 s. 0 layout problems. [Source](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.json) ## When should you pick draw.io? Pick draw.io when you want to decide where each shape goes, how each line bends and what each part looks like. It is free with no sign-up, its source is Apache 2.0 licensed, and it exports SVG (a picture file that stays sharp at any size), PNG and PDF. There is a desktop app, and you choose where files are stored. draw.io takes text too. It turns a pasted Mermaid diagram into native draw.io shapes you can restyle, though regenerating it from the Mermaid text resets any shape you moved. Its official MCP server, a small program that lets an AI app such as Claude Code call draw.io, takes draw.io XML, Mermaid, PlantUML or CSV and shows the diagram in the chat. The viewer in that server's app includes a layout check. ## When does open-diagram fit better? Pick open-diagram when the diagram sits in a repository next to the code and changes with it. The file is text, so a pull request shows which word or line changed. States that change often can sit in a small file, such as `{"Fraud checks": "live"}`. When work ships, change one word and the picture follows. A GitHub Action checks the diagrams on every push, fails if a layout problem appears, and can redraw them. When an AI agent does the drawing, `open-diagram check` names each problem by the labels involved, such as two boxes too close or a line through a box, so the agent can fix the layout without seeing it. open-diagram is free and MIT licensed. ## Can I move from draw.io to open-diagram? Only by hand: open-diagram does not read draw.io files. Each shape's label becomes the title of a panel, open-diagram's box; each connector becomes a link, and each container a group. If the diagram started as Mermaid, draw.io keeps the Mermaid source, and `open-diagram draw flow.mmd` draws a Mermaid flowchart. ## How do they compare on input, output, license and price? | | open-diagram | draw.io | | --- | --- | --- | | Input | Python, JSON, Mermaid flowcharts | An editor; also turns Mermaid into shapes | | Layout | You choose the columns; it spaces the boxes and routes the lines | By hand | | Checks layout | Yes, and names each problem | In the viewer of its MCP server's app | | Output | SVG, PNG | SVG, PNG, PDF | | MCP server | Yes, runs on your computer | Yes, official; takes XML, Mermaid, PlantUML, CSV | | License | MIT | Apache-2.0 | | Price | Free | Free | Sources: open-diagram's [README](https://github.com/lukendeasy/open-diagram#readme), [command line](https://github.com/lukendeasy/open-diagram/blob/main/docs/cli.md) and [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md) docs. draw.io's [home page](https://www.drawio.com/) (free, no sign-up, exports, desktop app, storage), [repository](https://github.com/jgraph/drawio) (license), [Mermaid post](https://www.drawio.com/blog/mermaid-diagrams) (native shapes, layout reset), [MCP server](https://github.com/jgraph/drawio-mcp) (inputs) and its [app README](https://github.com/jgraph/drawio-mcp/blob/main/mcp-app-server/README.md) (layout check). Checked November 25, 2026 Updated November 25, 2026. Web page: https://open-diagram.dev/compare/drawio.html See also: - [open-diagram vs Excalidraw for architecture diagrams](https://open-diagram.dev/compare/excalidraw.md) - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md) - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md) --- # open-diagram vs Eraser for architecture diagrams This page is for teams deciding where to keep architecture diagrams: in Eraser's hosted workspace, or as files next to their code, drawn by open-diagram. Both work with or without AI. ## What is the difference? Eraser is a hosted app for technical diagrams and documents. You draw by hand, write its diagram-as-code language, or describe the diagram to its AI, then edit the result any of those three ways. open-diagram is a free, MIT-licensed library that runs on your computer. You or an AI agent write the diagram in Python, JSON or a Mermaid flowchart. It draws SVG files, which stay sharp at any size, and PNG files, then checks the layout. ## When should you pick Eraser? Pick Eraser when a team wants diagrams and documents in one shared workspace. It can start from a sentence: its AI drafts a diagram from a description or from pasted code. Its diagram-as-code covers five kinds of diagram: flow charts, entity relationship diagrams, cloud architecture, sequence diagrams and BPMN, a notation for business processes. Eraser lays these out by itself, and a freeform diagram lets you place every element instead. It exports PDF, PNG, SVG and Markdown on every plan. Its official MCP server, a program that lets an AI coding agent work in an Eraser workspace, can create, read, search and update diagrams, documents and files. The server is free to use within the free plan's limits, and calls that use AI spend AI credits. The free plan includes 3 files and 3 AI credits. Business costs "$45 / member / mo billed annually, or $60 monthly", with 100 AI credits a month. ## When does open-diagram fit better? Pick open-diagram when diagrams belong in a repository next to the code. The file is text, so a pull request shows each changed word. A GitHub Action checks the diagrams on every push, fails if a layout problem appears, and can redraw them. For diagrams that should not leave your computer, the library and its MCP server run locally, with no account to create. When the layout has to be right without a person looking, `open-diagram check` names each problem by the labels involved: ```text 'Storage' and 'Recommendations' are only 9 px apart (minimum 16) ``` An AI agent reads the message, moves a box and checks again. open-diagram costs nothing at any number of diagrams or users. ## Can I move from Eraser to open-diagram? Only by hand: open-diagram does not read Eraser's diagram-as-code. Each node becomes a panel, open-diagram's box, and each connection becomes a link with the same label. ## How do they compare on input, output, license and price? | | open-diagram | Eraser | | --- | --- | --- | | Input | Python, JSON, Mermaid flowcharts | Editor, diagram-as-code, AI prompts | | Layout | You choose the columns; it spaces the boxes and routes the lines | Automatic for diagram-as-code; by hand for freeform | | Checks layout | Yes, and names each problem | Not in its docs | | Output | SVG, PNG | PDF, PNG, SVG, Markdown | | MCP server | Yes, runs on your computer | Yes, hosted; AI calls use credits | | License | MIT | No license in its docs; a hosted service | | Price | Free | Free: 3 files, 3 AI credits. Business "$45 / member / mo billed annually, or $60 monthly". Business Plus "$42 / member / mo", "Min. 10 seats", billed annually. Enterprise "Custom" | Sources: open-diagram's [README](https://github.com/lukendeasy/open-diagram#readme), [command line](https://github.com/lukendeasy/open-diagram/blob/main/docs/cli.md) and [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md) docs. Eraser's [docs home](https://docs.eraser.io/) (sections, no license), [diagram-as-code](https://docs.eraser.io/docs/diagram-as-code) (diagram kinds, automatic layout, freeform), [Eraser AI](https://www.eraser.io/ai) (prompts, pasted code, three ways to edit), [MCP server](https://docs.eraser.io/mcp) (tools, free tier, credits) and [pricing](https://www.eraser.io/pricing) (plans, credits, exports). "Not in its docs" means the linked pages do not mention it. Checked November 25, 2026 Updated November 25, 2026. Web page: https://open-diagram.dev/compare/eraser.html See also: - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md) - [open-diagram vs D2 for architecture diagrams](https://open-diagram.dev/compare/d2.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) --- # open-diagram vs Excalidraw for architecture diagrams This page is for people who sketch architecture in Excalidraw and want to know when a finished diagram should come from text instead. It shows the same flow drawn by both. ## What is the difference? On Excalidraw's whiteboard you draw on an open canvas, and every shape comes out looking hand-drawn. open-diagram takes a file instead, in Python, JSON or a Mermaid flowchart, and places the boxes, routes the lines and checks the layout itself. ## How do the two draw the same flow? Excalidraw converted the Mermaid version of a photo upload flow; open-diagram drew its own JSON version. Both used default settings. ![The photo upload flow drawn by Excalidraw](https://open-diagram.dev/images/compare/excalidraw.png) Excalidraw. Made in 0.020 s inside the browser, from the Mermaid file. [Source](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.mmd) ![The photo upload flow drawn by open-diagram](https://open-diagram.dev/images/compare/open-diagram.png) open-diagram. Made in 0.59 s. 0 layout problems. [Source](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.json) Excalidraw 0.18.1, through its Mermaid converter (mermaid-to-excalidraw 3.6.0) inside Chrome, and open-diagram 0.5.0 from the command line, timed on one Mac on November 23, 2026, median of five runs. The open-diagram file sets the columns, a lane above the boxes and the ends of one line; the Mermaid file leaves placement to the converter. Both files are in the library's [docs/compare](https://github.com/lukendeasy/open-diagram/tree/main/docs/compare) folder. ## When should you pick Excalidraw? Pick Excalidraw to sketch: you move anything with the mouse as the idea changes. The editor is free and MIT licensed, and it exports PNG, SVG (a picture file that stays sharp at any size) and an open `.excalidraw` file. The free plan includes ten generative AI requests a day, and the pricing page lists text to diagram and Mermaid to Excalidraw. Excalidraw+ costs "$6 a month per user" billed annually, or "$7 a month per user" monthly. It adds an MCP server, in public beta, that lets an AI app draw into your Excalidraw+ workspace. That server "reports layout problems (text overflowing its box, arrows through shapes, overlaps) with each write". There is also an open-source Excalidraw MCP server under the MIT license. ## When does open-diagram fit better? For a finished architecture map, open-diagram fits better: boxes with several lines of detail, owners, states such as live or planned, and lines that must stay clear of every box. Its layout check is free and runs on your computer: ```bash open-diagram check plan.json ``` Each problem comes back as a sentence that names the parts, such as `'Storage' and 'Recommendations' are only 9 px apart (minimum 16)`, so an AI agent can fix the layout without seeing it. open-diagram's MCP server gives the agent that check. The file is text, so it can sit next to the code and change in the same pull request. open-diagram is free and MIT licensed. ## Can I move from Excalidraw to open-diagram? Only by hand: open-diagram does not read `.excalidraw` files. Each shape's label becomes the title of a panel, open-diagram's box; each arrow becomes a link, and each box drawn around others a group. If the drawing began as Mermaid, draw from that file instead: `open-diagram draw flow.mmd` reads Mermaid flowcharts. ## How do they compare on input, output, license and price? | | open-diagram | Excalidraw | | --- | --- | --- | | Input | Python, JSON, Mermaid flowcharts | A whiteboard; Mermaid and AI text to diagram | | Layout | You choose the columns; it spaces the boxes and routes the lines | By hand | | Checks layout | Yes, free, and names each problem | In the Excalidraw+ MCP server | | Output | SVG, PNG | PNG, SVG, `.excalidraw` file | | MCP server | Yes, runs on your computer | Excalidraw+ (public beta); an open-source server | | License | MIT | MIT | | Price | Free | Free. Plus "$6 a month per user" annually, "$7 a month per user" monthly | Sources: open-diagram's [README](https://github.com/lukendeasy/open-diagram#readme), [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md) and [Mermaid](https://github.com/lukendeasy/open-diagram/blob/main/docs/mermaid.md) docs. Excalidraw's [repository](https://github.com/excalidraw/excalidraw) (whiteboard, license, exports), [pricing](https://plus.excalidraw.com/pricing) (plans, AI requests, MCP), [Excalidraw+](https://plus.excalidraw.com/) (text to diagram), [Excalidraw+ MCP docs](https://plus.excalidraw.com/docs/mcp) (layout problems) and the [open-source MCP server](https://github.com/excalidraw/excalidraw-mcp). Checked November 25, 2026 Updated November 25, 2026. Web page: https://open-diagram.dev/compare/excalidraw.html See also: - [open-diagram vs draw.io for architecture diagrams](https://open-diagram.dev/compare/drawio.md) - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md) - [Convert a Mermaid flowchart to a checked SVG and PNG](https://open-diagram.dev/guides/convert-mermaid.md) --- # Architecture diagram tools compared: code, text and editors This page is for people choosing a tool to draw architecture diagrams, by hand or with an AI agent. It says when to pick each of nine tools, then sets their facts side by side, with sources. ## When should you pick open-diagram, and where does it fall short? Pick open-diagram for a dense architecture map that has to read well the first time, above all when an AI agent writes it. It measures every label, then checks the layout and names each problem, such as two boxes 9 px apart. It reads Python, JSON and Mermaid flowcharts, writes SVG (a picture file that stays sharp at any size) and PNG, and comes with an MCP server, a small program that lets an AI app such as Claude Code call it. It draws one kind of diagram, made of boxes, lines and groups, so it cannot draw sequence diagrams or Gantt charts. It has no canvas to drag shapes on. From Mermaid it reads flowcharts only, and draws every node as the same box. PNG needs Chrome, Chromium or Edge. In the [comparison pictures](https://github.com/lukendeasy/open-diagram/blob/main/docs/comparison.md), D2 drew the same flow in 0.017 s to open-diagram's 0.59 s, and the D2 and Mermaid files took 27 lines each, to 183 lines of formatted JSON. ## When should you pick Mermaid? Pick Mermaid when the diagram sits in a Markdown file: GitHub draws Mermaid code blocks in files, issues and pull requests. Mermaid also draws kinds of diagram open-diagram does not, such as sequence diagrams and Gantt charts. ## When should you pick D2? Pick D2 for speed, slides and a choice of layout. It drew the comparison flow fastest, exports PowerPoint and GIF, and offers three layout engines. ## When should you pick draw.io? Pick draw.io to place every shape by hand in a free editor, in the browser or a desktop app. It turns pasted Mermaid into shapes you can restyle. ## When should you pick Excalidraw? Pick Excalidraw to sketch on an open canvas in a hand-drawn style. The editor is free; Excalidraw+ adds an MCP server that reports layout problems with each change the AI makes. ## When should you pick archify? Pick archify when your agent should build an interactive HTML page for readers to explore, or when you need one of its ten diagram kinds, such as sequence or timeline. Like open-diagram, it checks the layout before it delivers. ## When should you pick mingrammer's diagrams? Pick mingrammer's diagrams when cloud provider icons carry the meaning and the code should be short. It draws from Python, with icons for AWS, Azure, Google Cloud, Kubernetes and more, and Graphviz lays it out. ## When should you pick PlantUML? Pick PlantUML for UML, the standard set of software design diagrams: sequence, class, state, timing and deployment diagrams, among others. It has its own MCP server, and you choose its license from five. ## When should you pick Eraser? Pick Eraser when a team wants a hosted workspace where AI drafts diagrams from a prompt or pasted code, and people edit them by hand, by prompt or as diagram-as-code. ## How do all nine compare? | Tool | Input | Layout | Checks layout | Output | MCP server | License | Price | | --- | --- | --- | --- | --- | --- | --- | --- | | [open-diagram](https://github.com/lukendeasy/open-diagram) | Python, JSON, Mermaid flowcharts | You choose the columns; it spaces and routes | Yes, names each problem | SVG, PNG | Yes | MIT | Free | | [Mermaid](https://mermaid.js.org/) | Mermaid text | Automatic | Not in its docs | SVG; PNG, PDF from the CLI | Yes | MIT | Free; paid plans from "$10 per user / month", billed annually | | [D2](https://d2lang.com/) | D2 text | Automatic, three engines | Not in its docs | SVG, PNG, PDF, PowerPoint, GIF, ASCII | Not in its docs | MPL-2.0 | Free; the TALA engine needs a license for commercial use | | [draw.io](https://www.drawio.com/) | Editor | By hand | In its MCP server's viewer | SVG, PNG, PDF | Yes | Apache-2.0 | Free | | [Excalidraw](https://github.com/excalidraw/excalidraw) | Whiteboard | By hand | In the Excalidraw+ MCP server | PNG, SVG, `.excalidraw` | Excalidraw+; an open-source server | MIT | Free; Plus "$6 a month per user", billed annually | | [archify](https://github.com/tt-a1i/archify) | JSON written by your agent | Automatic when asked | Yes | HTML page; PNG, WebP, JPG, PDF, video | Not in its docs; it is an agent skill | Apache-2.0 | Free | | [mingrammer's diagrams](https://github.com/mingrammer/diagrams) | Python | Automatic, by Graphviz | Not in its docs | PNG, JPG, SVG, PDF, DOT | Not in its docs | MIT | Free | | [PlantUML](https://plantuml.com/) | PlantUML text | Automatic, by Graphviz or Smetana | Not in its docs | PNG, SVG, LaTeX, EPS | Yes | GPL, LGPL, Apache, EPL or MIT | Free | | [Eraser](https://www.eraser.io/) | Editor, diagram-as-code, AI prompts | Automatic for diagram-as-code | Not in its docs | PDF, PNG, SVG, Markdown | Yes | None in its docs | Free plan; Business "$45 / member / mo billed annually, or $60 monthly" | Sources: open-diagram's [README](https://github.com/lukendeasy/open-diagram#readme), [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md) and [Mermaid](https://github.com/lukendeasy/open-diagram/blob/main/docs/mermaid.md) docs. Mermaid: [GitHub's diagram docs](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams), [introduction](https://mermaid.js.org/intro/), [CLI](https://github.com/mermaid-js/mermaid-cli), [repository](https://github.com/mermaid-js/mermaid), [MCP server](https://mermaid.ai/docs/ai/mcp-server), [pricing](https://mermaid.ai/pricing). D2: [exports](https://d2lang.com/tour/exports/), [repository](https://github.com/terrastruct/d2), [TALA](https://github.com/terrastruct/TALA). draw.io: [home page](https://www.drawio.com/), [repository](https://github.com/jgraph/drawio), [Mermaid post](https://www.drawio.com/blog/mermaid-diagrams), [MCP server](https://github.com/jgraph/drawio-mcp/blob/main/mcp-app-server/README.md). Excalidraw: [repository](https://github.com/excalidraw/excalidraw), [pricing](https://plus.excalidraw.com/pricing), [MCP docs](https://plus.excalidraw.com/docs/mcp). archify: [repository](https://github.com/tt-a1i/archify). mingrammer's diagrams: [repository](https://github.com/mingrammer/diagrams), [diagram guide](https://diagrams.mingrammer.com/docs/guides/diagram). PlantUML: [home page](https://plantuml.com/), [repository](https://github.com/plantuml/plantuml). Eraser: [Eraser AI](https://www.eraser.io/ai), [diagram-as-code](https://docs.eraser.io/docs/diagram-as-code), [MCP server](https://docs.eraser.io/mcp), [pricing](https://www.eraser.io/pricing), [docs home](https://docs.eraser.io/). "Not in its docs" means the linked pages do not mention it. Each tool's page links the source of every fact. Checked November 25, 2026 If a fact here is wrong or out of date, open a pull request on the [open-diagram-website repo](https://github.com/lukendeasy/open-diagram-website). Updated November 25, 2026. Web page: https://open-diagram.dev/compare.html See also: - [Convert a Mermaid flowchart to a checked SVG and PNG](https://open-diagram.dev/guides/convert-mermaid.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md) Pages: - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md): Mermaid draws many kinds of diagram from text. open-diagram draws dense architecture diagrams, checks their layout, and reads Mermaid flowcharts. - [open-diagram vs D2 for architecture diagrams](https://open-diagram.dev/compare/d2.md): D2 is a diagram language with three layout engines and many export formats. open-diagram draws from Python, JSON or Mermaid and checks its layout. - [open-diagram vs draw.io for architecture diagrams](https://open-diagram.dev/compare/drawio.md): draw.io is a free editor where you place every shape by hand. open-diagram draws architecture diagrams from text or code and checks their layout. - [open-diagram vs Excalidraw for architecture diagrams](https://open-diagram.dev/compare/excalidraw.md): Excalidraw is a whiteboard for hand-drawn sketches. open-diagram draws dense architecture diagrams from text or code and checks their layout for free. - [open-diagram vs archify for architecture diagrams](https://open-diagram.dev/compare/archify.md): archify and open-diagram both check their own layout. archify builds interactive HTML pages through an agent; open-diagram writes SVG and PNG files. - [open-diagram vs the Python diagrams library by mingrammer](https://open-diagram.dev/compare/mingrammer-diagrams.md): Both draw architecture from Python. mingrammer's diagrams uses cloud icons and Graphviz; open-diagram uses boxes of text and checks its layout. - [open-diagram vs PlantUML for architecture diagrams](https://open-diagram.dev/compare/plantuml.md): PlantUML draws UML and other diagrams from text. open-diagram draws dense architecture diagrams from Python, JSON or Mermaid and checks the layout. - [open-diagram vs Eraser for architecture diagrams](https://open-diagram.dev/compare/eraser.md): Eraser is a hosted app with diagram-as-code and AI diagrams. open-diagram is a free library that draws architecture diagrams and checks their layout. --- # open-diagram vs Mermaid for architecture diagrams This page is for people choosing between Mermaid and open-diagram to write an architecture diagram as text. It shows one flow drawn by both, and how open-diagram reads a Mermaid flowchart. ## What is the difference? Mermaid draws many kinds of diagram from one text syntax. open-diagram draws one kind, made of boxes, lines and groups, and checks its own layout. ## How do the two draw the same flow? Each tool drew the same photo upload flow from its own file, with default settings. ![The photo upload flow drawn by Mermaid](https://open-diagram.dev/images/compare/mermaid.png) Mermaid. Made in 0.76 s. [Source](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.mmd) ![The photo upload flow drawn by open-diagram](https://open-diagram.dev/images/compare/open-diagram.png) open-diagram. Made in 0.59 s. 0 layout problems. [Source](https://github.com/lukendeasy/open-diagram/blob/main/docs/compare/photo-upload.json) Mermaid's command line tool (CLI) 12.2.0 and open-diagram 0.5.0, timed on one Mac on November 23, 2026, median of five runs. The open-diagram file sets the columns, a lane above the boxes and the ends of one line; the Mermaid file leaves placement to Mermaid. Both files are in the library's [docs/compare](https://github.com/lukendeasy/open-diagram/tree/main/docs/compare) folder. Given the Mermaid file itself, open-diagram 0.6.2 reports 0 layout problems (checked November 25, 2026). ## When should you pick Mermaid? Pick Mermaid when the diagram sits in a Markdown file. GitHub draws a `mermaid` code block in place, so the picture changes in the same pull request as the text. Its files are short: the photo upload flow takes 27 lines of Mermaid, against 183 lines of formatted JSON for open-diagram. It also draws sequence diagrams and Gantt charts, which open-diagram cannot. Its official MCP server, a small program that lets an AI app such as Claude Code call the tool, checks Mermaid syntax and renders a PNG for anyone with a free Mermaid account. ## When does open-diagram fit better? open-diagram fits a dense map that must read well the first time: many boxes, a few lines of detail in each, owners, states such as live or planned, and lines clear of every box. It measures each label before placing anything, so each box fits its words. Then `open-diagram check` names every layout problem by the labels involved: ```text 'Storage' and 'Recommendations' are only 9 px apart (minimum 16) ``` An AI agent reads the message, moves a box and checks again, without looking at the picture. open-diagram's MCP server gives the agent `check` and `draw`, and runs on your computer. Its SVG, a picture file that stays sharp at any size, draws text as shapes, so it looks the same in a browser, PowerPoint, Keynote or Figma. open-diagram is free and MIT licensed. ## Can I move from Mermaid to open-diagram? Yes, for flowcharts. open-diagram reads a Mermaid `flowchart` or `graph` file and lays it out again: ```bash open-diagram draw flow.mmd ``` Top-level subgraphs become shaded groups, dotted lines become connections still to build, and a class named after a state, such as `A:::planned`, sets that state. Every node becomes the same box, and `
` becomes a space. Thick, two-way and open-ended lines become plain arrows. Other Mermaid kinds, such as `sequenceDiagram`, stop the command with a message that names the line. The [Mermaid reference](https://open-diagram.dev/docs/mermaid.html) has the full list. ## How do they compare on input, output, license and price? | | open-diagram | Mermaid | | --- | --- | --- | | Input | Python, JSON, Mermaid flowcharts | Mermaid text | | Layout | You choose the columns; it spaces the boxes and routes the lines. For Mermaid it chooses the columns too | Automatic | | Checks layout | Yes, and names each problem | Not in its docs. Its MCP server checks syntax | | Output | SVG, PNG | SVG. The CLI also writes PNG and PDF | | MCP server | Yes, runs on your computer | Yes, hosted; needs a free Mermaid account | | License | MIT | MIT | | Price | Free | Free. Paid plans from "$10 per user / month", "Billed Annually" | Sources: open-diagram's [README](https://github.com/lukendeasy/open-diagram#readme), [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md) and [Mermaid](https://github.com/lukendeasy/open-diagram/blob/main/docs/mermaid.md) docs. Mermaid's [introduction](https://mermaid.js.org/intro/) (diagram kinds, SVG), [repository](https://github.com/mermaid-js/mermaid) (license), [CLI](https://github.com/mermaid-js/mermaid-cli) (PNG and PDF), [MCP server](https://mermaid.ai/docs/ai/mcp-server) and [pricing](https://mermaid.ai/pricing). GitHub's [diagram docs](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams) say where GitHub draws Mermaid. "Not in its docs" means the linked pages do not mention it. Checked November 25, 2026 Updated November 25, 2026. Web page: https://open-diagram.dev/compare/mermaid.html See also: - [Convert a Mermaid flowchart to a checked SVG and PNG](https://open-diagram.dev/guides/convert-mermaid.md) - [open-diagram vs D2 for architecture diagrams](https://open-diagram.dev/compare/d2.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) --- # open-diagram vs the Python diagrams library by mingrammer This page is for Python users choosing between two libraries that draw architecture as code: diagrams, by mingrammer, and open-diagram. It shows the same small system written in each. ## What is the difference? mingrammer's diagrams draws each part as a cloud provider's icon, and Graphviz, a separate layout program, lays the picture out. open-diagram draws each part as a box of text, with a title, sections, an owner and a state. It measures every label and checks the layout, naming each problem. ## How is the same system written in each? mingrammer's quick start draws a load balancer, a web server and a database: ```python # diagram.py from diagrams import Diagram from diagrams.aws.compute import EC2 from diagrams.aws.database import RDS from diagrams.aws.network import ELB with Diagram("Web Service", show=False): ELB("lb") >> EC2("web") >> RDS("userdb") ``` The same three parts in open-diagram, with a line of detail in each: ```python from open_diagram import Diagram, Panel def build(): d = Diagram("Web service") lb = d.add(Panel("Load balancer", ["Spreads requests"])) web = d.right_of(lb, Panel("Web server", ["Serves pages", "Checks sign-in"]), align="center") db = d.right_of(web, Panel("User database", ["Accounts", "Sessions"]), align="center") d.link(lb, web) d.link(web, db) return d ``` ![Web service](https://open-diagram.dev/images/pages/compare-mingrammer-diagrams-1.svg) The check: 0 layout problems mingrammer's version is shorter: one line chains the three parts. ## When should you pick mingrammer's diagrams? Pick it when the icons carry the meaning. Its providers include AWS, Azure, Google Cloud, Kubernetes, Alibaba Cloud and Oracle Cloud, plus on-premises, SaaS and programming nodes. open-diagram ships 20 built-in icons for AWS, Azure and Google Cloud; more come from icon lists that point to files you download. In its code, `>>` draws a line, and `with Cluster("DB Cluster"):` groups the nodes inside it. Graphviz decides where everything goes, and you can pass Graphviz settings through. It writes PNG by default, or JPG, SVG (a picture file that stays sharp at any size), PDF or DOT, Graphviz's own text format. ## When does open-diagram fit better? Pick open-diagram when each box has to say more than its name: what a service does, who owns it, whether it is live, being built or planned. The key lists only the states the picture uses. When the layout has to be right without a person checking the picture, `open-diagram check` names each problem by the labels involved, such as two boxes too close or a line through a box. It exits with 1, so a script or a GitHub Action can stop on it. It needs no Graphviz: pip installs everything the SVG needs, and only PNG also needs Chrome, Chromium or Edge. The same diagram can also be JSON or a Mermaid flowchart, and an MCP server lets an AI app such as Claude Code draw and check it. open-diagram is free and MIT licensed. ## Can I move from mingrammer's diagrams to open-diagram? Only by hand, but both are Python, so the change is line by line. Each node becomes a `Panel` or a `Tile`, each `>>` becomes `d.link(a, b)`, and each `Cluster` becomes `d.group(label, members)`. A provider icon carries over as an SVG or PNG file passed to `Tile(icon=...)` or `Resource(icon=...)`. ## How do they compare on input, output, license and price? | | open-diagram | mingrammer's diagrams | | --- | --- | --- | | Input | Python, JSON, Mermaid flowcharts | Python | | Layout | You place the boxes; it spaces them and routes the lines | Automatic, by Graphviz | | Checks layout | Yes, and names each problem | Not in its docs | | Output | SVG, PNG | PNG (default), JPG, SVG, PDF, DOT | | Needs | Python 3.10+; a browser for PNG only | Python 3.9+ and Graphviz | | MCP server | Yes, runs on your computer | Not in its docs | | License | MIT | MIT | | Price | Free | Free | Sources: open-diagram's [README](https://github.com/lukendeasy/open-diagram#readme), [Python](https://github.com/lukendeasy/open-diagram/blob/main/docs/python.md) and [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md) docs, and its [templates](https://github.com/lukendeasy/open-diagram/tree/main/templates). mingrammer's [repository](https://github.com/mingrammer/diagrams) (providers, Graphviz, Python version, license), [site](https://diagrams.mingrammer.com/), [installation](https://diagrams.mingrammer.com/docs/getting-started/installation) (quick start), [diagram guide](https://diagrams.mingrammer.com/docs/guides/diagram) (formats, Graphviz settings) and [cluster guide](https://diagrams.mingrammer.com/docs/guides/cluster). "Not in its docs" means the linked pages do not mention it. Both are free under the MIT license, which grants use "free of charge". Checked November 25, 2026 Updated November 25, 2026. Web page: https://open-diagram.dev/compare/mingrammer-diagrams.html See also: - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md) - [open-diagram vs D2 for architecture diagrams](https://open-diagram.dev/compare/d2.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) --- # open-diagram vs PlantUML for architecture diagrams This page is for people who write diagrams in PlantUML and want to know which of them open-diagram draws better, and which to keep in PlantUML. ## What is the difference? PlantUML draws UML, the standard set of software design diagrams, from text: sequence, use case, class, activity, component, deployment, state and timing diagrams, plus Gantt charts, mind maps and network diagrams. open-diagram covers only boxes, lines and groups, and checks their layout. ## When should you pick PlantUML? Pick PlantUML for UML: sequence, class and state diagrams each have their own type. It also suits a deployment diagram written in UML terms. PlantUML has keywords for `node`, `cloud`, `database`, `queue`, `component` and many more, and it can lay them out top to bottom or left to right. It writes PNG, SVG (a picture file that stays sharp at any size), LaTeX and EPS, and ASCII art for sequence diagrams. It lays diagrams out with Graphviz, a separate program, by default, or with Smetana, a layout engine built into PlantUML that needs no external program. You choose its license from GPL, LGPL, Apache, EPL and MIT. PlantUML also has its own MCP server, `@plantuml/mcp-js`, a Node.js program that lets an AI app render PlantUML with no Java needed. draw.io's official MCP server takes PlantUML as well. ## When does open-diagram fit better? For the overview, a whole system on one page with many boxes, open-diagram fits better. Each box carries a few lines of detail, an owner and a state such as live or planned, and no line may run through a box. open-diagram measures every label before it places anything, so no text spills out of its box. When an AI agent writes the diagram, `open-diagram check` names each problem in a sentence: ```text 'Storage' and 'Recommendations' are only 9 px apart (minimum 16) ``` The agent moves one of the two boxes and runs the check again, with no need to see the picture. open-diagram's MCP server gives it `check` and `draw` on your computer. In a repository, a GitHub Action checks the diagrams on every push, fails if a layout problem appears, and can redraw them, and a small states file changes a part from planned to live with one word. open-diagram is free and MIT licensed. ## Can I move from PlantUML to open-diagram? Only by hand: open-diagram does not read PlantUML. For a deployment or component diagram, each element becomes a panel, open-diagram's box; each arrow becomes a link with the same label, and each element that contains others becomes a group. Sequence and timing diagrams have no open-diagram form. ## How do they compare on input, output, license and price? | | open-diagram | PlantUML | | --- | --- | --- | | Input | Python, JSON, Mermaid flowcharts | PlantUML text | | Layout | You choose the columns; it spaces the boxes and routes the lines | Automatic: Graphviz by default, or Smetana | | Checks layout | Yes, and names each problem | Not in its docs | | Output | SVG, PNG | PNG, SVG, LaTeX, EPS; ASCII art for sequence diagrams | | MCP server | Yes, runs on your computer | Yes, `@plantuml/mcp-js` | | License | MIT | Your choice: GPL, LGPL, Apache, EPL or MIT | | Price | Free | Free | Sources: open-diagram's [README](https://github.com/lukendeasy/open-diagram#readme), [command line](https://github.com/lukendeasy/open-diagram/blob/main/docs/cli.md) and [AI agents](https://github.com/lukendeasy/open-diagram/blob/main/docs/agents.md) docs. PlantUML's [home page](https://plantuml.com/) (diagram types, formats, Graphviz and Smetana), [repository](https://github.com/plantuml/plantuml) (licenses, MCP server), [deployment diagram guide](https://plantuml.com/deployment-diagram) (keywords, direction) and the [MCP package listing](https://www.npmjs.com/package/@plantuml/mcp-js) (no Java runtime, MIT). draw.io's [MCP server](https://github.com/jgraph/drawio-mcp). "Not in its docs" means the linked pages do not mention it. PlantUML's MIT option grants use "free of charge". Checked November 25, 2026 Updated November 25, 2026. Web page: https://open-diagram.dev/compare/plantuml.html See also: - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md) - [open-diagram vs D2 for architecture diagrams](https://open-diagram.dev/compare/d2.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) --- # Arrow leaves or enters a box on the wrong side: how to fix it The message means a line leaves its first block, or enters its second, through a side that points away from the other block. ```json {"title": "Bookshop returns", "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Returns form"]}], [{"id": "store", "title": "Warehouse", "tiles": ["Returns shelf"]}]], "links": [{"from": "shop", "to": "store"}, {"from": "store", "to": "shop", "label": "refund"}]} ``` ![Bookshop returns](https://open-diagram.dev/images/pages/problems-arrow-on-the-wrong-side-1.svg) The check: 1 layout problem(s) ```text line 'store' -> 'shop' leaves 'store' from its right side, facing away from 'shop'; use start='auto' and end='auto', other sides, or a lane (via_x/via_y) ``` ## Why does it happen? A line that runs back, from a right column to a left one, keeps the default sides. In the `columns` layout every line leaves from the right side and enters the left, unless you set `start` and `end`. Here `refund` loops behind both blocks. The check for crossings skips the two blocks a line joins, so this is the only message about it. Two blocks side by side, joined top to top, get the same message. The line ends level with its start, never above it. In the `ring` and `panels` layouts the sides default to `auto`. Lines in a lane skip this check. ## How do I fix it? Let open-diagram pick the sides that face each other, or route the line through a lane. 1. Set `"start": "auto"` and `"end": "auto"` on the link. 2. Or name the sides yourself: for a line from right to left, `"start": "left"` and `"end": "right"`. 3. Or route the line through a lane, with `"lane": "top"` or `"lane": "bottom"`. 4. Run the check again. With `auto` on `refund`, the check reports 0 layout problems: ```json {"title": "Bookshop returns", "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Returns form"]}], [{"id": "store", "title": "Warehouse", "tiles": ["Returns shelf"]}]], "links": [{"from": "shop", "to": "store"}, {"from": "store", "to": "shop", "label": "refund", "start": "auto", "end": "auto"}]} ``` ![Bookshop returns](https://open-diagram.dev/images/pages/problems-arrow-on-the-wrong-side-2.svg) The check: 0 layout problems In Python, the same line is `d.link(store, shop, label="refund", start="auto", end="auto")`. Updated November 25, 2026. Web page: https://open-diagram.dev/problems/arrow-on-the-wrong-side.html See also: - [Diagram line crosses a box: how to fix it](https://open-diagram.dev/problems/line-crosses-a-box.md) - [Diagram group covers a box that is not in it: how to fix it](https://open-diagram.dev/problems/group-covers-a-box.md) - [Draw right-angle lines in diagrams from Python, JSON or Mermaid](https://open-diagram.dev/guides/right-angle-lines.md) --- # Diagram boxes too close or overlapping: how to fix it The message means two blocks sit closer than 16 px, the theme's `min_gap`, or that one covers part of the other. ```json {"title": "Bookshop orders", "gap": 10, "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Basket", "Checkout"]}], [{"id": "orders", "title": "Order service", "tiles": ["Orders", "Stock"]}]], "links": [{"from": "shop", "to": "orders"}]} ``` ![Bookshop orders](https://open-diagram.dev/images/pages/problems-boxes-too-close-1.svg) The check: 1 layout problem(s) ```text 'shop' and 'orders' are only 10 px apart (minimum 16) ``` ## Why does it happen? A spacing setting or a position set by hand has put two blocks too close: - `gap` or `row_gap` set under 16. Left out, columns sit 72 px apart and rows 28 px. - `x` and `y` in the `panels` layout, or `add()` in Python. Here the cause is `"gap": 10`. The check measures the space between every pair of blocks and reports each pair under 16 px on its own line. It names each block by its `id`, or by its title when it has none. When one block covers another, the message reads `'shop' and 'orders' overlap; move one (right_of() and below() keep a gap)`. ## How do I fix it? Give the two blocks at least 16 px between them. 1. If you set `gap` or `row_gap`, raise it to 16 or more. In Python, both are arguments of `columns()`. 2. If you placed the blocks with `x` and `y`, move one of them. 3. In Python, place the second block with `right_of()` or `below()`, which keep the theme's gap. 4. Run the check again. With `gap` at 40, the check reports 0 layout problems: ```json {"title": "Bookshop orders", "gap": 40, "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Basket", "Checkout"]}], [{"id": "orders", "title": "Order service", "tiles": ["Orders", "Stock"]}]], "links": [{"from": "shop", "to": "orders"}]} ``` ![Bookshop orders](https://open-diagram.dev/images/pages/problems-boxes-too-close-2.svg) The check: 0 layout problems Updated November 25, 2026. Web page: https://open-diagram.dev/problems/boxes-too-close.html See also: - [Diagram line crosses a box: how to fix it](https://open-diagram.dev/problems/line-crosses-a-box.md) - [Diagram group covers a box that is not in it: how to fix it](https://open-diagram.dev/problems/group-covers-a-box.md) - [Text does not fit in a diagram box: how to fix it](https://open-diagram.dev/problems/text-does-not-fit.md) --- # Graph label touches a node: how to fix it The message means a label on a line inside a graph comes within 2 px of a node, so the two run together. ```json {"title": "Weather app data", "columns": [[{"id": "map", "title": "Where readings go", "sections": [{"graph": {"nodes": {"st": "Stations", "fc": "Forecasts"}, "links": [["st", "fc", "hourly readings"]], "at": {"st": [0, 0], "fc": [1, 0]}}}]}]]} ``` ![Weather app data](https://open-diagram.dev/images/pages/problems-graph-label-touches-a-node-1.svg) The check: 2 layout problem(s) ```text graph: the label 'hourly readings' touches the node 'Stations' graph: the label 'hourly readings' touches the node 'Forecasts' ``` ## Why does it happen? A graph label stays at the middle of its line, and this one is wider than the space between its two nodes. Unlike a label on a line between blocks, it never slides to a clear spot. A graph is a section of a panel that puts named nodes on a grid and joins pairs of them with straight lines. Its `at` gives each node a column and a row. Graph columns are 132 px apart, centre to centre, and each node is as wide as its name plus 26 px. Here `Stations` and `Forecasts` leave 58 px between them. The label needs 89 px, so it touches both. When two labels touch each other, the message reads `graph: the labels 'A' and 'B' touch`. ## How do I fix it? Give the label more line, or make it shorter. 1. Spread the nodes in `at`: move one a column further away. Positions can be fractions, such as `[1.5, 0]`, for a smaller step. 2. Or shorten the label. 3. Run the check again. Here `Forecasts` moves to column 2, and the check reports 0 layout problems: ```json {"title": "Weather app data", "columns": [[{"id": "map", "title": "Where readings go", "sections": [{"graph": {"nodes": {"st": "Stations", "fc": "Forecasts"}, "links": [["st", "fc", "hourly readings"]], "at": {"st": [0, 0], "fc": [2, 0]}}}]}]]} ``` ![Weather app data](https://open-diagram.dev/images/pages/problems-graph-label-touches-a-node-2.svg) The check: 0 layout problems In Python, the same section is `Graph(nodes, links, at)`, with `at` as a dictionary of `(column, row)` pairs. Updated November 25, 2026. Web page: https://open-diagram.dev/problems/graph-label-touches-a-node.html See also: - [Graph line runs through a node: how to fix it](https://open-diagram.dev/problems/graph-line-through-a-node.md) - [Line label covers a box in a diagram: how to fix it](https://open-diagram.dev/problems/line-label-covers-a-box.md) --- # Graph line runs through a node: how to fix it The message means a straight line in a graph passes behind a third node, so the picture hides where the line goes. ```json {"title": "Weather app data", "columns": [[{"id": "map", "title": "Where readings go", "sections": [{"graph": {"nodes": {"st": "Stations", "fc": "Forecasts", "al": "Alerts"}, "links": [["st", "fc"], ["fc", "al"], ["st", "al"]], "at": {"st": [0, 0], "fc": [1, 0], "al": [2, 0]}}}]}]]} ``` ![Weather app data](https://open-diagram.dev/images/pages/problems-graph-line-through-a-node-1.svg) The check: 1 layout problem(s) ```text graph: the line 'Stations' to 'Alerts' runs through 'Forecasts' ``` ## Why does it happen? A third node sits on the straight path between the two nodes a line joins. A graph, a section of a panel with named nodes on a grid, joins pairs of nodes with straight lines. Those lines have no lanes, no sides to choose and no `cross_ok`, and nodes are drawn over them. Here the three nodes share row 0, so the line from `Stations` to `Alerts` passes behind `Forecasts`. The picture shows a chain, Stations to Forecasts to Alerts. The check tests points along every graph line against every node except the two the line joins. ## How do I fix it? Move a node off the straight path. 1. Move the node in the way to another row in `at`. 2. Or move one end of the line, so the path between the pair is clear. 3. Run the check again. Here `Forecasts` moves down to row 1, so all three lines show. The check reports 0 layout problems: ```json {"title": "Weather app data", "columns": [[{"id": "map", "title": "Where readings go", "sections": [{"graph": {"nodes": {"st": "Stations", "fc": "Forecasts", "al": "Alerts"}, "links": [["st", "fc"], ["fc", "al"], ["st", "al"]], "at": {"st": [0, 0], "fc": [1, 1], "al": [2, 0]}}}]}]]} ``` ![Weather app data](https://open-diagram.dev/images/pages/problems-graph-line-through-a-node-2.svg) The check: 0 layout problems Graph rows are 58 px apart, centre to centre, and positions can be fractions, such as `[1, 0.5]`. In Python, the same section is `Graph(nodes, links, at)`. Updated November 25, 2026. Web page: https://open-diagram.dev/problems/graph-line-through-a-node.html See also: - [Graph label touches a node: how to fix it](https://open-diagram.dev/problems/graph-label-touches-a-node.md) - [Diagram line crosses a box: how to fix it](https://open-diagram.dev/problems/line-crosses-a-box.md) --- # Diagram group covers a box that is not in it: how to fix it The message means a group's dashed area covers a block outside the group, so the block looks like a member. ```json {"title": "Bookshop orders", "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Checkout"]}], [{"id": "pay", "title": "Card payments", "tiles": ["Card checks"]}], [{"id": "orders", "title": "Order service", "tiles": ["Orders"]}]], "groups": [{"label": "Our own systems", "members": ["shop", "orders"]}], "links": [{"from": "shop", "to": "pay"}, {"from": "pay", "to": "orders"}]} ``` ![Bookshop orders](https://open-diagram.dev/images/pages/problems-group-covers-a-box-1.svg) The check: 1 layout problem(s) ```text group 'Our own systems' overlaps 'pay', which is not in it; add it to the group or move it ``` ## Why does it happen? A group is one rectangle drawn around all its members, so a block between them falls inside. The rectangle reaches 20 px past the members on each side, with a row for the title on top. The check compares it with every block that is not a member. In the `columns` layout, a group around the first and third columns covers the second. ## How do I fix it? Make the picture match the group's list of members. 1. If the block belongs in the group, add its id to the group's `members`, or in Python to the list passed to `d.group()`. 2. If it does not, place the members next to each other, in one column or in neighbouring columns. 3. Put the other block outside the group's area. 4. Run the check again. Here `shop` and `orders` share the first column, and `pay` moves to the second. The check reports 0 layout problems: ```json {"title": "Bookshop orders", "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Checkout"]}, {"id": "orders", "title": "Order service", "tiles": ["Orders"]}], [{"id": "pay", "title": "Card payments", "tiles": ["Card checks"]}]], "groups": [{"label": "Our own systems", "members": ["shop", "orders"]}], "links": [{"from": "shop", "to": "pay"}, {"from": "pay", "to": "orders", "start": "auto", "end": "auto"}]} ``` ![Bookshop orders](https://open-diagram.dev/images/pages/problems-group-covers-a-box-2.svg) The check: 0 layout problems The line from `pay` back to `orders` now runs right to left, so it takes `auto` sides. Without them, the check reports that the line leaves `pay` facing away from `orders`. Updated November 25, 2026. Web page: https://open-diagram.dev/problems/group-covers-a-box.html See also: - [Diagram boxes too close or overlapping: how to fix it](https://open-diagram.dev/problems/boxes-too-close.md) - [Line label covers a group title: how to fix it](https://open-diagram.dev/problems/label-covers-group-title.md) - [Arrow leaves or enters a box on the wrong side: how to fix it](https://open-diagram.dev/problems/arrow-on-the-wrong-side.md) --- # Layout problems open-diagram reports, and how to fix each one Each page below takes one message from the check (`open-diagram check`), shows a small diagram with that problem, then the change that brings the count to 0. The check names each layout problem in a plain sentence, with the blocks (the boxes in the picture) involved, so a person or an agent can fix it without looking at the picture. A mistake in a JSON or Mermaid file stops the check with an error that names its place: a path such as `columns[0][0].tiles[1]` in JSON, a line number such as `line 3` in Mermaid. Fix that spot and run the check again. Updated November 25, 2026. Web page: https://open-diagram.dev/problems.html Pages: - [Diagram boxes too close or overlapping: how to fix it](https://open-diagram.dev/problems/boxes-too-close.md): What it means when the open-diagram check says two blocks are only a few px apart or overlap, and how to give them room. - [Diagram line crosses a box: how to fix it](https://open-diagram.dev/problems/line-crosses-a-box.md): What it means when the open-diagram check says a line crosses a box, and how to send the line around it through a lane or other sides. - [Line label covers a box in a diagram: how to fix it](https://open-diagram.dev/problems/line-label-covers-a-box.md): What it means when the open-diagram check says a line's label sits on a box, and how to fix it by shortening the label or widening the gap. - [Arrow leaves or enters a box on the wrong side: how to fix it](https://open-diagram.dev/problems/arrow-on-the-wrong-side.md): What it means when the open-diagram check says a line leaves or enters a box facing away, and how auto sides or a lane fix it. - [Line label covers a group title: how to fix it](https://open-diagram.dev/problems/label-covers-group-title.md): What it means when the open-diagram check says a line's label sits on the title of a group, and how to move the line or the group. - [Diagram group covers a box that is not in it: how to fix it](https://open-diagram.dev/problems/group-covers-a-box.md): What it means when the open-diagram check says a group overlaps a box that is not in it, and how to add the box or move it out. - [Graph label touches a node: how to fix it](https://open-diagram.dev/problems/graph-label-touches-a-node.md): What it means when the open-diagram check says a graph label touches a node, and how to spread the nodes or shorten the label. - [Graph line runs through a node: how to fix it](https://open-diagram.dev/problems/graph-line-through-a-node.md): What it means when the open-diagram check says a graph line runs through a node, and how to move a node so the straight line is clear. - [Text does not fit in a diagram box: how to fix it](https://open-diagram.dev/problems/text-does-not-fit.md): What it means when the open-diagram check says a block needs more px than it was given, and how to shorten the words or widen the block. - [Diagram text too small: how to fix it](https://open-diagram.dev/problems/text-too-small.md): What it means when the open-diagram check says the smallest text is below the theme's minimum, and how to fix it with shorter words. --- # Line label covers a group title: how to fix it The message means a line's label lands on a group's title, the name printed in the top-left corner of the group's dashed area. ```json {"title": "Parcel service", "row_gap": 44, "columns": [[{"id": "web", "title": "Tracking page", "tiles": ["Track a parcel"]}, {"id": "depot", "title": "Depot", "tiles": ["Sorting belt"]}]], "groups": [{"label": "Run by the depot team", "members": ["depot"]}], "links": [{"from": "web", "to": "depot", "label": "scans", "start": "bottom", "end": "top"}]} ``` ![Parcel service](https://open-diagram.dev/images/pages/problems-label-covers-group-title-1.svg) The check: 1 layout problem(s) ```text the label 'scans' on line 'web' -> 'depot' sits on the title of group 'Run by the depot team'; move the label's line, or the group ``` ## Why does it happen? The line is too short for its label to clear the group's title. A group's border and title take about 40 px above its first block: 20 px of padding, then a row for the title. Here the two blocks are 44 px apart, so the title sits across the middle of the line. open-diagram looks along each line for a spot clear of blocks, group titles, other lines and other labels. On this line no spot is clear, so the label stays in the middle and the check reports the title it covers. The line itself may cross the title. Titles are drawn over lines, on a backing, so the line reads as passing behind. ## How do I fix it? Give the label a stretch of line away from the title. 1. Give the line a different start or end side, so it enters the group away from its title. 2. Or route the line through a lane. 3. Or move the group's blocks further from the line's other end. 4. Run the check again. Here the rows move 90 px apart, so the label finds a spot above the group. The check reports 0 layout problems: ```json {"title": "Parcel service", "row_gap": 90, "columns": [[{"id": "web", "title": "Tracking page", "tiles": ["Track a parcel"]}, {"id": "depot", "title": "Depot", "tiles": ["Sorting belt"]}]], "groups": [{"label": "Run by the depot team", "members": ["depot"]}], "links": [{"from": "web", "to": "depot", "label": "scans", "start": "bottom", "end": "top"}]} ``` ![Parcel service](https://open-diagram.dev/images/pages/problems-label-covers-group-title-2.svg) The check: 0 layout problems In Python, the rows are spaced with `row_gap` in `columns()`. A label that lands on a block gets its own message. Updated November 25, 2026. Web page: https://open-diagram.dev/problems/label-covers-group-title.html See also: - [Line label covers a box in a diagram: how to fix it](https://open-diagram.dev/problems/line-label-covers-a-box.md) - [Diagram group covers a box that is not in it: how to fix it](https://open-diagram.dev/problems/group-covers-a-box.md) - [Diagram boxes too close or overlapping: how to fix it](https://open-diagram.dev/problems/boxes-too-close.md) --- # Diagram line crosses a box: how to fix it The message means a line runs through a block it does not join, and disappears behind that block. ```json {"title": "Bookshop orders", "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Checkout"]}], [{"id": "orders", "title": "Order service", "tiles": ["Orders"]}], [{"id": "post", "title": "Parcel desk", "tiles": ["Labels"]}]], "links": [{"from": "shop", "to": "orders"}, {"from": "orders", "to": "post"}, {"from": "shop", "to": "post"}]} ``` ![Bookshop orders](https://open-diagram.dev/images/pages/problems-line-crosses-a-box-1.svg) The check: 1 layout problem(s) ```text line 'shop' -> 'post' crosses 'orders'; route it with via_x/via_y, move a block, or pass cross_ok=True ``` ## Why does it happen? The shortest path between the two blocks leads through a third, and blocks are drawn over lines. The check walks along every line and reports each block it enters, apart from the two it joins. In the `columns` layout, a line from the first column to the third must pass the second. Here `shop` to `post` runs behind `orders`, and looks like a second line into `orders` and a second line out of it. ## How do I fix it? Send the line around the block, or move the blocks so its path is clear. The message gives the Python names. JSON uses the same keys, `via_x`, `via_y` and `cross_ok`, and adds `lane`. 1. In JSON, add `"lane": "top"` or `"lane": "bottom"` to the link. 2. In Python, pass `via_y`, a height above or below every block, such as `min(p.y for p in d.placed) - 80`. 3. Or pass `via_x`, a position beside the blocks, for a line that should run down the side. 4. Or set `start` and `end` to other sides of the two blocks. 5. Or move a block, so the two ends sit side by side. 6. Run the check again. A top lane runs 70 px above the highest block, and each further line in it 30 px higher. A line through a lane always turns at right angles. With the third line in the top lane, the check reports 0 layout problems: ```json {"title": "Bookshop orders", "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Checkout"]}], [{"id": "orders", "title": "Order service", "tiles": ["Orders"]}], [{"id": "post", "title": "Parcel desk", "tiles": ["Labels"]}]], "links": [{"from": "shop", "to": "orders"}, {"from": "orders", "to": "post"}, {"from": "shop", "to": "post", "lane": "top"}]} ``` ![Bookshop orders](https://open-diagram.dev/images/pages/problems-line-crosses-a-box-2.svg) The check: 0 layout problems ## What if the line should pass behind the box? Set `"cross_ok": true` on the link, or `cross_ok=True` in Python. The line is still drawn behind the block, and the check stops reporting it. Updated November 25, 2026. Web page: https://open-diagram.dev/problems/line-crosses-a-box.html See also: - [Arrow leaves or enters a box on the wrong side: how to fix it](https://open-diagram.dev/problems/arrow-on-the-wrong-side.md) - [Line label covers a box in a diagram: how to fix it](https://open-diagram.dev/problems/line-label-covers-a-box.md) - [Draw right-angle lines in diagrams from Python, JSON or Mermaid](https://open-diagram.dev/guides/right-angle-lines.md) --- # Line label covers a box in a diagram: how to fix it The message means a line's label sits on top of a block. ```json {"title": "Bookshop orders", "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Checkout"]}], [{"id": "orders", "title": "Order service", "tiles": ["Orders"]}]], "links": [{"from": "shop", "to": "orders", "label": "every order, as soon as it is paid"}]} ``` ![Bookshop orders](https://open-diagram.dev/images/pages/problems-line-label-covers-a-box-1.svg) The check: 2 layout problem(s) ```text the label 'every order, as soon as it is paid' on line 'shop' -> 'orders' sits on 'shop' the label 'every order, as soon as it is paid' on line 'shop' -> 'orders' sits on 'orders' ``` ## Why does it happen? The label is wider than the gap its line crosses. A label's box is 18 px tall, and as wide as its text plus 14 px. This one is 175 px wide, and the columns are 72 px apart. Before the check runs, open-diagram slides each label along its line to the first spot clear of blocks, group titles, other lines and other labels. If no spot is clear, the label stays in the middle of the line, here across both blocks. The check reports each block it covers, one message each. ## How do I fix it? Shorten the label, or widen the gap. 1. Shorten the label to a word or two. 2. Or raise `gap` at the top of the JSON, or in `columns()` in Python, so the columns sit further apart. 3. Run the check again. A wider gap keeps the long label, but it spreads every column, so the whole picture grows. Here the label drops to two words, and the check reports 0 layout problems: ```json {"title": "Bookshop orders", "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Checkout"]}], [{"id": "orders", "title": "Order service", "tiles": ["Orders"]}]], "links": [{"from": "shop", "to": "orders", "label": "when paid"}]} ``` ![Bookshop orders](https://open-diagram.dev/images/pages/problems-line-label-covers-a-box-2.svg) The check: 0 layout problems In Python, the label is an argument of the link: `d.link(shop, orders, label="when paid")`. A label that lands on a group's title gets a different message. Updated November 25, 2026. Web page: https://open-diagram.dev/problems/line-label-covers-a-box.html See also: - [Line label covers a group title: how to fix it](https://open-diagram.dev/problems/label-covers-group-title.md) - [Diagram line crosses a box: how to fix it](https://open-diagram.dev/problems/line-crosses-a-box.md) - [Diagram boxes too close or overlapping: how to fix it](https://open-diagram.dev/problems/boxes-too-close.md) --- # Text does not fit in a diagram box: how to fix it The message means a block's words need more width than the width you set, so open-diagram drew it wider than you asked. ```python from open_diagram import Diagram, Panel def build(): d = Diagram("Parcel service") hub = d.add(Panel("Sorting hub", ["Scan parcels", "Weigh parcels"]), 0, 0, width=200) vans = d.right_of(hub, Panel("Vans", ["Morning round"]), width=200) d.link(hub, vans) return d ``` ![Parcel service](https://open-diagram.dev/images/pages/problems-text-does-not-fit-1.svg) The check: 1 layout problem(s) ```text 'Sorting hub' needs 253 px wide but was given 200; using 253 ``` ## Why does it happen? A `width` given to `add()`, `right_of()` or `below()` can stretch a block, never shrink it. Every block measures its own words from the font before open-diagram places it. Here the two blocks were meant to match at 200 px. The tiles in `Sorting hub` need 253 px, so it comes out 53 px wider than `Vans`. In JSON, a panel's `width` also only widens it, but reports nothing, so this message comes from Python. ## How do I fix it? Shorten the words, or give the block the width they need. 1. Shorten the words in the block's title or tiles. For longer detail, a tile can carry a second line in `sub`. 2. Or set `width` to the number the message names, or more. 3. Or leave `width` out, so each block takes the width its words need. 4. Run the check again. Here the tile labels drop the word "parcels". Both blocks come out at 200 px, and the check reports 0 layout problems: ```python from open_diagram import Diagram, Panel def build(): d = Diagram("Parcel service") hub = d.add(Panel("Sorting hub", ["Scan", "Weigh"]), 0, 0, width=200) vans = d.right_of(hub, Panel("Vans", ["Morning round"]), width=200) d.link(hub, vans) return d ``` ![Parcel service](https://open-diagram.dev/images/pages/problems-text-does-not-fit-2.svg) The check: 0 layout problems Updated November 25, 2026. Web page: https://open-diagram.dev/problems/text-does-not-fit.html See also: - [Diagram text too small: how to fix it](https://open-diagram.dev/problems/text-too-small.md) - [Diagram boxes too close or overlapping: how to fix it](https://open-diagram.dev/problems/boxes-too-close.md) --- # Diagram text too small: how to fix it The message means some text in the picture is smaller than the theme's minimum of 10 px. ```json {"title": "Weather app", "theme": {"tile": 9}, "columns": [[{"id": "app", "title": "Phone app", "tiles": ["Today, hour by hour, with rain chances"]}]]} ``` ![Weather app](https://open-diagram.dev/images/pages/problems-text-too-small-1.svg) The check: 1 layout problem(s) ```text smallest text is 9 px; the theme's minimum is 10 px ``` ## Why does it happen? The theme sets a text size under 10 px. The check records the size of every piece of text it draws, then compares the smallest with the theme's minimum, `min_text`. The default sizes all sit above the minimum: 12 px for tile labels, and 10.5 px for a tile's second line, line labels and footers. Here `"tile": 9` takes tile labels under it. `open-diagram draw` prints the smallest text size on every run, next to the count of layout problems. ## How do I fix it? Keep the theme's sizes, and shorten the words. At the default size, a long label makes its box wider or wraps onto another line, because each block measures its own words. 1. Remove the size from `theme`, or set it to 10 or more. 2. Shorten the label to four words or fewer. 3. Move the detail into the tile's `sub`, a second line at 10.5 px. 4. Run the check again. Here `theme` is gone, the label keeps "Today, by the hour", and "with rain chances" moves to `sub`. The check reports 0 layout problems: ```json {"title": "Weather app", "columns": [[{"id": "app", "title": "Phone app", "tiles": [{"label": "Today, by the hour", "sub": "with rain chances"}]}]]} ``` ![Weather app](https://open-diagram.dev/images/pages/problems-text-too-small-2.svg) The check: 0 layout problems In Python, the same tile is `Tile("Today, by the hour", sub="with rain chances")`. Updated November 25, 2026. Web page: https://open-diagram.dev/problems/text-too-small.html See also: - [Text does not fit in a diagram box: how to fix it](https://open-diagram.dev/problems/text-does-not-fit.md) - [Diagram boxes too close or overlapping: how to fix it](https://open-diagram.dev/problems/boxes-too-close.md) --- # AWS, Azure and Google Cloud icons in architecture diagrams This guide is for people who draw cloud architecture and want each service shown with its provider's icon. open-diagram comes with 20 icons, and the cloud-icons skill tells an agent how to fetch more. ## How do I start a cloud diagram? Start from one of the four cloud templates. `open-diagram new` lists them: ```text $ open-diagram new aws_etl Data ingestion on AWS in six numbered sections, from orchestration to dashboards aws_architecture An AWS account, network and subnets around an API, a function, a database and storage azure_web_app A web app on Azure behind Front Door, with its database and cache inside a virtual network gcp_event_pipeline An event pipeline on Google Cloud from Pub/Sub to a warehouse and a forecast model ``` 1. Run `open-diagram new azure_web_app` to write `azure_web_app.json` in the current folder. 2. Change each resource's `label` to your own words. 3. Keep each `sub`, the service name under the icon. 4. If a resource needs to move, change its `x` and `y`. 5. After each change, run `open-diagram check azure_web_app.json`. 6. Run `open-diagram draw azure_web_app.json`. The template's icons come with the package, so drawing it never uses the network. Over the MCP server, an agent gets the same JSON from the `template` tool. ![Web app on Azure](https://open-diagram.dev/images/pages/guides-cloud-icons-1.svg) Web app on Azure. Drawn by open-diagram 0.6.2 from `templates/azure_web_app.json`: 0 layout problems. Source: https://github.com/lukendeasy/open-diagram/blob/main/templates/azure_web_app.json The picture as text: ```text Web app on Azure A public site behind Front Door, with the app and its data inside one virtual network. Solid lines: requests and data. Blocks, left to right: - Public entry (Azure Front Door) - App secrets (Azure Key Vault) - Web app (Azure App Service) - Uploaded files (Azure Blob Storage) - Orders database (Azure SQL Database) - Session cache (Azure Cache for Redis) Groups: - App subnet: Web app - Data subnet: Orders database, Session cache - Virtual network: Web app, Orders database, Session cache - Resource group: Public entry, Web app, Orders database, Session cache, App secrets, Uploaded files Lines: - Public entry -> Web app, labeled "HTTPS" - Web app -> Orders database, labeled "SQL" - Web app -> Session cache, labeled "sessions" - Web app -> App secrets, labeled "secrets" - Web app -> Uploaded files, labeled "files" Note: Fictional workload. No deployed resources Replace the labels; keep each service name under its icon ``` ## Which icons come with open-diagram? Twenty, all used by the templates: | Provider | Icon names | | --- | --- | | AWS | `aws/api-gateway`, `aws/athena`, `aws/glue`, `aws/lambda`, `aws/mwaa`, `aws/quicksight`, `aws/rds`, `aws/s3` | | Azure | `azure/app-service`, `azure/block-blob`, `azure/cache-for-redis`, `azure/front-door`, `azure/key-vault`, `azure/sql-database` | | Google Cloud | `gcp/bigquery`, `gcp/cloud-functions`, `gcp/cloud-run`, `gcp/cloud-storage`, `gcp/pub-sub`, `gcp/vertex-ai` | In JSON, a resource or a tile takes an icon by name. A resource is a large icon with its label and service name under it. An enclosure is a box around resources. ```json { "title": "Photo uploads on Google Cloud", "subtitle": "An invented workload", "resources": [ {"id": "run", "label": "Upload service", "sub": "Cloud Run", "icon": "gcp/cloud-run", "x": 0, "y": 0}, {"id": "bucket", "label": "Original photos", "sub": "Cloud Storage", "icon": "gcp/cloud-storage", "x": 300, "y": 0}, {"id": "topic", "label": "New photo events", "sub": "Pub/Sub", "icon": "gcp/pub-sub", "x": 600, "y": 0} ], "enclosures": [ {"id": "project", "label": "Cloud project", "members": ["run", "bucket", "topic"], "border": "dashed"} ], "links": [ {"from": "run", "to": "bucket", "label": "writes"}, {"from": "bucket", "to": "topic", "label": "notifies"} ] } ``` ![Photo uploads on Google Cloud](https://open-diagram.dev/images/pages/guides-cloud-icons-2.svg) The check: 0 layout problems open-diagram looks for an icon name next to the JSON file, then in each folder given with `--icons FOLDER`, then among the built-in icons. Full paths and `..` are refused: `icon '/etc/passwd' must be a name inside an icon folder, such as 'aws/s3'; full paths and '..' are not allowed`. Mermaid input takes no icons. ## What if my service has no built-in icon? Use the cloud-icons skill. The open-diagram repository's `cloud-icons/` folder has one list per provider: 33 AWS services, 30 Azure and 30 Google Cloud. Each entry is a service key, such as `s3` or `lambda`, with the web address of its SVG icon. Every address points to one fixed version of the file, hosted by a third party, theSVG. The skill tells an agent how to pick icons, download them, and pass each file to `Resource(icon=...)` or `Tile(icon=...)` in Python. For Claude Code, copy it into your skills folder from a copy of the repository: ```bash cp -r skills/cloud-icons ~/.claude/skills/ ``` The icon lists stay in your copy of the repository, so if you run the skill's example from another folder, set its `ICON_DIR` to that copy's `cloud-icons/` folder. Once downloaded, the icons work offline. The finished SVG and PNG contain the icons themselves, so you can share them without the icon links. ## What terms do the icons carry? Their owners' terms. The icons belong to Amazon, Microsoft and Google, and open-diagram's MIT license does not cover them. | Provider | What the library's notes say | | --- | --- | | AWS | The icon catalog lists them as [CC BY-ND 2.0](https://creativecommons.org/licenses/by-nd/2.0/). Credit Amazon Web Services and link to the [AWS source](https://aws.amazon.com/architecture/icons/) and license when you share a diagram. The QuickSight icon comes from an AWS Labs release, with its license in `templates/assets/aws/LICENSE-QuickSight.txt` | | Azure | Microsoft's [icon terms](https://learn.microsoft.com/en-us/azure/architecture/icons/) permit the icons in architecture diagrams. They ask that icons are not cropped, flipped, rotated or reshaped, and that the product name appears next to each icon. The catalog lists them as MIT | | Google Cloud | Google owns the artwork; the source is [Google Cloud icons](https://cloud.google.com/icons). The catalog lists them as Apache-2.0. Follow Google's guidance | When you share the pictures or the icon files, keep these credits, source links and license notices with them. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/cloud-icons.html See also: - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md) - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) --- # Convert a Mermaid flowchart to a checked SVG and PNG This guide is for people who already have Mermaid flowcharts and want them drawn with measured labels and checked for layout problems. ## How do I convert a flowchart? Run `open-diagram draw` on the `.mmd` or `.mermaid` file. open-diagram lays the flowchart out again, measures every label and checks the layout, as for any other diagram. ```bash open-diagram draw returns.mmd ``` That writes `returns.svg` and `returns.png` next to the file. This flowchart draws the picture below it: ```mermaid --- title: How a parcel return is handled --- flowchart LR request[Return request] --> label[Print label] label --> dropoff[Drop at locker] dropoff --> inspect{Inspect item} inspect -->|passes| refund[Refund card] inspect -->|fails| reject[Send back] inspect -.-> resell[Resell online] class resell planned ``` ![How a parcel return is handled](https://open-diagram.dev/images/pages/guides-convert-mermaid-1.svg) The check: 0 layout problems The title comes from the front matter. Without one, the title is "Flowchart", and `--title` sets another. ## What carries over? The structure and the states: - `flowchart` and `graph`, with `LR`, `RL`, `TD`, `TB` or `BT`. `RL` and `BT` are drawn as the mirror image of `LR` and `TD`. - Nodes in any bracket shape, with or without quotes. - Chains (`A --> B --> C`) and `&` (`A & B --> C`). - Line labels: `-->|text|`, `-- text -->`, `-. text .->` and `== text ==>`. - Dotted lines (`-.->`), which become connections still to build, drawn dotted. - Each top-level `subgraph` … `end`, which becomes a shaded group with its own band. - A class named after a state: `A:::building` or `class A,B planned`. The states are live, building, trial, planned and retiring. - Mermaid's `curve` setting. `step`, `stepBefore` and `stepAfter` draw [right-angle lines](right-angle-lines.html). - `%%` comments, and `;` between statements. ## What changes? The look and the layout: - Every node is drawn as the same box. The diamond `{Inspect item}` above became a plain box. - `
` becomes a space, and the label wraps to fit. - Thick lines (`==>`), lines with no arrowhead (`---`), circle and cross ends (`--o`, `--x`) and two-way arrows (`<-->`) are all drawn as ordinary one-way arrows. - A subgraph inside another subgraph is merged into the outer one. - Class names that are not states are ignored, and so are `classDef`, `style`, `linkStyle`, `click` and `direction`. - Markdown strings and icons such as `fa:fa-car` are shown exactly as typed. - open-diagram chooses the layout. Boxes go in steps by the longest chain of arrows that leads to each one. Lines that skip a step or point backwards run in a lane above or below the picture. ## What is not read? Other Mermaid diagram types, the newer shape syntax and D2 files. For a Mermaid file it cannot read, the command stops and names the line: ```text $ open-diagram check seq.mmd error: line 1: expected 'flowchart LR' or 'graph TD' first, got 'sequenceDiagram' $ open-diagram check shape.mmd error: line 2: cannot read the shape of node 'A@{ shape: rect }' ``` Mermaid input takes no icons either. For cloud icons, write [JSON](json-from-any-language.html). ## Can an agent or a script convert it? Yes. The MCP server's `check` and `draw` tools take Mermaid text as well as JSON. From Python, `from_mermaid(text)` returns the `Diagram`, and `from_mermaid(text, routing="orthogonal")` draws right-angle lines. The [Mermaid comparison](../compare/mermaid.html) says when Mermaid is the better choice. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/convert-mermaid.html See also: - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md) - [Draw right-angle lines in diagrams from Python, JSON or Mermaid](https://open-diagram.dev/guides/right-angle-lines.md) - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md) --- # Describe an architecture diagram as plain text for alt text This guide is for people who publish diagrams, and for anyone who has an agent draw them. One command prints what a picture says in plain words. Use the text as alt text, the words that replace a picture for someone who cannot see it, or to check the picture against the request. ## How do I get the text? Run `open-diagram describe` on the diagram file. It prints the description and writes no files. ```bash open-diagram describe reminders.json ``` In Python, `d.describe()` returns the same text. An agent connected to the MCP server calls the `describe` tool, and the `draw` tool returns the text with the picture. ## What does the text say? Everything a reader would find in the picture: the title, the key, each block with its tiles and states, the groups, and every line with its label. For this diagram, `open-diagram describe` prints the text below it. ```json { "title": "How a clinic sends appointment reminders", "gap": 100, "columns": [ [{"id": "book", "title": "Booking desk", "tiles": ["Front desk", "Phone line"], "cols": 1, "footer": "Owner: Reception"}], [{"id": "diary", "title": "Appointment diary", "step": 1, "tiles": ["Slots", {"label": "Waiting list", "status": "building"}], "cols": 1}, {"id": "notify", "title": "Reminder service", "step": 2, "tiles": ["Text message", {"label": "Email", "status": "planned"}], "cols": 1}], [{"id": "patient", "title": "Patient", "tiles": ["Confirms", "Cancels"], "cols": 1}] ], "groups": [{"label": "Clinic systems", "members": ["diary", "notify"]}], "links": [ {"from": "book", "to": "diary"}, {"from": "diary", "to": "notify", "start": "bottom", "end": "top", "label": "day before"}, {"from": "notify", "to": "patient"}, {"from": "patient", "to": "diary", "kind": "planned", "lane": "top", "label": "replies"} ] } ``` ![How a clinic sends appointment reminders](https://open-diagram.dev/images/pages/guides-describe-a-diagram-as-text-1.svg) The check: 0 layout problems ```text How a clinic sends appointment reminders States shown: Live, Being built, Planned. Solid lines: data flows today. Dotted lines: connection to build. Blocks, left to right: - Booking desk: Front desk; Phone line. Owner: Reception - Appointment diary [step 1]: Slots; Waiting list (being built) - Reminder service [step 2]: Text message; Email (planned) - Patient: Confirms; Cancels Groups: - Clinic systems: Appointment diary, Reminder service Lines: - Booking desk -> Appointment diary - Appointment diary -> Reminder service, labeled "day before" - Reminder service -> Patient - Patient -> Appointment diary (connection to build), labeled "replies" ``` ## Where does the text go in the SVG? open-diagram writes it into the SVG, where screen readers can read it. The file opens with `role="img"`, a `` with the diagram's title, and a `<desc>` with the text above. Wherever you place the PNG, such as on a web page or in a README, use the same text as its alt text. ## How do I check a picture against a request? Read the text against the request, then look at the picture. 1. Run `open-diagram describe` on the file. 2. Find every system, state, owner and line the request named in the text. 3. If the text names something the request did not, remove it or call it an assumption. 4. Open the PNG. 5. Check that the reading direction is obvious and the main flow has few bends. 6. Check that no line is unclear where it meets a panel. 7. Check that the key matches what the picture uses. 8. Check that every word is one the requester would use, with no placeholder text left. These checks are step 5 of the [agent skill](draw-diagrams-with-claude-code.html), which has an agent run them before it answers. Steps 1 to 3 need no picture, so an agent can do them from the text alone. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/describe-a-diagram-as-text.html See also: - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md) - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) --- # Put architecture diagrams in slides, docs and GitHub READMEs This guide is for people who need a diagram inside a slide deck, a document or a README. `open-diagram draw` writes an SVG for READMEs and slides, and a PNG for apps that do not take SVG. ## What files does draw write? An SVG and a PNG, next to the input file: ```text $ open-diagram draw plan.json wrote plan.svg, plan.png: 900 x 371 px; smallest text 10.5 px; 0 layout problem(s) ``` The SVG is a picture made of shapes, sharp at any size. open-diagram draws every word as shapes too, so the SVG looks the same in a browser, PowerPoint, Keynote or Figma, with or without the font installed. The PNG needs Chrome, Chromium or Microsoft Edge. If yours is not in the usual place, set the `CHROME` environment variable to its path. The SVG is always written, browser or not. To write the SVG only, add `--no-png`. To write somewhere else, add `-o` with a path and no extension. ## What size are the pictures? The SVG has the size the summary line prints. The PNG has that size times its scale, which is 2 unless you set `--scale`. From the run above: | File | Size | | --- | --- | | `plan.svg` | 900 × 371 px | | `plan.png` | 1800 × 742 px | | `plan.png` with `--scale 3` | 2700 × 1113 px | The cloud templates are kept within 2,000 × 1,400 px, so each fits on one screen or slide. A larger picture has to be shrunk to be seen whole, and its text stops being readable. ## How do I put a diagram in a GitHub README? Commit the SVG, then point to it with a Markdown image and a relative link: ```markdown ![A bookshop's order system, this quarter](docs/diagrams/plan.svg) ``` GitHub's [writing and formatting guide](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#images) (checked November 25, 2026) gives this form: `!`, the alt text in `[ ]`, then the link in `( )`. For an image in your own repository, it says to use a relative link. Its own example image is an SVG. For the alt text, use the description that [`open-diagram describe`](describe-a-diagram-as-text.html) prints. The SVG already carries that text as its `<desc>`, with the title in `<title>`, so screen readers can read it. ## How do I put one in slides or a document? Add the SVG as a picture. If an app does not take SVG files, use the PNG. To change a word later, edit the diagram file, draw again, and replace the picture. ## How do I keep them current? Draw again whenever the diagram file changes. The same file gives the same SVG, byte for byte: drawing `plan.json` twice wrote identical files. In Git, a redrawn SVG shows a change only when the picture changed. A states file changes what is live and planned without editing the diagram, as [Show live and planned work](show-live-and-planned-work.html) explains. The GitHub Action in draw mode writes the SVG and PNG next to each file on every push, and does not commit them. [Keep diagrams current](keep-diagrams-current.html) sets it up. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/diagrams-in-slides-docs-and-readmes.html See also: - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md) - [Describe an architecture diagram as plain text for alt text](https://open-diagram.dev/guides/describe-a-diagram-as-text.md) - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md) --- # Draw architecture diagrams with Claude Code and an MCP server This guide is for people who want Claude Code to draw their architecture diagrams. After two installs, Claude writes a diagram, checks it and fixes every layout problem before it draws. Claude Desktop, Cursor and Amp have [their own setup guide](mcp-server-in-cursor-claude-desktop-and-amp.html). ## How do I add the MCP server? Run one command in a terminal. The MCP server is a small program that Claude Code starts on your computer, so Claude can check and draw diagrams with tools of its own. ```bash claude mcp add open-diagram -- uvx open-diagram mcp ``` The command uses [uv](https://docs.astral.sh/uv/), which fetches open-diagram and the Python it needs (3.10 or later) the first time. Without uv, run `pip install open-diagram`, then give `open-diagram` as the command and `mcp` as its first argument. uv keeps a copy of what it downloaded. To pick up a new release, add `--refresh` once after `uvx`. Setups made before 0.6.2 with `--from "open-diagram[mcp]" open-diagram-mcp` keep working. ## What can the server read and write? It takes JSON and Mermaid only, never Python, and writes files only inside the folder that `--out` names. Nothing is hosted, and nothing leaves your computer. The command above has no `--out`, so files go to the folder in the `OPEN_DIAGRAM_OUT` environment variable, else to an `open-diagram` folder where Claude Code starts the server. If that folder cannot be written, they go to one in your home folder. Icons come only from the built-in icons and from folders you name with `--icons` or the `OPEN_DIAGRAM_ICONS` environment variable. The server never reads an icon from a path Claude writes. ## How do I add the agent skill? The agent skill is a file of instructions that Claude loads when you ask for a diagram. To install it, run this in your project folder: ```bash npx skills add lukendeasy/open-diagram --skill open-diagram --agent claude-code ``` The [skills](https://skills.sh) tool puts it in `.claude/skills/` in that folder. Add `-g` to install it for all your projects. In a copy of the open-diagram repository, you can copy the folder instead: ```bash cp -r skills/open-diagram ~/.claude/skills/ ``` The skill tells Claude to plan the picture and to use only facts you gave. If the picture needs a fact you left out, Claude asks. If you want owner lines but named no owner, it writes "Owner: Not yet named". Without the MCP server, the skill has Claude install open-diagram if needed, write a file and run `open-diagram check` on it. ## What does Claude do when I ask for a diagram? Claude reads the format guide once, then writes and checks the diagram until the check reports 0 layout problems. Only then does it draw. ```json { "title": "How an agent draws with the open-diagram MCP server", "legend": false, "gap": 110, "columns": [ [{"id": "guide", "title": "Read the format", "tiles": ["format_guide"], "cols": 1}], [{"id": "write", "title": "Write the diagram", "tiles": ["JSON or Mermaid"], "cols": 1}], [{"id": "check", "title": "Check the layout", "tiles": ["check"], "cols": 1}], [{"id": "draw", "title": "Draw and compare", "tiles": ["draw", "describe"], "cols": 1}] ], "links": [ {"from": "guide", "to": "write", "label": "once"}, {"from": "write", "to": "check"}, {"from": "check", "to": "write", "lane": "bottom", "label": "fix each named problem"}, {"from": "check", "to": "draw", "label": "0 problems"} ] } ``` ![How an agent draws with the open-diagram MCP server](https://open-diagram.dev/images/pages/guides-draw-diagrams-with-claude-code-1.svg) The check: 0 layout problems The MCP server gives Claude five tools: | Tool | What Claude gets | | --- | --- | | `format_guide` | A JSON example to copy, every key, Mermaid support, and how to fix each kind of problem | | `template` | The list of templates, or one template as JSON to start from | | `check` | The layout problems, without writing files | | `draw` | The SVG and PNG written, plus the problems, the file paths, the description and the picture | | `describe` | What the picture says, in plain words | Each problem comes back as a sentence that names the parts, such as `the label 'pickup orders' on line 'orders' -> 'lockers' sits on 'orders'`. For a cloud picture, Claude calls `template` first and starts from the closest template. After `draw`, Claude compares the description with your request. Every system, state, owner and line you named should be there, and nothing you did not name. Claude then tells you where the SVG and PNG are, and which facts in the picture are its own assumptions. ## What should I ask for? Ask in plain words, with the systems, owners and states you know. The docs give this example: "Draw a systems map of our checkout, warehouse and reporting, with what is live and what is planned." ## Has this been tested? Yes, on November 25, 2026, with open-diagram 0.6.2 on macOS. In Claude Code 2.1.332, Claude called `format_guide`, `check` and `draw`, and the SVG and PNG were written with 0 layout problems. The same day, skills 1.9.0 installed the agent skill, and Claude Code loaded it from the folder the tool wrote. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/draw-diagrams-with-claude-code.html See also: - [Set up a diagram MCP server in Cursor, Claude Desktop and Amp](https://open-diagram.dev/guides/mcp-server-in-cursor-claude-desktop-and-amp.md) - [Describe an architecture diagram as plain text for alt text](https://open-diagram.dev/guides/describe-a-diagram-as-text.md) - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) - [Diagram boxes too close or overlapping: how to fix it](https://open-diagram.dev/problems/boxes-too-close.md) --- # How-to guides for open-diagram Each guide takes one task step by step, from setting up an AI agent to putting the finished picture in a README. open-diagram draws every picture on these pages when the site is built, with 0 layout problems. Updated November 25, 2026. Web page: https://open-diagram.dev/guides.html Pages: - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md): Add the open-diagram MCP server and agent skill to Claude Code, then let Claude write, check, fix and draw diagrams with 0 layout problems. - [Set up a diagram MCP server in Cursor, Claude Desktop and Amp](https://open-diagram.dev/guides/mcp-server-in-cursor-claude-desktop-and-amp.md): Setup lines for the open-diagram MCP server in Claude Desktop, Cursor and Amp, with the versions tested and the apps not yet tested. - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md): Add the open-diagram GitHub Action so every push checks or redraws your diagrams and fails when a layout problem appears. - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md): Mark each part of an architecture diagram as live, being built, in trial, planned or retiring, and update the states from one small file. - [Convert a Mermaid flowchart to a checked SVG and PNG](https://open-diagram.dev/guides/convert-mermaid.md): Turn a Mermaid flowchart into a checked SVG and PNG with one command, and see what carries over, what changes and what is not read. - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md): Draw checked architecture diagrams without writing Python: build the JSON in JavaScript, C# or any language, then run one command. - [Describe an architecture diagram as plain text for alt text](https://open-diagram.dev/guides/describe-a-diagram-as-text.md): Print what an open-diagram picture says as plain text, for alt text, screen readers and checking a picture against the request. - [Draw right-angle lines in diagrams from Python, JSON or Mermaid](https://open-diagram.dev/guides/right-angle-lines.md): Draw diagram lines as straight runs that turn at right angles, with one setting in Python, JSON or Mermaid, for the whole picture or one line. - [AWS, Azure and Google Cloud icons in architecture diagrams](https://open-diagram.dev/guides/cloud-icons.md): Draw AWS, Azure and Google Cloud diagrams with each provider's own icons, from a template or the cloud-icons skill, and the terms the icons carry. - [Put architecture diagrams in slides, docs and GitHub READMEs](https://open-diagram.dev/guides/diagrams-in-slides-docs-and-readmes.md): Put open-diagram's SVG and PNG files in slides, documents and GitHub READMEs, and redraw them when the diagram changes. --- # Draw diagrams without Python: write JSON from any language This guide is for developers whose code is in JavaScript, C# or another language that is not Python. Your program writes a JSON file, and one command turns it into a checked SVG and PNG. ## Do I need Python? Only to run the `open-diagram` command, which needs Python 3.10 or later. Your own program can be in any language that can write a text file. The command reads the JSON, then measures, lays out and checks the diagram. ## What does the JSON look like? A title, one layout, and the lines between panels. Here the layout is `columns`, a list of columns, each a list of panels: ```json { "title": "How a bus ticket is booked", "columns": [ [{"id": "web", "title": "Booking site", "tiles": ["Search", "Pay"], "cols": 1}], [{"id": "api", "title": "Booking API", "tiles": ["Seats", "Prices"], "cols": 1}], [{"id": "db", "title": "Bookings database", "tiles": ["Trips", "Tickets"], "cols": 1}] ], "links": [ {"from": "web", "to": "api"}, {"from": "api", "to": "db"} ] } ``` ![How a bus ticket is booked](https://open-diagram.dev/images/pages/guides-json-from-any-language-1.svg) The check: 0 layout problems A tile is a string, or an object with `label`, `sub`, `status` and `icon`. A link joins two panel ids, and can take a `label`, a `kind` (`flow` or `planned`) and a `lane` (`top` or `bottom`). The [JSON reference](../docs.html) lists every key. ## How do I write it from my own code? Build the object from your data and save it as a file. This JavaScript example, for Node.js, writes the diagram above from a list of services: ```javascript // Example: write-diagram.js builds the diagram from a list of services and saves it as JSON. const fs = require("fs"); const services = [ { id: "web", title: "Booking site", tiles: ["Search", "Pay"] }, { id: "api", title: "Booking API", tiles: ["Seats", "Prices"] }, { id: "db", title: "Bookings database", tiles: ["Trips", "Tickets"] }, ]; const diagram = { title: "How a bus ticket is booked", columns: services.map((s) => [{ ...s, cols: 1 }]), links: services.slice(1).map((s, i) => ({ from: services[i].id, to: s.id })), }; fs.writeFileSync("booking.json", JSON.stringify(diagram, null, 2)); ``` Then run the program and draw the file: ```text $ node write-diagram.js $ open-diagram draw booking.json wrote booking.svg, booking.png: 824 x 329 px; smallest text 12 px; 0 layout problem(s) ``` A C# program, or any other, that writes the same JSON gets the same picture. An AI agent connected to the [MCP server](draw-diagrams-with-claude-code.html) sends the same JSON as text, with no file to write. ## How do I know the JSON is right? Run `open-diagram check`. It builds the diagram in memory, writes nothing, and names the place of any mistake: ```text $ open-diagram check booking-bad.json error: columns[0][0].tiles[2]: unknown key(s) 'colour'; allowed: icon, label, status, sub ``` Each layout problem comes back as a sentence that names the parts involved. `check` and `draw` exit with 1 when the layout has problems, and with 2 when the file has a mistake like the one above or cannot be opened. A build script can stop on either. ## Can I start from an example? Yes, from a template. `open-diagram new` lists the templates, and `open-diagram new azure_web_app` writes one as JSON to edit. Every template is a JSON file, so it works from any language that can read and write JSON. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/json-from-any-language.html See also: - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md) - [Describe an architecture diagram as plain text for alt text](https://open-diagram.dev/guides/describe-a-diagram-as-text.md) - [AWS, Azure and Google Cloud icons in architecture diagrams](https://open-diagram.dev/guides/cloud-icons.md) --- # Keep architecture diagrams current with a GitHub Action This guide is for teams that keep diagram files in a GitHub repository. With the open-diagram GitHub Action, every push checks or redraws those files, and a layout problem fails the run. ## What does the Action do? It installs open-diagram, then runs the check on every file you list, or draws each one. The files can be JSON (`.json`), Mermaid (`.mmd` or `.mermaid`) or Python scripts with a `build()` function (`.py`). ## How do I add it? Add one workflow file, which tells GitHub what to run and when. 1. Put your diagram files in one folder, such as `docs/diagrams/`. 2. If you keep a states file, put it outside that folder, such as `docs/states.json`. 3. Add this file to the repository as `.github/workflows/diagrams.yml`: ```yaml # .github/workflows/diagrams.yml name: diagrams on: [push, pull_request] jobs: diagrams: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: lukendeasy/open-diagram@v0.6.2 with: files: docs/diagrams/*.json docs/diagrams/*.mmd statuses: docs/states.json # optional mode: check # or draw, to write SVG and PNG next to each file ``` 4. Push the change. Step 2 matters because `docs/diagrams/*.json` matches every JSON file in that folder. The Action reads a states file there as a diagram, and the check stops with `unknown key(s) 'Fraud checks', 'Parcel lockers'`. ## Which settings does it take? Four, and only `files` is required. | Input | Required | What it does | | --- | --- | --- | | `files` | Yes | The diagram files, separated by spaces or new lines. Patterns such as `*.json` and `**` work | | `mode` | No | `check` (the default) or `draw` | | `statuses` | No | A JSON file of names and states, applied before each diagram is built | | `python-version` | No | The Python version to use; `3.12` by default | A pattern that matches no file fails the run with `no files match 'docs/missing/*.json'`. Any mode other than `check` or `draw` fails it too. ## Should I use check mode or draw mode? Use check mode when you only need to know that every diagram has 0 layout problems, and draw mode when the job also needs the pictures. Check mode builds each diagram in memory, lists its problems and writes nothing. Draw mode also writes an SVG and a PNG next to each file. The Action does not commit or upload them. To keep them, add your own step after it. A PNG needs Chrome, Chromium or Edge on the machine that runs the job, and the Action installs none. Without a browser, `draw` writes the SVG, prints `PNG skipped: Chrome, Chromium or Edge was not found (set the CHROME environment variable to its path)`, and passes if the layout has no problems. ## What does a failing run show? In check mode, the same lines `open-diagram check` prints on your own computer. This local run covers two files, one with a crowded line label: ```text $ open-diagram check docs/diagrams/*.json docs/diagrams/*.mmd docs/diagrams/plan.json: 2 layout problem(s) - the label 'pickup orders' on line 'orders' -> 'lockers' sits on 'orders' - the label 'pickup orders' on line 'orders' -> 'lockers' sits on 'lockers' docs/diagrams/returns.mmd: 0 layout problem(s) ``` The command exits with 1, and the step fails. The [layout problem pages](../problems.html) explain each message and its fix. ## How does the Action use a states file? It applies one states file to every file it checks. For example: ```json {"Fraud checks": "live", "Parcel lockers": "building"} ``` Names match panel titles, panel ids and tile labels. When work ships, change one word and push. Each name must match a part in every file the Action checks. If one file has no part called "Fraud checks", the run stops with `no panel or tile is named 'Fraud checks'`. In check mode, the files after it are not checked. [Show live and planned work](show-live-and-planned-work.html) covers the states themselves. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/keep-diagrams-current.html See also: - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md) - [Put architecture diagrams in slides, docs and GitHub READMEs](https://open-diagram.dev/guides/diagrams-in-slides-docs-and-readmes.md) - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md) --- # Set up a diagram MCP server in Cursor, Claude Desktop and Amp This guide is for people who want the AI in Claude Desktop, Cursor or Amp to draw diagrams with open-diagram. Each app needs one block of settings or one command. With it, the app starts the MCP server, a small program on your computer that gives the app's AI its own tools to check and draw diagrams. [The Claude Code guide](draw-diagrams-with-claude-code.html) lists the server's five tools, and says what the server can read and write, how to set it up without uv, and how to update it. ## How do I set it up in Claude Desktop or Cursor? Add the same block to the app's settings file: `claude_desktop_config.json` for Claude Desktop, or `~/.cursor/mcp.json` for Cursor. 1. Open the file for your app. 2. Add this block: ```json { "mcpServers": { "open-diagram": { "command": "uvx", "args": ["open-diagram", "mcp", "--out", "/Users/you/Documents/open-diagram"] } } } ``` 3. Change `/Users/you/Documents/open-diagram` to the folder where you want the SVG and PNG files. ## How do I set it up in Amp? Run this in a terminal: ```bash amp mcp add open-diagram -- uvx open-diagram mcp ``` If you add the server to one folder's settings with `amp mcp add --workspace`, also run `amp mcp approve open-diagram`. This command sets no `--out`, so the server picks the folder for its files by the rules in [the Claude Code guide](draw-diagrams-with-claude-code.html). ## Which apps were tested? Claude Desktop, Cursor and Amp, on November 25, 2026, with open-diagram 0.6.2 on macOS. Each used the setup on this page. | App | Version | What was checked | | --- | --- | --- | | Claude Desktop | 6.28899.6 | The app found `uvx`, started the server and received its list of tools | | Cursor | 3.32.4 | Cursor connected and listed all 5 tools | | Amp | 0.0.1788357228 | Amp connected and listed all 5 tools | In these three apps, the test checked the connection and the list of tools. The Claude Code test is the only one that records a drawn picture. ## Which apps were not tested? Codex and VS Code. The open-diagram docs give no setup line for either, and list no test. The skills tool can install the agent skill for another app if you name it after `--agent`. That route was tested with Claude Code only. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/mcp-server-in-cursor-claude-desktop-and-amp.html See also: - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) - [An AGENTS.md block for drawing diagrams with open-diagram](https://open-diagram.dev/for-agents/agents-md-block.md) --- # Draw right-angle lines in diagrams from Python, JSON or Mermaid This guide is for people who want lines that run straight and turn at right angles, in place of the default curves. Each format has one setting for it. ## How do I turn on right-angle lines? Set `routing` to `orthogonal`, which means straight runs that meet at right angles. The default is `curved`. | Format | Setting | | --- | --- | | JSON | `"routing": "orthogonal"` at the top level | | Python | `Diagram("Title", routing="orthogonal")` | | Mermaid | `curve: step` in the front matter, or a `%%{init: {"flowchart": {"curve": "step"}}}%%` line | ```json { "title": "How sensor readings reach a city air-quality map", "routing": "orthogonal", "columns": [ [{"id": "sensors", "title": "Street sensors", "tiles": ["Air quality", "Noise", "Traffic counts"], "cols": 1}], [{"id": "intake", "title": "Intake service", "tiles": ["Checks readings", "Drops duplicates"], "cols": 1}], [{"id": "store", "title": "Readings store", "tiles": ["Last 90 days"], "cols": 1}, {"id": "alerts", "title": "Alerts", "tiles": ["Text messages"], "cols": 1}, {"id": "map", "title": "Public map", "tiles": ["Hourly tiles"], "cols": 1}] ], "links": [ {"from": "sensors", "to": "intake"}, {"from": "intake", "to": "store"}, {"from": "intake", "to": "alerts", "label": "over limit"}, {"from": "intake", "to": "map"} ] } ``` ![How sensor readings reach a city air-quality map](https://open-diagram.dev/images/pages/guides-right-angle-lines-1.svg) The check: 0 layout problems ## What changes in the picture? Only the lines. The blocks keep their places, and each corner of a line is slightly rounded. When two blocks face each other and their sides overlap, the line runs straight across, as it does into "Intake service" above. Lines that would share the same gap each get their own track, 12 px apart, ordered so they cross as little as possible. The check works the same way for both kinds of line. ## Can I set it for one line only? Yes. Give the link its own `routing`, `curved` or `orthogonal`, and it overrides the diagram's setting: ```python from open_diagram import Diagram, Panel d = Diagram("Sensor readings", routing="orthogonal") sensors = d.add(Panel("Street sensors", ["Air quality", "Noise"])) intake = d.right_of(sensors, Panel("Intake service", ["Checks readings"]), align="center") d.link(sensors, intake, routing="curved") ``` In JSON, put the same key on the link: `{"from": "sensors", "to": "intake", "routing": "curved"}`. A line sent through a lane (`"lane": "top"`), or given `via_x` or `via_y`, always turns at right angles. ## How do I do it in Mermaid? Use Mermaid's own `curve` setting. `step`, `stepBefore` and `stepAfter` draw right-angle lines. Any other curve draws smooth curves. ```mermaid --- title: Sign-in with right-angle lines config: flowchart: curve: step --- flowchart LR login[Sign-in page] --> check[Check password] check -->|ok| home[Home page] check -->|wrong| retry[Try again] ``` ![Sign-in with right-angle lines](https://open-diagram.dev/images/pages/guides-right-angle-lines-2.svg) The check: 0 layout problems From Python, `from_mermaid(text, routing="orthogonal")` does the same without touching the file. ## Which lines does it leave alone? The lines inside a `Graph`, a small map drawn inside a panel, with nodes on a grid. Its lines run straight from node to node, diagonals included, whatever the diagram's `routing`. To avoid a diagonal in a `Graph`, place the two nodes in the same row or column of its grid. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/right-angle-lines.html See also: - [Convert a Mermaid flowchart to a checked SVG and PNG](https://open-diagram.dev/guides/convert-mermaid.md) - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md) - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md) --- # Show live and planned work on an architecture diagram This guide is for anyone who needs one picture of what runs today and what is still coming. open-diagram draws five states, and a small file can change them without touching the diagram. ## Which states can a part have? Live, building, trial, planned and retiring: | State | Word in the key | How it is drawn | | --- | --- | --- | | `live` | Live | The default look: a solid dark border on white | | `building` | Being built | A dashed orange border on pale orange | | `trial` | In trial | A dashed purple border on pale purple | | `planned` | Planned | A dotted gray border on pale gray | | `retiring` | Retiring | A solid red border on pale red | A panel with a state also shows the state's word in its header. The key at the top lists only the states the picture uses. Lines have their own two kinds: a solid line for "Data flows today", and a dotted line, `"kind": "planned"`, for "Connection to build". ## How do I set a state? Add `"status"` to a tile or a panel. A tile becomes `{"label": ..., "status": ...}` instead of a plain string. ```json { "title": "A bookshop's order system, this quarter", "gap": 110, "columns": [ [{"id": "shop", "title": "Online shop", "tiles": ["Checkout", {"label": "Gift cards", "status": "trial"}, {"label": "Paper catalogue", "status": "retiring"}], "cols": 1}], [{"id": "orders", "title": "Order service", "tiles": ["Orders", {"label": "Fraud checks", "status": "building"}], "cols": 1}], [{"id": "lockers", "title": "Parcel lockers", "status": "planned", "tiles": ["Locker booking", "Pickup codes"], "cols": 1}] ], "links": [ {"from": "shop", "to": "orders"}, {"from": "orders", "to": "lockers", "kind": "planned", "label": "pickup orders"} ] } ``` ![A bookshop's order system, this quarter](https://open-diagram.dev/images/pages/guides-show-live-and-planned-work-1.svg) The check: 0 layout problems In Python, pass `status=` to `Tile` or `Panel`. In a Mermaid flowchart, a class named after a state sets it: `A:::building` or `class A,B planned`. ## How do I change states without editing the diagram? Keep the states in a separate file and pass it with `--statuses`. 1. Save the diagram above as `plan.json`. 2. Write `states.json`: ```json {"Fraud checks": "live", "Parcel lockers": "building"} ``` 3. Draw with the file: ```bash open-diagram draw plan.json --statuses states.json ``` Names match panel titles, panel ids and tile labels. `live` returns a part to the default look. With the same file, `open-diagram describe plan.json --statuses states.json` lists "Fraud checks" with no state and "Parcel lockers [being built]". open-diagram checks the file before it draws anything. A misspelled name stops the draw with `no panel or tile is named 'Fraud check'`. An unknown state stops it with `unknown state(s) 'done'; this theme has: live, building, trial, planned, retiring`. A JSON diagram can also keep the same names and states under a top-level `"statuses"` key. In Python, call `d.set_statuses({"Fraud checks": "live"})`. ## Can I add a state of my own? Yes, through the theme. This Python adds a dashed purple "Pilot" state: ```python from open_diagram import Diagram, Status, Theme theme = Theme() theme.statuses["pilot"] = Status("Pilot", stroke="#8E24AA", fill="#F6EDF9", dash="dashed") d = Diagram("My picture", theme=theme) ``` A JSON diagram can do the same under `"theme": {"statuses": {...}}`, with `label`, `stroke`, `fill` and an optional `dash`. ## How do I keep the states current? When work ships, change one word in the states file, then draw again. The [GitHub Action](keep-diagrams-current.html) takes the same file as its `statuses` input, so every push checks or redraws the pictures with the latest states. Updated November 25, 2026. Web page: https://open-diagram.dev/guides/show-live-and-planned-work.html See also: - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md) - [Describe an architecture diagram as plain text for alt text](https://open-diagram.dev/guides/describe-a-diagram-as-text.md) - [Convert a Mermaid flowchart to a checked SVG and PNG](https://open-diagram.dev/guides/convert-mermaid.md) --- # Business process diagram with owners: what an AI agent drew For anyone who needs a process drawn with an owner on every step, this page records one run of an AI agent doing it with open-diagram. Both drafts passed the check. The one change, to the key, came from reading the picture. ## What was asked? The user typed one sentence: ```text Draw this business process from order to delivery, with an owner on every step. ``` Hollin & Pike is an invented company that makes furniture to order and sells it online. The user gave these steps, tasks and owners: | Step | Tasks | Owner | | --- | --- | --- | | Order placed | Website order, phone order | Sales team | | Payment checked | Card payment, bank transfer | Finance team | | Made to order | Cut timber, assemble, finish | Workshop lead | | Quality check | Inspect finish, photo record | Workshop lead | | Packed | Wrap and box, print label | Warehouse team | | Delivered | Book a slot, two-person delivery | None named yet | Pieces that fail the quality check go back to the workshop. ## What did the first draft get wrong? Nothing the check measures: it reported `0 layout problem(s)`. Following the agent skill, each step is a column with a step number, and each owner is a footer. Delivery reads "Owner: Not yet named", the wording the agent skill gives when the user names no owner. The line back to the workshop runs backwards, so it goes through a lane below the picture (`"lane": "bottom"`). One fault lay outside the check: the key. open-diagram's default key shows "Live" for any box without a state, and "Data flows today" for any solid line. Here the arrows pass work from step to step. ```json { "title": "Hollin & Pike: from order to delivery", "subtitle": "Every step of a made-to-order piece, with its owner", "columns": [ [{"id": "order", "title": "Order placed", "step": 1, "tiles": ["Website order", "Phone order"], "cols": 1, "footer": "Owner: Sales team"}], [{"id": "pay", "title": "Payment checked", "step": 2, "tiles": ["Card payment", "Bank transfer"], "cols": 1, "footer": "Owner: Finance team"}], [{"id": "make", "title": "Made to order", "step": 3, "tiles": ["Cut timber", "Assemble", "Finish"], "cols": 1, "footer": "Owner: Workshop lead"}], [{"id": "qc", "title": "Quality check", "step": 4, "tiles": ["Inspect finish", "Photo record"], "cols": 1, "footer": "Owner: Workshop lead"}], [{"id": "pack", "title": "Packed", "step": 5, "tiles": ["Wrap and box", "Print label"], "cols": 1, "footer": "Owner: Warehouse team"}], [{"id": "deliver", "title": "Delivered", "step": 6, "tiles": ["Book a slot", "Two-person delivery"], "cols": 1, "footer": "Owner: Not yet named"}] ], "links": [ {"from": "order", "to": "pay"}, {"from": "pay", "to": "make"}, {"from": "make", "to": "qc"}, {"from": "qc", "to": "pack", "label": "passed"}, {"from": "pack", "to": "deliver"}, {"from": "qc", "to": "make", "lane": "bottom", "label": "fails check"} ] } ``` ![Hollin & Pike: from order to delivery](https://open-diagram.dev/images/pages/prompts-business-process-with-owners-1.svg) The check: 0 layout problems ## What changed between drafts? The agent added `"legend": false`, which removes the key; the step numbers and arrows already give the order. At the time of the run, the agent skill's list of top-level JSON fields left out `legend`, and the agent found it in the JSON reader, `src/open_diagram/spec.py`. The skill has listed it since November 25, 2026. ## What was the result? Two rounds: two drafts, two runs of the check, 0 layout problems each time, in a picture 1,640 by 439 pixels. ```json { "title": "Hollin & Pike: from order to delivery", "subtitle": "Every step of a made-to-order piece, with its owner", "legend": false, "columns": [ [{"id": "order", "title": "Order placed", "step": 1, "tiles": ["Website order", "Phone order"], "cols": 1, "footer": "Owner: Sales team"}], [{"id": "pay", "title": "Payment checked", "step": 2, "tiles": ["Card payment", "Bank transfer"], "cols": 1, "footer": "Owner: Finance team"}], [{"id": "make", "title": "Made to order", "step": 3, "tiles": ["Cut timber", "Assemble", "Finish"], "cols": 1, "footer": "Owner: Workshop lead"}], [{"id": "qc", "title": "Quality check", "step": 4, "tiles": ["Inspect finish", "Photo record"], "cols": 1, "footer": "Owner: Workshop lead"}], [{"id": "pack", "title": "Packed", "step": 5, "tiles": ["Wrap and box", "Print label"], "cols": 1, "footer": "Owner: Warehouse team"}], [{"id": "deliver", "title": "Delivered", "step": 6, "tiles": ["Book a slot", "Two-person delivery"], "cols": 1, "footer": "Owner: Not yet named"}] ], "links": [ {"from": "order", "to": "pay"}, {"from": "pay", "to": "make"}, {"from": "make", "to": "qc"}, {"from": "qc", "to": "pack", "label": "passed"}, {"from": "pack", "to": "deliver"}, {"from": "qc", "to": "make", "lane": "bottom", "label": "fails check"} ] } ``` ![Hollin & Pike: from order to delivery](https://open-diagram.dev/images/pages/prompts-business-process-with-owners-2.svg) The check: 0 layout problems Drawn by Claude Opus 5.5 on November 25, 2026, with open-diagram 0.6.2's check command, the same check the MCP server's check tool runs. Updated November 25, 2026. Web page: https://open-diagram.dev/prompts/business-process-with-owners.html See also: - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) --- # What an AI agent drew from one prompt These pages are for people deciding whether to let an AI agent draw their diagrams. Each records one real run: an agent takes one prompt, writes the diagram, runs the check, and fixes every problem it names until the check reports 0 layout problems. Each page shows the prompt, the first draft, the check's messages word for word, every change, and the finished picture, with the number of rounds. In the first five runs, every first draft passed the check. The changes that followed came from the agent skill's last step: describe the picture and look at it as a reader would. Updated November 25, 2026. Web page: https://open-diagram.dev/prompts.html Pages: - [Systems map from one prompt: what an AI agent drew](https://open-diagram.dev/prompts/systems-map-live-and-planned.md): One recorded run of an AI agent drawing a live-and-planned systems map with open-diagram. The first draft had 0 layout problems. - [Mermaid flowchart to slide diagram: what an AI agent drew](https://open-diagram.dev/prompts/mermaid-flowchart-to-slide.md): One recorded run of an AI agent turning a pasted Mermaid flowchart into a slide diagram with open-diagram, in three drafts. - [Release cycle ring diagram from one prompt: what an AI agent drew](https://open-diagram.dev/prompts/release-cycle-ring.md): One recorded run of an AI agent drawing a release cycle as a ring, goals in the middle, with open-diagram. Two drafts, 0 layout problems. - [Business process diagram with owners: what an AI agent drew](https://open-diagram.dev/prompts/business-process-with-owners.md): One recorded run of an AI agent drawing an order-to-delivery process with an owner on every step, using open-diagram. Two drafts. - [Layered stack diagram with retiring parts: what an AI agent drew](https://open-diagram.dev/prompts/stack-layers-retiring.md): One recorded run of an AI agent drawing a software stack as layers, with retiring parts marked, using open-diagram. Two drafts. --- # Mermaid flowchart to slide diagram: what an AI agent drew For anyone with a Mermaid flowchart to put on a slide, this page records one run of an AI agent doing it with open-diagram. All three drafts passed the check; each change came from the picture's size. ## What was asked? The user typed one sentence and pasted a flowchart: ```text Turn this Mermaid flowchart into a diagram I can put on a slide. ``` Quillfern is an invented home-repair booking service. In its flowchart, dotted lines mark steps not built yet: ```mermaid flowchart TD %% dotted = not built yet subgraph Office A[Customer books a repair] --> B{Job type known?} B -->|Yes| C[Match a fixer] B -->|No| D[Call the customer] D --> C end subgraph Field C --> E[Fixer accepts the job] E --> F[Visit and repair] F --> G{Customer happy?} G -->|No| I[Send a second fixer] I --> F end G -->|Yes| H[Take payment] H --> J[Ask for a review] H -.-> K[Text the invoice] ``` ## What did the first draft get wrong? Nothing the check measures: it reported `0 layout problem(s)`. The picture's size was the trouble. The agent skill says to draw a Mermaid flowchart directly, so the first draft is the user's file with two changes. It has a title, since open-diagram titles a file without one "Flowchart". It reads `LR` in place of `TD`, since a slide is wide. ```mermaid --- title: How Quillfern handles a repair request --- flowchart LR %% dotted = not built yet subgraph Office A[Customer books a repair] --> B{Job type known?} B -->|Yes| C[Match a fixer] B -->|No| D[Call the customer] D --> C end subgraph Field C --> E[Fixer accepts the job] E --> F[Visit and repair] F --> G{Customer happy?} G -->|No| I[Send a second fixer] I --> F end G -->|Yes| H[Take payment] H --> J[Ask for a review] H -.-> K[Text the invoice] ``` ![How Quillfern handles a repair request](https://open-diagram.dev/images/pages/prompts-mermaid-flowchart-to-slide-1.svg) The check: 0 layout problems The picture is 1,894 by 640 pixels. Each subgraph gets its own band, so the Field steps sit below and to the right of the Office steps, leaving two corners empty. The line back from "Send a second fixer" climbs above the Field group. ## What changed between drafts? 1. Draft 2 went back to the user's `TD`. The check reported `0 layout problem(s)`; the picture was 910 by 1,107 pixels, taller than wide. 2. Draft 3 is JSON, because open-diagram places the boxes of a Mermaid file itself. The steps sit in five columns, up to three deep, and the subgraphs became groups. The check reported `0 layout problem(s)`. ## What was the result? Three rounds: three drafts, three runs of the check, 0 layout problems each time. ```json { "title": "How Quillfern handles a repair request", "columns": [ [{"id": "book", "title": "Customer books a repair"}, {"id": "known", "title": "Job type known?"}, {"id": "call", "title": "Call the customer"}], [{"id": "match", "title": "Match a fixer"}], [{"id": "accepts", "title": "Fixer accepts the job"}, {"id": "visit", "title": "Visit and repair"}, {"id": "second", "title": "Send a second fixer"}], [{"id": "happy", "title": "Customer happy?"}], [{"id": "review", "title": "Ask for a review"}, {"id": "pay", "title": "Take payment"}, {"id": "invoice", "title": "Text the invoice"}] ], "groups": [ {"label": "Office", "members": ["book", "known", "call", "match"]}, {"label": "Field", "members": ["accepts", "visit", "second", "happy"]} ], "links": [ {"from": "book", "to": "known", "start": "bottom", "end": "top"}, {"from": "known", "to": "call", "start": "bottom", "end": "top", "label": "No"}, {"from": "known", "to": "match", "label": "Yes"}, {"from": "call", "to": "match"}, {"from": "match", "to": "accepts"}, {"from": "accepts", "to": "visit", "start": "bottom", "end": "top"}, {"from": "visit", "to": "happy"}, {"from": "happy", "to": "second", "start": "bottom", "end": "right", "label": "No"}, {"from": "second", "to": "visit", "start": "top", "end": "bottom"}, {"from": "happy", "to": "pay", "label": "Yes"}, {"from": "pay", "to": "review", "start": "top", "end": "bottom"}, {"from": "pay", "to": "invoice", "start": "bottom", "end": "top", "kind": "planned"} ] } ``` ![How Quillfern handles a repair request](https://open-diagram.dev/images/pages/prompts-mermaid-flowchart-to-slide-2.svg) The check: 0 layout problems The picture is 1,388 by 472 pixels, still about three times as wide as tall. It is 27 percent narrower than the first draft, so at the same slide width its text is 36 percent larger. Every node, line and label from the flowchart is there, and the dotted line is a planned connection. The diamonds are gone: open-diagram draws every node as the same box, so the question marks in the titles mark the decisions. Drawn by Claude Opus 5.5 on November 25, 2026, with open-diagram 0.6.2's check command, the same check the MCP server's check tool runs. Updated November 25, 2026. Web page: https://open-diagram.dev/prompts/mermaid-flowchart-to-slide.html See also: - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) --- # Release cycle ring diagram from one prompt: what an AI agent drew For anyone who wants a cycle drawn as a ring, this page records one run of an AI agent doing it with open-diagram. Both drafts passed the check; the second drops a key the picture did not need. ## What was asked? The user typed one sentence: ```text Draw our release cycle as a ring, with the goals in the middle. ``` Ottermint is an invented company that makes a budgeting app for phones and ships a release every two weeks. Its six stages are plan (pick fixes, size the work), build (write code, unit tests), review (code review, design check), beta test (beta testers, crash reports), release (app stores, release notes) and learn (store ratings, support tickets). Its goals are to ship every two weeks, have fewer crashes and answer support within a day. ## What did the first draft get wrong? Nothing the check measures: it reported `0 layout problem(s)`. Following the agent skill, the draft puts the stages in a `ring` and the goals in `center`. Lines in a ring leave from the sides that face each other, so none needed a `start` or `end`. One fault lay outside the check: the key. open-diagram's default key shows "Live" for any box without a state, and "Data flows today" for any solid line. Here no box has a state, and each arrow means "next stage". ```json { "title": "Ottermint release cycle", "subtitle": "One budgeting app release every two weeks", "ring": [ {"id": "plan", "title": "Plan", "tiles": ["Pick fixes", "Size the work"], "cols": 1}, {"id": "build", "title": "Build", "tiles": ["Write code", "Unit tests"], "cols": 1}, {"id": "review", "title": "Review", "tiles": ["Code review", "Design check"], "cols": 1}, {"id": "beta", "title": "Beta test", "tiles": ["Beta testers", "Crash reports"], "cols": 1}, {"id": "release", "title": "Release", "tiles": ["App stores", "Release notes"], "cols": 1}, {"id": "learn", "title": "Learn", "tiles": ["Store ratings", "Support tickets"], "cols": 1} ], "center": [ {"id": "goals", "title": "Goals", "tone": "neutral", "tiles": ["Ship every two weeks", "Fewer crashes", "Support reply in a day"], "cols": 1} ], "links": [ {"from": "plan", "to": "build"}, {"from": "build", "to": "review"}, {"from": "review", "to": "beta"}, {"from": "beta", "to": "release"}, {"from": "release", "to": "learn"}, {"from": "learn", "to": "plan", "label": "next cycle"} ] } ``` ![Ottermint release cycle](https://open-diagram.dev/images/pages/prompts-release-cycle-ring-1.svg) The check: 0 layout problems ## What changed between drafts? The agent added `"legend": false`, which removes the key; with no states and one kind of line, the picture needs none. At the time of the run, the agent skill's list of top-level JSON fields left out `legend`, and the agent found it in the JSON reader, `src/open_diagram/spec.py`. The skill has listed it since November 25, 2026. ## What was the result? Two rounds: two drafts, two runs of the check, 0 layout problems each time, in a picture 849 by 791 pixels. ```json { "title": "Ottermint release cycle", "subtitle": "One budgeting app release every two weeks", "legend": false, "ring": [ {"id": "plan", "title": "Plan", "tiles": ["Pick fixes", "Size the work"], "cols": 1}, {"id": "build", "title": "Build", "tiles": ["Write code", "Unit tests"], "cols": 1}, {"id": "review", "title": "Review", "tiles": ["Code review", "Design check"], "cols": 1}, {"id": "beta", "title": "Beta test", "tiles": ["Beta testers", "Crash reports"], "cols": 1}, {"id": "release", "title": "Release", "tiles": ["App stores", "Release notes"], "cols": 1}, {"id": "learn", "title": "Learn", "tiles": ["Store ratings", "Support tickets"], "cols": 1} ], "center": [ {"id": "goals", "title": "Goals", "tone": "neutral", "tiles": ["Ship every two weeks", "Fewer crashes", "Support reply in a day"], "cols": 1} ], "links": [ {"from": "plan", "to": "build"}, {"from": "build", "to": "review"}, {"from": "review", "to": "beta"}, {"from": "beta", "to": "release"}, {"from": "release", "to": "learn"}, {"from": "learn", "to": "plan", "label": "next cycle"} ] } ``` ![Ottermint release cycle](https://open-diagram.dev/images/pages/prompts-release-cycle-ring-2.svg) The check: 0 layout problems Drawn by Claude Opus 5.5 on November 25, 2026, with open-diagram 0.6.2's check command, the same check the MCP server's check tool runs. Updated November 25, 2026. Web page: https://open-diagram.dev/prompts/release-cycle-ring.html See also: - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) --- # Layered stack diagram with retiring parts: what an AI agent drew For anyone who wants a stack drawn as layers with its retiring parts marked, this page records one run of an AI agent doing it with open-diagram. Both drafts passed the check; the second removes three arrows the picture did not need. ## What was asked? The user typed one sentence: ```text Show this stack as layers, with the parts we are retiring marked. ``` Maplestave is an invented company that sells tickets for small theatres. Its stack, from the top, is apps (booking website, box office app, kiosks), services (seat maps, payments, e-tickets, printed tickets), data (main database, reporting copy, sales archive) and hosting (cloud servers, office server). Maplestave is retiring the kiosks, printed tickets, sales archive and office server. ## What did the first draft get wrong? Nothing the check measures: it reported `0 layout problem(s)`. The agent skill says `columns` can read top to bottom for layers. In JSON, that is one column of four layers, each with its parts in a row. The four retiring parts carry `"status": "retiring"`, which draws them in red and adds "Retiring" to the key. As in the library's layers example, an arrow joins each layer to the one below. One line of the key lay outside the check. open-diagram's default key calls every solid line "Data flows today". The data layer sends nothing to hosting; it is stored there. ```json { "title": "Maplestave ticketing stack", "subtitle": "Top to bottom, with the parts we are retiring", "columns": [[ {"id": "apps", "title": "Apps", "cols": 3, "tiles": ["Booking website", "Box office app", {"label": "Kiosks", "status": "retiring"}]}, {"id": "services", "title": "Services", "cols": 4, "tiles": ["Seat maps", "Payments", "E-tickets", {"label": "Printed tickets", "status": "retiring"}]}, {"id": "data", "title": "Data", "cols": 3, "tiles": ["Main database", "Reporting copy", {"label": "Sales archive", "status": "retiring"}]}, {"id": "hosting", "title": "Hosting", "cols": 2, "tiles": ["Cloud servers", {"label": "Office server", "status": "retiring"}]} ]], "links": [ {"from": "apps", "to": "services", "start": "bottom", "end": "top"}, {"from": "services", "to": "data", "start": "bottom", "end": "top"}, {"from": "data", "to": "hosting", "start": "bottom", "end": "top"} ] } ``` ![Maplestave ticketing stack](https://open-diagram.dev/images/pages/prompts-stack-layers-retiring-1.svg) The check: 0 layout problems ## What changed between drafts? The agent removed the three arrows. The stacking already shows the order, and the agent skill's rule for lines is "Only the flows that matter." The key now shows only "Live" and "Retiring". ## What was the result? Two rounds: two drafts, two runs of the check, 0 layout problems each time, in a picture 640 by 704 pixels. ```json { "title": "Maplestave ticketing stack", "subtitle": "Top to bottom, with the parts we are retiring", "columns": [[ {"id": "apps", "title": "Apps", "cols": 3, "tiles": ["Booking website", "Box office app", {"label": "Kiosks", "status": "retiring"}]}, {"id": "services", "title": "Services", "cols": 4, "tiles": ["Seat maps", "Payments", "E-tickets", {"label": "Printed tickets", "status": "retiring"}]}, {"id": "data", "title": "Data", "cols": 3, "tiles": ["Main database", "Reporting copy", {"label": "Sales archive", "status": "retiring"}]}, {"id": "hosting", "title": "Hosting", "cols": 2, "tiles": ["Cloud servers", {"label": "Office server", "status": "retiring"}]} ]] } ``` ![Maplestave ticketing stack](https://open-diagram.dev/images/pages/prompts-stack-layers-retiring-2.svg) The check: 0 layout problems Drawn by Claude Opus 5.5 on November 25, 2026, with open-diagram 0.6.2's check command, the same check the MCP server's check tool runs. Updated November 25, 2026. Web page: https://open-diagram.dev/prompts/stack-layers-retiring.html See also: - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) --- # Systems map from one prompt: what an AI agent drew For anyone deciding whether to hand a systems map to an AI agent, this page records one run with open-diagram. The first draft passed the check and matched the request, so it is the finished picture. ## What was asked? The user typed one sentence: ```text Draw a systems map of our checkout, warehouse and reporting, with what is live and what is planned. ``` Tallowmere Goods is an invented company that sells kitchenware online. These facts came with the prompt: - Live: a web shop (basket, card payments), an order system (orders, refunds) that sends new orders to a stock system (stock levels, pick lists), and a sales report (daily sales, refund totals) filled nightly from the order system. - Planned: gift cards in the web shop, a mobile app checkout, carrier label printing fed by the stock system, and a stock dashboard with low stock alerts. ## What did the first draft get wrong? Nothing the check measures: it reported `0 layout problem(s)`. The agent skill's last step is to run `open-diagram describe` and compare its text with the request. The text listed seven boxes, three groups and six lines, each part in the state the user gave. The picture showed nothing to change. Three choices came from the agent skill. The areas named in the prompt became groups, with the order system between them. The nightly line skips the warehouse column, so it runs in a lane above the picture (`"lane": "top"`). Connections still to build are `"kind": "planned"`, drawn dotted. ## What changed between drafts? Nothing. There was one draft. ## What was the result? One round: one draft, one run of the check, 0 layout problems, in a picture 1,148 by 625 pixels. ```json { "title": "Tallowmere Goods: checkout, warehouse and reporting", "subtitle": "What is live today and what is planned", "columns": [ [{"id": "web", "title": "Web shop", "tiles": ["Basket", "Card payments", {"label": "Gift cards", "status": "planned"}], "cols": 1}, {"id": "app", "title": "Mobile app", "status": "planned", "tiles": ["App checkout"], "cols": 1}], [{"id": "orders", "title": "Order system", "tiles": ["Orders", "Refunds"], "cols": 1}], [{"id": "stock", "title": "Stock system", "tiles": ["Stock levels", "Pick lists"], "cols": 1}, {"id": "labels", "title": "Carrier labels", "status": "planned", "tiles": ["Label printing"], "cols": 1}], [{"id": "sales", "title": "Sales report", "tiles": ["Daily sales", "Refund totals"], "cols": 1}, {"id": "dash", "title": "Stock dashboard", "status": "planned", "tiles": ["Low stock alerts"], "cols": 1}] ], "groups": [ {"label": "Checkout", "members": ["web", "app"]}, {"label": "Warehouse", "members": ["stock", "labels"]}, {"label": "Reporting", "members": ["sales", "dash"]} ], "links": [ {"from": "web", "to": "orders"}, {"from": "app", "to": "orders", "kind": "planned"}, {"from": "orders", "to": "stock", "label": "new orders"}, {"from": "stock", "to": "labels", "kind": "planned", "start": "bottom", "end": "top"}, {"from": "orders", "to": "sales", "lane": "top", "label": "nightly"}, {"from": "stock", "to": "dash", "kind": "planned"} ] } ``` ![Tallowmere Goods: checkout, warehouse and reporting](https://open-diagram.dev/images/pages/prompts-systems-map-live-and-planned-1.svg) The check: 0 layout problems Drawn by Claude Opus 5.5 on November 25, 2026, with open-diagram 0.6.2's check command, the same check the MCP server's check tool runs. Updated November 25, 2026. Web page: https://open-diagram.dev/prompts/systems-map-live-and-planned.html See also: - [Systems map diagram with live and planned parts, from Python](https://open-diagram.dev/diagrams/systems-map.md) - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md) - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) --- # An AGENTS.md block for drawing diagrams with open-diagram This page is for people who set up coding agents. AGENTS.md (or CLAUDE.md) is a file of instructions for coding agents, kept in your project. The library's own [AGENTS.md](https://github.com/lukendeasy/open-diagram/blob/main/AGENTS.md) is a different file: it is for agents that change the open-diagram library itself. ## What do I paste? Paste this block, as it is, anywhere in the file. ```markdown ## Diagrams This project draws its diagrams with open-diagram. - Install it with `pip install open-diagram`. - Without installing, put `uvx` in front of each command: `uvx open-diagram check FILE`. - FILE is `.json`, `.mmd` (Mermaid), or `.py` (a script whose `build()` returns a `Diagram`). Docs, as Markdown: - Format guide: https://open-diagram.dev/for-agents/format-guide.md - JSON: https://open-diagram.dev/docs/json.md - Python: https://open-diagram.dev/docs/python.md - Mermaid: https://open-diagram.dev/docs/mermaid.md - Layout problems: https://open-diagram.dev/problems.md - All docs in one file: https://open-diagram.dev/llms-full.txt For each diagram: 1. Run `open-diagram check FILE`. 2. Fix every problem it names. 3. Run the check again. Repeat until it reports `0 layout problem(s)`. 4. Run `open-diagram describe FILE`. Compare the text with the request. 5. Run `open-diagram draw FILE`. It writes the SVG and PNG next to FILE. 6. Tell the user where the SVG and PNG are. ``` ## How do I change the block for my project? Edit the lines that differ in your project. - To write the SVG and PNG to another place, give `draw` a path without an extension: `open-diagram draw FILE -o docs/diagrams/NAME`. `draw` makes the folder if it does not exist. - To draw PNG files, the computer needs Chrome, Chromium or Edge. Without one, `draw` writes the SVG only. - If the agent has the MCP server, it can call the `check`, `describe` and `draw` tools in place of the commands. [MCP tools](https://open-diagram.dev/for-agents/mcp-tools.md) gives their arguments. Updated November 25, 2026. Web page: https://open-diagram.dev/for-agents/agents-md-block.html See also: - [The open-diagram format guide, as the MCP server returns it](https://open-diagram.dev/for-agents/format-guide.md) - [open-diagram layout problem messages and their fixes](https://open-diagram.dev/for-agents/layout-problem-messages.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) --- # The open-diagram format guide, as the MCP server returns it This page is the text that the MCP server's `format_guide` tool returns, for agents that write diagrams with or without the server. The build takes it from the library, and the icon list at the end shows the built-in icons. A server started with `--icons` also lists the icons in those folders. ```text # open-diagram format guide Write the diagram as JSON (below) or as a Mermaid flowchart. Call `check` until it reports 0 layout problems, then `draw`. Every problem names the parts involved; fix each one, never ignore it. ## JSON: a worked example to copy { "title": "How a search request is answered", "subtitle": "Optional one-line scope", "tag": "DRAFT", "steps": [[1, "Cache results"], [2, "Add spelling fixes"]], "steps_label": "Rollout", "columns": [ [{"id": "app", "title": "Web app", "tiles": ["Search box", "Results page"], "cols": 1, "footer": "Owner: Web team"}], [{"id": "api", "title": "Search API", "step": 1, "tiles": ["Checks access", {"label": "Caches results", "status": "building"}], "cols": 1}, {"id": "logs", "title": "Request log", "tiles": ["Daily totals"], "tone": "neutral"}], [{"id": "index", "title": "Search index", "status": "planned", "step": 2, "tiles": ["Product text", {"label": "Spelling fixes", "status": "planned"}], "cols": 1}] ], "groups": [{"label": "Platform", "members": ["api", "logs"], "sub": "Run by the platform team"}], "links": [ {"from": "app", "to": "api"}, {"from": "api", "to": "logs", "start": "bottom", "end": "top"}, {"from": "api", "to": "index", "kind": "planned", "label": "new"}, {"from": "app", "to": "index", "lane": "top", "label": "Direct for admins"} ] } ## Other shapes Use exactly one layout. "columns" (above) reads left to right. "ring" puts panels around a circle, clockwise from the top, for cycles: {"title": "...", "ring": [panels], "center": [panels in the middle], "gap": 84, "links": [...]}. "panels" places each panel where you say: give every panel "x" and "y" (its top-left corner, in pixels). In ring and panels layouts, links leave from the sides that face each other unless you set start and end. ## Keys - Top level: title (required), one layout (columns, ring with optional center and start_angle, or panels), subtitle, tag, note {title, lines}, steps [[number, text]], steps_label, gap, row_gap, valign, groups, links, statuses {name: state}, theme, routing ("orthogonal" draws every line as straight runs that meet at right angles; the default is "curved"). - Panel: title (required), id (used by links and groups; defaults to the title), sub, status, step, footer ("Owner: ..."; text before the colon is bold), tone (default, neutral, accent = soft yellow, dark = charcoal), width, x and y (panels layout only), tiles (strings or {label, sub, status}) with cols and label, or sections (each {"tiles": [...]}, {"text": "..."}, {"card": {"title", "rows": [[name, value]], "intro"}}, {"graph": {"nodes", "links", "at"}}, or {"row": [sections]}). - Link: from, to (panel ids), kind (flow = solid, planned = dotted), label, start/end (left, right, top, bottom, or auto: the side facing the other panel), lane (top or bottom: route around the picture), via_x / via_y, cross_ok, dash (solid, dashed or dotted; optional style override independent of deployment state), routing (curved or orthogonal, for this link only). - Group: label, members (panel ids), sub. - States: live (default look), building, trial, planned, retiring. Use them only when the user cares about state. ## Cloud resources and templates For cloud architecture, call `template` with no name to list the templates, then `template` with a name to get one as JSON; keep its shape, replace the labels, keep each resource's sub (the service name). To write one yourself, use "resources" instead of a layout (or with "panels"): each {id, label, sub, icon, x, y} is a large icon with its label under it, placed at x and y in pixels. "enclosures" draw boxes around resources: {id, label, members, sub, border (solid, dashed, dotted), style (outline, or panel for a filled header), pad, fill, stroke, tone}; list them from the inside out. An icon is a name such as "aws/s3"; the icons available are listed at the end of this guide. Links join resource ids as they join panels. ## Mermaid flowchart or graph, any direction; nodes with any bracket shape; chains and &; edge labels (-->|text| or -- text -->); dotted edges (-.->) become planned; top-level subgraphs become shaded groups; A:::building or class A,B planned sets a state; a front-matter title: line sets the title; curve: step (in front matter, or %%{init: {"flowchart": {"curve": "step"}}}%%) draws right-angle lines. ## Fixing problems Use the first line below whose words the message contains; the more specific lines come first. - "sits on the title of group": give the link another start/end side or a lane, or move the group's panels. - "group ... overlaps": add the panel to the group, or move it out of the group's area. - "groups ... overlap": move one group's panels so the two areas no longer cross, or put one group wholly inside the other. - "graph: the label ... touches" or "graph: the labels ... touch": spread the nodes in "at", or shorten the label. - "graph: the line ... runs through": move a node so the straight line between the pair is clear. - "overlap" or "px apart": raise gap or row_gap, or move panels to other columns. - "crosses": route the link with a lane, change start/end, or reorder columns. - "label ... sits on": shorten the label or raise gap. - "facing away": the link leaves or enters on the wrong side; set start and end to auto, or use a lane. - "needs N px": shorten the words or give the panel more width. - "smallest text": shorten the words; never shrink text below the theme's minimum. Long curved links between distant panels are hard to follow: put the two panels side by side, or use a lane. When the user asks for straight, square or right-angle lines, set "routing": "orthogonal" at the top level. Yellow: the accent tone is yellow. When any panel uses it, step numbers turn charcoal so yellow keeps one meaning; use accent for one kind of panel only and say what it means in a note. Keep panel titles to two to four words and tiles to four words or fewer. Never invent owners, numbers or states. Icons available: aws/api-gateway, aws/athena, aws/glue, aws/lambda, aws/mwaa, aws/quicksight, aws/rds, aws/s3, azure/app-service, azure/block-blob, azure/cache-for-redis, azure/front-door, azure/key-vault, azure/sql-database, gcp/bigquery, gcp/cloud-functions, gcp/cloud-run, gcp/cloud-storage, gcp/pub-sub, gcp/vertex-ai ``` Updated November 25, 2026. Web page: https://open-diagram.dev/for-agents/format-guide.html See also: - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) - [open-diagram layout problem messages and their fixes](https://open-diagram.dev/for-agents/layout-problem-messages.md) - [An AGENTS.md block for drawing diagrams with open-diagram](https://open-diagram.dev/for-agents/agents-md-block.md) --- # open-diagram for AI agents This page is for AI coding agents, such as Claude Code, Cursor and Amp, and for the people who set them up. It lists each way an agent can use open-diagram, with the exact command. open-diagram draws architecture diagrams as SVG and PNG files from JSON, Mermaid or Python, and names each layout problem in plain words. ## How does an agent connect to the MCP server? Add the server to the app's MCP settings, with one of the setups below. An MCP server is a small program that an AI app starts on your computer, so the AI can draw diagrams as one of its own actions. open-diagram's MCP server accepts JSON and Mermaid only, never Python, and writes files only inside one output folder. Claude Code: ```bash claude mcp add open-diagram -- uvx open-diagram mcp ``` Amp: ```bash amp mcp add open-diagram -- uvx open-diagram mcp ``` In Amp, a server added to one folder's settings (`amp mcp add --workspace`) also needs `amp mcp approve open-diagram`. Claude Desktop (`claude_desktop_config.json`) or Cursor (`~/.cursor/mcp.json`): ```json { "mcpServers": { "open-diagram": { "command": "uvx", "args": ["open-diagram", "mcp", "--out", "/Users/you/Documents/open-diagram"] } } } ``` Replace `/Users/you/Documents/open-diagram` with the folder for the SVG and PNG files. `uvx` is part of [uv](https://docs.astral.sh/uv/). The first time, it fetches open-diagram and Python 3.10 or later. uv keeps a copy of what it downloaded. To pick up a new release, add `--refresh` once after `uvx`. Without uv, run `pip install open-diagram`. Then use `open-diagram` as the command and `mcp` as its first argument. The server has five tools: `format_guide`, `template`, `check`, `describe` and `draw`. [MCP tools](https://open-diagram.dev/for-agents/mcp-tools.md) gives each tool's arguments and what it returns. ## How does an agent load the agent skill? Install it with the [skills](https://skills.sh) tool. An agent skill is a folder of instructions that an agent loads when it needs them. open-diagram's skill is [`skills/open-diagram/SKILL.md`](https://github.com/lukendeasy/open-diagram/blob/main/skills/open-diagram/SKILL.md). ```bash npx skills add lukendeasy/open-diagram --skill open-diagram --agent claude-code ``` This writes the skill to `.claude/skills/` in the current folder. Add `-g` to install it for all your projects. For another app, name that app after `--agent`. In a copy of the open-diagram repo, you can copy the folder instead: ```bash cp -r skills/open-diagram ~/.claude/skills/ ``` ## How does an agent use the command line? Run `open-diagram` with one of these commands. Each one takes a JSON file (`.json`), a Mermaid flowchart (`.mmd` or `.mermaid`), or a Python script (`.py`) with a `build()` function that returns a `Diagram`. ```bash open-diagram check plan.json # lists the layout problems; writes no files open-diagram describe plan.json # prints what the picture says, in plain words open-diagram draw plan.json # writes plan.svg and plan.png next to plan.json open-diagram new # lists the templates open-diagram new azure_web_app # writes azure_web_app.json to start from ``` `check` and `draw` exit with status 1 when the layout has problems. Status 2 means the file could not be read. The message after `error:` names the place, such as `columns[0][0].tiles[0]`. PNG files need Chrome, Chromium or Edge. If the browser is not found, set `CHROME` to its path. The SVG is always written. [Command line](https://open-diagram.dev/docs/cli.html) lists every option. ## How does an agent use the Python library? Install it with pip, then write a script whose `build()` function returns a `Diagram`. ```bash pip install open-diagram python3 -c "import open_diagram; print(open_diagram.__version__)" ``` open-diagram needs Python 3.10 or later. Check a script with `open-diagram check script.py`. [Python](https://open-diagram.dev/docs/python.html) lists every block and placing method. ## Where are the docs as plain text? They are in two text files and in the Markdown copy of each page. - [llms.txt](https://open-diagram.dev/llms.txt) lists the pages, with one line for each. - [llms-full.txt](https://open-diagram.dev/llms-full.txt) has the Docs pages and the pages in these sections as Markdown, one after another: Diagram examples, Compared, Layout problems, Guides, Prompts and For AI agents. - Each Docs page, and each page in those six sections, has a Markdown copy at the same address, with `.md` in place of `.html`. This page's copy is [https://open-diagram.dev/for-agents.md](https://open-diagram.dev/for-agents.md). ## What are the steps for one diagram? Write, check, fix, describe, then draw. The steps come from the agent skill. Each step names the command, then the MCP tool. 1. If you use the MCP server, call `format_guide` once. 2. Write the diagram as JSON, Mermaid or Python. 3. Run `open-diagram check plan.json`, or call `check`. 4. Fix every problem the check names. 5. Run the check again. Repeat until it reports `0 layout problem(s)`. 6. Run `open-diagram describe plan.json`, or call `describe`. 7. Compare the description with the request. Every system, state, owner and line the user named must be there, and nothing they did not name. 8. Run `open-diagram draw plan.json`, or call `draw`. 9. Look at the PNG. 10. Tell the user where the SVG and PNG are, and which facts in the picture are your assumptions. A check that finds a problem prints one line for it: ```text plan.json: 1 layout problem(s) - line 'web' -> 'ops' crosses 'orders'; route it with via_x/via_y, move a block, or pass cross_ok=True ``` After `"lane": "top"` was added to that link, which routes it above the picture, the check printed `plan.json: 0 layout problem(s)`. [Layout problem messages](https://open-diagram.dev/for-agents/layout-problem-messages.md) gives the fix for each message. ## Which version does this page describe? Version 0.6.2, from the library's `pyproject.toml`. To upgrade an install made with pip, run `pip install -U open-diagram`. Check PyPI for the latest version: [https://pypi.org/project/open-diagram/](https://pypi.org/project/open-diagram/) Updated November 25, 2026. Web page: https://open-diagram.dev/for-agents.html See also: - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) - [An AGENTS.md block for drawing diagrams with open-diagram](https://open-diagram.dev/for-agents/agents-md-block.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) - [Set up a diagram MCP server in Cursor, Claude Desktop and Amp](https://open-diagram.dev/guides/mcp-server-in-cursor-claude-desktop-and-amp.md) Pages: - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md): The five tools of the open-diagram MCP server, with each argument, its type and default, what each tool returns, and which one writes files. - [The open-diagram format guide, as the MCP server returns it](https://open-diagram.dev/for-agents/format-guide.md): The format guide that the open-diagram MCP server's format_guide tool returns: a JSON example, every key, Mermaid rules and fixes. - [open-diagram layout problem messages and their fixes](https://open-diagram.dev/for-agents/layout-problem-messages.md): Every layout problem message open-diagram reports, in the exact words of the code, with what it means and how to fix it. - [An AGENTS.md block for drawing diagrams with open-diagram](https://open-diagram.dev/for-agents/agents-md-block.md): A block to paste into your project's AGENTS.md or CLAUDE.md, so a coding agent draws diagrams with open-diagram and fixes each layout problem. --- # open-diagram layout problem messages and their fixes This page is for AI agents that read the output of `open-diagram check`, `open-diagram draw`, or the MCP tools `check` and `draw`. It gives every layout problem message in version 0.6.2, in the exact words of the code, with what it means and the fix. Ten of these problems also have a page with a picture, listed on [Layout problems](https://open-diagram.dev/problems.html). ## How do I read a problem message? Each message is one line that names the parts involved. `open-diagram check` prints it under `FILE: N layout problem(s)`, after ` - `; `open-diagram draw` ends its summary line with the count instead. The MCP tools print it after `- `. In Python, `save()` writes the files, then raises `LayoutError` with the list. ```text plan.json: 1 layout problem(s) - line 'web' -> 'ops' crosses 'orders'; route it with via_x/via_y, move a block, or pass cross_ok=True ``` A name in quotes is the part's `id` in JSON, or its title (a resource's label) when it has no `id`. In Python, it is the block's title, or the `name` given when the block was placed. ## What does each message mean, and what is the fix? Find the message in the first column. In the messages, `A`, `B` and `P` stand for the names of blocks or graph nodes. `G` and `H` stand for group labels, `L` and `M` for line labels, `T` for a tile or resource label, `SIDE` for `left`, `right`, `top` or `bottom`, and `N` for a number. | Message | What it means | Fix | | --- | --- | --- | | `'A' and 'B' overlap; move one (right_of() and below() keep a gap)` | Two blocks cover each other. | Raise `gap` or `row_gap`, move one block to another column, or place it with `right_of()` or `below()`. | | `'A' and 'B' are only N px apart (minimum N)` | Two blocks are closer than the minimum gap, 16 px by default. | Raise `gap` or `row_gap`, move one block to another column, or place it with `right_of()` or `below()`. | | `line 'A' -> 'B' crosses 'P'; route it with via_x/via_y, move a block, or pass cross_ok=True` | The line runs through a block that is not one of its ends. | Route the line through a lane (`"lane": "top"` or `"bottom"` in JSON, `via_y` or `via_x` in Python), change `start` and `end`, or reorder the columns. Use `cross_ok` only when the line should pass behind the block. | | `line 'A' -> 'B' leaves 'A' from its SIDE side, facing away from 'B'; use start='auto' and end='auto', other sides, or a lane (via_x/via_y)` | The line starts on a side of A that points away from B. | Set `start` and `end` to `auto`, choose other sides, or route the line through a lane. | | `line 'A' -> 'B' enters 'B' from its SIDE side, facing away from 'A'; use start='auto' and end='auto', other sides, or a lane (via_x/via_y)` | The line ends on a side of B that points away from A. | Set `start` and `end` to `auto`, choose other sides, or route the line through a lane. | | `the label 'L' on line 'A' -> 'B' sits on 'P'` | The line's label covers a block. | Shorten the label, or raise `gap` to widen the space between the two columns. | | `the label 'L' on line 'A' -> 'B' sits on the title of group 'G'; move the label's line, or the group` | The line's label covers a group's title. | Give the line another `start` or `end` side, route it through a lane, or move the group's blocks. | | `group 'G' overlaps 'P', which is not in it; add it to the group or move it` | A group's shaded area covers a block that is not a member. | Add the block to the group's `members`, or move it out of the group's area. | | `groups 'G' and 'H' overlap` | Two groups' areas cover each other, and neither one is inside the other. | Move the blocks of one group away from the blocks of the other. | | `tile 'T' needs N px but has N px` | A tile's words do not fit its width. | Give the panel more `width`, or shorten the words. | | `resource 'T' needs N x N px but has N x N px` | A resource's icon and label do not fit the space it was given. | Give the block more width, or shorten the label. | | `'A' needs N px wide but was given N; using N` | A `width` set by hand is smaller than the words need, so the block is drawn at the width it needs. | Raise `width` to the first number, leave `width` out, or shorten the words. | | `smallest text is N px; the theme's minimum is N px` | Some text is smaller than the theme allows, 10 px by default. | Do not shrink text below the minimum. Shorten the words instead. | | `graph: the line 'A' to 'B' runs through 'P'` | In a graph section, the straight line between two nodes passes through a third node. | Move a node in `at` so the straight line between the pair is clear. | | `graph: the label 'L' touches the node 'P'` | In a graph section, a line's label touches a node. | Spread the nodes in `at`, or shorten the label. | | `graph: the labels 'L' and 'M' touch` | In a graph section, two line labels touch each other. | Spread the nodes in `at`, or shorten a label. | The fixes come from the fix table in the agent skill (`skills/open-diagram/SKILL.md`) and from the format guide. The skill's table puts the more specific messages first, so take the first row whose words the message contains. The fixes for `groups 'G' and 'H' overlap` and `graph: the labels 'L' and 'M' touch` follow from the code: a group's area is drawn around its blocks, and a graph label sits at the middle of its line. ## What about a mistake in the JSON or Mermaid text? A mistake in the text is not a layout problem: nothing is drawn. The command line prints `error:` and the message, and exits with status 2. The MCP tools fail with the same message. The message names the place, so fix that spot. ```text error: columns[0][0].tiles[0]: unknown key(s) 'colour'; allowed: icon, label, status, sub ``` Mermaid mistakes name the line, such as `line 1: expected 'flowchart LR' or 'graph TD' first, got 'hello'`. ## How do I know the diagram is finished? The check reports `0 layout problem(s)`. Then run `describe` and compare its text with the request, before you draw. Updated November 25, 2026. Web page: https://open-diagram.dev/for-agents/layout-problem-messages.html See also: - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md) - [The open-diagram format guide, as the MCP server returns it](https://open-diagram.dev/for-agents/format-guide.md) - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md) --- # open-diagram MCP tools: names, arguments and results This page is for AI agents connected to the open-diagram MCP server, and for the people who set them up. It gives the five tools, each argument with its type and default, what each tool returns, and which tool writes files. The facts come from `src/open_diagram/mcp_server.py` in version 0.6.2. ## Which tools does the server have? Five tools. Only `draw` writes files. | Tool | Arguments | Writes files | | --- | --- | --- | | `format_guide` | none | No | | `template` | `name: str = ""` | No | | `check` | `source: str`, `format: str = "auto"` | No | | `describe` | `source: str`, `format: str = "auto"` | No | | `draw` | `source: str`, `format: str = "auto"`, `name: str = "diagram"`, `picture: bool = True` | Yes: `NAME.svg` and `NAME.png` | Each tool carries hints: labels the server sends to the app about what the tool does. `format_guide`, `template`, `check` and `describe` have `readOnlyHint: true` and `openWorldHint: false`: they change nothing and reach no outside service. `draw` has `readOnlyHint: false`, `destructiveHint: false` and `openWorldHint: false`. When an app connects, the server sends it these instructions: ```text open-diagram draws architecture diagrams that check their own layout. Workflow: call format_guide once; write the diagram as JSON (or Mermaid), or start from a template (call template with no name to list them); call check and fix every problem it names until it reports 0; then call draw, look at the picture, and compare its description with what the user asked for. ``` ## What does `format_guide` return? It returns the format guide as text: a JSON example to copy, every key, Mermaid support, and how to fix each kind of layout problem. The text ends with `Icons available:` and the icon names, such as `aws/s3`. The full text is on [Format guide](https://open-diagram.dev/for-agents/format-guide.md). It takes no arguments. ```json {} ``` ## What does `template` return? With no name, it returns the list of templates. With a name, it returns that template as JSON text, to start from. - `name` (string, default `""`): the template's name. ```json {} ``` ```text Templates (call template with a name to get one as JSON): - aws_etl: Data ingestion on AWS in six numbered sections, from orchestration to dashboards - aws_architecture: An AWS account, network and subnets around an API, a function, a database and storage - azure_web_app: A web app on Azure behind Front Door, with its database and cache inside a virtual network - gcp_event_pipeline: An event pipeline on Google Cloud from Pub/Sub to a warehouse and a forecast model ``` ```json {"name": "azure_web_app"} ``` An unknown name, such as `nope`, fails with `no template named 'nope'; templates: aws_etl, aws_architecture, azure_web_app, gcp_event_pipeline`. ## What does `check` return? It returns the number of layout problems and one line for each. It builds the diagram in memory and writes no files. - `source` (string, required): the diagram as JSON or Mermaid text, up to 200,000 characters. - `format` (string, default `"auto"`): `"json"`, `"mermaid"` or `"auto"`. With `"auto"`, text that starts with `{` is read as JSON. Any other text is read as Mermaid. A JSON diagram goes in as text, with its quotes escaped: ```json {"source": "{\"title\": \"Order flow\", \"columns\": [[{\"id\": \"web\", \"title\": \"Website\", \"tiles\": [\"Checkout\"]}], [{\"id\": \"orders\", \"title\": \"Order service\", \"tiles\": [\"Orders\"]}]], \"links\": [{\"from\": \"web\", \"to\": \"orders\"}]}"} ``` ```text 0 layout problem(s) ``` A Mermaid flowchart goes in the same way: ```json {"source": "flowchart LR\n A[Web app] --> B[Search API]", "format": "mermaid"} ``` When there are problems, the last line asks for a fix: ```text 1 layout problem(s) - line 'web' -> 'ops' crosses 'orders'; route it with via_x/via_y, move a block, or pass cross_ok=True Fix every problem above and run check again. ``` ## What does `describe` return? It returns what the diagram says in plain words: the title, the key, each block with its tiles and states, the groups, and every line with its label. It takes the same `source` and `format` as `check`, and writes no files. ```json {"source": "flowchart LR\n A[Web app] -->|query| B[Search API]\n B -.-> C[Search index]"} ``` ```text Flowchart States shown: Live. Solid lines: data flows today. Dotted lines: connection to build. Blocks, left to right: - Web app - Search API - Search index Lines: - Web app -> Search API, labeled "query" - Search API -> Search index (connection to build) ``` ## What does `draw` write and return? It writes `NAME.svg` and `NAME.png` into the output folder. It returns the layout problems, the file paths, the size, the description, and the picture. - `source` (string, required) and `format` (string, default `"auto"`): as for `check`. - `name` (string, default `"diagram"`): the file name, without an extension. - `picture` (boolean, default `true`): if true and the PNG was written, the result also carries the PNG as an image. ```json {"source": "flowchart LR\n A[Web app] -->|query| B[Search API]\n B -.-> C[Search index]", "name": "search-flow"} ``` The text part of the result, with the output folder `/Users/you/Documents/open-diagram`: ```text 0 layout problem(s) Files: - /Users/you/Documents/open-diagram/search-flow.svg - /Users/you/Documents/open-diagram/search-flow.png Size: 640 x 218 px; smallest text 10.5 px What the picture says: ``` After `What the picture says:` comes the same text that `describe` returns for this source. Rules for the files: - `draw` writes the files even when the layout has problems. - A file with the same name is replaced. - In `name`, each run of characters other than A to Z, a to z, 0 to 9, `_` and `-` becomes one `-`. Dashes at the ends are removed, and the name is cut to 80 characters. `"../order flow"` becomes `order-flow`, so no file lands outside the output folder. - If the PNG cannot be made, the result says `PNG skipped:`, then the reason, then `The SVG is written.` PNG files need Chrome, Chromium or Edge. ## Where does the server write files, and where does it read icons? It writes to the folder given with `--out` when the app starts it. Without `--out`, it uses the `OPEN_DIAGRAM_OUT` environment variable. Without either, it uses an `open-diagram` folder in the folder where the app starts the server. If that folder is the top of the disk or cannot be written, it uses `open-diagram` in the home folder. ```text open-diagram mcp [--out FOLDER] [--icons FOLDER] ``` Icons come from the built-in icons and from each `--icons` folder. Without `--icons`, the server reads the `OPEN_DIAGRAM_ICONS` environment variable: folders separated by the system's path separator. It never reads an icon from a path written in the diagram text. `open-diagram-mcp` is the same command under its older name. ## What happens when the source has a mistake? The tool fails with a message that names the place of the mistake. Fix that spot and call the tool again. These messages came from the code: | Mistake | Message | | --- | --- | | Text that is not JSON | `not valid JSON: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)` | | An unknown key | `columns[0][0].tiles[1]: unknown key(s) 'colour'; allowed: icon, label, status, sub` | | No title | `diagram: missing required key 'title'` | | Text that is not a flowchart | `line 1: expected 'flowchart LR' or 'graph TD' first, got 'hello'` | | A wrong `format` | `format must be 'json', 'mermaid' or 'auto'` | | Text over the limit | `the diagram text is N characters; the limit is 200000` | Updated November 25, 2026. Web page: https://open-diagram.dev/for-agents/mcp-tools.html See also: - [The open-diagram format guide, as the MCP server returns it](https://open-diagram.dev/for-agents/format-guide.md) - [open-diagram layout problem messages and their fixes](https://open-diagram.dev/for-agents/layout-problem-messages.md) - [Set up a diagram MCP server in Cursor, Claude Desktop and Amp](https://open-diagram.dev/guides/mcp-server-in-cursor-claude-desktop-and-amp.md)