Skip to main content
100%

The Margin Convention

✓ Published0🌍 Public
BbeauMarko
Last edited Jan 27, 2021
Created on Jan 27, 2021

This example demonstrates the margin convention in a bar chart that displays population data for ten countries, including China and India, using horizontal bars scaled by population size. The visualization is built with React and D3 v6, using `d3.csv` to load the dataset, `scaleBand` for country positions, and `scaleLinear` for population values. The SVG rendering groups all bars inside a `<g>` element translated by the margin object, which defines consistent spacing between the chart and the viewport edges.

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