Skip to content

More optimization for cartesian subplots #2487

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 6 commits into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ exports.plot = function(gd, data, layout, config) {

// draw ticks, titles, and calculate axis scaling (._b, ._m)
function drawAxes() {
return Axes.doTicks(gd, 'redraw');
return Axes.doTicks(gd, graphWasEmpty ? '' : 'redraw');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK... this is the only caller using doTicks(gd, '') right? From the logic below it looks like there may have been one previously (or someone just calling doTicks(gd)) but I don't see it now. I'm a little reticent to add new branches inside doTicks when what we really need to do is unpack it into more digestible pieces - but that's probably a project for another time refactoring all of axes.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK... this is the only caller using doTicks(gd, '') right? From the logic below it looks like there may have been one previously (or someone just calling doTicks(gd)) but I don't see it now.

That's correct.

}

// Now plot the data
Expand Down
6 changes: 2 additions & 4 deletions src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1539,10 +1539,8 @@ axes.doTicks = function(gd, axid, skipTitle) {
return function() {
if(!ax._id) return;
var axDone = axes.doTicks(gd, ax._id);
if(axid === 'redraw') {
ax._r = ax.range.slice();
ax._rl = Lib.simpleMap(ax._r, ax.r2l);
}
ax._r = ax.range.slice();
ax._rl = Lib.simpleMap(ax._r, ax.r2l);
return axDone;
};
}));
Expand Down