Skip to content

Commit

Permalink
Force calc if relayout with rangeslider and guard against NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtusz committed Apr 25, 2016
1 parent 454e7c2 commit b533355
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/rangeslider/range_plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ module.exports = function rangePlot(gd, w, h) {
var posX = w * (x[k] - minX) / (maxX - minX),
posY = h * (1 - (y[k] - minY) / (maxY - minY));

pointPairs.push([posX, posY]);
if(!isNaN(posX) && !isNaN(posY)) {
pointPairs.push([posX, posY]);
}
}

// more trace type range plots can be added here
Expand Down
4 changes: 4 additions & 0 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2191,6 +2191,10 @@ Plotly.relayout = function relayout(gd, astr, val) {
docalc = true;
}

if(pleafPlus.indexOf('rangeslider') !== -1) {
docalc = true;
}

// toggling log without autorange: need to also recalculate ranges
// logical XOR (ie are we toggling log)
if(pleaf==='type' && ((parentFull.type === 'log') !== (vi === 'log'))) {
Expand Down

0 comments on commit b533355

Please sign in to comment.