-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Rangeslider allow zoom on oppaxis #2364
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
Changes from 5 commits
519e1a7
044e633
f335258
707f432
6a7f652
fc4f082
92c6550
b30167c
91caff1
3dd91b5
00fd1d7
5e0486a
32488f1
bc2a40a
d3b6071
b496641
149ef70
54d8b58
dd48914
a8a3ee5
0ae2831
8764e4d
a17d3a8
e85e3d0
0dd8562
3929be6
e2ad33d
df85f35
fe83e07
3b6b81a
9de4e3e
f2819c8
df96a13
9c66f81
f092c44
041ce3d
23c8401
73560f6
c556f8c
43f15a7
ccb6091
6a88b24
95b8c10
4f54f62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -389,6 +389,10 @@ axes.saveRangeInitial = function(gd, overwrite) { | |
ax._rangeInitial = ax.range.slice(); | ||
hasOneAxisChanged = true; | ||
} | ||
// store the initial range for the rangeslider if we zoom on oppaxis | ||
if((isNew && ax.fixedrange === false) || (overwrite && hasChanged)) { | ||
ax._rangesliderInitialRange = ax.range.slice(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, one issue with this: That seems to me to mean that we need a real attribute for the range of each y axis on the rangeslider, and perhaps even an attribute for whether to autorange that y axis on the range slider - it would be cool if the y axis could be told to autorange in the range slider even if you start out zoomed in on the main plot, wouldn't it? BTW I came to this realization as I was thinking "what tests should we have for this feature", noting that a big part of this is drawing code so it should have an image test, but then realizing as it stands we can't make an image test because we have no mechanism to force There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, I didn't think about that. |
||
} | ||
} | ||
|
||
return hasOneAxisChanged; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed this. Why pick a different opacity value here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this effect - you see that the y axis is constrained, but it's not shaded as darkly as the x axis constraint, which aligns with the fact that you can only affect the x axis constraint with the range slider handles.
But a different thought occurred to me on looking at this: this is semitransparent black, so does that mean range sliders don't work on a black background? That's a totally separate issue, doesn't need to be addressed in this PR, but we should look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, that's what I wanted to show with the 2 different values of opacity.
And yeah, the black backgrond will be an issue.