diff --git a/CHANGELOG.md b/CHANGELOG.md index 278e49e26de..ab0036950df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ where X.Y.Z is the semver of most recent plotly.js release. with thanks to @my-tien for the contribution! ### Changed - - Switch to United Nations (coastlines, countries, land, ocean) + Natural Earth (lakes, rivers, subunits) geodata for building topojson used in geo plot + - Switch to United Nations (coastlines, countries, land, ocean) + Natural Earth (lakes, rivers, subunits) geodata for building topojson used in geo plot [[#7393](https://github.com/plotly/plotly.js/pull/7393)] - Make 'png' all caps [[#7400](https://github.com/plotly/plotly.js/pull/7400)] ### Fixed diff --git a/draftlogs/7481_change.md b/draftlogs/7481_change.md new file mode 100644 index 00000000000..7692eab51a2 --- /dev/null +++ b/draftlogs/7481_change.md @@ -0,0 +1 @@ +- Refactor files related to UN topojson [[#7481](https://github.com/plotly/plotly.js/pull/7481)] diff --git a/src/assets/geo_assets.js b/src/assets/geo_assets.js index 633f6411f88..4157285ae13 100644 --- a/src/assets/geo_assets.js +++ b/src/assets/geo_assets.js @@ -1,22 +1,21 @@ 'use strict'; -// TODO: Remove comments from Antarctica, Oceania during new maps release PR const topojson = { africa_110m: require('../../dist/topojson/africa_110m.json'), - // antarctica_110m: require('../../dist/topojson/antarctica_110m.json'), + antarctica_110m: require('../../dist/topojson/antarctica_110m.json'), asia_110m: require('../../dist/topojson/asia_110m.json'), europe_110m: require('../../dist/topojson/europe_110m.json'), 'north-america_110m': require('../../dist/topojson/north-america_110m.json'), - // oceania_110m: require('../../dist/topojson/oceania_110m.json'), + oceania_110m: require('../../dist/topojson/oceania_110m.json'), 'south-america_110m': require('../../dist/topojson/south-america_110m.json'), usa_110m: require('../../dist/topojson/usa_110m.json'), world_110m: require('../../dist/topojson/world_110m.json'), africa_50m: require('../../dist/topojson/africa_50m.json'), - // antarctica_50m: require('../../dist/topojson/antarctica_50m.json'), + antarctica_50m: require('../../dist/topojson/antarctica_50m.json'), asia_50m: require('../../dist/topojson/asia_50m.json'), europe_50m: require('../../dist/topojson/europe_50m.json'), 'north-america_50m': require('../../dist/topojson/north-america_50m.json'), - // oceania_50m: require('../../dist/topojson/oceania_50m.json'), + oceania_50m: require('../../dist/topojson/oceania_50m.json'), 'south-america_50m': require('../../dist/topojson/south-america_50m.json'), usa_50m: require('../../dist/topojson/usa_50m.json'), world_50m: require('../../dist/topojson/world_50m.json'), diff --git a/tasks/cdn_publish.sh b/tasks/cdn_publish.sh index 8ed5d160116..3047320dd67 100755 --- a/tasks/cdn_publish.sh +++ b/tasks/cdn_publish.sh @@ -29,13 +29,11 @@ for path in `ls $dist/plotly*`; do done # copy topojson files over to the sync folder -# NOTE: Temporarily adding the suffix '_un' to avoid overwriting the old topojson -# which some old plots might depend on -for filepath in $dist/topojson/*.json; do - f=${filepath##*/} - f=${f%.*} - cp $filepath "$sync/${f%.*}_un.json" -done +# NOTE: Temporarily syncing topojson to 'un' folder to avoid overwriting the old topojson +# which some old plots might depend on. These can be accessed by setting 'topojsonURL' to +# 'https://cdn.plot.ly/un/' in the Plotly config. +mkdir $sync/un +cp $dist/topojson/* $sync/un # list folder and files echo $sync diff --git a/topojson/bin/process_geodata.mjs b/topojson/bin/process_geodata.mjs index 846c63d249d..e859caafa13 100644 --- a/topojson/bin/process_geodata.mjs +++ b/topojson/bin/process_geodata.mjs @@ -242,7 +242,6 @@ async function convertLayersToTopojson({ name, resolution }) { // Get required polygon features from UN GeoJSON const inputFilePathUNGeojson = `${inputDir}/${unFilename}.geojson`; -// await mapshaper.runCommands(`${inputFilePathUNGeojson} -filter 'stscod !== undefined' target=1 -clean target=1 -o force ${inputFilePathUNGeojson}`) const outputFilePathAntarctica50m = `${outputDirGeojson}/${unFilename}_50m/antarctica.geojson`; const outputFilePathFiji50m = `${outputDirGeojson}/${unFilename}_50m/fiji.geojson`; const outputFilePathFijiAntimeridian50m = `${outputDirGeojson}/${unFilename}_50m/fiji_antimeridian.geojson`;