@galaxy-io/dls 1.2.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) 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 +216 -250
  8. package/dist/charts/ChartAxis.d.ts +47 -22
  9. package/dist/charts/ChartAxis.js +81 -60
  10. package/dist/charts/ChartEmptyState.d.ts +17 -0
  11. package/dist/charts/ChartEmptyState.js +29 -0
  12. package/dist/charts/ChartFrame.d.ts +82 -0
  13. package/dist/charts/ChartFrame.js +86 -0
  14. package/dist/charts/ChartLegend.d.ts +27 -4
  15. package/dist/charts/ChartLegend.js +46 -23
  16. package/dist/charts/ChartPrimitives.d.ts +195 -0
  17. package/dist/charts/ChartPrimitives.js +268 -0
  18. package/dist/charts/ChartTooltip.d.ts +27 -6
  19. package/dist/charts/ChartTooltip.js +56 -50
  20. package/dist/charts/LineChart.d.ts +42 -20
  21. package/dist/charts/LineChart.js +186 -237
  22. package/dist/charts/PieChart.d.ts +48 -32
  23. package/dist/charts/PieChart.js +159 -171
  24. package/dist/charts/barChartGeometry.d.ts +87 -0
  25. package/dist/charts/barChartGeometry.js +218 -0
  26. package/dist/charts/chartFormat.d.ts +19 -0
  27. package/dist/charts/chartFormat.js +59 -0
  28. package/dist/charts/chartScales.d.ts +84 -0
  29. package/dist/charts/chartScales.js +111 -0
  30. package/dist/charts/chartTheme.d.ts +18 -0
  31. package/dist/charts/chartTheme.js +26 -0
  32. package/dist/charts/constants.d.ts +225 -18
  33. package/dist/charts/constants.js +240 -32
  34. package/dist/charts/lineChartGeometry.d.ts +54 -0
  35. package/dist/charts/lineChartGeometry.js +143 -0
  36. package/dist/charts/pieChartGeometry.d.ts +48 -0
  37. package/dist/charts/pieChartGeometry.js +89 -0
  38. package/dist/charts/types.d.ts +522 -54
  39. package/dist/charts/types.js +136 -0
  40. package/dist/charts/useChartDimensions.d.ts +40 -0
  41. package/dist/charts/useChartDimensions.js +53 -0
  42. package/dist/charts/useChartFormatters.d.ts +19 -0
  43. package/dist/charts/useChartFormatters.js +20 -0
  44. package/dist/charts/useChartInteraction.d.ts +71 -0
  45. package/dist/charts/useChartInteraction.js +130 -0
  46. package/dist/charts/useChartTooltipPosition.d.ts +53 -0
  47. package/dist/charts/useChartTooltipPosition.js +39 -0
  48. package/dist/hooks/useElementClientSize.d.ts +20 -0
  49. package/dist/hooks/useElementClientSize.js +43 -0
  50. package/dist/inputs/CheckboxInput.d.ts +7 -2
  51. package/dist/inputs/CheckboxInput.js +30 -14
  52. package/dist/inputs/Input.d.ts +5 -2
  53. package/dist/inputs/Input.js +20 -17
  54. package/dist/inputs/MultiSelectInput.js +1 -1
  55. package/dist/inputs/RadioInput.js +7 -2
  56. package/dist/styles.css +68 -75
  57. package/dist/table/InfiniteSpreadsheet.d.ts +6 -0
  58. package/dist/table/InfiniteSpreadsheet.js +235 -0
  59. package/dist/table/InfiniteTable.d.ts +7 -88
  60. package/dist/table/InfiniteTable.js +366 -577
  61. package/dist/{spreadsheet → table}/SpreadsheetCell.d.ts +6 -4
  62. package/dist/table/SpreadsheetCell.js +71 -0
  63. package/dist/{spreadsheet → table}/SpreadsheetCellEditor.js +27 -21
  64. package/dist/table/SpreadsheetHeaderCell.d.ts +23 -0
  65. package/dist/table/SpreadsheetHeaderCell.js +91 -0
  66. package/dist/table/SpreadsheetMenuItem.d.ts +14 -0
  67. package/dist/table/SpreadsheetMenuItem.js +33 -0
  68. package/dist/table/SpreadsheetPrimitives.d.ts +172 -0
  69. package/dist/table/SpreadsheetPrimitives.js +105 -0
  70. package/dist/table/SpreadsheetRow.d.ts +33 -0
  71. package/dist/table/SpreadsheetRow.js +73 -0
  72. package/dist/{spreadsheet → table}/SpreadsheetRowActionCell.d.ts +5 -7
  73. package/dist/table/SpreadsheetRowActionCell.js +51 -0
  74. package/dist/table/TableExpandCell.d.ts +11 -0
  75. package/dist/table/TableExpandCell.js +24 -0
  76. package/dist/table/TableExpandedRow.d.ts +16 -0
  77. package/dist/table/TableExpandedRow.js +77 -0
  78. package/dist/table/TableHeaderCellContent.d.ts +30 -0
  79. package/dist/table/TableHeaderCellContent.js +48 -0
  80. package/dist/table/TablePrimitives.d.ts +307 -0
  81. package/dist/table/TablePrimitives.js +298 -0
  82. package/dist/table/TableSelectCell.d.ts +18 -0
  83. package/dist/table/TableSelectCell.js +26 -0
  84. package/dist/table/TableStatusRow.d.ts +18 -0
  85. package/dist/table/TableStatusRow.js +50 -0
  86. package/dist/table/VirtualizedInfiniteTable.d.ts +11 -27
  87. package/dist/table/VirtualizedInfiniteTable.js +182 -317
  88. package/dist/table/types.d.ts +249 -0
  89. package/dist/table/types.js +51 -0
  90. package/dist/table/useInfiniteScrollSentinel.d.ts +24 -0
  91. package/dist/table/useInfiniteScrollSentinel.js +53 -0
  92. package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.d.ts +1 -1
  93. package/dist/{spreadsheet/hooks → table}/useSpreadsheetEditing.js +1 -1
  94. package/dist/table/useTableColumnLayout.d.ts +28 -0
  95. package/dist/table/useTableColumnLayout.js +63 -0
  96. package/dist/table/useTableColumnResize.d.ts +38 -0
  97. package/dist/table/useTableColumnResize.js +155 -0
  98. package/dist/table/useTableKeyboardNavigation.d.ts +25 -0
  99. package/dist/table/useTableKeyboardNavigation.js +83 -0
  100. package/dist/table/useTableRowExpansion.d.ts +24 -0
  101. package/dist/table/useTableRowExpansion.js +62 -0
  102. package/dist/table/useTableRowSelection.d.ts +27 -0
  103. package/dist/table/useTableRowSelection.js +94 -0
  104. package/dist/table/utils.d.ts +50 -0
  105. package/dist/table/utils.js +78 -0
  106. package/dist/text/MarkdownText.js +45 -27
  107. package/dist/theme/variants/dark.js +1 -1
  108. package/dist/widget/Widget.d.ts +2 -0
  109. package/dist/widget/Widget.js +14 -7
  110. package/package.json +1 -5
  111. package/dist/assets/components/enrichment/PerplexityIcon.d.ts +0 -3
  112. package/dist/assets/components/enrichment/PerplexityIcon.js +0 -35
  113. package/dist/assets/components/enrichment/TavilyIcon.d.ts +0 -3
  114. package/dist/assets/components/enrichment/TavilyIcon.js +0 -15
  115. package/dist/assets/components/onboarding/TenantSetupDark.d.ts +0 -3
  116. package/dist/assets/components/onboarding/TenantSetupDark.js +0 -498
  117. package/dist/assets/components/onboarding/TenantSetupLight.d.ts +0 -3
  118. package/dist/assets/components/onboarding/TenantSetupLight.js +0 -482
  119. package/dist/assets/components/onboarding/UserSetupDark.d.ts +0 -3
  120. package/dist/assets/components/onboarding/UserSetupDark.js +0 -1086
  121. package/dist/assets/components/onboarding/UserSetupLight.d.ts +0 -3
  122. package/dist/assets/components/onboarding/UserSetupLight.js +0 -1024
  123. package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.d.ts +0 -3
  124. package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.js +0 -466
  125. package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.d.ts +0 -3
  126. package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.js +0 -460
  127. package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.d.ts +0 -3
  128. package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.js +0 -336
  129. package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.d.ts +0 -3
  130. package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.js +0 -336
  131. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.d.ts +0 -3
  132. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.js +0 -153
  133. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.d.ts +0 -3
  134. package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.js +0 -153
  135. package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.d.ts +0 -3
  136. package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.js +0 -117
  137. package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.d.ts +0 -3
  138. package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.js +0 -117
  139. package/dist/assets/components/projects/MappingMethodBlankDark.d.ts +0 -3
  140. package/dist/assets/components/projects/MappingMethodBlankDark.js +0 -150
  141. package/dist/assets/components/projects/MappingMethodBlankDarkHovered.d.ts +0 -3
  142. package/dist/assets/components/projects/MappingMethodBlankDarkHovered.js +0 -150
  143. package/dist/assets/components/projects/MappingMethodBlankLight.d.ts +0 -3
  144. package/dist/assets/components/projects/MappingMethodBlankLight.js +0 -150
  145. package/dist/assets/components/projects/MappingMethodBlankLightHovered.d.ts +0 -3
  146. package/dist/assets/components/projects/MappingMethodBlankLightHovered.js +0 -150
  147. package/dist/assets/components/projects/MappingMethodJsonDark.d.ts +0 -3
  148. package/dist/assets/components/projects/MappingMethodJsonDark.js +0 -90
  149. package/dist/assets/components/projects/MappingMethodJsonDarkHovered.d.ts +0 -3
  150. package/dist/assets/components/projects/MappingMethodJsonDarkHovered.js +0 -90
  151. package/dist/assets/components/projects/MappingMethodJsonLight.d.ts +0 -3
  152. package/dist/assets/components/projects/MappingMethodJsonLight.js +0 -90
  153. package/dist/assets/components/projects/MappingMethodJsonLightHovered.d.ts +0 -3
  154. package/dist/assets/components/projects/MappingMethodJsonLightHovered.js +0 -90
  155. package/dist/assets/components/projects/ProjectsEmptyStateDark.d.ts +0 -3
  156. package/dist/assets/components/projects/ProjectsEmptyStateDark.js +0 -454
  157. package/dist/assets/components/projects/ProjectsEmptyStateLight.d.ts +0 -3
  158. package/dist/assets/components/projects/ProjectsEmptyStateLight.js +0 -456
  159. package/dist/assets/components/root/CreateProjectActionCardDark.d.ts +0 -3
  160. package/dist/assets/components/root/CreateProjectActionCardDark.js +0 -1796
  161. package/dist/assets/components/root/CreateProjectActionCardDarkHovered.d.ts +0 -3
  162. package/dist/assets/components/root/CreateProjectActionCardDarkHovered.js +0 -1796
  163. package/dist/assets/components/root/CreateProjectActionCardLight.d.ts +0 -3
  164. package/dist/assets/components/root/CreateProjectActionCardLight.js +0 -1786
  165. package/dist/assets/components/root/CreateProjectActionCardLightHovered.d.ts +0 -3
  166. package/dist/assets/components/root/CreateProjectActionCardLightHovered.js +0 -1786
  167. package/dist/assets/components/root/CreateSourceActionCardDark.d.ts +0 -3
  168. package/dist/assets/components/root/CreateSourceActionCardDark.js +0 -879
  169. package/dist/assets/components/root/CreateSourceActionCardDarkHovered.d.ts +0 -3
  170. package/dist/assets/components/root/CreateSourceActionCardDarkHovered.js +0 -879
  171. package/dist/assets/components/root/CreateSourceActionCardLight.d.ts +0 -3
  172. package/dist/assets/components/root/CreateSourceActionCardLight.js +0 -889
  173. package/dist/assets/components/root/CreateSourceActionCardLightHovered.d.ts +0 -3
  174. package/dist/assets/components/root/CreateSourceActionCardLightHovered.js +0 -889
  175. package/dist/assets/components/sources/AttioIcon.d.ts +0 -3
  176. package/dist/assets/components/sources/AttioIcon.js +0 -11
  177. package/dist/assets/components/sources/BigquerySourceIcon.d.ts +0 -3
  178. package/dist/assets/components/sources/BigquerySourceIcon.js +0 -39
  179. package/dist/assets/components/sources/BrowserbaseSourceIcon.d.ts +0 -3
  180. package/dist/assets/components/sources/BrowserbaseSourceIcon.js +0 -35
  181. package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.d.ts +0 -3
  182. package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.js +0 -13
  183. package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.d.ts +0 -3
  184. package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.js +0 -13
  185. package/dist/assets/components/sources/ConfluenceSourceIcon.d.ts +0 -3
  186. package/dist/assets/components/sources/ConfluenceSourceIcon.js +0 -30
  187. package/dist/assets/components/sources/GithubSourceIcon.d.ts +0 -3
  188. package/dist/assets/components/sources/GithubSourceIcon.js +0 -27
  189. package/dist/assets/components/sources/GoogleDriveIcon.d.ts +0 -3
  190. package/dist/assets/components/sources/GoogleDriveIcon.js +0 -45
  191. package/dist/assets/components/sources/HubspotSourceIcon.d.ts +0 -3
  192. package/dist/assets/components/sources/HubspotSourceIcon.js +0 -14
  193. package/dist/assets/components/sources/JiraSourceIcon.d.ts +0 -3
  194. package/dist/assets/components/sources/JiraSourceIcon.js +0 -54
  195. package/dist/assets/components/sources/LinearSourceIcon.d.ts +0 -3
  196. package/dist/assets/components/sources/LinearSourceIcon.js +0 -14
  197. package/dist/assets/components/sources/MysqlLogoSourceIconDark.d.ts +0 -3
  198. package/dist/assets/components/sources/MysqlLogoSourceIconDark.js +0 -17
  199. package/dist/assets/components/sources/NetsuiteSourceIcon.d.ts +0 -3
  200. package/dist/assets/components/sources/NetsuiteSourceIcon.js +0 -32
  201. package/dist/assets/components/sources/NotionIcon.d.ts +0 -3
  202. package/dist/assets/components/sources/NotionIcon.js +0 -20
  203. package/dist/assets/components/sources/PostgresqlIcon.d.ts +0 -3
  204. package/dist/assets/components/sources/PostgresqlIcon.js +0 -61
  205. package/dist/assets/components/sources/S3Icon.d.ts +0 -3
  206. package/dist/assets/components/sources/S3Icon.js +0 -76
  207. package/dist/assets/components/sources/SalesforceSourceIcon.d.ts +0 -3
  208. package/dist/assets/components/sources/SalesforceSourceIcon.js +0 -23
  209. package/dist/assets/components/sources/SlackIcon.d.ts +0 -3
  210. package/dist/assets/components/sources/SlackIcon.js +0 -32
  211. package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.d.ts +0 -3
  212. package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.js +0 -14
  213. package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.d.ts +0 -3
  214. package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.js +0 -14
  215. package/dist/assets/components/sources/WikipediaSourceIcon.d.ts +0 -3
  216. package/dist/assets/components/sources/WikipediaSourceIcon.js +0 -1490
  217. package/dist/avatar/AvatarEmpty.d.ts +0 -7
  218. package/dist/avatar/AvatarEmpty.js +0 -99
  219. package/dist/avatar/types.d.ts +0 -5
  220. package/dist/avatar/types.js +0 -9
  221. package/dist/charts/utils.d.ts +0 -29
  222. package/dist/charts/utils.js +0 -62
  223. package/dist/icons/BackIcon.d.ts +0 -3
  224. package/dist/icons/BackIcon.js +0 -13
  225. package/dist/icons/CloseIcon.d.ts +0 -3
  226. package/dist/icons/CloseIcon.js +0 -13
  227. package/dist/icons/CreateIcon.d.ts +0 -3
  228. package/dist/icons/CreateIcon.js +0 -13
  229. package/dist/icons/ForwardIcon.d.ts +0 -3
  230. package/dist/icons/ForwardIcon.js +0 -13
  231. package/dist/icons/HelpIcon.d.ts +0 -3
  232. package/dist/icons/HelpIcon.js +0 -14
  233. package/dist/icons/ProjectsIcon.d.ts +0 -3
  234. package/dist/icons/ProjectsIcon.js +0 -12
  235. package/dist/icons/SearchIcon.d.ts +0 -3
  236. package/dist/icons/SearchIcon.js +0 -12
  237. package/dist/icons/SourcesIcon.d.ts +0 -3
  238. package/dist/icons/SourcesIcon.js +0 -12
  239. package/dist/icons/TextIcon.d.ts +0 -4
  240. package/dist/icons/TextIcon.js +0 -22
  241. package/dist/icons/WebScrapeIcon.d.ts +0 -4
  242. package/dist/icons/WebScrapeIcon.js +0 -22
  243. package/dist/icons/WebhookIcon.d.ts +0 -4
  244. package/dist/icons/WebhookIcon.js +0 -22
  245. package/dist/icons/sources/AttioLogomark.d.ts +0 -4
  246. package/dist/icons/sources/AttioLogomark.js +0 -8
  247. package/dist/icons/sources/BrowserbaseLogomark.d.ts +0 -4
  248. package/dist/icons/sources/BrowserbaseLogomark.js +0 -8
  249. package/dist/icons/sources/ClickhouseLogomark.d.ts +0 -4
  250. package/dist/icons/sources/ClickhouseLogomark.js +0 -16
  251. package/dist/icons/sources/ConfluenceLogomark.d.ts +0 -4
  252. package/dist/icons/sources/ConfluenceLogomark.js +0 -8
  253. package/dist/icons/sources/GithubLogomark.d.ts +0 -4
  254. package/dist/icons/sources/GithubLogomark.js +0 -8
  255. package/dist/icons/sources/GoogleBigqueryLogomark.d.ts +0 -4
  256. package/dist/icons/sources/GoogleBigqueryLogomark.js +0 -8
  257. package/dist/icons/sources/GoogleDriveLogomark.d.ts +0 -4
  258. package/dist/icons/sources/GoogleDriveLogomark.js +0 -8
  259. package/dist/icons/sources/HubspotLogomark.d.ts +0 -4
  260. package/dist/icons/sources/HubspotLogomark.js +0 -8
  261. package/dist/icons/sources/JiraLogomark.d.ts +0 -4
  262. package/dist/icons/sources/JiraLogomark.js +0 -8
  263. package/dist/icons/sources/LinearLogomark.d.ts +0 -4
  264. package/dist/icons/sources/LinearLogomark.js +0 -8
  265. package/dist/icons/sources/MySQLLogomark.d.ts +0 -4
  266. package/dist/icons/sources/MySQLLogomark.js +0 -8
  267. package/dist/icons/sources/NetsuiteLogomark.d.ts +0 -4
  268. package/dist/icons/sources/NetsuiteLogomark.js +0 -8
  269. package/dist/icons/sources/NotionLogomark.d.ts +0 -4
  270. package/dist/icons/sources/NotionLogomark.js +0 -8
  271. package/dist/icons/sources/PostgresLogomark.d.ts +0 -4
  272. package/dist/icons/sources/PostgresLogomark.js +0 -8
  273. package/dist/icons/sources/S3Logomark.d.ts +0 -4
  274. package/dist/icons/sources/S3Logomark.js +0 -8
  275. package/dist/icons/sources/SalesforceLogomark.d.ts +0 -4
  276. package/dist/icons/sources/SalesforceLogomark.js +0 -8
  277. package/dist/icons/sources/SlackLogoIconmark.d.ts +0 -4
  278. package/dist/icons/sources/SlackLogoIconmark.js +0 -8
  279. package/dist/icons/sources/SnowflakeLogomark.d.ts +0 -4
  280. package/dist/icons/sources/SnowflakeLogomark.js +0 -16
  281. package/dist/icons/sources/WikipediaLogomark.d.ts +0 -4
  282. package/dist/icons/sources/WikipediaLogomark.js +0 -8
  283. package/dist/spreadsheet/InfiniteSpreadsheet.d.ts +0 -3
  284. package/dist/spreadsheet/InfiniteSpreadsheet.js +0 -265
  285. package/dist/spreadsheet/SpreadsheetAddColumnButton.d.ts +0 -6
  286. package/dist/spreadsheet/SpreadsheetAddColumnButton.js +0 -32
  287. package/dist/spreadsheet/SpreadsheetCell.js +0 -115
  288. package/dist/spreadsheet/SpreadsheetHeaderCell.d.ts +0 -18
  289. package/dist/spreadsheet/SpreadsheetHeaderCell.js +0 -141
  290. package/dist/spreadsheet/SpreadsheetRow.d.ts +0 -21
  291. package/dist/spreadsheet/SpreadsheetRow.js +0 -68
  292. package/dist/spreadsheet/SpreadsheetRowActionCell.js +0 -78
  293. package/dist/spreadsheet/hooks/useColumnResize.d.ts +0 -6
  294. package/dist/spreadsheet/hooks/useColumnResize.js +0 -46
  295. package/dist/spreadsheet/types.d.ts +0 -92
  296. package/dist/spreadsheet/types.js +0 -21
  297. /package/dist/{spreadsheet → table}/SpreadsheetCellEditor.d.ts +0 -0
@@ -0,0 +1,59 @@
1
+ import { ChartValueUnit } from "./types.js";
2
+ import { match } from "ts-pattern";
3
+ //#region src/charts/chartFormat.ts
4
+ /**
5
+ * Value and label formatting for the chart components.
6
+ *
7
+ * Resolving the formatter once, centrally, is what keeps axis ticks, value
8
+ * labels and tooltip rows from drifting apart — a recurring problem when every
9
+ * call site writes its own one-liner.
10
+ */
11
+ /**
12
+ * `Intl` formatters are comparatively expensive to construct, and the charts
13
+ * format every tick and tooltip row on each render, so instances are cached per
14
+ * unit.
15
+ */
16
+ var FORMATTER_CACHE = /* @__PURE__ */ new Map();
17
+ function getIntlFormatter(unit) {
18
+ const cached = FORMATTER_CACHE.get(unit);
19
+ if (cached) return cached;
20
+ const formatter = match(unit).with(ChartValueUnit.PLAIN, () => new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 })).with(ChartValueUnit.CURRENCY, () => new Intl.NumberFormat(void 0, {
21
+ style: "currency",
22
+ currency: "USD",
23
+ maximumFractionDigits: 0
24
+ })).with(ChartValueUnit.PERCENT, () => new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 })).with(ChartValueUnit.COMPACT, () => new Intl.NumberFormat(void 0, {
25
+ notation: "compact",
26
+ maximumFractionDigits: 1
27
+ })).exhaustive();
28
+ FORMATTER_CACHE.set(unit, formatter);
29
+ return formatter;
30
+ }
31
+ /**
32
+ * Format a value with a built-in unit.
33
+ *
34
+ * `PERCENT` takes a 0–100 value rather than a 0–1 fraction, matching how
35
+ * percentage data usually arrives, and appends the sign itself instead of using
36
+ * `style: "percent"` (which would divide by 100).
37
+ */
38
+ function formatChartValue(value, unit) {
39
+ if (!Number.isFinite(value)) return "—";
40
+ const formatted = getIntlFormatter(unit).format(value);
41
+ return unit === ChartValueUnit.PERCENT ? `${formatted}%` : formatted;
42
+ }
43
+ /**
44
+ * Pick the effective value formatter.
45
+ *
46
+ * An explicit `valueFormatter` always wins; otherwise the unit supplies a
47
+ * default, and `PLAIN` is the fallback when neither is given.
48
+ */
49
+ function resolveValueFormatter(valueFormatter, unit) {
50
+ if (valueFormatter) return valueFormatter;
51
+ const resolvedUnit = unit ?? ChartValueUnit.PLAIN;
52
+ return (value) => formatChartValue(value, resolvedUnit);
53
+ }
54
+ /** Pick the effective label formatter, defaulting to identity. */
55
+ function resolveLabelFormatter(labelFormatter) {
56
+ return labelFormatter ?? ((label) => label);
57
+ }
58
+ //#endregion
59
+ export { formatChartValue, resolveLabelFormatter, resolveValueFormatter };
@@ -0,0 +1,84 @@
1
+ import type { ChartMargin, ChartValueDomain, ChartValueFormatter } from "./types";
2
+ /**
3
+ * Scale construction and axis sizing for the chart components.
4
+ *
5
+ * Pure arithmetic with no React and no theme access, so it can be unit-reasoned
6
+ * about and stays safe for Linaria's build-time evaluation.
7
+ */
8
+ export declare const clamp: (value: number, min: number, max: number) => number;
9
+ /**
10
+ * Coerce a datum value into something safe to feed a scale.
11
+ *
12
+ * A single `NaN` or `Infinity` in consumer data otherwise propagates into every
13
+ * path's `d` attribute and blanks the entire chart rather than one mark.
14
+ */
15
+ export declare const sanitizeValue: (value: number | undefined | null) => number;
16
+ /**
17
+ * Merge a partial margin over the defaults.
18
+ *
19
+ * Written per-field rather than as a spread: spreading an object that carries
20
+ * an explicit `undefined` overwrites the default with `undefined` rather than
21
+ * falling back to it, which is easy to trip over when the partial is assembled
22
+ * from separate optional values.
23
+ */
24
+ export declare const resolveMargin: (partial?: Partial<ChartMargin>) => ChartMargin;
25
+ /** Inner plot dimensions, never negative. */
26
+ export declare const getPlotDimensions: (width: number, height: number, margin: ChartMargin) => {
27
+ plotWidth: number;
28
+ plotHeight: number;
29
+ };
30
+ /**
31
+ * Widen a margin to leave room for axis titles.
32
+ *
33
+ * The reservation has to happen here rather than inside the axis, because the
34
+ * margin is resolved before any axis renders — and with the root SVG set to
35
+ * `overflow: visible`, an unreserved title would paint outside the container and
36
+ * be clipped by whatever the consumer wraps the chart in.
37
+ *
38
+ * Applied to the caller's *partial* before {@link resolveMargin} fills in the
39
+ * defaults, so an explicit `margin.left` still governs the tick gutter and the
40
+ * title band is added on top of it rather than eating into it. Returns the input
41
+ * untouched when there are no titles, so the common case allocates nothing.
42
+ */
43
+ export declare const addAxisTitleSpace: (partial: Partial<ChartMargin> | undefined, { hasValueTitle, hasCategoryTitle }: {
44
+ hasValueTitle: boolean;
45
+ hasCategoryTitle: boolean;
46
+ }) => Partial<ChartMargin> | undefined;
47
+ /**
48
+ * Build the value scale from a signed domain.
49
+ *
50
+ * Two behaviours worth knowing, both fixing defects in the V1 charts:
51
+ *
52
+ * - **Zero is always in the domain.** Bars need a baseline to grow from, and
53
+ * without this a negative value maps outside the range and renders as a
54
+ * rectangle with negative height, which paints nothing at all.
55
+ * - **A zero-width domain is widened to 0–1.** d3's `normalize()` returns a
56
+ * constant `0.5` when the domain has no extent, so empty or all-zero data
57
+ * would otherwise map every value to the middle of the plot and strand the
58
+ * baseline halfway up.
59
+ */
60
+ export declare const buildValueScale: ([min, max]: [number, number], range: [number, number]) => import("d3-scale").ScaleLinear<number, number, never>;
61
+ /** Apply an explicit domain override on top of a computed domain. */
62
+ export declare const applyDomainOverride: (computed: [number, number], override?: Partial<ChartValueDomain>) => [number, number];
63
+ /** Band scale for categories, used by the bar chart. */
64
+ export declare const buildCategoryBandScale: (labels: string[], range: [number, number], paddingInner: number, paddingOuter: number) => import("d3-scale").ScaleBand<string>;
65
+ /** Point scale for categories, used by the line chart. */
66
+ export declare const buildCategoryPointScale: (labels: string[], range: [number, number], padding?: number) => import("d3-scale").ScalePoint<string>;
67
+ /**
68
+ * Estimate the left margin needed to fit the widest formatted tick label.
69
+ *
70
+ * Estimated from character count rather than measured from the DOM, mirroring
71
+ * `estimateColumnWidth` in `table/utils.ts`, so it works during server
72
+ * rendering. Clamped to at least the default margin, so it can only widen a
73
+ * chart, never shrink one.
74
+ */
75
+ export declare const estimateValueAxisMargin: (ticks: number[], formatter: ChartValueFormatter) => number;
76
+ /**
77
+ * How many categories to skip between rendered axis labels.
78
+ *
79
+ * Returns 1 when every label fits, so a chart that is not crowded renders
80
+ * exactly as it would with no skipping at all.
81
+ */
82
+ export declare const getCategoryLabelStride: (labels: string[], step: number) => number;
83
+ /** Tick values for the value axis, honoring an explicit tick count. */
84
+ export declare const getValueTicks: (scale: ReturnType<typeof buildValueScale>, override?: Partial<ChartValueDomain>) => number[];
@@ -0,0 +1,111 @@
1
+ import { CAPTION_CHAR_WIDTH_PX, DEFAULT_CHART_MARGIN } from "./constants.js";
2
+ import { scaleBand, scaleLinear, scalePoint } from "d3-scale";
3
+ //#region src/charts/chartScales.ts
4
+ /**
5
+ * Scale construction and axis sizing for the chart components.
6
+ *
7
+ * Pure arithmetic with no React and no theme access, so it can be unit-reasoned
8
+ * about and stays safe for Linaria's build-time evaluation.
9
+ */
10
+ var clamp = (value, min, max) => Math.min(Math.max(value, min), max);
11
+ /**
12
+ * Coerce a datum value into something safe to feed a scale.
13
+ *
14
+ * A single `NaN` or `Infinity` in consumer data otherwise propagates into every
15
+ * path's `d` attribute and blanks the entire chart rather than one mark.
16
+ */
17
+ var sanitizeValue = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
18
+ /**
19
+ * Merge a partial margin over the defaults.
20
+ *
21
+ * Written per-field rather than as a spread: spreading an object that carries
22
+ * an explicit `undefined` overwrites the default with `undefined` rather than
23
+ * falling back to it, which is easy to trip over when the partial is assembled
24
+ * from separate optional values.
25
+ */
26
+ var resolveMargin = (partial) => ({
27
+ top: partial?.top ?? DEFAULT_CHART_MARGIN.top,
28
+ right: partial?.right ?? DEFAULT_CHART_MARGIN.right,
29
+ bottom: partial?.bottom ?? DEFAULT_CHART_MARGIN.bottom,
30
+ left: partial?.left ?? DEFAULT_CHART_MARGIN.left
31
+ });
32
+ /** Inner plot dimensions, never negative. */
33
+ var getPlotDimensions = (width, height, margin) => ({
34
+ plotWidth: Math.max(0, width - margin.left - margin.right),
35
+ plotHeight: Math.max(0, height - margin.top - margin.bottom)
36
+ });
37
+ /**
38
+ * Widen a margin to leave room for axis titles.
39
+ *
40
+ * The reservation has to happen here rather than inside the axis, because the
41
+ * margin is resolved before any axis renders — and with the root SVG set to
42
+ * `overflow: visible`, an unreserved title would paint outside the container and
43
+ * be clipped by whatever the consumer wraps the chart in.
44
+ *
45
+ * Applied to the caller's *partial* before {@link resolveMargin} fills in the
46
+ * defaults, so an explicit `margin.left` still governs the tick gutter and the
47
+ * title band is added on top of it rather than eating into it. Returns the input
48
+ * untouched when there are no titles, so the common case allocates nothing.
49
+ */
50
+ var addAxisTitleSpace = (partial, { hasValueTitle, hasCategoryTitle }) => {
51
+ if (!hasValueTitle && !hasCategoryTitle) return partial;
52
+ return {
53
+ ...partial,
54
+ left: (partial?.left ?? DEFAULT_CHART_MARGIN.left) + (hasValueTitle ? 18 : 0),
55
+ bottom: (partial?.bottom ?? DEFAULT_CHART_MARGIN.bottom) + (hasCategoryTitle ? 18 : 0)
56
+ };
57
+ };
58
+ /**
59
+ * Build the value scale from a signed domain.
60
+ *
61
+ * Two behaviours worth knowing, both fixing defects in the V1 charts:
62
+ *
63
+ * - **Zero is always in the domain.** Bars need a baseline to grow from, and
64
+ * without this a negative value maps outside the range and renders as a
65
+ * rectangle with negative height, which paints nothing at all.
66
+ * - **A zero-width domain is widened to 0–1.** d3's `normalize()` returns a
67
+ * constant `0.5` when the domain has no extent, so empty or all-zero data
68
+ * would otherwise map every value to the middle of the plot and strand the
69
+ * baseline halfway up.
70
+ */
71
+ var buildValueScale = ([min, max], range) => {
72
+ const lo = Math.min(0, min);
73
+ const hi = Math.max(0, max);
74
+ return scaleLinear().domain([lo, lo === hi ? hi + 1 : hi]).nice().range(range);
75
+ };
76
+ /** Apply an explicit domain override on top of a computed domain. */
77
+ var applyDomainOverride = (computed, override) => [override?.min ?? computed[0], override?.max ?? computed[1]];
78
+ /** Band scale for categories, used by the bar chart. */
79
+ var buildCategoryBandScale = (labels, range, paddingInner, paddingOuter) => scaleBand().domain(labels).range(range).paddingInner(paddingInner).paddingOuter(paddingOuter);
80
+ /** Point scale for categories, used by the line chart. */
81
+ var buildCategoryPointScale = (labels, range, padding = 0) => scalePoint().domain(labels).range(range).padding(padding);
82
+ /**
83
+ * Estimate the left margin needed to fit the widest formatted tick label.
84
+ *
85
+ * Estimated from character count rather than measured from the DOM, mirroring
86
+ * `estimateColumnWidth` in `table/utils.ts`, so it works during server
87
+ * rendering. Clamped to at least the default margin, so it can only widen a
88
+ * chart, never shrink one.
89
+ */
90
+ var estimateValueAxisMargin = (ticks, formatter) => {
91
+ let widest = 0;
92
+ for (const tick of ticks) widest = Math.max(widest, formatter(tick).length * CAPTION_CHAR_WIDTH_PX);
93
+ return clamp(Math.ceil(widest) + 12, DEFAULT_CHART_MARGIN.left, 96);
94
+ };
95
+ /**
96
+ * How many categories to skip between rendered axis labels.
97
+ *
98
+ * Returns 1 when every label fits, so a chart that is not crowded renders
99
+ * exactly as it would with no skipping at all.
100
+ */
101
+ var getCategoryLabelStride = (labels, step) => {
102
+ if (labels.length === 0 || step <= 0) return 1;
103
+ let widest = 0;
104
+ for (const label of labels) widest = Math.max(widest, label.length * CAPTION_CHAR_WIDTH_PX);
105
+ const required = widest + 8;
106
+ return required <= step ? 1 : Math.ceil(required / step);
107
+ };
108
+ /** Tick values for the value axis, honoring an explicit tick count. */
109
+ var getValueTicks = (scale, override) => scale.ticks(override?.tickCount ?? 5);
110
+ //#endregion
111
+ export { addAxisTitleSpace, applyDomainOverride, buildCategoryBandScale, buildCategoryPointScale, buildValueScale, clamp, estimateValueAxisMargin, getCategoryLabelStride, getPlotDimensions, getValueTicks, resolveMargin, sanitizeValue };
@@ -0,0 +1,18 @@
1
+ import type { Theme } from "../theme/types";
2
+ import { ChartPalette } from "./types";
3
+ /**
4
+ * Palette resolution for the chart components.
5
+ *
6
+ * Consumer data names a {@link ChartPalette} slot; the concrete color is looked
7
+ * up here against the active theme. That keeps raw hex out of application data
8
+ * and guarantees both themes render correctly.
9
+ *
10
+ * Linaria evaluates this module at build time, so it must not import components.
11
+ */
12
+ /** Resolve a palette slot to a concrete color for the active theme. */
13
+ export declare function resolveChartPaletteColor(theme: Theme, palette: ChartPalette): string;
14
+ /**
15
+ * Resolve the color for a series, honoring an explicit slot and otherwise
16
+ * falling back to the series' position in the default palette order.
17
+ */
18
+ export declare function resolveSeriesColor(theme: Theme, index: number, palette?: ChartPalette): string;
@@ -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,229 @@
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
+ /** Margin around a pie, which needs no axis gutters. */
158
+ export declare const PIE_CHART_MARGIN: {
159
+ top: number;
160
+ right: number;
161
+ bottom: number;
162
+ left: number;
163
+ };
164
+ /**
165
+ * Duration in ms for hover, dim and tooltip transitions.
166
+ *
167
+ * Sits inside the 75–150ms band the DLS uses everywhere else. Hover feedback is
168
+ * a response, not an animation — anything long enough to *watch* reads as the
169
+ * chart being slow rather than the chart being smooth.
170
+ */
171
+ export declare const CHART_TRANSITION_MS = 100;
172
+ /**
173
+ * Delay in ms before marks return to full strength after the pointer leaves.
174
+ *
175
+ * Restoring immediately makes the whole chart flash while the pointer sweeps
176
+ * across categories. Highlighting stays instant (no delay) — only the
177
+ * *un*-highlight waits, so a sweep reads as one continuous gesture.
178
+ *
179
+ * Kept short because it does less work than it looks: while the pointer is
180
+ * anywhere in the plot the chart is still engaged, so `ChartPlotGroup` and
181
+ * `ChartLegendRow` zero this out and category-to-category sweeping is already
182
+ * instant. All this actually covers is the moment the pointer leaves entirely,
183
+ * where a long delay just feels like lag.
184
+ */
185
+ export declare const CHART_RESTORE_DELAY_MS = 200;
186
+ /**
187
+ * Opacity ramp for the mark states.
188
+ *
189
+ * The grammar is inherited from the reference charts and is the opposite of the
190
+ * obvious one: hovering does not brighten the hovered mark, it *softens*
191
+ * everything else. `MUTED` applies to marks outside the hovered category;
192
+ * `FADED` to marks outside a *pinned* one.
193
+ *
194
+ * The step down from ACTIVE is deliberately steep. These are large filled areas
195
+ * — bars and arcs — and a filled shape still reads as present at an opacity
196
+ * where a hairline would have vanished, so a timid step barely registers as a
197
+ * highlight at all.
198
+ *
199
+ * Keep `FADED` below `MUTED`, or pinning becomes visually indistinguishable
200
+ * from hovering — the pin exists to say "I am holding this one", which only
201
+ * reads if the rest recede further than they do on hover.
202
+ */
203
+ export declare const CHART_MARK_OPACITY_ACTIVE = 1;
204
+ export declare const CHART_MARK_OPACITY_MUTED = 0.1;
205
+ export declare const CHART_MARK_OPACITY_FADED = 0.04;
206
+ /** Distance in px between the tooltip and its anchor. */
207
+ export declare const CHART_TOOLTIP_OFFSET = 10;
208
+ /** Minimum width of the tooltip, in px. */
209
+ export declare const CHART_TOOLTIP_MIN_WIDTH = 168;
210
+ /** Maximum width of the tooltip, in px. */
211
+ export declare const CHART_TOOLTIP_MAX_WIDTH = 320;
212
+ /**
213
+ * Approximate width of one CAPTION-size character.
214
+ *
215
+ * Axis sizing estimates label widths arithmetically rather than measuring the
216
+ * DOM, so it stays correct during build-time evaluation and server rendering.
217
+ */
218
+ export declare const CAPTION_CHAR_WIDTH_PX = 6.2;
219
+ /** Ceiling for an auto-sized left margin, so a wide formatter can't eat the plot. */
220
+ export declare const MAX_AUTO_MARGIN_LEFT = 96;
221
+ /** Minimum px between category labels before AUTO mode starts skipping them. */
222
+ export declare const MIN_CATEGORY_LABEL_GAP = 8;
223
+ /**
224
+ * Default assignment order for series colors.
225
+ *
226
+ * Purple leads to match the Galaxy brand. Galaxy blue is deliberately absent —
227
+ * it is structural only, reserved for primary actions and selection.
228
+ */
229
+ export declare const CHART_PALETTE_ORDER: ChartPalette[];