DOT mapping
How markup-dot-writer maps the Graph model to Graphviz DOT source text.
Graph structure
| Model element | Produced DOT | Notes |
|---|---|---|
|
digraph Pipeline {
|
|
graph |
rankdir=LR; |
one indented |
|
parse [shape=box]; |
` id [attrs];` — the bracket list is omitted entirely when the node has no attributes: ` parse;`. |
|
parse -> write [label=model]; |
|
closing |
} |
always the final line. |
Attribute order
Within a node’s or edge’s […] list, attributes are comma-separated and ordered:
| Element | Typed style properties (first, in this order) | Then |
|---|---|---|
|
|
|
|
|
|
ID quoting
Every identifier position — node/edge ids, the graph name, attribute names, and attribute values — is written bare when it matches the DOT ID grammar, and double-quoted otherwise:
-
Bare — matches
[A-Za-z_](alphanumeric/underscore, not starting with a digit) or a numeral (-?(\.|[0-9](\.[0-9])?)). -
Quoted — everything else is wrapped in double quotes, with backslashes escaped as
\\and double quotes as\".
| Input | Written as |
|---|---|
|
|
|
|
|
|
|
|
Flow chunking
dotFlow() emits chunks in this order (concatenation equals toDot() exactly; boundaries are an implementation detail):
-
the
graph {/digraph {header including graph attribute lines — one chunk -
one chunk per node
-
one chunk per edge
-
the closing
}— one chunk
See also
-
Writer API contract — the four output forms
-
Modules and coordinates —
markup-graphandmarkup-dot-writer