Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

equal widths for boxes in graphviz

Tags:

graphviz

dot

Is it possible to get two boxes to be as wide as the widest one.

digraph G {
        node[shape=box];
        "A long description of a node" -> "short description";
}

Will produce:

enter image description here

But I want the two boxes' size to be aligned.

like image 565
fakedrake Avatar asked Jun 04 '16 09:06

fakedrake


People also ask

How do you set the size of a Graphviz?

The size attribute lets you recommend a maximum or desired height and width for the output image in inches. I.e., the attribute size=3,5 tells Graphviz to generate a 3 by 5 inch image at most. If the image is smaller than 3 by 5 to begin with, Graphviz will leave it alone.

What is the shape of a node?

The special node shapes Msquare, Mcircle, and Mdiamond are simply an ordinary square, circle and diamond with the diagonals style set. The rounded style causes the polygonal corners to be smoothed. Note that this style also applies to record-based nodes.

How do you order nodes in Graphviz?

If ordering="out" , then the outedges of a node, that is, edges with the node as its tail node, must appear left-to-right in the same order in which they are defined in the input. If ordering="in" , then the inedges of a node must appear left-to-right in the same order in which they are defined in the input.

How do I use a dot file in Graphviz?

How do I use graphviz to convert this into an image? For windows: dl the msi and install; Find gvedit.exe in your programs list; Open . dot file in question; Click running person on toolbar; Go to graph -> settings ; change Output file type to file type of your liking and press ok..


1 Answers

You can control the (minimum) size of the box with the width and height parameters:

digraph G {
        node[shape=box, width = 2.5, height = .75 ];
        "A long description of a node" -> "short description";
}

yields

enter image description here

like image 62
vaettchen Avatar answered Jan 04 '23 01:01

vaettchen