Fork of Pie Chart
✓ Published0🌍 Public
This example displays mortality rates across US states using a pie chart, with each slice representing a state’s death count and a legend listing state names alongside their numeric values. It loads CSV data from a GitHub gist, parses it with the `csv` function from D3 v5, and renders the chart as SVG. The visualization uses `pie` to compute slice angles, `arc` to generate path geometry, and `scaleOrdinal` to map states to a fixed color palette. Slice labels are positioned using `arc.centroid`, and the legend is built manually with appended `rect` and `text` elements.
AI-generated descriptionMIT Licensed