Giter Site home page Giter Site logo

Comments (7)

mbostock avatar mbostock commented on September 1, 2024 2

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.

from d3-scale.

mbostock avatar mbostock commented on September 1, 2024 1

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.

from d3-scale.

mbostock avatar mbostock commented on September 1, 2024 1

This is being implemented in #156.

from d3-scale.

yurivish avatar yurivish commented on September 1, 2024

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)

from d3-scale.

mbostock avatar mbostock commented on September 1, 2024

No thoughts beyond those expressed in earlier comments, sorry.

from d3-scale.

mbostock avatar mbostock commented on September 1, 2024

Related 393b9a5 which implements d3.scaleSequentialQuantile.

from d3-scale.

jonsadka avatar jonsadka commented on September 1, 2024

@mbostock Anything I can do to help on this?

from d3-scale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.