Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GraphViz set page width

I'm using GraphViz to determine the controls location in my C# application.

But i'm not being able to give the graphViz dot generator the width of the output.

This are the paremeters of the dot file that im using

Digraph x {
    autosize=false;
    size="25.7,8.3!";
    resolution=100;
    node [shape=rect];
    (edges definitions comes here)
     ...

But seems to have no effect on the generated plaintext file.

Am I missing something do set the page width?

Regards

like image 665
guanabara Avatar asked Feb 19 '13 10:02

guanabara


1 Answers

I added a -> b to your example. Here's the plaintext output I get:

digraph x {
    graph [autosize=false, size="25.7,8.3!", resolution=100];
    node [label="\N", shape=rect];
    graph [bb="0,0,54,108"];
    a [pos="27,90", width=0.75, height=0.5];
    b [pos="27,18", width=0.75, height=0.5];
    a -> b [pos="e,27,36.104 27,71.697 27,63.983 27,54.712 27,46.112"];
}

As you can see, the size and resolution attributes are included in the output.

You may change the values of size and resolution, this won't change anything else than those attributes in the plaintext output. The positions of all nodes and edges are relative to the bounding box (bb) of the graph.

However, if you decide for example to output a png, graphviz will use this information to scale the bounding box according to your size and resolution attributes and calculate the final image size.

In this example, the resulting png will be 444 by 831 pixels (8.3 inches with a resolution of 100 dpi result in 830 pixels, the pixel on top is probably due to a rounding error).

You may find more detailed examples about size attribute and the resulting image size in this answer.

like image 164
marapet Avatar answered Sep 25 '22 16:09

marapet