File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -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
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ module.exports = Geo;
60
60
61
61
var proto = Geo . prototype ;
62
62
63
- proto . plot = function ( geoData , fullLayout ) {
63
+ proto . plot = function ( geoData , fullLayout , promises ) {
64
64
var _this = this ,
65
65
geoLayout = fullLayout [ _this . id ] ,
66
66
graphSize = fullLayout . _size ;
@@ -100,12 +100,16 @@ proto.plot = function(geoData, fullLayout) {
100
100
_this . topojsonName
101
101
) ;
102
102
103
- // N.B this is async
104
- d3 . json ( topojsonPath , function ( error , topojson ) {
105
- _this . topojson = topojson ;
106
- PlotlyGeoAssets . topojson [ _this . topojsonName ] = topojson ;
107
- _this . onceTopojsonIsLoaded ( geoData , geoLayout ) ;
108
- } ) ;
103
+ promises . push ( new Promise ( function ( resolve ) {
104
+ d3 . json ( topojsonPath , function ( error , topojson ) {
105
+
106
+ _this . topojson = topojson ;
107
+ PlotlyGeoAssets . topojson [ _this . topojsonName ] = topojson ;
108
+
109
+ _this . onceTopojsonIsLoaded ( geoData , geoLayout ) ;
110
+ resolve ( ) ;
111
+ } ) ;
112
+ } ) ) ;
109
113
}
110
114
}
111
115
else _this . onceTopojsonIsLoaded ( geoData , geoLayout ) ;
You can’t perform that action at this time.
0 commit comments