Skip to content
Merged
Changes from all commits
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
7 changes: 4 additions & 3 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ Plotly.plot = function(gd, data, layout, config) {
gd.emit('plotly_afterplot');
}

var donePlotting = Lib.syncOrAsync([
Lib.syncOrAsync([
Plots.previousPromises,
marginPushers,
marginPushersAgain,
Expand All @@ -333,8 +333,9 @@ Plotly.plot = function(gd, data, layout, config) {

// even if everything we did was synchronous, return a promise
// so that the caller doesn't care which route we took
return (donePlotting && donePlotting.then) ?
donePlotting : Promise.resolve(gd);
return Promise.all(gd._promises).then(function() {
return gd;
});
};

// Get the container div: we store all variables for this plot as
Expand Down