Quality & Process Workbench¶
LEAP's Quality & Process Workbench covers three tabs: SPC control charts, process capability, and Gage R&R. All computations run locally inside the panel (no external statistics dependency); results render through the panel's chart renderer and are fully exercisable headlessly.

Access¶
(Ctrl+Alt+Shift+C)SPC Control Chart,(Ctrl+Alt+Shift+K)Process Capability,(Ctrl+Alt+Shift+G)Gage R&R.- CLI:
leap spc ...,leap capability ...,leap gage-rr ....
SPC control charts¶
Supported chart types: xbar-r, xbar-s, i-mr, p, np, c, u.
Subgroup size is configurable (2..=25); an attribute chart variant is used
for p/np/c/u. Nelson rules 1–8 are flagged on points and summarized
in the violation list.
I-MR (individuals + moving range)¶
Xbar-R / Xbar-S¶
with \(\sigma = A_2\bar{R}/3 = A_3\bar{s}/3\). R chart: \(UCL_R = D_4\bar{R}\), \(LCL_R = D_3\bar{R}\) (where defined); S chart: \(UCL_S = B_4\bar{s}\), \(LCL_S = B_3\bar{s}\) (where defined).
Attribute charts (P / NP / C / U)¶
Nelson rules evaluated¶
Rule 1: 1 point beyond 3σ; Rule 2: 9 points same side of CL; Rule 3: 6 points steadily increasing/decreasing; Rule 4: 14 points alternating; Rule 5: 2 of 3 beyond 2σ; Rule 6: 4 of 5 beyond 1σ; Rule 7: 15 points within 1σ; Rule 8: 8 points beyond 1σ on the same side.
Process capability¶
Computed indices: \(C_p\), \(C_{pk}\), \(P_p\), \(P_{pk}\), \(C_{pm}\) and PPM.
Long-run / within-subgroup within mode uses range/stddev/moving-range
sigma estimates (CLI). The CLI additionally supports non-normal capability
models (empirical / weibull / lognormal).
Gage R&R¶
Crossed and nested ANOVA Gage R&R. Variance components are reported as Repeatability (EV) and Reproducibility (AV):
with per-component variance, pct_contribution, pct_study_var and
pct_tolerance (\(100 \cdot 6\sigma_i / \text{tolerance}\)). The crossed mode
treats parts and operators as two-way random effects; nested treats
operators as nested within parts.
Active-table integration¶
Quality accepts the active table's numeric columns via
show_with_table(ui, panel, numeric_cols) — a dropdown above the panel
selects between the Demo Preset and each active table column; loading a
column sets active_source and populates both SPC and Capability. Columns
must be non-empty and finite (non-finite or too-short columns are rejected
and the panel is left unchanged).
GUI / CLI parity¶
Open SPC with (Ctrl+Alt+Shift+C), Capability with (Ctrl+Alt+Shift+K) or
Gage R&R with (Ctrl+Alt+Shift+G). Pick a table column from the Data Source
bar; charts update live.
leap spc data.csv --mode xbar-r --column yield_pct --subgroup-size 5 --nelson --svg chart.svg
leap spc data.csv --mode p --counts defect_count --ns n --svg p_chart.svg
leap capability data.csv --column yield_pct --lsl 40 --usl 60 --target 50 --ppm
leap capability data.csv --column yield_pct --mode within --subgroup-size 5 --method range
leap capability data.csv --column yield_pct --mode non-normal --model weibull --lsl 40 --usl 60 --svg cap.svg
leap gage-rr data.csv --mode crossed --part part --operator operator --value reading --tolerance 60,40 --svg gage.svg
leap gage-rr data.csv --mode nested --part part --operator operator --value reading