Comments (9)
Hey @fin absolutely, if you have a way of making d4 better which doesn't break anything in terms of backward compatibility I am all for it. My feeling is that this should probably be an accessor, there are several examples of how to do this in other features. Also you will probably want to checkout https://github.com/heavysixer/d4-www to run your changes against the examples directory. If you have both projects checked out side by side it's designed to copy over your development version of d4 into the example site so that you can ensure you are not breaking anything.
Thanks again for the interest in D4
from d4.
hey,
i have tried to build this and now i'm confused. it looks like the .domain() calls in builders/scales.js is always d3.scale.domain, not the anonymous functions d3.scale.domain is wrapped with by base.js/createAxisScaleAccessor
do you have a minute to shed some light on this?
thanks.
from d4.
Hi @fin is there a branch i can pull to see what's going on? I think i'll need to be able to reproduce the error before i can help.
from d4.
i pushed a clean commit, the diff to your master will be slightly more involved since grunt seems to re-format sourcefiles as well, but those are the only functional changes:
figured it would be enough to override the proxy's .domain function to call .nice after its values were set, but the proxy seems to not be accessed by the builders.
which means my mental model for what's going on was wrong. i'll try to look further into it, but if you have pointers i'd appreciate them!
from d4.
@fin awesome, let me pull and see if I can suss out what is going on. Thanks for taking a stab at it.
from d4.
working on this now...
from d4.
Hey @fin just to make sure I understand what you are after checkout this codepin:
http://codepen.io/heavysixer/pen/wKwBBZ
You'll see you can adjust nice
and the chart will update based on the new parameters that are being supplied. This is how d4 works currently without modifications. I am trying to understand where you are trying to use nice()
instead.
from d4.
i'm trying to move the .nice into the declaration of the chart.
in your example, the chart is coupled to the data doubly: in the declaration, and through the .datum().call() function.
what i would have wanted to achieve is to have a setting on the axis, saying "should the axis' scale be niced? (y/n/[integer value like d3.time.day])"
so that the chart can be defined independently from the data, and there's only one data ingress point: the .datum().call() pattern.
from d4.
Forgive me if I am still not understanding you, but I think we are agreed that we don't want to nice()
the entire chart. If you did could do so by pre-processing the incoming data. In my mind nicing
lives at the feature level, so that you can nice two axis elements in different ways. The way you'd do that is with the using()
pattern (like my example shows). The part I am less clear on is how this approach effects the data ingress point like you pointed out. In my mind, the way nice()
works now provides an adequate and desirable separation of concerns between features.
from d4.
Related Issues (20)
- Waterfall charts do not respect min/max of the chart domain.
- Dual-axis capability on a basic chart HOT 10
- Transitions broken on the donut chart example HOT 1
- Scales shouldn't auto-nice without an option to prevent it HOT 1
- Method to change stack order of elements HOT 7
- Better series indexing HOT 10
- Add Padding method make distinct from Margin HOT 8
- Dual-axis capability breaks when using groupedColumnSeries HOT 6
- Negative label values are not displayed properly
- Refactor as node module HOT 7
- Attempt to make the svg more responsive to resizing
- d4.js:1172 Uncaught ReferenceError: d4 is not defined HOT 3
- License Missing HOT 1
- Throws reference error when using Browserify (assuming will also throw error with other bundlers?) HOT 2
- Cannot read property 'ordinal' of undefined HOT 12
- missing [week,hour,0] data result wrong graph for punch-card example
- [enhance] add line for punch-card
- wrong order punch-card data result wrong graph for punch-card example
- Example links in documentation are broken
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 d4.