Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored Bar Chart

Public visualization

Refactored Bar Chart

0 stars1🌍 Public
SSamirAhma
Last edited Nov 26, 2022
Created on Nov 25, 2022

This bar chart displays the top 10 countries by population for 2020, using a horizontal layout where each bar’s length encodes population values on a linear scale. The visualization is rendered as SVG in a React component, with D3 v5 utilities (scaleBand, scaleLinear, max, csv) handling data loading, scaling, and axes. The dataset is fetched from a CSV file of UN population estimates, and React state (useState, useEffect) manages the asynchronous data loading, while the Marks component draws each rectangle bar.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data.

Comments

Sign in to join the discussion.

MIT Licensed