d3 / d3-scale

Encodings that map abstract data to visual representation.

Home Page:https://d3js.org/d3-scale

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quantitative scales shouldn’t treat null as zero.

mbostock opened this issue · comments

const scale = d3.scaleLinear();
scale(null); // returns 0
scale(undefined); // returns undefined

The issue is that quantitative scales coerce to numbers, which is good, but +null is zero, which is bad. We should be consistent with d3-array and treat null as undefined.

Fixed in #241.