observablehq / plot

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

no ramp legend for continuous scales with a degenerate domain #2211

Closed Fil closed 1 week ago

Fil commented 1 month ago

closes #2210

I considered an alternative where we would generate a ramp “from x to x” if there is 1 element, and “from NaN to NaN” if there is none. This would show the interpolator colors (like below).

However the bug report shows that we might be in a case where we normally expect an ordinal scale, but since the empty domain makes it impossible to automatically determine if we're ordinal or linear, the ramp is just a consequence of having defaulted to linear.

Capture d’écran 2024-10-28 à 07 02 39 Capture d’écran 2024-10-28 à 07 02 26

Fil commented 1 week ago

superseded by #2212