Skip to main content
100%

The Margin Convention

✓ Published1🌍 Public
KK3zter
Last edited Dec 17, 2021
Created on Dec 17, 2021
Forked from Simple Bar Chart

This example shows a horizontal bar chart of the top 10 countries by population in 2020, loaded from a CSV file. The chart demonstrates the margin convention by offsetting a group of rectangles using an SVG transform. React state manages the asynchronous data loading with `d3.csv`, while the scales `scaleBand` and `scaleLinear` map country names and population counts to the inner chart dimensions. The bars are rendered as SVG `rect` elements within React’s declarative JSX structure.

AI-generated description

Loads in some data using D3 and uses react state to track the data

MIT Licensed

Similar vizzes