@@ -178,7 +178,7 @@ Plotly.plot = function(gd, data, layout, config) {
178
178
return plots . previousPromises ( gd ) ;
179
179
}
180
180
181
- function marginPushersAgain ( ) {
181
+ function marginPushersAgain ( ) {
182
182
// in case the margins changed, draw margin pushers again
183
183
var seq = JSON . stringify ( fullLayout . _size ) === oldmargins ?
184
184
[ ] : [ marginPushers , layoutStyles ] ;
@@ -335,7 +335,7 @@ Plotly.plot = function(gd, data, layout, config) {
335
335
return plots . previousPromises ( gd ) ;
336
336
}
337
337
338
- function cleanUp ( ) {
338
+ function cleanUp ( ) {
339
339
// now we're REALLY TRULY done plotting...
340
340
// so mark it as done and let other procedures call a replot
341
341
gd . _replotting = false ;
@@ -484,7 +484,7 @@ function plotGeo(gd) {
484
484
fullLayout [ geoId ] . _geo = geo ;
485
485
}
486
486
487
- geo . plot ( fullGeoData , fullLayout ) ;
487
+ geo . plot ( fullGeoData , fullLayout , gd . _promises ) ;
488
488
}
489
489
}
490
490
@@ -570,7 +570,7 @@ function plotPolar(gd, data, layout) {
570
570
if ( txt === '' || ! txt ) opacity = 0 ;
571
571
var placeholderText = 'Click to enter title' ;
572
572
573
- var titleLayout = function ( ) {
573
+ var titleLayout = function ( ) {
574
574
this . call ( Plotly . util . convertToTspans ) ;
575
575
//TODO: html/mathjax
576
576
//TODO: center title
@@ -586,17 +586,17 @@ function plotPolar(gd, data, layout) {
586
586
title . attr ( { 'data-unformatted' : placeholderText } )
587
587
. text ( placeholderText )
588
588
. style ( { opacity : opacity } )
589
- . on ( 'mouseover.opacity' , function ( ) {
589
+ . on ( 'mouseover.opacity' , function ( ) {
590
590
d3 . select ( this ) . transition ( ) . duration ( 100 )
591
591
. style ( 'opacity' , 1 ) ;
592
592
} )
593
- . on ( 'mouseout.opacity' , function ( ) {
593
+ . on ( 'mouseout.opacity' , function ( ) {
594
594
d3 . select ( this ) . transition ( ) . duration ( 1000 )
595
595
. style ( 'opacity' , 0 ) ;
596
596
} ) ;
597
597
}
598
598
599
- var setContenteditable = function ( ) {
599
+ var setContenteditable = function ( ) {
600
600
this . call ( Plotly . util . makeEditable )
601
601
. on ( 'edit' , function ( text ) {
602
602
gd . framework ( { layout : { title : text } } ) ;
@@ -605,7 +605,7 @@ function plotPolar(gd, data, layout) {
605
605
. call ( titleLayout ) ;
606
606
this . call ( setContenteditable ) ;
607
607
} )
608
- . on ( 'cancel' , function ( ) {
608
+ . on ( 'cancel' , function ( ) {
609
609
var txt = this . attr ( 'data-unformatted' ) ;
610
610
this . text ( txt ) . call ( titleLayout ) ;
611
611
} ) ;
@@ -940,7 +940,7 @@ Plotly.redraw = function(gd) {
940
940
Plotly . newPlot = function ( gd , data , layout , config ) {
941
941
gd = getGraphDiv ( gd ) ;
942
942
plots . purge ( gd ) ;
943
- Plotly . plot ( gd , data , layout , config ) ;
943
+ return Plotly . plot ( gd , data , layout , config ) ;
944
944
} ;
945
945
946
946
function doCalcdata ( gd ) {
@@ -1747,7 +1747,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
1747
1747
}
1748
1748
1749
1749
// make a new empty vals array for undoit
1750
- function a0 ( ) { return traces . map ( function ( ) { return undefined ; } ) ; }
1750
+ function a0 ( ) { return traces . map ( function ( ) { return undefined ; } ) ; }
1751
1751
1752
1752
// for autoranging multiple axes
1753
1753
function addToAxlist ( axid ) {
@@ -1764,11 +1764,11 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
1764
1764
// attr can be an array to set several at once (all to the same val)
1765
1765
function doextra ( attr , val , i ) {
1766
1766
if ( Array . isArray ( attr ) ) {
1767
- attr . forEach ( function ( a ) { doextra ( a , val , i ) ; } ) ;
1767
+ attr . forEach ( function ( a ) { doextra ( a , val , i ) ; } ) ;
1768
1768
return ;
1769
1769
}
1770
1770
// quit if explicitly setting this elsewhere
1771
- if ( attr in aobj ) { return ; }
1771
+ if ( attr in aobj ) return ;
1772
1772
1773
1773
var extraparam ;
1774
1774
if ( attr . substr ( 0 , 6 ) === 'LAYOUT' ) {
@@ -2055,7 +2055,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
2055
2055
// a complete layout redraw takes care of plot and
2056
2056
var seq ;
2057
2057
if ( dolayout ) {
2058
- seq = [ function changeLayout ( ) {
2058
+ seq = [ function changeLayout ( ) {
2059
2059
var copyLayout = gd . layout ;
2060
2060
gd . layout = undefined ;
2061
2061
return Plotly . plot ( gd , '' , copyLayout ) ;
@@ -2068,7 +2068,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
2068
2068
plots . supplyDefaults ( gd ) ;
2069
2069
seq = [ plots . previousPromises ] ;
2070
2070
if ( dostyle ) {
2071
- seq . push ( function doStyle ( ) {
2071
+ seq . push ( function doStyle ( ) {
2072
2072
// first see if we need to do arraysToCalcdata
2073
2073
// call it regardless of what change we made, in case
2074
2074
// supplyDefaults brought in an array that was already
@@ -2085,7 +2085,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
2085
2085
} ) ;
2086
2086
}
2087
2087
if ( docolorbars ) {
2088
- seq . push ( function doColorBars ( ) {
2088
+ seq . push ( function doColorBars ( ) {
2089
2089
gd . calcdata . forEach ( function ( cd ) {
2090
2090
if ( ( cd [ 0 ] . t || { } ) . cb ) {
2091
2091
var trace = cd [ 0 ] . trace ,
@@ -2114,7 +2114,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
2114
2114
2115
2115
if ( ! plotDone || ! plotDone . then ) plotDone = Promise . resolve ( ) ;
2116
2116
2117
- return plotDone . then ( function ( ) {
2117
+ return plotDone . then ( function ( ) {
2118
2118
gd . emit ( 'plotly_restyle' ,
2119
2119
Plotly . Lib . extendDeep ( [ ] , [ redoit , traces ] ) ) ;
2120
2120
} ) ;
@@ -2432,7 +2432,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
2432
2432
seq = [ plots . previousPromises ] ;
2433
2433
2434
2434
if ( doplot || docalc ) {
2435
- seq . push ( function layoutReplot ( ) {
2435
+ seq . push ( function layoutReplot ( ) {
2436
2436
// force plot() to redo the layout
2437
2437
gd . layout = undefined ;
2438
2438
// force it to redo calcdata?
@@ -2447,7 +2447,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
2447
2447
fullLayout = gd . _fullLayout ;
2448
2448
2449
2449
if ( dolegend ) {
2450
- seq . push ( function doLegend ( ) {
2450
+ seq . push ( function doLegend ( ) {
2451
2451
Plotly . Legend . draw ( gd ) ;
2452
2452
return plots . previousPromises ( gd ) ;
2453
2453
} ) ;
@@ -2456,7 +2456,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
2456
2456
if ( dolayoutstyle ) seq . push ( layoutStyles ) ;
2457
2457
2458
2458
if ( doticks ) {
2459
- seq . push ( function ( ) {
2459
+ seq . push ( function ( ) {
2460
2460
Plotly . Axes . doTicks ( gd , 'redraw' ) ;
2461
2461
Plotly . Titles . draw ( gd , 'gtitle' ) ;
2462
2462
return plots . previousPromises ( gd ) ;
@@ -2486,7 +2486,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
2486
2486
2487
2487
if ( ! plotDone || ! plotDone . then ) plotDone = Promise . resolve ( ) ;
2488
2488
2489
- return plotDone . then ( function ( ) {
2489
+ return plotDone . then ( function ( ) {
2490
2490
gd . emit ( 'plotly_relayout' ,
2491
2491
Plotly . Lib . extendDeep ( { } , redoit ) ) ;
2492
2492
} ) ;
@@ -2671,7 +2671,7 @@ function makePlotFramework(gd) {
2671
2671
// position and style the containers, make main title
2672
2672
var frameWorkDone = Plotly . Lib . syncOrAsync ( [
2673
2673
layoutStyles ,
2674
- function goAxes ( ) { return Plotly . Axes . doTicks ( gd , 'redraw' ) ; } ,
2674
+ function goAxes ( ) { return Plotly . Axes . doTicks ( gd , 'redraw' ) ; } ,
2675
2675
Plotly . Fx . init
2676
2676
] , gd ) ;
2677
2677
0 commit comments