在GraphViz
的DOT
语言中,我试图表示一个依赖关系图。我需要能够在容器中拥有节点,并且能够使节点和/或容器依赖于其他节点和/或容器。
我使用subgraph
来表示我的容器。节点链接工作得很好,但我不知道如何连接子图。
根据下面的程序,我需要能够用箭头连接cluster_1
和cluster_2
,但我尝试的任何操作都会创建新节点,而不是连接集群:
digraph G {
graph [fontsize=10 fontname="Verdana"];
node [shape=record fontsize=10 fontname="Verdana"];
subgraph cluster_0 {
node [style=filled];
"Item 1" "Item 2";
label = "Container A";
color=blue;
}
subgraph cluster_1 {
node [style=filled];
"Item 3" "Item 4";
label = "Container B";
color=blue;
}
subgraph cluster_2 {
node [style=filled];
"Item 5" "Item 6";
label = "Container C";
color=blue;
}
// Renders fine
"Item 1" -> "Item 2";
"Item 2" -> "Item 3";
// Both of these create new nodes
cluster_1 -> cluster_2;
"Container A" -> "Container C";
}
https://stackoverflow.com/questions/2012036
复制相似问题