Nodes at the same rank


Good day!
Please tell me what needs to be done so that the first blocks on top are on the same level, or the “body” that is longer is on the left. Tried the “rank” attribute for the graph, but no success.
The presented result is written in python using the appropriate library.
Graph.gv (4.1 KB)
Graph.gv.dot (6.8 KB)

Add this line to the bottom of your input:

	{rank=same "start_link-13" "start_link-20" }

Giving:

                    with graph.subgraph() as s:
                        s.attr(rank="same")
                        s.node(link_id_start, label="a", shape="circle", fixedsize="true", width="0.75")
                        s.node('another_node_id', label="", shape="circle", fixedsize="true", width="0")

this solution helped me

What can you recommend so that this part is on the left?


and this part on the right…

(if you look at these parts as in a mirror)

Clumsy, but it seems to work:

	//{rank=same "start_link-13" "start_link-20" }
        {node [style=invis] dummy1 dummy2}
        {rank=same
	  edge[style=invis]
	  "start-23" -- dummy1 -- "start_link-13" -- dummy2 --  "start_link-20"
	}

Giving:

1 Like