Dataviz 6 - Margin convention
✓ Published1🌍 Public
This example displays the top 10 most populous countries from the United Nations World Population Prospects 2019 dataset as simple bars without axes or labels. It demonstrates the margin convention by using D3’s scaleBand and scaleLinear to map country names and population values to pixel ranges within an inner chart area. The React component loads CSV data via useCallback and useEffect, then renders SVG rectangles inside a translated group element. The code uses d3.csv, scaleBand, scaleLinear, and max from d3.v5.
AI-generated descriptionA program that shows the top 10 most populous countries as a pathetic bar chart with no axes.
MIT Licensed