d3 / d3-scale

Encodings that map abstract data to visual representation.
https://d3js.org/d3-scale
ISC License
1.59k stars 286 forks source link

scale.high/low #258

Open Fil opened 2 years ago

Fil commented 2 years ago

scale.low and scale.high define what to do with values higher or lower than the bounds of the domain. If undefined, we do the usual (ie. interpolate or clamp).

demo https://observablehq.com/@d3/scale-high-low-258

visnup commented 2 years ago

Is this interpretable for a categorical scale too?

I assume it'd work for an ordinal scale, but what does "high" vs. "low" mean for a categorical one?

Fil commented 2 years ago

Good question! (for now it's only designed for continuous scales, and implemented in just one class of them).

thinking out loud:

visnup commented 2 years ago

in between 🤯 hadn't thought of that one.