【发布时间】:2021-10-29 19:51:56
【问题描述】:
问题
与这个问题(GraphViz - How to connect subgraphs?)类似,我想连接一些子图。只有这一次我需要连接嵌套的子图...... Graphviz 似乎对我的语法不满意。
来源
digraph G {
compound=true
subgraph cluster_family1 {
graph [ label="Family1"; ]
subgraph cluster_genus1 {
graph [ label="Genus1"; ]
species_1
species_2
}
subgraph cluster_genus2 {
graph [ label="Genus2"; ]
species_3
species_4
}
}
subgraph cluster_family2 {
graph [ label="Family2"; ]
subgraph cluster_genus2 {
graph [ label="Genus3"; ]
species_5
species_6
}
}
species_2 -> species_3 [ lhead=cluster_genus1 ] # TODO: Fix this line!!
}
生成的图表没有我希望的所需子图箭头。相反,我得到了错误:
dot -Tsvg source.dot -o output.svg
Warning: Two clusters named cluster_genus2 - the second will be ignored
Warning: species_2 -> species_3: head not inside head cluster cluster_genus1
【问题讨论】:
标签: syntax graphviz diagram dot