欲生成的Graphviz下面的圖時:填充使用的Graphviz和NEATO
爲原因解釋here,這樣:
digraph
{
layout=dot;
rankdir="LR";
overlap = true;
node[shape=record, height="0.4", width="0.4"];
edge[dir=none];
A; B; C; D; E; F; G; H; I;
A -> B -> C;
D -> E -> F;
G -> H -> I;
edge[constraint=false];
A -> D -> G;
subgraph clusterX
{
label="Cluster 1";
A; B;
}
subgraph clusterY
{
label="Cluster 2";
E; F; H; I;
}
}
產生這樣的:
繼some careful tweaking of the order of appearance of nodes:
F; E; I; H; D; G; A; B; C;
我得到正確的結果。
雖然這個作品,我想在節點的位置更直接的控制,所以我試圖切換到NEATO,這樣我可以使用POS強制節點位置:
graph g
{
layout=neato;
node[shape=record, height="0.4", width="0.4"];
edge[dir=none];
A [pos="1,3!"];
B [pos="2,3!"];
C [pos="3,3!"];
D [pos="1,2!"];
E [pos="2,2!"];
F [pos="3,2!"];
G [pos="1,1!"];
H [pos="2,1!"];
I [pos="3,1!"];
A -- B -- C;
D -- E -- F;
G -- H -- I;
A -- D -- G;
subgraph clusterX
{
label="Cluster 1";
A;
B;
}
subgraph clusterY
{
label="Cluster 2";
E; F; H; I;
}
}
此給出以下結果:
我怎樣才能得到NEATO到集羣中添加集羣邊界和節點之間的填充(在斑點做同樣的方式)?
Thanks @marapet。看起來我不得不在這裏改變我的方法。我很欣賞你提供的信息和鏈接。我已經更新了該問題以刪除有向邊。 – 2012-03-28 17:30:28