Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Pie Chart

Public visualization

Viewing a saved revision (read-only)

9c37b3d204714b60b57bad69387af945

Fork of Pie Chart

0 stars0🌍 Public
Jjampani921@gmail.com
Last edited Nov 6, 2024
Created on Nov 6, 2024
Forked from Pie Chart

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 description