8000 use un_world from sane-topojson · plotly/plotly.js@8b5de73 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b5de73

Browse files
committed
use un_world from sane-topojson
1 parent 7c407ec commit 8b5de73

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

src/lib/topojson_utils.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@ topojsonUtils.getTopojsonName = function(geoLayout) {
1313
};
1414

1515
topojsonUtils.getTopojsonPath = function(topojsonURL, topojsonName) {
16-
return topojsonURL + topojsonName + '.json';
16+
var path = topojsonURL;
17+
18+
if(topojsonName.startsWith('un_')) {
19+
path += 'un';
20+
} else {
21+
path += topojsonName;
22+
}
23+
24+
return path + '.json';
1725
};
1826

1927
topojsonUtils.getTopojsonFeatures = function(trace, topojson) {

src/plots/geo/constants.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,17 @@ exports.lataxisSpan = {
141141
'*': 180
142142
};
143143

144+
var world = {
145+
lonaxisRange: [-180, 180],
146+
lataxisRange: [-90, 90],
147+
projType: 'equirectangular',
148+
projRotate: [0, 0, 0]
149+
};
150+
144151
// defaults for each scope
145152
exports.scopeDefaults = {
146-
world: {
147-
lonaxisRange: [-180, 180],
148-
lataxisRange: [-90, 90],
149-
projType: 'equirectangular',
150-
projRotate: [0, 0, 0]
151-
},
153+
un: world,
154+
world: world,
152155
usa: {
153156
lonaxisRange: [-180, -50],
154157
lataxisRange: [15, 80],

src/plots/geo/layout_attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var attrs = module.exports = overrideAll({
104104
scope: {
105105
valType: 'enumerated',
106106
values: sortObjectKeys(constants.scopeDefaults),
107-
dflt: 'world',
107+
dflt: 'un',
108108
description: 'Set the scope of the map.'
109109
},
110110
projection: {

test/plot-schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2540,7 +2540,7 @@
25402540
"role": "object",
25412541
"scope": {
25422542
"description": "Set the scope of the map.",
2543-
"dflt": "world",
2543+
"dflt": "un",
25442544
"editType": "plot",
25452545
"valType": "enumerated",
25462546
"values": [
@@ -2549,6 +2549,7 @@
25492549
"europe",
25502550
"north america",
25512551
"south america",
2552+
"un",
25522553
"usa",
25532554
"world"
25542555
]

0 commit comments

Comments
 (0)
0