I’ve been struggling for awhile on how to keep subgraph
within rectangle instead of “Tetris” shapes when edge
is being added and layout becomes more complex.
on Layer 2
in the codes below you’ll clearly notice “C”-shaped subgraph
.
Is it possible to fix the subgraph
’s shape ratio to rectangle as an ascii or any attribute
to handle this?
digraph G {
subgraph cluster_0 {
subgraph cluster_3 {
label="Layer 3";
"3-1" -> "3-2" -> "3-3";
}
subgraph cluster_2 {
label="Layer 2";
"2-1" -> "2-2" -> "2-3";
}
subgraph cluster_1 {
label="Layer 1";
"1-1" -> "1-2" -> "1-3";
}
}
"1-1" -> "2-1";
"1-3" -> "2-1";
"1-1" -> "2-2";
"1-2" -> "2-2";
"1-2" -> "2-3";
"1-3" -> "2-3";
"2-1" -> {"3-1" "3-2"};
"2-3" -> {"3-1" "3-3"};
}
here is an img explanation:
.