Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axis with React and D3

Public visualization

Axis with React and D3

0 stars0🌍 Public
Mmarouan-ben
Last edited Sep 29, 2023
Created on Sep 29, 2023

This example visualizes the top 20 countries by 2020 population as a horizontal bar chart, using React for rendering and D3 for data loading and scales. It fetches CSV data with `d3.csv` and constructs band and linear scales via `d3.scaleBand` and `d3.scaleLinear`. Axes are hand-drawn as SVG lines and text elements, with ticks generated from `xScale.ticks()`. The React component manages state with hooks (`useState`, `useEffect`) and updates the SVG output accordingly.

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!

Comments

Sign in to join the discussion.

MIT Licensed