Skip to main content
100%

Axes width React & D3

✓ Published1🌍 Public
HHaris Abdullah
Last edited Sep 30, 2021
Created on Sep 28, 2021

This example displays a horizontal bar chart of the top 80 countries by 2020 population, drawn as SVG elements. It uses React hooks (`useState`, `useEffect`) to load and manage data from a CSV file via D3’s `csv`, while D3’s `scaleBand` and `scaleLinear` map country names and population values to pixel coordinates. Axis ticks are rendered manually with D3’s tick generation, and each bar is a `<rect>` positioned by those scales. The layout includes explicit margins and uses D3’s `max` for domain calculation.

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