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) {
13
13
] . join ( '' ) ;
14
14
} ;
15
15
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' ;
21
18
} ;
22
19
23
20
topojsonUtils . getTopojsonFeatures = function ( trace , topojson ) {
Original file line number Diff line number Diff line change @@ -471,7 +471,8 @@ function plotGeo(gd) {
471
471
geo = new Plotly . Geo (
472
472
{
473
473
id : geoId ,
474
- container : fullLayout . _geocontainer . node ( )
474
+ container : fullLayout . _geocontainer . node ( ) ,
475
+ topojsonURL : gd . _context . topojsonURL
475
476
} ,
476
477
fullLayout
477
478
) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ function Geo(options, fullLayout) {
22
22
23
23
this . id = options . id ;
24
24
this . container = options . container ;
25
+ this . topojsonURL = options . topojsonURL ;
25
26
26
27
// add a few projection types to d3.geo,
27
28
// a subset of https://github.com/d3/d3-geo-projection
@@ -85,7 +86,10 @@ proto.plot = function(geoData, fullLayout) {
85
86
_this . onceTopojsonIsLoaded ( geoData , geoLayout ) ;
86
87
}
87
88
else {
88
- topojsonPath = topojsonUtils . getTopojsonPath ( _this . topojsonName ) ;
89
+ topojsonPath = topojsonUtils . getTopojsonPath (
90
+ _this . topojsonURL ,
91
+ _this . topojsonName
92
+ ) ;
89
93
90
94
// N.B this is async
91
95
d3 . json ( topojsonPath , function ( error , topojson ) {
You can’t perform that action at this time.
0 commit comments