Skip to content

Commit a762fe3

Browse files
author
Tom Chandler
committed
Added promise returns to Plotly.plot
1 parent fa2c61d commit a762fe3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plot_api/plot_api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Plotly.plot = function(gd, data, layout, config) {
5959
Events.init(gd);
6060

6161
var okToPlot = Events.triggerHandler(gd, 'plotly_beforeplot', [data, layout, config]);
62-
if(okToPlot===false) return;
62+
if(okToPlot===false) return new Promise.reject();
6363

6464
// if there's no data or layout, and this isn't yet a plotly plot
6565
// container, log a warning to help plotly.js users debug
@@ -112,7 +112,7 @@ Plotly.plot = function(gd, data, layout, config) {
112112
// signal to drag handler that after everything else is done
113113
// we need to replot, because something has changed
114114
gd._replotPending = true;
115-
return;
115+
return new Promise.reject();
116116
} else {
117117
// we're going ahead with a replot now
118118
gd._replotPending = false;

0 commit comments

Comments
 (0)