Containers and icons (D2)
Beyond nesting, D2 has a small styling vocabulary that is enough to make a diagram look deliberate without a stylesheet.
#What this example shows
Named containers with display labels.
Shape keywords, which change how a node is drawn.
Per-node style blocks for fill and stroke.
#A worked example
Open it, edit it, or copy the source below.
The source, which you can paste into a new diagram and edit:
#Making it your own
Shapes worth knowing: cylinder, hexagon, package, queue, document, person.
Style blocks nest, so a container style applies as a background to its children.
stroke-dash on a connection is the tidy way to mark something conditional.
#Related
Nesting is the whole idea.
