Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Rendering Data with React & D3

Public visualization

Viewing a saved revision (read-only)

068e127e9c8a4574bce6c1396bac1927

Fork of Rendering Data with React & D3

0 stars0🌍 Public
DDeaxNG
Last edited Dec 3, 2021
Created on Dec 3, 2021

This example renders a horizontal bar chart of UN population data for 2020 using React and D3 v5. It loads the CSV file with `d3.csv`, parses the population column, and stores the result in React state via the `useState` and `useEffect` hooks. The visualization uses `scaleBand` and `scaleLinear` to map countries and populations to SVG `rect` elements, with React’s declarative rendering driving the SVG output. While loading, it displays a large “Loading…” message before the chart appears.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data.