diff --git a/src/plots/cartesian/set_convert.js b/src/plots/cartesian/set_convert.js index e2848a77388..57574b9fc8d 100644 --- a/src/plots/cartesian/set_convert.js +++ b/src/plots/cartesian/set_convert.js @@ -123,9 +123,9 @@ module.exports = function setConvert(ax) { ax.l2p = function(v) { if(!isNumeric(v)) return constants.BADNUM; + // include 2 fractional digits on pixel, for PDF zooming etc - return d3.round(Lib.constrain(ax._b + ax._m*v, - -clipMult*ax._length, (1+clipMult)*ax._length), 2); + return d3.round(ax._b + ax._m * v, 2); }; ax.p2l = function(px) { return (px-ax._b)/ax._m; }; diff --git a/test/image/baselines/ultra_zoom.png b/test/image/baselines/ultra_zoom.png new file mode 100644 index 00000000000..3670d77fcb0 Binary files /dev/null and b/test/image/baselines/ultra_zoom.png differ diff --git a/test/image/mocks/ultra_zoom.json b/test/image/mocks/ultra_zoom.json new file mode 100644 index 00000000000..f3acf46e4aa --- /dev/null +++ b/test/image/mocks/ultra_zoom.json @@ -0,0 +1,45 @@ +{ + "data": [ + { + "x": [ + 10000, + 0.0001 + ], + "y": [ + 0.0001, + 10000 + ], + "uid": "1376de" + } + ], + "layout": { + "xaxis": { + "range": [ + 4990.012238820174, + 5009.888574816098 + ], + "type": "linear", + "autorange": false + }, + "yaxis": { + "range": [ + 4907.413431128477, + 5132.099078595185 + ], + "type": "linear", + "autorange": false + }, + "shapes": [ + { + "type": "line", + "x0": 10000, + "x1": 0.0001, + "y0": 10000, + "y1": 0.0001 + } + ], + "height": 450, + "width": 1000, + "autosize": true + } +}