🌍 Public
Viewing a saved revision (read-only)
6d33299612bb40089c7698ef7037eb55
XYAxis with React & D3 with refactoring
This example shows a horizontal bar chart of population data for the top 10 countries in 2020, with axes rendered as SVG elements. The React components `AxisBottom`, `AxisLeft`, and `Marks` repurpose D3 scales—`d3.scaleBand` and `d3.scaleLinear`—to compute positions and sizes. The bottom axis uses `xScale.ticks()` for tick values, while the left axis maps country names from the data domain. Data is loaded asynchronously from a CSV via `d3.csv` and the React hook `useEffect`. The visualization demonstrates clean separation of axis and mark rendering through reusable, refactored functions.
AI-generated descriptionUses react and D3 to render the data as a radial burst! data about CSS colors.