DOT Format Overview
The Graphviz DOT language describes graphs using a concise text syntax. DOT remains a de facto interchange format across graph analytics tooling, making it a natural bridge into the @deck.gl-community/graph-layers ecosystem.
Building blocks
DOT files describe:
- Graph statements –
graph(undirected) ordigraph(directed), optionally prefixed withstrictto disallow parallel edges. Graph-level attributes appear either ingraph [...]blocks or askey=value;assignments. - Nodes – Declared explicitly (
node1 [label="Label"];) or implicitly when referenced by an edge. Node attributes are key/value pairs, andnode [...]statements set defaults for subsequent nodes within the current scope. - Edges – Connect nodes using
--(undirected) or->(directed). Edge chains such asa -> b -> cexpand to multiple edges. Attribute defaults come fromedge [...]statements, while individual edges can override them. - Subgraphs –
subgraphblocks (including thecluster_*convention used by Graphviz) group nodes for styling or layout hints. Nested subgraphs form a hierarchy.
How graph-layers interprets DOT
The DOT loader shipped with graph-layers preserves the majority of authoring intent:
- Graph-level attributes populate loader metadata so applications can inspect labels, layout hints, or custom properties.
- Nodes and edges retain all declared attributes in their respective
databags, including numeric weights, labels, and styles. - Scoped
node [...]andedge [...]defaults cascade through nested subgraphs, matching Graphviz semantics. - Subgraph membership becomes an explicit
subgraphsarray on every node and edge, recording the subgraph identifier, its attributes, and the parent relationship. - Directionality derives from the edge operator and honors the
dir=noneoverride that Graphviz uses to suppress arrowheads inside directed graphs.
Additional resources
- DOT Language Reference – Official specification maintained by the Graphviz project.
- Graphviz Gallery – Examples showcasing DOT syntax for clusters, network diagrams, and more.
- Graphviz FAQ – Answers to common modeling questions and tips for working with DOT.
Understanding how DOT encodes structural and styling information helps when mapping existing Graphviz assets into GPU-driven visualizations built with graph-layers.