Uh oh!
There was an error while loading. Please reload this page.
Implementing matching axes - #3506
Conversation
- that way, they are appends across matching axes and the category-to-position maps just works!
- defaults to `false`, when set to `true`, the generated splom axes will match
... so that it works when matching an overlaying axis
... moreovwe, boast relayout perf for non-autorange matching axis groups.
| group = traceOut._groupName = isOverlay ? traceOut.uid : ( | ||
| getAxisGroup(fullLayout, traceOut.xaxis) + | ||
| getAxisGroup(fullLayout, traceOut.yaxis) + |
There was a problem hiding this comment.
N.B. currently, both x and y need to match in order to be considered in the same auto-bin group.
etpinard
commented
Feb 1, 2019
Remaking https://plot.ly/~jackp/16209/machine-learning-classifier-comparison.embed with matching axes gives ➡️ https://codepen.io/etpinard/pen/NojNwY |
alexcjohnson
commented
Feb 2, 2019
This is awesome @etpinard, so much fun to play with!
yeah, that one has some problems... looks like after a zoom/pan it manages to satisfy all the constraints (the very shrunken subplots I think are correct), but initially or after an autorange it does not. Here's a more extreme example. Kind of a pathological case, where each subplot has x&y matching, and the x of each subplot is supposed to scale with the y of the previous... this is the case I think compounds height/width differences, so it should be expected that either the first or last subplot gets its data very compressed if you stretch it to a very non-square size. Right now it appears to apply all the Plotly.newPlot(gd,[{y:[1,2]},{y:[1,2],xaxis:'x2',yaxis:'y2'},{y:[1,2],xaxis:'x3',yaxis:'y3'},{y:[1,2],xaxis:'x4',yaxis:'y4'}],{yaxis: {matches: 'x'},xaxis2: {scaleanchor: 'y'},yaxis2: {matches: 'x2'},xaxis3: {scaleanchor: 'y2'},yaxis3: {matches: 'x3'},xaxis4: {scaleanchor: 'y3'},yaxis4: {matches: 'x4'},grid: {rows: 2,columns: 2,pattern: 'independent'},width: 500,height: 400})I haven't looked at your code in detail yet, but in order to satisfy this kind of chained constraints seems to me it may be necessary to generate |
This comment has been minimized.
This comment has been minimized.
etpinard
commented
Feb 5, 2019
@alexcjohnson here's an attempt at satisfying both In that commit, matching Now, about your Plotly.newPlot(gd,[{y:[1,2]},{y:[1,2],xaxis:'x2',yaxis:'y2'},{y:[1,2],xaxis:'x3',yaxis:'y3'},{y:[1,2],xaxis:'x4',yaxis:'y4'}],{yaxis: {matches: 'x'},xaxis2: {scaleanchor: 'y'},yaxis2: {matches: 'x2'},xaxis3: {scaleanchor: 'y2'},yaxis3: {matches: 'x3'},xaxis4: {scaleanchor: 'y3'},yaxis4: {matches: 'x4'},grid: {rows: 2,columns: 2,pattern: 'independent'},width: 500,height: 400})in 9f2fad1, we disallowed
from your #1549 (comment) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@nicolaskruchten@alexcjohnson would it a big deal if we disallowed simultaneous use of |
nicolaskruchten
commented
Feb 11, 2019
In principle that's fine... I would assume that |
alexcjohnson
commented
Feb 11, 2019
In principle you can have both, if you have |
etpinard
commented
Feb 11, 2019
Great. Thanks! Sorry for quitting on this problem, but I'll like to get going on |
... for now, until we found a way to apply domain scaleanchor constraints on matching axes (which is theoretically possible).
etpinard
commented
Feb 12, 2019
Done in 91431ec @plotly/plotly_js this PR is now ready to review 👀 As this PR touches some fairly important cartesian subplot concepts, I'll like both @antoinerg and @archmoj to review this thing. Thanks! |
nicolaskruchten
commented
Feb 12, 2019
Just to make sure I get the scaleanchor limitations... it means it’s not possible to have two plots with matched axes that are both constrained to be physically square? |
that's correct. (sorry 😢 ) |
nicolaskruchten
commented
Feb 18, 2019
I think that's totally reasonable to start with! |
etpinard
commented
Feb 18, 2019
Ping @archmoj@antoinerg can one of you please review this thing today? Thank you. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
archmoj
commented
Feb 18, 2019
@antoinerg it is a 💃 from my side, if you have no more comments? |
antoinerg
commented
Feb 18, 2019
It is also a 💃 from me! @etpinard eventually I'd be curious to know what hurdles you ran into and how long or hard it woud be to support constrained axes. Anyway, nice PR 💪 |
etpinard
commented
Feb 18, 2019
That's in -> #3539 |


resolves#1549 - with a ✨ new ✨ cartesian axis attribute
ax.matches❗Demos:
Matching
x,x2andx3axes:Matching splom axes (notice the constrained zoombox on the diagonal):
Or funkier things, like matching an overlaying axis:
Notable features:
splomdimension attribute (axis.matches) to turn on matching axes behavior for splom-generated axes c290adfMore technically, I attempted to reuse most of the
scaleanchorlogic, for better and worse as some things didn't match (pun 😏 ) too well. I also cleaned up a few things in thecartesian_interact_test.jssuite (in 13007e0, e962e96ca1de5d)I'll tag this thing as
reviewable, but I'll hunt around for edge cases again on Monday. I'll not 100% convinced thescaleanchor+matchesmock (added in 8c09944) does the right thing (update: won't be done in this PR). Moreover, I'll try to incorporate #3460 into this branch (done in:99a9edb)cc @plotly/plotly_js