1

我正在尝试从 DOT 文件创建 PNG, dot -Tpng -o temp.png
但出现以下错误: Warning: node s1, port eth2 unrecognized Warning: node s2, port eth2 unrecognized Warning: node s2, port eth3 unrecognized Warning: node s3, port eth2 unrecognized Warning: node s4, port eth4 unrecognized Warning: node s3, port eth3 unrecognized

点文件 1: graph G { node [shape=record]; graph [hostidtype="hostname", version="1:0", date="04/12/2013"]; edge [dir=none, len=1, headport=center, tailport=center]; "s1":"eth2" -- "s2":"eth2"; "s2":"eth3" -- "s3":"eth2"; "s4":"eth4" -- "s3":"eth3"; }

当我尝试使用以下拓扑文件时,它可以工作。

点文件 2 graph G { node [shape=record]; graph [hostidtype="hostname", version="1:0", date="04/12/2013"]; edge [dir=none, len=1, headport=center, tailport=center]; "R1":"swp1" -- "R3":"swp3"; "R1":"swp2" -- "R4":"swp3"; }


这里有什么区别。DOT FILE 1 给出错误的原因是什么?

4

2 回答 2

1

您的示例缺少一些信息(节点的描述)。假设这些在某个地方并且刚刚从您的示例中省略,那么问题可能是 usingnode [shape=record]不适用于portHTML 属性。例如,尝试node [shape=plaintext].

于 2018-04-17T19:15:53.680 回答
0

端口位置是“罗盘点”。来自http://www.graphviz.org/doc/info/attrs.html#k:portPos的文档

如果使用罗盘点,它的格式必须为“n”、“ne”、“e”、“se”、“s”、“sw”、“w”、“nw”、“c”、“ . 这会修改边缘放置以针对端口上的相应罗盘点,或者在没有提供端口名的第二种形式中,针对节点本身。罗盘点“c”指定节点或端口的中心。罗盘点“ ”指定应使用与节点外部相邻的端口的适当一侧,如果存在的话。否则,使用中心。如果未将罗盘点与端口名一起使用,则默认值为“_”。

于 2014-11-06T13:43:47.593 回答