Skip to content

Commit 928ff6d

Browse files
committed
do not try to clear ax layers on first render
- this can speed up Axes.doTicks by 50ms on 50x50 subplots grids
1 parent 42ec6a0 commit 928ff6d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/plot_api/plot_api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ exports.plot = function(gd, data, layout, config) {
347347

348348
// draw ticks, titles, and calculate axis scaling (._b, ._m)
349349
function drawAxes() {
350-
return Axes.doTicks(gd, 'redraw');
350+
return Axes.doTicks(gd, graphWasEmpty ? '' : 'redraw');
351351
}
352352

353353
// Now plot the data

src/plots/cartesian/axes.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,10 +1539,8 @@ axes.doTicks = function(gd, axid, skipTitle) {
15391539
return function() {
15401540
if(!ax._id) return;
15411541
var axDone = axes.doTicks(gd, ax._id);
1542-
if(axid === 'redraw') {
1543-
ax._r = ax.range.slice();
1544-
ax._rl = Lib.simpleMap(ax._r, ax.r2l);
1545-
}
1542+
ax._r = ax.range.slice();
1543+
ax._rl = Lib.simpleMap(ax._r, ax.r2l);
15461544
return axDone;
15471545
};
15481546
}));

0 commit comments

Comments
 (0)