ngwr 16.7.0 → 16.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/charts/donut-chart/styles/_index.scss +9 -3
  2. package/charts/meter-group/styles/_index.scss +8 -1
  3. package/charts/sparkline/styles/_index.scss +6 -3
  4. package/checkbox/styles/_index.scss +4 -0
  5. package/command-palette/styles/_index.scss +10 -0
  6. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -1
  7. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  8. package/fesm2022/ngwr-charts-core.mjs +17 -0
  9. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  10. package/fesm2022/ngwr-charts-donut-chart-testing.mjs +27 -0
  11. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  12. package/fesm2022/ngwr-charts-donut-chart.mjs +54 -6
  13. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  14. package/fesm2022/ngwr-charts-meter-group-testing.mjs +27 -0
  15. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  16. package/fesm2022/ngwr-charts-meter-group.mjs +54 -6
  17. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  18. package/fesm2022/ngwr-charts-sparkline-testing.mjs +27 -0
  19. package/fesm2022/ngwr-charts-sparkline-testing.mjs.map +1 -1
  20. package/fesm2022/ngwr-charts-sparkline.mjs +45 -4
  21. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  22. package/fesm2022/ngwr-checkbox.mjs +38 -3
  23. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  24. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  25. package/fesm2022/ngwr-color-picker.mjs +4 -3
  26. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  27. package/fesm2022/ngwr-command-palette.mjs +39 -19
  28. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  29. package/fesm2022/ngwr-context-menu.mjs +7 -2
  30. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  31. package/fesm2022/ngwr-date-picker.mjs +1 -0
  32. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  33. package/fesm2022/ngwr-dialog.mjs +10 -7
  34. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  35. package/fesm2022/ngwr-drawer.mjs +14 -8
  36. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  37. package/fesm2022/ngwr-file-upload.mjs +2 -2
  38. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  39. package/fesm2022/ngwr-i18n-ar.mjs +9 -2
  40. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  41. package/fesm2022/ngwr-i18n-cs.mjs +9 -2
  42. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  43. package/fesm2022/ngwr-i18n-de.mjs +9 -2
  44. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  45. package/fesm2022/ngwr-i18n-en.mjs +9 -2
  46. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  47. package/fesm2022/ngwr-i18n-es.mjs +9 -2
  48. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  49. package/fesm2022/ngwr-i18n-fr.mjs +9 -2
  50. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  51. package/fesm2022/ngwr-i18n-he.mjs +9 -2
  52. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  53. package/fesm2022/ngwr-i18n-hi.mjs +9 -2
  54. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  55. package/fesm2022/ngwr-i18n-id.mjs +9 -2
  56. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  57. package/fesm2022/ngwr-i18n-it.mjs +9 -2
  58. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  59. package/fesm2022/ngwr-i18n-ja.mjs +9 -2
  60. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  61. package/fesm2022/ngwr-i18n-kk.mjs +9 -2
  62. package/fesm2022/ngwr-i18n-kk.mjs.map +1 -1
  63. package/fesm2022/ngwr-i18n-ko.mjs +9 -2
  64. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  65. package/fesm2022/ngwr-i18n-nl.mjs +9 -2
  66. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  67. package/fesm2022/ngwr-i18n-pl.mjs +9 -2
  68. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  69. package/fesm2022/ngwr-i18n-pt.mjs +9 -2
  70. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  71. package/fesm2022/ngwr-i18n-ru.mjs +9 -2
  72. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  73. package/fesm2022/ngwr-i18n-sv.mjs +9 -2
  74. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  75. package/fesm2022/ngwr-i18n-tr.mjs +9 -2
  76. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  77. package/fesm2022/ngwr-i18n-uk.mjs +9 -2
  78. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  79. package/fesm2022/ngwr-i18n-vi.mjs +9 -2
  80. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  81. package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -2
  82. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  83. package/fesm2022/ngwr-i18n-zh.mjs +9 -2
  84. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  85. package/fesm2022/ngwr-input-number.mjs +33 -10
  86. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  87. package/fesm2022/ngwr-input-otp.mjs +24 -10
  88. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  89. package/fesm2022/ngwr-input.mjs +2 -2
  90. package/fesm2022/ngwr-input.mjs.map +1 -1
  91. package/fesm2022/ngwr-lightbox.mjs +5 -3
  92. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  93. package/fesm2022/ngwr-overlay.mjs +51 -2
  94. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  95. package/fesm2022/ngwr-popconfirm.mjs +2 -2
  96. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  97. package/fesm2022/ngwr-popover.mjs +11 -1
  98. package/fesm2022/ngwr-popover.mjs.map +1 -1
  99. package/fesm2022/ngwr-scroll.mjs +39 -16
  100. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  101. package/fesm2022/ngwr-slider.mjs +22 -17
  102. package/fesm2022/ngwr-slider.mjs.map +1 -1
  103. package/fesm2022/ngwr-switch.mjs +33 -3
  104. package/fesm2022/ngwr-switch.mjs.map +1 -1
  105. package/fesm2022/ngwr-table.mjs +17 -4
  106. package/fesm2022/ngwr-table.mjs.map +1 -1
  107. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  108. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  109. package/fesm2022/ngwr-tour.mjs +8 -3
  110. package/fesm2022/ngwr-tour.mjs.map +1 -1
  111. package/fesm2022/ngwr-version.mjs +1 -1
  112. package/fesm2022/ngwr-version.mjs.map +1 -1
  113. package/i18n/ar.json +9 -2
  114. package/i18n/cs.json +9 -2
  115. package/i18n/de.json +9 -2
  116. package/i18n/en.json +9 -2
  117. package/i18n/es.json +9 -2
  118. package/i18n/fr.json +9 -2
  119. package/i18n/he.json +9 -2
  120. package/i18n/hi.json +9 -2
  121. package/i18n/id.json +9 -2
  122. package/i18n/it.json +9 -2
  123. package/i18n/ja.json +9 -2
  124. package/i18n/kk.json +9 -2
  125. package/i18n/ko.json +9 -2
  126. package/i18n/nl.json +9 -2
  127. package/i18n/pl.json +9 -2
  128. package/i18n/pt.json +9 -2
  129. package/i18n/ru.json +9 -2
  130. package/i18n/sv.json +9 -2
  131. package/i18n/tr.json +9 -2
  132. package/i18n/uk.json +9 -2
  133. package/i18n/vi.json +9 -2
  134. package/i18n/zh-TW.json +9 -2
  135. package/i18n/zh.json +9 -2
  136. package/llms-full.txt +4 -4
  137. package/package.json +1 -1
  138. package/radio/styles/_index.scss +4 -0
  139. package/schematics/use/rule.js +1 -0
  140. package/schematics/use/symbol-map.json +1 -0
  141. package/switch/styles/_index.scss +4 -0
  142. package/table/styles/_index.scss +7 -0
  143. package/tour/styles/_index.scss +11 -7
  144. package/types/ngwr-charts-donut-chart-testing.d.ts +32 -3
  145. package/types/ngwr-charts-donut-chart.d.ts +45 -6
  146. package/types/ngwr-charts-meter-group-testing.d.ts +29 -1
  147. package/types/ngwr-charts-meter-group.d.ts +43 -4
  148. package/types/ngwr-charts-sparkline-testing.d.ts +32 -2
  149. package/types/ngwr-charts-sparkline.d.ts +42 -3
  150. package/types/ngwr-checkbox.d.ts +14 -0
  151. package/types/ngwr-color-picker-testing.d.ts +1 -1
  152. package/types/ngwr-command-palette.d.ts +2 -1
  153. package/types/ngwr-date-picker.d.ts +8 -2
  154. package/types/ngwr-dialog.d.ts +11 -6
  155. package/types/ngwr-drawer.d.ts +12 -4
  156. package/types/ngwr-file-upload.d.ts +1 -1
  157. package/types/ngwr-input-number.d.ts +14 -2
  158. package/types/ngwr-input-otp.d.ts +2 -0
  159. package/types/ngwr-lightbox.d.ts +1 -0
  160. package/types/ngwr-overlay.d.ts +20 -1
  161. package/types/ngwr-popover.d.ts +3 -3
  162. package/types/ngwr-scroll.d.ts +11 -2
  163. package/types/ngwr-slider.d.ts +3 -1
  164. package/types/ngwr-switch.d.ts +13 -0
  165. package/types/ngwr-table.d.ts +1 -0
  166. package/types/ngwr-tabs-router.d.ts +3 -4
  167. package/types/ngwr-version.d.ts +1 -1
@@ -4,9 +4,10 @@
4
4
  // Styles for the entry points this component's own markup renders. The legend is a
5
5
  // `ul[wr-chart-legend]`, so `@use 'ngwr/charts/donut-chart'` alone draws it styled.
6
6
  @use '../../chart-legend/styles' as chart-legend-styles; // WrChartLegend
7
- // The chart theme every hook below defaults to (`--wr-chart-*`), the hover-dim rule and
8
- // the empty / loading / error message.
9
- @use '../../core/styles' as core-styles; // WrChartState
7
+ // The chart theme every hook below defaults to (`--wr-chart-*`), the hover-dim rule, the
8
+ // empty / loading / error message, and the `<wr-chart-table>` that `dataTable` renders
9
+ // beside the drawing, which its own sheet clips out of sight.
10
+ @use '../../core/styles' as core-styles; // WrChartTable, WrChartState
10
11
  @include theme.loaded('charts/donut-chart');
11
12
 
12
13
  .wr-donut-chart {
@@ -24,6 +25,11 @@
24
25
  display: inline-flex;
25
26
  flex-direction: column;
26
27
  align-items: center;
28
+ // The containing block of the out-of-flow `dataTable` copy, as on every chart that
29
+ // renders it: a static host lets that 1px box resolve against an ancestor outside the
30
+ // chart and keep its place in an unpositioned scroller's content. No z-index, so no
31
+ // stacking context.
32
+ position: relative;
27
33
  // No `gap`: the room between the drawing and the legend is the legend's own margin, on
28
34
  // whichever side `legendPosition` puts it. See `&__legend`.
29
35
  font-family: var(--wr-donut-chart-font-family);
@@ -4,7 +4,9 @@
4
4
  // Styles for the entry points this component's own markup renders. The legend is a
5
5
  // `ul[wr-chart-legend]`, so `@use 'ngwr/charts/meter-group'` alone draws it styled.
6
6
  @use '../../chart-legend/styles' as chart-legend-styles; // WrChartLegend
7
- @use '../../core/styles' as core-styles; // WrChartState
7
+ // With `dataTable`, the figures render as a `<wr-chart-table>` beside the bar, which its
8
+ // own sheet clips out of sight.
9
+ @use '../../core/styles' as core-styles; // WrChartTable, WrChartState
8
10
  @include theme.loaded('charts/meter-group');
9
11
 
10
12
  .wr-meter-group {
@@ -31,6 +33,11 @@
31
33
 
32
34
  display: flex;
33
35
  flex-direction: column;
36
+ // The containing block of the out-of-flow `dataTable` copy, as on every chart that
37
+ // renders it: a static host lets that 1px box resolve against an ancestor outside the
38
+ // chart and keep its place in an unpositioned scroller's content. No z-index, so no
39
+ // stacking context.
40
+ position: relative;
34
41
  font-family: var(--wr-meter-group-font-family);
35
42
  color: var(--wr-meter-group-color);
36
43
 
@@ -1,8 +1,10 @@
1
1
  @use '../../../popover/styles'; // the `.wr-tooltip` chip the hover tooltip renders into
2
2
  @use '../../../theme/styles/loaded' as theme;
3
3
 
4
- // The chart theme the line's colour and the marker's ring default to.
5
- @use '../../core/styles' as core-styles;
4
+ // The chart theme the line's colour and the marker's ring default to, and the
5
+ // `<wr-chart-table>` that `dataTable` renders beside the drawing, which its own sheet
6
+ // clips out of sight.
7
+ @use '../../core/styles' as core-styles; // WrChartTable
6
8
  @include theme.loaded('charts/sparkline');
7
9
 
8
10
  .wr-sparkline {
@@ -12,7 +14,8 @@
12
14
  --wr-sparkline-marker-ring: var(--wr-chart-separator);
13
15
 
14
16
  display: inline-block;
15
- // The hover marker is placed from this box's padding edge, measured off the drawing.
17
+ // The hover marker is placed from this box's padding edge, measured off the drawing. It
18
+ // is also the containing block of the out-of-flow `dataTable` copy.
16
19
  position: relative;
17
20
  line-height: 0;
18
21
 
@@ -27,6 +27,10 @@
27
27
  --wr-checkbox-mark: transparent;
28
28
  --wr-checkbox-color: var(--wr-color-on-surface);
29
29
 
30
+ // The containing block of the visually hidden input: without it the input is
31
+ // placed against a positioned ancestor outside any scroller between them, and
32
+ // focusing it scrolls that ancestor.
33
+ position: relative;
30
34
  display: inline-flex;
31
35
  vertical-align: middle;
32
36
  color: var(--wr-checkbox-color);
@@ -23,9 +23,19 @@
23
23
  --wr-command-palette-padding-bottom: var(--wr-space-lg);
24
24
  --wr-command-palette-font-family: var(--wr-font-family-base);
25
25
 
26
+ // A `popover="manual"` host: the UA sheet shrinks it to its content, centres
27
+ // it and paints a border, a background and a `Canvas` colour.
26
28
  position: fixed;
27
29
  inset: 0;
28
30
  z-index: 1000;
31
+ box-sizing: border-box;
32
+ width: 100%;
33
+ height: 100%;
34
+ margin: 0;
35
+ border: 0;
36
+ overflow: visible;
37
+ background: none;
38
+ color: inherit;
29
39
  display: flex;
30
40
  align-items: flex-start;
31
41
  justify-content: center;
@@ -137,7 +137,9 @@ var WrCalendarHeatmap = class WrCalendarHeatmap {
137
137
  const firstIso = toIso(from);
138
138
  const lastIso = toIso(end);
139
139
  const firstTime = start.getTime();
140
- const lastTime = end.getTime() + 864e5;
140
+ const after = new Date(end);
141
+ after.setDate(end.getDate() + 1);
142
+ const lastTime = after.getTime();
141
143
  const map = /* @__PURE__ */ new Map();
142
144
  let max = 0;
143
145
  for (const d of data) {
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-charts-calendar-heatmap.mjs","names":[],"sources":["../../../projects/lib/charts/calendar-heatmap/calendar-heatmap.ts","../../../projects/lib/charts/calendar-heatmap/calendar-heatmap.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartScale, type WrChartLegendPosition } from 'ngwr/charts/chart-legend';\nimport { WrChartState, WrChartTable, type WrChartTableData, useChartNumbers, useChartState } from 'ngwr/charts/core';\nimport { wrDateLocale } from 'ngwr/date';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip, wrCoerceChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrHeatmapDatum } from './types';\n\ninterface Cell {\n readonly iso: string;\n /** The day as the reader's locale writes it — see `cellTitle`. */\n readonly date: Date;\n readonly value: number;\n readonly intensity: number;\n /** Its step on the scale: 0 for a day of nothing, 1 to 5 for a day of something. */\n readonly level: number;\n /** The paint of its level, written on the square. */\n readonly paint: string;\n readonly week: number;\n readonly day: number;\n}\n\n/**\n * The steps of the sequential scale a day of something is painted with, lowest first: the\n * chart's own hooks, which the stylesheet points at `--wr-chart-seq-1` to `-5`. Written\n * out, so each hook is read by name.\n */\nconst STEPS = [\n 'var(--wr-calendar-heatmap-step-1)',\n 'var(--wr-calendar-heatmap-step-2)',\n 'var(--wr-calendar-heatmap-step-3)',\n 'var(--wr-calendar-heatmap-step-4)',\n 'var(--wr-calendar-heatmap-step-5)',\n] as const;\n\n/** A day in the form the data usually gives it, which sorts as a date does: `2026-03-09`. */\nconst ISO_DAY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\n/** Every `Intl.DateTimeFormat` the calendars have asked for, by locale and options. */\nconst DATE_FORMATS = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * The `Intl.DateTimeFormat` for `locale` and `options`, built once for the page: every\n * calendar built four of its own, 0.4 ms an instance, and a formatter holds no state.\n */\nfunction dateFormat(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const key = `${locale}|${JSON.stringify(options)}`;\n let format = DATE_FORMATS.get(key);\n if (!format) {\n format = new Intl.DateTimeFormat(locale, options);\n DATE_FORMATS.set(key, format);\n }\n return format;\n}\n\nfunction toIso(d: Date): string {\n const y = d.getFullYear();\n const m = String(d.getMonth() + 1).padStart(2, '0');\n const day = String(d.getDate()).padStart(2, '0');\n return `${y}-${m}-${day}`;\n}\n\nfunction parseInput(value: string | Date): Date {\n return value instanceof Date ? new Date(value) : new Date(`${value}T00:00:00`);\n}\n\n/** Which rows carry a weekday label: three of seven, or they do not fit. */\nconst LABELLED_ROWS = new Set([1, 3, 5]);\n\n/**\n * A day's contribution, with anything non-finite read as `0`.\n *\n * One `NaN` used to flatten the entire rendered window rather than its own day:\n * `Math.max(a, NaN)` is `NaN`, so the data set's maximum became `NaN`, `max > 0`\n * was false, and every cell fell to intensity 0 — a map that reads as a stretch\n * with no activity at all. The bad day also printed the literal text `NaN` in its\n * `title`.\n */\nfunction amount(raw: number): number {\n return Number.isFinite(raw) ? raw : 0;\n}\n\n/**\n * GitHub-style year-grid heatmap. One column per ISO week, one row per\n * weekday — cells coloured by `value` relative to the largest day drawn.\n *\n * **The scale.** A day of something takes one of five levels by its share of the largest\n * day, painted with the chart theme's sequential scale: `--wr-chart-seq-1`, a tint of the\n * first palette colour, up to `--wr-chart-seq-5`, the colour itself. `color` steps the same\n * five from a colour of the chart's own. A day of nothing is the theme's track, and every\n * square carries a faint edge, so the lowest level still reads on a dark surface. A scale\n * key under the grid shows the levels from 0 to the largest day (`showLegend`,\n * `legendPosition`).\n *\n * **Empty, loading, error.** With no data the grid keeps its squares and says \"No data\"\n * under them; `loading` and `error` put their own message there.\n *\n * **A year does not reflow.** Its 53 columns are a fixed cell size, so in a container\n * narrower than the grid the host scrolls sideways. While it does, it is a tab stop with\n * the shared focus ring, so the keyboard can scroll it too — WebKit makes no scroller\n * focusable by itself — and it opens on the inline END, the newest weeks, rather than on\n * the oldest. The stop carries no name of its own: focus lands on the grid's picture,\n * named by `ariaLabel`.\n *\n * **What a screen reader gets.** The grid is one named `role=\"img\"` and every square is\n * hidden, so the days' values are not in text anywhere unless `dataTable` renders them;\n * without it, say what the year shows in `ariaLabel`.\n *\n * @example\n * ```html\n * <wr-calendar-heatmap [data]=\"contributions\" />\n * <wr-calendar-heatmap [data]=\"data\" [endDate]=\"today\" [weeks]=\"26\" color=\"#10b981\" />\n * ```\n *\n * @see https://ngwr.dev/charts/calendar-heatmap\n */\n@Component({\n selector: 'wr-calendar-heatmap',\n templateUrl: './calendar-heatmap.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n // `wr-chart--legend`: the shared rule that keeps the scale key's room from the grid.\n class: 'wr-calendar-heatmap wr-chart--legend',\n // A colour of the chart's own for the highest level, which the stylesheet then steps\n // the lower ones from. Without one the levels are the chart theme's sequential scale.\n '[class.wr-calendar-heatmap--tinted]': 'color() !== null',\n '[style.--wr-calendar-heatmap-scale-color]': 'color()',\n // A tab stop only while the year is wider than its container: see `scrollable`.\n '[attr.tabindex]': 'scrollable() ? 0 : null',\n },\n imports: [WrChartScale, WrChartState, WrChartTable],\n})\nexport class WrCalendarHeatmap {\n /**\n * One entry per day — `{ date, value }`. Days you pass nothing for render as\n * empty cells, so a sparse array is the normal shape rather than a gap. Rows outside\n * the weeks drawn are skipped, and do not move the scale.\n */\n readonly data = input<readonly WrHeatmapDatum[]>([]);\n\n /**\n * Accessible name of the whole grid. Its cells are bare spans whose `title` a screen\n * reader on a role-less element does not read, so the map used to be several hundred\n * anonymous nodes with no name. Falls back to `calendarHeatmap.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'calendarHeatmap.label', 'Calendar heatmap');\n\n private readonly cellText = useI18nFormatter('calendarHeatmap.cell', '{{date}}: {{count}}');\n\n /**\n * A cell's tooltip, with both halves formatted and the sentence in the catalog.\n *\n * It used to be `` `${cell.iso}: ${cell.value}` `` — a raw ISO date beside an\n * unformatted number, joined by a hard-coded `': '`. Three things were wrong\n * at once and none of them are visible from the template: `2026-09-10` is not\n * how most of the world writes a date, `1234` is not how every locale groups\n * digits (`ar-SA` does not even use these ones), and the separator and order\n * were frozen into a shape a translator could not reach.\n *\n * Both halves go through `Intl`: the date in `WR_DATE_LOCALE`, which the weekday\n * and month labels use too and which follows Angular's `LOCALE_ID` unless\n * `withDates()` pins it, and the count in `LOCALE_ID` itself — or through\n * `valueFormat` — as every chart writes its numbers. The key ships as\n * `{{date}}: {{count}}` everywhere, so nothing reorders today and every locale can.\n */\n protected cellTitle(cell: { readonly date: Date; readonly value: number }): string {\n return this.cellText({ date: this.dateFormat().format(cell.date), count: this.numbers.value(cell.value) });\n }\n\n /**\n * The formatters, built once. They were built per call, and with `tooltip` off\n * the template asks for every square's title on every pass — so each `mousemove`\n * over the grid, which still marks the view for check, built 740 of them: 44,400\n * for 60 moves, measured in dev mode at 907–931ms against 348–358ms with the\n * tooltip on.\n */\n private readonly dateFormat = computed(() => dateFormat(this.locale, { dateStyle: 'medium' }));\n\n /**\n * Every square's `title`, and only while the tooltip is off — the tooltip carries the\n * same sentence, and the browser would open a second copy a moment later. Worked out\n * when the days or the catalog change, not on every pass of the template.\n */\n protected readonly titles = computed(() => (this.tooltip() ? null : this.cells().map(cell => this.cellTitle(cell))));\n\n /** Last day to render. @default today */\n readonly endDate = input<string | Date | null>(null);\n\n /** Number of weeks (columns) to render. @default 53 */\n readonly weeks = input(53, { transform: (v: unknown): number => Math.max(4, coerceNumberProperty(v, 53)) });\n\n /**\n * Cell side in CSS pixels. Twelve with a gap of three reads as a grid of days; the\n * eleven and two it was before 16.5 ran the squares together. @default 12\n */\n readonly cellSize = input(12, { transform: (v: unknown): number => Math.max(4, coerceNumberProperty(v, 12)) });\n\n /** Pixel gap between cells. @default 3 */\n readonly cellGap = input(3, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 3)) });\n\n /**\n * The colour of the highest level: any CSS colour, `var(--wr-…)` included. The four\n * levels under it are stepped from it toward the surface, as the chart theme steps its\n * own scale. `null` paints the levels with the theme's sequential scale,\n * `--wr-chart-seq-1` to `-5`, which an app retints for every chart at once.\n * @default null\n */\n readonly color = input<string | null>(null);\n\n /**\n * Background colour for zero-value days. `null` takes `--wr-calendar-heatmap-empty`,\n * the chart theme's track. @default null\n */\n readonly emptyColor = input<string | null>(null);\n\n /** Show the scale key: the levels from 0 to the largest day. @default true */\n readonly showLegend = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Where the scale key sits: under the grid, over it, or `none` for no key at all. It\n * keeps to the inline end, where the newest weeks are, so it stays in sight while the\n * year scrolls. @default 'bottom'\n */\n readonly legendPosition = input<Exclude<WrChartLegendPosition, 'start' | 'end'>>('bottom');\n\n /**\n * A request for the days is in flight: the grid keeps its squares, all empty, and the\n * loading message sits under them. @default false\n */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The days failed to load: the grid keeps its squares, all empty, with the error\n * message under them. `loading` wins while both are set. @default false\n */\n readonly error = input(false, { transform: coerceBooleanProperty });\n\n /** The message shown with no data. Falls back to `chart.empty`, then `'No data'`. */\n readonly emptyLabel = input<string | null>(null);\n\n /** The message shown while `loading`. Falls back to `chart.loading`, then `'Loading…'`. */\n readonly loadingLabel = input<string | null>(null);\n\n /** The message shown on `error`. Falls back to `chart.error`, then `'Could not load'`. */\n readonly errorLabel = input<string | null>(null);\n\n /** Show the weekday + month labels around the grid. @default true */\n readonly showLabels = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip with the day and its count on hover. It is the sentence the square's\n * `title` carried, so the `title` is written only while this is off — or the browser\n * would open a second copy a moment later.\n *\n * By default the pointer passes under the chip to the chart, so the next section\n * answers at once and the chip closes off the chart; `'hoverable'` lets the pointer\n * rest on the chip instead, as WCAG 1.4.13 asks of a hint. @default true\n */\n readonly tooltip = input<boolean | 'hoverable', unknown>(true, { transform: wrCoerceChartTooltip });\n\n /**\n * Writes each day's count in the tooltip, the `title` and the data table. `null` uses\n * `Intl.NumberFormat` in `LOCALE_ID`.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /**\n * Render the days' values as a table that only assistive technology reaches: a row per\n * week, headed by its dates, and a column per weekday, each day's count written the way\n * the tooltip writes it. A day after the last one drawn is an empty cell.\n *\n * The grid is one named `role=\"img\"`, which hides everything inside it, so without the\n * table the values are nowhere a screen reader can walk. It is rendered beside the grid,\n * clipped to nothing: it takes no room, draws nothing and holds no tab stop.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /** A day's count as the tooltip, the `title` and the data table write it, in `LOCALE_ID`: never compact. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly daysEl = viewChild<ElementRef<HTMLElement>>('days');\n\n private readonly gridEl = viewChild<ElementRef<HTMLElement>>('grid');\n\n /**\n * Whether the year is wider than the host, which then scrolls it — and is a tab stop\n * while it does. `axe`'s `scrollable-region-focusable` named the scroller with no stop\n * at all, and in WebKit, which makes no scroller focusable by itself, a keyboard could\n * not reach the newest weeks. Measured in the browser after render and on every resize;\n * `false` on the server and in jsdom, which lay nothing out.\n */\n protected readonly scrollable = signal(false);\n\n private readonly dateLocale = wrDateLocale();\n\n private get locale(): string {\n return this.dateLocale();\n }\n\n /**\n * Weekday names from the locale rather than a hard-coded English list — the row order is\n * Sunday-first, matching the grid's own alignment, so 7 Jan 2024 (a Sunday) is the\n * reference. Rows without a label stay blank on purpose: seven labels do not fit.\n */\n protected readonly weekdayLabels = computed<readonly string[]>(() => {\n const formatter = dateFormat(this.locale, { weekday: 'short' });\n const sunday = new Date(2024, 0, 7);\n return Array.from({ length: 7 }, (_, row) => {\n if (!LABELLED_ROWS.has(row)) return '';\n const day = new Date(sunday);\n day.setDate(sunday.getDate() + row);\n return formatter.format(day);\n });\n });\n\n private readonly monthNames = computed<readonly string[]>(() => {\n const formatter = dateFormat(this.locale, { month: 'short' });\n return Array.from({ length: 12 }, (_, month) => formatter.format(new Date(2024, month, 15)));\n });\n\n protected readonly cells = computed<readonly Cell[]>(() => {\n const end = this.endDate() ? parseInput(this.endDate()!) : new Date();\n end.setHours(0, 0, 0, 0);\n const weeks = this.weeks();\n // A state shows the grid as its frame: every square empty.\n const data = this.state() && this.state()?.kind !== 'empty' ? [] : this.data();\n\n // Walk backwards from end day; arrange into columns by week, rows by weekday.\n const out: Cell[] = [];\n // Exactly `weeks` columns, the last of them the week `end` falls in, every\n // column starting on a Sunday (matches GitHub).\n //\n // Counted in WEEKS rather than in days. It used to allocate `weeks * 7`\n // days and then align the start back to a Sunday, which adds up to six\n // more — so any alignment at all produced one column more than asked for:\n // 54 for the default 53, with `--wr-calendar-heatmap-columns` reporting 54 and a\n // container sized from `weeks * (cellSize + cellGap)` one column short.\n const start = new Date(end);\n start.setDate(end.getDate() - end.getDay() - (weeks - 1) * 7);\n\n // Build value lookup, from the rows inside the window only. Ten years of days handed\n // to a year's calendar parsed every one of them, 19 ms for ten thousand rows, to keep\n // 371. A day written `2026-03-09` sorts as a date does, so one outside the window is\n // told by a string compare and never parsed; a week of margin at the start keeps a\n // day the calendar rolls over (`2026-02-31` is 3 March) where it was. A `Date` is\n // told by its time. The largest day is taken over the rows kept.\n const from = new Date(start);\n from.setDate(start.getDate() - 7);\n const firstIso = toIso(from);\n const lastIso = toIso(end);\n const firstTime = start.getTime();\n const lastTime = end.getTime() + 86_400_000;\n const map = new Map<string, number>();\n let max = 0;\n for (const d of data) {\n const { date } = d;\n if (typeof date === 'string') {\n if (ISO_DAY.test(date) && (date < firstIso || date > lastIso)) continue;\n } else {\n const time = date.getTime();\n if (time < firstTime || time >= lastTime) continue;\n }\n const iso = toIso(parseInput(date));\n const sum = (map.get(iso) ?? 0) + amount(d.value);\n map.set(iso, sum);\n }\n const startIso = toIso(start);\n for (const [iso, sum] of map) if (iso >= startIso && iso <= lastIso && sum > max) max = sum;\n\n const empty = this.emptyColor() ?? 'var(--wr-calendar-heatmap-empty)';\n const cursor = new Date(start);\n let column = 0;\n while (cursor <= end) {\n for (let row = 0; row < 7; row++) {\n // Stop at `end`. The inner loop always walks a whole week, so once the\n // cursor crossed `end` mid-week it kept going to Saturday — up to six\n // days AFTER the last day to render, drawn as ordinary `value: 0`\n // squares and indistinguishable from a past day of no activity. With\n // the default that is today plus five future days.\n if (cursor > end) break;\n const iso = toIso(cursor);\n const value = map.get(iso) ?? 0;\n // Clamped at the BOTTOM as well as the top. A negative value produced a\n // negative intensity, which is not zero — so `colorFor` painted it in\n // the accent colour and `opacityFor` put it in the lightest band,\n // rendering a day of negative activity exactly like a day of light\n // activity, and unlike the empty day it should have matched. The scale\n // has no negative half; the honest floor is \"nothing\".\n const intensity = max > 0 ? Math.min(1, Math.max(0, value / max)) : 0;\n // Five levels over the days of something, the largest day on the fifth; a day of\n // nothing has none, and is painted as the track.\n const level = intensity === 0 ? 0 : Math.min(STEPS.length, Math.ceil(intensity * STEPS.length - 1e-9));\n const paint = level === 0 ? empty : STEPS[level - 1];\n out.push({ iso, date: new Date(cursor), value, intensity, level, paint, week: column, day: row });\n cursor.setDate(cursor.getDate() + 1);\n }\n column++;\n }\n return out;\n });\n\n /** Every weekday's full name, Sunday first as the rows are: the data table's columns. */\n private readonly weekdayNames = computed<readonly string[]>(() => {\n const formatter = dateFormat(this.locale, { weekday: 'long' });\n return Array.from({ length: 7 }, (_, row) => formatter.format(new Date(2024, 0, 7 + row)));\n });\n\n /**\n * The figures for `dataTable`: the grid's name as the caption, a column per weekday and\n * a row per week, headed by the week's first and last day drawn — `formatRange`, so the\n * locale writes the span its own way — and every day's count as the tooltip writes it.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const range = this.dateFormat();\n const weeks: (Cell | undefined)[][] = [];\n for (const cell of this.cells()) (weeks[cell.week] ??= [])[cell.day] = cell;\n return {\n caption: this.resolvedAriaLabel(),\n columns: this.weekdayNames(),\n groups: [\n {\n rows: weeks.map(days => {\n const drawn = days.filter((day): day is Cell => day !== undefined);\n return {\n header: range.formatRange(drawn[0].date, drawn[drawn.length - 1].date),\n cells: Array.from({ length: 7 }, (_, d) => (days[d] ? this.numbers.value(days[d].value) : '')),\n };\n }),\n },\n ],\n };\n });\n\n protected readonly monthLabels = computed(() => {\n // Pull the first cell of each visible month → render a label centered\n // over its column.\n const cells = this.cells();\n const seen = new Set<string>();\n // Off the date each cell already carries: its ISO string was parsed again here, twice\n // for a month's first day, 371 string parses a pass.\n return cells\n .filter(({ date }) => {\n if (date.getDate() !== 1) return false;\n const key = `${date.getFullYear()}-${date.getMonth()}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n })\n .map(cell => ({ label: this.monthNames()[cell.date.getMonth()], week: cell.week }));\n });\n\n /** The largest day drawn, which the highest level stands for; 0 with no day of something. */\n private readonly peak = computed(() => this.cells().reduce((max, cell) => Math.max(max, cell.value), 0));\n\n /**\n * The scale key: a day of nothing, then the five levels, between 0 and the largest day\n * as the tooltip writes a count. With no day of something it keys the empty square alone.\n */\n protected readonly legend = computed(() => {\n const peak = this.peak();\n const empty = this.emptyColor() ?? 'var(--wr-calendar-heatmap-empty)';\n return {\n min: this.numbers.value(0),\n max: peak > 0 ? this.numbers.value(peak) : null,\n steps: peak > 0 ? [empty, ...STEPS] : [empty],\n };\n });\n\n /** Whether the chart draws its scale key: with `showLegend`, unless `legendPosition` is `none`. */\n protected readonly legendShown = computed(() => this.showLegend() && this.legendPosition() !== 'none');\n\n /** What the chart shows under its grid in place of the scale key, or `null` while it draws its days. */\n protected readonly state = useChartState({\n loading: this.loading,\n error: this.error,\n empty: computed(() => this.data().length === 0),\n emptyLabel: this.emptyLabel,\n loadingLabel: this.loadingLabel,\n errorLabel: this.errorLabel,\n });\n\n protected readonly columnCount = computed(() => {\n const cells = this.cells();\n return cells.length === 0 ? 0 : cells[cells.length - 1].week + 1;\n });\n\n /** Each day's position in `cells()`, for the square the pointer lands on. */\n private readonly indexByIso = computed(() => new Map(this.cells().map((cell, index) => [cell.iso, index])));\n\n /**\n * One tooltip for the whole year, pointing at the hovered day: above its square,\n * below it when there is no room above, and slid along the viewport edge for the\n * first and last weeks with the arrow still on the square. A listener on the grid\n * rather than one per square: a year is 371 of them.\n *\n * The box is the square's LAYOUT box rather than its client rect. The hovered square\n * grows by `:hover` over a transition, and a rect read part way through it would\n * move the chip by up to a fifth of a square depending on when it was measured;\n * the scale is centred, so the layout box is the rect's centre and the square's\n * own size.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const cell = this.cells()[index];\n // The squares are the container's only children, drawn in `cells()` order.\n const square = cell ? this.daysEl()?.nativeElement.children.item(index) : null;\n if (!cell || !(square instanceof HTMLElement)) return null;\n const rect = square.getBoundingClientRect();\n const width = square.offsetWidth;\n const height = square.offsetHeight;\n return {\n datum: { value: this.cellTitle(cell) },\n anchor: {\n x: (rect.left + rect.right - width) / 2,\n y: (rect.top + rect.bottom - height) / 2,\n width,\n height,\n },\n };\n });\n\n /**\n * Which square the pointer is on, from a `mousemove` on the grid. Over the gap\n * between two squares it is on none, and the tooltip starts to leave.\n */\n private onCellsPointer(event: MouseEvent): void {\n const iso = (event.target as Element | null)?.closest<HTMLElement>('.wr-calendar-heatmap__cell')?.dataset['date'];\n const index = iso === undefined ? undefined : this.indexByIso().get(iso);\n if (index === undefined) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/calendar-heatmap');\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const destroyRef = inject(DestroyRef);\n // Measured after render, in a browser, and again whenever the host or the grid changes\n // size: the host when its container does, the grid when `weeks` or `cellSize` does.\n // The observer's first report is the first measurement, so a year that boots narrower\n // than its container opens on its newest weeks, and so does one that starts to\n // overflow later — a chart that booted hidden, a window made narrow. A host that\n // already scrolled is left where the reader put it.\n // The pointer, heard on the days by two listeners of the chart's own rather than the\n // template's: a template listener checks the whole year again on every event. These\n // run nothing unless the square under the pointer changes.\n afterNextRender(() => {\n const days = this.daysEl()?.nativeElement;\n if (!days) return;\n const move = (event: MouseEvent): void => this.onCellsPointer(event);\n const leave = (event: MouseEvent): void => this.tip.leave(event);\n days.addEventListener('mousemove', move);\n days.addEventListener('mouseleave', leave);\n destroyRef.onDestroy(() => {\n days.removeEventListener('mousemove', move);\n days.removeEventListener('mouseleave', leave);\n });\n });\n\n // The ring round the day the tooltip reads, set by hand on that one square.\n let ringed: Element | null = null;\n effect(() => {\n const active = this.tip.active();\n const next = active === null ? null : (this.daysEl()?.nativeElement.children.item(active) ?? null);\n if (next === ringed) return;\n ringed?.classList.remove('wr-calendar-heatmap__cell--active');\n next?.classList.add('wr-calendar-heatmap__cell--active');\n ringed = next;\n });\n\n afterNextRender(() => {\n const grid = this.gridEl()?.nativeElement;\n if (typeof ResizeObserver === 'undefined') return;\n const measure = (): void => {\n const overflows = host.scrollWidth > host.clientWidth;\n if (overflows && !this.scrollable()) WrCalendarHeatmap.scrollToEnd(host);\n this.scrollable.set(overflows);\n };\n const observer = new ResizeObserver(measure);\n observer.observe(host);\n if (grid) observer.observe(grid);\n destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n /**\n * Scrolls the host to its inline end, where the newest weeks are: the right in LTR and\n * the left under RTL, where `scrollLeft` runs from 0 down to minus the overflow. The\n * value is clamped by the browser, so either sign of the whole width lands on the end.\n */\n private static scrollToEnd(host: HTMLElement): void {\n const rtl = getComputedStyle(host).direction === 'rtl';\n host.scrollLeft = rtl ? -host.scrollWidth : host.scrollWidth;\n }\n}\n\nexport type { WrHeatmapDatum } from './types';\n","@let shown = state();\n@let key = legend();\n@let keyed = legendShown() && !shown;\n\n@if (keyed && legendPosition() === 'top') {\n <!-- The scale key, before the grid or after it so it is in the DOM where it is on\n screen. Hidden, as an axis' ticks are on every chart: the grid's name is what is\n announced, and the counts are in the data table. -->\n <wr-chart-scale\n class=\"wr-calendar-heatmap__legend\"\n aria-hidden=\"true\"\n position=\"top\"\n [steps]=\"key.steps\"\n [minLabel]=\"key.min\"\n [maxLabel]=\"key.max\"\n />\n}\n\n<div\n #grid\n class=\"wr-calendar-heatmap__grid\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.--wr-calendar-heatmap-cell-size.px]=\"cellSize()\"\n [style.--wr-calendar-heatmap-cell-gap.px]=\"cellGap()\"\n [style.--wr-calendar-heatmap-columns]=\"columnCount()\"\n>\n @if (showLabels()) {\n <div class=\"wr-calendar-heatmap__weekdays\">\n @for (label of weekdayLabels(); track $index) {\n <span class=\"wr-calendar-heatmap__weekday\">{{ label }}</span>\n }\n </div>\n }\n\n <!-- The pointer is heard here by listeners the component adds itself, and the reading\n day's ring is set by hand: nothing in this template follows the pointer, so a move\n across the year checks no square. A square's paint is its level's, a step of the\n sequential scale, or the track for a day of nothing. -->\n <div #days class=\"wr-calendar-heatmap__cells\">\n @for (cell of cells(); track cell.iso) {\n <span\n class=\"wr-calendar-heatmap__cell\"\n [style.background]=\"cell.paint\"\n [style.grid-column]=\"cell.week + 1\"\n [style.grid-row]=\"cell.day + 1\"\n [attr.title]=\"titles()?.[$index] ?? null\"\n [attr.data-date]=\"cell.iso\"\n [attr.data-value]=\"cell.value\"\n [attr.data-level]=\"cell.level\"\n aria-hidden=\"true\"\n ></span>\n }\n </div>\n\n @if (showLabels()) {\n <div class=\"wr-calendar-heatmap__months\">\n @for (m of monthLabels(); track $index) {\n <span class=\"wr-calendar-heatmap__month\" [style.grid-column]=\"m.week + 1\">{{ m.label }}</span>\n }\n </div>\n }\n</div>\n\n@if (shown) {\n <!-- Under the grid, in the scale key's place, and never inside the grid's `img`, which\n makes everything it holds presentational: the message is a live region. -->\n <div class=\"wr-calendar-heatmap__status\">\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n </div>\n} @else if (keyed && legendPosition() === 'bottom') {\n <wr-chart-scale\n class=\"wr-calendar-heatmap__legend\"\n aria-hidden=\"true\"\n position=\"bottom\"\n [steps]=\"key.steps\"\n [minLabel]=\"key.min\"\n [maxLabel]=\"key.max\"\n />\n}\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the grid's `img` and never inside it: `img`\n makes everything it holds presentational. Clipped to nothing by its own stylesheet,\n so it takes no room, draws nothing and adds nothing to the scroll. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkDA,MAAM,QAAQ;CACZ;CACA;CACA;CACA;CACA;AACQ;AAGV,MAAM,UAAU;AAGhB,MAAM,+BAAe,IAAI,IAAG;AAM5B,SAAS,WAAW,QAAgB,SAAmC;CACrE,MAAM,MAAM,GAAG,OAAM,GAAI,KAAK,UAAU,OAAO;CAC/C,IAAI,SAAS,aAAa,IAAI,GAAG;CACjC,IAAI,CAAC,QAAQ;EACX,SAAS,IAAI,KAAK,eAAe,QAAQ,OAAO;EAChD,aAAa,IAAI,KAAK,MAAM;CAC9B;CACA,OAAO;AACT;AAEA,SAAS,MAAM,GAAO;CAIpB,OAAO,GAHG,EAAE,YAGF,EAAC,GAFD,OAAO,EAAE,SAAQ,IAAK,CAAC,CAAC,CAAC,SAAS,GAAG,GAEhC,EAAC,GADJ,OAAO,EAAE,QAAO,CAAE,CAAC,CAAC,SAAS,GAAG,GACxB;AACtB;AAEA,SAAS,WAAW,OAAoB;CACtC,OAAO,iBAA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AAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAEN,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-charts-calendar-heatmap.mjs","names":[],"sources":["../../../projects/lib/charts/calendar-heatmap/calendar-heatmap.ts","../../../projects/lib/charts/calendar-heatmap/calendar-heatmap.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartScale, type WrChartLegendPosition } from 'ngwr/charts/chart-legend';\nimport { WrChartState, WrChartTable, type WrChartTableData, useChartNumbers, useChartState } from 'ngwr/charts/core';\nimport { wrDateLocale } from 'ngwr/date';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip, wrCoerceChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrHeatmapDatum } from './types';\n\ninterface Cell {\n readonly iso: string;\n /** The day as the reader's locale writes it — see `cellTitle`. */\n readonly date: Date;\n readonly value: number;\n readonly intensity: number;\n /** Its step on the scale: 0 for a day of nothing, 1 to 5 for a day of something. */\n readonly level: number;\n /** The paint of its level, written on the square. */\n readonly paint: string;\n readonly week: number;\n readonly day: number;\n}\n\n/**\n * The steps of the sequential scale a day of something is painted with, lowest first: the\n * chart's own hooks, which the stylesheet points at `--wr-chart-seq-1` to `-5`. Written\n * out, so each hook is read by name.\n */\nconst STEPS = [\n 'var(--wr-calendar-heatmap-step-1)',\n 'var(--wr-calendar-heatmap-step-2)',\n 'var(--wr-calendar-heatmap-step-3)',\n 'var(--wr-calendar-heatmap-step-4)',\n 'var(--wr-calendar-heatmap-step-5)',\n] as const;\n\n/** A day in the form the data usually gives it, which sorts as a date does: `2026-03-09`. */\nconst ISO_DAY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\n/** Every `Intl.DateTimeFormat` the calendars have asked for, by locale and options. */\nconst DATE_FORMATS = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * The `Intl.DateTimeFormat` for `locale` and `options`, built once for the page: every\n * calendar built four of its own, 0.4 ms an instance, and a formatter holds no state.\n */\nfunction dateFormat(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const key = `${locale}|${JSON.stringify(options)}`;\n let format = DATE_FORMATS.get(key);\n if (!format) {\n format = new Intl.DateTimeFormat(locale, options);\n DATE_FORMATS.set(key, format);\n }\n return format;\n}\n\nfunction toIso(d: Date): string {\n const y = d.getFullYear();\n const m = String(d.getMonth() + 1).padStart(2, '0');\n const day = String(d.getDate()).padStart(2, '0');\n return `${y}-${m}-${day}`;\n}\n\nfunction parseInput(value: string | Date): Date {\n return value instanceof Date ? new Date(value) : new Date(`${value}T00:00:00`);\n}\n\n/** Which rows carry a weekday label: three of seven, or they do not fit. */\nconst LABELLED_ROWS = new Set([1, 3, 5]);\n\n/**\n * A day's contribution, with anything non-finite read as `0`.\n *\n * One `NaN` used to flatten the entire rendered window rather than its own day:\n * `Math.max(a, NaN)` is `NaN`, so the data set's maximum became `NaN`, `max > 0`\n * was false, and every cell fell to intensity 0 — a map that reads as a stretch\n * with no activity at all. The bad day also printed the literal text `NaN` in its\n * `title`.\n */\nfunction amount(raw: number): number {\n return Number.isFinite(raw) ? raw : 0;\n}\n\n/**\n * GitHub-style year-grid heatmap. One column per ISO week, one row per\n * weekday — cells coloured by `value` relative to the largest day drawn.\n *\n * **The scale.** A day of something takes one of five levels by its share of the largest\n * day, painted with the chart theme's sequential scale: `--wr-chart-seq-1`, a tint of the\n * first palette colour, up to `--wr-chart-seq-5`, the colour itself. `color` steps the same\n * five from a colour of the chart's own. A day of nothing is the theme's track, and every\n * square carries a faint edge, so the lowest level still reads on a dark surface. A scale\n * key under the grid shows the levels from 0 to the largest day (`showLegend`,\n * `legendPosition`).\n *\n * **Empty, loading, error.** With no data the grid keeps its squares and says \"No data\"\n * under them; `loading` and `error` put their own message there.\n *\n * **A year does not reflow.** Its 53 columns are a fixed cell size, so in a container\n * narrower than the grid the host scrolls sideways. While it does, it is a tab stop with\n * the shared focus ring, so the keyboard can scroll it too — WebKit makes no scroller\n * focusable by itself — and it opens on the inline END, the newest weeks, rather than on\n * the oldest. The stop carries no name of its own: focus lands on the grid's picture,\n * named by `ariaLabel`.\n *\n * **What a screen reader gets.** The grid is one named `role=\"img\"` and every square is\n * hidden, so the days' values are not in text anywhere unless `dataTable` renders them;\n * without it, say what the year shows in `ariaLabel`.\n *\n * @example\n * ```html\n * <wr-calendar-heatmap [data]=\"contributions\" />\n * <wr-calendar-heatmap [data]=\"data\" [endDate]=\"today\" [weeks]=\"26\" color=\"#10b981\" />\n * ```\n *\n * @see https://ngwr.dev/charts/calendar-heatmap\n */\n@Component({\n selector: 'wr-calendar-heatmap',\n templateUrl: './calendar-heatmap.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n // `wr-chart--legend`: the shared rule that keeps the scale key's room from the grid.\n class: 'wr-calendar-heatmap wr-chart--legend',\n // A colour of the chart's own for the highest level, which the stylesheet then steps\n // the lower ones from. Without one the levels are the chart theme's sequential scale.\n '[class.wr-calendar-heatmap--tinted]': 'color() !== null',\n '[style.--wr-calendar-heatmap-scale-color]': 'color()',\n // A tab stop only while the year is wider than its container: see `scrollable`.\n '[attr.tabindex]': 'scrollable() ? 0 : null',\n },\n imports: [WrChartScale, WrChartState, WrChartTable],\n})\nexport class WrCalendarHeatmap {\n /**\n * One entry per day — `{ date, value }`. Days you pass nothing for render as\n * empty cells, so a sparse array is the normal shape rather than a gap. Rows outside\n * the weeks drawn are skipped, and do not move the scale.\n */\n readonly data = input<readonly WrHeatmapDatum[]>([]);\n\n /**\n * Accessible name of the whole grid. Its cells are bare spans whose `title` a screen\n * reader on a role-less element does not read, so the map used to be several hundred\n * anonymous nodes with no name. Falls back to `calendarHeatmap.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'calendarHeatmap.label', 'Calendar heatmap');\n\n private readonly cellText = useI18nFormatter('calendarHeatmap.cell', '{{date}}: {{count}}');\n\n /**\n * A cell's tooltip, with both halves formatted and the sentence in the catalog.\n *\n * It used to be `` `${cell.iso}: ${cell.value}` `` — a raw ISO date beside an\n * unformatted number, joined by a hard-coded `': '`. Three things were wrong\n * at once and none of them are visible from the template: `2026-09-10` is not\n * how most of the world writes a date, `1234` is not how every locale groups\n * digits (`ar-SA` does not even use these ones), and the separator and order\n * were frozen into a shape a translator could not reach.\n *\n * Both halves go through `Intl`: the date in `WR_DATE_LOCALE`, which the weekday\n * and month labels use too and which follows Angular's `LOCALE_ID` unless\n * `withDates()` pins it, and the count in `LOCALE_ID` itself — or through\n * `valueFormat` — as every chart writes its numbers. The key ships as\n * `{{date}}: {{count}}` everywhere, so nothing reorders today and every locale can.\n */\n protected cellTitle(cell: { readonly date: Date; readonly value: number }): string {\n return this.cellText({ date: this.dateFormat().format(cell.date), count: this.numbers.value(cell.value) });\n }\n\n /**\n * The formatters, built once. They were built per call, and with `tooltip` off\n * the template asks for every square's title on every pass — so each `mousemove`\n * over the grid, which still marks the view for check, built 740 of them: 44,400\n * for 60 moves, measured in dev mode at 907–931ms against 348–358ms with the\n * tooltip on.\n */\n private readonly dateFormat = computed(() => dateFormat(this.locale, { dateStyle: 'medium' }));\n\n /**\n * Every square's `title`, and only while the tooltip is off — the tooltip carries the\n * same sentence, and the browser would open a second copy a moment later. Worked out\n * when the days or the catalog change, not on every pass of the template.\n */\n protected readonly titles = computed(() => (this.tooltip() ? null : this.cells().map(cell => this.cellTitle(cell))));\n\n /** Last day to render. @default today */\n readonly endDate = input<string | Date | null>(null);\n\n /** Number of weeks (columns) to render. @default 53 */\n readonly weeks = input(53, { transform: (v: unknown): number => Math.max(4, coerceNumberProperty(v, 53)) });\n\n /**\n * Cell side in CSS pixels. Twelve with a gap of three reads as a grid of days; the\n * eleven and two it was before 16.5 ran the squares together. @default 12\n */\n readonly cellSize = input(12, { transform: (v: unknown): number => Math.max(4, coerceNumberProperty(v, 12)) });\n\n /** Pixel gap between cells. @default 3 */\n readonly cellGap = input(3, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 3)) });\n\n /**\n * The colour of the highest level: any CSS colour, `var(--wr-…)` included. The four\n * levels under it are stepped from it toward the surface, as the chart theme steps its\n * own scale. `null` paints the levels with the theme's sequential scale,\n * `--wr-chart-seq-1` to `-5`, which an app retints for every chart at once.\n * @default null\n */\n readonly color = input<string | null>(null);\n\n /**\n * Background colour for zero-value days. `null` takes `--wr-calendar-heatmap-empty`,\n * the chart theme's track. @default null\n */\n readonly emptyColor = input<string | null>(null);\n\n /** Show the scale key: the levels from 0 to the largest day. @default true */\n readonly showLegend = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Where the scale key sits: under the grid, over it, or `none` for no key at all. It\n * keeps to the inline end, where the newest weeks are, so it stays in sight while the\n * year scrolls. @default 'bottom'\n */\n readonly legendPosition = input<Exclude<WrChartLegendPosition, 'start' | 'end'>>('bottom');\n\n /**\n * A request for the days is in flight: the grid keeps its squares, all empty, and the\n * loading message sits under them. @default false\n */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The days failed to load: the grid keeps its squares, all empty, with the error\n * message under them. `loading` wins while both are set. @default false\n */\n readonly error = input(false, { transform: coerceBooleanProperty });\n\n /** The message shown with no data. Falls back to `chart.empty`, then `'No data'`. */\n readonly emptyLabel = input<string | null>(null);\n\n /** The message shown while `loading`. Falls back to `chart.loading`, then `'Loading…'`. */\n readonly loadingLabel = input<string | null>(null);\n\n /** The message shown on `error`. Falls back to `chart.error`, then `'Could not load'`. */\n readonly errorLabel = input<string | null>(null);\n\n /** Show the weekday + month labels around the grid. @default true */\n readonly showLabels = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip with the day and its count on hover. It is the sentence the square's\n * `title` carried, so the `title` is written only while this is off — or the browser\n * would open a second copy a moment later.\n *\n * By default the pointer passes under the chip to the chart, so the next section\n * answers at once and the chip closes off the chart; `'hoverable'` lets the pointer\n * rest on the chip instead, as WCAG 1.4.13 asks of a hint. @default true\n */\n readonly tooltip = input<boolean | 'hoverable', unknown>(true, { transform: wrCoerceChartTooltip });\n\n /**\n * Writes each day's count in the tooltip, the `title` and the data table. `null` uses\n * `Intl.NumberFormat` in `LOCALE_ID`.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /**\n * Render the days' values as a table that only assistive technology reaches: a row per\n * week, headed by its dates, and a column per weekday, each day's count written the way\n * the tooltip writes it. A day after the last one drawn is an empty cell.\n *\n * The grid is one named `role=\"img\"`, which hides everything inside it, so without the\n * table the values are nowhere a screen reader can walk. It is rendered beside the grid,\n * clipped to nothing: it takes no room, draws nothing and holds no tab stop.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /** A day's count as the tooltip, the `title` and the data table write it, in `LOCALE_ID`: never compact. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly daysEl = viewChild<ElementRef<HTMLElement>>('days');\n\n private readonly gridEl = viewChild<ElementRef<HTMLElement>>('grid');\n\n /**\n * Whether the year is wider than the host, which then scrolls it — and is a tab stop\n * while it does. `axe`'s `scrollable-region-focusable` named the scroller with no stop\n * at all, and in WebKit, which makes no scroller focusable by itself, a keyboard could\n * not reach the newest weeks. Measured in the browser after render and on every resize;\n * `false` on the server and in jsdom, which lay nothing out.\n */\n protected readonly scrollable = signal(false);\n\n private readonly dateLocale = wrDateLocale();\n\n private get locale(): string {\n return this.dateLocale();\n }\n\n /**\n * Weekday names from the locale rather than a hard-coded English list — the row order is\n * Sunday-first, matching the grid's own alignment, so 7 Jan 2024 (a Sunday) is the\n * reference. Rows without a label stay blank on purpose: seven labels do not fit.\n */\n protected readonly weekdayLabels = computed<readonly string[]>(() => {\n const formatter = dateFormat(this.locale, { weekday: 'short' });\n const sunday = new Date(2024, 0, 7);\n return Array.from({ length: 7 }, (_, row) => {\n if (!LABELLED_ROWS.has(row)) return '';\n const day = new Date(sunday);\n day.setDate(sunday.getDate() + row);\n return formatter.format(day);\n });\n });\n\n private readonly monthNames = computed<readonly string[]>(() => {\n const formatter = dateFormat(this.locale, { month: 'short' });\n return Array.from({ length: 12 }, (_, month) => formatter.format(new Date(2024, month, 15)));\n });\n\n protected readonly cells = computed<readonly Cell[]>(() => {\n const end = this.endDate() ? parseInput(this.endDate()!) : new Date();\n end.setHours(0, 0, 0, 0);\n const weeks = this.weeks();\n // A state shows the grid as its frame: every square empty.\n const data = this.state() && this.state()?.kind !== 'empty' ? [] : this.data();\n\n // Walk backwards from end day; arrange into columns by week, rows by weekday.\n const out: Cell[] = [];\n // Exactly `weeks` columns, the last of them the week `end` falls in, every\n // column starting on a Sunday (matches GitHub).\n //\n // Counted in WEEKS rather than in days. It used to allocate `weeks * 7`\n // days and then align the start back to a Sunday, which adds up to six\n // more — so any alignment at all produced one column more than asked for:\n // 54 for the default 53, with `--wr-calendar-heatmap-columns` reporting 54 and a\n // container sized from `weeks * (cellSize + cellGap)` one column short.\n const start = new Date(end);\n start.setDate(end.getDate() - end.getDay() - (weeks - 1) * 7);\n\n // Build value lookup, from the rows inside the window only. Ten years of days handed\n // to a year's calendar parsed every one of them, 19 ms for ten thousand rows, to keep\n // 371. A day written `2026-03-09` sorts as a date does, so one outside the window is\n // told by a string compare and never parsed; a week of margin at the start keeps a\n // day the calendar rolls over (`2026-02-31` is 3 March) where it was. A `Date` is\n // told by its time. The largest day is taken over the rows kept.\n const from = new Date(start);\n from.setDate(start.getDate() - 7);\n const firstIso = toIso(from);\n const lastIso = toIso(end);\n const firstTime = start.getTime();\n // The next local midnight, not 24 hours on: a day that ends a DST change is 23 or 25.\n const after = new Date(end);\n after.setDate(end.getDate() + 1);\n const lastTime = after.getTime();\n const map = new Map<string, number>();\n let max = 0;\n for (const d of data) {\n const { date } = d;\n if (typeof date === 'string') {\n if (ISO_DAY.test(date) && (date < firstIso || date > lastIso)) continue;\n } else {\n const time = date.getTime();\n if (time < firstTime || time >= lastTime) continue;\n }\n const iso = toIso(parseInput(date));\n const sum = (map.get(iso) ?? 0) + amount(d.value);\n map.set(iso, sum);\n }\n const startIso = toIso(start);\n for (const [iso, sum] of map) if (iso >= startIso && iso <= lastIso && sum > max) max = sum;\n\n const empty = this.emptyColor() ?? 'var(--wr-calendar-heatmap-empty)';\n const cursor = new Date(start);\n let column = 0;\n while (cursor <= end) {\n for (let row = 0; row < 7; row++) {\n // Stop at `end`. The inner loop always walks a whole week, so once the\n // cursor crossed `end` mid-week it kept going to Saturday — up to six\n // days AFTER the last day to render, drawn as ordinary `value: 0`\n // squares and indistinguishable from a past day of no activity. With\n // the default that is today plus five future days.\n if (cursor > end) break;\n const iso = toIso(cursor);\n const value = map.get(iso) ?? 0;\n // Clamped at the BOTTOM as well as the top. A negative value produced a\n // negative intensity, which is not zero — so `colorFor` painted it in\n // the accent colour and `opacityFor` put it in the lightest band,\n // rendering a day of negative activity exactly like a day of light\n // activity, and unlike the empty day it should have matched. The scale\n // has no negative half; the honest floor is \"nothing\".\n const intensity = max > 0 ? Math.min(1, Math.max(0, value / max)) : 0;\n // Five levels over the days of something, the largest day on the fifth; a day of\n // nothing has none, and is painted as the track.\n const level = intensity === 0 ? 0 : Math.min(STEPS.length, Math.ceil(intensity * STEPS.length - 1e-9));\n const paint = level === 0 ? empty : STEPS[level - 1];\n out.push({ iso, date: new Date(cursor), value, intensity, level, paint, week: column, day: row });\n cursor.setDate(cursor.getDate() + 1);\n }\n column++;\n }\n return out;\n });\n\n /** Every weekday's full name, Sunday first as the rows are: the data table's columns. */\n private readonly weekdayNames = computed<readonly string[]>(() => {\n const formatter = dateFormat(this.locale, { weekday: 'long' });\n return Array.from({ length: 7 }, (_, row) => formatter.format(new Date(2024, 0, 7 + row)));\n });\n\n /**\n * The figures for `dataTable`: the grid's name as the caption, a column per weekday and\n * a row per week, headed by the week's first and last day drawn — `formatRange`, so the\n * locale writes the span its own way — and every day's count as the tooltip writes it.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const range = this.dateFormat();\n const weeks: (Cell | undefined)[][] = [];\n for (const cell of this.cells()) (weeks[cell.week] ??= [])[cell.day] = cell;\n return {\n caption: this.resolvedAriaLabel(),\n columns: this.weekdayNames(),\n groups: [\n {\n rows: weeks.map(days => {\n const drawn = days.filter((day): day is Cell => day !== undefined);\n return {\n header: range.formatRange(drawn[0].date, drawn[drawn.length - 1].date),\n cells: Array.from({ length: 7 }, (_, d) => (days[d] ? this.numbers.value(days[d].value) : '')),\n };\n }),\n },\n ],\n };\n });\n\n protected readonly monthLabels = computed(() => {\n // Pull the first cell of each visible month → render a label centered\n // over its column.\n const cells = this.cells();\n const seen = new Set<string>();\n // Off the date each cell already carries: its ISO string was parsed again here, twice\n // for a month's first day, 371 string parses a pass.\n return cells\n .filter(({ date }) => {\n if (date.getDate() !== 1) return false;\n const key = `${date.getFullYear()}-${date.getMonth()}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n })\n .map(cell => ({ label: this.monthNames()[cell.date.getMonth()], week: cell.week }));\n });\n\n /** The largest day drawn, which the highest level stands for; 0 with no day of something. */\n private readonly peak = computed(() => this.cells().reduce((max, cell) => Math.max(max, cell.value), 0));\n\n /**\n * The scale key: a day of nothing, then the five levels, between 0 and the largest day\n * as the tooltip writes a count. With no day of something it keys the empty square alone.\n */\n protected readonly legend = computed(() => {\n const peak = this.peak();\n const empty = this.emptyColor() ?? 'var(--wr-calendar-heatmap-empty)';\n return {\n min: this.numbers.value(0),\n max: peak > 0 ? this.numbers.value(peak) : null,\n steps: peak > 0 ? [empty, ...STEPS] : [empty],\n };\n });\n\n /** Whether the chart draws its scale key: with `showLegend`, unless `legendPosition` is `none`. */\n protected readonly legendShown = computed(() => this.showLegend() && this.legendPosition() !== 'none');\n\n /** What the chart shows under its grid in place of the scale key, or `null` while it draws its days. */\n protected readonly state = useChartState({\n loading: this.loading,\n error: this.error,\n empty: computed(() => this.data().length === 0),\n emptyLabel: this.emptyLabel,\n loadingLabel: this.loadingLabel,\n errorLabel: this.errorLabel,\n });\n\n protected readonly columnCount = computed(() => {\n const cells = this.cells();\n return cells.length === 0 ? 0 : cells[cells.length - 1].week + 1;\n });\n\n /** Each day's position in `cells()`, for the square the pointer lands on. */\n private readonly indexByIso = computed(() => new Map(this.cells().map((cell, index) => [cell.iso, index])));\n\n /**\n * One tooltip for the whole year, pointing at the hovered day: above its square,\n * below it when there is no room above, and slid along the viewport edge for the\n * first and last weeks with the arrow still on the square. A listener on the grid\n * rather than one per square: a year is 371 of them.\n *\n * The box is the square's LAYOUT box rather than its client rect. The hovered square\n * grows by `:hover` over a transition, and a rect read part way through it would\n * move the chip by up to a fifth of a square depending on when it was measured;\n * the scale is centred, so the layout box is the rect's centre and the square's\n * own size.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const cell = this.cells()[index];\n // The squares are the container's only children, drawn in `cells()` order.\n const square = cell ? this.daysEl()?.nativeElement.children.item(index) : null;\n if (!cell || !(square instanceof HTMLElement)) return null;\n const rect = square.getBoundingClientRect();\n const width = square.offsetWidth;\n const height = square.offsetHeight;\n return {\n datum: { value: this.cellTitle(cell) },\n anchor: {\n x: (rect.left + rect.right - width) / 2,\n y: (rect.top + rect.bottom - height) / 2,\n width,\n height,\n },\n };\n });\n\n /**\n * Which square the pointer is on, from a `mousemove` on the grid. Over the gap\n * between two squares it is on none, and the tooltip starts to leave.\n */\n private onCellsPointer(event: MouseEvent): void {\n const iso = (event.target as Element | null)?.closest<HTMLElement>('.wr-calendar-heatmap__cell')?.dataset['date'];\n const index = iso === undefined ? undefined : this.indexByIso().get(iso);\n if (index === undefined) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/calendar-heatmap');\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const destroyRef = inject(DestroyRef);\n // Measured after render, in a browser, and again whenever the host or the grid changes\n // size: the host when its container does, the grid when `weeks` or `cellSize` does.\n // The observer's first report is the first measurement, so a year that boots narrower\n // than its container opens on its newest weeks, and so does one that starts to\n // overflow later — a chart that booted hidden, a window made narrow. A host that\n // already scrolled is left where the reader put it.\n // The pointer, heard on the days by two listeners of the chart's own rather than the\n // template's: a template listener checks the whole year again on every event. These\n // run nothing unless the square under the pointer changes.\n afterNextRender(() => {\n const days = this.daysEl()?.nativeElement;\n if (!days) return;\n const move = (event: MouseEvent): void => this.onCellsPointer(event);\n const leave = (event: MouseEvent): void => this.tip.leave(event);\n days.addEventListener('mousemove', move);\n days.addEventListener('mouseleave', leave);\n destroyRef.onDestroy(() => {\n days.removeEventListener('mousemove', move);\n days.removeEventListener('mouseleave', leave);\n });\n });\n\n // The ring round the day the tooltip reads, set by hand on that one square.\n let ringed: Element | null = null;\n effect(() => {\n const active = this.tip.active();\n const next = active === null ? null : (this.daysEl()?.nativeElement.children.item(active) ?? null);\n if (next === ringed) return;\n ringed?.classList.remove('wr-calendar-heatmap__cell--active');\n next?.classList.add('wr-calendar-heatmap__cell--active');\n ringed = next;\n });\n\n afterNextRender(() => {\n const grid = this.gridEl()?.nativeElement;\n if (typeof ResizeObserver === 'undefined') return;\n const measure = (): void => {\n const overflows = host.scrollWidth > host.clientWidth;\n if (overflows && !this.scrollable()) WrCalendarHeatmap.scrollToEnd(host);\n this.scrollable.set(overflows);\n };\n const observer = new ResizeObserver(measure);\n observer.observe(host);\n if (grid) observer.observe(grid);\n destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n /**\n * Scrolls the host to its inline end, where the newest weeks are: the right in LTR and\n * the left under RTL, where `scrollLeft` runs from 0 down to minus the overflow. The\n * value is clamped by the browser, so either sign of the whole width lands on the end.\n */\n private static scrollToEnd(host: HTMLElement): void {\n const rtl = getComputedStyle(host).direction === 'rtl';\n host.scrollLeft = rtl ? -host.scrollWidth : host.scrollWidth;\n }\n}\n\nexport type { WrHeatmapDatum } from './types';\n","@let shown = state();\n@let key = legend();\n@let keyed = legendShown() && !shown;\n\n@if (keyed && legendPosition() === 'top') {\n <!-- The scale key, before the grid or after it so it is in the DOM where it is on\n screen. Hidden, as an axis' ticks are on every chart: the grid's name is what is\n announced, and the counts are in the data table. -->\n <wr-chart-scale\n class=\"wr-calendar-heatmap__legend\"\n aria-hidden=\"true\"\n position=\"top\"\n [steps]=\"key.steps\"\n [minLabel]=\"key.min\"\n [maxLabel]=\"key.max\"\n />\n}\n\n<div\n #grid\n class=\"wr-calendar-heatmap__grid\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.--wr-calendar-heatmap-cell-size.px]=\"cellSize()\"\n [style.--wr-calendar-heatmap-cell-gap.px]=\"cellGap()\"\n [style.--wr-calendar-heatmap-columns]=\"columnCount()\"\n>\n @if (showLabels()) {\n <div class=\"wr-calendar-heatmap__weekdays\">\n @for (label of weekdayLabels(); track $index) {\n <span class=\"wr-calendar-heatmap__weekday\">{{ label }}</span>\n }\n </div>\n }\n\n <!-- The pointer is heard here by listeners the component adds itself, and the reading\n day's ring is set by hand: nothing in this template follows the pointer, so a move\n across the year checks no square. A square's paint is its level's, a step of the\n sequential scale, or the track for a day of nothing. -->\n <div #days class=\"wr-calendar-heatmap__cells\">\n @for (cell of cells(); track cell.iso) {\n <span\n class=\"wr-calendar-heatmap__cell\"\n [style.background]=\"cell.paint\"\n [style.grid-column]=\"cell.week + 1\"\n [style.grid-row]=\"cell.day + 1\"\n [attr.title]=\"titles()?.[$index] ?? null\"\n [attr.data-date]=\"cell.iso\"\n [attr.data-value]=\"cell.value\"\n [attr.data-level]=\"cell.level\"\n aria-hidden=\"true\"\n ></span>\n }\n </div>\n\n @if (showLabels()) {\n <div class=\"wr-calendar-heatmap__months\">\n @for (m of monthLabels(); track $index) {\n <span class=\"wr-calendar-heatmap__month\" [style.grid-column]=\"m.week + 1\">{{ m.label }}</span>\n }\n </div>\n }\n</div>\n\n@if (shown) {\n <!-- Under the grid, in the scale key's place, and never inside the grid's `img`, which\n makes everything it holds presentational: the message is a live region. -->\n <div class=\"wr-calendar-heatmap__status\">\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n </div>\n} @else if (keyed && legendPosition() === 'bottom') {\n <wr-chart-scale\n class=\"wr-calendar-heatmap__legend\"\n aria-hidden=\"true\"\n position=\"bottom\"\n [steps]=\"key.steps\"\n [minLabel]=\"key.min\"\n [maxLabel]=\"key.max\"\n />\n}\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the grid's `img` and never inside it: `img`\n makes everything it holds presentational. Clipped to nothing by its own stylesheet,\n so it takes no room, draws nothing and adds nothing to the scroll. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;;;AAk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AAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAEN,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -340,10 +340,26 @@ function useChartHover(handlers) {
340
340
  const destroyRef = inject(DestroyRef);
341
341
  let index = null;
342
342
  let series = null;
343
+ let relight = null;
344
+ const watch = (on) => {
345
+ if (!on) {
346
+ relight?.disconnect();
347
+ relight = null;
348
+ } else if (!relight && typeof MutationObserver !== "undefined") {
349
+ relight = new MutationObserver(() => {
350
+ if (series !== null) wrChartDim(host, series);
351
+ });
352
+ relight.observe(host, {
353
+ childList: true,
354
+ subtree: true
355
+ });
356
+ }
357
+ };
343
358
  const dim = (key) => {
344
359
  if (key === series) return;
345
360
  series = key;
346
361
  wrChartDim(host, key);
362
+ watch(key !== null);
347
363
  };
348
364
  let current = null;
349
365
  const band = (section) => {
@@ -381,6 +397,7 @@ function useChartHover(handlers) {
381
397
  host.addEventListener("mouseover", over);
382
398
  host.addEventListener("mouseleave", leave);
383
399
  destroyRef.onDestroy(() => {
400
+ watch(false);
384
401
  host.removeEventListener("mouseover", over);
385
402
  host.removeEventListener("mouseleave", leave);
386
403
  });