The Margin Convention
✓ Published1🌍 Public
This example shows a horizontal bar chart of the top 10 most populous countries in the world for 2020, with the D3 margin convention demonstrated by a chart area inset from the SVG edges. It renders an SVG using React, pulling data from a CSV of UN population figures. The code uses `d3.csv`, `scaleLinear`, and `scaleBand` to map population values and country names to x and y scales, while axes are drawn manually with `xScale.ticks()` and gridlines.
AI-generated descriptionBasic D3 bar chart (with React). It includes basic rendering, filtering data before visualization, and the margin convention.
MIT Licensed