Scatter charts
Points ringed in the card's surface, so dense clouds stay readable, on Recharts' ScatterChart. Fits carry their confidence band, the points that matter wear the same inverse pills as the rest of the charts, and one point at a time can be in focus with the readout above following it.
Install
npx shadcn@latest add @nelumbo/chartLog axes and groups
scale="log" on both axes for quantities spanning orders of magnitude. Point at a gene, click to keep it, or tab to the chart and use the arrow keys; the readout starts on the correlation. Groups are separate Scatter series with a legend that toggles them.
Scatter Chart - Log axes
mRNA and protein copies per cell for 140 genes, both on log scales. Illustrative, after the shape of genome-wide measurements in mouse fibroblasts.
Scatter Chart - Groups
Cell area against nuclear area from imaging, two cell lines (illustrative). Tap a chip to hide a line.
Fit and band
chartLinearFit does least squares with a 95% confidence band for the line; draw the band as a range Area and the fit as a Line under the points. Here three samples are read off a standard curve; pick one to see its concentration.
Scatter Chart - Fit
A Bradford assay: BSA standards in triplicate, a least-squares line with its 95% confidence band, and three lysates read off the curve (illustrative).
Volcano and bubble
The volcano colors only what passes both thresholds, red up and blue down, and names the strongest hits; the arrow keys walk the significant genes from the most significant. The bubble chart is an enrichment dot plot: ZAxis sets the dot area, and the tone of one hue carries the q-value.
Scatter Chart - Volcano
Differential expression under hypoxia (illustrative): fold change against significance. Dotted lines mark a twofold change and an adjusted p of 0.05; the strongest hits are named.
Scatter Chart - Bubble
Gene sets enriched among hypoxia-induced genes (illustrative). Dot size is the number of genes; a deeper tone is a smaller q-value.
Helpers
| Prop | Type | Default | Notes |
|---|---|---|---|
chartPoint(key, { r, fill, bubble, opacity }) | Scatter shape | A dot ringed in the surface. fill picks a color per point; bubble takes the radius from the ZAxis area | |
chartLinearFit(points) | ChartFit | slope, intercept, r2, n, predict(x), band(x) for the 95% confidence band, rows(from, to, steps) for a Line and a range Area | |
ChartPointLabel | { x, y, text, side, tone } | An inverse pill beside a point, in plot coordinates (from a Customized component's axis scales) | |
useChartFocus().preview(i) | (index | null) => void | Preview a point on hover: Scatter's onMouseEnter and onMouseLeave, since scatter hover isn't tied to the tooltip index |