Refactored Bar chart - Countries by population (top 10)
✓ Published1🌍 Public
AAlexander Dorling
Last edited May 14, 2021
Created on May 14, 2021
This bar chart displays the top 10 most populous countries in 2020, with each country's total population represented by the length of its corresponding bar. The visualization uses React components to render SVG elements, with d3.scaleBand and d3.scaleLinear handling the categorical and linear scales for the country names and population values. Data is loaded asynchronously from a CSV file using d3.csv, and the chart is composed of separate AxisBottom, AxisLeft, and Marks components that are refactored for clarity. The bars are drawn as SVG rect elements within a 960×500 viewport.
AI-generated descriptionA program that creates a bar chart of the top 10 most populous countries. Using gist from Curran (datavis 2020).
MIT Licensed