Fork of ICE 8 - 1Q Sharanya
✓ Published0🌍 Public
This choropleth displays a numeric metric for each U.S. state, colored with a quantized green scale and accompanied by interactive tooltips showing the state name and value. It renders vector paths with d3.geoPath, uses a geoAlbersUsa projection, and loads TopoJSON from the us-atlas package. Custom CSV data is joined to state names via a FIPS ID mapping, and a gradient legend communicates the color scale.
AI-generated descriptionMap (ICE-8 Q1) — Explanation
What the code does
- Loads TopoJSON for world countries (110m) and converts
to GeoJSON via
topojson.feature. - Uses
country-names.tsvto map numeric IDs to country names, then joins with my CSV (name,value). - Projects with Natural Earth (
d3.geoNaturalEarth1) and draws a graticule for context. - Colors countries using a quantized color scale with a legend.
- Adds tooltips on hover (country + formatted value).
Data
country_data_sample.csvcontains a metric per country (example: population in millions).- To replace the metric, edit the CSV and keep the
name,valuecolumns.
How it meets the rubric
- Runs on VizHub without errors and uses TopoJSON (10 pts).
- Commented code + explanation (10 pts).
- World map rendered (10 pts).
- Linked custom data via CSV (15 pts).
Sources (from course tutorial)
- World Atlas TopoJSON + d3 links as provided in the tutorial PDF.
MIT Licensed