Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphviz forcing nodes to stack vertically despite rankdir=LR

Tags:

graphviz

dot

I am new to Graphviz and trying to layout some nodes from left to right with something like the following:

digraph g {
graph [ rankdir = "LR" ]; 
node [ fontsize = "16",  fontname="Arial" ]; 
nodesep = 1.0; 
ranksep = 4.0; 

"node0" [ 
label = "<f0>OBJECT0| <f1> Id | <f2> Name" 
shape = "record"  ];

"node1" [ 
label = "<f0>OBJECT1| <f1> Id | <f2> Name"
shape = "record"  ];
"node2" [ 
label = "<f0>OBJECT2| <f1> Id | <f2> Name"
shape = "record"  ];    

"node4" [ 
label = "<f0>OBJECT3| <f1> Id | <f2> Name"
shape = "record"  ];    
** I also have some connectors in here across the nodes **
}

This works ok for very basic nodes, but if I have say 100 rows within a node (representing a database table and fields) the nodes are stacked vertically and nothing I do seems to influence the damn things to revert back to a horizontal layout.

Any suggestions on how I might force the issue would be most appreciated - this one has me completely stuck!

Cheers CH

like image 466
user1517566 Avatar asked Jan 20 '26 07:01

user1517566


1 Answers

Resolved - needed to add the line node0 -> node1 -> node2 -> node3 -> node4 [style=invis]

like image 150
user1517566 Avatar answered Jan 22 '26 19:01

user1517566



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!