Skip to main content
Two primitives left to introduce:
  • stack — auto-replicate a part N times vertically. Models HA pods, server racks, sharded databases.
  • annotation — screen-space text box pinned to a part via a thin leader line. For latency callouts, ownership notes, etc.
Both are YAML-only (the .d2 path doesn’t have an equivalent yet).

Three replicas of one pod

Take a single pod and stamp it N times:
Render:
You’ll see three pods stacked vertically with a 10-unit gap. The bottom one keeps the declared id pod; the upper two get suffixed ids pod~1 and pod~2. Connectors and annotations can target a specific layer:

A callout pinned to the top pod

Add a document-level annotations: block:
The renderer draws a rounded white box above the top pod with a dashed leader line pointing at its silhouette. Multi-line text via \n. Sides: top | right | bottom | left. Default distance is 60 world units; set distance: 80 for more breathing room.

Iso ground grid (already shown in step 03 indirectly)

For the floor plan look, add a canvas: block:
grid: iso paints a dashed diamond rhombus pattern that aligns with the iso projection — the scene now floats on a ground plane. Other options: dots, hatch, solid, none.

Putting it all together

That’s all four DSL primitives at once: canvas grid, theme, stack, annotation. Render it.

Next step

→ 05-publishing.md — drop the SVG into docs, slides, or LLM context.