Skip to content

Fixup rangebreaks l2p and p2l functions #4699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Mar 29, 2020
Prev Previous commit
Next Next commit
check for Infinity in rangebreak l2p
  • Loading branch information
archmoj committed Mar 29, 2020
commit 063632d08e21d4d685bc700f2a3d53e29ce8ffb9
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