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
KK3zter
Last edited Dec 17, 2021
Created on Dec 17, 2021

This example shows a horizontal bar chart of the top 10 countries by 2020 population, rendered as SVG through React components. React state tracks the data, initially loaded via `d3.csv`, while `scaleBand` and `scaleLinear` position bars and axes. The chart includes manually drawn tick marks and labels for both axes. The code uses React `useState` and `useEffect` hooks, along with D3’s `max` for scaling.

AI-generated description

Loads in some data using D3 and uses react state to track the data

Comments

Sign in to join the discussion.

MIT Licensed