Ivy.Widgets.ActivityHeatmap
1.3.21
dotnet add package Ivy.Widgets.ActivityHeatmap --version 1.3.21
NuGet\Install-Package Ivy.Widgets.ActivityHeatmap -Version 1.3.21
<PackageReference Include="Ivy.Widgets.ActivityHeatmap" Version="1.3.21" />
<PackageVersion Include="Ivy.Widgets.ActivityHeatmap" Version="1.3.21" />
<PackageReference Include="Ivy.Widgets.ActivityHeatmap" />
paket add Ivy.Widgets.ActivityHeatmap --version 1.3.21
#r "nuget: Ivy.Widgets.ActivityHeatmap, 1.3.21"
#:package Ivy.Widgets.ActivityHeatmap@1.3.21
#addin nuget:?package=Ivy.Widgets.ActivityHeatmap&version=1.3.21
#tool nuget:?package=Ivy.Widgets.ActivityHeatmap&version=1.3.21
Ivy.Widgets.ActivityHeatmap
GitHub-style activity heatmap widget for Ivy Framework. Renders an activity graph grid, either day-by-day (52-week × 7-day) or hour-by-hour.
Usage
The recommended way to build a heatmap is the ToActivityHeatmap() builder, which projects any
IEnumerable<T> / IQueryable<T> into the grid using a dimension (the date/time axis) and a
measure (the aggregated value per cell).
using Ivy.Widgets.ActivityHeatmap;
public record RepoStats(DateOnly Date, DateTime Timestamp, int Stars, int Downloads);
public class ActivityHeatmapDemo : ViewBase
{
public override object Build()
{
var repoService = UseService<IMyRepoService>();
var dailyStats = repoService.GetDailyStats().ToList();
return dailyStats.ToActivityHeatmap(
dimension: e => e.Date,
measure: e => e.Downloads);
}
}
Values are summed per cell. The measure supports int, long, float, double, decimal, and
their nullable variants. To count events per cell, use a constant measure such as measure: _ => 1.
For a custom aggregator, call .Measure(name, q => ...) on the returned builder.
Daily vs. hourly intervals
The Interval controls whether each cell represents a day or an hour:
ActivityInterval.Daily— a 52-week × 7-day grid (GitHub contributions style).ActivityInterval.Hourly— an hour-by-hour grid.
If you don't set Interval explicitly, the builder auto-detects it: when the dimension values carry
a non-zero time component, it uses Hourly; otherwise Daily. Set it explicitly with .Interval(...)
to override.
Low-level widget
You can also construct the widget directly and supply pre-aggregated data. Each Activity should be
unique per cell (one entry per day, or per day+hour for hourly):
var data = new[]
{
new Activity { Date = DateOnly.FromDateTime(DateTime.Today), Count = 5 },
};
new ActivityHeatmap()
.Data(data)
.ColorScheme(Colors.Green)
.OnDayClick(day => Console.WriteLine($"Clicked {day.Date}: {day.Count}"));
Builder API
The builder (ToActivityHeatmap()) exposes the configuration below in addition to the widget props.
| Method | Description |
|---|---|
ToActivityHeatmap(dimension, measure) |
Projects data into the grid; sums the measure per cell. |
Measure(name, aggregator) |
Overrides the default sum with a custom pivot aggregator. name is used as the value label. |
Interval(ActivityInterval) |
Forces Daily or Hourly; otherwise auto-detected from the data. |
ColorScheme(Colors) |
See props below. |
ShowTooltip(bool) / ShowMonthLabels(bool) / ShowDayLabels(bool) |
See props below. |
StartDate(DateOnly?) / EndDate(DateOnly?) |
See props below. |
OnDayClick(...) |
See events below. |
Props
These props apply to the ActivityHeatmap widget (the builder forwards most of them).
| Prop | Type | Default | Description |
|---|---|---|---|
Data |
Activity[] |
[] |
Daily/hourly activity data (one entry per cell) |
ColorScheme |
Ivy.Colors |
Colors.Primary |
Color scheme; supports semantic, chromatic, and neutral color tokens |
ShowTooltip |
bool |
true |
Show date/count tooltip on hover |
ShowMonthLabels |
bool |
true |
Show month labels along the top |
ShowDayLabels |
bool |
true |
Show Mon/Wed/Fri labels on the left |
Interval |
ActivityInterval |
Daily |
Daily or Hourly cell granularity |
ValueLabel |
string? |
null |
Label used for the value in the tooltip; when unset the tooltip falls back to "Count" (the builder sets this to the measure name) |
StartDate |
DateOnly? |
null |
Pins the start of the visible range; when set, overrides the minimum date derived from Data |
EndDate |
DateOnly? |
null |
Pins the end of the visible range; when set, overrides the maximum date derived from Data |
If both StartDate and EndDate are set and EndDate is before StartDate, the widget treats the range in chronological order (same as swapping the two values), so the grid still renders instead of collapsing to zero weeks.
Activity
Activity is the per-cell data record:
| Field | Type | Description |
|---|---|---|
Date |
DateOnly |
The day this cell represents |
Hour |
int? |
The hour (0–23) for hourly intervals; null for daily |
Count |
int |
The aggregated value for the cell |
Data Constraints
- Duplicate cells in
Dataare not supported — provide at most oneActivityperDateOnly(daily) or perDateOnly+Hour(hourly). - If your source can produce duplicates, aggregate them first (for example by summing counts per cell) before passing data to
ActivityHeatmap. TheToActivityHeatmap()builder handles this aggregation for you.
Events
| Event | Args | Description |
|---|---|---|
OnDayClick |
Activity |
Fired when user clicks a cell |
Development
Building
Install frontend dependencies:
cd frontend pnpm installBuild the frontend:
pnpm buildBuild the widget (repository root, or any path that builds
Ivy.Widgets.ActivityHeatmap.csproj):dotnet buildThe widget project uses Ivy’s external-widget MSBuild targets:
dotnet buildrunsvp install/vp buildinfrontendwhen needed, so after dependencies exist you can rely on that instead of repeating steps 1–2.
Frontend watch
While changing React/TypeScript under frontend/src, run a watch build in another terminal:
cd frontend
pnpm exec vp build --watch
Sample app
cd .samples
dotnet run
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Ivy (>= 1.3.21)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.21 | 363 | 8/18/2026 |
| 1.3.20 | 111 | 8/13/2026 |
| 1.3.17 | 155 | 8/2/2026 |
| 1.3.16 | 530 | 7/28/2026 |
| 1.3.15 | 164 | 7/26/2026 |
| 1.3.13 | 157 | 7/25/2026 |
| 1.3.12 | 111 | 7/23/2026 |
| 1.3.11 | 125 | 7/23/2026 |
| 1.3.10 | 109 | 7/18/2026 |
| 1.3.9 | 112 | 7/14/2026 |
| 1.3.8 | 234 | 7/10/2026 |
| 1.3.7 | 124 | 7/10/2026 |
| 1.3.6 | 200 | 7/3/2026 |
| 1.3.5 | 141 | 7/3/2026 |
| 1.3.4 | 148 | 7/2/2026 |
| 1.3.3 | 119 | 7/2/2026 |
| 1.3.2 | 114 | 7/2/2026 |
| 1.3.1 | 164 | 6/29/2026 |
| 1.3.0 | 117 | 6/29/2026 |
| 1.2.72 | 148 | 6/27/2026 |