🌍 Public
Viewing a saved revision (read-only)
4fe8f52b4d1a46d1a76a9a86a3a4e226
Fork of Pie Chart
This example displays the total sales figures for the top 10 US states as a pie chart, with each segment sized proportionally to its sales value. The visualization includes a legend showing state names and formatted dollar amounts, and hovering over a segment logs that state’s sales to the console. Built with D3 v5 and React, it uses `d3.csv` to load data from a GitHub gist, `d3.pie` to compute angles, `d3.arc` to generate SVG paths, and `d3.scaleOrdinal` with `schemeCategory10` for colors. The data is sorted descending before rendering.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.