Skip to main content


This is where D2 really begins to shine. The language makes it very easy to declare shapes that contain other shapes, a commonly found pattern in software architecture diagrams.

containers render

Nested syntax

You can avoid repeating containers by creating nested maps.

containers render

Container labels

There are two ways to give labels to connections.

  1. Shorthand
  1. Explicit with the reserved keyword label


containers render