terrastruct/d2
D2 is a diagramming tool that converts text descriptions into visual diagrams, supporting multiple output formats including SVG, PNG, PDF, PPTX, and ASCII art. The system features a modular architecture with pluggable layout engines (Dagre, ELK, Grid, Sequence) and renderers, allowing for flexible diagram generation. It provides a comprehensive CLI interface, a JavaScript/WebAssembly API for browser-based usage, and a language server for IDE integration, enabling programmatic and interactive diagram creation.
54.8
Adequate · 1 August 2026
44k
lines of production code
Go
primary language
2
bus factor · 67 authors in all
2
measurements over time
How it got here
2022 · Architecture modernization and release tooling
This period focused on modernizing the D2 codebase by introducing an intermediate representation for compilation, refactoring the layout and rendering engines, and adding support for new diagram types like sequence and LaTeX. Concurrently, the project established a robust release and installation infrastructure, including automated install scripts, CI automation, and AWS-based builder management.
56 changes
2023–2025 · WebAssembly, ASCII, and CLI expansion
This period focused on expanding D2's rendering capabilities with new ASCII and PPTX export formats, while introducing a comprehensive WebAssembly API for browser-based execution. The work also included significant CLI refactoring, the addition of a language server, and the introduction of a new intermediate representation for diagram compilation.
32 changes
Survey your own repository
terrastruct/d2 was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point the surveyor at a repository you know and see whether you agree with it.
About this page
- The description of this project is derived from its own commit history, not from its README.
- The score is its highest published measurement, taken on 1 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 2446e247b6 — the exact code this score is about.
- Scored under rubric rubric-2026.08.18. Score the same commit under that rubric and you get the same number.