Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axes with React & D3

Public visualization

Axes with React & D3

0 stars1🌍 Public
AAngel Lam
Last edited Mar 15, 2021
Created on Mar 15, 2021

This example shows a horizontal bar chart of the ten most populous countries in 2020, with axes rendered as SVG elements. The code uses React’s `useState` and `useEffect` hooks to load CSV data via `d3.csv`, then builds linear and band scales with `d3.scaleLinear` and `d3.scaleBand`. Ticks and labels are generated manually using `xScale.ticks()` and the scale domains, while bars are drawn as `<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

Comments

Sign in to join the discussion.

MIT Licensed