🌍 Public
Viewing a saved revision (read-only)
1c3283dabe934bf5aafd640c3a0b6c8b
Let's make a face with D3.js!
This example uses D3.js v5 to build a horizontal bar chart from population data for ten countries, with each bar's width proportional to the country's population in thousands. The chart is rendered as SVG, with a linear scale for the x-axis and a band scale for the y-axis, which positions each bar and calculates its height. The code fetches data from a CSV file, multiplies each population value by 1000, and then maps the values to the SVG canvas dimensions.
AI-generated description