-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6743 from plotly/fix6742-partial-range-interact
Fix range interactions affecting partial ranges in other subplots
- Loading branch information
Showing
5 changed files
with
155 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Fix range interactions affecting partial ranges in other subplots [[#6743](https://github.com/plotly/plotly.js/pull/6743)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use strict'; | ||
|
||
var handleAutorangeOptionsDefaults = require('./autorange_options_defaults'); | ||
|
||
module.exports = function handleRangeDefaults(containerIn, containerOut, coerce, options) { | ||
var axTemplate = containerOut._template || {}; | ||
var axType = containerOut.type || axTemplate.type || '-'; | ||
|
||
coerce('minallowed'); | ||
coerce('maxallowed'); | ||
|
||
var range = coerce('range'); | ||
var autorangeDflt = containerOut.getAutorangeDflt(range, options); | ||
var autorange = coerce('autorange', autorangeDflt); | ||
|
||
var shouldAutorange; | ||
|
||
// validate range and set autorange true for invalid partial ranges | ||
if(range && ( | ||
(range[0] === null && range[1] === null) || | ||
((range[0] === null || range[1] === null) && (autorange === 'reversed' || autorange === true)) || | ||
(range[0] !== null && (autorange === 'min' || autorange === 'max reversed')) || | ||
(range[1] !== null && (autorange === 'max' || autorange === 'min reversed')) | ||
)) { | ||
range = undefined; | ||
delete containerOut.range; | ||
containerOut.autorange = true; | ||
shouldAutorange = true; | ||
} | ||
|
||
if(!shouldAutorange) { | ||
autorangeDflt = containerOut.getAutorangeDflt(range, options); | ||
autorange = coerce('autorange', autorangeDflt); | ||
} | ||
|
||
if(autorange) { | ||
handleAutorangeOptionsDefaults(coerce, autorange, range); | ||
if(axType === 'linear' || axType === '-') coerce('rangemode'); | ||
} | ||
|
||
containerOut.cleanRange(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters