Comments (4)
Thanks @tpitale for bringing this up, it was a fairly large assumption to default to 0 as the minimum for all non-ordinal scales. I'll update it to simply use the minimum shortly (with the existing option to override with domain
, if specified).
from d3.compose.
I'd be happy to submit a PR if you'd like one.
from d3.compose.
Or I could wait to try until after #43 is completed/merged.
from d3.compose.
I'm a little on the fence about the future of createScale
currently, it does too much and makes a few too many assumptions for my tastes. I have been thinking of breaking it into a few different approaches:
- Add
scaleBandSeries
that extends scaleBand in d3 v4. This covers theadjacent
,centered
, andseries
options - Add
getMinMaxDomain
andgetOrdinalDomain
that handledata
andkey
options for setting domains for linear-link and ordinal scales, respectively.
The getMinMaxDomain
should cover this case, although I just looked at it and it has the same issue: vNext:src/mixins/xy (which in some ways is more egregious here since it has min in the name). I'll update it in that PR before it gets merged (which should be today or tomorrow).
I think the new approach is much more direct (with the tradeoff being slightly more to type), although I'm open to adding createScale
back as an add-on.
// Before
var xScale = {type: 'time', data: data, key: 'date'};
var x2Scale = {type: 'ordinal', domain: ['a', 'b', 'c'], adjacent: true, series: 2};
// After
var xScale = d3.time.scale()
.domain(getMinMaxDomain(data, 'date'));
var x2Scale = scaleBandSeries()
.domain(['a', 'b', 'c']).adjacent(true).seriesCount(2);
I'm glad to hear you're using the library and would love to have your feedback!
from d3.compose.
Related Issues (8)
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.compose.