Skip to main content
100%

Axes with React and D3

✓ Published1🌍 Public
JJeff Wagner
Last edited Jun 8, 2023
Created on Jun 8, 2023
Forked from In the Margins

This example shows a horizontal bar chart of the top 10 most populous countries in 2020, rendered as SVG in a React component. The chart uses D3’s `scaleBand` for the categorical y-axis and `scaleLinear` for the numeric x-axis, with grid lines and tick labels generated via D3’s `ticks()`. Data is loaded asynchronously from a CSV file using `d3.csv`, and React manages state and rendering. The visualization demonstrates a clean manual integration of D3 scales and SVG elements within React’s declarative paradigm.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes