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

Transforms on quantized or sequential scales? #62

Closed
4 of 7 tasks
mbostock opened this issue Jun 6, 2016 · 7 comments
Closed
4 of 7 tasks

Transforms on quantized or sequential scales? #62

mbostock opened this issue Jun 6, 2016 · 7 comments
Assignees

Comments

@mbostock
Copy link
Member

mbostock commented Jun 6, 2016

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.

  • d3.scaleSequentialSqrt
  • d3.scaleSequentialPow
  • d3.scaleSequentialLog
  • d3.scaleSequentialQuantile
  • d3.scaleQuantizeSqrt
  • d3.scaleQuantizePow
  • d3.scaleQuantizeLog
@mbostock
Copy link
Member Author

mbostock commented Jun 6, 2016

I think it’d be pretty straightforward to have separate constructors for these:

  • d3.scaleSequentialPow
  • d3.scaleSequentialLog
  • d3.scaleQuantizePow
  • d3.scaleQuantizeLog

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.

@yurivish
Copy link

yurivish commented Dec 2, 2016

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 scaleSequentialLog scale.

This works for a subset of cases: d3.scaleLog().domain(extent).interpolate(() => d3.interpolateMagma)

@mbostock
Copy link
Member Author

mbostock commented Dec 2, 2016

No thoughts beyond those expressed in earlier comments, sorry.

@Fil Fil mentioned this issue Dec 17, 2016
@mbostock mbostock self-assigned this Jan 23, 2017
@mbostock mbostock changed the title Log or pow transforms on quantized or sequential scales? ransforms on quantized or sequential scales? Jan 23, 2017
@mbostock mbostock changed the title ransforms on quantized or sequential scales? Transforms on quantized or sequential scales? Jan 23, 2017
@mbostock
Copy link
Member Author

Related 393b9a5 which implements d3.scaleSequentialQuantile.

@jonsadka
Copy link

jonsadka commented Feb 17, 2017

@mbostock Anything I can do to help on this?

@mbostock
Copy link
Member Author

mbostock commented Jun 16, 2018

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.

@mbostock mbostock mentioned this issue Jan 6, 2019
Merged
13 tasks
@mbostock
Copy link
Member Author

mbostock commented Jan 6, 2019

This is being implemented in #156.

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

3 participants