Proportional Area Chart
Source: Data Visualisation Catalogue - Proportional Area Chart
Why This Belongs In The Compiler Gallery
The catalogue proportional area chart compares quantities with circle area. It is a focused test for the compiler's sqrt scale and the new generated size legend: both the data circles and the legend symbols must resolve from the same radius scale.
Data Contract
Each data row represents one category.
| Field | Type | Purpose |
|---|---|---|
category | categorical | Circle label and x-axis category. |
value | quantitative | Quantity encoded by circle area. |
formatted | text | Visible value label. |
tooltip | text | Hover/inspection label. |
Expected Visual
The chart should show comparable circles on a shared categorical baseline. Circle radius must be area-correct, so the visual area, not diameter, represents the underlying value.
| Element | Expected treatment |
|---|---|
| Circles | Point glyphs with radius resolved through a sqrt scale. |
| Category labels | Generated band-axis labels below the circles. |
| Size legend | Generated guide symbols from the same radius scale. |
| Values | Short centered labels only because this gallery example is sparse. |
Compiler Mapping
| Compiler part | Mapping |
|---|---|
| Data source | areas table with raw category/value rows. |
| Transform | None; radius is not precomputed in data. |
| Scales | x: band(category), r: sqrt(value). |
| Layers | point circles plus text value labels. |
| Guides | Generated x-axis labels and generated size legend. |
Faithfulness Notes
The core chart is compiler-owned: source rows do not contain radius values, and the size legend is generated from the resolved r scale. Remaining polish is label collision handling for denser examples.