Expand description
Violin plot — a mirrored kernel-density silhouette per group. The KDE
(kde) is a pure function (Gaussian kernel, Silverman bandwidth) sampled
on an evenly-spaced grid; ViolinView paints the mirrored density as a
filled polygon and overlays the median line.
Structs§
- Density
- One density curve:
grid[i](the value axis) carries densitydens[i]. - Violin
State - Persistent, observable interaction state (FC-3). The violin’s hover readout
tracks the cursor’s exact position, so the stored hover carries both the
group index (into
densities()) and the value the cursor maps to. - Violin
View - A violin plot: named groups of raw samples.
Enums§
- Violin
Effect - FC-8: the violin plot does no I/O.
- Violin
Msg - FC-2 input surface. One input: the hovered silhouette / cursor value changing
(hit-tested purely in
ViolinView::render, applied inViolinView::update).
Functions§
- kde
- Gaussian-kernel density estimate of
values, evaluated onbinsevenly spaced points spanning[min, max]padded by one bandwidth.Nonefor an empty sample. - silverman_
bandwidth - Silverman’s rule-of-thumb bandwidth:
1.06 · σ · n^(−1/5). Falls back to a small positive width on a degenerate (zero-variance) sample so the kernel stays well-defined.