cd /news/developer-tools/d2-v0-10 · home › topics › developer-tools › article
[ARTICLE · art-177401] src=d2lang.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

D2 v0.10

D2 released version 0.10.0, adding an alpha animated-transitions feature controlled by the `animate-duration` setting (default zero) and `animate-interval`, plus TALA step animations that preserve node positions and routes across steps. The release also ships a language server via `d2 lsp`, an MCP server via `d2 mcp` that lets AI clients look up D2 syntax and render PNG, SVG or text, and publishes `io.github.d2lang/d2` to the official MCP Registry after the PyPI package ships. The maintainer said performance across build size, output size and speed advanced significantly in this release and that a 1.0 release is planned soon with one-time breaking changes such as renaming `sequence_diagram` to `sequence-diagram`.

key takeaway

D2 v0.10.0 adds `d2 mcp`, an MCP server letting AI clients look up D2 syntax, check diagrams and render PNG, SVG or text, and publishes `io.github.d2lang/d2` to the official MCP Registry after the PyPI package ships.

read13 min views3 publishedNov 27, 2026

AI is ripping. Finally got around to clearing out some long-standing issues, formalize a grammar (though it's still wip), fix a bunch of corner cases, tedious issues, etc. I'm focusing on 2 things:

  1. Performance -- across size of build (mainly for client-side/JS use case), size of output, and speed. All 3 have advanced significantly in this release, somewhat near capabilities of public frontier models. We'll revisit when the Reimann Hypothesis-solving generation of models come out.
  2. Animations. I make a lot of 3b1b-type explainer videos to understand things in my day-to-day work and the quality is tempermental. There's a 3b1b library for their animations but it didn't work well for me and I've removed it from my prompts. I'm more motivated to do well here for my own use case, so I want to make animations in D2 really nice throughout the 0.10 series of releases.

I plan to cut a 1.0 soon finally. There'll be more one-time breaking changes like consolidating casing/hyphenation (e.g. sequence_diagram to sequence-diagram).

AI-generated changelog:

Features 🚀

  • Animated transitions. Setanimate-duration to animate styles, gradients, text decorations, grid edits, and sketch shading in SVG or GIF. It defaults to zero.animate-interval sets the minimum time per board.Timing ·Grid examples

  • TALA step animations. Small edits can preserve node positions and routes across steps and scenarios. Connections draw in, groups move between containers, trailing SQL rows slide in or out, and sequence messages travel to their receivers.Animated steps and source ·Go API

Animated transitions are in alpha. Send feedback or suggestions.

  • Language server. Rund2 lsp for live diagnostics, completion, and formatting in your editor. Go to definition, find references, and rename shapes across open diagrams and their imports. In VS Code, install the official extension withcode --install-extension d2lang.d2lang .VS Code guide ·Other editors
  • MCP server. Rund2 mcp to let an AI client look up D2 syntax, check diagrams, and render PNG, SVG, or text. Starting with v0.10.0, stable releases publishio.github.d2lang/d2 to the official MCP Registry after the PyPI package ships.Set up Codex or Claude Code ·Registry listing manifest
  • ELK. Setelk-algorithm in the diagram. New options control edge routing, layer placement, tree ordering, and spacing.Compare algorithms ·Layered options ·Run the radial example in the Playground
  • Configuration. Setscale andforce-appendix invars.d2-config , anddagre-nodesep anddagre-edgesep invars.d2-config.data .Export options ·Dagre spacing
  • Connections. Crossing lines now leave a transparent gap in the back line where there’s room.#3011
  • Themes. Select light and dark themes by name, for exampletheme-id: Terminal or--dark-theme dark-mauve .Themes
  • Syntax. Use unquoted labels likecost $5 and#oncall , colors like#abc , and names likeR&D . Variables can use keyword names, and nested shapes can be namedlayers ,scenarios , orsteps .Punctuation ·Hash-prefixed labels and keyword names
  • Formatter.d2 fmt README.md formats D2 fences in Markdown. Used2 fmt --check --diff README.md to show a diff in CI.Formatter options
  • Installation. Run the CLI withuvx d2lang , or install it in CI withd2lang/setup-d2@v1 . Windows x64 now has a-user.msi installer for users without administrator rights.uv and uvx ·GitHub Actions ·Windows
  • Linux packages. Install a specific GitHub release with APT on Debian or Ubuntu (amd64 ,arm64 ) or DNF on Fedora or RHEL (x86_64 ,aarch64 ). Download the matching.deb or.rpm and pass its local path to the package manager.Debian and Ubuntu ·Fedora and RHEL
  • Language reference. Explore the grammar with railroad diagrams, EBNF, and parser conformance cases. Download the docs as Markdown, by page or in one file.Grammar reference ·Conformance cases ·Page index ·Full text

Improvements 🧹

CLI export time on an Apple M4, including startup, layout, and SVG output. Timings use d70ec718.

| Workload | v0.9.0 | v0.10.0 candidate | Speedup |

|---|---|---|---|
| [3,000 rectangles in a grid](https://github.com/d2lang/d2/pull/2893) | 8.29 s | 159 ms | 52.1× | 

| Ten real-world diagrams , sum of medians | 451 ms | 307 ms | 1.47× |

Layout and rendering. Native timings compare each optimization with its preceding implementation. Engine rows total layout time across the test suite. Layout benchmarks

Workload Before After
Dagre 298 ms 22.9 ms
ELK 190 ms 28.1 ms
TALA, one seed, including routing 11.47 s 3.08 s
Choose grid row breaks , 100 cells in 10 rows 27.94 ms 11.38 µs
Compile two SQL tables with a global edge style declared first 936 µs 73 µs
| [Re-render a 1,000-message sequence after a label edit](https://github.com/d2lang/d2/pull/2995) | 24.4 ms | 16.3 ms | 
| [Write a 30-slide PowerPoint deck](https://github.com/d2lang/d2/pull/3000) | 3.3 ms | 2.1 ms | 

SVG output size. Each file uses gzip level 9. The two candidate builds produced identical SVGs for all 16 fixtures with version metadata omitted. SVG changes

Diagram v0.9.0 v0.10.0 candidate Reduction
Links example with forced appendix 274.6 KB 117.8 KB 57.1%
Five multiboard animations 37.9 KB 30.4 KB 19.6%
Ten real-world diagrams 200.8 KB 198.9 KB 1.0%

CLI and Docker sizes. The macOS candidate was built at e53d9644.

Artifact Before After Change
Docker layers , Linux x86-64, before/after deduplication 92.16 MB 54.60 MB −41%
Docker layers, Linux arm64, same change 86.55 MB 52.16 MB −40%
macOS arm64 CLI, v0.9.0 → candidate 40.04 MB 39.28 MB −1.9%
Linux x86-64 CLI, PowerPoint writer change alone 43.47 MB 40.42 MB −7%
  • TALA aligns connections across containers, centers parallel branches, packs hierarchies more tightly, and routes larger diagrams.#3034 ·#2986 ·#3025
  • Grids balance row widths withgrid-rows alone and column heights withgrid-columns alone.Grid layouts
  • Exports. Repeated renders reuse bundled font measurements and subsets. Animated SVG connections respectprefers-reduced-motion . Multiboard exports preserve user edits, roll back on failure, and give reserved or nonportable board names hashed filenames. Links between boards follow the new paths.Font caching ·#2976 ·#2900
  • File and image access. Exports validate image contents and sizes. Use--allow-private-network for trusted internal images or--allow-local-files=false to disable local reads by diagrams. Go callers must setCompileOptions.FS to enable imports. Image access is configured separately.Go import options ·Image options
  • Watch mode authenticates browser sessions through the URL printed byd2 --watch .#2910
  • Installation. Standalone installs verify SHA-256 checksums. Add--verify-provenance to verify signed builds locally. Source builds require Go 1.27.4 or newer. Go module installs report the installed D2 version in the CLI, LSP, and MCP server.Installer verification ·Build from source

Bugfixes ⛑️

Dagre. Containers keep the same dimensions across runs. Nested diagrams with connections between sibling containers can now render when Dagre previously failed during ordering or edge routing.Deterministic layouts ·Nested diagrams #

ELK. Force, stress, and Mr. Tree route labeled self-loops. These layouts and radial attach cross-container edges to the correct shape or SQL column. Loop labels clear rounded bends where space permits. Mr. Tree routes avoid crossing intervening nodes.#3016 ·#3017 ·#3018 ·#2981 #

TALA. Fixed overlapping nodes and captions, reversed dependencies, and misplaced endpoint labels. Chains ofstep shapes retain connection order and annotations. Pinned junctions stay in place. SQL edges attach to the correct row, and routes stay attached when containers move.#3032 ·#3022 ·#3028 ·#3031 ·#2889 #

Grids. Grids with onlygrid-rows orgrid-columns finish laying out even when one cell is much larger than the others. Cells keep their order through imports and variable spreads. Circles stay round, nested content fits, and routes retain SQL row targets and make room for self-loops. TALA routes around intervening cells and accepts grid containers asnear targets.Grid connections ·#3036 #

Sequence diagrams. A nested group containing only a note now renders. Notes after messages between spans on the same actor leave room for the preceding group.Sequence groups ·#3035 ·#2940 #

Native exports. SVG icons render with gradients, masks, and blur. PDF backgrounds fill the margins on pages without navigation. PNG watch previews embed local images and show placeholders for missing images.#2982 ·#2932 ·#2980 #

Labels. SQL and class members retain types that match their names. Rounded tables and classes clip their contents to the outline. Fixed LaTeX font colors, paired delimiters, andbigtimes . ASCII fixes spacing for single-column multibyte characters such as Vietnamese letters and keeps arrowheads visible under long labels.SQL tables ·UML classes ·ASCII export #

Syntax. Unquoted reserved keys ignore case. Quote"STYLE" for an object name. Labels like10${unit} interpolate correctly. Undirected edges require-- , block fences must match, and invalid groups, indices, filters, and paths report errors.d2 fmt preserves board order, import filename case, escapes, and empty maps.d2 fmt - writes already-formatted stdin to stdout.Formatter ·Syntax fixes #

Board globs. Globs apply once to each matching layer, scenario, or step, including imported boards. In ascenarios map,*.style.fill: red sets each scenario’s background. Use**.style.fill: red to fill its objects. Glob connections pair endpoints within the same board.Board glob fixes #

Compiler and API. Parsing and compilation honor cancellation, including befored2 fmt writes. A step with a map can follow one without a map. Glob connections whose shared path matches nothing now compile, and invalid connection endpoints report errors. Cyclic variables, oversized expansions, invalid board trees, and oversized grids return errors. Go callers can configure expansion budgets. Each graph passed to Dagre or ELK is limited to 1,024 objects and 1,024 edges. LaTeX labels are limited to 4 KiB and 128 nested groups.Compiler and renderer limits #

Windows and standalone installs. Nested imports resolve relative to the importing file, including on UNC shares. Git Bash can acquire the installer lock. Failed upgrades preserve the existing install.#2993 ·#3026 ·#3024 #

Formatter and Go editor.d2 fmt preserves names and labels split across lines. The Go editor distinguishes quoted shape names from properties and keeps label capitalization. #

Dotted boards and arrays. Dotted steps and scenarios inherit shapes, connections, and rules. Array spreads preserve declaration order and later entries. #

Selected imports. Imported values keep their module bindings and can use caller variables as fallbacks. Variables required only by unselected exports can be omitted. #

Filters. Edge filters use each endpoint’s effective label and shape. Class filters accept lists and variables. Nesting depth is correct for shapes namedroot . #

Animation and Markdown variables. Numeric variables with metadata interpolate across steps. Templates keep their declaration scope. Markdown substitutions preserve escaped placeholders, shortcut links, and variable names containing Markdown punctuation.#3063

Breaking Changes

  • Quote shape names that match keywords. To keep a child namedSTYLE , changeservice.STYLE: notes toservice."STYLE": notes and useapi -> service."STYLE" in connections. UnquotedLABEL now sets a label, so an existing diagram can render differently even if it still compiles.
  • Check large generated diagrams. Dagre and ELK accept up to 1,024 objects and 1,024 edges per layout graph. A flat inventory of 1,025 independent services can usegrid-columns: 32 . For connected diagrams, split the drawing intoboards .
  • Layout plugins and postprocessing. D2 no longer loads externald2plugin-* executables. Use a built-in engine. The Go packagesd2plugin andd2layouts/d2layoutfeatures were removed. Drop the plugins argument when callingd2cli.LayoutResolver ord2cli.RouterResolver . To replacePostProcess , modify the bytes returned byd2svg.Render .Layout engines ·Go example
  • Go struct changes. If you set ELK graph options directly, useEdgeEdgeSpacing (*int ) for spacing between edges on adjacent layers.EdgeNode now takes a*float64 .d2scenebuild.AssetOptions andd2themes.ThemableElement contain slice or map fields. Code that compares them with== or uses them as map keys must compare or key on the fields it needs.

D2.js 0.2.0

The @d2lang/d2 package runs in browsers and Node.js.

  • Command line. Runnpx @d2lang/d2 input.d2 output.svg to render a single file. Omit the output path to write an SVG beside the input, or pipe source to the command for SVG on stdout. Afternpm install @d2lang/d2 , npm scripts can rund2-svg input.d2 output.svg . Use the natived2 CLI for PNG, PDF or local imports.CLI usage
  • API.d2.renderSVG() renders a D2 string or a multi-file project in one call.d2.format() formats a source file. TypeScript now covers theme overrides and the Playground helpersd2.encode() andd2.decode() . Decoded source is limited to 16 MiB.JavaScript API
  • Animations and fonts. SetanimateDuration for step transitions. UseforceAppendix withanimateInterval to show each board’s links and tooltips in its frame. Custom TrueType fonts supplied asUint8Array now render correctly. Compiled diagrams retain their fonts when another diagram uses a different family or a saved diagram is rendered in a fresh worker.Animation options
  • Browser workers. Callnew D2() inside a dedicated worker, or pass{ workerURL } to load a self-hosted worker. Safari 27.2 workers start correctly. The SDK surfaces startup errors and releases the embedded worker URL after startup, including on failure.Worker options
  • Nightlies. Install the latest nightly withnpm install @d2lang/d2@nightly .

Package size. Removing the goroutine scheduler and deduplicating fonts and tables cut the WebAssembly module by 53% compared with the preceding build. It still includes all three layout engines. All 24,824 outputs matched in the 519-script comparison. Building from source requires D2’s TinyGo fork. Sizes are in decimal MB. The two npm columns use the public packages. The complete browser module was measured with brotli -q 5 -c. Build instructions · Build changes and comparison

Artifact 0.1.34 (npm) Before #3046 0.2.0 (npm) Reduction vs. 0.1.34
npm download 31.66 MB 13.65 MB 8.32 MB 73.7%
Unpacked npm package 95.88 MB 30.41 MB 15.92 MB 83.4%
WebAssembly, uncompressed 42.12 MB 22.49 MB 10.64 MB 74.7%
WebAssembly, Brotli-compressed inside browser module 8.50 MB 5.58 MB 3.59 MB 57.7%
Complete browser module, HTTP Brotli quality 5 8.52 MB 5.64 MB 3.67 MB 57.0%

Chrome performance. Median times on an Apple M4 at d70ec718, with the browser module served from localhost. WebAssembly now decompresses in the worker, freeing the main thread during startup. The first SVG uses a fresh worker. The ten-diagram run reuses one worker for all ten compiles and renders. Benchmark diagrams

Workload 0.1.34 (npm) Before #3046 0.2.0 candidate Speedup vs. 0.1.34
First two-node SVG, including module download and import 765 ms 296 ms 191 ms 4.00×
First two-node SVG, after module import 714 ms 262 ms 167 ms 4.27×
Main-thread delay during startup (zero-delay timer) 501 ms 1.9 ms 1.5 ms —
Ten real-world diagrams, warm worker 748 ms 310 ms 208 ms 3.59×
── more in #developer-tools 4 stories · sorted by recency
── more on @d2 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/d2-v0-10] indexed:0 read:13min 2026-11-27 · —