【发布时间】:2020-10-16 08:05:25
【问题描述】:
我正在尝试使用 Java (guru.nidi.graphviz.parse.Parser) 构建一个带有集群节点的 GraphViz 图形,但每次尝试构建时都会收到错误消息。
20:26:25.983 [main] INFO guru.nidi.graphviz.parse.Parser - ERROR label at 51:3 Attribute is not allowed for scope 'SUB_GRAPH'.
和
20:26:25.987 [main] INFO guru.nidi.graphviz.parse.Parser - ERROR color at 53:1 Attribute is not allowed for scope 'SUB_GRAPH'.
我的代码一开始就存在
digraph g {
graph [bgcolor=grey15, fontcolor=grey70];
node [color=grey70,style=filled, fontcolor=grey15, fontsize=18];
edge [color=grey70,fontcolor=grey70, fontsize=18fontsize=18];
然后是一些节点和边定义,例如
"lorem" [label="lorem"];
"foo bar" -> "lorem";
"ipsum" [shape=diamond];
...
最后是一些子图簇的定义:
subgraph Foos{
label="Foos";
{rank=same "lorem"; "foo bar"; }
color=blue;
}
...
集群工作(集群的节点彼此相邻。当我在子图括号之间添加边缘连接时,它们会显示子图节点。)
我将自己定位在GraphVIZ-dotguide(第23页)和these Graphviz-dot-examples(“子图(集群)”部分)。那么也许有人可以帮助我解决这个问题?
非常感谢!
【问题讨论】:
-
您是否可能遗漏了一些代码?这些错误似乎与数据格式有关,因此文件的前几行可能存在错误(如果有)。另外,它抱怨的台词是什么? (51 和 53)