Skip to content

Commit b5e8301

Browse files
committed
ensure that range selector attributes are only coerced for date axes
1 parent aa84cf0 commit b5e8301

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/range_selector/draw.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ function makeSelectorData(gd) {
107107
for(var i = 0; i < axes.length; i++) {
108108
var axis = axes[i];
109109

110-
if(axis.rangeselector.visible) data.push(axis);
110+
if(axis.rangeselector && axis.rangeselector.visible) {
111+
data.push(axis);
112+
}
111113
}
112114

113115
return data;

src/plots/cartesian/layout_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
134134
handleAxisDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions);
135135
handlePositionDefaults(axLayoutIn, axLayoutOut, coerce, positioningOptions);
136136

137-
if(axLetter === 'x') {
137+
if(axLetter === 'x' && axLayoutOut.type === 'date') {
138138
// TODO add check on axis type 'date'
139139
rangeSelectorDefaults(axLayoutIn, axLayoutOut, layoutOut);
140140
}

0 commit comments

Comments
 (0)