@@ -78,7 +78,8 @@ module.exports = function(gd) {
78
78
rangeSliders . each ( function ( axisOpts ) {
79
79
var rangeSlider = d3 . select ( this ) ,
80
80
opts = axisOpts [ constants . name ] ,
81
- oppAxisOpts = fullLayout [ Axes . id2name ( axisOpts . anchor ) ] ;
81
+ oppAxisOpts = fullLayout [ Axes . id2name ( axisOpts . anchor ) ] ,
82
+ oppAxisRangeOpts = opts [ Axes . id2name ( axisOpts . anchor ) ] ;
82
83
83
84
// update range
84
85
// Expand slider range to the axis range
@@ -136,9 +137,9 @@ module.exports = function(gd) {
136
137
137
138
opts . _rl = [ range0 , range1 ] ;
138
139
139
- if ( oppAxisOpts . rangeslidermode === 'auto' || oppAxisOpts . rangeslidermode === 'fixed' ) {
140
- var range0OppAxis = oppAxisOpts . r2l ( oppAxisOpts . rangesliderrange [ 0 ] ) ,
141
- range1OppAxis = oppAxisOpts . r2l ( oppAxisOpts . rangesliderrange [ 1 ] ) ,
140
+ if ( oppAxisRangeOpts . rangemode === 'auto' || oppAxisRangeOpts . rangemode === 'fixed' ) {
141
+ var range0OppAxis = oppAxisOpts . r2l ( oppAxisRangeOpts . range [ 0 ] ) ,
142
+ range1OppAxis = oppAxisOpts . r2l ( oppAxisRangeOpts . range [ 1 ] ) ,
142
143
distOppAxis = range1OppAxis - range0OppAxis ;
143
144
144
145
opts . d2pOppAxis = function ( v ) {
@@ -151,16 +152,16 @@ module.exports = function(gd) {
151
152
rangeSlider
152
153
. call ( drawBg , gd , axisOpts , opts )
153
154
. call ( addClipPath , gd , axisOpts , opts )
154
- . call ( drawRangePlot , gd , axisOpts , opts )
155
- . call ( drawMasks , gd , axisOpts , opts , oppAxisOpts )
155
+ . call ( drawRangePlot , gd , axisOpts , opts , oppAxisRangeOpts )
156
+ . call ( drawMasks , gd , axisOpts , opts , oppAxisRangeOpts )
156
157
. call ( drawSlideBox , gd , axisOpts , opts )
157
158
. call ( drawGrabbers , gd , axisOpts , opts ) ;
158
159
159
160
// setup drag element
160
161
setupDragElement ( rangeSlider , gd , axisOpts , opts ) ;
161
162
162
163
// update current range
163
- setPixelRange ( rangeSlider , gd , axisOpts , opts , oppAxisOpts ) ;
164
+ setPixelRange ( rangeSlider , gd , axisOpts , opts , oppAxisOpts , oppAxisRangeOpts ) ;
164
165
165
166
// update margins
166
167
@@ -276,7 +277,7 @@ function setDataRange(rangeSlider, gd, axisOpts, opts) {
276
277
} ) ;
277
278
}
278
279
279
- function setPixelRange ( rangeSlider , gd , axisOpts , opts , oppAxisOpts ) {
280
+ function setPixelRange ( rangeSlider , gd , axisOpts , opts , oppAxisOpts , oppAxisRangeOpts ) {
280
281
var hw2 = constants . handleWidth / 2 ;
281
282
282
283
function clamp ( v ) {
@@ -305,7 +306,7 @@ function setPixelRange(rangeSlider, gd, axisOpts, opts, oppAxisOpts) {
305
306
. attr ( 'x' , pixelMax )
306
307
. attr ( 'width' , opts . _width - pixelMax ) ;
307
308
308
- if ( oppAxisOpts . rangeslidermode === 'auto' || oppAxisOpts . rangeslidermode === 'fixed' ) {
309
+ if ( oppAxisRangeOpts . rangemode === 'auto' || oppAxisRangeOpts . rangemode === 'fixed' ) {
309
310
var pixelMinOppAxis = opts . _height - clampOppAxis ( opts . d2pOppAxis ( oppAxisOpts . _rl [ 1 ] ) ) ,
310
311
pixelMaxOppAxis = opts . _height - clampOppAxis ( opts . d2pOppAxis ( oppAxisOpts . _rl [ 0 ] ) ) ;
311
312
@@ -385,7 +386,7 @@ function addClipPath(rangeSlider, gd, axisOpts, opts) {
385
386
} ) ;
386
387
}
387
388
388
- function drawRangePlot ( rangeSlider , gd , axisOpts , opts ) {
389
+ function drawRangePlot ( rangeSlider , gd , axisOpts , opts , oppAxisRangeOpts ) {
389
390
var subplotData = Axes . getSubplots ( gd , axisOpts ) ,
390
391
calcData = gd . calcdata ;
391
392
@@ -428,7 +429,7 @@ function drawRangePlot(rangeSlider, gd, axisOpts, opts) {
428
429
mockFigure . layout [ oppAxisName ] = {
429
430
type : oppAxisOpts . type ,
430
431
domain : [ 0 , 1 ] ,
431
- range : ( oppAxisOpts . rangeslidermode === 'auto' || oppAxisOpts . rangeslidermode === 'fixed' ) ? oppAxisOpts . rangesliderrange . slice ( ) : oppAxisOpts . range . slice ( ) ,
432
+ range : ( oppAxisRangeOpts . rangemode === 'auto' || oppAxisRangeOpts . rangemode === 'fixed' ) ? oppAxisRangeOpts . range . slice ( ) : oppAxisOpts . range . slice ( ) ,
432
433
calendar : oppAxisOpts . calendar
433
434
} ;
434
435
@@ -469,7 +470,7 @@ function filterRangePlotCalcData(calcData, subplotId) {
469
470
return out ;
470
471
}
471
472
472
- function drawMasks ( rangeSlider , gd , axisOpts , opts , oppAxisOpts ) {
473
+ function drawMasks ( rangeSlider , gd , axisOpts , opts , yAxisOpts ) {
473
474
var maskMin = rangeSlider . selectAll ( 'rect.' + constants . maskMinClassName )
474
475
. data ( [ 0 ] ) ;
475
476
@@ -495,7 +496,7 @@ function drawMasks(rangeSlider, gd, axisOpts, opts, oppAxisOpts) {
495
496
. call ( Color . fill , constants . maskColor ) ;
496
497
497
498
// masks used for oppAxis zoom
498
- if ( oppAxisOpts . rangeslidermode === 'auto' || oppAxisOpts . rangeslidermode === 'fixed' ) {
499
+ if ( yAxisOpts . rangemode === 'auto' || yAxisOpts . rangemode === 'fixed' ) {
499
500
var maskMinOppAxis = rangeSlider . selectAll ( 'rect.' + constants . maskMinOppAxisClassName )
500
501
. data ( [ 0 ] ) ;
501
502
@@ -506,7 +507,7 @@ function drawMasks(rangeSlider, gd, axisOpts, opts, oppAxisOpts) {
506
507
507
508
maskMinOppAxis
508
509
. attr ( 'width' , opts . _width )
509
- . call ( Color . fill , constants . maskOppColor ) ;
510
+ . call ( Color . fill , constants . maskOppAxisColor ) ;
510
511
511
512
var maskMaxOppAxis = rangeSlider . selectAll ( 'rect.' + constants . maskMaxOppAxisClassName )
512
513
. data ( [ 0 ] ) ;
@@ -519,7 +520,7 @@ function drawMasks(rangeSlider, gd, axisOpts, opts, oppAxisOpts) {
519
520
maskMaxOppAxis
520
521
. attr ( 'width' , opts . _width )
521
522
. style ( 'border-top' , constants . maskOppBorder )
522
- . call ( Color . fill , constants . maskOppColor ) ;
523
+ . call ( Color . fill , constants . maskOppAxisColor ) ;
523
524
}
524
525
}
525
526
0 commit comments