Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Fork of Fork of Make a bar chart with react and d3

Public visualization

Fork of Fork of Fork of Make a bar chart with react and d3

0 stars1🌍 Public
TtrwMK
Last edited Oct 14, 2022
Created on Oct 14, 2022

This example shows a horizontal bar chart ranking the top 20 countries by 2020 population, rendered as SVG rectangles in React. The code loads data from a CSV of UN population statistics using `d3.csv`, then uses `scaleBand` for the categorical country axis and `scaleLinear` for the population values. React’s `useState` and `useEffect` manage the asynchronous data loading, while JSX maps each country to a `<rect>` element. The chart updates purely through React’s render cycle, with D3 providing only scales and data parsing utilities.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React to render the data as a radial burst!

Comments

Sign in to join the discussion.

MIT Licensed