2013-02-19 176 views
3

我正在使用GraphViz来确定我的C#应用​​程序中的控件位置。GraphViz设置页面宽度

但我无法给graphViz点生成器输出的宽度。

这是即时通讯使用

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

但似乎对生成的明文文件没有影响的点文件的paremeters。

我是否缺少一些设置页面宽度?

问候

回答

6

我添加a -> b到你的榜样。这里是明文输出我得到:

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"]; 
} 

正如你所看到的,sizeresolution属性包含在输出中。

你可以改变的sizeresolution值,这不会改变任何事情比明文输出的属性别的。所有节点和边缘的位置是相对于到图的边界框(bb)。

但是,如果你决定,例如输出PNG,graphviz的将使用这些信息根据您sizeresolution属性缩放边框,并计算出最终的图像大小。

在此示例中,生成的png将为444乘831像素(8.3英寸,分辨率为100 dpi,结果为830像素,顶部像素可能是由于舍入误差)。

您可以在this answer中找到有关size属性和最终图像大小的更多详细示例。