Pie Chart
Source: Data Visualisation Catalogue - Pie Chart
Why This Belongs In The Compiler Gallery
Pie charts are the first useful test for compiler-owned polar sector geometry. The visible marks are SVG paths, but the source data should remain plain category/value rows.
Data Contract
Each raw row is one category total.
| Field | Type | Purpose |
|---|---|---|
channel | categorical | Sector category and legend label. |
value | quantitative | Quantity encoded as angular share. |
pathD | text, derived | Generated SVG 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 | channel-share raw rows and derived sectors. |
| Transform | layout with layoutKind: "polarSectors" and proportional-angle mode. |
| Scales | color: ordinal(channel). |
| Layers | One generated path per sector plus percentage text. |
| Guides | Generated color legend. |
Faithfulness Notes
The core pie anatomy is compiler-owned now: source rows do not include angles, centroids, or path strings. Remaining work is polar guide/label collision policy and better small-slice callouts.