Skip to main content
100%

Fork of Rendering Data with React

✓ Published1🌍 Public
Ddleoenri
Last edited Apr 20, 2022
Created on Apr 20, 2022

This example shows a horizontal bar chart of the top 10 most populous countries in 2020, rendered as SVG rectangles. The chart loads UN population data from a CSV file using d3.csv, then maps each country’s population to bar widths with d3.scaleLinear and uses d3.scaleBand for vertical positioning. React state and the useEffect hook manage the asynchronous data loading, while ReactDOM.render mounts the visualization into the DOM. The code relies on React 18, d3 v7, and SVG elements created directly within JSX.

AI-generated description

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

See also React Starter.

MIT Licensed

Similar vizzes