type: rankdir, default: TB
For example, if rankdir="LR", and barring cycles, an edge T -> H; will go from left to right. By default, graphs are laid out from top to bottom.
This attribute also has a side-effect in determining how record nodes are interpreted. See record shapes.
digraph {
rankdir="TB"
a -> b -> c;
}
digraph {
rankdir="BT"
a -> b -> c;
}
digraph {
rankdir="LR"
a -> b -> c;
}
digraph {
rankdir="RL"
a -> b -> c;
}
Note: dot only.
© 2025 The Graphviz Authors
Licensed under the Eclipse Public License 1.0.
https://www.graphviz.org/docs/attrs/rankdir/