@ids-group-ltd/ids-design-system 0.13.4 → 0.14.1

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 (247) hide show
  1. package/CHANGELOG.md +584 -0
  2. package/components.md +100 -52
  3. package/design-system.md +2 -0
  4. package/docs/agent/INDEX.md +3 -2
  5. package/docs/agent/charts/column-series-component.md +1 -1
  6. package/docs/agent/charts/ds-bar-chart.md +2 -1
  7. package/docs/agent/charts/ds-chart.md +3 -1
  8. package/docs/agent/charts/ds-config.md +3 -1
  9. package/docs/agent/charts/ds-line-chart.md +3 -3
  10. package/docs/agent/charts/ds-pie-chart.md +4 -3
  11. package/docs/agent/charts/line-series-component.md +1 -1
  12. package/docs/agent/feedback/ds-alert.md +1 -0
  13. package/docs/agent/feedback/ds-badge.md +1 -1
  14. package/docs/agent/feedback/ds-banner.md +1 -0
  15. package/docs/agent/feedback/ds-skeleton.md +2 -2
  16. package/docs/agent/feedback/ds-tag.md +1 -1
  17. package/docs/agent/forms/ds-autocomplete.md +2 -2
  18. package/docs/agent/forms/ds-button.md +1 -1
  19. package/docs/agent/forms/ds-color-picker.md +1 -1
  20. package/docs/agent/forms/ds-date-picker.md +2 -2
  21. package/docs/agent/forms/ds-filter-bar.md +1 -1
  22. package/docs/agent/forms/ds-icon-button.md +1 -1
  23. package/docs/agent/forms/ds-input.md +1 -1
  24. package/docs/agent/forms/ds-multi-select.md +2 -2
  25. package/docs/agent/forms/ds-otp-input.md +1 -1
  26. package/docs/agent/forms/ds-search.md +3 -3
  27. package/docs/agent/forms/ds-split-button.md +1 -1
  28. package/docs/agent/forms/ds-switch.md +4 -2
  29. package/docs/agent/forms/ds-textarea.md +2 -1
  30. package/docs/agent/foundations/tokens.md +1 -1
  31. package/docs/agent/navigation/ds-app-layout.md +2 -2
  32. package/docs/agent/navigation/ds-auth-layout.md +4 -4
  33. package/docs/agent/navigation/ds-page-header.md +1 -1
  34. package/docs/agent/navigation/ds-pagination.md +2 -2
  35. package/docs/agent/platform/ds-config.md +3 -3
  36. package/docs/agent/platform/ds-intl.md +33 -0
  37. package/docs/agent/surfaces/ds-accordion.md +2 -2
  38. package/docs/agent/tables/ds-cell-template.md +1 -1
  39. package/docs/agent/tables/ds-table.md +5 -4
  40. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +9 -5
  41. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
  42. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +21 -10
  43. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
  44. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +9 -5
  45. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
  46. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +8 -8
  47. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
  48. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +13 -8
  49. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
  50. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +5 -3
  51. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -1
  52. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +5 -10
  53. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -1
  54. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +12 -8
  55. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
  56. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +21 -10
  57. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
  58. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +56 -32
  59. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
  60. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
  61. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
  62. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +7 -6
  63. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
  64. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +4 -3
  65. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
  66. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +4 -4
  67. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  68. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +15 -3
  69. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -1
  70. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +5 -3
  71. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
  72. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +45 -39
  73. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
  74. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +414 -105
  75. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
  76. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +9 -5
  77. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
  78. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +22 -18
  79. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
  80. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +16 -9
  81. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
  82. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +4 -2
  83. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
  84. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +7 -4
  85. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
  86. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +12 -6
  87. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
  88. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
  89. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
  90. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +13 -7
  91. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
  92. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +40 -42
  93. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
  94. package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +13 -9
  95. package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
  96. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +3 -3
  97. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -1
  98. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +5 -4
  99. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
  100. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +27 -23
  101. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
  102. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +62 -13
  103. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
  104. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +15 -10
  105. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
  106. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +5 -4
  107. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
  108. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +13 -7
  109. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
  110. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
  111. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
  112. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +22 -13
  113. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
  114. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +12 -11
  115. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -1
  116. package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +55 -29
  117. package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
  118. package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +41 -12
  119. package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
  120. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +13 -6
  121. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
  122. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +4 -3
  123. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
  124. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +4 -2
  125. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
  126. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +5 -3
  127. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
  128. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +37 -4
  129. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
  130. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +8 -7
  131. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
  132. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +5 -3
  133. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -1
  134. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +9 -6
  135. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
  136. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +6 -4
  137. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
  138. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +20 -5
  139. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
  140. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +18 -15
  141. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
  142. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +9 -6
  143. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
  144. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +47 -38
  145. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  146. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +5 -3
  147. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
  148. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +9 -5
  149. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
  150. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +26 -4
  151. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
  152. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +12 -10
  153. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
  154. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +8 -6
  155. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
  156. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +5 -3
  157. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -1
  158. package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +14 -15
  159. package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -1
  160. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +345 -66
  161. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  162. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +361 -6
  163. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  164. package/fesm2022/ids-group-ltd-ids-design-system.mjs +1 -1
  165. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  166. package/migrations/0.10.0.json +1 -1
  167. package/migrations/0.10.1.json +1 -1
  168. package/migrations/0.12.2.json +4 -1
  169. package/migrations/0.13.3.json +32 -10
  170. package/migrations/0.13.4.json +1630 -132
  171. package/migrations/0.14.0.json +615 -0
  172. package/migrations/0.14.1.json +856 -0
  173. package/migrations/0.5.0.json +10 -4
  174. package/migrations/0.7.0.json +5 -2
  175. package/migrations/0.9.0.json +5 -2
  176. package/migrations/README.md +7 -2
  177. package/package.json +1 -1
  178. package/schematics/check-overrides/index.cjs +56 -0
  179. package/schematics/check-overrides/scan.cjs +74 -0
  180. package/schematics/check-overrides/schema.json +19 -0
  181. package/schematics/check-overrides/surface.json +2304 -0
  182. package/schematics/collection.json +5 -0
  183. package/styles/_chart-frame.scss +4 -4
  184. package/styles/_chart-interactive.scss +33 -0
  185. package/styles/_chart-motion.scss +17 -10
  186. package/styles/_field-box.scss +12 -0
  187. package/styles/_overlay-motion.scss +20 -10
  188. package/styles/_skeleton-shimmer.scss +4 -1
  189. package/styles/_tokens-charts.scss +1 -1
  190. package/styles/_tokens.scss +1 -1
  191. package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +11 -2
  192. package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +4 -0
  193. package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +5 -2
  194. package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +5 -5
  195. package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +7 -4
  196. package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +2 -0
  197. package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +5 -3
  198. package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +6 -2
  199. package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +4 -0
  200. package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +20 -14
  201. package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +2 -0
  202. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +2 -2
  203. package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +5 -0
  204. package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +2 -0
  205. package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +11 -6
  206. package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +155 -36
  207. package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +6 -2
  208. package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +11 -8
  209. package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +9 -3
  210. package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +2 -0
  211. package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +2 -0
  212. package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +3 -0
  213. package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +9 -4
  214. package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +13 -13
  215. package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +7 -5
  216. package/types/ids-group-ltd-ids-design-system-components-input.d.ts +2 -0
  217. package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +17 -11
  218. package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +6 -0
  219. package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +11 -6
  220. package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +2 -0
  221. package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +6 -2
  222. package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +17 -10
  223. package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +2 -0
  224. package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +25 -14
  225. package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +15 -6
  226. package/types/ids-group-ltd-ids-design-system-components-search.d.ts +9 -3
  227. package/types/ids-group-ltd-ids-design-system-components-select.d.ts +3 -2
  228. package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +2 -0
  229. package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +3 -1
  230. package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +6 -1
  231. package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +2 -0
  232. package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +6 -4
  233. package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +5 -2
  234. package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +2 -0
  235. package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +10 -1
  236. package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +1 -0
  237. package/types/ids-group-ltd-ids-design-system-components-table.d.ts +44 -28
  238. package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +2 -0
  239. package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +6 -2
  240. package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +15 -0
  241. package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -0
  242. package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +3 -0
  243. package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +2 -0
  244. package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +7 -5
  245. package/types/ids-group-ltd-ids-design-system-components.d.ts +83 -17
  246. package/types/ids-group-ltd-ids-design-system-core.d.ts +420 -14
  247. package/types/ids-group-ltd-ids-design-system.d.ts +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-funnel-chart.mjs","sources":["../../../src/lib/components/funnel-chart/funnel-chart.math.ts","../../../src/lib/components/funnel-chart/funnel-chart.component.ts","../../../src/lib/components/funnel-chart/funnel-chart.component.html","../../../src/lib/components/funnel-chart/ids-group-ltd-ids-design-system-components-funnel-chart.ts"],"sourcesContent":["import type { FunnelChartShape } from './funnel-chart.types';\n\n/** Bottom width of the fixed silhouette, as a fraction of the full width. The\n * tail carries a label, so it never narrows past this. */\nexport const FUNNEL_TAIL_WIDTH = 0.38;\n\n/** Ramp step for one stage, spread across the whole ramp rather than taking its\n * first `rampedCount` entries — a three-stage funnel that used steps 1-3 would\n * never reach the deep end the ramp exists to provide. */\nexport function rampPosition(\n index: number,\n rampedCount: number,\n rampLength: number,\n): number {\n if (rampLength <= 0 || rampedCount <= 1) {\n return 0;\n }\n const position = Math.round((index / (rampedCount - 1)) * (rampLength - 1));\n\n return Math.min(Math.max(position, 0), rampLength - 1);\n}\n\n/** The viewBox is normalised: depth runs 0..100 whatever the stage count, and\n * the rendered block size carries the real height. */\nexport const FUNNEL_VIEW_BOX_WIDTH = 100;\n\nexport const FUNNEL_VIEW_BOX_HEIGHT = 100;\n\n/** One inter-stage gap, as a share of a single stage's own depth. A share and\n * not a count of units, because the viewBox depth is normalised: a fixed\n * number of units would grow on screen with every stage added. */\nconst FUNNEL_STAGE_GAP_SHARE = 0.14;\n\nexport interface FunnelStageGeometry {\n /** Fraction of the full width at the stage's top edge, 0..1. */\n readonly topWidth: number;\n readonly bottomWidth: number;\n /** Fraction of the total depth at the stage's top edge, 0..1. */\n readonly top: number;\n readonly bottom: number;\n}\n\n/** Every value as a finite, non-negative number. A negative would mirror a\n * stage about its own centre line, and a non-finite one reaches an SVG\n * attribute as `NaN`, where the renderer drops the whole shape without an\n * error. */\nexport function sanitizeValues(values: readonly number[]): number[] {\n return values.map((value) =>\n Number.isFinite(value) ? Math.max(value, 0) : 0,\n );\n}\n\nfunction clampFraction(value: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), 1);\n}\n\nfunction widthAtDepth(depth: number, tailWidth: number): number {\n return 1 - (1 - tailWidth) * clampFraction(depth);\n}\n\nfunction largestValue(values: readonly number[]): number {\n return values.reduce(\n (largest, value) => (value > largest ? value : largest),\n 0,\n );\n}\n\n/** The depth at which `areaShare` of the silhouette's area lies above. The area\n * down to depth `t` is `t - (1 - tail) * t² / 2` against a whole of\n * `(1 + tail) / 2`, so the depth is a root of that quadratic rather than a\n * ratio — this is the step that makes area, not width, carry the value. The\n * discriminant bottoms out at `tail²`, so the root is always real. */\nexport function depthForAreaShare(\n areaShare: number,\n tailWidth: number,\n): number {\n const share = clampFraction(areaShare);\n const tail = clampFraction(tailWidth);\n const narrowing = 1 - tail;\n // A silhouette that does not narrow is a rectangle, where area is linear in\n // depth and the quadratic degenerates to 0/0.\n if (narrowing <= 0) {\n return share;\n }\n const discriminant = Math.max(1 - narrowing * share * (1 + tail), 0);\n\n return clampFraction((1 - Math.sqrt(discriminant)) / narrowing);\n}\n\nfunction evenDepths(count: number): number[] {\n return Array.from({ length: count + 1 }, (_, index) => index / count);\n}\n\nfunction boundaryDepths(\n values: readonly number[],\n shape: FunnelChartShape,\n tailWidth: number,\n): number[] {\n const count = values.length;\n if (shape !== 'area') {\n return evenDepths(count);\n }\n const total = values.reduce((sum, value) => sum + value, 0);\n if (!Number.isFinite(total) || total <= 0) {\n return evenDepths(count);\n }\n const depths: number[] = [];\n let consumed = 0;\n for (let index = 0; index <= count; index += 1) {\n depths.push(depthForAreaShare(consumed / total, tailWidth));\n if (index < count) {\n consumed += values[index];\n }\n }\n\n return depths;\n}\n\nfunction boundaryWidths(\n values: readonly number[],\n shape: FunnelChartShape,\n depths: readonly number[],\n tailWidth: number,\n): number[] {\n if (shape !== 'width') {\n return depths.map((depth) => widthAtDepth(depth, tailWidth));\n }\n const count = values.length;\n const largest = largestValue(values);\n if (!Number.isFinite(largest) || largest <= 0) {\n return depths.map(() => 0);\n }\n\n // The last boundary repeats the last value, which flattens the closing edge:\n // there is no following stage to taper towards.\n return Array.from({ length: count + 1 }, (_, index) =>\n clampFraction(values[Math.min(index, count - 1)] / largest),\n );\n}\n\n/** One trapezoid per stage, in fractions of the full width and of the total\n * depth.\n *\n * `'taper'` and `'area'` share one fixed silhouette — full width at the top,\n * `FUNNEL_TAIL_WIDTH` at the bottom — and differ only in where the stage\n * boundaries land on it: evenly spaced for `'taper'`, so width encodes\n * nothing, and at the depths that make each band's area proportional to its\n * value for `'area'`. `'width'` abandons the silhouette and reads every\n * boundary straight off the values. */\nexport function funnelGeometry(\n values: readonly number[],\n shape: FunnelChartShape,\n tailWidth: number = FUNNEL_TAIL_WIDTH,\n): FunnelStageGeometry[] {\n const safeValues = sanitizeValues(values);\n if (safeValues.length === 0) {\n return [];\n }\n const tail = Number.isFinite(tailWidth)\n ? clampFraction(tailWidth)\n : FUNNEL_TAIL_WIDTH;\n const depths = boundaryDepths(safeValues, shape, tail);\n const widths = boundaryWidths(safeValues, shape, depths, tail);\n\n return safeValues.map((_, index) => ({\n top: depths[index],\n bottom: depths[index + 1],\n topWidth: widths[index],\n bottomWidth: widths[index + 1],\n }));\n}\n\n/** The fall from `previousValue` to `value`, as a fraction of `previousValue`.\n * Null where there is nothing to fall from — a zero or non-finite predecessor\n * makes the ratio 0/0. Negative where the stage grew, which is real data. */\nexport function stageDrop(previousValue: number, value: number): number | null {\n if (!Number.isFinite(previousValue) || !Number.isFinite(value)) {\n return null;\n }\n if (previousValue <= 0) {\n return null;\n }\n\n return (previousValue - value) / previousValue;\n}\n\n/** The drop into each stage. The first entry is null and not zero: a printed\n * `0%` there would claim nobody fell away, rather than that there was no\n * earlier stage to fall from. */\nexport function stageDrops(values: readonly number[]): (number | null)[] {\n return values.map((value, index) =>\n index === 0 ? null : stageDrop(values[index - 1], value),\n );\n}\n\n/** Depth of one inter-stage gap, in viewBox units. */\nexport function stageGapUnits(\n stageCount: number,\n viewBoxHeight: number,\n): number {\n if (\n !Number.isFinite(stageCount) ||\n !Number.isFinite(viewBoxHeight) ||\n stageCount <= 0\n ) {\n return 0;\n }\n\n return (FUNNEL_STAGE_GAP_SHARE * viewBoxHeight) / stageCount;\n}\n\nfunction roundCoordinate(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n\n/** The stage's four corners as an SVG `points` value, or an empty string when\n * any input is non-finite. An attribute holding `NaN` is discarded by the\n * renderer without an error, so the shape would go missing in silence. */\nexport function stagePolygonPoints(\n geometry: FunnelStageGeometry,\n viewBoxWidth: number,\n viewBoxHeight: number,\n gapUnits: number,\n): string {\n const inputs = [\n geometry.topWidth,\n geometry.bottomWidth,\n geometry.top,\n geometry.bottom,\n viewBoxWidth,\n viewBoxHeight,\n gapUnits,\n ];\n if (inputs.some((input) => !Number.isFinite(input))) {\n return '';\n }\n const halfGap = Math.max(gapUnits, 0) / 2;\n const bandTop = clampFraction(geometry.top) * viewBoxHeight;\n const bandBottom = clampFraction(geometry.bottom) * viewBoxHeight;\n let top = bandTop + halfGap;\n let bottom = bandBottom - halfGap;\n if (bottom < top) {\n // A band shallower than the gap it has to leave. Collapse it to a line\n // instead of letting the edges cross and draw a bow tie.\n const middle = (top + bottom) / 2;\n top = middle;\n bottom = middle;\n }\n const horizontalCentre = viewBoxWidth / 2;\n const topWidth = clampFraction(geometry.topWidth);\n const bottomWidth = clampFraction(geometry.bottomWidth);\n // The widths belong to the band's own boundaries, and the gap moves the drawn edges INSIDE them.\n // Drawing the boundary widths at the inset depths makes every band overhang the silhouette at its\n // top and fall short of it at its bottom, so the stack reads as a fir tree rather than a funnel.\n // The silhouette is linear in depth for every shape, so the inset widths interpolate exactly.\n const bandDepth = bandBottom - bandTop;\n // Capped at half: past that the band has collapsed to a line, and an uncapped fraction would\n // swap the two edges and draw the bow tie the collapse exists to prevent.\n const inset =\n bandDepth > 0 ? Math.min(Math.max(halfGap / bandDepth, 0), 0.5) : 0;\n const widthAt = (fraction: number) =>\n topWidth + (bottomWidth - topWidth) * fraction;\n const halfTopWidth = (widthAt(inset) * viewBoxWidth) / 2;\n const halfBottomWidth = (widthAt(1 - inset) * viewBoxWidth) / 2;\n\n return [\n `${roundCoordinate(horizontalCentre - halfTopWidth)},${roundCoordinate(top)}`,\n `${roundCoordinate(horizontalCentre + halfTopWidth)},${roundCoordinate(top)}`,\n `${roundCoordinate(horizontalCentre + halfBottomWidth)},${roundCoordinate(bottom)}`,\n `${roundCoordinate(horizontalCentre - halfBottomWidth)},${roundCoordinate(bottom)}`,\n ].join(' ');\n}\n\n/** The middle of a band, for placing a marker inside it. The x is the viewBox centre because every\n * funnel band is symmetrical about it, whatever its two widths.\n *\n * @internal */\nexport function stageCenter(\n geometry: FunnelStageGeometry,\n viewBoxWidth: number,\n viewBoxHeight: number,\n): { x: number; y: number } {\n const top = clampFraction(geometry.top) * viewBoxHeight;\n const bottom = clampFraction(geometry.bottom) * viewBoxHeight;\n\n return { x: viewBoxWidth / 2, y: (top + bottom) / 2 };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n CHART_RAMP_COLORS,\n chartColors,\n describeSeries,\n formatPercent,\n focusMark,\n markAt,\n nextRovingIndex,\n staggerDelay,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport type { ChartDataRow } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport { resolveChartDefaults } from '@ids-group-ltd/ids-design-system/components';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n FUNNEL_VIEW_BOX_HEIGHT,\n FUNNEL_VIEW_BOX_WIDTH,\n funnelGeometry,\n rampPosition,\n stageDrops,\n stageCenter,\n stageGapUnits,\n stagePolygonPoints,\n} from './funnel-chart.math';\nimport type {\n FunnelChartDrop,\n FunnelChartShape,\n FunnelChartStage,\n} from './funnel-chart.types';\n\n/** The Drop cell, in whichever unit the chart was asked for. A null fall is the first stage, which\n * has nothing above it to fall from. */\nfunction formatDrop(\n fraction: number | null,\n count: number | null,\n mode: FunnelChartDrop,\n format: (value: number) => string,\n): string {\n if (mode === 'none' || fraction === null) {\n return '—';\n }\n\n return mode === 'absolute' && count !== null\n ? `−${format(Math.abs(count))}`\n : formatPercent(fraction, 1);\n}\n\nconst SKELETON_STAGE_WIDTHS = ['88%', '62%', '80%', '54%', '72%'] as const;\n\n@Component({\n selector: 'ds-funnel-chart',\n standalone: true,\n imports: [\n SkeletonComponent,\n ChartTooltipDirective,\n IconComponent,\n ChartDataTableComponent,\n ],\n templateUrl: './funnel-chart.component.html',\n styleUrl: './funnel-chart.component.scss',\n host: { '[class.framed]': \"frameResolved() === 'auto'\" },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FunnelChartComponent {\n /** Drawn in the order given. The order of a funnel's stages is its meaning,\n * so they are never sorted. */\n readonly data = input.required<readonly FunnelChartStage[]>();\n\n /** What the silhouette encodes. `'area'`, the default, makes each stage's AREA proportional to\n * its value, which is the honest encoding that still leaves a tail wide enough to label.\n * `'width'` reads the widths straight off the values, which collapses the tail of a steep\n * funnel below a labellable width. `'taper'` encodes NOTHING: the shape is fixed whatever the\n * data, and the numbers are read from the table beside it. */\n readonly shape = input<FunnelChartShape>('area');\n\n /** The value, percent and drop table printed under the funnel. It supersedes\n * `dataTable`: while this is on, the disclosure every chart carries would\n * repeat a strict subset of these same numbers, so it is not rendered. */\n readonly showTable = input(true, { transform: booleanAttribute });\n\n /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;\n * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.\n * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards\n * is one decision per app rather than per plot. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the\n * default, takes it away at once: a panel that outlives the pointer sits over the plot the\n * reader has moved on to.\n *\n * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything\n * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so\n * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to\n * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */\n readonly tooltipLingerMs = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value disclosure every chart carries. Ignored while `showTable` is on, which\n * already prints every label and value. Unset falls back to `DS_CONFIG.chart.dataTable`, then\n * `'toggle'`. */\n readonly dataTable = input<ChartDataTable | null>(null);\n /** What the Drop column reports: `'relative'` (the default) the share that leaked at this\n * stage, `'absolute'` the count, `'none'` no column at all. */\n readonly drop = input<FunnelChartDrop>('relative');\n\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. Unset falls back to\n * `DS_CONFIG.chart.emptyText`, then `'No data'`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then\n * `'Could not load the data'`. */\n readonly errorText = input<string | null>(null);\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale\n * grouping with a K/M/B suffix past four digits. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n private readonly defaults = resolveChartDefaults(this);\n readonly frameResolved = this.defaults.frame;\n readonly dataTableResolved = this.defaults.dataTable;\n readonly emptyTextResolved = this.defaults.emptyText;\n readonly errorTextResolved = this.defaults.errorText;\n readonly valueFormatResolved = this.defaults.valueFormat;\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The stage that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly stageClicked = output<FunnelChartStage>();\n\n /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press\n * outside releases it. Off by default: a click is already the drill-down hook, and a mark left\n * lit after the pointer has gone needs a reader who knows why it is lit. `stageClicked` fires\n * either way — pinning is a state, not a handler. */\n readonly pinOnClick = input(false, { transform: booleanAttribute });\n\n /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the\n * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed\n * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full\n * opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark\n * and pays for it with the rest of the chart. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at\n * all; `40` is the documented non-zero step. The total is capped, so a long series does not\n * crawl in. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n protected markStagger(index: number): string {\n return `${staggerDelay(index, this.staggerMs())}ms`;\n }\n\n /** Whether a hovered or focused stage opens a tooltip. `'axis'` is not offered — a\n * funnel's stages are its categories, so an axis tooltip would repeat the item one. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n private readonly tooltipLingerResolved = this.defaults.tooltipLingerMs;\n\n protected readonly activeMark = chartActiveMark(() =>\n this.tooltipLingerResolved(),\n );\n\n /** Where the badge goes, as a percentage of the shape's box. Percentages rather than viewBox\n * units because this svg is `preserveAspectRatio=\"none\"`: it stretches horizontally with the\n * card, and anything measured in user units stretches with it. */\n protected readonly pinnedCenter = computed(() => {\n const entry = this.stages()[this.activeMark.index()];\n if (!this.activeMark.pinned() || !entry) {\n return null;\n }\n\n return {\n xPercent: (entry.center.x / FUNNEL_VIEW_BOX_WIDTH) * 100,\n yPercent: (entry.center.y / FUNNEL_VIEW_BOX_HEIGHT) * 100,\n };\n });\n\n protected onMarkClick(\n payload: FunnelChartStage,\n index: number,\n event: Event,\n ): void {\n this.stageClicked.emit(payload);\n if (this.pinOnClick()) {\n this.activeMark.pin(index, event);\n }\n }\n /** One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not\n * every mouse-operable control has to be separately focusable, and that is what keeps a\n * twenty-five mark chart from being twenty-five stops in the page's tab order. */\n protected readonly rovingIndex = signal(0);\n\n protected readonly tabStopIndex = computed(() =>\n Math.min(this.rovingIndex(), Math.max(0, this.stages().length - 1)),\n );\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.rovingIndex.set(index);\n this.activeMark.enter(index, event);\n }\n\n /** A table row stands for its band, so it opens the band's tooltip over the BAND and dims the\n * others — the same state hovering the band itself produces. */\n protected onRowEnter(index: number, event: Event): void {\n this.activeMark.enter(\n index,\n event,\n markAt(\n (event.currentTarget as Element).closest('figure'),\n index,\n '.stage',\n ),\n );\n }\n\n protected isDimmed(index: number): boolean {\n return (\n this.dimOthers() &&\n this.activeMark.index() !== -1 &&\n this.activeMark.index() !== index\n );\n }\n\n protected onMarkNavigation(event: KeyboardEvent, index: number): void {\n const next = nextRovingIndex(event.key, index, this.stages().length);\n if (next === null) {\n return;\n }\n event.preventDefault();\n this.rovingIndex.set(next);\n focusMark((event.currentTarget as Element).closest('svg'), next);\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.stages()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.stage.label,\n value: entry.stage.value,\n formatted: `${entry.formattedValue} · ${entry.formattedPercent}`,\n color: entry.color,\n detail:\n entry.formattedDrop === '—'\n ? ''\n : `${entry.formattedDrop} fell away since the stage above`,\n },\n ],\n };\n },\n );\n\n protected readonly viewBox = `0 0 ${FUNNEL_VIEW_BOX_WIDTH} ${FUNNEL_VIEW_BOX_HEIGHT}`;\n\n /** The gap between two bands, painted as a TRANSPARENT STROKE on each. A stroke straddles the\n * edge it is drawn on, so each band claims half the gap above it and half below — the gap stays\n * exactly as wide to the eye and stops being dead space to the pointer. */\n protected readonly hitGapUnits = computed(() =>\n stageGapUnits(this.data().length, FUNNEL_VIEW_BOX_HEIGHT),\n );\n\n protected readonly tableRows = computed<readonly ChartDataRow[]>(() =>\n this.stages().map((entry) => ({\n key: entry.stage.id,\n cells: [entry.stage.label, entry.formattedValue],\n })),\n );\n\n protected readonly stages = computed(() => {\n const data = this.data();\n const values = data.map((stage) => stage.value);\n const geometry = funnelGeometry(values, this.shape());\n const drops = stageDrops(values);\n const gapUnits = stageGapUnits(data.length, FUNNEL_VIEW_BOX_HEIGHT);\n const format = (value: number) =>\n this.valueFormatResolved()(value, 'tooltip');\n // Every stage is a share of the funnel's mouth, not of the column total:\n // the stages are nested subsets, so they do not add up to 100%.\n const firstValue = values.length ? values[0] : 0;\n // The stages are one quantity draining, not eight categories, so they take a\n // single-hue ramp. The last one is the outcome the funnel is read for, so it\n // leaves the ramp and takes the accent.\n const lastIndex = data.length - 1;\n\n return data.map((stage, index) => {\n const drop = drops[index];\n\n return {\n stage,\n // The middle of the band, for the marker that says this one is held. A polygon has no\n // centre of its own, and its bounding box centre drifts outside a steeply tapered band.\n center: stageCenter(\n geometry[index],\n FUNNEL_VIEW_BOX_WIDTH,\n FUNNEL_VIEW_BOX_HEIGHT,\n ),\n points: stagePolygonPoints(\n geometry[index],\n FUNNEL_VIEW_BOX_WIDTH,\n FUNNEL_VIEW_BOX_HEIGHT,\n gapUnits,\n ),\n formattedValue: format(stage.value),\n formattedPercent: formatPercent(stage.value, firstValue),\n formattedDrop: formatDrop(\n drop,\n index > 0 ? values[index - 1] - stage.value : null,\n this.drop(),\n format,\n ),\n color:\n index === lastIndex\n ? chartColors.seriesAccent\n : CHART_RAMP_COLORS[\n rampPosition(index, lastIndex, CHART_RAMP_COLORS.length)\n ],\n };\n });\n });\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.caption() ?? 'Chart',\n this.data().map((stage) => ({\n label: stage.label,\n value: stage.value,\n })),\n (value) => this.valueFormatResolved()(value, 'tooltip'),\n this.showTable() || this.dataTableResolved() !== 'none',\n ),\n );\n\n protected entryLabel(entry: {\n stage: FunnelChartStage;\n formattedValue: string;\n }): string {\n return `${entry.stage.label}, ${entry.formattedValue}`;\n }\n\n protected onStageKey(stage: FunnelChartStage, event: Event): void {\n // A key pressed on a control inside the stage belongs to that control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.stageClicked.emit(stage);\n }\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n protected readonly showDataTable = computed(\n () => this.dataTableResolved() !== 'none' && !this.showTable(),\n );\n\n protected readonly chartHeight = computed(\n () =>\n `calc(var(--_funnel-chart-stage-height) * ${Math.max(this.data().length, 1)})`,\n );\n\n /** Placeholder stage widths while loading. The count follows the real stage\n * count so the chart does not resize when the data lands, falling back to\n * three when `data` is still empty. The widths vary — and deliberately do\n * not narrow in order — because a column of equal full-width bars is\n * indistinguishable from a funnel whose stages have all gone grey, and a\n * narrowing one just reads as the funnel itself. Same reasoning as the\n * table's skeleton rows. */\n protected readonly skeletonStages = computed(() =>\n Array.from(\n { length: Math.max(this.data().length, 3) },\n (unusedEntry, index) =>\n SKELETON_STAGE_WIDTHS[index % SKELETON_STAGE_WIDTHS.length],\n ),\n );\n}\n","<figure class=\"funnel-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholderWidth of skeletonStages(); track $index) {\n <ds-skeleton\n height=\"calc(var(--_funnel-chart-stage-height) - var(--_funnel-chart-stage-gap))\"\n [width]=\"placeholderWidth\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"shape\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n preserveAspectRatio=\"none\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n [style.block-size]=\"chartHeight()\">\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <polygon\n class=\"stage\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [attr.stroke-width]=\"hitGapUnits()\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [attr.points]=\"entry.points\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.stage, index, $event)\"\n (keydown.enter)=\"onStageKey(entry.stage, $event)\"\n (keydown.space)=\"onStageKey(entry.stage, $event)\">\n </polygon>\n }\n </svg>\n\n @if (pinnedCenter(); as center) {\n <span\n class=\"pin-marker\"\n [style.left.%]=\"center.xPercent\"\n [style.top.%]=\"center.yPercent\">\n <ds-icon\n name=\"pin\"\n [size]=\"13\" />\n </span>\n }\n </div>\n\n @if (showTable()) {\n <table class=\"stage-table\">\n <caption class=\"visually-hidden\">\n Each stage as a percentage of the first, and the drop from the stage\n above it.\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Stage\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Percent\n </th>\n\n @if (drop() !== 'none') {\n <th scope=\"col\">\n Drop\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <tr\n (pointerenter)=\"onRowEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\">\n <th scope=\"row\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n aria-hidden=\"true\"\n [style.background]=\"entry.color\">\n </span>\n\n {{ entry.stage.label }}\n </th>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n\n @if (drop() !== 'none') {\n <td>\n {{ entry.formattedDrop }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n\n @if (showDataTable()) {\n <ds-chart-data-table\n [columns]=\"['Label', 'Value']\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\" />\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;AAC2D;AACpD,MAAM,iBAAiB,GAAG,IAAI;AAErC;;AAE2D;SAC3C,YAAY,CAC1B,KAAa,EACb,WAAmB,EACnB,UAAkB,EAAA;IAElB,IAAI,UAAU,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,EAAE;AACvC,QAAA,OAAO,CAAC;IACV;IACA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,WAAW,GAAG,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,CAAC,CAAC;AAE3E,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC;AACxD;AAEA;AACuD;AAChD,MAAM,qBAAqB,GAAG,GAAG;AAEjC,MAAM,sBAAsB,GAAG,GAAG;AAEzC;;AAEmE;AACnE,MAAM,sBAAsB,GAAG,IAAI;AAWnC;;;AAGa;AACP,SAAU,cAAc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,CAAA,EAAA;46DAmH3C,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE5MtB;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-funnel-chart.mjs","sources":["../../../src/lib/components/funnel-chart/funnel-chart.math.ts","../../../src/lib/components/funnel-chart/funnel-chart.component.ts","../../../src/lib/components/funnel-chart/funnel-chart.component.html","../../../src/lib/components/funnel-chart/ids-group-ltd-ids-design-system-components-funnel-chart.ts"],"sourcesContent":["import type { FunnelChartShape } from './funnel-chart.types';\n\n/** Bottom width of the fixed silhouette, as a fraction of the full width. The\n * tail carries a label, so it never narrows past this. */\nexport const FUNNEL_TAIL_WIDTH = 0.38;\n\n/** Ramp step for one stage, spread across the whole ramp rather than taking its\n * first `rampedCount` entries — a three-stage funnel that used steps 1-3 would\n * never reach the deep end the ramp exists to provide. */\nexport function rampPosition(\n index: number,\n rampedCount: number,\n rampLength: number,\n): number {\n if (rampLength <= 0 || rampedCount <= 1) {\n return 0;\n }\n const position = Math.round((index / (rampedCount - 1)) * (rampLength - 1));\n\n return Math.min(Math.max(position, 0), rampLength - 1);\n}\n\n/** The viewBox is normalised: depth runs 0..100 whatever the stage count, and\n * the rendered block size carries the real height. */\nexport const FUNNEL_VIEW_BOX_WIDTH = 100;\n\nexport const FUNNEL_VIEW_BOX_HEIGHT = 100;\n\n/** One inter-stage gap, as a share of a single stage's own depth. A share and\n * not a count of units, because the viewBox depth is normalised: a fixed\n * number of units would grow on screen with every stage added. */\nconst FUNNEL_STAGE_GAP_SHARE = 0.14;\n\nexport interface FunnelStageGeometry {\n /** Fraction of the full width at the stage's top edge, 0..1. */\n readonly topWidth: number;\n readonly bottomWidth: number;\n /** Fraction of the total depth at the stage's top edge, 0..1. */\n readonly top: number;\n readonly bottom: number;\n}\n\n/** Every value as a finite, non-negative number. A negative would mirror a\n * stage about its own centre line, and a non-finite one reaches an SVG\n * attribute as `NaN`, where the renderer drops the whole shape without an\n * error. */\nexport function sanitizeValues(values: readonly number[]): number[] {\n return values.map((value) =>\n Number.isFinite(value) ? Math.max(value, 0) : 0,\n );\n}\n\nfunction clampFraction(value: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), 1);\n}\n\nfunction widthAtDepth(depth: number, tailWidth: number): number {\n return 1 - (1 - tailWidth) * clampFraction(depth);\n}\n\nfunction largestValue(values: readonly number[]): number {\n return values.reduce(\n (largest, value) => (value > largest ? value : largest),\n 0,\n );\n}\n\n/** The depth at which `areaShare` of the silhouette's area lies above. The area\n * down to depth `t` is `t - (1 - tail) * t² / 2` against a whole of\n * `(1 + tail) / 2`, so the depth is a root of that quadratic rather than a\n * ratio — this is the step that makes area, not width, carry the value. The\n * discriminant bottoms out at `tail²`, so the root is always real. */\nexport function depthForAreaShare(\n areaShare: number,\n tailWidth: number,\n): number {\n const share = clampFraction(areaShare);\n const tail = clampFraction(tailWidth);\n const narrowing = 1 - tail;\n // A silhouette that does not narrow is a rectangle, where area is linear in\n // depth and the quadratic degenerates to 0/0.\n if (narrowing <= 0) {\n return share;\n }\n const discriminant = Math.max(1 - narrowing * share * (1 + tail), 0);\n\n return clampFraction((1 - Math.sqrt(discriminant)) / narrowing);\n}\n\nfunction evenDepths(count: number): number[] {\n return Array.from({ length: count + 1 }, (_, index) => index / count);\n}\n\nfunction boundaryDepths(\n values: readonly number[],\n shape: FunnelChartShape,\n tailWidth: number,\n): number[] {\n const count = values.length;\n if (shape !== 'area') {\n return evenDepths(count);\n }\n const total = values.reduce((sum, value) => sum + value, 0);\n if (!Number.isFinite(total) || total <= 0) {\n return evenDepths(count);\n }\n const depths: number[] = [];\n let consumed = 0;\n for (let index = 0; index <= count; index += 1) {\n depths.push(depthForAreaShare(consumed / total, tailWidth));\n if (index < count) {\n consumed += values[index];\n }\n }\n\n return depths;\n}\n\nfunction boundaryWidths(\n values: readonly number[],\n shape: FunnelChartShape,\n depths: readonly number[],\n tailWidth: number,\n): number[] {\n if (shape !== 'width') {\n return depths.map((depth) => widthAtDepth(depth, tailWidth));\n }\n const count = values.length;\n const largest = largestValue(values);\n if (!Number.isFinite(largest) || largest <= 0) {\n return depths.map(() => 0);\n }\n\n // The last boundary repeats the last value, which flattens the closing edge:\n // there is no following stage to taper towards.\n return Array.from({ length: count + 1 }, (_, index) =>\n clampFraction(values[Math.min(index, count - 1)] / largest),\n );\n}\n\n/** One trapezoid per stage, in fractions of the full width and of the total\n * depth.\n *\n * `'taper'` and `'area'` share one fixed silhouette — full width at the top,\n * `FUNNEL_TAIL_WIDTH` at the bottom — and differ only in where the stage\n * boundaries land on it: evenly spaced for `'taper'`, so width encodes\n * nothing, and at the depths that make each band's area proportional to its\n * value for `'area'`. `'width'` abandons the silhouette and reads every\n * boundary straight off the values. */\nexport function funnelGeometry(\n values: readonly number[],\n shape: FunnelChartShape,\n tailWidth: number = FUNNEL_TAIL_WIDTH,\n): FunnelStageGeometry[] {\n const safeValues = sanitizeValues(values);\n if (safeValues.length === 0) {\n return [];\n }\n const tail = Number.isFinite(tailWidth)\n ? clampFraction(tailWidth)\n : FUNNEL_TAIL_WIDTH;\n const depths = boundaryDepths(safeValues, shape, tail);\n const widths = boundaryWidths(safeValues, shape, depths, tail);\n\n return safeValues.map((_, index) => ({\n top: depths[index],\n bottom: depths[index + 1],\n topWidth: widths[index],\n bottomWidth: widths[index + 1],\n }));\n}\n\n/** The fall from `previousValue` to `value`, as a fraction of `previousValue`.\n * Null where there is nothing to fall from — a zero or non-finite predecessor\n * makes the ratio 0/0. Negative where the stage grew, which is real data. */\nexport function stageDrop(previousValue: number, value: number): number | null {\n if (!Number.isFinite(previousValue) || !Number.isFinite(value)) {\n return null;\n }\n if (previousValue <= 0) {\n return null;\n }\n\n return (previousValue - value) / previousValue;\n}\n\n/** The drop into each stage. The first entry is null and not zero: a printed\n * `0%` there would claim nobody fell away, rather than that there was no\n * earlier stage to fall from. */\nexport function stageDrops(values: readonly number[]): (number | null)[] {\n return values.map((value, index) =>\n index === 0 ? null : stageDrop(values[index - 1], value),\n );\n}\n\n/** Depth of one inter-stage gap, in viewBox units. */\nexport function stageGapUnits(\n stageCount: number,\n viewBoxHeight: number,\n): number {\n if (\n !Number.isFinite(stageCount) ||\n !Number.isFinite(viewBoxHeight) ||\n stageCount <= 0\n ) {\n return 0;\n }\n\n return (FUNNEL_STAGE_GAP_SHARE * viewBoxHeight) / stageCount;\n}\n\nfunction roundCoordinate(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n\n/** The stage's four corners as an SVG `points` value, or an empty string when\n * any input is non-finite. An attribute holding `NaN` is discarded by the\n * renderer without an error, so the shape would go missing in silence. */\nexport function stagePolygonPoints(\n geometry: FunnelStageGeometry,\n viewBoxWidth: number,\n viewBoxHeight: number,\n gapUnits: number,\n): string {\n const inputs = [\n geometry.topWidth,\n geometry.bottomWidth,\n geometry.top,\n geometry.bottom,\n viewBoxWidth,\n viewBoxHeight,\n gapUnits,\n ];\n if (inputs.some((input) => !Number.isFinite(input))) {\n return '';\n }\n const halfGap = Math.max(gapUnits, 0) / 2;\n const bandTop = clampFraction(geometry.top) * viewBoxHeight;\n const bandBottom = clampFraction(geometry.bottom) * viewBoxHeight;\n const bandDepth = bandBottom - bandTop;\n let top = bandTop + halfGap;\n let bottom = bandBottom - halfGap;\n if (bandDepth <= 0) {\n top = bandTop;\n bottom = bandTop;\n } else if (bottom - top < halfGap) {\n // A band shallower than the gap it has to leave, which is where a small tail stage of the area\n // shape lands. It keeps half a gap of depth about its own middle so it stays a visible mark;\n // the neighbours are inset by half a gap, so a quarter gap still separates them.\n const middle = Math.min(\n Math.max((bandTop + bandBottom) / 2, halfGap / 2),\n viewBoxHeight - halfGap / 2,\n );\n top = middle - halfGap / 2;\n bottom = middle + halfGap / 2;\n }\n const horizontalCentre = viewBoxWidth / 2;\n const topWidth = clampFraction(geometry.topWidth);\n const bottomWidth = clampFraction(geometry.bottomWidth);\n // The widths belong to the band's own boundaries, and the gap moves the drawn edges INSIDE them.\n // Drawing the boundary widths at the inset depths makes every band overhang the silhouette at its\n // top and fall short of it at its bottom, so the stack reads as a fir tree rather than a funnel.\n // The silhouette is linear in depth for every shape, so the drawn widths interpolate exactly.\n const widthAt = (depth: number) =>\n bandDepth > 0\n ? topWidth +\n (bottomWidth - topWidth) * clampFraction((depth - bandTop) / bandDepth)\n : (topWidth + bottomWidth) / 2;\n const halfTopWidth = (widthAt(top) * viewBoxWidth) / 2;\n const halfBottomWidth = (widthAt(bottom) * viewBoxWidth) / 2;\n\n return [\n `${roundCoordinate(horizontalCentre - halfTopWidth)},${roundCoordinate(top)}`,\n `${roundCoordinate(horizontalCentre + halfTopWidth)},${roundCoordinate(top)}`,\n `${roundCoordinate(horizontalCentre + halfBottomWidth)},${roundCoordinate(bottom)}`,\n `${roundCoordinate(horizontalCentre - halfBottomWidth)},${roundCoordinate(bottom)}`,\n ].join(' ');\n}\n\n/** The middle of a band, for placing a marker inside it. The x is the viewBox centre because every\n * funnel band is symmetrical about it, whatever its two widths.\n *\n * @internal */\nexport function stageCenter(\n geometry: FunnelStageGeometry,\n viewBoxWidth: number,\n viewBoxHeight: number,\n): { x: number; y: number } {\n const top = clampFraction(geometry.top) * viewBoxHeight;\n const bottom = clampFraction(geometry.bottom) * viewBoxHeight;\n\n return { x: viewBoxWidth / 2, y: (top + bottom) / 2 };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport {\n CHART_RAMP_COLORS,\n chartColors,\n describeSeries,\n formatPercent,\n markAt,\n rovingMarks,\n leaveMark,\n staggerDelay,\n chartRenderGate,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport type { ChartDataRow } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport { resolveChartDefaults } from '@ids-group-ltd/ids-design-system/components';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n FUNNEL_VIEW_BOX_HEIGHT,\n FUNNEL_VIEW_BOX_WIDTH,\n funnelGeometry,\n rampPosition,\n stageDrops,\n stageCenter,\n stageGapUnits,\n stagePolygonPoints,\n} from './funnel-chart.math';\nimport type {\n FunnelChartDrop,\n FunnelChartShape,\n FunnelChartStage,\n} from './funnel-chart.types';\n\n/** The Drop cell, in whichever unit the chart was asked for. A null fall is the first stage, which\n * has nothing above it to fall from. */\nfunction formatDrop(\n fraction: number | null,\n count: number | null,\n mode: FunnelChartDrop,\n format: (value: number) => string,\n locale: string,\n): string {\n if (mode === 'none' || fraction === null) {\n return '—';\n }\n\n return mode === 'absolute' && count !== null\n ? `−${format(Math.abs(count))}`\n : formatPercent(fraction, 1, locale);\n}\n\nconst SKELETON_STAGE_WIDTHS = ['88%', '62%', '80%', '54%', '72%'] as const;\n\n@Component({\n selector: 'ds-funnel-chart',\n standalone: true,\n imports: [\n SkeletonComponent,\n ChartTooltipDirective,\n IconComponent,\n ChartDataTableComponent,\n ],\n templateUrl: './funnel-chart.component.html',\n styleUrl: './funnel-chart.component.scss',\n host: { '[class.framed]': \"frameResolved() === 'auto'\" },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FunnelChartComponent {\n protected readonly renderReady = chartRenderGate();\n\n protected readonly leaveMark = leaveMark;\n\n /** Drawn in the order given. The order of a funnel's stages is its meaning,\n * so they are never sorted. */\n readonly data = input.required<readonly FunnelChartStage[]>();\n\n /** What the silhouette encodes. `'area'`, the default, makes each stage's AREA proportional to\n * its value, which is the honest encoding that still leaves a tail wide enough to label.\n * `'width'` reads the widths straight off the values, which collapses the tail of a steep\n * funnel below a labellable width. `'taper'` encodes NOTHING: the shape is fixed whatever the\n * data, and the numbers are read from the table beside it. */\n readonly shape = input<FunnelChartShape>('area');\n\n /** The value, percent and drop table printed under the funnel. It supersedes\n * `dataTable`: while this is on, the disclosure every chart carries would\n * repeat a strict subset of these same numbers, so it is not rendered. */\n readonly showTable = input(true, { transform: booleanAttribute });\n\n /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;\n * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.\n * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards\n * is one decision per app rather than per plot. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the\n * default, takes it away at once: a panel that outlives the pointer sits over the plot the\n * reader has moved on to.\n *\n * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything\n * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so\n * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to\n * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */\n readonly tooltipLingerMs = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value disclosure every chart carries. Ignored while `showTable` is on, which\n * already prints every label and value. Unset falls back to `DS_CONFIG.chart.dataTable`, then\n * `'toggle'`. */\n readonly dataTable = input<ChartDataTable | null>(null);\n /** What the Drop column reports: `'relative'` (the default) the share that leaked at this\n * stage, `'absolute'` the count, `'none'` no column at all. */\n readonly drop = input<FunnelChartDrop>('relative');\n\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. Unset falls back to\n * `DS_INTL.chart.empty`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. Unset falls back to `DS_INTL.chart.error`. */\n readonly errorText = input<string | null>(null);\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then `DS_CONFIG.locale` /\n * `LOCALE_ID`. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n private readonly defaults = resolveChartDefaults(this);\n protected readonly intl = inject(DS_INTL);\n readonly frameResolved = this.defaults.frame;\n readonly dataTableResolved = this.defaults.dataTable;\n readonly emptyTextResolved = this.defaults.emptyText;\n readonly errorTextResolved = this.defaults.errorText;\n readonly valueFormatResolved = this.defaults.valueFormat;\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The stage that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly stageClicked = output<FunnelChartStage>();\n\n /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press\n * outside releases it. Off by default: a click is already the drill-down hook, and a mark left\n * lit after the pointer has gone needs a reader who knows why it is lit. `stageClicked` fires\n * either way — pinning is a state, not a handler. */\n readonly pinOnClick = input(false, { transform: booleanAttribute });\n\n /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the\n * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed\n * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full\n * opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark\n * and pays for it with the rest of the chart. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at\n * all; `40` is the documented non-zero step. The total is capped, so a long series does not\n * crawl in. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n protected markStagger(index: number): string {\n return `${staggerDelay(index, this.staggerMs())}ms`;\n }\n\n /** Whether a hovered or focused stage opens a tooltip. `'axis'` is not offered — a\n * funnel's stages are its categories, so an axis tooltip would repeat the item one. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n private readonly tooltipLingerResolved = this.defaults.tooltipLingerMs;\n\n protected readonly activeMark = chartActiveMark(() =>\n this.tooltipLingerResolved(),\n );\n\n /** Where the badge goes, as a percentage of the shape's box. Percentages rather than viewBox\n * units because this svg is `preserveAspectRatio=\"none\"`: it stretches horizontally with the\n * card, and anything measured in user units stretches with it. */\n protected readonly pinnedCenter = computed(() => {\n const entry = this.stages()[this.activeMark.index()];\n if (!this.activeMark.pinned() || !entry) {\n return null;\n }\n\n return {\n xPercent: (entry.center.x / FUNNEL_VIEW_BOX_WIDTH) * 100,\n yPercent: (entry.center.y / FUNNEL_VIEW_BOX_HEIGHT) * 100,\n };\n });\n\n protected onMarkClick(\n payload: FunnelChartStage,\n index: number,\n event: Event,\n ): void {\n this.stageClicked.emit(payload);\n if (this.pinOnClick()) {\n this.activeMark.pin(index, event);\n }\n }\n protected readonly roving = rovingMarks(() => this.stages().length);\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.roving.focus(index);\n this.activeMark.enter(index, event);\n }\n\n /** A table row stands for its band, so it opens the band's tooltip over the BAND and dims the\n * others — the same state hovering the band itself produces. */\n protected onRowEnter(index: number, event: Event): void {\n this.activeMark.enter(\n index,\n event,\n markAt(\n (event.currentTarget as Element).closest('figure'),\n index,\n '.stage',\n ),\n );\n }\n\n protected isDimmed(index: number): boolean {\n return (\n this.dimOthers() &&\n this.activeMark.index() !== -1 &&\n this.activeMark.index() !== index\n );\n }\n\n protected onMarkNavigation(event: KeyboardEvent, index: number): void {\n this.roving.navigate(\n event,\n index,\n (event.currentTarget as Element).closest('svg'),\n );\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.stages()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.stage.label,\n value: entry.stage.value,\n formatted: `${entry.formattedValue} · ${entry.formattedPercent}`,\n color: entry.color,\n detail:\n entry.formattedDrop === '—'\n ? ''\n : this.intl().chart.fellAway(entry.formattedDrop),\n },\n ],\n };\n },\n );\n\n protected readonly viewBox = `0 0 ${FUNNEL_VIEW_BOX_WIDTH} ${FUNNEL_VIEW_BOX_HEIGHT}`;\n\n /** The gap between two bands, painted as a TRANSPARENT STROKE on each. A stroke straddles the\n * edge it is drawn on, so each band claims half the gap above it and half below — the gap stays\n * exactly as wide to the eye and stops being dead space to the pointer. */\n protected readonly hitGapUnits = computed(() =>\n stageGapUnits(this.data().length, FUNNEL_VIEW_BOX_HEIGHT),\n );\n\n protected readonly tableRows = computed<readonly ChartDataRow[]>(() =>\n this.stages().map((entry) => ({\n key: entry.stage.id,\n cells: [entry.stage.label, entry.formattedValue],\n })),\n );\n\n protected readonly stages = computed(() => {\n const data = this.data();\n const values = data.map((stage) => stage.value);\n const geometry = funnelGeometry(values, this.shape());\n const drops = stageDrops(values);\n const gapUnits = stageGapUnits(data.length, FUNNEL_VIEW_BOX_HEIGHT);\n const format = (value: number) =>\n this.valueFormatResolved()(value, 'tooltip');\n // Every stage is a share of the funnel's mouth, not of the column total:\n // the stages are nested subsets, so they do not add up to 100%.\n const firstValue = values.length ? values[0] : 0;\n // The stages are one quantity draining, not eight categories, so they take a\n // single-hue ramp. The last one is the outcome the funnel is read for, so it\n // leaves the ramp and takes the accent.\n const lastIndex = data.length - 1;\n\n return data.map((stage, index) => {\n const drop = drops[index];\n\n return {\n stage,\n // The middle of the band, for the marker that says this one is held. A polygon has no\n // centre of its own, and its bounding box centre drifts outside a steeply tapered band.\n center: stageCenter(\n geometry[index],\n FUNNEL_VIEW_BOX_WIDTH,\n FUNNEL_VIEW_BOX_HEIGHT,\n ),\n points: stagePolygonPoints(\n geometry[index],\n FUNNEL_VIEW_BOX_WIDTH,\n FUNNEL_VIEW_BOX_HEIGHT,\n gapUnits,\n ),\n formattedValue: format(stage.value),\n formattedPercent: formatPercent(\n stage.value,\n firstValue,\n this.defaults.locale,\n ),\n formattedDrop: formatDrop(\n drop,\n index > 0 ? values[index - 1] - stage.value : null,\n this.drop(),\n format,\n this.defaults.locale,\n ),\n color:\n index === lastIndex\n ? chartColors.seriesAccent\n : CHART_RAMP_COLORS[\n rampPosition(index, lastIndex, CHART_RAMP_COLORS.length)\n ],\n };\n });\n });\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.intl().chart,\n this.caption() ?? this.intl().chart.title,\n this.data().map((stage) => ({\n label: stage.label,\n value: stage.value,\n })),\n (value) => this.valueFormatResolved()(value, 'tooltip'),\n this.showTable() || this.dataTableResolved() !== 'none',\n ),\n );\n\n protected entryLabel(entry: {\n stage: FunnelChartStage;\n formattedValue: string;\n }): string {\n return `${entry.stage.label}, ${entry.formattedValue}`;\n }\n\n protected onStageKey(stage: FunnelChartStage, event: Event): void {\n // A key pressed on a control inside the stage belongs to that control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.stageClicked.emit(stage);\n }\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n protected readonly showDataTable = computed(\n () => this.dataTableResolved() !== 'none' && !this.showTable(),\n );\n\n protected readonly chartHeight = computed(\n () =>\n `calc(var(--_funnel-chart-stage-height) * ${Math.max(this.data().length, 1)})`,\n );\n\n /** Placeholder stage widths while loading. The count follows the real stage\n * count so the chart does not resize when the data lands, falling back to\n * three when `data` is still empty. The widths vary — and deliberately do\n * not narrow in order — because a column of equal full-width bars is\n * indistinguishable from a funnel whose stages have all gone grey, and a\n * narrowing one just reads as the funnel itself. Same reasoning as the\n * table's skeleton rows. */\n protected readonly skeletonStages = computed(() =>\n Array.from(\n { length: Math.max(this.data().length, 3) },\n (unusedEntry, index) =>\n SKELETON_STAGE_WIDTHS[index % SKELETON_STAGE_WIDTHS.length],\n ),\n );\n}\n","<figure class=\"funnel-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n {{ intl().chart.unpin }}\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading() || !renderReady()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholderWidth of skeletonStages(); track $index) {\n <ds-skeleton height=\"calc(var(--_funnel-chart-stage-height) - var(--_funnel-chart-stage-gap))\"\n [shimmer]=\"loading()\"\n [width]=\"placeholderWidth\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"shape\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPinned]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n preserveAspectRatio=\"none\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n [style.block-size]=\"chartHeight()\">\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <polygon\n class=\"stage\"\n [attr.stroke-width]=\"hitGapUnits()\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [attr.points]=\"entry.points\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (animate.leave)=\"leaveMark($event)\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.stage, index, $event)\"\n (keydown.enter)=\"onStageKey(entry.stage, $event)\"\n (keydown.space)=\"onStageKey(entry.stage, $event)\">\n </polygon>\n }\n </svg>\n\n @if (pinnedCenter(); as center) {\n <span\n class=\"pin-marker\"\n [style.left.%]=\"center.xPercent\"\n [style.top.%]=\"center.yPercent\">\n <ds-icon\n name=\"pin\"\n [size]=\"13\" />\n </span>\n }\n </div>\n\n @if (showTable()) {\n <table class=\"stage-table\">\n <caption class=\"visually-hidden\">\n {{\n intl().chart.funnelCaption\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n {{ intl().chart.stageColumn }}\n </th>\n\n <th scope=\"col\">\n {{ intl().chart.valueColumn }}\n </th>\n\n <th scope=\"col\">\n {{ intl().chart.percentColumn }}\n </th>\n\n @if (drop() !== 'none') {\n <th scope=\"col\">\n {{ intl().chart.dropColumn }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <tr\n (pointerenter)=\"onRowEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\">\n <th scope=\"row\">\n <span\n class=\"swatch\"\n aria-hidden=\"true\"\n [style.background]=\"entry.color\">\n </span>\n\n {{ entry.stage.label }}\n </th>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n\n @if (drop() !== 'none') {\n <td>\n {{ entry.formattedDrop }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n\n @if (showDataTable()) {\n <ds-chart-data-table\n [columns]=\"[intl().chart.labelColumn, intl().chart.valueColumn]\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\" />\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAEA;AAC2D;AACpD,MAAM,iBAAiB,GAAG,IAAI;AAErC;;AAE2D;SAC3C,YAAY,CAC1B,KAAa,EACb,WAAmB,EACnB,UAAkB,EAAA;IAElB,IAAI,UAAU,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,EAAE;AACvC,QAAA,OAAO,CAAC;IACV;IACA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,WAAW,GAAG,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,CAAC,CAAC;AAE3E,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC;AACxD;AAEA;AACuD;AAChD,MAAM,qBAAqB,GAAG,GAAG;AAEjC,MAAM,sBAAsB,GAAG,GAAG;AAEzC;;AAEmE;AACnE,MAAM,sBAAsB,GAAG,IAAI;AAWnC;;;AAGa;AACP,SAAU,cAAc,CAAC,MAAyB,EAAA;AACtD,IAAA,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KACtB,MAAM,CAAC,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A,CAAA,uzPAAA,CAAA,EAAA;46DAuH3C,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnNtB;;AAEG;;;;"}
@@ -1,9 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, output, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
- import { resolveChartDefaults, CHART_HEAT_COLORS } from '@ids-group-ltd/ids-design-system/components';
2
+ import { input, booleanAttribute, output, inject, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
+ import { chartRenderGate, resolveChartDefaults, CHART_HEAT_COLORS } from '@ids-group-ltd/ids-design-system/components';
4
4
  import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
5
5
  import { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';
6
6
  import { chartActiveMark, ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
7
+ import { DS_INTL } from '@ids-group-ltd/ids-design-system/core';
7
8
 
8
9
  /** The reading's step on a ramp of `stepCount` colours, or `null` where there is no reading to
9
10
  * place. A `null` step is not the coldest one: an absent measurement and the smallest measured
@@ -43,6 +44,7 @@ function heatmapDomain(rows) {
43
44
  * charts - WCAG 1.4.1 is not satisfied by a grid of coloured squares.
44
45
  */
45
46
  class HeatmapChartComponent {
47
+ renderReady = chartRenderGate();
46
48
  /** The column headings, left to right. Their count decides how many readings of a row are drawn:
47
49
  * a row longer than this loses its tail, a shorter one ends early. */
48
50
  columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
@@ -75,10 +77,10 @@ class HeatmapChartComponent {
75
77
  /** Separate from an empty matrix: "the request failed" and "there is nothing to show" read the
76
78
  * same and mean opposite things. */
77
79
  error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
78
- /** Shown when there are no rows or no columns. Unset falls back to `DS_CONFIG.chart.emptyText`. */
80
+ /** Shown when there are no rows or no columns. Unset falls back to `DS_INTL.chart.empty`. */
79
81
  emptyText = input(null, ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
80
82
  /** Shown in place of the grid while `error` is set. Unset falls back to
81
- * `DS_CONFIG.chart.errorText`. */
83
+ * `DS_INTL.chart.error`. */
82
84
  errorText = input(null, ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
83
85
  /** Formats every reading the chart prints - the scale's two ends, each cell's accessible name
84
86
  * and the annex table. Unset falls back to `DS_CONFIG.chart.valueFormat`. */
@@ -90,6 +92,7 @@ class HeatmapChartComponent {
90
92
  * cell, which has no reading to drill into. */
91
93
  cellClicked = output();
92
94
  defaults = resolveChartDefaults(this);
95
+ intl = inject(DS_INTL);
93
96
  frameResolved = this.defaults.frame;
94
97
  emptyTextResolved = this.defaults.emptyText;
95
98
  errorTextResolved = this.defaults.errorText;
@@ -138,7 +141,9 @@ class HeatmapChartComponent {
138
141
  const step = value === null
139
142
  ? null
140
143
  : rampIndexOf(value, min, max, CHART_HEAT_COLORS.length);
141
- const formattedValue = value === null ? 'No reading' : format(value, 'tooltip');
144
+ const formattedValue = value === null
145
+ ? this.intl().chart.noReading
146
+ : format(value, 'tooltip');
142
147
  return {
143
148
  key: `${row.id ?? rowIndex}-${columnIndex}`,
144
149
  columnIndex,
@@ -160,8 +165,7 @@ class HeatmapChartComponent {
160
165
  const caption = this.caption();
161
166
  const { min, max } = this.domain();
162
167
  const format = this.valueFormatResolved();
163
- const size = `${this.data().length} rows by ${this.columns().length} columns`;
164
- return `${caption ?? 'Heat map'}, ${size}, readings from ${format(min, 'tooltip')} to ${format(max, 'tooltip')}.`;
168
+ return this.intl().chart.heatmapSummary(caption ?? this.intl().chart.heatmapTitle, this.data().length, this.columns().length, format(min, 'tooltip'), format(max, 'tooltip'));
165
169
  }, ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
166
170
  skeletonRows = computed(() => Array.from({ length: Math.max(this.data().length, 4) }), ...(ngDevMode ? [{ debugName: "skeletonRows" }] : /* istanbul ignore next */ []));
167
171
  /** Flattened so one index addresses a cell: `chartActiveMark` counts marks, and a grid's marks
@@ -200,13 +204,13 @@ class HeatmapChartComponent {
200
204
  });
201
205
  }
202
206
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HeatmapChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
203
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: HeatmapChartComponent, isStandalone: true, selector: "ds-heatmap-chart", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cellClicked: "cellClicked" }, host: { properties: { "class.framed": "frameResolved() === 'auto'" } }, exportAs: ["dsHeatmapChart"], ngImport: i0, template: "<figure class=\"heatmap-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_heatmap-chart-cell-size)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"grid-scroll\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\">\n <table\n class=\"grid\"\n [class.dims-others]=\"dimOthers()\">\n <thead>\n <tr>\n <td class=\"corner\"></td>\n\n @for (column of columns(); track column) {\n <th\n class=\"column-label\"\n scope=\"col\">\n {{ column }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key; let rowIndex = $index) {\n <tr>\n <th\n class=\"row-label\"\n scope=\"row\">\n {{ entry.row.label }}\n </th>\n\n @for (cell of entry.cells; track cell.key) {\n <td\n class=\"cell-slot\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n <!-- A button only where a click means something: an unmeasured cell has no\n reading to drill into, and a grid of dead buttons is a tab trap. -->\n @if (interactive() && cell.value !== null) {\n <button\n class=\"cell interactive\"\n type=\"button\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\"\n (click)=\"onCellClick(entry, cell, rowIndex)\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \"\n (focus)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n @if (showValues()) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </button>\n } @else {\n <span\n class=\"cell\"\n role=\"img\"\n [class.is-missing]=\"cell.value === null\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\">\n @if (showValues() && cell.value !== null) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"scale\">\n <span class=\"scale-label\">\n {{ scaleMinLabel() }}\n </span>\n\n <span\n class=\"scale-ramp\"\n aria-hidden=\"true\">\n @for (step of scaleSteps(); track step) {\n <span\n class=\"scale-step\"\n [style.background]=\"step\">\n </span>\n }\n </span>\n\n <span class=\"scale-label\">\n {{ scaleMaxLabel() }}\n </span>\n </div>\n\n <!-- Always present, never a `dataTable` choice: colour is the only channel carrying magnitude\n on the grid, so the numbers have to be reachable somewhere that is not a colour. -->\n <ds-chart-data-table\n rowHeader\n [columns]=\"tableColumns()\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\" />\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.heatmap-chart{--_heatmap-chart-cell-size: var(--ds-heatmap-chart-cell-size, 34px);--_heatmap-chart-cell-gap: var(--ds-heatmap-chart-cell-gap, 2px);--_heatmap-chart-cell-radius: var(--ds-heatmap-chart-cell-radius, var(--ds-radius-control));--_heatmap-chart-label-color: var(--ds-heatmap-chart-label-color, var(--ds-chart-axis-label-color));--_heatmap-chart-label-font-size: var(--ds-heatmap-chart-label-font-size, var(--ds-chart-axis-font-size));--_heatmap-chart-missing-color: var(--ds-heatmap-chart-missing-color, var(--surface-secondary));--_heatmap-chart-focus-color: var(--ds-heatmap-chart-focus-color, var(--focus-ring-color));--_heatmap-chart-focus-width: var(--ds-heatmap-chart-focus-width, var(--focus-ring-width));--ds-chart-focus-ring-color: var(--_heatmap-chart-focus-color);--focus-ring-color: var(--_heatmap-chart-focus-color);--focus-ring-width: var(--_heatmap-chart-focus-width);margin:0}.empty{display:grid;place-items:center;min-block-size:calc(4 * var(--_heatmap-chart-cell-size));margin:0;color:var(--text-secondary);text-align:center}.skeleton{display:grid;gap:var(--_heatmap-chart-cell-gap)}.grid-scroll{overflow-x:auto}.grid .cell{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),background var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.grid .cell.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.grid.dims-others:not(:has(.cell.is-pinned)):has(.cell.interactive:hover) .cell.interactive:not(:hover),.grid.dims-others:not(:has(.cell.is-pinned)):has(.cell.interactive:focus-visible) .cell.interactive:not(:focus-visible),.grid.dims-others:has(.cell.is-pinned) .cell:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.grid{border-collapse:separate;border-spacing:var(--_heatmap-chart-cell-gap)}.column-label,.row-label{color:var(--_heatmap-chart-label-color);font-size:var(--_heatmap-chart-label-font-size);font-weight:var(--font-weight-regular);white-space:nowrap}.column-label{text-align:center}.row-label{text-align:end;padding-inline-end:var(--space-2)}.cell-slot{padding:0}.cell{display:grid;place-items:center;inline-size:var(--_heatmap-chart-cell-size);block-size:var(--_heatmap-chart-cell-size);border:0;border-radius:var(--_heatmap-chart-cell-radius);padding:0}.cell.is-missing{background:var(--_heatmap-chart-missing-color)}.cell-value{font-size:var(--font-size-xs);font-weight:var(--font-weight-bold);color:#fff;mix-blend-mode:difference}.cell.interactive{cursor:pointer}.cell.interactive:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.scale{display:flex;align-items:center;gap:var(--space-2);margin-block-start:var(--space-3)}.scale-ramp{display:flex}.scale-step{inline-size:var(--space-4);block-size:var(--space-2)}.scale-step:first-child{border-start-start-radius:var(--ds-radius-control);border-end-start-radius:var(--ds-radius-control)}.scale-step:last-child{border-start-end-radius:var(--ds-radius-control);border-end-end-radius:var(--ds-radius-control)}.scale-label{color:var(--_heatmap-chart-label-color);font-size:var(--_heatmap-chart-label-font-size)}\n"], dependencies: [{ kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPreferBelow"] }, { kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "component", type: ChartDataTableComponent, selector: "ds-chart-data-table", inputs: ["columns", "rows", "caption", "open", "rowHeader"], outputs: ["toggled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
207
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: HeatmapChartComponent, isStandalone: true, selector: "ds-heatmap-chart", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, showValues: { classPropertyName: "showValues", publicName: "showValues", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cellClicked: "cellClicked" }, host: { properties: { "class.framed": "frameResolved() === 'auto'" } }, exportAs: ["dsHeatmapChart"], ngImport: i0, template: "<figure class=\"heatmap-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading() || !renderReady()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_heatmap-chart-cell-size)\" [shimmer]=\"loading()\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"grid-scroll\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\">\n <table\n class=\"grid\"\n [class.dims-others]=\"dimOthers()\">\n <thead>\n <tr>\n <td class=\"corner\"></td>\n\n @for (column of columns(); track column) {\n <th\n class=\"column-label\"\n scope=\"col\">\n {{ column }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key; let rowIndex = $index) {\n <tr>\n <th\n class=\"row-label\"\n scope=\"row\">\n {{ entry.row.label }}\n </th>\n\n @for (cell of entry.cells; track cell.key) {\n <td\n class=\"cell-slot\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n <!-- A button only where a click means something: an unmeasured cell has no\n reading to drill into, and a grid of dead buttons is a tab trap. -->\n @if (interactive() && cell.value !== null) {\n <button\n class=\"cell interactive\"\n type=\"button\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\"\n (click)=\"onCellClick(entry, cell, rowIndex)\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \"\n (focus)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n @if (showValues()) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </button>\n } @else {\n <span\n class=\"cell\"\n role=\"img\"\n [class.is-missing]=\"cell.value === null\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\">\n @if (showValues() && cell.value !== null) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"scale\">\n <span class=\"scale-label\">\n {{ scaleMinLabel() }}\n </span>\n\n <span\n class=\"scale-ramp\"\n aria-hidden=\"true\">\n @for (step of scaleSteps(); track step) {\n <span\n class=\"scale-step\"\n [style.background]=\"step\">\n </span>\n }\n </span>\n\n <span class=\"scale-label\">\n {{ scaleMaxLabel() }}\n </span>\n </div>\n\n <!-- Always present, never a `dataTable` choice: colour is the only channel carrying magnitude\n on the grid, so the numbers have to be reachable somewhere that is not a colour. -->\n <ds-chart-data-table\n rowHeader\n [columns]=\"tableColumns()\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\" />\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.heatmap-chart{--_heatmap-chart-cell-size: var(--ds-heatmap-chart-cell-size, 34px);--_heatmap-chart-cell-gap: var(--ds-heatmap-chart-cell-gap, 2px);--_heatmap-chart-cell-radius: var(--ds-heatmap-chart-cell-radius, var(--ds-radius-control));--_heatmap-chart-label-color: var(--ds-heatmap-chart-label-color, var(--ds-chart-axis-label-color));--_heatmap-chart-label-font-size: var(--ds-heatmap-chart-label-font-size, var(--ds-chart-axis-font-size));--_heatmap-chart-missing-color: var(--ds-heatmap-chart-missing-color, var(--surface-secondary));--_heatmap-chart-focus-color: var(--ds-heatmap-chart-focus-color, var(--focus-ring-color));--_heatmap-chart-focus-width: var(--ds-heatmap-chart-focus-width, var(--focus-ring-width));--ds-chart-focus-ring-color: var(--_heatmap-chart-focus-color);--focus-ring-color: var(--_heatmap-chart-focus-color);--focus-ring-width: var(--_heatmap-chart-focus-width);margin:0}.empty{display:grid;place-items:center;min-block-size:calc(4 * var(--_heatmap-chart-cell-size));margin:0;color:var(--text-secondary);text-align:center}.skeleton{display:grid;gap:var(--_heatmap-chart-cell-gap)}.grid-scroll{overflow-x:auto}.grid .cell{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),background var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.grid .cell.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.grid.dims-others:not(:has(.cell.is-pinned)):has(.cell.interactive:hover) .cell.interactive:not(:hover),.grid.dims-others:not(:has(.cell.is-pinned)):has(.cell.interactive:focus-visible) .cell.interactive:not(:focus-visible),.grid.dims-others:has(.cell.is-pinned) .cell:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.grid{border-collapse:separate;border-spacing:var(--_heatmap-chart-cell-gap)}.column-label,.row-label{color:var(--_heatmap-chart-label-color);font-size:var(--_heatmap-chart-label-font-size);font-weight:var(--font-weight-regular);white-space:nowrap}.column-label{text-align:center}.row-label{text-align:end;padding-inline-end:var(--space-2)}.cell-slot{padding:0}.cell{display:grid;place-items:center;inline-size:var(--_heatmap-chart-cell-size);block-size:var(--_heatmap-chart-cell-size);border:0;border-radius:var(--_heatmap-chart-cell-radius);padding:0}.cell.is-missing{background:var(--_heatmap-chart-missing-color)}.cell-value{font-size:var(--font-size-xs);font-weight:var(--font-weight-bold);color:#fff;mix-blend-mode:difference}.cell.interactive{cursor:pointer}.cell.interactive:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.scale{display:flex;align-items:center;gap:var(--space-2);margin-block-start:var(--space-3)}.scale-ramp{display:flex}.scale-step{inline-size:var(--space-4);block-size:var(--space-2)}.scale-step:first-child{border-start-start-radius:var(--ds-radius-control);border-end-start-radius:var(--ds-radius-control)}.scale-step:last-child{border-start-end-radius:var(--ds-radius-control);border-end-end-radius:var(--ds-radius-control)}.scale-label{color:var(--_heatmap-chart-label-color);font-size:var(--_heatmap-chart-label-font-size)}\n"], dependencies: [{ kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPinned"] }, { kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline", "shimmer"] }, { kind: "component", type: ChartDataTableComponent, selector: "ds-chart-data-table", inputs: ["columns", "rows", "caption", "open", "rowHeader"], outputs: ["toggled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
204
208
  }
205
209
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: HeatmapChartComponent, decorators: [{
206
210
  type: Component,
207
211
  args: [{ selector: 'ds-heatmap-chart', standalone: true, exportAs: 'dsHeatmapChart', imports: [ChartTooltipDirective, SkeletonComponent, ChartDataTableComponent], host: {
208
212
  '[class.framed]': "frameResolved() === 'auto'",
209
- }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure class=\"heatmap-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_heatmap-chart-cell-size)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"grid-scroll\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\">\n <table\n class=\"grid\"\n [class.dims-others]=\"dimOthers()\">\n <thead>\n <tr>\n <td class=\"corner\"></td>\n\n @for (column of columns(); track column) {\n <th\n class=\"column-label\"\n scope=\"col\">\n {{ column }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key; let rowIndex = $index) {\n <tr>\n <th\n class=\"row-label\"\n scope=\"row\">\n {{ entry.row.label }}\n </th>\n\n @for (cell of entry.cells; track cell.key) {\n <td\n class=\"cell-slot\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n <!-- A button only where a click means something: an unmeasured cell has no\n reading to drill into, and a grid of dead buttons is a tab trap. -->\n @if (interactive() && cell.value !== null) {\n <button\n class=\"cell interactive\"\n type=\"button\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\"\n (click)=\"onCellClick(entry, cell, rowIndex)\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \"\n (focus)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n @if (showValues()) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </button>\n } @else {\n <span\n class=\"cell\"\n role=\"img\"\n [class.is-missing]=\"cell.value === null\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\">\n @if (showValues() && cell.value !== null) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"scale\">\n <span class=\"scale-label\">\n {{ scaleMinLabel() }}\n </span>\n\n <span\n class=\"scale-ramp\"\n aria-hidden=\"true\">\n @for (step of scaleSteps(); track step) {\n <span\n class=\"scale-step\"\n [style.background]=\"step\">\n </span>\n }\n </span>\n\n <span class=\"scale-label\">\n {{ scaleMaxLabel() }}\n </span>\n </div>\n\n <!-- Always present, never a `dataTable` choice: colour is the only channel carrying magnitude\n on the grid, so the numbers have to be reachable somewhere that is not a colour. -->\n <ds-chart-data-table\n rowHeader\n [columns]=\"tableColumns()\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\" />\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.heatmap-chart{--_heatmap-chart-cell-size: var(--ds-heatmap-chart-cell-size, 34px);--_heatmap-chart-cell-gap: var(--ds-heatmap-chart-cell-gap, 2px);--_heatmap-chart-cell-radius: var(--ds-heatmap-chart-cell-radius, var(--ds-radius-control));--_heatmap-chart-label-color: var(--ds-heatmap-chart-label-color, var(--ds-chart-axis-label-color));--_heatmap-chart-label-font-size: var(--ds-heatmap-chart-label-font-size, var(--ds-chart-axis-font-size));--_heatmap-chart-missing-color: var(--ds-heatmap-chart-missing-color, var(--surface-secondary));--_heatmap-chart-focus-color: var(--ds-heatmap-chart-focus-color, var(--focus-ring-color));--_heatmap-chart-focus-width: var(--ds-heatmap-chart-focus-width, var(--focus-ring-width));--ds-chart-focus-ring-color: var(--_heatmap-chart-focus-color);--focus-ring-color: var(--_heatmap-chart-focus-color);--focus-ring-width: var(--_heatmap-chart-focus-width);margin:0}.empty{display:grid;place-items:center;min-block-size:calc(4 * var(--_heatmap-chart-cell-size));margin:0;color:var(--text-secondary);text-align:center}.skeleton{display:grid;gap:var(--_heatmap-chart-cell-gap)}.grid-scroll{overflow-x:auto}.grid .cell{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),background var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.grid .cell.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.grid.dims-others:not(:has(.cell.is-pinned)):has(.cell.interactive:hover) .cell.interactive:not(:hover),.grid.dims-others:not(:has(.cell.is-pinned)):has(.cell.interactive:focus-visible) .cell.interactive:not(:focus-visible),.grid.dims-others:has(.cell.is-pinned) .cell:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.grid{border-collapse:separate;border-spacing:var(--_heatmap-chart-cell-gap)}.column-label,.row-label{color:var(--_heatmap-chart-label-color);font-size:var(--_heatmap-chart-label-font-size);font-weight:var(--font-weight-regular);white-space:nowrap}.column-label{text-align:center}.row-label{text-align:end;padding-inline-end:var(--space-2)}.cell-slot{padding:0}.cell{display:grid;place-items:center;inline-size:var(--_heatmap-chart-cell-size);block-size:var(--_heatmap-chart-cell-size);border:0;border-radius:var(--_heatmap-chart-cell-radius);padding:0}.cell.is-missing{background:var(--_heatmap-chart-missing-color)}.cell-value{font-size:var(--font-size-xs);font-weight:var(--font-weight-bold);color:#fff;mix-blend-mode:difference}.cell.interactive{cursor:pointer}.cell.interactive:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.scale{display:flex;align-items:center;gap:var(--space-2);margin-block-start:var(--space-3)}.scale-ramp{display:flex}.scale-step{inline-size:var(--space-4);block-size:var(--space-2)}.scale-step:first-child{border-start-start-radius:var(--ds-radius-control);border-end-start-radius:var(--ds-radius-control)}.scale-step:last-child{border-start-end-radius:var(--ds-radius-control);border-end-end-radius:var(--ds-radius-control)}.scale-label{color:var(--_heatmap-chart-label-color);font-size:var(--_heatmap-chart-label-font-size)}\n"] }]
213
+ }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure class=\"heatmap-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading() || !renderReady()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_heatmap-chart-cell-size)\" [shimmer]=\"loading()\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"grid-scroll\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\">\n <table\n class=\"grid\"\n [class.dims-others]=\"dimOthers()\">\n <thead>\n <tr>\n <td class=\"corner\"></td>\n\n @for (column of columns(); track column) {\n <th\n class=\"column-label\"\n scope=\"col\">\n {{ column }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key; let rowIndex = $index) {\n <tr>\n <th\n class=\"row-label\"\n scope=\"row\">\n {{ entry.row.label }}\n </th>\n\n @for (cell of entry.cells; track cell.key) {\n <td\n class=\"cell-slot\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n <!-- A button only where a click means something: an unmeasured cell has no\n reading to drill into, and a grid of dead buttons is a tab trap. -->\n @if (interactive() && cell.value !== null) {\n <button\n class=\"cell interactive\"\n type=\"button\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\"\n (click)=\"onCellClick(entry, cell, rowIndex)\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \"\n (focus)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n @if (showValues()) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </button>\n } @else {\n <span\n class=\"cell\"\n role=\"img\"\n [class.is-missing]=\"cell.value === null\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\">\n @if (showValues() && cell.value !== null) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"scale\">\n <span class=\"scale-label\">\n {{ scaleMinLabel() }}\n </span>\n\n <span\n class=\"scale-ramp\"\n aria-hidden=\"true\">\n @for (step of scaleSteps(); track step) {\n <span\n class=\"scale-step\"\n [style.background]=\"step\">\n </span>\n }\n </span>\n\n <span class=\"scale-label\">\n {{ scaleMaxLabel() }}\n </span>\n </div>\n\n <!-- Always present, never a `dataTable` choice: colour is the only channel carrying magnitude\n on the grid, so the numbers have to be reachable somewhere that is not a colour. -->\n <ds-chart-data-table\n rowHeader\n [columns]=\"tableColumns()\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\" />\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.heatmap-chart{--_heatmap-chart-cell-size: var(--ds-heatmap-chart-cell-size, 34px);--_heatmap-chart-cell-gap: var(--ds-heatmap-chart-cell-gap, 2px);--_heatmap-chart-cell-radius: var(--ds-heatmap-chart-cell-radius, var(--ds-radius-control));--_heatmap-chart-label-color: var(--ds-heatmap-chart-label-color, var(--ds-chart-axis-label-color));--_heatmap-chart-label-font-size: var(--ds-heatmap-chart-label-font-size, var(--ds-chart-axis-font-size));--_heatmap-chart-missing-color: var(--ds-heatmap-chart-missing-color, var(--surface-secondary));--_heatmap-chart-focus-color: var(--ds-heatmap-chart-focus-color, var(--focus-ring-color));--_heatmap-chart-focus-width: var(--ds-heatmap-chart-focus-width, var(--focus-ring-width));--ds-chart-focus-ring-color: var(--_heatmap-chart-focus-color);--focus-ring-color: var(--_heatmap-chart-focus-color);--focus-ring-width: var(--_heatmap-chart-focus-width);margin:0}.empty{display:grid;place-items:center;min-block-size:calc(4 * var(--_heatmap-chart-cell-size));margin:0;color:var(--text-secondary);text-align:center}.skeleton{display:grid;gap:var(--_heatmap-chart-cell-gap)}.grid-scroll{overflow-x:auto}.grid .cell{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),background var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.grid .cell.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.grid.dims-others:not(:has(.cell.is-pinned)):has(.cell.interactive:hover) .cell.interactive:not(:hover),.grid.dims-others:not(:has(.cell.is-pinned)):has(.cell.interactive:focus-visible) .cell.interactive:not(:focus-visible),.grid.dims-others:has(.cell.is-pinned) .cell:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.grid{border-collapse:separate;border-spacing:var(--_heatmap-chart-cell-gap)}.column-label,.row-label{color:var(--_heatmap-chart-label-color);font-size:var(--_heatmap-chart-label-font-size);font-weight:var(--font-weight-regular);white-space:nowrap}.column-label{text-align:center}.row-label{text-align:end;padding-inline-end:var(--space-2)}.cell-slot{padding:0}.cell{display:grid;place-items:center;inline-size:var(--_heatmap-chart-cell-size);block-size:var(--_heatmap-chart-cell-size);border:0;border-radius:var(--_heatmap-chart-cell-radius);padding:0}.cell.is-missing{background:var(--_heatmap-chart-missing-color)}.cell-value{font-size:var(--font-size-xs);font-weight:var(--font-weight-bold);color:#fff;mix-blend-mode:difference}.cell.interactive{cursor:pointer}.cell.interactive:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}.scale{display:flex;align-items:center;gap:var(--space-2);margin-block-start:var(--space-3)}.scale-ramp{display:flex}.scale-step{inline-size:var(--space-4);block-size:var(--space-2)}.scale-step:first-child{border-start-start-radius:var(--ds-radius-control);border-end-start-radius:var(--ds-radius-control)}.scale-step:last-child{border-start-end-radius:var(--ds-radius-control);border-end-end-radius:var(--ds-radius-control)}.scale-label{color:var(--_heatmap-chart-label-color);font-size:var(--_heatmap-chart-label-font-size)}\n"] }]
210
214
  }], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], cellClicked: [{ type: i0.Output, args: ["cellClicked"] }] } });
211
215
 
212
216
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-heatmap-chart.mjs","sources":["../../../src/lib/components/heatmap-chart/heatmap-chart.math.ts","../../../src/lib/components/heatmap-chart/heatmap-chart.component.ts","../../../src/lib/components/heatmap-chart/heatmap-chart.component.html","../../../src/lib/components/heatmap-chart/ids-group-ltd-ids-design-system-components-heatmap-chart.ts"],"sourcesContent":["import type { HeatmapChartRow } from './heatmap-chart.types';\n\n/** The reading's step on a ramp of `stepCount` colours, or `null` where there is no reading to\n * place. A `null` step is not the coldest one: an absent measurement and the smallest measured\n * value are different facts, and painting them the same colour is the failure this return exists\n * to prevent.\n *\n * @internal */\nexport function rampIndexOf(\n value: number,\n domainMin: number,\n domainMax: number,\n stepCount: number,\n): number | null {\n if (!Number.isFinite(value) || stepCount < 1) {\n return null;\n }\n const span = domainMax - domainMin;\n if (!Number.isFinite(span) || span <= 0) {\n return 0;\n }\n const share = Math.min(1, Math.max(0, (value - domainMin) / span));\n\n return Math.floor(share * (stepCount - 1));\n}\n\n/** The span every cell is coloured against. Built from the readings alone: a `null` is a hole, so\n * it neither lowers the floor to zero nor counts as a measurement.\n *\n * @internal */\nexport function heatmapDomain(rows: readonly HeatmapChartRow[]): {\n min: number;\n max: number;\n} {\n const readings = rows\n .flatMap((row) => row.data)\n .filter(\n (value): value is number =>\n typeof value === 'number' && Number.isFinite(value),\n );\n\n return readings.length === 0\n ? { min: 0, max: 0 }\n : { min: Math.min(...readings), max: Math.max(...readings) };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n output,\n} from '@angular/core';\nimport { CHART_HEAT_COLORS } from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport type { ChartDataRow } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { heatmapDomain, rampIndexOf } from './heatmap-chart.math';\nimport type { HeatmapChartCell, HeatmapChartRow } from './heatmap-chart.types';\nimport { resolveChartDefaults } from '@ids-group-ltd/ids-design-system/components';\n\ninterface PlacedCell {\n readonly key: string;\n readonly columnIndex: number;\n readonly column: string;\n readonly value: number | null;\n readonly color: string | null;\n readonly formattedValue: string;\n readonly accessibleName: string;\n}\n\ninterface PlacedRow {\n readonly key: string;\n readonly row: HeatmapChartRow;\n readonly cells: readonly PlacedCell[];\n}\n\n/**\n * A matrix of readings, coloured by magnitude: depot by weekday, hour by date, queue by region.\n *\n * Colour carries the quantity and nothing else carries it on the plot, so every cell names its own\n * reading to assistive tech and the annex table is not optional here the way it is on the other\n * charts - WCAG 1.4.1 is not satisfied by a grid of coloured squares.\n */\n@Component({\n selector: 'ds-heatmap-chart',\n standalone: true,\n exportAs: 'dsHeatmapChart',\n imports: [ChartTooltipDirective, SkeletonComponent, ChartDataTableComponent],\n templateUrl: './heatmap-chart.component.html',\n styleUrl: './heatmap-chart.component.scss',\n host: {\n '[class.framed]': \"frameResolved() === 'auto'\",\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HeatmapChartComponent {\n /** The column headings, left to right. Their count decides how many readings of a row are drawn:\n * a row longer than this loses its tail, a shorter one ends early. */\n readonly columns = input<readonly string[]>([]);\n\n /** One entry per row, each carrying one reading per column. A `null` reading is a cell that\n * was never measured and is drawn as the surface rather than as the ramp's coldest step. */\n readonly data = input<readonly HeatmapChartRow[]>([]);\n\n /** Printed above the grid as the visible title. */\n readonly caption = input<string | null>(null);\n\n /** Pins the floor of the colour scale. It only ever OPENS the scale further, so a floor above\n * the data cannot push a reading off the ramp. Unset, the scale starts at the lowest reading. */\n readonly min = input<number | null>(null);\n\n /** Pins the ceiling of the colour scale, the same way `min` pins its floor. Set both to compare\n * two heat maps by colour: unset, each one spans its own readings and the same hue means a\n * different quantity on each. */\n readonly max = input<number | null>(null);\n\n /** Prints each cell's reading inside it. Off by default: a grid dense enough to be worth a heat\n * map has no room for the numbers, which is why the annex table is always there. */\n readonly showValues = input(false, { transform: booleanAttribute });\n\n /** Makes every measured cell a button. An unmeasured cell stays inert - a grid of buttons with\n * nothing behind them is a tab trap. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** Fades every cell but the one under the pointer. Off by default: the dimming costs the\n * separation BETWEEN the dimmed cells, which on a ramp is the only thing carrying magnitude. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** `'auto'` draws the bordered, padded box; `'none'` leaves it bare for a chart inside a card the\n * page has already drawn. Unset falls back to `DS_CONFIG.chart.frame`. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** A skeleton at the grid's own height, so the page does not resize when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n\n /** Separate from an empty matrix: \"the request failed\" and \"there is nothing to show\" read the\n * same and mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** Shown when there are no rows or no columns. Unset falls back to `DS_CONFIG.chart.emptyText`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shown in place of the grid while `error` is set. Unset falls back to\n * `DS_CONFIG.chart.errorText`. */\n readonly errorText = input<string | null>(null);\n\n /** Formats every reading the chart prints - the scale's two ends, each cell's accessible name\n * and the annex table. Unset falls back to `DS_CONFIG.chart.valueFormat`. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n /** Whether a hovered or focused cell opens a tooltip. A heat map's cells carry no printed value\n * by default, so this is where a reading is read without reaching for the annex table. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n /** The clicked cell, with the row and the column it sits at. Never fires for an unmeasured\n * cell, which has no reading to drill into. */\n readonly cellClicked = output<HeatmapChartCell>();\n\n private readonly defaults = resolveChartDefaults(this);\n readonly frameResolved = this.defaults.frame;\n readonly emptyTextResolved = this.defaults.emptyText;\n readonly errorTextResolved = this.defaults.errorText;\n readonly valueFormatResolved = this.defaults.valueFormat;\n\n protected readonly activeMark = chartActiveMark(() => 0);\n\n protected readonly isEmpty = computed(\n () => this.data().length === 0 || this.columns().length === 0,\n );\n\n private readonly domain = computed(() => {\n const measured = heatmapDomain(this.data());\n const askedMin = this.min();\n const askedMax = this.max();\n\n return {\n min:\n askedMin !== null &&\n Number.isFinite(askedMin) &&\n askedMin < measured.min\n ? askedMin\n : measured.min,\n max:\n askedMax !== null &&\n Number.isFinite(askedMax) &&\n askedMax > measured.max\n ? askedMax\n : measured.max,\n };\n });\n\n /** The row header column has no name of its own: the corner cell above it is blank, which is\n * what a matrix's top-left is. */\n protected readonly tableColumns = computed<readonly string[]>(() => [\n '',\n ...this.columns(),\n ]);\n\n protected readonly tableRows = computed<readonly ChartDataRow[]>(() =>\n this.rows().map((entry) => ({\n key: entry.key,\n cells: [\n entry.row.label,\n ...entry.cells.map((cell) => cell.formattedValue),\n ],\n })),\n );\n\n protected readonly rows = computed<readonly PlacedRow[]>(() => {\n const columns = this.columns();\n const { min, max } = this.domain();\n const format = this.valueFormatResolved();\n\n return this.data().map((row, rowIndex) => ({\n key: row.id ?? String(rowIndex),\n row,\n cells: columns.map((column, columnIndex) => {\n const value = row.data[columnIndex] ?? null;\n const step =\n value === null\n ? null\n : rampIndexOf(value, min, max, CHART_HEAT_COLORS.length);\n const formattedValue =\n value === null ? 'No reading' : format(value, 'tooltip');\n\n return {\n key: `${row.id ?? rowIndex}-${columnIndex}`,\n columnIndex,\n column,\n value,\n color: step === null ? null : CHART_HEAT_COLORS[step],\n formattedValue,\n accessibleName: `${row.label}, ${column}: ${formattedValue}`,\n };\n }),\n }));\n });\n\n /** The legend under the grid: the ramp's own steps with the readings at either end, which is the\n * only thing that says what a colour is worth. */\n protected readonly scaleSteps = computed(() => CHART_HEAT_COLORS);\n\n protected readonly scaleMinLabel = computed(() =>\n this.valueFormatResolved()(this.domain().min, 'tick'),\n );\n\n protected readonly scaleMaxLabel = computed(() =>\n this.valueFormatResolved()(this.domain().max, 'tick'),\n );\n\n protected readonly accessibleName = computed(() => {\n const caption = this.caption();\n const { min, max } = this.domain();\n const format = this.valueFormatResolved();\n const size = `${this.data().length} rows by ${this.columns().length} columns`;\n\n return `${caption ?? 'Heat map'}, ${size}, readings from ${format(min, 'tooltip')} to ${format(max, 'tooltip')}.`;\n });\n\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.max(this.data().length, 4) }),\n );\n\n /** Flattened so one index addresses a cell: `chartActiveMark` counts marks, and a grid's marks\n * are its cells rather than its rows. */\n private readonly flatCells = computed(() =>\n this.rows().flatMap((row) => row.cells),\n );\n\n protected cellIndex(rowIndex: number, columnIndex: number): number {\n return rowIndex * this.columns().length + columnIndex;\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const cell = this.flatCells()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !cell || cell.value === null) {\n return null;\n }\n\n return {\n category: cell.column,\n entries: [\n {\n label: cell.accessibleName.split(':')[0],\n value: cell.value,\n formatted: cell.formattedValue,\n color: cell.color ?? '',\n },\n ],\n };\n },\n );\n\n protected onCellClick(\n row: PlacedRow,\n cell: PlacedCell,\n rowIndex: number,\n ): void {\n if (cell.value === null) {\n return;\n }\n this.cellClicked.emit({\n row: row.row,\n rowIndex,\n columnIndex: cell.columnIndex,\n column: cell.column,\n value: cell.value,\n });\n }\n}\n","<figure class=\"heatmap-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_heatmap-chart-cell-size)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"grid-scroll\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\">\n <table\n class=\"grid\"\n [class.dims-others]=\"dimOthers()\">\n <thead>\n <tr>\n <td class=\"corner\"></td>\n\n @for (column of columns(); track column) {\n <th\n class=\"column-label\"\n scope=\"col\">\n {{ column }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key; let rowIndex = $index) {\n <tr>\n <th\n class=\"row-label\"\n scope=\"row\">\n {{ entry.row.label }}\n </th>\n\n @for (cell of entry.cells; track cell.key) {\n <td\n class=\"cell-slot\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n <!-- A button only where a click means something: an unmeasured cell has no\n reading to drill into, and a grid of dead buttons is a tab trap. -->\n @if (interactive() && cell.value !== null) {\n <button\n class=\"cell interactive\"\n type=\"button\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\"\n (click)=\"onCellClick(entry, cell, rowIndex)\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \"\n (focus)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n @if (showValues()) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </button>\n } @else {\n <span\n class=\"cell\"\n role=\"img\"\n [class.is-missing]=\"cell.value === null\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\">\n @if (showValues() && cell.value !== null) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"scale\">\n <span class=\"scale-label\">\n {{ scaleMinLabel() }}\n </span>\n\n <span\n class=\"scale-ramp\"\n aria-hidden=\"true\">\n @for (step of scaleSteps(); track step) {\n <span\n class=\"scale-step\"\n [style.background]=\"step\">\n </span>\n }\n </span>\n\n <span class=\"scale-label\">\n {{ scaleMaxLabel() }}\n </span>\n </div>\n\n <!-- Always present, never a `dataTable` choice: colour is the only channel carrying magnitude\n on the grid, so the numbers have to be reachable somewhere that is not a colour. -->\n <ds-chart-data-table\n rowHeader\n [columns]=\"tableColumns()\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\" />\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;;;;;AAKgB;AACV,SAAU,WAAW,CACzB,KAAa,EACb,SAAiB,EACjB,SAAiB,EACjB,SAAiB,EAAA;AAEjB,IAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS,GAAG,CAAC,EAAE;AAC5C,QAAA,OAAO,IAAI;IACb;AACA,IAAA,MAAM,IAAI,GAAG,SAAS,GAAG,SAAS;AAClC,IAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE;AACvC,QAAA,OAAO,CAAC;IACV;IACA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC;AAElE,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC;AAC5C;AAEA;;;AAGgB;AACV,SAAU,aAAa,CAAC,IAAgC,EAAA;IAI5D,MAAM,QAAQ,GAAG;SACd,OAAO,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI;AACzB,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,MAAA,EAAA,CAAA,gBAAA,EAAA,sBAAA,EAAA,wBAAA,EAAA,wBAAA,EAAA,2BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,iBAAiB,yGAAE,uBAAuB,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,SAAA,EAAA,MAAA,EAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAShE,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,UAAA,EAChB,IAAI,EAAA,QAAA,EACN,gBAAgB,EAAA,OAAA,EACjB,CAAC,qBAAqB,EAAE,iBAAiB,EAAE,uBAAuB,CAAC,EAAA,IAAA,EAGtE;AACJ,wBAAA,gBAAgB,EAAE,4BAA4B;AAC/C,qBAAA,EAAA,aAAA,EACc,iBAAiB,CAAC,QAAQ,EAAA,eAAA,EACxB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ojJAAA,EAAA,MAAA,EAAA,CAAA,+nMAAA,CAAA,EAAA;;;AE/DjD;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-heatmap-chart.mjs","sources":["../../../src/lib/components/heatmap-chart/heatmap-chart.math.ts","../../../src/lib/components/heatmap-chart/heatmap-chart.component.ts","../../../src/lib/components/heatmap-chart/heatmap-chart.component.html","../../../src/lib/components/heatmap-chart/ids-group-ltd-ids-design-system-components-heatmap-chart.ts"],"sourcesContent":["import type { HeatmapChartRow } from './heatmap-chart.types';\n\n/** The reading's step on a ramp of `stepCount` colours, or `null` where there is no reading to\n * place. A `null` step is not the coldest one: an absent measurement and the smallest measured\n * value are different facts, and painting them the same colour is the failure this return exists\n * to prevent.\n *\n * @internal */\nexport function rampIndexOf(\n value: number,\n domainMin: number,\n domainMax: number,\n stepCount: number,\n): number | null {\n if (!Number.isFinite(value) || stepCount < 1) {\n return null;\n }\n const span = domainMax - domainMin;\n if (!Number.isFinite(span) || span <= 0) {\n return 0;\n }\n const share = Math.min(1, Math.max(0, (value - domainMin) / span));\n\n return Math.floor(share * (stepCount - 1));\n}\n\n/** The span every cell is coloured against. Built from the readings alone: a `null` is a hole, so\n * it neither lowers the floor to zero nor counts as a measurement.\n *\n * @internal */\nexport function heatmapDomain(rows: readonly HeatmapChartRow[]): {\n min: number;\n max: number;\n} {\n const readings = rows\n .flatMap((row) => row.data)\n .filter(\n (value): value is number =>\n typeof value === 'number' && Number.isFinite(value),\n );\n\n return readings.length === 0\n ? { min: 0, max: 0 }\n : { min: Math.min(...readings), max: Math.max(...readings) };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n} from '@angular/core';\nimport {\n CHART_HEAT_COLORS,\n chartRenderGate,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport type { ChartDataRow } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { heatmapDomain, rampIndexOf } from './heatmap-chart.math';\nimport type { HeatmapChartCell, HeatmapChartRow } from './heatmap-chart.types';\nimport { resolveChartDefaults } from '@ids-group-ltd/ids-design-system/components';\n\ninterface PlacedCell {\n readonly key: string;\n readonly columnIndex: number;\n readonly column: string;\n readonly value: number | null;\n readonly color: string | null;\n readonly formattedValue: string;\n readonly accessibleName: string;\n}\n\ninterface PlacedRow {\n readonly key: string;\n readonly row: HeatmapChartRow;\n readonly cells: readonly PlacedCell[];\n}\n\n/**\n * A matrix of readings, coloured by magnitude: depot by weekday, hour by date, queue by region.\n *\n * Colour carries the quantity and nothing else carries it on the plot, so every cell names its own\n * reading to assistive tech and the annex table is not optional here the way it is on the other\n * charts - WCAG 1.4.1 is not satisfied by a grid of coloured squares.\n */\n@Component({\n selector: 'ds-heatmap-chart',\n standalone: true,\n exportAs: 'dsHeatmapChart',\n imports: [ChartTooltipDirective, SkeletonComponent, ChartDataTableComponent],\n templateUrl: './heatmap-chart.component.html',\n styleUrl: './heatmap-chart.component.scss',\n host: {\n '[class.framed]': \"frameResolved() === 'auto'\",\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HeatmapChartComponent {\n protected readonly renderReady = chartRenderGate();\n\n /** The column headings, left to right. Their count decides how many readings of a row are drawn:\n * a row longer than this loses its tail, a shorter one ends early. */\n readonly columns = input<readonly string[]>([]);\n\n /** One entry per row, each carrying one reading per column. A `null` reading is a cell that\n * was never measured and is drawn as the surface rather than as the ramp's coldest step. */\n readonly data = input<readonly HeatmapChartRow[]>([]);\n\n /** Printed above the grid as the visible title. */\n readonly caption = input<string | null>(null);\n\n /** Pins the floor of the colour scale. It only ever OPENS the scale further, so a floor above\n * the data cannot push a reading off the ramp. Unset, the scale starts at the lowest reading. */\n readonly min = input<number | null>(null);\n\n /** Pins the ceiling of the colour scale, the same way `min` pins its floor. Set both to compare\n * two heat maps by colour: unset, each one spans its own readings and the same hue means a\n * different quantity on each. */\n readonly max = input<number | null>(null);\n\n /** Prints each cell's reading inside it. Off by default: a grid dense enough to be worth a heat\n * map has no room for the numbers, which is why the annex table is always there. */\n readonly showValues = input(false, { transform: booleanAttribute });\n\n /** Makes every measured cell a button. An unmeasured cell stays inert - a grid of buttons with\n * nothing behind them is a tab trap. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** Fades every cell but the one under the pointer. Off by default: the dimming costs the\n * separation BETWEEN the dimmed cells, which on a ramp is the only thing carrying magnitude. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** `'auto'` draws the bordered, padded box; `'none'` leaves it bare for a chart inside a card the\n * page has already drawn. Unset falls back to `DS_CONFIG.chart.frame`. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** A skeleton at the grid's own height, so the page does not resize when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n\n /** Separate from an empty matrix: \"the request failed\" and \"there is nothing to show\" read the\n * same and mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** Shown when there are no rows or no columns. Unset falls back to `DS_INTL.chart.empty`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shown in place of the grid while `error` is set. Unset falls back to\n * `DS_INTL.chart.error`. */\n readonly errorText = input<string | null>(null);\n\n /** Formats every reading the chart prints - the scale's two ends, each cell's accessible name\n * and the annex table. Unset falls back to `DS_CONFIG.chart.valueFormat`. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n /** Whether a hovered or focused cell opens a tooltip. A heat map's cells carry no printed value\n * by default, so this is where a reading is read without reaching for the annex table. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n /** The clicked cell, with the row and the column it sits at. Never fires for an unmeasured\n * cell, which has no reading to drill into. */\n readonly cellClicked = output<HeatmapChartCell>();\n\n private readonly defaults = resolveChartDefaults(this);\n protected readonly intl = inject(DS_INTL);\n readonly frameResolved = this.defaults.frame;\n readonly emptyTextResolved = this.defaults.emptyText;\n readonly errorTextResolved = this.defaults.errorText;\n readonly valueFormatResolved = this.defaults.valueFormat;\n\n protected readonly activeMark = chartActiveMark(() => 0);\n\n protected readonly isEmpty = computed(\n () => this.data().length === 0 || this.columns().length === 0,\n );\n\n private readonly domain = computed(() => {\n const measured = heatmapDomain(this.data());\n const askedMin = this.min();\n const askedMax = this.max();\n\n return {\n min:\n askedMin !== null &&\n Number.isFinite(askedMin) &&\n askedMin < measured.min\n ? askedMin\n : measured.min,\n max:\n askedMax !== null &&\n Number.isFinite(askedMax) &&\n askedMax > measured.max\n ? askedMax\n : measured.max,\n };\n });\n\n /** The row header column has no name of its own: the corner cell above it is blank, which is\n * what a matrix's top-left is. */\n protected readonly tableColumns = computed<readonly string[]>(() => [\n '',\n ...this.columns(),\n ]);\n\n protected readonly tableRows = computed<readonly ChartDataRow[]>(() =>\n this.rows().map((entry) => ({\n key: entry.key,\n cells: [\n entry.row.label,\n ...entry.cells.map((cell) => cell.formattedValue),\n ],\n })),\n );\n\n protected readonly rows = computed<readonly PlacedRow[]>(() => {\n const columns = this.columns();\n const { min, max } = this.domain();\n const format = this.valueFormatResolved();\n\n return this.data().map((row, rowIndex) => ({\n key: row.id ?? String(rowIndex),\n row,\n cells: columns.map((column, columnIndex) => {\n const value = row.data[columnIndex] ?? null;\n const step =\n value === null\n ? null\n : rampIndexOf(value, min, max, CHART_HEAT_COLORS.length);\n const formattedValue =\n value === null\n ? this.intl().chart.noReading\n : format(value, 'tooltip');\n\n return {\n key: `${row.id ?? rowIndex}-${columnIndex}`,\n columnIndex,\n column,\n value,\n color: step === null ? null : CHART_HEAT_COLORS[step],\n formattedValue,\n accessibleName: `${row.label}, ${column}: ${formattedValue}`,\n };\n }),\n }));\n });\n\n /** The legend under the grid: the ramp's own steps with the readings at either end, which is the\n * only thing that says what a colour is worth. */\n protected readonly scaleSteps = computed(() => CHART_HEAT_COLORS);\n\n protected readonly scaleMinLabel = computed(() =>\n this.valueFormatResolved()(this.domain().min, 'tick'),\n );\n\n protected readonly scaleMaxLabel = computed(() =>\n this.valueFormatResolved()(this.domain().max, 'tick'),\n );\n\n protected readonly accessibleName = computed(() => {\n const caption = this.caption();\n const { min, max } = this.domain();\n const format = this.valueFormatResolved();\n\n return this.intl().chart.heatmapSummary(\n caption ?? this.intl().chart.heatmapTitle,\n this.data().length,\n this.columns().length,\n format(min, 'tooltip'),\n format(max, 'tooltip'),\n );\n });\n\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.max(this.data().length, 4) }),\n );\n\n /** Flattened so one index addresses a cell: `chartActiveMark` counts marks, and a grid's marks\n * are its cells rather than its rows. */\n private readonly flatCells = computed(() =>\n this.rows().flatMap((row) => row.cells),\n );\n\n protected cellIndex(rowIndex: number, columnIndex: number): number {\n return rowIndex * this.columns().length + columnIndex;\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const cell = this.flatCells()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !cell || cell.value === null) {\n return null;\n }\n\n return {\n category: cell.column,\n entries: [\n {\n label: cell.accessibleName.split(':')[0],\n value: cell.value,\n formatted: cell.formattedValue,\n color: cell.color ?? '',\n },\n ],\n };\n },\n );\n\n protected onCellClick(\n row: PlacedRow,\n cell: PlacedCell,\n rowIndex: number,\n ): void {\n if (cell.value === null) {\n return;\n }\n this.cellClicked.emit({\n row: row.row,\n rowIndex,\n columnIndex: cell.columnIndex,\n column: cell.column,\n value: cell.value,\n });\n }\n}\n","<figure class=\"heatmap-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading() || !renderReady()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_heatmap-chart-cell-size)\" [shimmer]=\"loading()\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"grid-scroll\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\">\n <table\n class=\"grid\"\n [class.dims-others]=\"dimOthers()\">\n <thead>\n <tr>\n <td class=\"corner\"></td>\n\n @for (column of columns(); track column) {\n <th\n class=\"column-label\"\n scope=\"col\">\n {{ column }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key; let rowIndex = $index) {\n <tr>\n <th\n class=\"row-label\"\n scope=\"row\">\n {{ entry.row.label }}\n </th>\n\n @for (cell of entry.cells; track cell.key) {\n <td\n class=\"cell-slot\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n <!-- A button only where a click means something: an unmeasured cell has no\n reading to drill into, and a grid of dead buttons is a tab trap. -->\n @if (interactive() && cell.value !== null) {\n <button\n class=\"cell interactive\"\n type=\"button\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\"\n (click)=\"onCellClick(entry, cell, rowIndex)\"\n (pointerenter)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \"\n (focus)=\"\n activeMark.enter(\n cellIndex(rowIndex, cell.columnIndex),\n $event\n )\n \">\n @if (showValues()) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </button>\n } @else {\n <span\n class=\"cell\"\n role=\"img\"\n [class.is-missing]=\"cell.value === null\"\n [style.background]=\"cell.color\"\n [attr.aria-label]=\"cell.accessibleName\">\n @if (showValues() && cell.value !== null) {\n <span class=\"cell-value\">\n {{ cell.formattedValue }}\n </span>\n }\n </span>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"scale\">\n <span class=\"scale-label\">\n {{ scaleMinLabel() }}\n </span>\n\n <span\n class=\"scale-ramp\"\n aria-hidden=\"true\">\n @for (step of scaleSteps(); track step) {\n <span\n class=\"scale-step\"\n [style.background]=\"step\">\n </span>\n }\n </span>\n\n <span class=\"scale-label\">\n {{ scaleMaxLabel() }}\n </span>\n </div>\n\n <!-- Always present, never a `dataTable` choice: colour is the only channel carrying magnitude\n on the grid, so the numbers have to be reachable somewhere that is not a colour. -->\n <ds-chart-data-table\n rowHeader\n [columns]=\"tableColumns()\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\" />\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;;;;;AAKgB;AACV,SAAU,WAAW,CACzB,KAAa,EACb,SAAiB,EACjB,SAAiB,EACjB,SAAiB,EAAA;AAEjB,IAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS,GAAG,CAAC,EAAE;AAC5C,QAAA,OAAO,IAAI;IACb;AACA,IAAA,MAAM,IAAI,GAAG,SAAS,GAAG,SAAS;AAClC,IAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE;AACvC,QAAA,OAAO,CAAC;IACV;IACA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC;AAElE,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC;AAC5C;AAEA;;;AAGgB;AACV,SAAU,aAAa,CAAC,IAAgC,EAAA;IAI5D,MAAM,QAAQ,GAAG;SACd,OAAO,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI;AACzB,SAAA,MAAM,CACL,CAAC,KAAK,KACJ,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CACtD;AAEH,IAAA,OAAO,QAAQ,CAAC,MAAM,KAAK;UACvB,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;UAChB,EAAE,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