【问题标题】:GraphViz set page widthGraphViz 设置页面宽度
【发布时间】:2013-02-19 10:17:46
【问题描述】:

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

但我无法为 graphViz 点生成器提供输出的宽度。

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

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

但是好像对生成的明文文件没有影响。

我是否遗漏了一些设置页面宽度的内容?

问候

【问题讨论】:

    标签: width graphviz output


    【解决方案1】:

    我在您的示例中添加了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 x 831 像素(8.3 英寸,分辨率为 100 dpi 的结果为 830 像素,顶部的像素可能是由于舍入误差)。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-15
      • 2014-08-11
      • 2014-06-16
      相关资源
      最近更新 更多