@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
@@ -0,0 +1,26 @@
1
+ import { ChartPalette } from "./types.js";
2
+ import { CHART_PALETTE_ORDER } from "./constants.js";
3
+ import { match } from "ts-pattern";
4
+ //#region src/charts/chartTheme.ts
5
+ /**
6
+ * Palette resolution for the chart components.
7
+ *
8
+ * Consumer data names a {@link ChartPalette} slot; the concrete color is looked
9
+ * up here against the active theme. That keeps raw hex out of application data
10
+ * and guarantees both themes render correctly.
11
+ *
12
+ * Linaria evaluates this module at build time, so it must not import components.
13
+ */
14
+ /** Resolve a palette slot to a concrete color for the active theme. */
15
+ function resolveChartPaletteColor(theme, palette) {
16
+ return match(palette).with(ChartPalette.PURPLE, () => theme.color.icon.purple).with(ChartPalette.PINK, () => theme.color.icon.pink).with(ChartPalette.BLUE, () => theme.color.icon.blue).with(ChartPalette.TEAL, () => theme.color.icon.teal).with(ChartPalette.LIME, () => theme.color.icon.lime).with(ChartPalette.ORANGE, () => theme.color.icon.orange).with(ChartPalette.YELLOW, () => theme.color.icon.yellow).with(ChartPalette.GREEN, () => theme.color.icon.success).with(ChartPalette.RED, () => theme.color.icon.error).exhaustive();
17
+ }
18
+ /**
19
+ * Resolve the color for a series, honoring an explicit slot and otherwise
20
+ * falling back to the series' position in the default palette order.
21
+ */
22
+ function resolveSeriesColor(theme, index, palette) {
23
+ return resolveChartPaletteColor(theme, palette ?? CHART_PALETTE_ORDER[index % CHART_PALETTE_ORDER.length]);
24
+ }
25
+ //#endregion
26
+ export { resolveChartPaletteColor, resolveSeriesColor };
@@ -1,22 +1,245 @@
1
- import type { Theme } from "../theme/types";
1
+ import { ChartPalette } from "./types";
2
2
  import type { ChartMargin } from "./types";
3
3
  /**
4
- * Theme-derived chart series color palette.
5
- * Purple first to match Galaxy brand aesthetic.
4
+ * Layout and motion tokens for the chart components.
5
+ *
6
+ * This module is evaluated by Linaria at build time — its constants are
7
+ * interpolated statically into styled templates — so it must stay free of
8
+ * component imports. Pulling React, framer-motion or Phosphor in here would
9
+ * drag them into build-time evaluation.
6
10
  */
7
- export declare const getChartPalette: (theme: Theme) => string[];
8
11
  export declare const DEFAULT_CHART_MARGIN: ChartMargin;
9
- /** Spacing between bars within a group (fraction of bandwidth, 0-1) */
10
- export declare const DEFAULT_BAR_PADDING_INNER = 0.2;
11
- /** Spacing around bar groups (fraction of step, 0-1) */
12
- export declare const DEFAULT_BAR_PADDING_OUTER = 0.1;
13
- /** Default bar top-corner radius in px */
14
- export declare const DEFAULT_BAR_RADIUS = 4;
15
- /** Default line stroke width in px */
16
- export declare const DEFAULT_LINE_STROKE_WIDTH = 2;
17
- /** Default data-point dot radius in px */
18
- export declare const DEFAULT_LINE_DOT_RADIUS = 4;
19
- /** Transition duration in ms for hover effects */
20
- export declare const CHART_TRANSITION_MS = 150;
21
- /** Default number of y-axis ticks */
22
- export declare const DEFAULT_Y_TICK_COUNT = 5;
12
+ /**
13
+ * Gap between a value-axis tick label and the plot edge.
14
+ *
15
+ * The label box is `margin.left - VALUE_AXIS_TICK_GAP` wide, so the axis
16
+ * geometry follows the margin instead of hardcoding an offset.
17
+ */
18
+ export declare const VALUE_AXIS_TICK_GAP = 12;
19
+ /** Height of a value-axis tick label box in px. */
20
+ export declare const VALUE_AXIS_LABEL_HEIGHT = 20;
21
+ /** Height of the category-axis label box in px. */
22
+ export declare const CATEGORY_AXIS_LABEL_HEIGHT = 24;
23
+ /** Gap between the plot's bottom edge and the category labels, in px. */
24
+ export declare const CATEGORY_AXIS_LABEL_GAP = 8;
25
+ /** Band reserved for an axis title, in px. Sized for one CAPTION line. */
26
+ export declare const AXIS_TITLE_BAND = 18;
27
+ /**
28
+ * Clear space between an axis title and its tick labels, in px.
29
+ *
30
+ * The category axis gets this for free: its labels sit in a 24px box and its
31
+ * title in an 18px band, and centring a CAPTION line in each leaves roughly this
32
+ * much air between the two. The value axis has no such slack — its title band
33
+ * abuts the label box exactly — so without reserving it here a wide tick number
34
+ * runs straight into the rotated title, and the two axes visibly disagree.
35
+ */
36
+ export declare const AXIS_TITLE_GAP = 8;
37
+ /** Default approximate tick count on the value axis. */
38
+ export declare const DEFAULT_VALUE_TICK_COUNT = 5;
39
+ /** Corner radius applied to the outer end of a wide bar, in px. */
40
+ export declare const BAR_RADIUS = 4;
41
+ /** Corner radius for bars narrower than {@link NARROW_BAR_WIDTH}, in px. */
42
+ export declare const BAR_RADIUS_NARROW = 2;
43
+ /** Bars below this width use the smaller radius so the curve doesn't dominate. */
44
+ export declare const NARROW_BAR_WIDTH = 40;
45
+ /**
46
+ * Px shaved off a stacked segment's covered edge to separate it from its
47
+ * neighbour.
48
+ *
49
+ * Keep this a whole number. The geometry snaps every stack boundary to a whole
50
+ * pixel first, so an integer gap renders at exactly the same size at every seam;
51
+ * a fractional one would land differently against the device pixel grid from one
52
+ * boundary to the next and read as uneven.
53
+ *
54
+ * Applied to every segment except the one sitting on the baseline, so each seam
55
+ * gets a gap and the bar still meets the axis flush.
56
+ */
57
+ export declare const STACK_SEGMENT_GAP = 2;
58
+ /** Minimum rendered height for a non-zero bar, in px. */
59
+ export declare const MIN_BAR_LENGTH = 2;
60
+ /**
61
+ * Target gaps in px between groups, and between bars within a group.
62
+ *
63
+ * The within-group gap must stay clearly smaller than the between-group gap —
64
+ * that ratio is the only thing making a group read as a group. When the two are
65
+ * close, the eye has nothing to bind a group's bars together and the chart reads
66
+ * as one long row of unrelated bars.
67
+ */
68
+ export declare const GROUP_GAP_COMFORTABLE = 24;
69
+ export declare const BAR_GAP_COMFORTABLE = 6;
70
+ export declare const GROUP_GAP_MEDIUM = 16;
71
+ export declare const BAR_GAP_MEDIUM = 4;
72
+ export declare const GROUP_GAP_TIGHT = 12;
73
+ export declare const BAR_GAP_TIGHT = 3;
74
+ /**
75
+ * Fraction of its available slot a bar actually fills.
76
+ *
77
+ * Bars sized to consume every last pixel of their group read as heavy, and the
78
+ * chart becomes a wall of colour rather than a set of measurements. Holding them
79
+ * back leaves air on both sides of each group without touching the gap between
80
+ * neighbouring bars.
81
+ */
82
+ export declare const BAR_WIDTH_RATIO = 0.8;
83
+ /**
84
+ * Ceiling on a single bar's thickness, in px.
85
+ *
86
+ * Without it a two- or three-category chart divides the whole plot between a
87
+ * handful of bars and produces slabs — the width stops carrying information the
88
+ * moment it exceeds what the eye needs to compare heights.
89
+ */
90
+ export declare const MAX_BAR_WIDTH = 44;
91
+ /** Below this many bars the chart always uses comfortable spacing. */
92
+ export declare const MIN_BARS_FOR_TIGHT_SPACING = 13;
93
+ /**
94
+ * Ceiling on a gap, as a share of the space it divides.
95
+ *
96
+ * The gaps above are absolute pixel values chosen from chart-wide density, which
97
+ * says nothing about how much room a *single* category actually got. Forty
98
+ * categories in a 650px plot leave a 16px step, and a 24px gap subtracted from
99
+ * that goes negative — the width lands on its 1px floor and every bar renders as
100
+ * a hairline. Capping the gap proportionally keeps it honest at any density: it
101
+ * stays exactly as specified whenever there is room, and degrades smoothly when
102
+ * there is not.
103
+ */
104
+ export declare const MAX_GAP_SHARE = 0.3;
105
+ /** Plot widths above this stay comfortable; below the tight threshold go tight. */
106
+ export declare const WIDTH_FOR_MEDIUM_SPACING = 650;
107
+ export declare const WIDTH_FOR_TIGHT_SPACING = 500;
108
+ /** Grid lines extend this far past both plot edges, in px. */
109
+ export declare const GRID_LINE_BLEED = 12;
110
+ export declare const DEFAULT_LINE_STROKE_WIDTH = 1.5;
111
+ /** Radius of the dot marking a point on a hovered category, in px. */
112
+ export declare const LINE_POINT_RADIUS = 3.5;
113
+ /** Opacity of the area fill under a line. */
114
+ export declare const LINE_AREA_OPACITY = 0.12;
115
+ /** Gap between slices, in radians. */
116
+ export declare const PIE_PAD_ANGLE = 0.012;
117
+ /** Slice corner radius in px. */
118
+ export declare const PIE_CORNER_RADIUS = 2;
119
+ /** Inner radius as a fraction of the outer radius, for donut mode. */
120
+ export declare const PIE_DONUT_INNER_RATIO = 0.62;
121
+ /**
122
+ * Share of the narrowest slice that its two inner pad insets may consume.
123
+ *
124
+ * d3 turns {@link PIE_PAD_ANGLE} into a *constant linear* gap, and holding that
125
+ * width at radius `r` costs an angular inset of `asin(gap / 2r)` — unbounded as
126
+ * `r` approaches zero. When the two insets no longer fit inside a slice's own
127
+ * span, d3 collapses that slice's inner edge rather than sweeping backwards. The
128
+ * collapse is what makes a hole-less pie look wrong: the gap edge stops being
129
+ * radial, so gaps sit at visibly different widths and lean at slight angles, and
130
+ * it bites hardest between the *narrowest* slices, where the span runs out
131
+ * first.
132
+ *
133
+ * So the inner radius is solved for rather than guessed: pick the radius that
134
+ * keeps both insets inside the narrowest slice, with this much of it spent. At
135
+ * 0.7 the measured gap spread is 1.01× (against 1.46× when the inner edge is
136
+ * left to collapse), and the remaining 30% is what absorbs the corner radius.
137
+ */
138
+ export declare const PIE_MAX_INSET_SHARE = 0.7;
139
+ /**
140
+ * Ceiling on the auto-derived inner radius, as a share of the outer radius.
141
+ *
142
+ * The radius needed grows without bound as the narrowest slice shrinks, so a
143
+ * single sliver would otherwise turn a pie into a donut. Past this point the
144
+ * hole is doing more visual damage than the uneven gap it fixes, so the gap is
145
+ * allowed to degrade instead — never worse than it renders today.
146
+ */
147
+ export declare const PIE_MAX_AUTO_INNER_RATIO = 0.06;
148
+ /** How far outside the arc the tooltip anchors, in px. */
149
+ export declare const PIE_TOOLTIP_ANCHOR_INSET = 8;
150
+ /**
151
+ * Default share below which a slice is folded into an "Other" bucket.
152
+ *
153
+ * Slivers this thin are unreadable and effectively unhoverable, so grouping
154
+ * them communicates more than rendering each faithfully.
155
+ */
156
+ export declare const PIE_MIN_SLICE_SHARE = 0.02;
157
+ /** React key used for the bucket that absorbs slices below the fold threshold. */
158
+ export declare const AGGREGATED_SLICE_KEY = "__other__";
159
+ /** Margin around a pie, which needs no axis gutters. */
160
+ export declare const PIE_CHART_MARGIN: ChartMargin;
161
+ /**
162
+ * Duration in ms for hover, dim and tooltip transitions.
163
+ *
164
+ * Sits inside the 75–150ms band the DLS uses everywhere else. Hover feedback is
165
+ * a response, not an animation — anything long enough to *watch* reads as the
166
+ * chart being slow rather than the chart being smooth.
167
+ */
168
+ export declare const CHART_TRANSITION_MS = 100;
169
+ /**
170
+ * Delay in ms before marks return to full strength after the pointer leaves.
171
+ *
172
+ * Restoring immediately makes the whole chart flash while the pointer sweeps
173
+ * across categories. Highlighting stays instant (no delay) — only the
174
+ * *un*-highlight waits, so a sweep reads as one continuous gesture.
175
+ *
176
+ * Kept short because it does less work than it looks: while the pointer is
177
+ * anywhere in the plot the chart is still engaged, so `ChartPlotGroup` and
178
+ * `ChartLegendRow` zero this out and category-to-category sweeping is already
179
+ * instant. All this actually covers is the moment the pointer leaves entirely,
180
+ * where a long delay just feels like lag.
181
+ */
182
+ export declare const CHART_RESTORE_DELAY_MS = 200;
183
+ /**
184
+ * Opacity ramp for the mark states.
185
+ *
186
+ * The grammar is inherited from the reference charts and is the opposite of the
187
+ * obvious one: hovering does not brighten the hovered mark, it *softens*
188
+ * everything else. `MUTED` applies to marks outside the hovered category;
189
+ * `FADED` to marks outside a *pinned* one.
190
+ *
191
+ * The step down from ACTIVE is deliberately steep. These are large filled areas
192
+ * — bars and arcs — and a filled shape still reads as present at an opacity
193
+ * where a hairline would have vanished, so a timid step barely registers as a
194
+ * highlight at all.
195
+ *
196
+ * Keep `FADED` below `MUTED`, or pinning becomes visually indistinguishable
197
+ * from hovering — the pin exists to say "I am holding this one", which only
198
+ * reads if the rest recede further than they do on hover.
199
+ */
200
+ export declare const CHART_MARK_OPACITY_ACTIVE = 1;
201
+ export declare const CHART_MARK_OPACITY_MUTED = 0.1;
202
+ export declare const CHART_MARK_OPACITY_FADED = 0.04;
203
+ /** Distance in px between the tooltip and its anchor. */
204
+ export declare const CHART_TOOLTIP_OFFSET = 10;
205
+ /** Minimum width of the tooltip, in px. */
206
+ export declare const CHART_TOOLTIP_MIN_WIDTH = 168;
207
+ /** Maximum width of the tooltip, in px. */
208
+ export declare const CHART_TOOLTIP_MAX_WIDTH = 320;
209
+ /**
210
+ * Approximate width of one CAPTION-size character.
211
+ *
212
+ * Axis sizing estimates label widths arithmetically rather than measuring the
213
+ * DOM, so it stays correct during build-time evaluation and server rendering.
214
+ */
215
+ export declare const CAPTION_CHAR_WIDTH_PX = 6.2;
216
+ /** Ceiling for an auto-sized left margin, so a wide formatter can't eat the plot. */
217
+ export declare const MAX_AUTO_MARGIN_LEFT = 96;
218
+ /**
219
+ * Floor for an auto-sized left margin.
220
+ *
221
+ * Enough for a two- or three-character tick plus {@link VALUE_AXIS_TICK_GAP}, so
222
+ * an axis labelled `0`–`5` still has its numbers clear of the container edge
223
+ * rather than jammed against it.
224
+ */
225
+ export declare const MIN_AUTO_MARGIN_LEFT = 32;
226
+ /**
227
+ * Quantum for an auto-sized left margin, in px.
228
+ *
229
+ * Sizing the gutter to the widest tick means the plot origin moves whenever that
230
+ * label's width changes — live data crossing 999 → 1000 gains a digit and would
231
+ * shift every mark sideways. Rounding up to a step absorbs that: the margin only
232
+ * moves when a label crosses a real threshold, and two charts with similar ticks
233
+ * land on the *same* value, so stacked charts in a dashboard keep their plots
234
+ * aligned instead of each choosing its own origin.
235
+ */
236
+ export declare const AUTO_MARGIN_LEFT_STEP = 8;
237
+ /** Minimum px between category labels before AUTO mode starts skipping them. */
238
+ export declare const MIN_CATEGORY_LABEL_GAP = 8;
239
+ /**
240
+ * Default assignment order for series colors.
241
+ *
242
+ * Purple leads to match the Galaxy brand. Galaxy blue is deliberately absent —
243
+ * it is structural only, reserved for primary actions and selection.
244
+ */
245
+ export declare const CHART_PALETTE_ORDER: ChartPalette[];
@@ -1,38 +1,267 @@
1
+ import { ChartPalette } from "./types.js";
1
2
  //#region src/charts/constants.ts
2
3
  /**
3
- * Theme-derived chart series color palette.
4
- * Purple first to match Galaxy brand aesthetic.
5
- */
6
- var getChartPalette = (theme) => [
7
- theme.color.text.purple,
8
- theme.color.text.pink,
9
- theme.color.text.blue,
10
- theme.color.text.teal,
11
- theme.color.text.lime,
12
- theme.color.text.orange,
13
- theme.color.text.yellow,
14
- theme.color.text.success,
15
- theme.color.text.error
16
- ];
4
+ * Layout and motion tokens for the chart components.
5
+ *
6
+ * This module is evaluated by Linaria at build time — its constants are
7
+ * interpolated statically into styled templates — so it must stay free of
8
+ * component imports. Pulling React, framer-motion or Phosphor in here would
9
+ * drag them into build-time evaluation.
10
+ */
17
11
  var DEFAULT_CHART_MARGIN = {
18
- top: 16,
12
+ top: 12,
19
13
  right: 16,
20
- bottom: 32,
21
- left: 48
14
+ bottom: 36,
15
+ left: 52
16
+ };
17
+ /**
18
+ * Gap between a value-axis tick label and the plot edge.
19
+ *
20
+ * The label box is `margin.left - VALUE_AXIS_TICK_GAP` wide, so the axis
21
+ * geometry follows the margin instead of hardcoding an offset.
22
+ */
23
+ var VALUE_AXIS_TICK_GAP = 12;
24
+ /** Height of a value-axis tick label box in px. */
25
+ var VALUE_AXIS_LABEL_HEIGHT = 20;
26
+ /** Height of the category-axis label box in px. */
27
+ var CATEGORY_AXIS_LABEL_HEIGHT = 24;
28
+ /** Gap between the plot's bottom edge and the category labels, in px. */
29
+ var CATEGORY_AXIS_LABEL_GAP = 8;
30
+ /** Band reserved for an axis title, in px. Sized for one CAPTION line. */
31
+ var AXIS_TITLE_BAND = 18;
32
+ /**
33
+ * Clear space between an axis title and its tick labels, in px.
34
+ *
35
+ * The category axis gets this for free: its labels sit in a 24px box and its
36
+ * title in an 18px band, and centring a CAPTION line in each leaves roughly this
37
+ * much air between the two. The value axis has no such slack — its title band
38
+ * abuts the label box exactly — so without reserving it here a wide tick number
39
+ * runs straight into the rotated title, and the two axes visibly disagree.
40
+ */
41
+ var AXIS_TITLE_GAP = 8;
42
+ /** Default approximate tick count on the value axis. */
43
+ var DEFAULT_VALUE_TICK_COUNT = 5;
44
+ /** Corner radius applied to the outer end of a wide bar, in px. */
45
+ var BAR_RADIUS = 4;
46
+ /** Corner radius for bars narrower than {@link NARROW_BAR_WIDTH}, in px. */
47
+ var BAR_RADIUS_NARROW = 2;
48
+ /** Bars below this width use the smaller radius so the curve doesn't dominate. */
49
+ var NARROW_BAR_WIDTH = 40;
50
+ /**
51
+ * Px shaved off a stacked segment's covered edge to separate it from its
52
+ * neighbour.
53
+ *
54
+ * Keep this a whole number. The geometry snaps every stack boundary to a whole
55
+ * pixel first, so an integer gap renders at exactly the same size at every seam;
56
+ * a fractional one would land differently against the device pixel grid from one
57
+ * boundary to the next and read as uneven.
58
+ *
59
+ * Applied to every segment except the one sitting on the baseline, so each seam
60
+ * gets a gap and the bar still meets the axis flush.
61
+ */
62
+ var STACK_SEGMENT_GAP = 2;
63
+ /** Minimum rendered height for a non-zero bar, in px. */
64
+ var MIN_BAR_LENGTH = 2;
65
+ /**
66
+ * Target gaps in px between groups, and between bars within a group.
67
+ *
68
+ * The within-group gap must stay clearly smaller than the between-group gap —
69
+ * that ratio is the only thing making a group read as a group. When the two are
70
+ * close, the eye has nothing to bind a group's bars together and the chart reads
71
+ * as one long row of unrelated bars.
72
+ */
73
+ var GROUP_GAP_COMFORTABLE = 24;
74
+ var BAR_GAP_COMFORTABLE = 6;
75
+ var GROUP_GAP_MEDIUM = 16;
76
+ var BAR_GAP_MEDIUM = 4;
77
+ var GROUP_GAP_TIGHT = 12;
78
+ var BAR_GAP_TIGHT = 3;
79
+ /**
80
+ * Fraction of its available slot a bar actually fills.
81
+ *
82
+ * Bars sized to consume every last pixel of their group read as heavy, and the
83
+ * chart becomes a wall of colour rather than a set of measurements. Holding them
84
+ * back leaves air on both sides of each group without touching the gap between
85
+ * neighbouring bars.
86
+ */
87
+ var BAR_WIDTH_RATIO = .8;
88
+ /**
89
+ * Ceiling on a single bar's thickness, in px.
90
+ *
91
+ * Without it a two- or three-category chart divides the whole plot between a
92
+ * handful of bars and produces slabs — the width stops carrying information the
93
+ * moment it exceeds what the eye needs to compare heights.
94
+ */
95
+ var MAX_BAR_WIDTH = 44;
96
+ /** Below this many bars the chart always uses comfortable spacing. */
97
+ var MIN_BARS_FOR_TIGHT_SPACING = 13;
98
+ /**
99
+ * Ceiling on a gap, as a share of the space it divides.
100
+ *
101
+ * The gaps above are absolute pixel values chosen from chart-wide density, which
102
+ * says nothing about how much room a *single* category actually got. Forty
103
+ * categories in a 650px plot leave a 16px step, and a 24px gap subtracted from
104
+ * that goes negative — the width lands on its 1px floor and every bar renders as
105
+ * a hairline. Capping the gap proportionally keeps it honest at any density: it
106
+ * stays exactly as specified whenever there is room, and degrades smoothly when
107
+ * there is not.
108
+ */
109
+ var MAX_GAP_SHARE = .3;
110
+ /** Plot widths above this stay comfortable; below the tight threshold go tight. */
111
+ var WIDTH_FOR_MEDIUM_SPACING = 650;
112
+ var WIDTH_FOR_TIGHT_SPACING = 500;
113
+ /** Grid lines extend this far past both plot edges, in px. */
114
+ var GRID_LINE_BLEED = 12;
115
+ var DEFAULT_LINE_STROKE_WIDTH = 1.5;
116
+ /** Radius of the dot marking a point on a hovered category, in px. */
117
+ var LINE_POINT_RADIUS = 3.5;
118
+ /** Opacity of the area fill under a line. */
119
+ var LINE_AREA_OPACITY = .12;
120
+ /** Gap between slices, in radians. */
121
+ var PIE_PAD_ANGLE = .012;
122
+ /** Slice corner radius in px. */
123
+ var PIE_CORNER_RADIUS = 2;
124
+ /** Inner radius as a fraction of the outer radius, for donut mode. */
125
+ var PIE_DONUT_INNER_RATIO = .62;
126
+ /**
127
+ * Share of the narrowest slice that its two inner pad insets may consume.
128
+ *
129
+ * d3 turns {@link PIE_PAD_ANGLE} into a *constant linear* gap, and holding that
130
+ * width at radius `r` costs an angular inset of `asin(gap / 2r)` — unbounded as
131
+ * `r` approaches zero. When the two insets no longer fit inside a slice's own
132
+ * span, d3 collapses that slice's inner edge rather than sweeping backwards. The
133
+ * collapse is what makes a hole-less pie look wrong: the gap edge stops being
134
+ * radial, so gaps sit at visibly different widths and lean at slight angles, and
135
+ * it bites hardest between the *narrowest* slices, where the span runs out
136
+ * first.
137
+ *
138
+ * So the inner radius is solved for rather than guessed: pick the radius that
139
+ * keeps both insets inside the narrowest slice, with this much of it spent. At
140
+ * 0.7 the measured gap spread is 1.01× (against 1.46× when the inner edge is
141
+ * left to collapse), and the remaining 30% is what absorbs the corner radius.
142
+ */
143
+ var PIE_MAX_INSET_SHARE = .7;
144
+ /**
145
+ * Ceiling on the auto-derived inner radius, as a share of the outer radius.
146
+ *
147
+ * The radius needed grows without bound as the narrowest slice shrinks, so a
148
+ * single sliver would otherwise turn a pie into a donut. Past this point the
149
+ * hole is doing more visual damage than the uneven gap it fixes, so the gap is
150
+ * allowed to degrade instead — never worse than it renders today.
151
+ */
152
+ var PIE_MAX_AUTO_INNER_RATIO = .06;
153
+ /** How far outside the arc the tooltip anchors, in px. */
154
+ var PIE_TOOLTIP_ANCHOR_INSET = 8;
155
+ /**
156
+ * Default share below which a slice is folded into an "Other" bucket.
157
+ *
158
+ * Slivers this thin are unreadable and effectively unhoverable, so grouping
159
+ * them communicates more than rendering each faithfully.
160
+ */
161
+ var PIE_MIN_SLICE_SHARE = .02;
162
+ /** React key used for the bucket that absorbs slices below the fold threshold. */
163
+ var AGGREGATED_SLICE_KEY = "__other__";
164
+ /** Margin around a pie, which needs no axis gutters. */
165
+ var PIE_CHART_MARGIN = {
166
+ top: 8,
167
+ right: 8,
168
+ bottom: 8,
169
+ left: 8
22
170
  };
23
- /** Spacing between bars within a group (fraction of bandwidth, 0-1) */
24
- var DEFAULT_BAR_PADDING_INNER = .2;
25
- /** Spacing around bar groups (fraction of step, 0-1) */
26
- var DEFAULT_BAR_PADDING_OUTER = .1;
27
- /** Default bar top-corner radius in px */
28
- var DEFAULT_BAR_RADIUS = 4;
29
- /** Default line stroke width in px */
30
- var DEFAULT_LINE_STROKE_WIDTH = 2;
31
- /** Default data-point dot radius in px */
32
- var DEFAULT_LINE_DOT_RADIUS = 4;
33
- /** Transition duration in ms for hover effects */
34
- var CHART_TRANSITION_MS = 150;
35
- /** Default number of y-axis ticks */
36
- var DEFAULT_Y_TICK_COUNT = 5;
171
+ /**
172
+ * Duration in ms for hover, dim and tooltip transitions.
173
+ *
174
+ * Sits inside the 75–150ms band the DLS uses everywhere else. Hover feedback is
175
+ * a response, not an animation anything long enough to *watch* reads as the
176
+ * chart being slow rather than the chart being smooth.
177
+ */
178
+ var CHART_TRANSITION_MS = 100;
179
+ /**
180
+ * Delay in ms before marks return to full strength after the pointer leaves.
181
+ *
182
+ * Restoring immediately makes the whole chart flash while the pointer sweeps
183
+ * across categories. Highlighting stays instant (no delay) — only the
184
+ * *un*-highlight waits, so a sweep reads as one continuous gesture.
185
+ *
186
+ * Kept short because it does less work than it looks: while the pointer is
187
+ * anywhere in the plot the chart is still engaged, so `ChartPlotGroup` and
188
+ * `ChartLegendRow` zero this out and category-to-category sweeping is already
189
+ * instant. All this actually covers is the moment the pointer leaves entirely,
190
+ * where a long delay just feels like lag.
191
+ */
192
+ var CHART_RESTORE_DELAY_MS = 200;
193
+ /**
194
+ * Opacity ramp for the mark states.
195
+ *
196
+ * The grammar is inherited from the reference charts and is the opposite of the
197
+ * obvious one: hovering does not brighten the hovered mark, it *softens*
198
+ * everything else. `MUTED` applies to marks outside the hovered category;
199
+ * `FADED` to marks outside a *pinned* one.
200
+ *
201
+ * The step down from ACTIVE is deliberately steep. These are large filled areas
202
+ * — bars and arcs — and a filled shape still reads as present at an opacity
203
+ * where a hairline would have vanished, so a timid step barely registers as a
204
+ * highlight at all.
205
+ *
206
+ * Keep `FADED` below `MUTED`, or pinning becomes visually indistinguishable
207
+ * from hovering — the pin exists to say "I am holding this one", which only
208
+ * reads if the rest recede further than they do on hover.
209
+ */
210
+ var CHART_MARK_OPACITY_ACTIVE = 1;
211
+ var CHART_MARK_OPACITY_MUTED = .1;
212
+ var CHART_MARK_OPACITY_FADED = .04;
213
+ /** Distance in px between the tooltip and its anchor. */
214
+ var CHART_TOOLTIP_OFFSET = 10;
215
+ /** Minimum width of the tooltip, in px. */
216
+ var CHART_TOOLTIP_MIN_WIDTH = 168;
217
+ /** Maximum width of the tooltip, in px. */
218
+ var CHART_TOOLTIP_MAX_WIDTH = 320;
219
+ /**
220
+ * Approximate width of one CAPTION-size character.
221
+ *
222
+ * Axis sizing estimates label widths arithmetically rather than measuring the
223
+ * DOM, so it stays correct during build-time evaluation and server rendering.
224
+ */
225
+ var CAPTION_CHAR_WIDTH_PX = 6.2;
226
+ /** Ceiling for an auto-sized left margin, so a wide formatter can't eat the plot. */
227
+ var MAX_AUTO_MARGIN_LEFT = 96;
228
+ /**
229
+ * Floor for an auto-sized left margin.
230
+ *
231
+ * Enough for a two- or three-character tick plus {@link VALUE_AXIS_TICK_GAP}, so
232
+ * an axis labelled `0`–`5` still has its numbers clear of the container edge
233
+ * rather than jammed against it.
234
+ */
235
+ var MIN_AUTO_MARGIN_LEFT = 32;
236
+ /**
237
+ * Quantum for an auto-sized left margin, in px.
238
+ *
239
+ * Sizing the gutter to the widest tick means the plot origin moves whenever that
240
+ * label's width changes — live data crossing 999 → 1000 gains a digit and would
241
+ * shift every mark sideways. Rounding up to a step absorbs that: the margin only
242
+ * moves when a label crosses a real threshold, and two charts with similar ticks
243
+ * land on the *same* value, so stacked charts in a dashboard keep their plots
244
+ * aligned instead of each choosing its own origin.
245
+ */
246
+ var AUTO_MARGIN_LEFT_STEP = 8;
247
+ /** Minimum px between category labels before AUTO mode starts skipping them. */
248
+ var MIN_CATEGORY_LABEL_GAP = 8;
249
+ /**
250
+ * Default assignment order for series colors.
251
+ *
252
+ * Purple leads to match the Galaxy brand. Galaxy blue is deliberately absent —
253
+ * it is structural only, reserved for primary actions and selection.
254
+ */
255
+ var CHART_PALETTE_ORDER = [
256
+ ChartPalette.PURPLE,
257
+ ChartPalette.PINK,
258
+ ChartPalette.BLUE,
259
+ ChartPalette.TEAL,
260
+ ChartPalette.LIME,
261
+ ChartPalette.ORANGE,
262
+ ChartPalette.YELLOW,
263
+ ChartPalette.GREEN,
264
+ ChartPalette.RED
265
+ ];
37
266
  //#endregion
38
- export { CHART_TRANSITION_MS, DEFAULT_BAR_PADDING_INNER, DEFAULT_BAR_PADDING_OUTER, DEFAULT_BAR_RADIUS, DEFAULT_CHART_MARGIN, DEFAULT_LINE_DOT_RADIUS, DEFAULT_LINE_STROKE_WIDTH, DEFAULT_Y_TICK_COUNT, getChartPalette };
267
+ export { AGGREGATED_SLICE_KEY, AUTO_MARGIN_LEFT_STEP, AXIS_TITLE_BAND, AXIS_TITLE_GAP, BAR_GAP_COMFORTABLE, BAR_GAP_MEDIUM, BAR_GAP_TIGHT, BAR_RADIUS, BAR_RADIUS_NARROW, BAR_WIDTH_RATIO, CAPTION_CHAR_WIDTH_PX, CATEGORY_AXIS_LABEL_GAP, CATEGORY_AXIS_LABEL_HEIGHT, CHART_MARK_OPACITY_ACTIVE, CHART_MARK_OPACITY_FADED, CHART_MARK_OPACITY_MUTED, CHART_PALETTE_ORDER, CHART_RESTORE_DELAY_MS, CHART_TOOLTIP_MAX_WIDTH, CHART_TOOLTIP_MIN_WIDTH, CHART_TOOLTIP_OFFSET, CHART_TRANSITION_MS, DEFAULT_CHART_MARGIN, DEFAULT_LINE_STROKE_WIDTH, DEFAULT_VALUE_TICK_COUNT, GRID_LINE_BLEED, GROUP_GAP_COMFORTABLE, GROUP_GAP_MEDIUM, GROUP_GAP_TIGHT, LINE_AREA_OPACITY, LINE_POINT_RADIUS, MAX_AUTO_MARGIN_LEFT, MAX_BAR_WIDTH, MAX_GAP_SHARE, MIN_AUTO_MARGIN_LEFT, MIN_BARS_FOR_TIGHT_SPACING, MIN_BAR_LENGTH, MIN_CATEGORY_LABEL_GAP, NARROW_BAR_WIDTH, PIE_CHART_MARGIN, PIE_CORNER_RADIUS, PIE_DONUT_INNER_RATIO, PIE_MAX_AUTO_INNER_RATIO, PIE_MAX_INSET_SHARE, PIE_MIN_SLICE_SHARE, PIE_PAD_ANGLE, PIE_TOOLTIP_ANCHOR_INSET, STACK_SEGMENT_GAP, VALUE_AXIS_LABEL_HEIGHT, VALUE_AXIS_TICK_GAP, WIDTH_FOR_MEDIUM_SPACING, WIDTH_FOR_TIGHT_SPACING };