Marimekko Chart
Source: Data Visualisation Catalogue - Marimekko Chart
Why This Belongs In The Compiler Gallery
Marimekko charts are a high-value bridge from grouped/stacked bars into mosaic layouts. They use simple rect marks, but both x width and y height are data-derived proportions, so the compiler needs to own the layout.
Data Contract
Each raw row is one category/series value.
| Field | Type | Purpose |
|---|---|---|
category | categorical | Variable-width parent column. |
series | categorical | Segment stacked within each category. |
value | quantitative | Segment size. |
categoryShare | quantitative, derived | Category total share of all values. |
segmentShare | quantitative, derived | Segment share inside the category. |
x, y, width, height | quantitative, derived | Mosaic segment geometry. |
Expected Visual
A faithful first pass should show category columns whose widths encode category totals, with colored stacked segments inside each column encoding within-category composition.
Compiler Mapping
| Compiler part | Mapping |
|---|---|
| Data source | category-mix raw rows and derived mosaic-segments. |
| Transform | layout with layoutKind: "mosaic" computes variable-width columns and stacked segment bounds. |
| Scales | color: ordinal(series). |
| Layers | Rect mosaic segments, centered segment values, category labels, generated color legend. |
Faithfulness Notes
The current layout covers the rectangular Marimekko/Mekko family. Follow-ups include axis-like percentage guides, configurable category ordering, label hiding for small segments, and broader mosaic policies for two-dimensional contingency tables.