🌍 Public
Viewing a saved revision (read-only)
1a21c474426044eea8cd4172ee7df4d4
Activity 8 Q1.2
This visualization displays population figures for the top countries in 2010 as a horizontal bar chart, with countries listed along the y-axis and population values along the x-axis. The code uses React hooks (useState, useEffect) to load CSV data via d3.csv, then renders SVG rect elements for each bar using React components. Scales are created with d3.scaleBand for the categorical y-axis and d3.scaleLinear for the numeric x-axis, while d3.format with the '.2s' specifier converts population ticks into abbreviated labels (replacing 'G' with 'B' for billions).
AI-generated descriptionA demonstration of how to start using D3 version 6.