Calendar
Source: Data Visualisation Catalogue - Calendar
Why This Belongs In The Compiler Gallery
Calendar charts are the first date-layout chart in this gallery that is not just a time axis. They prove the compiler can turn raw dated rows into a calendar-aware grid before normal rect, text, and color-scale rendering happens.
Data Contract
Each raw row is one dated observation.
| Field | Type | Purpose |
|---|---|---|
date | temporal | Raw day to place in the month grid. |
value | quantitative | Encoded cell color. |
day | ordinal, derived | Day-of-month label. |
weekday | ordinal, derived | Column index. |
week | ordinal, derived | Row index. |
x, y, width, height | quantitative, derived | Cell geometry. |
Expected Visual
A faithful first-pass calendar should render a month grid with weekday columns, week rows, one cell per date, and a color ramp for the daily value.
Compiler Mapping
| Compiler part | Mapping |
|---|---|
| Data source | daily-activity raw rows and derived calendar-cells. |
| Transform | layout with layoutKind: "calendarMonth" computes weekday/week positions and cell bounds. |
| Scales | color: sequential(value). |
| Layers | Context frame, weekday labels, day cell rects, day-number text. |
| Guides | Generated stepped color legend. |
Faithfulness Notes
The current transform handles a single month grid. Remaining calendar work includes multi-month/year layouts, week-start policies, blank-day cells, richer date labels, and label collision policies for very small cells.