ngwr 16.3.0 → 16.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/carousel/styles/_index.scss +53 -1
  2. package/charts/bar-chart/styles/_index.scss +494 -305
  3. package/charts/boxplot-chart/styles/_index.scss +114 -48
  4. package/charts/bullet-chart/styles/_index.scss +113 -42
  5. package/charts/calendar-heatmap/styles/_index.scss +111 -20
  6. package/charts/candlestick-chart/styles/_index.scss +61 -26
  7. package/charts/chart-legend/styles/_index.scss +119 -1
  8. package/charts/core/styles/_index.scss +201 -5
  9. package/charts/donut-chart/styles/_index.scss +76 -21
  10. package/charts/funnel-chart/styles/_index.scss +66 -38
  11. package/charts/gauge/styles/_index.scss +12 -1
  12. package/charts/heatmap-chart/styles/_index.scss +90 -53
  13. package/charts/line-chart/styles/_index.scss +143 -139
  14. package/charts/meter-group/styles/_index.scss +87 -25
  15. package/charts/radar-chart/styles/_index.scss +82 -40
  16. package/charts/scatter-chart/styles/_index.scss +117 -44
  17. package/charts/sparkline/styles/_index.scss +7 -1
  18. package/charts/treemap-chart/styles/_index.scss +94 -42
  19. package/charts/waterfall-chart/styles/_index.scss +150 -87
  20. package/color-picker/styles/_index.scss +7 -3
  21. package/copy-value/styles/_index.scss +21 -2
  22. package/date-stamp/styles/_index.scss +2 -1
  23. package/dialog/styles/_index.scss +6 -0
  24. package/drawer/styles/_index.scss +5 -1
  25. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  26. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  27. package/fesm2022/ngwr-carousel-testing.mjs +27 -1
  28. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  29. package/fesm2022/ngwr-carousel.mjs +86 -4
  30. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  31. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  32. package/fesm2022/ngwr-cascader.mjs +56 -25
  33. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  34. package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
  35. package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
  36. package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
  37. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  38. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
  39. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
  40. package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
  41. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
  42. package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
  43. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
  44. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
  45. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  46. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
  47. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
  48. package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
  49. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
  50. package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
  51. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  52. package/fesm2022/ngwr-charts-core.mjs +299 -18
  53. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  54. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  55. package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
  56. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  57. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
  58. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
  59. package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
  60. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
  61. package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
  62. package/fesm2022/ngwr-charts-gauge.mjs +98 -12
  63. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  64. package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
  65. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
  66. package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
  67. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  68. package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
  69. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  70. package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
  71. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  72. package/fesm2022/ngwr-charts-meter-group.mjs +223 -31
  73. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  74. package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
  75. package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
  77. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
  79. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
  81. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  82. package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
  83. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  84. package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
  85. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
  86. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
  87. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
  88. package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
  89. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
  90. package/fesm2022/ngwr-color-picker.mjs +44 -4
  91. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  92. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  93. package/fesm2022/ngwr-context-menu.mjs +60 -17
  94. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  95. package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
  96. package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
  97. package/fesm2022/ngwr-copy-value.mjs +38 -2
  98. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  99. package/fesm2022/ngwr-date-picker.mjs +56 -8
  100. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  101. package/fesm2022/ngwr-dialog.mjs +13 -5
  102. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  103. package/fesm2022/ngwr-drawer.mjs +19 -3
  104. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  105. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  106. package/fesm2022/ngwr-dropdown.mjs +49 -6
  107. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  108. package/fesm2022/ngwr-editor.mjs +1 -0
  109. package/fesm2022/ngwr-editor.mjs.map +1 -1
  110. package/fesm2022/ngwr-file-upload.mjs +7 -3
  111. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  112. package/fesm2022/ngwr-graph-testing.mjs +27 -0
  113. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  114. package/fesm2022/ngwr-graph.mjs +643 -14
  115. package/fesm2022/ngwr-graph.mjs.map +1 -1
  116. package/fesm2022/ngwr-i18n-ar.mjs +13 -4
  117. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  118. package/fesm2022/ngwr-i18n-cs.mjs +13 -4
  119. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  120. package/fesm2022/ngwr-i18n-de.mjs +13 -4
  121. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  122. package/fesm2022/ngwr-i18n-en.mjs +13 -4
  123. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  124. package/fesm2022/ngwr-i18n-es.mjs +13 -4
  125. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  126. package/fesm2022/ngwr-i18n-fr.mjs +13 -4
  127. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  128. package/fesm2022/ngwr-i18n-he.mjs +13 -4
  129. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  130. package/fesm2022/ngwr-i18n-hi.mjs +13 -4
  131. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  132. package/fesm2022/ngwr-i18n-id.mjs +13 -4
  133. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  134. package/fesm2022/ngwr-i18n-it.mjs +13 -4
  135. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  136. package/fesm2022/ngwr-i18n-ja.mjs +13 -4
  137. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  138. package/fesm2022/ngwr-i18n-ko.mjs +13 -4
  139. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  140. package/fesm2022/ngwr-i18n-nl.mjs +13 -4
  141. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  142. package/fesm2022/ngwr-i18n-pl.mjs +13 -4
  143. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  144. package/fesm2022/ngwr-i18n-pt.mjs +13 -4
  145. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  146. package/fesm2022/ngwr-i18n-ru.mjs +13 -4
  147. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  148. package/fesm2022/ngwr-i18n-sv.mjs +13 -4
  149. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  150. package/fesm2022/ngwr-i18n-tr.mjs +13 -4
  151. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  152. package/fesm2022/ngwr-i18n-uk.mjs +13 -4
  153. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  154. package/fesm2022/ngwr-i18n-vi.mjs +13 -4
  155. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  156. package/fesm2022/ngwr-i18n-zh-tw.mjs +13 -4
  157. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  158. package/fesm2022/ngwr-i18n-zh.mjs +13 -4
  159. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  160. package/fesm2022/ngwr-lightbox.mjs +22 -5
  161. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  162. package/fesm2022/ngwr-list.mjs +2 -2
  163. package/fesm2022/ngwr-list.mjs.map +1 -1
  164. package/fesm2022/ngwr-overlay.mjs +21 -2
  165. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  166. package/fesm2022/ngwr-pagination.mjs +1 -0
  167. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  168. package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
  169. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  170. package/fesm2022/ngwr-popconfirm.mjs +41 -5
  171. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  172. package/fesm2022/ngwr-popover.mjs +67 -12
  173. package/fesm2022/ngwr-popover.mjs.map +1 -1
  174. package/fesm2022/ngwr-schema-form.mjs +3 -0
  175. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  176. package/fesm2022/ngwr-select.mjs +100 -3
  177. package/fesm2022/ngwr-select.mjs.map +1 -1
  178. package/fesm2022/ngwr-sortable-list.mjs +2 -2
  179. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  180. package/fesm2022/ngwr-table-testing.mjs +71 -3
  181. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  182. package/fesm2022/ngwr-table.mjs +173 -11
  183. package/fesm2022/ngwr-table.mjs.map +1 -1
  184. package/fesm2022/ngwr-tour-testing.mjs +13 -1
  185. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  186. package/fesm2022/ngwr-tour.mjs +25 -16
  187. package/fesm2022/ngwr-tour.mjs.map +1 -1
  188. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  189. package/fesm2022/ngwr-tree.mjs +52 -8
  190. package/fesm2022/ngwr-tree.mjs.map +1 -1
  191. package/fesm2022/ngwr-utils.mjs +64 -1
  192. package/fesm2022/ngwr-utils.mjs.map +1 -1
  193. package/fesm2022/ngwr-version.mjs +1 -1
  194. package/fesm2022/ngwr-version.mjs.map +1 -1
  195. package/fesm2022/ngwr-window.mjs +16 -9
  196. package/fesm2022/ngwr-window.mjs.map +1 -1
  197. package/graph/styles/_index.scss +87 -0
  198. package/i18n/ar.json +13 -4
  199. package/i18n/cs.json +13 -4
  200. package/i18n/de.json +13 -4
  201. package/i18n/en.json +13 -4
  202. package/i18n/es.json +13 -4
  203. package/i18n/fr.json +13 -4
  204. package/i18n/he.json +13 -4
  205. package/i18n/hi.json +13 -4
  206. package/i18n/id.json +13 -4
  207. package/i18n/it.json +13 -4
  208. package/i18n/ja.json +13 -4
  209. package/i18n/ko.json +13 -4
  210. package/i18n/nl.json +13 -4
  211. package/i18n/pl.json +13 -4
  212. package/i18n/pt.json +13 -4
  213. package/i18n/ru.json +13 -4
  214. package/i18n/sv.json +13 -4
  215. package/i18n/tr.json +13 -4
  216. package/i18n/uk.json +13 -4
  217. package/i18n/vi.json +13 -4
  218. package/i18n/zh-TW.json +13 -4
  219. package/i18n/zh.json +13 -4
  220. package/llms-full.txt +12 -12
  221. package/llms.txt +64 -27
  222. package/package.json +1 -1
  223. package/popconfirm/styles/_index.scss +6 -0
  224. package/popover/styles/_index.scss +24 -13
  225. package/schematics/collection.json +5 -0
  226. package/schematics/eject/index.js +158 -0
  227. package/schematics/eject/schema.js +8 -0
  228. package/schematics/eject/schema.json +24 -0
  229. package/schematics/eject/source.js +295 -0
  230. package/schematics/use/symbol-map.json +2 -0
  231. package/select/styles/_index.scss +13 -0
  232. package/skills/ngwr/SKILL.md +30 -3
  233. package/skills/ngwr/references/catalog.md +2 -2
  234. package/table/styles/_index.scss +24 -0
  235. package/theme/styles/_focus.scss +11 -1
  236. package/tour/styles/_index.scss +6 -0
  237. package/types/ngwr-carousel-testing.d.ts +29 -6
  238. package/types/ngwr-carousel.d.ts +52 -5
  239. package/types/ngwr-cascader-testing.d.ts +4 -3
  240. package/types/ngwr-cascader.d.ts +29 -7
  241. package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
  242. package/types/ngwr-charts-bar-chart.d.ts +220 -48
  243. package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
  244. package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
  245. package/types/ngwr-charts-bullet-chart.d.ts +72 -12
  246. package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
  247. package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
  248. package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
  249. package/types/ngwr-charts-chart-legend.d.ts +142 -5
  250. package/types/ngwr-charts-core.d.ts +259 -21
  251. package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
  252. package/types/ngwr-charts-donut-chart.d.ts +124 -16
  253. package/types/ngwr-charts-funnel-chart.d.ts +62 -6
  254. package/types/ngwr-charts-gauge-testing.d.ts +5 -1
  255. package/types/ngwr-charts-gauge.d.ts +72 -10
  256. package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
  257. package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
  258. package/types/ngwr-charts-line-chart.d.ts +215 -86
  259. package/types/ngwr-charts-meter-group.d.ts +96 -7
  260. package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
  261. package/types/ngwr-charts-radar-chart.d.ts +148 -28
  262. package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
  263. package/types/ngwr-charts-scatter-chart.d.ts +188 -18
  264. package/types/ngwr-charts-sparkline.d.ts +26 -4
  265. package/types/ngwr-charts-treemap-chart.d.ts +121 -23
  266. package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
  267. package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
  268. package/types/ngwr-color-picker.d.ts +27 -0
  269. package/types/ngwr-context-menu-testing.d.ts +10 -9
  270. package/types/ngwr-context-menu.d.ts +19 -0
  271. package/types/ngwr-copy-value.d.ts +8 -0
  272. package/types/ngwr-date-picker.d.ts +34 -2
  273. package/types/ngwr-dialog.d.ts +30 -10
  274. package/types/ngwr-drawer.d.ts +32 -1
  275. package/types/ngwr-dropdown-testing.d.ts +8 -5
  276. package/types/ngwr-dropdown.d.ts +31 -6
  277. package/types/ngwr-file-upload.d.ts +8 -2
  278. package/types/ngwr-graph-testing.d.ts +28 -0
  279. package/types/ngwr-graph.d.ts +263 -91
  280. package/types/ngwr-lightbox.d.ts +15 -0
  281. package/types/ngwr-overlay.d.ts +16 -1
  282. package/types/ngwr-popconfirm-testing.d.ts +11 -2
  283. package/types/ngwr-popconfirm.d.ts +28 -1
  284. package/types/ngwr-popover.d.ts +59 -9
  285. package/types/ngwr-select.d.ts +37 -0
  286. package/types/ngwr-table-testing.d.ts +52 -1
  287. package/types/ngwr-table.d.ts +102 -10
  288. package/types/ngwr-tour-testing.d.ts +10 -0
  289. package/types/ngwr-tour.d.ts +32 -4
  290. package/types/ngwr-tree-testing.d.ts +1 -2
  291. package/types/ngwr-tree.d.ts +35 -2
  292. package/types/ngwr-utils.d.ts +79 -1
  293. package/types/ngwr-version.d.ts +1 -1
  294. package/types/ngwr-window.d.ts +14 -11
  295. package/window/styles/_index.scss +5 -10
@@ -1,25 +1,173 @@
1
1
  import * as i0 from "@angular/core";
2
- import { Component, LOCALE_ID, ViewEncapsulation, computed, inject, input, model, viewChild } from "@angular/core";
2
+ import { Component, DestroyRef, LOCALE_ID, ViewEncapsulation, afterNextRender, computed, inject, input, model, viewChild } from "@angular/core";
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
- import { wrCheckStyles, wrRound } from "ngwr/utils";
4
+ import { NgTemplateOutlet } from "@angular/common";
5
+ import { wrCheckStyles } from "ngwr/utils";
5
6
  import { useI18nText } from "ngwr/i18n";
6
7
  import { WrChartLegend } from "ngwr/charts/chart-legend";
7
- import { WrChartTable, useChartNumbers, wrChartAxis, wrChartColor, wrChartMarker, wrChartMarkerExtent, wrChartMarkerPath } from "ngwr/charts/core";
8
- import { useChartTooltip } from "ngwr/popover";
8
+ import { WrChartState, WrChartTable, useChartHover, useChartNumbers, useChartSize, useChartState, wrChartAxis, wrChartColor, 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 POINT_RADIUS = 5;
16
+ const MAX_SIDE = 256;
17
+ const cellOf = (percent, side) => Math.min(side - 1, Math.max(0, Math.floor(percent / 100 * side)));
18
+ function wrScatterIndex(points) {
19
+ const count = points.length;
20
+ const side = Math.min(MAX_SIDE, Math.max(1, Math.ceil(Math.sqrt(count))));
21
+ const lefts = new Float64Array(count);
22
+ const tops = new Float64Array(count);
23
+ const reaches = new Float64Array(count);
24
+ const cells = new Int32Array(count);
25
+ const starts = new Int32Array(side * side + 1);
26
+ let reach = 0;
27
+ for (let i = 0; i < count; i++) {
28
+ const point = points[i];
29
+ lefts[i] = point.left;
30
+ tops[i] = point.top;
31
+ reaches[i] = point.reach;
32
+ if (point.reach > reach) reach = point.reach;
33
+ const cell = cellOf(point.top, side) * side + cellOf(point.left, side);
34
+ cells[i] = cell;
35
+ starts[cell + 1]++;
36
+ }
37
+ for (let cell = 0; cell < side * side; cell++) starts[cell + 1] += starts[cell];
38
+ const items = new Int32Array(count);
39
+ const next = starts.slice(0, side * side);
40
+ for (let i = 0; i < count; i++) items[next[cells[i]]++] = i;
41
+ return {
42
+ columns: side,
43
+ rows: side,
44
+ starts,
45
+ items,
46
+ lefts,
47
+ tops,
48
+ reaches,
49
+ reach
50
+ };
51
+ }
52
+ function wrScatterHit(index, left, top, width, height) {
53
+ if (!(width > 0) || !(height > 0) || index.items.length === 0) return null;
54
+ const { columns, rows, starts, items, lefts, tops, reaches } = index;
55
+ const acrossReach = index.reach / width * 100;
56
+ const downReach = index.reach / height * 100;
57
+ const firstColumn = cellOf(left - acrossReach, columns);
58
+ const lastColumn = cellOf(left + acrossReach, columns);
59
+ const firstRow = cellOf(top - downReach, rows);
60
+ const lastRow = cellOf(top + downReach, rows);
61
+ let best = null;
62
+ let nearest = Number.POSITIVE_INFINITY;
63
+ for (let row = firstRow; row <= lastRow; row++) for (let column = firstColumn; column <= lastColumn; column++) {
64
+ const cell = row * columns + column;
65
+ for (let k = starts[cell]; k < starts[cell + 1]; k++) {
66
+ const i = items[k];
67
+ const distance = Math.hypot((lefts[i] - left) / 100 * width, (tops[i] - top) / 100 * height);
68
+ if (distance > reaches[i]) continue;
69
+ if (distance < nearest || distance === nearest && best !== null && i < best) {
70
+ nearest = distance;
71
+ best = i;
72
+ }
73
+ }
74
+ }
75
+ return best;
76
+ }
77
+ /**
78
+ * @license
79
+ *
80
+ * Use of this source code is governed by an MIT-style license that can be
81
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
82
+ */
83
+ const CACHE_LIMIT = 4096;
84
+ const ARGUMENTS = {
85
+ M: 2,
86
+ L: 2,
87
+ A: 7,
88
+ Z: 0
89
+ };
90
+ const write = (value) => String(wrChartRound(value, 3));
91
+ function wrScatterRelativePath(d) {
92
+ const tokens = d.split(/\s+/).filter(Boolean);
93
+ let out = "";
94
+ let x = 0;
95
+ let y = 0;
96
+ for (let at = 0; at < tokens.length;) {
97
+ const command = tokens[at++];
98
+ const count = ARGUMENTS[command];
99
+ if (count === void 0) return "";
100
+ const values = tokens.slice(at, at + count).map(Number);
101
+ at += count;
102
+ if (command === "Z") {
103
+ out += "z";
104
+ continue;
105
+ }
106
+ const toX = values[count - 2];
107
+ const toY = values[count - 1];
108
+ const lead = command === "A" ? `${values.slice(0, 5).map(write).join(" ")} ` : "";
109
+ out += `${command.toLowerCase()}${lead}${write(toX - x)} ${write(toY - y)}`;
110
+ x = toX;
111
+ y = toY;
112
+ }
113
+ return out;
114
+ }
115
+ function wrScatterMarkerCache() {
116
+ const cache = /* @__PURE__ */ new Map();
117
+ return (shape, r) => {
118
+ const key = `${shape}:${r}`;
119
+ let marker = cache.get(key);
120
+ if (!marker) {
121
+ const d = wrChartMarkerPath(shape, r);
122
+ marker = {
123
+ d,
124
+ relative: wrScatterRelativePath(d),
125
+ extent: wrChartMarkerExtent(shape, r)
126
+ };
127
+ if (cache.size >= CACHE_LIMIT) cache.clear();
128
+ cache.set(key, marker);
129
+ }
130
+ return marker;
131
+ };
132
+ }
133
+ function wrScatterDensePath(points, width, height) {
134
+ let d = "";
135
+ for (const point of points) d += `M${wrChartRound(point.left / 100 * width, 1)} ${wrChartRound(point.top / 100 * height, 1)}${point.relative}`;
136
+ return d;
137
+ }
138
+ /**
139
+ * @license
140
+ *
141
+ * Use of this source code is governed by an MIT-style license that can be
142
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
143
+ */
144
+ const POINT_RADIUS = 3;
16
145
  const MIN_RADIUS = 4;
17
146
  const HIT_RADIUS = 16;
147
+ const HOVER_GROW = 1;
18
148
  const HALO_GAP = 3;
19
- const percent = (value) => Math.round(value * 1e3) / 1e3;
149
+ const DENSE_FROM = 2e3;
150
+ const ASSUMED_WIDTH = 560;
151
+ const percent = (value) => wrChartRound(value, 3);
20
152
  var WrScatterChart = class WrScatterChart {
21
153
  constructor() {
22
154
  if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("charts/scatter-chart");
155
+ useChartHover({
156
+ enter: () => void 0,
157
+ leave: () => void 0
158
+ });
159
+ const destroyRef = inject(DestroyRef);
160
+ afterNextRender(() => {
161
+ const plot = this.plot().nativeElement;
162
+ const move = (event) => this.onPointerMove(event);
163
+ const leave = (event) => this.tip.leave(event);
164
+ plot.addEventListener("mousemove", move);
165
+ plot.addEventListener("mouseleave", leave);
166
+ destroyRef.onDestroy(() => {
167
+ plot.removeEventListener("mousemove", move);
168
+ plot.removeEventListener("mouseleave", leave);
169
+ });
170
+ });
23
171
  }
24
172
  series = input([], ...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
25
173
  ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
@@ -32,7 +180,7 @@ var WrScatterChart = class WrScatterChart {
32
180
  sizeName = useI18nText(this.sizeLabel, "scatterChart.size", "Size");
33
181
  valueFormat = input(null, ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
34
182
  numbers = useChartNumbers(this.valueFormat);
35
- ordinals = new Intl.NumberFormat(inject(LOCALE_ID));
183
+ ordinals = wrChartNumberFormat(inject(LOCALE_ID));
36
184
  height = input(240, {
37
185
  ...ngDevMode ? { debugName: "height" } : /* istanbul ignore next */ {},
38
186
  transform: (v) => Math.max(80, coerceNumberProperty(v, 240))
@@ -41,10 +189,26 @@ var WrScatterChart = class WrScatterChart {
41
189
  ...ngDevMode ? { debugName: "showGrid" } : /* istanbul ignore next */ {},
42
190
  transform: coerceBooleanProperty
43
191
  });
44
- showLegend = input(true, {
192
+ showAxis = input(true, {
193
+ ...ngDevMode ? { debugName: "showAxis" } : /* istanbul ignore next */ {},
194
+ transform: coerceBooleanProperty
195
+ });
196
+ showLegend = input("auto", {
45
197
  ...ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {},
198
+ transform: (value) => value === "auto" ? "auto" : coerceBooleanProperty(value)
199
+ });
200
+ legendPosition = input("bottom", ...ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []);
201
+ loading = input(false, {
202
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
46
203
  transform: coerceBooleanProperty
47
204
  });
205
+ error = input(false, {
206
+ ...ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {},
207
+ transform: coerceBooleanProperty
208
+ });
209
+ emptyLabel = input(null, ...ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []);
210
+ loadingLabel = input(null, ...ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []);
211
+ errorLabel = input(null, ...ngDevMode ? [{ debugName: "errorLabel" }] : /* istanbul ignore next */ []);
48
212
  toggleableLegend = input(false, {
49
213
  ...ngDevMode ? { debugName: "toggleableLegend" } : /* istanbul ignore next */ {},
50
214
  transform: coerceBooleanProperty
@@ -52,7 +216,7 @@ var WrScatterChart = class WrScatterChart {
52
216
  hiddenSeries = model([], ...ngDevMode ? [{ debugName: "hiddenSeries" }] : /* istanbul ignore next */ []);
53
217
  tooltip = input(true, {
54
218
  ...ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {},
55
- transform: coerceBooleanProperty
219
+ transform: wrCoerceChartTooltip
56
220
  });
57
221
  dataTable = input(false, {
58
222
  ...ngDevMode ? { debugName: "dataTable" } : /* istanbul ignore next */ {},
@@ -63,6 +227,9 @@ var WrScatterChart = class WrScatterChart {
63
227
  transform: (v) => Math.max(MIN_RADIUS, coerceNumberProperty(v, 20))
64
228
  });
65
229
  svg = viewChild("svg", ...ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []);
230
+ plot = viewChild.required("plot", ...ngDevMode ? [{ debugName: "plot" }] : /* istanbul ignore next */ []);
231
+ drawingSize = useChartSize(this.svg);
232
+ markerOf = wrScatterMarkerCache();
66
233
  resolvedSeries = computed(() => this.series().map((s, index) => ({
67
234
  index,
68
235
  label: s.label,
@@ -81,6 +248,29 @@ var WrScatterChart = class WrScatterChart {
81
248
  color,
82
249
  marker
83
250
  })), ...ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []);
251
+ legendShown = computed(() => {
252
+ const show = this.showLegend();
253
+ const rows = this.legendItems().length;
254
+ if (show === false || rows === 0 || this.legendPosition() === "none") return false;
255
+ return show === true || rows > 1;
256
+ }, ...ngDevMode ? [{ debugName: "legendShown" }] : /* istanbul ignore next */ []);
257
+ legendFirst = computed(() => {
258
+ const position = this.legendPosition();
259
+ return position === "top" || position === "start";
260
+ }, ...ngDevMode ? [{ debugName: "legendFirst" }] : /* istanbul ignore next */ []);
261
+ legendSide = computed(() => {
262
+ const position = this.legendPosition();
263
+ return position === "start" || position === "end";
264
+ }, ...ngDevMode ? [{ debugName: "legendSide" }] : /* istanbul ignore next */ []);
265
+ empty = computed(() => this.resolvedSeries().every((s) => s.points.length === 0), ...ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []);
266
+ state = useChartState({
267
+ loading: this.loading,
268
+ error: this.error,
269
+ empty: this.empty,
270
+ emptyLabel: this.emptyLabel,
271
+ loadingLabel: this.loadingLabel,
272
+ errorLabel: this.errorLabel
273
+ });
84
274
  visibleSeries = computed(() => {
85
275
  const hidden = new Set(this.hiddenSeries());
86
276
  return this.resolvedSeries().filter((s) => !hidden.has(s.index));
@@ -100,7 +290,7 @@ var WrScatterChart = class WrScatterChart {
100
290
  const maxRadius = this.maxRadius();
101
291
  return this.visibleSeries().flatMap((s) => s.points.map((p) => {
102
292
  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 = wrChartMarkerExtent(s.marker, r + HALO_GAP);
293
+ const marker = this.markerOf(s.marker, r);
104
294
  return {
105
295
  key: `${s.index}:${p.n}`,
106
296
  series: s.index,
@@ -115,11 +305,63 @@ var WrScatterChart = class WrScatterChart {
115
305
  left: percent((p.x - x.min) / (x.max - x.min) * 100),
116
306
  top: percent((y.max - p.y) / (y.max - y.min) * 100),
117
307
  r,
118
- d: wrChartMarkerPath(s.marker, r),
119
- halo
308
+ d: marker.d,
309
+ relative: marker.relative,
310
+ values: p.size === null ? `${p.x} ${p.y} ${r}` : `${p.x} ${p.y} ${r} ${p.size}`,
311
+ halo: this.markerOf(s.marker, r + HALO_GAP).extent
120
312
  };
121
313
  })).sort((a, b) => b.r - a.r);
122
314
  }, ...ngDevMode ? [{ debugName: "points" }] : /* istanbul ignore next */ []);
315
+ dense = computed(() => this.points().length > DENSE_FROM, ...ngDevMode ? [{ debugName: "dense" }] : /* istanbul ignore next */ []);
316
+ runs = computed(() => {
317
+ if (this.dense()) return [];
318
+ const runs = [];
319
+ for (const point of this.points()) {
320
+ const last = runs[runs.length - 1];
321
+ if (last?.series === point.series) last.points.push(point);
322
+ else runs.push({
323
+ key: point.key,
324
+ series: point.series,
325
+ color: point.color,
326
+ marker: point.marker,
327
+ points: [point]
328
+ });
329
+ }
330
+ return runs;
331
+ }, ...ngDevMode ? [{ debugName: "runs" }] : /* istanbul ignore next */ []);
332
+ denseSize = computed(() => {
333
+ const { width, height } = this.drawingSize();
334
+ return width > 0 && height > 0 ? {
335
+ width,
336
+ height
337
+ } : {
338
+ width: ASSUMED_WIDTH,
339
+ height: this.height()
340
+ };
341
+ }, ...ngDevMode ? [{ debugName: "denseSize" }] : /* istanbul ignore next */ []);
342
+ denseBox = computed(() => `0 0 ${this.denseSize().width} ${this.denseSize().height}`, ...ngDevMode ? [{ debugName: "denseBox" }] : /* istanbul ignore next */ []);
343
+ densePaths = computed(() => {
344
+ if (!this.dense()) return [];
345
+ const { width, height } = this.denseSize();
346
+ const bySeries = /* @__PURE__ */ new Map();
347
+ for (const point of this.points()) {
348
+ const list = bySeries.get(point.series);
349
+ if (list) list.push(point);
350
+ else bySeries.set(point.series, [point]);
351
+ }
352
+ return [...bySeries.entries()].sort(([a], [b]) => a - b).map(([series, points]) => ({
353
+ series,
354
+ color: points[0].color,
355
+ marker: points[0].marker,
356
+ count: points.length,
357
+ d: wrScatterDensePath(points, width, height)
358
+ }));
359
+ }, ...ngDevMode ? [{ debugName: "densePaths" }] : /* istanbul ignore next */ []);
360
+ index = computed(() => wrScatterIndex(this.points().map(({ left, top, halo }) => ({
361
+ left,
362
+ top,
363
+ reach: Math.max(HIT_RADIUS, halo.radius)
364
+ }))), ...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
123
365
  reach = computed(() => {
124
366
  let x = 0;
125
367
  let y = 0;
@@ -128,8 +370,8 @@ var WrScatterChart = class WrScatterChart {
128
370
  y = Math.max(y, halo.top, halo.bottom);
129
371
  }
130
372
  return {
131
- x: wrRound(x, 3),
132
- y: wrRound(Math.min(y, this.height() / 4), 3)
373
+ x: wrChartRound(x, 3),
374
+ y: wrChartRound(Math.min(y, this.height() / 4), 3)
133
375
  };
134
376
  }, ...ngDevMode ? [{ debugName: "reach" }] : /* istanbul ignore next */ []);
135
377
  yTicks = computed(() => {
@@ -137,7 +379,8 @@ var WrScatterChart = class WrScatterChart {
137
379
  const labels = this.numbers.ticks(ticks, step, "y");
138
380
  return ticks.map((value, i) => ({
139
381
  label: labels[i],
140
- top: percent((max - value) / (max - min) * 100)
382
+ top: percent((max - value) / (max - min) * 100),
383
+ zero: value === 0
141
384
  }));
142
385
  }, ...ngDevMode ? [{ debugName: "yTicks" }] : /* istanbul ignore next */ []);
143
386
  xTicks = computed(() => {
@@ -156,7 +399,7 @@ var WrScatterChart = class WrScatterChart {
156
399
  tip = useChartTooltip(this.tooltip, (index) => {
157
400
  const point = this.points()[index];
158
401
  const svg = this.svg()?.nativeElement;
159
- if (!point || !svg) return null;
402
+ if (!point || !svg || this.state()) return null;
160
403
  const box = svg.getBoundingClientRect();
161
404
  const x = box.left + point.left / 100 * box.width;
162
405
  const y = box.top + point.top / 100 * box.height;
@@ -188,11 +431,11 @@ var WrScatterChart = class WrScatterChart {
188
431
  }, (x, y) => this.pointAt(x, y));
189
432
  activePoint = computed(() => {
190
433
  const index = this.tip.active();
191
- return index === null ? null : this.points()[index] ?? null;
434
+ return index === null || this.state() ? null : this.points()[index] ?? null;
192
435
  }, ...ngDevMode ? [{ debugName: "activePoint" }] : /* istanbul ignore next */ []);
193
436
  haloPath = computed(() => {
194
437
  const point = this.activePoint();
195
- return point ? wrChartMarkerPath(point.marker, point.r + HALO_GAP) : "";
438
+ return point ? this.markerOf(point.marker, point.r + HOVER_GROW).d : "";
196
439
  }, ...ngDevMode ? [{ debugName: "haloPath" }] : /* istanbul ignore next */ []);
197
440
  tableData = computed(() => {
198
441
  const sized = this.sized();
@@ -218,26 +461,17 @@ var WrScatterChart = class WrScatterChart {
218
461
  };
219
462
  }, ...ngDevMode ? [{ debugName: "tableData" }] : /* istanbul ignore next */ []);
220
463
  onPointerMove(event) {
221
- if (!this.tooltip()) return;
464
+ if (!this.tooltip() || this.tip.active() !== null) return;
222
465
  const index = this.pointAt(event.clientX, event.clientY);
223
466
  if (index === null) this.tip.leave(event);
224
467
  else this.tip.enter(index);
225
468
  }
226
469
  pointAt(clientX, clientY) {
227
470
  const svg = this.svg()?.nativeElement;
228
- if (!svg) return null;
471
+ if (!svg || this.state()) return null;
229
472
  const box = svg.getBoundingClientRect();
230
473
  if (box.width <= 0 || box.height <= 0) return null;
231
- let best = null;
232
- let nearest = Number.POSITIVE_INFINITY;
233
- this.points().forEach((point, index) => {
234
- const distance = Math.hypot(box.left + point.left / 100 * box.width - clientX, box.top + point.top / 100 * box.height - clientY);
235
- if (distance <= Math.max(HIT_RADIUS, point.halo.radius) && distance < nearest) {
236
- nearest = distance;
237
- best = index;
238
- }
239
- });
240
- return best;
474
+ return wrScatterHit(this.index(), (clientX - box.left) / box.width * 100, (clientY - box.top) / box.height * 100, box.width, box.height);
241
475
  }
242
476
  fit(read) {
243
477
  let min = Number.POSITIVE_INFINITY;
@@ -320,6 +554,13 @@ var WrScatterChart = class WrScatterChart {
320
554
  isRequired: false,
321
555
  transformFunction: null
322
556
  },
557
+ showAxis: {
558
+ classPropertyName: "showAxis",
559
+ publicName: "showAxis",
560
+ isSignal: true,
561
+ isRequired: false,
562
+ transformFunction: null
563
+ },
323
564
  showLegend: {
324
565
  classPropertyName: "showLegend",
325
566
  publicName: "showLegend",
@@ -327,6 +568,48 @@ var WrScatterChart = class WrScatterChart {
327
568
  isRequired: false,
328
569
  transformFunction: null
329
570
  },
571
+ legendPosition: {
572
+ classPropertyName: "legendPosition",
573
+ publicName: "legendPosition",
574
+ isSignal: true,
575
+ isRequired: false,
576
+ transformFunction: null
577
+ },
578
+ loading: {
579
+ classPropertyName: "loading",
580
+ publicName: "loading",
581
+ isSignal: true,
582
+ isRequired: false,
583
+ transformFunction: null
584
+ },
585
+ error: {
586
+ classPropertyName: "error",
587
+ publicName: "error",
588
+ isSignal: true,
589
+ isRequired: false,
590
+ transformFunction: null
591
+ },
592
+ emptyLabel: {
593
+ classPropertyName: "emptyLabel",
594
+ publicName: "emptyLabel",
595
+ isSignal: true,
596
+ isRequired: false,
597
+ transformFunction: null
598
+ },
599
+ loadingLabel: {
600
+ classPropertyName: "loadingLabel",
601
+ publicName: "loadingLabel",
602
+ isSignal: true,
603
+ isRequired: false,
604
+ transformFunction: null
605
+ },
606
+ errorLabel: {
607
+ classPropertyName: "errorLabel",
608
+ publicName: "errorLabel",
609
+ isSignal: true,
610
+ isRequired: false,
611
+ transformFunction: null
612
+ },
330
613
  toggleableLegend: {
331
614
  classPropertyName: "toggleableLegend",
332
615
  publicName: "toggleableLegend",
@@ -366,11 +649,13 @@ var WrScatterChart = class WrScatterChart {
366
649
  outputs: { hiddenSeries: "hiddenSeriesChange" },
367
650
  host: {
368
651
  properties: {
652
+ "class.wr-chart--legend-side": "legendShown() && legendSide()",
653
+ "class.wr-scatter-chart--axis": "showAxis()",
369
654
  "class.wr-scatter-chart--bubbles": "sized()",
370
655
  "style.--wr-scatter-chart-reach-x": "reach().x",
371
656
  "style.--wr-scatter-chart-reach-y": "reach().y"
372
657
  },
373
- classAttribute: "wr-scatter-chart"
658
+ classAttribute: "wr-scatter-chart wr-chart--legend"
374
659
  },
375
660
  viewQueries: [{
376
661
  propertyName: "svg",
@@ -378,27 +663,53 @@ var WrScatterChart = class WrScatterChart {
378
663
  predicate: ["svg"],
379
664
  descendants: true,
380
665
  isSignal: true
381
- }],
382
- ngImport: i0,
383
- template: "@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",
384
- dependencies: [{
385
- kind: "component",
386
- type: WrChartLegend,
387
- selector: "ul[wr-chart-legend]",
388
- inputs: [
389
- "items",
390
- "toggleable",
391
- "hiddenSeries",
392
- "ariaLabel",
393
- "hiddenLabel"
394
- ],
395
- outputs: ["hiddenSeriesChange", "toggled"]
396
666
  }, {
397
- kind: "component",
398
- type: WrChartTable,
399
- selector: "wr-chart-table",
400
- inputs: ["data"]
667
+ propertyName: "plot",
668
+ first: true,
669
+ predicate: ["plot"],
670
+ descendants: true,
671
+ isSignal: true
401
672
  }],
673
+ ngImport: i0,
674
+ template: "@let active = activePoint();\n@let shown = state();\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 row keys its series by the series' own marker shape, the channel that tells the\n points apart where the colours do not. Rows are tracked by position, so two series\n that share a label are two rows. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-scatter-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<!-- Three columns: the y axis' name turned along the axis, the y tick labels, and the\n drawing, with the x tick labels and the x axis' name under the drawing only, so\n their percentages are the drawing's. -->\n<div class=\"wr-scatter-chart__body\">\n @if (yLabel()) {\n <!-- Along its axis, beside the scale it names: set level above the plot it read as an\n entry of a legend placed there. -->\n <div class=\"wr-scatter-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showAxis()) {\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 <!-- The pointer is heard on the plot by one native listener pair the component adds,\n and a point is found by position. -->\n <div\n #plot\n class=\"wr-scatter-chart__plot\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\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 <!-- The line at zero takes the stronger `--wr-scatter-chart-zero-color`. -->\n <line\n class=\"wr-scatter-chart__grid-line\"\n [class.wr-scatter-chart__grid-line--zero]=\"tick.zero\"\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 <!-- Painted `transparent` by default: a chart reads its values across. The\n lines stay so that `--wr-scatter-chart-grid-x-color` can draw them. -->\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 @if (!shown) {\n @for (run of runs(); track run.key) {\n <!-- A stretch of one series' points, in drawing order. The group carries what\n they share: the fill, the shape, and `data-wr-series`, the series' row in\n the legend, which the shared hover dims by. -->\n <g\n class=\"wr-scatter-chart__series\"\n [attr.fill]=\"run.color\"\n [attr.data-wr-series]=\"run.series\"\n [attr.data-marker]=\"run.marker\"\n >\n @for (p of run.points; track p.key) {\n <!-- A nested `<svg>` placed by percentage, its marker drawn about its origin\n in px: an SVG's `x` and `y` take a percentage where a `transform` does\n not, so the marker sits on its point at any size and keeps its own. Its\n viewport is the drawing's whole box, painted nowhere, and `overflow`\n lets the marker reach outside it. `data-point` is the point's x, y and\n radius, and its size when it has one: what a test harness reads. -->\n <svg\n class=\"wr-scatter-chart__point\"\n [attr.x]=\"`${p.left}%`\"\n [attr.y]=\"`${p.top}%`\"\n overflow=\"visible\"\n [attr.data-point]=\"p.values\"\n >\n <path class=\"wr-scatter-chart__marker\" [attr.d]=\"p.d\" />\n </svg>\n }\n </g>\n }\n\n @if (dense()) {\n <!-- Too many points for a node each: every series is one path, a subpath per\n marker, in px of the drawing's measured size. The `viewBox` is that size, so\n nothing is scaled once it is measured; before that, and between a resize and\n the path written for it, the markers stretch with the box. -->\n <svg\n class=\"wr-scatter-chart__dense\"\n [attr.viewBox]=\"denseBox()\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\"\n >\n @for (s of densePaths(); track s.series) {\n <path\n class=\"wr-scatter-chart__points wr-scatter-chart__marker\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"s.d\"\n [attr.fill]=\"s.color\"\n [attr.data-wr-series]=\"s.series\"\n [attr.data-marker]=\"s.marker\"\n [attr.data-count]=\"s.count\"\n />\n }\n </svg>\n }\n }\n\n @if (active) {\n <!-- The point being read, drawn again over the rest: its own shape a little\n larger, solid, inside a ring of the surface. -->\n <svg class=\"wr-scatter-chart__halo\" [attr.x]=\"`${active.left}%`\" [attr.y]=\"`${active.top}%`\" overflow=\"visible\">\n <path [attr.d]=\"haloPath()\" [attr.fill]=\"active.color\" />\n </svg>\n }\n </svg>\n </div>\n\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the axes the chart keeps.\n Beside the plot, in its grid cell, and not inside it: the plot is an `img`, which\n makes everything it holds presentational, and the message is a live region. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n }\n\n @if (showAxis()) {\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 (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n@if (dataTable() && !shown) {\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",
675
+ dependencies: [
676
+ {
677
+ kind: "directive",
678
+ type: NgTemplateOutlet,
679
+ selector: "[ngTemplateOutlet]",
680
+ inputs: [
681
+ "ngTemplateOutletContext",
682
+ "ngTemplateOutlet",
683
+ "ngTemplateOutletInjector"
684
+ ]
685
+ },
686
+ {
687
+ kind: "component",
688
+ type: WrChartLegend,
689
+ selector: "ul[wr-chart-legend]",
690
+ inputs: [
691
+ "items",
692
+ "position",
693
+ "toggleable",
694
+ "hiddenSeries",
695
+ "ariaLabel",
696
+ "hiddenLabel"
697
+ ],
698
+ outputs: ["hiddenSeriesChange", "toggled"]
699
+ },
700
+ {
701
+ kind: "component",
702
+ type: WrChartState,
703
+ selector: "wr-chart-state",
704
+ inputs: ["kind", "label"]
705
+ },
706
+ {
707
+ kind: "component",
708
+ type: WrChartTable,
709
+ selector: "wr-chart-table",
710
+ inputs: ["data"]
711
+ }
712
+ ],
402
713
  encapsulation: i0.ViewEncapsulation.None
403
714
  });
404
715
  };
@@ -413,13 +724,20 @@ i0.ɵɵngDeclareClassMetadata({
413
724
  selector: "wr-scatter-chart",
414
725
  encapsulation: ViewEncapsulation.None,
415
726
  host: {
416
- class: "wr-scatter-chart",
727
+ class: "wr-scatter-chart wr-chart--legend",
728
+ "[class.wr-chart--legend-side]": "legendShown() && legendSide()",
729
+ "[class.wr-scatter-chart--axis]": "showAxis()",
417
730
  "[class.wr-scatter-chart--bubbles]": "sized()",
418
731
  "[style.--wr-scatter-chart-reach-x]": "reach().x",
419
732
  "[style.--wr-scatter-chart-reach-y]": "reach().y"
420
733
  },
421
- imports: [WrChartLegend, WrChartTable],
422
- template: "@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"
734
+ imports: [
735
+ NgTemplateOutlet,
736
+ WrChartLegend,
737
+ WrChartState,
738
+ WrChartTable
739
+ ],
740
+ template: "@let active = activePoint();\n@let shown = state();\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 row keys its series by the series' own marker shape, the channel that tells the\n points apart where the colours do not. Rows are tracked by position, so two series\n that share a label are two rows. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-scatter-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<!-- Three columns: the y axis' name turned along the axis, the y tick labels, and the\n drawing, with the x tick labels and the x axis' name under the drawing only, so\n their percentages are the drawing's. -->\n<div class=\"wr-scatter-chart__body\">\n @if (yLabel()) {\n <!-- Along its axis, beside the scale it names: set level above the plot it read as an\n entry of a legend placed there. -->\n <div class=\"wr-scatter-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showAxis()) {\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 <!-- The pointer is heard on the plot by one native listener pair the component adds,\n and a point is found by position. -->\n <div\n #plot\n class=\"wr-scatter-chart__plot\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\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 <!-- The line at zero takes the stronger `--wr-scatter-chart-zero-color`. -->\n <line\n class=\"wr-scatter-chart__grid-line\"\n [class.wr-scatter-chart__grid-line--zero]=\"tick.zero\"\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 <!-- Painted `transparent` by default: a chart reads its values across. The\n lines stay so that `--wr-scatter-chart-grid-x-color` can draw them. -->\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 @if (!shown) {\n @for (run of runs(); track run.key) {\n <!-- A stretch of one series' points, in drawing order. The group carries what\n they share: the fill, the shape, and `data-wr-series`, the series' row in\n the legend, which the shared hover dims by. -->\n <g\n class=\"wr-scatter-chart__series\"\n [attr.fill]=\"run.color\"\n [attr.data-wr-series]=\"run.series\"\n [attr.data-marker]=\"run.marker\"\n >\n @for (p of run.points; track p.key) {\n <!-- A nested `<svg>` placed by percentage, its marker drawn about its origin\n in px: an SVG's `x` and `y` take a percentage where a `transform` does\n not, so the marker sits on its point at any size and keeps its own. Its\n viewport is the drawing's whole box, painted nowhere, and `overflow`\n lets the marker reach outside it. `data-point` is the point's x, y and\n radius, and its size when it has one: what a test harness reads. -->\n <svg\n class=\"wr-scatter-chart__point\"\n [attr.x]=\"`${p.left}%`\"\n [attr.y]=\"`${p.top}%`\"\n overflow=\"visible\"\n [attr.data-point]=\"p.values\"\n >\n <path class=\"wr-scatter-chart__marker\" [attr.d]=\"p.d\" />\n </svg>\n }\n </g>\n }\n\n @if (dense()) {\n <!-- Too many points for a node each: every series is one path, a subpath per\n marker, in px of the drawing's measured size. The `viewBox` is that size, so\n nothing is scaled once it is measured; before that, and between a resize and\n the path written for it, the markers stretch with the box. -->\n <svg\n class=\"wr-scatter-chart__dense\"\n [attr.viewBox]=\"denseBox()\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\"\n >\n @for (s of densePaths(); track s.series) {\n <path\n class=\"wr-scatter-chart__points wr-scatter-chart__marker\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"s.d\"\n [attr.fill]=\"s.color\"\n [attr.data-wr-series]=\"s.series\"\n [attr.data-marker]=\"s.marker\"\n [attr.data-count]=\"s.count\"\n />\n }\n </svg>\n }\n }\n\n @if (active) {\n <!-- The point being read, drawn again over the rest: its own shape a little\n larger, solid, inside a ring of the surface. -->\n <svg class=\"wr-scatter-chart__halo\" [attr.x]=\"`${active.left}%`\" [attr.y]=\"`${active.top}%`\" overflow=\"visible\">\n <path [attr.d]=\"haloPath()\" [attr.fill]=\"active.color\" />\n </svg>\n }\n </svg>\n </div>\n\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the axes the chart keeps.\n Beside the plot, in its grid cell, and not inside it: the plot is an `img`, which\n makes everything it holds presentational, and the message is a live region. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n }\n\n @if (showAxis()) {\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 (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n@if (dataTable() && !shown) {\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"
423
741
  }]
424
742
  }],
425
743
  ctorParameters: () => [],
@@ -488,6 +806,14 @@ i0.ɵɵngDeclareClassMetadata({
488
806
  required: false
489
807
  }]
490
808
  }],
809
+ showAxis: [{
810
+ type: i0.Input,
811
+ args: [{
812
+ isSignal: true,
813
+ alias: "showAxis",
814
+ required: false
815
+ }]
816
+ }],
491
817
  showLegend: [{
492
818
  type: i0.Input,
493
819
  args: [{
@@ -496,6 +822,54 @@ i0.ɵɵngDeclareClassMetadata({
496
822
  required: false
497
823
  }]
498
824
  }],
825
+ legendPosition: [{
826
+ type: i0.Input,
827
+ args: [{
828
+ isSignal: true,
829
+ alias: "legendPosition",
830
+ required: false
831
+ }]
832
+ }],
833
+ loading: [{
834
+ type: i0.Input,
835
+ args: [{
836
+ isSignal: true,
837
+ alias: "loading",
838
+ required: false
839
+ }]
840
+ }],
841
+ error: [{
842
+ type: i0.Input,
843
+ args: [{
844
+ isSignal: true,
845
+ alias: "error",
846
+ required: false
847
+ }]
848
+ }],
849
+ emptyLabel: [{
850
+ type: i0.Input,
851
+ args: [{
852
+ isSignal: true,
853
+ alias: "emptyLabel",
854
+ required: false
855
+ }]
856
+ }],
857
+ loadingLabel: [{
858
+ type: i0.Input,
859
+ args: [{
860
+ isSignal: true,
861
+ alias: "loadingLabel",
862
+ required: false
863
+ }]
864
+ }],
865
+ errorLabel: [{
866
+ type: i0.Input,
867
+ args: [{
868
+ isSignal: true,
869
+ alias: "errorLabel",
870
+ required: false
871
+ }]
872
+ }],
499
873
  toggleableLegend: [{
500
874
  type: i0.Input,
501
875
  args: [{
@@ -542,6 +916,10 @@ i0.ɵɵngDeclareClassMetadata({
542
916
  svg: [{
543
917
  type: i0.ViewChild,
544
918
  args: ["svg", { isSignal: true }]
919
+ }],
920
+ plot: [{
921
+ type: i0.ViewChild,
922
+ args: ["plot", { isSignal: true }]
545
923
  }]
546
924
  }
547
925
  });