Skip to content

Compared with others

Mermaid, D2 and Graphviz also turn text into diagrams. This page says where diago differs from each, and when another tool is the better choice. It was checked on 2026-10-19 against mermaid-cli 12.0.0 (Mermaid 12.2.0), D2 0.9.0 and Graphviz 16.1.0, and every claim about another tool links to that tool’s own docs or source. If one is out of date, open an issue.

  • Mermaid, when the diagram lives in a Markdown file on GitHub or GitLab: both render a Mermaid code block themselves (GitHub, GitLab), where a diago diagram is an SVG file you commit beside it. Also when you need one of Mermaid’s other diagram types, such as Gantt, state, ER or pie charts: diago draws flow, sequence and class diagrams only.
  • D2, when the picture’s look matters most: its shapes, icons, styles, layers and animated steps, and its three bundled layout engines, go well beyond diago’s fixed themes.
  • Graphviz, for very large graphs and for layouts other than layered ones (force-directed, circular, radial), with decades of tooling around the DOT format.
diago mermaid-cli D2 Graphviz
Input Typed JSON with a JSON Schema per diagram type, or a Mermaid flowchart, sequence or class file Mermaid D2 DOT
A browser to render No; PNG runs resvg on the SVG Headless Chromium through Puppeteer, for SVG, PNG and PDF (source) No, since 0.9.0 (exports) No
Same output on every machine Yes: the same SVG and text bytes, measured with embedded fonts Not by default: ids come from the date unless deterministicIds is set (config), and text is measured in the browser Not stated; text is measured with embedded fonts (README) Depends on the fonts installed (FAQ)
Text art Every diagram and every diff, in Unicode box drawing None built in .txt output, in beta (exports) ascii and vt draw the rendered image in characters, pixel by pixel (outputs)
A diff of two versions diago diff: one picture, every change marked and listed, for all three types None in Mermaid or mermaid-cli; third-party editor extensions draw one (one of them) None None; diffimg compares two raster images (diffimg)
Renders in Markdown on GitHub No: commit the SVG Yes No No

diago renders a Mermaid file as it is (diago render diagram.mmd), so for a flowchart, a sequence diagram or a class diagram the question is fair. What changes:

  • No browser. mermaid-cli launches a headless Chromium for every render. diago is one Go binary; only PNG needs a second program, resvg.
  • The same bytes every time. A checked-in SVG changes only when its diagram does, on any machine, so a pull request shows real changes and nothing else.
  • Text art. diago render -format text diagram.mmd draws the diagram for a terminal, a code block or a pull request comment.
  • Diffs. diago diff old.mmd new.mmd draws both versions as one picture: what was added, changed or removed, and a list of every change. See the diffs guide.

diago carries what its three diagram types can hold. What the importer approximates or rejects is listed in the Mermaid guide, and diago import turns a Mermaid file into a JSON spec to keep editing.

D2 is the closest tool: one Go binary, no browser since 0.9.0, text measured with embedded fonts, and a text output in beta. Where diago differs:

  • Diffs. D2 has no diff of two versions; diago diff draws one, as SVG, PNG or text art.
  • Revisions stay in place. A diff, or a render given its previous version with -previous, keeps a flow or class diagram’s unchanged boxes close to where they were, so a small edit reads as a small change.
  • Typed JSON input. Each diagram type has a JSON Schema, and a validation error names the field, such as nodes[0].shape: a spec a program or an agent writes is checked before anything is drawn. D2 is a language for people to write.
  • Mermaid files, rendered as they are.
  • Fonts. Graphviz takes text metrics from the fonts installed where it runs (FAQ), so a layout can change from one machine to the next. diago embeds its fonts.
  • Orthogonal edges with labels. In dot, orthogonal routing does not handle edge labels (splines). diago routes every edge in right-angle segments and places its label beside it.
  • Text art and diffs, as above.