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

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 (306) hide show
  1. package/CHANGELOG.md +1106 -9
  2. package/components.md +563 -44
  3. package/design-system.md +9 -0
  4. package/docs/agent/INDEX.md +58 -17
  5. package/docs/agent/charts/chart-colour-which-palette-a-chart-takes.md +1 -1
  6. package/docs/agent/charts/column-series-component.md +8 -0
  7. package/docs/agent/charts/ds-bar-chart.md +6 -1
  8. package/docs/agent/charts/ds-chart-data-table.md +10 -0
  9. package/docs/agent/charts/ds-chart.md +8 -0
  10. package/docs/agent/charts/ds-column-chart.md +7 -2
  11. package/docs/agent/charts/ds-funnel-chart.md +5 -1
  12. package/docs/agent/charts/ds-heatmap-chart.md +20 -0
  13. package/docs/agent/charts/ds-line-chart.md +8 -4
  14. package/docs/agent/charts/{ds-donut-chart.md → ds-pie-chart.md} +10 -6
  15. package/docs/agent/charts/ds-scatter-chart.md +20 -0
  16. package/docs/agent/charts/ds-waterfall-chart.md +20 -0
  17. package/docs/agent/charts/line-series-component.md +8 -0
  18. package/docs/agent/charts/reference-label-component.md +8 -0
  19. package/docs/agent/charts/reference-line-component.md +8 -0
  20. package/docs/agent/charts/series-annotation-component.md +10 -0
  21. package/docs/agent/feedback/ds-alert.md +4 -0
  22. package/docs/agent/feedback/ds-avatar-group.md +4 -0
  23. package/docs/agent/feedback/ds-avatar.md +4 -0
  24. package/docs/agent/feedback/ds-badge.md +4 -0
  25. package/docs/agent/feedback/ds-banner.md +5 -1
  26. package/docs/agent/feedback/ds-bar.md +17 -0
  27. package/docs/agent/feedback/ds-description-item.md +8 -0
  28. package/docs/agent/feedback/ds-description-list.md +8 -0
  29. package/docs/agent/feedback/ds-empty-state.md +4 -0
  30. package/docs/agent/feedback/ds-list-item.md +8 -0
  31. package/docs/agent/feedback/ds-list.md +8 -0
  32. package/docs/agent/feedback/ds-loading-overlay.md +8 -0
  33. package/docs/agent/feedback/ds-skeleton.md +4 -0
  34. package/docs/agent/feedback/ds-spinner.md +4 -0
  35. package/docs/agent/feedback/ds-stat.md +4 -0
  36. package/docs/agent/feedback/ds-status-dot.md +4 -0
  37. package/docs/agent/feedback/ds-tag.md +4 -0
  38. package/docs/agent/feedback/ds-timeline-item.md +8 -0
  39. package/docs/agent/feedback/ds-toast-region.md +8 -0
  40. package/docs/agent/feedback/ds-toast.md +4 -0
  41. package/docs/agent/feedback/ds-tree.md +8 -0
  42. package/docs/agent/forms/ds-autocomplete.md +4 -0
  43. package/docs/agent/forms/ds-button-group.md +8 -0
  44. package/docs/agent/forms/ds-button.md +6 -2
  45. package/docs/agent/forms/ds-checkbox.md +4 -0
  46. package/docs/agent/forms/ds-color-picker.md +8 -0
  47. package/docs/agent/forms/ds-date-picker.md +5 -1
  48. package/docs/agent/forms/ds-dropzone.md +4 -0
  49. package/docs/agent/forms/ds-field-group.md +8 -0
  50. package/docs/agent/forms/ds-filter-bar.md +8 -0
  51. package/docs/agent/forms/ds-icon-button.md +4 -0
  52. package/docs/agent/forms/ds-input.md +13 -1
  53. package/docs/agent/forms/ds-multi-select.md +4 -0
  54. package/docs/agent/forms/ds-number-stepper.md +4 -0
  55. package/docs/agent/forms/ds-otp-input.md +8 -0
  56. package/docs/agent/forms/ds-password-rules.md +8 -0
  57. package/docs/agent/forms/ds-radio-group.md +8 -0
  58. package/docs/agent/forms/ds-radio.md +4 -0
  59. package/docs/agent/forms/ds-search.md +4 -0
  60. package/docs/agent/forms/ds-segmented.md +8 -0
  61. package/docs/agent/forms/ds-select.md +4 -0
  62. package/docs/agent/forms/ds-slider.md +8 -0
  63. package/docs/agent/forms/ds-split-button.md +8 -0
  64. package/docs/agent/forms/ds-switch.md +4 -0
  65. package/docs/agent/forms/ds-textarea.md +5 -1
  66. package/docs/agent/forms/ds-time-picker.md +8 -0
  67. package/docs/agent/forms/ds-toggle-button.md +8 -0
  68. package/docs/agent/forms/filter-item-directive.md +8 -0
  69. package/docs/agent/forms/the-picker-family-ds-select-ds-multi-select-ds-autocomplete.md +4 -0
  70. package/docs/agent/navigation/ds-app-layout.md +6 -2
  71. package/docs/agent/navigation/ds-auth-layout.md +5 -1
  72. package/docs/agent/navigation/ds-breadcrumbs.md +4 -0
  73. package/docs/agent/navigation/ds-container.md +8 -0
  74. package/docs/agent/navigation/ds-divider.md +4 -0
  75. package/docs/agent/navigation/ds-inline.md +8 -0
  76. package/docs/agent/navigation/ds-page-footer.md +4 -0
  77. package/docs/agent/navigation/ds-page-header.md +5 -1
  78. package/docs/agent/navigation/ds-pagination.md +5 -1
  79. package/docs/agent/navigation/ds-sidenav-footer.md +8 -0
  80. package/docs/agent/navigation/ds-sidenav-group.md +4 -0
  81. package/docs/agent/navigation/ds-sidenav-item.md +4 -0
  82. package/docs/agent/navigation/ds-sidenav.md +4 -0
  83. package/docs/agent/navigation/ds-stack.md +8 -0
  84. package/docs/agent/navigation/ds-stepper.md +4 -0
  85. package/docs/agent/navigation/ds-tab.md +8 -0
  86. package/docs/agent/navigation/ds-tabs.md +5 -1
  87. package/docs/agent/overlays/ds-bottom-sheet.md +4 -0
  88. package/docs/agent/overlays/ds-drawer.md +4 -0
  89. package/docs/agent/overlays/ds-menu.md +4 -0
  90. package/docs/agent/overlays/ds-modal-card.md +4 -0
  91. package/docs/agent/overlays/ds-modal.md +4 -0
  92. package/docs/agent/overlays/ds-popover.md +4 -0
  93. package/docs/agent/overlays/ds-tooltip-panel.md +8 -0
  94. package/docs/agent/overlays/ds-tooltip.md +4 -0
  95. package/docs/agent/surfaces/ds-accordion-item.md +8 -0
  96. package/docs/agent/surfaces/ds-accordion.md +4 -0
  97. package/docs/agent/surfaces/ds-card.md +6 -2
  98. package/docs/agent/tables/ds-cell-template.md +8 -0
  99. package/docs/agent/tables/ds-table-columns.md +8 -0
  100. package/docs/agent/tables/ds-table-export.md +8 -0
  101. package/docs/agent/tables/ds-table.md +9 -2
  102. package/docs/agent/tables/header-filter-directive.md +8 -0
  103. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +4 -4
  104. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
  105. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +10 -8
  106. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
  107. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +19 -19
  108. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
  109. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +2 -2
  110. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
  111. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +7 -6
  112. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
  113. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
  114. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
  115. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +9 -6
  116. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
  117. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +119 -30
  118. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
  119. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +95 -0
  120. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -0
  121. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +3 -3
  122. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
  123. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +7 -3
  124. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  125. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +2 -2
  126. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -1
  127. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +32 -0
  128. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -0
  129. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +2 -2
  130. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
  131. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +84 -43
  132. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
  133. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +1322 -0
  134. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -0
  135. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +2 -2
  136. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
  137. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +8 -6
  138. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
  139. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +164 -126
  140. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
  141. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +5 -3
  142. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
  143. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +4 -4
  144. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
  145. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +23 -16
  146. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
  147. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
  148. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
  149. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
  150. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
  151. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +1 -1
  152. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
  153. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +32 -13
  154. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
  155. package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +217 -0
  156. package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -0
  157. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
  158. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
  159. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +2 -2
  160. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -1
  161. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +185 -573
  162. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
  163. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
  164. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
  165. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +2 -2
  166. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -1
  167. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +2 -2
  168. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
  169. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +6 -6
  170. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
  171. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +7 -5
  172. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
  173. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
  174. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
  175. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +2 -2
  176. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
  177. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
  178. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
  179. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +14 -3
  180. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
  181. package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +391 -0
  182. package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -0
  183. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +5 -3
  184. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
  185. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +2 -2
  186. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
  187. package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +300 -0
  188. package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -0
  189. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +2 -2
  190. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
  191. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +9 -4
  192. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
  193. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +7 -5
  194. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
  195. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
  196. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
  197. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +2 -2
  198. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
  199. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +2 -2
  200. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
  201. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +2 -2
  202. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
  203. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
  204. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
  205. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +4 -4
  206. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
  207. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +4 -1
  208. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
  209. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +9 -9
  210. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  211. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +2 -2
  212. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
  213. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
  214. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
  215. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +2 -2
  216. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
  217. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +5 -3
  218. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
  219. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +2 -2
  220. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
  221. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +34 -21
  222. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
  223. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
  224. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
  225. package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +252 -0
  226. package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -0
  227. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +429 -24
  228. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  229. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +1 -1
  230. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  231. package/fesm2022/ids-group-ltd-ids-design-system.mjs +8 -4
  232. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  233. package/migrations/0.10.0.json +2 -2
  234. package/migrations/0.10.1.json +3 -3
  235. package/migrations/0.10.2.json +8 -28
  236. package/migrations/0.11.0.json +3 -3
  237. package/migrations/0.11.1.json +15 -15
  238. package/migrations/0.11.2.json +9 -9
  239. package/migrations/0.11.3.json +1 -1
  240. package/migrations/0.11.4.json +8 -8
  241. package/migrations/0.12.1.json +1 -1
  242. package/migrations/0.12.2.json +1 -1
  243. package/migrations/0.12.3.json +3 -3
  244. package/migrations/0.13.0.json +24 -32
  245. package/migrations/0.13.1.json +5 -5
  246. package/migrations/0.13.3.json +211 -0
  247. package/migrations/0.13.4.json +994 -0
  248. package/migrations/0.5.0.json +1 -1
  249. package/migrations/0.8.0.json +4 -3
  250. package/migrations/0.9.0.json +1 -1
  251. package/package.json +57 -25
  252. package/styles/_chart-frame.scss +31 -8
  253. package/styles/_check-box.scss +12 -12
  254. package/styles/_dropdown-overlay.scss +14 -10
  255. package/styles/_field-box.scss +3 -3
  256. package/styles/_field-label.scss +7 -7
  257. package/styles/_overlay-motion.scss +1 -1
  258. package/styles/_table-controls.scss +3 -3
  259. package/styles/_tokens-charts.scss +69 -12
  260. package/styles/_tokens.scss +3 -3
  261. package/styles/_typography.scss +101 -101
  262. package/themes/dark/_theme.scss +13 -0
  263. package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +3 -3
  264. package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +5 -4
  265. package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +17 -17
  266. package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +3 -1
  267. package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +4 -2
  268. package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +37 -3
  269. package/types/ids-group-ltd-ids-design-system-components-bar.d.ts +63 -0
  270. package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +1 -1
  271. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +6 -2
  272. package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +31 -0
  273. package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +11 -4
  274. package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +729 -0
  275. package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +3 -1
  276. package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +99 -38
  277. package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +9 -7
  278. package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +4 -4
  279. package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +9 -1
  280. package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +124 -0
  281. package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +84 -148
  282. package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +3 -1
  283. package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +13 -1
  284. package/types/{ids-group-ltd-ids-design-system-components-donut-chart.d.ts → ids-group-ltd-ids-design-system-components-pie-chart.d.ts} +35 -17
  285. package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +3 -1
  286. package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +183 -0
  287. package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +5 -1
  288. package/types/ids-group-ltd-ids-design-system-components-select.d.ts +3 -1
  289. package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +3 -0
  290. package/types/ids-group-ltd-ids-design-system-components-table.d.ts +11 -11
  291. package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -1
  292. package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +5 -2
  293. package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +116 -0
  294. package/types/ids-group-ltd-ids-design-system-components.d.ts +151 -9
  295. package/types/ids-group-ltd-ids-design-system-core.d.ts +78 -4
  296. package/types/ids-group-ltd-ids-design-system.d.ts +16 -12
  297. package/docs/agent/feedback/ds-meter.md +0 -11
  298. package/docs/agent/feedback/ds-progress.md +0 -10
  299. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +0 -351
  300. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +0 -1
  301. package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs +0 -61
  302. package/fesm2022/ids-group-ltd-ids-design-system-components-meter.mjs.map +0 -1
  303. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +0 -65
  304. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +0 -1
  305. package/types/ids-group-ltd-ids-design-system-components-meter.d.ts +0 -36
  306. package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +0 -40
@@ -0,0 +1,1322 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, input, numberAttribute, booleanAttribute, inject, ElementRef, computed, signal, effect, afterRenderEffect, viewChild, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, output, viewChildren } from '@angular/core';
3
+ import { domainMinOf, niceDomain, linearScale, tickValues, roundStepAtLeast, resolveChartDefaults, elementWidth, bandScale, rotationWouldFit, labelInterval, defaultChartFormat, CHART_SERIES_COLORS, staggerDelay, nextRovingIndex, focusMark, describeShare, lineSegments, linePath, areaPath, bandPath } from '@ids-group-ltd/ids-design-system/components';
4
+ import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
5
+ import { chartActiveMark } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
6
+ import { DomSanitizer } from '@angular/platform-browser';
7
+ import { ICONS } from '@ids-group-ltd/ids-design-system/core';
8
+
9
+ const CHART_DEFAULT_TICK_COUNT = 5;
10
+ const CHART_AXIS_LABEL_GAP = 8;
11
+ const CHART_CATEGORY_LABEL_OFFSET = 18;
12
+ const CHART_BAND_PADDING = 0.3;
13
+ /** What the chart lays out at while it measures zero: under SSR, while the host is
14
+ * `display: none`, and for the frame before the first `ResizeObserver` callback. Without it the
15
+ * plot is `0 - axisGutter - EDGE_GUTTER` wide, which clamps to zero and stacks every category on
16
+ * one x rather than leaving a blank space that the measurement then fills.
17
+ *
18
+ * The client cost is one frame drawn at this width and scaled to fit - measured at a 400px card
19
+ * in Chrome 153: `viewBox="0 0 640 310"` at t=242ms, `"0 0 358 310"` at t=260ms.
20
+ *
21
+ * @internal */
22
+ const CHART_FALLBACK_WIDTH = 640;
23
+ const CHART_DEFAULT_PLOT_HEIGHT = 240;
24
+ const CHART_DEFAULT_AXIS_GUTTER = 46;
25
+ const CHART_DEFAULT_VALUE_SPACE = 20;
26
+ /** Room past the last band, so a mark centred on it is not cut by the viewBox edge. */
27
+ const CHART_EDGE_GUTTER = 12;
28
+ /** Blank between two stacked plots: enough for the lower plot's top tick label to clear the upper
29
+ * plot's category-free bottom edge. */
30
+ const CHART_STACKED_PLOT_GAP = 34;
31
+ /** Height of the category-label row under the plot: one line plus its descenders. */
32
+ const CATEGORY_GUTTER = 30;
33
+ /** The drawable rectangle, in the same CSS pixels the container was measured in.
34
+ *
35
+ * `measuredWidth` is the `<svg>`'s own rendered width, which is what makes every coordinate
36
+ * derived from this an exact CSS pixel: the viewBox is sized to match, so one user unit is one
37
+ * pixel and a mark capped at 48 is 48 pixels wide at every card width.
38
+ *
39
+ * @internal */
40
+ function chartPlot(measuredWidth, plotHeight, axisGutter, valueSpace, rightGutter = CHART_EDGE_GUTTER) {
41
+ return {
42
+ left: axisGutter,
43
+ top: valueSpace,
44
+ width: Math.max(0, measuredWidth - axisGutter - rightGutter),
45
+ height: Math.max(0, plotHeight),
46
+ };
47
+ }
48
+ /** The viewBox's height, and the `<svg>`'s rendered height in pixels - the two are the same
49
+ * number, which is what holds the 1:1 scale on the vertical axis too.
50
+ *
51
+ * `valueSpace` is always budgeted above the plot, for a value label over the tallest mark. It is
52
+ * budgeted a SECOND time below the baseline only when the domain reaches under zero, where a
53
+ * negative mark's label would otherwise print into the category labels: reserving it for every
54
+ * chart costs the all-positive ones - the common case - that much height for nothing.
55
+ *
56
+ * @internal */
57
+ function chartViewHeight(plotHeight, valueSpace, reservesBelowBaseline = false) {
58
+ const below = reservesBelowBaseline ? valueSpace : 0;
59
+ return valueSpace + Math.max(0, plotHeight) + below + CATEGORY_GUTTER;
60
+ }
61
+ /** The domain the value axis draws: the union of every reported set, always reaching zero,
62
+ * widened by the pins and snapped to a round tick step.
63
+ *
64
+ * Zero is always in it because a bar measured against a floating floor misstates its own size,
65
+ * and a pin only ever widens because a maximum under the data would push readings off the plot
66
+ * rather than rescale them.
67
+ *
68
+ * @internal */
69
+ function axisDomain(reported, tickCount, pinnedMinimum = null, pinnedMaximum = null) {
70
+ let minimum = 0;
71
+ let maximum = 0;
72
+ for (const values of reported) {
73
+ const finite = values.filter((value) => Number.isFinite(value));
74
+ minimum = Math.min(minimum, domainMinOf(finite));
75
+ maximum = finite.reduce((highest, value) => Math.max(highest, value), maximum);
76
+ }
77
+ if (pinnedMinimum !== null &&
78
+ Number.isFinite(pinnedMinimum) &&
79
+ pinnedMinimum < minimum) {
80
+ minimum = pinnedMinimum;
81
+ }
82
+ if (pinnedMaximum !== null &&
83
+ Number.isFinite(pinnedMaximum) &&
84
+ pinnedMaximum > maximum) {
85
+ maximum = pinnedMaximum;
86
+ }
87
+ return niceDomain(minimum, maximum, tickCount);
88
+ }
89
+ /** Where a value sits vertically, clamped inside the plot. An unplottable value lands on the
90
+ * baseline rather than becoming a `NaN`, which would void the whole coordinate attribute it was
91
+ * written into and take the mark off screen with nothing logged.
92
+ *
93
+ * @internal */
94
+ function valueScale(domain, top, height) {
95
+ const baseline = top + height;
96
+ const scale = linearScale(domain.min, domain.max, height);
97
+ return (value) => {
98
+ const y = baseline - scale(value);
99
+ return Number.isFinite(y) ? Math.min(Math.max(y, top), baseline) : baseline;
100
+ };
101
+ }
102
+ /** Distance from a reference line, or a band's upper edge, to its label's baseline. */
103
+ const THRESHOLD_LABEL_GAP = 5;
104
+ /** Inset from the plot's LEFT edge. The label sits at the start of the line rather than its end
105
+ * because a value label is centred on its column, and the last column's is the one nearest the
106
+ * edge the line stops at - measured on the docs demo, a right-anchored "Escalation" printed over
107
+ * the last column's own value. */
108
+ const THRESHOLD_LABEL_INSET = 4;
109
+ /** Every drawable coordinate of a chart's reference lines and bands, so the strokes and the labels
110
+ * - which paint in different layers, under the marks and over them - are laid out by one
111
+ * calculation rather than by two that can disagree.
112
+ *
113
+ * @internal */
114
+ function thresholdMarks(thresholds, plot, toY) {
115
+ return thresholds.map((threshold, index) => {
116
+ const y = toY(threshold.value);
117
+ const far = threshold.to == null ? y : toY(threshold.to);
118
+ const top = Math.min(y, far);
119
+ return {
120
+ key: index,
121
+ label: threshold.label ?? '',
122
+ color: threshold.color ?? null,
123
+ dash: threshold.dash ?? 'dashed',
124
+ band: threshold.to != null,
125
+ left: plot.left,
126
+ right: plot.left + plot.width,
127
+ width: plot.width,
128
+ y,
129
+ top,
130
+ height: Math.abs(y - far),
131
+ labelX: plot.left + THRESHOLD_LABEL_INSET,
132
+ labelY: top - THRESHOLD_LABEL_GAP,
133
+ };
134
+ });
135
+ }
136
+ /** A tick row's index for the value zero, or `null` when the rows do not carry one.
137
+ *
138
+ * Two axes share gridlines only if they also share a zero: a second scale hung on the first's
139
+ * rows has to put its own zero on the same row, or a reading above the line on one axis sits
140
+ * below it on the other. */
141
+ function zeroRow(ticks) {
142
+ if (ticks.length < 2) {
143
+ return null;
144
+ }
145
+ const step = ticks[1] - ticks[0];
146
+ if (!Number.isFinite(step) || step === 0) {
147
+ return null;
148
+ }
149
+ const row = (0 - ticks[0]) / step;
150
+ const rounded = Math.round(row);
151
+ return Math.abs(row - rounded) < 1e-9 &&
152
+ rounded >= 0 &&
153
+ rounded < ticks.length
154
+ ? rounded
155
+ : null;
156
+ }
157
+ /** The second value axis, as the four modes define it.
158
+ *
159
+ * `'aligned'` and `'exact'` hang the second scale on the first's tick rows and differ only in the
160
+ * step: `'aligned'` snaps it up to a round number and overshoots the data, `'exact'` takes the
161
+ * step the data needs and lands on it. `'dual-grid'` and `'split'` nice the second domain on
162
+ * its own - stacked plots sit one above the other, so there is nothing to align.
163
+ *
164
+ * Falls back to an independent scale wherever alignment is not available: fewer than two rows, no
165
+ * shared zero row, or a domain whose sign has no rows on its side of that zero.
166
+ *
167
+ * @internal */
168
+ function secondaryAxis(primaryTicks, reported, tickCount, mode, pinnedMax = null) {
169
+ let minimum = 0;
170
+ let maximum = 0;
171
+ for (const values of reported) {
172
+ const finite = values.filter((value) => Number.isFinite(value));
173
+ minimum = Math.min(minimum, domainMinOf(finite));
174
+ maximum = finite.reduce((highest, value) => Math.max(highest, value), maximum);
175
+ }
176
+ if (pinnedMax !== null && Number.isFinite(pinnedMax)) {
177
+ maximum = pinnedMax;
178
+ }
179
+ const independent = () => ({
180
+ domain: niceDomain(minimum, maximum, tickCount),
181
+ ticks: tickValues(minimum, maximum, tickCount),
182
+ aligned: false,
183
+ });
184
+ if (mode !== 'aligned' && mode !== 'exact') {
185
+ return independent();
186
+ }
187
+ const zero = zeroRow(primaryTicks);
188
+ if (zero === null) {
189
+ return independent();
190
+ }
191
+ const rowsAbove = primaryTicks.length - 1 - zero;
192
+ const rowsBelow = zero;
193
+ if ((maximum > 0 && rowsAbove === 0) || (minimum < 0 && rowsBelow === 0)) {
194
+ return independent();
195
+ }
196
+ const needed = Math.max(rowsAbove > 0 ? maximum / rowsAbove : 0, rowsBelow > 0 ? -minimum / rowsBelow : 0);
197
+ const step = mode === 'aligned' ? roundStepAtLeast(needed) : needed;
198
+ if (!Number.isFinite(step) || step <= 0) {
199
+ return {
200
+ domain: { min: 0, max: 0 },
201
+ ticks: primaryTicks.map(() => 0),
202
+ aligned: true,
203
+ };
204
+ }
205
+ return {
206
+ domain: { min: -rowsBelow * step, max: rowsAbove * step },
207
+ ticks: primaryTicks.map((_, row) => roundTick((row - zero) * step)),
208
+ aligned: true,
209
+ };
210
+ }
211
+ /** A step multiplied back out rarely lands on itself, and an axis label that prints
212
+ * `149.99999999999997` is the visible form of that. */
213
+ function roundTick(value) {
214
+ return Number(value.toFixed(6));
215
+ }
216
+ /** Every segment's span on the value axis, series-major: `offsets[series][category]`.
217
+ *
218
+ * `'none'` and `'grouped'` give every series the same span it would have alone - the two differ in
219
+ * where the band puts them, which is geometry rather than value. The stacking modes run a
220
+ * POSITIVE and a NEGATIVE pile per category, so a negative segment hangs below the baseline
221
+ * instead of being subtracted from the positive pile it sits in.
222
+ *
223
+ * `'normalized'` divides a running SUM rather than each share in turn: adding 20/60 to 40/60
224
+ * lands on 0.9999999999999999, which draws a category that visibly falls short of full.
225
+ */
226
+ function stackOffsets(series, mode) {
227
+ const reading = (value) => Number.isFinite(value) ? value : 0;
228
+ if (mode === 'none' || mode === 'grouped') {
229
+ return series.map((values) => values.map((value) => ({ from: 0, to: reading(value) })));
230
+ }
231
+ const magnitude = [];
232
+ if (mode === 'normalized') {
233
+ for (const values of series) {
234
+ values.forEach((value, category) => {
235
+ magnitude[category] =
236
+ (magnitude[category] ?? 0) + Math.abs(reading(value));
237
+ });
238
+ }
239
+ }
240
+ const risen = [];
241
+ const fallen = [];
242
+ return series.map((values) => values.map((raw, category) => {
243
+ const value = reading(raw);
244
+ const pile = value < 0 ? fallen : risen;
245
+ const from = pile[category] ?? 0;
246
+ const to = from + value;
247
+ pile[category] = to;
248
+ const total = mode === 'normalized' ? (magnitude[category] ?? 0) : 1;
249
+ return total > 0
250
+ ? { from: from / total, to: to / total }
251
+ : { from: 0, to: 0 };
252
+ }));
253
+ }
254
+ /** View units between a reading and the label above it, and the margin inside which a label
255
+ * anchors to its own edge instead of centring.
256
+ *
257
+ * @internal */
258
+ const ANNOTATION_GAP = 12;
259
+ /** @internal */
260
+ const ANNOTATION_EDGE_GUARD = 48;
261
+ /** Places a label against each reading it names.
262
+ *
263
+ * @internal */
264
+ function annotationMarks(readings, plotWidth) {
265
+ return readings.map((reading) => ({
266
+ key: reading.key,
267
+ label: reading.label,
268
+ x: reading.x,
269
+ // Above the reading, and below it where there is no room - a peak sits at the top of the
270
+ // plot, which is exactly where a label clamped upward lands on its own marker.
271
+ y: reading.y - ANNOTATION_GAP >= ANNOTATION_GAP
272
+ ? reading.y - ANNOTATION_GAP
273
+ : reading.y + ANNOTATION_GAP,
274
+ // Anchored away from the plot edges: a centred label at the first or last category hangs
275
+ // half outside the viewBox and is clipped rather than merely tight.
276
+ anchor: reading.x < ANNOTATION_EDGE_GUARD
277
+ ? 'start'
278
+ : reading.x > plotWidth - ANNOTATION_EDGE_GUARD
279
+ ? 'end'
280
+ : 'middle',
281
+ }));
282
+ }
283
+ /** Which category a pointer at `x` is over, or `-1` outside the plot. Bands are equal and abut,
284
+ * so the reading is a division rather than a search - and the half band at each end belongs to
285
+ * the first and last category, which is where a reader aiming at the edge means to be.
286
+ *
287
+ * @internal */
288
+ function categoryAt(x, plotLeft, plotWidth, categoryCount) {
289
+ if (categoryCount <= 0 || plotWidth <= 0 || !Number.isFinite(x)) {
290
+ return -1;
291
+ }
292
+ const offset = x - plotLeft;
293
+ if (offset < 0 || offset > plotWidth) {
294
+ return -1;
295
+ }
296
+ const band = plotWidth / categoryCount;
297
+ return Math.min(categoryCount - 1, Math.floor(offset / band));
298
+ }
299
+
300
+ const CHART_SCALES = new InjectionToken('CHART_SCALES');
301
+
302
+ class ChartComponent {
303
+ /** The category axis. Every projected mark is positioned against this list, so its length is
304
+ * what decides how many bands the plot has. */
305
+ categories = input([], ...(ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []));
306
+ /** How many value-axis ticks to aim for. A hint, not a count: ticks snap to a round step, so
307
+ * the axis may carry one more or one fewer. */
308
+ tickCount = input(CHART_DEFAULT_TICK_COUNT, { ...(ngDevMode ? { debugName: "tickCount" } : /* istanbul ignore next */ {}), transform: numberAttribute });
309
+ /** Pins the floor of the value axis instead of deriving it from the marks. It only ever opens
310
+ * the axis further: a floor above the data would push readings off the plot. */
311
+ min = input(null, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
312
+ /** Pins the ceiling of the value axis. See `min`. Two charts drawn one subject at a time are
313
+ * only comparable when both are pinned. */
314
+ max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
315
+ /** Draws a band and a crosshair down the category under the pointer, and reports that category
316
+ * to every mark through `activeIndex`. `'none'`, the default, leaves the plot alone: a chart
317
+ * whose marks are the hover targets already answers per mark, and two affordances on one plot
318
+ * read as two different questions. */
319
+ cursor = input('none', ...(ngDevMode ? [{ debugName: "cursor" }] : /* istanbul ignore next */ []));
320
+ /** Whether a press holds the category cursor where it is, so the reader can look away from the
321
+ * plot with the comparison still on screen. Released by pressing it again, by Escape, or by a
322
+ * press outside the plot. */
323
+ cursorPin = input(false, { ...(ngDevMode ? { debugName: "cursorPin" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
324
+ /** Milliseconds the cursor survives the pointer leaving the plot. The tooltip panel is portaled
325
+ * out of the plot, so without a grace period it closes before the pointer can reach it. */
326
+ tooltipLingerMs = input(null, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
327
+ /** Pins the ceiling of the SECOND value axis, the way `max` pins the first. Two plots read
328
+ * against each other need both pinned, or the second rescales under them. */
329
+ maxSecondary = input(null, { ...(ngDevMode ? { debugName: "maxSecondary" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
330
+ /** Height of the plot itself, in CSS pixels, axis labels and value headroom excluded. Real
331
+ * pixels rather than a share of the width: one viewBox unit is one pixel, so a card that
332
+ * widens spreads the categories further apart and leaves the plot exactly this tall. */
333
+ plotHeight = input(CHART_DEFAULT_PLOT_HEIGHT, { ...(ngDevMode ? { debugName: "plotHeight" } : /* istanbul ignore next */ {}), transform: numberAttribute });
334
+ /** Width in CSS pixels of the gutter down the left that carries the value-axis labels. Widen it
335
+ * for long tick labels; the plot takes whatever is left. */
336
+ axisGutter = input(CHART_DEFAULT_AXIS_GUTTER, { ...(ngDevMode ? { debugName: "axisGutter" } : /* istanbul ignore next */ {}), transform: numberAttribute });
337
+ /** Pixels reserved for a value label at each end of the plot: above the top tick for a mark at
338
+ * the ceiling, and below the baseline for a negative mark, whose label would otherwise print
339
+ * over the category labels. Reserved whether or not a mark draws one, because a chart that
340
+ * gains a label on one value must not change height. */
341
+ valueSpace = input(CHART_DEFAULT_VALUE_SPACE, { ...(ngDevMode ? { debugName: "valueSpace" } : /* istanbul ignore next */ {}), transform: numberAttribute });
342
+ /** Printed above the plot as the chart's visible title. */
343
+ caption = input(null, ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
344
+ /** Whether the projected marks answer to the pointer and the keyboard. The container draws no
345
+ * marks of its own and only reads this for the plot's role: a group of controls to step
346
+ * through, against a single image to be described. */
347
+ interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
348
+ /** Accessible name for the plot. The container holds no readings of its own, so a chart that
349
+ * needs its numbers described supplies the sentence here - `describeSeries` is what the five
350
+ * presets build it with. It is the whole label in the static case, where nothing else is
351
+ * reachable. */
352
+ summary = input(null, ...(ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []));
353
+ /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;
354
+ * `'none'` leaves it bare, for one placed inside a card the page has already drawn. Unset
355
+ * falls back to `DS_CONFIG.chart.frame`, then `'auto'`. */
356
+ frame = input(null, ...(ngDevMode ? [{ debugName: "frame" }] : /* istanbul ignore next */ []));
357
+ /** Draws a placeholder in place of the plot, at the plot's own height, so the page does not
358
+ * resize when the data lands. */
359
+ loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
360
+ /** Shown in place of the plot when `categories` is empty. Unset falls back to
361
+ * `DS_CONFIG.chart.emptyText`, then `'No data'`. */
362
+ emptyText = input(null, ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
363
+ /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty
364
+ * `categories`, because "the request failed" and "there is nothing to show" read the same to a
365
+ * reader and mean opposite things. */
366
+ error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
367
+ /** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then
368
+ * `'Could not load the data'`. */
369
+ errorText = input(null, ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
370
+ /** Formats the value-axis ticks. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the
371
+ * browser's locale grouping with a K/M/B suffix past four digits. */
372
+ valueFormat = input(null, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
373
+ /** How the second value axis relates to the first, once a mark has reported against it. The
374
+ * same four words `ds-line-chart` takes. */
375
+ secondaryAxisMode = input('aligned', ...(ngDevMode ? [{ debugName: "secondaryAxisMode" }] : /* istanbul ignore next */ []));
376
+ /** Paints the first axis's tick labels in the colour of the marks measured against it. A
377
+ * two-scale plot is ambiguous without it - nothing on the canvas says which of two lines is
378
+ * read against which set of numbers - and it is the author, not the container, who knows which
379
+ * colour an axis belongs to, because several marks can share one. */
380
+ axisColor = input(null, ...(ngDevMode ? [{ debugName: "axisColor" }] : /* istanbul ignore next */ []));
381
+ /** `axisColor` for the second axis. */
382
+ secondaryAxisColor = input(null, ...(ngDevMode ? [{ debugName: "secondaryAxisColor" }] : /* istanbul ignore next */ []));
383
+ /** Names the first axis's unit beside it. On a two-scale plot the colour says which line reads
384
+ * which axis and this says what the numbers ARE - a reader who has neither is left comparing
385
+ * two quantities that may not be comparable at all. */
386
+ axisLabel = input(null, ...(ngDevMode ? [{ debugName: "axisLabel" }] : /* istanbul ignore next */ []));
387
+ /** `axisLabel` for the second axis. */
388
+ secondaryAxisLabel = input(null, ...(ngDevMode ? [{ debugName: "secondaryAxisLabel" }] : /* istanbul ignore next */ []));
389
+ defaults = resolveChartDefaults(this);
390
+ frameResolved = this.defaults.frame;
391
+ emptyTextResolved = this.defaults.emptyText;
392
+ errorTextResolved = this.defaults.errorText;
393
+ valueFormatResolved = this.defaults.valueFormat;
394
+ host = inject(ElementRef);
395
+ /** The `<svg>`'s own rendered width: `:host(.framed)` carries the frame padding, so the host's
396
+ * CONTENT box - which is what a `ResizeObserver` reports - is the box the canvas fills at
397
+ * `inline-size: 100%`. Measuring the host is therefore measuring the canvas. */
398
+ measuredWidth = elementWidth(this.host);
399
+ viewWidth = computed(() => this.measuredWidth() || CHART_FALLBACK_WIDTH, ...(ngDevMode ? [{ debugName: "viewWidth" }] : /* istanbul ignore next */ []));
400
+ /** Whether the marks may animate yet. The first frame draws at `CHART_FALLBACK_WIDTH` scaled to
401
+ * fit, so the measurement that follows moves every mark - and a mark that transitions its
402
+ * geometry would play that correction as an animated slide on every load, hydration included.
403
+ *
404
+ * Two frames, not one. A transition starts when the property changes in a style that also
405
+ * enables it, so the enabling must not land in the same style recalculation as the correction.
406
+ * One `requestAnimationFrame` is not enough: scheduled from the change detection that writes
407
+ * the corrected geometry, it runs at the START of the next frame, still before that geometry
408
+ * has been through a recalculation. Measured with one frame: `transitionrun` on `x` and
409
+ * `width`, both marks, on the same tick the class cleared. */
410
+ settled = signal(false, ...(ngDevMode ? [{ debugName: "settled" }] : /* istanbul ignore next */ []));
411
+ constructor() {
412
+ effect((onCleanup) => {
413
+ if (this.settled() || this.measuredWidth() === 0) {
414
+ return;
415
+ }
416
+ let second = 0;
417
+ const first = requestAnimationFrame(() => {
418
+ second = requestAnimationFrame(() => this.settled.set(true));
419
+ });
420
+ onCleanup(() => {
421
+ cancelAnimationFrame(first);
422
+ cancelAnimationFrame(second);
423
+ });
424
+ });
425
+ // The read phase, so every `getComputedTextLength` lands in one batch before any write:
426
+ // interleaving them forces a synchronous layout per label.
427
+ afterRenderEffect({
428
+ read: () => {
429
+ this.measuredLabelWidth.set(this.widestLabel('.axis-label.is-primary'));
430
+ this.measuredSecondaryLabelWidth.set(this.widestLabel('.axis-label.is-secondary'));
431
+ this.measuredCategoryLabelWidth.set(this.widestLabel('.category-label'));
432
+ },
433
+ });
434
+ }
435
+ widestLabel(selector) {
436
+ const labels = this.host.nativeElement.querySelectorAll(selector);
437
+ let widest = 0;
438
+ for (const label of labels) {
439
+ widest = Math.max(widest, label.getComputedTextLength());
440
+ }
441
+ return Math.ceil(widest);
442
+ }
443
+ /** Two plots, one above the other, sharing the category axis: the only mode whose second axis
444
+ * is a second PLOT rather than a second scale over the first. */
445
+ stacked = computed(() => this.secondaryAxisMode() === 'split' && this.hasSecondaryAxis(), ...(ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []));
446
+ viewHeight = computed(() => chartViewHeight(this.plotHeight(), this.valueSpace(), this.reachesBelowZero()) + (this.stacked() ? this.plotHeight() + CHART_STACKED_PLOT_GAP : 0), ...(ngDevMode ? [{ debugName: "viewHeight" }] : /* istanbul ignore next */ []));
447
+ /** One viewBox unit is one CSS pixel, in both axes. That is the whole point of measuring: a
448
+ * radius, a gutter or a width cap set anywhere inside the plot is then the length it says it
449
+ * is, at every card width, instead of a share of one that a fixed viewBox stretches. */
450
+ viewBox = computed(() => `0 0 ${this.viewWidth()} ${this.viewHeight()}`, ...(ngDevMode ? [{ debugName: "viewBox" }] : /* istanbul ignore next */ []));
451
+ /** Widest tick label actually rendered, in the CSS pixels the canvas is drawn in. Zero until the
452
+ * first read, and zero under SSR, where `axisGutter` alone decides. */
453
+ measuredLabelWidth = signal(0, ...(ngDevMode ? [{ debugName: "measuredLabelWidth" }] : /* istanbul ignore next */ []));
454
+ /** The widest category label as drawn, which is what decides whether they all fit. */
455
+ measuredCategoryLabelWidth = signal(0, ...(ngDevMode ? [{ debugName: "measuredCategoryLabelWidth" }] : /* istanbul ignore next */ []));
456
+ /** `axisGutter` is the FLOOR, not the answer: a compact number is far wider in some locales than
457
+ * in others - `3,5 тыс.` against `3.5k` - and an SVG canvas CLIPS what a DOM column merely
458
+ * overflowed, so a fixed gutter silently eats the leading digit. The gutter takes whichever is
459
+ * larger, so setting the token still guarantees at least that much room.
460
+ *
461
+ * This converges rather than oscillating: a tick's TEXT is decided by the domain and the tick
462
+ * count, neither of which the gutter feeds, so widening it moves the labels without rewriting
463
+ * them and the second measurement equals the first. */
464
+ effectiveAxisGutter = computed(() => Math.max(this.axisGutter(), this.measuredLabelWidth() + CHART_AXIS_LABEL_GAP), ...(ngDevMode ? [{ debugName: "effectiveAxisGutter" }] : /* istanbul ignore next */ []));
465
+ /** Widest secondary tick label, measured the same way and for the same reason as the primary
466
+ * one: those labels sit OUTSIDE the plot's right edge and an SVG canvas clips what a DOM
467
+ * column merely overflowed. */
468
+ measuredSecondaryLabelWidth = signal(0, ...(ngDevMode ? [{ debugName: "measuredSecondaryLabelWidth" }] : /* istanbul ignore next */ []));
469
+ /** The plot gives the right-hand labels room only when they are drawn there - a stacked second
470
+ * axis puts both label columns down the left, so the plot keeps the full width. */
471
+ rightGutter = computed(() => this.hasSecondaryAxis() && !this.stacked()
472
+ ? Math.max(this.axisGutter(), this.measuredSecondaryLabelWidth() + CHART_AXIS_LABEL_GAP)
473
+ : CHART_EDGE_GUTTER, ...(ngDevMode ? [{ debugName: "rightGutter" }] : /* istanbul ignore next */ []));
474
+ plot = computed(() => chartPlot(this.viewWidth(), this.plotHeight(), this.effectiveAxisGutter(), this.valueSpace(), this.rightGutter()), ...(ngDevMode ? [{ debugName: "plot" }] : /* istanbul ignore next */ []));
475
+ secondaryPlot = computed(() => {
476
+ const plot = this.plot();
477
+ return this.stacked()
478
+ ? { ...plot, top: plot.top + plot.height + CHART_STACKED_PLOT_GAP }
479
+ : plot;
480
+ }, ...(ngDevMode ? [{ debugName: "secondaryPlot" }] : /* istanbul ignore next */ []));
481
+ reportedDomains = signal(new Map(), ...(ngDevMode ? [{ debugName: "reportedDomains" }] : /* istanbul ignore next */ []));
482
+ reportDomain(id, values, axis = 'primary') {
483
+ this.reportedDomains.update((reported) => new Map(reported).set(id, { axis, values }));
484
+ }
485
+ valuesOn(axis) {
486
+ const found = [];
487
+ for (const report of this.reportedDomains().values()) {
488
+ if (report.axis === axis) {
489
+ found.push(report.values);
490
+ }
491
+ }
492
+ return found;
493
+ }
494
+ releaseDomain(id) {
495
+ this.reportedDomains.update((reported) => {
496
+ const next = new Map(reported);
497
+ next.delete(id);
498
+ return next;
499
+ });
500
+ }
501
+ /** Compared by value, which is what stops a mark that reports AND reads `yPosition()` in one
502
+ * effect from running forever: every report allocates a fresh `Map` and `niceDomain` a fresh
503
+ * object, so identity always differs and the read would re-arm the write. Measured without it:
504
+ * 97507 effect runs in 45 seconds, no Angular loop error, renderer unresponsive. */
505
+ domain = computed(() => axisDomain(this.valuesOn('primary'), this.tickCount(), this.min(), this.max()), { ...(ngDevMode ? { debugName: "domain" } : /* istanbul ignore next */ {}), equal: (a, b) => a.min === b.min && a.max === b.max });
506
+ // Counts VALUES, not reporters: `valuesOn` returns one entry per mark that registered, and a
507
+ // line series registers both axes unconditionally, so an empty contribution would otherwise
508
+ // raise a whole second axis on a plot that has one.
509
+ hasSecondaryAxis = computed(() => this.valuesOn('secondary').some((values) => values.length > 0), ...(ngDevMode ? [{ debugName: "hasSecondaryAxis" }] : /* istanbul ignore next */ []));
510
+ secondary = computed(() => secondaryAxis(this.ticks().map((tick) => tick.value), this.valuesOn('secondary'), this.tickCount(), this.secondaryAxisMode(), this.maxSecondary()), { ...(ngDevMode ? { debugName: "secondary" } : /* istanbul ignore next */ {}), equal: (a, b) => a.aligned === b.aligned &&
511
+ a.domain.min === b.domain.min &&
512
+ a.domain.max === b.domain.max &&
513
+ a.ticks.length === b.ticks.length &&
514
+ a.ticks.every((tick, index) => tick === b.ticks[index]) });
515
+ secondaryYPosition = computed(() => {
516
+ if (!this.hasSecondaryAxis()) {
517
+ return this.yPosition();
518
+ }
519
+ const plot = this.secondaryPlot();
520
+ return valueScale(this.secondary().domain, plot.top, plot.height);
521
+ }, ...(ngDevMode ? [{ debugName: "secondaryYPosition" }] : /* istanbul ignore next */ []));
522
+ secondaryTicks = computed(() => {
523
+ if (!this.hasSecondaryAxis()) {
524
+ return [];
525
+ }
526
+ const toY = this.secondaryYPosition();
527
+ const format = this.valueFormatResolved();
528
+ return this.secondary().ticks.map((value) => ({
529
+ value,
530
+ y: toY(value),
531
+ label: format(value, 'tick'),
532
+ }));
533
+ }, ...(ngDevMode ? [{ debugName: "secondaryTicks" }] : /* istanbul ignore next */ []));
534
+ /** A second set of gridlines only where the two scales do NOT share rows: drawn against an
535
+ * aligned axis they would land on the primary's own lines and double every stroke. */
536
+ showSecondaryGridlines = computed(() => this.hasSecondaryAxis() &&
537
+ (this.stacked() || !this.secondary().aligned) &&
538
+ this.secondaryTicks().length > 1, ...(ngDevMode ? [{ debugName: "showSecondaryGridlines" }] : /* istanbul ignore next */ []));
539
+ secondaryLabelX = computed(() => this.stacked()
540
+ ? this.plot().left - CHART_AXIS_LABEL_GAP
541
+ : this.plot().left + this.plot().width + CHART_AXIS_LABEL_GAP, ...(ngDevMode ? [{ debugName: "secondaryLabelX" }] : /* istanbul ignore next */ []));
542
+ secondaryLabelAnchor = computed(() => this.stacked() ? 'end' : 'start', ...(ngDevMode ? [{ debugName: "secondaryLabelAnchor" }] : /* istanbul ignore next */ []));
543
+ secondaryPlotBottom = computed(() => this.secondaryPlot().top + this.secondaryPlot().height, ...(ngDevMode ? [{ debugName: "secondaryPlotBottom" }] : /* istanbul ignore next */ []));
544
+ /** No tint on a single-scale plot: one axis needs no telling apart, and colouring it would only
545
+ * restate the marks' own colour in the furniture. */
546
+ axisLabelFill = computed(() => this.hasSecondaryAxis() ? this.axisColor() : null, ...(ngDevMode ? [{ debugName: "axisLabelFill" }] : /* istanbul ignore next */ []));
547
+ secondaryAxisLabelFill = computed(() => this.secondaryAxisColor(), ...(ngDevMode ? [{ debugName: "secondaryAxisLabelFill" }] : /* istanbul ignore next */ []));
548
+ bands = computed(() => bandScale(this.categories().length, this.plot().width, CHART_BAND_PADDING), ...(ngDevMode ? [{ debugName: "bands" }] : /* istanbul ignore next */ []));
549
+ bandWidth = computed(() => this.bands().bandWidth, ...(ngDevMode ? [{ debugName: "bandWidth" }] : /* istanbul ignore next */ []));
550
+ xPosition = computed(() => {
551
+ const plot = this.plot();
552
+ const bands = this.bands();
553
+ return (index) => plot.left + bands.position(index) + bands.bandWidth / 2;
554
+ }, ...(ngDevMode ? [{ debugName: "xPosition" }] : /* istanbul ignore next */ []));
555
+ yPosition = computed(() => {
556
+ const plot = this.plot();
557
+ return valueScale(this.domain(), plot.top, plot.height);
558
+ }, ...(ngDevMode ? [{ debugName: "yPosition" }] : /* istanbul ignore next */ []));
559
+ zeroOffset = computed(() => this.yPosition()(0), ...(ngDevMode ? [{ debugName: "zeroOffset" }] : /* istanbul ignore next */ []));
560
+ cursorBand = computed(() => {
561
+ const index = this.activeIndex();
562
+ if (this.cursor() !== 'category' || index < 0) {
563
+ return null;
564
+ }
565
+ const width = this.bandWidth();
566
+ const plot = this.plot();
567
+ return {
568
+ x: this.xPosition()(index) - width / 2,
569
+ width,
570
+ top: plot.top,
571
+ bottom: plot.top + plot.height,
572
+ };
573
+ }, ...(ngDevMode ? [{ debugName: "cursorBand" }] : /* istanbul ignore next */ []));
574
+ /** The same state machine the element marks run on: pin, linger, the grace period that lets the
575
+ * pointer reach a portaled panel, Escape and press-outside. A category cursor differs from a
576
+ * mark only in what the index counts, so it takes the behaviour rather than restating it. */
577
+ cursorState = chartActiveMark(() => this.defaults.tooltipLingerMs());
578
+ activeIndex = this.cursorState.index;
579
+ pointerAt = signal(null, ...(ngDevMode ? [{ debugName: "pointerAt" }] : /* istanbul ignore next */ []));
580
+ cursorPointer = computed(() => this.activeIndex() < 0 ? null : this.pointerAt(), ...(ngDevMode ? [{ debugName: "cursorPointer" }] : /* istanbul ignore next */ []));
581
+ /** Whether the cursor is held. A preset renders its own way out of the pin from this. */
582
+ cursorPinned = this.cursorState.pinned;
583
+ releaseCursor() {
584
+ this.cursorState.release();
585
+ }
586
+ onPlotPointer(event) {
587
+ if (this.cursor() !== 'category') {
588
+ return;
589
+ }
590
+ const canvas = event.currentTarget.getBoundingClientRect();
591
+ const plot = this.plot();
592
+ // The canvas is scaled to its box, so a client x has to come back through the viewBox before
593
+ // it means anything to a plot measured in view units.
594
+ const viewX = ((event.clientX - canvas.left) / canvas.width) * this.viewWidth();
595
+ const index = this.clampIndex(categoryAt(viewX, plot.left, plot.width, this.categories().length));
596
+ this.pointerAt.set({ x: event.clientX, y: event.clientY });
597
+ if (event.type === 'pointerdown' && this.cursorPin()) {
598
+ this.cursorState.pin(index, event);
599
+ return;
600
+ }
601
+ this.cursorState.enter(index, event);
602
+ }
603
+ clearCursor() {
604
+ if (this.cursor() === 'category') {
605
+ this.cursorState.leave();
606
+ }
607
+ }
608
+ bandElement = viewChild('cursorBandEl', ...(ngDevMode ? [{ debugName: "bandElement" }] : /* istanbul ignore next */ []));
609
+ cursorOrigin = computed(() => this.cursorBand() ? (this.bandElement()?.nativeElement ?? null) : null, ...(ngDevMode ? [{ debugName: "cursorOrigin" }] : /* istanbul ignore next */ []));
610
+ setActiveIndex(index) {
611
+ this.cursorState.setIndex(this.clampIndex(index));
612
+ }
613
+ clampIndex(index) {
614
+ const last = this.categories().length - 1;
615
+ return Number.isFinite(index)
616
+ ? Math.min(Math.max(Math.trunc(index), -1), last)
617
+ : -1;
618
+ }
619
+ plotRight = computed(() => this.plot().left + this.plot().width, ...(ngDevMode ? [{ debugName: "plotRight" }] : /* istanbul ignore next */ []));
620
+ plotBottom = computed(() => this.plot().top + this.plot().height, ...(ngDevMode ? [{ debugName: "plotBottom" }] : /* istanbul ignore next */ []));
621
+ axisLabelX = computed(() => this.plot().left - CHART_AXIS_LABEL_GAP, ...(ngDevMode ? [{ debugName: "axisLabelX" }] : /* istanbul ignore next */ []));
622
+ /** Clears the same reservation the view height budgets, and only when it is there: adding it
623
+ * unconditionally would drop the labels past a viewBox that no longer holds the space. */
624
+ categoryLabelY = computed(() => this.secondaryPlotBottom() +
625
+ (this.reachesBelowZero() ? this.valueSpace() : 0) +
626
+ CHART_CATEGORY_LABEL_OFFSET, ...(ngDevMode ? [{ debugName: "categoryLabelY" }] : /* istanbul ignore next */ []));
627
+ ticks = computed(() => {
628
+ const domain = this.domain();
629
+ const toY = this.yPosition();
630
+ const format = this.valueFormatResolved();
631
+ return tickValues(domain.min, domain.max, this.tickCount()).map((value) => ({
632
+ value,
633
+ y: toY(value),
634
+ label: format(value, 'tick'),
635
+ }));
636
+ }, ...(ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []));
637
+ /** Rotation is spent before thinning: a tilt costs the reader a glance, dropping a label costs
638
+ * them a reading. Both are decided from the widest label as it actually rendered. */
639
+ categoryLabelsRotated = computed(() => rotationWouldFit([this.measuredCategoryLabelWidth()], this.plot().width / Math.max(1, this.categories().length)), ...(ngDevMode ? [{ debugName: "categoryLabelsRotated" }] : /* istanbul ignore next */ []));
640
+ categoryLabelInterval = computed(() => labelInterval([this.measuredCategoryLabelWidth()], this.plot().width / Math.max(1, this.categories().length), this.categoryLabelsRotated()), ...(ngDevMode ? [{ debugName: "categoryLabelInterval" }] : /* istanbul ignore next */ []));
641
+ categoryLabels = computed(() => {
642
+ const toX = this.xPosition();
643
+ const interval = this.categoryLabelInterval();
644
+ return (this.categories()
645
+ .map((text, index) => ({ x: toX(index), text, index }))
646
+ // The first is always drawn and the rest follow the interval, so the axis keeps an anchor
647
+ // the reader can count from rather than an arbitrary offset into the categories.
648
+ .filter((label) => label.index % interval === 0));
649
+ }, ...(ngDevMode ? [{ debugName: "categoryLabels" }] : /* istanbul ignore next */ []));
650
+ reachesBelowZero = computed(() => this.domain().min < 0, ...(ngDevMode ? [{ debugName: "reachesBelowZero" }] : /* istanbul ignore next */ []));
651
+ /** Empty is read off `categories` alone, never off the reported domains: the marks are
652
+ * projected INTO the branch that this decides, so a container that waited for a report before
653
+ * rendering them would never receive one. */
654
+ isEmpty = computed(() => this.categories().length === 0, ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
655
+ accessibleName = computed(() => this.summary() ?? this.caption() ?? 'Chart', ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
656
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
657
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartComponent, isStandalone: true, selector: "ds-chart", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, tickCount: { classPropertyName: "tickCount", publicName: "tickCount", 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 }, cursor: { classPropertyName: "cursor", publicName: "cursor", isSignal: true, isRequired: false, transformFunction: null }, cursorPin: { classPropertyName: "cursorPin", publicName: "cursorPin", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, maxSecondary: { classPropertyName: "maxSecondary", publicName: "maxSecondary", isSignal: true, isRequired: false, transformFunction: null }, plotHeight: { classPropertyName: "plotHeight", publicName: "plotHeight", isSignal: true, isRequired: false, transformFunction: null }, axisGutter: { classPropertyName: "axisGutter", publicName: "axisGutter", isSignal: true, isRequired: false, transformFunction: null }, valueSpace: { classPropertyName: "valueSpace", publicName: "valueSpace", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", 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 }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", 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 }, secondaryAxisMode: { classPropertyName: "secondaryAxisMode", publicName: "secondaryAxisMode", isSignal: true, isRequired: false, transformFunction: null }, axisColor: { classPropertyName: "axisColor", publicName: "axisColor", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisColor: { classPropertyName: "secondaryAxisColor", publicName: "secondaryAxisColor", isSignal: true, isRequired: false, transformFunction: null }, axisLabel: { classPropertyName: "axisLabel", publicName: "axisLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryAxisLabel: { classPropertyName: "secondaryAxisLabel", publicName: "secondaryAxisLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.framed": "frameResolved() === 'auto'", "class.measuring": "!settled()", "style.--_chart-view-height": "viewHeight() + 'px'" } }, providers: [
658
+ {
659
+ provide: CHART_SCALES,
660
+ useExisting: forwardRef(() => ChartComponent),
661
+ },
662
+ ], viewQueries: [{ propertyName: "bandElement", first: true, predicate: ["cursorBandEl"], descendants: true, isSignal: true }], exportAs: ["dsChart"], ngImport: i0, template: "<figure class=\"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 <ds-skeleton height=\"var(--_chart-view-height)\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\"\n (pointermove)=\"onPlotPointer($event)\"\n (pointerdown)=\"onPlotPointer($event)\"\n (pointerleave)=\"clearCursor()\">\n @if (cursorBand(); as band) {\n <g\n class=\"cursor\"\n aria-hidden=\"true\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\">\n <rect\n #cursorBandEl\n class=\"category-band\"\n [attr.x]=\"band.x\"\n [attr.y]=\"band.top\"\n [attr.width]=\"band.width\"\n [attr.height]=\"band.bottom - band.top\" />\n\n <line\n class=\"cursor-line\"\n [attr.x1]=\"band.x + band.width / 2\"\n [attr.x2]=\"band.x + band.width / 2\"\n [attr.y1]=\"band.top\"\n [attr.y2]=\"band.bottom\" />\n </g>\n }\n\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @if (axisLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"axisLabelFill()\"\n [attr.transform]=\"\n 'rotate(-90 12 ' +\n (plot().top + plot().height / 2) +\n ') translate(0 0)'\n \"\n [attr.x]=\"12\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ axisLabel() }}\n </text>\n }\n\n @if (secondaryAxisLabel() && hasSecondaryAxis()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.transform]=\"\n 'rotate(90 ' +\n (viewWidth() - 12) +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"viewWidth() - 12\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ secondaryAxisLabel() }}\n </text>\n }\n\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track label.index) {\n <text\n class=\"category-label\"\n [class.is-rotated]=\"categoryLabelsRotated()\"\n [attr.text-anchor]=\"categoryLabelsRotated() ? 'end' : 'middle'\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\"\n [attr.transform]=\"\n categoryLabelsRotated()\n ? 'rotate(-45 ' + label.x + ' ' + categoryLabelY() + ')'\n : null\n \">\n {{ label.text }}\n </text>\n }\n\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel], [dsSeriesAnnotation]\" />\n </g>\n </svg>\n </div>\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)}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.category-label.is-rotated{dominant-baseline:middle}.axis-title{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size);font-weight:var(--font-weight-bold)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}.cursor.cursor-in{animation:ds-chart-mark-fade-in var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.cursor.cursor-out{animation:ds-chart-mark-exit var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.category-band{fill:var(--ds-chart-hover-bg-color)}.cursor-line{stroke:var(--ds-chart-cursor-line-color);stroke-width:1}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
663
+ }
664
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartComponent, decorators: [{
665
+ type: Component,
666
+ args: [{ selector: 'ds-chart', standalone: true, exportAs: 'dsChart', imports: [SkeletonComponent], host: {
667
+ '[class.framed]': "frameResolved() === 'auto'",
668
+ '[class.measuring]': '!settled()',
669
+ '[style.--_chart-view-height]': "viewHeight() + 'px'",
670
+ }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
671
+ {
672
+ provide: CHART_SCALES,
673
+ useExisting: forwardRef(() => ChartComponent),
674
+ },
675
+ ], template: "<figure class=\"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 <ds-skeleton height=\"var(--_chart-view-height)\" />\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"plot\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\">\n <svg\n class=\"canvas\"\n preserveAspectRatio=\"xMidYMid meet\"\n [style.block-size.px]=\"viewHeight()\"\n [attr.viewBox]=\"viewBox()\"\n (pointermove)=\"onPlotPointer($event)\"\n (pointerdown)=\"onPlotPointer($event)\"\n (pointerleave)=\"clearCursor()\">\n @if (cursorBand(); as band) {\n <g\n class=\"cursor\"\n aria-hidden=\"true\"\n animate.enter=\"cursor-in\"\n animate.leave=\"cursor-out\">\n <rect\n #cursorBandEl\n class=\"category-band\"\n [attr.x]=\"band.x\"\n [attr.y]=\"band.top\"\n [attr.width]=\"band.width\"\n [attr.height]=\"band.bottom - band.top\" />\n\n <line\n class=\"cursor-line\"\n [attr.x1]=\"band.x + band.width / 2\"\n [attr.x2]=\"band.x + band.width / 2\"\n [attr.y1]=\"band.top\"\n [attr.y2]=\"band.bottom\" />\n </g>\n }\n\n <!-- Hidden as a group rather than on the svg: a projected mark may be focusable, and an\n aria-hidden ancestor would leave it reachable by Tab and invisible to a reader. -->\n <g\n class=\"axes\"\n aria-hidden=\"true\">\n @for (tick of ticks(); track tick.value) {\n <line\n class=\"grid-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"plotBottom()\"\n [attr.y2]=\"plotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"plot().top\"\n [attr.y2]=\"plotBottom()\" />\n\n @if (showSecondaryGridlines()) {\n @for (tick of secondaryTicks(); track tick.value) {\n <line\n class=\"grid-line is-secondary\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\" />\n }\n }\n\n @if (stacked()) {\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"secondaryPlotBottom()\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n\n <line\n class=\"axis-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plot().left\"\n [attr.y1]=\"secondaryPlot().top\"\n [attr.y2]=\"secondaryPlotBottom()\" />\n }\n\n @if (reachesBelowZero()) {\n <line\n class=\"zero-line\"\n [attr.x1]=\"plot().left\"\n [attr.x2]=\"plotRight()\"\n [attr.y1]=\"zeroOffset()\"\n [attr.y2]=\"zeroOffset()\" />\n }\n </g>\n\n <!-- Two slots, one group: a reference line has to paint UNDER the marks whatever order the\n consumer wrote it in, and a selected slot is what decides that instead of the author.\n Both stay inside `.marks`, which is what the boot transition guard is keyed on. -->\n <g class=\"marks\">\n <ng-content select=\"[dsReferenceLine]\" />\n\n <ng-content />\n </g>\n\n <g\n class=\"labels\"\n aria-hidden=\"true\">\n @if (axisLabel()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"axisLabelFill()\"\n [attr.transform]=\"\n 'rotate(-90 12 ' +\n (plot().top + plot().height / 2) +\n ') translate(0 0)'\n \"\n [attr.x]=\"12\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ axisLabel() }}\n </text>\n }\n\n @if (secondaryAxisLabel() && hasSecondaryAxis()) {\n <text\n class=\"axis-title\"\n text-anchor=\"middle\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.transform]=\"\n 'rotate(90 ' +\n (viewWidth() - 12) +\n ' ' +\n (plot().top + plot().height / 2) +\n ')'\n \"\n [attr.x]=\"viewWidth() - 12\"\n [attr.y]=\"plot().top + plot().height / 2\">\n {{ secondaryAxisLabel() }}\n </text>\n }\n\n @for (tick of ticks(); track tick.value) {\n <text\n class=\"axis-label is-primary\"\n text-anchor=\"end\"\n [style.fill]=\"axisLabelFill()\"\n [attr.x]=\"axisLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (tick of secondaryTicks(); track tick.value) {\n <text\n class=\"axis-label is-secondary\"\n [style.fill]=\"secondaryAxisLabelFill()\"\n [attr.text-anchor]=\"secondaryLabelAnchor()\"\n [attr.x]=\"secondaryLabelX()\"\n [attr.y]=\"tick.y\">\n {{ tick.label }}\n </text>\n }\n\n @for (label of categoryLabels(); track label.index) {\n <text\n class=\"category-label\"\n [class.is-rotated]=\"categoryLabelsRotated()\"\n [attr.text-anchor]=\"categoryLabelsRotated() ? 'end' : 'middle'\"\n [attr.x]=\"label.x\"\n [attr.y]=\"categoryLabelY()\"\n [attr.transform]=\"\n categoryLabelsRotated()\n ? 'rotate(-45 ' + label.x + ' ' + categoryLabelY() + ')'\n : null\n \">\n {{ label.text }}\n </text>\n }\n\n <!-- Over the marks, where `.marks` is under them: an annotation's LINE is furniture and\n belongs below the readings, its NAME has to survive a column drawn through it. -->\n <ng-content select=\"[dsReferenceLabel], [dsSeriesAnnotation]\" />\n </g>\n </svg>\n </div>\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)}.chart{--_chart-grid-line-color: var(--ds-chart-grid-line-color, var(--chart-grid-line-color));--_chart-axis-line-color: var(--ds-chart-axis-line-color, var(--chart-axis-line-color));--_chart-axis-label-color: var(--ds-chart-axis-label-color, var(--chart-axis-label-color));--_chart-axis-font-size: var(--ds-chart-axis-font-size, var(--chart-axis-font-size));margin:0}.empty{display:grid;place-items:center;min-block-size:var(--_chart-view-height);margin:0;color:var(--text-secondary);text-align:center;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.canvas{display:block;inline-size:100%}:host(.measuring) .marks ::ng-deep *{transition-duration:0ms!important}.grid-line{stroke:var(--_chart-grid-line-color);stroke-width:1}.axis-line,.zero-line{stroke:var(--_chart-axis-line-color);stroke-width:1}.axis-label,.category-label{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size)}.category-label.is-rotated{dominant-baseline:middle}.axis-title{fill:var(--_chart-axis-label-color);font-size:var(--_chart-axis-font-size);font-weight:var(--font-weight-bold)}.axis-label{dominant-baseline:middle}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}.cursor.cursor-in{animation:ds-chart-mark-fade-in var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.cursor.cursor-out{animation:ds-chart-mark-exit var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing) both}.category-band{fill:var(--ds-chart-hover-bg-color)}.cursor-line{stroke:var(--ds-chart-cursor-line-color);stroke-width:1}\n"] }]
676
+ }], ctorParameters: () => [], propDecorators: { categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: false }] }], tickCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickCount", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], cursor: [{ type: i0.Input, args: [{ isSignal: true, alias: "cursor", required: false }] }], cursorPin: [{ type: i0.Input, args: [{ isSignal: true, alias: "cursorPin", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], maxSecondary: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSecondary", required: false }] }], plotHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "plotHeight", required: false }] }], axisGutter: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisGutter", required: false }] }], valueSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSpace", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], secondaryAxisMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisMode", required: false }] }], axisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisColor", required: false }] }], secondaryAxisColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisColor", required: false }] }], axisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisLabel", required: false }] }], secondaryAxisLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryAxisLabel", required: false }] }], bandElement: [{ type: i0.ViewChild, args: ['cursorBandEl', { isSignal: true }] }] } });
677
+
678
+ /** The disc's radius, and half the glyph's box, in the same CSS pixels the plot is drawn in. */
679
+ const PIN_DISC_RADIUS = 11;
680
+ const PIN_GLYPH_SIZE = 14;
681
+ /** Distance from a mark's own tip to its value label's baseline. */
682
+ const VALUE_LABEL_GAP = 8;
683
+ /** Blank left at a stacked segment's lower end, so the boundary between two segments is a gap in
684
+ * the surface colour rather than a drawn rule. A rule is a third ink the palette has to stay
685
+ * legible against and it vanishes in print; a gap survives both, and it is the secondary encoding
686
+ * the palette's 6-8 dE separation band asks for. */
687
+ const STACK_SEGMENT_GAP = 2;
688
+ let nextSeriesId$1 = 0;
689
+ /**
690
+ * One column per datum, drawn against the scales `ds-chart` supplies.
691
+ *
692
+ * Hosted on a `<g>` rather than an element of its own: an element the SVG specification does not
693
+ * know is not rendered, and neither are its descendants, so `<ds-column-series>` inside the
694
+ * container's canvas would draw nothing. Written as `<svg:g dsColumnSeries>`.
695
+ */
696
+ class ColumnSeriesComponent {
697
+ scales = inject(CHART_SCALES);
698
+ /** Not `input.required`: the preset reads `tooltipContext()` from a binding on this same
699
+ * element, and a required input throws NG0950 for the pass before its own value is written. */
700
+ data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
701
+ /** Prints each column's value above the column. */
702
+ showValues = input(true, { ...(ngDevMode ? { debugName: "showValues" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
703
+ /** Turns on the click affordance - the pointer cursor and the hover tint. `pointClicked`
704
+ * fires whether or not this is set. */
705
+ interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
706
+ /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a
707
+ * press outside releases it. Pinning is a state, not a handler. */
708
+ pinOnClick = input(false, { ...(ngDevMode ? { debugName: "pinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
709
+ /** Fades every mark but the one under the pointer. Off by default: the dimming buys loudness
710
+ * for one mark and pays for it with the separation between the rest. */
711
+ dimOthers = input(false, { ...(ngDevMode ? { debugName: "dimOthers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
712
+ /** Milliseconds between one mark's entrance and the next. The total is capped, so a long
713
+ * series does not crawl in. */
714
+ staggerMs = input(0, { ...(ngDevMode ? { debugName: "staggerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
715
+ /** Declares that the marks are parts of one whole, which is what makes a share of their total
716
+ * a real quantity. On, each mark's share appears on the tooltip's second line. */
717
+ partOfWhole = input(false, { ...(ngDevMode ? { debugName: "partOfWhole" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
718
+ /** Whether a hovered or focused column opens a tooltip. */
719
+ tooltip = input('item', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
720
+ /** Where the tooltip is pinned. `'mark'` is the column itself; `'cell'` is the full-height
721
+ * category cell, which puts the panel at the top of the plot whatever the column's value. */
722
+ tooltipAnchor = input('mark', ...(ngDevMode ? [{ debugName: "tooltipAnchor" }] : /* istanbul ignore next */ []));
723
+ /** How long the panel survives the pointer leaving the mark. Raise it only for a panel a
724
+ * reader has to REACH, which is WCAG 1.4.13's hoverable clause; about 140 crosses the gap. */
725
+ tooltipLingerMs = input(0, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
726
+ /** Formats every value this series prints. Called with `'tick'` for an axis label and
727
+ * `'tooltip'` everywhere a value is printed in full. */
728
+ valueFormat = input(defaultChartFormat, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
729
+ /** The mark's share of its category's own slot, before the maximum width caps it. Measured off
730
+ * the slot rather than off `bandWidth()`, which has the container's own padding already taken
731
+ * out of it - applying both would narrow every uncapped column twice. */
732
+ columnWidthRatio = input(0.8, { ...(ngDevMode ? { debugName: "columnWidthRatio" } : /* istanbul ignore next */ {}), transform: numberAttribute });
733
+ /** This series' position among the slots a category's band is divided into. */
734
+ slot = input(0, { ...(ngDevMode ? { debugName: "slot" } : /* istanbul ignore next */ {}), transform: numberAttribute });
735
+ /** How many slots the band is divided into - the number of series drawn side by side. One, the
736
+ * default, is the whole band, which is what a single series has always taken. */
737
+ slotCount = input(1, { ...(ngDevMode ? { debugName: "slotCount" } : /* istanbul ignore next */ {}), transform: numberAttribute });
738
+ /** Where each mark starts and ends on the value axis, one entry per point. Unset, every mark
739
+ * runs from zero to its own value, which is the unstacked case. */
740
+ offsets = input(null, ...(ngDevMode ? [{ debugName: "offsets" }] : /* istanbul ignore next */ []));
741
+ /** One colour for the whole series, which is what several series drawn together need. Unset,
742
+ * each mark takes the categorical palette by its own position - the right reading when the
743
+ * marks ARE the categories, which is the single-series case. A point's own colour wins over
744
+ * both. */
745
+ seriesColor = input(null, ...(ngDevMode ? [{ debugName: "seriesColor" }] : /* istanbul ignore next */ []));
746
+ /** `seriesColor` for the fill pattern. A point's own `fill` wins. */
747
+ seriesFill = input(null, ...(ngDevMode ? [{ debugName: "seriesFill" }] : /* istanbul ignore next */ []));
748
+ /** Names the series in the tooltip, where the category then becomes the panel's heading. Unset,
749
+ * the panel names the category instead, which is what a chart of one series has to say. */
750
+ seriesLabel = input(null, ...(ngDevMode ? [{ debugName: "seriesLabel" }] : /* istanbul ignore next */ []));
751
+ /** The clicked datum. Fires on click and on Enter or Space, whatever `interactive` says. */
752
+ pointClicked = output();
753
+ seriesId = nextSeriesId$1++;
754
+ domainId = `column-series-${this.seriesId}`;
755
+ /** Per instance: two charts on one page would otherwise share the first `<pattern>` to reach the
756
+ * document, and every hatched mark would take that chart's colour. */
757
+ hatchId = `ds-column-hatch-${this.seriesId}`;
758
+ /** Where each mark actually spans, which is what the axis has to hold: a stacked segment's top
759
+ * is its category's running total, not its own reading. */
760
+ spans = computed(() => {
761
+ const given = this.offsets();
762
+ return this.data().map((point, index) => given?.[index] ?? {
763
+ from: 0,
764
+ to: Number.isFinite(point.value) ? point.value : 0,
765
+ });
766
+ }, ...(ngDevMode ? [{ debugName: "spans" }] : /* istanbul ignore next */ []));
767
+ constructor() {
768
+ effect(() => this.scales.reportDomain(this.domainId, this.spans().flatMap((span) => [span.from, span.to])));
769
+ }
770
+ ngOnDestroy() {
771
+ this.scales.releaseDomain(this.domainId);
772
+ }
773
+ activeMark = chartActiveMark(() => this.tooltipLingerMs());
774
+ /** One SERIES' slot inside a category's band: the whole band while a chart draws one series,
775
+ * a share of it per series when several are grouped. The box that catches the pointer is sized
776
+ * from this rather than from the drawn column, so a short column stays reachable. */
777
+ slotStep = computed(() => {
778
+ const count = this.data().length;
779
+ const slots = Math.max(1, this.slotCount());
780
+ return count > 0 ? this.scales.plot().width / count / slots : 0;
781
+ }, ...(ngDevMode ? [{ debugName: "slotStep" }] : /* istanbul ignore next */ []));
782
+ slotStepPx = computed(() => `${this.slotStep()}px`, ...(ngDevMode ? [{ debugName: "slotStepPx" }] : /* istanbul ignore next */ []));
783
+ markWidthPx = computed(() => `${this.slotStep() * this.columnWidthRatio()}px`, ...(ngDevMode ? [{ debugName: "markWidthPx" }] : /* istanbul ignore next */ []));
784
+ /** The whole canvas, reserved end included. Overshooting when the container drops that
785
+ * reservation costs nothing - the outer `<svg>` clips it - while falling short would leave a
786
+ * strip under the plot that answers no pointer. */
787
+ hitHeight = computed(() => {
788
+ const plot = this.scales.plot();
789
+ return chartViewHeight(plot.height, plot.top, true);
790
+ }, ...(ngDevMode ? [{ debugName: "hitHeight" }] : /* istanbul ignore next */ []));
791
+ pinDiscRadius = PIN_DISC_RADIUS;
792
+ pinGlyphSize = PIN_GLYPH_SIZE;
793
+ pinGlyphOffset = -PIN_GLYPH_SIZE / 2;
794
+ pinGlyph = inject(DomSanitizer).bypassSecurityTrustHtml(ICONS.pin);
795
+ marks = computed(() => {
796
+ const toX = this.scales.xPosition();
797
+ const toY = this.scales.yPosition();
798
+ const spans = this.spans();
799
+ const format = this.valueFormat();
800
+ return this.data().map((point, index) => {
801
+ const span = spans[index];
802
+ const foot = toY(span.from);
803
+ const tip = toY(span.to);
804
+ const below = tip > foot;
805
+ // Only a segment that has one under it gives up the gap: taking it off the baseline segment
806
+ // would lift the whole stack off the axis.
807
+ const gap = span.from === 0 ? 0 : Math.min(STACK_SEGMENT_GAP, Math.abs(tip - foot));
808
+ const baseline = below ? foot + gap : foot - gap;
809
+ const color = point.color ??
810
+ this.seriesColor() ??
811
+ CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length];
812
+ return {
813
+ key: point.id ?? String(index),
814
+ point,
815
+ x: toX(index),
816
+ tip,
817
+ below,
818
+ baseline,
819
+ top: Math.min(tip, baseline),
820
+ height: Math.abs(tip - baseline),
821
+ labelY: below ? tip + VALUE_LABEL_GAP : tip - VALUE_LABEL_GAP,
822
+ pinY: Math.min(tip, baseline) + PIN_DISC_RADIUS,
823
+ // Growing from the baseline, never the mark's own tip - a column below zero grows
824
+ // downward, so its transform-origin flips to the top edge it hangs from.
825
+ origin: below ? 'top' : 'bottom',
826
+ formattedValue: format(point.value, 'tooltip'),
827
+ color,
828
+ hatched: (point.fill ?? this.seriesFill()) === 'hatched',
829
+ };
830
+ });
831
+ }, ...(ngDevMode ? [{ debugName: "marks" }] : /* istanbul ignore next */ []));
832
+ markStagger(index) {
833
+ return `${staggerDelay(index, this.staggerMs())}ms`;
834
+ }
835
+ onMarkClick(payload, index, event) {
836
+ this.pointClicked.emit(payload);
837
+ if (this.pinOnClick()) {
838
+ this.activeMark.pin(index, event, this.tooltipAnchor() === 'mark' ? '.bar' : undefined);
839
+ }
840
+ }
841
+ onMarkEnter(index, event) {
842
+ this.activeMark.enter(index, event, this.tooltipAnchor() === 'mark' ? '.bar' : undefined);
843
+ }
844
+ /** One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not
845
+ * every mouse-operable control has to be separately focusable, and that is what keeps a
846
+ * twenty-five mark chart from being twenty-five stops in the page's tab order. */
847
+ rovingIndex = signal(0, ...(ngDevMode ? [{ debugName: "rovingIndex" }] : /* istanbul ignore next */ []));
848
+ tabStopIndex = computed(() => Math.min(this.rovingIndex(), Math.max(0, this.marks().length - 1)), ...(ngDevMode ? [{ debugName: "tabStopIndex" }] : /* istanbul ignore next */ []));
849
+ onMarkFocus(index, event) {
850
+ this.rovingIndex.set(index);
851
+ this.onMarkEnter(index, event);
852
+ }
853
+ onMarkNavigation(event, index) {
854
+ const next = nextRovingIndex(event.key, index, this.marks().length);
855
+ if (next === null) {
856
+ return;
857
+ }
858
+ event.preventDefault();
859
+ this.rovingIndex.set(next);
860
+ focusMark(event.currentTarget.closest('.columns'), next);
861
+ }
862
+ onPointKey(point, event) {
863
+ // Only the column's own key opens it: a key pressed on a control inside belongs to that
864
+ // control.
865
+ if (!this.interactive() || event.target !== event.currentTarget) {
866
+ return;
867
+ }
868
+ event.preventDefault();
869
+ this.pointClicked.emit(point);
870
+ }
871
+ entryLabel(mark) {
872
+ return `${mark.point.label}, ${mark.formattedValue}`;
873
+ }
874
+ tooltipContext = computed(() => {
875
+ const mark = this.marks()[this.activeMark.index()];
876
+ if (this.tooltip() === 'none' || !mark) {
877
+ return null;
878
+ }
879
+ const series = this.seriesLabel();
880
+ return {
881
+ category: series ? mark.point.label : '',
882
+ entries: [
883
+ {
884
+ label: series ?? mark.point.label,
885
+ value: mark.point.value,
886
+ formatted: mark.formattedValue,
887
+ color: mark.color,
888
+ detail: this.partOfWhole()
889
+ ? describeShare(this.data().map((point) => point.value), this.activeMark.index())
890
+ : undefined,
891
+ },
892
+ ],
893
+ };
894
+ }, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
895
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ColumnSeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
896
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ColumnSeriesComponent, isStandalone: true, selector: "g[dsColumnSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", 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 }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, partOfWhole: { classPropertyName: "partOfWhole", publicName: "partOfWhole", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAnchor: { classPropertyName: "tooltipAnchor", publicName: "tooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, columnWidthRatio: { classPropertyName: "columnWidthRatio", publicName: "columnWidthRatio", isSignal: true, isRequired: false, transformFunction: null }, slot: { classPropertyName: "slot", publicName: "slot", isSignal: true, isRequired: false, transformFunction: null }, slotCount: { classPropertyName: "slotCount", publicName: "slotCount", isSignal: true, isRequired: false, transformFunction: null }, offsets: { classPropertyName: "offsets", publicName: "offsets", isSignal: true, isRequired: false, transformFunction: null }, seriesColor: { classPropertyName: "seriesColor", publicName: "seriesColor", isSignal: true, isRequired: false, transformFunction: null }, seriesFill: { classPropertyName: "seriesFill", publicName: "seriesFill", isSignal: true, isRequired: false, transformFunction: null }, seriesLabel: { classPropertyName: "seriesLabel", publicName: "seriesLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, exportAs: ["dsColumnSeries"], ngImport: i0, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. -->\n <svg:defs>\n <svg:pattern\n class=\"hatch\"\n patternUnits=\"userSpaceOnUse\"\n width=\"8\"\n height=\"8\"\n patternTransform=\"rotate(45)\"\n [attr.id]=\"hatchId\">\n <svg:rect\n class=\"hatch-ground\"\n width=\"8\"\n height=\"8\" />\n\n <svg:line\n class=\"hatch-stripe\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"8\" />\n </svg:pattern>\n </svg:defs>\n\n @for (mark of marks(); track mark.key; let index = $index) {\n <svg:g\n class=\"column\"\n animate.leave=\"mark-leave\"\n [class.interactive]=\"interactive()\"\n [class.below-baseline]=\"mark.below\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [style.--_column-mark-height]=\"mark.height + 'px'\"\n [style.--_column-baseline-y]=\"mark.baseline + 'px'\"\n [style.--_column-x]=\"mark.x + 'px'\"\n [attr.data-mark-index]=\"index\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.aria-label]=\"interactive() ? entryLabel(mark) : null\"\n (pointerenter)=\"onMarkEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(mark.point, index, $event)\"\n (keydown.enter)=\"onPointKey(mark.point, $event)\"\n (keydown.space)=\"onPointKey(mark.point, $event)\">\n <!-- The box that catches the pointer is the whole category slot, not the drawn column: a\n column two pixels tall is otherwise unreachable, and a pointer that has to find the\n mark is a pointer that misses it. -->\n <svg:rect\n class=\"hit-area\"\n y=\"0\"\n [attr.height]=\"hitHeight()\" />\n\n <svg:g\n class=\"bar\"\n animate.enter=\"mark-enter\"\n [style.transform-origin]=\"mark.origin\">\n <!-- Under the capped rect, not beside it: `rx` rounds all four corners, and the cap\n belongs on the free end alone. This one fills the two corners at the baseline back\n in, and both keep `y` and `height` a plain interpolable length, which a `<path>`\n would not. -->\n <svg:rect\n class=\"bar-base\"\n [attr.fill]=\"mark.color\" />\n\n <svg:rect\n class=\"bar-cap\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"mark.color\" />\n\n <!-- Stripes OVER the painted mark, not a pattern in place of its fill: a pattern carries\n its own colour, so one shared definition cannot take each mark's. Painting the surface\n colour through it leaves the mark's own hue showing between the stripes. -->\n @if (mark.hatched) {\n <svg:rect\n class=\"bar-hatch\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"'url(#' + hatchId + ')'\" />\n }\n </svg:g>\n\n @if (showValues()) {\n <svg:text\n class=\"value\"\n text-anchor=\"middle\"\n [attr.y]=\"mark.labelY\">\n {{ mark.formattedValue }}\n </svg:text>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <svg:g\n class=\"pin-marker\"\n aria-hidden=\"true\"\n [attr.transform]=\"'translate(0,' + mark.pinY + ')'\">\n <svg:circle\n class=\"pin-disc\"\n [attr.r]=\"pinDiscRadius\" />\n\n <svg:svg\n class=\"pin-glyph\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.x]=\"pinGlyphOffset\"\n [attr.y]=\"pinGlyphOffset\"\n [attr.width]=\"pinGlyphSize\"\n [attr.height]=\"pinGlyphSize\"\n [innerHTML]=\"pinGlyph\" />\n </svg:g>\n }\n </svg:g>\n }\n</svg:g>\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)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.column .bar{transform-origin:bottom}.bar.mark-enter{animation:ds-chart-mark-grow-y var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.column.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.column:focus{outline:none}}.columns .column{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.columns .column.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:hover) .column.interactive:not(:hover),.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:focus-visible) .column.interactive:not(:focus-visible),.columns.dims-others:has(.column.is-pinned) .column:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.columns .column.interactive{cursor:pointer}.columns{--_column-chart-column-max-width: var(--ds-column-chart-column-max-width, 48px);--_column-chart-column-gap: var(--ds-column-chart-column-gap, var(--ds-chart-bar-gap));--_column-chart-cap-radius: var( --ds-column-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_chart-hatch-color: var( --ds-chart-hatch-color, var(--surface-default) );--_chart-hatch-width: var(--ds-chart-hatch-width, 3px)}.column{--_column-mark-width: min( var(--_column-chart-column-share), var(--_column-chart-column-max-width) );--_column-hit-width: min( var(--_column-chart-slot-step), calc( var(--_column-chart-column-max-width) + var(--_column-chart-column-gap) ) );--_column-square-height: min( var(--_column-chart-cap-radius), calc(var(--_column-mark-height) / 2) );--_column-slot-offset: calc( (2 * var(--_column-slot, 0) - var(--_column-slots, 1) + 1) * (var(--_column-mark-width) + var(--_column-chart-column-gap)) / 2 );transform:translate(calc(var(--_column-x, 0px) + var(--_column-slot-offset)))}.hit-area{width:var(--_column-hit-width);x:calc(var(--_column-hit-width) / -2);fill:transparent}.bar{transform-box:fill-box}.bar-base,.bar-cap,.bar-hatch{width:var(--_column-mark-width);x:calc(var(--_column-mark-width) / -2);transition:y var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),height var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.bar-cap{rx:var(--_column-chart-cap-radius)}.hatch-ground{fill:none}.hatch-stripe{stroke:var(--_chart-hatch-color);stroke-width:var(--_chart-hatch-width)}.bar-hatch{rx:var(--_column-chart-cap-radius);pointer-events:none}.bar-base{height:var(--_column-square-height);y:calc(var(--_column-baseline-y) - var(--_column-square-height))}.column.below-baseline .bar-base{y:var(--_column-baseline-y)}.value{fill:currentcolor;font-size:var(--font-size-xs);font-weight:700;pointer-events:none}.column.below-baseline .value{dominant-baseline:hanging}@media not (forced-colors:active){.column.interactive:focus-visible{outline:none}}.column.interactive:focus-visible .bar-cap{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}@media(forced-colors:active){.column.interactive:focus-visible .bar-cap{stroke:Highlight;filter:none}}.pin-marker{pointer-events:none}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
897
+ }
898
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ColumnSeriesComponent, decorators: [{
899
+ type: Component,
900
+ args: [{ selector: 'g[dsColumnSeries]', standalone: true, exportAs: 'dsColumnSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"columns\"\n [class.dims-others]=\"dimOthers()\"\n [style.--_column-chart-column-share]=\"markWidthPx()\"\n [style.--_column-chart-slot-step]=\"slotStepPx()\"\n [style.--_column-slot]=\"slot()\"\n [style.--_column-slots]=\"slotCount()\">\n <!-- `userSpaceOnUse`, so the stripe pitch is the same on a tall column and a short one: with the\n default object bounding box it would scale with each mark and read as a different texture\n per bar. -->\n <svg:defs>\n <svg:pattern\n class=\"hatch\"\n patternUnits=\"userSpaceOnUse\"\n width=\"8\"\n height=\"8\"\n patternTransform=\"rotate(45)\"\n [attr.id]=\"hatchId\">\n <svg:rect\n class=\"hatch-ground\"\n width=\"8\"\n height=\"8\" />\n\n <svg:line\n class=\"hatch-stripe\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"8\" />\n </svg:pattern>\n </svg:defs>\n\n @for (mark of marks(); track mark.key; let index = $index) {\n <svg:g\n class=\"column\"\n animate.leave=\"mark-leave\"\n [class.interactive]=\"interactive()\"\n [class.below-baseline]=\"mark.below\"\n [class.is-pinned]=\"activeMark.pinned() && activeMark.index() === index\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [style.--_column-mark-height]=\"mark.height + 'px'\"\n [style.--_column-baseline-y]=\"mark.baseline + 'px'\"\n [style.--_column-x]=\"mark.x + 'px'\"\n [attr.data-mark-index]=\"index\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.aria-label]=\"interactive() ? entryLabel(mark) : null\"\n (pointerenter)=\"onMarkEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(mark.point, index, $event)\"\n (keydown.enter)=\"onPointKey(mark.point, $event)\"\n (keydown.space)=\"onPointKey(mark.point, $event)\">\n <!-- The box that catches the pointer is the whole category slot, not the drawn column: a\n column two pixels tall is otherwise unreachable, and a pointer that has to find the\n mark is a pointer that misses it. -->\n <svg:rect\n class=\"hit-area\"\n y=\"0\"\n [attr.height]=\"hitHeight()\" />\n\n <svg:g\n class=\"bar\"\n animate.enter=\"mark-enter\"\n [style.transform-origin]=\"mark.origin\">\n <!-- Under the capped rect, not beside it: `rx` rounds all four corners, and the cap\n belongs on the free end alone. This one fills the two corners at the baseline back\n in, and both keep `y` and `height` a plain interpolable length, which a `<path>`\n would not. -->\n <svg:rect\n class=\"bar-base\"\n [attr.fill]=\"mark.color\" />\n\n <svg:rect\n class=\"bar-cap\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"mark.color\" />\n\n <!-- Stripes OVER the painted mark, not a pattern in place of its fill: a pattern carries\n its own colour, so one shared definition cannot take each mark's. Painting the surface\n colour through it leaves the mark's own hue showing between the stripes. -->\n @if (mark.hatched) {\n <svg:rect\n class=\"bar-hatch\"\n [attr.y]=\"mark.top\"\n [attr.height]=\"mark.height\"\n [attr.fill]=\"'url(#' + hatchId + ')'\" />\n }\n </svg:g>\n\n @if (showValues()) {\n <svg:text\n class=\"value\"\n text-anchor=\"middle\"\n [attr.y]=\"mark.labelY\">\n {{ mark.formattedValue }}\n </svg:text>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <svg:g\n class=\"pin-marker\"\n aria-hidden=\"true\"\n [attr.transform]=\"'translate(0,' + mark.pinY + ')'\">\n <svg:circle\n class=\"pin-disc\"\n [attr.r]=\"pinDiscRadius\" />\n\n <svg:svg\n class=\"pin-glyph\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.75\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.x]=\"pinGlyphOffset\"\n [attr.y]=\"pinGlyphOffset\"\n [attr.width]=\"pinGlyphSize\"\n [attr.height]=\"pinGlyphSize\"\n [innerHTML]=\"pinGlyph\" />\n </svg:g>\n }\n </svg:g>\n }\n</svg:g>\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)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.column .bar{transform-origin:bottom}.bar.mark-enter{animation:ds-chart-mark-grow-y var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.column.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.column:focus{outline:none}}.columns .column{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.columns .column.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:hover) .column.interactive:not(:hover),.columns.dims-others:not(:has(.column.is-pinned)):has(.column.interactive:focus-visible) .column.interactive:not(:focus-visible),.columns.dims-others:has(.column.is-pinned) .column:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.columns .column.interactive{cursor:pointer}.columns{--_column-chart-column-max-width: var(--ds-column-chart-column-max-width, 48px);--_column-chart-column-gap: var(--ds-column-chart-column-gap, var(--ds-chart-bar-gap));--_column-chart-cap-radius: var( --ds-column-chart-cap-radius, var(--ds-chart-mark-cap-radius) );--_chart-hatch-color: var( --ds-chart-hatch-color, var(--surface-default) );--_chart-hatch-width: var(--ds-chart-hatch-width, 3px)}.column{--_column-mark-width: min( var(--_column-chart-column-share), var(--_column-chart-column-max-width) );--_column-hit-width: min( var(--_column-chart-slot-step), calc( var(--_column-chart-column-max-width) + var(--_column-chart-column-gap) ) );--_column-square-height: min( var(--_column-chart-cap-radius), calc(var(--_column-mark-height) / 2) );--_column-slot-offset: calc( (2 * var(--_column-slot, 0) - var(--_column-slots, 1) + 1) * (var(--_column-mark-width) + var(--_column-chart-column-gap)) / 2 );transform:translate(calc(var(--_column-x, 0px) + var(--_column-slot-offset)))}.hit-area{width:var(--_column-hit-width);x:calc(var(--_column-hit-width) / -2);fill:transparent}.bar{transform-box:fill-box}.bar-base,.bar-cap,.bar-hatch{width:var(--_column-mark-width);x:calc(var(--_column-mark-width) / -2);transition:y var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),height var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.bar-cap{rx:var(--_column-chart-cap-radius)}.hatch-ground{fill:none}.hatch-stripe{stroke:var(--_chart-hatch-color);stroke-width:var(--_chart-hatch-width)}.bar-hatch{rx:var(--_column-chart-cap-radius);pointer-events:none}.bar-base{height:var(--_column-square-height);y:calc(var(--_column-baseline-y) - var(--_column-square-height))}.column.below-baseline .bar-base{y:var(--_column-baseline-y)}.value{fill:currentcolor;font-size:var(--font-size-xs);font-weight:700;pointer-events:none}.column.below-baseline .value{dominant-baseline:hanging}@media not (forced-colors:active){.column.interactive:focus-visible{outline:none}}.column.interactive:focus-visible .bar-cap{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}@media(forced-colors:active){.column.interactive:focus-visible .bar-cap{stroke:Highlight;filter:none}}.pin-marker{pointer-events:none}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}\n"] }]
901
+ }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValues", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], partOfWhole: [{ type: i0.Input, args: [{ isSignal: true, alias: "partOfWhole", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], columnWidthRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidthRatio", required: false }] }], slot: [{ type: i0.Input, args: [{ isSignal: true, alias: "slot", required: false }] }], slotCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotCount", required: false }] }], offsets: [{ type: i0.Input, args: [{ isSignal: true, alias: "offsets", required: false }] }], seriesColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesColor", required: false }] }], seriesFill: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesFill", required: false }] }], seriesLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "seriesLabel", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }] } });
902
+
903
+ let nextSeriesId = 0;
904
+ /**
905
+ * One line per series, drawn against the scales `ds-chart` supplies, on either of its two value
906
+ * axes.
907
+ *
908
+ * Hosted on a `<g>` rather than an element of its own: an element the SVG specification does not
909
+ * know is not rendered, and neither are its descendants. Written as `<svg:g dsLineSeries>`.
910
+ */
911
+ class LineSeriesComponent {
912
+ scales = inject(CHART_SCALES);
913
+ /** Not `input.required`: the preset reads `tooltipContext()` from a binding on this same
914
+ * element, and a required input throws NG0950 for the pass before its own value is written. */
915
+ data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
916
+ /** Draws a round marker at every reading. Off leaves the line alone, which reads better past
917
+ * roughly twenty points. */
918
+ showMarkers = input(true, { ...(ngDevMode ? { debugName: "showMarkers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
919
+ /** Turns on the click affordance - the pointer cursor and the hover tint. `pointClicked`
920
+ * fires whether or not this is set. */
921
+ interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
922
+ /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a
923
+ * press outside releases it. Pinning is a state, not a handler. */
924
+ pinOnClick = input(false, { ...(ngDevMode ? { debugName: "pinOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
925
+ /** Fades every series but the one under the pointer. Off by default: the dimming buys loudness
926
+ * for one line and pays for it with the separation between the rest. */
927
+ dimOthers = input(false, { ...(ngDevMode ? { debugName: "dimOthers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
928
+ /** The one series to single out: every other one draws faded and this one draws bold, so the
929
+ * comparison survives a monochrome print. Driven from a legend, or from whatever else the app
930
+ * uses to mean "show me this one". Needs `dimOthers`, which is what says fading is wanted at
931
+ * all. */
932
+ highlighted = input(null, ...(ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []));
933
+ /** A dash pattern per series, in the order the series are given. A series past the end of the
934
+ * list, or given an empty string, draws solid. */
935
+ patterns = input([], ...(ngDevMode ? [{ debugName: "patterns" }] : /* istanbul ignore next */ []));
936
+ /** Fills each area from the series below it rather than from the baseline, which is what a
937
+ * stacked plot needs and what the fill reads as. */
938
+ stacked = input(false, { ...(ngDevMode ? { debugName: "stacked" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
939
+ /** The dash for a series' position, or null where it draws solid. */
940
+ dashFor(seriesIndex) {
941
+ return this.patterns()[seriesIndex] || null;
942
+ }
943
+ /** Milliseconds between one marker's entrance and the next. The total is capped. */
944
+ staggerMs = input(0, { ...(ngDevMode ? { debugName: "staggerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
945
+ /** What a `null` reading draws: `'break'` leaves a hole in the line, `'zero'` plots a point
946
+ * at zero. A missing measurement and a measured zero are different facts. */
947
+ gaps = input('break', ...(ngDevMode ? [{ debugName: "gaps" }] : /* istanbul ignore next */ []));
948
+ /** How the line joins its readings. `'linear'` by default, which asserts nothing the data does
949
+ * not say; a curve is a claim about what happened BETWEEN two readings. `'step'` holds each
950
+ * reading to the next, `'smooth'` is a monotone cubic that draws no peak the data lacks. */
951
+ curve = input('linear', ...(ngDevMode ? [{ debugName: "curve" }] : /* istanbul ignore next */ []));
952
+ /** Whether a hovered or focused reading opens a tooltip, and for what. `'item'` names the
953
+ * marker itself. `'axis'` names every series at the category under the pointer, which is the
954
+ * reading a multi-series line is compared on - it follows the container's `cursor`, so set
955
+ * `cursor="category"` on `ds-chart` with it or nothing marks the category being read. */
956
+ tooltip = input('item', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
957
+ /** Where an `'axis'` panel hangs: `'reading'` puts it over the highest reading in the category,
958
+ * so it names what it points at and stays put while the pointer travels within one band;
959
+ * `'pointer'` follows the cursor. */
960
+ tooltipAnchor = input('reading', ...(ngDevMode ? [{ debugName: "tooltipAnchor" }] : /* istanbul ignore next */ []));
961
+ /** How long the panel survives the pointer leaving the marker. Raise it only for a panel a
962
+ * reader has to REACH, which is WCAG 1.4.13's hoverable clause; about 140 crosses the gap. */
963
+ tooltipLingerMs = input(0, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
964
+ /** Formats every value this series prints. Called with `'tick'` for an axis label and
965
+ * `'tooltip'` everywhere a value is printed in full. */
966
+ valueFormat = input(defaultChartFormat, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
967
+ /** The clicked reading, with the series it belongs to and its position in `categories`.
968
+ * Fires on click and on Enter or Space, whatever `interactive` says. */
969
+ pointClicked = output();
970
+ domainId = `line-series-${nextSeriesId++}`;
971
+ constructor() {
972
+ effect(() => {
973
+ this.scales.reportDomain(`${this.domainId}-primary`, this.valuesOn('primary'), 'primary');
974
+ this.scales.reportDomain(`${this.domainId}-secondary`, this.valuesOn('secondary'), 'secondary');
975
+ });
976
+ }
977
+ ngOnDestroy() {
978
+ this.scales.releaseDomain(`${this.domainId}-primary`);
979
+ this.scales.releaseDomain(`${this.domainId}-secondary`);
980
+ }
981
+ activeMark = chartActiveMark(() => this.tooltipLingerMs());
982
+ valuesOn(axis) {
983
+ return this.data()
984
+ .filter((series) => (series.axis ?? 'primary') === axis)
985
+ .flatMap((series) => series.data.filter((value) => value !== null));
986
+ }
987
+ /** A `null` past the end is the same missing reading as a `null` inside the run, so a series
988
+ * shorter than `categories` ends its line rather than running off the plot's edge. */
989
+ readingsOf(series, count) {
990
+ const zeroed = this.gaps() === 'zero';
991
+ const readings = [];
992
+ for (let index = 0; index < count; index++) {
993
+ const raw = series.data[index];
994
+ const reading = typeof raw === 'number' && Number.isFinite(raw) ? raw : null;
995
+ readings.push(reading === null && zeroed ? 0 : reading);
996
+ }
997
+ return readings;
998
+ }
999
+ plotted = computed(() => {
1000
+ const toX = this.scales.xPosition();
1001
+ const primaryY = this.scales.yPosition();
1002
+ const secondaryY = this.scales.secondaryYPosition();
1003
+ const categories = this.scales.categories();
1004
+ let markerIndex = 0;
1005
+ return this.data().map((series, index) => {
1006
+ const secondary = (series.axis ?? 'primary') === 'secondary';
1007
+ const toY = secondary ? secondaryY : primaryY;
1008
+ const color = series.color ?? CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length];
1009
+ const points = this.readingsOf(series, categories.length).map((value, categoryIndex) => value === null
1010
+ ? null
1011
+ : {
1012
+ categoryIndex,
1013
+ x: toX(categoryIndex),
1014
+ y: toY(value),
1015
+ value,
1016
+ });
1017
+ const segments = lineSegments(points);
1018
+ const format = this.valueFormat();
1019
+ const curve = this.curve();
1020
+ return {
1021
+ series,
1022
+ color,
1023
+ seriesIndex: index,
1024
+ linePaths: segments.map((segment) => linePath(segment, curve)),
1025
+ areaPaths: series.area
1026
+ ? this.areaPathsFor(series, segments, toX, toY, curve)
1027
+ : [],
1028
+ markers: points
1029
+ .filter((point) => point !== null)
1030
+ .map((point) => ({
1031
+ key: `${series.id}-${point.categoryIndex}`,
1032
+ markIndex: markerIndex++,
1033
+ x: point.x,
1034
+ y: point.y,
1035
+ value: point.value,
1036
+ category: categories[point.categoryIndex] ?? '',
1037
+ formattedValue: format(point.value, 'tooltip'),
1038
+ seriesLabel: series.label,
1039
+ seriesId: series.id,
1040
+ categoryIndex: point.categoryIndex,
1041
+ color,
1042
+ })),
1043
+ };
1044
+ });
1045
+ }, ...(ngDevMode ? [{ debugName: "plotted" }] : /* istanbul ignore next */ []));
1046
+ areaPathsFor(series, segments, toX, toY, curve) {
1047
+ const lower = series.lower;
1048
+ if (!lower) {
1049
+ return segments
1050
+ .map((segment) => areaPath(segment, toY(0), curve))
1051
+ .filter((path) => path.length > 0);
1052
+ }
1053
+ const lowerSegments = lineSegments(lower.map((value, categoryIndex) => value === null
1054
+ ? null
1055
+ : {
1056
+ categoryIndex,
1057
+ x: toX(categoryIndex),
1058
+ y: toY(value),
1059
+ value,
1060
+ }));
1061
+ return segments
1062
+ .map((segment, index) => lowerSegments[index]
1063
+ ? bandPath(segment, lowerSegments[index], curve)
1064
+ : areaPath(segment, toY(0), curve))
1065
+ .filter((path) => path.length > 0);
1066
+ }
1067
+ allMarkers = computed(() => this.plotted().flatMap((entry) => entry.markers), ...(ngDevMode ? [{ debugName: "allMarkers" }] : /* istanbul ignore next */ []));
1068
+ seriesStagger(index) {
1069
+ return `${staggerDelay(index, this.staggerMs())}ms`;
1070
+ }
1071
+ /** One tab stop PER SERIES: each line is a strand the reader walks with the arrows, and the
1072
+ * strands are what the chart is comparing. WCAG 2.1.1's Understanding is explicit that not
1073
+ * every mouse-operable control has to be separately focusable, which is what keeps a
1074
+ * 12-category, 2-series plot from being twenty-four stops in the page's tab order. */
1075
+ rovingBySeries = signal(new Map(), ...(ngDevMode ? [{ debugName: "rovingBySeries" }] : /* istanbul ignore next */ []));
1076
+ isTabStop(seriesId, markIndex) {
1077
+ const chosen = this.rovingBySeries().get(seriesId);
1078
+ if (chosen !== undefined) {
1079
+ return chosen === markIndex;
1080
+ }
1081
+ const first = this.plotted().find((entry) => entry.series.id === seriesId)
1082
+ ?.markers[0];
1083
+ return first?.markIndex === markIndex;
1084
+ }
1085
+ /** The series a marker holds focus on, which narrows an `'axis'` panel to that one reading: a
1086
+ * pointer answers for every series at once, a focused marker answers for its own. */
1087
+ focusedSeries = signal(null, ...(ngDevMode ? [{ debugName: "focusedSeries" }] : /* istanbul ignore next */ []));
1088
+ onMarkerEnter(markIndex, event) {
1089
+ this.activeMark.enter(markIndex, event);
1090
+ }
1091
+ onMarkerFocus(markIndex, event) {
1092
+ const marker = this.allMarkers()[markIndex];
1093
+ if (marker) {
1094
+ this.rovingBySeries.update((roving) => new Map(roving).set(marker.seriesId, markIndex));
1095
+ this.focusedSeries.set(marker.seriesId);
1096
+ this.scales.setActiveIndex(marker.categoryIndex);
1097
+ }
1098
+ this.onMarkerEnter(markIndex, event);
1099
+ }
1100
+ onMarkerBlur() {
1101
+ this.focusedSeries.set(null);
1102
+ this.activeMark.leave();
1103
+ }
1104
+ onMarkerNavigation(event, markIndex) {
1105
+ const marker = this.allMarkers()[markIndex];
1106
+ const strand = this.allMarkers().filter((candidate) => candidate.seriesId === marker?.seriesId);
1107
+ const current = strand.findIndex((candidate) => candidate.markIndex === markIndex);
1108
+ const next = nextRovingIndex(event.key, current, strand.length);
1109
+ if (next === null) {
1110
+ return;
1111
+ }
1112
+ event.preventDefault();
1113
+ focusMark(event.currentTarget.closest('.lines'), strand[next].markIndex);
1114
+ }
1115
+ isDimmed(seriesId) {
1116
+ const highlighted = this.highlighted();
1117
+ return this.dimOthers() && highlighted !== null && highlighted !== seriesId;
1118
+ }
1119
+ onMarkerClick(markIndex, event) {
1120
+ if (this.pinOnClick() && event) {
1121
+ this.activeMark.pin(markIndex, event, '.series-marker');
1122
+ }
1123
+ const marker = this.allMarkers()[markIndex];
1124
+ const series = this.data().find((entry) => entry.id === marker?.seriesId);
1125
+ if (marker && series) {
1126
+ this.pointClicked.emit({
1127
+ series,
1128
+ categoryIndex: marker.categoryIndex,
1129
+ value: marker.value,
1130
+ });
1131
+ }
1132
+ }
1133
+ markerLabel(marker) {
1134
+ return `${marker.seriesLabel}, ${marker.category}, ${marker.formattedValue}`;
1135
+ }
1136
+ tooltipContext = computed(() => {
1137
+ if (this.tooltip() === 'none') {
1138
+ return null;
1139
+ }
1140
+ if (this.tooltip() === 'axis') {
1141
+ return this.axisTooltipContext();
1142
+ }
1143
+ const marker = this.allMarkers()[this.activeMark.index()];
1144
+ if (!marker) {
1145
+ return null;
1146
+ }
1147
+ return {
1148
+ category: marker.category,
1149
+ entries: [
1150
+ {
1151
+ label: marker.seriesLabel,
1152
+ value: marker.value,
1153
+ formatted: marker.formattedValue,
1154
+ color: marker.color,
1155
+ },
1156
+ ],
1157
+ };
1158
+ }, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
1159
+ markerElements = viewChildren('markerEl', ...(ngDevMode ? [{ debugName: "markerElements" }] : /* istanbul ignore next */ []));
1160
+ /** The topmost reading at the active category, as its own element. The cursor band spans the
1161
+ * whole plot, so anchoring an `'axis'` panel to it opens the panel at the top of the chart
1162
+ * rather than over the readings it is about. */
1163
+ topReadingElement = computed(() => {
1164
+ const categoryIndex = this.scales.activeIndex();
1165
+ if (categoryIndex < 0) {
1166
+ return null;
1167
+ }
1168
+ const highest = this.allMarkers()
1169
+ .filter((marker) => marker.categoryIndex === categoryIndex)
1170
+ .reduce((top, marker) => (top === null || marker.y < top.y ? marker : top), null);
1171
+ return highest
1172
+ ? (this.markerElements()[highest.markIndex]?.nativeElement ?? null)
1173
+ : null;
1174
+ }, ...(ngDevMode ? [{ debugName: "topReadingElement" }] : /* istanbul ignore next */ []));
1175
+ /** Where the panel hangs: the reading or the pointer in `'axis'` mode, the hovered mark
1176
+ * otherwise. */
1177
+ tooltipOrigin = computed(() => {
1178
+ if (this.tooltip() !== 'axis') {
1179
+ return this.activeMark.origin();
1180
+ }
1181
+ if (this.tooltipAnchor() === 'pointer') {
1182
+ return this.scales.cursorPointer() ?? this.scales.cursorOrigin();
1183
+ }
1184
+ return this.topReadingElement() ?? this.scales.cursorOrigin();
1185
+ }, ...(ngDevMode ? [{ debugName: "tooltipOrigin" }] : /* istanbul ignore next */ []));
1186
+ /** Every series' reading at the category the CONTAINER says is active, which is what the
1187
+ * category cursor sets. A series with no reading there contributes no row rather than a
1188
+ * blank one. */
1189
+ axisTooltipContext = computed(() => {
1190
+ const categoryIndex = this.scales.activeIndex();
1191
+ if (categoryIndex < 0) {
1192
+ return null;
1193
+ }
1194
+ const focused = this.focusedSeries();
1195
+ const reporting = focused
1196
+ ? this.plotted().filter((entry) => entry.series.id === focused)
1197
+ : this.plotted();
1198
+ const entries = reporting.flatMap((entry) => {
1199
+ const marker = entry.markers.find((candidate) => candidate.categoryIndex === categoryIndex);
1200
+ return marker
1201
+ ? [
1202
+ {
1203
+ label: marker.seriesLabel,
1204
+ value: marker.value,
1205
+ formatted: marker.formattedValue,
1206
+ color: marker.color,
1207
+ },
1208
+ ]
1209
+ : [];
1210
+ });
1211
+ if (!entries.length) {
1212
+ return null;
1213
+ }
1214
+ return {
1215
+ category: this.scales.categories()[categoryIndex] ?? '',
1216
+ entries,
1217
+ };
1218
+ }, ...(ngDevMode ? [{ debugName: "axisTooltipContext" }] : /* istanbul ignore next */ []));
1219
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineSeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1220
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: LineSeriesComponent, isStandalone: true, selector: "g[dsLineSeries]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null }, patterns: { classPropertyName: "patterns", publicName: "patterns", isSignal: true, isRequired: false, transformFunction: null }, stacked: { classPropertyName: "stacked", publicName: "stacked", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, gaps: { classPropertyName: "gaps", publicName: "gaps", isSignal: true, isRequired: false, transformFunction: null }, curve: { classPropertyName: "curve", publicName: "curve", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAnchor: { classPropertyName: "tooltipAnchor", publicName: "tooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClicked: "pointClicked" }, viewQueries: [{ propertyName: "markerElements", predicate: ["markerEl"], descendants: true, isSignal: true }], exportAs: ["dsLineSeries"], ngImport: i0, template: "<svg:g\n class=\"lines\"\n [class.dims-others]=\"dimOthers()\">\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.areaPaths; track $index) {\n <svg:path\n class=\"series-area\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [class.is-stacked]=\"stacked()\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\" />\n }\n }\n\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-line\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.stroke]=\"entry.color\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (marker of entry.markers; track marker.key) {\n <svg:circle\n #markerEl\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"marker.markIndex === activeMark.index()\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.data-mark-index]=\"marker.markIndex\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.markIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"interactive() ? markerLabel(marker) : null\"\n (pointerenter)=\"onMarkerEnter(marker.markIndex, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkerFocus(marker.markIndex, $event)\"\n (blur)=\"onMarkerBlur()\"\n (keydown)=\"onMarkerNavigation($event, marker.markIndex)\"\n (click)=\"onMarkerClick(marker.markIndex, $event)\"\n (keydown.enter)=\"onMarkerClick(marker.markIndex)\"\n (keydown.space)=\"onMarkerClick(marker.markIndex)\" />\n }\n }\n }\n</svg:g>\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)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.series-line.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-line.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-area.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-area.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-marker.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-marker.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.series-marker:focus{outline:none}}.lines{--_chart-line-width: var(--ds-chart-line-width);--_chart-line-width-bold: var(--ds-chart-line-width-bold);--_chart-dot-radius: var(--ds-chart-dot-radius);--_chart-dot-radius-active: var(--ds-chart-dot-radius-active);--_chart-area-opacity: var(--ds-chart-area-opacity)}.series-line{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),stroke var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.series-line.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),r var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker.interactive{cursor:pointer}.series-area{fill-opacity:var(--_chart-area-opacity);stroke:none}.series-area.is-stacked{stroke:var(--surface-default);stroke-width:2;stroke-linejoin:round}.lines:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_chart-line-width-bold)}.series-line{fill:none;stroke-width:var(--_chart-line-width);stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-marker{r:var(--_chart-dot-radius)}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible,.series-marker.ghost.is-active{fill-opacity:1}.series-marker.is-active{r:var(--_chart-dot-radius-active)}.series-marker.interactive{stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(pointer:coarse){.series-marker.interactive{stroke-width:44px}}@media not (forced-colors:active){.series-marker.interactive:focus-visible{outline:none}}.series-marker.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color));r:var(--_chart-dot-radius-active)}@media(forced-colors:active){.series-line{stroke:CanvasText}.series-marker{fill:CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1221
+ }
1222
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: LineSeriesComponent, decorators: [{
1223
+ type: Component,
1224
+ args: [{ selector: 'g[dsLineSeries]', standalone: true, exportAs: 'dsLineSeries', encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"lines\"\n [class.dims-others]=\"dimOthers()\">\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.areaPaths; track $index) {\n <svg:path\n class=\"series-area\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [class.is-stacked]=\"stacked()\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.fill]=\"entry.color\" />\n }\n }\n\n @for (entry of plotted(); track entry.series.id) {\n @for (path of entry.linePaths; track $index) {\n <svg:path\n class=\"series-line\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [attr.stroke-dasharray]=\"dashFor(entry.seriesIndex)\"\n [style.--_chart-mark-stagger]=\"seriesStagger(entry.seriesIndex)\"\n [attr.d]=\"path\"\n [attr.stroke]=\"entry.color\" />\n }\n }\n\n @if (showMarkers() || interactive()) {\n @for (entry of plotted(); track entry.series.id) {\n @for (marker of entry.markers; track marker.key) {\n <svg:circle\n #markerEl\n class=\"series-marker\"\n [class.is-dimmed]=\"isDimmed(entry.series.id)\"\n [class.ghost]=\"!showMarkers()\"\n [class.interactive]=\"interactive()\"\n [class.is-active]=\"marker.markIndex === activeMark.index()\"\n [attr.cx]=\"marker.x\"\n [attr.cy]=\"marker.y\"\n [attr.fill]=\"entry.color\"\n [attr.data-mark-index]=\"marker.markIndex\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive()\n ? isTabStop(entry.series.id, marker.markIndex)\n ? 0\n : -1\n : null\n \"\n [attr.aria-label]=\"interactive() ? markerLabel(marker) : null\"\n (pointerenter)=\"onMarkerEnter(marker.markIndex, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkerFocus(marker.markIndex, $event)\"\n (blur)=\"onMarkerBlur()\"\n (keydown)=\"onMarkerNavigation($event, marker.markIndex)\"\n (click)=\"onMarkerClick(marker.markIndex, $event)\"\n (keydown.enter)=\"onMarkerClick(marker.markIndex)\"\n (keydown.space)=\"onMarkerClick(marker.markIndex)\" />\n }\n }\n }\n</svg:g>\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)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.series-line.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-line.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-area.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-area.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.series-marker.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.series-marker.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}@media not (forced-colors:active){.series-marker:focus{outline:none}}.lines{--_chart-line-width: var(--ds-chart-line-width);--_chart-line-width-bold: var(--ds-chart-line-width-bold);--_chart-dot-radius: var(--ds-chart-dot-radius);--_chart-dot-radius-active: var(--ds-chart-dot-radius-active);--_chart-area-opacity: var(--ds-chart-area-opacity)}.series-line{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),stroke var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.series-line.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing),r var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.series-marker.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.series-marker.interactive{cursor:pointer}.series-area{fill-opacity:var(--_chart-area-opacity);stroke:none}.series-area.is-stacked{stroke:var(--surface-default);stroke-width:2;stroke-linejoin:round}.lines:has(.series-line.is-dimmed) .series-line:not(.is-dimmed){stroke-width:var(--_chart-line-width-bold)}.series-line{fill:none;stroke-width:var(--_chart-line-width);stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.series-marker{r:var(--_chart-dot-radius)}.series-marker.ghost{fill-opacity:0}.series-marker.ghost:hover,.series-marker.ghost:focus-visible,.series-marker.ghost.is-active{fill-opacity:1}.series-marker.is-active{r:var(--_chart-dot-radius-active)}.series-marker.interactive{stroke:transparent;stroke-width:24px;vector-effect:non-scaling-stroke}@media(pointer:coarse){.series-marker.interactive{stroke-width:44px}}@media not (forced-colors:active){.series-marker.interactive:focus-visible{outline:none}}.series-marker.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color));r:var(--_chart-dot-radius-active)}@media(forced-colors:active){.series-line{stroke:CanvasText}.series-marker{fill:CanvasText}}\n"] }]
1225
+ }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], highlighted: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlighted", required: false }] }], patterns: [{ type: i0.Input, args: [{ isSignal: true, alias: "patterns", required: false }] }], stacked: [{ type: i0.Input, args: [{ isSignal: true, alias: "stacked", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], gaps: [{ type: i0.Input, args: [{ isSignal: true, alias: "gaps", required: false }] }], curve: [{ type: i0.Input, args: [{ isSignal: true, alias: "curve", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAnchor", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], pointClicked: [{ type: i0.Output, args: ["pointClicked"] }], markerElements: [{ type: i0.ViewChildren, args: ['markerEl', { isSignal: true }] }] } });
1226
+
1227
+ /**
1228
+ * The names of a chart's reference lines, laid out by the same geometry that draws them.
1229
+ *
1230
+ * A second element rather than part of `g[dsReferenceLine]`: the strokes belong under the marks
1231
+ * and the names over them, and a projected element lands in exactly one of the container's slots.
1232
+ * Reports no domain - the line it names already did.
1233
+ */
1234
+ class ReferenceLabelComponent {
1235
+ scales = inject(CHART_SCALES);
1236
+ /** The same list `dsReferenceLine` is given. This mark draws only the labels, so it is placed
1237
+ * AFTER the series and the line mark before it, which is what keeps a label legible over a mark
1238
+ * that would otherwise cover it. */
1239
+ thresholds = input([], ...(ngDevMode ? [{ debugName: "thresholds" }] : /* istanbul ignore next */ []));
1240
+ lines = computed(() => thresholdMarks(this.thresholds(), this.scales.plot(), this.scales.yPosition()).filter((mark) => mark.label !== ''), ...(ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []));
1241
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ReferenceLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1242
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ReferenceLabelComponent, isStandalone: true, selector: "g[dsReferenceLabel]", inputs: { thresholds: { classPropertyName: "thresholds", publicName: "thresholds", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg:g class=\"reference-labels\">\n @for (line of lines(); track line.key) {\n <svg:text\n class=\"threshold-label\"\n text-anchor=\"start\"\n [style.--_chart-threshold-color]=\"line.color\"\n [attr.x]=\"line.labelX\"\n [attr.y]=\"line.labelY\">\n {{ line.label }}\n </svg:text>\n }\n</svg:g>\n", styles: [".threshold-label{--_chart-threshold-color: var(--ds-chart-threshold-color, var(--chart-threshold-color));fill:var(--_chart-threshold-color);font-size:var(--ds-chart-axis-font-size);font-weight:600;paint-order:stroke;stroke:var(--ds-chart-frame-bg-color);stroke-width:3;stroke-linejoin:round}@media(forced-colors:active){.threshold-label{fill:CanvasText;stroke:Canvas}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1243
+ }
1244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ReferenceLabelComponent, decorators: [{
1245
+ type: Component,
1246
+ args: [{ selector: 'g[dsReferenceLabel]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g class=\"reference-labels\">\n @for (line of lines(); track line.key) {\n <svg:text\n class=\"threshold-label\"\n text-anchor=\"start\"\n [style.--_chart-threshold-color]=\"line.color\"\n [attr.x]=\"line.labelX\"\n [attr.y]=\"line.labelY\">\n {{ line.label }}\n </svg:text>\n }\n</svg:g>\n", styles: [".threshold-label{--_chart-threshold-color: var(--ds-chart-threshold-color, var(--chart-threshold-color));fill:var(--_chart-threshold-color);font-size:var(--ds-chart-axis-font-size);font-weight:600;paint-order:stroke;stroke:var(--ds-chart-frame-bg-color);stroke-width:3;stroke-linejoin:round}@media(forced-colors:active){.threshold-label{fill:CanvasText;stroke:Canvas}}\n"] }]
1247
+ }], propDecorators: { thresholds: [{ type: i0.Input, args: [{ isSignal: true, alias: "thresholds", required: false }] }] } });
1248
+
1249
+ let nextReferenceId = 0;
1250
+ /**
1251
+ * Reference lines and bands across the plot, drawn against the scales `ds-chart` supplies.
1252
+ *
1253
+ * Strokes only: the LABELS are a second element, `g[dsReferenceLabel]`, because the two belong in
1254
+ * different layers of the canvas - a line reads as furniture under the marks, a label has to stay
1255
+ * legible over them - and one projected element can only land in one of the container's slots.
1256
+ *
1257
+ * Hosted on a `<g>` rather than an element of its own: an element the SVG specification does not
1258
+ * know is not rendered, and neither are its descendants. Written as `<svg:g dsReferenceLine>`.
1259
+ */
1260
+ class ReferenceLineComponent {
1261
+ scales = inject(CHART_SCALES);
1262
+ /** The lines and bands to draw across the plot. Each entry is ONE reading, `value`, plus an
1263
+ * optional `label`, `color` and `dash`; a `to` makes it a band between two readings. Each one
1264
+ * widens the value axis to hold it, so a target above every mark still lands on the plot. */
1265
+ thresholds = input([], ...(ngDevMode ? [{ debugName: "thresholds" }] : /* istanbul ignore next */ []));
1266
+ domainId = `reference-line-${nextReferenceId++}`;
1267
+ constructor() {
1268
+ // Reported like a series: a target above every reading is the one the reader most needs to
1269
+ // see, and an axis derived from the data alone would draw it off the plot.
1270
+ effect(() => this.scales.reportDomain(this.domainId, this.thresholds().flatMap((threshold) => threshold.to == null
1271
+ ? [threshold.value]
1272
+ : [threshold.value, threshold.to])));
1273
+ }
1274
+ ngOnDestroy() {
1275
+ this.scales.releaseDomain(this.domainId);
1276
+ }
1277
+ lines = computed(() => thresholdMarks(this.thresholds(), this.scales.plot(), this.scales.yPosition()), ...(ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []));
1278
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ReferenceLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1279
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ReferenceLineComponent, isStandalone: true, selector: "g[dsReferenceLine]", inputs: { thresholds: { classPropertyName: "thresholds", publicName: "thresholds", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg:g\n class=\"references\"\n aria-hidden=\"true\">\n @for (line of lines(); track line.key) {\n <svg:g\n class=\"reference\"\n [style.--_chart-threshold-color]=\"line.color\">\n @if (line.band) {\n <svg:rect\n class=\"threshold-band\"\n [attr.x]=\"line.left\"\n [attr.y]=\"line.top\"\n [attr.width]=\"line.width\"\n [attr.height]=\"line.height\" />\n } @else {\n <svg:line\n class=\"threshold-line\"\n [class.is-dashed]=\"line.dash === 'dashed'\"\n [class.is-dotted]=\"line.dash === 'dotted'\"\n [attr.x1]=\"line.left\"\n [attr.x2]=\"line.right\"\n [attr.y1]=\"line.y\"\n [attr.y2]=\"line.y\" />\n }\n </svg:g>\n }\n</svg:g>\n", styles: [".references{--_chart-threshold-color: var(--ds-chart-threshold-color, var(--chart-threshold-color));--_chart-threshold-band-opacity: var(--ds-chart-threshold-band-opacity, var(--chart-threshold-band-opacity));--_chart-threshold-dashed-pattern: var(--ds-chart-threshold-dashed-pattern, var(--chart-threshold-dashed-pattern));--_chart-threshold-dotted-pattern: var(--ds-chart-threshold-dotted-pattern, var(--chart-threshold-dotted-pattern));pointer-events:none}.threshold-line{stroke:var(--_chart-threshold-color);stroke-width:var(--ds-chart-line-width)}.threshold-line.is-dashed{stroke-dasharray:var(--_chart-threshold-dashed-pattern)}.threshold-line.is-dotted{stroke-dasharray:var(--_chart-threshold-dotted-pattern);stroke-linecap:round}.threshold-band{fill:var(--_chart-threshold-color);fill-opacity:var(--_chart-threshold-band-opacity)}@media(forced-colors:active){.threshold-line{stroke:CanvasText}.threshold-band{fill:CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1280
+ }
1281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ReferenceLineComponent, decorators: [{
1282
+ type: Component,
1283
+ args: [{ selector: 'g[dsReferenceLine]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g\n class=\"references\"\n aria-hidden=\"true\">\n @for (line of lines(); track line.key) {\n <svg:g\n class=\"reference\"\n [style.--_chart-threshold-color]=\"line.color\">\n @if (line.band) {\n <svg:rect\n class=\"threshold-band\"\n [attr.x]=\"line.left\"\n [attr.y]=\"line.top\"\n [attr.width]=\"line.width\"\n [attr.height]=\"line.height\" />\n } @else {\n <svg:line\n class=\"threshold-line\"\n [class.is-dashed]=\"line.dash === 'dashed'\"\n [class.is-dotted]=\"line.dash === 'dotted'\"\n [attr.x1]=\"line.left\"\n [attr.x2]=\"line.right\"\n [attr.y1]=\"line.y\"\n [attr.y2]=\"line.y\" />\n }\n </svg:g>\n }\n</svg:g>\n", styles: [".references{--_chart-threshold-color: var(--ds-chart-threshold-color, var(--chart-threshold-color));--_chart-threshold-band-opacity: var(--ds-chart-threshold-band-opacity, var(--chart-threshold-band-opacity));--_chart-threshold-dashed-pattern: var(--ds-chart-threshold-dashed-pattern, var(--chart-threshold-dashed-pattern));--_chart-threshold-dotted-pattern: var(--ds-chart-threshold-dotted-pattern, var(--chart-threshold-dotted-pattern));pointer-events:none}.threshold-line{stroke:var(--_chart-threshold-color);stroke-width:var(--ds-chart-line-width)}.threshold-line.is-dashed{stroke-dasharray:var(--_chart-threshold-dashed-pattern)}.threshold-line.is-dotted{stroke-dasharray:var(--_chart-threshold-dotted-pattern);stroke-linecap:round}.threshold-band{fill:var(--_chart-threshold-color);fill-opacity:var(--_chart-threshold-band-opacity)}@media(forced-colors:active){.threshold-line{stroke:CanvasText}.threshold-band{fill:CanvasText}}\n"] }]
1284
+ }], ctorParameters: () => [], propDecorators: { thresholds: [{ type: i0.Input, args: [{ isSignal: true, alias: "thresholds", required: false }] }] } });
1285
+
1286
+ /**
1287
+ * A tooltip answers "what is this?" on hover; an annotation answers it in a printed page or a
1288
+ * screenshot.
1289
+ *
1290
+ * Takes the readings rather than finding them: a mark never sees the other marks, so the caller
1291
+ * that owns the series is the one that knows which value a label belongs to. Reports no domain -
1292
+ * the series it annotates already did.
1293
+ */
1294
+ class SeriesAnnotationComponent {
1295
+ scales = inject(CHART_SCALES);
1296
+ annotations = input([], ...(ngDevMode ? [{ debugName: "annotations" }] : /* istanbul ignore next */ []));
1297
+ placed = computed(() => {
1298
+ const plot = this.scales.plot();
1299
+ const xPosition = this.scales.xPosition();
1300
+ const yPosition = this.scales.yPosition();
1301
+ const secondaryYPosition = this.scales.secondaryYPosition();
1302
+ return annotationMarks(this.annotations().map((annotation, index) => ({
1303
+ key: `${annotation.categoryIndex}:${index}`,
1304
+ label: annotation.label,
1305
+ x: xPosition(annotation.categoryIndex),
1306
+ y: (annotation.axis === 'secondary' ? secondaryYPosition : yPosition)(annotation.value),
1307
+ })), plot.left + plot.width);
1308
+ }, ...(ngDevMode ? [{ debugName: "placed" }] : /* istanbul ignore next */ []));
1309
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SeriesAnnotationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1310
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SeriesAnnotationComponent, isStandalone: true, selector: "g[dsSeriesAnnotation]", inputs: { annotations: { classPropertyName: "annotations", publicName: "annotations", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg:g class=\"annotations\">\n @for (note of placed(); track note.key) {\n <svg:text\n class=\"annotation\"\n [attr.x]=\"note.x\"\n [attr.y]=\"note.y\"\n [attr.text-anchor]=\"note.anchor\">\n {{ note.label }}\n </svg:text>\n }\n</svg:g>\n", styles: [".annotations{--_chart-annotation-color: var(--ds-chart-annotation-color, var(--text-primary));--_chart-annotation-font-size: var(--ds-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_chart-annotation-font-weight: var(--ds-chart-annotation-font-weight, var(--font-weight-bold));--_chart-annotation-halo-color: var(--ds-chart-annotation-halo-color, var(--surface-default));--_chart-annotation-halo-width: var(--ds-chart-annotation-halo-width, 3px)}.annotation{fill:var(--_chart-annotation-color);font-size:var(--_chart-annotation-font-size);font-weight:var(--_chart-annotation-font-weight);paint-order:stroke;stroke:var(--_chart-annotation-halo-color);stroke-width:var(--_chart-annotation-halo-width);stroke-linejoin:round}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1311
+ }
1312
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SeriesAnnotationComponent, decorators: [{
1313
+ type: Component,
1314
+ args: [{ selector: 'g[dsSeriesAnnotation]', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:g class=\"annotations\">\n @for (note of placed(); track note.key) {\n <svg:text\n class=\"annotation\"\n [attr.x]=\"note.x\"\n [attr.y]=\"note.y\"\n [attr.text-anchor]=\"note.anchor\">\n {{ note.label }}\n </svg:text>\n }\n</svg:g>\n", styles: [".annotations{--_chart-annotation-color: var(--ds-chart-annotation-color, var(--text-primary));--_chart-annotation-font-size: var(--ds-chart-annotation-font-size, var(--ds-chart-axis-font-size));--_chart-annotation-font-weight: var(--ds-chart-annotation-font-weight, var(--font-weight-bold));--_chart-annotation-halo-color: var(--ds-chart-annotation-halo-color, var(--surface-default));--_chart-annotation-halo-width: var(--ds-chart-annotation-halo-width, 3px)}.annotation{fill:var(--_chart-annotation-color);font-size:var(--_chart-annotation-font-size);font-weight:var(--_chart-annotation-font-weight);paint-order:stroke;stroke:var(--_chart-annotation-halo-color);stroke-width:var(--_chart-annotation-halo-width);stroke-linejoin:round}\n"] }]
1315
+ }], propDecorators: { annotations: [{ type: i0.Input, args: [{ isSignal: true, alias: "annotations", required: false }] }] } });
1316
+
1317
+ /**
1318
+ * Generated bundle index. Do not edit.
1319
+ */
1320
+
1321
+ export { CHART_DEFAULT_VALUE_SPACE, CHART_SCALES, ChartComponent, ColumnSeriesComponent, LineSeriesComponent, ReferenceLabelComponent, ReferenceLineComponent, SeriesAnnotationComponent, annotationMarks, chartViewHeight, stackOffsets };
1322
+ //# sourceMappingURL=ids-group-ltd-ids-design-system-components-chart.mjs.map