ngwr 16.4.0 → 16.6.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 (427) hide show
  1. package/back-top/styles/_index.scss +6 -0
  2. package/breadcrumbs/styles/_rules.scss +34 -0
  3. package/cascader/styles/_rules.scss +7 -0
  4. package/charts/bar-chart/styles/_index.scss +494 -305
  5. package/charts/boxplot-chart/styles/_index.scss +114 -48
  6. package/charts/bullet-chart/styles/_index.scss +113 -42
  7. package/charts/calendar-heatmap/styles/_index.scss +111 -20
  8. package/charts/candlestick-chart/styles/_index.scss +61 -26
  9. package/charts/chart-legend/styles/_index.scss +120 -10
  10. package/charts/core/styles/_index.scss +201 -5
  11. package/charts/donut-chart/styles/_index.scss +76 -21
  12. package/charts/funnel-chart/styles/_index.scss +66 -38
  13. package/charts/gauge/styles/_index.scss +12 -1
  14. package/charts/heatmap-chart/styles/_index.scss +90 -53
  15. package/charts/line-chart/styles/_index.scss +143 -139
  16. package/charts/meter-group/styles/_index.scss +87 -25
  17. package/charts/radar-chart/styles/_index.scss +82 -40
  18. package/charts/scatter-chart/styles/_index.scss +117 -44
  19. package/charts/sparkline/styles/_index.scss +7 -1
  20. package/charts/treemap-chart/styles/_index.scss +94 -42
  21. package/charts/waterfall-chart/styles/_index.scss +150 -87
  22. package/color-picker/styles/_index.scss +7 -3
  23. package/copy-value/styles/_index.scss +21 -2
  24. package/counter/styles/_index.scss +1 -8
  25. package/date-picker/styles/_index.scss +15 -9
  26. package/date-stamp/styles/_index.scss +2 -1
  27. package/dialog/styles/_index.scss +43 -0
  28. package/drawer/styles/_index.scss +5 -1
  29. package/editor/styles/_index.scss +1 -8
  30. package/event-calendar/styles/_index.scss +2 -6
  31. package/fesm2022/ngwr-affix.mjs +1 -1
  32. package/fesm2022/ngwr-affix.mjs.map +1 -1
  33. package/fesm2022/ngwr-anchor.mjs +9 -2
  34. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  35. package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
  36. package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
  37. package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
  38. package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
  39. package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
  40. package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
  41. package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
  42. package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
  43. package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
  44. package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
  45. package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
  46. package/fesm2022/ngwr-animations-glow-border.mjs.map +1 -1
  47. package/fesm2022/ngwr-animations-gradient-flow.mjs.map +1 -1
  48. package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
  49. package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
  50. package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
  51. package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
  52. package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
  53. package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
  54. package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
  55. package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
  56. package/fesm2022/ngwr-animations-tilt.mjs +20 -13
  57. package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
  58. package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
  59. package/fesm2022/ngwr-breadcrumbs.mjs +40 -7
  60. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  61. package/fesm2022/ngwr-button.mjs +12 -3
  62. package/fesm2022/ngwr-button.mjs.map +1 -1
  63. package/fesm2022/ngwr-carousel-testing.mjs +4 -1
  64. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  65. package/fesm2022/ngwr-carousel.mjs +27 -2
  66. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  67. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  68. package/fesm2022/ngwr-cascader.mjs +72 -8
  69. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  70. package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
  71. package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
  72. package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
  73. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  74. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
  75. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
  77. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
  79. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
  81. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  82. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
  83. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
  84. package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
  85. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
  86. package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
  87. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  88. package/fesm2022/ngwr-charts-core.mjs +311 -23
  89. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  90. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  91. package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
  92. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  93. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
  94. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
  95. package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
  96. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
  97. package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
  98. package/fesm2022/ngwr-charts-gauge.mjs +98 -12
  99. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  100. package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
  101. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
  102. package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
  103. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  104. package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
  105. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  106. package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
  107. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  108. package/fesm2022/ngwr-charts-meter-group.mjs +225 -31
  109. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  110. package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
  111. package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
  112. package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
  113. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  114. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
  115. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
  116. package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
  117. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  118. package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
  119. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  120. package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
  121. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
  122. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
  123. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
  124. package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
  125. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
  126. package/fesm2022/ngwr-checkbox.mjs +3 -2
  127. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  128. package/fesm2022/ngwr-color-picker.mjs +65 -5
  129. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  130. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  131. package/fesm2022/ngwr-context-menu.mjs +51 -24
  132. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  133. package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
  134. package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
  135. package/fesm2022/ngwr-copy-value.mjs +38 -2
  136. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  137. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  138. package/fesm2022/ngwr-date-picker.mjs +105 -9
  139. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  140. package/fesm2022/ngwr-dialog.mjs +29 -11
  141. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  142. package/fesm2022/ngwr-directives.mjs +9 -6
  143. package/fesm2022/ngwr-directives.mjs.map +1 -1
  144. package/fesm2022/ngwr-drawer.mjs +19 -3
  145. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  146. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  147. package/fesm2022/ngwr-dropdown.mjs +35 -6
  148. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  149. package/fesm2022/ngwr-editor.mjs +1 -0
  150. package/fesm2022/ngwr-editor.mjs.map +1 -1
  151. package/fesm2022/ngwr-event-calendar.mjs +20 -9
  152. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  153. package/fesm2022/ngwr-form.mjs +170 -3
  154. package/fesm2022/ngwr-form.mjs.map +1 -1
  155. package/fesm2022/ngwr-graph.mjs +81 -13
  156. package/fesm2022/ngwr-graph.mjs.map +1 -1
  157. package/fesm2022/ngwr-i18n-ar.mjs +20 -0
  158. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  159. package/fesm2022/ngwr-i18n-cs.mjs +20 -0
  160. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  161. package/fesm2022/ngwr-i18n-de.mjs +20 -0
  162. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  163. package/fesm2022/ngwr-i18n-en.mjs +20 -0
  164. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  165. package/fesm2022/ngwr-i18n-es.mjs +20 -0
  166. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  167. package/fesm2022/ngwr-i18n-fr.mjs +20 -0
  168. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  169. package/fesm2022/ngwr-i18n-he.mjs +20 -0
  170. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  171. package/fesm2022/ngwr-i18n-hi.mjs +20 -0
  172. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  173. package/fesm2022/ngwr-i18n-id.mjs +20 -0
  174. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  175. package/fesm2022/ngwr-i18n-it.mjs +20 -0
  176. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  177. package/fesm2022/ngwr-i18n-ja.mjs +20 -0
  178. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  179. package/fesm2022/ngwr-i18n-ko.mjs +20 -0
  180. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  181. package/fesm2022/ngwr-i18n-nl.mjs +20 -0
  182. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  183. package/fesm2022/ngwr-i18n-pl.mjs +20 -0
  184. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  185. package/fesm2022/ngwr-i18n-pt.mjs +20 -0
  186. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  187. package/fesm2022/ngwr-i18n-ru.mjs +20 -0
  188. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  189. package/fesm2022/ngwr-i18n-sv.mjs +20 -0
  190. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  191. package/fesm2022/ngwr-i18n-tr.mjs +20 -0
  192. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  193. package/fesm2022/ngwr-i18n-uk.mjs +20 -0
  194. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  195. package/fesm2022/ngwr-i18n-vi.mjs +20 -0
  196. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  197. package/fesm2022/ngwr-i18n-zh-tw.mjs +20 -0
  198. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  199. package/fesm2022/ngwr-i18n-zh.mjs +20 -0
  200. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  201. package/fesm2022/ngwr-i18n.mjs +82 -11
  202. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  203. package/fesm2022/ngwr-input-number.mjs +24 -1
  204. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  205. package/fesm2022/ngwr-input-otp.mjs +2 -2
  206. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  207. package/fesm2022/ngwr-input.mjs +10 -2
  208. package/fesm2022/ngwr-input.mjs.map +1 -1
  209. package/fesm2022/ngwr-layout.mjs.map +1 -1
  210. package/fesm2022/ngwr-lightbox.mjs +20 -3
  211. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  212. package/fesm2022/ngwr-list.mjs +1 -1
  213. package/fesm2022/ngwr-list.mjs.map +1 -1
  214. package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
  215. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  216. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  217. package/fesm2022/ngwr-mention.mjs +8 -0
  218. package/fesm2022/ngwr-mention.mjs.map +1 -1
  219. package/fesm2022/ngwr-meta.mjs +9 -6
  220. package/fesm2022/ngwr-meta.mjs.map +1 -1
  221. package/fesm2022/ngwr-overlay.mjs +21 -2
  222. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  223. package/fesm2022/ngwr-page-header.mjs +21 -0
  224. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  225. package/fesm2022/ngwr-pagination.mjs +2 -0
  226. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  227. package/fesm2022/ngwr-pipes.mjs +8 -1
  228. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  229. package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
  230. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  231. package/fesm2022/ngwr-popconfirm.mjs +43 -6
  232. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  233. package/fesm2022/ngwr-popover.mjs +114 -15
  234. package/fesm2022/ngwr-popover.mjs.map +1 -1
  235. package/fesm2022/ngwr-qr.mjs +6 -2
  236. package/fesm2022/ngwr-qr.mjs.map +1 -1
  237. package/fesm2022/ngwr-radio.mjs +71 -5
  238. package/fesm2022/ngwr-radio.mjs.map +1 -1
  239. package/fesm2022/ngwr-schema-form.mjs +12 -1
  240. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  241. package/fesm2022/ngwr-scroll.mjs +1 -3
  242. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  243. package/fesm2022/ngwr-segmented.mjs +20 -0
  244. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  245. package/fesm2022/ngwr-select.mjs +80 -9
  246. package/fesm2022/ngwr-select.mjs.map +1 -1
  247. package/fesm2022/ngwr-sortable-list.mjs +16 -4
  248. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  249. package/fesm2022/ngwr-storage.mjs +1 -1
  250. package/fesm2022/ngwr-storage.mjs.map +1 -1
  251. package/fesm2022/ngwr-switch.mjs +2 -2
  252. package/fesm2022/ngwr-switch.mjs.map +1 -1
  253. package/fesm2022/ngwr-table.mjs +43 -7
  254. package/fesm2022/ngwr-table.mjs.map +1 -1
  255. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  256. package/fesm2022/ngwr-textarea.mjs +2 -2
  257. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  258. package/fesm2022/ngwr-toast.mjs +28 -0
  259. package/fesm2022/ngwr-toast.mjs.map +1 -1
  260. package/fesm2022/ngwr-tour.mjs +16 -11
  261. package/fesm2022/ngwr-tour.mjs.map +1 -1
  262. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  263. package/fesm2022/ngwr-tree.mjs +49 -16
  264. package/fesm2022/ngwr-tree.mjs.map +1 -1
  265. package/fesm2022/ngwr-typography.mjs +20 -0
  266. package/fesm2022/ngwr-typography.mjs.map +1 -1
  267. package/fesm2022/ngwr-utils-router.mjs.map +1 -1
  268. package/fesm2022/ngwr-utils.mjs +46 -4
  269. package/fesm2022/ngwr-utils.mjs.map +1 -1
  270. package/fesm2022/ngwr-validators.mjs +33 -1
  271. package/fesm2022/ngwr-validators.mjs.map +1 -1
  272. package/fesm2022/ngwr-version.mjs +1 -1
  273. package/fesm2022/ngwr-version.mjs.map +1 -1
  274. package/fesm2022/ngwr-window.mjs +16 -9
  275. package/fesm2022/ngwr-window.mjs.map +1 -1
  276. package/form/styles/_index.scss +37 -0
  277. package/graph/styles/_index.scss +1 -9
  278. package/i18n/ar.json +20 -0
  279. package/i18n/cs.json +20 -0
  280. package/i18n/de.json +20 -0
  281. package/i18n/en.json +20 -0
  282. package/i18n/es.json +20 -0
  283. package/i18n/fr.json +20 -0
  284. package/i18n/he.json +20 -0
  285. package/i18n/hi.json +20 -0
  286. package/i18n/id.json +20 -0
  287. package/i18n/it.json +20 -0
  288. package/i18n/ja.json +20 -0
  289. package/i18n/ko.json +20 -0
  290. package/i18n/nl.json +20 -0
  291. package/i18n/pl.json +20 -0
  292. package/i18n/pt.json +20 -0
  293. package/i18n/ru.json +20 -0
  294. package/i18n/sv.json +20 -0
  295. package/i18n/tr.json +20 -0
  296. package/i18n/uk.json +20 -0
  297. package/i18n/vi.json +20 -0
  298. package/i18n/zh-TW.json +20 -0
  299. package/i18n/zh.json +20 -0
  300. package/image-cropper/styles/_index.scss +1 -9
  301. package/input-number/styles/_index.scss +7 -0
  302. package/layout/styles/_index.scss +13 -1
  303. package/llms-full.txt +17 -17
  304. package/llms.txt +7 -3
  305. package/loading-bar/styles/_rules.scss +6 -0
  306. package/package.json +2 -2
  307. package/page-header/styles/_index.scss +18 -0
  308. package/popconfirm/styles/_index.scss +6 -0
  309. package/popover/styles/_index.scss +31 -13
  310. package/schematics/use/symbol-map.json +3 -0
  311. package/segmented/styles/_index.scss +7 -0
  312. package/select/styles/_index.scss +7 -0
  313. package/sidebar/styles/_index.scss +6 -0
  314. package/skills/ngwr/references/catalog.md +2 -2
  315. package/sortable-list/styles/_rules.scss +1 -9
  316. package/speed-dial/styles/_index.scss +6 -0
  317. package/stepper/styles/_index.scss +1 -9
  318. package/table/styles/_index.scss +49 -0
  319. package/theme/_index.scss +12 -1
  320. package/theme/styles/_colors.scss +11 -0
  321. package/theme/styles/_contrast.scss +6 -0
  322. package/theme/styles/_index.scss +1 -0
  323. package/theme/styles/_mixins.scss +45 -0
  324. package/theme/styles/_print.scss +17 -0
  325. package/toast/styles/_index.scss +7 -0
  326. package/tour/styles/_index.scss +14 -0
  327. package/tree/styles/_index.scss +1 -9
  328. package/types/ngwr-anchor.d.ts +3 -0
  329. package/types/ngwr-animations-aurora.d.ts +6 -0
  330. package/types/ngwr-animations-blur-reveal.d.ts +6 -0
  331. package/types/ngwr-animations-click-sparks.d.ts +6 -0
  332. package/types/ngwr-animations-confetti.d.ts +6 -0
  333. package/types/ngwr-animations-decode.d.ts +6 -0
  334. package/types/ngwr-animations-destruct.d.ts +6 -0
  335. package/types/ngwr-animations-dot-grid.d.ts +6 -0
  336. package/types/ngwr-animations-falling-letters.d.ts +6 -0
  337. package/types/ngwr-animations-flow-lines.d.ts +6 -0
  338. package/types/ngwr-animations-fluid-cursor.d.ts +6 -0
  339. package/types/ngwr-animations-glitch.d.ts +6 -0
  340. package/types/ngwr-animations-glow-border.d.ts +6 -0
  341. package/types/ngwr-animations-gradient-flow.d.ts +6 -0
  342. package/types/ngwr-animations-marquee.d.ts +6 -0
  343. package/types/ngwr-animations-orbit.d.ts +6 -0
  344. package/types/ngwr-animations-reveal.d.ts +6 -0
  345. package/types/ngwr-animations-ripple-grid.d.ts +6 -0
  346. package/types/ngwr-animations-rotate-reveal.d.ts +6 -0
  347. package/types/ngwr-animations-shimmer.d.ts +6 -0
  348. package/types/ngwr-animations-spotlight.d.ts +6 -0
  349. package/types/ngwr-animations-thread-lines.d.ts +6 -0
  350. package/types/ngwr-animations-tilt.d.ts +10 -0
  351. package/types/ngwr-animations-typewriter.d.ts +6 -0
  352. package/types/ngwr-breadcrumbs.d.ts +25 -0
  353. package/types/ngwr-button.d.ts +23 -3
  354. package/types/ngwr-carousel-testing.d.ts +6 -4
  355. package/types/ngwr-carousel.d.ts +16 -3
  356. package/types/ngwr-cascader-testing.d.ts +4 -3
  357. package/types/ngwr-cascader.d.ts +34 -3
  358. package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
  359. package/types/ngwr-charts-bar-chart.d.ts +220 -48
  360. package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
  361. package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
  362. package/types/ngwr-charts-bullet-chart.d.ts +72 -12
  363. package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
  364. package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
  365. package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
  366. package/types/ngwr-charts-chart-legend.d.ts +142 -5
  367. package/types/ngwr-charts-core.d.ts +275 -21
  368. package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
  369. package/types/ngwr-charts-donut-chart.d.ts +124 -16
  370. package/types/ngwr-charts-funnel-chart.d.ts +62 -6
  371. package/types/ngwr-charts-gauge-testing.d.ts +5 -1
  372. package/types/ngwr-charts-gauge.d.ts +72 -10
  373. package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
  374. package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
  375. package/types/ngwr-charts-line-chart.d.ts +215 -86
  376. package/types/ngwr-charts-meter-group.d.ts +98 -7
  377. package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
  378. package/types/ngwr-charts-radar-chart.d.ts +148 -28
  379. package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
  380. package/types/ngwr-charts-scatter-chart.d.ts +188 -18
  381. package/types/ngwr-charts-sparkline.d.ts +26 -4
  382. package/types/ngwr-charts-treemap-chart.d.ts +121 -23
  383. package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
  384. package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
  385. package/types/ngwr-checkbox.d.ts +1 -0
  386. package/types/ngwr-color-picker.d.ts +28 -0
  387. package/types/ngwr-context-menu-testing.d.ts +10 -9
  388. package/types/ngwr-context-menu.d.ts +18 -1
  389. package/types/ngwr-copy-value.d.ts +8 -0
  390. package/types/ngwr-date-picker.d.ts +53 -2
  391. package/types/ngwr-dialog.d.ts +64 -13
  392. package/types/ngwr-directives.d.ts +12 -4
  393. package/types/ngwr-drawer.d.ts +33 -2
  394. package/types/ngwr-dropdown-testing.d.ts +8 -5
  395. package/types/ngwr-dropdown.d.ts +29 -6
  396. package/types/ngwr-event-calendar.d.ts +4 -0
  397. package/types/ngwr-form.d.ts +85 -1
  398. package/types/ngwr-graph.d.ts +22 -6
  399. package/types/ngwr-i18n.d.ts +65 -5
  400. package/types/ngwr-input-number.d.ts +8 -0
  401. package/types/ngwr-input.d.ts +7 -0
  402. package/types/ngwr-layout.d.ts +1 -1
  403. package/types/ngwr-lightbox.d.ts +15 -0
  404. package/types/ngwr-loading-bar-router.d.ts +6 -0
  405. package/types/ngwr-overlay.d.ts +16 -1
  406. package/types/ngwr-page-header.d.ts +23 -1
  407. package/types/ngwr-popconfirm-testing.d.ts +11 -2
  408. package/types/ngwr-popconfirm.d.ts +29 -2
  409. package/types/ngwr-popover.d.ts +87 -13
  410. package/types/ngwr-radio.d.ts +47 -5
  411. package/types/ngwr-segmented.d.ts +7 -0
  412. package/types/ngwr-select.d.ts +57 -13
  413. package/types/ngwr-sortable-list.d.ts +20 -7
  414. package/types/ngwr-table.d.ts +59 -6
  415. package/types/ngwr-tabs-router.d.ts +6 -0
  416. package/types/ngwr-toast.d.ts +11 -0
  417. package/types/ngwr-tour.d.ts +21 -3
  418. package/types/ngwr-tree-testing.d.ts +1 -2
  419. package/types/ngwr-tree.d.ts +33 -2
  420. package/types/ngwr-typography.d.ts +7 -0
  421. package/types/ngwr-utils-router.d.ts +6 -0
  422. package/types/ngwr-utils.d.ts +56 -2
  423. package/types/ngwr-validators.d.ts +49 -1
  424. package/types/ngwr-version.d.ts +1 -1
  425. package/types/ngwr-window.d.ts +14 -11
  426. package/typography/styles/_index.scss +4 -0
  427. package/window/styles/_index.scss +6 -19
@@ -1,19 +1,22 @@
1
1
  import * as i0 from "@angular/core";
2
- import { Component, LOCALE_ID, ViewEncapsulation, computed, effect, inject, input, isDevMode, model, viewChildren } from "@angular/core";
2
+ import { Component, ElementRef, LOCALE_ID, ViewEncapsulation, afterRenderEffect, computed, effect, inject, input, isDevMode, model, signal, untracked, viewChild } from "@angular/core";
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
+ import { NgTemplateOutlet } from "@angular/common";
4
5
  import { wrCheckStyles, wrClamp } from "ngwr/utils";
5
6
  import { useI18nFormatter, useI18nText, wrReadI18nText } from "ngwr/i18n";
6
7
  import { WrChartLegend } from "ngwr/charts/chart-legend";
7
- import { WrChartTable, useChartNumbers, wrChartColor, wrChartDash, wrChartMarker, wrChartMarkerExtent, wrChartMarkerPath } from "ngwr/charts/core";
8
- import { useChartTooltip } from "ngwr/popover";
8
+ import { WrChartState, WrChartTable, useChartHover, useChartNumbers, useChartSize, useChartState, wrChartAxis, wrChartColor, wrChartDash, wrChartLabelStep, wrChartLongest, wrChartMarker, wrChartMarkerExtent, wrChartMarkerPath, wrChartNumberFormat, wrChartRound } from "ngwr/charts/core";
9
+ import { useChartTooltip, wrCoerceChartTooltip } from "ngwr/popover";
9
10
  /**
10
11
  * @license
11
12
  *
12
13
  * Use of this source code is governed by an MIT-style license that can be
13
14
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
14
15
  */
15
- const short = (value) => Math.round(value * 1e4) / 1e4 || 0;
16
- const percent = (share) => Math.round(share * 1e4) / 100 || 0;
16
+ const short = (value) => wrChartRound(value, 4);
17
+ const percent = (share) => wrChartRound(share * 100, 2);
18
+ const PROBES = 3;
19
+ const LABEL_GAP = 8;
17
20
  const POINT_RADIUS = 4;
18
21
  var WrBarChart = class WrBarChart {
19
22
  data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
@@ -30,9 +33,17 @@ var WrBarChart = class WrBarChart {
30
33
  totalText = wrReadI18nText("barChart.total", "Total");
31
34
  valueText = wrReadI18nText("barChart.value", "Value");
32
35
  datumText = useI18nFormatter("barChart.datum", "{{label}}: {{value}}");
33
- ordinals = new Intl.NumberFormat(inject(LOCALE_ID));
34
- color = input("var(--wr-color-primary)", ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
35
- showValues = input(true, {
36
+ ordinals = wrChartNumberFormat(inject(LOCALE_ID));
37
+ color = input(wrChartColor(0), ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
38
+ showGrid = input(true, {
39
+ ...ngDevMode ? { debugName: "showGrid" } : /* istanbul ignore next */ {},
40
+ transform: coerceBooleanProperty
41
+ });
42
+ showAxis = input(true, {
43
+ ...ngDevMode ? { debugName: "showAxis" } : /* istanbul ignore next */ {},
44
+ transform: coerceBooleanProperty
45
+ });
46
+ showValues = input(false, {
36
47
  ...ngDevMode ? { debugName: "showValues" } : /* istanbul ignore next */ {},
37
48
  transform: coerceBooleanProperty
38
49
  });
@@ -46,12 +57,24 @@ var WrBarChart = class WrBarChart {
46
57
  });
47
58
  tooltip = input(true, {
48
59
  ...ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {},
49
- transform: coerceBooleanProperty
60
+ transform: wrCoerceChartTooltip
50
61
  });
51
- showLegend = input(true, {
62
+ showLegend = input("auto", {
52
63
  ...ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {},
64
+ transform: (value) => value === "auto" ? "auto" : coerceBooleanProperty(value)
65
+ });
66
+ legendPosition = input("bottom", ...ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []);
67
+ loading = input(false, {
68
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
69
+ transform: coerceBooleanProperty
70
+ });
71
+ error = input(false, {
72
+ ...ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {},
53
73
  transform: coerceBooleanProperty
54
74
  });
75
+ emptyLabel = input(null, ...ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []);
76
+ loadingLabel = input(null, ...ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []);
77
+ errorLabel = input(null, ...ngDevMode ? [{ debugName: "errorLabel" }] : /* istanbul ignore next */ []);
55
78
  toggleableLegend = input(false, {
56
79
  ...ngDevMode ? { debugName: "toggleableLegend" } : /* istanbul ignore next */ {},
57
80
  transform: coerceBooleanProperty
@@ -64,11 +87,26 @@ var WrBarChart = class WrBarChart {
64
87
  });
65
88
  valueFormat = input(null, ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
66
89
  numbers = useChartNumbers(this.valueFormat);
67
- barEls = viewChildren("barEl", ...ngDevMode ? [{ debugName: "barEls" }] : /* istanbul ignore next */ []);
68
- categoryEls = viewChildren("categoryEl", ...ngDevMode ? [{ debugName: "categoryEls" }] : /* istanbul ignore next */ []);
69
- pointEls = viewChildren("pointEl", ...ngDevMode ? [{ debugName: "pointEls" }] : /* istanbul ignore next */ []);
90
+ host = inject(ElementRef).nativeElement;
91
+ trackEl = viewChild("trackEl", ...ngDevMode ? [{ debugName: "trackEl" }] : /* istanbul ignore next */ []);
92
+ labelsEl = viewChild("labelsEl", ...ngDevMode ? [{ debugName: "labelsEl" }] : /* istanbul ignore next */ []);
93
+ labelsSize = useChartSize(this.labelsEl);
94
+ labelWidth = signal(0, ...ngDevMode ? [{ debugName: "labelWidth" }] : /* istanbul ignore next */ []);
70
95
  constructor() {
71
96
  if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("charts/bar-chart");
97
+ useChartHover({
98
+ enter: (index) => this.tip.enter(index),
99
+ leave: (event) => this.tip.leave(event)
100
+ });
101
+ afterRenderEffect(() => {
102
+ const row = this.labelsEl()?.nativeElement;
103
+ this.labelProbes();
104
+ this.labelsSize();
105
+ if (!row) return;
106
+ let width = 0;
107
+ for (const probe of row.querySelectorAll(".wr-bar-chart__label-probe")) width = Math.max(width, probe.getBoundingClientRect().width);
108
+ if (width !== untracked(this.labelWidth)) this.labelWidth.set(width);
109
+ });
72
110
  if (isDevMode()) {
73
111
  let warned = false;
74
112
  effect(() => {
@@ -116,7 +154,7 @@ var WrBarChart = class WrBarChart {
116
154
  };
117
155
  }, ...ngDevMode ? [{ debugName: "dataScale" }] : /* istanbul ignore next */ []);
118
156
  bars = computed(() => {
119
- const { lo, hi } = this.dataScale();
157
+ const { lo, hi } = this.scale();
120
158
  const combo = this.hasLines();
121
159
  const floor = this.at(0);
122
160
  const zero = this.zero();
@@ -133,10 +171,10 @@ var WrBarChart = class WrBarChart {
133
171
  display: missing ? "" : this.numbers.label(value),
134
172
  text,
135
173
  color: d.color ?? this.color(),
136
- share,
174
+ share: short(share),
137
175
  below,
138
176
  start: below ? short(zero - share) : zero,
139
- at: below ? short(zero - share) : zero + share,
177
+ at: below ? short(zero - share) : short(zero + share),
140
178
  name: missing ? d.label : this.name(d.label, value)
141
179
  };
142
180
  });
@@ -203,7 +241,35 @@ var WrBarChart = class WrBarChart {
203
241
  hi
204
242
  };
205
243
  }, ...ngDevMode ? [{ debugName: "seriesScale" }] : /* istanbul ignore next */ []);
206
- scale = computed(() => this.seriesMode() ? this.seriesScale() : this.dataScale(), ...ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []);
244
+ scale = computed(() => {
245
+ const { lo, hi } = this.seriesMode() ? this.seriesScale() : this.dataScale();
246
+ if (!this.showGrid() && !this.showAxis()) return {
247
+ lo,
248
+ hi,
249
+ ticks: [],
250
+ step: hi - lo
251
+ };
252
+ const axis = wrChartAxis(lo, hi, { includeZero: true });
253
+ const fixed = this.max() > 0;
254
+ const slack = axis.step * 1e-6;
255
+ const top = fixed ? hi : axis.ticks.find((tick) => Math.abs(tick - hi) <= slack) ?? axis.max;
256
+ return {
257
+ lo: axis.min,
258
+ hi: top,
259
+ ticks: axis.ticks.filter((tick) => tick <= top + slack),
260
+ step: axis.step
261
+ };
262
+ }, ...ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []);
263
+ ticks = computed(() => {
264
+ const { ticks, step } = this.scale();
265
+ const labels = this.showAxis() ? this.numbers.ticks(ticks, step) : [];
266
+ return ticks.map((value, index) => ({
267
+ value,
268
+ at: short(this.at(value)),
269
+ text: labels[index] ?? ""
270
+ }));
271
+ }, ...ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []);
272
+ tickProbes = computed(() => wrChartLongest(this.ticks().map((tick) => tick.text), PROBES), ...ngDevMode ? [{ debugName: "tickProbes" }] : /* istanbul ignore next */ []);
207
273
  at(value) {
208
274
  const { lo, hi } = this.scale();
209
275
  return wrClamp((value - lo) / (hi - lo), 0, 1);
@@ -213,17 +279,25 @@ var WrBarChart = class WrBarChart {
213
279
  const series = this.visibleSeries();
214
280
  const labels = this.categories();
215
281
  const values = this.showValues();
282
+ const stacked = this.stacked();
216
283
  const zero = this.at(0);
217
284
  const name = (label, value) => this.name(label, value);
218
285
  return Array.from({ length: this.categoryCount() }, (_, c) => {
219
286
  const label = labels[c] ?? this.ordinals.format(c + 1);
220
- if (!this.stacked()) return {
287
+ let from = zero;
288
+ let to = zero;
289
+ const reach = (start, size) => {
290
+ from = Math.min(from, start);
291
+ to = Math.max(to, start + size);
292
+ };
293
+ if (!stacked) return {
221
294
  label,
222
295
  lanes: series.map((s) => {
223
296
  const v = s.data[c];
224
297
  if (v === null || v === void 0) return {
225
298
  key: s.index,
226
- bars: [],
299
+ up: [],
300
+ down: [],
227
301
  ends: []
228
302
  };
229
303
  const end = this.at(v);
@@ -231,13 +305,16 @@ var WrBarChart = class WrBarChart {
231
305
  series: s.index,
232
306
  color: s.color,
233
307
  dash: s.dash,
308
+ layer: null,
234
309
  start: short(Math.min(zero, end)),
235
310
  size: short(Math.abs(end - zero)),
236
311
  name: name(s.label, v)
237
312
  };
313
+ reach(bar.start, bar.size);
238
314
  return {
239
315
  key: s.index,
240
- bars: [bar],
316
+ up: v < 0 ? [] : [bar],
317
+ down: v < 0 ? [bar] : [],
241
318
  ends: values ? [{
242
319
  text: this.numbers.label(v),
243
320
  at: short(end),
@@ -245,35 +322,36 @@ var WrBarChart = class WrBarChart {
245
322
  name: null
246
323
  }] : []
247
324
  };
248
- })
325
+ }),
326
+ from: short(from),
327
+ to: short(to)
249
328
  };
250
- let up = 0;
251
- let down = 0;
252
- let rises = false;
253
- let falls = false;
254
- const bars = series.flatMap((s) => {
329
+ let rise = 0;
330
+ let fall = 0;
331
+ const up = [];
332
+ const down = [];
333
+ for (const s of series) {
255
334
  const v = s.data[c];
256
- if (v === null || v === void 0) return [];
257
- const base = v < 0 ? down : up;
335
+ if (v === null || v === void 0) continue;
336
+ const side = v < 0 ? down : up;
337
+ const base = v < 0 ? fall : rise;
258
338
  const top = base + v;
259
- if (v < 0) {
260
- down = top;
261
- falls = true;
262
- } else {
263
- up = top;
264
- rises = true;
265
- }
266
- const from = this.at(base);
267
- const to = this.at(top);
268
- return [{
339
+ if (v < 0) fall = top;
340
+ else rise = top;
341
+ const start = this.at(base);
342
+ const end = this.at(top);
343
+ const bar = {
269
344
  series: s.index,
270
345
  color: s.color,
271
346
  dash: s.dash,
272
- start: short(Math.min(from, to)),
273
- size: short(Math.abs(to - from)),
347
+ layer: -side.length,
348
+ start: short(Math.min(start, end)),
349
+ size: short(Math.abs(end - start)),
274
350
  name: name(s.label, v)
275
- }];
276
- });
351
+ };
352
+ reach(bar.start, bar.size);
353
+ side.push(bar);
354
+ }
277
355
  const total = (value, below) => ({
278
356
  text: this.numbers.label(value),
279
357
  at: short(this.at(value)),
@@ -281,15 +359,18 @@ var WrBarChart = class WrBarChart {
281
359
  name: name(this.totalText(), value)
282
360
  });
283
361
  const ends = [];
284
- if (values && rises) ends.push(total(up, false));
285
- if (values && falls) ends.push(total(down, true));
362
+ if (values && up.length > 0) ends.push(total(rise, false));
363
+ if (values && down.length > 0) ends.push(total(fall, true));
286
364
  return {
287
365
  label,
288
366
  lanes: [{
289
367
  key: 0,
290
- bars,
368
+ up,
369
+ down,
291
370
  ends
292
- }]
371
+ }],
372
+ from: short(from),
373
+ to: short(to)
293
374
  };
294
375
  });
295
376
  }, ...ngDevMode ? [{ debugName: "seriesCategories" }] : /* istanbul ignore next */ []);
@@ -300,19 +381,17 @@ var WrBarChart = class WrBarChart {
300
381
  max: [],
301
382
  min: []
302
383
  };
303
- if (!this.seriesMode()) {
304
- const bars = this.bars();
305
- return {
306
- max: [...new Set(bars.filter((b) => !b.below && !b.missing).map((b) => b.display))],
307
- min: [...new Set(bars.filter((b) => b.below && !b.missing).map((b) => b.display))]
308
- };
309
- }
310
- const ends = this.seriesCategories().flatMap((c) => c.lanes.flatMap((lane) => lane.ends));
384
+ const ends = this.seriesMode() ? this.seriesCategories().flatMap((c) => c.lanes.flatMap((lane) => lane.ends)) : this.bars().filter((bar) => !bar.missing).map((bar) => ({
385
+ text: bar.display,
386
+ below: bar.below
387
+ }));
311
388
  return {
312
- max: [...new Set(ends.filter((e) => !e.below).map((e) => e.text))],
313
- min: [...new Set(ends.filter((e) => e.below).map((e) => e.text))]
389
+ max: wrChartLongest(ends.filter((end) => !end.below).map((end) => end.text), PROBES),
390
+ min: wrChartLongest(ends.filter((end) => end.below).map((end) => end.text), PROBES)
314
391
  };
315
392
  }, ...ngDevMode ? [{ debugName: "rooms" }] : /* istanbul ignore next */ []);
393
+ labelProbes = computed(() => this.horizontal() ? [] : wrChartLongest(this.categoryLabels(), PROBES), ...ngDevMode ? [{ debugName: "labelProbes" }] : /* istanbul ignore next */ []);
394
+ labelStep = computed(() => wrChartLabelStep(this.categoryTotal(), this.labelsSize().width, this.labelWidth(), LABEL_GAP), ...ngDevMode ? [{ debugName: "labelStep" }] : /* istanbul ignore next */ []);
316
395
  lineLayers = computed(() => {
317
396
  const count = this.seriesMode() ? this.categoryCount() : this.data().length;
318
397
  if (count === 0) return [];
@@ -329,27 +408,27 @@ var WrBarChart = class WrBarChart {
329
408
  y: percent(1 - at)
330
409
  };
331
410
  };
411
+ const offset = this.resolvedSeries().length;
332
412
  return this.visibleLines().map((line) => {
333
- const segments = [];
334
413
  const points = [];
335
- let previous = null;
414
+ let path = "";
415
+ let segments = 0;
416
+ let drawing = false;
336
417
  for (let c = 0; c < count; c++) {
337
418
  const value = line.data[c];
338
419
  if (value === null || value === void 0) {
339
- previous = null;
420
+ drawing = false;
340
421
  continue;
341
422
  }
342
423
  const position = place(c, value);
343
- if (previous) segments.push({
344
- from: previous,
345
- to: position
346
- });
424
+ path += `${drawing ? "L" : "M"}${position.x} ${position.y}`;
425
+ if (drawing) segments++;
347
426
  points.push({
348
427
  ...position,
349
428
  category: c,
350
429
  name: this.name(labels[c] ?? this.ordinals.format(c + 1), value)
351
430
  });
352
- previous = position;
431
+ drawing = true;
353
432
  }
354
433
  return {
355
434
  index: line.index,
@@ -359,8 +438,10 @@ var WrBarChart = class WrBarChart {
359
438
  marker: line.marker,
360
439
  d: wrChartMarkerPath(line.marker, POINT_RADIUS),
361
440
  count,
441
+ path: segments > 0 ? path : "",
362
442
  segments,
363
- points
443
+ points,
444
+ key: offset + line.index
364
445
  };
365
446
  });
366
447
  }, ...ngDevMode ? [{ debugName: "lineLayers" }] : /* istanbul ignore next */ []);
@@ -371,18 +452,41 @@ var WrBarChart = class WrBarChart {
371
452
  const extent = wrChartMarkerExtent(line.marker, POINT_RADIUS);
372
453
  reach = Math.max(reach, horizontal ? extent.side : Math.max(extent.top, extent.bottom));
373
454
  }
374
- return Math.round(reach * 1e3) / 1e3;
455
+ return wrChartRound(reach, 3);
375
456
  }, ...ngDevMode ? [{ debugName: "lineReach" }] : /* istanbul ignore next */ []);
376
- legendItems = computed(() => [...this.resolvedSeries().map(({ label, color, dash }) => ({
457
+ legendItems = computed(() => [...this.resolvedSeries().map(({ label, color }) => ({
377
458
  label,
378
- color,
379
- dash
459
+ color
380
460
  })), ...this.resolvedLines().map(({ label, color, dash, marker }) => ({
381
461
  label,
382
462
  color,
383
463
  dash,
384
464
  marker
385
465
  }))], ...ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []);
466
+ legendShown = computed(() => {
467
+ const show = this.showLegend();
468
+ const rows = this.legendItems().length;
469
+ if (show === false || rows === 0 || this.legendPosition() === "none") return false;
470
+ if (!this.seriesMode() && !this.hasLines()) return false;
471
+ return show === true || rows > 1 || this.hasLines();
472
+ }, ...ngDevMode ? [{ debugName: "legendShown" }] : /* istanbul ignore next */ []);
473
+ legendFirst = computed(() => {
474
+ const position = this.legendPosition();
475
+ return position === "top" || position === "start";
476
+ }, ...ngDevMode ? [{ debugName: "legendFirst" }] : /* istanbul ignore next */ []);
477
+ legendSide = computed(() => {
478
+ const position = this.legendPosition();
479
+ return position === "start" || position === "end";
480
+ }, ...ngDevMode ? [{ debugName: "legendSide" }] : /* istanbul ignore next */ []);
481
+ empty = computed(() => this.categoryTotal() === 0, ...ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []);
482
+ state = useChartState({
483
+ loading: this.loading,
484
+ error: this.error,
485
+ empty: this.empty,
486
+ emptyLabel: this.emptyLabel,
487
+ loadingLabel: this.loadingLabel,
488
+ errorLabel: this.errorLabel
489
+ });
386
490
  legendHidden = computed(() => {
387
491
  const hiddenSeries = this.hiddenSeries();
388
492
  if (!this.hasLines()) return hiddenSeries;
@@ -424,25 +528,26 @@ var WrBarChart = class WrBarChart {
424
528
  tip = useChartTooltip(this.tooltip, (index) => this.seriesMode() ? this.categoryTip(index) : this.barTip(index));
425
529
  barTip(index) {
426
530
  const bar = this.bars()[index];
427
- const anchor = this.barEls()[index]?.nativeElement;
428
- if (!bar || !anchor) return null;
531
+ if (!bar || this.state()) return null;
429
532
  const rows = this.lineRows(index);
430
- if (rows.length === 0) return bar.missing ? null : {
533
+ if (rows.length === 0 && bar.missing) return null;
534
+ const anchor = this.sectionBox(index, bar.start, bar.start + bar.share);
535
+ if (!anchor) return null;
536
+ return rows.length === 0 ? {
431
537
  datum: {
432
538
  label: bar.label,
433
539
  value: bar.text,
434
540
  color: bar.color
435
541
  },
436
542
  anchor
437
- };
438
- return {
543
+ } : {
439
544
  datum: {
440
545
  label: bar.label,
441
546
  value: bar.text,
442
547
  color: bar.color,
443
548
  rows
444
549
  },
445
- anchor: WrBarChart.around([anchor.getBoundingClientRect(), ...this.pointBoxes(index)])
550
+ anchor
446
551
  };
447
552
  }
448
553
  lineRows(index) {
@@ -455,29 +560,44 @@ var WrBarChart = class WrBarChart {
455
560
  }];
456
561
  });
457
562
  }
458
- pointBoxes(index) {
459
- const categories = this.lineLayers().flatMap((line) => line.points.map((point) => point.category));
460
- return this.pointEls().flatMap((el, i) => {
461
- const marker = el.nativeElement.firstElementChild;
462
- return categories[i] === index && marker ? [marker.getBoundingClientRect()] : [];
463
- });
464
- }
465
- static around(boxes) {
466
- const left = Math.min(...boxes.map((box) => box.left));
467
- const top = Math.min(...boxes.map((box) => box.top));
468
- const right = Math.max(...boxes.map((box) => box.right));
469
- const bottom = Math.max(...boxes.map((box) => box.bottom));
563
+ sectionBox(index, from, to) {
564
+ const track = this.trackEl()?.nativeElement;
565
+ const section = this.host.querySelector(`[data-wr-index="${index}"]`);
566
+ if (!track || !section) return null;
567
+ let reach = 0;
568
+ for (const line of this.visibleLines()) {
569
+ const value = line.data[index];
570
+ if (value === null || value === void 0) continue;
571
+ const at = this.at(value);
572
+ from = Math.min(from, at);
573
+ to = Math.max(to, at);
574
+ reach = this.lineReach() + 1;
575
+ }
576
+ const axis = track.getBoundingClientRect();
577
+ const across = section.getBoundingClientRect();
578
+ if (!this.horizontal()) {
579
+ const top = axis.bottom - to * axis.height - reach;
580
+ const bottom = axis.bottom - from * axis.height + reach;
581
+ return {
582
+ x: across.left,
583
+ y: top,
584
+ width: across.width,
585
+ height: bottom - top
586
+ };
587
+ }
588
+ const rtl = getComputedStyle(track).direction === "rtl";
589
+ const left = rtl ? axis.right - to * axis.width - reach : axis.left + from * axis.width - reach;
590
+ const right = rtl ? axis.right - from * axis.width + reach : axis.left + to * axis.width + reach;
470
591
  return {
471
592
  x: left,
472
- y: top,
593
+ y: across.top,
473
594
  width: right - left,
474
- height: bottom - top
595
+ height: across.height
475
596
  };
476
597
  }
477
598
  categoryTip(index) {
478
599
  const category = this.seriesCategories()[index];
479
- const element = this.categoryEls()[index]?.nativeElement;
480
- if (!category || !element) return null;
600
+ if (!category || this.state()) return null;
481
601
  const rows = [...this.visibleSeries().flatMap((s) => {
482
602
  const value = s.data[index];
483
603
  return value === null || value === void 0 ? [] : [{
@@ -487,15 +607,15 @@ var WrBarChart = class WrBarChart {
487
607
  }];
488
608
  }), ...this.lineRows(index)];
489
609
  if (rows.length === 0) return null;
490
- const boxes = [...[...element.querySelectorAll(".wr-bar-chart__series-bar")].map((bar) => bar.getBoundingClientRect()), ...this.pointBoxes(index)];
491
- if (boxes.length === 0) return null;
610
+ const anchor = this.sectionBox(index, category.from, category.to);
611
+ if (!anchor) return null;
492
612
  return {
493
613
  datum: {
494
614
  label: category.label,
495
615
  value: "",
496
616
  rows
497
617
  },
498
- anchor: WrBarChart.around(boxes)
618
+ anchor
499
619
  };
500
620
  }
501
621
  static ɵfac = i0.ɵɵngDeclareFactory({
@@ -569,6 +689,20 @@ var WrBarChart = class WrBarChart {
569
689
  isRequired: false,
570
690
  transformFunction: null
571
691
  },
692
+ showGrid: {
693
+ classPropertyName: "showGrid",
694
+ publicName: "showGrid",
695
+ isSignal: true,
696
+ isRequired: false,
697
+ transformFunction: null
698
+ },
699
+ showAxis: {
700
+ classPropertyName: "showAxis",
701
+ publicName: "showAxis",
702
+ isSignal: true,
703
+ isRequired: false,
704
+ transformFunction: null
705
+ },
572
706
  showValues: {
573
707
  classPropertyName: "showValues",
574
708
  publicName: "showValues",
@@ -604,6 +738,48 @@ var WrBarChart = class WrBarChart {
604
738
  isRequired: false,
605
739
  transformFunction: null
606
740
  },
741
+ legendPosition: {
742
+ classPropertyName: "legendPosition",
743
+ publicName: "legendPosition",
744
+ isSignal: true,
745
+ isRequired: false,
746
+ transformFunction: null
747
+ },
748
+ loading: {
749
+ classPropertyName: "loading",
750
+ publicName: "loading",
751
+ isSignal: true,
752
+ isRequired: false,
753
+ transformFunction: null
754
+ },
755
+ error: {
756
+ classPropertyName: "error",
757
+ publicName: "error",
758
+ isSignal: true,
759
+ isRequired: false,
760
+ transformFunction: null
761
+ },
762
+ emptyLabel: {
763
+ classPropertyName: "emptyLabel",
764
+ publicName: "emptyLabel",
765
+ isSignal: true,
766
+ isRequired: false,
767
+ transformFunction: null
768
+ },
769
+ loadingLabel: {
770
+ classPropertyName: "loadingLabel",
771
+ publicName: "loadingLabel",
772
+ isSignal: true,
773
+ isRequired: false,
774
+ transformFunction: null
775
+ },
776
+ errorLabel: {
777
+ classPropertyName: "errorLabel",
778
+ publicName: "errorLabel",
779
+ isSignal: true,
780
+ isRequired: false,
781
+ transformFunction: null
782
+ },
607
783
  toggleableLegend: {
608
784
  classPropertyName: "toggleableLegend",
609
785
  publicName: "toggleableLegend",
@@ -646,6 +822,8 @@ var WrBarChart = class WrBarChart {
646
822
  },
647
823
  host: {
648
824
  properties: {
825
+ "class.wr-chart--legend-side": "legendShown() && legendSide()",
826
+ "class.wr-bar-chart--axis": "showAxis()",
649
827
  "class.wr-bar-chart--horizontal": "horizontal()",
650
828
  "class.wr-bar-chart--series": "seriesMode()",
651
829
  "class.wr-bar-chart--stacked": "seriesMode() && stacked()",
@@ -653,48 +831,61 @@ var WrBarChart = class WrBarChart {
653
831
  "style.--wr-bar-chart-reach": "hasLines() ? lineReach() : null",
654
832
  "style.--wr-bar-chart-categories": "categoryTotal() || null"
655
833
  },
656
- classAttribute: "wr-bar-chart"
834
+ classAttribute: "wr-bar-chart wr-chart--legend"
657
835
  },
658
- viewQueries: [
836
+ viewQueries: [{
837
+ propertyName: "trackEl",
838
+ first: true,
839
+ predicate: ["trackEl"],
840
+ descendants: true,
841
+ isSignal: true
842
+ }, {
843
+ propertyName: "labelsEl",
844
+ first: true,
845
+ predicate: ["labelsEl"],
846
+ descendants: true,
847
+ isSignal: true
848
+ }],
849
+ ngImport: i0,
850
+ template: "@let isSeries = seriesMode();\n@let isHorizontal = horizontal();\n@let shown = state();\n@let scale = ticks();\n\n<!-- The legend, drawn before the body or after it so it is in the DOM where it is on\n screen: a toggleable legend's rows are tab stops, and their order follows it. Every\n series is keyed by a dot in its colour and each line by its dash and its marker. Rows\n are tracked by position, so two series that share a label are two rows. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-bar-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [hiddenSeries]=\"legendHidden()\"\n (hiddenSeriesChange)=\"onLegendHidden($event)\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<div class=\"wr-bar-chart__body\">\n <!-- One layout for `data` and `series`, standing up and lying down: the plot is a grid of\n the value axis' scale, the track the bars run along, and a room past each end of it\n for the values printed there. A named `group`, not an `img`: `img` is a\n children-presentational role, so the bars' own `img` names inside it are dropped by a\n user agent that follows the spec - WebKit drops exactly such a subtree. Sideways,\n `height` is a floor rather than a height: each row keeps room for a line of text, so\n many rows grow the plot. -->\n <div\n class=\"wr-bar-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"isHorizontal ? null : height()\"\n [style.min-height.px]=\"isHorizontal ? height() : null\"\n >\n @if (showAxis()) {\n <!-- The scale: decoration, since every bar's name carries its value. The hidden\n copies of the longest labels are what give the gutter its width. -->\n <div class=\"wr-bar-chart__axis\" aria-hidden=\"true\">\n @for (text of tickProbes(); track $index) {\n <span class=\"wr-bar-chart__tick wr-bar-chart__tick--probe\">{{ text }}</span>\n }\n @for (tick of scale; track $index) {\n <span class=\"wr-bar-chart__tick\" [style.--wr-bar-chart-at]=\"tick.at\">{{ tick.text }}</span>\n }\n </div>\n }\n @if (isHorizontal) {\n <!-- In the plot, so the rows share its gap with the track; decoration, as under the\n vertical bars: each row's group or image is named. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n @if (showValues()) {\n <!-- Hidden copies of the longest values printed past each end of the axis, stacked in\n one cell: each room is as large as the largest of them, in the value's own font,\n so a value past the longest bar has exactly the space it needs. Tracked by\n position: they are measuring copies, and live data changes every text at once. -->\n <div class=\"wr-bar-chart__room wr-bar-chart__room--max\" aria-hidden=\"true\">\n @for (text of rooms().max; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n <div class=\"wr-bar-chart__room wr-bar-chart__room--min\" aria-hidden=\"true\">\n @for (text of rooms().min; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n }\n <div #trackEl class=\"wr-bar-chart__track\" data-wr-hold [style.--wr-bar-chart-zero]=\"zero()\">\n @if (showGrid()) {\n <!-- Under the bars: a line at every tick of the value axis. -->\n <div class=\"wr-bar-chart__grid\" aria-hidden=\"true\">\n @for (tick of scale; track $index) {\n <span class=\"wr-bar-chart__grid-line\" [style.--wr-bar-chart-at]=\"tick.at\"></span>\n }\n </div>\n }\n <!-- Before the bars, so a bar standing on zero covers it and a 0 draws nothing. -->\n <div class=\"wr-bar-chart__baseline\"></div>\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the axis the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n } @else if (isSeries) {\n @for (category of seriesCategories(); track $index) {\n <!-- `data-wr-index` is what the chart's one hover listener reads. -->\n <div\n class=\"wr-bar-chart__category\"\n role=\"group\"\n [attr.aria-label]=\"category.label\"\n [attr.data-wr-index]=\"$index\"\n >\n @for (lane of category.lanes; track lane.key) {\n <div class=\"wr-bar-chart__lane\">\n <!-- A side per sign: the box from zero to that end of the axis, which clips\n the bars it holds. Each bar is as large as its side and moved along the\n value axis by a transform the stylesheet works out from the two shares\n written here, so a new value moves the bar without a layout pass. By\n position, not by label: two series may share one. -->\n @if (lane.up.length > 0) {\n <div class=\"wr-bar-chart__side\">\n @for (bar of lane.up; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-series]=\"bar.series\"\n [attr.data-dash]=\"bar.dash\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n [style.z-index]=\"bar.layer\"\n ></div>\n }\n </div>\n }\n @if (lane.down.length > 0) {\n <div class=\"wr-bar-chart__side wr-bar-chart__side--down\">\n @for (bar of lane.down; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-series]=\"bar.series\"\n [attr.data-dash]=\"bar.dash\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n [style.z-index]=\"bar.layer\"\n ></div>\n }\n </div>\n }\n @for (end of lane.ends; track $index) {\n <!-- Past one bar, hidden: the bar's own name carries its value. Past a pile,\n an image named \"Total: 20\": no bar's name carries the total, and a\n reader should not have to add the names up. -->\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"end.below\"\n [style.--wr-bar-chart-at]=\"end.at\"\n [attr.role]=\"end.name ? 'img' : null\"\n [attr.aria-label]=\"end.name\"\n [attr.aria-hidden]=\"end.name ? null : 'true'\"\n >{{ end.text }}</span\n >\n }\n </div>\n }\n </div>\n }\n } @else {\n @for (bar of bars(); track $index) {\n <!-- One datum: the column is its lane, and carries its name. Keyed `c<n>` for the\n hover, a key no legend row has, so a column dims the others and never a line. -->\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-wr-series]=\"`c${$index}`\"\n >\n <div class=\"wr-bar-chart__side\" [class.wr-bar-chart__side--down]=\"bar.below\">\n <div\n class=\"wr-bar-chart__bar\"\n [class.wr-bar-chart__bar--below]=\"bar.below\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.share\"\n [style.background]=\"bar.color\"\n ></div>\n </div>\n @if (showValues() && !bar.missing) {\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"bar.below\"\n [style.--wr-bar-chart-at]=\"bar.at\"\n >{{ bar.display }}</span\n >\n }\n </div>\n }\n }\n @if (!shown) {\n @for (line of lineLayers(); track line.index) {\n <!-- Over the bars and the baseline, and out of the pointer's way, so hovering a\n point still opens its category's tooltip. Each line is a group named by the\n line, holding a named image per point; its path is decoration. The box runs\n from the middle of the first category to the middle of the last, which the\n stylesheet works out from `count`. -->\n <svg\n class=\"wr-bar-chart__line\"\n role=\"group\"\n focusable=\"false\"\n [attr.aria-label]=\"line.label\"\n [attr.data-wr-series]=\"line.key\"\n [style.--wr-bar-chart-count]=\"line.count\"\n >\n @if (line.path) {\n <!-- The whole line as ONE path, in a box stretched over the line's own. The\n stroke does not scale with it, so the width and the dash stay in pixels. -->\n <svg\n class=\"wr-bar-chart__line-run\"\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\"\n aria-hidden=\"true\"\n >\n <path\n class=\"wr-bar-chart__line-segment\"\n fill=\"none\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"line.path\"\n [attr.data-segments]=\"line.segments\"\n [attr.stroke]=\"line.color\"\n [attr.stroke-dasharray]=\"line.dash || null\"\n />\n </svg>\n }\n @for (point of line.points; track point.category) {\n <!-- A nested `<svg>` placed by percentage with its marker drawn about its origin\n in px, as the scatter chart places its points: one pixel of viewport, and\n `overflow` lets the marker reach outside it, so a marker keeps its shape\n and its size at any width. -->\n <svg\n class=\"wr-bar-chart__point\"\n role=\"img\"\n width=\"1\"\n height=\"1\"\n overflow=\"visible\"\n [attr.aria-label]=\"point.name\"\n [attr.x]=\"`${point.x}%`\"\n [attr.y]=\"`${point.y}%`\"\n [attr.data-marker]=\"line.marker\"\n >\n <path [attr.d]=\"line.d\" [attr.fill]=\"line.color\" />\n </svg>\n }\n </svg>\n }\n }\n </div>\n </div>\n @if (!isHorizontal) {\n <!-- Named on each bar or category above, so the visible label row is decoration. A\n name left out by the thinning keeps its slot, so the ones printed stay under their\n bars; the hidden copies of the longest names are what the thinning measures. -->\n <div #labelsEl class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @let step = labelStep();\n @for (label of categoryLabels(); track $index) {\n <span\n class=\"wr-bar-chart__label\"\n [class.wr-bar-chart__label--wide]=\"step > 1\"\n [class.wr-bar-chart__label--skipped]=\"step > 1 && $index % step !== 0\"\n >{{ label }}</span\n >\n }\n @for (text of labelProbes(); track $index) {\n <span class=\"wr-bar-chart__label-probe\">{{ text }}</span>\n }\n </div>\n }\n</div>\n\n@if (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n@if (dataTable() && !shown) {\n <!-- The figures for a screen reader who wants to move cell by cell. Clipped to nothing\n by its own stylesheet, so it takes no room and draws nothing. With `data`, one\n column for the bars, then one per line. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n",
851
+ dependencies: [
852
+ {
853
+ kind: "directive",
854
+ type: NgTemplateOutlet,
855
+ selector: "[ngTemplateOutlet]",
856
+ inputs: [
857
+ "ngTemplateOutletContext",
858
+ "ngTemplateOutlet",
859
+ "ngTemplateOutletInjector"
860
+ ]
861
+ },
659
862
  {
660
- propertyName: "barEls",
661
- predicate: ["barEl"],
662
- descendants: true,
663
- isSignal: true
863
+ kind: "component",
864
+ type: WrChartLegend,
865
+ selector: "ul[wr-chart-legend]",
866
+ inputs: [
867
+ "items",
868
+ "position",
869
+ "toggleable",
870
+ "hiddenSeries",
871
+ "ariaLabel",
872
+ "hiddenLabel"
873
+ ],
874
+ outputs: ["hiddenSeriesChange", "toggled"]
664
875
  },
665
876
  {
666
- propertyName: "categoryEls",
667
- predicate: ["categoryEl"],
668
- descendants: true,
669
- isSignal: true
877
+ kind: "component",
878
+ type: WrChartState,
879
+ selector: "wr-chart-state",
880
+ inputs: ["kind", "label"]
670
881
  },
671
882
  {
672
- propertyName: "pointEls",
673
- predicate: ["pointEl"],
674
- descendants: true,
675
- isSignal: true
883
+ kind: "component",
884
+ type: WrChartTable,
885
+ selector: "wr-chart-table",
886
+ inputs: ["data"]
676
887
  }
677
888
  ],
678
- ngImport: i0,
679
- template: "@let isSeries = seriesMode();\n@let isHorizontal = horizontal();\n@let isCombo = hasLines();\n@if ((isSeries || isCombo) && showLegend() && legendItems().length > 0) {\n <!-- Every row keys its series by the series' own dash, the one its bars' outlines are\n drawn in, and each line by its dash and its marker. Rows are tracked by position, so\n two series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-bar-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [hiddenSeries]=\"legendHidden()\"\n (hiddenSeriesChange)=\"onLegendHidden($event)\"\n ></ul>\n}\n\n@if (!isSeries && !isHorizontal && !isCombo) {\n <!-- A named `group`, not an `img`: `img` is a children-presentational role, so the\n bars' own `img` names inside it are dropped by a user agent that follows the spec —\n WebKit drops exactly such a subtree, which is why the donut moved its `img` off the\n wrapper. -->\n <div class=\"wr-bar-chart__plot\" role=\"group\" [attr.aria-label]=\"resolvedAriaLabel()\" [style.height.px]=\"height()\">\n @for (bar of bars(); track $index) {\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showValues() && !bar.missing) {\n <span class=\"wr-bar-chart__value\">{{ bar.display }}</span>\n }\n <div #barEl class=\"wr-bar-chart__bar\" [style.flex-grow]=\"bar.share\" [style.background]=\"bar.color\"></div>\n </div>\n }\n </div>\n <!-- Named on the column above, so the visible label row is decoration here. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (bar of bars(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ bar.label }}</span>\n }\n </div>\n} @else {\n <!-- The layout `series`, `orientation=\"horizontal\"` and `lines` share: the plot is a grid\n of the track the bars run along, a room past each end of it for the values printed\n there, and — sideways — the gutter of category names. Still a named `group`, for the\n reason the vertical `data` plot gives. Sideways, `height` is a floor rather than a\n height: each row keeps room for a line of text, so many rows grow the plot. -->\n <div\n class=\"wr-bar-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"isHorizontal ? null : height()\"\n [style.min-height.px]=\"isHorizontal ? height() : null\"\n >\n @if (isHorizontal) {\n <!-- In the plot, so the rows share its gap with the track; decoration, as under the\n vertical bars: each row's group or image is named. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n @if (showValues()) {\n <!-- Hidden copies of the values printed past each end of the axis, stacked in one\n cell: each room is as large as the largest of them, in the value's own font, so\n a value past the longest bar has exactly the space it needs. Tracked by position:\n they are measuring copies, and live data changes every text at once. -->\n <div class=\"wr-bar-chart__room wr-bar-chart__room--max\" aria-hidden=\"true\">\n @for (text of rooms().max; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n <div class=\"wr-bar-chart__room wr-bar-chart__room--min\" aria-hidden=\"true\">\n @for (text of rooms().min; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n }\n <div class=\"wr-bar-chart__track\" [style.--wr-bar-chart-zero]=\"zero()\">\n @if (isSeries) {\n @for (category of seriesCategories(); track $index) {\n <div\n #categoryEl\n class=\"wr-bar-chart__category\"\n role=\"group\"\n [attr.aria-label]=\"category.label\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @for (lane of category.lanes; track lane.key) {\n <div class=\"wr-bar-chart__lane\">\n <!-- By position, not by label: two series may share one. Each bar hands the\n stylesheet where it starts and how much of the axis it covers. -->\n @for (bar of lane.bars; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n >\n <!-- The outline, in the series' colour and its own dash: what tells two\n series apart without hue, and what the legend's key draws. Sized in\n pixels, so a dash is the same length on every bar. -->\n <svg class=\"wr-bar-chart__edge\" aria-hidden=\"true\" focusable=\"false\">\n <rect\n width=\"100%\"\n height=\"100%\"\n fill=\"none\"\n [attr.stroke]=\"bar.color\"\n [attr.stroke-dasharray]=\"bar.dash || null\"\n />\n </svg>\n </div>\n }\n @for (end of lane.ends; track $index) {\n <!-- Past one bar, hidden: the bar's own name carries its value. Past a pile,\n an image named \"Total: 20\": no bar's name carries the total, and a\n reader should not have to add the names up. -->\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"end.below\"\n [style.--wr-bar-chart-at]=\"end.at\"\n [attr.role]=\"end.name ? 'img' : null\"\n [attr.aria-label]=\"end.name\"\n [attr.aria-hidden]=\"end.name ? null : 'true'\"\n >{{ end.text }}</span\n >\n }\n </div>\n }\n </div>\n }\n } @else {\n @for (bar of bars(); track $index) {\n <!-- Beside `lines`, the column also hands the stylesheet where its bar starts: on\n zero, or at its own end for a bar hanging below it. -->\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [style.--wr-bar-chart-start]=\"isCombo ? bar.start : null\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showValues() && !bar.missing) {\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"bar.below\"\n [style.--wr-bar-chart-at]=\"bar.at\"\n >{{ bar.display }}</span\n >\n }\n <div\n #barEl\n class=\"wr-bar-chart__bar\"\n [class.wr-bar-chart__bar--below]=\"bar.below\"\n [style.flex-grow]=\"bar.share\"\n [style.background]=\"bar.color\"\n ></div>\n </div>\n }\n }\n <!-- After the bars, so it is drawn over them where zero runs through the plot. -->\n <div class=\"wr-bar-chart__baseline\"></div>\n @for (line of lineLayers(); track line.index) {\n <!-- Over the bars and the baseline, and out of the pointer's way, so hovering a\n point still opens its category's tooltip. Each line is a group named by the\n line, holding a named image per point; its runs are decoration. The box runs\n from the middle of the first category to the middle of the last, which the\n stylesheet works out from `count`, and every position in it is a percentage,\n so nothing stretches: a dash and a marker keep their size at any width. -->\n <svg\n class=\"wr-bar-chart__line\"\n role=\"group\"\n focusable=\"false\"\n [attr.aria-label]=\"line.label\"\n [style.--wr-bar-chart-count]=\"line.count\"\n >\n @for (segment of line.segments; track $index) {\n <line\n class=\"wr-bar-chart__line-segment\"\n [attr.x1]=\"`${segment.from.x}%`\"\n [attr.y1]=\"`${segment.from.y}%`\"\n [attr.x2]=\"`${segment.to.x}%`\"\n [attr.y2]=\"`${segment.to.y}%`\"\n [attr.stroke]=\"line.color\"\n [attr.stroke-dasharray]=\"line.dash || null\"\n />\n }\n @for (point of line.points; track point.category) {\n <!-- A nested `<svg>` placed by percentage with its marker drawn about its origin\n in px, as the scatter chart places its points: one pixel of viewport, and\n `overflow` lets the marker reach outside it. -->\n <svg\n #pointEl\n class=\"wr-bar-chart__point\"\n role=\"img\"\n width=\"1\"\n height=\"1\"\n overflow=\"visible\"\n [attr.aria-label]=\"point.name\"\n [attr.x]=\"`${point.x}%`\"\n [attr.y]=\"`${point.y}%`\"\n [attr.data-marker]=\"line.marker\"\n >\n <path [attr.d]=\"line.d\" [attr.fill]=\"line.color\" />\n </svg>\n }\n </svg>\n }\n </div>\n </div>\n @if (!isHorizontal) {\n <!-- Named on each category's group above, so the visible label row is decoration. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n}\n\n@if (dataTable() && (isSeries || bars().length > 0)) {\n <!-- The figures for a screen reader who wants to move cell by cell. Clipped to nothing\n by its own stylesheet, so it takes no room and draws nothing. With `data`, one\n column for the bars, then one per line. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n",
680
- dependencies: [{
681
- kind: "component",
682
- type: WrChartLegend,
683
- selector: "ul[wr-chart-legend]",
684
- inputs: [
685
- "items",
686
- "toggleable",
687
- "hiddenSeries",
688
- "ariaLabel",
689
- "hiddenLabel"
690
- ],
691
- outputs: ["hiddenSeriesChange", "toggled"]
692
- }, {
693
- kind: "component",
694
- type: WrChartTable,
695
- selector: "wr-chart-table",
696
- inputs: ["data"]
697
- }],
698
889
  encapsulation: i0.ViewEncapsulation.None
699
890
  });
700
891
  };
@@ -709,7 +900,9 @@ i0.ɵɵngDeclareClassMetadata({
709
900
  selector: "wr-bar-chart",
710
901
  encapsulation: ViewEncapsulation.None,
711
902
  host: {
712
- class: "wr-bar-chart",
903
+ class: "wr-bar-chart wr-chart--legend",
904
+ "[class.wr-chart--legend-side]": "legendShown() && legendSide()",
905
+ "[class.wr-bar-chart--axis]": "showAxis()",
713
906
  "[class.wr-bar-chart--horizontal]": "horizontal()",
714
907
  "[class.wr-bar-chart--series]": "seriesMode()",
715
908
  "[class.wr-bar-chart--stacked]": "seriesMode() && stacked()",
@@ -717,8 +910,13 @@ i0.ɵɵngDeclareClassMetadata({
717
910
  "[style.--wr-bar-chart-reach]": "hasLines() ? lineReach() : null",
718
911
  "[style.--wr-bar-chart-categories]": "categoryTotal() || null"
719
912
  },
720
- imports: [WrChartLegend, WrChartTable],
721
- template: "@let isSeries = seriesMode();\n@let isHorizontal = horizontal();\n@let isCombo = hasLines();\n@if ((isSeries || isCombo) && showLegend() && legendItems().length > 0) {\n <!-- Every row keys its series by the series' own dash, the one its bars' outlines are\n drawn in, and each line by its dash and its marker. Rows are tracked by position, so\n two series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-bar-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [hiddenSeries]=\"legendHidden()\"\n (hiddenSeriesChange)=\"onLegendHidden($event)\"\n ></ul>\n}\n\n@if (!isSeries && !isHorizontal && !isCombo) {\n <!-- A named `group`, not an `img`: `img` is a children-presentational role, so the\n bars' own `img` names inside it are dropped by a user agent that follows the spec —\n WebKit drops exactly such a subtree, which is why the donut moved its `img` off the\n wrapper. -->\n <div class=\"wr-bar-chart__plot\" role=\"group\" [attr.aria-label]=\"resolvedAriaLabel()\" [style.height.px]=\"height()\">\n @for (bar of bars(); track $index) {\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showValues() && !bar.missing) {\n <span class=\"wr-bar-chart__value\">{{ bar.display }}</span>\n }\n <div #barEl class=\"wr-bar-chart__bar\" [style.flex-grow]=\"bar.share\" [style.background]=\"bar.color\"></div>\n </div>\n }\n </div>\n <!-- Named on the column above, so the visible label row is decoration here. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (bar of bars(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ bar.label }}</span>\n }\n </div>\n} @else {\n <!-- The layout `series`, `orientation=\"horizontal\"` and `lines` share: the plot is a grid\n of the track the bars run along, a room past each end of it for the values printed\n there, and — sideways — the gutter of category names. Still a named `group`, for the\n reason the vertical `data` plot gives. Sideways, `height` is a floor rather than a\n height: each row keeps room for a line of text, so many rows grow the plot. -->\n <div\n class=\"wr-bar-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"isHorizontal ? null : height()\"\n [style.min-height.px]=\"isHorizontal ? height() : null\"\n >\n @if (isHorizontal) {\n <!-- In the plot, so the rows share its gap with the track; decoration, as under the\n vertical bars: each row's group or image is named. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n @if (showValues()) {\n <!-- Hidden copies of the values printed past each end of the axis, stacked in one\n cell: each room is as large as the largest of them, in the value's own font, so\n a value past the longest bar has exactly the space it needs. Tracked by position:\n they are measuring copies, and live data changes every text at once. -->\n <div class=\"wr-bar-chart__room wr-bar-chart__room--max\" aria-hidden=\"true\">\n @for (text of rooms().max; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n <div class=\"wr-bar-chart__room wr-bar-chart__room--min\" aria-hidden=\"true\">\n @for (text of rooms().min; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n }\n <div class=\"wr-bar-chart__track\" [style.--wr-bar-chart-zero]=\"zero()\">\n @if (isSeries) {\n @for (category of seriesCategories(); track $index) {\n <div\n #categoryEl\n class=\"wr-bar-chart__category\"\n role=\"group\"\n [attr.aria-label]=\"category.label\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @for (lane of category.lanes; track lane.key) {\n <div class=\"wr-bar-chart__lane\">\n <!-- By position, not by label: two series may share one. Each bar hands the\n stylesheet where it starts and how much of the axis it covers. -->\n @for (bar of lane.bars; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n >\n <!-- The outline, in the series' colour and its own dash: what tells two\n series apart without hue, and what the legend's key draws. Sized in\n pixels, so a dash is the same length on every bar. -->\n <svg class=\"wr-bar-chart__edge\" aria-hidden=\"true\" focusable=\"false\">\n <rect\n width=\"100%\"\n height=\"100%\"\n fill=\"none\"\n [attr.stroke]=\"bar.color\"\n [attr.stroke-dasharray]=\"bar.dash || null\"\n />\n </svg>\n </div>\n }\n @for (end of lane.ends; track $index) {\n <!-- Past one bar, hidden: the bar's own name carries its value. Past a pile,\n an image named \"Total: 20\": no bar's name carries the total, and a\n reader should not have to add the names up. -->\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"end.below\"\n [style.--wr-bar-chart-at]=\"end.at\"\n [attr.role]=\"end.name ? 'img' : null\"\n [attr.aria-label]=\"end.name\"\n [attr.aria-hidden]=\"end.name ? null : 'true'\"\n >{{ end.text }}</span\n >\n }\n </div>\n }\n </div>\n }\n } @else {\n @for (bar of bars(); track $index) {\n <!-- Beside `lines`, the column also hands the stylesheet where its bar starts: on\n zero, or at its own end for a bar hanging below it. -->\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [style.--wr-bar-chart-start]=\"isCombo ? bar.start : null\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showValues() && !bar.missing) {\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"bar.below\"\n [style.--wr-bar-chart-at]=\"bar.at\"\n >{{ bar.display }}</span\n >\n }\n <div\n #barEl\n class=\"wr-bar-chart__bar\"\n [class.wr-bar-chart__bar--below]=\"bar.below\"\n [style.flex-grow]=\"bar.share\"\n [style.background]=\"bar.color\"\n ></div>\n </div>\n }\n }\n <!-- After the bars, so it is drawn over them where zero runs through the plot. -->\n <div class=\"wr-bar-chart__baseline\"></div>\n @for (line of lineLayers(); track line.index) {\n <!-- Over the bars and the baseline, and out of the pointer's way, so hovering a\n point still opens its category's tooltip. Each line is a group named by the\n line, holding a named image per point; its runs are decoration. The box runs\n from the middle of the first category to the middle of the last, which the\n stylesheet works out from `count`, and every position in it is a percentage,\n so nothing stretches: a dash and a marker keep their size at any width. -->\n <svg\n class=\"wr-bar-chart__line\"\n role=\"group\"\n focusable=\"false\"\n [attr.aria-label]=\"line.label\"\n [style.--wr-bar-chart-count]=\"line.count\"\n >\n @for (segment of line.segments; track $index) {\n <line\n class=\"wr-bar-chart__line-segment\"\n [attr.x1]=\"`${segment.from.x}%`\"\n [attr.y1]=\"`${segment.from.y}%`\"\n [attr.x2]=\"`${segment.to.x}%`\"\n [attr.y2]=\"`${segment.to.y}%`\"\n [attr.stroke]=\"line.color\"\n [attr.stroke-dasharray]=\"line.dash || null\"\n />\n }\n @for (point of line.points; track point.category) {\n <!-- A nested `<svg>` placed by percentage with its marker drawn about its origin\n in px, as the scatter chart places its points: one pixel of viewport, and\n `overflow` lets the marker reach outside it. -->\n <svg\n #pointEl\n class=\"wr-bar-chart__point\"\n role=\"img\"\n width=\"1\"\n height=\"1\"\n overflow=\"visible\"\n [attr.aria-label]=\"point.name\"\n [attr.x]=\"`${point.x}%`\"\n [attr.y]=\"`${point.y}%`\"\n [attr.data-marker]=\"line.marker\"\n >\n <path [attr.d]=\"line.d\" [attr.fill]=\"line.color\" />\n </svg>\n }\n </svg>\n }\n </div>\n </div>\n @if (!isHorizontal) {\n <!-- Named on each category's group above, so the visible label row is decoration. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n}\n\n@if (dataTable() && (isSeries || bars().length > 0)) {\n <!-- The figures for a screen reader who wants to move cell by cell. Clipped to nothing\n by its own stylesheet, so it takes no room and draws nothing. With `data`, one\n column for the bars, then one per line. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"
913
+ imports: [
914
+ NgTemplateOutlet,
915
+ WrChartLegend,
916
+ WrChartState,
917
+ WrChartTable
918
+ ],
919
+ template: "@let isSeries = seriesMode();\n@let isHorizontal = horizontal();\n@let shown = state();\n@let scale = ticks();\n\n<!-- The legend, drawn before the body or after it so it is in the DOM where it is on\n screen: a toggleable legend's rows are tab stops, and their order follows it. Every\n series is keyed by a dot in its colour and each line by its dash and its marker. Rows\n are tracked by position, so two series that share a label are two rows. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-bar-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [hiddenSeries]=\"legendHidden()\"\n (hiddenSeriesChange)=\"onLegendHidden($event)\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<div class=\"wr-bar-chart__body\">\n <!-- One layout for `data` and `series`, standing up and lying down: the plot is a grid of\n the value axis' scale, the track the bars run along, and a room past each end of it\n for the values printed there. A named `group`, not an `img`: `img` is a\n children-presentational role, so the bars' own `img` names inside it are dropped by a\n user agent that follows the spec - WebKit drops exactly such a subtree. Sideways,\n `height` is a floor rather than a height: each row keeps room for a line of text, so\n many rows grow the plot. -->\n <div\n class=\"wr-bar-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"isHorizontal ? null : height()\"\n [style.min-height.px]=\"isHorizontal ? height() : null\"\n >\n @if (showAxis()) {\n <!-- The scale: decoration, since every bar's name carries its value. The hidden\n copies of the longest labels are what give the gutter its width. -->\n <div class=\"wr-bar-chart__axis\" aria-hidden=\"true\">\n @for (text of tickProbes(); track $index) {\n <span class=\"wr-bar-chart__tick wr-bar-chart__tick--probe\">{{ text }}</span>\n }\n @for (tick of scale; track $index) {\n <span class=\"wr-bar-chart__tick\" [style.--wr-bar-chart-at]=\"tick.at\">{{ tick.text }}</span>\n }\n </div>\n }\n @if (isHorizontal) {\n <!-- In the plot, so the rows share its gap with the track; decoration, as under the\n vertical bars: each row's group or image is named. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n @if (showValues()) {\n <!-- Hidden copies of the longest values printed past each end of the axis, stacked in\n one cell: each room is as large as the largest of them, in the value's own font,\n so a value past the longest bar has exactly the space it needs. Tracked by\n position: they are measuring copies, and live data changes every text at once. -->\n <div class=\"wr-bar-chart__room wr-bar-chart__room--max\" aria-hidden=\"true\">\n @for (text of rooms().max; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n <div class=\"wr-bar-chart__room wr-bar-chart__room--min\" aria-hidden=\"true\">\n @for (text of rooms().min; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n }\n <div #trackEl class=\"wr-bar-chart__track\" data-wr-hold [style.--wr-bar-chart-zero]=\"zero()\">\n @if (showGrid()) {\n <!-- Under the bars: a line at every tick of the value axis. -->\n <div class=\"wr-bar-chart__grid\" aria-hidden=\"true\">\n @for (tick of scale; track $index) {\n <span class=\"wr-bar-chart__grid-line\" [style.--wr-bar-chart-at]=\"tick.at\"></span>\n }\n </div>\n }\n <!-- Before the bars, so a bar standing on zero covers it and a 0 draws nothing. -->\n <div class=\"wr-bar-chart__baseline\"></div>\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the axis the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n } @else if (isSeries) {\n @for (category of seriesCategories(); track $index) {\n <!-- `data-wr-index` is what the chart's one hover listener reads. -->\n <div\n class=\"wr-bar-chart__category\"\n role=\"group\"\n [attr.aria-label]=\"category.label\"\n [attr.data-wr-index]=\"$index\"\n >\n @for (lane of category.lanes; track lane.key) {\n <div class=\"wr-bar-chart__lane\">\n <!-- A side per sign: the box from zero to that end of the axis, which clips\n the bars it holds. Each bar is as large as its side and moved along the\n value axis by a transform the stylesheet works out from the two shares\n written here, so a new value moves the bar without a layout pass. By\n position, not by label: two series may share one. -->\n @if (lane.up.length > 0) {\n <div class=\"wr-bar-chart__side\">\n @for (bar of lane.up; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-series]=\"bar.series\"\n [attr.data-dash]=\"bar.dash\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n [style.z-index]=\"bar.layer\"\n ></div>\n }\n </div>\n }\n @if (lane.down.length > 0) {\n <div class=\"wr-bar-chart__side wr-bar-chart__side--down\">\n @for (bar of lane.down; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-series]=\"bar.series\"\n [attr.data-dash]=\"bar.dash\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n [style.z-index]=\"bar.layer\"\n ></div>\n }\n </div>\n }\n @for (end of lane.ends; track $index) {\n <!-- Past one bar, hidden: the bar's own name carries its value. Past a pile,\n an image named \"Total: 20\": no bar's name carries the total, and a\n reader should not have to add the names up. -->\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"end.below\"\n [style.--wr-bar-chart-at]=\"end.at\"\n [attr.role]=\"end.name ? 'img' : null\"\n [attr.aria-label]=\"end.name\"\n [attr.aria-hidden]=\"end.name ? null : 'true'\"\n >{{ end.text }}</span\n >\n }\n </div>\n }\n </div>\n }\n } @else {\n @for (bar of bars(); track $index) {\n <!-- One datum: the column is its lane, and carries its name. Keyed `c<n>` for the\n hover, a key no legend row has, so a column dims the others and never a line. -->\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-wr-series]=\"`c${$index}`\"\n >\n <div class=\"wr-bar-chart__side\" [class.wr-bar-chart__side--down]=\"bar.below\">\n <div\n class=\"wr-bar-chart__bar\"\n [class.wr-bar-chart__bar--below]=\"bar.below\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.share\"\n [style.background]=\"bar.color\"\n ></div>\n </div>\n @if (showValues() && !bar.missing) {\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"bar.below\"\n [style.--wr-bar-chart-at]=\"bar.at\"\n >{{ bar.display }}</span\n >\n }\n </div>\n }\n }\n @if (!shown) {\n @for (line of lineLayers(); track line.index) {\n <!-- Over the bars and the baseline, and out of the pointer's way, so hovering a\n point still opens its category's tooltip. Each line is a group named by the\n line, holding a named image per point; its path is decoration. The box runs\n from the middle of the first category to the middle of the last, which the\n stylesheet works out from `count`. -->\n <svg\n class=\"wr-bar-chart__line\"\n role=\"group\"\n focusable=\"false\"\n [attr.aria-label]=\"line.label\"\n [attr.data-wr-series]=\"line.key\"\n [style.--wr-bar-chart-count]=\"line.count\"\n >\n @if (line.path) {\n <!-- The whole line as ONE path, in a box stretched over the line's own. The\n stroke does not scale with it, so the width and the dash stay in pixels. -->\n <svg\n class=\"wr-bar-chart__line-run\"\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\"\n aria-hidden=\"true\"\n >\n <path\n class=\"wr-bar-chart__line-segment\"\n fill=\"none\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"line.path\"\n [attr.data-segments]=\"line.segments\"\n [attr.stroke]=\"line.color\"\n [attr.stroke-dasharray]=\"line.dash || null\"\n />\n </svg>\n }\n @for (point of line.points; track point.category) {\n <!-- A nested `<svg>` placed by percentage with its marker drawn about its origin\n in px, as the scatter chart places its points: one pixel of viewport, and\n `overflow` lets the marker reach outside it, so a marker keeps its shape\n and its size at any width. -->\n <svg\n class=\"wr-bar-chart__point\"\n role=\"img\"\n width=\"1\"\n height=\"1\"\n overflow=\"visible\"\n [attr.aria-label]=\"point.name\"\n [attr.x]=\"`${point.x}%`\"\n [attr.y]=\"`${point.y}%`\"\n [attr.data-marker]=\"line.marker\"\n >\n <path [attr.d]=\"line.d\" [attr.fill]=\"line.color\" />\n </svg>\n }\n </svg>\n }\n }\n </div>\n </div>\n @if (!isHorizontal) {\n <!-- Named on each bar or category above, so the visible label row is decoration. A\n name left out by the thinning keeps its slot, so the ones printed stay under their\n bars; the hidden copies of the longest names are what the thinning measures. -->\n <div #labelsEl class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @let step = labelStep();\n @for (label of categoryLabels(); track $index) {\n <span\n class=\"wr-bar-chart__label\"\n [class.wr-bar-chart__label--wide]=\"step > 1\"\n [class.wr-bar-chart__label--skipped]=\"step > 1 && $index % step !== 0\"\n >{{ label }}</span\n >\n }\n @for (text of labelProbes(); track $index) {\n <span class=\"wr-bar-chart__label-probe\">{{ text }}</span>\n }\n </div>\n }\n</div>\n\n@if (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n@if (dataTable() && !shown) {\n <!-- The figures for a screen reader who wants to move cell by cell. Clipped to nothing\n by its own stylesheet, so it takes no room and draws nothing. With `data`, one\n column for the bars, then one per line. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"
722
920
  }]
723
921
  }],
724
922
  ctorParameters: () => [],
@@ -787,6 +985,22 @@ i0.ɵɵngDeclareClassMetadata({
787
985
  required: false
788
986
  }]
789
987
  }],
988
+ showGrid: [{
989
+ type: i0.Input,
990
+ args: [{
991
+ isSignal: true,
992
+ alias: "showGrid",
993
+ required: false
994
+ }]
995
+ }],
996
+ showAxis: [{
997
+ type: i0.Input,
998
+ args: [{
999
+ isSignal: true,
1000
+ alias: "showAxis",
1001
+ required: false
1002
+ }]
1003
+ }],
790
1004
  showValues: [{
791
1005
  type: i0.Input,
792
1006
  args: [{
@@ -827,6 +1041,54 @@ i0.ɵɵngDeclareClassMetadata({
827
1041
  required: false
828
1042
  }]
829
1043
  }],
1044
+ legendPosition: [{
1045
+ type: i0.Input,
1046
+ args: [{
1047
+ isSignal: true,
1048
+ alias: "legendPosition",
1049
+ required: false
1050
+ }]
1051
+ }],
1052
+ loading: [{
1053
+ type: i0.Input,
1054
+ args: [{
1055
+ isSignal: true,
1056
+ alias: "loading",
1057
+ required: false
1058
+ }]
1059
+ }],
1060
+ error: [{
1061
+ type: i0.Input,
1062
+ args: [{
1063
+ isSignal: true,
1064
+ alias: "error",
1065
+ required: false
1066
+ }]
1067
+ }],
1068
+ emptyLabel: [{
1069
+ type: i0.Input,
1070
+ args: [{
1071
+ isSignal: true,
1072
+ alias: "emptyLabel",
1073
+ required: false
1074
+ }]
1075
+ }],
1076
+ loadingLabel: [{
1077
+ type: i0.Input,
1078
+ args: [{
1079
+ isSignal: true,
1080
+ alias: "loadingLabel",
1081
+ required: false
1082
+ }]
1083
+ }],
1084
+ errorLabel: [{
1085
+ type: i0.Input,
1086
+ args: [{
1087
+ isSignal: true,
1088
+ alias: "errorLabel",
1089
+ required: false
1090
+ }]
1091
+ }],
830
1092
  toggleableLegend: [{
831
1093
  type: i0.Input,
832
1094
  args: [{
@@ -873,17 +1135,13 @@ i0.ɵɵngDeclareClassMetadata({
873
1135
  required: false
874
1136
  }]
875
1137
  }],
876
- barEls: [{
877
- type: i0.ViewChildren,
878
- args: ["barEl", { isSignal: true }]
879
- }],
880
- categoryEls: [{
881
- type: i0.ViewChildren,
882
- args: ["categoryEl", { isSignal: true }]
1138
+ trackEl: [{
1139
+ type: i0.ViewChild,
1140
+ args: ["trackEl", { isSignal: true }]
883
1141
  }],
884
- pointEls: [{
885
- type: i0.ViewChildren,
886
- args: ["pointEl", { isSignal: true }]
1142
+ labelsEl: [{
1143
+ type: i0.ViewChild,
1144
+ args: ["labelsEl", { isSignal: true }]
887
1145
  }]
888
1146
  }
889
1147
  });