2014-11-06 138 views
0

我試圖創建DOT文件 dot -Tpng -o temp.png
一個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 端口在DOT文件中無法識別?

DOT文件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"; }

當我嘗試用下面的拓撲文件,它作品。

DOT FILE 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給出錯誤的原因是什麼?

回答

0

端口位置是「指南針點」。從http://www.graphviz.org/doc/info/attrs.html#k:portPos

如果使用指南針點的文檔,它必須有形式 「N」, 「東北」, 「E」, 「SE」, 「S」, 「SW」,「W 「,」nw「,」c「,」「。這會修改邊緣 的放置位置,以針對端口上的相應指南針點或 (其中沒有提供端口名稱)在節點本身上。 指南針點「c」指定節點或端口的中心。 指南針點「」指定應使用與節點外部相鄰的端口 的適當邊(如果存在)。 否則,使用該中心。如果沒有指南針點與 端口名一起使用,則默認值爲「_」。