Skip to main content
100%

Pathetic Bar Chart

✓ Published1🌍 Public
MMilena Belianovich Holtman
Last edited Oct 12, 2022
Created on Oct 12, 2022

This example uses React and D3 to render a horizontal bar chart of the ten most populous countries from a UN population dataset. The visualization shows country names on the y-axis and population totals on the x-axis, with each bar’s length proportional to its population value. The code loads CSV data via `d3.csv`, assigns ordinal y-axis scales using `d3.scaleBand`, and a linear x-axis scale constructed with `d3.scaleLinear` and `d3.max`. React’s `useEffect` hook triggers the asynchronous data fetch, and the final SVG is built by mapping over the data to output `rect` elements.

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!

MIT Licensed

Similar vizzes