Skip to content

Commit

Permalink
check for Infinity in rangebreak l2p
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Mar 29, 2020
1 parent 11c8ea2 commit 063632d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/plots/cartesian/set_convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ module.exports = function setConvert(ax, fullLayout) {
break;
}
}
return _l2p(v, (isY ? -1 : 1) * ax._m2, ax._B[q]);
var b2 = ax._B[q] || 0;
if(!isFinite(b2)) return 0; // avoid NaN translate e.g. in positionLabels if one keep zooming exactly into a break

return _l2p(v, (isY ? -1 : 1) * ax._m2, b2);
};

p2l = function(px) {
Expand All @@ -242,8 +245,8 @@ module.exports = function setConvert(ax, fullLayout) {
if(pos < brk.pmin) break;
if(pos > brk.pmax) q = nextI;
}

return _p2l(px, (isY ? -1 : 1) * ax._m2, ax._B[q]);
var b2 = ax._B[q];
return _p2l(px, (isY ? -1 : 1) * ax._m2, b2);
};
}

Expand Down

0 comments on commit 063632d

Please sign in to comment.