【问题标题】:Port unrecognized in DOT file?DOT 文件中无法识别端口?
【发布时间】:2015-01-02 17:29:14
【问题描述】:

我正在尝试从 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 报错的原因是什么?

【问题讨论】:

    标签: python dot pygraphviz


    【解决方案1】:

    您的示例缺少一些信息(节点的描述)。假设这些在某处并且刚刚从您的示例中省略, 也许问题是使用node [shape=record] 不适用于port HTML 属性。例如,试试node [shape=plaintext]

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-11-08
        • 1970-01-01
        • 2021-02-28
        • 2018-02-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多