ScatterPlot
Two measures against each other, with optional median-split quadrants.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
Two measures against each other, with optional median-split quadrants.
Accessibility
Each chart ships an accessible fallback (a visually-hidden data table / aria-label summary) so the data is available to screen readers, not just sighted users. Colour is paired with shape/label, never used alone.
Install and import
npx shadcn@latest add @prism/scatter-plot
import { ScatterPlot } from '@/components/prism/ScatterPlot';
In a no-build prototype, read it from the bundle instead: const { ScatterPlot } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
points | ScatterPoint[] | Yes | |
xLabel | string | — | |
yLabel | string | — | |
height | number | — | |
quadrants | ScatterQuadrants | — | Quadrant names. Use NOUNS naming what falls there, never "high/high". |
xDivider | number | — | Divider positions. Default: the medians, which always split the population in half. |
yDivider | number | — | |
formatX | (value: number) => React.ReactNode | — | |
formatY | (value: number) => React.ReactNode | — | |
sizeKey | string | — | Point key whose value scales the dot AREA (a bubble chart). |
caption | string | — | |
className | string | — |