Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored Bar Graph

Public visualization

Refactored Bar Graph

0 stars1🌍 Public
SSushan Prajapati
Last edited May 25, 2021
Created on May 25, 2021

This visualization shows the 10 most populous countries in 2020 using horizontal bars, with country names on the y-axis and population values scaled on the x-axis. The graph is built with React components that render SVG elements, using D3’s `scaleBand` and `scaleLinear` for positioning and sizing, while axis tick marks are generated with `xScale.ticks()`. Data comes from the United Nations World Population Prospects 2019, loaded via `d3.csv` and filtered to the top ten entries. The code organizes reusable components for axes and marks, demonstrating a modular approach to chart construction in React with D3.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed