Refactor Bar chart
✓ Published1🌍 Public
This bar chart visualizes the population of the top 10 countries in 2020, using horizontally-oriented bars. Built with React and SVG, the example decomposes the visualization into reusable components: `AxisBottom`, `AxisLeft`, and `Marks`. It uses `d3.scaleBand` for the categorical y-axis, `d3.scaleLinear` for the population x-axis, and `d3.max` for domain calculation. Data is loaded asynchronously from a CSV file via a custom `useData` hook, which fetches and parses the UN Population 2019 dataset.
AI-generated descriptionMouse follower
MIT Licensed