🌍 Public
Viewing a saved revision (read-only)
6bf50d4c3ba44e58ba2bb113bbc42991
Axes with react and D3
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