.d2nested syntax — auto-translated to isogroup- YAML
shape: group— for precise placement
.d2 path first because it’s the same source you wrote
in step 02 — just one extra brace.
Wrap the API tier in a VPC
Rewriteservices.d2:
vpc { … } now sit on a translucent
labeled iso panel. Arrows from outside reference parts via
dot-notation: vpc.api, vpc.worker, vpc.db.
Nesting goes deeper
You can nest any number of levels:cluster.region_a.pod -> cluster.region_b.pod.
YAML equivalent (manual composition)
When you want control over composition that auto-layout can’t give (styled boards, stairs, hero scenes), switch to the YAML DSL. Same primitive —shape: group — but you still don’t compute
coordinates: give the group a layout and it arranges the children
and sizes its own substrate around them:
mode: row marches the children along the iso x-axis; gap is in
cells (1 cell = the canvas gridStep, default 40 world units).
Free-standing parts outside a group are positioned the same
declarative way with place::
offset: {wx, wy} coordinates still work — but treat
them as a fine-tune delta on top of place/layout, not the
primary mechanism. Every scene in
samples/topology is coordinate-free; the
langchain-app sample
shows grid containers, place chains and auto-sizing in one file.
Full grammar: reference/dsl-yaml.md.
Next step
→04-replicas-annotations.md —
auto-replicate parts and add screen-space callouts.