Refactored bar chart
✓ Published1🌍 Public
This example shows a horizontal bar chart displaying the top 10 countries by population for 2020, using data from a UN Population CSV file. It demonstrates a modular React component structure with separate files for axes, marks, and data loading. The chart renders as SVG using React elements, with a d3.scaleBand for the categorical y-axis and d3.scaleLinear for the quantitative x-axis. The code uses d3.csv for data fetching and parsing, and d3.max to compute the population domain.
AI-generated descriptionA program that loads some data
MIT Licensed