Viewing a saved revision (read-only)
49a2229982a540f8a5fdb07e026bfe5c
Fork of Reusable pie chart
This example is a reusable pie chart that visualizes categorical data from a CSV file containing wine characteristics. It shows how each category's proportion is represented as a slice of the pie, with labels positioned at each slice's centroid and a color scale applied via `d3.scaleOrdinal` with the `d3.schemeCategory10` palette. The chart is rendered as an SVG using D3 v7, with pie geometry computed through the `d3.pie` and `d3.arc` APIs. Hovering over a slice triggers a brief animation that expands the arc outward using D3 transitions, providing interactive feedback. The data is loaded asynchronously via `d3.csv`, and numeric values are converted before the slices are appended.
AI-generated description