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

Treat null as undefined. #241

Closed mbostock closed 3 years ago

mbostock commented 3 years ago

I’m surprised we didn’t find this sooner, but I think it’s appropriate for quantitative scales to treat null as undefined, rather than implicitly coercing null to zero. This makes d3-scale more consistent with d3-array.

Fil commented 3 years ago

No problem in principle, but I believe this might break a lot of applications that rely (knowingly or not) on null being treated as 0. And I don't see a way to evaluate the risk (eg by searching for examples in blocks or observable).

mbostock commented 3 years ago

I am confident we can proceed with this as a patch release. I think it is more likely that null data is inaccurately being misrepresented as zero than people are relying on null implicitly representing zero.