Skip to content

Commit 063632d

Browse files
committed
check for Infinity in rangebreak l2p
1 parent 11c8ea2 commit 063632d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/plots/cartesian/set_convert.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ module.exports = function setConvert(ax, fullLayout) {
222222
break;
223223
}
224224
}
225-
return _l2p(v, (isY ? -1 : 1) * ax._m2, ax._B[q]);
225+
var b2 = ax._B[q] || 0;
226+
if(!isFinite(b2)) return 0; // avoid NaN translate e.g. in positionLabels if one keep zooming exactly into a break
227+
228+
return _l2p(v, (isY ? -1 : 1) * ax._m2, b2);
226229
};
227230

228231
p2l = function(px) {
@@ -242,8 +245,8 @@ module.exports = function setConvert(ax, fullLayout) {
242245
if(pos < brk.pmin) break;
243246
if(pos > brk.pmax) q = nextI;
244247
}
245-
246-
return _p2l(px, (isY ? -1 : 1) * ax._m2, ax._B[q]);
248+
var b2 = ax._B[q];
249+
return _p2l(px, (isY ? -1 : 1) * ax._m2, b2);
247250
};
248251
}
249252

0 commit comments

Comments
 (0)