Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axis Creation With React & d3

Public visualization

Viewing a saved revision (read-only)

53ea426f98074ef5ac0085bafa25cf65

Axis Creation With React & d3

0 stars1🌍 Public
Kkbrookshire420
Last edited May 8, 2022
Created on May 8, 2022

This example shows a horizontal bar chart of 2019 UN population data for the top ten countries, loaded via d3.csv. React state stores the parsed data, while d3.scaleBand and d3.scaleLinear create categorical and linear scales for positioning bars and axes. The SVG renders custom tick marks and labels by iterating over xScale.ticks() and yScale.domain(), with bars drawn as rect elements sized by the scales.

AI-generated description

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