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

sequentialScale with same lower and upper bound produces incorrect value #130

Closed
GrubbyHalo opened this issue Dec 5, 2017 · 1 comment
Closed

Comments

@GrubbyHalo
Copy link

GrubbyHalo commented Dec 5, 2017

If i have sequential scale with the same values for the domain and i call/apply it with the same input value as the domain values, i get an a color value that is not within the range of the color interpolater i specified.
e.g.

var ss=d3.scaleSequential(d3.interpolateBlues);
ss.domain([1000,1000]);
ss(1000); // "rgb(0, 0, 0)"

any other value produces the correct result.
Is this expected behavior ?

@mbostock
Copy link
Member

mbostock commented Dec 6, 2017

I think this should be considered a bug; the scale should probably return interpolate(0) for all inputs if the domain is collapsed. (Though if the domain contained NaN, I think interpolate(NaN) would be appropriate, which is what is happening erroneously here.)

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

2 participants