-
Notifications
You must be signed in to change notification settings - Fork 21
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
Multi scale axis (-- extends right-y-axis) #209
Conversation
…name, array of series objects) Fixed bugs with axes recognizing which yAxis they are
this.options needs to be passed in because the sizing info most probably have changed since the axis was created
Give me some time to review all the changes and then maybe we can walk through all of it. I'm a bit concerned that now all visualizations need to be aware of the left/right axis difference and the amount of code that is now dependent on knowing the difference between left/right axes. I always thought we could do it by configuring a new axis and abstracting how/what the visualizations use, so
but maybe this is not possible with the current structure. |
Definitely review, take your time -- there are many changes. To clarify -- what the visualizations really need to know is what is the Your code proposal could potentially work for the distinction between y On Thu, Mar 12, 2015 at 12:53 PM, Jaime del Palacio <
|
Hey -- just checking in -- noticed you committed a bunch of changes to contour/master and now this doesn't cleanly merge. If I were to make this branch cleanly merge again would you accept it? If not is it the feature you don't want (right y axis, and multi-scale y axis)? Or the implementation? If it is the feature unfortunately I require both and can't see how I could do it without modifying contour, but if its the implementation I am glad to hear how you would like to see it structured. I would like to get this merged upstream sooner rather then later. Since it is such a wide change the older it gets the harder it gets to merge. |
Hey, so far my thinking is that the multiple axes is not something I specially want to support (bad practice and all that :), but I want to make it easy for you to have a specific extension that allows for that. My concern with the current implementation is that the concept of the multiple axes get's leaked into every part of cartesian() and the visualizations. So give me a few days to come up with a solution that does not involve so much dependencies in the axes and I'll let you know. How does that sounds? OTHO, I made a few changes to master that relate to jshint and code standards, and also fixed some tests that were broken. |
Honestly I am a bit dubious about how we could achieve your desire to With that said I understand not wanting to support multiple axes/scales Starting with your pseudo code which you attached above. It could The fundamental issue is that I need the ability to apply a different scale Now with all that negative stuff out of the way I am very interested to Another bit of "good" news in all of this is that line, scatter, column, Now as a starting point I could imagine making a subclass of cartesian I am still drawing a blank though about how to get around the conundrum of complexCartesian.supportsMultipleScales = function() { return true; } complexCartesian.y = function(d, modDfn) { line.y = _.bind(function(d) { line.render = function() { Therefore I guess if you are willing to bear with the changes to That is the best that I can think of at the moment. On Mon, Mar 16, 2015 at 6:16 PM, Jaime del Palacio <notifications@github.com
|
Hi Billy, After some refactor of cartesian(), I think I found a way of creating a multiAxes component that would work for multiple axes on the left or right sides, without leaking into cartesian or the visualizations. Take a look at branch 'axes' (https://github.com/forio/contour/tree/axes). I added the code for the multiAxes component in the file examples/multi-axes.html I'm sure there's still things to work out to make it resize and re-render correctly. Let me know what you think. |
This structure does show promise and definitely solves my right axis I think this solution could also be used as a basis to solve my multiple I have included an image of what I mean when I say multiple scales on a [image: Inline image 1] On Wed, Mar 18, 2015 at 1:52 AM, Jaime del Palacio <notifications@github.com
|
Take a look at my latests commits in the axes branch, I think that change would allow you add any axis constructor to the _.nw.axes namespace and then use it as a type for the axisFactory, that way you can specify it in the type for the multi axis component... |
Yes -- that works. Do you want me to make this all work with resizing, and setting new data or On Wed, Mar 18, 2015 at 4:28 PM, Jaime del Palacio <notifications@github.com
|
Ok, let me merge that branch into master and then you can take it from the to do the work on the 'multiAxies' component. How's that? |
Yes -- that works for me. I assume from the way you are talking that you On Wed, Mar 18, 2015 at 5:24 PM, Jaime del Palacio <notifications@github.com
|
Yes, that's exactly the idea. the multi-axes would be an external component that you can keep separate from the core contour repo, the idea is at some point to have a repository for people to contribute those external components if they like. |
This fork is a branch which is on top of the right-y-axis branch. This means it adds everything that the right-y-axis branch does PLUS a new axis type (multiscaling linear y axis).
This new axis is used to represent multiple scales on the same axis. Both this and the right-y-axis feature are coded in such a way as to not affect any existing deployments unless they choose to use the new features.
Jaime -- if you would like I would be happy to walk you through these changes, how to configure the new chart types, and what the new chart types look like (and do)