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

numberDisplay always starts from zero #1186

Open
gordonwoodhull opened this issue Jul 27, 2016 · 1 comment
Open

numberDisplay always starts from zero #1186

gordonwoodhull opened this issue Jul 27, 2016 · 1 comment
Labels
Milestone

Comments

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Jul 27, 2016

when it starts, it cycles from 0 to the current value. which, I guess, is exciting, but doesn't make a whole lot of sense. seems like it should just start at the current value.

it also starts from 0 if it encounters Infinity, NaN. while testing #1176 / #1177, i tried having it start from a very large number instead of Infinity, but this is tricky, because it shouldn't be so large that it displays exponents.

there is no way to transition to or from NaN so I think it should just flip from NaN.

currently it does flip to NaN and Infinity but I think it could spin to a very large number in the latter case.

it's a breaking change, since people might like to see it spinning up, but i think i'd like it to do correct/sensible things in the future.

@gordonwoodhull gordonwoodhull added this to the v2.1 milestone Jul 27, 2016
@XaserAcheron
Copy link
Contributor

Making the flipping explicit is probably a good thing to do. It more or less does that only because that's what d3.interpolateNumber decides to do in that case -- given its inability to flip away from said state, I suspect it's undefined behavior.

Spinning to a large number for Infinity probably isn't safe, though. There's probably plenty of folk (including myself) who are using d3.format functions that will happily (try to) display large numbers. It'd probably make my page all funky during transitions due to text wrapping.

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

No branches or pull requests

2 participants