Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering data with react

Public visualization

Viewing a saved revision (read-only)

3ef2cb4e347b4251a1ff12ed789a4d70

Rendering data with react

0 stars2🌍 Public
SSreekar Reddy
Last edited May 13, 2021
Created on May 13, 2021

A bar chart displays the top 10 countries by 2020 population, loaded from a UN dataset via `d3.csv`. React's `useState` and `useEffect` manage the asynchronous data fetching, while `d3.scaleBand` positions bars on the y-axis and `d3.scaleLinear` maps population values to widths. The SVG rectangles render through React components, with `d3.max` setting the x-domain.

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.