我想生成这样的东西 - 节点的对齐是重要的,而不是边缘的角度:
+--------------+
| |
+--------------+
| |
V V
+-----+ +-----+ <--- alignment at top
| | | |
| |->| |
| | | |
+-----+ | |
| | |
V | |
+-----+ | |
| | | |
| |->| |
| | | |
+-----+ +-----+ <--- alignment at bottom
| |
V V
+--------------+
| |
+--------------+
我能想到的最好的方法是将两个左节点粘贴到一个带有白色(=> 不可见)边框的集群子图中,并将其中一个边的权重设置为 0。但它仍然不太正确:
digraph G {
// scale things down for example
size="5,5"
rankdir=TD
ranksep=1
nodesep=1
node [shape=box]
node [width=5 height=2]
top
subgraph cluster_left
{
color=white
node [width=2 height=2]
left1
left2
}
node [width=2 height=5]
right
node [width=5 height=2]
bottom
top->left1
top->right
left1->left2
left1->right
left2->right [weight=0]
left2->bottom
right->bottom
}
结果是这样的 - 对齐不佳:
关于如何得到我想要的任何想法?