feat(statistics-deck): Week view (Room, Desk, Laptop) #135

Closed
opened 2026-09-26 11:29:17 +00:00 by gabogg · 0 comments
Owner

Blocked by: #133

Part of the statistics deck UI (accepted RFC, #80). This issue is the Week view in its three profiles. The shell (#133) provides the frame, top bar, picker, keyboard and marker helpers.

Content (RFC §4)

KPIs, most important first:

  1. Visitors, vs the same week last year;
  2. vs the previous week;
  3. daily average;
  4. weekend share (Saturday and Sunday business days);
  5. busiest day;
  6. highest peak (people inside).

Graphs, most important first:

  1. Visitors by day vs the previous week and last year;
  2. Day × hour intensity (heatmap);
  3. Average visit (Mean Dwell) by day;
  4. Entrance share.

Data

  • GET /api/statistics/periods/week/{monday}/summary: the KPIs.
  • GET /api/statistics/timeseries/daily: once for the week, once for the previous week and once for the same ISO week last year. The day-by-day graph and dwell by day come from here.
  • The daily series with bucket=hour feeds the heatmap. Its per-hour gap_estimated marks the cells.
  • GET /api/statistics/periods/week/{monday}/entrances: entrance share.

The week label is the date range, with the ISO week number shown small.

Week-view marker

  • Per-day bars and points: a dashed amber outline for Estimate days, grey hatching for Unreliable days (the day classification comes from the daily rows' excluded, trusted, gap_estimated and has_data, via the shell helper).
  • Heatmap cells of gap hours are hatched.

Profiles

Room shows 6 KPIs and 4–5 graphs, Desk 4 KPIs and 3 graphs, Laptop 3 KPIs and 1 graph. Each smaller profile keeps the top of the ranking below (KPIs and graphs are listed most important first). Each profile is its own layout, not a crop (RFC §3.3), and follows the zero-scroll rule and row splits from the shell.

Rules that apply to every figure

  • Comparisons: the previous period first; last year only when it has data. A missing reference shows "—" with its reason, never 0%. Partial periods compare by daily average only when the route returns basis: DAILY_AVERAGE.
  • Data-quality marker (RFC §4.1): totals and averages include marked days. Records come from the route, which skips Unreliable days (#129). Mark graphs with the shell's shared Estimate / Unreliable styles. No per-KPI marks, and no confidence margins.
  • Holidays are marked on per-day graphs. Closed Days are shown as closed, not as missing.
  • All copy goes through i18n (es/en).

Acceptance

  • All three profiles render from live routes with no scroll at 1920×1080 and 1920×960.
  • A partial week shows its covered-day count, and compares by daily average or shows "—" with PARTIAL_PERIOD.
  • An excluded busiest day is never shown as the busiest day, and the week total still includes it.
  • Frontend tests cover the data mapping, the three-series alignment by weekday, and the marker cases.

Depends on #133 and #129. Refs #80.

🤖 Generated with Claude Code

Blocked by: #133 Part of the statistics deck UI (accepted RFC, #80). This issue is the **Week** view in its three profiles. The shell (#133) provides the frame, top bar, picker, keyboard and marker helpers. ## Content (RFC §4) **KPIs, most important first:** 1. Visitors, vs the same week last year; 2. vs the previous week; 3. daily average; 4. weekend share (Saturday and Sunday business days); 5. busiest day; 6. highest peak (people inside). **Graphs, most important first:** 1. Visitors by day vs the previous week and last year; 2. Day × hour intensity (heatmap); 3. Average visit (Mean Dwell) by day; 4. Entrance share. ## Data - `GET /api/statistics/periods/week/{monday}/summary`: the KPIs. - `GET /api/statistics/timeseries/daily`: once for the week, once for the previous week and once for the same ISO week last year. The day-by-day graph and dwell by day come from here. - The daily series with `bucket=hour` feeds the heatmap. Its per-hour `gap_estimated` marks the cells. - `GET /api/statistics/periods/week/{monday}/entrances`: entrance share. The week label is the date range, with the ISO week number shown small. ## Week-view marker - Per-day bars and points: a dashed amber outline for Estimate days, grey hatching for Unreliable days (the day classification comes from the daily rows' `excluded`, `trusted`, `gap_estimated` and `has_data`, via the shell helper). - Heatmap cells of gap hours are hatched. ## Profiles Room shows 6 KPIs and 4–5 graphs, Desk 4 KPIs and 3 graphs, Laptop 3 KPIs and 1 graph. Each smaller profile keeps the top of the ranking below (KPIs and graphs are listed most important first). Each profile is its own layout, not a crop (RFC §3.3), and follows the zero-scroll rule and row splits from the shell. ## Rules that apply to every figure - Comparisons: the previous period first; last year only when it has data. A missing reference shows "—" with its `reason`, never 0%. Partial periods compare by daily average only when the route returns `basis: DAILY_AVERAGE`. - Data-quality marker (RFC §4.1): totals and averages include marked days. Records come from the route, which skips Unreliable days (#129). Mark graphs with the shell's shared Estimate / Unreliable styles. No per-KPI marks, and no confidence margins. - Holidays are marked on per-day graphs. Closed Days are shown as closed, not as missing. - All copy goes through i18n (es/en). ## Acceptance - All three profiles render from live routes with no scroll at 1920×1080 and 1920×960. - A partial week shows its covered-day count, and compares by daily average or shows "—" with `PARTIAL_PERIOD`. - An excluded busiest day is never shown as the busiest day, and the week total still includes it. - Frontend tests cover the data mapping, the three-series alignment by weekday, and the marker cases. Depends on #133 and #129. Refs #80. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#135
No description provided.