From 063632d08e21d4d685bc700f2a3d53e29ce8ffb9 Mon Sep 17 00:00:00 2001 From: archmoj Date: Sat, 28 Mar 2020 22:19:14 -0400 Subject: [PATCH] check for Infinity in rangebreak l2p --- src/plots/cartesian/set_convert.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plots/cartesian/set_convert.js b/src/plots/cartesian/set_convert.js index 277bc0c81dc..b6aa9971600 100644 --- a/src/plots/cartesian/set_convert.js +++ b/src/plots/cartesian/set_convert.js @@ -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) { @@ -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); }; }