Skip to content

Packed Multiline Serpentine Grid

A packed multi-row grid where section G shares a grid cell with its upstream producer section E and is also fed from the section above it. Its `entry: top` and `entry: left` hints name conflicting sides; the first-declared side wins and the section enters cleanly from the top rather than resolving to a flow-opposing right entry that folds a line back over its own track.

Mermaid source
examples/topologies/packed_multiline_serpentine_grid.mmd
%%metro title: Packed multi-row grid
%%metro style: dark
%%metro legend: tr
%%metro file: file1 | DATA
%%metro file: file2 | DATA
%%metro file: file3 | DATA
%%metro file: file4 | DATA
%%metro file: file5 | DATA
%%metro file: file6 | DATA
%%metro file: file7 | DATA
%%metro line: l1 | Line 1 | #e6007e
%%metro line: l2 | Line 2 | #2db572
%%metro line: l3 | Line 3 | #2b6cb0
%%metro grid: sec_a | 0,0
%%metro grid: sec_b | 1,0
%%metro grid: sec_f, sec_h | 2,0
%%metro grid: sec_c,sec_d | 0,1
%%metro grid: sec_e,sec_g | 2,1
graph LR
subgraph sec_a [Section A]
%%metro exit: right | l1, l2, l3
file1[]
a1[A1]
a2[A2]
a3[A3]
a4[A4]
a5[A5]
a6[A6]
a7[A7]
a8[A8]
a9[A9]
a10[A10]
a11[A11]
a12[A12]
file1 -->|l1,l2,l3| a1
a1 -->|l1,l2,l3| a2
a2 -->|l1,l2,l3| a3
a3 -->|l1,l2,l3| a4
a3 -->|l1,l2,l3| a5
a4 -->|l1,l2,l3| a6
a5 -->|l1,l2,l3| a6
a6 -->|l1,l2,l3| a7
a7 -->|l1,l2,l3| a8
a7 -->|l1,l2,l3| a9
a7 -->|l1,l2,l3| a10
a8 -->|l1,l2,l3| a11
a9 -->|l1,l2,l3| a11
a10 -->|l1,l2,l3| a11
a11 -->|l1,l2,l3| a12
end
subgraph sec_b [Section B]
%%metro entry: left | l1, l2, l3
%%metro exit: right | l1, l2, l3
b1[B1]
b2[B2]
b1 -->|l1,l2,l3| b2
end
subgraph sec_c [Section C]
%%metro entry: top | l2
%%metro exit: right | l1
c1[C1]
c2[C2]
c3[C3]
c1 -->|l2| c2
c2 -->|l2| c3
c3 -->|l2| file2
end
subgraph sec_d [Section D]
%%metro entry: top | l1
%%metro entry: left | l1
%%metro exit: right | l1
d1[D1]
d2[D2]
d3[D3]
d4[D4]
d5[D5]
d6[D6]
d7[D7]
d8[D8]
d1 -->|l1| d2
d2 -->|l1| d4
d3 -->|l1| d8
d4 -->|l1| d8
d5 -->|l1| d8
d6 -->|l1| d8
d7 -->|l1| d8
d8 -->|l1| file3
end
subgraph sec_e [Section E]
%%metro entry: top | l1
%%metro entry: left | l1
%%metro exit: right | l1
e1[E1]
e2[E2]
e3[E3]
e4[E4]
e5[E5]
e1 -->|l1| file5
e2 -->|l1| e3
e3 -->|l1| e4
file3 -->|l1| e5
e3 -->|l1| e5
end
subgraph sec_f [Section F]
%%metro entry: left | l1, l2, l3
%%metro exit: right | l1, l2, l3
f1[F1]
f2[F2]
f3[F3]
f1 -->|l1,l2,l3| f2
f2 -->|l1,l2,l3| file4
end
subgraph sec_g [Section G]
%%metro entry: top | l2
%%metro entry: left | l1
g1[G1]
g2[G2]
g3[G3]
g4[G4]
g5[G5]
g6[G6]
g7[G7]
g8[G8]
g9[G9]
g1 -->|l1,l2| g3
g1 -->|l1,l2| g4
g3 -->|l1,l2| g8
g4 -->|l1,l2| g8
g2 -->|l1,l2| g5
g2 -->|l1,l2| g6
g2 -->|l1,l2| g7
g5 -->|l1,l2| g9
g6 -->|l1,l2| g9
g7 -->|l1,l2| g9
g8 -->|l1,l2| file6
g9 -->|l1,l2| file6
end
subgraph sec_h [Section H]
%%metro entry: left | l1, l2, l3
h1[H1]
h1 -->|l1,l2,l3| file7
end
%% Inter-section edges
a12 -->|l1,l2,l3| b1
b2 -->|l2| c1
b2 -->|l1| d1
b2 -->|l1| d3
b2 -->|l1| d5
b2 -->|l1| d6
b2 -->|l1| d7
file2 -->|l1| d3
file2 -->|l1| d5
file2 -->|l1| d6
file2 -->|l1| d1
b2 -->|l1| e1
b2 -->|l1| e2
b2 -->|l1,l2,l3| f1
b2 -->|l1,l2,l3| f3
e4 -->|l1| g1
f3 -->|l2| g1
e5 -->|l1| g2
f3 -->|l2| g2
f3 -->|l1,l2,l3| h1
CLI command
Terminal window
nf-metro render examples/topologies/packed_multiline_serpentine_grid.mmd -o packed_multiline_serpentine_grid.svg
Rendered map
Packed multi-row grid 1 2 5 6 7 3 8 4 DATA DATA DATA DATA DATA DATA DATA D1 D3 G1 B1 D5 E2 F3 H1 G2 C1 D6 E1 F1 D7 D2 G3 G4 A1 B2 E3 G5 C2 G6 F2 G7 D4 E4 G8 A2 E5 G9 C3 A3 D8 A4 A5 A6 A7 A8 A9 A10 A11 A12 Line 1 Line 2 Line 3 created with nf-metro v2.0.0+dev