Closed cpopescu closed 2 years ago
Does https://graphviz.readthedocs.io/en/stable/examples.html#rank-same-py help (mentioned in attributes docs)?
import graphviz
dot = graphviz.Digraph()
with dot.subgraph() as s:
s.attr(rank='same')
s.node('a')
s.node('b')
dot.node('c')
dot.node('d')
dot.edges(['ab', 'bc', 'ad'])
dot
Sometimes is useful to enforce the same rank on a group of nodes (or subgraphs) using something like the structure described in the subject. E.g. compare
with
I couldn't find how to do it with current API - Is it possible to add support for that? (e.g.
dot.rank('same', ['a', 'b'])
or similar)Thanks a lot !
cp