Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Axes with react and D3

Public visualization

Axes with react and D3

0 stars1🌍 Public
Ggayatrisridhar
Last edited May 14, 2021
Created on May 11, 2021

This example shows a horizontal bar chart of the top 10 countries by 2020 population, with custom axes rendered as SVG elements. D3 scales (scaleBand, scaleLinear) compute bar positions and sizes, while React manages state and renders ticks, labels, and rects. The code manually generates axis ticks via xScale.ticks() and maps domains, avoiding d3.axisBottom. Data loads from a CSV file using d3.csv.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed