🌍 Public
Viewing a saved revision (read-only)
d74fc24a10494e3c82844053c1df772a
Refactored Bar Chart
This example presents a horizontal bar chart showing the population of the top 10 countries from a UN Population dataset. The chart uses React components to render SVG elements, with D3’s `scaleBand` for the categorical country axis and `scaleLinear` for the numeric population axis. The visualization is split into modular components, including `AxisBottom`, `AxisLeft`, and `Marks`, which draw the ticks and rectangles. Data is loaded asynchronously via `d3.csv`, and the chart updates upon data arrival.
AI-generated descriptionA program that loads in some data and creates a bar chart with margins, info texts and ticks.