isotopo. Now we’ll render a real architecture
diagram — three layers of services with arrows between them.
Goal
A.d2 source with five nodes; one render command; an SVG you can
drop into a doc.
The DSL
Save this asservices.d2:
- Every line that has no
->declares a node.id: Label { shape: ... }is the full form;id: Labelis the most common short form. - Shapes are picked by name.
person,cylinder, etc. — the full list is inreference/dsl-d2.mdor live viaisotopo capabilities. - Arrows are
from -> to: label. Label is optional.
Render it
What just happened
iso-topology compiled your.d2 via the dagre layout engine,
translated the result into our Document model, and rendered the
top-level “scene” composite into one SVG. The output dir has:
out/topology.svg— the scene as a single SVG fileout/topology.html— the SVG side-by-side with your editable DSLout/topology.d2— a copy of your source (renamed for the re-render pipeline)out/nodes/<id>.svg,.html,.yaml— one self-contained iso sticker per element
out/nodes/db.svg — it’s the database cylinder all by
itself. Useful for sticker sheets.
Validate before render
Make a typo:"suggest": "person". Apply, re-run.
Next step
→03-grouping.md — wrap related parts in a
labeled container.