-
Notifications
You must be signed in to change notification settings - Fork 187
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
d3.histogram shouldn’t coerce ordinal input to numbers. #34
Comments
Oh sorry. I got confused by the negative x0/x1 values. Was expecting a date object or a positive value. |
Ah. Well yes, the bin.x0 and bin.x1 are coerced to numbers. And so are the other parts of the histogram (the domain, the values, the thresholds). However, it occurs to me that this is overly strict, and really the histogram only requires comparable (ordinal) values and not numbers, so we could relax that and leave dates as dates. |
Observation: if var A = [1476448344837, 1476448348221, 1476448350581, 1476448352482]; var yay = d3.histogram().value(a => a)(A); // all numbers var nay = d3.histogram().value(a => new Date(a))(A); // Date objects for `nay[0].x0` and `nay[1].x1` |
Lets say you have a
let x = d3.scaleTime()
and you want to use it on an histogram
The text was updated successfully, but these errors were encountered: