Edges
An edge line draws an arrow from one node to another:
from -> to [-> more …] [size] [line style] [color] [url] [text…]
Any line containing -> outside quotes is an edge line.
Attributes come after the last id, in the order shown, and each one is optional.
a -> b
c -> d dashed red
e -> f big bold blue /example.com Labeled, linked edge
Open in editor
Arrows
Every edge is a straight line from center to center, with an arrowhead at the target node, colored like the line.
Each end is pulled back by a fixed distance that depends on the node's shape and size, not by the exact outline.
So lines stop a little short of circles, and they reach into wide shapes such as squares when they arrive from the
side. Image nodes are the exception: their lines stop exactly at the image or its
frame. Spaces around -> are optional.
a->b
Open in editor
c circle blue circle
s square blue square
d diamond blue diamond
h big hex purple hub
c -> h
s -> h
d -> h
h -> s dashed
Open in editor
Edges create nodes
The ids on an edge line don't need to be declared first. A missing node is created with the default attributes. Style it with a node line anywhere in the source.
db square purple Database
app -> db
Open in editor
Chains
Several arrows on one line make a chain. a -> b -> c -> d is three edges: a→b, b→c and c→d. The
attributes at the end of the line apply to every edge in the chain, including its label.
a -> b -> c -> d dotted green step
Open in editor
Only the last segment can carry attributes. In earlier segments only the first word, the id, counts. Anything else is silently ignored, shown struck through below:
a big red -> b
Open in editor
To style the edges of one path differently, write them on separate lines:
a -> b solid green
b -> c dashed orange
c -> d dotted red
Open in editor
Defaults
| Attribute | Default |
|---|---|
| size | normal |
| line style | solid |
| color | gray |
| url | none |
| text | none: the edge has no label |
Line styles
solid, dashed, dotted and bold (a thicker solid line). An edge has
one style. There is no way to make a line both dashed and bold.
a1 -> b1 solid solid
a2 -> b2 dashed dashed
a3 -> b3 dotted dotted
a4 -> b4 bold bold
Open in editor
Each label above repeats the style name: the first solid is the line style, and the second, which
comes after the style slot is filled, is label text. See keywords as
text.
Edge size
An edge's size scales its label only. It doesn't change the line's thickness; use bold for
that. Edge labels are 12px at normal and scale like nodes, with a 10px minimum, so tiny
and small both give 10px labels.
a1 -> b1 small small label
a2 -> b2 normal normal label
a3 -> b3 big big label
a4 -> b4 bigger bigger
Open in editor
Edge labels
An edge label is drawn at the middle of the line, nudged a little to one side. Labels longer than 28 characters are
cut to 27 plus …. Hover over the edge to see the full text, its endpoints and its link. Clicking an edge
with a URL opens the link (see Links).
client -> server blue /developer.mozilla.org/en-US/docs/Web/HTTP GET /index.html
server -> cache dashed purple Look up the rendered page in the cache before rendering
Open in editor
Repeated, reverse and self edges
Each edge line adds new edges, even when the same pair is already connected. Edges are straight lines, so repeated edges are drawn exactly on top of each other and look like one. Their labels overlap too.
a -> b red first
a -> b blue second
Open in editor
Edges in opposite directions also overlap, which produces a line with an arrowhead at each end. This is the usual way to show a two-way connection:
client -> server teal
server -> client teal
Open in editor
An edge from a node to itself (a -> a) is accepted, but it has no length: its arrowhead and label land
on top of the node and obscure the node's own label. Use the node's text to describe a self-transition instead.
Fan-out and fan-in
A chain is a single path, so branching takes one line per branch:
hub big circle purple Hub
hub -> n
hub -> e
hub -> s
hub -> w
Open in editor
a -> sink teal
b -> sink teal
c -> sink teal
sink square teal Collected
Open in editor