United States Map
✓ Published0🌍 Public
This example displays a world map with countries rendered in light green against a dark blue ocean sphere, using a natural Earth projection. It loads geographic data from the World Atlas TopoJSON dataset via unpkg and converts it to GeoJSON using the `feature` function from Topojson. The visualization leverages D3 v5 APIs including `d3.geoPath`, `d3.geoNaturalEarth1`, and `d3.json` to project and draw the country boundaries as SVG paths.
AI-generated descriptionAn example showing the capabilities of VizHub:
<!-- * Loads D3 via UNPKG. * Demonstrates use of `import` from `"d3"`. * Demonstrates use of `import` from local ES6 modules. -->Notes:
- We have used World Atlas TopoJSON (npm package) and imported as a script in html file (using unpkg)
- The data we get from fetching from the API endpoint returns in Topology format but in D3 we have methods to deal with geojson data.
- We will convert topojson data into geojson using a library 'Topojson'.
- topology.feature can help us do that.
MIT Licensed