Skip to main content
100%

(axis w/ react & d3) Countries by population (top 10)

✓ Published1🌍 Public
AAlexander Dorling
Last edited May 14, 2021
Created on May 14, 2021

This example visualizes the top 10 most populous countries in 2020 as a bar chart, using a horizontal layout. It shows the population counts along the x-axis and country names along the y-axis, with gridlines and tick labels generated manually. The code loads data from a CSV file using `d3.csv`, processes it in a React component with hooks (`useState`, `useEffect`), and uses `scaleBand` for the y-axis, `scaleLinear` for the x-axis, and `max` from d3. React elements are used to render SVG bars, text labels, and lines, with ReactDOM mounting the component.

AI-generated description

A program that creates a bar chart of the top 10 most populous countries. Using gist from Curran (datavis 2020).

MIT Licensed

Similar vizzes