Yitzhak Melamed
Yitzhak Melamed

Reputation: 15

Graphviz: Force / leapfrog "column" for box

I would like to recreate the petroleum product tree with graphviz.

prototype

For this I'm glad with graphviz possibility to create a graph structured in columns.

My graph

But how can I force a box to be rendered in the 3rd instead of the 2nd column without using an empty box as bypass?

Upvotes: 0

Views: 44

Answers (1)

albert
albert

Reputation: 9057

I did a small experiment, important part is rank=same:

digraph g {

rankdir=LR

node [shape=box ]
Petroleum
{rank=same Benzene;Xylene;Butanes}
{rank=same Ethylbenzene;Cyclobenzene;Cumene;"p-Xylene";Toluene}

Petroleum -> Benzene
Petroleum -> Xylene
Petroleum -> Butanes
Petroleum -> Toluene
Benzene -> Ethylbenzene
Benzene -> Cyclobenzene
Benzene -> Cumene
Xylene -> "p-Xylene"

}

Upvotes: 1

Related Questions