Skip to content

Commit b533355

Browse files
committed
Force calc if relayout with rangeslider and guard against NaN
1 parent 454e7c2 commit b533355

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/components/rangeslider/range_plot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ module.exports = function rangePlot(gd, w, h) {
6363
var posX = w * (x[k] - minX) / (maxX - minX),
6464
posY = h * (1 - (y[k] - minY) / (maxY - minY));
6565

66-
pointPairs.push([posX, posY]);
66+
if(!isNaN(posX) && !isNaN(posY)) {
67+
pointPairs.push([posX, posY]);
68+
}
6769
}
6870

6971
// more trace type range plots can be added here

src/plot_api/plot_api.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,10 @@ Plotly.relayout = function relayout(gd, astr, val) {
21912191
docalc = true;
21922192
}
21932193

2194+
if(pleafPlus.indexOf('rangeslider') !== -1) {
2195+
docalc = true;
2196+
}
2197+
21942198
// toggling log without autorange: need to also recalculate ranges
21952199
// logical XOR (ie are we toggling log)
21962200
if(pleaf==='type' && ((parentFull.type === 'log') !== (vi === 'log'))) {

0 commit comments

Comments
 (0)