Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering Data with React

Public visualization

Viewing a saved revision (read-only)

6e5544cb3f364ed6935605011abe0002

Rendering Data with React

0 stars0🌍 Public
Kkrandslam
Last edited Oct 11, 2023
Created on Oct 9, 2023

This example shows a bar chart of the top 10 countries by population in 2020, rendered as SVG elements via React. The underlying CSV data is fetched and parsed with D3’s `csv` utility, then scaled using `scaleBand` and `scaleLinear`. React’s `useEffect` and `useState` manage asynchronous data loading, while `ReactDOM.render` mounts the app. Each bar’s height and width are derived from D3’s `max` and scale functions, mapping country names and population values to screen coordinates.

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!