Skip to content

Commit df09650

Browse files
committed
rm hard fixedrange: true set in slider defaults
- replace with 'smart' defaults in cartesian layout defaults so that user set `fixedrange: false` will now be honored.
1 parent 5829a0a commit df09650

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

src/components/rangeslider/defaults.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var Lib = require('../../lib');
1212
var attributes = require('./attributes');
1313

1414

15-
module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxes) {
15+
module.exports = function handleDefaults(layoutIn, layoutOut, axName) {
1616
if(!layoutIn[axName].rangeslider) return;
1717

1818
// not super proud of this (maybe store _ in axis object instead
@@ -47,14 +47,6 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxe
4747
axOut._needsExpand = true;
4848
}
4949

50-
if(containerOut.visible) {
51-
counterAxes.forEach(function(ax) {
52-
var opposing = layoutOut[ax] || {};
53-
opposing.fixedrange = true;
54-
layoutOut[ax] = opposing;
55-
});
56-
}
57-
5850
// to map back range slider (auto) range
5951
containerOut._input = containerIn;
6052
};

src/plots/cartesian/axis_defaults.js

-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
105105
coerce('range');
106106
containerOut.cleanRange();
107107

108-
coerce('fixedrange');
109-
110108
handleTickValueDefaults(containerIn, containerOut, coerce, axType);
111109
handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options);
112110
handleTickMarkDefaults(containerIn, containerOut, coerce, options);

src/plots/cartesian/layout_defaults.js

+17
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,22 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
179179
axLayoutOut.calendar
180180
);
181181
}
182+
183+
coerce('fixedrange');
184+
});
185+
186+
yaList.forEach(function(axName) {
187+
axLayoutIn = layoutIn[axName];
188+
axLayoutOut = layoutOut[axName];
189+
190+
var anchoredAxis = layoutOut[axisIds.id2name(axLayoutOut.anchor)];
191+
192+
var fixedRangeDflt = (
193+
anchoredAxis &&
194+
anchoredAxis.rangeslider &&
195+
anchoredAxis.rangeslider.visible
196+
);
197+
198+
coerce('fixedrange', fixedRangeDflt);
182199
});
183200
};

0 commit comments

Comments
 (0)