🌍 Public
Axes for React and D3
This example displays a horizontal bar chart of the top ten countries by population in 2020, using data loaded from a CSV file. The visualization is built with React and D3 v5, rendered as an SVG. The code uses D3 utilities like `csv` for data loading, `scaleBand` for the y-axis, `scaleLinear` for the x-axis, and `max` to compute the domain. Axis ticks and grid lines are generated from the scales, with bars drawn as SVG rectangles.
AI-generated descriptionA program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data.
MIT Licensed
Comments
Sign in to join the discussion.