Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axes with React and D3

Public visualization

Viewing a saved revision (read-only)

f4ca8bc764354ec2abe9cfc67864edeb

Axes with React and D3

0 stars1🌍 Public
Nnpelliccia
Last edited Aug 4, 2021
Created on Aug 4, 2021

This example shows a horizontal bar chart of 2020 population estimates for ten countries, rendered as SVG from React components that directly call D3 scales and tick functions. It loads CSV data from a GitHub gist using `d3.csv` and a row-conversion function, then builds a band scale for country names and a linear scale for population values. Tick marks and labels for the x-axis are generated manually from `xScale.ticks()`, while y-axis labels use the band scale’s domain, and rectangles are drawn with computed widths and heights.

AI-generated description

A program that loads CSV data into react and renders the data