Skip to main content
100%

The Margin Convention

✓ Published1🌍 Public
LLisa Wagner
Last edited Aug 24, 2021
Created on Aug 24, 2021

This example demonstrates the margin convention in D3 by rendering a horizontal bar chart of population data for the top 10 countries from a CSV file. The visualization uses React to manage state and render SVG elements, while D3 utilities (`csv`, `scaleBand`, `scaleLinear`, and `max`) handle data loading and scaling. A fixed margin object creates inner dimensions for the plot area, with bars translated inside a `<g>` element. The chart shows each country's 2020 population as a proportional bar, with axes omitted to focus purely on bar lengths and spacing.

AI-generated description

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

MIT Licensed

Similar vizzes