Graphviz 大小/页面大小属性似乎被忽略

发布于 2024-09-11 04:28:00 字数 1539 浏览 4 评论 0原文

如何通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日记撕了你也走了 2024-09-18 04:28:00

我的 dot 认为 size="(20,20)", 是一个语法错误

size="20,20"; resolution=72; bgcolor="#C6CFD532";

,并且 DOT 规范 似乎 证明这一点

My dot considers size="(20,20)", a syntax error preferring

size="20,20"; resolution=72; bgcolor="#C6CFD532";

and the DOT specification seems to bear this out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文