Skip to main content
100%

Axes with React & D3

✓ Published1🌍 Public
Qqtrfx
Last edited Jun 17, 2023
Created on Jun 17, 2023

This example demonstrates a horizontal bar chart of the top 10 most populous countries for 2020, rendered as SVG. It loads UN population data from a CSV URL using D3’s `csv` utility, then uses React’s `useState` and `useEffect` hooks to manage the asynchronous data loading and re-render. The chart builds custom axes manually—D3’s `scaleBand` and `scaleLinear` position bars and ticks, while loops generate gridlines, axis labels, and text elements without using `d3.axis`. React components render each bar, tick, and label directly into the SVG.

AI-generated description

A program that loads in some data using D3 utilities, and uses React to render the Data.

MIT Licensed

Similar vizzes