Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantitative scales shouldn’t treat null as zero. #229

Closed
mbostock opened this issue Nov 25, 2020 · 1 comment
Closed

Quantitative scales shouldn’t treat null as zero. #229

mbostock opened this issue Nov 25, 2020 · 1 comment

Comments

@mbostock
Copy link
Member

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.

@mbostock
Copy link
Member Author

Fixed in #241.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant