Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Rendering data with react

Public visualization

Fork of Rendering data with react

0 stars0🌍 Public
SSreekar Reddy
Last edited May 15, 2021
Created on May 15, 2021

This example visualizes the top 10 countries by projected 2020 population from a UN dataset, using horizontal bars rendered as SVG rectangles. The React component loads the CSV with `d3.csv`, stores the parsed data in state via the `useState` and `useEffect` hooks, and maps it to a bar chart. Positioning and sizing rely on `d3.scaleBand` for the categorical y-axis and `d3.scaleLinear` for the quantitative x-axis, with the chart width fixed at 960 pixels. The code also imports unused D3 arc and pie functions, while the `message.js` file defines a utility for summarizing data size.

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.

Comments

Sign in to join the discussion.

MIT Licensed