Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored Bar Chart

Public visualization

Viewing a saved revision (read-only)

669ff0147768455b8814597de7a3b916

Refactored Bar Chart

0 stars1🌍 Public
CCHOI SEUNG HYUN
Last edited May 18, 2022
Created on May 18, 2022
Forked from Margins and Axes

This example shows a horizontal bar chart of the top 10 countries by population for 2020, rendered as SVG via React components. It loads CSV data from a GitHub-hosted file using D3’s `csv` utility, then defines separate axis and mark components (`AxisBottom`, `AxisLeft`, `Marks`) that leverage D3’s `scaleBand` and `scaleLinear` for positioning. The chart uses React’s state and `useData` hook to fetch and transform the data, displaying a loading message until the data arrives.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React to render the data as a radial burst!