observablehq / plot

A concise API for exploratory data visualization implementing a layered grammar of graphics
https://observablehq.com/plot/
ISC License
4.47k stars 182 forks source link

waffle unit: auto #2214

Open Fil opened 1 month ago

Fil commented 1 month ago

When a waffle mark depicts large values, it might become invisible because the area for each "dot" becomes infinitesimal. This suggests that the default unit should be "auto" instead of 1, and adapt to the available area.

To avoid unwanted surprises, this should not be too progressive (we don't want this to kick in for values such as 0.001 or 1000), but only happen only if the base dot is infinitesimal or super-extra-huge. It should also only work with powers of 10 (or maybe powers of 1000).

It should also be shared between all waffle marks (but that should be OK given that it will be based on the available area = bandwidth × bar length). We might want a way to surface it to the user (something like an internal scale, maybe?).

Image