Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored Bar Chart

Public visualization

Viewing a saved revision (read-only)

8c79f08c054f43beb69db54fc29f2d30

Refactored Bar Chart

0 stars1🌍 Public
Bbakstorage00001
Last edited Feb 4, 2022
Created on Feb 4, 2022

A horizontal bar chart displays population data for ten countries in 2020, loaded from a CSV file hosted on GitHub. The React app uses a custom hook with `d3.csv` to fetch and parse the data, storing it in state. SVG rendering builds the visualization from reusable components: `AxisBottom` creates the linear population scale, `AxisLeft` labels the categorical country bands, and `Marks` draws rectangles using `scaleBand` and `scaleLinear`. The chart updates upon data loading.

AI-generated description

A program that loads in some data using d3 utilities, and uses React state to keep track of the data.