@galaxy-io/dls 1.2.7 → 1.3.1

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 (305) hide show
  1. package/README.md +2 -0
  2. package/dist/avatar/Avatar.d.ts +2 -1
  3. package/dist/avatar/Avatar.js +103 -14
  4. package/dist/buttons/Button.d.ts +6 -1
  5. package/dist/buttons/Button.js +8 -4
  6. package/dist/charts/BarChart.d.ts +30 -20
  7. package/dist/charts/BarChart.js +183 -253
  8. package/dist/charts/ChartAxis.d.ts +47 -22
  9. package/dist/charts/ChartAxis.js +81 -60
  10. package/dist/charts/ChartCategoryTargets.d.ts +27 -0
  11. package/dist/charts/ChartCategoryTargets.js +75 -0
  12. package/dist/charts/ChartEmptyState.d.ts +17 -0
  13. package/dist/charts/ChartEmptyState.js +29 -0
  14. package/dist/charts/ChartFrame.d.ts +110 -0
  15. package/dist/charts/ChartFrame.js +143 -0
  16. package/dist/charts/ChartLegend.d.ts +27 -4
  17. package/dist/charts/ChartLegend.js +46 -23
  18. package/dist/charts/ChartPrimitives.d.ts +230 -0
  19. package/dist/charts/ChartPrimitives.js +305 -0
  20. package/dist/charts/ChartTooltip.d.ts +25 -4
  21. package/dist/charts/ChartTooltip.js +55 -49
  22. package/dist/charts/LineChart.d.ts +42 -20
  23. package/dist/charts/LineChart.js +175 -241
  24. package/dist/charts/PieChart.d.ts +48 -32
  25. package/dist/charts/PieChart.js +180 -170
  26. package/dist/charts/barChartGeometry.d.ts +120 -0
  27. package/dist/charts/barChartGeometry.js +210 -0
  28. package/dist/charts/barChartLegend.d.ts +25 -0
  29. package/dist/charts/barChartLegend.js +23 -0
  30. package/dist/charts/chartFormat.d.ts +27 -0
  31. package/dist/charts/chartFormat.js +71 -0
  32. package/dist/charts/chartScales.d.ts +120 -0
  33. package/dist/charts/chartScales.js +165 -0
  34. package/dist/charts/chartTheme.d.ts +18 -0
  35. package/dist/charts/chartTheme.js +26 -0
  36. package/dist/charts/constants.d.ts +241 -18
  37. package/dist/charts/constants.js +261 -32
  38. package/dist/charts/lineChartGeometry.d.ts +92 -0
  39. package/dist/charts/lineChartGeometry.js +134 -0
  40. package/dist/charts/pieChartGeometry.d.ts +60 -0
  41. package/dist/charts/pieChartGeometry.js +79 -0
  42. package/dist/charts/types.d.ts +428 -54
  43. package/dist/charts/types.js +155 -0
  44. package/dist/charts/useCartesianChartLayout.d.ts +70 -0
  45. package/dist/charts/useCartesianChartLayout.js +56 -0
  46. package/dist/charts/useChartDimensions.d.ts +47 -0
  47. package/dist/charts/useChartDimensions.js +63 -0
  48. package/dist/charts/useChartFormatters.d.ts +19 -0
  49. package/dist/charts/useChartFormatters.js +20 -0
  50. package/dist/charts/useChartInteraction.d.ts +76 -0
  51. package/dist/charts/useChartInteraction.js +126 -0
  52. package/dist/charts/useChartTooltipPosition.d.ts +53 -0
  53. package/dist/charts/useChartTooltipPosition.js +39 -0
  54. package/dist/charts/useSeriesColorResolver.d.ts +37 -0
  55. package/dist/charts/useSeriesColorResolver.js +27 -0
  56. package/dist/hooks/useElementClientSize.d.ts +20 -0
  57. package/dist/hooks/useElementClientSize.js +43 -0
  58. package/dist/inputs/CheckboxInput.d.ts +7 -2
  59. package/dist/inputs/CheckboxInput.js +30 -14
  60. package/dist/inputs/Input.d.ts +1 -1
  61. package/dist/inputs/Input.js +6 -2
  62. package/dist/inputs/MultiSelectInput.js +1 -1
  63. package/dist/inputs/RadioInput.js +7 -2
  64. package/dist/styles.css +69 -74
  65. package/dist/table/InfiniteSpreadsheet.d.ts +6 -0
  66. package/dist/table/InfiniteSpreadsheet.js +235 -0
  67. package/dist/table/InfiniteTable.d.ts +7 -88
  68. package/dist/table/InfiniteTable.js +366 -577
  69. package/dist/{spreadsheet → table}/SpreadsheetCell.d.ts +6 -4
  70. package/dist/table/SpreadsheetCell.js +71 -0
  71. package/dist/{spreadsheet → table}/SpreadsheetCellEditor.js +27 -21
  72. package/dist/table/SpreadsheetHeaderCell.d.ts +23 -0
  73. package/dist/table/SpreadsheetHeaderCell.js +91 -0
  74. package/dist/table/SpreadsheetMenuItem.d.ts +14 -0
  75. package/dist/table/SpreadsheetMenuItem.js +33 -0
  76. package/dist/table/SpreadsheetPrimitives.d.ts +172 -0
  77. package/dist/table/SpreadsheetPrimitives.js +105 -0
  78. package/dist/table/SpreadsheetRow.d.ts +33 -0
  79. package/dist/table/SpreadsheetRow.js +73 -0
  80. package/dist/{spreadsheet → table}/SpreadsheetRowActionCell.d.ts +5 -7
  81. package/dist/table/SpreadsheetRowActionCell.js +51 -0
  82. package/dist/table/TableExpandCell.d.ts +11 -0
  83. package/dist/table/TableExpandCell.js +24 -0
  84. package/dist/table/TableExpandedRow.d.ts +16 -0
  85. package/dist/table/TableExpandedRow.js +77 -0
  86. package/dist/table/TableHeaderCellContent.d.ts +30 -0
  87. package/dist/table/TableHeaderCellContent.js +48 -0
  88. package/dist/table/TablePrimitives.d.ts +307 -0
  89. package/dist/table/TablePrimitives.js +298 -0
  90. package/dist/table/TableSelectCell.d.ts +18 -0
  91. package/dist/table/TableSelectCell.js +26 -0
  92. package/dist/table/TableStatusRow.d.ts +18 -0
  93. package/dist/table/TableStatusRow.js +50 -0
  94. package/dist/table/VirtualizedInfiniteTable.d.ts +11 -27
  95. package/dist/table/VirtualizedInfiniteTable.js +182 -317
  96. package/dist/table/types.d.ts +249 -0
  97. package/dist/table/types.js +51 -0
  98. package/dist/table/useInfiniteScrollSentinel.d.ts +24 -0
  99. package/dist/table/useInfiniteScrollSentinel.js +53 -0
  100. package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.d.ts +1 -1
  101. package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.js +1 -1
  102. package/dist/table/useTableColumnLayout.d.ts +28 -0
  103. package/dist/table/useTableColumnLayout.js +63 -0
  104. package/dist/table/useTableColumnResize.d.ts +38 -0
  105. package/dist/table/useTableColumnResize.js +155 -0
  106. package/dist/table/useTableKeyboardNavigation.d.ts +25 -0
  107. package/dist/table/useTableKeyboardNavigation.js +83 -0
  108. package/dist/table/useTableRowExpansion.d.ts +24 -0
  109. package/dist/table/useTableRowExpansion.js +62 -0
  110. package/dist/table/useTableRowSelection.d.ts +27 -0
  111. package/dist/table/useTableRowSelection.js +94 -0
  112. package/dist/table/utils.d.ts +50 -0
  113. package/dist/table/utils.js +78 -0
  114. package/dist/text/MarkdownText.js +45 -27
  115. package/dist/theme/variants/dark.js +1 -1
  116. package/dist/widget/Widget.d.ts +2 -0
  117. package/dist/widget/Widget.js +14 -7
  118. package/package.json +1 -5
  119. package/dist/assets/components/enrichment/PerplexityIcon.d.ts +0 -3
  120. package/dist/assets/components/enrichment/PerplexityIcon.js +0 -35
  121. package/dist/assets/components/enrichment/TavilyIcon.d.ts +0 -3
  122. package/dist/assets/components/enrichment/TavilyIcon.js +0 -15
  123. package/dist/assets/components/onboarding/TenantSetupDark.d.ts +0 -3
  124. package/dist/assets/components/onboarding/TenantSetupDark.js +0 -498
  125. package/dist/assets/components/onboarding/TenantSetupLight.d.ts +0 -3
  126. package/dist/assets/components/onboarding/TenantSetupLight.js +0 -482
  127. package/dist/assets/components/onboarding/UserSetupDark.d.ts +0 -3
  128. package/dist/assets/components/onboarding/UserSetupDark.js +0 -1086
  129. package/dist/assets/components/onboarding/UserSetupLight.d.ts +0 -3
  130. package/dist/assets/components/onboarding/UserSetupLight.js +0 -1024
  131. package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.d.ts +0 -3
  132. package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.js +0 -466
  133. package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.d.ts +0 -3
  134. package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.js +0 -460
  135. package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.d.ts +0 -3
  136. package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.js +0 -336
  137. package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.d.ts +0 -3
  138. package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.js +0 -336
  139. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.d.ts +0 -3
  140. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.js +0 -153
  141. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.d.ts +0 -3
  142. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.js +0 -153
  143. package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.d.ts +0 -3
  144. package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.js +0 -117
  145. package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.d.ts +0 -3
  146. package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.js +0 -117
  147. package/dist/assets/components/projects/MappingMethodBlankDark.d.ts +0 -3
  148. package/dist/assets/components/projects/MappingMethodBlankDark.js +0 -150
  149. package/dist/assets/components/projects/MappingMethodBlankDarkHovered.d.ts +0 -3
  150. package/dist/assets/components/projects/MappingMethodBlankDarkHovered.js +0 -150
  151. package/dist/assets/components/projects/MappingMethodBlankLight.d.ts +0 -3
  152. package/dist/assets/components/projects/MappingMethodBlankLight.js +0 -150
  153. package/dist/assets/components/projects/MappingMethodBlankLightHovered.d.ts +0 -3
  154. package/dist/assets/components/projects/MappingMethodBlankLightHovered.js +0 -150
  155. package/dist/assets/components/projects/MappingMethodJsonDark.d.ts +0 -3
  156. package/dist/assets/components/projects/MappingMethodJsonDark.js +0 -90
  157. package/dist/assets/components/projects/MappingMethodJsonDarkHovered.d.ts +0 -3
  158. package/dist/assets/components/projects/MappingMethodJsonDarkHovered.js +0 -90
  159. package/dist/assets/components/projects/MappingMethodJsonLight.d.ts +0 -3
  160. package/dist/assets/components/projects/MappingMethodJsonLight.js +0 -90
  161. package/dist/assets/components/projects/MappingMethodJsonLightHovered.d.ts +0 -3
  162. package/dist/assets/components/projects/MappingMethodJsonLightHovered.js +0 -90
  163. package/dist/assets/components/projects/ProjectsEmptyStateDark.d.ts +0 -3
  164. package/dist/assets/components/projects/ProjectsEmptyStateDark.js +0 -454
  165. package/dist/assets/components/projects/ProjectsEmptyStateLight.d.ts +0 -3
  166. package/dist/assets/components/projects/ProjectsEmptyStateLight.js +0 -456
  167. package/dist/assets/components/root/CreateProjectActionCardDark.d.ts +0 -3
  168. package/dist/assets/components/root/CreateProjectActionCardDark.js +0 -1796
  169. package/dist/assets/components/root/CreateProjectActionCardDarkHovered.d.ts +0 -3
  170. package/dist/assets/components/root/CreateProjectActionCardDarkHovered.js +0 -1796
  171. package/dist/assets/components/root/CreateProjectActionCardLight.d.ts +0 -3
  172. package/dist/assets/components/root/CreateProjectActionCardLight.js +0 -1786
  173. package/dist/assets/components/root/CreateProjectActionCardLightHovered.d.ts +0 -3
  174. package/dist/assets/components/root/CreateProjectActionCardLightHovered.js +0 -1786
  175. package/dist/assets/components/root/CreateSourceActionCardDark.d.ts +0 -3
  176. package/dist/assets/components/root/CreateSourceActionCardDark.js +0 -879
  177. package/dist/assets/components/root/CreateSourceActionCardDarkHovered.d.ts +0 -3
  178. package/dist/assets/components/root/CreateSourceActionCardDarkHovered.js +0 -879
  179. package/dist/assets/components/root/CreateSourceActionCardLight.d.ts +0 -3
  180. package/dist/assets/components/root/CreateSourceActionCardLight.js +0 -889
  181. package/dist/assets/components/root/CreateSourceActionCardLightHovered.d.ts +0 -3
  182. package/dist/assets/components/root/CreateSourceActionCardLightHovered.js +0 -889
  183. package/dist/assets/components/sources/AttioIcon.d.ts +0 -3
  184. package/dist/assets/components/sources/AttioIcon.js +0 -11
  185. package/dist/assets/components/sources/BigquerySourceIcon.d.ts +0 -3
  186. package/dist/assets/components/sources/BigquerySourceIcon.js +0 -39
  187. package/dist/assets/components/sources/BrowserbaseSourceIcon.d.ts +0 -3
  188. package/dist/assets/components/sources/BrowserbaseSourceIcon.js +0 -35
  189. package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.d.ts +0 -3
  190. package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.js +0 -13
  191. package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.d.ts +0 -3
  192. package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.js +0 -13
  193. package/dist/assets/components/sources/ConfluenceSourceIcon.d.ts +0 -3
  194. package/dist/assets/components/sources/ConfluenceSourceIcon.js +0 -30
  195. package/dist/assets/components/sources/GithubSourceIcon.d.ts +0 -3
  196. package/dist/assets/components/sources/GithubSourceIcon.js +0 -27
  197. package/dist/assets/components/sources/GoogleDriveIcon.d.ts +0 -3
  198. package/dist/assets/components/sources/GoogleDriveIcon.js +0 -45
  199. package/dist/assets/components/sources/HubspotSourceIcon.d.ts +0 -3
  200. package/dist/assets/components/sources/HubspotSourceIcon.js +0 -14
  201. package/dist/assets/components/sources/JiraSourceIcon.d.ts +0 -3
  202. package/dist/assets/components/sources/JiraSourceIcon.js +0 -54
  203. package/dist/assets/components/sources/LinearSourceIcon.d.ts +0 -3
  204. package/dist/assets/components/sources/LinearSourceIcon.js +0 -14
  205. package/dist/assets/components/sources/MysqlLogoSourceIconDark.d.ts +0 -3
  206. package/dist/assets/components/sources/MysqlLogoSourceIconDark.js +0 -17
  207. package/dist/assets/components/sources/NetsuiteSourceIcon.d.ts +0 -3
  208. package/dist/assets/components/sources/NetsuiteSourceIcon.js +0 -32
  209. package/dist/assets/components/sources/NotionIcon.d.ts +0 -3
  210. package/dist/assets/components/sources/NotionIcon.js +0 -20
  211. package/dist/assets/components/sources/PostgresqlIcon.d.ts +0 -3
  212. package/dist/assets/components/sources/PostgresqlIcon.js +0 -61
  213. package/dist/assets/components/sources/S3Icon.d.ts +0 -3
  214. package/dist/assets/components/sources/S3Icon.js +0 -76
  215. package/dist/assets/components/sources/SalesforceSourceIcon.d.ts +0 -3
  216. package/dist/assets/components/sources/SalesforceSourceIcon.js +0 -23
  217. package/dist/assets/components/sources/SlackIcon.d.ts +0 -3
  218. package/dist/assets/components/sources/SlackIcon.js +0 -32
  219. package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.d.ts +0 -3
  220. package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.js +0 -14
  221. package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.d.ts +0 -3
  222. package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.js +0 -14
  223. package/dist/assets/components/sources/WikipediaSourceIcon.d.ts +0 -3
  224. package/dist/assets/components/sources/WikipediaSourceIcon.js +0 -1490
  225. package/dist/avatar/AvatarEmpty.d.ts +0 -7
  226. package/dist/avatar/AvatarEmpty.js +0 -99
  227. package/dist/avatar/types.d.ts +0 -5
  228. package/dist/avatar/types.js +0 -9
  229. package/dist/charts/utils.d.ts +0 -29
  230. package/dist/charts/utils.js +0 -62
  231. package/dist/icons/BackIcon.d.ts +0 -3
  232. package/dist/icons/BackIcon.js +0 -13
  233. package/dist/icons/CloseIcon.d.ts +0 -3
  234. package/dist/icons/CloseIcon.js +0 -13
  235. package/dist/icons/CreateIcon.d.ts +0 -3
  236. package/dist/icons/CreateIcon.js +0 -13
  237. package/dist/icons/ForwardIcon.d.ts +0 -3
  238. package/dist/icons/ForwardIcon.js +0 -13
  239. package/dist/icons/HelpIcon.d.ts +0 -3
  240. package/dist/icons/HelpIcon.js +0 -14
  241. package/dist/icons/ProjectsIcon.d.ts +0 -3
  242. package/dist/icons/ProjectsIcon.js +0 -12
  243. package/dist/icons/SearchIcon.d.ts +0 -3
  244. package/dist/icons/SearchIcon.js +0 -12
  245. package/dist/icons/SourcesIcon.d.ts +0 -3
  246. package/dist/icons/SourcesIcon.js +0 -12
  247. package/dist/icons/TextIcon.d.ts +0 -4
  248. package/dist/icons/TextIcon.js +0 -22
  249. package/dist/icons/WebScrapeIcon.d.ts +0 -4
  250. package/dist/icons/WebScrapeIcon.js +0 -22
  251. package/dist/icons/WebhookIcon.d.ts +0 -4
  252. package/dist/icons/WebhookIcon.js +0 -22
  253. package/dist/icons/sources/AttioLogomark.d.ts +0 -4
  254. package/dist/icons/sources/AttioLogomark.js +0 -8
  255. package/dist/icons/sources/BrowserbaseLogomark.d.ts +0 -4
  256. package/dist/icons/sources/BrowserbaseLogomark.js +0 -8
  257. package/dist/icons/sources/ClickhouseLogomark.d.ts +0 -4
  258. package/dist/icons/sources/ClickhouseLogomark.js +0 -16
  259. package/dist/icons/sources/ConfluenceLogomark.d.ts +0 -4
  260. package/dist/icons/sources/ConfluenceLogomark.js +0 -8
  261. package/dist/icons/sources/GithubLogomark.d.ts +0 -4
  262. package/dist/icons/sources/GithubLogomark.js +0 -8
  263. package/dist/icons/sources/GoogleBigqueryLogomark.d.ts +0 -4
  264. package/dist/icons/sources/GoogleBigqueryLogomark.js +0 -8
  265. package/dist/icons/sources/GoogleDriveLogomark.d.ts +0 -4
  266. package/dist/icons/sources/GoogleDriveLogomark.js +0 -8
  267. package/dist/icons/sources/HubspotLogomark.d.ts +0 -4
  268. package/dist/icons/sources/HubspotLogomark.js +0 -8
  269. package/dist/icons/sources/JiraLogomark.d.ts +0 -4
  270. package/dist/icons/sources/JiraLogomark.js +0 -8
  271. package/dist/icons/sources/LinearLogomark.d.ts +0 -4
  272. package/dist/icons/sources/LinearLogomark.js +0 -8
  273. package/dist/icons/sources/MySQLLogomark.d.ts +0 -4
  274. package/dist/icons/sources/MySQLLogomark.js +0 -8
  275. package/dist/icons/sources/NetsuiteLogomark.d.ts +0 -4
  276. package/dist/icons/sources/NetsuiteLogomark.js +0 -8
  277. package/dist/icons/sources/NotionLogomark.d.ts +0 -4
  278. package/dist/icons/sources/NotionLogomark.js +0 -8
  279. package/dist/icons/sources/PostgresLogomark.d.ts +0 -4
  280. package/dist/icons/sources/PostgresLogomark.js +0 -8
  281. package/dist/icons/sources/S3Logomark.d.ts +0 -4
  282. package/dist/icons/sources/S3Logomark.js +0 -8
  283. package/dist/icons/sources/SalesforceLogomark.d.ts +0 -4
  284. package/dist/icons/sources/SalesforceLogomark.js +0 -8
  285. package/dist/icons/sources/SlackLogoIconmark.d.ts +0 -4
  286. package/dist/icons/sources/SlackLogoIconmark.js +0 -8
  287. package/dist/icons/sources/SnowflakeLogomark.d.ts +0 -4
  288. package/dist/icons/sources/SnowflakeLogomark.js +0 -16
  289. package/dist/icons/sources/WikipediaLogomark.d.ts +0 -4
  290. package/dist/icons/sources/WikipediaLogomark.js +0 -8
  291. package/dist/spreadsheet/InfiniteSpreadsheet.d.ts +0 -3
  292. package/dist/spreadsheet/InfiniteSpreadsheet.js +0 -265
  293. package/dist/spreadsheet/SpreadsheetAddColumnButton.d.ts +0 -6
  294. package/dist/spreadsheet/SpreadsheetAddColumnButton.js +0 -32
  295. package/dist/spreadsheet/SpreadsheetCell.js +0 -115
  296. package/dist/spreadsheet/SpreadsheetHeaderCell.d.ts +0 -18
  297. package/dist/spreadsheet/SpreadsheetHeaderCell.js +0 -141
  298. package/dist/spreadsheet/SpreadsheetRow.d.ts +0 -21
  299. package/dist/spreadsheet/SpreadsheetRow.js +0 -68
  300. package/dist/spreadsheet/SpreadsheetRowActionCell.js +0 -78
  301. package/dist/spreadsheet/hooks/useColumnResize.d.ts +0 -6
  302. package/dist/spreadsheet/hooks/useColumnResize.js +0 -46
  303. package/dist/spreadsheet/types.d.ts +0 -92
  304. package/dist/spreadsheet/types.js +0 -21
  305. /package/dist/{spreadsheet → table}/SpreadsheetCellEditor.d.ts +0 -0
@@ -1,35 +1,51 @@
1
- import type { ChartLabelFormatter, ChartTooltipRenderer, ChartValueFormatter, PieSlice } from "./types";
2
- export interface PieChartProps {
3
- /** Slice data */
4
- slices: PieSlice[];
5
- /** Chart width in pixels. Optional when fillWidth is true. */
6
- width?: number;
7
- /** Chart height in pixels. Optional when aspectRatio is provided. */
8
- height?: number;
9
- /** When true, chart fills container width */
10
- fillWidth?: boolean;
11
- /** Aspect ratio (width/height). Used to auto-calculate height when fillWidth is true. */
12
- aspectRatio?: number;
13
- /** Inner radius for donut charts (0 = full pie) */
14
- innerRadius?: number;
15
- /** Gap between slices in radians */
1
+ import type { ReactNode } from "react";
2
+ import type { BaseChartProps, ChartSeriesStyles, ChartSize, PieChartSliceDatum } from "./types";
3
+ export type PieChartProps<TSlice extends string> = BaseChartProps & ChartSize & {
4
+ /**
5
+ * Presentation for every slice, keyed by slice.
6
+ *
7
+ * `TSlice` is inferred from these keys alone `slices` wraps it in
8
+ * `NoInfer` — so a mistyped key is a compile error rather than a slice that
9
+ * silently fails to draw.
10
+ */
11
+ series: ChartSeriesStyles<TSlice>;
12
+ /** Slices, rendered clockwise from 12 o'clock in array order. */
13
+ slices: PieChartSliceDatum<NoInfer<TSlice>>[];
14
+ /**
15
+ * Hole size as a fraction of the outer radius, 0–1.
16
+ * `0` is a solid pie. Defaults to a donut.
17
+ */
18
+ innerRadiusRatio?: number;
19
+ /** Gap between slices, in radians. */
16
20
  padAngle?: number;
17
- /** Rounded slice corners in px */
21
+ /** Slice corner radius in px. */
18
22
  cornerRadius?: number;
19
- /** Format values in tooltip/labels */
20
- valueFormatter?: ChartValueFormatter;
21
- /** Format labels in legend/tooltip */
22
- labelFormatter?: ChartLabelFormatter;
23
- /** Custom tooltip renderer */
24
- tooltipRenderer?: ChartTooltipRenderer;
25
- /** Disable tooltip */
26
- noTooltip?: boolean;
27
- /** Show legend */
28
- showLegend?: boolean;
29
- /** Show percentage labels on slices */
30
- showLabels?: boolean;
31
- /** Accessible label for the chart SVG */
32
- ariaLabel?: string;
33
- }
34
- declare const PieChart: ({ slices, width, height, fillWidth, aspectRatio, innerRadius, padAngle, cornerRadius, valueFormatter, labelFormatter, tooltipRenderer, noTooltip, showLegend, showLabels, ariaLabel, }: PieChartProps) => import("react").JSX.Element;
23
+ /**
24
+ * Slices below this share of the total are folded into one bucket.
25
+ * Set `0` to render every slice faithfully.
26
+ */
27
+ minSliceShare?: number;
28
+ /** Label for the folded bucket. @default "Other" */
29
+ aggregatedLabel?: string;
30
+ /**
31
+ * Content for the donut hole — a total, a headline percentage.
32
+ * Ignored when `innerRadiusRatio` is 0.
33
+ */
34
+ centerContent?: ReactNode;
35
+ /**
36
+ * Notified when a slice is pinned or unpinned by a click.
37
+ *
38
+ * The index is a position in the *rendered* arcs, which excludes folded
39
+ * slices and may include the aggregated bucket.
40
+ */
41
+ onPinnedChange?: (sliceIndex: number | null) => void;
42
+ };
43
+ /**
44
+ * Pie and donut chart.
45
+ *
46
+ * Unlike the cartesian charts there is no category axis to hit-test against, so
47
+ * each arc is its own target. Small slices are folded into an "Other" bucket by
48
+ * default, which keeps every remaining arc large enough to actually hit.
49
+ */
50
+ declare const PieChart: <TSlice extends string>({ series, slices, width, height, fillWidth, fillHeight, aspectRatio, margin, innerRadiusRatio, padAngle, cornerRadius, minSliceShare, aggregatedLabel, centerContent, valueUnit, valueFormatter, labelFormatter, showLegend, noTooltip, tooltipRenderer, isLoading, contentWhenEmpty, ariaLabel, ariaDescription, onPinnedChange, }: PieChartProps<TSlice>) => import("react").JSX.Element;
35
51
  export default PieChart;
@@ -1,183 +1,193 @@
1
- import { useGalaxyTheme, withTheme } from "../theme/GalaxyTheme.js";
2
- import Text, { TextSize, TextWeight } from "../text/Text.js";
3
1
  import FlexWrapper, { AlignItems, FlexDirection, JustifyContent } from "../containers/FlexWrapper.js";
4
- import { useElementWidth } from "../hooks/useElementWidth.js";
5
- import Wrapper from "../containers/Wrapper.js";
6
- import { getChartPalette } from "./constants.js";
7
- import { defaultLabelFormatter, defaultValueFormatter } from "./utils.js";
8
- import ChartLegend from "./ChartLegend.js";
9
- import ChartTooltip from "./ChartTooltip.js";
10
- /* empty css */
11
- import { styled } from "@linaria/react";
12
- import { useCallback, useMemo, useRef, useState } from "react";
13
- import { jsx, jsxs } from "react/jsx-runtime";
14
- import { arc, pie } from "d3-shape";
2
+ import { ChartKind, ChartTargetShape } from "./types.js";
3
+ import { PIE_CHART_MARGIN, PIE_MIN_SLICE_SHARE } from "./constants.js";
4
+ import { useSeriesColorResolver } from "./useSeriesColorResolver.js";
5
+ import { ChartTooltipVerticalAlign } from "./useChartTooltipPosition.js";
6
+ import { useChartInteraction } from "./useChartInteraction.js";
7
+ import { useChartFormatters } from "./useChartFormatters.js";
8
+ import { useChartDimensions } from "./useChartDimensions.js";
9
+ import { buildPieChartGeometry } from "./pieChartGeometry.js";
10
+ import { ChartArcPath, ChartCenterBox } from "./ChartPrimitives.js";
11
+ import ChartFrame from "./ChartFrame.js";
12
+ import { useCallback, useMemo, useRef } from "react";
13
+ import { jsx } from "react/jsx-runtime";
15
14
  //#region src/charts/PieChart.tsx
16
- var DEFAULT_PAD_ANGLE = .02;
17
- var DEFAULT_CORNER_RADIUS = 2;
18
- var PIE_MARGIN = 8;
19
- var _exp = () => ({ $fillWidth }) => $fillWidth ? "flex" : "inline-flex";
20
- var _exp2 = () => ({ $fillWidth }) => $fillWidth ? "100%" : "auto";
21
- var ChartWrapper = withTheme(/*#__PURE__*/ styled("div")({
22
- name: "ChartWrapper",
23
- class: "c1ez9f1",
24
- propsAsIs: false,
25
- vars: {
26
- "c1ez9f1-0": [_exp()],
27
- "c1ez9f1-1": [_exp2()]
28
- }
29
- }));
30
- var resolveSliceColor = (slice, index, palette) => slice.color ?? palette[index % palette.length];
31
- var PieChart = ({ slices, width, height, fillWidth = false, aspectRatio, innerRadius = 0, padAngle = DEFAULT_PAD_ANGLE, cornerRadius = DEFAULT_CORNER_RADIUS, valueFormatter = defaultValueFormatter, labelFormatter = defaultLabelFormatter, tooltipRenderer, noTooltip = false, showLegend = true, showLabels = false, ariaLabel }) => {
32
- const { theme } = useGalaxyTheme();
15
+ /**
16
+ * Pie and donut chart.
17
+ *
18
+ * Unlike the cartesian charts there is no category axis to hit-test against, so
19
+ * each arc is its own target. Small slices are folded into an "Other" bucket by
20
+ * default, which keeps every remaining arc large enough to actually hit.
21
+ */
22
+ var PieChart = ({ series, slices, width, height, fillWidth, fillHeight, aspectRatio, margin, innerRadiusRatio, padAngle, cornerRadius, minSliceShare = PIE_MIN_SLICE_SHARE, aggregatedLabel, centerContent, valueUnit, valueFormatter, labelFormatter, showLegend = true, noTooltip = false, tooltipRenderer, isLoading = false, contentWhenEmpty, ariaLabel, ariaDescription, onPinnedChange }) => {
33
23
  const containerRef = useRef(null);
34
- const svgRef = useRef(null);
35
- const [tooltip, setTooltip] = useState(null);
36
- const [hoveredSliceIndex, setHoveredSliceIndex] = useState(null);
37
- const measuredWidth = useElementWidth(containerRef);
38
- const resolvedWidth = fillWidth ? measuredWidth ?? 0 : width ?? 0;
39
- const resolvedHeight = aspectRatio ? resolvedWidth / aspectRatio : height ?? 0;
40
- const palette = useMemo(() => getChartPalette(theme), [theme]);
41
- const outerRadius = useMemo(() => Math.min(resolvedWidth, resolvedHeight) / 2 - PIE_MARGIN, [resolvedWidth, resolvedHeight]);
42
- const effectivePadAngle = innerRadius > 0 ? padAngle : 0;
43
- const pieGen = useMemo(() => pie().value((d) => d.value).sort(null).padAngle(effectivePadAngle), [effectivePadAngle]);
44
- const arcs = useMemo(() => pieGen(slices), [pieGen, slices]);
45
- const arcGen = useMemo(() => arc().innerRadius(innerRadius).outerRadius(outerRadius).cornerRadius(cornerRadius), [
46
- innerRadius,
47
- outerRadius,
48
- cornerRadius
24
+ const colors = useSeriesColorResolver(series);
25
+ const dimensions = useChartDimensions({
26
+ containerRef,
27
+ width,
28
+ height,
29
+ fillWidth,
30
+ fillHeight,
31
+ aspectRatio,
32
+ margin,
33
+ defaultMargin: PIE_CHART_MARGIN
34
+ });
35
+ const { plotWidth, plotHeight } = dimensions;
36
+ const { formatValue, formatLabel } = useChartFormatters({
37
+ valueFormatter,
38
+ valueUnit,
39
+ labelFormatter
40
+ });
41
+ const getSliceLabel = useCallback((sliceKey) => series[sliceKey]?.label ?? sliceKey, [series]);
42
+ const getSliceColor = useCallback((sliceKey) => series[sliceKey]?.color, [series]);
43
+ const resolveColor = useCallback(({ sliceKey, explicit }) => sliceKey === null ? colors.neutral : colors.resolve(sliceKey, explicit), [colors]);
44
+ const geometry = useMemo(() => buildPieChartGeometry({
45
+ slices,
46
+ plotWidth,
47
+ plotHeight,
48
+ innerRadiusRatio,
49
+ padAngle,
50
+ cornerRadius,
51
+ minSliceShare,
52
+ aggregatedLabel,
53
+ resolveColor,
54
+ getSliceColor,
55
+ getSliceLabel
56
+ }), [
57
+ slices,
58
+ plotWidth,
59
+ plotHeight,
60
+ innerRadiusRatio,
61
+ padAngle,
62
+ cornerRadius,
63
+ minSliceShare,
64
+ aggregatedLabel,
65
+ resolveColor,
66
+ getSliceColor,
67
+ getSliceLabel
49
68
  ]);
50
- const labelArc = useMemo(() => {
51
- const mid = innerRadius > 0 ? (innerRadius + outerRadius) / 2 : outerRadius * .65;
52
- return arc().innerRadius(mid).outerRadius(mid);
53
- }, [innerRadius, outerRadius]);
54
- const total = useMemo(() => slices.reduce((sum, s) => sum + s.value, 0), [slices]);
55
- const handleSliceMouseEnter = useCallback((sliceIndex, event) => {
56
- const slice = slices[sliceIndex];
57
- if (!slice) return;
58
- const svgRect = svgRef.current?.getBoundingClientRect();
59
- if (!svgRect) return;
60
- setHoveredSliceIndex(sliceIndex);
61
- setTooltip({
62
- label: labelFormatter(slice.label),
63
- items: [{
64
- seriesKey: slice.label,
65
- seriesName: labelFormatter(slice.label),
66
- value: slice.value,
67
- color: resolveSliceColor(slice, sliceIndex, palette)
69
+ const isEmpty = geometry.arcs.length === 0;
70
+ const legendItems = useMemo(() => geometry.arcs.map((chartArc) => ({
71
+ key: chartArc.id,
72
+ label: formatLabel(chartArc.label),
73
+ color: chartArc.color
74
+ })), [geometry.arcs, formatLabel]);
75
+ const legendKeys = useMemo(() => legendItems.map((item) => item.key), [legendItems]);
76
+ const interaction = useChartInteraction({
77
+ categoryCount: geometry.arcs.length,
78
+ seriesKeys: legendKeys,
79
+ disabled: noTooltip || isLoading || isEmpty,
80
+ isLoading,
81
+ onPinnedChange
82
+ });
83
+ const buildCategoryTooltip = useCallback((index) => {
84
+ const chartArc = geometry.arcs[index];
85
+ if (!chartArc) return null;
86
+ return {
87
+ label: formatLabel(chartArc.label),
88
+ rows: [{
89
+ key: chartArc.id,
90
+ label: `${Math.round(chartArc.share * 1e3) / 10}% of total`,
91
+ value: chartArc.value,
92
+ formattedValue: formatValue(chartArc.value),
93
+ color: chartArc.color
68
94
  }],
69
- x: event.clientX - svgRect.left,
70
- y: event.clientY - svgRect.top
71
- });
95
+ anchorX: chartArc.anchorX,
96
+ anchorY: chartArc.anchorY
97
+ };
72
98
  }, [
73
- slices,
74
- palette,
75
- labelFormatter
99
+ geometry.arcs,
100
+ formatValue,
101
+ formatLabel
76
102
  ]);
77
- const handleSliceMouseMove = useCallback((event) => {
78
- if (hoveredSliceIndex === null) return;
79
- const svgRect = svgRef.current?.getBoundingClientRect();
80
- if (!svgRect) return;
81
- setTooltip((prev) => prev ? {
82
- ...prev,
83
- x: event.clientX - svgRect.left,
84
- y: event.clientY - svgRect.top
85
- } : null);
86
- }, [hoveredSliceIndex]);
87
- const handleSliceMouseLeave = useCallback(() => {
88
- setHoveredSliceIndex(null);
89
- setTooltip(null);
90
- }, []);
91
- const legendSeries = useMemo(() => slices.map((s, i) => ({
92
- key: s.label,
93
- name: labelFormatter(s.label),
94
- color: resolveSliceColor(s, i, palette)
95
- })), [
96
- slices,
97
- palette,
98
- labelFormatter
103
+ /**
104
+ * A slice reads better than the generic "label: row, row" sentence.
105
+ *
106
+ * The frame's default would render "Enterprise: 42.1% of total 1,240", which
107
+ * puts the share where a reader expects the value.
108
+ */
109
+ const describeCategory = useCallback((index) => {
110
+ const chartArc = geometry.arcs[index];
111
+ if (!chartArc) return "";
112
+ const share = `${Math.round(chartArc.share * 1e3) / 10}% of total`;
113
+ return `${formatLabel(chartArc.label)}, ${formatValue(chartArc.value)}, ${share}`;
114
+ }, [
115
+ geometry.arcs,
116
+ formatValue,
117
+ formatLabel
99
118
  ]);
100
- if (resolvedWidth === 0 || resolvedHeight === 0) return /* @__PURE__ */ jsx(ChartWrapper, {
101
- ref: containerRef,
102
- $fillWidth: fillWidth
103
- });
104
- const cx = resolvedWidth / 2;
105
- const cy = resolvedHeight / 2;
106
- const defaultAriaLabel = `Pie chart with ${slices.length} slices`;
107
- return /* @__PURE__ */ jsxs(ChartWrapper, {
108
- ref: containerRef,
109
- $fillWidth: fillWidth,
110
- children: [/* @__PURE__ */ jsxs(Wrapper, {
111
- position: "relative",
112
- children: [/* @__PURE__ */ jsx("svg", {
113
- ref: svgRef,
114
- width: resolvedWidth,
115
- height: resolvedHeight,
116
- role: "img",
117
- "aria-label": ariaLabel ?? defaultAriaLabel,
118
- children: /* @__PURE__ */ jsx("g", {
119
- transform: `translate(${cx}, ${cy})`,
120
- children: arcs.map((d, i) => {
121
- const color = resolveSliceColor(d.data, i, palette);
122
- const isDimmed = hoveredSliceIndex !== null && hoveredSliceIndex !== i;
123
- const path = arcGen(d) ?? "";
124
- const pct = total > 0 ? Math.round(d.data.value / total * 100) : 0;
125
- return /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("path", {
126
- d: path,
127
- fill: color,
128
- opacity: isDimmed ? .3 : 1,
129
- style: {
130
- transition: `opacity 150ms ease-in-out`,
131
- cursor: "pointer"
132
- },
133
- onMouseEnter: (e) => handleSliceMouseEnter(i, e),
134
- onMouseMove: handleSliceMouseMove,
135
- onMouseLeave: handleSliceMouseLeave,
136
- onFocus: (e) => handleSliceMouseEnter(i, e),
137
- onBlur: handleSliceMouseLeave,
138
- tabIndex: 0,
139
- role: "graphics-symbol",
140
- "aria-roledescription": "slice",
141
- "aria-label": `${labelFormatter(d.data.label)}: ${valueFormatter(d.data.value)} (${pct}%)`
142
- }), showLabels && pct > 5 && (() => {
143
- const [lx, ly] = labelArc.centroid(d);
144
- const labelW = 48;
145
- const labelH = 20;
146
- return /* @__PURE__ */ jsx("foreignObject", {
147
- x: lx - labelW / 2,
148
- y: ly - labelH / 2,
149
- width: labelW,
150
- height: labelH,
151
- style: { pointerEvents: "none" },
152
- children: /* @__PURE__ */ jsx(FlexWrapper, {
153
- justifyContent: JustifyContent.CENTER,
154
- alignItems: AlignItems.CENTER,
155
- fillWidth: true,
156
- fillHeight: true,
157
- children: /* @__PURE__ */ jsx(Text, {
158
- size: TextSize.CAPTION,
159
- weight: TextWeight.MEDIUM,
160
- hex: theme.color.text.primaryAlt,
161
- children: `${pct}%`
162
- })
163
- })
164
- });
165
- })()] }, d.data.label);
166
- })
119
+ /**
120
+ * Targets reuse each arc's own `d`, drawn again transparent above the marks.
121
+ *
122
+ * The arcs themselves stop being interactive: hit testing, focus and the
123
+ * focus ring then work identically on all three charts, instead of the pie
124
+ * attaching handlers permanently and toggling `data-interactive` while the
125
+ * cartesian charts rendered their targets away.
126
+ */
127
+ const categoryTargets = useMemo(() => geometry.arcs.map((chartArc) => ({
128
+ key: chartArc.id,
129
+ shape: ChartTargetShape.PATH,
130
+ d: chartArc.path
131
+ })), [geometry.arcs]);
132
+ const showCenter = centerContent && (innerRadiusRatio ?? .62) > 0;
133
+ return /* @__PURE__ */ jsx(ChartFrame, {
134
+ containerRef,
135
+ dimensions,
136
+ fillWidth,
137
+ fillHeight,
138
+ interaction,
139
+ kind: ChartKind.PIE,
140
+ categoryCount: geometry.arcs.length,
141
+ ariaLabel,
142
+ ariaDescription,
143
+ noTooltip,
144
+ buildCategoryTooltip,
145
+ tooltipRenderer,
146
+ categoryTargets,
147
+ categoryTargetsTransform: `translate(${geometry.centerX}, ${geometry.centerY})`,
148
+ wrapCategoryNavigation: true,
149
+ describeCategory,
150
+ placeAwayFromX: geometry.centerX,
151
+ verticalAlign: ChartTooltipVerticalAlign.CENTERED,
152
+ isEmpty,
153
+ isLoading,
154
+ contentWhenEmpty,
155
+ showLegend,
156
+ legendItems,
157
+ legendInset: 0,
158
+ plotOverlay: showCenter && !isEmpty ? /* @__PURE__ */ jsx(ChartDonutCenter, {
159
+ centerX: dimensions.margin.left + geometry.centerX,
160
+ centerY: dimensions.margin.top + geometry.centerY,
161
+ diameter: geometry.innerRadius * 2,
162
+ children: centerContent
163
+ }) : null,
164
+ children: /* @__PURE__ */ jsx("g", {
165
+ transform: `translate(${geometry.centerX}, ${geometry.centerY})`,
166
+ children: geometry.arcs.map((chartArc, index) => /* @__PURE__ */ jsx(ChartArcPath, {
167
+ d: chartArc.path,
168
+ fill: chartArc.color,
169
+ "data-state": interaction.getMarkState({
170
+ categoryIndex: index,
171
+ seriesKey: chartArc.id
167
172
  })
168
- }), !noTooltip && (tooltipRenderer ? tooltip && tooltipRenderer(tooltip) : /* @__PURE__ */ jsx(ChartTooltip, {
169
- data: tooltip,
170
- valueFormatter
171
- }))]
172
- }), showLegend && /* @__PURE__ */ jsx(FlexWrapper, {
173
- direction: FlexDirection.ROW,
174
- gap: 0,
175
- children: /* @__PURE__ */ jsx(ChartLegend, {
176
- series: legendSeries,
177
- palette
178
- })
179
- })]
173
+ }, chartArc.id))
174
+ })
180
175
  });
181
176
  };
177
+ /** Positions arbitrary content inside the donut hole. */
178
+ var ChartDonutCenter = ({ centerX, centerY, diameter, children }) => /* @__PURE__ */ jsx(ChartCenterBox, {
179
+ $centerX: centerX,
180
+ $centerY: centerY,
181
+ $diameter: diameter,
182
+ children: /* @__PURE__ */ jsx(FlexWrapper, {
183
+ direction: FlexDirection.COLUMN,
184
+ justifyContent: JustifyContent.CENTER,
185
+ alignItems: AlignItems.CENTER,
186
+ gap: 2,
187
+ fillWidth: true,
188
+ fillHeight: true,
189
+ children
190
+ })
191
+ });
182
192
  //#endregion
183
193
  export { PieChart as default };
@@ -0,0 +1,120 @@
1
+ import { buildValueScale } from "./chartScales";
2
+ import { BarChartNormalization, BarCorners } from "./types";
3
+ import type { BarChartGroupDatum, ChartPalette } from "./types";
4
+ /**
5
+ * Rectangle with one pair of corners rounded.
6
+ *
7
+ * The radius is clamped to half the height as well as half the width, so a very
8
+ * short bar renders as a symmetric cap instead of a lopsided half-pill.
9
+ */
10
+ export declare function roundedRectPath(x: number, y: number, width: number, height: number, radius: number, corners: BarCorners): string;
11
+ /**
12
+ * Signed value domain across every group.
13
+ *
14
+ * Percent-normalized charts always span 0–1, so the axis is stable no matter
15
+ * what the underlying totals are.
16
+ */
17
+ export declare function getBarValueDomain<TMetric extends string, TComponentKey extends string>(groups: BarChartGroupDatum<TMetric, TComponentKey>[], normalization: BarChartNormalization): [number, number];
18
+ /**
19
+ * A single rendered rectangle.
20
+ *
21
+ * The geometry layer flattens the group/bar/component hierarchy into an array
22
+ * of these, so rendering is a plain `.map()` with no nested loops or
23
+ * accumulators in the component body.
24
+ */
25
+ export interface BarChartRect<TMetric extends string, TComponentKey extends string = string> {
26
+ /**
27
+ * React key: `${groupIndex}:${barIndex}:${componentKey}`.
28
+ *
29
+ * Deliberately index-based rather than label-based — group labels are free to
30
+ * repeat, and duplicated keys would silently drop rectangles.
31
+ */
32
+ id: string;
33
+ groupIndex: number;
34
+ metric: TMetric;
35
+ componentKey: TComponentKey;
36
+ /** The component's label, carried through for the tooltip. */
37
+ label: string;
38
+ /** The raw value, before any normalization. */
39
+ value: number;
40
+ x: number;
41
+ y: number;
42
+ width: number;
43
+ height: number;
44
+ /** Resolved from the theme — never a raw hex from consumer data. */
45
+ color: string;
46
+ /** Interior stack segments get {@link BarCorners.NONE}. */
47
+ corners: BarCorners;
48
+ /** Corner radius in px, reduced for narrow bars so the curve can't dominate. */
49
+ radius: number;
50
+ }
51
+ /**
52
+ * A category's invisible hit target and tooltip anchor.
53
+ *
54
+ * Hit testing happens per group rather than per rectangle: a two-pixel bar is
55
+ * then exactly as hoverable as a two-hundred-pixel one, and moving the pointer
56
+ * between segments inside one group fires nothing, so the tooltip stays put
57
+ * instead of jumping between segment tops.
58
+ */
59
+ export interface BarChartGroupBand {
60
+ groupIndex: number;
61
+ label: string;
62
+ /** Tiles edge to edge with its neighbours, so there are no dead gutters. */
63
+ x: number;
64
+ y: number;
65
+ width: number;
66
+ height: number;
67
+ /** Group centre, at the top of its tallest bar. Stable while hovering. */
68
+ anchorX: number;
69
+ anchorY: number;
70
+ }
71
+ export interface BarChartGeometry<TMetric extends string, TComponentKey extends string = string> {
72
+ /** Every rendered rectangle, in draw order. */
73
+ rects: BarChartRect<TMetric, TComponentKey>[];
74
+ /** One hit target per group, tiling the plot with no gaps. */
75
+ bands: BarChartGroupBand[];
76
+ /** The resolved value scale, shared with the axis. */
77
+ valueScale: ReturnType<typeof buildValueScale>;
78
+ }
79
+ interface BuildBarChartGeometryArgs<TMetric extends string, TComponentKey extends string> {
80
+ groups: BarChartGroupDatum<TMetric, TComponentKey>[];
81
+ plotWidth: number;
82
+ plotHeight: number;
83
+ normalization: BarChartNormalization;
84
+ /**
85
+ * Whether the chart as a whole is stacked.
86
+ *
87
+ * Chart-wide, not per bar, because it decides the *colour rule* and the legend
88
+ * lists one domain for the whole chart. Deriving it per bar would colour a
89
+ * single-component bar by metric while the legend named components.
90
+ */
91
+ isStacked: boolean;
92
+ /**
93
+ * The final value domain, already overridden, zeroed and niced.
94
+ *
95
+ * Resolved by the caller rather than here, because the left gutter is sized
96
+ * from the tick labels and therefore needs the domain before the plot — and
97
+ * hence this builder — exists.
98
+ */
99
+ domain: [number, number];
100
+ /**
101
+ * Maps one segment to a concrete color.
102
+ *
103
+ * The geometry deliberately does not decide the rule — it only reports what
104
+ * it knows about the segment. Whether a stack is coloured by component or a
105
+ * group by metric is a presentation question, and it needs the `series`
106
+ * record to answer, which this module has no business importing.
107
+ */
108
+ resolveColor: (args: ResolveBarColorArgs<TMetric>) => string;
109
+ }
110
+ export interface ResolveBarColorArgs<TMetric extends string> {
111
+ metric: TMetric;
112
+ /** Index of the component within its bar. */
113
+ componentIndex: number;
114
+ /** True when the *chart* is stacked — see the option of the same name. */
115
+ isStacked: boolean;
116
+ /** The component's own palette override, if it declared one. */
117
+ explicit?: ChartPalette;
118
+ }
119
+ export declare function buildBarChartGeometry<TMetric extends string, TComponentKey extends string = string>({ groups, plotWidth, plotHeight, normalization, isStacked, domain, resolveColor, }: BuildBarChartGeometryArgs<TMetric, TComponentKey>): BarChartGeometry<TMetric, TComponentKey>;
120
+ export {};