Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored Bar Chart

Public visualization

Refactored Bar Chart

0 stars1🌍 Public
Tthomasjungcoe
Last edited Mar 13, 2021
Created on Mar 13, 2021

This example displays a horizontal bar chart of the top nine countries by 2020 population, with country names on the y-axis and population on the x-axis. The React app uses a custom `useData` hook to fetch CSV data via D3’s `csv` utility, then renders SVG with D3 scales (`scaleBand` and `scaleLinear`) and helper components for axes and marks. The `Marks` component creates `rect` elements for each bar, while the axis components generate tick lines and text labels.

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