ngwr 16.3.0 → 16.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/carousel/styles/_index.scss +53 -1
  2. package/charts/bar-chart/styles/_index.scss +494 -305
  3. package/charts/boxplot-chart/styles/_index.scss +114 -48
  4. package/charts/bullet-chart/styles/_index.scss +113 -42
  5. package/charts/calendar-heatmap/styles/_index.scss +111 -20
  6. package/charts/candlestick-chart/styles/_index.scss +61 -26
  7. package/charts/chart-legend/styles/_index.scss +119 -1
  8. package/charts/core/styles/_index.scss +201 -5
  9. package/charts/donut-chart/styles/_index.scss +76 -21
  10. package/charts/funnel-chart/styles/_index.scss +66 -38
  11. package/charts/gauge/styles/_index.scss +12 -1
  12. package/charts/heatmap-chart/styles/_index.scss +90 -53
  13. package/charts/line-chart/styles/_index.scss +143 -139
  14. package/charts/meter-group/styles/_index.scss +87 -25
  15. package/charts/radar-chart/styles/_index.scss +82 -40
  16. package/charts/scatter-chart/styles/_index.scss +117 -44
  17. package/charts/sparkline/styles/_index.scss +7 -1
  18. package/charts/treemap-chart/styles/_index.scss +94 -42
  19. package/charts/waterfall-chart/styles/_index.scss +150 -87
  20. package/color-picker/styles/_index.scss +7 -3
  21. package/copy-value/styles/_index.scss +21 -2
  22. package/date-stamp/styles/_index.scss +2 -1
  23. package/dialog/styles/_index.scss +6 -0
  24. package/drawer/styles/_index.scss +5 -1
  25. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  26. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  27. package/fesm2022/ngwr-carousel-testing.mjs +27 -1
  28. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  29. package/fesm2022/ngwr-carousel.mjs +86 -4
  30. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  31. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  32. package/fesm2022/ngwr-cascader.mjs +56 -25
  33. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  34. package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
  35. package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
  36. package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
  37. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  38. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
  39. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
  40. package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
  41. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
  42. package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
  43. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
  44. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
  45. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  46. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
  47. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
  48. package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
  49. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
  50. package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
  51. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  52. package/fesm2022/ngwr-charts-core.mjs +299 -18
  53. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  54. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  55. package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
  56. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  57. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
  58. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
  59. package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
  60. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
  61. package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
  62. package/fesm2022/ngwr-charts-gauge.mjs +98 -12
  63. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  64. package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
  65. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
  66. package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
  67. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  68. package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
  69. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  70. package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
  71. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  72. package/fesm2022/ngwr-charts-meter-group.mjs +223 -31
  73. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  74. package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
  75. package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
  77. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
  79. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
  81. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  82. package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
  83. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  84. package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
  85. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
  86. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
  87. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
  88. package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
  89. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
  90. package/fesm2022/ngwr-color-picker.mjs +44 -4
  91. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  92. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  93. package/fesm2022/ngwr-context-menu.mjs +60 -17
  94. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  95. package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
  96. package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
  97. package/fesm2022/ngwr-copy-value.mjs +38 -2
  98. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  99. package/fesm2022/ngwr-date-picker.mjs +56 -8
  100. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  101. package/fesm2022/ngwr-dialog.mjs +13 -5
  102. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  103. package/fesm2022/ngwr-drawer.mjs +19 -3
  104. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  105. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  106. package/fesm2022/ngwr-dropdown.mjs +49 -6
  107. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  108. package/fesm2022/ngwr-editor.mjs +1 -0
  109. package/fesm2022/ngwr-editor.mjs.map +1 -1
  110. package/fesm2022/ngwr-file-upload.mjs +7 -3
  111. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  112. package/fesm2022/ngwr-graph-testing.mjs +27 -0
  113. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  114. package/fesm2022/ngwr-graph.mjs +643 -14
  115. package/fesm2022/ngwr-graph.mjs.map +1 -1
  116. package/fesm2022/ngwr-i18n-ar.mjs +13 -4
  117. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  118. package/fesm2022/ngwr-i18n-cs.mjs +13 -4
  119. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  120. package/fesm2022/ngwr-i18n-de.mjs +13 -4
  121. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  122. package/fesm2022/ngwr-i18n-en.mjs +13 -4
  123. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  124. package/fesm2022/ngwr-i18n-es.mjs +13 -4
  125. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  126. package/fesm2022/ngwr-i18n-fr.mjs +13 -4
  127. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  128. package/fesm2022/ngwr-i18n-he.mjs +13 -4
  129. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  130. package/fesm2022/ngwr-i18n-hi.mjs +13 -4
  131. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  132. package/fesm2022/ngwr-i18n-id.mjs +13 -4
  133. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  134. package/fesm2022/ngwr-i18n-it.mjs +13 -4
  135. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  136. package/fesm2022/ngwr-i18n-ja.mjs +13 -4
  137. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  138. package/fesm2022/ngwr-i18n-ko.mjs +13 -4
  139. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  140. package/fesm2022/ngwr-i18n-nl.mjs +13 -4
  141. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  142. package/fesm2022/ngwr-i18n-pl.mjs +13 -4
  143. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  144. package/fesm2022/ngwr-i18n-pt.mjs +13 -4
  145. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  146. package/fesm2022/ngwr-i18n-ru.mjs +13 -4
  147. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  148. package/fesm2022/ngwr-i18n-sv.mjs +13 -4
  149. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  150. package/fesm2022/ngwr-i18n-tr.mjs +13 -4
  151. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  152. package/fesm2022/ngwr-i18n-uk.mjs +13 -4
  153. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  154. package/fesm2022/ngwr-i18n-vi.mjs +13 -4
  155. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  156. package/fesm2022/ngwr-i18n-zh-tw.mjs +13 -4
  157. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  158. package/fesm2022/ngwr-i18n-zh.mjs +13 -4
  159. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  160. package/fesm2022/ngwr-lightbox.mjs +22 -5
  161. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  162. package/fesm2022/ngwr-list.mjs +2 -2
  163. package/fesm2022/ngwr-list.mjs.map +1 -1
  164. package/fesm2022/ngwr-overlay.mjs +21 -2
  165. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  166. package/fesm2022/ngwr-pagination.mjs +1 -0
  167. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  168. package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
  169. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  170. package/fesm2022/ngwr-popconfirm.mjs +41 -5
  171. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  172. package/fesm2022/ngwr-popover.mjs +67 -12
  173. package/fesm2022/ngwr-popover.mjs.map +1 -1
  174. package/fesm2022/ngwr-schema-form.mjs +3 -0
  175. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  176. package/fesm2022/ngwr-select.mjs +100 -3
  177. package/fesm2022/ngwr-select.mjs.map +1 -1
  178. package/fesm2022/ngwr-sortable-list.mjs +2 -2
  179. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  180. package/fesm2022/ngwr-table-testing.mjs +71 -3
  181. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  182. package/fesm2022/ngwr-table.mjs +173 -11
  183. package/fesm2022/ngwr-table.mjs.map +1 -1
  184. package/fesm2022/ngwr-tour-testing.mjs +13 -1
  185. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  186. package/fesm2022/ngwr-tour.mjs +25 -16
  187. package/fesm2022/ngwr-tour.mjs.map +1 -1
  188. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  189. package/fesm2022/ngwr-tree.mjs +52 -8
  190. package/fesm2022/ngwr-tree.mjs.map +1 -1
  191. package/fesm2022/ngwr-utils.mjs +64 -1
  192. package/fesm2022/ngwr-utils.mjs.map +1 -1
  193. package/fesm2022/ngwr-version.mjs +1 -1
  194. package/fesm2022/ngwr-version.mjs.map +1 -1
  195. package/fesm2022/ngwr-window.mjs +16 -9
  196. package/fesm2022/ngwr-window.mjs.map +1 -1
  197. package/graph/styles/_index.scss +87 -0
  198. package/i18n/ar.json +13 -4
  199. package/i18n/cs.json +13 -4
  200. package/i18n/de.json +13 -4
  201. package/i18n/en.json +13 -4
  202. package/i18n/es.json +13 -4
  203. package/i18n/fr.json +13 -4
  204. package/i18n/he.json +13 -4
  205. package/i18n/hi.json +13 -4
  206. package/i18n/id.json +13 -4
  207. package/i18n/it.json +13 -4
  208. package/i18n/ja.json +13 -4
  209. package/i18n/ko.json +13 -4
  210. package/i18n/nl.json +13 -4
  211. package/i18n/pl.json +13 -4
  212. package/i18n/pt.json +13 -4
  213. package/i18n/ru.json +13 -4
  214. package/i18n/sv.json +13 -4
  215. package/i18n/tr.json +13 -4
  216. package/i18n/uk.json +13 -4
  217. package/i18n/vi.json +13 -4
  218. package/i18n/zh-TW.json +13 -4
  219. package/i18n/zh.json +13 -4
  220. package/llms-full.txt +12 -12
  221. package/llms.txt +64 -27
  222. package/package.json +1 -1
  223. package/popconfirm/styles/_index.scss +6 -0
  224. package/popover/styles/_index.scss +24 -13
  225. package/schematics/collection.json +5 -0
  226. package/schematics/eject/index.js +158 -0
  227. package/schematics/eject/schema.js +8 -0
  228. package/schematics/eject/schema.json +24 -0
  229. package/schematics/eject/source.js +295 -0
  230. package/schematics/use/symbol-map.json +2 -0
  231. package/select/styles/_index.scss +13 -0
  232. package/skills/ngwr/SKILL.md +30 -3
  233. package/skills/ngwr/references/catalog.md +2 -2
  234. package/table/styles/_index.scss +24 -0
  235. package/theme/styles/_focus.scss +11 -1
  236. package/tour/styles/_index.scss +6 -0
  237. package/types/ngwr-carousel-testing.d.ts +29 -6
  238. package/types/ngwr-carousel.d.ts +52 -5
  239. package/types/ngwr-cascader-testing.d.ts +4 -3
  240. package/types/ngwr-cascader.d.ts +29 -7
  241. package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
  242. package/types/ngwr-charts-bar-chart.d.ts +220 -48
  243. package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
  244. package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
  245. package/types/ngwr-charts-bullet-chart.d.ts +72 -12
  246. package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
  247. package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
  248. package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
  249. package/types/ngwr-charts-chart-legend.d.ts +142 -5
  250. package/types/ngwr-charts-core.d.ts +259 -21
  251. package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
  252. package/types/ngwr-charts-donut-chart.d.ts +124 -16
  253. package/types/ngwr-charts-funnel-chart.d.ts +62 -6
  254. package/types/ngwr-charts-gauge-testing.d.ts +5 -1
  255. package/types/ngwr-charts-gauge.d.ts +72 -10
  256. package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
  257. package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
  258. package/types/ngwr-charts-line-chart.d.ts +215 -86
  259. package/types/ngwr-charts-meter-group.d.ts +96 -7
  260. package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
  261. package/types/ngwr-charts-radar-chart.d.ts +148 -28
  262. package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
  263. package/types/ngwr-charts-scatter-chart.d.ts +188 -18
  264. package/types/ngwr-charts-sparkline.d.ts +26 -4
  265. package/types/ngwr-charts-treemap-chart.d.ts +121 -23
  266. package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
  267. package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
  268. package/types/ngwr-color-picker.d.ts +27 -0
  269. package/types/ngwr-context-menu-testing.d.ts +10 -9
  270. package/types/ngwr-context-menu.d.ts +19 -0
  271. package/types/ngwr-copy-value.d.ts +8 -0
  272. package/types/ngwr-date-picker.d.ts +34 -2
  273. package/types/ngwr-dialog.d.ts +30 -10
  274. package/types/ngwr-drawer.d.ts +32 -1
  275. package/types/ngwr-dropdown-testing.d.ts +8 -5
  276. package/types/ngwr-dropdown.d.ts +31 -6
  277. package/types/ngwr-file-upload.d.ts +8 -2
  278. package/types/ngwr-graph-testing.d.ts +28 -0
  279. package/types/ngwr-graph.d.ts +263 -91
  280. package/types/ngwr-lightbox.d.ts +15 -0
  281. package/types/ngwr-overlay.d.ts +16 -1
  282. package/types/ngwr-popconfirm-testing.d.ts +11 -2
  283. package/types/ngwr-popconfirm.d.ts +28 -1
  284. package/types/ngwr-popover.d.ts +59 -9
  285. package/types/ngwr-select.d.ts +37 -0
  286. package/types/ngwr-table-testing.d.ts +52 -1
  287. package/types/ngwr-table.d.ts +102 -10
  288. package/types/ngwr-tour-testing.d.ts +10 -0
  289. package/types/ngwr-tour.d.ts +32 -4
  290. package/types/ngwr-tree-testing.d.ts +1 -2
  291. package/types/ngwr-tree.d.ts +35 -2
  292. package/types/ngwr-utils.d.ts +79 -1
  293. package/types/ngwr-version.d.ts +1 -1
  294. package/types/ngwr-window.d.ts +14 -11
  295. package/window/styles/_index.scss +5 -10
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-charts-boxplot-chart.mjs","names":[],"sources":["../../../projects/lib/charts/boxplot-chart/internal/stats.ts","../../../projects/lib/charts/boxplot-chart/boxplot-chart.ts","../../../projects/lib/charts/boxplot-chart/boxplot-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrBoxplotStats } from '../types';\n\n/** How far past the box, in interquartile ranges, a value may lie and still be reached by a whisker: Tukey's. */\nconst FENCE = 1.5;\n\n/**\n * The `p` quantile of `sorted`, which is ascending and not empty, by LINEAR\n * INTERPOLATION between the two closest ranks — Hyndman and Fan's type 7, the default\n * of R's `quantile()` and NumPy's `quantile()` and what Excel's `QUARTILE.INC` computes.\n *\n * The quantile sits at the zero-based position `(n − 1) · p`: on a value where that\n * position is whole, and that share of the way between the two values either side\n * where it is not. So 1, 2, 3, 4 has its first quartile at position 0.75, three\n * quarters of the way from 1 to 2: 1.75.\n *\n * @internal\n */\nexport function quantile(sorted: readonly number[], p: number): number {\n const position = (sorted.length - 1) * p;\n const below = Math.floor(position);\n const above = Math.ceil(position);\n return sorted[below] + (position - below) * (sorted[above] - sorted[below]);\n}\n\n/**\n * The summary a box plot draws for `values`: the quartiles by {@link quantile}, the\n * whiskers to the farthest value within 1.5 IQR of the box (Tukey's fences, inclusive),\n * and every value strictly past them as an outlier, ascending. Values that are not\n * finite numbers are left out; with none left, there is nothing to draw: `null`.\n *\n * A whisker never reaches INTO the box. Interpolated quartiles can sit past every value\n * on their side of the fence — 0, 100, 100, 100 has its first quartile at 75 and its\n * lowest value within the fence at 100 — so a whisker end on the wrong side of its\n * quartile is held at the quartile, as matplotlib holds it, and the whisker has no\n * length.\n *\n * @internal\n */\nexport function boxplotStats(values: readonly number[]): Required<WrBoxplotStats> | null {\n const sorted = values.filter(value => Number.isFinite(value)).sort((a, b) => a - b);\n if (sorted.length === 0) return null;\n\n const q1 = quantile(sorted, 0.25);\n const median = quantile(sorted, 0.5);\n const q3 = quantile(sorted, 0.75);\n const reach = FENCE * (q3 - q1);\n const low = q1 - reach;\n const high = q3 + reach;\n\n const inside = sorted.filter(value => value >= low && value <= high);\n // Never empty — the first value at or above the first quartile lies within the fences\n // for any count — so the fallbacks are there for the type checker alone.\n const min = Math.min(q1, inside[0] ?? q1);\n const max = Math.max(q3, inside.at(-1) ?? q3);\n const outliers = sorted.filter(value => value < low || value > high);\n\n return { min, q1, median, q3, max, outliers };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n type ElementRef,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n viewChildren,\n} from '@angular/core';\n\nimport { WrChartTable, type WrChartTableData, wrChartAxis, useChartNumbers } from 'ngwr/charts/core';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { type WrChartTooltipRow, useChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { boxplotStats } from './internal/stats';\nimport type { WrBoxplotGroup, WrBoxplotStats } from './types';\n\n/** How many gaps the value axis aims for: `wrChartAxis`'s own default, on a plot tall enough for them. */\nconst TICK_COUNT = 4;\n\n/** How much plot height, in px, each gap of the value axis asks for: two and a half lines of tick label. */\nconst TICK_ROOM = 40;\n\n/**\n * How many of a group's outliers its tooltip writes out, the lowest first, a row each;\n * past that one more row counts the rest, so a group with dozens keeps a chip that fits\n * on the screen.\n */\nconst TOOLTIP_OUTLIERS = 3;\n\n/** A percentage to three decimals, so an inline style stays short. */\nconst percent = (value: number): number => Math.round(value * 1000) / 1000;\n\n/** A group's summary as the chart reads it: every number finite, the outliers ascending. */\ntype Summary = Required<WrBoxplotStats>;\n\n/** Where one group's marks sit, each as a percentage of the drawing's height from its top. */\ninterface DrawnBox {\n /** The upper whisker, from its end down to the box. */\n readonly upper: { readonly top: number; readonly bottom: number };\n /** The lower whisker, from the box down to its end. */\n readonly lower: { readonly top: number; readonly bottom: number };\n /** The box, from the third quartile down to the first. */\n readonly box: { readonly top: number; readonly bottom: number };\n readonly max: number;\n readonly median: number;\n readonly min: number;\n readonly outliers: readonly { readonly value: number; readonly top: number }[];\n /** Everything the group draws, outliers included: what the tooltip points at. */\n readonly extent: { readonly top: number; readonly bottom: number };\n}\n\n/** One group as the chart draws it: its data, its slot across the drawing and its marks. */\ninterface DrawnGroup {\n /** Its position in `groups`. */\n readonly index: number;\n readonly label: string;\n readonly color: string;\n /** Its summary, or `null` when it has nothing to draw. */\n readonly stats: Summary | null;\n /**\n * Where its slot starts, as a percentage of the drawing's width from its inline start:\n * the left, or the right under RTL.\n */\n readonly start: number;\n /** How wide its slot is, as a percentage of the drawing's width. */\n readonly slot: number;\n readonly marks: DrawnBox | null;\n}\n\n/** A span between two heights, top first whichever order they arrive in. */\nconst span = (a: number, b: number): { readonly top: number; readonly bottom: number } => ({\n top: Math.min(a, b),\n bottom: Math.max(a, b),\n});\n\n/**\n * The summary a group draws: its `stats` as given, when every one of the five numbers is\n * finite, else the summary of its `values`, else nothing.\n */\nfunction summarise(group: WrBoxplotGroup): Summary | null {\n const given = group.stats;\n if (given) {\n const { min, q1, median, q3, max } = given;\n if (![min, q1, median, q3, max].every(value => Number.isFinite(value))) return null;\n const outliers = (given.outliers ?? []).filter(value => Number.isFinite(value)).sort((a, b) => a - b);\n return { min, q1, median, q3, max, outliers };\n }\n return group.values ? boxplotStats(group.values) : null;\n}\n\n/**\n * Box-and-whisker plots of several groups side by side, on one value axis: a box from the\n * first quartile to the third with a line at the median, a whisker either side, and a dot\n * per outlier. No SVG and no dependency: every mark is an HTML element placed by\n * percentage, so a box keeps its width however tall the plot is.\n *\n * @example\n * ```html\n * <wr-boxplot-chart\n * ariaLabel=\"Response time by region\"\n * [groups]=\"[\n * { label: 'EU', values: [112, 98, 130, 141, 104, 99, 260] },\n * { label: 'US', stats: { min: 80, q1: 101, median: 118, q3: 134, max: 170, outliers: [240] } }\n * ]\"\n * />\n * ```\n *\n * From `values`, the chart works out the quartiles by LINEAR INTERPOLATION — type 7 of\n * Hyndman and Fan, the default of R's and NumPy's `quantile()` and what Excel's\n * `QUARTILE.INC` computes — and Tukey's whiskers: each reaches the farthest value within\n * 1.5 interquartile ranges of the box, and every value beyond is an outlier. A summary\n * worked out elsewhere goes in `stats` and is drawn exactly as given.\n *\n * The value axis is fitted to every number drawn, outliers included, with no zero forced\n * in — a box plot has no baseline — and snapped outward to a readable step. The groups\n * share the drawing's width in equal slots under their names, in reading order: left to\n * right, and right to left under RTL, as the bar chart's columns are, so the first group\n * stands beside the value axis either way.\n *\n * The drawing is one named `role=\"img\"` and takes no tab stop; the tooltip, with the five\n * numbers and the outliers past them, is pointer only. `dataTable` renders every group's\n * numbers as a table only assistive technology reaches.\n *\n * @see https://ngwr.dev/charts/boxplot-chart\n */\n@Component({\n selector: 'wr-boxplot-chart',\n templateUrl: './boxplot-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-boxplot-chart' },\n imports: [WrChartTable],\n})\nexport class WrBoxplotChart {\n /**\n * One entry per box, in reading order: each with its raw `values` or a `stats` summary\n * worked out elsewhere. A group with neither, or with nothing finite to summarise,\n * keeps its slot and its name and draws no box.\n */\n readonly groups = input<readonly WrBoxplotGroup[]>([]);\n\n /**\n * Accessible name of the chart. The numbers are nowhere in text unless `dataTable`\n * puts them there, so say what the chart shows. Falls back to `boxplotChart.label`\n * (\"Box plot\").\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'boxplotChart.label', 'Box plot');\n\n /**\n * What the groups are — a region, a release. Drawn under the group names only when\n * given; either way it heads the group column of the data table, which falls back to\n * `boxplotChart.group` (\"Group\").\n */\n readonly xLabel = input<string | null>(null);\n\n /** What the values measure, with their unit. Drawn above the value axis only when given. */\n readonly yLabel = input<string | null>(null);\n\n protected readonly xName = useI18nText(this.xLabel, 'boxplotChart.group', 'Group');\n\n private readonly upperName = wrReadI18nText('boxplotChart.upperWhisker', 'Upper whisker');\n private readonly q3Name = wrReadI18nText('boxplotChart.q3', 'Q3');\n private readonly medianName = wrReadI18nText('boxplotChart.median', 'Median');\n private readonly q1Name = wrReadI18nText('boxplotChart.q1', 'Q1');\n private readonly lowerName = wrReadI18nText('boxplotChart.lowerWhisker', 'Lower whisker');\n private readonly outliersName = wrReadI18nText('boxplotChart.outliers', 'Outliers');\n\n /**\n * Writes every number the chart shows: the axis ticks, the tooltip and the data table.\n * `null` uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ticks (`1.2K`, `3.4M`)\n * unless the full numbers are shorter.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /** The figures in full and the axis' compact ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly locale = inject(LOCALE_ID);\n\n /** How many outliers the tooltip leaves unwritten, in the reader's own digits: a count, never a value to format. */\n private readonly counts = new Intl.NumberFormat(this.locale);\n\n /** The tooltip's tail for the outliers past the first few it writes out. */\n private readonly moreOutliers = useI18nFormatter('boxplotChart.moreOutliers', '+{{count}} more');\n\n /**\n * A group's outliers in one data table cell, as the locale lists them. A narrow\n * CONJUNCTION list, because a unit list separates them with bare spaces in several\n * locales, and a space is the digit grouping of Russian and French: `9 000 12 000`.\n */\n private readonly list = new Intl.ListFormat(this.locale, { type: 'conjunction', style: 'narrow' });\n\n /** The colour of every group with no `color` of its own. Any CSS colour. @default 'var(--wr-color-primary)' */\n readonly color = input<string>('var(--wr-color-primary)');\n\n /**\n * The plot's height in px, at least 80. Under 160 the value axis aims for fewer ticks,\n * so their labels keep clear of one another. @default 240\n */\n readonly height = input(240, { transform: (v: unknown): number => Math.max(80, coerceNumberProperty(v, 240)) });\n\n /** Show the gridlines and the value axis' tick labels. @default true */\n readonly showGrid = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip with the hovered group's five numbers — the whiskers' ends, the\n * quartiles and the median — and its outliers' values, the lowest three, then how many\n * more there are. Pointer only. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Render every group's numbers as a table only assistive technology reaches, beside the\n * drawing: a row per group, a column for each of the five numbers from the lower\n * whisker up and, when a group has any, one listing its outliers. The drawing is one\n * named image, so without it the numbers are nowhere a screen reader can walk.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n private readonly groupEls = viewChildren<ElementRef<HTMLElement>>('group');\n\n /** Every group with its colour and its summary, in order. */\n private readonly resolvedGroups = computed(() =>\n this.groups().map((group, index) => ({\n index,\n label: group.label,\n color: group.color ?? this.color(),\n stats: summarise(group),\n }))\n );\n\n /**\n * The value axis, from `wrChartAxis` over every number drawn — whisker ends, quartiles,\n * medians and outliers alike, so a summary given out of order still lands inside it —\n * with no zero forced in and both ends kept off the data (`symmetric`). A single value\n * is centred with a step either side; with nothing to draw, the 0 to 1 frame.\n *\n * It aims for four gaps, and for fewer on a short plot: a gap per 40px of `height`, so\n * the tick labels, a line of text each, never stand on one another — at the 80px\n * floor, four gaps put five labels in 64px of drawing.\n */\n protected readonly axis = computed(() => {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n for (const { stats } of this.resolvedGroups()) {\n if (!stats) continue;\n for (const value of [stats.min, stats.q1, stats.median, stats.q3, stats.max, ...stats.outliers]) {\n if (value < min) min = value;\n if (value > max) max = value;\n }\n }\n const tickCount = Math.min(TICK_COUNT, Math.max(2, Math.floor(this.height() / TICK_ROOM)));\n return wrChartAxis(min, max, { symmetric: true, tickCount });\n });\n\n /** The groups as drawn: an equal slot each across the drawing, and their marks placed on the axis. */\n protected readonly drawnGroups = computed<readonly DrawnGroup[]>(() => {\n const groups = this.resolvedGroups();\n const { min, max } = this.axis();\n const top = (value: number): number => percent(((max - value) / (max - min)) * 100);\n const slot = groups.length > 0 ? 100 / groups.length : 100;\n return groups.map(group => {\n const s = group.stats;\n let marks: DrawnBox | null = null;\n if (s) {\n const outliers = s.outliers.map(value => ({ value, top: top(value) }));\n const all = [s.max, s.q3, s.median, s.q1, s.min, ...s.outliers].map(top);\n marks = {\n upper: span(top(s.max), top(s.q3)),\n lower: span(top(s.q1), top(s.min)),\n box: span(top(s.q3), top(s.q1)),\n max: top(s.max),\n median: top(s.median),\n min: top(s.min),\n outliers,\n extent: { top: Math.min(...all), bottom: Math.max(...all) },\n };\n }\n return { ...group, start: percent(group.index * slot), slot: percent(slot), marks };\n });\n });\n\n /** The value axis' ticks, top to bottom: each value's label and its gridline's distance from the top, in percent. */\n protected readonly yTicks = computed(() => {\n const { min, max, step, ticks } = this.axis();\n const labels = this.numbers.ticks(ticks, step);\n return ticks.map((value, i) => ({ label: labels[i], top: percent(((max - value) / (max - min)) * 100) }));\n });\n\n /**\n * One tooltip for the group under the pointer: its name and colour as the heading, then\n * the five numbers top to bottom, the way the box is drawn, and its outliers when it has\n * any — their VALUES, as the data table's column of the same name lists them: the lowest\n * three a row each under the one label, so a long figure never shares a line with\n * another and pushes past the chip, then a row counting the rest. It points at the top\n * of everything the group draws, so the chip covers none of its marks.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const group = this.drawnGroups()[index];\n const anchor = this.groupEls()[index]?.nativeElement.querySelector('.wr-boxplot-chart__extent') ?? null;\n if (!group?.stats || !anchor) return null;\n const { stats } = group;\n const rows: WrChartTooltipRow[] = [\n { label: this.upperName(), value: this.numbers.value(stats.max) },\n { label: this.q3Name(), value: this.numbers.value(stats.q3) },\n { label: this.medianName(), value: this.numbers.value(stats.median) },\n { label: this.q1Name(), value: this.numbers.value(stats.q1) },\n { label: this.lowerName(), value: this.numbers.value(stats.min) },\n ];\n if (stats.outliers.length > 0) {\n const shown = stats.outliers.slice(0, TOOLTIP_OUTLIERS).map(value => this.numbers.value(value));\n const rest = stats.outliers.length - shown.length;\n if (rest > 0) shown.push(this.moreOutliers({ count: this.counts.format(rest) }));\n shown.forEach((value, i) => rows.push({ label: i === 0 ? this.outliersName() : '', value }));\n }\n return { datum: { label: group.label, value: '', color: group.color, rows }, anchor };\n });\n\n /** The group the tooltip is reading, washed in the drawing. Never one with nothing drawn. */\n protected readonly activeGroup = computed(() => {\n const index = this.tip.active();\n return index !== null && this.drawnGroups()[index]?.marks ? index : null;\n });\n\n /**\n * The figures for `dataTable`: the chart's name as the caption, a row per group headed\n * by its name, and its five numbers ascending, as a five-number summary reads, written\n * as the tooltip writes them. The outliers column appears once any group has an\n * outlier, and lists that group's ascending. A group with nothing to draw has a row of\n * empty cells.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const groups = this.resolvedGroups();\n const withOutliers = groups.some(({ stats }) => (stats?.outliers.length ?? 0) > 0);\n const columns = [this.lowerName(), this.q1Name(), this.medianName(), this.q3Name(), this.upperName()];\n if (withOutliers) columns.push(this.outliersName());\n const value = (v: number): string => this.numbers.value(v);\n return {\n caption: this.resolvedAriaLabel(),\n corner: this.xName(),\n columns,\n groups: [\n {\n rows: groups.map(({ label, stats }) => {\n if (!stats) return { header: label, cells: columns.map(() => '') };\n const cells = [stats.min, stats.q1, stats.median, stats.q3, stats.max].map(value);\n if (withOutliers) cells.push(this.list.format(stats.outliers.map(value)));\n return { header: label, cells };\n }),\n },\n ],\n };\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/boxplot-chart');\n // A summary is drawn as given, so one whose numbers are out of order draws a whisker\n // inside its box, and one with a number that is not finite draws nothing at all —\n // both of which read on screen as data, not as a mistake.\n if (isDevMode()) {\n const warned = new Set<string>();\n effect(() => {\n for (const group of this.groups()) {\n const stats = group.stats;\n if (!stats) continue;\n const five = [stats.min, stats.q1, stats.median, stats.q3, stats.max];\n const problem = !five.every(v => Number.isFinite(v))\n ? 'has a number that is not finite, so it draws nothing'\n : five.some((v, i) => i > 0 && v < five[i - 1])\n ? 'is not in order (min ≤ q1 ≤ median ≤ q3 ≤ max), and is drawn as given'\n : null;\n const message = problem && `the stats of \"${group.label}\" ${problem}.`;\n if (!message || warned.has(message)) continue;\n warned.add(message);\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(`[NGWR] <wr-boxplot-chart>: ${message}`);\n }\n });\n }\n }\n\n /**\n * The pointer entered a group's slot. A group with nothing drawn reads as leaving, so a\n * chip open on its neighbour closes after the usual grace rather than at once.\n */\n protected onEnter(index: number, event: MouseEvent): void {\n if (this.drawnGroups()[index]?.marks) this.tip.enter(index);\n else this.tip.leave(event);\n }\n}\n\nexport type { WrBoxplotGroup, WrBoxplotStats } from './types';\n","@let active = activeGroup();\n<!-- Two columns: the value axis' ticks at inline start and the drawing beside them, with\n the axis' name above and the group names under the drawing only, so their\n percentages are the drawing's. -->\n<div class=\"wr-boxplot-chart__body\">\n @if (yLabel()) {\n <div class=\"wr-boxplot-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showGrid()) {\n <!-- In flow, so the column is exactly as wide as the longest label; each one hands\n the stylesheet the y of its own gridline. Hidden, as the drawing is one image:\n its name is what is announced, and the numbers are the data table's. -->\n <div class=\"wr-boxplot-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-boxplot-chart__y-tick\" [style.--wr-boxplot-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <div class=\"wr-boxplot-chart__plot\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\" [style.height.px]=\"height()\">\n <!-- Every mark is an element placed by percentage of this box, its width in px or a\n share of its slot: a box keeps its width however tall the plot is, which an SVG\n stretched to the plot would not. Hidden as well as presentational, as the\n scatter's drawing is: `img` already makes it so. -->\n <div class=\"wr-boxplot-chart__drawing\" aria-hidden=\"true\">\n @if (showGrid()) {\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-boxplot-chart__grid-line\" [style.--wr-boxplot-chart-y]=\"tick.top\"></span>\n }\n }\n\n <!-- By position, not by label: two groups may share one. Each slot is the hover\n target for its group, top to bottom, so the pointer need not find a 2px\n whisker. It carries the group's numbers in `data-*`, beside the placement. -->\n @for (g of drawnGroups(); track g.index) {\n <div\n #group\n class=\"wr-boxplot-chart__group\"\n [class.wr-boxplot-chart__group--active]=\"active === g.index\"\n [class.wr-boxplot-chart__group--empty]=\"!g.marks\"\n [style.--wr-boxplot-chart-slot-start]=\"g.start\"\n [style.--wr-boxplot-chart-slot-width]=\"g.slot\"\n [style.--wr-boxplot-chart-group-color]=\"g.color\"\n [attr.data-min]=\"g.stats?.min\"\n [attr.data-q1]=\"g.stats?.q1\"\n [attr.data-median]=\"g.stats?.median\"\n [attr.data-q3]=\"g.stats?.q3\"\n [attr.data-max]=\"g.stats?.max\"\n (mouseenter)=\"onEnter(g.index, $event)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (g.marks; as m) {\n <span\n class=\"wr-boxplot-chart__whisker wr-boxplot-chart__whisker--upper\"\n [style.--wr-boxplot-chart-top]=\"m.upper.top\"\n [style.--wr-boxplot-chart-bottom]=\"m.upper.bottom\"\n ></span>\n <span\n class=\"wr-boxplot-chart__whisker wr-boxplot-chart__whisker--lower\"\n [style.--wr-boxplot-chart-top]=\"m.lower.top\"\n [style.--wr-boxplot-chart-bottom]=\"m.lower.bottom\"\n ></span>\n <span\n class=\"wr-boxplot-chart__cap wr-boxplot-chart__cap--upper\"\n [style.--wr-boxplot-chart-y]=\"m.max\"\n ></span>\n <span\n class=\"wr-boxplot-chart__cap wr-boxplot-chart__cap--lower\"\n [style.--wr-boxplot-chart-y]=\"m.min\"\n ></span>\n <span\n class=\"wr-boxplot-chart__box\"\n [style.--wr-boxplot-chart-top]=\"m.box.top\"\n [style.--wr-boxplot-chart-bottom]=\"m.box.bottom\"\n ></span>\n <span class=\"wr-boxplot-chart__median\" [style.--wr-boxplot-chart-y]=\"m.median\"></span>\n @for (o of m.outliers; track $index) {\n <span\n class=\"wr-boxplot-chart__outlier\"\n [style.--wr-boxplot-chart-y]=\"o.top\"\n [attr.data-value]=\"o.value\"\n ></span>\n }\n <!-- Paints nothing: the span from the topmost mark to the lowest, outliers\n included, which the tooltip points at so its chip covers none of them. -->\n <span\n class=\"wr-boxplot-chart__extent\"\n [style.--wr-boxplot-chart-top]=\"m.extent.top\"\n [style.--wr-boxplot-chart-bottom]=\"m.extent.bottom\"\n ></span>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- Each name is centred under its slot and ellipsised past it; the tooltip and the\n data table carry it whole. -->\n <div class=\"wr-boxplot-chart__x-axis\">\n @for (g of drawnGroups(); track g.index) {\n <span\n class=\"wr-boxplot-chart__x-label\"\n [style.--wr-boxplot-chart-slot-start]=\"g.start\"\n [style.--wr-boxplot-chart-slot-width]=\"g.slot\"\n >{{ g.label }}</span\n >\n }\n </div>\n\n @if (xLabel()) {\n <div class=\"wr-boxplot-chart__x-title\">{{ xLabel() }}</div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the plot's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,QAAQ;AAcd,SAAgB,SAAS,QAA2B,GAAS;CAC3D,MAAM,YAAY,OAAO,SAAS,KAAK;CACvC,MAAM,QAAQ,KAAK,MAAM,QAAQ;CACjC,MAAM,QAAQ,KAAK,KAAK,QAAQ;CAChC,OAAO,OAAO,UAAU,WAAW,UAAU,OAAO,SAAS,OAAO;AACtE;AAgBA,SAAgB,aAAa,QAAyB;CACpD,MAAM,SAAS,OAAO,QAAO,UAAS,OAAO,SAAS,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC;CAClF,IAAI,OAAO,WAAW,GAAG,OAAO;CAEhC,MAAM,KAAK,SAAS,QAAQ,GAAI;CAChC,MAAM,SAAS,SAAS,QAAQ,EAAG;CACnC,MAAM,KAAK,SAAS,QAAQ,GAAI;CAChC,MAAM,QAAQ,SAAS,KAAK;CAC5B,MAAM,MAAM,KAAK;CACjB,MAAM,OAAO,KAAK;CAElB,MAAM,SAAS,OAAO,QAAO,UAAS,SAAS,OAAO,SAAS,IAAI;CAOnE,OAAO;EAAE,KAJG,KAAK,IAAI,I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AAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-charts-boxplot-chart.mjs","names":[],"sources":["../../../projects/lib/charts/boxplot-chart/internal/stats.ts","../../../projects/lib/charts/boxplot-chart/boxplot-chart.ts","../../../projects/lib/charts/boxplot-chart/boxplot-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrBoxplotStats } from '../types';\n\n/** How far past the box, in interquartile ranges, a value may lie and still be reached by a whisker: Tukey's. */\nconst FENCE = 1.5;\n\n/**\n * How many outliers a group DRAWS on each side of its box at the most. Past it the dots\n * are a sample; the summary, the tooltip's count and the data table keep them all.\n */\nconst DRAWN_PER_SIDE = 100;\n\n/** The first index of ascending `sorted` whose value is at least `bound`, or its length. */\nfunction firstAtLeast(sorted: Float64Array, bound: number): number {\n let from = 0;\n let to = sorted.length;\n while (from < to) {\n const middle = (from + to) >>> 1; // eslint-disable-line no-bitwise -- halving an index\n if (sorted[middle] < bound) from = middle + 1;\n else to = middle;\n }\n return from;\n}\n\n/** The first index of ascending `sorted` whose value is past `bound`, or its length. */\nfunction firstPast(sorted: Float64Array, bound: number): number {\n let from = 0;\n let to = sorted.length;\n while (from < to) {\n const middle = (from + to) >>> 1; // eslint-disable-line no-bitwise -- halving an index\n if (sorted[middle] <= bound) from = middle + 1;\n else to = middle;\n }\n return from;\n}\n\n/** `limit` of ascending `run` from `start` up to `end`, evenly spread, both ends among them. */\nfunction sample(run: readonly number[], start: number, end: number, limit: number, into: number[]): void {\n const count = end - start;\n if (count <= limit) {\n for (let i = start; i < end; i++) into.push(run[i]);\n return;\n }\n for (let k = 0; k < limit; k++) into.push(run[start + Math.round((k * (count - 1)) / (limit - 1))]);\n}\n\n/**\n * The `p` quantile of `sorted`, which is ascending and not empty, by LINEAR\n * INTERPOLATION between the two closest ranks — Hyndman and Fan's type 7, the default\n * of R's `quantile()` and NumPy's `quantile()` and what Excel's `QUARTILE.INC` computes.\n *\n * The quantile sits at the zero-based position `(n − 1) · p`: on a value where that\n * position is whole, and that share of the way between the two values either side\n * where it is not. So 1, 2, 3, 4 has its first quartile at position 0.75, three\n * quarters of the way from 1 to 2: 1.75.\n *\n * @internal\n */\nexport function quantile(sorted: ArrayLike<number>, p: number): number {\n const position = (sorted.length - 1) * p;\n const below = Math.floor(position);\n const above = Math.ceil(position);\n return sorted[below] + (position - below) * (sorted[above] - sorted[below]);\n}\n\n/**\n * The finite numbers of `values`, ascending, in a typed array of their own: the array\n * given is never reordered.\n *\n * A `Float64Array` sorts numerically with no comparator, in native code over unboxed\n * doubles: a hundred thousand values sort in about a quarter of the time\n * `number[].sort((a, b) => a - b)` takes, which calls back into script for every\n * comparison.\n *\n * @internal\n */\nexport function sortedFinite(values: ArrayLike<number>): Float64Array {\n const kept = new Float64Array(values.length);\n let count = 0;\n // An `ArrayLike` has an index and a length and no iterator.\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < values.length; i++) {\n const value = values[i];\n if (Number.isFinite(value)) kept[count++] = value;\n }\n return kept.subarray(0, count).sort();\n}\n\n/**\n * The summary a box plot draws for `values`: the quartiles by {@link quantile}, the\n * whiskers to the farthest value within 1.5 IQR of the box (Tukey's fences, inclusive),\n * and every value strictly past them as an outlier, ascending. Values that are not\n * finite numbers are left out; with none left, there is nothing to draw: `null`.\n *\n * A whisker never reaches INTO the box. Interpolated quartiles can sit past every value\n * on their side of the fence — 0, 100, 100, 100 has its first quartile at 75 and its\n * lowest value within the fence at 100 — so a whisker end on the wrong side of its\n * quartile is held at the quartile, as matplotlib holds it, and the whisker has no\n * length.\n *\n * One typed sort ({@link sortedFinite}) and two binary searches: the values inside the\n * fences are one run of the sorted array and the outliers the two runs either side of\n * it, so nothing is filtered a second and a third time.\n *\n * @internal\n */\nexport function boxplotStats(values: ArrayLike<number>): Required<WrBoxplotStats> | null {\n const sorted = sortedFinite(values);\n if (sorted.length === 0) return null;\n\n const q1 = quantile(sorted, 0.25);\n const median = quantile(sorted, 0.5);\n const q3 = quantile(sorted, 0.75);\n const reach = FENCE * (q3 - q1);\n\n // The run inside the fences is never empty — the first value at or above the first\n // quartile lies within them for any count.\n const from = firstAtLeast(sorted, q1 - reach);\n const to = firstPast(sorted, q3 + reach);\n const min = Math.min(q1, sorted[from]);\n const max = Math.max(q3, sorted[to - 1]);\n\n const outliers = new Array<number>(from + sorted.length - to);\n for (let i = 0; i < from; i++) outliers[i] = sorted[i];\n for (let i = to; i < sorted.length; i++) outliers[from + i - to] = sorted[i];\n\n return { min, q1, median, q3, max, outliers };\n}\n\n/**\n * The outliers a group DRAWS, of its ascending `outliers`: every one up to a hundred on\n * each side of `median`, and past that a hundred of that side, evenly spread by rank,\n * with the farthest one and the one nearest the box always among them. The same input\n * draws the same dots.\n *\n * A dot is an element. A group of a million readings with a long tail has tens of\n * thousands of outliers, nearly all on the same few pixels: drawn one each they were\n * tens of thousands of elements for a line a hundred would draw. The extremes are kept\n * because they are what the axis is fitted to and what a reader looks for.\n *\n * @internal\n */\nexport function drawnOutliers(outliers: readonly number[], median: number, limit = DRAWN_PER_SIDE): readonly number[] {\n if (outliers.length <= limit) return outliers;\n let above = 0;\n while (above < outliers.length && outliers[above] < median) above++;\n if (above <= limit && outliers.length - above <= limit) return outliers;\n const drawn: number[] = [];\n sample(outliers, 0, above, limit, drawn);\n sample(outliers, above, outliers.length, limit, drawn);\n return drawn;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ElementRef,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n} from '@angular/core';\n\nimport {\n WrChartState,\n WrChartTable,\n type WrChartTableData,\n useChartHover,\n useChartNumbers,\n useChartState,\n wrChartAxis,\n wrChartColor,\n wrChartNumberFormat,\n wrChartRound,\n} from 'ngwr/charts/core';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { type WrChartTooltipRow, useChartTooltip, wrCoerceChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { boxplotStats, drawnOutliers, sortedFinite } from './internal/stats';\nimport type { WrBoxplotGroup, WrBoxplotStats } from './types';\n\n/** How many gaps the value axis aims for: `wrChartAxis`'s own default, on a plot tall enough for them. */\nconst TICK_COUNT = 4;\n\n/** How much plot height, in px, each gap of the value axis asks for: two and a half lines of tick label. */\nconst TICK_ROOM = 40;\n\n/**\n * How many of a group's outliers its tooltip writes out, the lowest first, a row each;\n * past that one more row counts the rest, so a group with dozens keeps a chip that fits\n * on the screen.\n */\nconst TOOLTIP_OUTLIERS = 3;\n\n/**\n * How many of a group's outliers its data table cell lists. Past that the cell names the\n * lowest and the highest and counts the rest: a cell of two hundred thousand figures is\n * megabytes of text nobody reads to the end of.\n */\nconst TABLE_OUTLIERS = 50;\n\n/** A percentage to three decimals, so an inline style stays short. */\nconst percent = (value: number): number => wrChartRound(value, 3);\n\n/** A group's summary as the chart reads it: every number finite, the outliers ascending. */\ntype Summary = Required<WrBoxplotStats>;\n\n/** Where one group's marks sit, each as a percentage of the drawing's height from its top. */\ninterface DrawnBox {\n /** The upper whisker, from its end down to the box. */\n readonly upper: { readonly top: number; readonly bottom: number };\n /** The lower whisker, from the box down to its end. */\n readonly lower: { readonly top: number; readonly bottom: number };\n /** The box, from the third quartile down to the first. */\n readonly box: { readonly top: number; readonly bottom: number };\n readonly max: number;\n readonly median: number;\n readonly min: number;\n /** The outliers drawn: every one of a group with few, a sample of each side past a hundred. */\n readonly outliers: readonly { readonly value: number; readonly top: number }[];\n /** Everything the group draws, outliers included: what the tooltip points at. */\n readonly extent: { readonly top: number; readonly bottom: number };\n}\n\n/** One group as the chart draws it: its data, its slot across the drawing and its marks. */\ninterface DrawnGroup {\n /** Its position in `groups`. */\n readonly index: number;\n readonly label: string;\n readonly color: string;\n /** Its summary, or `null` when it has nothing to draw. */\n readonly stats: Summary | null;\n /** The slot's classes, in one binding: its own, and `--active` or `--empty`, which never meet. */\n readonly classes: string;\n /** Its five numbers, lower whisker first, in one attribute for the harness; `null` with nothing drawn. */\n readonly figures: string | null;\n /**\n * Where its slot starts, as a percentage of the drawing's width from its inline start:\n * the left, or the right under RTL.\n */\n readonly start: number;\n /** How wide its slot is, as a percentage of the drawing's width. */\n readonly slot: number;\n readonly marks: DrawnBox | null;\n}\n\n/** A span between two heights, top first whichever order they arrive in. */\nconst span = (a: number, b: number): { readonly top: number; readonly bottom: number } => ({\n top: Math.min(a, b),\n bottom: Math.max(a, b),\n});\n\n/**\n * The summary a group draws: its `stats` as given, when every one of the five numbers is\n * finite, else the summary of its `values`, else nothing.\n */\nfunction summarise(group: WrBoxplotGroup): Summary | null {\n const given = group.stats;\n if (given) {\n const { min, q1, median, q3, max } = given;\n if (![min, q1, median, q3, max].every(value => Number.isFinite(value))) return null;\n return { min, q1, median, q3, max, outliers: given.outliers ? Array.from(sortedFinite(given.outliers)) : [] };\n }\n return group.values ? boxplotStats(group.values) : null;\n}\n\n/**\n * Box-and-whisker plots of several groups side by side, on one value axis: a box from the\n * first quartile to the third with a line at the median, a whisker either side, and a dot\n * per outlier. No SVG and no dependency: every mark is an HTML element placed by\n * percentage, so a box keeps its width however tall the plot is.\n *\n * @example\n * ```html\n * <wr-boxplot-chart\n * ariaLabel=\"Response time by region\"\n * [groups]=\"[\n * { label: 'EU', values: [112, 98, 130, 141, 104, 99, 260] },\n * { label: 'US', stats: { min: 80, q1: 101, median: 118, q3: 134, max: 170, outliers: [240] } }\n * ]\"\n * />\n * ```\n *\n * From `values`, the chart works out the quartiles by LINEAR INTERPOLATION — type 7 of\n * Hyndman and Fan, the default of R's and NumPy's `quantile()` and what Excel's\n * `QUARTILE.INC` computes — and Tukey's whiskers: each reaches the farthest value within\n * 1.5 interquartile ranges of the box, and every value beyond is an outlier. A summary\n * worked out elsewhere goes in `stats` and is drawn exactly as given.\n *\n * The value axis is fitted to every number drawn, outliers included, with no zero forced\n * in — a box plot has no baseline — and snapped outward to a readable step: gridlines\n * across the plot (`showGrid`) and a scale beside it (`showAxis`), both on by default.\n * With no group to draw the chart keeps that frame and says \"No data\"; `loading` and\n * `error` put their own message there in place of the boxes. The groups\n * share the drawing's width in equal slots under their names, in reading order: left to\n * right, and right to left under RTL, as the bar chart's columns are, so the first group\n * stands beside the value axis either way.\n *\n * The drawing is one named `role=\"img\"` and takes no tab stop; the tooltip, with the five\n * numbers and the outliers past them, is pointer only. `dataTable` renders every group's\n * numbers as a table only assistive technology reaches.\n *\n * A group of raw `values` is sorted once, in a typed array, and a group with more than a\n * hundred outliers on one side of its box draws a hundred of them there, the farthest\n * and the nearest included: the tooltip still counts every one.\n *\n * @see https://ngwr.dev/charts/boxplot-chart\n */\n@Component({\n selector: 'wr-boxplot-chart',\n templateUrl: './boxplot-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-boxplot-chart',\n '[class.wr-boxplot-chart--axis]': 'showAxis()',\n },\n imports: [WrChartState, WrChartTable],\n})\nexport class WrBoxplotChart {\n /**\n * One entry per box, in reading order: each with its raw `values` or a `stats` summary\n * worked out elsewhere. A group with neither, or with nothing finite to summarise,\n * keeps its slot and its name and draws no box.\n */\n readonly groups = input<readonly WrBoxplotGroup[]>([]);\n\n /**\n * Accessible name of the chart. The numbers are nowhere in text unless `dataTable`\n * puts them there, so say what the chart shows. Falls back to `boxplotChart.label`\n * (\"Box plot\").\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'boxplotChart.label', 'Box plot');\n\n /**\n * What the groups are — a region, a release. Drawn under the group names only when\n * given; either way it heads the group column of the data table, which falls back to\n * `boxplotChart.group` (\"Group\").\n */\n readonly xLabel = input<string | null>(null);\n\n /** What the values measure, with their unit. Drawn along the value axis, reading upwards, only when given. */\n readonly yLabel = input<string | null>(null);\n\n protected readonly xName = useI18nText(this.xLabel, 'boxplotChart.group', 'Group');\n\n private readonly upperName = wrReadI18nText('boxplotChart.upperWhisker', 'Upper whisker');\n private readonly q3Name = wrReadI18nText('boxplotChart.q3', 'Q3');\n private readonly medianName = wrReadI18nText('boxplotChart.median', 'Median');\n private readonly q1Name = wrReadI18nText('boxplotChart.q1', 'Q1');\n private readonly lowerName = wrReadI18nText('boxplotChart.lowerWhisker', 'Lower whisker');\n private readonly outliersName = wrReadI18nText('boxplotChart.outliers', 'Outliers');\n\n /**\n * Writes every number the chart shows: the axis ticks, the tooltip and the data table.\n * `null` uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ticks (`1.2K`, `3.4M`)\n * unless the full numbers are shorter.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /** The figures in full and the axis' compact ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly locale = inject(LOCALE_ID);\n\n /** How many outliers the tooltip leaves unwritten, in the reader's own digits: a count, never a value to format. */\n private readonly counts = wrChartNumberFormat(this.locale);\n\n /** The tooltip's tail for the outliers past the first few it writes out. */\n private readonly moreOutliers = useI18nFormatter('boxplotChart.moreOutliers', '+{{count}} more');\n\n /**\n * A group's outliers in one data table cell, as the locale lists them. A narrow\n * CONJUNCTION list, because a unit list separates them with bare spaces in several\n * locales, and a space is the digit grouping of Russian and French: `9 000 12 000`.\n */\n private readonly list = new Intl.ListFormat(this.locale, { type: 'conjunction', style: 'narrow' });\n\n /**\n * The colour of every group with no `color` of its own. Any CSS colour. Defaults to the\n * first colour of the chart palette, `--wr-chart-1`. @default 'var(--wr-chart-1)'\n */\n readonly color = input<string>(wrChartColor(0));\n\n /**\n * The plot's height in px, at least 80. Under 160 the value axis aims for fewer ticks,\n * so their labels keep clear of one another. @default 240\n */\n readonly height = input(240, { transform: (v: unknown): number => Math.max(80, coerceNumberProperty(v, 240)) });\n\n /**\n * Draw the gridlines: one across the plot at every tick of the value axis. Their colour\n * is `--wr-boxplot-chart-grid-color`, which defaults to the chart theme's\n * `--wr-chart-grid`; the one at zero, when the axis reaches it, is the stronger\n * `--wr-boxplot-chart-zero-color`. @default true\n */\n readonly showGrid = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Draw the value axis' scale: a number at every tick, beside the plot. Decoration, as\n * the tooltip and the data table carry every figure. @default true\n */\n readonly showAxis = input(true, { transform: coerceBooleanProperty });\n\n /**\n * A request for the chart's data is in flight: the boxes give way to the loading\n * message, over the grid and the axis the chart keeps. @default false\n */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The chart's data failed to load: the boxes give way to the error message. `loading`\n * comes first when both are set. @default false\n */\n readonly error = input(false, { transform: coerceBooleanProperty });\n\n /** The message shown when no group has anything to draw. Falls back to `chart.empty`, then `'No data'`. */\n readonly emptyLabel = input<string | null>(null);\n\n /** The message shown while `loading`. Falls back to `chart.loading`, then `'Loading…'`. */\n readonly loadingLabel = input<string | null>(null);\n\n /** The message shown on `error`. Falls back to `chart.error`, then `'Could not load'`. */\n readonly errorLabel = input<string | null>(null);\n\n /**\n * Show a tooltip with the hovered group's five numbers — the whiskers' ends, the\n * quartiles and the median — and its outliers' values, the lowest three, then how\n * many more there are: every outlier is counted, drawn or not. Pointer only.\n *\n * By default the pointer passes under the chip to the chart, so the next section\n * answers at once and the chip closes off the chart; `'hoverable'` lets the pointer\n * rest on the chip instead, as WCAG 1.4.13 asks of a hint. @default true\n */\n readonly tooltip = input<boolean | 'hoverable', unknown>(true, { transform: wrCoerceChartTooltip });\n\n /**\n * Render every group's numbers as a table only assistive technology reaches, beside the\n * drawing: a row per group, a column for each of the five numbers from the lower\n * whisker up and, when a group has any, one listing its outliers - all of them up to\n * fifty, and past that the lowest, the highest and how many more. The drawing is one\n * named image, so without it the numbers are nowhere a screen reader can walk.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /** Every group with its colour and its summary, in order. */\n private readonly resolvedGroups = computed(() =>\n this.groups().map((group, index) => ({\n index,\n label: group.label,\n color: group.color ?? this.color(),\n stats: summarise(group),\n }))\n );\n\n /**\n * The value axis, from `wrChartAxis` over every number drawn — whisker ends, quartiles,\n * medians and outliers alike, so a summary given out of order still lands inside it —\n * with no zero forced in and both ends kept off the data (`symmetric`). A single value\n * is centred with a step either side; with nothing to draw, the 0 to 1 frame.\n *\n * It aims for four gaps, and for fewer on a short plot: a gap per 40px of `height`, so\n * the tick labels, a line of text each, never stand on one another — at the 80px\n * floor, four gaps put five labels in 64px of drawing.\n */\n protected readonly axis = computed(() => {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n for (const { stats } of this.resolvedGroups()) {\n if (!stats) continue;\n // The outliers are ascending, so their two ends stand for all of them: a spread of\n // every one overflowed the stack past about 120k.\n const ends = stats.outliers.length > 0 ? [stats.outliers[0], stats.outliers[stats.outliers.length - 1]] : [];\n for (const value of [stats.min, stats.q1, stats.median, stats.q3, stats.max, ...ends]) {\n if (value < min) min = value;\n if (value > max) max = value;\n }\n }\n const tickCount = Math.min(TICK_COUNT, Math.max(2, Math.floor(this.height() / TICK_ROOM)));\n return wrChartAxis(min, max, { symmetric: true, tickCount });\n });\n\n /**\n * The groups as placed: an equal slot each across the drawing, and their marks on the\n * axis. Hovering rebuilds none of it: the hovered slot's class is added in\n * {@link drawnGroups}.\n */\n private readonly placedGroups = computed(() => {\n const groups = this.resolvedGroups();\n const { min, max } = this.axis();\n const top = (value: number): number => percent(((max - value) / (max - min)) * 100);\n const slot = groups.length > 0 ? 100 / groups.length : 100;\n return groups.map(group => {\n const s = group.stats;\n let marks: DrawnBox | null = null;\n if (s) {\n const outliers = drawnOutliers(s.outliers, s.median).map(value => ({ value, top: top(value) }));\n // The five numbers and the two farthest outliers, which the drawn ones always include.\n let highest = Math.min(top(s.max), top(s.q3), top(s.median), top(s.q1), top(s.min));\n let lowest = Math.max(top(s.max), top(s.q3), top(s.median), top(s.q1), top(s.min));\n if (outliers.length > 0) {\n highest = Math.min(highest, outliers[0].top, outliers[outliers.length - 1].top);\n lowest = Math.max(lowest, outliers[0].top, outliers[outliers.length - 1].top);\n }\n marks = {\n upper: span(top(s.max), top(s.q3)),\n lower: span(top(s.q1), top(s.min)),\n box: span(top(s.q3), top(s.q1)),\n max: top(s.max),\n median: top(s.median),\n min: top(s.min),\n outliers,\n extent: { top: highest, bottom: lowest },\n };\n }\n const figures = s ? `${s.min} ${s.q1} ${s.median} ${s.q3} ${s.max}` : null;\n return { ...group, start: percent(group.index * slot), slot: percent(slot), marks, figures };\n });\n });\n\n /** The groups as drawn: placed, each with its slot's classes, the hovered one's among them. */\n protected readonly drawnGroups = computed<readonly DrawnGroup[]>(() => {\n const active = this.activeGroup();\n return this.placedGroups().map(group => ({\n ...group,\n classes: `wr-boxplot-chart__group${\n !group.marks\n ? ' wr-boxplot-chart__group--empty'\n : active === group.index\n ? ' wr-boxplot-chart__group--active'\n : ''\n }`,\n }));\n });\n\n /** The value axis' ticks, top to bottom: each value's label and its gridline's distance from the top, in percent. */\n protected readonly yTicks = computed(() => {\n const { min, max, step, ticks } = this.axis();\n const labels = this.numbers.ticks(ticks, step);\n return ticks.map((value, i) => ({\n label: labels[i],\n top: percent(((max - value) / (max - min)) * 100),\n zero: value === 0,\n }));\n });\n\n /** Whether the chart has nothing to draw: no group, or none with a summary. */\n private readonly empty = computed(() => this.resolvedGroups().every(group => !group.stats));\n\n /** What the chart shows in place of its boxes, or `null` while it draws them. */\n protected readonly state = useChartState({\n loading: this.loading,\n error: this.error,\n empty: this.empty,\n emptyLabel: this.emptyLabel,\n loadingLabel: this.loadingLabel,\n errorLabel: this.errorLabel,\n });\n\n /**\n * Whether the slots are drawn: always, but under `loading` and `error`. With nothing to\n * draw each group still keeps its slot and its name, under the \"No data\" message.\n */\n protected readonly slotsShown = computed(() => {\n const kind = this.state()?.kind;\n return kind !== 'loading' && kind !== 'error';\n });\n\n /**\n * One tooltip for the group under the pointer: its name and colour as the heading, then\n * the five numbers top to bottom, the way the box is drawn, and its outliers when it has\n * any — their VALUES, as the data table's column of the same name lists them: the lowest\n * three a row each under the one label, so a long figure never shares a line with\n * another and pushes past the chip, then a row counting the rest - every outlier of the\n * summary, the ones a crowded group does not draw included. It points at the top of\n * everything the group draws, so the chip covers none of its marks.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const group = this.placedGroups()[index];\n if (!group?.stats || !this.slotsShown()) return null;\n const anchor = this.host.querySelector(`[data-wr-index=\"${index}\"] .wr-boxplot-chart__extent`);\n if (!anchor) return null;\n const { stats } = group;\n const rows: WrChartTooltipRow[] = [\n { label: this.upperName(), value: this.numbers.value(stats.max) },\n { label: this.q3Name(), value: this.numbers.value(stats.q3) },\n { label: this.medianName(), value: this.numbers.value(stats.median) },\n { label: this.q1Name(), value: this.numbers.value(stats.q1) },\n { label: this.lowerName(), value: this.numbers.value(stats.min) },\n ];\n if (stats.outliers.length > 0) {\n // The lowest few, read off the front of the list rather than a copy of all of it.\n const shown: string[] = [];\n for (let i = 0; i < Math.min(TOOLTIP_OUTLIERS, stats.outliers.length); i++) {\n shown.push(this.numbers.value(stats.outliers[i]));\n }\n const rest = stats.outliers.length - shown.length;\n if (rest > 0) shown.push(this.moreOutliers({ count: this.counts.format(rest) }));\n shown.forEach((value, i) => rows.push({ label: i === 0 ? this.outliersName() : '', value }));\n }\n return { datum: { label: group.label, value: '', color: group.color, rows }, anchor };\n });\n\n /** The group the tooltip is reading, washed in the drawing. Never one with nothing drawn. */\n protected readonly activeGroup = computed(() => {\n const index = this.tip.active();\n return index !== null && this.placedGroups()[index]?.marks ? index : null;\n });\n\n /**\n * The figures for `dataTable`: the chart's name as the caption, a row per group headed\n * by its name, and its five numbers ascending, as a five-number summary reads, written\n * as the tooltip writes them. The outliers column appears once any group has an\n * outlier, and lists that group's ascending: all of them up to fifty, and past that\n * the lowest, the highest and a count of the rest. A group with nothing to draw has a\n * row of empty cells.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const groups = this.resolvedGroups();\n const withOutliers = groups.some(({ stats }) => (stats?.outliers.length ?? 0) > 0);\n const columns = [this.lowerName(), this.q1Name(), this.medianName(), this.q3Name(), this.upperName()];\n if (withOutliers) columns.push(this.outliersName());\n const value = (v: number): string => this.numbers.value(v);\n return {\n caption: this.resolvedAriaLabel(),\n corner: this.xName(),\n columns,\n groups: [\n {\n rows: groups.map(({ label, stats }) => {\n if (!stats) return { header: label, cells: columns.map(() => '') };\n const cells = [stats.min, stats.q1, stats.median, stats.q3, stats.max].map(value);\n if (withOutliers) cells.push(this.outlierList(stats.outliers));\n return { header: label, cells };\n }),\n },\n ],\n };\n });\n\n /** A group's outliers in one data table cell: every one of a few, the two ends and a count of many. */\n private outlierList(outliers: readonly number[]): string {\n if (outliers.length <= TABLE_OUTLIERS) return this.list.format(outliers.map(v => this.numbers.value(v)));\n return this.list.format([\n this.numbers.value(outliers[0]),\n this.numbers.value(outliers[outliers.length - 1]),\n this.moreOutliers({ count: this.counts.format(outliers.length - 2) }),\n ]);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/boxplot-chart');\n // One listener pair for the whole chart: a slot is whatever carries `data-wr-index`.\n // A group with nothing drawn reads as leaving, so a chip open on its neighbour closes\n // after the usual grace rather than at once.\n useChartHover({\n enter: index => {\n if (this.placedGroups()[index]?.marks) this.tip.enter(index);\n else this.tip.leave();\n },\n leave: event => this.tip.leave(event),\n });\n // A summary is drawn as given, so one whose numbers are out of order draws a whisker\n // inside its box, and one with a number that is not finite draws nothing at all —\n // both of which read on screen as data, not as a mistake.\n if (isDevMode()) {\n const warned = new Set<string>();\n effect(() => {\n for (const group of this.groups()) {\n const stats = group.stats;\n if (!stats) continue;\n const five = [stats.min, stats.q1, stats.median, stats.q3, stats.max];\n const problem = !five.every(v => Number.isFinite(v))\n ? 'has a number that is not finite, so it draws nothing'\n : five.some((v, i) => i > 0 && v < five[i - 1])\n ? 'is not in order (min ≤ q1 ≤ median ≤ q3 ≤ max), and is drawn as given'\n : null;\n const message = problem && `the stats of \"${group.label}\" ${problem}.`;\n if (!message || warned.has(message)) continue;\n warned.add(message);\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(`[NGWR] <wr-boxplot-chart>: ${message}`);\n }\n });\n }\n }\n}\n\nexport type { WrBoxplotGroup, WrBoxplotStats } from './types';\n","@let shown = state();\n<!-- Three columns: the value axis' name along it, its ticks, and the drawing beside them,\n with the group names under the drawing only, so their percentages are the drawing's. -->\n<div class=\"wr-boxplot-chart__body\">\n @if (yLabel()) {\n <div class=\"wr-boxplot-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showAxis()) {\n <!-- In flow, so the column is exactly as wide as the longest label; each one hands\n the stylesheet the y of its own gridline. Hidden, as the drawing is one image:\n its name is what is announced, and the numbers are the data table's. -->\n <div class=\"wr-boxplot-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-boxplot-chart__y-tick\" [style.--wr-boxplot-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <div class=\"wr-boxplot-chart__plot\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\" [style.height.px]=\"height()\">\n <!-- Every mark is an element placed by percentage of this box, its width in px or a\n share of its slot: a box keeps its width however tall the plot is, which an SVG\n stretched to the plot would not. Hidden as well as presentational, as the\n scatter's drawing is: `img` already makes it so. -->\n <div class=\"wr-boxplot-chart__drawing\" aria-hidden=\"true\">\n @if (showGrid()) {\n @for (tick of yTicks(); track $index) {\n <span\n class=\"wr-boxplot-chart__grid-line\"\n [class.wr-boxplot-chart__grid-line--zero]=\"tick.zero\"\n [style.--wr-boxplot-chart-y]=\"tick.top\"\n ></span>\n }\n }\n\n <!-- By position, not by label: two groups may share one. Each slot is the hover\n target for its group, top to bottom, so the pointer need not find a 2px\n whisker: `data-wr-index` is what the chart's one hover listener reads. Its five\n numbers ride in one attribute, for the harness. Under `loading` and `error`\n the slots give way to the message. -->\n @if (slotsShown()) {\n @for (g of drawnGroups(); track g.index) {\n <div\n [class]=\"g.classes\"\n [style.--wr-boxplot-chart-slot-start]=\"g.start\"\n [style.--wr-boxplot-chart-slot-width]=\"g.slot\"\n [style.--wr-boxplot-chart-group-color]=\"g.color\"\n [attr.data-wr-index]=\"g.index\"\n [attr.data-box]=\"g.figures\"\n >\n @if (g.marks; as m) {\n <span\n class=\"wr-boxplot-chart__whisker wr-boxplot-chart__whisker--upper\"\n [style.--wr-boxplot-chart-top]=\"m.upper.top\"\n [style.--wr-boxplot-chart-bottom]=\"m.upper.bottom\"\n ></span>\n <span\n class=\"wr-boxplot-chart__whisker wr-boxplot-chart__whisker--lower\"\n [style.--wr-boxplot-chart-top]=\"m.lower.top\"\n [style.--wr-boxplot-chart-bottom]=\"m.lower.bottom\"\n ></span>\n <span\n class=\"wr-boxplot-chart__cap wr-boxplot-chart__cap--upper\"\n [style.--wr-boxplot-chart-y]=\"m.max\"\n ></span>\n <span\n class=\"wr-boxplot-chart__cap wr-boxplot-chart__cap--lower\"\n [style.--wr-boxplot-chart-y]=\"m.min\"\n ></span>\n <span\n class=\"wr-boxplot-chart__box\"\n [style.--wr-boxplot-chart-top]=\"m.box.top\"\n [style.--wr-boxplot-chart-bottom]=\"m.box.bottom\"\n ></span>\n <span class=\"wr-boxplot-chart__median\" [style.--wr-boxplot-chart-y]=\"m.median\"></span>\n @for (o of m.outliers; track $index) {\n <span\n class=\"wr-boxplot-chart__outlier\"\n [style.--wr-boxplot-chart-y]=\"o.top\"\n [attr.data-value]=\"o.value\"\n ></span>\n }\n <!-- Paints nothing: the span from the topmost mark to the lowest, outliers\n included, which the tooltip points at so its chip covers none of them. -->\n <span\n class=\"wr-boxplot-chart__extent\"\n [style.--wr-boxplot-chart-top]=\"m.extent.top\"\n [style.--wr-boxplot-chart-bottom]=\"m.extent.bottom\"\n ></span>\n }\n </div>\n }\n }\n </div>\n </div>\n\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the axis the chart keeps.\n Beside the plot in its grid cell, never inside it: `img` makes what it holds\n presentational, and the message is a live region. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n }\n\n <!-- Each name is centred under its slot and ellipsised past it; the tooltip and the\n data table carry it whole. -->\n <div class=\"wr-boxplot-chart__x-axis\">\n @for (g of drawnGroups(); track g.index) {\n <span\n class=\"wr-boxplot-chart__x-label\"\n [style.--wr-boxplot-chart-slot-start]=\"g.start\"\n [style.--wr-boxplot-chart-slot-width]=\"g.slot\"\n >{{ g.label }}</span\n >\n }\n </div>\n\n @if (xLabel()) {\n <div class=\"wr-boxplot-chart__x-title\">{{ xLabel() }}</div>\n }\n</div>\n\n@if (dataTable() && slotsShown()) {\n <!-- The figures for a screen reader, beside the plot's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,QAAQ;AAMd,MAAM,iBAAiB;AAGvB,SAAS,aAAa,QAAsB,OAAa;CACvD,IAAI,OAAO;CACX,IAAI,KAAK,OAAO;CAChB,OAAO,OAAO,IAAI;EAChB,MAAM,SAAU,OAAO,OAAQ;EAC/B,IAAI,OAAO,UAAU,OAAO,OAAO,SAAS;OACvC,KAAK;CACZ;CACA,OAAO;AACT;AAGA,SAAS,UAAU,QAAsB,OAAa;CACpD,IAAI,OAAO;CACX,IAAI,KAAK,OAAO;CAChB,OAAO,OAAO,IAAI;EAChB,MAAM,SAAU,OAAO,OAAQ;EAC/B,IAAI,OAAO,WAAW,OAAO,OAAO,SAAS;OACxC,KAAK;CACZ;CACA,OAAO;AACT;AAGA,SAAS,OAAO,KAAwB,OAAe,KAAa,OAAe,MAAc;CAC/F,MAAM,QAAQ,MAAM;CACpB,IAAI,SAAS,OAAO;EAClB,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,KAAK,KAAK,KAAK,IAAI,EAAE;EAClD;CACF;CACA,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK,KAAK,KAAK,IAAI,QAAQ,KAAK,MAAO,KAAK,QAAQ,MAAO,QAAQ,EAAE,EAAE;AACpG;AAcA,SAAgB,SAAS,QAA2B,GAAS;CAC3D,MAAM,YAAY,OAAO,SAAS,KAAK;CACvC,MAAM,QAAQ,KAAK,MAAM,QAAQ;CACjC,MAAM,QAAQ,KAAK,KAAK,QAAQ;CAChC,OAAO,OAAO,UAAU,WAAW,UAAU,OAAO,SAAS,OAAO;AAC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AAA,YAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,YAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,WAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,gCAAA,aAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UChL3B;EA+HA,cAAA,CAAA;GAAA,MAAA;GAAA,MD+CY;GAAY,UAAA;GAAA,QAAA,CAAA,QAAA,OAAA;EAAA,GAAA;GAAA,MAAA;GAAA,MAAE;GAAY,UAAA;GAAA,QAAA,CAAA,MAAA;EAAA,CAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAEzB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAV1B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAkB,eAEb,kBAAkB;GAAI,MAC/B;IACJ,OAAO;IACP,kCAAkC;GACnC;GAAA,SACQ,CAAC,cAAc,YAAY;GAAC,UAAA;EAAA,CAAA"}
@@ -3,8 +3,8 @@ import { Component, DestroyRef, ElementRef, ViewEncapsulation, afterNextRender,
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
4
  import { wrCheckStyles, wrClamp, wrRound } from "ngwr/utils";
5
5
  import { useI18nFormatter, useI18nText, wrReadI18nText } from "ngwr/i18n";
6
- import { useChartNumbers, wrChartAxis } from "ngwr/charts/core";
7
- import { useChartTooltip } from "ngwr/popover";
6
+ import { WrChartState, useChartHover, useChartNumbers, useChartSize, useChartState, wrChartAxis, wrChartRound } from "ngwr/charts/core";
7
+ import { useChartTooltip, wrCoerceChartTooltip } from "ngwr/popover";
8
8
  /**
9
9
  * @license
10
10
  *
@@ -24,7 +24,7 @@ const TICK_COUNTS = [
24
24
  2,
25
25
  1
26
26
  ];
27
- const short = (value) => wrRound(value, 4) || 0;
27
+ const short = (value) => wrChartRound(value, 4);
28
28
  var WrBulletChart = class WrBulletChart {
29
29
  value = input.required({
30
30
  ...ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {},
@@ -52,31 +52,41 @@ var WrBulletChart = class WrBulletChart {
52
52
  });
53
53
  tooltip = input(true, {
54
54
  ...ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {},
55
+ transform: wrCoerceChartTooltip
56
+ });
57
+ loading = input(false, {
58
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
59
+ transform: coerceBooleanProperty
60
+ });
61
+ error = input(false, {
62
+ ...ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {},
55
63
  transform: coerceBooleanProperty
56
64
  });
65
+ emptyLabel = input(null, ...ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []);
66
+ loadingLabel = input(null, ...ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []);
67
+ errorLabel = input(null, ...ngDevMode ? [{ debugName: "errorLabel" }] : /* istanbul ignore next */ []);
57
68
  numbers = useChartNumbers(this.valueFormat);
58
69
  track = viewChild("track", ...ngDevMode ? [{ debugName: "track" }] : /* istanbul ignore next */ []);
59
70
  host = inject(ElementRef);
60
71
  measured = signal(null, ...ngDevMode ? [{ debugName: "measured" }] : /* istanbul ignore next */ []);
61
72
  trackWidth = 0;
73
+ trackSize = useChartSize(this.track);
62
74
  constructor() {
63
75
  if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("charts/bullet-chart");
64
76
  const destroyRef = inject(DestroyRef);
77
+ useChartHover({
78
+ enter: (index) => this.tip.enter(index),
79
+ leave: (event) => this.tip.leave(event)
80
+ });
81
+ afterRenderEffect(() => {
82
+ const { width } = this.trackSize();
83
+ if (width <= 0) return;
84
+ this.trackWidth = width;
85
+ untracked(() => this.measure());
86
+ });
65
87
  afterNextRender(() => {
66
- const track = this.track()?.nativeElement;
67
- if (!track || typeof ResizeObserver === "undefined") return;
68
- const observer = new ResizeObserver(([entry]) => {
69
- const width = entry.contentRect.width;
70
- if (width <= 0) return;
71
- this.trackWidth = width;
72
- this.measure();
73
- });
74
- observer.observe(track);
75
88
  let destroyed = false;
76
- destroyRef.onDestroy(() => {
77
- destroyed = true;
78
- observer.disconnect();
79
- });
89
+ destroyRef.onDestroy(() => destroyed = true);
80
90
  if ("fonts" in document) document.fonts.ready.then(() => {
81
91
  if (!destroyed) this.measure();
82
92
  });
@@ -197,6 +207,14 @@ var WrBulletChart = class WrBulletChart {
197
207
  }
198
208
  return true;
199
209
  }
210
+ state = useChartState({
211
+ loading: this.loading,
212
+ error: this.error,
213
+ empty: computed(() => this.value() === null && this.target() === null),
214
+ emptyLabel: this.emptyLabel,
215
+ loadingLabel: this.loadingLabel,
216
+ errorLabel: this.errorLabel
217
+ });
200
218
  subject = useI18nText(this.label, "bulletChart.label", "Bullet chart");
201
219
  summaryText = useI18nFormatter("bulletChart.summary", "{{label}}: {{value}} of target {{target}}");
202
220
  summaryNoTargetText = useI18nFormatter("bulletChart.summaryNoTarget", "{{label}}: {{value}}");
@@ -332,6 +350,41 @@ var WrBulletChart = class WrBulletChart {
332
350
  isSignal: true,
333
351
  isRequired: false,
334
352
  transformFunction: null
353
+ },
354
+ loading: {
355
+ classPropertyName: "loading",
356
+ publicName: "loading",
357
+ isSignal: true,
358
+ isRequired: false,
359
+ transformFunction: null
360
+ },
361
+ error: {
362
+ classPropertyName: "error",
363
+ publicName: "error",
364
+ isSignal: true,
365
+ isRequired: false,
366
+ transformFunction: null
367
+ },
368
+ emptyLabel: {
369
+ classPropertyName: "emptyLabel",
370
+ publicName: "emptyLabel",
371
+ isSignal: true,
372
+ isRequired: false,
373
+ transformFunction: null
374
+ },
375
+ loadingLabel: {
376
+ classPropertyName: "loadingLabel",
377
+ publicName: "loadingLabel",
378
+ isSignal: true,
379
+ isRequired: false,
380
+ transformFunction: null
381
+ },
382
+ errorLabel: {
383
+ classPropertyName: "errorLabel",
384
+ publicName: "errorLabel",
385
+ isSignal: true,
386
+ isRequired: false,
387
+ transformFunction: null
335
388
  }
336
389
  },
337
390
  host: {
@@ -346,7 +399,13 @@ var WrBulletChart = class WrBulletChart {
346
399
  isSignal: true
347
400
  }],
348
401
  ngImport: i0,
349
- template: "@let valueBar = bar();\n@let target = targetAt();\n@if (labelled()) {\n <!-- Hidden, as the scale is: the label opens the drawing's name and the sub-label is its\n description, so read here as well they would be heard twice. -->\n <div class=\"wr-bullet-chart__labels\" aria-hidden=\"true\">\n @if (label()) {\n <span class=\"wr-bullet-chart__label\">{{ label() }}</span>\n }\n @if (subLabel()) {\n <span class=\"wr-bullet-chart__sub-label\" [id]=\"subLabelId\">{{ subLabel() }}</span>\n }\n </div>\n}\n\n<!-- The drawing: one named image. Its parts are empty boxes placed by the shares the\n component writes, every one a logical inset, so the drawing mirrors under RTL with no\n rule of its own. -->\n<div\n #track\n class=\"wr-bullet-chart__track\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-describedby]=\"subLabel() ? subLabelId : null\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <!-- The bands sit in a layer of their own, which clips them to the track's corners\n without clipping the target marker at either end. -->\n <div class=\"wr-bullet-chart__ranges\">\n @for (band of bands(); track band.index) {\n <span\n class=\"wr-bullet-chart__range\"\n [attr.data-index]=\"band.index\"\n [style.--wr-bullet-chart-start]=\"band.start\"\n [style.--wr-bullet-chart-size]=\"band.size\"\n [style.--wr-bullet-chart-range-mix]=\"band.mix\"\n ></span>\n }\n </div>\n\n @if (valueBar) {\n <span\n class=\"wr-bullet-chart__bar\"\n [class.wr-bullet-chart__bar--negative]=\"valueBar.negative\"\n [style.--wr-bullet-chart-start]=\"valueBar.start\"\n [style.--wr-bullet-chart-size]=\"valueBar.size\"\n ></span>\n }\n\n @if (target !== null) {\n <span class=\"wr-bullet-chart__target\" [style.--wr-bullet-chart-at]=\"target\"></span>\n }\n</div>\n\n@if (showScale()) {\n <div class=\"wr-bullet-chart__scale\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-bullet-chart__tick\"\n [class.wr-bullet-chart__tick--start]=\"tick.edge === 'start'\"\n [class.wr-bullet-chart__tick--end]=\"tick.edge === 'end'\"\n [style.--wr-bullet-chart-at]=\"tick.at\"\n >\n <span class=\"wr-bullet-chart__tick-label\">{{ tick.label }}</span>\n </span>\n }\n </div>\n}\n",
402
+ template: "@let valueBar = bar();\n@let target = targetAt();\n@let shown = state();\n@if (labelled()) {\n <!-- Hidden, as the scale is: the label opens the drawing's name and the sub-label is its\n description, so read here as well they would be heard twice. -->\n <div class=\"wr-bullet-chart__labels\" aria-hidden=\"true\">\n @if (label()) {\n <span class=\"wr-bullet-chart__label\">{{ label() }}</span>\n }\n @if (subLabel()) {\n <span class=\"wr-bullet-chart__sub-label\" [id]=\"subLabelId\">{{ subLabel() }}</span>\n }\n </div>\n}\n\n<!-- The drawing: one named image. Its parts are empty boxes placed by the shares the\n component writes. The bands are logical insets, which mirror under RTL by themselves;\n the bar and the marker move by a transform, which the stylesheet mirrors by hand.\n `data-wr-index` makes it the one section the chart's hover listener reports. -->\n<div\n #track\n class=\"wr-bullet-chart__track\"\n role=\"img\"\n data-wr-index=\"0\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-describedby]=\"subLabel() ? subLabelId : null\"\n>\n <!-- The bands sit in a layer of their own, which clips them to the track's corners\n without clipping the target marker at either end. -->\n <div class=\"wr-bullet-chart__ranges\">\n @for (band of shown ? [] : bands(); track band.index) {\n <span\n class=\"wr-bullet-chart__range\"\n [attr.data-index]=\"band.index\"\n [style.--wr-bullet-chart-start]=\"band.start\"\n [style.--wr-bullet-chart-size]=\"band.size\"\n [style.--wr-bullet-chart-range-mix]=\"band.mix\"\n ></span>\n }\n </div>\n\n @if (valueBar && !shown) {\n <span\n class=\"wr-bullet-chart__bar\"\n [class.wr-bullet-chart__bar--negative]=\"valueBar.negative\"\n [style.--wr-bullet-chart-start]=\"valueBar.start\"\n [style.--wr-bullet-chart-size]=\"valueBar.size\"\n ></span>\n }\n\n @if (target !== null && !shown) {\n <span class=\"wr-bullet-chart__target\" [style.--wr-bullet-chart-at]=\"target\"></span>\n }\n</div>\n\n@if (shown) {\n <!-- Over the track, beside the drawing's `img` and never inside it: `img` makes\n everything it holds presentational, and the message is a live region. -->\n <div class=\"wr-bullet-chart__status\">\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n </div>\n}\n\n@if (showScale()) {\n <div class=\"wr-bullet-chart__scale\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-bullet-chart__tick\"\n [class.wr-bullet-chart__tick--start]=\"tick.edge === 'start'\"\n [class.wr-bullet-chart__tick--end]=\"tick.edge === 'end'\"\n [style.--wr-bullet-chart-at]=\"tick.at\"\n >\n <span class=\"wr-bullet-chart__tick-label\">{{ tick.label }}</span>\n </span>\n }\n </div>\n}\n",
403
+ dependencies: [{
404
+ kind: "component",
405
+ type: WrChartState,
406
+ selector: "wr-chart-state",
407
+ inputs: ["kind", "label"]
408
+ }],
350
409
  encapsulation: i0.ViewEncapsulation.None
351
410
  });
352
411
  };
@@ -364,7 +423,8 @@ i0.ɵɵngDeclareClassMetadata({
364
423
  class: "wr-bullet-chart",
365
424
  "[class.wr-bullet-chart--labelled]": "labelled()"
366
425
  },
367
- template: "@let valueBar = bar();\n@let target = targetAt();\n@if (labelled()) {\n <!-- Hidden, as the scale is: the label opens the drawing's name and the sub-label is its\n description, so read here as well they would be heard twice. -->\n <div class=\"wr-bullet-chart__labels\" aria-hidden=\"true\">\n @if (label()) {\n <span class=\"wr-bullet-chart__label\">{{ label() }}</span>\n }\n @if (subLabel()) {\n <span class=\"wr-bullet-chart__sub-label\" [id]=\"subLabelId\">{{ subLabel() }}</span>\n }\n </div>\n}\n\n<!-- The drawing: one named image. Its parts are empty boxes placed by the shares the\n component writes, every one a logical inset, so the drawing mirrors under RTL with no\n rule of its own. -->\n<div\n #track\n class=\"wr-bullet-chart__track\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-describedby]=\"subLabel() ? subLabelId : null\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <!-- The bands sit in a layer of their own, which clips them to the track's corners\n without clipping the target marker at either end. -->\n <div class=\"wr-bullet-chart__ranges\">\n @for (band of bands(); track band.index) {\n <span\n class=\"wr-bullet-chart__range\"\n [attr.data-index]=\"band.index\"\n [style.--wr-bullet-chart-start]=\"band.start\"\n [style.--wr-bullet-chart-size]=\"band.size\"\n [style.--wr-bullet-chart-range-mix]=\"band.mix\"\n ></span>\n }\n </div>\n\n @if (valueBar) {\n <span\n class=\"wr-bullet-chart__bar\"\n [class.wr-bullet-chart__bar--negative]=\"valueBar.negative\"\n [style.--wr-bullet-chart-start]=\"valueBar.start\"\n [style.--wr-bullet-chart-size]=\"valueBar.size\"\n ></span>\n }\n\n @if (target !== null) {\n <span class=\"wr-bullet-chart__target\" [style.--wr-bullet-chart-at]=\"target\"></span>\n }\n</div>\n\n@if (showScale()) {\n <div class=\"wr-bullet-chart__scale\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-bullet-chart__tick\"\n [class.wr-bullet-chart__tick--start]=\"tick.edge === 'start'\"\n [class.wr-bullet-chart__tick--end]=\"tick.edge === 'end'\"\n [style.--wr-bullet-chart-at]=\"tick.at\"\n >\n <span class=\"wr-bullet-chart__tick-label\">{{ tick.label }}</span>\n </span>\n }\n </div>\n}\n"
426
+ imports: [WrChartState],
427
+ template: "@let valueBar = bar();\n@let target = targetAt();\n@let shown = state();\n@if (labelled()) {\n <!-- Hidden, as the scale is: the label opens the drawing's name and the sub-label is its\n description, so read here as well they would be heard twice. -->\n <div class=\"wr-bullet-chart__labels\" aria-hidden=\"true\">\n @if (label()) {\n <span class=\"wr-bullet-chart__label\">{{ label() }}</span>\n }\n @if (subLabel()) {\n <span class=\"wr-bullet-chart__sub-label\" [id]=\"subLabelId\">{{ subLabel() }}</span>\n }\n </div>\n}\n\n<!-- The drawing: one named image. Its parts are empty boxes placed by the shares the\n component writes. The bands are logical insets, which mirror under RTL by themselves;\n the bar and the marker move by a transform, which the stylesheet mirrors by hand.\n `data-wr-index` makes it the one section the chart's hover listener reports. -->\n<div\n #track\n class=\"wr-bullet-chart__track\"\n role=\"img\"\n data-wr-index=\"0\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-describedby]=\"subLabel() ? subLabelId : null\"\n>\n <!-- The bands sit in a layer of their own, which clips them to the track's corners\n without clipping the target marker at either end. -->\n <div class=\"wr-bullet-chart__ranges\">\n @for (band of shown ? [] : bands(); track band.index) {\n <span\n class=\"wr-bullet-chart__range\"\n [attr.data-index]=\"band.index\"\n [style.--wr-bullet-chart-start]=\"band.start\"\n [style.--wr-bullet-chart-size]=\"band.size\"\n [style.--wr-bullet-chart-range-mix]=\"band.mix\"\n ></span>\n }\n </div>\n\n @if (valueBar && !shown) {\n <span\n class=\"wr-bullet-chart__bar\"\n [class.wr-bullet-chart__bar--negative]=\"valueBar.negative\"\n [style.--wr-bullet-chart-start]=\"valueBar.start\"\n [style.--wr-bullet-chart-size]=\"valueBar.size\"\n ></span>\n }\n\n @if (target !== null && !shown) {\n <span class=\"wr-bullet-chart__target\" [style.--wr-bullet-chart-at]=\"target\"></span>\n }\n</div>\n\n@if (shown) {\n <!-- Over the track, beside the drawing's `img` and never inside it: `img` makes\n everything it holds presentational, and the message is a live region. -->\n <div class=\"wr-bullet-chart__status\">\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n </div>\n}\n\n@if (showScale()) {\n <div class=\"wr-bullet-chart__scale\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-bullet-chart__tick\"\n [class.wr-bullet-chart__tick--start]=\"tick.edge === 'start'\"\n [class.wr-bullet-chart__tick--end]=\"tick.edge === 'end'\"\n [style.--wr-bullet-chart-at]=\"tick.at\"\n >\n <span class=\"wr-bullet-chart__tick-label\">{{ tick.label }}</span>\n </span>\n }\n </div>\n}\n"
368
428
  }]
369
429
  }],
370
430
  ctorParameters: () => [],
@@ -449,6 +509,46 @@ i0.ɵɵngDeclareClassMetadata({
449
509
  required: false
450
510
  }]
451
511
  }],
512
+ loading: [{
513
+ type: i0.Input,
514
+ args: [{
515
+ isSignal: true,
516
+ alias: "loading",
517
+ required: false
518
+ }]
519
+ }],
520
+ error: [{
521
+ type: i0.Input,
522
+ args: [{
523
+ isSignal: true,
524
+ alias: "error",
525
+ required: false
526
+ }]
527
+ }],
528
+ emptyLabel: [{
529
+ type: i0.Input,
530
+ args: [{
531
+ isSignal: true,
532
+ alias: "emptyLabel",
533
+ required: false
534
+ }]
535
+ }],
536
+ loadingLabel: [{
537
+ type: i0.Input,
538
+ args: [{
539
+ isSignal: true,
540
+ alias: "loadingLabel",
541
+ required: false
542
+ }]
543
+ }],
544
+ errorLabel: [{
545
+ type: i0.Input,
546
+ args: [{
547
+ isSignal: true,
548
+ alias: "errorLabel",
549
+ required: false
550
+ }]
551
+ }],
452
552
  track: [{
453
553
  type: i0.ViewChild,
454
554
  args: ["track", { isSignal: true }]
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-charts-bullet-chart.mjs","names":[],"sources":["../../../projects/lib/charts/bullet-chart/bullet-chart.ts","../../../projects/lib/charts/bullet-chart/bullet-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n afterRenderEffect,\n computed,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\n\nimport { wrChartAxis, useChartNumbers } from 'ngwr/charts/core';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip } from 'ngwr/popover';\nimport { wrClamp, wrRound, wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Instance counter for the sub-label's id, which the drawing's `aria-describedby` names.\n * Counted rather than `wrRandomId()`, so the prerendered id is the one the browser renders\n * again — the reason `wr-tabs` and `wr-graph` count.\n */\nlet bulletUid = 0;\n\n/** A finite number, or `null` for anything else: a missing reading is drawn as none, never as zero. */\nconst finiteOrNull = (v: unknown): number | null => {\n const value = coerceNumberProperty(v, Number.NaN);\n return Number.isFinite(value) ? value : null;\n};\n\n/** A computed colour that paints nothing — a bar not laid out, or no stylesheet loaded. */\nconst TRANSPARENT = /^(?:transparent|rgba\\(0, 0, 0, 0\\))$/;\n\n/** The least room kept between two tick labels, in px. */\nconst TICK_GAP = 8;\n\n/** The tick counts the scale tries, most first, while its labels overlap: what `wrChartAxis` aims for. */\nconst TICK_COUNTS = [4, 3, 2, 1] as const;\n\n/** A share of the scale for an inline style, to four decimals with `-0` folded to `0`, so the style stays short. */\nconst short = (value: number): number => wrRound(value, 4) || 0;\n\n/** One qualitative band as drawn: where it starts and how much of the scale it covers, both as shares from 0 to 1. */\ninterface Band {\n /** Its position in the sorted `ranges`, which decides its shade. */\n readonly index: number;\n readonly start: number;\n readonly size: number;\n /** How far its shade has moved from the strongest grey towards the faintest, as a CSS percentage. */\n readonly mix: string;\n}\n\n/** A tick of the scale: its label, its share of the scale, and which end of the scale it sits on, if either. */\ninterface Tick {\n readonly label: string;\n readonly at: number;\n readonly edge: 'start' | 'end' | null;\n}\n\n/** What a browser has laid out, in px: the drawing's width, and a tick label's width per character. */\ninterface Measured {\n readonly width: number;\n readonly char: number;\n}\n\n/**\n * Bullet chart: one measure against a target, over qualitative bands — Stephen Few's\n * bullet graph, the compact replacement for a dashboard gauge. Horizontal, one line high.\n * HTML and CSS only — no external dependency.\n *\n * @example\n * ```html\n * <wr-bullet-chart label=\"Revenue\" subLabel=\"USD, thousands\" [value]=\"270\" [target]=\"250\" [ranges]=\"[150, 225, 300]\" />\n * ```\n *\n * **What is drawn.** `ranges` are the upper limits of the qualitative bands — poor,\n * satisfactory, good — drawn as stepped greys from the theme's neutral roles, the\n * strongest nearest zero and each band after it fainter, so they read as steps in\n * LIGHTNESS and survive greyscale. The value is a bar a third of the line high, from zero;\n * the target is a perpendicular marker. The two are told apart by shape, not by colour,\n * and both are drawn in the text colour, which keeps 3:1 against the strongest band in\n * either theme where the primary blue does not.\n *\n * **The scale** starts at zero, or lower where a value, the target or a range limit is\n * negative, and ends at `max` — by default the largest of the value, the target and the\n * ranges, exactly, so the last band reaches the end. A value past a fixed `max` is drawn\n * to the end and announced as itself. A narrow drawing prints fewer ticks, so no two of\n * their labels touch. Under RTL the chart mirrors, as a progress bar does:\n * the label is on the right and the bar grows leftwards.\n *\n * **What a screen reader gets.** The drawing is one `role=\"img\"` named by a sentence —\n * \"Revenue: 270 of target 250\" (`bulletChart.summary`) — and described by the sub-label.\n * The label and the sub-label beside it are `aria-hidden`, since the sentence and the\n * description already carry them, and so are the scale's ticks. The bands have no names,\n * so they are not announced: say what they mean in `ariaLabel` where it matters. There is\n * no data table, since there is one number, and no tab stop.\n *\n * @see https://ngwr.dev/charts/bullet-chart\n */\n@Component({\n selector: 'wr-bullet-chart',\n templateUrl: './bullet-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-bullet-chart',\n // The label column exists only when there is something to put in it; without one the\n // drawing takes the whole width rather than leaving a gap where a column would be.\n '[class.wr-bullet-chart--labelled]': 'labelled()',\n },\n})\nexport class WrBulletChart {\n /**\n * The measure. A value that is not a finite number — `null` while it loads — draws no\n * bar, and the chart is announced as having no value rather than as zero.\n */\n readonly value = input.required<number | null, unknown>({ transform: finiteOrNull });\n\n /**\n * The comparative measure, drawn as a marker across the line. `null`, or anything that\n * is not a finite number, draws none and leaves it out of the accessible name.\n * @default null\n */\n readonly target = input<number | null, unknown>(null, { transform: finiteOrNull });\n\n /**\n * The upper limit of each qualitative band, in any order: `[150, 225, 300]` draws a band\n * from the scale's start to 150, one from 150 to 225 and one from 225 to 300. They are\n * sorted, a repeated limit counts once, and one that is not a finite number is dropped.\n * The band nearest zero is the strongest grey and each one after it fainter, between\n * `--wr-bullet-chart-range-start` and `--wr-bullet-chart-range-end`. Few recommends no\n * more than five.\n *\n * The first band is everything below the first limit, so it has room only where the\n * scale reaches below that limit. A negative first limit lower than both the value and\n * the target is where the scale starts, which leaves that band no room: it is not drawn,\n * and the drawing opens with the second band and its paler grey. Where the scale runs on\n * past the last limit, a rule marks where the last band ends.\n */\n readonly ranges = input<readonly number[]>([]);\n\n /**\n * The end of the scale. `0` takes the largest of `value`, `target` and `ranges`, so the\n * last band reaches the end; a value above `0` fixes it, and anything past it is drawn to\n * the end — the accessible name and the tooltip still give its own figure. @default 0\n */\n readonly max = input(0, {\n transform: (v: unknown): number => {\n const value = coerceNumberProperty(v, 0);\n return Number.isFinite(value) ? Math.max(0, value) : 0;\n },\n });\n\n /**\n * What is measured, shown at inline start beside the drawing, ellipsised past\n * `--wr-bullet-chart-label-max-width`. It heads the tooltip and opens the accessible\n * name; without it the name opens with `bulletChart.label` (\"Bullet chart\").\n */\n readonly label = input<string | null>(null);\n\n /**\n * A line under the label — the unit, the period. The drawing is described by it\n * (`aria-describedby`), so a screen reader hears it after the name.\n */\n readonly subLabel = input<string | null>(null);\n\n /**\n * Accessible name of the drawing, in place of the sentence the chart writes itself —\n * \"Revenue: 270 of target 250\". Give one where the bands mean something a reader needs,\n * since they have no names of their own.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Writes every number the chart shows: the scale's ticks, the tooltip and the\n * accessible name. `null` uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ticks\n * (`1.2K`) unless the full numbers are shorter.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /** Show the scale's ticks under the drawing. @default true */\n readonly showScale = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip with the label, the value and the target while the pointer is over the\n * drawing. Pointer only: the accessible name says the same. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /** The exact figures and the scale's compact ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly track = viewChild<ElementRef<HTMLElement>>('track');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The drawing's laid-out width and a tick label's width per character, once a browser\n * has measured them: whether the ticks fit is a question of pixels. Until then — on the\n * server and in the first paint — the scale draws its usual count.\n */\n private readonly measured = signal<Measured | null>(null);\n\n /** The drawing's width as the observer last reported it, in px; 0 until it has. */\n private trackWidth = 0;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/bullet-chart');\n const destroyRef = inject(DestroyRef);\n // Measured after render, so nothing here touches the DOM before a browser has one.\n afterNextRender(() => {\n const track = this.track()?.nativeElement;\n if (!track || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(([entry]) => {\n const width = entry.contentRect.width;\n // A hidden chart measures nothing; keep the last reading rather than thin to it.\n if (width <= 0) return;\n this.trackWidth = width;\n this.measure();\n });\n observer.observe(track);\n let destroyed = false;\n destroyRef.onDestroy(() => {\n destroyed = true;\n observer.disconnect();\n });\n // A web font arriving after the first measurement widens the labels and leaves the\n // drawing as wide as it was, so the observer never hears of it.\n if ('fonts' in document) {\n void document.fonts.ready.then(() => {\n if (!destroyed) this.measure();\n });\n }\n });\n // Labels that first appear after the drawing was measured — `showScale` switched on —\n // have never been measured either, and the drawing's width does not change for them.\n // Only while no width per character is known: measuring again on every change of the\n // ticks would take it off the labels a thinner scale prints, and could thin back and\n // forth between two counts.\n afterRenderEffect(() => {\n if (this.ticks().length === 0 || this.measured()) return;\n this.measure();\n });\n }\n\n /**\n * Read a tick label's width per character off the labels as laid out, and keep it with\n * the drawing's width. Per character, from the label that is widest for its length: the\n * digits are tabular, so the figure holds for the labels a coarser scale would print too.\n */\n private measure(): void {\n const width = this.trackWidth;\n if (width <= 0) return;\n let char = 0;\n for (const label of this.host.nativeElement.querySelectorAll('.wr-bullet-chart__tick-label')) {\n const length = label.textContent?.trim().length ?? 0;\n if (length > 0) char = Math.max(char, label.getBoundingClientRect().width / length);\n }\n const last = untracked(this.measured);\n // No label laid out — `showScale` off — measures nothing: keep what is known.\n if (char <= 0) char = last?.char ?? 0;\n if (char <= 0 || (last?.width === width && last.char === char)) return;\n this.measured.set({ width, char });\n }\n\n /** The id of the sub-label, which describes the drawing. */\n protected readonly subLabelId = `wr-bullet-chart-${bulletUid++}-sub-label`;\n\n /** Whether there is a label column to draw. */\n protected readonly labelled = computed(() => !!this.label() || !!this.subLabel());\n\n /** The range limits as drawn: finite, sorted, and each once. */\n private readonly limits = computed(() =>\n [...new Set(this.ranges().filter(limit => Number.isFinite(limit)))].sort((a, b) => a - b)\n );\n\n /**\n * The scale. It starts at zero, or at the lowest of the value, the target and the first\n * range limit where that is below zero, and ends at a fixed `max` or else at the largest\n * of the three. With nothing above the start to reach, the empty 0 to 1 frame.\n */\n private readonly scale = computed(() => {\n const value = this.value() ?? 0;\n const target = this.target() ?? 0;\n const limits = this.limits();\n const min = Math.min(0, value, target, limits[0] ?? 0);\n const explicit = this.max();\n const max = explicit > 0 ? explicit : Math.max(0, value, target, limits.at(-1) ?? 0);\n return max > min ? { min, max } : { min: 0, max: 1 };\n });\n\n /** A number's share of the scale from its start, held to the scale. */\n private share(value: number): number {\n const { min, max } = this.scale();\n return wrClamp((value - min) / (max - min), 0, 1);\n }\n\n /**\n * The bands, from the scale's start: each from the limit before it — the first from the\n * scale's start, so a negative value sits in the first band — to its own limit, held to\n * the scale. A band the scale leaves no room for is not drawn, and keeps its shade for\n * the bands that are: shades follow the limits given, not the bands that fit.\n */\n protected readonly bands = computed<readonly Band[]>(() => {\n const limits = this.limits();\n const { min } = this.scale();\n const last = limits.length - 1;\n return limits.flatMap((limit, index) => {\n // Both ends rounded before the size is taken between them, so a band ends exactly\n // where the next begins, and the last one exactly at 1 — where the rule past it is\n // clipped.\n const start = short(this.share(index === 0 ? min : limits[index - 1]));\n const end = short(this.share(limit));\n if (end <= start) return [];\n const mix = last === 0 ? 0 : (index / last) * 100;\n return [{ index, start, size: short(end - start), mix: `${wrRound(mix, 2)}%` }];\n });\n });\n\n /**\n * The value's bar, from zero to the value — leftwards of zero for a negative one — or\n * `null` with no value. A zero is still drawn, as a sliver, since it is a reading.\n */\n protected readonly bar = computed(() => {\n const value = this.value();\n if (value === null) return null;\n const zero = this.share(0);\n const at = this.share(value);\n return { start: short(Math.min(zero, at)), size: short(Math.abs(at - zero)), negative: value < 0 };\n });\n\n /** The target marker's share of the scale, or `null` with no target. */\n protected readonly targetAt = computed(() => {\n const target = this.target();\n return target === null ? null : short(this.share(target));\n });\n\n /**\n * The scale's ticks, from its start: `wrChartAxis` over the scale with the ticks it would\n * draw past either end left out, so the scale ends where `max` says rather than on the\n * next round number. Decided for the whole scale, as an axis' ticks are\n * (`useChartNumbers().ticks`). A tick on either end is aligned inwards, so its label\n * stays over the drawing — and once a browser has measured it, so is a tick near an end\n * whose centred label would reach past it.\n *\n * A narrow drawing gets fewer: once a browser has measured it, the scale aims for four\n * gaps, then three, two and one, and keeps the first whose labels stand at least 8px\n * apart, each as wide as its characters at the measured width per character.\n */\n protected readonly ticks = computed<readonly Tick[]>(() => {\n if (!this.showScale()) return [];\n const measured = this.measured();\n let ticks: readonly Tick[] = [];\n for (const count of TICK_COUNTS) {\n ticks = this.ticksFor(count, measured);\n if (!measured || this.fits(ticks, measured)) break;\n }\n return ticks;\n });\n\n /**\n * The scale's ticks for `wrChartAxis` aiming at `count` gaps. A tick on an end is aligned\n * inwards; with a measurement, so is one whose label, centred on it, would cross an end.\n */\n private ticksFor(count: number, measured: Measured | null): readonly Tick[] {\n const { min, max } = this.scale();\n const axis = wrChartAxis(min, max, { includeZero: true, tickCount: count });\n const values = axis.ticks.filter(tick => tick >= min - 1e-9 && tick <= max + 1e-9).reverse();\n const labels = this.numbers.ticks(values, axis.step);\n return values.map((value, i) => {\n const at = short(this.share(value));\n const half = measured ? (labels[i].length * measured.char) / 2 : 0;\n const x = measured ? at * measured.width : 0;\n const edge =\n at <= 0 || (measured && x - half < 0)\n ? 'start'\n : at >= 1 || (measured && x + half > measured.width)\n ? 'end'\n : null;\n return { label: labels[i], at, edge };\n });\n }\n\n /** Whether each tick label ends at least `TICK_GAP` before the next begins, placed as the stylesheet places them. */\n private fits(ticks: readonly Tick[], { width, char }: Measured): boolean {\n let end = Number.NEGATIVE_INFINITY;\n for (const tick of ticks) {\n const at = tick.at * width;\n const size = tick.label.length * char;\n const start = tick.edge === 'start' ? at : tick.edge === 'end' ? at - size : at - size / 2;\n if (start < end + TICK_GAP) return false;\n end = start + size;\n }\n return true;\n }\n\n /** The accessible name's subject: the label, else the catalog's name for the chart. */\n private readonly subject = useI18nText(this.label, 'bulletChart.label', 'Bullet chart');\n\n private readonly summaryText = useI18nFormatter('bulletChart.summary', '{{label}}: {{value}} of target {{target}}');\n\n private readonly summaryNoTargetText = useI18nFormatter('bulletChart.summaryNoTarget', '{{label}}: {{value}}');\n\n private readonly summaryNoValueText = useI18nFormatter(\n 'bulletChart.summaryNoValue',\n '{{label}}: no value, target {{target}}'\n );\n\n private readonly noValueText = useI18nFormatter('bulletChart.noValue', '{{label}}: no value');\n\n /** The tooltip's name for the target's row. */\n private readonly targetWord = wrReadI18nText('bulletChart.target', 'Target');\n\n /**\n * The drawing's accessible name: `ariaLabel`, or a sentence with the value and the\n * target written as the tooltip writes them — one of four, so a missing value or target\n * is said rather than left as a gap in a template.\n */\n protected readonly resolvedAriaLabel = computed(() => {\n const custom = this.ariaLabel();\n if (custom) return custom;\n const label = this.subject();\n const value = this.value();\n const target = this.target();\n if (value === null) {\n return target === null\n ? this.noValueText({ label })\n : this.summaryNoValueText({ label, target: this.numbers.value(target) });\n }\n return target === null\n ? this.summaryNoTargetText({ label, value: this.numbers.value(value) })\n : this.summaryText({ label, value: this.numbers.value(value), target: this.numbers.value(target) });\n });\n\n /**\n * One tooltip for the whole chart: the label as its heading with the value beside it and\n * the bar's own paint as the swatch, then a row for the target. It points at the end of\n * the bar from above — or at the target with no value — so the arrow marks the reading.\n * The label is the `label` input, never the catalog's fallback, which names the kind of\n * chart rather than the measure. With neither a value nor a target there is nothing to\n * say, and it does not open.\n */\n protected readonly tip = useChartTooltip(this.tooltip, () => {\n const track = this.track()?.nativeElement;\n const value = this.value();\n const target = this.target();\n if (!track || (value === null && target === null)) return null;\n const box = track.getBoundingClientRect();\n const at = this.share(value ?? target!);\n // The drawing mirrors under RTL, so its start is the box's right edge there.\n const rtl = getComputedStyle(track).direction === 'rtl';\n // The bar's paint as laid out, whatever its hook was set to: the chip renders under\n // `<body>`, where the chart's own custom properties do not reach.\n const bar = value === null ? null : track.querySelector('.wr-bullet-chart__bar');\n const paint = bar ? getComputedStyle(bar).backgroundColor : '';\n return {\n datum: {\n label: this.label() ?? undefined,\n value: value === null ? '' : this.numbers.value(value),\n color: paint && !TRANSPARENT.test(paint) ? paint : undefined,\n rows: target === null ? [] : [{ label: this.targetWord(), value: this.numbers.value(target) }],\n },\n anchor: { x: rtl ? box.right - at * box.width : box.left + at * box.width, y: box.top },\n };\n });\n}\n","@let valueBar = bar();\n@let target = targetAt();\n@if (labelled()) {\n <!-- Hidden, as the scale is: the label opens the drawing's name and the sub-label is its\n description, so read here as well they would be heard twice. -->\n <div class=\"wr-bullet-chart__labels\" aria-hidden=\"true\">\n @if (label()) {\n <span class=\"wr-bullet-chart__label\">{{ label() }}</span>\n }\n @if (subLabel()) {\n <span class=\"wr-bullet-chart__sub-label\" [id]=\"subLabelId\">{{ subLabel() }}</span>\n }\n </div>\n}\n\n<!-- The drawing: one named image. Its parts are empty boxes placed by the shares the\n component writes, every one a logical inset, so the drawing mirrors under RTL with no\n rule of its own. -->\n<div\n #track\n class=\"wr-bullet-chart__track\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-describedby]=\"subLabel() ? subLabelId : null\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <!-- The bands sit in a layer of their own, which clips them to the track's corners\n without clipping the target marker at either end. -->\n <div class=\"wr-bullet-chart__ranges\">\n @for (band of bands(); track band.index) {\n <span\n class=\"wr-bullet-chart__range\"\n [attr.data-index]=\"band.index\"\n [style.--wr-bullet-chart-start]=\"band.start\"\n [style.--wr-bullet-chart-size]=\"band.size\"\n [style.--wr-bullet-chart-range-mix]=\"band.mix\"\n ></span>\n }\n </div>\n\n @if (valueBar) {\n <span\n class=\"wr-bullet-chart__bar\"\n [class.wr-bullet-chart__bar--negative]=\"valueBar.negative\"\n [style.--wr-bullet-chart-start]=\"valueBar.start\"\n [style.--wr-bullet-chart-size]=\"valueBar.size\"\n ></span>\n }\n\n @if (target !== null) {\n <span class=\"wr-bullet-chart__target\" [style.--wr-bullet-chart-at]=\"target\"></span>\n }\n</div>\n\n@if (showScale()) {\n <div class=\"wr-bullet-chart__scale\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-bullet-chart__tick\"\n [class.wr-bullet-chart__tick--start]=\"tick.edge === 'start'\"\n [class.wr-bullet-chart__tick--end]=\"tick.edge === 'end'\"\n [style.--wr-bullet-chart-at]=\"tick.at\"\n >\n <span class=\"wr-bullet-chart__tick-label\">{{ tick.label }}</span>\n </span>\n }\n </div>\n}\n"],"mappings":";;;;;;;;;;;;;AAiCA,IAAI,YAAY;AAG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;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-charts-bullet-chart.mjs","names":[],"sources":["../../../projects/lib/charts/bullet-chart/bullet-chart.ts","../../../projects/lib/charts/bullet-chart/bullet-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n afterRenderEffect,\n computed,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\n\nimport {\n WrChartState,\n useChartHover,\n useChartNumbers,\n useChartSize,\n useChartState,\n wrChartAxis,\n wrChartRound,\n} from 'ngwr/charts/core';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip, wrCoerceChartTooltip } from 'ngwr/popover';\nimport { wrClamp, wrRound, wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Instance counter for the sub-label's id, which the drawing's `aria-describedby` names.\n * Counted rather than `wrRandomId()`, so the prerendered id is the one the browser renders\n * again — the reason `wr-tabs` and `wr-graph` count.\n */\nlet bulletUid = 0;\n\n/** A finite number, or `null` for anything else: a missing reading is drawn as none, never as zero. */\nconst finiteOrNull = (v: unknown): number | null => {\n const value = coerceNumberProperty(v, Number.NaN);\n return Number.isFinite(value) ? value : null;\n};\n\n/** A computed colour that paints nothing — a bar not laid out, or no stylesheet loaded. */\nconst TRANSPARENT = /^(?:transparent|rgba\\(0, 0, 0, 0\\))$/;\n\n/** The least room kept between two tick labels, in px. */\nconst TICK_GAP = 8;\n\n/** The tick counts the scale tries, most first, while its labels overlap: what `wrChartAxis` aims for. */\nconst TICK_COUNTS = [4, 3, 2, 1] as const;\n\n/** A share of the scale for an inline style, to four decimals with `-0` folded to `0`, so the style stays short. */\nconst short = (value: number): number => wrChartRound(value, 4);\n\n/** One qualitative band as drawn: where it starts and how much of the scale it covers, both as shares from 0 to 1. */\ninterface Band {\n /** Its position in the sorted `ranges`, which decides its shade. */\n readonly index: number;\n readonly start: number;\n readonly size: number;\n /** How far its shade has moved from the strongest step towards the faintest, as a CSS percentage. */\n readonly mix: string;\n}\n\n/** A tick of the scale: its label, its share of the scale, and which end of the scale it sits on, if either. */\ninterface Tick {\n readonly label: string;\n readonly at: number;\n readonly edge: 'start' | 'end' | null;\n}\n\n/** What a browser has laid out, in px: the drawing's width, and a tick label's width per character. */\ninterface Measured {\n readonly width: number;\n readonly char: number;\n}\n\n/**\n * Bullet chart: one measure against a target, over qualitative bands — Stephen Few's\n * bullet graph, the compact replacement for a dashboard gauge. Horizontal, one line high.\n * HTML and CSS only — no external dependency.\n *\n * @example\n * ```html\n * <wr-bullet-chart label=\"Revenue\" subLabel=\"USD, thousands\" [value]=\"270\" [target]=\"250\" [ranges]=\"[150, 225, 300]\" />\n * ```\n *\n * **What is drawn.** `ranges` are the upper limits of the qualitative bands — poor,\n * satisfactory, good — drawn as steps of the chart theme's sequential scale\n * (`--wr-chart-seq-3` down to `-1`, tints of the first palette colour), the strongest\n * nearest zero and each band after it fainter, so they read as steps in LIGHTNESS, survive\n * greyscale, and follow the palette when an app retints it. A 1px line in the surface\n * parts two bands. The value is a bar a third of the line high, from zero; the target is\n * a perpendicular marker. The two are told apart by shape, not by colour, and both are\n * drawn in the text colour, which holds 7:1 against the strongest band in either scheme\n * where the palette colour itself, a step of the same scale, would not reach 3:1.\n *\n * **Empty, loading, error.** With neither a value nor a target the track is empty and\n * says \"No data\"; `loading` and `error` put their own message there.\n *\n * **The scale** starts at zero, or lower where a value, the target or a range limit is\n * negative, and ends at `max` — by default the largest of the value, the target and the\n * ranges, exactly, so the last band reaches the end. A value past a fixed `max` is drawn\n * to the end and announced as itself. A narrow drawing prints fewer ticks, so no two of\n * their labels touch. Under RTL the chart mirrors, as a progress bar does:\n * the label is on the right and the bar grows leftwards.\n *\n * **What a screen reader gets.** The drawing is one `role=\"img\"` named by a sentence —\n * \"Revenue: 270 of target 250\" (`bulletChart.summary`) — and described by the sub-label.\n * The label and the sub-label beside it are `aria-hidden`, since the sentence and the\n * description already carry them, and so are the scale's ticks. The bands have no names,\n * so they are not announced: say what they mean in `ariaLabel` where it matters. There is\n * no data table, since there is one number, and no tab stop.\n *\n * @see https://ngwr.dev/charts/bullet-chart\n */\n@Component({\n selector: 'wr-bullet-chart',\n templateUrl: './bullet-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-bullet-chart',\n // The label column exists only when there is something to put in it; without one the\n // drawing takes the whole width rather than leaving a gap where a column would be.\n '[class.wr-bullet-chart--labelled]': 'labelled()',\n },\n imports: [WrChartState],\n})\nexport class WrBulletChart {\n /**\n * The measure. A value that is not a finite number — `null` while it loads — draws no\n * bar, and the chart is announced as having no value rather than as zero.\n */\n readonly value = input.required<number | null, unknown>({ transform: finiteOrNull });\n\n /**\n * The comparative measure, drawn as a marker across the line. `null`, or anything that\n * is not a finite number, draws none and leaves it out of the accessible name.\n * @default null\n */\n readonly target = input<number | null, unknown>(null, { transform: finiteOrNull });\n\n /**\n * The upper limit of each qualitative band, in any order: `[150, 225, 300]` draws a band\n * from the scale's start to 150, one from 150 to 225 and one from 225 to 300. They are\n * sorted, a repeated limit counts once, and one that is not a finite number is dropped.\n * The band nearest zero is the strongest step and each one after it fainter, between\n * `--wr-bullet-chart-range-start` and `--wr-bullet-chart-range-end`. Few recommends no\n * more than five.\n *\n * The first band is everything below the first limit, so it has room only where the\n * scale reaches below that limit. A negative first limit lower than both the value and\n * the target is where the scale starts, which leaves that band no room: it is not drawn,\n * and the drawing opens with the second band and its paler step. Where the scale runs on\n * past the last limit, a rule marks where the last band ends.\n */\n readonly ranges = input<readonly number[]>([]);\n\n /**\n * The end of the scale. `0` takes the largest of `value`, `target` and `ranges`, so the\n * last band reaches the end; a value above `0` fixes it, and anything past it is drawn to\n * the end — the accessible name and the tooltip still give its own figure. @default 0\n */\n readonly max = input(0, {\n transform: (v: unknown): number => {\n const value = coerceNumberProperty(v, 0);\n return Number.isFinite(value) ? Math.max(0, value) : 0;\n },\n });\n\n /**\n * What is measured, shown at inline start beside the drawing, ellipsised past\n * `--wr-bullet-chart-label-max-width`. It heads the tooltip and opens the accessible\n * name; without it the name opens with `bulletChart.label` (\"Bullet chart\").\n */\n readonly label = input<string | null>(null);\n\n /**\n * A line under the label — the unit, the period. The drawing is described by it\n * (`aria-describedby`), so a screen reader hears it after the name.\n */\n readonly subLabel = input<string | null>(null);\n\n /**\n * Accessible name of the drawing, in place of the sentence the chart writes itself —\n * \"Revenue: 270 of target 250\". Give one where the bands mean something a reader needs,\n * since they have no names of their own.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Writes every number the chart shows: the scale's ticks, the tooltip and the\n * accessible name. `null` uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ticks\n * (`1.2K`) unless the full numbers are shorter.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /** Show the scale's ticks under the drawing. @default true */\n readonly showScale = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip with the label, the value and the target while the pointer is over\n * the drawing. Pointer only: the accessible name says the same.\n *\n * By default the pointer passes under the chip to the chart, so the next section\n * answers at once and the chip closes off the chart; `'hoverable'` lets the pointer\n * rest on the chip instead, as WCAG 1.4.13 asks of a hint. @default true\n */\n readonly tooltip = input<boolean | 'hoverable', unknown>(true, { transform: wrCoerceChartTooltip });\n\n /**\n * A request for the measure is in flight: the bands, the bar and the marker give way to\n * the loading message on the track. @default false\n */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The measure failed to load: the marks give way to the error message. `loading` wins\n * while both are set. @default false\n */\n readonly error = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The message shown with neither a value nor a target. Falls back to `chart.empty`,\n * then `'No data'`.\n */\n readonly emptyLabel = input<string | null>(null);\n\n /** The message shown while `loading`. Falls back to `chart.loading`, then `'Loading…'`. */\n readonly loadingLabel = input<string | null>(null);\n\n /** The message shown on `error`. Falls back to `chart.error`, then `'Could not load'`. */\n readonly errorLabel = input<string | null>(null);\n\n /** The exact figures and the scale's compact ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly track = viewChild<ElementRef<HTMLElement>>('track');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The drawing's laid-out width and a tick label's width per character, once a browser\n * has measured them: whether the ticks fit is a question of pixels. Until then — on the\n * server and in the first paint — the scale draws its usual count.\n */\n private readonly measured = signal<Measured | null>(null);\n\n /** The drawing's width as the observer last reported it, in px; 0 until it has. */\n private trackWidth = 0;\n\n /**\n * The drawing's box, on the observer every chart shares: a table of a hundred bullets\n * is one observer and one callback a frame, where each bullet used to make its own.\n */\n private readonly trackSize = useChartSize(this.track);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/bullet-chart');\n const destroyRef = inject(DestroyRef);\n\n // One pair of native listeners on the host: the drawing is the chart's one section.\n useChartHover({ enter: index => this.tip.enter(index), leave: event => this.tip.leave(event) });\n\n // Measured after render, so nothing here touches the DOM before a browser has one.\n afterRenderEffect(() => {\n const { width } = this.trackSize();\n // A hidden chart measures nothing; keep the last reading rather than thin to it.\n if (width <= 0) return;\n this.trackWidth = width;\n untracked(() => this.measure());\n });\n\n // A web font arriving after the first measurement widens the labels and leaves the\n // drawing as wide as it was, so the observer never hears of it.\n afterNextRender(() => {\n let destroyed = false;\n destroyRef.onDestroy(() => (destroyed = true));\n if ('fonts' in document) {\n void document.fonts.ready.then(() => {\n if (!destroyed) this.measure();\n });\n }\n });\n\n // Labels that first appear after the drawing was measured — `showScale` switched on —\n // have never been measured either, and the drawing's width does not change for them.\n // Only while no width per character is known: measuring again on every change of the\n // ticks would take it off the labels a thinner scale prints, and could thin back and\n // forth between two counts.\n afterRenderEffect(() => {\n if (this.ticks().length === 0 || this.measured()) return;\n this.measure();\n });\n }\n\n /**\n * Read a tick label's width per character off the labels as laid out, and keep it with\n * the drawing's width. Per character, from the label that is widest for its length: the\n * digits are tabular, so the figure holds for the labels a coarser scale would print too.\n */\n private measure(): void {\n const width = this.trackWidth;\n if (width <= 0) return;\n let char = 0;\n for (const label of this.host.nativeElement.querySelectorAll('.wr-bullet-chart__tick-label')) {\n const length = label.textContent?.trim().length ?? 0;\n if (length > 0) char = Math.max(char, label.getBoundingClientRect().width / length);\n }\n const last = untracked(this.measured);\n // No label laid out — `showScale` off — measures nothing: keep what is known.\n if (char <= 0) char = last?.char ?? 0;\n if (char <= 0 || (last?.width === width && last.char === char)) return;\n this.measured.set({ width, char });\n }\n\n /** The id of the sub-label, which describes the drawing. */\n protected readonly subLabelId = `wr-bullet-chart-${bulletUid++}-sub-label`;\n\n /** Whether there is a label column to draw. */\n protected readonly labelled = computed(() => !!this.label() || !!this.subLabel());\n\n /** The range limits as drawn: finite, sorted, and each once. */\n private readonly limits = computed(() =>\n [...new Set(this.ranges().filter(limit => Number.isFinite(limit)))].sort((a, b) => a - b)\n );\n\n /**\n * The scale. It starts at zero, or at the lowest of the value, the target and the first\n * range limit where that is below zero, and ends at a fixed `max` or else at the largest\n * of the three. With nothing above the start to reach, the empty 0 to 1 frame.\n */\n private readonly scale = computed(() => {\n const value = this.value() ?? 0;\n const target = this.target() ?? 0;\n const limits = this.limits();\n const min = Math.min(0, value, target, limits[0] ?? 0);\n const explicit = this.max();\n const max = explicit > 0 ? explicit : Math.max(0, value, target, limits.at(-1) ?? 0);\n return max > min ? { min, max } : { min: 0, max: 1 };\n });\n\n /** A number's share of the scale from its start, held to the scale. */\n private share(value: number): number {\n const { min, max } = this.scale();\n return wrClamp((value - min) / (max - min), 0, 1);\n }\n\n /**\n * The bands, from the scale's start: each from the limit before it — the first from the\n * scale's start, so a negative value sits in the first band — to its own limit, held to\n * the scale. A band the scale leaves no room for is not drawn, and keeps its shade for\n * the bands that are: shades follow the limits given, not the bands that fit.\n */\n protected readonly bands = computed<readonly Band[]>(() => {\n const limits = this.limits();\n const { min } = this.scale();\n const last = limits.length - 1;\n return limits.flatMap((limit, index) => {\n // Both ends rounded before the size is taken between them, so a band ends exactly\n // where the next begins, and the last one exactly at 1 — where the rule past it is\n // clipped.\n const start = short(this.share(index === 0 ? min : limits[index - 1]));\n const end = short(this.share(limit));\n if (end <= start) return [];\n const mix = last === 0 ? 0 : (index / last) * 100;\n return [{ index, start, size: short(end - start), mix: `${wrRound(mix, 2)}%` }];\n });\n });\n\n /**\n * The value's bar, from zero to the value — leftwards of zero for a negative one — or\n * `null` with no value. A zero is still drawn, as a sliver, since it is a reading.\n */\n protected readonly bar = computed(() => {\n const value = this.value();\n if (value === null) return null;\n const zero = this.share(0);\n const at = this.share(value);\n return { start: short(Math.min(zero, at)), size: short(Math.abs(at - zero)), negative: value < 0 };\n });\n\n /** The target marker's share of the scale, or `null` with no target. */\n protected readonly targetAt = computed(() => {\n const target = this.target();\n return target === null ? null : short(this.share(target));\n });\n\n /**\n * The scale's ticks, from its start: `wrChartAxis` over the scale with the ticks it would\n * draw past either end left out, so the scale ends where `max` says rather than on the\n * next round number. Decided for the whole scale, as an axis' ticks are\n * (`useChartNumbers().ticks`). A tick on either end is aligned inwards, so its label\n * stays over the drawing — and once a browser has measured it, so is a tick near an end\n * whose centred label would reach past it.\n *\n * A narrow drawing gets fewer: once a browser has measured it, the scale aims for four\n * gaps, then three, two and one, and keeps the first whose labels stand at least 8px\n * apart, each as wide as its characters at the measured width per character.\n */\n protected readonly ticks = computed<readonly Tick[]>(() => {\n if (!this.showScale()) return [];\n const measured = this.measured();\n let ticks: readonly Tick[] = [];\n for (const count of TICK_COUNTS) {\n ticks = this.ticksFor(count, measured);\n if (!measured || this.fits(ticks, measured)) break;\n }\n return ticks;\n });\n\n /**\n * The scale's ticks for `wrChartAxis` aiming at `count` gaps. A tick on an end is aligned\n * inwards; with a measurement, so is one whose label, centred on it, would cross an end.\n */\n private ticksFor(count: number, measured: Measured | null): readonly Tick[] {\n const { min, max } = this.scale();\n const axis = wrChartAxis(min, max, { includeZero: true, tickCount: count });\n const values = axis.ticks.filter(tick => tick >= min - 1e-9 && tick <= max + 1e-9).reverse();\n const labels = this.numbers.ticks(values, axis.step);\n return values.map((value, i) => {\n const at = short(this.share(value));\n const half = measured ? (labels[i].length * measured.char) / 2 : 0;\n const x = measured ? at * measured.width : 0;\n const edge =\n at <= 0 || (measured && x - half < 0)\n ? 'start'\n : at >= 1 || (measured && x + half > measured.width)\n ? 'end'\n : null;\n return { label: labels[i], at, edge };\n });\n }\n\n /** Whether each tick label ends at least `TICK_GAP` before the next begins, placed as the stylesheet places them. */\n private fits(ticks: readonly Tick[], { width, char }: Measured): boolean {\n let end = Number.NEGATIVE_INFINITY;\n for (const tick of ticks) {\n const at = tick.at * width;\n const size = tick.label.length * char;\n const start = tick.edge === 'start' ? at : tick.edge === 'end' ? at - size : at - size / 2;\n if (start < end + TICK_GAP) return false;\n end = start + size;\n }\n return true;\n }\n\n /** What the chart shows in place of its marks, or `null` while it draws them. */\n protected readonly state = useChartState({\n loading: this.loading,\n error: this.error,\n empty: computed(() => this.value() === null && this.target() === null),\n emptyLabel: this.emptyLabel,\n loadingLabel: this.loadingLabel,\n errorLabel: this.errorLabel,\n });\n\n /** The accessible name's subject: the label, else the catalog's name for the chart. */\n private readonly subject = useI18nText(this.label, 'bulletChart.label', 'Bullet chart');\n\n private readonly summaryText = useI18nFormatter('bulletChart.summary', '{{label}}: {{value}} of target {{target}}');\n\n private readonly summaryNoTargetText = useI18nFormatter('bulletChart.summaryNoTarget', '{{label}}: {{value}}');\n\n private readonly summaryNoValueText = useI18nFormatter(\n 'bulletChart.summaryNoValue',\n '{{label}}: no value, target {{target}}'\n );\n\n private readonly noValueText = useI18nFormatter('bulletChart.noValue', '{{label}}: no value');\n\n /** The tooltip's name for the target's row. */\n private readonly targetWord = wrReadI18nText('bulletChart.target', 'Target');\n\n /**\n * The drawing's accessible name: `ariaLabel`, or a sentence with the value and the\n * target written as the tooltip writes them — one of four, so a missing value or target\n * is said rather than left as a gap in a template.\n */\n protected readonly resolvedAriaLabel = computed(() => {\n const custom = this.ariaLabel();\n if (custom) return custom;\n const label = this.subject();\n const value = this.value();\n const target = this.target();\n if (value === null) {\n return target === null\n ? this.noValueText({ label })\n : this.summaryNoValueText({ label, target: this.numbers.value(target) });\n }\n return target === null\n ? this.summaryNoTargetText({ label, value: this.numbers.value(value) })\n : this.summaryText({ label, value: this.numbers.value(value), target: this.numbers.value(target) });\n });\n\n /**\n * One tooltip for the whole chart: the label as its heading with the value beside it and\n * the bar's own paint as the swatch, then a row for the target. It points at the end of\n * the bar from above — or at the target with no value — so the arrow marks the reading.\n * The label is the `label` input, never the catalog's fallback, which names the kind of\n * chart rather than the measure. With neither a value nor a target there is nothing to\n * say, and it does not open.\n */\n protected readonly tip = useChartTooltip(this.tooltip, () => {\n const track = this.track()?.nativeElement;\n const value = this.value();\n const target = this.target();\n if (!track || (value === null && target === null)) return null;\n const box = track.getBoundingClientRect();\n const at = this.share(value ?? target!);\n // The drawing mirrors under RTL, so its start is the box's right edge there.\n const rtl = getComputedStyle(track).direction === 'rtl';\n // The bar's paint as laid out, whatever its hook was set to: the chip renders under\n // `<body>`, where the chart's own custom properties do not reach.\n const bar = value === null ? null : track.querySelector('.wr-bullet-chart__bar');\n const paint = bar ? getComputedStyle(bar).backgroundColor : '';\n return {\n datum: {\n label: this.label() ?? undefined,\n value: value === null ? '' : this.numbers.value(value),\n color: paint && !TRANSPARENT.test(paint) ? paint : undefined,\n rows: target === null ? [] : [{ label: this.targetWord(), value: this.numbers.value(target) }],\n },\n anchor: { x: rtl ? box.right - at * box.width : box.left + at * box.width, y: box.top },\n };\n });\n}\n","@let valueBar = bar();\n@let target = targetAt();\n@let shown = state();\n@if (labelled()) {\n <!-- Hidden, as the scale is: the label opens the drawing's name and the sub-label is its\n description, so read here as well they would be heard twice. -->\n <div class=\"wr-bullet-chart__labels\" aria-hidden=\"true\">\n @if (label()) {\n <span class=\"wr-bullet-chart__label\">{{ label() }}</span>\n }\n @if (subLabel()) {\n <span class=\"wr-bullet-chart__sub-label\" [id]=\"subLabelId\">{{ subLabel() }}</span>\n }\n </div>\n}\n\n<!-- The drawing: one named image. Its parts are empty boxes placed by the shares the\n component writes. The bands are logical insets, which mirror under RTL by themselves;\n the bar and the marker move by a transform, which the stylesheet mirrors by hand.\n `data-wr-index` makes it the one section the chart's hover listener reports. -->\n<div\n #track\n class=\"wr-bullet-chart__track\"\n role=\"img\"\n data-wr-index=\"0\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-describedby]=\"subLabel() ? subLabelId : null\"\n>\n <!-- The bands sit in a layer of their own, which clips them to the track's corners\n without clipping the target marker at either end. -->\n <div class=\"wr-bullet-chart__ranges\">\n @for (band of shown ? [] : bands(); track band.index) {\n <span\n class=\"wr-bullet-chart__range\"\n [attr.data-index]=\"band.index\"\n [style.--wr-bullet-chart-start]=\"band.start\"\n [style.--wr-bullet-chart-size]=\"band.size\"\n [style.--wr-bullet-chart-range-mix]=\"band.mix\"\n ></span>\n }\n </div>\n\n @if (valueBar && !shown) {\n <span\n class=\"wr-bullet-chart__bar\"\n [class.wr-bullet-chart__bar--negative]=\"valueBar.negative\"\n [style.--wr-bullet-chart-start]=\"valueBar.start\"\n [style.--wr-bullet-chart-size]=\"valueBar.size\"\n ></span>\n }\n\n @if (target !== null && !shown) {\n <span class=\"wr-bullet-chart__target\" [style.--wr-bullet-chart-at]=\"target\"></span>\n }\n</div>\n\n@if (shown) {\n <!-- Over the track, beside the drawing's `img` and never inside it: `img` makes\n everything it holds presentational, and the message is a live region. -->\n <div class=\"wr-bullet-chart__status\">\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n </div>\n}\n\n@if (showScale()) {\n <div class=\"wr-bullet-chart__scale\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-bullet-chart__tick\"\n [class.wr-bullet-chart__tick--start]=\"tick.edge === 'start'\"\n [class.wr-bullet-chart__tick--end]=\"tick.edge === 'end'\"\n [style.--wr-bullet-chart-at]=\"tick.at\"\n >\n <span class=\"wr-bullet-chart__tick-label\">{{ tick.label }}</span>\n </span>\n }\n </div>\n}\n"],"mappings":";;;;;;;;;;;;;AAyCA,IAAI,YAAY;AAGhB,MAAM,gBAAgB,MAA6B;CACjD,MAAM,QAAQ,qBAAqB,GAAG,GAAU;CAChD,OAAO,OAAO,SAAS,KAAK,IAAI,QAAQ;AAC1C;AAGA,MAAM,cAAc;A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