@@ -152,7 +152,6 @@ exports.plot = function(gd, data, layout, config) {
152
152
Plots . supplyDefaults ( gd ) ;
153
153
154
154
var fullLayout = gd . _fullLayout ;
155
-
156
155
var hasCartesian = fullLayout . _has ( 'cartesian' ) ;
157
156
158
157
// Legacy polar plots
@@ -375,11 +374,15 @@ exports.plot = function(gd, data, layout, config) {
375
374
if ( ! plotDone || ! plotDone . then ) plotDone = Promise . resolve ( ) ;
376
375
377
376
return plotDone . then ( function ( ) {
378
- gd . emit ( 'plotly_afterplot' ) ;
377
+ emitAfterPlot ( gd ) ;
379
378
return gd ;
380
379
} ) ;
381
380
} ;
382
381
382
+ function emitAfterPlot ( gd ) {
383
+ gd . emit ( 'plotly_afterplot' ) ;
384
+ }
385
+
383
386
exports . setPlotConfig = function setPlotConfig ( obj ) {
384
387
return Lib . extendFlat ( defaultConfig , obj ) ;
385
388
} ;
@@ -1327,6 +1330,8 @@ exports.restyle = function restyle(gd, astr, val, _traces) {
1327
1330
1328
1331
if ( flags . style ) seq . push ( subroutines . doTraceStyle ) ;
1329
1332
if ( flags . colorbars ) seq . push ( subroutines . doColorBars ) ;
1333
+
1334
+ seq . push ( emitAfterPlot ) ;
1330
1335
}
1331
1336
1332
1337
seq . push ( Plots . rehover ) ;
@@ -1704,6 +1709,8 @@ exports.relayout = function relayout(gd, astr, val) {
1704
1709
if ( flags . ticks ) seq . push ( subroutines . doTicksRelayout ) ;
1705
1710
if ( flags . modebar ) seq . push ( subroutines . doModeBar ) ;
1706
1711
if ( flags . camera ) seq . push ( subroutines . doCamera ) ;
1712
+
1713
+ seq . push ( emitAfterPlot ) ;
1707
1714
}
1708
1715
1709
1716
seq . push ( Plots . rehover ) ;
@@ -2191,6 +2198,8 @@ exports.update = function update(gd, traceUpdate, layoutUpdate, _traces) {
2191
2198
if ( relayoutFlags . ticks ) seq . push ( subroutines . doTicksRelayout ) ;
2192
2199
if ( relayoutFlags . modebar ) seq . push ( subroutines . doModeBar ) ;
2193
2200
if ( relayoutFlags . camera ) seq . push ( subroutines . doCamera ) ;
2201
+
2202
+ seq . push ( emitAfterPlot ) ;
2194
2203
}
2195
2204
2196
2205
seq . push ( Plots . rehover ) ;
@@ -2348,6 +2357,7 @@ exports.react = function(gd, data, layout, config) {
2348
2357
if ( relayoutFlags . ticks ) seq . push ( subroutines . doTicksRelayout ) ;
2349
2358
if ( relayoutFlags . modebar ) seq . push ( subroutines . doModeBar ) ;
2350
2359
if ( relayoutFlags . camera ) seq . push ( subroutines . doCamera ) ;
2360
+ seq . push ( emitAfterPlot ) ;
2351
2361
}
2352
2362
2353
2363
seq . push ( Plots . rehover ) ;
0 commit comments