Comments (7)
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.
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.
This is being implemented in #156.
from d3-scale.
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.
No thoughts beyond those expressed in earlier comments, sorry.
from d3-scale.
Related 393b9a5 which implements d3.scaleSequentialQuantile.
from d3-scale.
@mbostock Anything I can do to help on this?
from d3-scale.
Related Issues (20)
- scaleDiverging for domain [1,1,0] produces wrong results HOT 1
- get HEX color HOT 1
- d3.scale.quantile() error in 7.3.0 that works in 3.5.5 HOT 1
- ScaleTime ticks reset at the beginning of the month HOT 1
- Time Scale: How could one provide a custom irregular spacing of ticks? HOT 1
- d3.scaleTime() axis ticks are not aligned with scale outputs? HOT 2
- Not too nice ticks for big domains HOT 3
- Difficult debugging on invalid scale.range arguments
- Invert function does not work correctly on scaleTime HOT 2
- d3 dependency tree depends on a security vulnerable version of d3-color HOT 2
- Security vulnerability fix for d3-color required in 2.x
- Possible Bug in log implementation HOT 1
- Microseconds are not supported? HOT 1
- Snyk checks request a fixed version of d3-color HOT 1
- Update d3-interpolate dependency to v3 HOT 5
- Numerical instability with invert HOT 1
- Feature request: exp scale
- Feature proposal: logit scale
- scaleTime() ticks issue HOT 2
- The default tickFormat with a collapsed domain lacks sufficient precision
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-scale.