The Margin Convention
✓ Published1🌍 Public
This example displays the top ten countries from a UN population dataset as a horizontal bar chart. The bars are rendered as SVG rectangles, with their lengths encoding the 2020 population figures. The chart uses a margin convention to position the plotting area within the SVG canvas. The code employs d3’s `scaleBand` for the categorical y-axis, `scaleLinear` for the quantitative x-axis, and `csv` for data loading, while React manages the component’s state and renders the SVG output.
AI-generated descriptionA program that loads in some data about CSS named colours with d3 and uses react to reder data
MIT Licensed