1 2 3 4 5
The default (top-to-bottom) behavior is accomplished via using “TB” instead of “LR”, or by just never specifying graph[:rankdir].
For a more in-depth example, see sample 35 from Ruby-Graphviz’s examples on GitHub.
Features undocumented by Ruby-Graphviz can occasionally be accessed. Just experiment with stuff from the Node, Edge, and Graph Attributes list on GraphViz’s site.