Skip to content

Commit

Permalink
🔪 layoutStyles call in drawFramework step
Browse files Browse the repository at this point in the history
- this appear to be no longer needed
- adapt plot_api test to relied on layoutStyles spy counts
  • Loading branch information
etpinard committed Mar 14, 2018
1 parent e32434e commit e810c1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
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);
return Plots.previousPromises(gd);
}

// 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

0 comments on commit e810c1e

Please sign in to comment.