Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored Bar Chart

Public visualization

Refactored Bar Chart

0 stars1🌍 Public
AAlex Gomes
Last edited Mar 1, 2022
Created on Mar 1, 2022

This example presents a bar chart of population data for the top ten countries in 2020, sourced from a CSV file via a custom React hook that uses D3’s `csv` utility. The visualization is rendered as SVG, with React components for the axes (`AxisBottom`, `AxisLeft`) and bars (`Marks`), using D3 scales (`scaleBand`, `scaleLinear`) to map country names and population values to pixel coordinates. The chart loads asynchronously and displays a placeholder while fetching data.

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