Skip to main content
100%

axis with react and D3

✓ Published1🌍 Public
Sseanowh
Last edited Sep 1, 2021
Created on Sep 1, 2021

This example shows a horizontal bar chart of population estimates for the top 10 countries, rendered as SVG via React. It uses D3’s `csv` loader to fetch data from a UN population CSV and stores it in React state. The chart draws axes manually with `scaleBand` and `scaleLinear`, maps ticks to grid lines and labels, and renders bars with `rect` elements. The code demonstrates a hybrid approach where React manages the DOM while D3 provides scales, data parsing, and tick generation.

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.

MIT Licensed

Similar vizzes