Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

axis with react and D3

Public visualization

Viewing a saved revision (read-only)

bd5810eec15143ee905b5e99036a220b

axis with react and D3

0 stars1🌍 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.