Skip to main content
100%

The margin convention

✓ Published1🌍 Public
Yyejichun@naver.com
Last edited Dec 20, 2021
Created on Dec 19, 2021

This example demonstrates D3’s margin convention by rendering a horizontal bar chart of UN population data for the top ten countries in 2020. The chart uses React state to load the CSV via `d3.csv` and maps each country to a `<rect>` inside a translated `<g>` element, with scales from `d3.scaleBand` and `d3.scaleLinear`. All marks are drawn as SVG within a fixed 960×500 viewport, clearly separating the plotting area from the surrounding margins.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React state to render the data.

MIT Licensed

Similar vizzes