Skip to content

Commit 16be6a4

Browse files
authored
Merge pull request #3874 from plotly/sane-topojson-v3
Use sane-topojson v3
2 parents afdf997 + fcd1c4b commit 16be6a4

31 files changed

+37
-31
lines changed

dist/topojson/africa_110m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/africa_50m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/asia_110m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/asia_50m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/europe_110m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/europe_50m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/north-america_110m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/north-america_50m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/south-america_110m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/south-america_50m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/usa_110m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/usa_50m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/world_110m.json

+1-1
Large diffs are not rendered by default.

dist/topojson/world_50m.json

+1-1
Large diffs are not rendered by default.

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"regl-splom": "^1.0.6",
108108
"right-now": "^1.0.0",
109109
"robust-orientation": "^1.1.3",
110-
"sane-topojson": "^2.0.0",
110+
"sane-topojson": "^3.0.1",
111111
"strongly-connected-components": "^1.0.1",
112112
"superscript-text": "^1.0.0",
113113
"svg-path-sdf": "^1.1.3",

src/lib/geo_location_utils.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,16 @@ function locationToFeature(locationmode, location, features) {
4242

4343
if(locationId) {
4444
if(locationmode === 'USA-states') {
45-
// Filter out features south of the equator
45+
// Filter out features out in USA
4646
//
4747
// This is important as the Natural Earth files
4848
// include state/provinces from USA, Canada, Australia and Brazil
4949
// which have some overlay in their two-letter ids. For example,
5050
// 'WA' is used for both Washington state and Western Australia.
51-
// As subunits from USA and Canada never conflict, filtering out features
52-
// south of the equator suffices to fix https://github.com/plotly/plotly.js/issues/3779
53-
//
54-
// A better fix would have us add a "governing unit" properties in subunit features
55-
// in the `sane-topojson` package to avoid conflicts.
5651
features2 = [];
5752
for(i = 0; i < features.length; i++) {
5853
f = features[i];
59-
if(f.properties && f.properties.ct && f.properties.ct[1] > 0) {
54+
if(f.properties && f.properties.gu && f.properties.gu === 'USA') {
6055
features2.push(f);
6156
}
6257
}

tasks/util/constants.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@ var pathToImageTest = path.join(pathToRoot, 'test/image');
88
var pathToDist = path.join(pathToRoot, 'dist/');
99
var pathToBuild = path.join(pathToRoot, 'build/');
1010

11-
var pathToTopojsonSrc = path.join(
12-
path.dirname(require.resolve('sane-topojson')), 'dist/'
13-
);
11+
var pathToTopojsonSrc;
12+
try {
13+
pathToTopojsonSrc = path.join(path.dirname(require.resolve('sane-topojson')), 'dist/');
14+
} catch(e) {
15+
console.log([
16+
'',
17+
'WARN: Cannot resolve path to *sane-topojson* package.',
18+
' This can happen when one `npm link sane-topojson`',
19+
' and runs a command in a Docker container.',
20+
' There is nothing to worry, if you see this warning while running',
21+
' `npm run test-image`, `npm run test-export` or `npm run baseline` ;)',
22+
''
23+
].join('\n'));
24+
}
1425

1526
var partialBundleNames = [
1627
'basic', 'cartesian', 'geo', 'gl3d', 'gl2d', 'mapbox', 'finance'
-144 KB
Binary file not shown.
142 KB
Loading
81 Bytes
Loading
40 Bytes
Loading
-11 Bytes
Loading
-7 Bytes
Loading

test/image/baselines/geo_first.png

14 Bytes
Loading
148 Bytes
Loading
35 Bytes
Loading
-508 Bytes
Loading

test/image/baselines/geo_second.png

13 Bytes
Loading
13 Bytes
Loading

0 commit comments

Comments
 (0)