Skip to main content
100%

The Margin Convention

✓ Published1🌍 Public
BbeauMarko
Last edited Jan 27, 2021
Created on Jan 27, 2021
Forked from Pathetic Bar Chart

This example demonstrates the margin convention in D3, displaying a horizontal bar chart of population data for the top 10 countries from the UN Population 2019 dataset. The visualization uses React’s useState and useEffect hooks to asynchronously load CSV data via d3.csv, then renders SVG rectangles scaled with d3.scaleBand and d3.scaleLinear. A margin object defines the inner chart area, with a translated `<g>` element positioning the bars within the SVG canvas.

AI-generated description

A program that loads in saome data using d3 utilities and uses React to keep track of the data.

MIT Licensed

Similar vizzes