-
Notifications
You must be signed in to change notification settings - Fork 287
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.scaleQuantileP #93
Comments
mbostock
added a commit
that referenced
this issue
Dec 21, 2016
This is closely related to #62 as implemented in @393b9a5: d3.scaleSequentialQuantile computes the p-quantile prior to applying the interpolator. |
As previously commented, I think d3.scaleSequentialQuantile covers this need. If you want discrete quantiles, use d3.scaleQuantile: color = d3.scaleQuantile().domain(values).range(d3.schemeBlues[9]) If you want continuous quantiles, use d3.scaleSequentialQuantile: color = d3.scaleSequentialQuantile(d3.interpolateBlues).domain(values) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about in addition to d3.scaleQuantile, which requires you to specify a range with q elements to compute q-quantiles, you also have d3.scaleQuantileP, whose range is continuous and defaults to [0, 1], computing the p-quantile of an input value from the domain.
And then you can specify an output interpolator, say d3.interpolateViridis, so that you can map the p-quantile of the input value to a color.
Though this is somewhat tricky because it’s not clear whether d3.scaleQuantileP should function more like a d3.scaleSequential that takes a fixed output interpolator, or d3.scaleLinear where you can specify both the range and the interpolator.
The text was updated successfully, but these errors were encountered: