Style D2
D2 supports themes, shape properties, style blocks, classes, and sketch mode.
Start with the general presentation settings. They control the canvas background, padding, and frame for every diagram.
Source controlsโ
- Put local values in an element
styleblock. - Define reusable classes when elements use the same style.
- Use shape properties to control geometry and labels.
Renderer optionsโ
| Option | Values | Purpose |
|---|---|---|
theme | D2 theme name or number | Apply a D2 theme. |
layout | dagre or elk | Select the layout engine. |
sketch | Flag | Apply the hand-drawn style. |