Dither Density
When there are too many points to see one by one, each cell of the plot gets ink for how crowded it is, softened a little so a crowd reads as a shape, on a square-root scale so its thin edges still print, and never blank where there's a point at all. It develops in like a print the first time it's seen and eases to new data. Point at it for a dotted cross and how many points are near.
Needs: None. Canvas 2D.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| points | [number, number][] | required | The points, as [x, y]. Thousands are fine. |
| xLabel | string | – | What the x axis measures, with its unit. |
| yLabel | string | – | What the y axis measures, with its unit. |
| formatX | (value: number) => string | – | How an x value reads. |
| formatY | (value: number) => string | – | How a y value reads. |
| height | number | 280 | Height of the plot in px. It fills its container's width. |
| tone | string | – | The ink. The page's accent by default. |
| cell | number | 3 | Size of one dither cell in px. |
| spread | number | 2 | How far each point's ink spreads, in cells. 0 prints each point on its own. |
| label | string | "Density of points" | What the points are, for screen readers. |
| className | string | – | Class on the chart. |
| style | CSSProperties | – | Style on the chart. |