MCPcopy Create free account
hub / github.com/plotly/plotly.js / createCountriesList

Function createCountriesList

topojson/bin/process_geodata.mjs:34–46  ·  view source on GitHub ↗
(geojsonPath, outputPath)

Source from the content-addressed store, hash-verified

32}
33
34function createCountriesList(geojsonPath, outputPath) {
35 const geojson = getJsonFile(geojsonPath);
36 if (!geojson.features) return;
37
38 const countryData = geojson.features
39 .map((feature) => {
40 const { iso3cd, nam_en } = feature.properties;
41 return { iso3cd, name: nam_en };
42 })
43 .sort((a, b) => a.name.localeCompare(b.name));
44
45 fs.writeFileSync(outputPath, JSON.stringify(countryData));
46}
47
48function addCentroidsToGeojson(geojsonPath) {
49 const geojson = getJsonFile(geojsonPath);

Callers 1

Calls 1

getJsonFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…