🌍 Public
Viewing a saved revision (read-only)
220ff504ec044ab1b68f8fe2209fdd20
Refactored Bar Chart
This example shows a horizontal bar chart comparing the populations of the top 10 countries for 2020, with each bar’s length mapped to population and labeled by country name on the left axis. Built with React and D3 v5, the chart uses `scaleBand` for the categorical y-axis, `scaleLinear` for the quantitative x-axis, and renders SVG `rect` elements via a custom `Marks` component. Axes are constructed manually from `xScale.ticks()` and `yScale.domain()`, with data loaded asynchronously from a CSV file.
AI-generated descriptionReact Starter code.