@ojiepermana/angular 22.1.13 → 22.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/README.md +8 -6
  2. package/SUPPORT.md +3 -3
  3. package/chart/README.md +1 -1
  4. package/component/README.md +2 -2
  5. package/component/calendar/README.md +3 -15
  6. package/component/drawer/README.md +1 -2
  7. package/fesm2022/ojiepermana-angular-chart-area.mjs +352 -137
  8. package/fesm2022/ojiepermana-angular-chart-bar.mjs +744 -524
  9. package/fesm2022/ojiepermana-angular-chart-core.mjs +1140 -1344
  10. package/fesm2022/ojiepermana-angular-chart-line.mjs +393 -147
  11. package/fesm2022/ojiepermana-angular-chart-pie.mjs +408 -179
  12. package/fesm2022/ojiepermana-angular-chart-primitives.mjs +1262 -920
  13. package/fesm2022/ojiepermana-angular-chart-radar.mjs +473 -205
  14. package/fesm2022/ojiepermana-angular-chart-radial.mjs +425 -182
  15. package/fesm2022/ojiepermana-angular-chart-scatter.mjs +386 -210
  16. package/fesm2022/ojiepermana-angular-chart.mjs +3 -19
  17. package/fesm2022/ojiepermana-angular-component-accordion.mjs +485 -243
  18. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +963 -325
  19. package/fesm2022/ojiepermana-angular-component-alert.mjs +266 -103
  20. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +80 -35
  21. package/fesm2022/ojiepermana-angular-component-avatar.mjs +402 -135
  22. package/fesm2022/ojiepermana-angular-component-badge.mjs +109 -59
  23. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +410 -142
  24. package/fesm2022/ojiepermana-angular-component-button-group.mjs +249 -96
  25. package/fesm2022/ojiepermana-angular-component-button.mjs +153 -75
  26. package/fesm2022/ojiepermana-angular-component-calendar.mjs +531 -418
  27. package/fesm2022/ojiepermana-angular-component-card.mjs +457 -171
  28. package/fesm2022/ojiepermana-angular-component-carousel.mjs +642 -272
  29. package/fesm2022/ojiepermana-angular-component-checkbox.mjs +312 -108
  30. package/fesm2022/ojiepermana-angular-component-collapsible.mjs +299 -115
  31. package/fesm2022/ojiepermana-angular-component-combobox.mjs +396 -183
  32. package/fesm2022/ojiepermana-angular-component-command.mjs +807 -347
  33. package/fesm2022/ojiepermana-angular-component-composer.mjs +807 -330
  34. package/fesm2022/ojiepermana-angular-component-context-menu.mjs +196 -161
  35. package/fesm2022/ojiepermana-angular-component-date-picker.mjs +650 -338
  36. package/fesm2022/ojiepermana-angular-component-dialog.mjs +710 -316
  37. package/fesm2022/ojiepermana-angular-component-drawer.mjs +2 -5
  38. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +1212 -646
  39. package/fesm2022/ojiepermana-angular-component-editor.mjs +987 -502
  40. package/fesm2022/ojiepermana-angular-component-empty.mjs +350 -137
  41. package/fesm2022/ojiepermana-angular-component-form.mjs +813 -434
  42. package/fesm2022/ojiepermana-angular-component-hover-card.mjs +486 -277
  43. package/fesm2022/ojiepermana-angular-component-icon.mjs +241 -140
  44. package/fesm2022/ojiepermana-angular-component-input-group.mjs +449 -176
  45. package/fesm2022/ojiepermana-angular-component-input-otp.mjs +891 -488
  46. package/fesm2022/ojiepermana-angular-component-input.mjs +86 -55
  47. package/fesm2022/ojiepermana-angular-component-item.mjs +713 -261
  48. package/fesm2022/ojiepermana-angular-component-kanban.mjs +714 -216
  49. package/fesm2022/ojiepermana-angular-component-kbd.mjs +124 -52
  50. package/fesm2022/ojiepermana-angular-component-label.mjs +82 -31
  51. package/fesm2022/ojiepermana-angular-component-menubar.mjs +479 -329
  52. package/fesm2022/ojiepermana-angular-component-native-select.mjs +167 -65
  53. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +683 -380
  54. package/fesm2022/ojiepermana-angular-component-pagination.mjs +277 -94
  55. package/fesm2022/ojiepermana-angular-component-pillbox.mjs +1283 -607
  56. package/fesm2022/ojiepermana-angular-component-popover.mjs +291 -204
  57. package/fesm2022/ojiepermana-angular-component-progress.mjs +176 -53
  58. package/fesm2022/ojiepermana-angular-component-radio.mjs +449 -142
  59. package/fesm2022/ojiepermana-angular-component-resizable.mjs +659 -453
  60. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +117 -39
  61. package/fesm2022/ojiepermana-angular-component-segmented-control.mjs +351 -172
  62. package/fesm2022/ojiepermana-angular-component-select.mjs +475 -345
  63. package/fesm2022/ojiepermana-angular-component-separator.mjs +102 -35
  64. package/fesm2022/ojiepermana-angular-component-sheet.mjs +797 -347
  65. package/fesm2022/ojiepermana-angular-component-skeleton.mjs +62 -29
  66. package/fesm2022/ojiepermana-angular-component-slider.mjs +592 -376
  67. package/fesm2022/ojiepermana-angular-component-spinner.mjs +135 -38
  68. package/fesm2022/ojiepermana-angular-component-switch.mjs +315 -103
  69. package/fesm2022/ojiepermana-angular-component-table.mjs +440 -153
  70. package/fesm2022/ojiepermana-angular-component-tabs.mjs +590 -317
  71. package/fesm2022/ojiepermana-angular-component-textarea.mjs +85 -50
  72. package/fesm2022/ojiepermana-angular-component-timeline.mjs +609 -231
  73. package/fesm2022/ojiepermana-angular-component-toast.mjs +229 -243
  74. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +573 -288
  75. package/fesm2022/ojiepermana-angular-component-toggle.mjs +187 -78
  76. package/fesm2022/ojiepermana-angular-component-tooltip.mjs +798 -517
  77. package/fesm2022/ojiepermana-angular-component-utils-core.mjs +159 -292
  78. package/fesm2022/ojiepermana-angular-component-utils-overlay.mjs +46 -58
  79. package/fesm2022/ojiepermana-angular-component-utils-scale.mjs +76 -38
  80. package/fesm2022/ojiepermana-angular-component-utils.mjs +2 -8
  81. package/fesm2022/ojiepermana-angular-component.mjs +0 -10
  82. package/fesm2022/ojiepermana-angular-navigation-core.mjs +13 -23
  83. package/fesm2022/ojiepermana-angular-navigation-icon.mjs +35 -24
  84. package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-BKCeWzml.mjs +129 -0
  85. package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-DFEJK2jD.mjs +811 -0
  86. package/fesm2022/{ojiepermana-angular-navigation-navigation-entry-grid.component-Cd-jh6tg.mjs → ojiepermana-angular-navigation-navigation-entry-grid.component-mpK9Ar08.mjs} +387 -183
  87. package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-BPgH7FJk.mjs +650 -0
  88. package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-DMpYcD9t.mjs +662 -0
  89. package/fesm2022/ojiepermana-angular-navigation-navigation-item.component-Basp5SIk.mjs +1228 -0
  90. package/fesm2022/ojiepermana-angular-navigation-navigation-list.component-YUzHI9Pj.mjs +311 -0
  91. package/fesm2022/ojiepermana-angular-navigation-service.mjs +542 -724
  92. package/fesm2022/ojiepermana-angular-navigation-types.mjs +27 -56
  93. package/fesm2022/ojiepermana-angular-navigation.mjs +3052 -4
  94. package/fesm2022/ojiepermana-angular-sdk.mjs +91 -201
  95. package/fesm2022/ojiepermana-angular-theme-component-settings.mjs +1115 -737
  96. package/fesm2022/ojiepermana-angular-theme-layout-services.mjs +245 -328
  97. package/fesm2022/ojiepermana-angular-theme-layout-types.mjs +35 -38
  98. package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +1719 -552
  99. package/fesm2022/ojiepermana-angular-theme-layout.mjs +847 -491
  100. package/fesm2022/ojiepermana-angular-theme-page-core.mjs +288 -358
  101. package/fesm2022/ojiepermana-angular-theme-page-filter.mjs +362 -224
  102. package/fesm2022/ojiepermana-angular-theme-page-overview.mjs +88 -0
  103. package/fesm2022/ojiepermana-angular-theme-page-root.mjs +576 -254
  104. package/fesm2022/ojiepermana-angular-theme-page-side.mjs +317 -177
  105. package/fesm2022/ojiepermana-angular-theme-page-slots.mjs +256 -112
  106. package/fesm2022/ojiepermana-angular-theme-page.mjs +7 -12
  107. package/fesm2022/ojiepermana-angular-theme-shell-services.mjs +215 -326
  108. package/fesm2022/ojiepermana-angular-theme-shell-types.mjs +68 -129
  109. package/fesm2022/ojiepermana-angular-theme-shell.mjs +907 -378
  110. package/fesm2022/ojiepermana-angular-theme-styles.mjs +521 -720
  111. package/fesm2022/ojiepermana-angular-theme.mjs +0 -10
  112. package/fesm2022/ojiepermana-angular.mjs +5 -24
  113. package/navigation/README.md +1 -1
  114. package/package.json +16 -12
  115. package/sdk/README.md +1 -1
  116. package/sdk/src/writer/index.js +2 -2
  117. package/theme/README.md +1 -1
  118. package/theme/layout/README.md +2 -4
  119. package/theme/page/README.md +50 -0
  120. package/theme/styles/README.md +10 -10
  121. package/theme/styles/css/base/prefers-dark.css +1 -1
  122. package/theme/styles/css/base/status.css +1 -1
  123. package/theme/styles/css/color/amber.css +1 -1
  124. package/theme/styles/css/color/blue.css +1 -1
  125. package/theme/styles/css/color/cyan.css +1 -1
  126. package/theme/styles/css/color/emerald.css +1 -1
  127. package/theme/styles/css/color/fuchsia.css +1 -1
  128. package/theme/styles/css/color/green.css +1 -1
  129. package/theme/styles/css/color/indigo.css +1 -1
  130. package/theme/styles/css/color/lime.css +1 -1
  131. package/theme/styles/css/color/orange.css +1 -1
  132. package/theme/styles/css/color/pink.css +1 -1
  133. package/theme/styles/css/color/purple.css +1 -1
  134. package/theme/styles/css/color/red.css +1 -1
  135. package/theme/styles/css/color/rose.css +1 -1
  136. package/theme/styles/css/color/sky.css +1 -1
  137. package/theme/styles/css/color/teal.css +1 -1
  138. package/theme/styles/css/color/violet.css +1 -1
  139. package/theme/styles/css/color/yellow.css +1 -1
  140. package/theme/styles/css/neutral/gray.css +1 -1
  141. package/theme/styles/css/neutral/mauve.css +1 -1
  142. package/theme/styles/css/neutral/mist.css +1 -1
  143. package/theme/styles/css/neutral/neutral.css +1 -1
  144. package/theme/styles/css/neutral/olive.css +1 -1
  145. package/theme/styles/css/neutral/slate.css +1 -1
  146. package/theme/styles/css/neutral/stone.css +1 -1
  147. package/theme/styles/css/neutral/taupe.css +1 -1
  148. package/theme/styles/css/neutral/zinc.css +1 -1
  149. package/types/ojiepermana-angular-chart-area.d.ts +126 -63
  150. package/types/ojiepermana-angular-chart-bar.d.ts +244 -154
  151. package/types/ojiepermana-angular-chart-core.d.ts +409 -398
  152. package/types/ojiepermana-angular-chart-line.d.ts +141 -68
  153. package/types/ojiepermana-angular-chart-pie.d.ts +192 -121
  154. package/types/ojiepermana-angular-chart-primitives.d.ts +283 -214
  155. package/types/ojiepermana-angular-chart-radar.d.ts +189 -108
  156. package/types/ojiepermana-angular-chart-radial.d.ts +177 -106
  157. package/types/ojiepermana-angular-chart-scatter.d.ts +166 -110
  158. package/types/ojiepermana-angular-chart.d.ts +3 -2
  159. package/types/ojiepermana-angular-component-accordion.d.ts +135 -81
  160. package/types/ojiepermana-angular-component-alert-dialog.d.ts +271 -123
  161. package/types/ojiepermana-angular-component-alert.d.ts +69 -39
  162. package/types/ojiepermana-angular-component-aspect-ratio.d.ts +20 -12
  163. package/types/ojiepermana-angular-component-avatar.d.ts +103 -49
  164. package/types/ojiepermana-angular-component-badge.d.ts +36 -24
  165. package/types/ojiepermana-angular-component-breadcrumb.d.ts +79 -40
  166. package/types/ojiepermana-angular-component-button-group.d.ts +48 -24
  167. package/types/ojiepermana-angular-component-button.d.ts +44 -27
  168. package/types/ojiepermana-angular-component-calendar.d.ts +145 -107
  169. package/types/ojiepermana-angular-component-card.d.ts +112 -63
  170. package/types/ojiepermana-angular-component-carousel.d.ts +150 -81
  171. package/types/ojiepermana-angular-component-checkbox.d.ts +96 -38
  172. package/types/ojiepermana-angular-component-collapsible.d.ts +65 -39
  173. package/types/ojiepermana-angular-component-combobox.d.ts +100 -55
  174. package/types/ojiepermana-angular-component-command.d.ts +206 -121
  175. package/types/ojiepermana-angular-component-composer.d.ts +184 -84
  176. package/types/ojiepermana-angular-component-context-menu.d.ts +51 -41
  177. package/types/ojiepermana-angular-component-date-picker.d.ts +199 -109
  178. package/types/ojiepermana-angular-component-dialog.d.ts +200 -105
  179. package/types/ojiepermana-angular-component-drawer.d.ts +2 -1
  180. package/types/ojiepermana-angular-component-dropdown-menu.d.ts +324 -202
  181. package/types/ojiepermana-angular-component-editor.d.ts +215 -117
  182. package/types/ojiepermana-angular-component-empty.d.ts +80 -45
  183. package/types/ojiepermana-angular-component-form.d.ts +185 -121
  184. package/types/ojiepermana-angular-component-hover-card.d.ts +130 -72
  185. package/types/ojiepermana-angular-component-icon.d.ts +87 -57
  186. package/types/ojiepermana-angular-component-input-group.d.ts +93 -46
  187. package/types/ojiepermana-angular-component-input-otp.d.ts +243 -150
  188. package/types/ojiepermana-angular-component-input.d.ts +27 -17
  189. package/types/ojiepermana-angular-component-item.d.ts +160 -84
  190. package/types/ojiepermana-angular-component-kanban.d.ts +157 -62
  191. package/types/ojiepermana-angular-component-kbd.d.ts +24 -15
  192. package/types/ojiepermana-angular-component-label.d.ts +19 -11
  193. package/types/ojiepermana-angular-component-menubar.d.ts +120 -90
  194. package/types/ojiepermana-angular-component-native-select.d.ts +37 -24
  195. package/types/ojiepermana-angular-component-navigation-menu.d.ts +157 -98
  196. package/types/ojiepermana-angular-component-pagination.d.ts +78 -28
  197. package/types/ojiepermana-angular-component-pillbox.d.ts +361 -204
  198. package/types/ojiepermana-angular-component-popover.d.ts +94 -64
  199. package/types/ojiepermana-angular-component-progress.d.ts +45 -17
  200. package/types/ojiepermana-angular-component-radio.d.ts +129 -53
  201. package/types/ojiepermana-angular-component-resizable.d.ts +160 -112
  202. package/types/ojiepermana-angular-component-scroll-area.d.ts +33 -15
  203. package/types/ojiepermana-angular-component-segmented-control.d.ts +94 -50
  204. package/types/ojiepermana-angular-component-select.d.ts +94 -77
  205. package/types/ojiepermana-angular-component-separator.d.ts +26 -14
  206. package/types/ojiepermana-angular-component-sheet.d.ts +226 -116
  207. package/types/ojiepermana-angular-component-skeleton.d.ts +13 -10
  208. package/types/ojiepermana-angular-component-slider.d.ts +140 -75
  209. package/types/ojiepermana-angular-component-spinner.d.ts +31 -13
  210. package/types/ojiepermana-angular-component-switch.d.ts +97 -40
  211. package/types/ojiepermana-angular-component-table.d.ts +102 -50
  212. package/types/ojiepermana-angular-component-tabs.d.ts +174 -115
  213. package/types/ojiepermana-angular-component-textarea.d.ts +27 -17
  214. package/types/ojiepermana-angular-component-timeline.d.ts +141 -59
  215. package/types/ojiepermana-angular-component-toast.d.ts +51 -55
  216. package/types/ojiepermana-angular-component-toggle-group.d.ts +159 -88
  217. package/types/ojiepermana-angular-component-toggle.d.ts +47 -25
  218. package/types/ojiepermana-angular-component-tooltip.d.ts +222 -132
  219. package/types/ojiepermana-angular-component-utils-core.d.ts +81 -90
  220. package/types/ojiepermana-angular-component-utils-overlay.d.ts +7 -11
  221. package/types/ojiepermana-angular-component-utils-scale.d.ts +20 -12
  222. package/types/ojiepermana-angular-component-utils.d.ts +2 -2
  223. package/types/ojiepermana-angular-component.d.ts +1 -2
  224. package/types/ojiepermana-angular-navigation-core.d.ts +46 -50
  225. package/types/ojiepermana-angular-navigation-icon.d.ts +9 -12
  226. package/types/ojiepermana-angular-navigation-service.d.ts +112 -115
  227. package/types/ojiepermana-angular-navigation-types.d.ts +121 -125
  228. package/types/ojiepermana-angular-navigation.d.ts +663 -374
  229. package/types/ojiepermana-angular-sdk.d.ts +69 -71
  230. package/types/ojiepermana-angular-theme-component-settings.d.ts +115 -83
  231. package/types/ojiepermana-angular-theme-layout-services.d.ts +119 -124
  232. package/types/ojiepermana-angular-theme-layout-types.d.ts +27 -31
  233. package/types/ojiepermana-angular-theme-layout-wrapper.d.ts +399 -187
  234. package/types/ojiepermana-angular-theme-layout.d.ts +201 -112
  235. package/types/ojiepermana-angular-theme-page-core.d.ts +136 -142
  236. package/types/ojiepermana-angular-theme-page-filter.d.ts +112 -62
  237. package/types/ojiepermana-angular-theme-page-overview.d.ts +28 -0
  238. package/types/ojiepermana-angular-theme-page-root.d.ts +172 -88
  239. package/types/ojiepermana-angular-theme-page-side.d.ts +89 -49
  240. package/types/ojiepermana-angular-theme-page-slots.d.ts +58 -37
  241. package/types/ojiepermana-angular-theme-page.d.ts +7 -5
  242. package/types/ojiepermana-angular-theme-shell-services.d.ts +119 -125
  243. package/types/ojiepermana-angular-theme-shell-types.d.ts +38 -41
  244. package/types/ojiepermana-angular-theme-shell.d.ts +139 -61
  245. package/types/ojiepermana-angular-theme-styles.d.ts +184 -196
  246. package/types/ojiepermana-angular-theme.d.ts +1 -2
  247. package/types/ojiepermana-angular.d.ts +5 -5
  248. package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-CDBxQ8rk.mjs +0 -91
  249. package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-DBQHdvGa.mjs +0 -512
  250. package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-BCGvhoYj.mjs +0 -404
  251. package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-Dk_03e-6.mjs +0 -466
  252. package/fesm2022/ojiepermana-angular-navigation-ojiepermana-angular-navigation-DNKU6viC.mjs +0 -2642
@@ -1,524 +1,547 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, input, output, computed, Component } from '@angular/core';
3
- import { resolveSeriesColor, seriesColorVar, readNumber, zeroBaselineDomain, ChartContext, CartesianContext, ChartThemeRadius, resolveChartStyle, ChartThemeSpace, resolveChartMargin, DEFAULT_CARTESIAN_MARGIN_UNITS, setupCartesianChart, ChartRovingFocus, ChartMarkFocus, ChartDataTable } from '@ojiepermana/angular/chart/core';
4
- import { scaleBand, scaleLinear } from 'd3-scale';
5
- import { min, max } from 'd3-array';
6
- import { stack } from 'd3-shape';
7
- import { ChartPointerTracker } from '@ojiepermana/angular/chart/primitives';
8
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, computed, inject, input, output } from "@angular/core";
3
+ import { CartesianContext, ChartContext, ChartDataTable, ChartMarkFocus, ChartRovingFocus, ChartThemeRadius, ChartThemeSpace, DEFAULT_CARTESIAN_MARGIN_UNITS, readNumber, resolveChartMargin, resolveChartStyle, resolveSeriesColor, seriesColorVar, setupCartesianChart, zeroBaselineDomain } from "@ojiepermana/angular/chart/core";
4
+ import { scaleBand, scaleLinear } from "d3-scale";
5
+ import { max, min } from "d3-array";
6
+ import { stack } from "d3-shape";
7
+ import { ChartPointerTracker } from "@ojiepermana/angular/chart/primitives";
9
8
  function resolveBarColor(datum, seriesKey, colorKey) {
10
- return resolveSeriesColor(colorKey ? datum[colorKey] : undefined, seriesColorVar(seriesKey));
9
+ return resolveSeriesColor(colorKey ? datum[colorKey] : void 0, seriesColorVar(seriesKey));
11
10
  }
12
11
  function isActiveBar(datum, activeKey, activeValue) {
13
- if (!activeKey || activeValue === undefined) {
14
- return false;
15
- }
16
- const value = datum[activeKey];
17
- if (typeof value === 'number' && typeof activeValue === 'number') {
18
- return value === activeValue;
19
- }
20
- return String(value ?? '') === String(activeValue);
12
+ if (!activeKey || activeValue === void 0) return false;
13
+ const value = datum[activeKey];
14
+ if (typeof value === "number" && typeof activeValue === "number") return value === activeValue;
15
+ return String(value ?? "") === String(activeValue);
21
16
  }
22
- /** Build all bar rectangles for the given config. */
23
17
  function computeBarLayout(input) {
24
- const { data, xKey, seriesKeys, variant, orientation, innerWidth, innerHeight, bandPadding, groupPadding, colorKey, activeKey, activeValue, } = input;
25
- const categories = data.map((d) => String(d[xKey] ?? ''));
26
- const isVertical = orientation === 'vertical';
27
- const categoryScale = scaleBand()
28
- .domain(categories)
29
- .range(isVertical ? [0, innerWidth] : [0, innerHeight])
30
- .padding(bandPadding);
31
- const valueScale = scaleLinear();
32
- if (variant === 'stacked' && seriesKeys.length > 0) {
33
- return stackedLayout({
34
- data,
35
- xKey,
36
- seriesKeys,
37
- orientation,
38
- innerWidth,
39
- innerHeight,
40
- categoryScale,
41
- valueScale,
42
- categories,
43
- colorKey,
44
- activeKey,
45
- activeValue,
46
- });
47
- }
48
- return groupedLayout({
49
- data,
50
- xKey,
51
- seriesKeys,
52
- orientation,
53
- innerWidth,
54
- innerHeight,
55
- categoryScale,
56
- valueScale,
57
- groupPadding,
58
- categories,
59
- colorKey,
60
- activeKey,
61
- activeValue,
62
- });
18
+ const { data, xKey, seriesKeys, variant, orientation, innerWidth, innerHeight, bandPadding, groupPadding, colorKey, activeKey, activeValue } = input;
19
+ const categories = data.map((d) => String(d[xKey] ?? ""));
20
+ const isVertical = orientation === "vertical";
21
+ const categoryScale = scaleBand().domain(categories).range(isVertical ? [0, innerWidth] : [0, innerHeight]).padding(bandPadding);
22
+ const valueScale = scaleLinear();
23
+ if (variant === "stacked" && seriesKeys.length > 0) return stackedLayout({
24
+ data,
25
+ xKey,
26
+ seriesKeys,
27
+ orientation,
28
+ innerWidth,
29
+ innerHeight,
30
+ categoryScale,
31
+ valueScale,
32
+ categories,
33
+ colorKey,
34
+ activeKey,
35
+ activeValue
36
+ });
37
+ return groupedLayout({
38
+ data,
39
+ xKey,
40
+ seriesKeys,
41
+ orientation,
42
+ innerWidth,
43
+ innerHeight,
44
+ categoryScale,
45
+ valueScale,
46
+ groupPadding,
47
+ categories,
48
+ colorKey,
49
+ activeKey,
50
+ activeValue
51
+ });
63
52
  }
64
53
  function groupedLayout(input) {
65
- const { data, seriesKeys, orientation, innerWidth, innerHeight, categoryScale, valueScale, groupPadding, categories, colorKey, activeKey, activeValue, } = input;
66
- const isVertical = orientation === 'vertical';
67
- const minValue = min(data, (d) => min(seriesKeys, (k) => readNumber(d, k)) ?? 0) ?? 0;
68
- const maxValue = max(data, (d) => max(seriesKeys, (k) => readNumber(d, k)) ?? 0) ?? 0;
69
- const [domainMin, domainMax] = zeroBaselineDomain(minValue, maxValue);
70
- valueScale
71
- .domain([domainMin, domainMax])
72
- .nice()
73
- .range(isVertical ? [innerHeight, 0] : [0, innerWidth]);
74
- const baseline = valueScale(0);
75
- const subScale = scaleBand()
76
- .domain(seriesKeys)
77
- .range([0, categoryScale.bandwidth()])
78
- .padding(groupPadding);
79
- const bars = [];
80
- data.forEach((datum, datumIndex) => {
81
- const category = categories[datumIndex];
82
- const bandStart = categoryScale(category) ?? 0;
83
- seriesKeys.forEach((seriesKey) => {
84
- const value = readNumber(datum, seriesKey);
85
- const sub = subScale(seriesKey) ?? 0;
86
- const scaledValue = valueScale(value);
87
- const color = resolveBarColor(datum, seriesKey, colorKey);
88
- const active = isActiveBar(datum, activeKey, activeValue);
89
- const rect = isVertical
90
- ? {
91
- key: `${datumIndex}-${seriesKey}`,
92
- seriesKey,
93
- datumIndex,
94
- category,
95
- value,
96
- x: bandStart + sub,
97
- y: Math.min(scaledValue, baseline),
98
- width: subScale.bandwidth(),
99
- height: Math.abs(baseline - scaledValue),
100
- color,
101
- active,
102
- }
103
- : {
104
- key: `${datumIndex}-${seriesKey}`,
105
- seriesKey,
106
- datumIndex,
107
- category,
108
- value,
109
- x: Math.min(scaledValue, baseline),
110
- y: bandStart + sub,
111
- width: Math.abs(baseline - scaledValue),
112
- height: subScale.bandwidth(),
113
- color,
114
- active,
115
- };
116
- bars.push(rect);
117
- });
118
- });
119
- return { bars, categoryScale, valueScale, categories };
54
+ const { data, seriesKeys, orientation, innerWidth, innerHeight, categoryScale, valueScale, groupPadding, categories, colorKey, activeKey, activeValue } = input;
55
+ const isVertical = orientation === "vertical";
56
+ const minValue = min(data, (d) => min(seriesKeys, (k) => readNumber(d, k)) ?? 0) ?? 0;
57
+ const maxValue = max(data, (d) => max(seriesKeys, (k) => readNumber(d, k)) ?? 0) ?? 0;
58
+ const [domainMin, domainMax] = zeroBaselineDomain(minValue, maxValue);
59
+ valueScale.domain([domainMin, domainMax]).nice().range(isVertical ? [innerHeight, 0] : [0, innerWidth]);
60
+ const baseline = valueScale(0);
61
+ const subScale = scaleBand().domain(seriesKeys).range([0, categoryScale.bandwidth()]).padding(groupPadding);
62
+ const bars = [];
63
+ data.forEach((datum, datumIndex) => {
64
+ const category = categories[datumIndex];
65
+ const bandStart = categoryScale(category) ?? 0;
66
+ seriesKeys.forEach((seriesKey) => {
67
+ const value = readNumber(datum, seriesKey);
68
+ const sub = subScale(seriesKey) ?? 0;
69
+ const scaledValue = valueScale(value);
70
+ const color = resolveBarColor(datum, seriesKey, colorKey);
71
+ const active = isActiveBar(datum, activeKey, activeValue);
72
+ const rect = isVertical ? {
73
+ key: `${datumIndex}-${seriesKey}`,
74
+ seriesKey,
75
+ datumIndex,
76
+ category,
77
+ value,
78
+ x: bandStart + sub,
79
+ y: Math.min(scaledValue, baseline),
80
+ width: subScale.bandwidth(),
81
+ height: Math.abs(baseline - scaledValue),
82
+ color,
83
+ active
84
+ } : {
85
+ key: `${datumIndex}-${seriesKey}`,
86
+ seriesKey,
87
+ datumIndex,
88
+ category,
89
+ value,
90
+ x: Math.min(scaledValue, baseline),
91
+ y: bandStart + sub,
92
+ width: Math.abs(baseline - scaledValue),
93
+ height: subScale.bandwidth(),
94
+ color,
95
+ active
96
+ };
97
+ bars.push(rect);
98
+ });
99
+ });
100
+ return {
101
+ bars,
102
+ categoryScale,
103
+ valueScale,
104
+ categories
105
+ };
120
106
  }
121
107
  function stackedLayout(input) {
122
- const { data, seriesKeys, orientation, innerWidth, innerHeight, categoryScale, valueScale, categories, colorKey, activeKey, activeValue, } = input;
123
- const isVertical = orientation === 'vertical';
124
- const normalized = data.map((d) => {
125
- const out = {};
126
- for (const k of seriesKeys) {
127
- out[k] = readNumber(d, k);
128
- }
129
- return out;
130
- });
131
- const series = stack().keys(seriesKeys)(normalized);
132
- // Every layer is measured, not just the last one: a stack that runs below the
133
- // baseline puts its extreme on whichever layer carries the negative values.
134
- const minTotal = min(series, (layer) => min(layer, (p) => Math.min(p[0], p[1]))) ?? 0;
135
- const maxTotal = max(series, (layer) => max(layer, (p) => Math.max(p[0], p[1]))) ?? 0;
136
- const [domainMin, domainMax] = zeroBaselineDomain(minTotal, maxTotal);
137
- valueScale
138
- .domain([domainMin, domainMax])
139
- .nice()
140
- .range(isVertical ? [innerHeight, 0] : [0, innerWidth]);
141
- const bars = [];
142
- series.forEach((layer) => {
143
- const seriesKey = layer.key;
144
- layer.forEach((point, datumIndex) => {
145
- const [lower, upper] = point;
146
- const value = upper - lower;
147
- const category = categories[datumIndex];
148
- const bandStart = categoryScale(category) ?? 0;
149
- const color = resolveBarColor(data[datumIndex], seriesKey, colorKey);
150
- const active = isActiveBar(data[datumIndex], activeKey, activeValue);
151
- // A negative segment stacks downward, so `upper` lands on the far side of
152
- // the baseline from `lower`. Taking the near edge and the absolute span
153
- // keeps the rectangle drawable whichever way round the pair sits.
154
- const lowerCoord = valueScale(lower);
155
- const upperCoord = valueScale(upper);
156
- const span = Math.abs(upperCoord - lowerCoord);
157
- const rect = isVertical
158
- ? {
159
- key: `${datumIndex}-${seriesKey}`,
160
- seriesKey,
161
- datumIndex,
162
- category,
163
- value,
164
- x: bandStart,
165
- y: Math.min(lowerCoord, upperCoord),
166
- width: categoryScale.bandwidth(),
167
- height: span,
168
- color,
169
- active,
170
- }
171
- : {
172
- key: `${datumIndex}-${seriesKey}`,
173
- seriesKey,
174
- datumIndex,
175
- category,
176
- value,
177
- x: Math.min(lowerCoord, upperCoord),
178
- y: bandStart,
179
- width: span,
180
- height: categoryScale.bandwidth(),
181
- color,
182
- active,
183
- };
184
- bars.push(rect);
185
- });
186
- });
187
- return { bars, categoryScale, valueScale, categories };
108
+ const { data, seriesKeys, orientation, innerWidth, innerHeight, categoryScale, valueScale, categories, colorKey, activeKey, activeValue } = input;
109
+ const isVertical = orientation === "vertical";
110
+ const normalized = data.map((d) => {
111
+ const out = {};
112
+ for (const k of seriesKeys) out[k] = readNumber(d, k);
113
+ return out;
114
+ });
115
+ const series = stack().keys(seriesKeys)(normalized);
116
+ const minTotal = min(series, (layer) => min(layer, (p) => Math.min(p[0], p[1]))) ?? 0;
117
+ const maxTotal = max(series, (layer) => max(layer, (p) => Math.max(p[0], p[1]))) ?? 0;
118
+ const [domainMin, domainMax] = zeroBaselineDomain(minTotal, maxTotal);
119
+ valueScale.domain([domainMin, domainMax]).nice().range(isVertical ? [innerHeight, 0] : [0, innerWidth]);
120
+ const bars = [];
121
+ series.forEach((layer) => {
122
+ const seriesKey = layer.key;
123
+ layer.forEach((point, datumIndex) => {
124
+ const [lower, upper] = point;
125
+ const value = upper - lower;
126
+ const category = categories[datumIndex];
127
+ const bandStart = categoryScale(category) ?? 0;
128
+ const color = resolveBarColor(data[datumIndex], seriesKey, colorKey);
129
+ const active = isActiveBar(data[datumIndex], activeKey, activeValue);
130
+ const lowerCoord = valueScale(lower);
131
+ const upperCoord = valueScale(upper);
132
+ const span = Math.abs(upperCoord - lowerCoord);
133
+ const rect = isVertical ? {
134
+ key: `${datumIndex}-${seriesKey}`,
135
+ seriesKey,
136
+ datumIndex,
137
+ category,
138
+ value,
139
+ x: bandStart,
140
+ y: Math.min(lowerCoord, upperCoord),
141
+ width: categoryScale.bandwidth(),
142
+ height: span,
143
+ color,
144
+ active
145
+ } : {
146
+ key: `${datumIndex}-${seriesKey}`,
147
+ seriesKey,
148
+ datumIndex,
149
+ category,
150
+ value,
151
+ x: Math.min(lowerCoord, upperCoord),
152
+ y: bandStart,
153
+ width: span,
154
+ height: categoryScale.bandwidth(),
155
+ color,
156
+ active
157
+ };
158
+ bars.push(rect);
159
+ });
160
+ });
161
+ return {
162
+ bars,
163
+ categoryScale,
164
+ valueScale,
165
+ categories
166
+ };
188
167
  }
189
-
190
- /** Hard cap so degenerate inputs (tiny `dotSize`) cannot explode the DOM. */
191
168
  const MAX_ROWS_PER_COLUMN = 400;
192
- const EDGE_TOLERANCE = 0.5;
193
- /**
194
- * Build the dot-matrix cells for the `dot` bar style.
195
- *
196
- * Cells tile a global grid anchored at the value baseline, so stacked
197
- * segments snap to the same rows and never overlap. A bar fills every cell
198
- * whose center lies inside its value range; bars too short to cover a center
199
- * still claim the cell nearest their midpoint when it is free.
200
- */
169
+ const EDGE_TOLERANCE = .5;
201
170
  function computeBarDotCells(input) {
202
- const { bars, orientation, innerWidth, innerHeight, baseline, dotSize, dotGap } = input;
203
- const isVertical = orientation === 'vertical';
204
- const innerLength = isVertical ? innerHeight : innerWidth;
205
- const track = [];
206
- const values = [];
207
- if (innerLength <= 0 || bars.length === 0) {
208
- return { track, values };
209
- }
210
- const columns = groupColumns(bars, isVertical);
211
- columns.forEach((column, columnIndex) => {
212
- const cellLength = dotSize ?? column.thickness;
213
- const step = cellLength + dotGap;
214
- if (cellLength <= 0 || step <= EDGE_TOLERANCE) {
215
- return;
216
- }
217
- // Signed row index r anchored at the baseline: r = 0 is the first cell on
218
- // the positive-value side, negative r tiles the negative side.
219
- // `rowStart(r)` is the cell's lower main-axis coordinate (top edge for
220
- // vertical, left edge for horizontal); `rowAt(c)` is the fractional row
221
- // whose cell center sits at coordinate c.
222
- const rowStart = (r) => isVertical ? baseline - r * step - cellLength : baseline + r * step;
223
- const rowAt = (c) => isVertical ? (baseline - c - cellLength / 2) / step : (c - baseline - cellLength / 2) / step;
224
- // Rows whose cell lies fully inside the plot area.
225
- const rMin = Math.ceil(isVertical
226
- ? (baseline - innerLength - EDGE_TOLERANCE) / step
227
- : (-baseline - EDGE_TOLERANCE) / step);
228
- let rMax = Math.floor(isVertical
229
- ? (baseline - cellLength + EDGE_TOLERANCE) / step
230
- : (innerLength - baseline - cellLength + EDGE_TOLERANCE) / step);
231
- if (rMax - rMin + 1 > MAX_ROWS_PER_COLUMN) {
232
- rMax = rMin + MAX_ROWS_PER_COLUMN - 1;
233
- }
234
- const cellRect = (r) => isVertical
235
- ? { x: column.pos, y: rowStart(r), width: column.thickness, height: cellLength }
236
- : { x: rowStart(r), y: column.pos, width: cellLength, height: column.thickness };
237
- for (let r = rMin; r <= rMax; r++) {
238
- track.push({ key: `${columnIndex}:${r}`, ...cellRect(r) });
239
- }
240
- const usedRows = new Set();
241
- for (const bar of column.bars) {
242
- const barLength = isVertical ? bar.height : bar.width;
243
- if (barLength <= EDGE_TOLERANCE) {
244
- continue;
245
- }
246
- const barStart = isVertical ? bar.y : bar.x;
247
- const barEnd = barStart + barLength;
248
- // Rows whose cell center falls inside [barStart, barEnd] (± tolerance).
249
- const rA = rowAt(barStart);
250
- const rB = rowAt(barEnd);
251
- const first = Math.max(Math.ceil(Math.min(rA, rB) - EDGE_TOLERANCE / step), rMin);
252
- const last = Math.min(Math.floor(Math.max(rA, rB) + EDGE_TOLERANCE / step), rMax);
253
- const rows = [];
254
- for (let r = first; r <= last; r++) {
255
- rows.push(r);
256
- }
257
- // Guarantee visibility: a non-zero bar shorter than one cell claims the
258
- // row nearest its midpoint when that row is still free.
259
- if (rows.length === 0) {
260
- const r = Math.round(rowAt(barStart + barLength / 2));
261
- if (r >= rMin && r <= rMax && !usedRows.has(r)) {
262
- rows.push(r);
263
- }
264
- }
265
- for (const r of rows) {
266
- if (usedRows.has(r)) {
267
- continue;
268
- }
269
- usedRows.add(r);
270
- values.push({
271
- key: `${bar.key}:${r}`,
272
- ...cellRect(r),
273
- seriesKey: bar.seriesKey,
274
- datumIndex: bar.datumIndex,
275
- color: bar.color,
276
- active: bar.active,
277
- });
278
- }
279
- }
280
- });
281
- return { track, values };
171
+ const { bars, orientation, innerWidth, innerHeight, baseline, dotSize, dotGap } = input;
172
+ const isVertical = orientation === "vertical";
173
+ const innerLength = isVertical ? innerHeight : innerWidth;
174
+ const track = [];
175
+ const values = [];
176
+ if (innerLength <= 0 || bars.length === 0) return {
177
+ track,
178
+ values
179
+ };
180
+ groupColumns(bars, isVertical).forEach((column, columnIndex) => {
181
+ const cellLength = dotSize ?? column.thickness;
182
+ const step = cellLength + dotGap;
183
+ if (cellLength <= 0 || step <= EDGE_TOLERANCE) return;
184
+ const rowStart = (r) => isVertical ? baseline - r * step - cellLength : baseline + r * step;
185
+ const rowAt = (c) => isVertical ? (baseline - c - cellLength / 2) / step : (c - baseline - cellLength / 2) / step;
186
+ const rMin = Math.ceil(isVertical ? (baseline - innerLength - EDGE_TOLERANCE) / step : (-baseline - EDGE_TOLERANCE) / step);
187
+ let rMax = Math.floor(isVertical ? (baseline - cellLength + EDGE_TOLERANCE) / step : (innerLength - baseline - cellLength + EDGE_TOLERANCE) / step);
188
+ if (rMax - rMin + 1 > MAX_ROWS_PER_COLUMN) rMax = rMin + MAX_ROWS_PER_COLUMN - 1;
189
+ const cellRect = (r) => isVertical ? {
190
+ x: column.pos,
191
+ y: rowStart(r),
192
+ width: column.thickness,
193
+ height: cellLength
194
+ } : {
195
+ x: rowStart(r),
196
+ y: column.pos,
197
+ width: cellLength,
198
+ height: column.thickness
199
+ };
200
+ for (let r = rMin; r <= rMax; r++) track.push({
201
+ key: `${columnIndex}:${r}`,
202
+ ...cellRect(r)
203
+ });
204
+ const usedRows = /* @__PURE__ */ new Set();
205
+ for (const bar of column.bars) {
206
+ const barLength = isVertical ? bar.height : bar.width;
207
+ if (barLength <= EDGE_TOLERANCE) continue;
208
+ const barStart = isVertical ? bar.y : bar.x;
209
+ const barEnd = barStart + barLength;
210
+ const rA = rowAt(barStart);
211
+ const rB = rowAt(barEnd);
212
+ const first = Math.max(Math.ceil(Math.min(rA, rB) - EDGE_TOLERANCE / step), rMin);
213
+ const last = Math.min(Math.floor(Math.max(rA, rB) + EDGE_TOLERANCE / step), rMax);
214
+ const rows = [];
215
+ for (let r = first; r <= last; r++) rows.push(r);
216
+ if (rows.length === 0) {
217
+ const r = Math.round(rowAt(barStart + barLength / 2));
218
+ if (r >= rMin && r <= rMax && !usedRows.has(r)) rows.push(r);
219
+ }
220
+ for (const r of rows) {
221
+ if (usedRows.has(r)) continue;
222
+ usedRows.add(r);
223
+ values.push({
224
+ key: `${bar.key}:${r}`,
225
+ ...cellRect(r),
226
+ seriesKey: bar.seriesKey,
227
+ datumIndex: bar.datumIndex,
228
+ color: bar.color,
229
+ active: bar.active
230
+ });
231
+ }
232
+ }
233
+ });
234
+ return {
235
+ track,
236
+ values
237
+ };
282
238
  }
283
- /** Group bars sharing the same cross-axis band into one cell column. */
284
239
  function groupColumns(bars, isVertical) {
285
- const map = new Map();
286
- for (const bar of bars) {
287
- const pos = isVertical ? bar.x : bar.y;
288
- const thickness = isVertical ? bar.width : bar.height;
289
- if (thickness <= 0) {
290
- continue;
291
- }
292
- const key = `${pos.toFixed(2)}:${thickness.toFixed(2)}`;
293
- const existing = map.get(key);
294
- if (existing) {
295
- existing.bars.push(bar);
296
- }
297
- else {
298
- map.set(key, { pos, thickness, bars: [bar] });
299
- }
300
- }
301
- return [...map.values()];
240
+ const map = /* @__PURE__ */ new Map();
241
+ for (const bar of bars) {
242
+ const pos = isVertical ? bar.x : bar.y;
243
+ const thickness = isVertical ? bar.width : bar.height;
244
+ if (thickness <= 0) continue;
245
+ const key = `${pos.toFixed(2)}:${thickness.toFixed(2)}`;
246
+ const existing = map.get(key);
247
+ if (existing) existing.bars.push(bar);
248
+ else map.set(key, {
249
+ pos,
250
+ thickness,
251
+ bars: [bar]
252
+ });
253
+ }
254
+ return [...map.values()];
302
255
  }
303
-
304
256
  const defaultBarValueFormatter = (value) => `${value}`;
305
- /**
306
- * Bar chart — composable within `<Chart>`.
307
- *
308
- * Layout variants (via inputs):
309
- * - `orientation`: `'vertical'` (default) or `'horizontal'`
310
- * - `variant`: `'grouped'` (default) or `'stacked'`
311
- * - `styles`: `'base'` (default) or `'dot'` (dot-matrix cells)
312
- */
313
- class BarChart {
314
- root = inject(ChartContext);
315
- cart = inject(CartesianContext);
316
- themeRadius = inject(ChartThemeRadius);
317
- data = input.required(/* @ts-ignore */
318
- ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
319
- xKey = input.required(/* @ts-ignore */
320
- ...(ngDevMode ? [{ debugName: "xKey" }] : /* istanbul ignore next */ []));
321
- orientation = input('vertical', /* @ts-ignore */
322
- ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
323
- variant = input('grouped', /* @ts-ignore */
324
- ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
325
- /**
326
- * Presentational style of the chart.
327
- *
328
- * Replaces `styles`, which read like a CSS styles bag rather than a single
329
- * variant. Named `styleVariant` and not `variant` because `ChartBar` already
330
- * publishes a `variant` input for its grouped versus stacked axis, and one
331
- * name cannot mean two things across the family.
332
- */
333
- styleVariant = input(undefined, /* @ts-ignore */
334
- ...(ngDevMode ? [{ debugName: "styleVariant" }] : /* istanbul ignore next */ []));
335
- /**
336
- * @deprecated Use `styleVariant`. Still fully supported; when both are bound,
337
- * `styleVariant` wins. Due for removal in the next major.
338
- */
339
- styles = input('base', /* @ts-ignore */
340
- ...(ngDevMode ? [{ debugName: "styles" }] : /* istanbul ignore next */ []));
341
- /** The style actually in effect. Bind this, never `styles()`. */
342
- chartStyle = resolveChartStyle(this.styleVariant, this.styles);
343
- themeSpace = inject(ChartThemeSpace);
344
- /**
345
- * Plot gutters. Leave it unset and they follow the theme-space density
346
- * axis; set it and your numbers win, unchanged, whatever the axis says.
347
- */
348
- margin = input(null, /* @ts-ignore */
349
- ...(ngDevMode ? [{ debugName: "margin" }] : /* istanbul ignore next */ []));
350
- /** The margin actually in effect. Bind this, never `margin()`. */
351
- plotMargin = resolveChartMargin(this.margin, DEFAULT_CARTESIAN_MARGIN_UNITS, this.themeSpace);
352
- bandPadding = input(0.2, /* @ts-ignore */
353
- ...(ngDevMode ? [{ debugName: "bandPadding" }] : /* istanbul ignore next */ []));
354
- groupPadding = input(0.05, /* @ts-ignore */
355
- ...(ngDevMode ? [{ debugName: "groupPadding" }] : /* istanbul ignore next */ []));
356
- cornerRadius = input(null, /* @ts-ignore */
357
- ...(ngDevMode ? [{ debugName: "cornerRadius" }] : /* istanbul ignore next */ []));
358
- colorKey = input(undefined, /* @ts-ignore */
359
- ...(ngDevMode ? [{ debugName: "colorKey" }] : /* istanbul ignore next */ []));
360
- activeKey = input(undefined, /* @ts-ignore */
361
- ...(ngDevMode ? [{ debugName: "activeKey" }] : /* istanbul ignore next */ []));
362
- activeValue = input(undefined, /* @ts-ignore */
363
- ...(ngDevMode ? [{ debugName: "activeValue" }] : /* istanbul ignore next */ []));
364
- showValueLabels = input(false, /* @ts-ignore */
365
- ...(ngDevMode ? [{ debugName: "showValueLabels" }] : /* istanbul ignore next */ []));
366
- valueLabelFormat = input(defaultBarValueFormatter, /* @ts-ignore */
367
- ...(ngDevMode ? [{ debugName: "valueLabelFormat" }] : /* istanbul ignore next */ []));
368
- /** Cell length along the value axis for the `dot` style; defaults to the bar thickness. */
369
- dotSize = input(undefined, /* @ts-ignore */
370
- ...(ngDevMode ? [{ debugName: "dotSize" }] : /* istanbul ignore next */ []));
371
- /** Gap between consecutive cells along the value axis for the `dot` style. */
372
- dotGap = input(2, /* @ts-ignore */
373
- ...(ngDevMode ? [{ debugName: "dotGap" }] : /* istanbul ignore next */ []));
374
- /** Corner radius of each `dot` cell. */
375
- dotCornerRadius = input(null, /* @ts-ignore */
376
- ...(ngDevMode ? [{ debugName: "dotCornerRadius" }] : /* istanbul ignore next */ []));
377
- /** Render the faint full-height cell track behind the `dot` values. */
378
- showDotTrack = input(true, /* @ts-ignore */
379
- ...(ngDevMode ? [{ debugName: "showDotTrack" }] : /* istanbul ignore next */ []));
380
- barClick = output();
381
- /**
382
- * The shared cartesian scaffolding: geometry, the layout effect, and the click
383
- * plus active-point plus aria-label handlers. No `viewport` here, so the bar
384
- * chart always renders its whole dataset and `resolveDatumIndex` is the
385
- * identity.
386
- *
387
- * Declared before `layout` because the layout computed reads its geometry.
388
- */
389
- cx = setupCartesianChart({
390
- data: () => this.data(),
391
- margin: () => this.plotMargin(),
392
- cartesian: { context: this.cart, orientation: () => this.orientation() },
393
- publishLayout: () => {
394
- const layout = this.layout();
395
- this.cart.categoryScale.set(layout.categoryScale);
396
- this.cart.valueScale.set(layout.valueScale);
397
- this.cart.categories.set(layout.categories);
398
- },
399
- click: {
400
- emit: (event) => this.barClick.emit(event),
401
- payload: (bar, datumIndex, datum) => ({
402
- seriesKey: bar.seriesKey,
403
- datumIndex,
404
- category: bar.category,
405
- value: bar.value,
406
- datum,
407
- }),
408
- },
409
- ariaLabel: (bar, label) => `${label} in ${bar.category}: ${bar.value}`,
410
- });
411
- /** Bar corner radius; an unset input follows the live theme-radius axis. */
412
- resolvedCornerRadius = computed(() => this.cornerRadius() ?? this.themeRadius.px(), /* @ts-ignore */
413
- ...(ngDevMode ? [{ debugName: "resolvedCornerRadius" }] : /* istanbul ignore next */ []));
414
- /** Dot-cell corner radius; an unset input follows the theme-radius axis (smaller, SVG clamps to half the cell). */
415
- resolvedDotCornerRadius = computed(() => this.dotCornerRadius() ?? Math.min(this.themeRadius.px() * 0.5, 4), /* @ts-ignore */
416
- ...(ngDevMode ? [{ debugName: "resolvedDotCornerRadius" }] : /* istanbul ignore next */ []));
417
- layout = computed(() => computeBarLayout({
418
- data: this.data(),
419
- xKey: this.xKey(),
420
- seriesKeys: this.root.visibleSeriesKeys(),
421
- variant: this.variant(),
422
- orientation: this.orientation(),
423
- innerWidth: this.cx.innerWidth(),
424
- innerHeight: this.cx.innerHeight(),
425
- bandPadding: this.bandPadding(),
426
- groupPadding: this.groupPadding(),
427
- colorKey: this.colorKey(),
428
- activeKey: this.activeKey(),
429
- activeValue: this.activeValue(),
430
- }), /* @ts-ignore */
431
- ...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
432
- bars = computed(() => this.layout().bars, /* @ts-ignore */
433
- ...(ngDevMode ? [{ debugName: "bars" }] : /* istanbul ignore next */ []));
434
- dotLayout = computed(() => {
435
- if (this.chartStyle() !== 'dot') {
436
- return null;
437
- }
438
- const layout = this.layout();
439
- return computeBarDotCells({
440
- bars: layout.bars,
441
- orientation: this.orientation(),
442
- innerWidth: this.cx.innerWidth(),
443
- innerHeight: this.cx.innerHeight(),
444
- baseline: layout.valueScale(0),
445
- dotSize: this.dotSize(),
446
- dotGap: this.dotGap(),
447
- });
448
- }, /* @ts-ignore */
449
- ...(ngDevMode ? [{ debugName: "dotLayout" }] : /* istanbul ignore next */ []));
450
- dotTrackCells = computed(() => this.showDotTrack() ? (this.dotLayout()?.track ?? []) : [], /* @ts-ignore */
451
- ...(ngDevMode ? [{ debugName: "dotTrackCells" }] : /* istanbul ignore next */ []));
452
- dotValueCells = computed(() => this.dotLayout()?.values ?? [], /* @ts-ignore */
453
- ...(ngDevMode ? [{ debugName: "dotValueCells" }] : /* istanbul ignore next */ []));
454
- ariaSummary = computed(() => {
455
- const keys = this.root.visibleSeriesKeys();
456
- const n = this.data().length;
457
- return `Bar chart, ${n} categories, ${keys.length} series: ${keys.join(', ')}.`;
458
- }, /* @ts-ignore */
459
- ...(ngDevMode ? [{ debugName: "ariaSummary" }] : /* istanbul ignore next */ []));
460
- visibleSeriesKeys = computed(() => this.root.visibleSeriesKeys(), /* @ts-ignore */
461
- ...(ngDevMode ? [{ debugName: "visibleSeriesKeys" }] : /* istanbul ignore next */ []));
462
- dataColumns = computed(() => [this.xKey(), ...this.visibleSeriesKeys()], /* @ts-ignore */
463
- ...(ngDevMode ? [{ debugName: "dataColumns" }] : /* istanbul ignore next */ []));
464
- barOpacity(bar) {
465
- return this.emphasisOpacity(bar.active);
466
- }
467
- dotCellOpacity(cell) {
468
- return this.emphasisOpacity(cell.active);
469
- }
470
- /** In `dot` style the bar rect stays as an invisible interaction target. */
471
- barFill(bar) {
472
- return this.chartStyle() === 'dot' ? 'transparent' : bar.color;
473
- }
474
- emphasisOpacity(active) {
475
- return this.activeKey() && this.activeValue() !== undefined ? (active ? 1 : 0.42) : 1;
476
- }
477
- formatValueLabel(bar) {
478
- return this.valueLabelFormat()(bar.value);
479
- }
480
- barLabelX(bar) {
481
- if (this.orientation() === 'vertical') {
482
- return bar.x + bar.width / 2;
483
- }
484
- return bar.value >= 0 ? bar.x + bar.width + 6 : bar.x - 6;
485
- }
486
- barLabelY(bar) {
487
- if (this.orientation() === 'vertical') {
488
- return bar.value >= 0 ? bar.y - 8 : bar.y + bar.height + 10;
489
- }
490
- return bar.y + bar.height / 2;
491
- }
492
- barLabelAnchor(bar) {
493
- if (this.orientation() === 'vertical') {
494
- return 'middle';
495
- }
496
- return bar.value >= 0 ? 'start' : 'end';
497
- }
498
- onKeydown(event, index) {
499
- const key = event.key;
500
- let targetIndex = -1;
501
- if (key === 'ArrowRight' || key === 'ArrowDown') {
502
- targetIndex = index + 1;
503
- }
504
- else if (key === 'ArrowLeft' || key === 'ArrowUp') {
505
- targetIndex = index - 1;
506
- }
507
- if (targetIndex >= 0 && targetIndex < this.bars().length) {
508
- event.preventDefault();
509
- const svgEl = event.currentTarget;
510
- const parent = svgEl.parentElement;
511
- if (parent) {
512
- const rects = parent.querySelectorAll('.chart-bar');
513
- const targetRect = rects[targetIndex];
514
- if (targetRect) {
515
- targetRect.focus();
516
- }
517
- }
518
- }
519
- }
520
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: BarChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
521
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: BarChart, isStandalone: true, selector: "ChartBar", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, xKey: { classPropertyName: "xKey", publicName: "xKey", isSignal: true, isRequired: true, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, styleVariant: { classPropertyName: "styleVariant", publicName: "styleVariant", isSignal: true, isRequired: false, transformFunction: null }, styles: { classPropertyName: "styles", publicName: "styles", isSignal: true, isRequired: false, transformFunction: null }, margin: { classPropertyName: "margin", publicName: "margin", isSignal: true, isRequired: false, transformFunction: null }, bandPadding: { classPropertyName: "bandPadding", publicName: "bandPadding", isSignal: true, isRequired: false, transformFunction: null }, groupPadding: { classPropertyName: "groupPadding", publicName: "groupPadding", isSignal: true, isRequired: false, transformFunction: null }, cornerRadius: { classPropertyName: "cornerRadius", publicName: "cornerRadius", isSignal: true, isRequired: false, transformFunction: null }, colorKey: { classPropertyName: "colorKey", publicName: "colorKey", isSignal: true, isRequired: false, transformFunction: null }, activeKey: { classPropertyName: "activeKey", publicName: "activeKey", isSignal: true, isRequired: false, transformFunction: null }, activeValue: { classPropertyName: "activeValue", publicName: "activeValue", isSignal: true, isRequired: false, transformFunction: null }, showValueLabels: { classPropertyName: "showValueLabels", publicName: "showValueLabels", isSignal: true, isRequired: false, transformFunction: null }, valueLabelFormat: { classPropertyName: "valueLabelFormat", publicName: "valueLabelFormat", isSignal: true, isRequired: false, transformFunction: null }, dotSize: { classPropertyName: "dotSize", publicName: "dotSize", isSignal: true, isRequired: false, transformFunction: null }, dotGap: { classPropertyName: "dotGap", publicName: "dotGap", isSignal: true, isRequired: false, transformFunction: null }, dotCornerRadius: { classPropertyName: "dotCornerRadius", publicName: "dotCornerRadius", isSignal: true, isRequired: false, transformFunction: null }, showDotTrack: { classPropertyName: "showDotTrack", publicName: "showDotTrack", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { barClick: "barClick" }, host: { properties: { "attr.data-style": "chartStyle()" }, classAttribute: "relative block h-full w-full" }, providers: [CartesianContext], ngImport: i0, template: `
257
+ var BarChart = class BarChart {
258
+ root = inject(ChartContext);
259
+ cart = inject(CartesianContext);
260
+ themeRadius = inject(ChartThemeRadius);
261
+ data = input.required(...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
262
+ xKey = input.required(...ngDevMode ? [{ debugName: "xKey" }] : /* istanbul ignore next */ []);
263
+ orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
264
+ variant = input("grouped", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
265
+ styleVariant = input(void 0, ...ngDevMode ? [{ debugName: "styleVariant" }] : /* istanbul ignore next */ []);
266
+ styles = input("base", ...ngDevMode ? [{ debugName: "styles" }] : /* istanbul ignore next */ []);
267
+ chartStyle = resolveChartStyle(this.styleVariant, this.styles);
268
+ themeSpace = inject(ChartThemeSpace);
269
+ margin = input(null, ...ngDevMode ? [{ debugName: "margin" }] : /* istanbul ignore next */ []);
270
+ plotMargin = resolveChartMargin(this.margin, DEFAULT_CARTESIAN_MARGIN_UNITS, this.themeSpace);
271
+ bandPadding = input(.2, ...ngDevMode ? [{ debugName: "bandPadding" }] : /* istanbul ignore next */ []);
272
+ groupPadding = input(.05, ...ngDevMode ? [{ debugName: "groupPadding" }] : /* istanbul ignore next */ []);
273
+ cornerRadius = input(null, ...ngDevMode ? [{ debugName: "cornerRadius" }] : /* istanbul ignore next */ []);
274
+ colorKey = input(void 0, ...ngDevMode ? [{ debugName: "colorKey" }] : /* istanbul ignore next */ []);
275
+ activeKey = input(void 0, ...ngDevMode ? [{ debugName: "activeKey" }] : /* istanbul ignore next */ []);
276
+ activeValue = input(void 0, ...ngDevMode ? [{ debugName: "activeValue" }] : /* istanbul ignore next */ []);
277
+ showValueLabels = input(false, ...ngDevMode ? [{ debugName: "showValueLabels" }] : /* istanbul ignore next */ []);
278
+ valueLabelFormat = input(defaultBarValueFormatter, ...ngDevMode ? [{ debugName: "valueLabelFormat" }] : /* istanbul ignore next */ []);
279
+ dotSize = input(void 0, ...ngDevMode ? [{ debugName: "dotSize" }] : /* istanbul ignore next */ []);
280
+ dotGap = input(2, ...ngDevMode ? [{ debugName: "dotGap" }] : /* istanbul ignore next */ []);
281
+ dotCornerRadius = input(null, ...ngDevMode ? [{ debugName: "dotCornerRadius" }] : /* istanbul ignore next */ []);
282
+ showDotTrack = input(true, ...ngDevMode ? [{ debugName: "showDotTrack" }] : /* istanbul ignore next */ []);
283
+ barClick = output();
284
+ cx = setupCartesianChart({
285
+ data: () => this.data(),
286
+ margin: () => this.plotMargin(),
287
+ cartesian: {
288
+ context: this.cart,
289
+ orientation: () => this.orientation()
290
+ },
291
+ publishLayout: () => {
292
+ const layout = this.layout();
293
+ this.cart.categoryScale.set(layout.categoryScale);
294
+ this.cart.valueScale.set(layout.valueScale);
295
+ this.cart.categories.set(layout.categories);
296
+ },
297
+ click: {
298
+ emit: (event) => this.barClick.emit(event),
299
+ payload: (bar, datumIndex, datum) => ({
300
+ seriesKey: bar.seriesKey,
301
+ datumIndex,
302
+ category: bar.category,
303
+ value: bar.value,
304
+ datum
305
+ })
306
+ },
307
+ ariaLabel: (bar, label) => `${label} in ${bar.category}: ${bar.value}`
308
+ });
309
+ resolvedCornerRadius = computed(() => this.cornerRadius() ?? this.themeRadius.px(), ...ngDevMode ? [{ debugName: "resolvedCornerRadius" }] : /* istanbul ignore next */ []);
310
+ resolvedDotCornerRadius = computed(() => this.dotCornerRadius() ?? Math.min(this.themeRadius.px() * .5, 4), ...ngDevMode ? [{ debugName: "resolvedDotCornerRadius" }] : /* istanbul ignore next */ []);
311
+ layout = computed(() => computeBarLayout({
312
+ data: this.data(),
313
+ xKey: this.xKey(),
314
+ seriesKeys: this.root.visibleSeriesKeys(),
315
+ variant: this.variant(),
316
+ orientation: this.orientation(),
317
+ innerWidth: this.cx.innerWidth(),
318
+ innerHeight: this.cx.innerHeight(),
319
+ bandPadding: this.bandPadding(),
320
+ groupPadding: this.groupPadding(),
321
+ colorKey: this.colorKey(),
322
+ activeKey: this.activeKey(),
323
+ activeValue: this.activeValue()
324
+ }), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
325
+ bars = computed(() => this.layout().bars, ...ngDevMode ? [{ debugName: "bars" }] : /* istanbul ignore next */ []);
326
+ dotLayout = computed(() => {
327
+ if (this.chartStyle() !== "dot") return null;
328
+ const layout = this.layout();
329
+ return computeBarDotCells({
330
+ bars: layout.bars,
331
+ orientation: this.orientation(),
332
+ innerWidth: this.cx.innerWidth(),
333
+ innerHeight: this.cx.innerHeight(),
334
+ baseline: layout.valueScale(0),
335
+ dotSize: this.dotSize(),
336
+ dotGap: this.dotGap()
337
+ });
338
+ }, ...ngDevMode ? [{ debugName: "dotLayout" }] : /* istanbul ignore next */ []);
339
+ dotTrackCells = computed(() => this.showDotTrack() ? this.dotLayout()?.track ?? [] : [], ...ngDevMode ? [{ debugName: "dotTrackCells" }] : /* istanbul ignore next */ []);
340
+ dotValueCells = computed(() => this.dotLayout()?.values ?? [], ...ngDevMode ? [{ debugName: "dotValueCells" }] : /* istanbul ignore next */ []);
341
+ ariaSummary = computed(() => {
342
+ const keys = this.root.visibleSeriesKeys();
343
+ return `Bar chart, ${this.data().length} categories, ${keys.length} series: ${keys.join(", ")}.`;
344
+ }, ...ngDevMode ? [{ debugName: "ariaSummary" }] : /* istanbul ignore next */ []);
345
+ visibleSeriesKeys = computed(() => this.root.visibleSeriesKeys(), ...ngDevMode ? [{ debugName: "visibleSeriesKeys" }] : /* istanbul ignore next */ []);
346
+ dataColumns = computed(() => [this.xKey(), ...this.visibleSeriesKeys()], ...ngDevMode ? [{ debugName: "dataColumns" }] : /* istanbul ignore next */ []);
347
+ barOpacity(bar) {
348
+ return this.emphasisOpacity(bar.active);
349
+ }
350
+ dotCellOpacity(cell) {
351
+ return this.emphasisOpacity(cell.active);
352
+ }
353
+ barFill(bar) {
354
+ return this.chartStyle() === "dot" ? "transparent" : bar.color;
355
+ }
356
+ emphasisOpacity(active) {
357
+ return this.activeKey() && this.activeValue() !== void 0 ? active ? 1 : .42 : 1;
358
+ }
359
+ formatValueLabel(bar) {
360
+ return this.valueLabelFormat()(bar.value);
361
+ }
362
+ barLabelX(bar) {
363
+ if (this.orientation() === "vertical") return bar.x + bar.width / 2;
364
+ return bar.value >= 0 ? bar.x + bar.width + 6 : bar.x - 6;
365
+ }
366
+ barLabelY(bar) {
367
+ if (this.orientation() === "vertical") return bar.value >= 0 ? bar.y - 8 : bar.y + bar.height + 10;
368
+ return bar.y + bar.height / 2;
369
+ }
370
+ barLabelAnchor(bar) {
371
+ if (this.orientation() === "vertical") return "middle";
372
+ return bar.value >= 0 ? "start" : "end";
373
+ }
374
+ onKeydown(event, index) {
375
+ const key = event.key;
376
+ let targetIndex = -1;
377
+ if (key === "ArrowRight" || key === "ArrowDown") targetIndex = index + 1;
378
+ else if (key === "ArrowLeft" || key === "ArrowUp") targetIndex = index - 1;
379
+ if (targetIndex >= 0 && targetIndex < this.bars().length) {
380
+ event.preventDefault();
381
+ const parent = event.currentTarget.parentElement;
382
+ if (parent) {
383
+ const targetRect = parent.querySelectorAll(".chart-bar")[targetIndex];
384
+ if (targetRect) targetRect.focus();
385
+ }
386
+ }
387
+ }
388
+ static ɵfac = i0.ɵɵngDeclareFactory({
389
+ minVersion: "12.0.0",
390
+ version: "22.2.0",
391
+ ngImport: i0,
392
+ type: BarChart,
393
+ deps: [],
394
+ target: i0.ɵɵFactoryTarget.Component
395
+ });
396
+ static ɵcmp = i0.ɵɵngDeclareComponent({
397
+ minVersion: "17.0.0",
398
+ version: "22.2.0",
399
+ type: BarChart,
400
+ isStandalone: true,
401
+ selector: "ChartBar",
402
+ inputs: {
403
+ data: {
404
+ classPropertyName: "data",
405
+ publicName: "data",
406
+ isSignal: true,
407
+ isRequired: true,
408
+ transformFunction: null
409
+ },
410
+ xKey: {
411
+ classPropertyName: "xKey",
412
+ publicName: "xKey",
413
+ isSignal: true,
414
+ isRequired: true,
415
+ transformFunction: null
416
+ },
417
+ orientation: {
418
+ classPropertyName: "orientation",
419
+ publicName: "orientation",
420
+ isSignal: true,
421
+ isRequired: false,
422
+ transformFunction: null
423
+ },
424
+ variant: {
425
+ classPropertyName: "variant",
426
+ publicName: "variant",
427
+ isSignal: true,
428
+ isRequired: false,
429
+ transformFunction: null
430
+ },
431
+ styleVariant: {
432
+ classPropertyName: "styleVariant",
433
+ publicName: "styleVariant",
434
+ isSignal: true,
435
+ isRequired: false,
436
+ transformFunction: null
437
+ },
438
+ styles: {
439
+ classPropertyName: "styles",
440
+ publicName: "styles",
441
+ isSignal: true,
442
+ isRequired: false,
443
+ transformFunction: null
444
+ },
445
+ margin: {
446
+ classPropertyName: "margin",
447
+ publicName: "margin",
448
+ isSignal: true,
449
+ isRequired: false,
450
+ transformFunction: null
451
+ },
452
+ bandPadding: {
453
+ classPropertyName: "bandPadding",
454
+ publicName: "bandPadding",
455
+ isSignal: true,
456
+ isRequired: false,
457
+ transformFunction: null
458
+ },
459
+ groupPadding: {
460
+ classPropertyName: "groupPadding",
461
+ publicName: "groupPadding",
462
+ isSignal: true,
463
+ isRequired: false,
464
+ transformFunction: null
465
+ },
466
+ cornerRadius: {
467
+ classPropertyName: "cornerRadius",
468
+ publicName: "cornerRadius",
469
+ isSignal: true,
470
+ isRequired: false,
471
+ transformFunction: null
472
+ },
473
+ colorKey: {
474
+ classPropertyName: "colorKey",
475
+ publicName: "colorKey",
476
+ isSignal: true,
477
+ isRequired: false,
478
+ transformFunction: null
479
+ },
480
+ activeKey: {
481
+ classPropertyName: "activeKey",
482
+ publicName: "activeKey",
483
+ isSignal: true,
484
+ isRequired: false,
485
+ transformFunction: null
486
+ },
487
+ activeValue: {
488
+ classPropertyName: "activeValue",
489
+ publicName: "activeValue",
490
+ isSignal: true,
491
+ isRequired: false,
492
+ transformFunction: null
493
+ },
494
+ showValueLabels: {
495
+ classPropertyName: "showValueLabels",
496
+ publicName: "showValueLabels",
497
+ isSignal: true,
498
+ isRequired: false,
499
+ transformFunction: null
500
+ },
501
+ valueLabelFormat: {
502
+ classPropertyName: "valueLabelFormat",
503
+ publicName: "valueLabelFormat",
504
+ isSignal: true,
505
+ isRequired: false,
506
+ transformFunction: null
507
+ },
508
+ dotSize: {
509
+ classPropertyName: "dotSize",
510
+ publicName: "dotSize",
511
+ isSignal: true,
512
+ isRequired: false,
513
+ transformFunction: null
514
+ },
515
+ dotGap: {
516
+ classPropertyName: "dotGap",
517
+ publicName: "dotGap",
518
+ isSignal: true,
519
+ isRequired: false,
520
+ transformFunction: null
521
+ },
522
+ dotCornerRadius: {
523
+ classPropertyName: "dotCornerRadius",
524
+ publicName: "dotCornerRadius",
525
+ isSignal: true,
526
+ isRequired: false,
527
+ transformFunction: null
528
+ },
529
+ showDotTrack: {
530
+ classPropertyName: "showDotTrack",
531
+ publicName: "showDotTrack",
532
+ isSignal: true,
533
+ isRequired: false,
534
+ transformFunction: null
535
+ }
536
+ },
537
+ outputs: { barClick: "barClick" },
538
+ host: {
539
+ properties: { "attr.data-style": "chartStyle()" },
540
+ classAttribute: "relative block h-full w-full"
541
+ },
542
+ providers: [CartesianContext],
543
+ ngImport: i0,
544
+ template: `
522
545
  <svg:svg
523
546
  ChartPointerTracker
524
547
  ChartRovingFocus
@@ -612,16 +635,59 @@ class BarChart {
612
635
  [rowHeaderKey]="xKey()"
613
636
  [label]="ariaSummary()"
614
637
  />
615
- `, isInline: true, dependencies: [{ kind: "directive", type: ChartPointerTracker, selector: "svg:svg[ChartPointerTracker]" }, { kind: "directive", type: ChartRovingFocus, selector: "svg[ChartRovingFocus]" }, { kind: "directive", type: ChartMarkFocus, selector: "[ChartMarkFocus]" }, { kind: "component", type: ChartDataTable, selector: "ChartDataTable", inputs: ["data", "columns", "label", "rowHeaderKey"] }] });
616
- }
617
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: BarChart, decorators: [{
618
- type: Component,
619
- args: [{
620
- selector: 'ChartBar',
621
- providers: [CartesianContext],
622
- imports: [ChartPointerTracker, ChartRovingFocus, ChartMarkFocus, ChartDataTable],
623
- host: { class: 'relative block h-full w-full', '[attr.data-style]': 'chartStyle()' },
624
- template: `
638
+ `,
639
+ isInline: true,
640
+ dependencies: [
641
+ {
642
+ kind: "directive",
643
+ type: ChartPointerTracker,
644
+ selector: "svg:svg[ChartPointerTracker]"
645
+ },
646
+ {
647
+ kind: "directive",
648
+ type: ChartRovingFocus,
649
+ selector: "svg[ChartRovingFocus]"
650
+ },
651
+ {
652
+ kind: "directive",
653
+ type: ChartMarkFocus,
654
+ selector: "[ChartMarkFocus]"
655
+ },
656
+ {
657
+ kind: "component",
658
+ type: ChartDataTable,
659
+ selector: "ChartDataTable",
660
+ inputs: [
661
+ "data",
662
+ "columns",
663
+ "label",
664
+ "rowHeaderKey"
665
+ ]
666
+ }
667
+ ]
668
+ });
669
+ };
670
+ i0.ɵɵngDeclareClassMetadata({
671
+ minVersion: "12.0.0",
672
+ version: "22.2.0",
673
+ ngImport: i0,
674
+ type: BarChart,
675
+ decorators: [{
676
+ type: Component,
677
+ args: [{
678
+ selector: "ChartBar",
679
+ providers: [CartesianContext],
680
+ imports: [
681
+ ChartPointerTracker,
682
+ ChartRovingFocus,
683
+ ChartMarkFocus,
684
+ ChartDataTable
685
+ ],
686
+ host: {
687
+ class: "relative block h-full w-full",
688
+ "[attr.data-style]": "chartStyle()"
689
+ },
690
+ template: `
625
691
  <svg:svg
626
692
  ChartPointerTracker
627
693
  ChartRovingFocus
@@ -715,12 +781,166 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
715
781
  [rowHeaderKey]="xKey()"
716
782
  [label]="ariaSummary()"
717
783
  />
718
- `,
719
- }]
720
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], xKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "xKey", required: true }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], styleVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleVariant", required: false }] }], styles: [{ type: i0.Input, args: [{ isSignal: true, alias: "styles", required: false }] }], margin: [{ type: i0.Input, args: [{ isSignal: true, alias: "margin", required: false }] }], bandPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "bandPadding", required: false }] }], groupPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupPadding", required: false }] }], cornerRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "cornerRadius", required: false }] }], colorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorKey", required: false }] }], activeKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeKey", required: false }] }], activeValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeValue", required: false }] }], showValueLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValueLabels", required: false }] }], valueLabelFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueLabelFormat", required: false }] }], dotSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "dotSize", required: false }] }], dotGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "dotGap", required: false }] }], dotCornerRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "dotCornerRadius", required: false }] }], showDotTrack: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDotTrack", required: false }] }], barClick: [{ type: i0.Output, args: ["barClick"] }] } });
721
-
722
- /**
723
- * Generated bundle index. Do not edit.
724
- */
725
-
726
- export { BarChart, computeBarDotCells, computeBarLayout };
784
+ `
785
+ }]
786
+ }],
787
+ propDecorators: {
788
+ data: [{
789
+ type: i0.Input,
790
+ args: [{
791
+ isSignal: true,
792
+ alias: "data",
793
+ required: true
794
+ }]
795
+ }],
796
+ xKey: [{
797
+ type: i0.Input,
798
+ args: [{
799
+ isSignal: true,
800
+ alias: "xKey",
801
+ required: true
802
+ }]
803
+ }],
804
+ orientation: [{
805
+ type: i0.Input,
806
+ args: [{
807
+ isSignal: true,
808
+ alias: "orientation",
809
+ required: false
810
+ }]
811
+ }],
812
+ variant: [{
813
+ type: i0.Input,
814
+ args: [{
815
+ isSignal: true,
816
+ alias: "variant",
817
+ required: false
818
+ }]
819
+ }],
820
+ styleVariant: [{
821
+ type: i0.Input,
822
+ args: [{
823
+ isSignal: true,
824
+ alias: "styleVariant",
825
+ required: false
826
+ }]
827
+ }],
828
+ styles: [{
829
+ type: i0.Input,
830
+ args: [{
831
+ isSignal: true,
832
+ alias: "styles",
833
+ required: false
834
+ }]
835
+ }],
836
+ margin: [{
837
+ type: i0.Input,
838
+ args: [{
839
+ isSignal: true,
840
+ alias: "margin",
841
+ required: false
842
+ }]
843
+ }],
844
+ bandPadding: [{
845
+ type: i0.Input,
846
+ args: [{
847
+ isSignal: true,
848
+ alias: "bandPadding",
849
+ required: false
850
+ }]
851
+ }],
852
+ groupPadding: [{
853
+ type: i0.Input,
854
+ args: [{
855
+ isSignal: true,
856
+ alias: "groupPadding",
857
+ required: false
858
+ }]
859
+ }],
860
+ cornerRadius: [{
861
+ type: i0.Input,
862
+ args: [{
863
+ isSignal: true,
864
+ alias: "cornerRadius",
865
+ required: false
866
+ }]
867
+ }],
868
+ colorKey: [{
869
+ type: i0.Input,
870
+ args: [{
871
+ isSignal: true,
872
+ alias: "colorKey",
873
+ required: false
874
+ }]
875
+ }],
876
+ activeKey: [{
877
+ type: i0.Input,
878
+ args: [{
879
+ isSignal: true,
880
+ alias: "activeKey",
881
+ required: false
882
+ }]
883
+ }],
884
+ activeValue: [{
885
+ type: i0.Input,
886
+ args: [{
887
+ isSignal: true,
888
+ alias: "activeValue",
889
+ required: false
890
+ }]
891
+ }],
892
+ showValueLabels: [{
893
+ type: i0.Input,
894
+ args: [{
895
+ isSignal: true,
896
+ alias: "showValueLabels",
897
+ required: false
898
+ }]
899
+ }],
900
+ valueLabelFormat: [{
901
+ type: i0.Input,
902
+ args: [{
903
+ isSignal: true,
904
+ alias: "valueLabelFormat",
905
+ required: false
906
+ }]
907
+ }],
908
+ dotSize: [{
909
+ type: i0.Input,
910
+ args: [{
911
+ isSignal: true,
912
+ alias: "dotSize",
913
+ required: false
914
+ }]
915
+ }],
916
+ dotGap: [{
917
+ type: i0.Input,
918
+ args: [{
919
+ isSignal: true,
920
+ alias: "dotGap",
921
+ required: false
922
+ }]
923
+ }],
924
+ dotCornerRadius: [{
925
+ type: i0.Input,
926
+ args: [{
927
+ isSignal: true,
928
+ alias: "dotCornerRadius",
929
+ required: false
930
+ }]
931
+ }],
932
+ showDotTrack: [{
933
+ type: i0.Input,
934
+ args: [{
935
+ isSignal: true,
936
+ alias: "showDotTrack",
937
+ required: false
938
+ }]
939
+ }],
940
+ barClick: [{
941
+ type: i0.Output,
942
+ args: ["barClick"]
943
+ }]
944
+ }
945
+ });
946
+ export { BarChart, computeBarDotCells, computeBarLayout };