-
Notifications
You must be signed in to change notification settings - Fork 286
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
Transforms on quantized or sequential scales? #62
Comments
I think it’d be pretty straightforward to have separate constructors for these:
All should be relatively easy to implement, especially if we extract a “loggish” helper (akin to “linearish”) for decorating them with the appropriate tick, tick formatting, and nicing methods. |
Mike, have you had any further thoughts on this, or is there a suggested idiomatic workaround? I just found myself in a situation where what I'd want is exactly a This works for a subset of cases: |
No thoughts beyond those expressed in earlier comments, sorry. |
Related 393b9a5 which implements d3.scaleSequentialQuantile. |
@mbostock Anything I can do to help on this? |
I just added d3.scaleDiverging, which means we might now want d3.scaleDivergingPow, d3.scaleDivergingQuantile, d3.scaleDivergingLog etc. But better would be to decouple the transforms from the interpolation method, so that we don’t need a different scale implementation for each combination. For example, ideally d3.scaleLinear, d3.scaleLog and d3.scalePow could be subsumed by a d3.scaleQuantitative (or d3.scaleContinuous?); this would default to a linear scale, and you could specify a transform (and presumably an inverse transform) to achieve the desired non-linear behavior. But along with the transform you’d also need a nicing strategy and a tick strategy that is specific to the transform… but in theory you could pick and choose which strategies you wanted, and we could leave d3.scaleLog as convenience factories for common configurations. I need to think about this some more. |
This is being implemented in #156. |
There’s no equivalent to d3.scaleLog or d3.scalePow for a quantize or sequential scale, but sometimes we might still want to apply such a transform on the data as part of the scale.
The text was updated successfully, but these errors were encountered: