ngwr 15.8.0 → 16.0.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 (376) hide show
  1. package/animations/aurora/styles/_index.scss +1 -1
  2. package/animations/blur-reveal/styles/_index.scss +1 -1
  3. package/animations/decode/styles/_index.scss +1 -1
  4. package/animations/dot-grid/styles/_index.scss +1 -1
  5. package/animations/flow-lines/styles/_index.scss +1 -1
  6. package/animations/fluid-cursor/styles/_index.scss +1 -1
  7. package/animations/{core → internal}/styles/_mixins.scss +1 -1
  8. package/animations/reveal/styles/_index.scss +1 -1
  9. package/animations/ripple-grid/styles/_index.scss +1 -1
  10. package/animations/rotate-reveal/styles/_index.scss +1 -1
  11. package/animations/thread-lines/styles/_index.scss +1 -1
  12. package/animations/typewriter/styles/_index.scss +1 -1
  13. package/copy-value/styles/_index.scss +104 -0
  14. package/date-picker/styles/_index.scss +117 -0
  15. package/fesm2022/{ngwr-animations-core.mjs → internal-BaQU4t_0.mjs} +6 -49
  16. package/fesm2022/internal-BaQU4t_0.mjs.map +1 -0
  17. package/fesm2022/ngwr-alert.mjs +2 -2
  18. package/fesm2022/ngwr-alert.mjs.map +1 -1
  19. package/fesm2022/ngwr-animations-aurora.mjs +21 -21
  20. package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
  21. package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
  22. package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
  23. package/fesm2022/ngwr-animations-click-sparks.mjs +2 -2
  24. package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
  25. package/fesm2022/ngwr-animations-confetti.mjs +5 -5
  26. package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
  27. package/fesm2022/ngwr-animations-decode.mjs +4 -4
  28. package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
  29. package/fesm2022/ngwr-animations-destruct.mjs +5 -5
  30. package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
  31. package/fesm2022/ngwr-animations-dot-grid.mjs +7 -7
  32. package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
  33. package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
  34. package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
  35. package/fesm2022/ngwr-animations-flow-lines.mjs +17 -17
  36. package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
  37. package/fesm2022/ngwr-animations-fluid-cursor.mjs +12 -12
  38. package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
  39. package/fesm2022/ngwr-animations-glitch.mjs +2 -2
  40. package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
  41. package/fesm2022/ngwr-animations-marquee.mjs +2 -2
  42. package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
  43. package/fesm2022/ngwr-animations-orbit.mjs +7 -7
  44. package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
  45. package/fesm2022/ngwr-animations-reveal.mjs +4 -4
  46. package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
  47. package/fesm2022/ngwr-animations-ripple-grid.mjs +5 -5
  48. package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
  49. package/fesm2022/ngwr-animations-rotate-reveal.mjs +4 -4
  50. package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
  51. package/fesm2022/ngwr-animations-shimmer.mjs +2 -2
  52. package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
  53. package/fesm2022/ngwr-animations-spotlight.mjs +1 -1
  54. package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
  55. package/fesm2022/ngwr-animations-thread-lines.mjs +16 -16
  56. package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
  57. package/fesm2022/ngwr-animations-tilt.mjs +3 -3
  58. package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
  59. package/fesm2022/ngwr-animations-typewriter.mjs +4 -4
  60. package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
  61. package/fesm2022/ngwr-avatar.mjs +3 -3
  62. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  63. package/fesm2022/ngwr-badge.mjs.map +1 -1
  64. package/fesm2022/ngwr-cascader.mjs +43 -20
  65. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  66. package/fesm2022/ngwr-charts-bar-chart.mjs +13 -13
  67. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  68. package/fesm2022/ngwr-charts-boxplot-chart.mjs +9 -9
  69. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
  70. package/fesm2022/ngwr-charts-bullet-chart.mjs +8 -8
  71. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
  72. package/fesm2022/ngwr-charts-candlestick-chart.mjs +11 -11
  73. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
  74. package/fesm2022/ngwr-charts-chart-legend.mjs +2 -2
  75. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-core.mjs +20 -20
  77. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-donut-chart.mjs +2 -2
  79. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-funnel-chart.mjs +6 -6
  81. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
  82. package/fesm2022/ngwr-charts-gauge.mjs +3 -3
  83. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  84. package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
  85. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
  86. package/fesm2022/ngwr-charts-line-chart.mjs +10 -10
  87. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  88. package/fesm2022/ngwr-charts-meter-group.mjs +2 -2
  89. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  90. package/fesm2022/ngwr-charts-radar-chart.mjs +11 -11
  91. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  92. package/fesm2022/ngwr-charts-scatter-chart.mjs +10 -10
  93. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  94. package/fesm2022/ngwr-charts-treemap-chart.mjs +4 -4
  95. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
  96. package/fesm2022/ngwr-charts-waterfall-chart.mjs +7 -7
  97. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
  98. package/fesm2022/ngwr-checkbox.mjs +2 -2
  99. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  100. package/fesm2022/ngwr-collapse.mjs +2 -2
  101. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  102. package/fesm2022/ngwr-color-picker.mjs +52 -52
  103. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  104. package/fesm2022/ngwr-command-palette.mjs +4 -4
  105. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  106. package/fesm2022/ngwr-comment.mjs +2 -2
  107. package/fesm2022/ngwr-comment.mjs.map +1 -1
  108. package/fesm2022/ngwr-compare.mjs +6 -6
  109. package/fesm2022/ngwr-compare.mjs.map +1 -1
  110. package/fesm2022/ngwr-context-menu.mjs +4 -4
  111. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  112. package/fesm2022/ngwr-copy-value-testing.mjs +58 -0
  113. package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -0
  114. package/fesm2022/ngwr-copy-value.mjs +196 -0
  115. package/fesm2022/ngwr-copy-value.mjs.map +1 -0
  116. package/fesm2022/ngwr-counter.mjs +3 -3
  117. package/fesm2022/ngwr-counter.mjs.map +1 -1
  118. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  119. package/fesm2022/ngwr-date-picker.mjs +217 -40
  120. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  121. package/fesm2022/ngwr-date.mjs +27 -5
  122. package/fesm2022/ngwr-date.mjs.map +1 -1
  123. package/fesm2022/ngwr-dialog.mjs +32 -3
  124. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  125. package/fesm2022/ngwr-directives.mjs +116 -1
  126. package/fesm2022/ngwr-directives.mjs.map +1 -1
  127. package/fesm2022/ngwr-drawer.mjs +3 -3
  128. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  129. package/fesm2022/ngwr-dropdown.mjs +13 -12
  130. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  131. package/fesm2022/ngwr-editor.mjs +28 -28
  132. package/fesm2022/ngwr-editor.mjs.map +1 -1
  133. package/fesm2022/ngwr-event-calendar.mjs +5 -5
  134. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  135. package/fesm2022/ngwr-file-upload.mjs +8 -8
  136. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  137. package/fesm2022/ngwr-graph.mjs +3 -3
  138. package/fesm2022/ngwr-graph.mjs.map +1 -1
  139. package/fesm2022/ngwr-hotkey.mjs +22 -22
  140. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  141. package/fesm2022/ngwr-i18n-ar.mjs +5 -0
  142. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  143. package/fesm2022/ngwr-i18n-cs.mjs +5 -0
  144. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  145. package/fesm2022/ngwr-i18n-de.mjs +5 -0
  146. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  147. package/fesm2022/ngwr-i18n-en.mjs +5 -0
  148. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  149. package/fesm2022/ngwr-i18n-es.mjs +5 -0
  150. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  151. package/fesm2022/ngwr-i18n-fr.mjs +5 -0
  152. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  153. package/fesm2022/ngwr-i18n-he.mjs +5 -0
  154. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  155. package/fesm2022/ngwr-i18n-hi.mjs +5 -0
  156. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  157. package/fesm2022/ngwr-i18n-id.mjs +5 -0
  158. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  159. package/fesm2022/ngwr-i18n-it.mjs +5 -0
  160. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  161. package/fesm2022/ngwr-i18n-ja.mjs +5 -0
  162. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  163. package/fesm2022/ngwr-i18n-ko.mjs +5 -0
  164. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  165. package/fesm2022/ngwr-i18n-nl.mjs +5 -0
  166. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  167. package/fesm2022/ngwr-i18n-pl.mjs +5 -0
  168. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  169. package/fesm2022/ngwr-i18n-pt.mjs +5 -0
  170. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  171. package/fesm2022/ngwr-i18n-ru.mjs +5 -0
  172. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  173. package/fesm2022/ngwr-i18n-sv.mjs +5 -0
  174. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  175. package/fesm2022/ngwr-i18n-tr.mjs +5 -0
  176. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  177. package/fesm2022/ngwr-i18n-uk.mjs +5 -0
  178. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  179. package/fesm2022/ngwr-i18n-vi.mjs +5 -0
  180. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  181. package/fesm2022/ngwr-i18n-zh-tw.mjs +5 -0
  182. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  183. package/fesm2022/ngwr-i18n-zh.mjs +5 -0
  184. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  185. package/fesm2022/ngwr-i18n.mjs +2 -2
  186. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  187. package/fesm2022/ngwr-icon.mjs +5 -5
  188. package/fesm2022/ngwr-icon.mjs.map +1 -1
  189. package/fesm2022/ngwr-image-cropper.mjs +11 -11
  190. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  191. package/fesm2022/ngwr-input-number.mjs +4 -4
  192. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  193. package/fesm2022/ngwr-input-otp.mjs +2 -2
  194. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  195. package/fesm2022/ngwr-input.mjs +15 -15
  196. package/fesm2022/ngwr-input.mjs.map +1 -1
  197. package/fesm2022/ngwr-keyboard.mjs +28 -28
  198. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  199. package/fesm2022/ngwr-knob.mjs +4 -4
  200. package/fesm2022/ngwr-knob.mjs.map +1 -1
  201. package/fesm2022/ngwr-lightbox.mjs +2 -2
  202. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  203. package/fesm2022/ngwr-load-state.mjs +2 -2
  204. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  205. package/fesm2022/ngwr-mention.mjs +6 -6
  206. package/fesm2022/ngwr-mention.mjs.map +1 -1
  207. package/fesm2022/ngwr-meta.mjs +19 -3
  208. package/fesm2022/ngwr-meta.mjs.map +1 -1
  209. package/fesm2022/ngwr-overlay.mjs +3 -3
  210. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  211. package/fesm2022/ngwr-pagination.mjs +7 -5
  212. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  213. package/fesm2022/ngwr-pipes.mjs +3 -5
  214. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  215. package/fesm2022/ngwr-platform.mjs +4 -1
  216. package/fesm2022/ngwr-platform.mjs.map +1 -1
  217. package/fesm2022/ngwr-popconfirm.mjs +6 -5
  218. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  219. package/fesm2022/ngwr-popover.mjs +31 -30
  220. package/fesm2022/ngwr-popover.mjs.map +1 -1
  221. package/fesm2022/ngwr-pull-to-refresh.mjs +2 -2
  222. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  223. package/fesm2022/ngwr-qr.mjs +6 -6
  224. package/fesm2022/ngwr-qr.mjs.map +1 -1
  225. package/fesm2022/ngwr-radio.mjs +3 -3
  226. package/fesm2022/ngwr-radio.mjs.map +1 -1
  227. package/fesm2022/ngwr-rating.mjs +10 -10
  228. package/fesm2022/ngwr-rating.mjs.map +1 -1
  229. package/fesm2022/ngwr-schema-form.mjs +15 -5
  230. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  231. package/fesm2022/ngwr-select.mjs +57 -34
  232. package/fesm2022/ngwr-select.mjs.map +1 -1
  233. package/fesm2022/ngwr-sidebar.mjs +3 -3
  234. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  235. package/fesm2022/ngwr-skeleton.mjs +2 -2
  236. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  237. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  238. package/fesm2022/ngwr-slider.mjs +13 -13
  239. package/fesm2022/ngwr-slider.mjs.map +1 -1
  240. package/fesm2022/ngwr-sortable-list.mjs +3 -3
  241. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  242. package/fesm2022/ngwr-splitter.mjs +5 -5
  243. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  244. package/fesm2022/ngwr-statistic.mjs +5 -3
  245. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  246. package/fesm2022/ngwr-storage.mjs +6 -4
  247. package/fesm2022/ngwr-storage.mjs.map +1 -1
  248. package/fesm2022/ngwr-switch.mjs +2 -2
  249. package/fesm2022/ngwr-switch.mjs.map +1 -1
  250. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  251. package/fesm2022/ngwr-table.mjs +263 -32
  252. package/fesm2022/ngwr-table.mjs.map +1 -1
  253. package/fesm2022/ngwr-tabs.mjs +2 -2
  254. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  255. package/fesm2022/ngwr-toast-testing.mjs +8 -1
  256. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  257. package/fesm2022/ngwr-toast.mjs +63 -20
  258. package/fesm2022/ngwr-toast.mjs.map +1 -1
  259. package/fesm2022/ngwr-tour.mjs +7 -7
  260. package/fesm2022/ngwr-tour.mjs.map +1 -1
  261. package/fesm2022/ngwr-transfer.mjs +20 -9
  262. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  263. package/fesm2022/ngwr-tree.mjs +64 -24
  264. package/fesm2022/ngwr-tree.mjs.map +1 -1
  265. package/fesm2022/ngwr-utils.mjs +98 -55
  266. package/fesm2022/ngwr-utils.mjs.map +1 -1
  267. package/fesm2022/ngwr-validators.mjs +2 -2
  268. package/fesm2022/ngwr-validators.mjs.map +1 -1
  269. package/fesm2022/ngwr-version.mjs +1 -1
  270. package/fesm2022/ngwr-version.mjs.map +1 -1
  271. package/fesm2022/ngwr-window.mjs +26 -26
  272. package/fesm2022/ngwr-window.mjs.map +1 -1
  273. package/fesm2022/ngwr.mjs.map +1 -1
  274. package/i18n/ar.json +5 -0
  275. package/i18n/cs.json +5 -0
  276. package/i18n/de.json +5 -0
  277. package/i18n/en.json +5 -0
  278. package/i18n/es.json +5 -0
  279. package/i18n/fr.json +5 -0
  280. package/i18n/he.json +5 -0
  281. package/i18n/hi.json +5 -0
  282. package/i18n/id.json +5 -0
  283. package/i18n/it.json +5 -0
  284. package/i18n/ja.json +5 -0
  285. package/i18n/ko.json +5 -0
  286. package/i18n/nl.json +5 -0
  287. package/i18n/pl.json +5 -0
  288. package/i18n/pt.json +5 -0
  289. package/i18n/ru.json +5 -0
  290. package/i18n/sv.json +5 -0
  291. package/i18n/tr.json +5 -0
  292. package/i18n/uk.json +5 -0
  293. package/i18n/vi.json +5 -0
  294. package/i18n/zh-TW.json +5 -0
  295. package/i18n/zh.json +5 -0
  296. package/input-number/styles/_index.scss +6 -0
  297. package/llms-full.txt +31 -19
  298. package/llms.txt +37 -19
  299. package/mcp/providers.js +1 -1
  300. package/package.json +15 -10
  301. package/pagination/styles/_index.scss +8 -0
  302. package/schematics/icon-set/index.js +3 -3
  303. package/schematics/migrations/v16/index.js +742 -0
  304. package/schematics/migrations.json +5 -0
  305. package/schematics/ng-add/index.js +4 -4
  306. package/schematics/provider/index.js +4 -4
  307. package/schematics/use/symbol-map.json +2 -0
  308. package/select/styles/_index.scss +1 -1
  309. package/skills/ngwr/SKILL.md +6 -4
  310. package/skills/ngwr/references/catalog.md +4 -2
  311. package/skills/ngwr/references/setup.md +10 -9
  312. package/table/styles/_index.scss +92 -30
  313. package/toast/styles/_index.scss +30 -0
  314. package/tree/styles/_index.scss +17 -0
  315. package/types/index-CXbgza47.d.ts +13 -0
  316. package/types/ngwr-animations-aurora.d.ts +1 -1
  317. package/types/ngwr-animations-blur-reveal.d.ts +2 -2
  318. package/types/ngwr-animations-dot-grid.d.ts +1 -2
  319. package/types/ngwr-animations-flow-lines.d.ts +1 -1
  320. package/types/ngwr-animations-fluid-cursor.d.ts +1 -1
  321. package/types/ngwr-animations-reveal.d.ts +4 -8
  322. package/types/ngwr-animations-ripple-grid.d.ts +1 -1
  323. package/types/ngwr-animations-spotlight.d.ts +1 -1
  324. package/types/ngwr-animations-thread-lines.d.ts +1 -1
  325. package/types/ngwr-animations-tilt.d.ts +1 -1
  326. package/types/ngwr-avatar.d.ts +2 -2
  327. package/types/ngwr-badge.d.ts +1 -1
  328. package/types/ngwr-cascader.d.ts +12 -1
  329. package/types/ngwr-charts-boxplot-chart.d.ts +1 -1
  330. package/types/ngwr-charts-bullet-chart.d.ts +2 -2
  331. package/types/ngwr-charts-candlestick-chart.d.ts +1 -1
  332. package/types/ngwr-charts-core.d.ts +12 -12
  333. package/types/ngwr-charts-line-chart.d.ts +2 -2
  334. package/types/ngwr-charts-radar-chart.d.ts +1 -1
  335. package/types/ngwr-charts-scatter-chart.d.ts +2 -2
  336. package/types/ngwr-charts-waterfall-chart.d.ts +1 -1
  337. package/types/ngwr-color-picker.d.ts +12 -12
  338. package/types/ngwr-copy-value-testing.d.ts +87 -0
  339. package/types/ngwr-copy-value.d.ts +95 -0
  340. package/types/ngwr-date-picker-testing.d.ts +3 -3
  341. package/types/ngwr-date-picker.d.ts +97 -1
  342. package/types/ngwr-date.d.ts +44 -3
  343. package/types/ngwr-dialog.d.ts +50 -3
  344. package/types/ngwr-directives.d.ts +40 -0
  345. package/types/ngwr-drawer.d.ts +1 -1
  346. package/types/ngwr-dropdown.d.ts +3 -2
  347. package/types/ngwr-hotkey.d.ts +5 -5
  348. package/types/ngwr-i18n.d.ts +3 -3
  349. package/types/ngwr-icon.d.ts +26 -26
  350. package/types/ngwr-input-number.d.ts +2 -2
  351. package/types/ngwr-input.d.ts +8 -8
  352. package/types/ngwr-load-state.d.ts +6 -6
  353. package/types/ngwr-meta.d.ts +18 -0
  354. package/types/ngwr-pipes.d.ts +6 -4
  355. package/types/ngwr-platform.d.ts +2 -1
  356. package/types/ngwr-popconfirm.d.ts +3 -2
  357. package/types/ngwr-popover.d.ts +4 -3
  358. package/types/ngwr-select.d.ts +33 -18
  359. package/types/ngwr-slider-testing.d.ts +2 -2
  360. package/types/ngwr-slider.d.ts +3 -3
  361. package/types/ngwr-statistic.d.ts +5 -1
  362. package/types/ngwr-storage.d.ts +1 -1
  363. package/types/ngwr-table-testing.d.ts +2 -1
  364. package/types/ngwr-table.d.ts +155 -18
  365. package/types/ngwr-tabs.d.ts +10 -2
  366. package/types/ngwr-toast-testing.d.ts +6 -2
  367. package/types/ngwr-toast.d.ts +33 -5
  368. package/types/ngwr-transfer.d.ts +5 -0
  369. package/types/ngwr-tree.d.ts +22 -2
  370. package/types/ngwr-utils.d.ts +157 -82
  371. package/types/ngwr-validators.d.ts +4 -2
  372. package/types/ngwr-version.d.ts +1 -1
  373. package/types/ngwr.d.ts +1 -0
  374. package/types/pointer-tracker-D7fXxLQL.d.ts +24 -0
  375. package/fesm2022/ngwr-animations-core.mjs.map +0 -1
  376. package/types/ngwr-animations-core.d.ts +0 -294
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-charts-radar-chart.mjs","names":[],"sources":["../../../projects/lib/charts/radar-chart/radar-chart.ts","../../../projects/lib/charts/radar-chart/radar-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n model,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartLegend, type WrChartLegendItem } from 'ngwr/charts/chart-legend';\nimport {\n type WrChartAxis,\n WrChartTable,\n type WrChartTableData,\n chartAxis,\n chartColor,\n chartDash,\n useChartNumbers,\n} from 'ngwr/charts/core';\nimport { useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip } from 'ngwr/popover';\nimport { clamp, round, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrRadarSeries, WrRadarVariant } from './types';\n\n/** The drawing's centre, in its 100 × 100 viewBox. */\nconst CENTRE = 50;\n\n/** The outer ring's radius, in the same units: the drawing's box is the outer ring's. */\nconst RADIUS = 50;\n\n/**\n * How far past the outer ring the pointer may stray and still read an axis, as a share\n * of the radius: the dots on the outer ring overhang it.\n */\nconst REACH = 1.1;\n\n/**\n * A ring value's line box in CSS pixels — `--wr-text-xs-leading`, which\n * `--wr-radar-chart-label-line-height` defaults to — until a browser has laid one out to\n * measure.\n */\nconst LABEL_LINE = 16;\n\n/** The nice-number ladder's mantissas: the steps a fitted scale snaps to, times a power of ten. */\nconst LADDER = [1, 2, 2.5, 5];\n\n/**\n * The ring step for an outer ring fixed at `max`: of the steps on the nice-number ladder\n * that divide `max` into a whole number of rings from 1 to 10, the one whose count is\n * nearest `rings`, and the fewer rings on a tie. A rating out of 5 gets a ring per point,\n * a score out of 100 a ring per 25. Only a `max` no step on the ladder divides — an outer\n * ring of 37 — is cut into `rings` equal parts.\n */\nfunction fixedStep(max: number, rings: number): number {\n let best = max / rings;\n let distance = Number.POSITIVE_INFINITY;\n const top = Math.floor(Math.log10(max));\n // From the finest step to the coarsest, so a tie lands on the fewer rings. A step from\n // a tenth of `max` up to `max` gives 10 rings down to 1; one either side is room for\n // `log10` landing off by one at a power of ten.\n for (let e = top - 2; e <= top + 1; e++) {\n for (const mantissa of LADDER) {\n // Divided rather than multiplied below one, so 0.1 is the literal and not 1 × 10⁻¹.\n const step = e >= 0 ? mantissa * 10 ** e : mantissa / 10 ** -e;\n const count = Math.round(max / step);\n if (count < 1 || count > 10 || Math.abs(count * step - max) > max * 1e-9) continue;\n const off = Math.abs(count - rings);\n if (off > distance) continue;\n best = step;\n distance = off;\n }\n }\n return best;\n}\n\n/** A point in the viewBox. */\ninterface Point {\n readonly x: number;\n readonly y: number;\n}\n\n/** One axis: its name, its angle from three o'clock, clockwise, and the unit vector it runs along. */\ninterface Axis {\n readonly label: string;\n readonly angle: number;\n readonly cos: number;\n readonly sin: number;\n}\n\n/** A coordinate as a path writes it. */\nconst fixed = (value: number): string => value.toFixed(2);\n\n/** A number for an inline style, to four decimals with `-0` folded to `0`, so the style stays short. */\nconst short = (value: number): number => Math.round(value * 1e4) / 1e4 || 0;\n\nconst at = (point: Point): string => `${fixed(point.x)} ${fixed(point.y)}`;\n\nconst along = (axis: Axis, r: number): Point => ({ x: CENTRE + r * axis.cos, y: CENTRE + r * axis.sin });\n\n/** The point `r` out from the centre at `angle`, clockwise from three o'clock. */\nconst toward = (angle: number, r: number): Point => ({\n x: CENTRE + r * Math.cos(angle),\n y: CENTRE + r * Math.sin(angle),\n});\n\n/**\n * A polar-area series' outline: the silhouette of its wedges, walked once round. Each\n * wedge is an arc of its own radius across its slice — `half` either side of its axis —\n * and the step from one wedge to the next is a straight run along the edge they share.\n * A wedge with no area (`null` or `0`) is the centre, so the walk dips to it there and\n * draws no arc: a missing value invents nothing, and its neighbours keep their edges.\n *\n * One closed path rather than a closed wedge per value, because two wedges side by side\n * share an edge: stroked twice, at two different dash phases, the dashes fill each\n * other's gaps and the edge reads solid, which is the one channel besides hue that tells\n * two series apart. The fill is the same path, which is every wedge's area at once.\n *\n * With three axes or more a slice spans 120° at most, so every arc is the small one, and\n * it sweeps clockwise as the axes run.\n */\nfunction silhouette(axes: readonly Axis[], half: number, radii: readonly (number | null)[]): string {\n const commands: string[] = [];\n let last = '';\n const to = (point: Point): void => {\n const next = at(point);\n if (next !== last) commands.push(`${commands.length === 0 ? 'M' : 'L'} ${next}`);\n last = next;\n };\n radii.forEach((radius, a) => {\n const r = radius ?? 0;\n to(toward(axes[a].angle - half, r));\n if (r <= 0) return;\n last = at(toward(axes[a].angle + half, r));\n commands.push(`A ${fixed(r)} ${fixed(r)} 0 0 1 ${last}`);\n });\n return `${commands.join(' ')} Z`;\n}\n\n/** A ring with no polygon to follow — fewer than three axes — as a circle: two arcs, since one arc back to its start draws nothing. */\nconst circle = (r: number): string =>\n `M ${fixed(CENTRE - r)} ${CENTRE} A ${fixed(r)} ${fixed(r)} 0 1 0 ${fixed(CENTRE + r)} ${CENTRE} ` +\n `A ${fixed(r)} ${fixed(r)} 0 1 0 ${fixed(CENTRE - r)} ${CENTRE} Z`;\n\n/**\n * A series' outline: closed through every axis when it has a value on each, and open\n * across every missing one otherwise — one subpath per unbroken run, walked once round\n * from the first gap, so a run that wraps past the last axis to the first is one stroke.\n * A run of one point repeats it, since a subpath of a single `M` is not stroked at all and\n * the value would vanish with `showDots` off; the round cap paints it as a dot.\n */\nfunction outline(points: readonly (Point | null)[]): string {\n const gap = points.indexOf(null);\n if (gap === -1) return `M ${points.map(p => at(p!)).join(' L ')} Z`;\n\n const commands: string[] = [];\n let run: Point[] = [];\n const flush = (): void => {\n if (run.length === 1) commands.push(`M ${at(run[0])} L ${at(run[0])}`);\n else if (run.length > 1) commands.push(`M ${run.map(at).join(' L ')}`);\n run = [];\n };\n for (let k = 1; k <= points.length; k++) {\n const point = points[(gap + k) % points.length];\n if (point === null) flush();\n else run.push(point);\n }\n flush();\n return commands.join(' ');\n}\n\n/**\n * Radar chart: several series over the same axes, each a polygon on a polar grid — or,\n * with `variant=\"polar-area\"`, a wedge per axis whose area is the value. For comparing a\n * few profiles — products, players, releases — across the same handful of measures.\n * SVG-only — no external dependency.\n *\n * @example\n * ```html\n * <wr-radar-chart\n * [axes]=\"['Speed', 'Power', 'Range', 'Comfort', 'Price']\"\n * [series]=\"[\n * { label: 'Model A', data: [80, 65, 70, 90, 55] },\n * { label: 'Model B', data: [60, 85, 75, 60, 80] }\n * ]\"\n * [max]=\"100\"\n * />\n * ```\n *\n * **The geometry.** The first axis points to twelve o'clock and the rest follow\n * clockwise, evenly spaced. The scale runs from the centre to the outer ring and\n * includes zero, its rings on readable steps (`max` and `rings`), and every series is a\n * polygon in its colour and its own dash: the default palette's colours sit within\n * about 1.06:1 of each other in luminance, so a dash is what tells two outlines apart\n * without hue, the line chart's remedy. The fills sit under every outline.\n *\n * **A missing value is a gap, never a guess.** A `null`, a value that is not a finite\n * number, or one a shorter `data` does not reach, breaks the outline on either side of\n * its axis and the series is drawn OPEN and UNFILLED: closing the polygon across the gap\n * would draw a reading the data never took, and filling an open outline means closing it.\n *\n * **`variant=\"polar-area\"` draws wedges instead of polygons.** Each axis owns an equal\n * slice of the circle, centred on it, and each series draws one wedge per value there,\n * the series overlaid with their fills translucent and their outlines in their own\n * dashes — one outline round each series' wedges, so the edge two wedges share is\n * stroked once and its dash survives. The value is the wedge's AREA: every wedge has the\n * same angle, so its area grows with the square of its radius, and the radius is the\n * square ROOT of the value's share of the scale — twice the value is twice the ink, where\n * a radius proportional to the value would paint four times as much. The rings are\n * circles, labelled with values, and they bunch towards the outside for the same reason,\n * so a ring value that would sit closer than a line to the one outside it is left out\n * and its ring still drawn. The scale starts at zero: a wedge grows from the centre, so\n * a negative value has no area and sits at the centre, and the tooltip and the data\n * table keep its figure. A missing value is a missing wedge, and every other wedge of\n * the series is drawn and filled, since each stands on its own value. The spokes run\n * between the wedges rather than through them.\n *\n * **Labels are HTML beside the drawing**, so they keep their size at any `size`: the axis\n * names sit outside the outer ring, in a gutter round the drawing, each aligned away from\n * the centre and ellipsised past the room it has — the tooltip and the data table carry\n * the whole name. The ring values sit beside the first axis and are `aria-hidden`, as an\n * axis' ticks are on every chart here. The drawing keeps its clockwise order under RTL,\n * as every SVG chart here keeps its own — the HTML layouts (bar, bullet, treemap) are the\n * ones that mirror — and the labels follow the drawing.\n *\n * **What a screen reader gets.** The drawing is one named `role=\"img\"` — on the `<svg>`\n * itself, as on the donut, since WebKit drops the whole subtree of an `img` wrapper and\n * the axis names are real text beside it. The numbers are in text only in the tooltip,\n * which is pointer only, and in the data table `dataTable` renders: say them in\n * `ariaLabel`, or turn the table on. No part of the chart is a tab stop, unless\n * `toggleableLegend` makes the legend rows buttons.\n *\n * With fewer than three axes there is no polygon to draw: the chart draws the grid\n * alone and says so in dev mode.\n *\n * The legend is a `ul[wr-chart-legend]` (`ngwr/charts/chart-legend`), and with\n * `toggleableLegend` its rows show and hide their series through `hiddenSeries`.\n *\n * @see https://ngwr.dev/charts/radar-chart\n */\n@Component({\n selector: 'wr-radar-chart',\n templateUrl: './radar-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-radar-chart',\n '[class.wr-radar-chart--polygon]': '!polar()',\n '[class.wr-radar-chart--polar-area]': 'polar()',\n },\n imports: [WrChartLegend, WrChartTable],\n})\nexport class WrRadarChart {\n /**\n * The axes' names, clockwise from twelve o'clock. A series takes one value per axis,\n * in this order. Three at least: with fewer the chart draws the grid and no series.\n */\n readonly axes = input<readonly string[]>([]);\n\n /**\n * One polygon per series. A series with no `color` takes the next entry from the\n * chart's palette, and each takes the next dash, the first one solid.\n */\n readonly series = input<readonly WrRadarSeries[]>([]);\n\n /**\n * How the series are drawn. `'polygon'` joins each series' values into a polygon, one\n * vertex per axis. `'polar-area'` gives each axis an equal-angle wedge per series whose\n * AREA is the value — the radius grows with the square root of the value, so the ink\n * a wedge paints is proportional to what it stands for — with the series overlaid. The\n * legend, the toggle, the tooltip and the data table are the same in both.\n * @default 'polygon'\n */\n readonly variant = input<WrRadarVariant>('polygon');\n\n /**\n * Accessible name of the drawing. The shapes carry no text and the legend has the\n * series names only, so this is where to say what the chart shows — or turn on\n * `dataTable`. Falls back to `radarChart.label`, or to `radarChart.polarAreaLabel` in\n * the polar-area variant, which is also the data table's caption.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly polygonAriaLabel = useI18nText(this.ariaLabel, 'radarChart.label', 'Radar chart');\n\n private readonly polarAreaAriaLabel = useI18nText(this.ariaLabel, 'radarChart.polarAreaLabel', 'Polar area chart');\n\n protected readonly resolvedAriaLabel = computed(() =>\n this.polar() ? this.polarAreaAriaLabel() : this.polygonAriaLabel()\n );\n\n /**\n * The value of the outer ring. `0` fits the scale to the series shown, on a readable\n * step and including zero; a value above `0` fixes it, from zero at the centre — a score\n * out of 100, a rating out of 5 — with its rings on a readable step that divides it (see\n * `rings`). A value outside a fixed scale is drawn on its edge, and the tooltip and the\n * data table still give its own figure. @default 0\n */\n readonly max = input(0, {\n transform: (v: unknown): number => {\n const value = coerceNumberProperty(v, 0);\n return Number.isFinite(value) ? Math.max(0, value) : 0;\n },\n });\n\n /**\n * About how many rings the grid draws between the centre and the outer ring, each on a\n * readable step — 1, 2, 2.5 or 5 times a power of ten. A fitted scale aims for this many\n * and rounds its step up onto that ladder. A fixed `max` takes the step that divides it into the count\n * nearest this one, the fewer on a tie, so a rating out of 5 gets a ring per point and a\n * score out of 100 a ring per 25; only a `max` that no such step divides, such as 37,\n * is cut into exactly this many equal rings. Whole numbers from 1 to 10. @default 4\n */\n readonly rings = input(4, {\n transform: (v: unknown): number => {\n const value = Math.round(coerceNumberProperty(v, 4));\n return Number.isFinite(value) ? clamp(value, 1, 10) : 4;\n },\n });\n\n /**\n * The drawing's diameter in CSS pixels, at least 120. The axis names sit in a gutter\n * round it, so the chart is wider than this by the gutter on either side; in a narrower\n * container the drawing shrinks to fit. @default 280\n */\n readonly size = input(280, {\n transform: (v: unknown): number => {\n const value = coerceNumberProperty(v, 280);\n return Number.isFinite(value) ? Math.max(120, value) : 280;\n },\n });\n\n /** Show the rings, the spokes and the ring values. The axis names stay. @default true */\n readonly showGrid = input(true, { 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 series, through\n * `hiddenSeries`. A row is a `<button aria-pressed>`, pressed while its series is\n * shown, so the legend becomes one tab stop per series. @default false\n */\n readonly toggleableLegend = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The positions in `series` of the series that are hidden. Positions rather than\n * labels, since two series may share a label. A toggleable legend writes it, and a\n * host may bind it with or without one: `[(hiddenSeries)]`.\n *\n * A hidden series is left out of everything that reads its values: it draws no\n * polygon and no dots, it has no row in the tooltip and no column in the data table,\n * and a fitted scale is fitted to the series still shown. The axes do not change, since\n * they belong to the chart rather than to one series. The legend keeps the hidden\n * series' row, struck through, so it can be shown again; the row says \"hidden\" to a\n * screen reader as well. A position past the end of `series` is kept and ignored.\n */\n readonly hiddenSeries = model<readonly number[]>([]);\n\n /**\n * Show a dot at every value: on the polygon's vertex, or in the polar-area variant on\n * the middle of the wedge's arc, where the value reads against the rings. @default true\n */\n readonly showDots = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Fill each closed polygon with its colour, faintly (`--wr-radar-chart-area-opacity`),\n * under every outline — the name the line chart and the sparkline give the same fill. A\n * series with a missing value is never filled, whatever this says: its outline is open.\n * In the polar-area variant every wedge is filled, since the outline round them always\n * closes, and a missing value is a missing wedge. @default true\n */\n readonly showArea = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip for the axis nearest the pointer: its name, and every series' value\n * on it; an axis no series shown has a value on opens none. Pointer only — the data\n * table is where the same numbers are for a keyboard or a screen reader. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Writes every number the chart shows: the ring values, the tooltip and the data\n * table. `null` uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ring values\n * (`1.2K`) unless the full numbers are shorter.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /**\n * Render the chart's figures as a table that only assistive technology reaches: a row\n * per axis, headed by its name, and a column per series shown, every value written the\n * way the tooltip writes it. A missing value is an empty cell.\n *\n * The drawing is one named `role=\"img\"`, which hides everything inside it, so without\n * the table the numbers are nowhere a screen reader can walk. It is rendered beside the\n * drawing, clipped to nothing: it takes no room, draws nothing and holds no tab stop.\n * A hidden series leaves it. @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /** The ring values' compact ticks and the exact figures, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The drawing's laid-out width and a ring value's line box, both in CSS pixels, once a\n * browser has measured them: the drawing shrinks below `size` in a narrow container, and\n * how close two ring values may sit is a question of pixels, not of the viewBox.\n */\n private readonly measured = signal<{ readonly width: number; readonly line: number } | null>(null);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/radar-chart');\n const destroyRef = inject(DestroyRef);\n // Measured after render, so the server and the first paint assume `size` and a 16px\n // line, and nothing here touches the DOM before a browser has one.\n afterNextRender(() => {\n const svg = this.svg()?.nativeElement;\n if (!svg || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(([entry]) => {\n const width = entry.contentRect.width;\n // A hidden chart measures nothing; keep the last reading rather than thin to it.\n if (width <= 0) return;\n const label = this.host.nativeElement.querySelector('.wr-radar-chart__ring-label');\n // No value laid out — `showGrid` off — measures 0: keep the line already known.\n const height = label?.getBoundingClientRect().height ?? 0;\n const last = this.measured();\n const line = height > 0 ? height : (last?.line ?? LABEL_LINE);\n if (last?.width === width && last.line === line) return;\n this.measured.set({ width, line });\n });\n observer.observe(svg);\n destroyRef.onDestroy(() => observer.disconnect());\n });\n\n // A radar of two axes is a line and one of one a point, so neither can hold a\n // polygon; the chart draws the grid and nothing else, which on screen looks like\n // data that failed to load rather than a refusal.\n if (isDevMode()) {\n let warned: number | null = null;\n effect(() => {\n const count = this.axes().length;\n if (count >= 3 || this.series().length === 0 || warned === count) return;\n warned = count;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-radar-chart>: a radar needs at least three axes to draw a series, and it was given ${count}. ` +\n 'It draws the grid alone.'\n );\n });\n }\n }\n\n /** Every axis, clockwise from twelve o'clock: the drawing's y runs downwards, so a growing angle turns clockwise. */\n private readonly axisGeometry = computed<readonly Axis[]>(() => {\n const axes = this.axes();\n return axes.map((label, i) => {\n const angle = -Math.PI / 2 + (i * 2 * Math.PI) / axes.length;\n return { label, angle, cos: Math.cos(angle), sin: Math.sin(angle) };\n });\n });\n\n /** Whether the series are wedges rather than polygons. Anything but `'polar-area'` is the polygon. */\n protected readonly polar = computed(() => this.variant() === 'polar-area');\n\n /**\n * Whether there are axes enough for a polygon: three make the smallest one. The\n * polar-area variant keeps the same floor, so the two draw the same data.\n */\n private readonly drawable = computed(() => this.axes().length >= 3);\n\n /**\n * Every series, resolved: its palette colour, its dash, and one value per axis with\n * `null` where it is missing. Hidden ones included, since the legend lists them.\n */\n private readonly resolvedSeries = computed(() => {\n const count = this.axes().length;\n return this.series().map((s, index) => ({\n index,\n label: s.label,\n color: s.color ?? chartColor(index),\n dash: chartDash(index),\n values: Array.from({ length: count }, (_, a): number | null => {\n const value = s.data[a];\n return typeof value === 'number' && Number.isFinite(value) ? value : null;\n }),\n }));\n });\n\n /** The series drawn, read and fitted to: every one `hiddenSeries` does not name. */\n private readonly visibleSeries = computed(() => {\n const hidden = new Set(this.hiddenSeries());\n return this.resolvedSeries().filter(s => !hidden.has(s.index));\n });\n\n /**\n * The scale from the centre to the outer ring. A fixed `max` runs from zero, its rings\n * on the readable step that divides it (`fixedStep`). Otherwise it is `chartAxis` over\n * the series shown, including zero: the centre is zero unless a value is negative, and\n * then the scale's own minimum, which a radar shows as a smaller polygon rather than as\n * anything below a baseline — readable, and worth a fixed `max` where negative values\n * are the norm. The polar-area variant always starts at zero, since a wedge grows from\n * the centre: it is fitted to the largest value alone, and a negative value has no area.\n * With nothing to fit — or, for wedges, nothing above zero — it is the empty 0 to 1 frame.\n */\n private readonly scale = computed<WrChartAxis>(() => {\n const explicit = this.max();\n const rings = this.rings();\n if (explicit > 0) {\n const step = fixedStep(explicit, rings);\n const count = Math.round(explicit / step);\n const ticks = Array.from({ length: count + 1 }, (_, i) => round(explicit - i * step, 6));\n return { min: 0, max: explicit, step, ticks };\n }\n const values = this.visibleSeries().flatMap(s => s.values.filter((v): v is number => v !== null));\n if (values.length === 0) return chartAxis(Number.NaN, Number.NaN);\n const peak = Math.max(...values);\n if (this.polar()) {\n return peak > 0 ? chartAxis(0, peak, { includeZero: true, tickCount: rings }) : chartAxis(Number.NaN, Number.NaN);\n }\n return chartAxis(Math.min(...values), peak, { includeZero: true, tickCount: rings });\n });\n\n /**\n * How far from the centre a value sits, in the viewBox, held to the scale: in proportion\n * to the value's share of the scale for a polygon, and to its square root for a wedge, so\n * a wedge's area — which grows with the square of its radius — is in proportion to the\n * value. The rings go through here too, so a ring labelled 25 out of 100 sits at half\n * the radius in the polar-area variant and a wedge reaching it has a quarter of the\n * outer ring's area.\n */\n private radius(value: number): number {\n const { min, max } = this.scale();\n const share = clamp((value - min) / (max - min), 0, 1);\n return RADIUS * (this.polar() ? Math.sqrt(share) : share);\n }\n\n /**\n * The shapes, one per series shown that has at least one value: its outline, whether\n * that outline is closed, and the point at each axis (`null` where the value is missing).\n * Nothing at all with fewer than three axes.\n *\n * A polygon is closed only with a value on every axis. In the polar-area variant the\n * outline is the silhouette of the series' wedges, which always closes, and the point\n * at an axis is the middle of that wedge's arc — where its dot goes and its value reads\n * against the rings.\n */\n protected readonly shapes = computed(() => {\n if (!this.drawable()) return [];\n const axes = this.axisGeometry();\n const polar = this.polar();\n const half = Math.PI / axes.length;\n return this.visibleSeries().flatMap(s => {\n const radii = s.values.map(v => (v === null ? null : this.radius(v)));\n const points = radii.map((r, a) => (r === null ? null : along(axes[a], r)));\n if (points.every(p => p === null)) return [];\n return [\n {\n index: s.index,\n color: s.color,\n dash: s.dash,\n points,\n closed: polar || points.every(p => p !== null),\n d: polar ? silhouette(axes, half, radii) : outline(points),\n },\n ];\n });\n });\n\n /**\n * The rings, from the outer one in: a polygon through every axis, or a circle while\n * there are fewer than three axes to follow — and always a circle in the polar-area\n * variant, whose wedges end in arcs. The centre is the scale's minimum and gets no ring.\n */\n protected readonly ringPaths = computed(() => {\n const { min, ticks } = this.scale();\n const axes = this.axisGeometry();\n const polygon = axes.length >= 3 && !this.polar();\n return ticks\n .filter(tick => tick > min)\n .map(tick => {\n const r = this.radius(tick);\n return polygon ? `M ${axes.map(axis => at(along(axis, r))).join(' L ')} Z` : circle(r);\n });\n });\n\n /**\n * A spoke per axis, from the centre to the outer ring: along the axis for a polygon,\n * and on the edge between two wedges in the polar-area variant, where a spoke through\n * the middle of a wedge would cut its area in two.\n */\n protected readonly spokes = computed(() => {\n const axes = this.axisGeometry();\n if (!this.polar()) return axes.map(axis => along(axis, RADIUS));\n const half = Math.PI / axes.length;\n return axes.map(axis => toward(axis.angle - half, RADIUS));\n });\n\n /**\n * The ring values, from the outer ring in, each with the height of its ring as a\n * percentage of the drawing, where the first axis crosses it. Decided for the whole\n * scale, as an axis' ticks are (`useChartNumbers().ticks`).\n *\n * In the polar-area variant the rings sit at square-root radii, which bunch towards the\n * outer ring, so a value closer than one line to the last one kept is left out, walking\n * inwards from the outer ring — whose value always stays — while its ring is still\n * drawn. The distance is in pixels of the drawing as laid out (`measured`), or of `size`\n * until a browser has measured it. The polygon's rings are evenly spaced, and `rings`\n * is how a host spaces them.\n */\n protected readonly ringLabels = computed(() => {\n const { min, ticks, step } = this.scale();\n const texts = this.numbers.ticks(ticks, step);\n const labels = ticks.flatMap((tick, i) => {\n if (tick <= min) return [];\n const r = this.radius(tick);\n return [{ text: texts[i], r, y: short(CENTRE - r) }];\n });\n if (!this.polar()) return labels;\n const { width, line } = this.measured() ?? { width: this.size(), line: LABEL_LINE };\n // One line, in the viewBox's units: the drawing is 100 of them wide.\n const room = (line / width) * 100;\n let kept = Number.POSITIVE_INFINITY;\n return labels.filter(label => {\n // A hair under a line still counts as one, so rounding never drops a value that fits.\n if (kept - label.r < room - 1e-6) return false;\n kept = label.r;\n return true;\n });\n });\n\n /**\n * Each axis name with the end of its spoke as percentages of the drawing (`x`, `y`) and\n * the direction it points (`cos`, `sin`): the stylesheet moves the label out from the\n * end along that direction and aligns it away from the centre — a name at three o'clock\n * starts at the spoke, one at twelve is centred over it.\n */\n protected readonly axisLabels = computed(() =>\n this.axisGeometry().map(axis => ({\n label: axis.label,\n x: short(CENTRE + RADIUS * axis.cos),\n y: short(CENTRE + RADIUS * axis.sin),\n cos: short(axis.cos),\n sin: short(axis.sin),\n }))\n );\n\n /** The legend's rows: every series, hidden ones included, keyed by its own dash. */\n protected readonly legendItems = computed<readonly WrChartLegendItem[]>(() =>\n this.resolvedSeries().map(({ label, color, dash }) => ({ label, color, dash }))\n );\n\n /**\n * The figures for `dataTable`: the drawing's name as the caption, a column per series\n * shown and a row per axis. Each cell is the series' own value, even where a fixed scale\n * draws it on the edge, written as the tooltip writes it, and empty where it is missing.\n * With every series hidden there is nothing to tabulate, and no rows.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const series = this.visibleSeries();\n const rows =\n series.length === 0\n ? []\n : this.axes().map((axis, a) => ({\n header: axis,\n cells: series.map(s => {\n const value = s.values[a];\n return value === null ? '' : this.numbers.value(value);\n }),\n }));\n return { caption: this.resolvedAriaLabel(), columns: series.map(s => s.label), groups: [{ rows }] };\n });\n\n /**\n * One tooltip for the whole chart, for the axis nearest the pointer: the axis' name as\n * its heading and a row per series shown with a value there. It points at the end of\n * the axis, on the side the axis faces — above for one in the top quarter, beside it\n * for the two at three and nine o'clock — so the chip sits outside the web, over the\n * axis' own name, which it repeats in full.\n *\n * The axis is chosen by POSITION, anywhere over the web: by angle, the nearest axis to\n * the pointer — in the polar-area variant, the axis whose wedges the pointer is over. So\n * the helper is told which axis any spot reads, and a pointer moving round the chart\n * scrubs from axis to axis.\n */\n protected readonly tip = useChartTooltip(\n this.tooltip,\n index => {\n const axis = this.axisGeometry()[index];\n const svg = this.svg()?.nativeElement;\n if (!this.drawable() || !axis || !svg) return null;\n const box = svg.getBoundingClientRect();\n const { cos, sin } = axis;\n // The drawing's y runs downwards, so a positive sine is the lower half.\n const side = Math.abs(cos) > Math.abs(sin) ? (cos > 0 ? 'right' : 'left') : sin > 0 ? 'bottom' : 'top';\n const rows = this.visibleSeries().flatMap(s => {\n const value = s.values[index];\n return value === null ? [] : [{ label: s.label, value: this.numbers.value(value), color: s.color }];\n });\n // An axis no series shown has a value on — every series hidden, or every one missing\n // there — has nothing to say but its own name, which is already on screen.\n if (rows.length === 0) return null;\n return {\n datum: { label: axis.label, value: '', rows },\n anchor: {\n x: box.left + ((CENTRE + RADIUS * cos) / 100) * box.width,\n y: box.top + ((CENTRE + RADIUS * sin) / 100) * box.height,\n },\n side,\n };\n },\n (x, y) => this.axisAt(x, y)\n );\n\n /**\n * What the open tooltip marks on the drawing: its axis' spoke, and a ring round every\n * series' value on it.\n */\n protected readonly hover = computed(() => {\n const index = this.tip.active();\n const axis = index === null ? undefined : this.axisGeometry()[index];\n if (index === null || !axis || !this.drawable()) return null;\n const points = this.shapes().flatMap(s => {\n const point = s.points[index];\n return point ? [{ index: s.index, color: s.color, d: this.dotPath(point) }] : [];\n });\n // No crosshair without a value on it to mark, as there is no chip.\n if (points.length === 0) return null;\n return { end: along(axis, RADIUS), points };\n });\n\n /**\n * The axis under the pointer, heard on the drawing. A MOUSE event, as every chart's is:\n * a tap fires the compatibility `mousemove` and no `pointermove`. Off the web — the\n * drawing's corners, outside the outer ring and its dots — the tooltip lets go.\n */\n protected onPointerMove(event: MouseEvent): void {\n const index = this.axisAt(event.clientX, event.clientY);\n if (index === null) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n /** A zero-length line at a point, which a round cap paints as a dot of the stroke's width. */\n protected dotPath(point: Point): string {\n return `M ${at(point)} h 0`;\n }\n\n /**\n * The axis nearest a viewport point by angle, measured from the drawing's centre, or\n * `null` past the outer ring (with room for its dots), with nothing drawn, with no box\n * laid out to measure, or on an axis no series shown has a value on — so the tooltip\n * lets go there as it does off the web.\n */\n private axisAt(clientX: number, clientY: number): number | null {\n const count = this.axes().length;\n const svg = this.svg()?.nativeElement;\n if (!this.drawable() || !svg) return null;\n const box = svg.getBoundingClientRect();\n if (box.width <= 0 || box.height <= 0) return null;\n const dx = clientX - (box.left + box.width / 2);\n const dy = clientY - (box.top + box.height / 2);\n if (Math.hypot(dx, dy) > (Math.min(box.width, box.height) / 2) * REACH) return null;\n // Clockwise from twelve o'clock, in [0, 2π).\n const turn = (Math.atan2(dy, dx) + Math.PI / 2 + 2 * Math.PI) % (2 * Math.PI);\n const index = Math.round(turn / ((2 * Math.PI) / count)) % count;\n return this.visibleSeries().some(s => s.values[index] !== null) ? index : null;\n }\n}\n\nexport type { WrRadarSeries, WrRadarVariant } from './types';\n","@let hovered = hover();\n<!-- The drawing, with the axis names in a gutter round it. The surface is as wide as the\n drawing; the gutter is its padding, and both label layers cover the drawing exactly,\n so a percentage of either is a percentage of the drawing. -->\n<div class=\"wr-radar-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper: `img` is a children-presentational\n role, and WebKit drops the whole subtree of one, which would take the axis names\n beside the drawing down with it. -->\n <svg\n #svg\n class=\"wr-radar-chart__svg\"\n viewBox=\"0 0 100 100\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showGrid()) {\n @for (d of ringPaths(); track $index) {\n <path class=\"wr-radar-chart__ring\" [attr.d]=\"d\" fill=\"none\" vector-effect=\"non-scaling-stroke\" />\n }\n @for (end of spokes(); track $index) {\n <line\n class=\"wr-radar-chart__spoke\"\n x1=\"50\"\n y1=\"50\"\n [attr.x2]=\"end.x\"\n [attr.y2]=\"end.y\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n }\n\n <!-- Every fill under every outline, so the outlines and their dashes stay on top\n wherever two series overlap. An open outline is never filled: filling it would\n close it across a value the series does not have. A polar-area outline is the\n silhouette of the series' wedges, which always closes, so it always fills. -->\n @if (showArea()) {\n @for (s of shapes(); track s.index) {\n @if (s.closed) {\n <path class=\"wr-radar-chart__area\" [attr.d]=\"s.d\" [attr.fill]=\"s.color\" stroke=\"none\" />\n }\n }\n }\n <!-- By position, not by label: two series may share one. -->\n @for (s of shapes(); track s.index) {\n <path\n class=\"wr-radar-chart__line\"\n [attr.d]=\"s.d\"\n fill=\"none\"\n [attr.stroke]=\"s.color\"\n [attr.stroke-dasharray]=\"s.dash || null\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n @if (showDots()) {\n @for (s of shapes(); track s.index) {\n @for (point of s.points; track $index) {\n <!-- A missing value gets no dot. A dot is a zero-length line with a round cap and\n a non-scaling stroke, so it stays a circle of the same pixels at any size. -->\n @if (point) {\n <path\n class=\"wr-radar-chart__dot\"\n [attr.d]=\"dotPath(point)\"\n fill=\"none\"\n [attr.stroke]=\"s.color\"\n stroke-linecap=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n }\n }\n }\n\n @if (hovered) {\n <line\n class=\"wr-radar-chart__crosshair\"\n x1=\"50\"\n y1=\"50\"\n [attr.x2]=\"hovered.end.x\"\n [attr.y2]=\"hovered.end.y\"\n vector-effect=\"non-scaling-stroke\"\n />\n <!-- A ring of the series' colour round a surface-coloured centre, drawn the way a dot\n is and for the same reason. -->\n @for (p of hovered.points; track p.index) {\n <path\n class=\"wr-radar-chart__hover-dot\"\n [attr.d]=\"p.d\"\n fill=\"none\"\n [attr.stroke]=\"p.color\"\n stroke-linecap=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n class=\"wr-radar-chart__hover-dot-center\"\n [attr.d]=\"p.d\"\n fill=\"none\"\n stroke-linecap=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n }\n </svg>\n\n @if (showGrid() && ringLabels().length > 0) {\n <!-- Hidden, as an axis' ticks are on every chart: the drawing's name is what is\n announced, and the figures are in the data table. -->\n <div class=\"wr-radar-chart__ring-labels\" aria-hidden=\"true\">\n @for (ring of ringLabels(); track $index) {\n <span class=\"wr-radar-chart__ring-label\" [style.--wr-radar-chart-y]=\"ring.y\">{{ ring.text }}</span>\n }\n </div>\n }\n\n @if (axisLabels().length > 0) {\n <!-- Real text beside the drawing, as the line chart's x labels are: each hands the\n stylesheet the end of its spoke and the way it points. -->\n <div class=\"wr-radar-chart__axis-labels\">\n @for (axis of axisLabels(); track $index) {\n <span\n class=\"wr-radar-chart__axis-label\"\n [style.--wr-radar-chart-x]=\"axis.x\"\n [style.--wr-radar-chart-y]=\"axis.y\"\n [style.--wr-radar-chart-cos]=\"axis.cos\"\n [style.--wr-radar-chart-sin]=\"axis.sin\"\n >{{ axis.label }}</span\n >\n }\n </div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the drawing's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n\n@if (showLegend() && legendItems().length > 0) {\n <!-- Every row keys its series by the series' own dash, as the outline is drawn. Rows are\n tracked by position, so two series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-radar-chart__legend\"\n [items]=\"legendItems()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AAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,oBAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,KAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-charts-radar-chart.mjs","names":[],"sources":["../../../projects/lib/charts/radar-chart/radar-chart.ts","../../../projects/lib/charts/radar-chart/radar-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n model,\n signal,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartLegend, type WrChartLegendItem } from 'ngwr/charts/chart-legend';\nimport {\n type WrChartAxis,\n WrChartTable,\n type WrChartTableData,\n wrChartAxis,\n wrChartColor,\n wrChartDash,\n useChartNumbers,\n} from 'ngwr/charts/core';\nimport { useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip } from 'ngwr/popover';\nimport { wrClamp, wrRound, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrRadarSeries, WrRadarVariant } from './types';\n\n/** The drawing's centre, in its 100 × 100 viewBox. */\nconst CENTRE = 50;\n\n/** The outer ring's radius, in the same units: the drawing's box is the outer ring's. */\nconst RADIUS = 50;\n\n/**\n * How far past the outer ring the pointer may stray and still read an axis, as a share\n * of the radius: the dots on the outer ring overhang it.\n */\nconst REACH = 1.1;\n\n/**\n * A ring value's line box in CSS pixels — `--wr-text-xs-leading`, which\n * `--wr-radar-chart-label-line-height` defaults to — until a browser has laid one out to\n * measure.\n */\nconst LABEL_LINE = 16;\n\n/** The nice-number ladder's mantissas: the steps a fitted scale snaps to, times a power of ten. */\nconst LADDER = [1, 2, 2.5, 5];\n\n/**\n * The ring step for an outer ring fixed at `max`: of the steps on the nice-number ladder\n * that divide `max` into a whole number of rings from 1 to 10, the one whose count is\n * nearest `rings`, and the fewer rings on a tie. A rating out of 5 gets a ring per point,\n * a score out of 100 a ring per 25. Only a `max` no step on the ladder divides — an outer\n * ring of 37 — is cut into `rings` equal parts.\n */\nfunction fixedStep(max: number, rings: number): number {\n let best = max / rings;\n let distance = Number.POSITIVE_INFINITY;\n const top = Math.floor(Math.log10(max));\n // From the finest step to the coarsest, so a tie lands on the fewer rings. A step from\n // a tenth of `max` up to `max` gives 10 rings down to 1; one either side is room for\n // `log10` landing off by one at a power of ten.\n for (let e = top - 2; e <= top + 1; e++) {\n for (const mantissa of LADDER) {\n // Divided rather than multiplied below one, so 0.1 is the literal and not 1 × 10⁻¹.\n const step = e >= 0 ? mantissa * 10 ** e : mantissa / 10 ** -e;\n const count = Math.round(max / step);\n if (count < 1 || count > 10 || Math.abs(count * step - max) > max * 1e-9) continue;\n const off = Math.abs(count - rings);\n if (off > distance) continue;\n best = step;\n distance = off;\n }\n }\n return best;\n}\n\n/** A point in the viewBox. */\ninterface Point {\n readonly x: number;\n readonly y: number;\n}\n\n/** One axis: its name, its angle from three o'clock, clockwise, and the unit vector it runs along. */\ninterface Axis {\n readonly label: string;\n readonly angle: number;\n readonly cos: number;\n readonly sin: number;\n}\n\n/** A coordinate as a path writes it. */\nconst fixed = (value: number): string => value.toFixed(2);\n\n/** A number for an inline style, to four decimals with `-0` folded to `0`, so the style stays short. */\nconst short = (value: number): number => Math.round(value * 1e4) / 1e4 || 0;\n\nconst at = (point: Point): string => `${fixed(point.x)} ${fixed(point.y)}`;\n\nconst along = (axis: Axis, r: number): Point => ({ x: CENTRE + r * axis.cos, y: CENTRE + r * axis.sin });\n\n/** The point `r` out from the centre at `angle`, clockwise from three o'clock. */\nconst toward = (angle: number, r: number): Point => ({\n x: CENTRE + r * Math.cos(angle),\n y: CENTRE + r * Math.sin(angle),\n});\n\n/**\n * A polar-area series' outline: the silhouette of its wedges, walked once round. Each\n * wedge is an arc of its own radius across its slice — `half` either side of its axis —\n * and the step from one wedge to the next is a straight run along the edge they share.\n * A wedge with no area (`null` or `0`) is the centre, so the walk dips to it there and\n * draws no arc: a missing value invents nothing, and its neighbours keep their edges.\n *\n * One closed path rather than a closed wedge per value, because two wedges side by side\n * share an edge: stroked twice, at two different dash phases, the dashes fill each\n * other's gaps and the edge reads solid, which is the one channel besides hue that tells\n * two series apart. The fill is the same path, which is every wedge's area at once.\n *\n * With three axes or more a slice spans 120° at most, so every arc is the small one, and\n * it sweeps clockwise as the axes run.\n */\nfunction silhouette(axes: readonly Axis[], half: number, radii: readonly (number | null)[]): string {\n const commands: string[] = [];\n let last = '';\n const to = (point: Point): void => {\n const next = at(point);\n if (next !== last) commands.push(`${commands.length === 0 ? 'M' : 'L'} ${next}`);\n last = next;\n };\n radii.forEach((radius, a) => {\n const r = radius ?? 0;\n to(toward(axes[a].angle - half, r));\n if (r <= 0) return;\n last = at(toward(axes[a].angle + half, r));\n commands.push(`A ${fixed(r)} ${fixed(r)} 0 0 1 ${last}`);\n });\n return `${commands.join(' ')} Z`;\n}\n\n/** A ring with no polygon to follow — fewer than three axes — as a circle: two arcs, since one arc back to its start draws nothing. */\nconst circle = (r: number): string =>\n `M ${fixed(CENTRE - r)} ${CENTRE} A ${fixed(r)} ${fixed(r)} 0 1 0 ${fixed(CENTRE + r)} ${CENTRE} ` +\n `A ${fixed(r)} ${fixed(r)} 0 1 0 ${fixed(CENTRE - r)} ${CENTRE} Z`;\n\n/**\n * A series' outline: closed through every axis when it has a value on each, and open\n * across every missing one otherwise — one subpath per unbroken run, walked once round\n * from the first gap, so a run that wraps past the last axis to the first is one stroke.\n * A run of one point repeats it, since a subpath of a single `M` is not stroked at all and\n * the value would vanish with `showDots` off; the round cap paints it as a dot.\n */\nfunction outline(points: readonly (Point | null)[]): string {\n const gap = points.indexOf(null);\n if (gap === -1) return `M ${points.map(p => at(p!)).join(' L ')} Z`;\n\n const commands: string[] = [];\n let run: Point[] = [];\n const flush = (): void => {\n if (run.length === 1) commands.push(`M ${at(run[0])} L ${at(run[0])}`);\n else if (run.length > 1) commands.push(`M ${run.map(at).join(' L ')}`);\n run = [];\n };\n for (let k = 1; k <= points.length; k++) {\n const point = points[(gap + k) % points.length];\n if (point === null) flush();\n else run.push(point);\n }\n flush();\n return commands.join(' ');\n}\n\n/**\n * Radar chart: several series over the same axes, each a polygon on a polar grid — or,\n * with `variant=\"polar-area\"`, a wedge per axis whose area is the value. For comparing a\n * few profiles — products, players, releases — across the same handful of measures.\n * SVG-only — no external dependency.\n *\n * @example\n * ```html\n * <wr-radar-chart\n * [axes]=\"['Speed', 'Power', 'Range', 'Comfort', 'Price']\"\n * [series]=\"[\n * { label: 'Model A', data: [80, 65, 70, 90, 55] },\n * { label: 'Model B', data: [60, 85, 75, 60, 80] }\n * ]\"\n * [max]=\"100\"\n * />\n * ```\n *\n * **The geometry.** The first axis points to twelve o'clock and the rest follow\n * clockwise, evenly spaced. The scale runs from the centre to the outer ring and\n * includes zero, its rings on readable steps (`max` and `rings`), and every series is a\n * polygon in its colour and its own dash: the default palette's colours sit within\n * about 1.06:1 of each other in luminance, so a dash is what tells two outlines apart\n * without hue, the line chart's remedy. The fills sit under every outline.\n *\n * **A missing value is a gap, never a guess.** A `null`, a value that is not a finite\n * number, or one a shorter `data` does not reach, breaks the outline on either side of\n * its axis and the series is drawn OPEN and UNFILLED: closing the polygon across the gap\n * would draw a reading the data never took, and filling an open outline means closing it.\n *\n * **`variant=\"polar-area\"` draws wedges instead of polygons.** Each axis owns an equal\n * slice of the circle, centred on it, and each series draws one wedge per value there,\n * the series overlaid with their fills translucent and their outlines in their own\n * dashes — one outline round each series' wedges, so the edge two wedges share is\n * stroked once and its dash survives. The value is the wedge's AREA: every wedge has the\n * same angle, so its area grows with the square of its radius, and the radius is the\n * square ROOT of the value's share of the scale — twice the value is twice the ink, where\n * a radius proportional to the value would paint four times as much. The rings are\n * circles, labelled with values, and they bunch towards the outside for the same reason,\n * so a ring value that would sit closer than a line to the one outside it is left out\n * and its ring still drawn. The scale starts at zero: a wedge grows from the centre, so\n * a negative value has no area and sits at the centre, and the tooltip and the data\n * table keep its figure. A missing value is a missing wedge, and every other wedge of\n * the series is drawn and filled, since each stands on its own value. The spokes run\n * between the wedges rather than through them.\n *\n * **Labels are HTML beside the drawing**, so they keep their size at any `size`: the axis\n * names sit outside the outer ring, in a gutter round the drawing, each aligned away from\n * the centre and ellipsised past the room it has — the tooltip and the data table carry\n * the whole name. The ring values sit beside the first axis and are `aria-hidden`, as an\n * axis' ticks are on every chart here. The drawing keeps its clockwise order under RTL,\n * as every SVG chart here keeps its own — the HTML layouts (bar, bullet, treemap) are the\n * ones that mirror — and the labels follow the drawing.\n *\n * **What a screen reader gets.** The drawing is one named `role=\"img\"` — on the `<svg>`\n * itself, as on the donut, since WebKit drops the whole subtree of an `img` wrapper and\n * the axis names are real text beside it. The numbers are in text only in the tooltip,\n * which is pointer only, and in the data table `dataTable` renders: say them in\n * `ariaLabel`, or turn the table on. No part of the chart is a tab stop, unless\n * `toggleableLegend` makes the legend rows buttons.\n *\n * With fewer than three axes there is no polygon to draw: the chart draws the grid\n * alone and says so in dev mode.\n *\n * The legend is a `ul[wr-chart-legend]` (`ngwr/charts/chart-legend`), and with\n * `toggleableLegend` its rows show and hide their series through `hiddenSeries`.\n *\n * @see https://ngwr.dev/charts/radar-chart\n */\n@Component({\n selector: 'wr-radar-chart',\n templateUrl: './radar-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-radar-chart',\n '[class.wr-radar-chart--polygon]': '!polar()',\n '[class.wr-radar-chart--polar-area]': 'polar()',\n },\n imports: [WrChartLegend, WrChartTable],\n})\nexport class WrRadarChart {\n /**\n * The axes' names, clockwise from twelve o'clock. A series takes one value per axis,\n * in this order. Three at least: with fewer the chart draws the grid and no series.\n */\n readonly axes = input<readonly string[]>([]);\n\n /**\n * One polygon per series. A series with no `color` takes the next entry from the\n * chart's palette, and each takes the next dash, the first one solid.\n */\n readonly series = input<readonly WrRadarSeries[]>([]);\n\n /**\n * How the series are drawn. `'polygon'` joins each series' values into a polygon, one\n * vertex per axis. `'polar-area'` gives each axis an equal-angle wedge per series whose\n * AREA is the value — the radius grows with the square root of the value, so the ink\n * a wedge paints is proportional to what it stands for — with the series overlaid. The\n * legend, the toggle, the tooltip and the data table are the same in both.\n * @default 'polygon'\n */\n readonly variant = input<WrRadarVariant>('polygon');\n\n /**\n * Accessible name of the drawing. The shapes carry no text and the legend has the\n * series names only, so this is where to say what the chart shows — or turn on\n * `dataTable`. Falls back to `radarChart.label`, or to `radarChart.polarAreaLabel` in\n * the polar-area variant, which is also the data table's caption.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly polygonAriaLabel = useI18nText(this.ariaLabel, 'radarChart.label', 'Radar chart');\n\n private readonly polarAreaAriaLabel = useI18nText(this.ariaLabel, 'radarChart.polarAreaLabel', 'Polar area chart');\n\n protected readonly resolvedAriaLabel = computed(() =>\n this.polar() ? this.polarAreaAriaLabel() : this.polygonAriaLabel()\n );\n\n /**\n * The value of the outer ring. `0` fits the scale to the series shown, on a readable\n * step and including zero; a value above `0` fixes it, from zero at the centre — a score\n * out of 100, a rating out of 5 — with its rings on a readable step that divides it (see\n * `rings`). A value outside a fixed scale is drawn on its edge, and the tooltip and the\n * data table still give its own figure. @default 0\n */\n readonly max = input(0, {\n transform: (v: unknown): number => {\n const value = coerceNumberProperty(v, 0);\n return Number.isFinite(value) ? Math.max(0, value) : 0;\n },\n });\n\n /**\n * About how many rings the grid draws between the centre and the outer ring, each on a\n * readable step — 1, 2, 2.5 or 5 times a power of ten. A fitted scale aims for this many\n * and rounds its step up onto that ladder. A fixed `max` takes the step that divides it into the count\n * nearest this one, the fewer on a tie, so a rating out of 5 gets a ring per point and a\n * score out of 100 a ring per 25; only a `max` that no such step divides, such as 37,\n * is cut into exactly this many equal rings. Whole numbers from 1 to 10. @default 4\n */\n readonly rings = input(4, {\n transform: (v: unknown): number => {\n const value = Math.round(coerceNumberProperty(v, 4));\n return Number.isFinite(value) ? wrClamp(value, 1, 10) : 4;\n },\n });\n\n /**\n * The drawing's diameter in CSS pixels, at least 120. The axis names sit in a gutter\n * round it, so the chart is wider than this by the gutter on either side; in a narrower\n * container the drawing shrinks to fit. @default 280\n */\n readonly size = input(280, {\n transform: (v: unknown): number => {\n const value = coerceNumberProperty(v, 280);\n return Number.isFinite(value) ? Math.max(120, value) : 280;\n },\n });\n\n /** Show the rings, the spokes and the ring values. The axis names stay. @default true */\n readonly showGrid = input(true, { 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 series, through\n * `hiddenSeries`. A row is a `<button aria-pressed>`, pressed while its series is\n * shown, so the legend becomes one tab stop per series. @default false\n */\n readonly toggleableLegend = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The positions in `series` of the series that are hidden. Positions rather than\n * labels, since two series may share a label. A toggleable legend writes it, and a\n * host may bind it with or without one: `[(hiddenSeries)]`.\n *\n * A hidden series is left out of everything that reads its values: it draws no\n * polygon and no dots, it has no row in the tooltip and no column in the data table,\n * and a fitted scale is fitted to the series still shown. The axes do not change, since\n * they belong to the chart rather than to one series. The legend keeps the hidden\n * series' row, struck through, so it can be shown again; the row says \"hidden\" to a\n * screen reader as well. A position past the end of `series` is kept and ignored.\n */\n readonly hiddenSeries = model<readonly number[]>([]);\n\n /**\n * Show a dot at every value: on the polygon's vertex, or in the polar-area variant on\n * the middle of the wedge's arc, where the value reads against the rings. @default true\n */\n readonly showDots = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Fill each closed polygon with its colour, faintly (`--wr-radar-chart-area-opacity`),\n * under every outline — the name the line chart and the sparkline give the same fill. A\n * series with a missing value is never filled, whatever this says: its outline is open.\n * In the polar-area variant every wedge is filled, since the outline round them always\n * closes, and a missing value is a missing wedge. @default true\n */\n readonly showArea = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip for the axis nearest the pointer: its name, and every series' value\n * on it; an axis no series shown has a value on opens none. Pointer only — the data\n * table is where the same numbers are for a keyboard or a screen reader. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Writes every number the chart shows: the ring values, the tooltip and the data\n * table. `null` uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ring values\n * (`1.2K`) unless the full numbers are shorter.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /**\n * Render the chart's figures as a table that only assistive technology reaches: a row\n * per axis, headed by its name, and a column per series shown, every value written the\n * way the tooltip writes it. A missing value is an empty cell.\n *\n * The drawing is one named `role=\"img\"`, which hides everything inside it, so without\n * the table the numbers are nowhere a screen reader can walk. It is rendered beside the\n * drawing, clipped to nothing: it takes no room, draws nothing and holds no tab stop.\n * A hidden series leaves it. @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /** The ring values' compact ticks and the exact figures, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The drawing's laid-out width and a ring value's line box, both in CSS pixels, once a\n * browser has measured them: the drawing shrinks below `size` in a narrow container, and\n * how close two ring values may sit is a question of pixels, not of the viewBox.\n */\n private readonly measured = signal<{ readonly width: number; readonly line: number } | null>(null);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/radar-chart');\n const destroyRef = inject(DestroyRef);\n // Measured after render, so the server and the first paint assume `size` and a 16px\n // line, and nothing here touches the DOM before a browser has one.\n afterNextRender(() => {\n const svg = this.svg()?.nativeElement;\n if (!svg || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(([entry]) => {\n const width = entry.contentRect.width;\n // A hidden chart measures nothing; keep the last reading rather than thin to it.\n if (width <= 0) return;\n const label = this.host.nativeElement.querySelector('.wr-radar-chart__ring-label');\n // No value laid out — `showGrid` off — measures 0: keep the line already known.\n const height = label?.getBoundingClientRect().height ?? 0;\n const last = this.measured();\n const line = height > 0 ? height : (last?.line ?? LABEL_LINE);\n if (last?.width === width && last.line === line) return;\n this.measured.set({ width, line });\n });\n observer.observe(svg);\n destroyRef.onDestroy(() => observer.disconnect());\n });\n\n // A radar of two axes is a line and one of one a point, so neither can hold a\n // polygon; the chart draws the grid and nothing else, which on screen looks like\n // data that failed to load rather than a refusal.\n if (isDevMode()) {\n let warned: number | null = null;\n effect(() => {\n const count = this.axes().length;\n if (count >= 3 || this.series().length === 0 || warned === count) return;\n warned = count;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-radar-chart>: a radar needs at least three axes to draw a series, and it was given ${count}. ` +\n 'It draws the grid alone.'\n );\n });\n }\n }\n\n /** Every axis, clockwise from twelve o'clock: the drawing's y runs downwards, so a growing angle turns clockwise. */\n private readonly axisGeometry = computed<readonly Axis[]>(() => {\n const axes = this.axes();\n return axes.map((label, i) => {\n const angle = -Math.PI / 2 + (i * 2 * Math.PI) / axes.length;\n return { label, angle, cos: Math.cos(angle), sin: Math.sin(angle) };\n });\n });\n\n /** Whether the series are wedges rather than polygons. Anything but `'polar-area'` is the polygon. */\n protected readonly polar = computed(() => this.variant() === 'polar-area');\n\n /**\n * Whether there are axes enough for a polygon: three make the smallest one. The\n * polar-area variant keeps the same floor, so the two draw the same data.\n */\n private readonly drawable = computed(() => this.axes().length >= 3);\n\n /**\n * Every series, resolved: its palette colour, its dash, and one value per axis with\n * `null` where it is missing. Hidden ones included, since the legend lists them.\n */\n private readonly resolvedSeries = computed(() => {\n const count = this.axes().length;\n return this.series().map((s, index) => ({\n index,\n label: s.label,\n color: s.color ?? wrChartColor(index),\n dash: wrChartDash(index),\n values: Array.from({ length: count }, (_, a): number | null => {\n const value = s.data[a];\n return typeof value === 'number' && Number.isFinite(value) ? value : null;\n }),\n }));\n });\n\n /** The series drawn, read and fitted to: every one `hiddenSeries` does not name. */\n private readonly visibleSeries = computed(() => {\n const hidden = new Set(this.hiddenSeries());\n return this.resolvedSeries().filter(s => !hidden.has(s.index));\n });\n\n /**\n * The scale from the centre to the outer ring. A fixed `max` runs from zero, its rings\n * on the readable step that divides it (`fixedStep`). Otherwise it is `wrChartAxis` over\n * the series shown, including zero: the centre is zero unless a value is negative, and\n * then the scale's own minimum, which a radar shows as a smaller polygon rather than as\n * anything below a baseline — readable, and worth a fixed `max` where negative values\n * are the norm. The polar-area variant always starts at zero, since a wedge grows from\n * the centre: it is fitted to the largest value alone, and a negative value has no area.\n * With nothing to fit — or, for wedges, nothing above zero — it is the empty 0 to 1 frame.\n */\n private readonly scale = computed<WrChartAxis>(() => {\n const explicit = this.max();\n const rings = this.rings();\n if (explicit > 0) {\n const step = fixedStep(explicit, rings);\n const count = Math.round(explicit / step);\n const ticks = Array.from({ length: count + 1 }, (_, i) => wrRound(explicit - i * step, 6));\n return { min: 0, max: explicit, step, ticks };\n }\n const values = this.visibleSeries().flatMap(s => s.values.filter((v): v is number => v !== null));\n if (values.length === 0) return wrChartAxis(Number.NaN, Number.NaN);\n const peak = Math.max(...values);\n if (this.polar()) {\n return peak > 0\n ? wrChartAxis(0, peak, { includeZero: true, tickCount: rings })\n : wrChartAxis(Number.NaN, Number.NaN);\n }\n return wrChartAxis(Math.min(...values), peak, { includeZero: true, tickCount: rings });\n });\n\n /**\n * How far from the centre a value sits, in the viewBox, held to the scale: in proportion\n * to the value's share of the scale for a polygon, and to its square root for a wedge, so\n * a wedge's area — which grows with the square of its radius — is in proportion to the\n * value. The rings go through here too, so a ring labelled 25 out of 100 sits at half\n * the radius in the polar-area variant and a wedge reaching it has a quarter of the\n * outer ring's area.\n */\n private radius(value: number): number {\n const { min, max } = this.scale();\n const share = wrClamp((value - min) / (max - min), 0, 1);\n return RADIUS * (this.polar() ? Math.sqrt(share) : share);\n }\n\n /**\n * The shapes, one per series shown that has at least one value: its outline, whether\n * that outline is closed, and the point at each axis (`null` where the value is missing).\n * Nothing at all with fewer than three axes.\n *\n * A polygon is closed only with a value on every axis. In the polar-area variant the\n * outline is the silhouette of the series' wedges, which always closes, and the point\n * at an axis is the middle of that wedge's arc — where its dot goes and its value reads\n * against the rings.\n */\n protected readonly shapes = computed(() => {\n if (!this.drawable()) return [];\n const axes = this.axisGeometry();\n const polar = this.polar();\n const half = Math.PI / axes.length;\n return this.visibleSeries().flatMap(s => {\n const radii = s.values.map(v => (v === null ? null : this.radius(v)));\n const points = radii.map((r, a) => (r === null ? null : along(axes[a], r)));\n if (points.every(p => p === null)) return [];\n return [\n {\n index: s.index,\n color: s.color,\n dash: s.dash,\n points,\n closed: polar || points.every(p => p !== null),\n d: polar ? silhouette(axes, half, radii) : outline(points),\n },\n ];\n });\n });\n\n /**\n * The rings, from the outer one in: a polygon through every axis, or a circle while\n * there are fewer than three axes to follow — and always a circle in the polar-area\n * variant, whose wedges end in arcs. The centre is the scale's minimum and gets no ring.\n */\n protected readonly ringPaths = computed(() => {\n const { min, ticks } = this.scale();\n const axes = this.axisGeometry();\n const polygon = axes.length >= 3 && !this.polar();\n return ticks\n .filter(tick => tick > min)\n .map(tick => {\n const r = this.radius(tick);\n return polygon ? `M ${axes.map(axis => at(along(axis, r))).join(' L ')} Z` : circle(r);\n });\n });\n\n /**\n * A spoke per axis, from the centre to the outer ring: along the axis for a polygon,\n * and on the edge between two wedges in the polar-area variant, where a spoke through\n * the middle of a wedge would cut its area in two.\n */\n protected readonly spokes = computed(() => {\n const axes = this.axisGeometry();\n if (!this.polar()) return axes.map(axis => along(axis, RADIUS));\n const half = Math.PI / axes.length;\n return axes.map(axis => toward(axis.angle - half, RADIUS));\n });\n\n /**\n * The ring values, from the outer ring in, each with the height of its ring as a\n * percentage of the drawing, where the first axis crosses it. Decided for the whole\n * scale, as an axis' ticks are (`useChartNumbers().ticks`).\n *\n * In the polar-area variant the rings sit at square-root radii, which bunch towards the\n * outer ring, so a value closer than one line to the last one kept is left out, walking\n * inwards from the outer ring — whose value always stays — while its ring is still\n * drawn. The distance is in pixels of the drawing as laid out (`measured`), or of `size`\n * until a browser has measured it. The polygon's rings are evenly spaced, and `rings`\n * is how a host spaces them.\n */\n protected readonly ringLabels = computed(() => {\n const { min, ticks, step } = this.scale();\n const texts = this.numbers.ticks(ticks, step);\n const labels = ticks.flatMap((tick, i) => {\n if (tick <= min) return [];\n const r = this.radius(tick);\n return [{ text: texts[i], r, y: short(CENTRE - r) }];\n });\n if (!this.polar()) return labels;\n const { width, line } = this.measured() ?? { width: this.size(), line: LABEL_LINE };\n // One line, in the viewBox's units: the drawing is 100 of them wide.\n const room = (line / width) * 100;\n let kept = Number.POSITIVE_INFINITY;\n return labels.filter(label => {\n // A hair under a line still counts as one, so rounding never drops a value that fits.\n if (kept - label.r < room - 1e-6) return false;\n kept = label.r;\n return true;\n });\n });\n\n /**\n * Each axis name with the end of its spoke as percentages of the drawing (`x`, `y`) and\n * the direction it points (`cos`, `sin`): the stylesheet moves the label out from the\n * end along that direction and aligns it away from the centre — a name at three o'clock\n * starts at the spoke, one at twelve is centred over it.\n */\n protected readonly axisLabels = computed(() =>\n this.axisGeometry().map(axis => ({\n label: axis.label,\n x: short(CENTRE + RADIUS * axis.cos),\n y: short(CENTRE + RADIUS * axis.sin),\n cos: short(axis.cos),\n sin: short(axis.sin),\n }))\n );\n\n /** The legend's rows: every series, hidden ones included, keyed by its own dash. */\n protected readonly legendItems = computed<readonly WrChartLegendItem[]>(() =>\n this.resolvedSeries().map(({ label, color, dash }) => ({ label, color, dash }))\n );\n\n /**\n * The figures for `dataTable`: the drawing's name as the caption, a column per series\n * shown and a row per axis. Each cell is the series' own value, even where a fixed scale\n * draws it on the edge, written as the tooltip writes it, and empty where it is missing.\n * With every series hidden there is nothing to tabulate, and no rows.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const series = this.visibleSeries();\n const rows =\n series.length === 0\n ? []\n : this.axes().map((axis, a) => ({\n header: axis,\n cells: series.map(s => {\n const value = s.values[a];\n return value === null ? '' : this.numbers.value(value);\n }),\n }));\n return { caption: this.resolvedAriaLabel(), columns: series.map(s => s.label), groups: [{ rows }] };\n });\n\n /**\n * One tooltip for the whole chart, for the axis nearest the pointer: the axis' name as\n * its heading and a row per series shown with a value there. It points at the end of\n * the axis, on the side the axis faces — above for one in the top quarter, beside it\n * for the two at three and nine o'clock — so the chip sits outside the web, over the\n * axis' own name, which it repeats in full.\n *\n * The axis is chosen by POSITION, anywhere over the web: by angle, the nearest axis to\n * the pointer — in the polar-area variant, the axis whose wedges the pointer is over. So\n * the helper is told which axis any spot reads, and a pointer moving round the chart\n * scrubs from axis to axis.\n */\n protected readonly tip = useChartTooltip(\n this.tooltip,\n index => {\n const axis = this.axisGeometry()[index];\n const svg = this.svg()?.nativeElement;\n if (!this.drawable() || !axis || !svg) return null;\n const box = svg.getBoundingClientRect();\n const { cos, sin } = axis;\n // The drawing's y runs downwards, so a positive sine is the lower half.\n const side = Math.abs(cos) > Math.abs(sin) ? (cos > 0 ? 'right' : 'left') : sin > 0 ? 'bottom' : 'top';\n const rows = this.visibleSeries().flatMap(s => {\n const value = s.values[index];\n return value === null ? [] : [{ label: s.label, value: this.numbers.value(value), color: s.color }];\n });\n // An axis no series shown has a value on — every series hidden, or every one missing\n // there — has nothing to say but its own name, which is already on screen.\n if (rows.length === 0) return null;\n return {\n datum: { label: axis.label, value: '', rows },\n anchor: {\n x: box.left + ((CENTRE + RADIUS * cos) / 100) * box.width,\n y: box.top + ((CENTRE + RADIUS * sin) / 100) * box.height,\n },\n side,\n };\n },\n (x, y) => this.axisAt(x, y)\n );\n\n /**\n * What the open tooltip marks on the drawing: its axis' spoke, and a ring round every\n * series' value on it.\n */\n protected readonly hover = computed(() => {\n const index = this.tip.active();\n const axis = index === null ? undefined : this.axisGeometry()[index];\n if (index === null || !axis || !this.drawable()) return null;\n const points = this.shapes().flatMap(s => {\n const point = s.points[index];\n return point ? [{ index: s.index, color: s.color, d: this.dotPath(point) }] : [];\n });\n // No crosshair without a value on it to mark, as there is no chip.\n if (points.length === 0) return null;\n return { end: along(axis, RADIUS), points };\n });\n\n /**\n * The axis under the pointer, heard on the drawing. A MOUSE event, as every chart's is:\n * a tap fires the compatibility `mousemove` and no `pointermove`. Off the web — the\n * drawing's corners, outside the outer ring and its dots — the tooltip lets go.\n */\n protected onPointerMove(event: MouseEvent): void {\n const index = this.axisAt(event.clientX, event.clientY);\n if (index === null) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n /** A zero-length line at a point, which a round cap paints as a dot of the stroke's width. */\n protected dotPath(point: Point): string {\n return `M ${at(point)} h 0`;\n }\n\n /**\n * The axis nearest a viewport point by angle, measured from the drawing's centre, or\n * `null` past the outer ring (with room for its dots), with nothing drawn, with no box\n * laid out to measure, or on an axis no series shown has a value on — so the tooltip\n * lets go there as it does off the web.\n */\n private axisAt(clientX: number, clientY: number): number | null {\n const count = this.axes().length;\n const svg = this.svg()?.nativeElement;\n if (!this.drawable() || !svg) return null;\n const box = svg.getBoundingClientRect();\n if (box.width <= 0 || box.height <= 0) return null;\n const dx = clientX - (box.left + box.width / 2);\n const dy = clientY - (box.top + box.height / 2);\n if (Math.hypot(dx, dy) > (Math.min(box.width, box.height) / 2) * REACH) return null;\n // Clockwise from twelve o'clock, in [0, 2π).\n const turn = (Math.atan2(dy, dx) + Math.PI / 2 + 2 * Math.PI) % (2 * Math.PI);\n const index = Math.round(turn / ((2 * Math.PI) / count)) % count;\n return this.visibleSeries().some(s => s.values[index] !== null) ? index : null;\n }\n}\n\nexport type { WrRadarSeries, WrRadarVariant } from './types';\n","@let hovered = hover();\n<!-- The drawing, with the axis names in a gutter round it. The surface is as wide as the\n drawing; the gutter is its padding, and both label layers cover the drawing exactly,\n so a percentage of either is a percentage of the drawing. -->\n<div class=\"wr-radar-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper: `img` is a children-presentational\n role, and WebKit drops the whole subtree of one, which would take the axis names\n beside the drawing down with it. -->\n <svg\n #svg\n class=\"wr-radar-chart__svg\"\n viewBox=\"0 0 100 100\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showGrid()) {\n @for (d of ringPaths(); track $index) {\n <path class=\"wr-radar-chart__ring\" [attr.d]=\"d\" fill=\"none\" vector-effect=\"non-scaling-stroke\" />\n }\n @for (end of spokes(); track $index) {\n <line\n class=\"wr-radar-chart__spoke\"\n x1=\"50\"\n y1=\"50\"\n [attr.x2]=\"end.x\"\n [attr.y2]=\"end.y\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n }\n\n <!-- Every fill under every outline, so the outlines and their dashes stay on top\n wherever two series overlap. An open outline is never filled: filling it would\n close it across a value the series does not have. A polar-area outline is the\n silhouette of the series' wedges, which always closes, so it always fills. -->\n @if (showArea()) {\n @for (s of shapes(); track s.index) {\n @if (s.closed) {\n <path class=\"wr-radar-chart__area\" [attr.d]=\"s.d\" [attr.fill]=\"s.color\" stroke=\"none\" />\n }\n }\n }\n <!-- By position, not by label: two series may share one. -->\n @for (s of shapes(); track s.index) {\n <path\n class=\"wr-radar-chart__line\"\n [attr.d]=\"s.d\"\n fill=\"none\"\n [attr.stroke]=\"s.color\"\n [attr.stroke-dasharray]=\"s.dash || null\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n @if (showDots()) {\n @for (s of shapes(); track s.index) {\n @for (point of s.points; track $index) {\n <!-- A missing value gets no dot. A dot is a zero-length line with a round cap and\n a non-scaling stroke, so it stays a circle of the same pixels at any size. -->\n @if (point) {\n <path\n class=\"wr-radar-chart__dot\"\n [attr.d]=\"dotPath(point)\"\n fill=\"none\"\n [attr.stroke]=\"s.color\"\n stroke-linecap=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n }\n }\n }\n\n @if (hovered) {\n <line\n class=\"wr-radar-chart__crosshair\"\n x1=\"50\"\n y1=\"50\"\n [attr.x2]=\"hovered.end.x\"\n [attr.y2]=\"hovered.end.y\"\n vector-effect=\"non-scaling-stroke\"\n />\n <!-- A ring of the series' colour round a surface-coloured centre, drawn the way a dot\n is and for the same reason. -->\n @for (p of hovered.points; track p.index) {\n <path\n class=\"wr-radar-chart__hover-dot\"\n [attr.d]=\"p.d\"\n fill=\"none\"\n [attr.stroke]=\"p.color\"\n stroke-linecap=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n <path\n class=\"wr-radar-chart__hover-dot-center\"\n [attr.d]=\"p.d\"\n fill=\"none\"\n stroke-linecap=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n }\n </svg>\n\n @if (showGrid() && ringLabels().length > 0) {\n <!-- Hidden, as an axis' ticks are on every chart: the drawing's name is what is\n announced, and the figures are in the data table. -->\n <div class=\"wr-radar-chart__ring-labels\" aria-hidden=\"true\">\n @for (ring of ringLabels(); track $index) {\n <span class=\"wr-radar-chart__ring-label\" [style.--wr-radar-chart-y]=\"ring.y\">{{ ring.text }}</span>\n }\n </div>\n }\n\n @if (axisLabels().length > 0) {\n <!-- Real text beside the drawing, as the line chart's x labels are: each hands the\n stylesheet the end of its spoke and the way it points. -->\n <div class=\"wr-radar-chart__axis-labels\">\n @for (axis of axisLabels(); track $index) {\n <span\n class=\"wr-radar-chart__axis-label\"\n [style.--wr-radar-chart-x]=\"axis.x\"\n [style.--wr-radar-chart-y]=\"axis.y\"\n [style.--wr-radar-chart-cos]=\"axis.cos\"\n [style.--wr-radar-chart-sin]=\"axis.sin\"\n >{{ axis.label }}</span\n >\n }\n </div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the drawing's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n\n@if (showLegend() && legendItems().length > 0) {\n <!-- Every row keys its series by the series' own dash, as the outline is drawn. Rows are\n tracked by position, so two series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-radar-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n}\n"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAM,SAAS;AAGf,MAAM,SAAS;AAMf,MAAM,QAAQ;AAOd,MAAM,aAAa;AAGnB,MAAM,SAAS;CAAC;CAAG;CAAG;CAAK;AAAC;AAS5B,SAAS,UAAU,KAAa,OAAa;CAC3C,IAAI,OAAO,MAAM;CACjB,IAAI,WA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;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,KAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -1,10 +1,10 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { Component, LOCALE_ID, ViewEncapsulation, computed, inject, input, model, viewChild } from "@angular/core";
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
- import { round, wrCheckStyles } from "ngwr/utils";
4
+ import { wrCheckStyles, wrRound } from "ngwr/utils";
5
5
  import { useI18nText } from "ngwr/i18n";
6
6
  import { WrChartLegend } from "ngwr/charts/chart-legend";
7
- import { WrChartTable, chartAxis, chartColor, chartMarker, chartMarkerExtent, chartMarkerPath, useChartNumbers } from "ngwr/charts/core";
7
+ import { WrChartTable, useChartNumbers, wrChartAxis, wrChartColor, wrChartMarker, wrChartMarkerExtent, wrChartMarkerPath } from "ngwr/charts/core";
8
8
  import { useChartTooltip } from "ngwr/popover";
9
9
  /**
10
10
  * @license
@@ -66,8 +66,8 @@ var WrScatterChart = class WrScatterChart {
66
66
  resolvedSeries = computed(() => this.series().map((s, index) => ({
67
67
  index,
68
68
  label: s.label,
69
- color: s.color ?? chartColor(index),
70
- marker: chartMarker(index),
69
+ color: s.color ?? wrChartColor(index),
70
+ marker: wrChartMarker(index),
71
71
  points: s.data.flatMap((p, i) => Number.isFinite(p.x) && Number.isFinite(p.y) ? [{
72
72
  n: i + 1,
73
73
  x: p.x,
@@ -100,7 +100,7 @@ var WrScatterChart = class WrScatterChart {
100
100
  const maxRadius = this.maxRadius();
101
101
  return this.visibleSeries().flatMap((s) => s.points.map((p) => {
102
102
  const r = p.size === null || maxSize === null ? POINT_RADIUS : Math.max(MIN_RADIUS, maxRadius * Math.sqrt(maxSize > 0 ? p.size / maxSize : 0));
103
- const halo = chartMarkerExtent(s.marker, r + HALO_GAP);
103
+ const halo = wrChartMarkerExtent(s.marker, r + HALO_GAP);
104
104
  return {
105
105
  key: `${s.index}:${p.n}`,
106
106
  series: s.index,
@@ -115,7 +115,7 @@ var WrScatterChart = class WrScatterChart {
115
115
  left: percent((p.x - x.min) / (x.max - x.min) * 100),
116
116
  top: percent((y.max - p.y) / (y.max - y.min) * 100),
117
117
  r,
118
- d: chartMarkerPath(s.marker, r),
118
+ d: wrChartMarkerPath(s.marker, r),
119
119
  halo
120
120
  };
121
121
  })).sort((a, b) => b.r - a.r);
@@ -128,8 +128,8 @@ var WrScatterChart = class WrScatterChart {
128
128
  y = Math.max(y, halo.top, halo.bottom);
129
129
  }
130
130
  return {
131
- x: round(x, 3),
132
- y: round(Math.min(y, this.height() / 4), 3)
131
+ x: wrRound(x, 3),
132
+ y: wrRound(Math.min(y, this.height() / 4), 3)
133
133
  };
134
134
  }, ...ngDevMode ? [{ debugName: "reach" }] : /* istanbul ignore next */ []);
135
135
  yTicks = computed(() => {
@@ -192,7 +192,7 @@ var WrScatterChart = class WrScatterChart {
192
192
  }, ...ngDevMode ? [{ debugName: "activePoint" }] : /* istanbul ignore next */ []);
193
193
  haloPath = computed(() => {
194
194
  const point = this.activePoint();
195
- return point ? chartMarkerPath(point.marker, point.r + HALO_GAP) : "";
195
+ return point ? wrChartMarkerPath(point.marker, point.r + HALO_GAP) : "";
196
196
  }, ...ngDevMode ? [{ debugName: "haloPath" }] : /* istanbul ignore next */ []);
197
197
  tableData = computed(() => {
198
198
  const sized = this.sized();
@@ -247,7 +247,7 @@ var WrScatterChart = class WrScatterChart {
247
247
  if (v < min) min = v;
248
248
  if (v > max) max = v;
249
249
  }
250
- return chartAxis(min, max, { symmetric: true });
250
+ return wrChartAxis(min, max, { symmetric: true });
251
251
  }
252
252
  static ɵfac = i0.ɵɵngDeclareFactory({
253
253
  minVersion: "12.0.0",
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-charts-scatter-chart.mjs","names":[],"sources":["../../../projects/lib/charts/scatter-chart/scatter-chart.ts","../../../projects/lib/charts/scatter-chart/scatter-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 model,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartLegend, type WrChartLegendItem } from 'ngwr/charts/chart-legend';\nimport {\n type WrChartAxis,\n type WrChartMarkerExtent,\n type WrChartMarkerShape,\n WrChartTable,\n type WrChartTableData,\n chartAxis,\n chartColor,\n chartMarker,\n chartMarkerExtent,\n chartMarkerPath,\n useChartNumbers,\n} from 'ngwr/charts/core';\nimport { useI18nText } from 'ngwr/i18n';\nimport { type WrChartTooltipRow, useChartTooltip } from 'ngwr/popover';\nimport { round, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrScatterAxis, WrScatterSeries } from './types';\n\n/** The radius, in px, of a point with no `size`: a marker as large as a 10px circle. */\nconst POINT_RADIUS = 5;\n\n/** The smallest radius a sized point is drawn at, in px, however small its size: still a mark, still hoverable. */\nconst MIN_RADIUS = 4;\n\n/** How far from a marker's centre, in px, the pointer still reads that point — or as far as the marker reaches, if farther. */\nconst HIT_RADIUS = 16;\n\n/** How far outside its marker the hovered point's ring is drawn, in px. */\nconst HALO_GAP = 3;\n\n/** A percentage to three decimals, so an attribute stays short. */\nconst percent = (value: number): number => Math.round(value * 1000) / 1000;\n\n/** One point as the chart draws it: its data, where it sits and how large it is. */\ninterface DrawnPoint {\n /** Its series' position and its own position in that series' `data`, which no other point shares. */\n readonly key: string;\n /** Its series' position in `series`. */\n readonly series: number;\n readonly seriesLabel: string;\n readonly color: string;\n readonly marker: WrChartMarkerShape;\n /** Its position in its series' `data`, from 1: the row header of a point with no `label`. */\n readonly n: number;\n readonly x: number;\n readonly y: number;\n readonly size: number | null;\n readonly label: string | null;\n /** Its centre, as percentages of the drawing's width from the left and height from the top. */\n readonly left: number;\n readonly top: number;\n /** Its radius in px. */\n readonly r: number;\n /** Its marker's path about the origin. */\n readonly d: string;\n /** How far its hover ring reaches from its centre, in px: what the tooltip points at and the pointer reads. */\n readonly halo: WrChartMarkerExtent;\n}\n\n/**\n * Points on two numeric axes: one series per marker shape, and an optional third value\n * drawn as each point's area, which makes it a bubble chart. SVG-only — no external\n * dependency.\n *\n * @example\n * ```html\n * <wr-scatter-chart\n * xLabel=\"Price\"\n * yLabel=\"Rating\"\n * [series]=\"[\n * { label: 'Laptops', data: [{ x: 899, y: 4.1 }, { x: 1299, y: 4.6 }] },\n * { label: 'Tablets', data: [{ x: 329, y: 3.9 }, { x: 599, y: 4.4 }] }\n * ]\"\n * />\n * ```\n *\n * Each series is told apart by its marker's SHAPE as well as its colour — a circle, a\n * square, a triangle, a diamond, a cross, a downward triangle — since the palette's\n * colours sit too close in lightness to be read alone. Neither axis is forced to include\n * zero: each is fitted to its data and snapped outward to a readable step, so no point\n * lands exactly on the frame, and a single value sits in the middle with a step either\n * side. A point can still sit a hair inside the frame, so the plot's padding grows to\n * the largest marker drawn, and a bubble at the edge stays inside the chart's own box.\n *\n * The drawing is one named `role=\"img\"` and takes no tab stop; the tooltip is pointer\n * only. `dataTable` renders every value as a table only assistive technology reaches.\n * The legend is a `ul[wr-chart-legend]` (`ngwr/charts/chart-legend`), and with\n * `toggleableLegend` its rows show and hide their series through `hiddenSeries`.\n *\n * Hovering finds the nearest point by measuring every one, so a chart meant for more\n * than a few thousand points is better served by binning them first.\n *\n * @see https://ngwr.dev/charts/scatter-chart\n */\n@Component({\n selector: 'wr-scatter-chart',\n templateUrl: './scatter-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-scatter-chart',\n // A bubble chart's markers overlap as a rule, so they are drawn see-through.\n '[class.wr-scatter-chart--bubbles]': 'sized()',\n // How far the largest marker reaches, ring included: the stylesheet grows the plot's\n // padding to it, so a marker on the frame stays inside the plot.\n '[style.--wr-scatter-chart-reach-x]': 'reach().x',\n '[style.--wr-scatter-chart-reach-y]': 'reach().y',\n },\n imports: [WrChartLegend, WrChartTable],\n})\nexport class WrScatterChart {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/scatter-chart');\n }\n\n /**\n * One entry per series. A series with no `color` takes the next entry from the chart's\n * palette, and every series takes the next marker shape, so several series are told\n * apart unconfigured.\n */\n readonly series = input<readonly WrScatterSeries[]>([]);\n\n /**\n * Accessible name of the chart. The legend carries the series NAMES only — the values\n * are nowhere in text unless `dataTable` puts them there — so say what the chart shows.\n * Falls back to `scatterChart.label` (\"Scatter chart\").\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'scatterChart.label', 'Scatter chart');\n\n /**\n * The x axis' name. Drawn under the axis only when given; either way it names the x\n * row of the tooltip and the x column of the data table, which fall back to\n * `scatterChart.x` (\"X\").\n */\n readonly xLabel = input<string | null>(null);\n\n /**\n * The y axis' name. Drawn above the axis only when given; either way it names the y\n * row of the tooltip and the y column of the data table, which fall back to\n * `scatterChart.y` (\"Y\").\n */\n readonly yLabel = input<string | null>(null);\n\n /**\n * What a point's `size` measures. It names the size row of the tooltip and the size\n * column of the data table, which appear only when a point has a size, and falls back\n * to `scatterChart.size` (\"Size\").\n */\n readonly sizeLabel = input<string | null>(null);\n\n protected readonly xName = useI18nText(this.xLabel, 'scatterChart.x', 'X');\n protected readonly yName = useI18nText(this.yLabel, 'scatterChart.y', 'Y');\n protected readonly sizeName = useI18nText(this.sizeLabel, 'scatterChart.size', 'Size');\n\n /**\n * Writes every number the chart shows — the axis ticks, the tooltip and the data table —\n * and is told which number it is writing: `'x'`, `'y'` or `'size'`, so the two axes can\n * carry different units. A `(value) => string` written for another chart fits too. `null`\n * uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ticks (`1.2K`, `3.4M`) unless the\n * full numbers are shorter.\n */\n readonly valueFormat = input<((value: number, axis: WrScatterAxis) => string) | null>(null);\n\n /** The exact figures and the axes' compact ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers<[WrScatterAxis]>(this.valueFormat);\n\n /** The row headers of points with no `label`, which number them in the reader's own digits. */\n private readonly ordinals = new Intl.NumberFormat(inject(LOCALE_ID));\n\n /** The plot's height in px, at least 80. @default 240 */\n readonly height = input(240, { transform: (v: unknown): number => Math.max(80, coerceNumberProperty(v, 240)) });\n\n /** Show the gridlines and the tick labels of both axes. @default true */\n readonly showGrid = input(true, { transform: coerceBooleanProperty });\n\n /** Show the legend above 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 series, through\n * `hiddenSeries`. A row is a `<button aria-pressed>`, pressed while its series is\n * shown, so the legend becomes one tab stop per series. @default false\n */\n readonly toggleableLegend = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The positions in `series` of the series that are hidden. Positions rather than\n * labels, since two series may share a label. A toggleable legend writes it, and a host\n * may bind it with or without one: `[(hiddenSeries)]`.\n *\n * A hidden series is left out of everything that reads its values: it draws no points,\n * the tooltip cannot land on them, the data table drops its rows, and both axes and the\n * bubble scale are fitted to the series still shown, so hiding an outlier lets the rest\n * fill the plot. Its legend row stays, struck through, so it can be shown again. With\n * every series hidden the plot is the empty 0 to 1 frame. A position past the end of\n * `series` is kept and ignored.\n */\n readonly hiddenSeries = model<readonly number[]>([]);\n\n /** Show a tooltip with the series, x, y and size of the point under the pointer. Pointer only. @default true */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Render every point's values as a table only assistive technology reaches, beside the\n * drawing: one group of rows per series shown, headed by the series' name, a row per\n * point, and a column for x, for y and, when a point has one, for size. The drawing is\n * one named image, so without it the values are nowhere a screen reader can walk.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The radius, in px, the largest `size` shown is drawn at. Every other sized point is\n * scaled by AREA against it — a point of half the size has half the area, not half the\n * radius — and none is drawn under 4px. At least 4. @default 20\n */\n readonly maxRadius = input(20, {\n transform: (v: unknown): number => Math.max(MIN_RADIUS, coerceNumberProperty(v, 20)),\n });\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n /**\n * Every series, resolved: its palette colour, its marker shape, and its points with\n * every one dropped whose `x` or `y` is not a finite number. Hidden ones included, since\n * the legend lists them.\n *\n * A point that cannot be placed is left out rather than kept: one NaN in the pooled\n * minimum makes every coordinate in every series NaN, and the whole chart vanishes\n * instead of one point. A point keeps its position in its series' `data` all the same,\n * so the data table numbers the rest as the consumer numbered them.\n */\n protected readonly resolvedSeries = computed(() =>\n this.series().map((s, index) => ({\n index,\n label: s.label,\n color: s.color ?? chartColor(index),\n marker: chartMarker(index),\n points: s.data.flatMap((p, i) =>\n Number.isFinite(p.x) && Number.isFinite(p.y)\n ? [\n {\n n: i + 1,\n x: p.x,\n y: p.y,\n size: typeof p.size === 'number' && Number.isFinite(p.size) && p.size >= 0 ? p.size : null,\n label: p.label ?? null,\n },\n ]\n : []\n ),\n }))\n );\n\n /** The legend's rows: every series, keyed by its own marker. */\n protected readonly legendItems = computed<readonly WrChartLegendItem[]>(() =>\n this.resolvedSeries().map(({ label, color, marker }) => ({ label, color, marker }))\n );\n\n /** The series drawn, read and fitted to: every one `hiddenSeries` does not name. */\n protected readonly visibleSeries = computed(() => {\n const hidden = new Set(this.hiddenSeries());\n return this.resolvedSeries().filter(s => !hidden.has(s.index));\n });\n\n /** The largest `size` among the points shown, or `null` when none has one — a plain scatter. */\n private readonly maxSize = computed(() => {\n let max: number | null = null;\n for (const s of this.visibleSeries())\n for (const p of s.points) if (p.size !== null) max = Math.max(max ?? 0, p.size);\n return max;\n });\n\n /** Whether any point shown has a size, which adds the size row and column. */\n protected readonly sized = computed(() => this.maxSize() !== null);\n\n /**\n * The x axis, from `chartAxis` over the points shown: fitted to the data with no zero\n * forced in, since a scatter has no baseline, snapped outward at both ends and lifted a\n * step at EITHER end a point would sit on (`symmetric`), so no point lands exactly on\n * the frame. A single value — one point, or a column of them — is centred with a step\n * either side. With nothing to fit, the 0 to 1 frame.\n */\n protected readonly xAxis = computed(() => this.fit(p => p.x));\n\n /** The y axis, fitted the way {@link xAxis} is. */\n protected readonly yAxis = computed(() => this.fit(p => p.y));\n\n /**\n * The points as drawn: placed by percentage on both axes, sized, and ordered LARGEST\n * FIRST so a small bubble is never buried under a large one. Points of equal size keep\n * the series' order, so a plain scatter draws series by series.\n */\n protected readonly points = computed<readonly DrawnPoint[]>(() => {\n const x = this.xAxis();\n const y = this.yAxis();\n const maxSize = this.maxSize();\n const maxRadius = this.maxRadius();\n const drawn = this.visibleSeries().flatMap(s =>\n s.points.map(p => {\n const r =\n p.size === null || maxSize === null\n ? POINT_RADIUS\n : Math.max(MIN_RADIUS, maxRadius * Math.sqrt(maxSize > 0 ? p.size / maxSize : 0));\n const halo = chartMarkerExtent(s.marker, r + HALO_GAP);\n return {\n key: `${s.index}:${p.n}`,\n series: s.index,\n seriesLabel: s.label,\n color: s.color,\n marker: s.marker,\n n: p.n,\n x: p.x,\n y: p.y,\n size: p.size,\n label: p.label,\n left: percent(((p.x - x.min) / (x.max - x.min)) * 100),\n top: percent(((y.max - p.y) / (y.max - y.min)) * 100),\n r,\n d: chartMarkerPath(s.marker, r),\n halo,\n };\n })\n );\n return drawn.sort((a, b) => b.r - a.r);\n });\n\n /**\n * How far the largest marker drawn reaches past its centre, in px, sideways and up or\n * down — its hover ring included, so hovering moves nothing. The axes keep a point\n * off the frame only when it lands exactly on it, and one a fraction of a step inside\n * sits a few px from it; the stylesheet takes the larger of this and the plot's inset\n * tokens as the plot's padding, so the marker stays inside the plot rather than over\n * the tick labels or past the chart's own box. By SHAPE, not radius: a triangle's\n * point reaches 1.56 times its radius up. The ring's stroke is the stylesheet's.\n *\n * Up or down it is held to a quarter of `height`, so a short plot with a large\n * `maxRadius` keeps half its height for the drawing and lets the marker overhang.\n */\n protected readonly reach = computed(() => {\n let x = 0;\n let y = 0;\n for (const { halo } of this.points()) {\n x = Math.max(x, halo.side);\n y = Math.max(y, halo.top, halo.bottom);\n }\n return { x: round(x, 3), y: round(Math.min(y, this.height() / 4), 3) };\n });\n\n /** The y ticks, top to bottom: each value's label and its gridline's distance from the top, in percent. */\n protected readonly yTicks = computed(() => {\n const { min, max, step, ticks } = this.yAxis();\n const labels = this.numbers.ticks(ticks, step, 'y');\n return ticks.map((value, i) => ({ label: labels[i], top: percent(((max - value) / (max - min)) * 100) }));\n });\n\n /** The x ticks, left to right: each value's label and its gridline's distance from the left, in percent. */\n protected readonly xTicks = computed(() => {\n const { min, max, step, ticks } = this.xAxis();\n const values = [...ticks].reverse();\n const labels = this.numbers.ticks(values, step, 'x');\n return values.map((value, i) => ({ label: labels[i], left: percent(((value - min) / (max - min)) * 100) }));\n });\n\n /**\n * How far apart two neighbouring x ticks are, as a percentage of the drawing's width —\n * the room each tick label has, half on either side of its gridline, which the\n * stylesheet bounds it to and ellipsises past.\n */\n protected readonly xSlot = computed(() => {\n const count = this.xTicks().length;\n return count <= 1 ? 100 : percent(100 / (count - 1));\n });\n\n /**\n * One tooltip for the point under the pointer: the series' swatch and name with the\n * point's own label as its heading, then a row each for x, y and size. It points at\n * the box of the marker's hover ring from above, so the chip clears a large bubble and\n * a triangle's point rather than sitting on its centre.\n *\n * Points are found by POSITION — the nearest within 16px of the pointer, or anywhere a\n * larger marker reaches — so a point under the open chip can still be reached by\n * moving onto it, the way a sparkline is scrubbed.\n */\n protected readonly tip = useChartTooltip(\n this.tooltip,\n index => {\n const point = this.points()[index];\n const svg = this.svg()?.nativeElement;\n if (!point || !svg) return null;\n const box = svg.getBoundingClientRect();\n const x = box.left + (point.left / 100) * box.width;\n const y = box.top + (point.top / 100) * box.height;\n const rows: WrChartTooltipRow[] = [\n { label: this.xName(), value: this.numbers.value(point.x, 'x') },\n { label: this.yName(), value: this.numbers.value(point.y, 'y') },\n ];\n if (point.size !== null) rows.push({ label: this.sizeName(), value: this.numbers.value(point.size, 'size') });\n return {\n datum: { label: point.seriesLabel, value: point.label ?? '', color: point.color, rows },\n anchor: {\n x: x - point.halo.side,\n y: y - point.halo.top,\n width: point.halo.side * 2,\n height: point.halo.top + point.halo.bottom,\n },\n };\n },\n (x, y) => this.pointAt(x, y)\n );\n\n /** The point the tooltip is reading, ringed in the drawing. */\n protected readonly activePoint = computed(() => {\n const index = this.tip.active();\n return index === null ? null : (this.points()[index] ?? null);\n });\n\n /** The ring round the hovered point: its own shape, a little larger. */\n protected readonly haloPath = computed(() => {\n const point = this.activePoint();\n return point ? chartMarkerPath(point.marker, point.r + HALO_GAP) : '';\n });\n\n /**\n * The figures for `dataTable`: the chart's name as the caption, one group per series\n * shown and headed by its name, and a row per point headed by the point's `label` or\n * its position in the series. Every value is written as the tooltip writes it; a point\n * with no size has an empty size cell in a chart where others have one.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const sized = this.sized();\n const value = (v: number, axis: WrScatterAxis): string => this.numbers.value(v, axis);\n return {\n caption: this.resolvedAriaLabel(),\n columns: sized ? [this.xName(), this.yName(), this.sizeName()] : [this.xName(), this.yName()],\n groups: this.visibleSeries().map(s => ({\n header: s.label,\n rows: s.points.map(p => {\n const cells = [value(p.x, 'x'), value(p.y, 'y')];\n if (sized) cells.push(p.size === null ? '' : value(p.size, 'size'));\n return { header: p.label ?? this.ordinals.format(p.n), cells };\n }),\n })),\n };\n });\n\n /**\n * The point under the pointer. A MOUSE event, as every chart's is: a tap fires the\n * compatibility `mousemove` and no `pointermove`. Off every point, the open tooltip\n * starts its grace period.\n */\n protected onPointerMove(event: MouseEvent): void {\n if (!this.tooltip()) return;\n const index = this.pointAt(event.clientX, event.clientY);\n if (index === null) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n /**\n * The point nearest a viewport position: within 16px of its centre, or within the\n * circle its hover ring fits in where that is larger — a triangle's point or a\n * diamond's tips reach past its radius — and the nearest centre where several qualify.\n * A drawing with no box (nothing laid out yet) answers nothing.\n */\n private pointAt(clientX: number, clientY: number): number | null {\n const svg = this.svg()?.nativeElement;\n if (!svg) return null;\n const box = svg.getBoundingClientRect();\n if (box.width <= 0 || box.height <= 0) return null;\n let best: number | null = null;\n let nearest = Number.POSITIVE_INFINITY;\n this.points().forEach((point, index) => {\n const distance = Math.hypot(\n box.left + (point.left / 100) * box.width - clientX,\n box.top + (point.top / 100) * box.height - clientY\n );\n if (distance <= Math.max(HIT_RADIUS, point.halo.radius) && distance < nearest) {\n nearest = distance;\n best = index;\n }\n });\n return best;\n }\n\n /** One axis over the points shown: `chartAxis` with both ends kept off the data, and one value centred. */\n private fit(read: (point: { readonly x: number; readonly y: number }) => number): WrChartAxis {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n for (const s of this.visibleSeries()) {\n for (const p of s.points) {\n const v = read(p);\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n // No point at all leaves both infinite, which `chartAxis` answers with the empty frame;\n // one value, or a column of them, it centres between a step on either side.\n return chartAxis(min, max, { symmetric: true });\n }\n}\n\nexport type { WrScatterAxis, WrScatterPoint, WrScatterSeries } from './types';\n","@let active = activePoint();\n@if (showLegend() && resolvedSeries().length > 0) {\n <!-- Every row keys its series by the series' own marker shape, the channel that tells\n the points apart where the colours do not. Rows are tracked by position, so two\n series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-scatter-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n}\n\n<!-- Two columns: the y tick labels at inline start and the drawing beside them, with the\n y axis' name above and the x tick labels and the x axis' name under the drawing\n only, so their percentages are the drawing's. -->\n<div class=\"wr-scatter-chart__body\">\n @if (yLabel()) {\n <div class=\"wr-scatter-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showGrid()) {\n <!-- HTML beside the drawing rather than `<text>` inside it, in flow, so the column is\n exactly as wide as the longest label; each one hands the stylesheet the y of its\n own gridline. Hidden, as the drawing is one image: its name is what is announced,\n and the values are the data table's. -->\n <div class=\"wr-scatter-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-scatter-chart__y-tick\" [style.--wr-scatter-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <div\n class=\"wr-scatter-chart__plot\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n <!-- No viewBox: every position is a PERCENTAGE of the drawing, so nothing stretches.\n A viewBox with `preserveAspectRatio=\"none\"` would squash each marker with the\n drawing, a circle into an oval and a square into a bar, and a scatter's marker is\n its series' only channel besides colour. -->\n <!-- Hidden as well as presentational: `img` already makes it so, but every point is\n an `<svg>` of its own, and a tree that holds a node per point for thousands of\n them is work for nothing. -->\n <svg #svg class=\"wr-scatter-chart__svg\" aria-hidden=\"true\">\n @if (showGrid()) {\n @for (tick of yTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line\"\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"`${tick.top}%`\"\n [attr.y2]=\"`${tick.top}%`\"\n />\n }\n @for (tick of xTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line wr-scatter-chart__grid-line--x\"\n [attr.x1]=\"`${tick.left}%`\"\n [attr.x2]=\"`${tick.left}%`\"\n y1=\"0\"\n y2=\"100%\"\n />\n }\n }\n\n @for (p of points(); track p.key) {\n <!-- A nested `<svg>` placed by percentage, its marker drawn about its origin in\n px: an SVG's `x` and `y` take a percentage where a `transform` does not, so\n the marker sits on its point at any size and keeps its own. Its viewport is\n the drawing's whole box, painted nowhere, and `overflow` lets the marker\n reach outside it. -->\n <svg\n class=\"wr-scatter-chart__point\"\n [attr.x]=\"`${p.left}%`\"\n [attr.y]=\"`${p.top}%`\"\n overflow=\"visible\"\n [attr.data-series]=\"p.series\"\n [attr.data-x]=\"p.x\"\n [attr.data-y]=\"p.y\"\n [attr.data-size]=\"p.size\"\n [attr.data-radius]=\"p.r\"\n [attr.data-marker]=\"p.marker\"\n >\n <path class=\"wr-scatter-chart__marker\" [attr.d]=\"p.d\" [attr.fill]=\"p.color\" />\n </svg>\n }\n\n @if (active) {\n <!-- A ring of the point's own shape just outside it, so the reading is marked by\n outline as well as by the tooltip's arrow. -->\n <svg class=\"wr-scatter-chart__halo\" [attr.x]=\"`${active.left}%`\" [attr.y]=\"`${active.top}%`\" overflow=\"visible\">\n <path [attr.d]=\"haloPath()\" fill=\"none\" [attr.stroke]=\"active.color\" />\n </svg>\n }\n </svg>\n </div>\n\n @if (showGrid()) {\n <!-- The strip is as wide as the plot, and hands the stylesheet the distance between\n two ticks; each label hands it the x of its gridline, as a percentage of the\n drawing's width. -->\n <div class=\"wr-scatter-chart__x-axis\" aria-hidden=\"true\" [style.--wr-scatter-chart-x-slot]=\"xSlot()\">\n @for (tick of xTicks(); track $index) {\n <span class=\"wr-scatter-chart__x-tick\" [style.--wr-scatter-chart-x]=\"tick.left\">{{ tick.label }}</span>\n }\n </div>\n }\n\n @if (xLabel()) {\n <div class=\"wr-scatter-chart__x-title\">{{ xLabel() }}</div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the plot's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAM,eAAe;AAGrB,MAAM,aAAa;AAGnB,MAAM,aAAa;AAGnB,MAAM,WAAW;AAGjB,MAAM,WAAW,UAA0B,KAAK,MAAM,QAAQ,GAAI,IAAI;AA8EtE,IAAa,iBAAb,MAAa,eAAc;CACzB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,sBAAsB;CACzF;CAOS,SAAS,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAO9C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,KAAK,WAAW,sBAAsB,eAAe;CAO/F,SAAS,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAOnC,SAAS,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAOnC,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,QAAQ,YAAY,KAAK,QAAQ,kBAAkB,GAAG;CACtD,QAAQ,YAAY,KAAK,QAAQ,kBAAkB,GAAG;CACtD,WAAW,YAAY,KAAK,WAAW,qBAAqB,MAAM;CAS5E,cAAc,MAA+D,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;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YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,kBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,oBAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,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-scatter-chart.mjs","names":[],"sources":["../../../projects/lib/charts/scatter-chart/scatter-chart.ts","../../../projects/lib/charts/scatter-chart/scatter-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 model,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartLegend, type WrChartLegendItem } from 'ngwr/charts/chart-legend';\nimport {\n type WrChartAxis,\n type WrChartMarkerExtent,\n type WrChartMarkerShape,\n WrChartTable,\n type WrChartTableData,\n wrChartAxis,\n wrChartColor,\n wrChartMarker,\n wrChartMarkerExtent,\n wrChartMarkerPath,\n useChartNumbers,\n} from 'ngwr/charts/core';\nimport { useI18nText } from 'ngwr/i18n';\nimport { type WrChartTooltipRow, useChartTooltip } from 'ngwr/popover';\nimport { wrRound, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrScatterAxis, WrScatterSeries } from './types';\n\n/** The radius, in px, of a point with no `size`: a marker as large as a 10px circle. */\nconst POINT_RADIUS = 5;\n\n/** The smallest radius a sized point is drawn at, in px, however small its size: still a mark, still hoverable. */\nconst MIN_RADIUS = 4;\n\n/** How far from a marker's centre, in px, the pointer still reads that point — or as far as the marker reaches, if farther. */\nconst HIT_RADIUS = 16;\n\n/** How far outside its marker the hovered point's ring is drawn, in px. */\nconst HALO_GAP = 3;\n\n/** A percentage to three decimals, so an attribute stays short. */\nconst percent = (value: number): number => Math.round(value * 1000) / 1000;\n\n/** One point as the chart draws it: its data, where it sits and how large it is. */\ninterface DrawnPoint {\n /** Its series' position and its own position in that series' `data`, which no other point shares. */\n readonly key: string;\n /** Its series' position in `series`. */\n readonly series: number;\n readonly seriesLabel: string;\n readonly color: string;\n readonly marker: WrChartMarkerShape;\n /** Its position in its series' `data`, from 1: the row header of a point with no `label`. */\n readonly n: number;\n readonly x: number;\n readonly y: number;\n readonly size: number | null;\n readonly label: string | null;\n /** Its centre, as percentages of the drawing's width from the left and height from the top. */\n readonly left: number;\n readonly top: number;\n /** Its radius in px. */\n readonly r: number;\n /** Its marker's path about the origin. */\n readonly d: string;\n /** How far its hover ring reaches from its centre, in px: what the tooltip points at and the pointer reads. */\n readonly halo: WrChartMarkerExtent;\n}\n\n/**\n * Points on two numeric axes: one series per marker shape, and an optional third value\n * drawn as each point's area, which makes it a bubble chart. SVG-only — no external\n * dependency.\n *\n * @example\n * ```html\n * <wr-scatter-chart\n * xLabel=\"Price\"\n * yLabel=\"Rating\"\n * [series]=\"[\n * { label: 'Laptops', data: [{ x: 899, y: 4.1 }, { x: 1299, y: 4.6 }] },\n * { label: 'Tablets', data: [{ x: 329, y: 3.9 }, { x: 599, y: 4.4 }] }\n * ]\"\n * />\n * ```\n *\n * Each series is told apart by its marker's SHAPE as well as its colour — a circle, a\n * square, a triangle, a diamond, a cross, a downward triangle — since the palette's\n * colours sit too close in lightness to be read alone. Neither axis is forced to include\n * zero: each is fitted to its data and snapped outward to a readable step, so no point\n * lands exactly on the frame, and a single value sits in the middle with a step either\n * side. A point can still sit a hair inside the frame, so the plot's padding grows to\n * the largest marker drawn, and a bubble at the edge stays inside the chart's own box.\n *\n * The drawing is one named `role=\"img\"` and takes no tab stop; the tooltip is pointer\n * only. `dataTable` renders every value as a table only assistive technology reaches.\n * The legend is a `ul[wr-chart-legend]` (`ngwr/charts/chart-legend`), and with\n * `toggleableLegend` its rows show and hide their series through `hiddenSeries`.\n *\n * Hovering finds the nearest point by measuring every one, so a chart meant for more\n * than a few thousand points is better served by binning them first.\n *\n * @see https://ngwr.dev/charts/scatter-chart\n */\n@Component({\n selector: 'wr-scatter-chart',\n templateUrl: './scatter-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-scatter-chart',\n // A bubble chart's markers overlap as a rule, so they are drawn see-through.\n '[class.wr-scatter-chart--bubbles]': 'sized()',\n // How far the largest marker reaches, ring included: the stylesheet grows the plot's\n // padding to it, so a marker on the frame stays inside the plot.\n '[style.--wr-scatter-chart-reach-x]': 'reach().x',\n '[style.--wr-scatter-chart-reach-y]': 'reach().y',\n },\n imports: [WrChartLegend, WrChartTable],\n})\nexport class WrScatterChart {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/scatter-chart');\n }\n\n /**\n * One entry per series. A series with no `color` takes the next entry from the chart's\n * palette, and every series takes the next marker shape, so several series are told\n * apart unconfigured.\n */\n readonly series = input<readonly WrScatterSeries[]>([]);\n\n /**\n * Accessible name of the chart. The legend carries the series NAMES only — the values\n * are nowhere in text unless `dataTable` puts them there — so say what the chart shows.\n * Falls back to `scatterChart.label` (\"Scatter chart\").\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'scatterChart.label', 'Scatter chart');\n\n /**\n * The x axis' name. Drawn under the axis only when given; either way it names the x\n * row of the tooltip and the x column of the data table, which fall back to\n * `scatterChart.x` (\"X\").\n */\n readonly xLabel = input<string | null>(null);\n\n /**\n * The y axis' name. Drawn above the axis only when given; either way it names the y\n * row of the tooltip and the y column of the data table, which fall back to\n * `scatterChart.y` (\"Y\").\n */\n readonly yLabel = input<string | null>(null);\n\n /**\n * What a point's `size` measures. It names the size row of the tooltip and the size\n * column of the data table, which appear only when a point has a size, and falls back\n * to `scatterChart.size` (\"Size\").\n */\n readonly sizeLabel = input<string | null>(null);\n\n protected readonly xName = useI18nText(this.xLabel, 'scatterChart.x', 'X');\n protected readonly yName = useI18nText(this.yLabel, 'scatterChart.y', 'Y');\n protected readonly sizeName = useI18nText(this.sizeLabel, 'scatterChart.size', 'Size');\n\n /**\n * Writes every number the chart shows — the axis ticks, the tooltip and the data table —\n * and is told which number it is writing: `'x'`, `'y'` or `'size'`, so the two axes can\n * carry different units. A `(value) => string` written for another chart fits too. `null`\n * uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ticks (`1.2K`, `3.4M`) unless the\n * full numbers are shorter.\n */\n readonly valueFormat = input<((value: number, axis: WrScatterAxis) => string) | null>(null);\n\n /** The exact figures and the axes' compact ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers<[WrScatterAxis]>(this.valueFormat);\n\n /** The row headers of points with no `label`, which number them in the reader's own digits. */\n private readonly ordinals = new Intl.NumberFormat(inject(LOCALE_ID));\n\n /** The plot's height in px, at least 80. @default 240 */\n readonly height = input(240, { transform: (v: unknown): number => Math.max(80, coerceNumberProperty(v, 240)) });\n\n /** Show the gridlines and the tick labels of both axes. @default true */\n readonly showGrid = input(true, { transform: coerceBooleanProperty });\n\n /** Show the legend above 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 series, through\n * `hiddenSeries`. A row is a `<button aria-pressed>`, pressed while its series is\n * shown, so the legend becomes one tab stop per series. @default false\n */\n readonly toggleableLegend = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The positions in `series` of the series that are hidden. Positions rather than\n * labels, since two series may share a label. A toggleable legend writes it, and a host\n * may bind it with or without one: `[(hiddenSeries)]`.\n *\n * A hidden series is left out of everything that reads its values: it draws no points,\n * the tooltip cannot land on them, the data table drops its rows, and both axes and the\n * bubble scale are fitted to the series still shown, so hiding an outlier lets the rest\n * fill the plot. Its legend row stays, struck through, so it can be shown again. With\n * every series hidden the plot is the empty 0 to 1 frame. A position past the end of\n * `series` is kept and ignored.\n */\n readonly hiddenSeries = model<readonly number[]>([]);\n\n /** Show a tooltip with the series, x, y and size of the point under the pointer. Pointer only. @default true */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Render every point's values as a table only assistive technology reaches, beside the\n * drawing: one group of rows per series shown, headed by the series' name, a row per\n * point, and a column for x, for y and, when a point has one, for size. The drawing is\n * one named image, so without it the values are nowhere a screen reader can walk.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The radius, in px, the largest `size` shown is drawn at. Every other sized point is\n * scaled by AREA against it — a point of half the size has half the area, not half the\n * radius — and none is drawn under 4px. At least 4. @default 20\n */\n readonly maxRadius = input(20, {\n transform: (v: unknown): number => Math.max(MIN_RADIUS, coerceNumberProperty(v, 20)),\n });\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n /**\n * Every series, resolved: its palette colour, its marker shape, and its points with\n * every one dropped whose `x` or `y` is not a finite number. Hidden ones included, since\n * the legend lists them.\n *\n * A point that cannot be placed is left out rather than kept: one NaN in the pooled\n * minimum makes every coordinate in every series NaN, and the whole chart vanishes\n * instead of one point. A point keeps its position in its series' `data` all the same,\n * so the data table numbers the rest as the consumer numbered them.\n */\n protected readonly resolvedSeries = computed(() =>\n this.series().map((s, index) => ({\n index,\n label: s.label,\n color: s.color ?? wrChartColor(index),\n marker: wrChartMarker(index),\n points: s.data.flatMap((p, i) =>\n Number.isFinite(p.x) && Number.isFinite(p.y)\n ? [\n {\n n: i + 1,\n x: p.x,\n y: p.y,\n size: typeof p.size === 'number' && Number.isFinite(p.size) && p.size >= 0 ? p.size : null,\n label: p.label ?? null,\n },\n ]\n : []\n ),\n }))\n );\n\n /** The legend's rows: every series, keyed by its own marker. */\n protected readonly legendItems = computed<readonly WrChartLegendItem[]>(() =>\n this.resolvedSeries().map(({ label, color, marker }) => ({ label, color, marker }))\n );\n\n /** The series drawn, read and fitted to: every one `hiddenSeries` does not name. */\n protected readonly visibleSeries = computed(() => {\n const hidden = new Set(this.hiddenSeries());\n return this.resolvedSeries().filter(s => !hidden.has(s.index));\n });\n\n /** The largest `size` among the points shown, or `null` when none has one — a plain scatter. */\n private readonly maxSize = computed(() => {\n let max: number | null = null;\n for (const s of this.visibleSeries())\n for (const p of s.points) if (p.size !== null) max = Math.max(max ?? 0, p.size);\n return max;\n });\n\n /** Whether any point shown has a size, which adds the size row and column. */\n protected readonly sized = computed(() => this.maxSize() !== null);\n\n /**\n * The x axis, from `wrChartAxis` over the points shown: fitted to the data with no zero\n * forced in, since a scatter has no baseline, snapped outward at both ends and lifted a\n * step at EITHER end a point would sit on (`symmetric`), so no point lands exactly on\n * the frame. A single value — one point, or a column of them — is centred with a step\n * either side. With nothing to fit, the 0 to 1 frame.\n */\n protected readonly xAxis = computed(() => this.fit(p => p.x));\n\n /** The y axis, fitted the way {@link xAxis} is. */\n protected readonly yAxis = computed(() => this.fit(p => p.y));\n\n /**\n * The points as drawn: placed by percentage on both axes, sized, and ordered LARGEST\n * FIRST so a small bubble is never buried under a large one. Points of equal size keep\n * the series' order, so a plain scatter draws series by series.\n */\n protected readonly points = computed<readonly DrawnPoint[]>(() => {\n const x = this.xAxis();\n const y = this.yAxis();\n const maxSize = this.maxSize();\n const maxRadius = this.maxRadius();\n const drawn = this.visibleSeries().flatMap(s =>\n s.points.map(p => {\n const r =\n p.size === null || maxSize === null\n ? POINT_RADIUS\n : Math.max(MIN_RADIUS, maxRadius * Math.sqrt(maxSize > 0 ? p.size / maxSize : 0));\n const halo = wrChartMarkerExtent(s.marker, r + HALO_GAP);\n return {\n key: `${s.index}:${p.n}`,\n series: s.index,\n seriesLabel: s.label,\n color: s.color,\n marker: s.marker,\n n: p.n,\n x: p.x,\n y: p.y,\n size: p.size,\n label: p.label,\n left: percent(((p.x - x.min) / (x.max - x.min)) * 100),\n top: percent(((y.max - p.y) / (y.max - y.min)) * 100),\n r,\n d: wrChartMarkerPath(s.marker, r),\n halo,\n };\n })\n );\n return drawn.sort((a, b) => b.r - a.r);\n });\n\n /**\n * How far the largest marker drawn reaches past its centre, in px, sideways and up or\n * down — its hover ring included, so hovering moves nothing. The axes keep a point\n * off the frame only when it lands exactly on it, and one a fraction of a step inside\n * sits a few px from it; the stylesheet takes the larger of this and the plot's inset\n * tokens as the plot's padding, so the marker stays inside the plot rather than over\n * the tick labels or past the chart's own box. By SHAPE, not radius: a triangle's\n * point reaches 1.56 times its radius up. The ring's stroke is the stylesheet's.\n *\n * Up or down it is held to a quarter of `height`, so a short plot with a large\n * `maxRadius` keeps half its height for the drawing and lets the marker overhang.\n */\n protected readonly reach = computed(() => {\n let x = 0;\n let y = 0;\n for (const { halo } of this.points()) {\n x = Math.max(x, halo.side);\n y = Math.max(y, halo.top, halo.bottom);\n }\n return { x: wrRound(x, 3), y: wrRound(Math.min(y, this.height() / 4), 3) };\n });\n\n /** The y ticks, top to bottom: each value's label and its gridline's distance from the top, in percent. */\n protected readonly yTicks = computed(() => {\n const { min, max, step, ticks } = this.yAxis();\n const labels = this.numbers.ticks(ticks, step, 'y');\n return ticks.map((value, i) => ({ label: labels[i], top: percent(((max - value) / (max - min)) * 100) }));\n });\n\n /** The x ticks, left to right: each value's label and its gridline's distance from the left, in percent. */\n protected readonly xTicks = computed(() => {\n const { min, max, step, ticks } = this.xAxis();\n const values = [...ticks].reverse();\n const labels = this.numbers.ticks(values, step, 'x');\n return values.map((value, i) => ({ label: labels[i], left: percent(((value - min) / (max - min)) * 100) }));\n });\n\n /**\n * How far apart two neighbouring x ticks are, as a percentage of the drawing's width —\n * the room each tick label has, half on either side of its gridline, which the\n * stylesheet bounds it to and ellipsises past.\n */\n protected readonly xSlot = computed(() => {\n const count = this.xTicks().length;\n return count <= 1 ? 100 : percent(100 / (count - 1));\n });\n\n /**\n * One tooltip for the point under the pointer: the series' swatch and name with the\n * point's own label as its heading, then a row each for x, y and size. It points at\n * the box of the marker's hover ring from above, so the chip clears a large bubble and\n * a triangle's point rather than sitting on its centre.\n *\n * Points are found by POSITION — the nearest within 16px of the pointer, or anywhere a\n * larger marker reaches — so a point under the open chip can still be reached by\n * moving onto it, the way a sparkline is scrubbed.\n */\n protected readonly tip = useChartTooltip(\n this.tooltip,\n index => {\n const point = this.points()[index];\n const svg = this.svg()?.nativeElement;\n if (!point || !svg) return null;\n const box = svg.getBoundingClientRect();\n const x = box.left + (point.left / 100) * box.width;\n const y = box.top + (point.top / 100) * box.height;\n const rows: WrChartTooltipRow[] = [\n { label: this.xName(), value: this.numbers.value(point.x, 'x') },\n { label: this.yName(), value: this.numbers.value(point.y, 'y') },\n ];\n if (point.size !== null) rows.push({ label: this.sizeName(), value: this.numbers.value(point.size, 'size') });\n return {\n datum: { label: point.seriesLabel, value: point.label ?? '', color: point.color, rows },\n anchor: {\n x: x - point.halo.side,\n y: y - point.halo.top,\n width: point.halo.side * 2,\n height: point.halo.top + point.halo.bottom,\n },\n };\n },\n (x, y) => this.pointAt(x, y)\n );\n\n /** The point the tooltip is reading, ringed in the drawing. */\n protected readonly activePoint = computed(() => {\n const index = this.tip.active();\n return index === null ? null : (this.points()[index] ?? null);\n });\n\n /** The ring round the hovered point: its own shape, a little larger. */\n protected readonly haloPath = computed(() => {\n const point = this.activePoint();\n return point ? wrChartMarkerPath(point.marker, point.r + HALO_GAP) : '';\n });\n\n /**\n * The figures for `dataTable`: the chart's name as the caption, one group per series\n * shown and headed by its name, and a row per point headed by the point's `label` or\n * its position in the series. Every value is written as the tooltip writes it; a point\n * with no size has an empty size cell in a chart where others have one.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const sized = this.sized();\n const value = (v: number, axis: WrScatterAxis): string => this.numbers.value(v, axis);\n return {\n caption: this.resolvedAriaLabel(),\n columns: sized ? [this.xName(), this.yName(), this.sizeName()] : [this.xName(), this.yName()],\n groups: this.visibleSeries().map(s => ({\n header: s.label,\n rows: s.points.map(p => {\n const cells = [value(p.x, 'x'), value(p.y, 'y')];\n if (sized) cells.push(p.size === null ? '' : value(p.size, 'size'));\n return { header: p.label ?? this.ordinals.format(p.n), cells };\n }),\n })),\n };\n });\n\n /**\n * The point under the pointer. A MOUSE event, as every chart's is: a tap fires the\n * compatibility `mousemove` and no `pointermove`. Off every point, the open tooltip\n * starts its grace period.\n */\n protected onPointerMove(event: MouseEvent): void {\n if (!this.tooltip()) return;\n const index = this.pointAt(event.clientX, event.clientY);\n if (index === null) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n /**\n * The point nearest a viewport position: within 16px of its centre, or within the\n * circle its hover ring fits in where that is larger — a triangle's point or a\n * diamond's tips reach past its radius — and the nearest centre where several qualify.\n * A drawing with no box (nothing laid out yet) answers nothing.\n */\n private pointAt(clientX: number, clientY: number): number | null {\n const svg = this.svg()?.nativeElement;\n if (!svg) return null;\n const box = svg.getBoundingClientRect();\n if (box.width <= 0 || box.height <= 0) return null;\n let best: number | null = null;\n let nearest = Number.POSITIVE_INFINITY;\n this.points().forEach((point, index) => {\n const distance = Math.hypot(\n box.left + (point.left / 100) * box.width - clientX,\n box.top + (point.top / 100) * box.height - clientY\n );\n if (distance <= Math.max(HIT_RADIUS, point.halo.radius) && distance < nearest) {\n nearest = distance;\n best = index;\n }\n });\n return best;\n }\n\n /** One axis over the points shown: `wrChartAxis` with both ends kept off the data, and one value centred. */\n private fit(read: (point: { readonly x: number; readonly y: number }) => number): WrChartAxis {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n for (const s of this.visibleSeries()) {\n for (const p of s.points) {\n const v = read(p);\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n // No point at all leaves both infinite, which `wrChartAxis` answers with the empty frame;\n // one value, or a column of them, it centres between a step on either side.\n return wrChartAxis(min, max, { symmetric: true });\n }\n}\n\nexport type { WrScatterAxis, WrScatterPoint, WrScatterSeries } from './types';\n","@let active = activePoint();\n@if (showLegend() && resolvedSeries().length > 0) {\n <!-- Every row keys its series by the series' own marker shape, the channel that tells\n the points apart where the colours do not. Rows are tracked by position, so two\n series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-scatter-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n}\n\n<!-- Two columns: the y tick labels at inline start and the drawing beside them, with the\n y axis' name above and the x tick labels and the x axis' name under the drawing\n only, so their percentages are the drawing's. -->\n<div class=\"wr-scatter-chart__body\">\n @if (yLabel()) {\n <div class=\"wr-scatter-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showGrid()) {\n <!-- HTML beside the drawing rather than `<text>` inside it, in flow, so the column is\n exactly as wide as the longest label; each one hands the stylesheet the y of its\n own gridline. Hidden, as the drawing is one image: its name is what is announced,\n and the values are the data table's. -->\n <div class=\"wr-scatter-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-scatter-chart__y-tick\" [style.--wr-scatter-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <div\n class=\"wr-scatter-chart__plot\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n <!-- No viewBox: every position is a PERCENTAGE of the drawing, so nothing stretches.\n A viewBox with `preserveAspectRatio=\"none\"` would squash each marker with the\n drawing, a circle into an oval and a square into a bar, and a scatter's marker is\n its series' only channel besides colour. -->\n <!-- Hidden as well as presentational: `img` already makes it so, but every point is\n an `<svg>` of its own, and a tree that holds a node per point for thousands of\n them is work for nothing. -->\n <svg #svg class=\"wr-scatter-chart__svg\" aria-hidden=\"true\">\n @if (showGrid()) {\n @for (tick of yTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line\"\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"`${tick.top}%`\"\n [attr.y2]=\"`${tick.top}%`\"\n />\n }\n @for (tick of xTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line wr-scatter-chart__grid-line--x\"\n [attr.x1]=\"`${tick.left}%`\"\n [attr.x2]=\"`${tick.left}%`\"\n y1=\"0\"\n y2=\"100%\"\n />\n }\n }\n\n @for (p of points(); track p.key) {\n <!-- A nested `<svg>` placed by percentage, its marker drawn about its origin in\n px: an SVG's `x` and `y` take a percentage where a `transform` does not, so\n the marker sits on its point at any size and keeps its own. Its viewport is\n the drawing's whole box, painted nowhere, and `overflow` lets the marker\n reach outside it. -->\n <svg\n class=\"wr-scatter-chart__point\"\n [attr.x]=\"`${p.left}%`\"\n [attr.y]=\"`${p.top}%`\"\n overflow=\"visible\"\n [attr.data-series]=\"p.series\"\n [attr.data-x]=\"p.x\"\n [attr.data-y]=\"p.y\"\n [attr.data-size]=\"p.size\"\n [attr.data-radius]=\"p.r\"\n [attr.data-marker]=\"p.marker\"\n >\n <path class=\"wr-scatter-chart__marker\" [attr.d]=\"p.d\" [attr.fill]=\"p.color\" />\n </svg>\n }\n\n @if (active) {\n <!-- A ring of the point's own shape just outside it, so the reading is marked by\n outline as well as by the tooltip's arrow. -->\n <svg class=\"wr-scatter-chart__halo\" [attr.x]=\"`${active.left}%`\" [attr.y]=\"`${active.top}%`\" overflow=\"visible\">\n <path [attr.d]=\"haloPath()\" fill=\"none\" [attr.stroke]=\"active.color\" />\n </svg>\n }\n </svg>\n </div>\n\n @if (showGrid()) {\n <!-- The strip is as wide as the plot, and hands the stylesheet the distance between\n two ticks; each label hands it the x of its gridline, as a percentage of the\n drawing's width. -->\n <div class=\"wr-scatter-chart__x-axis\" aria-hidden=\"true\" [style.--wr-scatter-chart-x-slot]=\"xSlot()\">\n @for (tick of xTicks(); track $index) {\n <span class=\"wr-scatter-chart__x-tick\" [style.--wr-scatter-chart-x]=\"tick.left\">{{ tick.label }}</span>\n }\n </div>\n }\n\n @if (xLabel()) {\n <div class=\"wr-scatter-chart__x-title\">{{ xLabel() }}</div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the plot's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAM,eAAe;AAGrB,MAAM,aAAa;AAGnB,MAAM,aAAa;AAGnB,MAAM,WAAW;AAGjB,MAAM,WAAW,UAA0B,KAAK,MAAM,QAAQ,GAAI,IAAI;AA8EtE,IAAa,iBAAb,MAAa,eAAc;CACzB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,sBAAsB;CACzF;CAOS,SAAS,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAO9C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,KAAK,WAAW,sBAAsB,eAAe;CAO/F,S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A,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -2,8 +2,8 @@ import * as i0 from "@angular/core";
2
2
  import { Component, DestroyRef, LOCALE_ID, ViewEncapsulation, afterNextRender, computed, effect, inject, input, isDevMode, signal, viewChild, viewChildren } from "@angular/core";
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
4
  import { wrCheckStyles } from "ngwr/utils";
5
- import { readI18nText, useI18nText } from "ngwr/i18n";
6
- import { WrChartTable, chartColor, useChartNumbers } from "ngwr/charts/core";
5
+ import { useI18nText, wrReadI18nText } from "ngwr/i18n";
6
+ import { WrChartTable, useChartNumbers, wrChartColor } from "ngwr/charts/core";
7
7
  import { useChartTooltip } from "ngwr/popover";
8
8
  /**
9
9
  * @license
@@ -103,7 +103,7 @@ const SUM_TOLERANCE = 1e-9;
103
103
  const percent = (value) => Math.round(value * 1e3) / 1e3;
104
104
  function resolveNodes(nodes, path, inherited, key) {
105
105
  return nodes.map((node, i) => {
106
- const color = node.color ?? inherited ?? chartColor(i);
106
+ const color = node.color ?? inherited ?? wrChartColor(i);
107
107
  const own = typeof node.value === "number" && Number.isFinite(node.value) ? node.value : null;
108
108
  const ownSize = own !== null && own > 0 ? own : 0;
109
109
  const nodePath = [...path, node.label];
@@ -167,7 +167,7 @@ var WrTreemapChart = class WrTreemapChart {
167
167
  resolvedAriaLabel = useI18nText(this.ariaLabel, "treemapChart.label", "Treemap chart");
168
168
  valueLabel = input(null, ...ngDevMode ? [{ debugName: "valueLabel" }] : /* istanbul ignore next */ []);
169
169
  valueName = useI18nText(this.valueLabel, "treemapChart.value", "Value");
170
- shareName = readI18nText("treemapChart.share", "Share");
170
+ shareName = wrReadI18nText("treemapChart.share", "Share");
171
171
  height = input(280, {
172
172
  ...ngDevMode ? { debugName: "height" } : /* istanbul ignore next */ {},
173
173
  transform: (v) => {