@@ -152,7 +152,6 @@ exports.plot = function(gd, data, layout, config) {
152152 Plots . supplyDefaults ( gd ) ;
153153
154154 var fullLayout = gd . _fullLayout ;
155-
156155 var hasCartesian = fullLayout . _has ( 'cartesian' ) ;
157156
158157 // Legacy polar plots
@@ -375,11 +374,15 @@ exports.plot = function(gd, data, layout, config) {
375374 if ( ! plotDone || ! plotDone . then ) plotDone = Promise . resolve ( ) ;
376375
377376 return plotDone . then ( function ( ) {
378- gd . emit ( 'plotly_afterplot' ) ;
377+ emitAfterPlot ( gd ) ;
379378 return gd ;
380379 } ) ;
381380} ;
382381
382+ function emitAfterPlot ( gd ) {
383+ gd . emit ( 'plotly_afterplot' ) ;
384+ }
385+
383386exports . setPlotConfig = function setPlotConfig ( obj ) {
384387 return Lib . extendFlat ( defaultConfig , obj ) ;
385388} ;
@@ -1327,6 +1330,8 @@ exports.restyle = function restyle(gd, astr, val, _traces) {
13271330
13281331 if ( flags . style ) seq . push ( subroutines . doTraceStyle ) ;
13291332 if ( flags . colorbars ) seq . push ( subroutines . doColorBars ) ;
1333+
1334+ seq . push ( emitAfterPlot ) ;
13301335 }
13311336
13321337 seq . push ( Plots . rehover ) ;
@@ -1704,6 +1709,8 @@ exports.relayout = function relayout(gd, astr, val) {
17041709 if ( flags . ticks ) seq . push ( subroutines . doTicksRelayout ) ;
17051710 if ( flags . modebar ) seq . push ( subroutines . doModeBar ) ;
17061711 if ( flags . camera ) seq . push ( subroutines . doCamera ) ;
1712+
1713+ seq . push ( emitAfterPlot ) ;
17071714 }
17081715
17091716 seq . push ( Plots . rehover ) ;
@@ -2191,6 +2198,8 @@ exports.update = function update(gd, traceUpdate, layoutUpdate, _traces) {
21912198 if ( relayoutFlags . ticks ) seq . push ( subroutines . doTicksRelayout ) ;
21922199 if ( relayoutFlags . modebar ) seq . push ( subroutines . doModeBar ) ;
21932200 if ( relayoutFlags . camera ) seq . push ( subroutines . doCamera ) ;
2201+
2202+ seq . push ( emitAfterPlot ) ;
21942203 }
21952204
21962205 seq . push ( Plots . rehover ) ;
@@ -2348,6 +2357,7 @@ exports.react = function(gd, data, layout, config) {
23482357 if ( relayoutFlags . ticks ) seq . push ( subroutines . doTicksRelayout ) ;
23492358 if ( relayoutFlags . modebar ) seq . push ( subroutines . doModeBar ) ;
23502359 if ( relayoutFlags . camera ) seq . push ( subroutines . doCamera ) ;
2360+ seq . push ( emitAfterPlot ) ;
23512361 }
23522362
23532363 seq . push ( Plots . rehover ) ;
0 commit comments