Donut Chart
Source: Data Visualisation Catalogue - Donut Chart
Why This Belongs In The Compiler Gallery
Donut charts reuse pie-sector geometry with an inner radius. This verifies that generated path data can represent annular sectors, not only wedge sectors.
Data Contract
Each raw row is one category total.
| Field | Type | Purpose |
|---|---|---|
region | categorical | Sector category and legend label. |
value | quantitative | Quantity encoded as angular share. |
pathD | text, derived | Generated annular sector path. |
share, percentLabel | quantitative/text, derived | Sector share and visible percentage. |
labelX, labelY | quantitative, derived | Label anchor coordinates. |
Compiler Mapping
| Compiler part | Mapping |
|---|---|
| Data source | regional-sales raw rows and derived sectors. |
| Transform | layout with layoutKind: "polarSectors" and a non-zero innerRadius. |
| Scales | color: ordinal(region). |
| Layers | Annular path sectors, center summary text, and percentage labels. |
| Guides | Generated color legend. |
Faithfulness Notes
The annular paths are compiler-generated from raw values. Remaining polish is leader-line labels for thin sectors and center-content layout policy.