Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axis with React and D3

Public visualization

Axis with React and D3

0 stars1🌍 Public
Tthomasjungcoe
Last edited Mar 13, 2021
Created on Mar 12, 2021

This example displays a horizontal bar chart of 2019 UN population data for nine countries, using a linear x-axis for population values and a banded y-axis for country names. The visualization renders as SVG and combines React state management with D3 utilities: `csv` loads the dataset, `scaleLinear` and `scaleBand` construct the axes, and `max` computes the domain. React's `useState` and `useEffect` handle data loading, while manual tick generation from `xScale.ticks()` draws grid lines and labels.

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.

Comments

Sign in to join the discussion.

MIT Licensed