🌍 Public
Viewing a saved revision (read-only)
f75c64d0578949ec96e2ce0eccbc600a
The Margin Convention
This example demonstrates the D3 margin convention by rendering a horizontal bar chart of the top 10 countries by 2020 population, with a 50-pixel gutter on each side of the SVG canvas. The React app loads data from a CSV file using d3.csv, then uses scaleBand for the categorical y-axis and scaleLinear for the quantitative x-axis. Bars are drawn as SVG rectangles inside a translated group element.
AI-generated description- D3 Margin Convention