Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
519e1a7044e633f335258707f4326a7f652fc4f08292c6550b30167c91caff13dd91b500fd1d75e0486a32488f1bc2a40ad3b6071b496641149ef7054d8b58dd48914a8a3ee50ae28318764e4da17d3a8e85e3d00dd85623929be6e2ad33ddf85f35fe83e073b6b81a9de4e3ef2819c8df96a139c66f81f092c44041ce3d23c840173560f6c556f8c43f15a7ccb60916a88b2495b8c104f54f62File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /** | ||
| * Copyright 2012-2018, Plotly, Inc. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
| 'use strict'; | ||
| module.exports = { | ||
| // not really a 'subplot' attribute container, | ||
| // but this is the flag we use to denote attributes that | ||
| // support yaxis, yaxis2, yaxis3, ... counters | ||
| _isSubplotObj: true, | ||
| rangemode: { | ||
| valType: 'enumerated', | ||
| values: ['auto', 'fixed', 'match'], | ||
| dflt: 'match', | ||
| role: 'style', | ||
| editType: 'calc', | ||
| description: [ | ||
| 'Determines whether or not the range of this axis in', | ||
| 'the rangeslider use the same value than in the main plot', | ||
| 'when zooming in/out.', | ||
| 'If *auto*, the autorange will be used.', | ||
| 'If *fixed*, the `range` is used.', | ||
| 'If *match*, the current range of the corresponding y-axis on the main subplot is used.' | ||
| ].join(' ') | ||
| }, | ||
| range: { | ||
| valType: 'info_array', | ||
| role: 'style', | ||
| items: [ | ||
| {valType: 'any', editType: 'plot'}, | ||
| {valType: 'any', editType: 'plot'} | ||
| ], | ||
| editType: 'plot', | ||
| description: [ | ||
| 'Sets the range of this axis for the rangeslider.' | ||
| ].join(' ') | ||
| }, | ||
| editType: 'calc' | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -49,6 +49,12 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce, | ||
| var autoRange = coerce('autorange', !containerOut.isValidRange(containerIn.range)); | ||
| // both x and y axes may need autorange done just for the range slider's purposes | ||
| // the logic is complicated to figure this out later, particularly for y axes since | ||
| // the settings can be spread out in the x axes... so instead we'll collect them | ||
| // during supplyDefaults | ||
| containerOut._rangesliderAutorange = false; | ||
Contributor 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. Very clear comment. Thanks! | ||
| if(autoRange) coerce('rangemode'); | ||
| coerce('range'); | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
@alexcjohnson we should be able to change these to
editType: 'plot', correct?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.
oh hmm... actually I don't think we can, it's like
ax.autorangewhich is stillcalc, because this affects_rangesliderAutorangewhich determines whether we even bother calculatingax._min/_maxduring thecalcstep.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.
Ok. I tried switching them to
'plot', but that didn't break any test 😕