Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axes with React & D3

Public visualization

Viewing a saved revision (read-only)

1b08bc4c734f4553bb1c39f86369fa01

Axes with React & D3

0 stars1🌍 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.