GraphViz设置页面宽度

gua*_*ara 3 graphviz width output

我正在使用GraphViz来确定我的C#应用​​程序中的控件位置.

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

这是我正在使用的点文件的参数

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

但似乎对生成的纯文本文件没有影响.

我错过了设置页面宽度的东西吗?

问候

mar*_*pet 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"];
}
Run Code Online (Sandbox Code Playgroud)

如您所见,sizeresolution属性包含在输出中.

你可以改变的价值观sizeresolution,这不会改变任何东西比那些属性其他明文输出.所有节点和边的位置都对于图的边界框(bb).

但是,如果您决定输出一个png,graphviz将使用此信息根据您sizeresolution属性缩放边界框并计算最终图像大小.

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

您可以size此答案中找到有关属性和结果图像大小的更详细示例.