React Box Plot
Two tools with the same mean and very different spread look identical on a bar chart. Here they look obviously different — which is the entire reason to plot a distribution rather than its average.
Etch depth by tool
4 groups · box = Q1–Q3, whiskers = 1.5×IQR
MEDIAN
—
Q1
—
Q3
—
IQR
—
Lower whisker
—
Upper whisker
—
Hover a group for its five-number summary.
Installation
Props
| Prop | Type | Description |
|---|---|---|
| groups | BoxGroup[] | { label, values, color? } |
| unit | string | Appended to the readout |
| showPoints | boolean | Draw raw samples behind each box (default true) |
| usl lsl | number | Spec limits across all groups |
| height | number | SVG height (default 300) |
The exported computeBox(values) returns the full five-number summary plus iqr, outliers, and n, so you can reuse the statistics outside the chart.
| Returned | Meaning |
|---|---|
| q1 median q3 | Linear-interpolation percentiles |
| lowerWhisker upperWhisker | Furthest sample inside the 1.5×IQR fence |
| outliers | Samples beyond the fence |
Percentiles that match your other tools
Quartiles use linear interpolation — the "type 7" definition that NumPy and R use by default. That matters more than it sounds: there are at least nine published quartile definitions, and picking a different one gives you a box that disagrees with the analysis your process engineers ran in Python. Verified against the reference: [1..10] yields Q1 3.25, median 5.5, Q3 7.75, exactly as numpy.percentile(..., method="linear") does.
Whiskers are Tukey fences: they extend to the furthest actual sample still within 1.5×IQR of the box, not to a fixed percentile and not to the extremes. Anything beyond is drawn as a hollow outlier ring. That distinction is the point of the chart — a whisker that always reached the min and max would tell you nothing about whether a value is unusual.
Raw samples are jittered behind each box using a deterministic hash of the index, never Math.random(), so the cloud is identical between the server render and the browser.
New components every week
Get the week's new Kelvin UI components and templates in one short email. No spam, unsubscribe anytime.