Fork of Axes with React & D3
✓ Published0🌍 Public
This example renders a bar chart of the ten most populous countries, with a tooltip showing each country’s population on hover. It uses React’s `useState` and `useEffect` to fetch the data from the United Nations World Population Prospects 2019 CSV via d3’s `csv` loader, then maps the data to SVG rectangles. The axes are built using d3’s `scaleBand` and `scaleLinear`, with gridlines from `xScale.ticks()`. Mouse events trigger a React state change that displays a custom tooltip positioned at the cursor.
AI-generated descriptionA program that shows the top 10 most populous countries as a pathetic bar chart with no axes.
MIT Licensed