【问题标题】:Graphviz with HTML-like nodes, trying to control arrow shape带有类似 HTML 的节点的 Graphviz,试图控制箭头形状
【发布时间】:2020-01-17 06:12:43
【问题描述】:

我正在尝试创建 haproxy 重定向的表示,并链接到 haproxy 背后的服务。

我有以下点代码:

digraph structs {
    node [shape=plaintext]

    subgraph cluster_haproxy {
        label = "haproxy";

        haproxy [label=<
            <TABLE BORDER="3" CELLBORDER="1" CELLSPACING="50">
                <TR>
                    <TD PORT="80">80</TD>
                    <TD PORT="443">443</TD>
                </TR>
            </TABLE>
        >];
    }

    subgraph cluster_service001 {
        label = "service001";

        service001 [label=<
            <TABLE BORDER="3" CELLBORDER="1" CELLSPACING="4">
                <TR>
                    <TD PORT="123456789">123456789</TD>
                </TR>
            </TABLE>
        >];
    }

    haproxy:80:e -> haproxy:443:w;
    haproxy:443 -> service001:123456789;
}

这导致了这个图像,显示端口 80 被重定向到端口 443:

我想要实现的只是一个从 80 到 443 的直箭头,没有任何曲线。

请注意,同一行可能还有更多端口。

我尝试添加splines=line

我尝试使用基于记录的节点,给它们一个 rank=same 以使它们彼此相邻,但这给了我以下错误消息:

警告:相邻节点之间的平坦边缘,其中一个节点有记录 shape - 用类似 HTML 的标签替换记录

我尝试使用 box 形状,但是从左到右将项目按错误的顺序排列。

这里的想法用完了。非常感谢任何有关如何正确执行此类操作的建议。

【问题讨论】:

    标签: graphviz dot


    【解决方案1】:

    GraphViz 不处理节点 vell 中的内部边

    我建议你切换到 2 级集群,而不是像这里:

    digraph structs {
        node [shape=plaintext]
    
        subgraph cluster_haproxy {
            label = "haproxy";
    
            subgraph cluster_haproxy2 { 
                penwidth=3
                label=""
                node[shape=rect]
                {rank=same
                80
                443}
            }
        }
    
        subgraph cluster_service001 {
            label = "service001";
    
            subgraph cluster_service001 { 
                penwidth=3
                label=""
                123456789[shape=rect]
            }
        }
    
        80 -> 443
        443 -> 123456789
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-21
      • 1970-01-01
      • 2018-11-22
      • 1970-01-01
      • 2021-01-04
      • 1970-01-01
      相关资源
      最近更新 更多