2424C_SHADE = "#D5D8DC"
2525
2626# ── canvas ────────────────────────────────────────────────────────────────────
27- W , H = 12 , 26 # figure dimensions in data-units
27+ W , H = 12 , 30 # Increased height to 30
2828fig , ax = plt .subplots (figsize = (W * 0.72 , H * 0.72 ), dpi = 150 )
2929fig .patch .set_facecolor (BG )
3030ax .set_facecolor (BG )
@@ -66,10 +66,10 @@ def arrow_h(x0, x1, y, lw=2.0):
6666 )
6767
6868
69- TITLE_H = 0.52 # height of the coloured title strip
70- ITEM_STEP = 0.48 # vertical spacing between bullet lines
71- PAD_TOP = 0.20 # gap between title strip and first bullet
72- PAD_BOT = 0.22 # extra space below last bullet
69+ TITLE_H = 0.90 # height of the coloured title strip (increased for centered badge)
70+ ITEM_STEP = 0.52 # vertical spacing between bullet lines
71+ PAD_TOP = 0.25 # gap between title strip and first bullet
72+ PAD_BOT = 0.25 # extra space below last bullet
7373
7474
7575def node (x , y , w , color , title , items ,
@@ -92,16 +92,16 @@ def node(x, y, w, color, title, items,
9292 rbox (x , y_bot + box_h - TITLE_H , w , TITLE_H , color , ec = WHITE ,
9393 lw = 0 , r = 0.26 , zorder = 4 )
9494
95- # title text
96- ax .text (x + w / 2 , y_bot + box_h - TITLE_H / 2 ,
95+ # title text - positioned at the top of the header area
96+ ax .text (x + w / 2 , y_bot + box_h - 0.32 ,
9797 title , ha = "center" , va = "center" ,
9898 fontsize = title_fs , fontweight = "bold" , color = WHITE , zorder = 6 )
9999
100- # badge (dependency tag) inside title strip – right-aligned
100+ # badge (dependency tag) - centered horizontally and placed below title
101101 if badge :
102- bw , bh = 1.30 , 0.32
103- bx = x + w - bw - 0.12
104- by = y_bot + box_h - TITLE_H + ( TITLE_H - bh ) / 2
102+ bw , bh = 2.00 , 0.32
103+ bx = x + ( w - bw ) / 2
104+ by = y_bot + box_h - 0.75
105105 rbox (bx , by , bw , bh , WHITE , ec = color , lw = 1.0 , r = 0.12 , zorder = 7 )
106106 ax .text (bx + bw / 2 , by + bh / 2 , badge ,
107107 ha = "center" , va = "center" ,
@@ -128,13 +128,13 @@ def node(x, y, w, color, title, items,
128128 fontsize = 14 , fontweight = "bold" , color = WHITE , zorder = 5 )
129129
130130# ─────────────────────────────────────────────────────────────────────────────
131- # ① DATA INPUT
131+ # 1 DATA INPUT
132132# ─────────────────────────────────────────────────────────────────────────────
133133y_cursor = TITLE_BOX_TOP - 0.85 - 0.30 # top of next box
134134
135135y_bot1 = node (
136136 X0 , y_cursor , WW , C_INPUT ,
137- "① Data Input" ,
137+ "1 Data Input" ,
138138 [
139139 "Bruker FID directory tree · nmr_preprocessing class" ,
140140 "ng.bruker.read() → dic (acquisition params) + raw FID array" ,
@@ -146,11 +146,11 @@ def node(x, y, w, color, title, items,
146146y_cursor = y_bot1 - 0.30
147147
148148# ─────────────────────────────────────────────────────────────────────────────
149- # ② SIGNAL PREPROCESSING
149+ # 2 SIGNAL PREPROCESSING
150150# ─────────────────────────────────────────────────────────────────────────────
151151y_bot2 = node (
152152 X0 , y_cursor , WW , C_PRE ,
153- "② Signal Preprocessing" ,
153+ "2 Signal Preprocessing" ,
154154 [
155155 "Digital filter removal · ng.bruker.remove_digital_filter()" ,
156156 "Zero-filling → Fourier Transform (FFT)" ,
@@ -165,11 +165,11 @@ def node(x, y, w, color, title, items,
165165y_cursor = y_bot2 - 0.30
166166
167167# ─────────────────────────────────────────────────────────────────────────────
168- # ③ SPECTRAL NORMALISATION
168+ # 3 SPECTRAL NORMALISATION
169169# ─────────────────────────────────────────────────────────────────────────────
170170y_bot3 = node (
171171 X0 , y_cursor , WW , C_NORM ,
172- "③ Spectral Normalization" ,
172+ "3 Spectral Normalization" ,
173173 [
174174 "Probabilistic Quotient Normalization (PQN) · Normalization.pqn_normalization()" ,
175175 "Standard Normal Variate (SNV) · Normalization.snv_normalization()" ,
@@ -182,11 +182,11 @@ def node(x, y, w, color, title, items,
182182y_cursor = y_bot3 - 0.30
183183
184184# ─────────────────────────────────────────────────────────────────────────────
185- # ④ PEAK ALIGNMENT & DETECTION
185+ # 4 PEAK ALIGNMENT & DETECTION
186186# ─────────────────────────────────────────────────────────────────────────────
187187y_bot4 = node (
188188 X0 , y_cursor , WW , C_ALIGN ,
189- "④ Peak Alignment & Detection" ,
189+ "4 Peak Alignment & Detection" ,
190190 [
191191 "icoshift_align() · interval-correlation-optimized shifting (icoshift)" ,
192192 "detect_multiplets() · singlet / doublet / triplet / quartet / multiplet" ,
@@ -220,10 +220,10 @@ def node(x, y, w, color, title, items,
220220
221221y_fork_cursor = FORK_TOP - 0.28
222222
223- # ── ⑤a STOCSY ────────────────────────────────────────────────────────────────
223+ # ── 5a STOCSY ────────────────────────────────────────────────────────────────
224224y_botL1 = node (
225225 FX_L , y_fork_cursor , FW , C_STAT ,
226- "⑤0a STOCSY" ,
226+ "5a STOCSY" ,
227227 [
228228 "STOCSY() · Pearson corr. vs anchor ppm" ,
229229 "p-value threshold (default p < 0.0001)" ,
@@ -233,10 +233,10 @@ def node(x, y, w, color, title, items,
233233 title_fs = 9.5 , item_fs = 8.0 ,
234234)
235235
236- # ── ⑤b MULTIVARIATE MODELING ─────────────────────────────────────────────────
236+ # ── 5b MULTIVARIATE MODELING ─────────────────────────────────────────────────
237237y_botR1 = node (
238238 FX_R , y_fork_cursor , FW , C_STAT ,
239- "⑤0b Multivariate Modeling" ,
239+ "5b Multivariate Modeling" ,
240240 [
241241 "pca · pareto / UV / mean-center / min-max" ,
242242 "opls_da · OPLS-DA + permutation test" ,
@@ -305,11 +305,11 @@ def node(x, y, w, color, title, items,
305305 lw = 2.2 , mutation_scale = 14 ), zorder = 5 )
306306
307307# ─────────────────────────────────────────────────────────────────────────────
308- # ⑥ INTERACTIVE VISUALIZATION & OUTPUT
308+ # 6 INTERACTIVE VISUALIZATION & OUTPUT
309309# ─────────────────────────────────────────────────────────────────────────────
310310y_botViz = node (
311311 X0 , MERGE_Y - 0.25 , WW , C_VIZ ,
312- "⑥ Interactive Visualization & Output" ,
312+ "6 Interactive Visualization & Output" ,
313313 [
314314 "Plotly · scores plots / loadings / VIP / S-plot / trajectory / 3D PCA" ,
315315 "Dash apps · STOCSY_app · pickie_peak (browser-based)" ,
0 commit comments