@@ -343,7 +343,7 @@ Plotly.plot = function(gd, data, layout, config) {
343343 gd . emit ( 'plotly_afterplot' ) ;
344344 }
345345
346- Lib . syncOrAsync ( [
346+ var seq = [
347347 Plots . previousPromises ,
348348 addFrames ,
349349 drawFramework ,
@@ -353,8 +353,14 @@ Plotly.plot = function(gd, data, layout, config) {
353353 subroutines . layoutStyles ,
354354 drawAxes ,
355355 drawData ,
356- finalDraw
357- ] , gd , cleanUp ) ;
356+ finalDraw ,
357+ ] ;
358+
359+ if ( gd . _fullLayout . _rehover ) {
360+ seq . push ( function ( ) { Plots . rehover ( gd ) ; } ) ;
361+ }
362+
363+ Lib . syncOrAsync ( seq , gd , cleanUp ) ;
358364
359365 // even if everything we did was synchronous, return a promise
360366 // so that the caller doesn't care which route we took
@@ -1206,8 +1212,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
12061212
12071213 if ( flags . fullReplot ) {
12081214 seq . push ( Plotly . plot ) ;
1209- }
1210- else {
1215+ } else {
12111216 seq . push ( Plots . previousPromises ) ;
12121217
12131218 Plots . supplyDefaults ( gd ) ;
@@ -1216,6 +1221,10 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
12161221 if ( flags . docolorbars ) seq . push ( subroutines . doColorBars ) ;
12171222 }
12181223
1224+ if ( gd . _fullLayout . _rehover ) {
1225+ seq . push ( function ( ) { Plots . rehover ( gd ) ; } ) ;
1226+ }
1227+
12191228 Queue . add ( gd ,
12201229 restyle , [ gd , specs . undoit , specs . traces ] ,
12211230 restyle , [ gd , specs . redoit , specs . traces ]
@@ -1696,9 +1705,11 @@ Plotly.relayout = function relayout(gd, astr, val) {
16961705 }
16971706
16981707 var aobj = { } ;
1699- if ( typeof astr === 'string' ) aobj [ astr ] = val ;
1700- else if ( Lib . isPlainObject ( astr ) ) aobj = astr ;
1701- else {
1708+ if ( typeof astr === 'string' ) {
1709+ aobj [ astr ] = val ;
1710+ } else if ( Lib . isPlainObject ( astr ) ) {
1711+ aobj = astr ;
1712+ } else {
17021713 Lib . warn ( 'Relayout fail.' , astr , val ) ;
17031714 return Promise . reject ( ) ;
17041715 }
@@ -1716,8 +1727,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
17161727
17171728 if ( flags . layoutReplot ) {
17181729 seq . push ( subroutines . layoutReplot ) ;
1719- }
1720- else if ( Object . keys ( aobj ) . length ) {
1730+ } else if ( Object . keys ( aobj ) . length ) {
17211731 seq . push ( Plots . previousPromises ) ;
17221732 Plots . supplyDefaults ( gd ) ;
17231733
@@ -1727,6 +1737,10 @@ Plotly.relayout = function relayout(gd, astr, val) {
17271737 if ( flags . domodebar ) seq . push ( subroutines . doModeBar ) ;
17281738 }
17291739
1740+ if ( gd . _fullLayout . _rehover ) {
1741+ seq . push ( function ( ) { Plots . rehover ( gd ) ; } ) ;
1742+ }
1743+
17301744 Queue . add ( gd ,
17311745 relayout , [ gd , specs . undoit ] ,
17321746 relayout , [ gd , specs . redoit ]
@@ -2122,6 +2136,10 @@ Plotly.update = function update(gd, traceUpdate, layoutUpdate, traces) {
21222136 if ( relayoutFlags . domodebar ) seq . push ( subroutines . doModeBar ) ;
21232137 }
21242138
2139+ if ( gd . _fullLayout . _rehover ) {
2140+ seq . push ( function ( ) { Plots . rehover ( gd ) ; } ) ;
2141+ }
2142+
21252143 Queue . add ( gd ,
21262144 update , [ gd , restyleSpecs . undoit , relayoutSpecs . undoit , restyleSpecs . traces ] ,
21272145 update , [ gd , restyleSpecs . redoit , relayoutSpecs . redoit , restyleSpecs . traces ]
0 commit comments