Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored Bar Chart

Public visualization

Viewing a saved revision (read-only)

f4b9a299e704453896e66e2e82348f3c

Refactored Bar Chart

0 stars1🌍 Public
KKevin McMorrow
Last edited Sep 25, 2021
Created on Sep 25, 2021

This horizontal bar chart displays the population of the top 10 countries in 2020, with country names on the y-axis and population values on the x-axis. Built with React and D3 v7, it uses `scaleBand` and `scaleLinear` to map data to SVG coordinates. The chart is separated into modular components—`AxisBottom`, `AxisLeft`, and `Marks`—each rendering SVG elements like lines and text. Data is loaded asynchronously from a CSV file via `d3.csv`, and all visual elements are rendered declaratively with React's SVG output.

AI-generated description