Statements
node api "API"a box, with its text
edge a -> ba line from a to b
edge a <- bthe same line, written target first
edge a <-> barrows at both ends
point p 2 above a top-centera named spot, to place against or pass through
region r a top-left to c bottom-righta named area, from one corner to another
bundle trunk via: through r horizontala path that lines share
guide node g right of afor reference only; Guides in Settings shows it
style hot fill: reda named look, worn with style: hot
default edge line: (path: square)a look every edge wears; also node, leaf, container; the more specific wins
diagram theme: nord background: #1e2229the whole diagram's theme and colors
The picture is drawn exactly as written: nothing moves to make room, and lines go only where they are told. Check reports anything that overlaps.
Placement
node b right of abeside a, centered on it; also above, below, left of
node b above-left of adiagonally, corner to corner; also above-right, below-left, below-right
node b 3 left of a and 2 above a3 units left of a, and 2 above it
node c right of a and bagainst the box that just bounds a and b
node b even with aon a's center line
node b top even with atops in line; also bottom, left, right
node f inside box top-rightin a corner of box
node g outside box rightjust outside a side of box
node h on box bottom-leftcentered on a part of box
node i on between a and cmidway between a and c
node j below down from b and left from aat the point straight down from b and left from a
The parts of a box: text, the sides top bottom left right, and top-left top-center top-right left-center center right-center bottom-left bottom-center bottom-right. One node is unplaced; every other is placed against something. Each axis is said once.
Gaps
node b 2 right of aexactly 2 units apart
node b right of a (gap: wide)none, tight, normal or wide: 0, 2, 4 or 8 units
A box is about 4 units tall. A gap is exact.
Labels
node parserno text, so its name is its text
node parser ""deliberately blank
node a "two / lines"a space, slash and space breaks the line
Containment
node server.docker "Docker"a dotted name is a child; declare the parent first
node server layout: columnchildren top to bottom, in written order; or row
layout: column (gap: tight, widths: match, align-children: left)how the children line up
layout: decka stack of cards, the first child in front
gather-children: leftwhere the children sit in spare room
shape: noneon a container, draws no box
Without a layout, one child is unplaced and the rest are placed against it.
Sizes
width: 3030 units wide
height: menuas tall as menu
height: 0.5 menu heighthalf as tall as menu
height: a top to c bottomfrom a's top to c's bottom
min-width: 10at least 10 units wide
Appearance
style: hotwear a named style
fill: #191728a box's color
border: noneno outline
corners: sharpsquare corners; boxes are rounded unless told
line: #d2904ea line's color
overlap: allowthis one may overlap without a finding
url: "https://example.com"a link, shown on the page
description: "What it does"shown on the page; never drawn
Lines
line: (path: square, corners: rounded)everything about a line goes in line:
line: (path: curved, curve: subtle)straight (the default), square or curved
line: (path: square, turn: 1/3, step-out: tight)where a square line turns, and how far it steps out
line: (crossing: arc)where lines cross: gap, arc, square or none
line: (pattern: dashed)solid, dashed, dotted or dash-dot
line: (thickness: thick)thin, normal, thick, a multiple, or 3px
Where lines go
from: right to: leftleave and arrive at a side
to: bottom-centerarrive at a point on a side
to: left 3/4 downa fraction of the way along a side
via: c top, between a and bthe places a line passes, in order
via: through r horizontalstraight through a region
edge a -> b "calls" (at: start)where a line's text sits: start, 1/4, the middle by default
edge a -> b "calls" (above edge)text beside the line rather than on it
edge a -> b "calls" (on: longest level)text on the longest level stretch
A line runs straight between its two boxes, through anything in between, unless told otherwise.
Body
shape: documentrectangle, document, circle or none
node note "a note" right of a shape: nonejust text: an annotation
icon: databasethe node is the picture, with no box
badge: databasethe picture beside the text, in the box
layout: deck cards: "v1" "v2"a stack of cards, one per text, front first
icon logo """<svg …>…</svg>"""your own picture, used as icon: logo
Pictures: disk desktop laptop package cubes cube database.
Text
node a "Server" (size: large)small, normal or large
node a "Server" (color: theme-muted)the text's color
node a "A long label" (wrap: 24)folds at 24 characters
node a "Server" (inside top, align: left)where a container's title sits: on top, outside top, center
style dim text: (color: theme-muted)in a style, the bracket hangs off text:
node a "name / [dim]quieter[/dim]"those words in style dim's text color
node a "a \/ b"a slash that doesn't break the line; \[ for a bracket
Comments
// to the end of the lineanywhere, including after a statement
Nothing matches. Try one word, such as above, gap or color.