graphviz - 两个子图中的相同节点
问题描述
我想在两个子图周围画一个边框,但我有一个属于两个子图的节点。
digraph {
subgraph cluster_0 {
color = red
A -> D
A -> C
C -> D
}
subgraph cluster_1 {
color = blue
B -> C
B -> E
C -> E
}
}
现在C
应该是两个集群的一部分-相反,我得到了这个:
解决方案
There s a difference between tha name / label of a node and its identification. When a node has no name / label ithe identification is taken as name / label.
Not sure if the following is what uou intended (otherwise clarify you question).
digraph {
subgraph cluster_0 {
color = red
A -> D
A -> C
C -> D
}
subgraph cluster_1 {
color = blue
node C2 [label="C"]
B -> C2
B -> E
C2 -> E
}
}
From the comment of OP (image should be in original question) looks like OP wants something more like:
digraph {
subgraph cluster_2 {
color = none;
node C
}
subgraph cluster_0 {
color = red
A -> D
A -> C
C -> D
}
subgraph cluster_1 {
color = blue
B -> C
B -> E
C -> E
}
}
this image does not provide the exact picture OP wants but I think a direction and with some ran setting together with some hidden nodes and edges it should give the right picture.
推荐阅读
- python - SQLAlchemy Core - 子查询缺少别名
- php - 当子数组可能具有唯一的密钥对时,如何从多维数组中输出 CSV?
- node.js - nodejs中的子进程fork调用多次
- swift - 从 TensorFlow 转换的 CoreML 模型无法在 Xcode 中使用
- visual-studio-code - 在 vscode 中带有参数的 RUST 货物运行任务
- knockout.js - FullCalendar v4 的淘汰赛自定义绑定,取决于下拉选择
- mysql - 如何将 SELECT CASE 与子查询一起使用
- excel - 访问表单按钮
- r - 使用每周数据查找 R 中特定点的最高相关股票
- sql - 无法使服务器上的任何数据库联机