@k2b/ui 0.50.0 → 0.51.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 (294) hide show
  1. package/dist/base.css +32 -1
  2. package/dist/browser/actions/Button.js.map +1 -1
  3. package/dist/browser/actions/CommandList.js +861 -0
  4. package/dist/browser/actions/CommandList.js.map +1 -0
  5. package/dist/browser/actions/CommandMenu.js +237 -0
  6. package/dist/browser/actions/CommandMenu.js.map +1 -0
  7. package/dist/browser/actions/Dropdown.js +43 -10
  8. package/dist/browser/actions/Dropdown.js.map +1 -1
  9. package/dist/browser/actions/command-dock.js +47 -0
  10. package/dist/browser/actions/command-dock.js.map +1 -0
  11. package/dist/browser/actions/command-items.js +84 -0
  12. package/dist/browser/actions/command-items.js.map +1 -0
  13. package/dist/browser/actions/command-messages.js +42 -0
  14. package/dist/browser/actions/command-messages.js.map +1 -0
  15. package/dist/browser/actions/index.js +1 -0
  16. package/dist/browser/actions/index.js.map +1 -1
  17. package/dist/browser/charts/core/area.js +3 -5
  18. package/dist/browser/charts/core/area.js.map +1 -1
  19. package/dist/browser/charts/core/calendar.js +1 -1
  20. package/dist/browser/charts/core/calendar.js.map +1 -1
  21. package/dist/browser/charts/core/chart-messages.js +17 -0
  22. package/dist/browser/charts/core/chart-messages.js.map +1 -0
  23. package/dist/browser/charts/core/hbar-layout.js +118 -0
  24. package/dist/browser/charts/core/hbar-layout.js.map +1 -0
  25. package/dist/browser/charts/core/hbar.js +39 -0
  26. package/dist/browser/charts/core/hbar.js.map +1 -0
  27. package/dist/browser/charts/core/index.js +7 -2
  28. package/dist/browser/charts/core/index.js.map +1 -1
  29. package/dist/browser/charts/core/map.js +116 -0
  30. package/dist/browser/charts/core/map.js.map +1 -0
  31. package/dist/browser/charts/core/registry.js +22 -15
  32. package/dist/browser/charts/core/registry.js.map +1 -1
  33. package/dist/browser/charts/core/render-size.js +13 -0
  34. package/dist/browser/charts/core/render-size.js.map +1 -0
  35. package/dist/browser/charts/core/render.js +20 -10
  36. package/dist/browser/charts/core/render.js.map +1 -1
  37. package/dist/browser/charts/core/snapshot.js +3 -3
  38. package/dist/browser/charts/core/snapshot.js.map +1 -1
  39. package/dist/browser/charts/core/svg-renderers.js +2406 -0
  40. package/dist/browser/charts/core/svg-renderers.js.map +1 -0
  41. package/dist/browser/charts/core/svg.js +4 -2525
  42. package/dist/browser/charts/core/svg.js.map +1 -1
  43. package/dist/browser/charts/core/types.js +0 -2
  44. package/dist/browser/charts/core/types.js.map +1 -1
  45. package/dist/browser/charts/core/waterfall.js +162 -0
  46. package/dist/browser/charts/core/waterfall.js.map +1 -0
  47. package/dist/browser/charts/description.js +2 -0
  48. package/dist/browser/charts/description.js.map +1 -0
  49. package/dist/browser/charts.js.map +1 -1
  50. package/dist/browser/content/Chart.js +14 -628
  51. package/dist/browser/content/Chart.js.map +1 -1
  52. package/dist/browser/content/ChartRoot.js +632 -0
  53. package/dist/browser/content/ChartRoot.js.map +1 -0
  54. package/dist/browser/content/ChartSparkline.js +24 -0
  55. package/dist/browser/content/ChartSparkline.js.map +1 -0
  56. package/dist/browser/content/FileView.js +111 -61
  57. package/dist/browser/content/FileView.js.map +1 -1
  58. package/dist/browser/content/Lightbox.js +8 -8
  59. package/dist/browser/content/Lightbox.js.map +1 -1
  60. package/dist/browser/content/MapView.js +30 -28
  61. package/dist/browser/content/MapView.js.map +1 -1
  62. package/dist/browser/content/PdfPreview.js +84 -52
  63. package/dist/browser/content/PdfPreview.js.map +1 -1
  64. package/dist/browser/content/PdfViewer.js +588 -0
  65. package/dist/browser/content/PdfViewer.js.map +1 -0
  66. package/dist/browser/content/chart-bar.js +246 -16
  67. package/dist/browser/content/chart-bar.js.map +1 -1
  68. package/dist/browser/content/chart-inspection-core.js +22 -21
  69. package/dist/browser/content/chart-inspection-core.js.map +1 -1
  70. package/dist/browser/content/chart-line-gaps.js +1 -1
  71. package/dist/browser/content/chart-line-gaps.js.map +1 -1
  72. package/dist/browser/content/chart-message-catalog.js +10 -0
  73. package/dist/browser/content/chart-message-catalog.js.map +1 -1
  74. package/dist/browser/content/chart-state-timeline.js +1 -1
  75. package/dist/browser/content/chart-state-timeline.js.map +1 -1
  76. package/dist/browser/content/chart-svg.js +2 -1
  77. package/dist/browser/content/chart-svg.js.map +1 -1
  78. package/dist/browser/content/index.js +1 -0
  79. package/dist/browser/content/index.js.map +1 -1
  80. package/dist/browser/content/pdf-document.js +29 -0
  81. package/dist/browser/content/pdf-document.js.map +1 -0
  82. package/dist/browser/content/pdf-limits.js +31 -0
  83. package/dist/browser/content/pdf-limits.js.map +1 -0
  84. package/dist/browser/content/pdf-messages.js +34 -2
  85. package/dist/browser/content/pdf-messages.js.map +1 -1
  86. package/dist/browser/content/pdf-viewer-engine.js +57 -0
  87. package/dist/browser/content/pdf-viewer-worker.js +28 -0
  88. package/dist/browser/inputs/ChoiceInputs.js +94 -51
  89. package/dist/browser/inputs/ChoiceInputs.js.map +1 -1
  90. package/dist/browser/inputs/ChoiceSlider.js +75 -58
  91. package/dist/browser/inputs/ChoiceSlider.js.map +1 -1
  92. package/dist/browser/inputs/DatePicker.js +113 -98
  93. package/dist/browser/inputs/DatePicker.js.map +1 -1
  94. package/dist/browser/inputs/PeriodPicker.js +874 -0
  95. package/dist/browser/inputs/PeriodPicker.js.map +1 -0
  96. package/dist/browser/inputs/index.js +4 -1
  97. package/dist/browser/inputs/index.js.map +1 -1
  98. package/dist/browser/inputs/input-messages.js +8 -2
  99. package/dist/browser/inputs/input-messages.js.map +1 -1
  100. package/dist/browser/inputs/markdown/MarkdownEditor.js +14 -10
  101. package/dist/browser/inputs/markdown/MarkdownEditor.js.map +1 -1
  102. package/dist/browser/inputs/markdown/SlashCommands.js +402 -0
  103. package/dist/browser/inputs/markdown/SlashCommands.js.map +1 -0
  104. package/dist/browser/inputs/period-picker-messages.js +71 -0
  105. package/dist/browser/inputs/period-picker-messages.js.map +1 -0
  106. package/dist/browser/inputs/period.js +263 -0
  107. package/dist/browser/inputs/period.js.map +1 -0
  108. package/dist/browser/layout/DetailPanel.js +147 -120
  109. package/dist/browser/layout/DetailPanel.js.map +1 -1
  110. package/dist/browser/layout/Discussion.js +101 -108
  111. package/dist/browser/layout/Discussion.js.map +1 -1
  112. package/dist/browser/layout/index.js.map +1 -1
  113. package/dist/browser/surfaces/DescriptionList.js +5 -2
  114. package/dist/browser/surfaces/DescriptionList.js.map +1 -1
  115. package/dist/browser/surfaces/StatCell.js +19 -14
  116. package/dist/browser/surfaces/StatCell.js.map +1 -1
  117. package/dist/browser/surfaces/delta-badge.js +16 -2
  118. package/dist/browser/surfaces/delta-badge.js.map +1 -1
  119. package/dist/browser/widgets/DashboardFrame.js +310 -0
  120. package/dist/browser/widgets/DashboardFrame.js.map +1 -0
  121. package/dist/browser/widgets/index.js +1 -0
  122. package/dist/browser/widgets/index.js.map +1 -1
  123. package/dist/licenses/pdfjs-dist.txt +177 -0
  124. package/dist/ssr/actions/Button.js.map +1 -1
  125. package/dist/ssr/actions/CommandList.js +638 -0
  126. package/dist/ssr/actions/CommandList.js.map +1 -0
  127. package/dist/ssr/actions/CommandMenu.js +197 -0
  128. package/dist/ssr/actions/CommandMenu.js.map +1 -0
  129. package/dist/ssr/actions/Dropdown.js +43 -10
  130. package/dist/ssr/actions/Dropdown.js.map +1 -1
  131. package/dist/ssr/actions/command-dock.js +47 -0
  132. package/dist/ssr/actions/command-dock.js.map +1 -0
  133. package/dist/ssr/actions/command-items.js +84 -0
  134. package/dist/ssr/actions/command-items.js.map +1 -0
  135. package/dist/ssr/actions/command-messages.js +42 -0
  136. package/dist/ssr/actions/command-messages.js.map +1 -0
  137. package/dist/ssr/actions/index.js +1 -0
  138. package/dist/ssr/actions/index.js.map +1 -1
  139. package/dist/ssr/charts/core/area.js +3 -5
  140. package/dist/ssr/charts/core/area.js.map +1 -1
  141. package/dist/ssr/charts/core/calendar.js +1 -1
  142. package/dist/ssr/charts/core/calendar.js.map +1 -1
  143. package/dist/ssr/charts/core/chart-messages.js +17 -0
  144. package/dist/ssr/charts/core/chart-messages.js.map +1 -0
  145. package/dist/ssr/charts/core/hbar-layout.js +118 -0
  146. package/dist/ssr/charts/core/hbar-layout.js.map +1 -0
  147. package/dist/ssr/charts/core/hbar.js +39 -0
  148. package/dist/ssr/charts/core/hbar.js.map +1 -0
  149. package/dist/ssr/charts/core/index.js +7 -2
  150. package/dist/ssr/charts/core/index.js.map +1 -1
  151. package/dist/ssr/charts/core/map.js +116 -0
  152. package/dist/ssr/charts/core/map.js.map +1 -0
  153. package/dist/ssr/charts/core/registry.js +22 -15
  154. package/dist/ssr/charts/core/registry.js.map +1 -1
  155. package/dist/ssr/charts/core/render-size.js +13 -0
  156. package/dist/ssr/charts/core/render-size.js.map +1 -0
  157. package/dist/ssr/charts/core/render.js +20 -10
  158. package/dist/ssr/charts/core/render.js.map +1 -1
  159. package/dist/ssr/charts/core/snapshot.js +3 -3
  160. package/dist/ssr/charts/core/snapshot.js.map +1 -1
  161. package/dist/ssr/charts/core/svg-renderers.js +2406 -0
  162. package/dist/ssr/charts/core/svg-renderers.js.map +1 -0
  163. package/dist/ssr/charts/core/svg.js +4 -2525
  164. package/dist/ssr/charts/core/svg.js.map +1 -1
  165. package/dist/ssr/charts/core/types.js +0 -2
  166. package/dist/ssr/charts/core/types.js.map +1 -1
  167. package/dist/ssr/charts/core/waterfall.js +162 -0
  168. package/dist/ssr/charts/core/waterfall.js.map +1 -0
  169. package/dist/ssr/charts/description.js +2 -0
  170. package/dist/ssr/charts/description.js.map +1 -0
  171. package/dist/ssr/charts.js.map +1 -1
  172. package/dist/ssr/content/Chart.js +14 -471
  173. package/dist/ssr/content/Chart.js.map +1 -1
  174. package/dist/ssr/content/ChartRoot.js +475 -0
  175. package/dist/ssr/content/ChartRoot.js.map +1 -0
  176. package/dist/ssr/content/ChartSparkline.js +24 -0
  177. package/dist/ssr/content/ChartSparkline.js.map +1 -0
  178. package/dist/ssr/content/FileView.js +56 -7
  179. package/dist/ssr/content/FileView.js.map +1 -1
  180. package/dist/ssr/content/Lightbox.js +8 -8
  181. package/dist/ssr/content/Lightbox.js.map +1 -1
  182. package/dist/ssr/content/MapView.js +9 -9
  183. package/dist/ssr/content/MapView.js.map +1 -1
  184. package/dist/ssr/content/PdfPreview.js +49 -20
  185. package/dist/ssr/content/PdfPreview.js.map +1 -1
  186. package/dist/ssr/content/PdfViewer.js +484 -0
  187. package/dist/ssr/content/PdfViewer.js.map +1 -0
  188. package/dist/ssr/content/chart-bar.js +246 -16
  189. package/dist/ssr/content/chart-bar.js.map +1 -1
  190. package/dist/ssr/content/chart-inspection-core.js +22 -21
  191. package/dist/ssr/content/chart-inspection-core.js.map +1 -1
  192. package/dist/ssr/content/chart-line-gaps.js +1 -1
  193. package/dist/ssr/content/chart-line-gaps.js.map +1 -1
  194. package/dist/ssr/content/chart-message-catalog.js +10 -0
  195. package/dist/ssr/content/chart-message-catalog.js.map +1 -1
  196. package/dist/ssr/content/chart-state-timeline.js +1 -1
  197. package/dist/ssr/content/chart-state-timeline.js.map +1 -1
  198. package/dist/ssr/content/chart-svg.js +2 -1
  199. package/dist/ssr/content/chart-svg.js.map +1 -1
  200. package/dist/ssr/content/index.js +1 -0
  201. package/dist/ssr/content/index.js.map +1 -1
  202. package/dist/ssr/content/pdf-document.js +29 -0
  203. package/dist/ssr/content/pdf-document.js.map +1 -0
  204. package/dist/ssr/content/pdf-limits.js +31 -0
  205. package/dist/ssr/content/pdf-limits.js.map +1 -0
  206. package/dist/ssr/content/pdf-messages.js +34 -2
  207. package/dist/ssr/content/pdf-messages.js.map +1 -1
  208. package/dist/ssr/inputs/ChoiceInputs.js +49 -12
  209. package/dist/ssr/inputs/ChoiceInputs.js.map +1 -1
  210. package/dist/ssr/inputs/ChoiceSlider.js +17 -12
  211. package/dist/ssr/inputs/ChoiceSlider.js.map +1 -1
  212. package/dist/ssr/inputs/DatePicker.js +14 -9
  213. package/dist/ssr/inputs/DatePicker.js.map +1 -1
  214. package/dist/ssr/inputs/PeriodPicker.js +598 -0
  215. package/dist/ssr/inputs/PeriodPicker.js.map +1 -0
  216. package/dist/ssr/inputs/index.js +4 -1
  217. package/dist/ssr/inputs/index.js.map +1 -1
  218. package/dist/ssr/inputs/input-messages.js +8 -2
  219. package/dist/ssr/inputs/input-messages.js.map +1 -1
  220. package/dist/ssr/inputs/markdown/MarkdownEditor.js +3 -2
  221. package/dist/ssr/inputs/markdown/MarkdownEditor.js.map +1 -1
  222. package/dist/ssr/inputs/markdown/SlashCommands.js +339 -0
  223. package/dist/ssr/inputs/markdown/SlashCommands.js.map +1 -0
  224. package/dist/ssr/inputs/period-picker-messages.js +71 -0
  225. package/dist/ssr/inputs/period-picker-messages.js.map +1 -0
  226. package/dist/ssr/inputs/period.js +263 -0
  227. package/dist/ssr/inputs/period.js.map +1 -0
  228. package/dist/ssr/layout/DetailPanel.js +27 -4
  229. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  230. package/dist/ssr/layout/Discussion.js +16 -2
  231. package/dist/ssr/layout/Discussion.js.map +1 -1
  232. package/dist/ssr/layout/index.js.map +1 -1
  233. package/dist/ssr/surfaces/DescriptionList.js +1 -1
  234. package/dist/ssr/surfaces/DescriptionList.js.map +1 -1
  235. package/dist/ssr/surfaces/StatCell.js +4 -5
  236. package/dist/ssr/surfaces/StatCell.js.map +1 -1
  237. package/dist/ssr/surfaces/delta-badge.js +16 -2
  238. package/dist/ssr/surfaces/delta-badge.js.map +1 -1
  239. package/dist/ssr/widgets/DashboardFrame.js +200 -0
  240. package/dist/ssr/widgets/DashboardFrame.js.map +1 -0
  241. package/dist/ssr/widgets/index.js +1 -0
  242. package/dist/ssr/widgets/index.js.map +1 -1
  243. package/dist/styles.css +1 -1
  244. package/dist/types/actions/Button.d.ts +1 -1
  245. package/dist/types/actions/CommandList.d.ts +120 -0
  246. package/dist/types/actions/CommandMenu.d.ts +39 -0
  247. package/dist/types/actions/Dropdown.d.ts +17 -0
  248. package/dist/types/actions/command-dock.d.ts +8 -0
  249. package/dist/types/actions/command-items.d.ts +134 -0
  250. package/dist/types/actions/command-messages.d.ts +19 -0
  251. package/dist/types/actions/index.d.ts +3 -0
  252. package/dist/types/charts/core/calendar.d.ts +1 -1
  253. package/dist/types/charts/core/chart-messages.d.ts +5 -0
  254. package/dist/types/charts/core/hbar-layout.d.ts +74 -0
  255. package/dist/types/charts/core/hbar.d.ts +13 -0
  256. package/dist/types/charts/core/index.d.ts +7 -2
  257. package/dist/types/charts/core/map.d.ts +3 -0
  258. package/dist/types/charts/core/registry.d.ts +17 -11
  259. package/dist/types/charts/core/render-size.d.ts +7 -0
  260. package/dist/types/charts/core/render.d.ts +1 -4
  261. package/dist/types/charts/core/snapshot.d.ts +2 -2
  262. package/dist/types/charts/core/svg-renderers.d.ts +722 -0
  263. package/dist/types/charts/core/svg.d.ts +4 -698
  264. package/dist/types/charts/core/types.d.ts +1 -12
  265. package/dist/types/charts/core/waterfall.d.ts +68 -0
  266. package/dist/types/charts/description.d.ts +226 -0
  267. package/dist/types/charts.d.ts +1 -0
  268. package/dist/types/content/Chart.d.ts +3 -91
  269. package/dist/types/content/ChartRoot.d.ts +92 -0
  270. package/dist/types/content/ChartSparkline.d.ts +5 -0
  271. package/dist/types/content/PdfViewer.d.ts +32 -0
  272. package/dist/types/content/chart-bar.d.ts +95 -2
  273. package/dist/types/content/index.d.ts +2 -0
  274. package/dist/types/content/pdf-document.d.ts +5 -0
  275. package/dist/types/content/pdf-engine.d.ts +9 -0
  276. package/dist/types/content/pdf-limits.d.ts +43 -0
  277. package/dist/types/content/pdf-messages.d.ts +16 -0
  278. package/dist/types/inputs/ChoiceInputs.d.ts +4 -0
  279. package/dist/types/inputs/ChoiceSlider.d.ts +12 -0
  280. package/dist/types/inputs/DatePicker.d.ts +22 -0
  281. package/dist/types/inputs/PeriodPicker.d.ts +24 -0
  282. package/dist/types/inputs/index.d.ts +8 -2
  283. package/dist/types/inputs/input-messages.d.ts +3 -0
  284. package/dist/types/inputs/markdown/MarkdownEditor.d.ts +5 -0
  285. package/dist/types/inputs/markdown/SlashCommands.d.ts +20 -0
  286. package/dist/types/inputs/period-picker-messages.d.ts +34 -0
  287. package/dist/types/inputs/period.d.ts +134 -0
  288. package/dist/types/layout/DetailPanel.d.ts +12 -0
  289. package/dist/types/layout/index.d.ts +1 -1
  290. package/dist/types/surfaces/DescriptionList.d.ts +5 -0
  291. package/dist/types/surfaces/StatCell.d.ts +6 -1
  292. package/dist/types/widgets/DashboardFrame.d.ts +58 -0
  293. package/dist/types/widgets/index.d.ts +1 -0
  294. package/package.json +2 -1
@@ -0,0 +1,722 @@
1
+ import type { IntentTone } from "../../semantics";
2
+ import type { ChartDatum } from "./types";
3
+ export type Point = {
4
+ x: number;
5
+ y: number;
6
+ /** Optional third dimension. Honored by `scatter` (controls dot radius);
7
+ * ignored by `line` and `sparkline`. */
8
+ size?: number;
9
+ /** Symmetric ±error on the y value. Used by error-bar rendering on
10
+ * `scatter` and `line`. Overridden by `errYHigh`/`errYLow` if set. */
11
+ errY?: number;
12
+ /** Asymmetric upper bound on y (relative magnitude added to y). */
13
+ errYHigh?: number;
14
+ /** Asymmetric lower bound on y (relative magnitude subtracted from y). */
15
+ errYLow?: number;
16
+ /** Symmetric ±error on the x value. Renders horizontal error bars. */
17
+ errX?: number;
18
+ /** Asymmetric upper bound on x. */
19
+ errXHigh?: number;
20
+ /** Asymmetric lower bound on x. */
21
+ errXLow?: number;
22
+ };
23
+ /** Marker shapes for `scatter` data points. Auto-cycles per series when
24
+ * `autoVariant` is enabled on the chart. */
25
+ export type MarkerShape = "circle" | "square" | "triangle" | "diamond" | "plus" | "cross";
26
+ /** Line dash patterns for `line` series. Auto-cycles per series when
27
+ * `autoVariant` is enabled. */
28
+ export type LineStyle = "solid" | "dashed" | "dotted" | "dashdot";
29
+ export type Series = {
30
+ /** Optional label for this series. Used by `legend` rendering. */
31
+ label?: string;
32
+ data: Point[];
33
+ /** Override the marker shape for this series. Default: `circle`, or
34
+ * cycled from `DEFAULT_MARKERS` when the chart's `autoVariant` is true. */
35
+ marker?: MarkerShape;
36
+ /** Override the line dash pattern for this series. Default: `solid`, or
37
+ * cycled from `DEFAULT_LINE_STYLES` when the chart's `autoVariant` is true. */
38
+ lineStyle?: LineStyle;
39
+ };
40
+ export type MapPoint = {
41
+ /** Latitude in decimal degrees, from -90 to 90. */
42
+ latitude: number;
43
+ /** Longitude in decimal degrees, from -180 to 180. */
44
+ longitude: number;
45
+ /** Optional label emitted as an escaped SVG `<title>`. */
46
+ label?: string;
47
+ /** Optional magnitude used to scale the point radius. */
48
+ size?: number;
49
+ };
50
+ export type MapSeries = {
51
+ /** Optional label used by the legend. */
52
+ label?: string;
53
+ data: MapPoint[];
54
+ };
55
+ export type MapViewport = {
56
+ /** Latitude at the center of the viewport. */
57
+ latitude: number;
58
+ /** Longitude at the center of the viewport. */
59
+ longitude: number;
60
+ /** Zoom level from 0 (full world) to 5. Each level doubles the scale. */
61
+ zoom: number;
62
+ };
63
+ export type MapOptions = ChartOptions & {
64
+ series: MapSeries[];
65
+ /** Deterministic map center and zoom. Values are normalized to the map bounds. */
66
+ viewport?: MapViewport;
67
+ /** Pixel-radius range used when at least one finite `size` exists. */
68
+ sizeRange?: [number, number];
69
+ /** Render a series legend below the map. Default false. */
70
+ legend?: boolean;
71
+ };
72
+ export type BarItem = {
73
+ label: string;
74
+ value: number;
75
+ colorIndex?: number;
76
+ };
77
+ export type SliceItem = {
78
+ label: string;
79
+ value: number;
80
+ colorIndex?: number;
81
+ };
82
+ export type AxisOptions = {
83
+ /** Exact inclusive bounds for comparisons. Must contain all finite plotted
84
+ * values (including error bounds/baselines); invalid bounds throw RangeError. */
85
+ domain?: [number, number];
86
+ /** Opt in to space beside exact endpoint labels. Numeric X labels align
87
+ * inward; adjacent nice ticks within one interval are omitted. Default false. */
88
+ insetEndpointLabels?: boolean;
89
+ /** Suggested tick count. Actual count may differ to keep ticks "nice". */
90
+ ticks?: number;
91
+ /** Format a tick value into a label string. Default: `String(v)`. */
92
+ format?: (value: number) => string;
93
+ /** Optional axis title rendered alongside the axis. */
94
+ label?: string;
95
+ /** Axis scale. `"linear"` (default) or `"log"`. Log axis requires all
96
+ * data on this axis to be strictly positive; non-positive values are
97
+ * filtered out before domain computation. */
98
+ scale?: "linear" | "log";
99
+ /** Render small subdivision ticks between major ticks. Default false. */
100
+ minorTicks?: boolean;
101
+ };
102
+ export type Padding = {
103
+ top: number;
104
+ right: number;
105
+ bottom: number;
106
+ left: number;
107
+ };
108
+ /** One selectable datum in an inspected SVG. Indices refer to the source arrays.
109
+ * `anchor` uses the containing SVG coordinate system, including nested map SVGs.
110
+ * Values are raw data; `formatted` contains the renderer's axis/value formatting.
111
+ */
112
+ /** Wrap renderer-owned geometry with escaped, inert inspection metadata. */
113
+ export declare const chartDatumSvg: (svg: string, datum: ChartDatum, inspect?: boolean, titleText?: string) => string;
114
+ export type ChartOptions = {
115
+ /** Emit inert datum metadata and SVG titles for progressive inspection. */
116
+ inspect?: boolean;
117
+ /** Default 400. */
118
+ width?: number;
119
+ /** Default 240. */
120
+ height?: number;
121
+ /** Default `{ top: 16, right: 16, bottom: 32, left: 40 }`. A single number
122
+ * is applied to all four sides. */
123
+ padding?: number | Partial<Padding>;
124
+ /** Appended to the root `<svg>`'s class attribute (after `stdlib-chart`). */
125
+ className?: string;
126
+ /** Optional centered title rendered above the plot area. */
127
+ title?: string;
128
+ /** Optional centered subtitle rendered below the title. */
129
+ subtitle?: string;
130
+ };
131
+ /**
132
+ * A horizontal or vertical reference line drawn on a cartesian chart, e.g.
133
+ * for thresholds, targets, or averages.
134
+ */
135
+ export type ReferenceLine = {
136
+ /** Data value at which to draw the line. */
137
+ value: number;
138
+ /** Axis the line is anchored to. `"y"` (default) draws a horizontal line
139
+ * at the given y-value; `"x"` draws a vertical line at the x-value. */
140
+ axis?: "x" | "y";
141
+ /** Optional inline label rendered at the end of the line. */
142
+ label?: string;
143
+ /** Omit to retain the existing dashed line. */
144
+ style?: "solid" | "dashed" | "dotted";
145
+ /** Semantic color shared by the line and its label, with standalone SVG fallbacks. */
146
+ tone?: IntentTone;
147
+ };
148
+ /** Internal shared attributes for raw cartesian charts and UI bar layouts. */
149
+ export declare const referenceLineAttributes: (ref: ReferenceLine, label?: boolean) => string;
150
+ /** XML-escape a string for safe inclusion in attribute values or text content. */
151
+ export declare const escapeXml: (s: string) => string;
152
+ /** Normalize a `Padding` input (number or partial object) to a full `Padding`. */
153
+ export declare const normalizePadding: (p: number | Partial<Padding> | undefined) => Padding;
154
+ /**
155
+ * Compute `[min, max]` from a list of numeric values, ignoring non-finite
156
+ * entries. Returns `[0, 1]` for an empty/all-non-finite list and pads ±1
157
+ * around a single finite value.
158
+ */
159
+ export declare const computeDomain: (values: readonly number[]) => [number, number];
160
+ /**
161
+ * Pick a "nice" axis step (1, 2, 5, 10, 20, 50, ...) that splits `range`
162
+ * into roughly `target` intervals. Avoids ugly tick labels like 0.473.
163
+ */
164
+ export declare const niceStep: (range: number, target: number) => number;
165
+ /** The most ticks one linear axis counts, the same budget as a time axis; more never fit a readable axis. */
166
+ export declare const MAX_AXIS_TICKS = 1000;
167
+ /**
168
+ * Round `min` down and `max` up to the nearest multiples of `step`, so the
169
+ * domain edges fall on tick boundaries. Returns the extended domain plus the
170
+ * tick values within it (inclusive of both ends).
171
+ */
172
+ export declare const extendDomainToNice: (min: number, max: number, step: number) => {
173
+ domain: [number, number];
174
+ ticks: number[];
175
+ };
176
+ /** Linear map of `value` from input domain `[d0, d1]` to output range `[r0, r1]`. */
177
+ export declare const mapRange: (value: number, [d0, d1]: readonly [number, number], [r0, r1]: readonly [number, number]) => number;
178
+ /**
179
+ * Logarithmic (base-10) map of `value` from input domain `[d0, d1]` to
180
+ * output range `[r0, r1]`. Both domain endpoints must be strictly positive.
181
+ * Non-positive values are clamped to a small epsilon to avoid `-Infinity`.
182
+ */
183
+ export declare const mapLog: (value: number, [d0, d1]: readonly [number, number], [r0, r1]: readonly [number, number]) => number;
184
+ /**
185
+ * Compute logarithmic ticks (powers of 10) within `[min, max]`. The
186
+ * returned array always includes both decade boundaries enclosing the
187
+ * domain so the axis line spans the data.
188
+ */
189
+ export declare const niceLogTicks: (min: number, max: number) => {
190
+ domain: [number, number];
191
+ ticks: number[];
192
+ };
193
+ /**
194
+ * Least-squares linear regression. Returns slope, intercept, and r² for the
195
+ * regression line `y = slope * x + intercept`. Returns null for fewer than
196
+ * two finite points or all-x-equal input.
197
+ */
198
+ export declare const linearRegression: (points: ReadonlyArray<{
199
+ x: number;
200
+ y: number;
201
+ }>) => {
202
+ slope: number;
203
+ intercept: number;
204
+ r2: number;
205
+ } | null;
206
+ /**
207
+ * Compute box-plot statistics for a set of observations:
208
+ * min/max, quartiles (q1/q2/q3 via R-7 linear interpolation), Tukey whiskers
209
+ * (1.5×IQR rule clamped to data extents), and outliers beyond the whiskers.
210
+ *
211
+ * Returns null for an empty/all-non-finite input.
212
+ */
213
+ export declare const computeBoxStats: (values: readonly number[]) => {
214
+ min: number;
215
+ max: number;
216
+ q1: number;
217
+ q2: number;
218
+ q3: number;
219
+ whiskerLow: number;
220
+ whiskerHigh: number;
221
+ outliers: number[];
222
+ } | null;
223
+ /**
224
+ * Bin a numeric dataset into a histogram. `bins` may be:
225
+ * - undefined → Sturges' formula `ceil(log2(n)) + 1`
226
+ * - a number → that many equal-width bins
227
+ * - an array of edges (length k+1 → k bins)
228
+ *
229
+ * Non-finite input values are filtered. Returns bin edges and per-bin counts.
230
+ */
231
+ export declare const autoBin: (values: readonly number[], bins?: number | readonly number[]) => {
232
+ edges: number[];
233
+ counts: number[];
234
+ };
235
+ export type PlotArea = {
236
+ x0: number;
237
+ y0: number;
238
+ x1: number;
239
+ y1: number;
240
+ };
241
+ export declare const computePlotArea: (width: number, height: number, padding: Padding, hasXAxisLabel: boolean, hasYAxisLabel: boolean, headerHeight?: number, legendHeight?: number) => PlotArea;
242
+ /**
243
+ * Render an optional centered header (title + subtitle) at the top of an
244
+ * SVG. Returns the SVG fragment plus the pixel height it consumed so the
245
+ * caller can shift the plot area down accordingly.
246
+ */
247
+ export declare const renderHeader: (width: number, title: string | undefined, subtitle: string | undefined) => {
248
+ svg: string;
249
+ height: number;
250
+ };
251
+ /**
252
+ * Render a single-row centered legend at the bottom of the SVG. Returns the
253
+ * SVG fragment plus the height it consumed so callers can shift the plot
254
+ * area up accordingly. Empty input yields height 0.
255
+ */
256
+ export declare const renderLegend: (items: ReadonlyArray<{
257
+ label: string;
258
+ seriesIndex: number;
259
+ }>, width: number, yTop: number) => {
260
+ svg: string;
261
+ height: number;
262
+ };
263
+ /** Measure the total height a legend with `items` will consume in `width`,
264
+ * without actually rendering. Used by chart functions to reserve vertical
265
+ * space before computing the plot area. */
266
+ export declare const measureLegendHeight: (items: ReadonlyArray<{
267
+ label: string;
268
+ seriesIndex: number;
269
+ }>, width: number) => number;
270
+ /** Wrap chart body in a root `<svg>` with embedded default styles. */
271
+ export declare const svgRoot: (opts: {
272
+ width: number;
273
+ height: number;
274
+ className?: string;
275
+ }, body: string) => string;
276
+ /** Format an SVG path `d` attribute for a polyline through `points`. */
277
+ export declare const linePathD: (points: ReadonlyArray<{
278
+ x: number;
279
+ y: number;
280
+ }>) => string;
281
+ /**
282
+ * Format an SVG path `d` for a smooth curve through `points` using cubic
283
+ * Bezier segments with Catmull-Rom-derived vertical control points.
284
+ *
285
+ * Vertical control points use neighboring `points[i-1]` and `points[i+2]`
286
+ * (reflecting the end points at boundaries) with the standard Catmull-Rom
287
+ * tension factor of 1/6. Horizontal control points stay at the segment's
288
+ * thirds, so x progresses linearly and never doubles back when point spacing
289
+ * is uneven.
290
+ */
291
+ export declare const smoothPathD: (points: ReadonlyArray<{
292
+ x: number;
293
+ y: number;
294
+ }>) => string;
295
+ /**
296
+ * Build an SVG path `d` attribute for a pie slice (or donut sector).
297
+ *
298
+ * Angles are in radians, measured from the +X axis. Slices grow clockwise,
299
+ * which in SVG's y-down coordinate space means `a1 > a0` produces a clockwise
300
+ * arc when drawn with the large-arc and sweep flags set appropriately.
301
+ *
302
+ * Full-circle (a1 - a0 ≈ 2π) is split into two 180° arcs because a single
303
+ * `A` command can't draw a complete circle unambiguously.
304
+ */
305
+ export declare const arcPathD: (cx: number, cy: number, r: number, a0: number, a1: number, innerR?: number) => string;
306
+ /**
307
+ * SVG path `d` for a marker shape centered at `(cx, cy)` with circumradius `r`.
308
+ *
309
+ * The shapes are sized so a typical visual radius matches `r`:
310
+ * - circle: full radius
311
+ * - square: side = sqrt(2)·r so the diagonal equals 2·r (visually balanced
312
+ * next to a circle of the same r)
313
+ * - triangle: equilateral pointing up, circumradius r
314
+ * - diamond: square rotated 45°, half-diagonal = r
315
+ * - plus: cross-shape at thickness r·0.5
316
+ * - cross: X-shape at thickness r·0.4
317
+ */
318
+ export declare const markerPath: (shape: MarkerShape, cx: number, cy: number, r: number) => string;
319
+ /**
320
+ * SVG path `d` for a step (stair) line. `mode` controls where the vertical
321
+ * step happens relative to the data points:
322
+ * - `before` — vertical step at the new x BEFORE the value updates (state
323
+ * machine "Mealy" style: change at input)
324
+ * - `after` — value updates at the data point's x and persists until next x
325
+ * - `middle` — vertical step at the midpoint between consecutive x-values
326
+ */
327
+ export declare const stepPathD: (points: ReadonlyArray<{
328
+ x: number;
329
+ y: number;
330
+ }>, mode: "before" | "after" | "middle") => string;
331
+ /** Format a number for SVG attributes — short, no scientific notation. */
332
+ export declare const fmt: (n: number) => string;
333
+ export declare const clamp: (value: number, min: number, max: number) => number;
334
+ export type RgbColor = {
335
+ r: number;
336
+ g: number;
337
+ b: number;
338
+ };
339
+ export type AxisScale = {
340
+ domain: [number, number];
341
+ ticks: number[];
342
+ minorTicks: number[];
343
+ scale: "linear" | "log";
344
+ };
345
+ export type SeriesChartOptions = ChartOptions & {
346
+ series: Series[];
347
+ xAxis?: AxisOptions;
348
+ yAxis?: AxisOptions;
349
+ /** Reference lines (thresholds, targets, averages) drawn on the plot. */
350
+ references?: ReferenceLine[];
351
+ /** Render a single-row legend at the bottom of the chart, listing each
352
+ * series's label with its color swatch. Series without a `label` are
353
+ * shown as `Series N` (1-indexed). Default false. */
354
+ legend?: boolean;
355
+ };
356
+ export type ScatterOptions = SeriesChartOptions & {
357
+ /** Pixel-radius range for the optional `size` dimension on points.
358
+ * Default `[3, 12]`. Only applied when at least one point has a finite
359
+ * `size`; otherwise all points use the default radius (3px). */
360
+ sizeRange?: [number, number];
361
+ /** When true, automatically vary marker shape per series (cycling through
362
+ * `circle, square, triangle, diamond, plus, cross`) so series remain
363
+ * distinguishable in B/W or color-blind contexts. Default false. */
364
+ autoVariant?: boolean;
365
+ /** Overlay a least-squares linear regression line across all data points.
366
+ * Default false. */
367
+ trendline?: boolean;
368
+ };
369
+ export type LineOptions = SeriesChartOptions & {
370
+ /** Render smooth Catmull-Rom curves. Default `true`. Pass `false` for
371
+ * straight segments between points. */
372
+ smooth?: boolean;
373
+ /** Fill the area below each line with the series color (translucent).
374
+ * Renders as a separate path so the line stroke remains crisp. Default false. */
375
+ area?: boolean;
376
+ /** Render a step (stair) line instead of a smooth/straight one. Implies
377
+ * `smooth: false`. */
378
+ step?: "before" | "after" | "middle";
379
+ /** When true, automatically vary line dash pattern per series (cycling
380
+ * through `solid, dashed, dotted, dashdot`). Default false. */
381
+ autoVariant?: boolean;
382
+ /** Render a translucent confidence band between each point's `errYLow` and
383
+ * `errYHigh`. Points without explicit error fields are skipped. Default false. */
384
+ errorBand?: boolean;
385
+ };
386
+ /**
387
+ * Render a scatter plot. Each series produces a group of circles, one per
388
+ * data point, classed `stdlib-chart-series-N` so series colors stay
389
+ * consistent across charts.
390
+ *
391
+ * Non-finite x or y values are filtered out. An empty `series` (or one with
392
+ * no finite points) renders an empty-state SVG with a "no data" label.
393
+ *
394
+ * @example
395
+ * charts.scatter({ series: [{ data: [{x:1,y:2},{x:2,y:5},{x:3,y:3}] }] });
396
+ *
397
+ * @example
398
+ * charts.scatter({
399
+ * series: [
400
+ * { label: "Group A", data: [...] },
401
+ * { label: "Group B", data: [...] },
402
+ * ],
403
+ * xAxis: { label: "Time (s)" },
404
+ * yAxis: { label: "Value", format: v => `${v}k` },
405
+ * });
406
+ */
407
+ export declare const scatter: (opts: ScatterOptions) => string;
408
+ /**
409
+ * Render a line chart. Each series becomes a `<path class="stdlib-chart-line">`
410
+ * connecting its points (sorted by `x`). Multi-series charts get distinct
411
+ * `stdlib-chart-series-N` classes.
412
+ *
413
+ * Non-finite points are filtered. A series with fewer than 2 finite points
414
+ * is skipped (no path can be drawn). An empty/all-non-finite chart renders
415
+ * an empty-state SVG.
416
+ *
417
+ * @example
418
+ * charts.line({ series: [{ data: [{x:1,y:10},{x:2,y:25},{x:3,y:18}] }] });
419
+ *
420
+ * @example
421
+ * charts.line({
422
+ * series: [
423
+ * { label: "Revenue", data: [...] },
424
+ * { label: "Costs", data: [...] },
425
+ * ],
426
+ * yAxis: { format: v => `$${v}k` },
427
+ * });
428
+ */
429
+ export declare const line: (opts: LineOptions) => string;
430
+ export type BarChartOptions = ChartOptions & {
431
+ data: BarItem[];
432
+ yAxis?: AxisOptions;
433
+ /** When true, each bar gets its own series color (`series-0` ... `series-7`,
434
+ * cyclic). When false (default), all bars share `series-0`. */
435
+ colorByBar?: boolean;
436
+ /** Reference lines on the y-axis (e.g. target threshold). x-axis references
437
+ * are ignored on bar charts since the x-axis is categorical. */
438
+ references?: ReferenceLine[];
439
+ /** Render the formatted value above (positive) or below (negative) each bar.
440
+ * Uses `yAxis.format` if provided, otherwise `String(value)`. Default false. */
441
+ showValues?: boolean;
442
+ /** Render a legend mapping each bar's label to its color. Only meaningful
443
+ * when `colorByBar` is true; ignored otherwise (the default single-color
444
+ * bar chart needs no legend). Default false. */
445
+ legend?: boolean;
446
+ };
447
+ /**
448
+ * Render a categorical bar chart. The y-domain always includes zero so bars
449
+ * rest on a visible baseline. Negative values produce bars below the zero
450
+ * line; mixed positive/negative inputs render the zero line as the X axis.
451
+ *
452
+ * Bars use class `stdlib-chart-bar stdlib-chart-series-0` (single-series
453
+ * only in v1 — grouped/stacked bars are out of scope).
454
+ *
455
+ * Non-finite values are filtered. Empty input renders an empty-state SVG.
456
+ *
457
+ * @example
458
+ * charts.bar({ data: [{label:"Q1",value:120},{label:"Q2",value:180}] });
459
+ *
460
+ * @example
461
+ * charts.bar({
462
+ * data: [{label:"Profit",value:50},{label:"Loss",value:-20}],
463
+ * yAxis: { format: v => `${v}k` },
464
+ * });
465
+ */
466
+ export declare const bar: (opts: BarChartOptions) => string;
467
+ export type PieChartOptions = ChartOptions & {
468
+ data: SliceItem[];
469
+ /** Render slice labels with percentages outside the chart area. Default false.
470
+ * Note: for many small slices or one dominant slice, prefer `legend: true`
471
+ * to avoid overlapping labels. */
472
+ showLabels?: boolean;
473
+ /** Render a wrapping legend below the chart with `Label (XX%)` entries.
474
+ * Recommended when slices are many or when one slice dominates — outside
475
+ * labels collide in those cases. Default false. */
476
+ legend?: boolean;
477
+ /** Inner radius as a fraction of outer radius (0..1). 0 = pie, 0.6 = donut.
478
+ * Values outside `[0, 0.95]` are clamped. */
479
+ innerRadius?: number;
480
+ };
481
+ /**
482
+ * Render a pie chart. Slices are drawn clockwise starting at 12 o'clock,
483
+ * proportional to each item's `value`. Pass `showLabels: true` to render
484
+ * `Label (XX%)` outside each slice, or `legend: true` to render a wrapping
485
+ * legend below the chart.
486
+ *
487
+ * Use `legend` (not `showLabels`) when slices are many or one slice dominates —
488
+ * outside labels collide in those cases.
489
+ *
490
+ * Non-positive and non-finite values are filtered. A 100%-single-slice draws
491
+ * a complete circle. Empty/all-zero input renders an empty-state SVG.
492
+ *
493
+ * @example
494
+ * charts.pie({ data: [{label:"A",value:30},{label:"B",value:50},{label:"C",value:20}] });
495
+ *
496
+ * @example
497
+ * charts.pie({ data: [...], showLabels: true });
498
+ *
499
+ * @example
500
+ * charts.pie({ data: [...], legend: true }); // recommended for many small slices
501
+ */
502
+ export declare const pie: (opts: PieChartOptions) => string;
503
+ /**
504
+ * Render a donut chart. Identical to {@link pie} but with a hollow center
505
+ * (default `innerRadius: 0.6`). Override `innerRadius` for a thicker or
506
+ * thinner ring.
507
+ *
508
+ * @example
509
+ * charts.donut({ data: [{label:"Used",value:67},{label:"Free",value:33}] });
510
+ *
511
+ * @example
512
+ * charts.donut({ data: [...], innerRadius: 0.4, showLabels: true });
513
+ *
514
+ * @example
515
+ * charts.donut({ data: [...], legend: true }); // wrapping legend below the ring
516
+ */
517
+ export declare const donut: (opts: PieChartOptions) => string;
518
+ export type HistogramOptions = ChartOptions & {
519
+ /** Raw observations. Non-finite entries are filtered. */
520
+ data: number[];
521
+ /** Bin specification:
522
+ * - undefined → Sturges' formula `ceil(log2(n)) + 1`
523
+ * - number → that many equal-width bins
524
+ * - array of bin edges (length k+1 → k bins) */
525
+ bins?: number | number[];
526
+ yAxis?: AxisOptions;
527
+ xAxis?: AxisOptions;
528
+ references?: ReferenceLine[];
529
+ };
530
+ /**
531
+ * Render a histogram (frequency distribution) of the given observations.
532
+ * Uses Sturges' formula by default for bin count, or accepts an explicit
533
+ * count or list of bin edges.
534
+ *
535
+ * Bars are adjacent (no inter-bar gap) since a histogram represents a
536
+ * continuous distribution. The x-axis is numeric (bin edges as ticks).
537
+ *
538
+ * @example
539
+ * charts.histogram({ data: observations, title: "Reaction times (ms)" });
540
+ *
541
+ * @example
542
+ * charts.histogram({ data: scores, bins: 20, yAxis: { label: "Count" } });
543
+ */
544
+ export declare const histogram: (opts: HistogramOptions) => string;
545
+ export type BoxPlotItem = {
546
+ label: string;
547
+ values: number[];
548
+ };
549
+ export type BoxPlotOptions = ChartOptions & {
550
+ /** Groups of observations, one box per group. */
551
+ groups: BoxPlotItem[];
552
+ yAxis?: AxisOptions;
553
+ /** When true (default), render outliers as individual dots beyond the
554
+ * whiskers (1.5×IQR fences). */
555
+ showOutliers?: boolean;
556
+ references?: ReferenceLine[];
557
+ /** When true, each box gets its own series color. Default false (all use
558
+ * series-0). */
559
+ colorByBox?: boolean;
560
+ };
561
+ /**
562
+ * Render a box plot (Tukey style): box for the IQR (Q1-Q3), median line,
563
+ * whiskers extending to 1.5×IQR fences, and individual outlier dots.
564
+ *
565
+ * Useful for comparing distributions across categorical groups (e.g. test
566
+ * scores per class, reaction times per condition).
567
+ *
568
+ * @example
569
+ * charts.boxplot({
570
+ * groups: [
571
+ * { label: "Class A", values: scoresA },
572
+ * { label: "Class B", values: scoresB },
573
+ * ],
574
+ * yAxis: { label: "Score" },
575
+ * });
576
+ */
577
+ export declare const boxplot: (opts: BoxPlotOptions) => string;
578
+ export type Threshold = {
579
+ /** Inclusive upper bound for this threshold segment. */
580
+ value: number;
581
+ /** Optional label for legends or future consumers. */
582
+ label?: string;
583
+ /** Optional SVG color. When omitted, the series CSS variables are used. */
584
+ color?: string;
585
+ };
586
+ export type GaugeOptions = ChartOptions & {
587
+ value: number;
588
+ min?: number;
589
+ max?: number;
590
+ label?: string;
591
+ unit?: string;
592
+ format?: (value: number) => string;
593
+ thresholds?: Threshold[];
594
+ showNeedle?: boolean;
595
+ };
596
+ export type BarGaugeItem = {
597
+ label: string;
598
+ value: number;
599
+ min?: number;
600
+ max?: number;
601
+ unit?: string;
602
+ };
603
+ export type BarGaugeOptions = ChartOptions & {
604
+ data: BarGaugeItem[];
605
+ min?: number;
606
+ max?: number;
607
+ unit?: string;
608
+ format?: (value: number) => string;
609
+ thresholds?: Threshold[];
610
+ };
611
+ export type StatOptions = ChartOptions & {
612
+ label: string;
613
+ value: number | string;
614
+ unit?: string;
615
+ delta?: number | string;
616
+ deltaFormat?: (value: number) => string;
617
+ trend?: "up" | "down" | "neutral";
618
+ sparkline?: number[] | Point[];
619
+ format?: (value: number) => string;
620
+ };
621
+ export type HeatmapDatum = {
622
+ x: string;
623
+ y: string;
624
+ value: number;
625
+ };
626
+ export type HeatmapOptions = ChartOptions & {
627
+ data: HeatmapDatum[];
628
+ xLabels?: string[];
629
+ yLabels?: string[];
630
+ min?: number;
631
+ max?: number;
632
+ format?: (value: number) => string;
633
+ showValues?: boolean;
634
+ };
635
+ export type StateInterval = {
636
+ from: number;
637
+ to: number;
638
+ state: string;
639
+ label?: string;
640
+ };
641
+ export type StateTimelineRow = {
642
+ label: string;
643
+ intervals: StateInterval[];
644
+ };
645
+ export type StateStyle = {
646
+ state: string;
647
+ label?: string;
648
+ color?: string;
649
+ };
650
+ export type StateTimelineOptions = ChartOptions & {
651
+ rows: StateTimelineRow[];
652
+ states?: StateStyle[];
653
+ xAxis?: Pick<AxisOptions, "format" | "label">;
654
+ legend?: boolean;
655
+ };
656
+ /**
657
+ * Render a radial single-value gauge for KPI, quota, saturation, or SLO style
658
+ * dashboard panels.
659
+ */
660
+ export declare const gauge: (opts: GaugeOptions) => string;
661
+ /** Render compact horizontal bar gauges for multiple reduced metrics. */
662
+ export declare const barGauge: (opts: BarGaugeOptions) => string;
663
+ /** Render a large value panel with optional delta and inline sparkline. */
664
+ export declare const stat: (opts: StatOptions) => string;
665
+ /**
666
+ * Render a categorical two-dimensional heatmap. Cell opacity represents value
667
+ * intensity; labels are derived from first occurrence order unless provided.
668
+ */
669
+ export declare const heatmap: (opts: HeatmapOptions) => string;
670
+ /**
671
+ * Render state regions over a numeric timeline for services, jobs, deploys, or
672
+ * health checks.
673
+ */
674
+ export declare const stateTimeline: (opts: StateTimelineOptions) => string;
675
+ export type SparklineOptions = {
676
+ inspect?: boolean;
677
+ /** Series of values. Bare numbers auto-x to their array index. */
678
+ data: number[] | Point[];
679
+ /** Default 80. */
680
+ width?: number;
681
+ /** Default 20. */
682
+ height?: number;
683
+ /** Render with smooth Catmull-Rom curves. Default `true`. */
684
+ smooth?: boolean;
685
+ /** Render a small dot at the last data point. Default false. */
686
+ showLast?: boolean;
687
+ /** Render dots at the highest and lowest data points. Skipped when all
688
+ * values are equal. Default false. */
689
+ showMinMax?: boolean;
690
+ /** Render a soft gradient fill below the stroke line, fading from a
691
+ * translucent `currentColor` at the top to fully transparent at the
692
+ * bottom — the classic dashboard-tile look. The stroke line stays
693
+ * visible on top, and dots from `showLast`/`showMinMax` compose over
694
+ * the fill. Default false. */
695
+ area?: boolean;
696
+ /** Appended to the root `<svg>`'s class attribute. */
697
+ className?: string;
698
+ };
699
+ /**
700
+ * Render a minimalist sparkline — a tiny inline chart with no axes, no
701
+ * labels, and minimal padding. Designed to fit alongside text or in dense
702
+ * tables.
703
+ *
704
+ * Stroke uses `currentColor` by default, so it adopts the surrounding text
705
+ * color. Pass `className` to scope a different color.
706
+ *
707
+ * @example
708
+ * charts.sparkline({ data: [3, 7, 5, 9, 12, 10, 14] });
709
+ *
710
+ * @example
711
+ * charts.sparkline({
712
+ * data: [3, 7, 5, 9, 12, 10, 14],
713
+ * smooth: true,
714
+ * showLast: true,
715
+ * width: 120,
716
+ * });
717
+ *
718
+ * @example
719
+ * // Dashboard-tile look: stroke + soft gradient fill fading to transparent.
720
+ * charts.sparkline({ data: [3, 7, 5, 9, 12, 10, 14], area: true });
721
+ */
722
+ export declare const sparkline: (opts: SparklineOptions) => string;