CalendarHeatmap
Charts

CalendarHeatmap

A GitHub-style grid with one column per week and one cell per day, shaded by intensity, for showing the density of a daily time series.

Component behavior

CalendarHeatmap displays a daily metric on a calendar grid. It shows patterns rather than exact values: weekly rhythms, streaks, and gaps are visible without reading individual numbers.

Use cases
  • Daily activity across weeks or months.
  • Weekly patterns, seasonality, and consecutive activity.
  • Compact daily summaries for dashboards or profiles.
Alternatives

LineChart: exact values and their sequence must be compared.

Heatmap: the axes represent categories other than calendar dates.

BarChart: a few periods need direct magnitude comparison.

Props

Pass values as { date, value } pairs; same-day entries are summed. Dates are bucketed in UTC, so the grid renders the same on the server and the client regardless of timezone. The range defaults to the extent of your data, snapped out to whole weeks.

CalendarHeatmapProps props
PropTypeDefaultDescription
valuesCalendarHeatmapValue[]—Daily entries. `date` may be a Date or an ISO string (parsed as UTC). Values on the same day are summed.
startDateDate | string—Pin the grid start. Defaults to the earliest value, snapped to a whole week.
endDateDate | string—Pin the grid end. Defaults to the latest value.
maxValuenumber—Intensity ceiling for the color ramp. Defaults to the largest daily value.
colorstringprimaryColor the filled cells ramp toward across five levels.
weekStartsOn0 | 10First day of the week: 0 for Sunday or 1 for Monday.
cellSizenumber12Size of each day cell in pixels.
gapnumber3Spacing between cells in pixels.
renderTooltip(date: Date, value: number) => string—Custom tooltip text for a cell. Default is `"<value> · <ISO date>"`.

Examples

Daily activity

CalendarHeatmap
ImportTSX
import { CalendarHeatmap } from "@solarius/onset";
import type { CalendarHeatmapValue } from "@solarius/onset";