File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,8 @@ topojsonUtils.getTopojsonName = function(geoLayout) {
1313 ] . join ( '' ) ;
1414} ;
1515
16- topojsonUtils . getTopojsonPath = function ( topojsonName ) {
17- var topojsonUrl = ( window . PLOTLYENV &&
18- window . PLOTLYENV . TOPOJSON_URL ) || './topojson/' ;
19-
20- return topojsonUrl + topojsonName + '.json' ;
16+ topojsonUtils . getTopojsonPath = function ( topojsonURL , topojsonName ) {
17+ return topojsonURL + topojsonName + '.json' ;
2118} ;
2219
2320topojsonUtils . getTopojsonFeatures = function ( trace , topojson ) {
Original file line number Diff line number Diff line change @@ -471,7 +471,8 @@ function plotGeo(gd) {
471471 geo = new Plotly . Geo (
472472 {
473473 id : geoId ,
474- container : fullLayout . _geocontainer . node ( )
474+ container : fullLayout . _geocontainer . node ( ) ,
475+ topojsonURL : gd . _context . topojsonURL
475476 } ,
476477 fullLayout
477478 ) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ function Geo(options, fullLayout) {
2222
2323 this . id = options . id ;
2424 this . container = options . container ;
25+ this . topojsonURL = options . topojsonURL ;
2526
2627 // add a few projection types to d3.geo,
2728 // a subset of https://github.com/d3/d3-geo-projection
@@ -85,7 +86,10 @@ proto.plot = function(geoData, fullLayout) {
8586 _this . onceTopojsonIsLoaded ( geoData , geoLayout ) ;
8687 }
8788 else {
88- topojsonPath = topojsonUtils . getTopojsonPath ( _this . topojsonName ) ;
89+ topojsonPath = topojsonUtils . getTopojsonPath (
90+ _this . topojsonURL ,
91+ _this . topojsonName
92+ ) ;
8993
9094 // N.B this is async
9195 d3 . json ( topojsonPath , function ( error , topojson ) {
You can’t perform that action at this time.
0 commit comments