I am creating a DOT graph visualization from a tree data structure, but I am having difficulty setting fixed-level depths based on the data type. For example, if I had 4 nodes in the tree, and A denotes a specific data type and B is another, it would need Graph_1:
ROOT / \ A[0] B[1] / B[0]
unlike Graph_2:
ROOT / \ A[0] \ / \ B[0] B[1]
Graph_2 is what I would like to get.
Fixed levels are what I'm looking for. How can i achieve this? I can easily determine what type of data I am adding to the graph, but I am having problems with how to mark nodes to achieve this. Can this be done using subgraphs?
FYI, this is my first time playing with DOT.
python graphviz dot macos
Jagid
source share