Skip to main content
100%

Axes with React & D3

✓ Published2🌍 Public
Ddleoenri
Last edited Apr 20, 2022
Created on Apr 20, 2022
Forked from Margin Convention

A horizontal bar chart displays population data for ten countries in 2020, loaded via D3's `d3.csv` from a GitHub gist. React renders the SVG, while D3's `scaleBand` and `scaleLinear` position bars and axes. The code builds custom tick marks and labels using `xScale.ticks()` and manual SVG text elements, avoiding D3's axis components. React hooks manage the asynchronous data loading, and the chart updates when the fetched dataset becomes available.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes