Skip to content
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

Perf drawFramwork #2474

Merged
merged 17 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
4 changes: 1 addition & 3 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,7 @@ exports.plot = function(gd, data, layout, config) {
.attr('height', fullLayout.height);
}

return Lib.syncOrAsync([
subroutines.layoutStyles
], gd);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Too funny, so it just works! We may never know what obviated this...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just worksTM

return Plots.previousPromises(gd);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexcjohnson tests are ✅ after removing the extra layoutStyles call. Good riddance ⛵

}

// draw anything that can affect margins.
Expand Down
4 changes: 1 addition & 3 deletions test/jasmine/tests/plot_api_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2440,9 +2440,7 @@ describe('Test plot api', function() {

function countCalls(counts) {
var callsFinal = Lib.extendFlat({}, counts);
// TODO: do we really need to do layoutStyles twice in Plotly.plot?
// We get one from drawFramework and another directly from Plotly.plot.
callsFinal.layoutStyles = (counts.layoutStyles || 0) + 2 * (counts.plot || 0);
callsFinal.layoutStyles = (counts.layoutStyles || 0) + (counts.plot || 0);

mockedMethods.forEach(function(m) {
expect(subroutines[m]).toHaveBeenCalledTimes(callsFinal[m] || 0);
Expand Down