-
Notifications
You must be signed in to change notification settings - Fork 85
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
Idiomatic way to add x-axis, y-axis and tooltips #93
Comments
Here's one implementation I've used: https://gist.github.com/samselikoff/10014195 |
Nice! This is even better than what I was looking for as it basically provides a reusable axis component. Let me go through your implementation to get a hang of how I can use it in my context. |
Sam, Thanks for posting the xaxis component example. I'm working on something I notice on Line 71 you refer to the 'duration' method. Is this something https://gist.github.com/samselikoff/10014195#file-xaxis-js-L71 Pete On 6 April 2014 20:06, Ramnath Vaidyanathan [email protected]:
|
Oops - I see now it refers to the d3 https://github.com/mbostock/d3/wiki/Transitions#duration Pete |
@samselikoff, I quickly looked at your implementation. While I have not tried to run it, it seems to make sense to treat your x-axis as a independent chart - you are indeed doing something with the data in your merge event, which is consistent with the 'layer' concept in d3.chart. However, I would like to get an opinion from the group about how to treat the axes in very simple cases. For example, once the axes are set up, we can draw them completely using a single call -
Thoughts? |
I am really enjoying converting my
d3.js
code tod3.chart
to make it reusable. I have been working on ad3.scatter
component ford3.chart
and you can see my work in progress herehttp://jsfiddle.net/ramnathv/vtC75/2/
One question I had was regarding the idiomatic way to add x-axis, y-axis and tooltips. In some ways, these can be regarded as layers. Currently, I am sticking the code that creates the x-axis and y-axis directly inside the
insert
method. However, this is not modular and I have a niggling feeling that there is a cleaner solution to this problem. Any thoughts would be appreciated.Once I clean this up, I will contribute this to
d3.chart
as a reusable chart component.The text was updated successfully, but these errors were encountered: