Skip to main content
100%

Aggregating Data With React & D3 (skipped ahead)

✓ Published0🌍 Public
AAdrianna87
Last edited Oct 3, 2022
Created on Oct 3, 2022

This example shows a horizontal bar chart of the top 10 baby names from an 1880 dataset, with each bar’s length scaled to the name’s frequency. It uses React’s `useState` and `useEffect` to asynchronously load CSV data via `d3.csv`, then renders SVG rectangles with `d3.scaleBand` for the categorical y-axis and `d3.scaleLinear` for the quantitative x-axis. The chart also includes gridlines, tick labels, and axis labels generated from `xScale.ticks()`. The data source is a GitHub Gist, and the visualization updates only after the CSV resolves.

AI-generated description

A program that visualizes data using D3 utilities and uses React to render data.

MIT Licensed

Similar vizzes