Skip to content

Commit df85f35

Browse files
Changes requested by @etpinard
1 parent e2ad33d commit df85f35

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

src/components/rangeslider/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName) {
6363
if(rangeContainerIn.range && layoutOut[yName].isValidRange(rangeContainerIn.range)) {
6464
coerceRange(rangeContainerIn, rangeContainerOut, 'rangemode', 'fixed');
6565
} else {
66-
coerceRange(rangeContainerIn, rangeContainerOut, 'rangemode', 'auto');
66+
coerceRange(rangeContainerIn, rangeContainerOut, 'rangemode');
6767
}
6868

6969
layoutOut[yName].cleanRange('rangeslider.' + yName + '.range');

src/components/rangeslider/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ function drawRangePlot(rangeSlider, gd, axisOpts, opts) {
430430
mockFigure.layout[oppAxisName] = {
431431
type: oppAxisOpts.type,
432432
domain: [0, 1],
433-
range: oppAxisRangeOpts.range.slice(),
433+
range: oppAxisRangeOpts.rangemode === 'auto' || oppAxisRangeOpts.rangemode === 'fixed' ? oppAxisRangeOpts.range.slice() : oppAxisOpts.range.slice(),
434434
calendar: oppAxisOpts.calendar
435435
};
436436

src/components/rangeslider/range_attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
rangemode: {
1313
valType: 'enumerated',
1414
values: ['auto', 'fixed', 'match'],
15-
dflt: 'auto',
15+
dflt: 'match',
1616
role: 'style',
1717
editType: 'calc',
1818
description: [

src/plots/cartesian/axes.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,10 @@ axes.doAutoRange = function(ax) {
373373
if(axeRangeOpts) {
374374
if(axeRangeOpts.rangemode === 'auto') {
375375
axeRangeOpts.range = hasDeps ? axes.getAutoRange(ax) : ax.range.slice();
376-
} else {
377-
axeRangeOpts.range = ax.range.slice();
378376
}
379377
}
380378
axIn = ax._anchorAxis._input;
381-
axIn.rangeslider[ax._name] = Object.assign({}, axeRangeOpts);
379+
axIn.rangeslider[ax._name] = Lib.extendFlat({}, axeRangeOpts);
382380
}
383381
};
384382

test/jasmine/tests/range_slider_test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('the range slider', function() {
9191

9292
slide(start, sliderY, end, sliderY).then(function() {
9393
var maskMin = children[2],
94-
handleMin = children[7];
94+
handleMin = children[5];
9595

9696
expect(gd.layout.xaxis.range).toBeCloseToArray([4, 49], -0.5);
9797
expect(maskMin.getAttribute('width')).toEqual(String(diff));
@@ -111,7 +111,7 @@ describe('the range slider', function() {
111111

112112
slide(start, sliderY, end, sliderY).then(function() {
113113
var maskMax = children[3],
114-
handleMax = children[8];
114+
handleMax = children[6];
115115

116116
expect(gd.layout.xaxis.range).toBeCloseToArray([0, 32.77], -0.5);
117117
expect(+maskMax.getAttribute('width')).toBeCloseTo(-diff);
@@ -132,7 +132,7 @@ describe('the range slider', function() {
132132

133133
slide(start, sliderY, end, sliderY).then(function() {
134134
var maskMin = children[2],
135-
handleMin = children[7];
135+
handleMin = children[5];
136136

137137
expect(gd.layout.xaxis.range).toBeCloseToArray([3.96, 49], -0.5);
138138
expect(+maskMin.getAttribute('width')).toBeCloseTo(String(diff));
@@ -152,7 +152,7 @@ describe('the range slider', function() {
152152

153153
slide(start, sliderY, end, sliderY).then(function() {
154154
var maskMax = children[3],
155-
handleMax = children[8];
155+
handleMax = children[6];
156156

157157
expect(gd.layout.xaxis.range).toBeCloseToArray([0, 45.04], -0.5);
158158
expect(+maskMax.getAttribute('width')).toBeCloseTo(-diff);
@@ -187,8 +187,8 @@ describe('the range slider', function() {
187187
Plotly.relayout(gd, 'xaxis.range', [10, 20]).then(function() {
188188
var maskMin = children[2],
189189
maskMax = children[3],
190-
handleMin = children[7],
191-
handleMax = children[8];
190+
handleMin = children[5],
191+
handleMax = children[6];
192192

193193
expect(+maskMin.getAttribute('width')).toBeWithin(125, TOL);
194194
expect(+maskMax.getAttribute('width')).toBeWithin(365, TOL);
@@ -203,8 +203,8 @@ describe('the range slider', function() {
203203
Plotly.relayout(gd, 'xaxis.range[0]', 10).then(function() {
204204
var maskMin = children[2],
205205
maskMax = children[3],
206-
handleMin = children[7],
207-
handleMax = children[8];
206+
handleMin = children[5],
207+
handleMax = children[6];
208208

209209
expect(+maskMin.getAttribute('width')).toBeWithin(126, TOL);
210210
expect(+maskMax.getAttribute('width')).toEqual(0);

0 commit comments

Comments
 (0)