Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Migrant Chart try3

Public visualization

Viewing a saved revision (read-only)

222e01d65d064ec29ac6e958f6148195

Migrant Chart try3

0 stars0🌍 Public
Ssucotton9
Last edited Jul 15, 2021
Created on Jul 14, 2021
Forked from HTML Starter

This example displays migration to the United States from 14 countries as a bar chart, with each bar's height representing the number of migrants. The visualization is built using React and D3 v7, leveraging `d3.csvParse` to load data from a remote CSV file and `d3.scaleBand` and `d3.scaleLinear` to map country names and migrant counts to SVG rectangle coordinates. The chart renders bars as SVG `<rect>` elements, with axes implied by the scales but not explicitly drawn. Data loading is handled via a fetch promise, though the code currently logs parsed results instead of fully wiring them into the state.

AI-generated description

Chart of Migration to the US from 14 countries