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) {
484484 fullLayout [ geoId ] . _geo = geo ;
485485 }
486486
487- geo . plot ( fullGeoData , fullLayout ) ;
487+ geo . plot ( fullGeoData , fullLayout , gd . _promises ) ;
488488 }
489489}
490490
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ module.exports = Geo;
6060
6161var proto = Geo . prototype ;
6262
63- proto . plot = function ( geoData , fullLayout ) {
63+ proto . plot = function ( geoData , fullLayout , promises ) {
6464 var _this = this ,
6565 geoLayout = fullLayout [ _this . id ] ,
6666 graphSize = fullLayout . _size ;
@@ -100,12 +100,16 @@ proto.plot = function(geoData, fullLayout) {
100100 _this . topojsonName
101101 ) ;
102102
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+ } ) ) ;
109113 }
110114 }
111115 else _this . onceTopojsonIsLoaded ( geoData , geoLayout ) ;
You can’t perform that action at this time.
0 commit comments