Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

The Margin Convention

Public visualization

Viewing a saved revision (read-only)

8c2cf7a670aa477f933d614fd09bd2fc

The Margin Convention

0 stars1🌍 Public
TTroy Marchesseault
Last edited May 15, 2023
Created on May 15, 2023
Forked from Pathetic Bar Chart

This example shows a horizontal bar chart of the ten most populous countries, using UN population data for 2020. The chart applies a standard margin convention using D3’s `scaleBand` for the categorical country names and `scaleLinear` for population counts, rendered as SVG rectangles inside a translated group. The visualization is built with React, which manages the loading state via `useState` and `useEffect`, while D3’s `csv` utility fetches and parses the data before it is sliced and mapped to bars.

AI-generated description

A program that loads in some data about country populations using D3 utilities, and uses React to render the data as a bar chart.