Graphviz 大小/页面大小属性似乎被忽略
如何通过 DOT 格式在 GraphViz 中设置输出图像的大小?
我正在使用 QuickGraph 和 此技术用于渲染 GraphViz。如下例所示,我尝试设置渲染的最大尺寸。我已经尝试了很多尺寸(解释为英寸或像素)和页面大小的变化,两者。没关系。唯一有影响的是分辨率。
我无法判断是否是我没有设置的某种模式(即 mode =“fixedsize”),是否是 QuickGraph 中的错误语法,或者是否是 GraphViz 中的错误。我对第二个和第三个很怀疑,但我只是把它扔在那里。
digraph G {
size="(20,20)", resolution=72, bgcolor="#C6CFD532"
0 [fontcolor="#2F4F4FFF", style=filled, label="Resource A('A')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
1 [fontcolor="#2F4F4FFF", style=filled, label="Resource B('B')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
2 [fontcolor="#2F4F4FFF", style=filled, label="Resource C('C')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
3 [fontcolor="#2F4F4FFF", style=filled, label="Resource D('D')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
4 [fontcolor="#2F4F4FFF", style=filled, label="Resource E('E')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
5 [fontcolor="#2F4F4FFF", style=filled, label="Resource F('F')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
6 [fontcolor="#FFFAF0FF", style=filled, label="Resource G('G')", color="#762226FF", fillcolor="#93473BFF"];
7 [fontcolor="#2F4F4FFF", style=filled, label="Resource H('H')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
0 -> 1 [];
0 -> 2 [];
1 -> 2 [];
1 -> 3 [];
2 -> 3 [];
2 -> 4 [];
2 -> 5 [];
2 -> 6 [];
3 -> 7 [];
3 -> 1 [];
4 -> 5 [];
4 -> 6 [];
6 -> 4 [];
}
How does one set the size of the output image in GraphViz via the DOT format?
I'm using QuickGraph and this technique to render a GraphViz. As in the example below, I'm trying to set the maximum size of the rendering. I've tried lots of variations on size (interpreted as inches or as pixels) and pagesize, both, each. Doesn't matter. The only thing that has an effect is resolution.
I can't tell if it's some mode that I don't have set (i.e. mode = "fixedsize"), if it's bad syntax coming out of QuickGraph or if it's a bug in GraphViz. I doubt the second and third heavily, but I'm just throwing it out there.
digraph G {
size="(20,20)", resolution=72, bgcolor="#C6CFD532"
0 [fontcolor="#2F4F4FFF", style=filled, label="Resource A('A')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
1 [fontcolor="#2F4F4FFF", style=filled, label="Resource B('B')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
2 [fontcolor="#2F4F4FFF", style=filled, label="Resource C('C')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
3 [fontcolor="#2F4F4FFF", style=filled, label="Resource D('D')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
4 [fontcolor="#2F4F4FFF", style=filled, label="Resource E('E')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
5 [fontcolor="#2F4F4FFF", style=filled, label="Resource F('F')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
6 [fontcolor="#FFFAF0FF", style=filled, label="Resource G('G')", color="#762226FF", fillcolor="#93473BFF"];
7 [fontcolor="#2F4F4FFF", style=filled, label="Resource H('H')", color="#9FAE8DFF", fillcolor="#C4D6B6FF"];
0 -> 1 [];
0 -> 2 [];
1 -> 2 [];
1 -> 3 [];
2 -> 3 [];
2 -> 4 [];
2 -> 5 [];
2 -> 6 [];
3 -> 7 [];
3 -> 1 [];
4 -> 5 [];
4 -> 6 [];
6 -> 4 [];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的
dot
认为size="(20,20)",
是一个语法错误,并且 DOT 规范 似乎 证明这一点。
My
dot
considerssize="(20,20)",
a syntax error preferringand the DOT specification seems to bear this out.