ngwr 15.0.1 → 15.2.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 (420) hide show
  1. package/anchor/styles/_index.scss +13 -2
  2. package/bits/aurora/styles/_rules.scss +11 -0
  3. package/bits/dot-grid/dot-grid.scss +1 -0
  4. package/bits/dot-grid/styles/_index.scss +8 -0
  5. package/bits/dot-grid/styles/_rules.scss +54 -0
  6. package/bits/iridescence/iridescence.scss +1 -0
  7. package/bits/iridescence/styles/_index.scss +8 -0
  8. package/bits/iridescence/styles/_rules.scss +72 -0
  9. package/bits/marquee/styles/_rules.scss +7 -3
  10. package/bits/ripple-grid/ripple-grid.scss +1 -0
  11. package/bits/ripple-grid/styles/_index.scss +8 -0
  12. package/bits/ripple-grid/styles/_rules.scss +63 -0
  13. package/bits/spotlight-card/styles/_rules.scss +7 -4
  14. package/bits/star-border/styles/_rules.scss +5 -2
  15. package/bits/threads/styles/_index.scss +8 -0
  16. package/bits/threads/styles/_rules.scss +76 -0
  17. package/bits/threads/threads.scss +1 -0
  18. package/bits/waves/styles/_rules.scss +8 -1
  19. package/charts/bar-chart/styles/_index.scss +607 -7
  20. package/charts/boxplot-chart/styles/_index.scss +297 -0
  21. package/charts/bullet-chart/styles/_index.scss +268 -0
  22. package/charts/calendar-heatmap/styles/_index.scss +25 -3
  23. package/charts/candlestick-chart/styles/_index.scss +307 -0
  24. package/charts/chart-legend/styles/_index.scss +143 -0
  25. package/charts/core/styles/_index.scss +30 -0
  26. package/charts/donut-chart/styles/_index.scss +39 -3
  27. package/charts/funnel-chart/styles/_index.scss +237 -0
  28. package/charts/gauge/styles/_index.scss +4 -2
  29. package/charts/heatmap-chart/styles/_index.scss +329 -0
  30. package/charts/line-chart/styles/_index.scss +141 -8
  31. package/charts/meter-group/styles/_index.scss +44 -13
  32. package/charts/radar-chart/styles/_index.scss +206 -0
  33. package/charts/scatter-chart/styles/_index.scss +245 -0
  34. package/charts/sparkline/styles/_index.scss +10 -1
  35. package/charts/treemap-chart/styles/_index.scss +215 -0
  36. package/charts/waterfall-chart/styles/_index.scss +321 -0
  37. package/collapse/styles/_index.scss +6 -1
  38. package/fesm2022/ngwr-affix.mjs +3 -3
  39. package/fesm2022/ngwr-alert.mjs +3 -3
  40. package/fesm2022/ngwr-anchor.mjs +3 -3
  41. package/fesm2022/ngwr-avatar.mjs +3 -3
  42. package/fesm2022/ngwr-back-top.mjs +3 -3
  43. package/fesm2022/ngwr-badge.mjs +6 -6
  44. package/fesm2022/ngwr-bits-aurora.mjs +30 -38
  45. package/fesm2022/ngwr-bits-aurora.mjs.map +1 -1
  46. package/fesm2022/ngwr-bits-blur-text.mjs +3 -3
  47. package/fesm2022/ngwr-bits-border-glow-testing.mjs.map +1 -1
  48. package/fesm2022/ngwr-bits-border-glow.mjs +11 -5
  49. package/fesm2022/ngwr-bits-border-glow.mjs.map +1 -1
  50. package/fesm2022/ngwr-bits-circular-text.mjs +3 -3
  51. package/fesm2022/ngwr-bits-click-spark.mjs +3 -3
  52. package/fesm2022/ngwr-bits-confetti.mjs +3 -3
  53. package/fesm2022/ngwr-bits-decrypt-text.mjs +3 -3
  54. package/fesm2022/ngwr-bits-dot-grid-testing.mjs +40 -0
  55. package/fesm2022/ngwr-bits-dot-grid-testing.mjs.map +1 -0
  56. package/fesm2022/ngwr-bits-dot-grid.mjs +482 -0
  57. package/fesm2022/ngwr-bits-dot-grid.mjs.map +1 -0
  58. package/fesm2022/ngwr-bits-falling-text.mjs +3 -3
  59. package/fesm2022/ngwr-bits-fuzzy-text.mjs +3 -3
  60. package/fesm2022/ngwr-bits-glitch-text.mjs +3 -3
  61. package/fesm2022/ngwr-bits-gradient-text.mjs +3 -3
  62. package/fesm2022/ngwr-bits-iridescence-testing.mjs +31 -0
  63. package/fesm2022/ngwr-bits-iridescence-testing.mjs.map +1 -0
  64. package/fesm2022/ngwr-bits-iridescence.mjs +591 -0
  65. package/fesm2022/ngwr-bits-iridescence.mjs.map +1 -0
  66. package/fesm2022/ngwr-bits-marquee-testing.mjs +1 -1
  67. package/fesm2022/ngwr-bits-marquee-testing.mjs.map +1 -1
  68. package/fesm2022/ngwr-bits-marquee.mjs +7 -7
  69. package/fesm2022/ngwr-bits-marquee.mjs.map +1 -1
  70. package/fesm2022/ngwr-bits-ripple-grid-testing.mjs +40 -0
  71. package/fesm2022/ngwr-bits-ripple-grid-testing.mjs.map +1 -0
  72. package/fesm2022/ngwr-bits-ripple-grid.mjs +805 -0
  73. package/fesm2022/ngwr-bits-ripple-grid.mjs.map +1 -0
  74. package/fesm2022/ngwr-bits-rotating-text.mjs +3 -3
  75. package/fesm2022/ngwr-bits-shiny-text.mjs +6 -6
  76. package/fesm2022/ngwr-bits-splash-cursor.mjs +3 -3
  77. package/fesm2022/ngwr-bits-split-text.mjs +3 -3
  78. package/fesm2022/ngwr-bits-spotlight-card-testing.mjs +1 -1
  79. package/fesm2022/ngwr-bits-spotlight-card-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-bits-spotlight-card.mjs +10 -10
  81. package/fesm2022/ngwr-bits-spotlight-card.mjs.map +1 -1
  82. package/fesm2022/ngwr-bits-star-border-testing.mjs +1 -1
  83. package/fesm2022/ngwr-bits-star-border-testing.mjs.map +1 -1
  84. package/fesm2022/ngwr-bits-star-border.mjs +7 -7
  85. package/fesm2022/ngwr-bits-star-border.mjs.map +1 -1
  86. package/fesm2022/ngwr-bits-threads-testing.mjs +41 -0
  87. package/fesm2022/ngwr-bits-threads-testing.mjs.map +1 -0
  88. package/fesm2022/ngwr-bits-threads.mjs +482 -0
  89. package/fesm2022/ngwr-bits-threads.mjs.map +1 -0
  90. package/fesm2022/ngwr-bits-tilt-card.mjs +6 -6
  91. package/fesm2022/ngwr-bits-typewriter.mjs +3 -3
  92. package/fesm2022/ngwr-bits-waves-testing.mjs.map +1 -1
  93. package/fesm2022/ngwr-bits-waves.mjs +60 -41
  94. package/fesm2022/ngwr-bits-waves.mjs.map +1 -1
  95. package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
  96. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  97. package/fesm2022/ngwr-burger.mjs +3 -3
  98. package/fesm2022/ngwr-button.mjs +6 -6
  99. package/fesm2022/ngwr-calendar.mjs +3 -3
  100. package/fesm2022/ngwr-card.mjs +9 -9
  101. package/fesm2022/ngwr-carousel.mjs +6 -6
  102. package/fesm2022/ngwr-cascader.mjs +5 -5
  103. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  104. package/fesm2022/ngwr-charts-bar-chart-testing.mjs +127 -3
  105. package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
  106. package/fesm2022/ngwr-charts-bar-chart.mjs +683 -49
  107. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  108. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +161 -0
  109. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -0
  110. package/fesm2022/ngwr-charts-boxplot-chart.mjs +517 -0
  111. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -0
  112. package/fesm2022/ngwr-charts-bullet-chart-testing.mjs +68 -0
  113. package/fesm2022/ngwr-charts-bullet-chart-testing.mjs.map +1 -0
  114. package/fesm2022/ngwr-charts-bullet-chart.mjs +459 -0
  115. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -0
  116. package/fesm2022/ngwr-charts-calendar-heatmap-testing.mjs +27 -0
  117. package/fesm2022/ngwr-charts-calendar-heatmap-testing.mjs.map +1 -1
  118. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +96 -17
  119. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  120. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +107 -0
  121. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -0
  122. package/fesm2022/ngwr-charts-candlestick-chart.mjs +508 -0
  123. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -0
  124. package/fesm2022/ngwr-charts-chart-legend-testing.mjs +126 -0
  125. package/fesm2022/ngwr-charts-chart-legend-testing.mjs.map +1 -0
  126. package/fesm2022/ngwr-charts-chart-legend.mjs +251 -0
  127. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -0
  128. package/fesm2022/ngwr-charts-core.mjs +383 -0
  129. package/fesm2022/ngwr-charts-core.mjs.map +1 -0
  130. package/fesm2022/ngwr-charts-donut-chart-testing.mjs +10 -1
  131. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  132. package/fesm2022/ngwr-charts-donut-chart.mjs +187 -31
  133. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  134. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +100 -0
  135. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -0
  136. package/fesm2022/ngwr-charts-funnel-chart.mjs +415 -0
  137. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -0
  138. package/fesm2022/ngwr-charts-gauge-testing.mjs +9 -3
  139. package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
  140. package/fesm2022/ngwr-charts-gauge.mjs +9 -15
  141. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  142. package/fesm2022/ngwr-charts-heatmap-chart-testing.mjs +120 -0
  143. package/fesm2022/ngwr-charts-heatmap-chart-testing.mjs.map +1 -0
  144. package/fesm2022/ngwr-charts-heatmap-chart.mjs +519 -0
  145. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -0
  146. package/fesm2022/ngwr-charts-line-chart-testing.mjs +43 -1
  147. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  148. package/fesm2022/ngwr-charts-line-chart.mjs +436 -122
  149. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  150. package/fesm2022/ngwr-charts-meter-group-testing.mjs +14 -2
  151. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  152. package/fesm2022/ngwr-charts-meter-group.mjs +101 -32
  153. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  154. package/fesm2022/ngwr-charts-radar-chart-testing.mjs +98 -0
  155. package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -0
  156. package/fesm2022/ngwr-charts-radar-chart.mjs +720 -0
  157. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -0
  158. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +132 -0
  159. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -0
  160. package/fesm2022/ngwr-charts-scatter-chart.mjs +545 -0
  161. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -0
  162. package/fesm2022/ngwr-charts-sparkline-testing.mjs.map +1 -1
  163. package/fesm2022/ngwr-charts-sparkline.mjs +14 -16
  164. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  165. package/fesm2022/ngwr-charts-treemap-chart-testing.mjs +103 -0
  166. package/fesm2022/ngwr-charts-treemap-chart-testing.mjs.map +1 -0
  167. package/fesm2022/ngwr-charts-treemap-chart.mjs +535 -0
  168. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -0
  169. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +131 -0
  170. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -0
  171. package/fesm2022/ngwr-charts-waterfall-chart.mjs +462 -0
  172. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -0
  173. package/fesm2022/ngwr-checkbox.mjs +6 -6
  174. package/fesm2022/ngwr-clipboard.mjs +3 -3
  175. package/fesm2022/ngwr-collapse.mjs +9 -9
  176. package/fesm2022/ngwr-color-picker.mjs +6 -6
  177. package/fesm2022/ngwr-command-palette.mjs +3 -3
  178. package/fesm2022/ngwr-compare.mjs +3 -3
  179. package/fesm2022/ngwr-context-menu.mjs +12 -12
  180. package/fesm2022/ngwr-cookie.mjs +3 -3
  181. package/fesm2022/ngwr-counter.mjs +6 -6
  182. package/fesm2022/ngwr-date-picker.mjs +21 -21
  183. package/fesm2022/ngwr-date.mjs +6 -6
  184. package/fesm2022/ngwr-density.mjs +6 -6
  185. package/fesm2022/ngwr-descriptions.mjs +6 -6
  186. package/fesm2022/ngwr-dialog.mjs +15 -15
  187. package/fesm2022/ngwr-directives.mjs +12 -12
  188. package/fesm2022/ngwr-divider.mjs +3 -3
  189. package/fesm2022/ngwr-drawer.mjs +18 -18
  190. package/fesm2022/ngwr-dropdown.mjs +9 -9
  191. package/fesm2022/ngwr-editor.mjs +3 -3
  192. package/fesm2022/ngwr-empty.mjs +3 -3
  193. package/fesm2022/ngwr-event-calendar.mjs +6 -6
  194. package/fesm2022/ngwr-file-upload.mjs +3 -3
  195. package/fesm2022/ngwr-form.mjs +9 -9
  196. package/fesm2022/ngwr-graph.mjs +6 -6
  197. package/fesm2022/ngwr-hotkey.mjs +6 -6
  198. package/fesm2022/ngwr-i18n-ar.mjs +90 -4
  199. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  200. package/fesm2022/ngwr-i18n-cs.mjs +90 -4
  201. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  202. package/fesm2022/ngwr-i18n-de.mjs +90 -4
  203. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  204. package/fesm2022/ngwr-i18n-en.mjs +90 -4
  205. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  206. package/fesm2022/ngwr-i18n-es.mjs +90 -4
  207. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  208. package/fesm2022/ngwr-i18n-fr.mjs +90 -4
  209. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  210. package/fesm2022/ngwr-i18n-he.mjs +90 -4
  211. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  212. package/fesm2022/ngwr-i18n-hi.mjs +90 -4
  213. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  214. package/fesm2022/ngwr-i18n-id.mjs +90 -4
  215. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  216. package/fesm2022/ngwr-i18n-it.mjs +90 -4
  217. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  218. package/fesm2022/ngwr-i18n-ja.mjs +90 -4
  219. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  220. package/fesm2022/ngwr-i18n-ko.mjs +90 -4
  221. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  222. package/fesm2022/ngwr-i18n-nl.mjs +90 -4
  223. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  224. package/fesm2022/ngwr-i18n-pl.mjs +90 -4
  225. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  226. package/fesm2022/ngwr-i18n-pt.mjs +90 -4
  227. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  228. package/fesm2022/ngwr-i18n-ru.mjs +90 -4
  229. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  230. package/fesm2022/ngwr-i18n-sv.mjs +90 -4
  231. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  232. package/fesm2022/ngwr-i18n-tr.mjs +90 -4
  233. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  234. package/fesm2022/ngwr-i18n-uk.mjs +90 -4
  235. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  236. package/fesm2022/ngwr-i18n-vi.mjs +90 -4
  237. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  238. package/fesm2022/ngwr-i18n-zh-tw.mjs +90 -4
  239. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  240. package/fesm2022/ngwr-i18n-zh.mjs +90 -4
  241. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  242. package/fesm2022/ngwr-i18n.mjs +9 -9
  243. package/fesm2022/ngwr-icon.mjs +6 -6
  244. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  245. package/fesm2022/ngwr-input-number.mjs +3 -3
  246. package/fesm2022/ngwr-input-otp.mjs +3 -3
  247. package/fesm2022/ngwr-input.mjs +15 -15
  248. package/fesm2022/ngwr-keyboard.mjs +3 -3
  249. package/fesm2022/ngwr-knob.mjs +3 -3
  250. package/fesm2022/ngwr-layout.mjs +15 -15
  251. package/fesm2022/ngwr-lightbox.mjs +5 -5
  252. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  253. package/fesm2022/ngwr-list.mjs +8 -8
  254. package/fesm2022/ngwr-list.mjs.map +1 -1
  255. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  256. package/fesm2022/ngwr-mention.mjs +6 -6
  257. package/fesm2022/ngwr-meta.mjs +6 -6
  258. package/fesm2022/ngwr-overlay.mjs +6 -6
  259. package/fesm2022/ngwr-page-header.mjs +3 -3
  260. package/fesm2022/ngwr-pagination.mjs +3 -3
  261. package/fesm2022/ngwr-pipes.mjs +21 -21
  262. package/fesm2022/ngwr-platform.mjs +6 -6
  263. package/fesm2022/ngwr-popconfirm.mjs +6 -6
  264. package/fesm2022/ngwr-popover.mjs +43 -20
  265. package/fesm2022/ngwr-popover.mjs.map +1 -1
  266. package/fesm2022/ngwr-progress.mjs +3 -3
  267. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  268. package/fesm2022/ngwr-qr.mjs +4 -3
  269. package/fesm2022/ngwr-qr.mjs.map +1 -1
  270. package/fesm2022/ngwr-radio.mjs +6 -6
  271. package/fesm2022/ngwr-rating.mjs +3 -3
  272. package/fesm2022/ngwr-result.mjs +12 -12
  273. package/fesm2022/ngwr-schema-form.mjs +3 -3
  274. package/fesm2022/ngwr-scroll.mjs +3 -3
  275. package/fesm2022/ngwr-segmented.mjs +3 -3
  276. package/fesm2022/ngwr-select.mjs +12 -12
  277. package/fesm2022/ngwr-sidebar.mjs +3 -3
  278. package/fesm2022/ngwr-skeleton.mjs +3 -3
  279. package/fesm2022/ngwr-slider.mjs +3 -3
  280. package/fesm2022/ngwr-sortable-list.mjs +11 -11
  281. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  282. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  283. package/fesm2022/ngwr-spinner.mjs +3 -3
  284. package/fesm2022/ngwr-splitter.mjs +3 -3
  285. package/fesm2022/ngwr-statistic.mjs +9 -9
  286. package/fesm2022/ngwr-stepper.mjs +6 -6
  287. package/fesm2022/ngwr-storage.mjs +3 -3
  288. package/fesm2022/ngwr-switch.mjs +3 -3
  289. package/fesm2022/ngwr-table.mjs +18 -18
  290. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  291. package/fesm2022/ngwr-tabs.mjs +6 -6
  292. package/fesm2022/ngwr-textarea.mjs +3 -3
  293. package/fesm2022/ngwr-theme.mjs +3 -3
  294. package/fesm2022/ngwr-timeline.mjs +6 -6
  295. package/fesm2022/ngwr-toast-testing.mjs +2 -1
  296. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  297. package/fesm2022/ngwr-toast.mjs +34 -15
  298. package/fesm2022/ngwr-toast.mjs.map +1 -1
  299. package/fesm2022/ngwr-toolbar.mjs +3 -3
  300. package/fesm2022/ngwr-tour.mjs +6 -6
  301. package/fesm2022/ngwr-transfer.mjs +3 -3
  302. package/fesm2022/ngwr-tree.mjs +3 -3
  303. package/fesm2022/ngwr-typography.mjs +3 -3
  304. package/fesm2022/ngwr-utils.mjs +31 -1
  305. package/fesm2022/ngwr-utils.mjs.map +1 -1
  306. package/fesm2022/ngwr-version.mjs +1 -1
  307. package/fesm2022/ngwr-version.mjs.map +1 -1
  308. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  309. package/fesm2022/ngwr-window-testing.mjs +61 -5
  310. package/fesm2022/ngwr-window-testing.mjs.map +1 -1
  311. package/fesm2022/ngwr-window.mjs +1538 -895
  312. package/fesm2022/ngwr-window.mjs.map +1 -1
  313. package/fesm2022/ngwr.mjs.map +1 -1
  314. package/i18n/ar.json +84 -4
  315. package/i18n/cs.json +84 -4
  316. package/i18n/de.json +84 -4
  317. package/i18n/en.json +84 -4
  318. package/i18n/es.json +84 -4
  319. package/i18n/fr.json +84 -4
  320. package/i18n/he.json +84 -4
  321. package/i18n/hi.json +84 -4
  322. package/i18n/id.json +84 -4
  323. package/i18n/it.json +84 -4
  324. package/i18n/ja.json +84 -4
  325. package/i18n/ko.json +84 -4
  326. package/i18n/nl.json +84 -4
  327. package/i18n/pl.json +84 -4
  328. package/i18n/pt.json +84 -4
  329. package/i18n/ru.json +84 -4
  330. package/i18n/sv.json +84 -4
  331. package/i18n/tr.json +84 -4
  332. package/i18n/uk.json +84 -4
  333. package/i18n/vi.json +84 -4
  334. package/i18n/zh-TW.json +84 -4
  335. package/i18n/zh.json +84 -4
  336. package/llms-full.txt +266 -9
  337. package/llms.txt +30 -7
  338. package/mcp/api.js +69 -1
  339. package/mcp/catalog.js +10 -1
  340. package/mcp/server.js +15 -1
  341. package/mcp/tools.js +122 -26
  342. package/package.json +132 -1
  343. package/popover/styles/_index.scss +75 -7
  344. package/schematics/component-style/index.js +3 -0
  345. package/schematics/migrations/v15/index.js +3 -26
  346. package/schematics/ng-add/index.js +2 -2
  347. package/schematics/use/symbol-map.json +14 -0
  348. package/schematics/utility/global-styles.js +19 -4
  349. package/schematics/utility/v15-moves.js +55 -0
  350. package/skills/ngwr/SKILL.md +8 -2
  351. package/skills/ngwr/references/catalog.md +28 -0
  352. package/skills/ngwr/references/setup.md +5 -4
  353. package/theme/styles/_focus.scss +8 -0
  354. package/toast/styles/_index.scss +103 -12
  355. package/types/ngwr-bits-aurora.d.ts +11 -0
  356. package/types/ngwr-bits-border-glow-testing.d.ts +5 -6
  357. package/types/ngwr-bits-border-glow.d.ts +5 -1
  358. package/types/ngwr-bits-dot-grid-testing.d.ts +92 -0
  359. package/types/ngwr-bits-dot-grid.d.ts +158 -0
  360. package/types/ngwr-bits-iridescence-testing.d.ts +85 -0
  361. package/types/ngwr-bits-iridescence.d.ts +244 -0
  362. package/types/ngwr-bits-ripple-grid-testing.d.ts +96 -0
  363. package/types/ngwr-bits-ripple-grid.d.ts +294 -0
  364. package/types/ngwr-bits-splash-cursor.d.ts +0 -1
  365. package/types/ngwr-bits-spotlight-card-testing.d.ts +3 -1
  366. package/types/ngwr-bits-star-border-testing.d.ts +7 -7
  367. package/types/ngwr-bits-threads-testing.d.ts +97 -0
  368. package/types/ngwr-bits-threads.d.ts +216 -0
  369. package/types/ngwr-bits-waves-testing.d.ts +1 -1
  370. package/types/ngwr-bits-waves.d.ts +20 -3
  371. package/types/ngwr-charts-bar-chart-testing.d.ts +193 -14
  372. package/types/ngwr-charts-bar-chart.d.ts +546 -38
  373. package/types/ngwr-charts-boxplot-chart-testing.d.ts +165 -0
  374. package/types/ngwr-charts-boxplot-chart.d.ts +308 -0
  375. package/types/ngwr-charts-bullet-chart-testing.d.ts +99 -0
  376. package/types/ngwr-charts-bullet-chart.d.ts +262 -0
  377. package/types/ngwr-charts-calendar-heatmap-testing.d.ts +32 -1
  378. package/types/ngwr-charts-calendar-heatmap.d.ts +55 -6
  379. package/types/ngwr-charts-candlestick-chart-testing.d.ts +135 -0
  380. package/types/ngwr-charts-candlestick-chart.d.ts +361 -0
  381. package/types/ngwr-charts-chart-legend-testing.d.ts +84 -0
  382. package/types/ngwr-charts-chart-legend.d.ts +178 -0
  383. package/types/ngwr-charts-core.d.ts +391 -0
  384. package/types/ngwr-charts-donut-chart-testing.d.ts +28 -5
  385. package/types/ngwr-charts-donut-chart.d.ts +124 -12
  386. package/types/ngwr-charts-funnel-chart-testing.d.ts +130 -0
  387. package/types/ngwr-charts-funnel-chart.d.ts +296 -0
  388. package/types/ngwr-charts-gauge-testing.d.ts +5 -0
  389. package/types/ngwr-charts-gauge.d.ts +6 -4
  390. package/types/ngwr-charts-heatmap-chart-testing.d.ts +148 -0
  391. package/types/ngwr-charts-heatmap-chart.d.ts +359 -0
  392. package/types/ngwr-charts-line-chart-testing.d.ts +72 -11
  393. package/types/ngwr-charts-line-chart.d.ts +291 -67
  394. package/types/ngwr-charts-meter-group-testing.d.ts +16 -2
  395. package/types/ngwr-charts-meter-group.d.ts +71 -11
  396. package/types/ngwr-charts-radar-chart-testing.d.ts +162 -0
  397. package/types/ngwr-charts-radar-chart.d.ts +461 -0
  398. package/types/ngwr-charts-scatter-chart-testing.d.ts +147 -0
  399. package/types/ngwr-charts-scatter-chart.d.ts +396 -0
  400. package/types/ngwr-charts-sparkline-testing.d.ts +4 -1
  401. package/types/ngwr-charts-sparkline.d.ts +8 -6
  402. package/types/ngwr-charts-treemap-chart-testing.d.ts +131 -0
  403. package/types/ngwr-charts-treemap-chart.d.ts +295 -0
  404. package/types/ngwr-charts-waterfall-chart-testing.d.ts +149 -0
  405. package/types/ngwr-charts-waterfall-chart.d.ts +338 -0
  406. package/types/ngwr-color-picker.d.ts +0 -21
  407. package/types/ngwr-dropdown.d.ts +0 -52
  408. package/types/ngwr-editor.d.ts +2 -84
  409. package/types/ngwr-i18n.d.ts +0 -15
  410. package/types/ngwr-mention.d.ts +0 -13
  411. package/types/ngwr-popconfirm.d.ts +0 -33
  412. package/types/ngwr-popover.d.ts +29 -53
  413. package/types/ngwr-toast-testing.d.ts +6 -1
  414. package/types/ngwr-tour.d.ts +0 -2
  415. package/types/ngwr-utils.d.ts +49 -7
  416. package/types/ngwr-version.d.ts +1 -1
  417. package/types/ngwr-window-testing.d.ts +65 -7
  418. package/types/ngwr-window.d.ts +831 -207
  419. package/types/ngwr.d.ts +1 -0
  420. package/window/styles/_index.scss +528 -82
@@ -1,7 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
- import { Component, LOCALE_ID, ViewEncapsulation, computed, inject, input, viewChild } from "@angular/core";
2
+ import { Component, ViewEncapsulation, computed, input, model, viewChild } from "@angular/core";
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
4
  import { useI18nText } from "ngwr/i18n";
5
+ import { WR_CHART_LEGEND_BLOCK, WrChartLegend } from "ngwr/charts/chart-legend";
6
+ import { chartColor, useChartNumbers } from "ngwr/charts/core";
5
7
  import { useChartTooltip } from "ngwr/popover";
6
8
  /**
7
9
  * @license
@@ -12,17 +14,14 @@ import { useChartTooltip } from "ngwr/popover";
12
14
  function weight(value) {
13
15
  return Number.isFinite(value) ? Math.max(0, value) : 0;
14
16
  }
15
- const FALLBACK_COLORS = [
16
- "var(--wr-color-primary)",
17
- "var(--wr-color-success)",
18
- "var(--wr-color-warning)",
19
- "var(--wr-color-danger)",
20
- "var(--wr-color-on-surface-muted)"
21
- ];
17
+ const HIT_PX = 12;
18
+ const MAX_HIT_ANGLE = Math.PI / 12;
22
19
  var WrDonutChart = class WrDonutChart {
23
20
  segments = input([], ...ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []);
24
21
  ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
25
- resolvedAriaLabel = useI18nText(this.ariaLabel, "donutChart.label", "Donut chart");
22
+ donutLabel = useI18nText(this.ariaLabel, "donutChart.label", "Donut chart");
23
+ pieLabel = useI18nText(this.ariaLabel, "donutChart.pieLabel", "Pie chart");
24
+ resolvedAriaLabel = computed(() => this.pie() ? this.pieLabel() : this.donutLabel(), ...ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []);
26
25
  size = input(200, {
27
26
  ...ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {},
28
27
  transform: (v) => Math.max(48, coerceNumberProperty(v, 200))
@@ -31,56 +30,137 @@ var WrDonutChart = class WrDonutChart {
31
30
  ...ngDevMode ? { debugName: "thickness" } : /* istanbul ignore next */ {},
32
31
  transform: (v) => Math.min(100, Math.max(0, coerceNumberProperty(v, 30)))
33
32
  });
33
+ pie = input(false, {
34
+ ...ngDevMode ? { debugName: "pie" } : /* istanbul ignore next */ {},
35
+ transform: coerceBooleanProperty
36
+ });
34
37
  showLegend = input(true, {
35
38
  ...ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {},
36
39
  transform: coerceBooleanProperty
37
40
  });
41
+ toggleableLegend = input(false, {
42
+ ...ngDevMode ? { debugName: "toggleableLegend" } : /* istanbul ignore next */ {},
43
+ transform: coerceBooleanProperty
44
+ });
45
+ hiddenSegments = model([], ...ngDevMode ? [{ debugName: "hiddenSegments" }] : /* istanbul ignore next */ []);
38
46
  centerValue = input("", ...ngDevMode ? [{ debugName: "centerValue" }] : /* istanbul ignore next */ []);
39
47
  centerLabel = input("", ...ngDevMode ? [{ debugName: "centerLabel" }] : /* istanbul ignore next */ []);
48
+ showCenter = computed(() => !this.pie() && (!!this.centerValue() || !!this.centerLabel()), ...ngDevMode ? [{ debugName: "showCenter" }] : /* istanbul ignore next */ []);
40
49
  tooltip = input(true, {
41
50
  ...ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {},
42
51
  transform: coerceBooleanProperty
43
52
  });
44
53
  valueFormat = input(null, ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
45
- locale = inject(LOCALE_ID);
46
- numbers = new Intl.NumberFormat(this.locale);
47
- smallNumbers = new Intl.NumberFormat(this.locale, { maximumSignificantDigits: 3 });
48
- formatValue(value) {
49
- const custom = this.valueFormat();
50
- if (custom) return custom(value);
51
- return (value !== 0 && Math.abs(value) < 1 ? this.smallNumbers : this.numbers).format(value);
52
- }
54
+ numbers = useChartNumbers(this.valueFormat);
55
+ hidden = computed(() => new Set(this.hiddenSegments()), ...ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []);
53
56
  svg = viewChild("svg", ...ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []);
54
57
  outerR = 50;
55
58
  innerR = computed(() => {
56
59
  const thickness = this.thickness();
57
- if (thickness === 0) return 0;
60
+ if (this.pie() || thickness === 0) return 0;
58
61
  return this.outerR * (1 - thickness / 100);
59
62
  }, ...ngDevMode ? [{ debugName: "innerR" }] : /* istanbul ignore next */ []);
60
63
  total = computed(() => {
61
- const sum = this.segments().reduce((acc, s) => acc + weight(s.value), 0);
64
+ const hidden = this.hidden();
65
+ const sum = this.segments().reduce((acc, s, i) => acc + (hidden.has(i) ? 0 : weight(s.value)), 0);
62
66
  return sum > 0 ? sum : 1;
63
67
  }, ...ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []);
64
68
  slices = computed(() => {
65
69
  const total = this.total();
70
+ const hidden = this.hidden();
66
71
  const origin = -Math.PI / 2;
67
72
  let cumulative = 0;
68
73
  return this.segments().map((s, i) => {
69
74
  const value = weight(s.value);
75
+ const isHidden = hidden.has(i);
76
+ const share = isHidden ? 0 : value;
70
77
  const startAngle = origin + cumulative / total * Math.PI * 2;
71
- cumulative += value;
78
+ cumulative += share;
72
79
  const endAngle = origin + cumulative / total * Math.PI * 2;
73
80
  return {
74
81
  label: s.label,
75
82
  value,
76
- text: this.formatValue(value),
77
- color: s.color ?? FALLBACK_COLORS[i % FALLBACK_COLORS.length],
78
- path: this.arcPath(startAngle, endAngle),
79
- percent: value / total * 100,
83
+ text: Number.isFinite(s.value) ? this.numbers.value(s.value) : "",
84
+ color: s.color ?? chartColor(i),
85
+ hidden: isHidden,
86
+ path: isHidden ? "" : this.arcPath(startAngle, endAngle),
87
+ percent: share / total * 100,
88
+ startAngle,
89
+ endAngle,
80
90
  midAngle: (startAngle + endAngle) / 2
81
91
  };
82
92
  });
83
93
  }, ...ngDevMode ? [{ debugName: "slices" }] : /* istanbul ignore next */ []);
94
+ hits = computed(() => {
95
+ if (!this.pie() || !this.tooltip()) return [];
96
+ const min = Math.min(MAX_HIT_ANGLE, HIT_PX / (this.size() / 2));
97
+ const drawn = this.slices().map((slice, index) => ({
98
+ index,
99
+ start: slice.startAngle,
100
+ end: slice.endAngle
101
+ })).filter((slice) => slice.end - slice.start > 0);
102
+ const count = drawn.length;
103
+ if (count < 2) return [];
104
+ const width = drawn.map((slice) => slice.end - slice.start);
105
+ const thin = width.map((w) => w < min);
106
+ const prev = (k) => (k - 1 + count) % count;
107
+ const next = (k) => (k + 1) % count;
108
+ const spare = width.map((w, k) => thin[k] ? 0 : w - min);
109
+ const ask = width.map((w, k) => {
110
+ if (!thin[k]) return {
111
+ before: 0,
112
+ after: 0
113
+ };
114
+ const before = !thin[prev(k)];
115
+ const after = !thin[next(k)];
116
+ const share = (min - w) / (before && after ? 2 : 1);
117
+ return {
118
+ before: before ? share : 0,
119
+ after: after ? share : 0
120
+ };
121
+ });
122
+ const reach = width.map(() => ({
123
+ before: 0,
124
+ after: 0
125
+ }));
126
+ width.forEach((_, j) => {
127
+ if (thin[j]) return;
128
+ const fromBefore = thin[prev(j)] ? ask[prev(j)].after : 0;
129
+ const fromAfter = thin[next(j)] ? ask[next(j)].before : 0;
130
+ const claims = (fromBefore > 0 ? 1 : 0) + (fromAfter > 0 ? 1 : 0);
131
+ if (claims === 0) return;
132
+ const fair = spare[j] / claims;
133
+ const toBefore = Math.min(fromBefore, Math.max(fair, spare[j] - fromAfter));
134
+ const toAfter = Math.min(fromAfter, Math.max(fair, spare[j] - fromBefore));
135
+ if (toBefore > 0) reach[prev(j)].after = toBefore;
136
+ if (toAfter > 0) reach[next(j)].before = toAfter;
137
+ spare[j] = Math.max(0, spare[j] - toBefore - toAfter);
138
+ });
139
+ width.forEach((w, k) => {
140
+ if (!thin[k]) return;
141
+ let short = min - w - reach[k].before - reach[k].after;
142
+ for (const [side, j] of [["before", prev(k)], ["after", next(k)]]) {
143
+ if (short <= 0 || thin[j]) continue;
144
+ const more = Math.min(short, spare[j]);
145
+ reach[k][side] += more;
146
+ spare[j] -= more;
147
+ short -= more;
148
+ }
149
+ });
150
+ return drawn.flatMap((slice, k) => {
151
+ const { before, after } = reach[k];
152
+ if (!thin[k] || before + after <= 0) return [];
153
+ return [{
154
+ index: slice.index,
155
+ path: this.arcPath(slice.start - before, slice.end + after)
156
+ }];
157
+ });
158
+ }, ...ngDevMode ? [{ debugName: "hits" }] : /* istanbul ignore next */ []);
159
+ legendItems = computed(() => this.slices().map(({ label, color, text }) => ({
160
+ label,
161
+ color,
162
+ value: text === "" ? null : text
163
+ })), ...ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []);
84
164
  tip = useChartTooltip(this.tooltip, (index) => {
85
165
  const slice = this.slices()[index];
86
166
  const svg = this.svg()?.nativeElement;
@@ -138,7 +218,7 @@ var WrDonutChart = class WrDonutChart {
138
218
  }
139
219
  static ɵfac = i0.ɵɵngDeclareFactory({
140
220
  minVersion: "12.0.0",
141
- version: "22.2.3",
221
+ version: "22.2.4",
142
222
  ngImport: i0,
143
223
  type: WrDonutChart,
144
224
  deps: [],
@@ -146,7 +226,7 @@ var WrDonutChart = class WrDonutChart {
146
226
  });
147
227
  static ɵcmp = i0.ɵɵngDeclareComponent({
148
228
  minVersion: "17.0.0",
149
- version: "22.2.3",
229
+ version: "22.2.4",
150
230
  type: WrDonutChart,
151
231
  isStandalone: true,
152
232
  selector: "wr-donut-chart",
@@ -179,6 +259,13 @@ var WrDonutChart = class WrDonutChart {
179
259
  isRequired: false,
180
260
  transformFunction: null
181
261
  },
262
+ pie: {
263
+ classPropertyName: "pie",
264
+ publicName: "pie",
265
+ isSignal: true,
266
+ isRequired: false,
267
+ transformFunction: null
268
+ },
182
269
  showLegend: {
183
270
  classPropertyName: "showLegend",
184
271
  publicName: "showLegend",
@@ -186,6 +273,20 @@ var WrDonutChart = class WrDonutChart {
186
273
  isRequired: false,
187
274
  transformFunction: null
188
275
  },
276
+ toggleableLegend: {
277
+ classPropertyName: "toggleableLegend",
278
+ publicName: "toggleableLegend",
279
+ isSignal: true,
280
+ isRequired: false,
281
+ transformFunction: null
282
+ },
283
+ hiddenSegments: {
284
+ classPropertyName: "hiddenSegments",
285
+ publicName: "hiddenSegments",
286
+ isSignal: true,
287
+ isRequired: false,
288
+ transformFunction: null
289
+ },
189
290
  centerValue: {
190
291
  classPropertyName: "centerValue",
191
292
  publicName: "centerValue",
@@ -215,7 +316,11 @@ var WrDonutChart = class WrDonutChart {
215
316
  transformFunction: null
216
317
  }
217
318
  },
218
- host: { classAttribute: "wr-donut-chart" },
319
+ outputs: { hiddenSegments: "hiddenSegmentsChange" },
320
+ host: {
321
+ properties: { "class.wr-donut-chart--pie": "pie()" },
322
+ classAttribute: "wr-donut-chart"
323
+ },
219
324
  viewQueries: [{
220
325
  propertyName: "svg",
221
326
  first: true,
@@ -224,13 +329,29 @@ var WrDonutChart = class WrDonutChart {
224
329
  isSignal: true
225
330
  }],
226
331
  ngImport: i0,
227
- template: "<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <!-- Every slice is stroked in the SURFACE colour, so adjacent arcs are\n separated by a visible gap rather than by the boundary between two\n fills. Without it the only thing dividing two slices is the colour\n change itself, and the default palette's entries sit within about\n 1.06:1 of each other in relative luminance — for a reader who cannot\n separate hue, two neighbours merge into one arc and the chart reads as\n having fewer slices than it has. A gap is a shape, and it survives\n greyscale, printing and a monochrome display. -->\n @for (slice of slices(); track $index) {\n <path\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n stroke=\"var(--wr-color-surface)\"\n stroke-width=\"1\"\n stroke-linejoin=\"round\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n </svg>\n @if (centerValue() || centerLabel()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend() && slices().length > 0) {\n <ul class=\"wr-donut-chart__legend\">\n @for (slice of slices(); track $index) {\n <li class=\"wr-donut-chart__legend-item\">\n <span class=\"wr-donut-chart__swatch\" [style.background]=\"slice.color\"></span>\n <span class=\"wr-donut-chart__legend-label\">{{ slice.label }}</span>\n <span class=\"wr-donut-chart__legend-value\">{{ slice.text }}</span>\n </li>\n }\n </ul>\n}\n",
332
+ template: "<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <!-- Every slice is stroked in the SURFACE colour (`--wr-donut-chart-slice-gap-color`,\n from the stylesheet), so adjacent arcs are separated by a visible gap rather than\n by the boundary between two fills. Without it the only thing dividing two slices\n is the colour change itself, and the default palette's entries sit within about\n 1.06:1 of each other in relative luminance — for a reader who cannot separate\n hue, two neighbours merge into one arc and the chart reads as having fewer slices\n than it has. A gap is a shape, and it survives greyscale, printing and a\n monochrome display. -->\n @for (slice of slices(); track $index) {\n <!-- A hidden slice draws nothing at all; the index stays the slice's own, which is\n what the tooltip looks it up by. -->\n @if (!slice.hidden) {\n <path\n class=\"wr-donut-chart__slice\"\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n stroke-width=\"1\"\n stroke-linejoin=\"round\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n }\n <!-- A sliver's wider hover target in a pie, filled with nothing: see `hits`, which is\n empty for the ring and with the tooltip off. Last, so it wins the pointer over the\n slices it reaches into; `fill`, so the unpainted stroke is not hit-tested and the\n edges stay where `hits` put them. -->\n @for (hit of hits(); track hit.index) {\n <path\n class=\"wr-donut-chart__hit\"\n [attr.d]=\"hit.path\"\n fill=\"none\"\n pointer-events=\"fill\"\n (mouseenter)=\"tip.enter(hit.index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n </svg>\n <!-- Never with `pie`: a pie has no hole to print in. -->\n @if (showCenter()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend() && slices().length > 0) {\n <!-- The key is `aria-hidden`: the row's text is its name, and the dot carries no word\n of its own. -->\n <ul\n wr-chart-legend\n class=\"wr-donut-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSegments\"\n ></ul>\n}\n",
333
+ dependencies: [{
334
+ kind: "component",
335
+ type: WrChartLegend,
336
+ selector: "ul[wr-chart-legend]",
337
+ inputs: [
338
+ "items",
339
+ "toggleable",
340
+ "hiddenSeries",
341
+ "ariaLabel"
342
+ ],
343
+ outputs: ["hiddenSeriesChange", "toggled"]
344
+ }],
345
+ viewProviders: [{
346
+ provide: WR_CHART_LEGEND_BLOCK,
347
+ useValue: "wr-donut-chart"
348
+ }],
228
349
  encapsulation: i0.ViewEncapsulation.None
229
350
  });
230
351
  };
231
352
  i0.ɵɵngDeclareClassMetadata({
232
353
  minVersion: "12.0.0",
233
- version: "22.2.3",
354
+ version: "22.2.4",
234
355
  ngImport: i0,
235
356
  type: WrDonutChart,
236
357
  decorators: [{
@@ -238,8 +359,16 @@ i0.ɵɵngDeclareClassMetadata({
238
359
  args: [{
239
360
  selector: "wr-donut-chart",
240
361
  encapsulation: ViewEncapsulation.None,
241
- host: { class: "wr-donut-chart" },
242
- template: "<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <!-- Every slice is stroked in the SURFACE colour, so adjacent arcs are\n separated by a visible gap rather than by the boundary between two\n fills. Without it the only thing dividing two slices is the colour\n change itself, and the default palette's entries sit within about\n 1.06:1 of each other in relative luminance — for a reader who cannot\n separate hue, two neighbours merge into one arc and the chart reads as\n having fewer slices than it has. A gap is a shape, and it survives\n greyscale, printing and a monochrome display. -->\n @for (slice of slices(); track $index) {\n <path\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n stroke=\"var(--wr-color-surface)\"\n stroke-width=\"1\"\n stroke-linejoin=\"round\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n </svg>\n @if (centerValue() || centerLabel()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend() && slices().length > 0) {\n <ul class=\"wr-donut-chart__legend\">\n @for (slice of slices(); track $index) {\n <li class=\"wr-donut-chart__legend-item\">\n <span class=\"wr-donut-chart__swatch\" [style.background]=\"slice.color\"></span>\n <span class=\"wr-donut-chart__legend-label\">{{ slice.label }}</span>\n <span class=\"wr-donut-chart__legend-value\">{{ slice.text }}</span>\n </li>\n }\n </ul>\n}\n"
362
+ host: {
363
+ class: "wr-donut-chart",
364
+ "[class.wr-donut-chart--pie]": "pie()"
365
+ },
366
+ imports: [WrChartLegend],
367
+ viewProviders: [{
368
+ provide: WR_CHART_LEGEND_BLOCK,
369
+ useValue: "wr-donut-chart"
370
+ }],
371
+ template: "<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <!-- Every slice is stroked in the SURFACE colour (`--wr-donut-chart-slice-gap-color`,\n from the stylesheet), so adjacent arcs are separated by a visible gap rather than\n by the boundary between two fills. Without it the only thing dividing two slices\n is the colour change itself, and the default palette's entries sit within about\n 1.06:1 of each other in relative luminance — for a reader who cannot separate\n hue, two neighbours merge into one arc and the chart reads as having fewer slices\n than it has. A gap is a shape, and it survives greyscale, printing and a\n monochrome display. -->\n @for (slice of slices(); track $index) {\n <!-- A hidden slice draws nothing at all; the index stays the slice's own, which is\n what the tooltip looks it up by. -->\n @if (!slice.hidden) {\n <path\n class=\"wr-donut-chart__slice\"\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n stroke-width=\"1\"\n stroke-linejoin=\"round\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n }\n <!-- A sliver's wider hover target in a pie, filled with nothing: see `hits`, which is\n empty for the ring and with the tooltip off. Last, so it wins the pointer over the\n slices it reaches into; `fill`, so the unpainted stroke is not hit-tested and the\n edges stay where `hits` put them. -->\n @for (hit of hits(); track hit.index) {\n <path\n class=\"wr-donut-chart__hit\"\n [attr.d]=\"hit.path\"\n fill=\"none\"\n pointer-events=\"fill\"\n (mouseenter)=\"tip.enter(hit.index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n </svg>\n <!-- Never with `pie`: a pie has no hole to print in. -->\n @if (showCenter()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend() && slices().length > 0) {\n <!-- The key is `aria-hidden`: the row's text is its name, and the dot carries no word\n of its own. -->\n <ul\n wr-chart-legend\n class=\"wr-donut-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSegments\"\n ></ul>\n}\n"
243
372
  }]
244
373
  }],
245
374
  propDecorators: {
@@ -275,6 +404,14 @@ i0.ɵɵngDeclareClassMetadata({
275
404
  required: false
276
405
  }]
277
406
  }],
407
+ pie: [{
408
+ type: i0.Input,
409
+ args: [{
410
+ isSignal: true,
411
+ alias: "pie",
412
+ required: false
413
+ }]
414
+ }],
278
415
  showLegend: [{
279
416
  type: i0.Input,
280
417
  args: [{
@@ -283,6 +420,25 @@ i0.ɵɵngDeclareClassMetadata({
283
420
  required: false
284
421
  }]
285
422
  }],
423
+ toggleableLegend: [{
424
+ type: i0.Input,
425
+ args: [{
426
+ isSignal: true,
427
+ alias: "toggleableLegend",
428
+ required: false
429
+ }]
430
+ }],
431
+ hiddenSegments: [{
432
+ type: i0.Input,
433
+ args: [{
434
+ isSignal: true,
435
+ alias: "hiddenSegments",
436
+ required: false
437
+ }]
438
+ }, {
439
+ type: i0.Output,
440
+ args: ["hiddenSegmentsChange"]
441
+ }],
286
442
  centerValue: [{
287
443
  type: i0.Input,
288
444
  args: [{
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-charts-donut-chart.mjs","names":[],"sources":["../../../projects/lib/charts/donut-chart/donut-chart.ts","../../../projects/lib/charts/donut-chart/donut-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 type ElementRef,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n inject,\n input,\n viewChild,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip } from 'ngwr/popover';\n\nimport type { WrDonutSegment } from './types';\n\n/**\n * A segment's contribution to the ring. `Math.max(0, NaN)` is NaN, and the running total\n * carries it forward — so one non-finite datum used to take out its own arc AND every arc\n * after it, writing the literal text `NaN` into the path `d`.\n */\nfunction weight(value: number): number {\n return Number.isFinite(value) ? Math.max(0, value) : 0;\n}\n\n/**\n * Default series colours, in order.\n *\n * Four intents and the neutral role, and `info` is deliberately absent: it is the\n * same blue as `primary` to every reader (1.061:1 apart in light, 1.004:1 in\n * dark, and the same hue), so two adjacent series would be one series with a\n * seam. The neutral closes the list because it is the one tone here that no\n * intent is near — it used to be the `medium` intent, which v15 removed, and the\n * role resolves to the same step of the gray ramp.\n */\nconst FALLBACK_COLORS = [\n 'var(--wr-color-primary)',\n 'var(--wr-color-success)',\n 'var(--wr-color-warning)',\n 'var(--wr-color-danger)',\n 'var(--wr-color-on-surface-muted)',\n];\n\n/**\n * Donut chart. Set `thickness` to 0 for a solid pie. Optional center\n * text via inputs.\n *\n * @example\n * ```html\n * <wr-donut-chart [segments]=\"[\n * { label: 'Used', value: 60 },\n * { label: 'Free', value: 40 }\n * ]\" centerLabel=\"Disk\" centerValue=\"60%\" />\n * ```\n *\n * @see https://ngwr.dev/charts/donut-chart\n */\n@Component({\n selector: 'wr-donut-chart',\n templateUrl: './donut-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-donut-chart' },\n})\nexport class WrDonutChart {\n /**\n * The slices, drawn clockwise from twelve o'clock. A segment with no `color`\n * takes the next entry from the chart's fallback palette.\n */\n readonly segments = input<readonly WrDonutSegment[]>([]);\n\n /**\n * Accessible name of the drawing. The arcs carry no text and the legend is optional, so\n * with `showLegend: false` this and the centre text are the whole of what a screen reader\n * gets. Falls back to `donutChart.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'donutChart.label', 'Donut chart');\n\n /** Diameter in CSS pixels. @default 200 */\n readonly size = input(200, { transform: (v: unknown): number => Math.max(48, coerceNumberProperty(v, 200)) });\n\n /** Inner-ring thickness as a percent of radius (0–100). `0` = solid pie. @default 30 */\n readonly thickness = input(30, {\n transform: (v: unknown): number => Math.min(100, Math.max(0, coerceNumberProperty(v, 30))),\n });\n\n /** Show the legend under the chart. @default true */\n readonly showLegend = input(true, { transform: coerceBooleanProperty });\n\n /** Bold value text in the center. */\n readonly centerValue = input<string>('');\n\n /** Smaller label under the value. */\n readonly centerLabel = input<string>('');\n\n /**\n * Show a tooltip with the slice's label and value on hover. Pointer only — the\n * legend prints the same numbers, and with `showLegend` off `ariaLabel` is where\n * to say them. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Writes every value in the legend and the tooltip. `null` uses `Intl.NumberFormat`\n * in `LOCALE_ID`. The centre text is printed as given.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n private readonly locale = inject(LOCALE_ID);\n private readonly numbers = new Intl.NumberFormat(this.locale);\n /** Below one, by significant digits, which keep 0.0004 from rounding to `0`. */\n private readonly smallNumbers = new Intl.NumberFormat(this.locale, { maximumSignificantDigits: 3 });\n\n private formatValue(value: number): string {\n const custom = this.valueFormat();\n if (custom) return custom(value);\n return (value !== 0 && Math.abs(value) < 1 ? this.smallNumbers : this.numbers).format(value);\n }\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n // Drawn in a 100×100 viewBox.\n private readonly outerR = 50;\n\n protected readonly innerR = computed(() => {\n const thickness = this.thickness();\n // 0 = solid pie: fill all the way to the center, not a zero-width ring.\n if (thickness === 0) return 0;\n return this.outerR * (1 - thickness / 100);\n });\n\n protected readonly total = computed(() => {\n const sum = this.segments().reduce((acc, s) => acc + weight(s.value), 0);\n return sum > 0 ? sum : 1;\n });\n\n /**\n * Resolved slices ready for the template — each carries its arc path.\n *\n * Angles are in the drawing's own frame, where 0 is three o'clock and a positive\n * angle turns clockwise, because y runs downwards. The ring starts a quarter turn\n * back from there, at twelve o'clock, which is where the input's JSDoc always said\n * it started and where a reader looks for the first slice; it used to start at three.\n */\n protected readonly slices = computed(() => {\n const total = this.total();\n const origin = -Math.PI / 2;\n let cumulative = 0;\n return this.segments().map((s, i) => {\n const value = weight(s.value);\n const startAngle = origin + (cumulative / total) * Math.PI * 2;\n cumulative += value;\n const endAngle = origin + (cumulative / total) * Math.PI * 2;\n return {\n label: s.label,\n value,\n text: this.formatValue(value),\n color: s.color ?? FALLBACK_COLORS[i % FALLBACK_COLORS.length],\n path: this.arcPath(startAngle, endAngle),\n percent: (value / total) * 100,\n midAngle: (startAngle + endAngle) / 2,\n };\n });\n });\n\n /**\n * One tooltip for the whole chart, pointing at the hovered slice: at the middle of\n * its OUTER arc, on the side that part of the ring faces — above for a slice whose\n * middle is in the top quarter, below for the bottom one, beside it for the two at\n * three and nine o'clock. From there the chip sits clear of the ring, and the way\n * onto it runs straight out of the slice that opened it, over nothing else.\n *\n * Not the slice's `<path>` element: its box is most of the ring for any slice past\n * a quarter, so the chip would point at the middle of the chart. And not the middle\n * of the band: a chip there lies over the ring, under a pointer resting on it —\n * measured in Chromium, the inner half of a lower slice landed on its own chip. A\n * tiny slice keeps its own mid-angle, so the arrow says which sliver it is.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const slice = this.slices()[index];\n const svg = this.svg()?.nativeElement;\n if (!slice?.path || !svg) return null;\n const box = svg.getBoundingClientRect();\n // The drawing's y runs downwards, so a positive sine is the lower half.\n const cos = Math.cos(slice.midAngle);\n const sin = Math.sin(slice.midAngle);\n const side = Math.abs(cos) > Math.abs(sin) ? (cos > 0 ? 'right' : 'left') : sin > 0 ? 'bottom' : 'top';\n return {\n datum: { label: slice.label, value: slice.text, color: slice.color },\n anchor: {\n x: box.left + ((50 + this.outerR * cos) / 100) * box.width,\n y: box.top + ((50 + this.outerR * sin) / 100) * box.height,\n },\n side,\n };\n });\n\n // Helpers\n\n /** SVG path for one donut slice using outer and inner arcs. */\n private arcPath(start: number, end: number): string {\n const cx = 50;\n const cy = 50;\n const ro = this.outerR;\n const ri = this.innerR();\n const sweep = end - start;\n if (sweep <= 0) return '';\n // Full-circle slice — two halves so the arc can render.\n if (sweep >= Math.PI * 2 - 1e-6) {\n const path = [\n `M ${cx + ro} ${cy}`,\n `A ${ro} ${ro} 0 1 1 ${cx - ro} ${cy}`,\n `A ${ro} ${ro} 0 1 1 ${cx + ro} ${cy}`,\n ];\n if (ri > 0) {\n path.push(`M ${cx + ri} ${cy}`, `A ${ri} ${ri} 0 1 0 ${cx - ri} ${cy}`, `A ${ri} ${ri} 0 1 0 ${cx + ri} ${cy}`);\n }\n return path.join(' ');\n }\n const largeArc = sweep > Math.PI ? 1 : 0;\n const sox = cx + ro * Math.cos(start);\n const soy = cy + ro * Math.sin(start);\n const eox = cx + ro * Math.cos(end);\n const eoy = cy + ro * Math.sin(end);\n if (ri === 0) {\n return `M ${cx} ${cy} L ${sox.toFixed(2)} ${soy.toFixed(2)} A ${ro} ${ro} 0 ${largeArc} 1 ${eox.toFixed(2)} ${eoy.toFixed(2)} Z`;\n }\n const eix = cx + ri * Math.cos(end);\n const eiy = cy + ri * Math.sin(end);\n const six = cx + ri * Math.cos(start);\n const siy = cy + ri * Math.sin(start);\n return [\n `M ${sox.toFixed(2)} ${soy.toFixed(2)}`,\n `A ${ro} ${ro} 0 ${largeArc} 1 ${eox.toFixed(2)} ${eoy.toFixed(2)}`,\n `L ${eix.toFixed(2)} ${eiy.toFixed(2)}`,\n `A ${ri} ${ri} 0 ${largeArc} 0 ${six.toFixed(2)} ${siy.toFixed(2)}`,\n 'Z',\n ].join(' ');\n }\n}\n\nexport type { WrDonutSegment } from './types';\n","<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <!-- Every slice is stroked in the SURFACE colour, so adjacent arcs are\n separated by a visible gap rather than by the boundary between two\n fills. Without it the only thing dividing two slices is the colour\n change itself, and the default palette's entries sit within about\n 1.06:1 of each other in relative luminance — for a reader who cannot\n separate hue, two neighbours merge into one arc and the chart reads as\n having fewer slices than it has. A gap is a shape, and it survives\n greyscale, printing and a monochrome display. -->\n @for (slice of slices(); track $index) {\n <path\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n stroke=\"var(--wr-color-surface)\"\n stroke-width=\"1\"\n stroke-linejoin=\"round\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n </svg>\n @if (centerValue() || centerLabel()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend() && slices().length > 0) {\n <ul class=\"wr-donut-chart__legend\">\n @for (slice of slices(); track $index) {\n <li class=\"wr-donut-chart__legend-item\">\n <span class=\"wr-donut-chart__swatch\" [style.background]=\"slice.color\"></span>\n <span class=\"wr-donut-chart__legend-label\">{{ slice.label }}</span>\n <span class=\"wr-donut-chart__legend-value\">{{ slice.text }}</span>\n </li>\n }\n </ul>\n}\n"],"mappings":";;;;;;;;;;;AA6BA,SAAS,OAAO,OAAa;CAC3B,OAAO,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI;AACvD;AAYA,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;AACD;AAsBD,IAAa,eAAb,MAAa,aAAY;CAKd,WAAW,MAAiC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAO/C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,KAAK,WAAW,oBAAoB,aAAa;CAG3F,OAAO,MAAM,KAAG;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,KAAK,IAAI,IAAI,qBAAqB,GAAG,GAAG,CAAC;CAAC,CAAA;CAGjG,YAAY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GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,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,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,KAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-charts-donut-chart.mjs","names":[],"sources":["../../../projects/lib/charts/donut-chart/donut-chart.ts","../../../projects/lib/charts/donut-chart/donut-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 { Component, type ElementRef, ViewEncapsulation, computed, input, model, viewChild } from '@angular/core';\n\nimport { WR_CHART_LEGEND_BLOCK, WrChartLegend, type WrChartLegendItem } from 'ngwr/charts/chart-legend';\nimport { chartColor, useChartNumbers } from 'ngwr/charts/core';\nimport { useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip } from 'ngwr/popover';\n\nimport type { WrDonutSegment } from './types';\n\n/**\n * A segment's contribution to the ring. `Math.max(0, NaN)` is NaN, and the running total\n * carries it forward — so one non-finite datum used to take out its own arc AND every arc\n * after it, writing the literal text `NaN` into the path `d`.\n */\nfunction weight(value: number): number {\n return Number.isFinite(value) ? Math.max(0, value) : 0;\n}\n\n/**\n * How wide a slice's hover target is at least, along the outer edge, in CSS px. A\n * slice narrower than that — a share of a percent or two, which at the default 200px\n * is a few px of arc — is a target no pointer lands on, so it gets a wider one; see\n * `hits`.\n */\nconst HIT_PX = 12;\n\n/**\n * The widest that target may grow, in radians, whatever the chart's size: on a 48px\n * chart 12px of arc is a third of a quarter turn, which would take too much of the\n * slices beside it.\n */\nconst MAX_HIT_ANGLE = Math.PI / 12;\n\n/**\n * Donut chart, and with `pie` a pie chart. Optional center text via inputs.\n *\n * @example\n * ```html\n * <wr-donut-chart [segments]=\"[\n * { label: 'Used', value: 60 },\n * { label: 'Free', value: 40 }\n * ]\" centerLabel=\"Disk\" centerValue=\"60%\" />\n *\n * <wr-donut-chart [segments]=\"segments\" pie />\n * ```\n *\n * The legend is a `ul[wr-chart-legend]` (`ngwr/charts/chart-legend`), and with\n * `toggleableLegend` its rows show and hide their slices through `hiddenSegments`.\n *\n * @see https://ngwr.dev/charts/donut-chart\n */\n@Component({\n selector: 'wr-donut-chart',\n templateUrl: './donut-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-donut-chart', '[class.wr-donut-chart--pie]': 'pie()' },\n imports: [WrChartLegend],\n // The legend's rows keep the classes this chart drew before it drew them through\n // `WrChartLegend`: `.wr-donut-chart__legend-item`, `__swatch`, `__legend-label` and\n // `__legend-value`.\n viewProviders: [{ provide: WR_CHART_LEGEND_BLOCK, useValue: 'wr-donut-chart' }],\n})\nexport class WrDonutChart {\n /**\n * The slices, drawn clockwise from twelve o'clock. A segment with no `color`\n * takes the next entry from the chart's fallback palette.\n */\n readonly segments = input<readonly WrDonutSegment[]>([]);\n\n /**\n * Accessible name of the drawing. The arcs carry no text and the legend is optional, so\n * with `showLegend: false` this and the centre text are the whole of what a screen reader\n * gets. Falls back to `donutChart.label`, or to `donutChart.pieLabel` with `pie`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly donutLabel = useI18nText(this.ariaLabel, 'donutChart.label', 'Donut chart');\n private readonly pieLabel = useI18nText(this.ariaLabel, 'donutChart.pieLabel', 'Pie chart');\n\n protected readonly resolvedAriaLabel = computed(() => (this.pie() ? this.pieLabel() : this.donutLabel()));\n\n /** Diameter in CSS pixels. @default 200 */\n readonly size = input(200, { transform: (v: unknown): number => Math.max(48, coerceNumberProperty(v, 200)) });\n\n /**\n * Inner-ring thickness as a percent of radius (0–100). `0` fills to the centre, and\n * keeps the centre text; `pie` ignores it. @default 30\n */\n readonly thickness = input(30, {\n transform: (v: unknown): number => Math.min(100, Math.max(0, coerceNumberProperty(v, 30))),\n });\n\n /**\n * Draw a pie chart: every slice fills to the centre, whatever `thickness` says, and\n * the host takes the `wr-donut-chart--pie` modifier. A pie has no hole to print in, so\n * `centerValue` and `centerLabel` are not rendered. Everything else is the donut's: the\n * slices run clockwise from twelve o'clock, with the same gap between them, the legend\n * and its toggle, and the tooltip — which in a pie also opens from a wider, invisible\n * target over a slice too thin to point at (see `tooltip`). The drawing's name falls\n * back to `donutChart.pieLabel`. @default false\n */\n readonly pie = input(false, { transform: coerceBooleanProperty });\n\n /** Show the legend under the chart. @default true */\n readonly showLegend = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Make each legend row a toggle button that shows and hides its slice, through\n * `hiddenSegments`. A row is a `<button aria-pressed>`, pressed while its slice is\n * shown, so the legend becomes one tab stop per slice. @default false\n */\n readonly toggleableLegend = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The positions in `segments` of the slices that are hidden. Positions rather than\n * labels, since two slices may share a label. A toggleable legend writes it, and a\n * host may bind it with or without one: `[(hiddenSegments)]`.\n *\n * A hidden slice is left out of the ring, and the slices still shown RE-NORMALISE:\n * they share the whole ring between them, each at its share of their own total. A\n * donut reads as the parts of the whole it draws, so leaving the hidden slice's arc\n * as a gap would show a whole that no longer adds up, and turning a slice off is how\n * a reader asks \"of the rest, how much is each?\". The tooltip cannot open on a slice\n * that is not drawn. The legend keeps the hidden slice's row, struck through and with\n * its own value, so it can be shown again; the row says \"hidden\" to a screen reader as\n * well, through `aria-pressed` on a toggle and a visually hidden word otherwise. The\n * centre text is printed as given, so a host that writes a total there works it out\n * from this list. A position past the end of `segments` is kept and ignored.\n */\n readonly hiddenSegments = model<readonly number[]>([]);\n\n /** Bold value text in the center. Not rendered with `pie`, which has no hole to hold it. */\n readonly centerValue = input<string>('');\n\n /** Smaller label under the value. Not rendered with `pie`, which has no hole to hold it. */\n readonly centerLabel = input<string>('');\n\n /** Whether the centre text renders: some is given, and there is a hole to print it in. */\n protected readonly showCenter = computed(() => !this.pie() && (!!this.centerValue() || !!this.centerLabel()));\n\n /**\n * Show a tooltip with the slice's label and value on hover. Pointer only — the\n * legend prints the same numbers, and with `showLegend` off `ariaLabel` is where\n * to say them. With `pie`, a slice too thin to land a pointer on, a sliver of a few\n * degrees, is hovered over a wider strip than it draws, through an invisible\n * `.wr-donut-chart__hit` over the pie: widened toward 12px of outer arc (15° on a chart\n * under about 92px) out of what the wider slices beside it can spare, each of which keeps\n * that much of its own. A sliver whose neighbours are slivers too, or have little to\n * spare, gets a narrower target or none, and is read in the legend. The ring draws no\n * such target. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Writes every value in the legend and the tooltip. `null` uses `Intl.NumberFormat`\n * in `LOCALE_ID`. The centre text is printed as given.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /** Each value as the legend and the tooltip print it: exact, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly hidden = computed(() => new Set(this.hiddenSegments()));\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n // Drawn in a 100×100 viewBox.\n private readonly outerR = 50;\n\n protected readonly innerR = computed(() => {\n const thickness = this.thickness();\n // A pie, or a thickness of 0: fill all the way to the center, not a zero-width ring.\n if (this.pie() || thickness === 0) return 0;\n return this.outerR * (1 - thickness / 100);\n });\n\n /** The sum the ring is divided by: the slices still shown (see `hiddenSegments`). */\n protected readonly total = computed(() => {\n const hidden = this.hidden();\n const sum = this.segments().reduce((acc, s, i) => acc + (hidden.has(i) ? 0 : weight(s.value)), 0);\n return sum > 0 ? sum : 1;\n });\n\n /**\n * Resolved slices ready for the template — each carries its arc path.\n *\n * Angles are in the drawing's own frame, where 0 is three o'clock and a positive\n * angle turns clockwise, because y runs downwards. The ring starts a quarter turn\n * back from there, at twelve o'clock, which is where the input's JSDoc always said\n * it started and where a reader looks for the first slice; it used to start at three.\n */\n protected readonly slices = computed(() => {\n const total = this.total();\n const hidden = this.hidden();\n const origin = -Math.PI / 2;\n let cumulative = 0;\n return this.segments().map((s, i) => {\n const value = weight(s.value);\n const isHidden = hidden.has(i);\n // A hidden slice takes no turn of the ring, so the next slice starts where the last\n // shown one ended.\n const share = isHidden ? 0 : value;\n const startAngle = origin + (cumulative / total) * Math.PI * 2;\n cumulative += share;\n const endAngle = origin + (cumulative / total) * Math.PI * 2;\n return {\n label: s.label,\n value,\n // The segment's own figure, which a negative one keeps although it draws nothing:\n // the weight is the arc's, not the data's, and printing it named a \"0\" the data\n // never had. A value that is not a number has no figure to print.\n text: Number.isFinite(s.value) ? this.numbers.value(s.value) : '',\n color: s.color ?? chartColor(i),\n hidden: isHidden,\n path: isHidden ? '' : this.arcPath(startAngle, endAngle),\n percent: (share / total) * 100,\n startAngle,\n endAngle,\n midAngle: (startAngle + endAngle) / 2,\n };\n });\n });\n\n /**\n * In a pie, a wider hover target for every slice too thin to land a pointer on: an\n * invisible wedge over the slice, drawn above the pie, widened toward `HIT_PX` of outer\n * arc (`MAX_HIT_ANGLE` at most, which binds below about 92px) out of the wider slices\n * beside it.\n *\n * A wider slice gives away only what it can spare: it keeps `HIT_PX` of outer arc of its\n * own (the same `MAX_HIT_ANGLE` cap), however many slivers reach into it, so a slice\n * that was easy to point at stays easy, and its middle, where its own chip points, is\n * never covered. Two slivers reaching into one slice from either side split what it\n * spares. A sliver asks half its shortfall of each wider neighbour, or all of it of the\n * only one; what one side cannot give, the other gives if it can. Between two slivers\n * side by side the boundary stays their shared edge, so of a run of slivers only the two\n * at its ends grow, and the legend is where the rest are read — as it is for a sliver\n * whose neighbours have little to spare, which gets the narrower target they leave it.\n * A slice that draws nothing — a zero, or a hidden slice — has nothing to point at and\n * gets no target, and nor does one with no wider neighbour.\n *\n * Pie only, and only while the tooltip is on, which is all it is for: the ring draws\n * exactly what it drew before `pie` existed. The wedge is filled with nothing and\n * hit-tested through `pointer-events=\"fill\"`, which reads its interior whatever its\n * paint and never its unpainted stroke, so its edges are the ones computed here; it\n * paints in no theme and in no forced-colors palette.\n */\n protected readonly hits = computed(() => {\n if (!this.pie() || !this.tooltip()) return [];\n const min = Math.min(MAX_HIT_ANGLE, HIT_PX / (this.size() / 2));\n const drawn = this.slices()\n .map((slice, index) => ({ index, start: slice.startAngle, end: slice.endAngle }))\n .filter(slice => slice.end - slice.start > 0);\n const count = drawn.length;\n if (count < 2) return [];\n const width = drawn.map(slice => slice.end - slice.start);\n const thin = width.map(w => w < min);\n const prev = (k: number): number => (k - 1 + count) % count;\n const next = (k: number): number => (k + 1) % count;\n // What each wider slice can give away and still keep `min` of its own.\n const spare = width.map((w, k) => (thin[k] ? 0 : w - min));\n // How far each sliver asks to reach on each side: into a wider neighbour only.\n const ask = width.map((w, k) => {\n if (!thin[k]) return { before: 0, after: 0 };\n const before = !thin[prev(k)];\n const after = !thin[next(k)];\n const share = (min - w) / (before && after ? 2 : 1);\n return { before: before ? share : 0, after: after ? share : 0 };\n });\n const reach = width.map(() => ({ before: 0, after: 0 }));\n // A wider slice is reached into by the sliver before it, past its own end, and by the\n // one after it, past its own start — the same sliver from both sides when there are\n // only two slices. Each gets what it asks while the two fit in the spare; past that,\n // at least half of it, and more where the other asks for less.\n width.forEach((_, j) => {\n if (thin[j]) return;\n const fromBefore = thin[prev(j)] ? ask[prev(j)].after : 0;\n const fromAfter = thin[next(j)] ? ask[next(j)].before : 0;\n const claims = (fromBefore > 0 ? 1 : 0) + (fromAfter > 0 ? 1 : 0);\n if (claims === 0) return;\n const fair = spare[j] / claims;\n const toBefore = Math.min(fromBefore, Math.max(fair, spare[j] - fromAfter));\n const toAfter = Math.min(fromAfter, Math.max(fair, spare[j] - fromBefore));\n if (toBefore > 0) reach[prev(j)].after = toBefore;\n if (toAfter > 0) reach[next(j)].before = toAfter;\n spare[j] = Math.max(0, spare[j] - toBefore - toAfter);\n });\n // What one side could not give, the other side gives out of what it has left.\n width.forEach((w, k) => {\n if (!thin[k]) return;\n let short = min - w - reach[k].before - reach[k].after;\n for (const [side, j] of [\n ['before', prev(k)],\n ['after', next(k)],\n ] as const) {\n if (short <= 0 || thin[j]) continue;\n const more = Math.min(short, spare[j]);\n reach[k][side] += more;\n spare[j] -= more;\n short -= more;\n }\n });\n return drawn.flatMap((slice, k) => {\n const { before, after } = reach[k];\n if (!thin[k] || before + after <= 0) return [];\n return [{ index: slice.index, path: this.arcPath(slice.start - before, slice.end + after) }];\n });\n });\n\n /**\n * The legend's rows: every slice, hidden ones included, each with its own figure — a\n * negative one included, which draws no slice — and no value at all for a segment whose\n * value is not a number.\n */\n protected readonly legendItems = computed<readonly WrChartLegendItem[]>(() =>\n this.slices().map(({ label, color, text }) => ({ label, color, value: text === '' ? null : text }))\n );\n\n /**\n * One tooltip for the whole chart, pointing at the hovered slice: at the middle of\n * its OUTER arc, on the side that part of the ring faces — above for a slice whose\n * middle is in the top quarter, below for the bottom one, beside it for the two at\n * three and nine o'clock. From there the chip sits clear of the ring, and the way\n * onto it runs straight out of the slice that opened it, over nothing else.\n *\n * Not the slice's `<path>` element: its box is most of the ring for any slice past\n * a quarter, so the chip would point at the middle of the chart. And not the middle\n * of the band: a chip there lies over the ring, under a pointer resting on it —\n * measured in Chromium, the inner half of a lower slice landed on its own chip. A\n * tiny slice keeps its own mid-angle, so the arrow says which sliver it is.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const slice = this.slices()[index];\n const svg = this.svg()?.nativeElement;\n if (!slice?.path || !svg) return null;\n const box = svg.getBoundingClientRect();\n // The drawing's y runs downwards, so a positive sine is the lower half.\n const cos = Math.cos(slice.midAngle);\n const sin = Math.sin(slice.midAngle);\n const side = Math.abs(cos) > Math.abs(sin) ? (cos > 0 ? 'right' : 'left') : sin > 0 ? 'bottom' : 'top';\n return {\n datum: { label: slice.label, value: slice.text, color: slice.color },\n anchor: {\n x: box.left + ((50 + this.outerR * cos) / 100) * box.width,\n y: box.top + ((50 + this.outerR * sin) / 100) * box.height,\n },\n side,\n };\n });\n\n // Helpers\n\n /** SVG path for one donut slice using outer and inner arcs. */\n private arcPath(start: number, end: number): string {\n const cx = 50;\n const cy = 50;\n const ro = this.outerR;\n const ri = this.innerR();\n const sweep = end - start;\n if (sweep <= 0) return '';\n // Full-circle slice — two halves so the arc can render.\n if (sweep >= Math.PI * 2 - 1e-6) {\n const path = [\n `M ${cx + ro} ${cy}`,\n `A ${ro} ${ro} 0 1 1 ${cx - ro} ${cy}`,\n `A ${ro} ${ro} 0 1 1 ${cx + ro} ${cy}`,\n ];\n if (ri > 0) {\n path.push(`M ${cx + ri} ${cy}`, `A ${ri} ${ri} 0 1 0 ${cx - ri} ${cy}`, `A ${ri} ${ri} 0 1 0 ${cx + ri} ${cy}`);\n }\n return path.join(' ');\n }\n const largeArc = sweep > Math.PI ? 1 : 0;\n const sox = cx + ro * Math.cos(start);\n const soy = cy + ro * Math.sin(start);\n const eox = cx + ro * Math.cos(end);\n const eoy = cy + ro * Math.sin(end);\n if (ri === 0) {\n return `M ${cx} ${cy} L ${sox.toFixed(2)} ${soy.toFixed(2)} A ${ro} ${ro} 0 ${largeArc} 1 ${eox.toFixed(2)} ${eoy.toFixed(2)} Z`;\n }\n const eix = cx + ri * Math.cos(end);\n const eiy = cy + ri * Math.sin(end);\n const six = cx + ri * Math.cos(start);\n const siy = cy + ri * Math.sin(start);\n return [\n `M ${sox.toFixed(2)} ${soy.toFixed(2)}`,\n `A ${ro} ${ro} 0 ${largeArc} 1 ${eox.toFixed(2)} ${eoy.toFixed(2)}`,\n `L ${eix.toFixed(2)} ${eiy.toFixed(2)}`,\n `A ${ri} ${ri} 0 ${largeArc} 0 ${six.toFixed(2)} ${siy.toFixed(2)}`,\n 'Z',\n ].join(' ');\n }\n}\n\nexport type { WrDonutSegment } from './types';\n","<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <!-- Every slice is stroked in the SURFACE colour (`--wr-donut-chart-slice-gap-color`,\n from the stylesheet), so adjacent arcs are separated by a visible gap rather than\n by the boundary between two fills. Without it the only thing dividing two slices\n is the colour change itself, and the default palette's entries sit within about\n 1.06:1 of each other in relative luminance — for a reader who cannot separate\n hue, two neighbours merge into one arc and the chart reads as having fewer slices\n than it has. A gap is a shape, and it survives greyscale, printing and a\n monochrome display. -->\n @for (slice of slices(); track $index) {\n <!-- A hidden slice draws nothing at all; the index stays the slice's own, which is\n what the tooltip looks it up by. -->\n @if (!slice.hidden) {\n <path\n class=\"wr-donut-chart__slice\"\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n stroke-width=\"1\"\n stroke-linejoin=\"round\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n }\n <!-- A sliver's wider hover target in a pie, filled with nothing: see `hits`, which is\n empty for the ring and with the tooltip off. Last, so it wins the pointer over the\n slices it reaches into; `fill`, so the unpainted stroke is not hit-tested and the\n edges stay where `hits` put them. -->\n @for (hit of hits(); track hit.index) {\n <path\n class=\"wr-donut-chart__hit\"\n [attr.d]=\"hit.path\"\n fill=\"none\"\n pointer-events=\"fill\"\n (mouseenter)=\"tip.enter(hit.index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n </svg>\n <!-- Never with `pie`: a pie has no hole to print in. -->\n @if (showCenter()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend() && slices().length > 0) {\n <!-- The key is `aria-hidden`: the row's text is its name, and the dot carries no word\n of its own. -->\n <ul\n wr-chart-legend\n class=\"wr-donut-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSegments\"\n ></ul>\n}\n"],"mappings":";;;;;;;;;;;;;AAsBA,SAAS,OAAO,OAAa;CAC3B,OAAO,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI;AACvD;AAQA,MAAM,SAAS;AAOf,MAAM,gBAAgB,KAAK,KAAK;AA+BhC,IAAa,eAAb,MAAa,aAAY;CAKd,WAAW,MAAiC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAO/C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE9B,aAAa,YAAY,KAAK,WAAW,oBAAoB,aAAa;CAC1E,WAAW,YAAY,KAAK,WAAW,uBAAuB,WAAW;CAEvE,oBAAoB,eAAgB,KAAK,IAAG,IAAK,KAAK,SAAQ,IAAK,KAAK,WAAU,GAAI,GAAA,YAAA,CAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;CAGhG,OAAO,MAAM,KAAG;EAAA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;GAAA,CAAA;EAAA,CAAA;EAAA,KAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -0,0 +1,100 @@
1
+ import { ComponentHarness, HarnessPredicate } from "@angular/cdk/testing";
2
+ /**
3
+ * @license
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
7
+ */
8
+ const BAR_WIDTH = /(?:^|;)\s*width\s*:\s*([\d.]+)%/;
9
+ var StageHarness = class StageHarness extends ComponentHarness {
10
+ static hostSelector = ".wr-funnel-chart__stage";
11
+ async read() {
12
+ const host = await this.host();
13
+ const label = await this.locatorFor(".wr-funnel-chart__label")();
14
+ const value = await this.locatorForOptional(".wr-funnel-chart__value")();
15
+ const overall = await this.locatorForOptional(".wr-funnel-chart__overall")();
16
+ const bar = await this.locatorForOptional(".wr-funnel-chart__bar")();
17
+ return {
18
+ label: await label.text(),
19
+ value: value ? await value.text() : null,
20
+ fromFirst: overall ? await overall.text() : null,
21
+ name: await host.getAttribute("aria-label"),
22
+ widthPercent: bar ? StageHarness.widthOf(await bar.getAttribute("style")) : null
23
+ };
24
+ }
25
+ static widthOf(style) {
26
+ const match = BAR_WIDTH.exec(style ?? "");
27
+ if (!match) throw new Error(`WrFunnelChartHarness.getStages(): a bar carries no inline width percentage (style: "${style ?? ""}"). The component writes one for every bar it draws, a stage of zero included, so its absence is the bug — reporting 0 would read as a stage of zero.`);
28
+ return Number.parseFloat(match[1]);
29
+ }
30
+ };
31
+ var GapHarness = class extends ComponentHarness {
32
+ static hostSelector = ".wr-funnel-chart__gap";
33
+ async label() {
34
+ const label = await this.locatorForOptional(".wr-funnel-chart__gap-label")();
35
+ return label ? label.text() : null;
36
+ }
37
+ };
38
+ var TableRowHarness = class extends ComponentHarness {
39
+ static hostSelector = ".wr-chart-table tbody tr";
40
+ async read() {
41
+ const header = await this.locatorFor("th[scope=\"row\"]")();
42
+ const cells = await this.locatorForAll("td")();
43
+ return {
44
+ header: await header.text(),
45
+ cells: await Promise.all(cells.map((cell) => cell.text()))
46
+ };
47
+ }
48
+ };
49
+ var WrFunnelChartHarness = class WrFunnelChartHarness extends ComponentHarness {
50
+ static hostSelector = "wr-funnel-chart";
51
+ static with(options = {}) {
52
+ return new HarnessPredicate(WrFunnelChartHarness, options).addOption("ariaLabel", options.ariaLabel, (harness, label) => HarnessPredicate.stringMatches(harness.getAccessibleName(), label)).addOption("stageLabel", options.stageLabel, async (harness, label) => {
53
+ for (const stage of await harness.getLabels()) if (await HarnessPredicate.stringMatches(stage, label)) return true;
54
+ return false;
55
+ });
56
+ }
57
+ async getAccessibleName() {
58
+ return (await this.locatorFor(".wr-funnel-chart__plot")()).getAttribute("aria-label");
59
+ }
60
+ async getStages() {
61
+ const stages = await this.locatorForAll(StageHarness)();
62
+ return Promise.all(stages.map((stage) => stage.read()));
63
+ }
64
+ async getStageCount() {
65
+ return (await this.locatorForAll(".wr-funnel-chart__stage")()).length;
66
+ }
67
+ async getLabels() {
68
+ const labels = await this.locatorForAll(".wr-funnel-chart__label")();
69
+ return Promise.all(labels.map((label) => label.text()));
70
+ }
71
+ async getGapLabels() {
72
+ const gaps = await this.locatorForAll(GapHarness)();
73
+ return Promise.all(gaps.map((gap) => gap.label()));
74
+ }
75
+ async getBandCount() {
76
+ return (await this.locatorForAll(".wr-funnel-chart__band")()).length;
77
+ }
78
+ async hasValues() {
79
+ return await this.locatorForOptional(".wr-funnel-chart__value")() !== null;
80
+ }
81
+ async hasDataTable() {
82
+ return await this.locatorForOptional(".wr-chart-table")() !== null;
83
+ }
84
+ async getTableColumns() {
85
+ await this.assertDataTable("getTableColumns");
86
+ const cells = await this.locatorForAll(".wr-chart-table thead tr > *")();
87
+ return Promise.all(cells.slice(1).map((cell) => cell.text()));
88
+ }
89
+ async getTableRows() {
90
+ await this.assertDataTable("getTableRows");
91
+ const rows = await this.locatorForAll(TableRowHarness)();
92
+ return Promise.all(rows.map((row) => row.read()));
93
+ }
94
+ async assertDataTable(method) {
95
+ if (!await this.hasDataTable()) throw new Error(`WrFunnelChartHarness.${method}(): the chart renders no data table — \`dataTable\` is off. Ask hasDataTable() first.`);
96
+ }
97
+ };
98
+ export { WrFunnelChartHarness };
99
+
100
+ //# sourceMappingURL=ngwr-charts-funnel-chart-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-charts-funnel-chart-testing.mjs","names":[],"sources":["../../../projects/lib/charts/funnel-chart/testing/wr-funnel-chart-harness.ts"],"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 { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrFunnelChartHarnessFilters, WrFunnelChartHarnessStage, WrFunnelChartTableRow } from './types';\n\n/** The `width: <n>%` the component writes onto a bar, out of its inline `style`. */\nconst BAR_WIDTH = /(?:^|;)\\s*width\\s*:\\s*([\\d.]+)%/;\n\n/**\n * One stage row, so its label, its figures and its bar are read off the row they sit in\n * rather than matched up by position across the chart — a missing stage has no bar and a\n * stage with no figure no value, so lists of each would not line up.\n */\nclass StageHarness extends ComponentHarness {\n static hostSelector = '.wr-funnel-chart__stage';\n\n async read(): Promise<WrFunnelChartHarnessStage> {\n const host = await this.host();\n const label = await this.locatorFor('.wr-funnel-chart__label')();\n const value = await this.locatorForOptional('.wr-funnel-chart__value')();\n const overall = await this.locatorForOptional('.wr-funnel-chart__overall')();\n const bar = await this.locatorForOptional('.wr-funnel-chart__bar')();\n return {\n label: await label.text(),\n value: value ? await value.text() : null,\n fromFirst: overall ? await overall.text() : null,\n name: await host.getAttribute('aria-label'),\n widthPercent: bar ? StageHarness.widthOf(await bar.getAttribute('style')) : null,\n };\n }\n\n /** Parse a bar's declared width. See the class note on {@link WrFunnelChartHarness} for why this is not `getCssValue()`. */\n private static widthOf(style: string | null): number {\n const match = BAR_WIDTH.exec(style ?? '');\n if (!match) {\n throw new Error(\n `WrFunnelChartHarness.getStages(): a bar carries no inline width percentage (style: \"${style ?? ''}\"). ` +\n 'The component writes one for every bar it draws, a stage of zero included, so its absence is the bug — ' +\n 'reporting 0 would read as a stage of zero.'\n );\n }\n return Number.parseFloat(match[1]);\n }\n}\n\n/** The gap between two stages: the band and the share of the stage above. */\nclass GapHarness extends ComponentHarness {\n static hostSelector = '.wr-funnel-chart__gap';\n\n async label(): Promise<string | null> {\n const label = await this.locatorForOptional('.wr-funnel-chart__gap-label')();\n return label ? label.text() : null;\n }\n}\n\n/** One body row of the chart's data table. */\nclass TableRowHarness extends ComponentHarness {\n static hostSelector = '.wr-chart-table tbody tr';\n\n async read(): Promise<WrFunnelChartTableRow> {\n const header = await this.locatorFor('th[scope=\"row\"]')();\n const cells = await this.locatorForAll('td')();\n return { header: await header.text(), cells: await Promise.all(cells.map(cell => cell.text())) };\n }\n}\n\n/**\n * Test harness for `<wr-funnel-chart>`.\n *\n * **The bars are read as PERCENTAGES of the track, not as pixels.** Each bar's width is\n * written inline as a share of the full width — the largest stage, or `max` — which is\n * the one number that survives a test with no layout, and the component's whole job. It is\n * read off the `style` ATTRIBUTE rather than through `getCssValue()`, which is\n * `getComputedStyle()`: in a browser that answers the laid-out pixels and in jsdom the\n * declaration, with nothing to say which, and with no inline width at all it would fall\n * back to the stylesheet's and read as a stage of zero. The hairline a stage of zero keeps\n * is the stylesheet's floor, so no method reports it.\n *\n * **Two questions are not one.** A stage's printed text and its accessible name are read\n * separately ({@link WrFunnelChartHarnessStage.value} and {@link WrFunnelChartHarnessStage.name}): the\n * row is an `img`, so the name is what a screen reader gets, and asserting only what is\n * drawn would pass on a stage that announces nothing. The shares printed between the bars\n * are `aria-hidden` for the same reason — {@link getGapLabels} reads what is drawn, the\n * names carry the same figures.\n *\n * **The bands' shapes are not read.** Each is a `clip-path` polygon from one bar's width\n * to the next, and asserting its corners would restate the bar widths this harness already\n * reads; {@link getBandCount} counts them, since where one is missing is the decision\n * worth catching — there is none next to a missing stage.\n *\n * **No hover method.** The tooltip repeats the stage's name, and the chip renders into\n * the overlay container with nothing tying it to this chart, so a query for it would\n * answer with whichever chart's chip is open. The same figures are in the names and in the\n * data table, which {@link getTableRows} reads.\n *\n * @example\n * ```ts\n * const chart = await loader.getHarness(WrFunnelChartHarness);\n *\n * expect(await chart.getLabels()).toEqual(['Visited', 'Signed up', 'Paid']);\n * expect((await chart.getStages())[1].widthPercent).toBe(40);\n * expect(await chart.getGapLabels()).toEqual(['40%', '15%']);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrFunnelChartHarness extends ComponentHarness {\n static hostSelector = 'wr-funnel-chart';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrFunnelChartHarnessFilters = {}): HarnessPredicate<WrFunnelChartHarness> {\n return new HarnessPredicate(WrFunnelChartHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption('stageLabel', options.stageLabel, async (harness, label) => {\n for (const stage of await harness.getLabels()) {\n if (await HarnessPredicate.stringMatches(stage, label)) return true;\n }\n return false;\n });\n }\n\n /** The chart's accessible name, on the `group` that holds the stages. */\n async getAccessibleName(): Promise<string | null> {\n return (await this.locatorFor('.wr-funnel-chart__plot')()).getAttribute('aria-label');\n }\n\n /** Every stage, from the top of the funnel down: what it prints, what it announces and how wide its bar is. */\n async getStages(): Promise<WrFunnelChartHarnessStage[]> {\n const stages = await this.locatorForAll(StageHarness)();\n return Promise.all(stages.map(stage => stage.read()));\n }\n\n /** How many stages the chart drew — one per stage given, a missing one included. */\n async getStageCount(): Promise<number> {\n return (await this.locatorForAll('.wr-funnel-chart__stage')()).length;\n }\n\n /** The labels beside the bars, in order — the full text, ellipsised on screen or not. */\n async getLabels(): Promise<string[]> {\n const labels = await this.locatorForAll('.wr-funnel-chart__label')();\n return Promise.all(labels.map(label => label.text()));\n }\n\n /**\n * The share of the stage above printed in each gap between two bars, from the top down —\n * one entry per gap, so one fewer than there are stages. `null` where none is printed:\n * a stage with no such share, or a `conversion` that leaves it off the drawing.\n */\n async getGapLabels(): Promise<(string | null)[]> {\n const gaps = await this.locatorForAll(GapHarness)();\n return Promise.all(gaps.map(gap => gap.label()));\n }\n\n /**\n * How many bands join two bars: one per gap whose two stages both have a value. A missing\n * stage breaks the funnel on either side of it, since a band across it would draw a drop\n * the data never gave.\n */\n async getBandCount(): Promise<number> {\n return (await this.locatorForAll('.wr-funnel-chart__band')()).length;\n }\n\n /** Whether any value is printed beside a bar (`showValues`). */\n async hasValues(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-funnel-chart__value')()) !== null;\n }\n\n /** Whether the hidden data table is rendered (`dataTable`). */\n async hasDataTable(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-chart-table')()) !== null;\n }\n\n /**\n * The data table's column headings: the value, the share of the previous stage and the\n * share of the first, in that order.\n *\n * Throws when the chart renders no table (`dataTable` off) rather than answering with\n * no columns.\n */\n async getTableColumns(): Promise<string[]> {\n await this.assertDataTable('getTableColumns');\n // The first cell is the corner over the row headers — what one row is, a `<th>` or an\n // empty `<td>` — not a column of figures.\n const cells = await this.locatorForAll('.wr-chart-table thead tr > *')();\n return Promise.all(cells.slice(1).map(cell => cell.text()));\n }\n\n /**\n * The data table's rows, one per stage: its label and its three figures, as a screen\n * reader walks them. A stage above a fixed `max` is drawn full width and tabulated as\n * itself, and a figure the stage does not have is `''`.\n *\n * Throws when the chart renders no table (`dataTable` off), for the reason\n * {@link getTableColumns} gives.\n */\n async getTableRows(): Promise<WrFunnelChartTableRow[]> {\n await this.assertDataTable('getTableRows');\n const rows = await this.locatorForAll(TableRowHarness)();\n return Promise.all(rows.map(row => row.read()));\n }\n\n private async assertDataTable(method: string): Promise<void> {\n if (!(await this.hasDataTable())) {\n throw new Error(\n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