Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axes with React & D3

Public visualization

Axes with React & D3

0 stars1🌍 Public
GGonzalo Alarcón Usui
Last edited Dec 2, 2021
Created on Dec 2, 2021

This example shows a horizontal bar chart of the top 10 countries by 2020 population, with axes labels rendered as individual SVG elements. It uses React’s useState and useEffect hooks to load CSV data from a GitHub gist, then builds scales with d3.scaleBand and d3.scaleLinear. Axes ticks are generated manually via d3’s tick() method, with each tick and label positioned using SVG transforms, while bars are drawn as rect elements.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed