The Margin Convention
This example uses React and D3 v5 to render a bar chart of the top 10 most populous countries from the United Nations World Population Prospects 2019 dataset. The chart deliberately omits axes and scales, displaying only bars whose lengths encode population values, while the margin constraints define the plotting area. Using `d3.csv` to load data, `d3.scaleBand` for the categorical y-axis, and `d3.scaleLinear` for the numeric x-axis, the SVG output calculates bar widths against a fixed inner width. The code also renders tick lines and labels for the x-axis, but no axis lines or y-axis tick marks, highlighting the conventional margin structure without full annotation.
AI-generated descriptionA program that shows the top 10 most populous countries as a pathetic bar chart with no axes.