Skip to main content
100%

Axis with React D3

✓ Published0🌍 Public
Iisavedalex
Last edited Jul 31, 2021
Created on Jul 31, 2021

This example shows a horizontal bar chart of the top 10 countries by population in 2020, with labeled axes. It uses React hooks (`useState`, `useEffect`) to load CSV data via `d3.csv`, then renders SVG elements through JSX. The y-axis uses `d3.scaleBand` for country categories, while the x-axis uses `d3.scaleLinear` with tick marks generated by `xScale.ticks()` and grid lines drawn as `<line>` elements. Data is sourced from a GitHub-hosted UN population dataset.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React to render the data as a radial burst!

MIT Licensed

Similar vizzes