Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axis wit React and D3

Public visualization

Viewing a saved revision (read-only)

43bd9a40de0d4d1c9508880c040d6f92

Axis wit React and D3

0 stars1🌍 Public
Kkragovic
Last edited Mar 30, 2021
Created on Mar 30, 2021

This example displays a horizontal bar chart of the top 10 countries by 2020 population, using React state to manage data loaded asynchronously with `d3.csv`. The visualization manually constructs axes with `d3.scaleLinear` and `d3.scaleBand`, rendering tick marks, labels, and bars as SVG elements. It leverages React hooks (`useState`, `useEffect`, `useCallback`) to trigger the data fetch and update the chart, while D3 utilities handle scaling and data parsing.

AI-generated description

A program that loads in some data using D3 utilities, and uses React state to keep track of the data.