@zsherman/charts 0.0.0-stage → 0.1.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 (180) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +373 -0
  3. package/README.md +13 -2
  4. package/THIRD_PARTY_NOTICES.md +33 -0
  5. package/dist/dom/bar-list/bar-list.js +386 -0
  6. package/dist/dom/bar-list/bar-list.styles.js +171 -0
  7. package/dist/dom/bar-list/index.js +1 -0
  8. package/dist/dom/chart/chart.js +716 -0
  9. package/dist/dom/chart/chart.styles.js +165 -0
  10. package/dist/dom/chart/index.js +1 -0
  11. package/dist/dom/chart-grid/chart-grid.js +67 -0
  12. package/dist/dom/chart-grid/index.js +1 -0
  13. package/dist/dom/donut/donut.js +565 -0
  14. package/dist/dom/donut/donut.styles.js +111 -0
  15. package/dist/dom/donut/index.js +1 -0
  16. package/dist/dom/heat-graph/calendar.js +118 -0
  17. package/dist/dom/heat-graph/heat-graph.js +423 -0
  18. package/dist/dom/heat-graph/heat-graph.styles.js +168 -0
  19. package/dist/dom/heat-graph/index.js +1 -0
  20. package/dist/dom/heat-matrix/heat-matrix.js +346 -0
  21. package/dist/dom/heat-matrix/heat-matrix.styles.js +155 -0
  22. package/dist/dom/heat-matrix/index.js +1 -0
  23. package/dist/dom/heat-matrix/model.js +41 -0
  24. package/dist/dom/index.js +13 -0
  25. package/dist/dom/internal/colors.js +44 -0
  26. package/dist/dom/internal/floating-tip.js +83 -0
  27. package/dist/dom/internal/format.js +43 -0
  28. package/dist/dom/internal/grid-context.js +5 -0
  29. package/dist/dom/internal/hidden.styles.js +16 -0
  30. package/dist/dom/internal/legend.js +112 -0
  31. package/dist/dom/internal/legend.styles.js +108 -0
  32. package/dist/dom/internal/markers.js +101 -0
  33. package/dist/dom/internal/options.js +300 -0
  34. package/dist/dom/internal/place.js +27 -0
  35. package/dist/dom/internal/scheme-watch.js +73 -0
  36. package/dist/dom/internal/share.js +28 -0
  37. package/dist/dom/internal/types.js +0 -0
  38. package/dist/dom/row-chart/index.js +1 -0
  39. package/dist/dom/row-chart/model.js +59 -0
  40. package/dist/dom/row-chart/row-chart.js +691 -0
  41. package/dist/dom/row-chart/row-chart.styles.js +242 -0
  42. package/dist/dom/segmented-bar/index.js +1 -0
  43. package/dist/dom/segmented-bar/segmented-bar.js +280 -0
  44. package/dist/dom/segmented-bar/segmented-bar.styles.js +88 -0
  45. package/dist/dom/sparkline/index.js +1 -0
  46. package/dist/dom/sparkline/sparkline.js +145 -0
  47. package/dist/dom/stacked-histogram/histogram.js +137 -0
  48. package/dist/dom/stacked-histogram/index.js +1 -0
  49. package/dist/dom/stacked-histogram/stacked-histogram.js +761 -0
  50. package/dist/dom/stacked-histogram/stacked-histogram.styles.js +211 -0
  51. package/dist/dom/state-timeline/index.js +1 -0
  52. package/dist/dom/state-timeline/model.js +166 -0
  53. package/dist/dom/state-timeline/state-timeline.js +729 -0
  54. package/dist/dom/state-timeline/state-timeline.styles.js +171 -0
  55. package/dist/dom/status-history/index.js +1 -0
  56. package/dist/dom/status-history/status-history.js +542 -0
  57. package/dist/dom/status-history/status-history.styles.js +171 -0
  58. package/dist/solid/bar-list/bar-list.jsx +139 -0
  59. package/dist/solid/bar-list/bar-list.styles.jsx +171 -0
  60. package/dist/solid/bar-list/index.jsx +1 -0
  61. package/dist/solid/chart/chart.jsx +454 -0
  62. package/dist/solid/chart/chart.styles.jsx +165 -0
  63. package/dist/solid/chart/index.jsx +1 -0
  64. package/dist/solid/chart-grid/chart-grid.jsx +46 -0
  65. package/dist/solid/chart-grid/index.jsx +1 -0
  66. package/dist/solid/donut/donut.jsx +291 -0
  67. package/dist/solid/donut/donut.styles.jsx +111 -0
  68. package/dist/solid/donut/index.jsx +1 -0
  69. package/dist/solid/heat-graph/calendar.jsx +118 -0
  70. package/dist/solid/heat-graph/heat-graph.jsx +228 -0
  71. package/dist/solid/heat-graph/heat-graph.styles.jsx +168 -0
  72. package/dist/solid/heat-graph/index.jsx +1 -0
  73. package/dist/solid/heat-matrix/heat-matrix.jsx +165 -0
  74. package/dist/solid/heat-matrix/heat-matrix.styles.jsx +155 -0
  75. package/dist/solid/heat-matrix/index.jsx +1 -0
  76. package/dist/solid/heat-matrix/model.jsx +41 -0
  77. package/dist/solid/index.jsx +13 -0
  78. package/dist/solid/internal/colors.jsx +44 -0
  79. package/dist/solid/internal/floating-tip.jsx +68 -0
  80. package/dist/solid/internal/format.jsx +43 -0
  81. package/dist/solid/internal/grid-context.jsx +5 -0
  82. package/dist/solid/internal/hidden.styles.jsx +16 -0
  83. package/dist/solid/internal/legend.jsx +35 -0
  84. package/dist/solid/internal/legend.styles.jsx +108 -0
  85. package/dist/solid/internal/markers.jsx +101 -0
  86. package/dist/solid/internal/options.jsx +300 -0
  87. package/dist/solid/internal/place.jsx +27 -0
  88. package/dist/solid/internal/scheme-watch.jsx +73 -0
  89. package/dist/solid/internal/share.jsx +28 -0
  90. package/dist/solid/internal/types.jsx +0 -0
  91. package/dist/solid/row-chart/index.jsx +1 -0
  92. package/dist/solid/row-chart/model.jsx +59 -0
  93. package/dist/solid/row-chart/row-chart.jsx +312 -0
  94. package/dist/solid/row-chart/row-chart.styles.jsx +242 -0
  95. package/dist/solid/segmented-bar/index.jsx +1 -0
  96. package/dist/solid/segmented-bar/segmented-bar.jsx +125 -0
  97. package/dist/solid/segmented-bar/segmented-bar.styles.jsx +88 -0
  98. package/dist/solid/sparkline/index.jsx +1 -0
  99. package/dist/solid/sparkline/sparkline.jsx +88 -0
  100. package/dist/solid/stacked-histogram/histogram.jsx +137 -0
  101. package/dist/solid/stacked-histogram/index.jsx +1 -0
  102. package/dist/solid/stacked-histogram/stacked-histogram.jsx +381 -0
  103. package/dist/solid/stacked-histogram/stacked-histogram.styles.jsx +211 -0
  104. package/dist/solid/state-timeline/index.jsx +1 -0
  105. package/dist/solid/state-timeline/model.jsx +166 -0
  106. package/dist/solid/state-timeline/state-timeline.jsx +387 -0
  107. package/dist/solid/state-timeline/state-timeline.styles.jsx +171 -0
  108. package/dist/solid/status-history/index.jsx +1 -0
  109. package/dist/solid/status-history/status-history.jsx +279 -0
  110. package/dist/solid/status-history/status-history.styles.jsx +171 -0
  111. package/dist/styles.css +1 -0
  112. package/dist/types/bar-list/bar-list.d.ts +91 -0
  113. package/dist/types/bar-list/bar-list.styles.d.ts +148 -0
  114. package/dist/types/bar-list/index.d.ts +3 -0
  115. package/dist/types/chart/chart.d.ts +98 -0
  116. package/dist/types/chart/chart.styles.d.ts +145 -0
  117. package/dist/types/chart/index.d.ts +3 -0
  118. package/dist/types/chart-grid/chart-grid.d.ts +35 -0
  119. package/dist/types/chart-grid/index.d.ts +2 -0
  120. package/dist/types/donut/donut.d.ts +124 -0
  121. package/dist/types/donut/donut.styles.d.ts +96 -0
  122. package/dist/types/donut/index.d.ts +3 -0
  123. package/dist/types/heat-graph/calendar.d.ts +61 -0
  124. package/dist/types/heat-graph/heat-graph.d.ts +82 -0
  125. package/dist/types/heat-graph/heat-graph.styles.d.ts +141 -0
  126. package/dist/types/heat-graph/index.d.ts +4 -0
  127. package/dist/types/heat-matrix/heat-matrix.d.ts +65 -0
  128. package/dist/types/heat-matrix/heat-matrix.styles.d.ts +135 -0
  129. package/dist/types/heat-matrix/index.d.ts +3 -0
  130. package/dist/types/heat-matrix/model.d.ts +15 -0
  131. package/dist/types/index.d.ts +12 -0
  132. package/dist/types/internal/colors.d.ts +22 -0
  133. package/dist/types/internal/floating-tip.d.ts +15 -0
  134. package/dist/types/internal/format.d.ts +7 -0
  135. package/dist/types/internal/grid-context.d.ts +9 -0
  136. package/dist/types/internal/hidden.styles.d.ts +15 -0
  137. package/dist/types/internal/legend.d.ts +18 -0
  138. package/dist/types/internal/legend.styles.d.ts +96 -0
  139. package/dist/types/internal/markers.d.ts +16 -0
  140. package/dist/types/internal/options.d.ts +59 -0
  141. package/dist/types/internal/place.d.ts +20 -0
  142. package/dist/types/internal/scheme-watch.d.ts +12 -0
  143. package/dist/types/internal/share.d.ts +19 -0
  144. package/dist/types/internal/types.d.ts +163 -0
  145. package/dist/types/row-chart/index.d.ts +4 -0
  146. package/dist/types/row-chart/model.d.ts +50 -0
  147. package/dist/types/row-chart/row-chart.d.ts +148 -0
  148. package/dist/types/row-chart/row-chart.styles.d.ts +216 -0
  149. package/dist/types/segmented-bar/index.d.ts +3 -0
  150. package/dist/types/segmented-bar/segmented-bar.d.ts +65 -0
  151. package/dist/types/segmented-bar/segmented-bar.styles.d.ts +75 -0
  152. package/dist/types/sparkline/index.d.ts +3 -0
  153. package/dist/types/sparkline/sparkline.d.ts +38 -0
  154. package/dist/types/stacked-histogram/histogram.d.ts +48 -0
  155. package/dist/types/stacked-histogram/index.d.ts +4 -0
  156. package/dist/types/stacked-histogram/stacked-histogram.d.ts +73 -0
  157. package/dist/types/stacked-histogram/stacked-histogram.styles.d.ts +187 -0
  158. package/dist/types/state-timeline/index.d.ts +3 -0
  159. package/dist/types/state-timeline/model.d.ts +63 -0
  160. package/dist/types/state-timeline/state-timeline.d.ts +108 -0
  161. package/dist/types/state-timeline/state-timeline.styles.d.ts +151 -0
  162. package/dist/types/status-history/index.d.ts +3 -0
  163. package/dist/types/status-history/status-history.d.ts +72 -0
  164. package/dist/types/status-history/status-history.styles.d.ts +150 -0
  165. package/docs/api.json +1346 -0
  166. package/docs/bar-list.md +190 -0
  167. package/docs/chart-grid.md +77 -0
  168. package/docs/chart.md +355 -0
  169. package/docs/donut.md +182 -0
  170. package/docs/heat-graph.md +121 -0
  171. package/docs/heat-matrix.md +108 -0
  172. package/docs/llms.txt +68 -0
  173. package/docs/row-chart.md +193 -0
  174. package/docs/search-index.json +291 -0
  175. package/docs/segmented-bar.md +128 -0
  176. package/docs/sparkline.md +82 -0
  177. package/docs/stacked-histogram.md +123 -0
  178. package/docs/state-timeline.md +141 -0
  179. package/docs/status-history.md +121 -0
  180. package/package.json +104 -4
@@ -0,0 +1,75 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+ export declare const styles: Readonly<{
3
+ readonly root: Readonly<{
4
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
5
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
6
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
7
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
8
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
9
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
10
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
11
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
12
+ }>;
13
+ readonly figure: Readonly<{
14
+ readonly position: stylex.StyleXClassNameFor<"position", "relative">;
15
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
16
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
17
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
18
+ }>;
19
+ readonly bar: Readonly<{
20
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
21
+ readonly gap: stylex.StyleXClassNameFor<"gap", "2px">;
22
+ readonly height: stylex.StyleXClassNameFor<"height", "var(--sb-height)">;
23
+ readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
24
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "9999px">;
25
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
26
+ readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
27
+ readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "1px">;
28
+ readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "CanvasText">;
29
+ }>;
30
+ readonly segment: Readonly<{
31
+ readonly flexBasis: stylex.StyleXClassNameFor<"flexBasis", 0>;
32
+ readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 1>;
33
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", "2px">;
34
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "var(--swatch)">;
35
+ readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
36
+ }>;
37
+ readonly rest: Readonly<{
38
+ readonly flexBasis: stylex.StyleXClassNameFor<"flexBasis", 0>;
39
+ readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 1>;
40
+ }>;
41
+ readonly markerLabel: Readonly<{
42
+ readonly position: stylex.StyleXClassNameFor<"position", "relative">;
43
+ readonly height: stylex.StyleXClassNameFor<"height", "1lh">;
44
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
45
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
46
+ readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
47
+ }>;
48
+ readonly markerText: Readonly<{
49
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
50
+ readonly top: stylex.StyleXClassNameFor<"top", 0>;
51
+ readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
52
+ }>;
53
+ readonly tick: Readonly<{
54
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
55
+ readonly bottom: stylex.StyleXClassNameFor<"bottom", "-3px">;
56
+ readonly width: stylex.StyleXClassNameFor<"width", "2px">;
57
+ readonly height: stylex.StyleXClassNameFor<"height", "calc(var(--sb-height) + 6px)">;
58
+ readonly marginInlineStart: stylex.StyleXClassNameFor<"marginInlineStart", "-1px">;
59
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "1px">;
60
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
61
+ readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", `0 0 0 1px ${stylex.StyleXVar<string>}`>;
62
+ readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
63
+ }>;
64
+ readonly legendGrid: Readonly<{
65
+ readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "repeat(auto-fill, minmax(min(15rem, 100%), 1fr))">;
66
+ readonly columnGap: stylex.StyleXClassNameFor<"columnGap", string>;
67
+ }>;
68
+ readonly legendRow: Readonly<{
69
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 0>;
70
+ }>;
71
+ readonly empty: Readonly<{
72
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
73
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
74
+ }>;
75
+ }>;
@@ -0,0 +1,3 @@
1
+ export { Sparkline } from "./sparkline.js";
2
+ export type { SparklineProps } from "./sparkline.js";
3
+ export type { ChartColor, ChartData } from "../internal/types.js";
@@ -0,0 +1,38 @@
1
+ import type { JSX } from "@solidjs/web";
2
+ import type { ChartColor, ChartData } from "../internal/types.js";
3
+ export interface SparklineProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "class"> {
4
+ /** The trend in words: the metric, the period and its direction ("Revenue, last 30 days: up 12%"). */
5
+ label: string;
6
+ /** The values, oldest first; or `[x, y]` aligned data when the points aren't evenly spaced. */
7
+ data: readonly (number | null)[] | ChartData;
8
+ /**
9
+ * Height in pixels. The width follows the container.
10
+ * @defaultValue 32
11
+ */
12
+ height?: number;
13
+ /**
14
+ * The line's color: a chart token (`chart-1` … `chart-8`) or any CSS color.
15
+ * @defaultValue "chart-1"
16
+ */
17
+ color?: ChartColor;
18
+ /** Fill a wash under the line. */
19
+ area?: boolean;
20
+ /** Mark the latest value with a dot: where "now" is. */
21
+ dot?: boolean;
22
+ /**
23
+ * Line width in pixels.
24
+ * @defaultValue 1.5
25
+ */
26
+ width?: number;
27
+ /** Extra classes on the root. */
28
+ class?: JSX.ClassValue;
29
+ }
30
+ /**
31
+ * A word-sized trend line with no axes, legend or tooltip, for a stat tile or a table cell. It shows the
32
+ * shape, not values: put the number it supports next to it. A small SVG (no canvas, no uPlot), drawn on the
33
+ * server and themed by CSS.
34
+ *
35
+ * @example
36
+ * <Sparkline label="Revenue, last 30 days: up 12%" data={daily} />
37
+ */
38
+ export declare function Sparkline(props: SparklineProps): JSX.Element;
@@ -0,0 +1,48 @@
1
+ /** The stacked histogram's geometry: which buckets show, their bars as paths, the time ticks. No DOM. */
2
+ /** One time bucket: when it starts, and each series' count in it. */
3
+ export interface HistogramBucket {
4
+ /** The bucket's start, in milliseconds since the epoch (`Date.now()`, `date.getTime()`). */
5
+ time: number;
6
+ /** Each series' count, by its `key`. A missing key counts as 0. */
7
+ values: Readonly<Record<string, number>>;
8
+ }
9
+ /** A span of time in milliseconds: `from` inclusive, `to` exclusive. */
10
+ export interface HistogramRange {
11
+ from: number;
12
+ to: number;
13
+ }
14
+ /** The buckets inside the range, oldest first (they're expected sorted). */
15
+ export declare function visibleBuckets(buckets: readonly HistogramBucket[], range: HistogramRange): HistogramBucket[];
16
+ /** The range the buckets cover: the first one's start to the last one's end. */
17
+ export declare function extent(buckets: readonly HistogramBucket[], bucketMs: number): HistogramRange | undefined;
18
+ export declare function totalOf(bucket: HistogramBucket, keys: readonly string[]): number;
19
+ /** Each series' sum over the buckets from index `a` to `b` (inclusive). */
20
+ export declare function sums(buckets: readonly HistogramBucket[], keys: readonly string[], a: number, b: number): number[];
21
+ /** The bucket under a time: the last one starting at or before it, else the first. -1 with none. */
22
+ export declare function indexAt(buckets: readonly HistogramBucket[], time: number): number;
23
+ /**
24
+ * One SVG path per series, in a viewBox one unit per bucket wide and `height` pixels tall (stretched across
25
+ * the width; the heights aren't). Series stack from the first, on the baseline, up; a pixel of space
26
+ * separates a bucket's segments so each reads as its own.
27
+ */
28
+ export declare function barPaths(buckets: readonly HistogramBucket[], keys: readonly string[], range: HistogramRange, bucketMs: number, height: number): {
29
+ width: number;
30
+ max: number;
31
+ paths: string[];
32
+ };
33
+ /**
34
+ * A time zone's offset from UTC at a moment, in milliseconds: the runtime's own zone without one. Ticks
35
+ * fall on that zone's round hours and midnights.
36
+ */
37
+ export declare function zoneOffset(time: number, timeZone?: string): number;
38
+ /**
39
+ * Round times across the range, at most `max` of them: on the minute, the hour or midnight in the time
40
+ * zone, the step the smallest that fits. `day` marks a tick at midnight, which is written as a date.
41
+ */
42
+ export declare function timeTicks(range: HistogramRange, max: number, timeZone?: string): {
43
+ step: number;
44
+ ticks: Array<{
45
+ time: number;
46
+ day: boolean;
47
+ }>;
48
+ };
@@ -0,0 +1,4 @@
1
+ export { StackedHistogram } from "./stacked-histogram.js";
2
+ export type { HistogramSeries, StackedHistogramLabels, StackedHistogramProps } from "./stacked-histogram.js";
3
+ export type { HistogramBucket, HistogramRange } from "./histogram.js";
4
+ export type { ChartColor } from "../internal/types.js";
@@ -0,0 +1,73 @@
1
+ import type { JSX } from "@solidjs/web";
2
+ import type { ChartColor } from "../internal/types.js";
3
+ import { type HistogramBucket, type HistogramRange } from "./histogram.js";
4
+ /** One stacked series: a key into each bucket's `values`, its name and its color. */
5
+ export interface HistogramSeries {
6
+ /** The key of its count in each bucket's `values`. */
7
+ key: string;
8
+ /** Its name, in the legend and the tooltip. */
9
+ label: string;
10
+ /** A chart token (`chart-1` … `chart-8`) or any CSS color. Defaults to the chart tokens in order. */
11
+ color?: ChartColor;
12
+ }
13
+ /** The histogram's built-in words. Also set app-wide with the kit's `LocaleProvider messages={{ stackedHistogram }}`. */
14
+ export interface StackedHistogramLabels {
15
+ /** The selection card's zoom button. */
16
+ zoom: string;
17
+ /** The selection card's button that drops the selection. */
18
+ clear: string;
19
+ /** The sum row in the tooltip and the selection card. */
20
+ total: string;
21
+ /** The selection card's name. */
22
+ selection: string;
23
+ /** How to read the buckets with the keyboard. */
24
+ keyboardHint: string;
25
+ /** How to select a range with the keyboard, after `keyboardHint` when `onZoom` is set. */
26
+ selectHint: string;
27
+ }
28
+ export interface StackedHistogramProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "class"> {
29
+ /** What is counted, for assistive technology: the total and the measure ("412 log events by level"). */
30
+ label: string;
31
+ /** One entry per time bucket, oldest first. Buckets outside `domain` aren't drawn. */
32
+ buckets: readonly HistogramBucket[];
33
+ /** The stacked series, bottom to top: the first sits on the baseline. */
34
+ series: readonly HistogramSeries[];
35
+ /** The width of a bucket in milliseconds (`60_000` for minutes). */
36
+ bucketMs: number;
37
+ /** The time window drawn (`to` exclusive). Defaults to the buckets' own span; set it to what `onZoom` chose. */
38
+ domain?: HistogramRange;
39
+ /**
40
+ * The bars' height in pixels.
41
+ * @defaultValue 64
42
+ */
43
+ height?: number;
44
+ /**
45
+ * Called with the range a person selected (by dragging, or Shift with the arrow keys) and chose to zoom
46
+ * to. Without it, the histogram only reads out its buckets.
47
+ */
48
+ onZoom?: (range: HistogramRange) => void;
49
+ /**
50
+ * The series names under the axis. On by default for two or more series.
51
+ */
52
+ legend?: boolean;
53
+ /**
54
+ * The time zone times are written in and ticks fall on (`"UTC"`, `"Europe/Berlin"`). Defaults to the
55
+ * runtime's: set it when the server renders, so server and browser write the same times.
56
+ */
57
+ timeZone?: string;
58
+ /** How a count is written. Defaults to the locale's number format. */
59
+ formatValue?: (value: number) => string;
60
+ /** The histogram's words, in your wording or language (app-wide: `LocaleProvider messages.stackedHistogram`). */
61
+ labels?: Partial<StackedHistogramLabels>;
62
+ /** Extra classes on the root. */
63
+ class?: JSX.ClassValue;
64
+ }
65
+ /**
66
+ * Counts per time bucket, stacked by series, for the shape of events over time above a log or record list.
67
+ * Drag across the bars, or hold Shift with the arrow keys, to select a range and zoom the window to it. SVG
68
+ * drawn on the server; the arrow keys read each bucket out.
69
+ *
70
+ * @example
71
+ * <StackedHistogram label="412 log events by level" buckets={buckets} series={levels} bucketMs={60_000} />
72
+ */
73
+ export declare function StackedHistogram(props: StackedHistogramProps): JSX.Element;
@@ -0,0 +1,187 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+ export declare const styles: Readonly<{
3
+ readonly root: Readonly<{
4
+ readonly position: stylex.StyleXClassNameFor<"position", "relative">;
5
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
6
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
7
+ readonly flexDirection: stylex.StyleXClassNameFor<"flexDirection", "column">;
8
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
9
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
10
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
11
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
12
+ }>;
13
+ readonly plot: Readonly<{
14
+ readonly position: stylex.StyleXClassNameFor<"position", "relative">;
15
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
16
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
17
+ readonly direction: stylex.StyleXClassNameFor<"direction", "ltr">;
18
+ readonly borderBottomWidth: stylex.StyleXClassNameFor<"borderBottomWidth", "1px">;
19
+ readonly borderBottomStyle: stylex.StyleXClassNameFor<"borderBottomStyle", "solid">;
20
+ readonly borderBottomColor: stylex.StyleXClassNameFor<"borderBottomColor", string>;
21
+ readonly touchAction: stylex.StyleXClassNameFor<"touchAction", "pan-y">;
22
+ readonly userSelect: stylex.StyleXClassNameFor<"userSelect", "none">;
23
+ readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
24
+ readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "2px">;
25
+ readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "2px">;
26
+ readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", string>;
27
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "1px">;
28
+ }>;
29
+ readonly selectable: Readonly<{
30
+ readonly cursor: stylex.StyleXClassNameFor<"cursor", "crosshair">;
31
+ }>;
32
+ readonly svg: Readonly<{
33
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
34
+ readonly inset: stylex.StyleXClassNameFor<"inset", 0>;
35
+ readonly display: stylex.StyleXClassNameFor<"display", "block">;
36
+ readonly width: stylex.StyleXClassNameFor<"width", "100%">;
37
+ readonly height: stylex.StyleXClassNameFor<"height", "100%">;
38
+ readonly overflow: stylex.StyleXClassNameFor<"overflow", "visible">;
39
+ readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
40
+ }>;
41
+ readonly band: Readonly<{
42
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
43
+ readonly top: stylex.StyleXClassNameFor<"top", 0>;
44
+ readonly bottom: stylex.StyleXClassNameFor<"bottom", 0>;
45
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
46
+ readonly pointerEvents: stylex.StyleXClassNameFor<"pointerEvents", "none">;
47
+ }>;
48
+ readonly scrim: Readonly<{
49
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
50
+ readonly top: stylex.StyleXClassNameFor<"top", 0>;
51
+ readonly bottom: stylex.StyleXClassNameFor<"bottom", 0>;
52
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "color-mix(in oklab, var(--sui-surface) 65%, transparent)">;
53
+ readonly pointerEvents: stylex.StyleXClassNameFor<"pointerEvents", "none">;
54
+ }>;
55
+ readonly selection: Readonly<{
56
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
57
+ readonly top: stylex.StyleXClassNameFor<"top", 0>;
58
+ readonly bottom: stylex.StyleXClassNameFor<"bottom", 0>;
59
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
60
+ readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", "1px">;
61
+ readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
62
+ readonly borderColor: stylex.StyleXClassNameFor<"borderColor", "Highlight" | "oklch(0.54 0.264 277)">;
63
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "2px">;
64
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "color-mix(in oklab, var(--sui-accent) 8%, transparent)">;
65
+ readonly pointerEvents: stylex.StyleXClassNameFor<"pointerEvents", "none">;
66
+ }>;
67
+ readonly handle: Readonly<{
68
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
69
+ readonly top: stylex.StyleXClassNameFor<"top", "50%">;
70
+ readonly width: stylex.StyleXClassNameFor<"width", "4px">;
71
+ readonly height: stylex.StyleXClassNameFor<"height", "14px">;
72
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "2px">;
73
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "Highlight" | "oklch(0.54 0.264 277)">;
74
+ readonly transform: stylex.StyleXClassNameFor<"transform", "translate(-50%, -50%)">;
75
+ readonly cursor: stylex.StyleXClassNameFor<"cursor", "ew-resize">;
76
+ }>;
77
+ readonly axis: Readonly<{
78
+ readonly position: stylex.StyleXClassNameFor<"position", "relative">;
79
+ readonly height: stylex.StyleXClassNameFor<"height", "1rem">;
80
+ readonly direction: stylex.StyleXClassNameFor<"direction", "ltr">;
81
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
82
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", "1rem">;
83
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
84
+ readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
85
+ readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
86
+ }>;
87
+ readonly tick: Readonly<{
88
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
89
+ readonly top: stylex.StyleXClassNameFor<"top", 0>;
90
+ readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
91
+ readonly transform: stylex.StyleXClassNameFor<"transform", "translateX(-50%)">;
92
+ }>;
93
+ readonly legend: Readonly<{
94
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
95
+ readonly flexWrap: stylex.StyleXClassNameFor<"flexWrap", "wrap">;
96
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
97
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
98
+ readonly marginTop: stylex.StyleXClassNameFor<"marginTop", string>;
99
+ readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
100
+ readonly listStyle: stylex.StyleXClassNameFor<"listStyle", "none">;
101
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
102
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
103
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
104
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
105
+ }>;
106
+ readonly legendItem: Readonly<{
107
+ readonly display: stylex.StyleXClassNameFor<"display", "inline-flex">;
108
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
109
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
110
+ }>;
111
+ readonly swatch: Readonly<{
112
+ readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 0>;
113
+ readonly display: stylex.StyleXClassNameFor<"display", "inline-block">;
114
+ readonly width: stylex.StyleXClassNameFor<"width", "0.625rem">;
115
+ readonly height: stylex.StyleXClassNameFor<"height", "0.625rem">;
116
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "2px">;
117
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "var(--swatch)">;
118
+ readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
119
+ }>;
120
+ readonly panel: Readonly<{
121
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
122
+ readonly zIndex: stylex.StyleXClassNameFor<"zIndex", 1>;
123
+ readonly top: stylex.StyleXClassNameFor<"top", 0>;
124
+ readonly left: stylex.StyleXClassNameFor<"left", 0>;
125
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
126
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
127
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
128
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", "9rem">;
129
+ readonly maxWidth: stylex.StyleXClassNameFor<"maxWidth", "min(18rem, 100%)">;
130
+ readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", string>;
131
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
132
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
133
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
134
+ readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", "1px">;
135
+ readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
136
+ readonly borderColor: stylex.StyleXClassNameFor<"borderColor", string>;
137
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
138
+ readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", string>;
139
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
140
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
141
+ readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
142
+ }>;
143
+ readonly tooltip: Readonly<{
144
+ readonly pointerEvents: stylex.StyleXClassNameFor<"pointerEvents", "none">;
145
+ }>;
146
+ readonly heading: Readonly<{
147
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
148
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
149
+ }>;
150
+ readonly row: Readonly<{
151
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
152
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
153
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
154
+ }>;
155
+ readonly rowLabel: Readonly<{
156
+ readonly flexGrow: stylex.StyleXClassNameFor<"flexGrow", 1>;
157
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
158
+ }>;
159
+ readonly total: Readonly<{
160
+ readonly paddingTop: stylex.StyleXClassNameFor<"paddingTop", string>;
161
+ readonly borderTopWidth: stylex.StyleXClassNameFor<"borderTopWidth", "1px">;
162
+ readonly borderTopStyle: stylex.StyleXClassNameFor<"borderTopStyle", "solid">;
163
+ readonly borderTopColor: stylex.StyleXClassNameFor<"borderTopColor", string>;
164
+ }>;
165
+ readonly value: Readonly<{
166
+ readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
167
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
168
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
169
+ }>;
170
+ readonly actions: Readonly<{
171
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
172
+ readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "flex-end">;
173
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
174
+ readonly paddingTop: stylex.StyleXClassNameFor<"paddingTop", string>;
175
+ }>;
176
+ readonly visuallyHidden: Readonly<{
177
+ readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
178
+ readonly width: stylex.StyleXClassNameFor<"width", "1px">;
179
+ readonly height: stylex.StyleXClassNameFor<"height", "1px">;
180
+ readonly margin: stylex.StyleXClassNameFor<"margin", "-1px">;
181
+ readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
182
+ readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
183
+ readonly clip: stylex.StyleXClassNameFor<"clip", "rect(0 0 0 0)">;
184
+ readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
185
+ readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 0>;
186
+ }>;
187
+ }>;
@@ -0,0 +1,3 @@
1
+ export { StateTimeline } from "./state-timeline.js";
2
+ export type { StateTimelineLabels, StateTimelineProps, StateTimelineRow, StateTimelineSample, StateTimelineState, } from "./state-timeline.js";
3
+ export type { ChartColor, ChartTone } from "../internal/types.js";
@@ -0,0 +1,63 @@
1
+ /**
2
+ * StateTimeline's derivation: samples into runs of one state (segments), each row's share of time per
3
+ * state, the time axis' ticks, and the sample under a time. Plain functions of their input, no Solid.
4
+ * Times are milliseconds.
5
+ */
6
+ /** One reading: from `time`, the row was in `state` (`null`: no data) until the next reading or `step`. */
7
+ export interface Sample {
8
+ time: number;
9
+ state: string | null;
10
+ value?: number;
11
+ note?: string;
12
+ }
13
+ /** A run of samples in one state, with no gap between them. */
14
+ export interface Segment {
15
+ state: string;
16
+ start: number;
17
+ end: number;
18
+ /** The run's first and last sample (indexes into the row's sorted samples). */
19
+ first: number;
20
+ last: number;
21
+ }
22
+ export interface RowModel {
23
+ /** The samples, oldest first, each with when it ends. */
24
+ samples: (Sample & {
25
+ end: number;
26
+ })[];
27
+ segments: Segment[];
28
+ }
29
+ /** The smallest positive step between neighbouring samples across rows (a minute, if there's none). */
30
+ export declare function inferStep(rows: readonly (readonly Sample[])[]): number;
31
+ /**
32
+ * A row's samples, sorted, each lasting until the next one or `step`, whichever comes first (a reading
33
+ * that's late by more than its step leaves a gap); then runs of one state merged into segments. `null`
34
+ * states draw nothing.
35
+ */
36
+ export declare function buildRow(data: readonly Sample[], step: number): RowModel;
37
+ /** Each state's share of `[start, end)` in a row, and the share with no data. Segments are clipped. */
38
+ export declare function shares(segments: readonly Segment[], start: number, end: number): {
39
+ byState: Map<string, number>;
40
+ missing: number;
41
+ };
42
+ /** The sample whose span holds `time`, or `undefined` in a gap. */
43
+ export declare function sampleAt<S extends {
44
+ time: number;
45
+ end: number;
46
+ }>(samples: readonly S[], time: number): S | undefined;
47
+ /** The segment that holds `time`, or `undefined`. */
48
+ export declare function segmentAt(segments: readonly Segment[], time: number): Segment | undefined;
49
+ /**
50
+ * Round ticks across `[start, end]`: the smallest round step that gives at most `count` of them, at
51
+ * multiples of the step in the given UTC offset (minutes east of UTC), so an hour step lands on the hour.
52
+ */
53
+ export declare function ticks(start: number, end: number, count: number, offsetMinutes?: number): {
54
+ step: number;
55
+ at: number[];
56
+ };
57
+ /** The time zone's offset from UTC at `time`, in minutes east (Intl's `longOffset`: "GMT+05:30"). */
58
+ export declare function zoneOffset(time: number, timeZone: string | undefined): number;
59
+ /**
60
+ * One SVG path per state for a row: a rectangle per segment in a 1000-wide, 1-high box. A segment shorter
61
+ * than `min` (in box units: about a pixel) is widened to it, so a short failure stays visible.
62
+ */
63
+ export declare function paths(segments: readonly Segment[], start: number, end: number, min: number): Map<string, string>;
@@ -0,0 +1,108 @@
1
+ import type { JSX } from "@solidjs/web";
2
+ import type { ChartColor, ChartTone } from "../internal/types.js";
3
+ /** One state a row can be in. List them from calm to severe: later states draw over earlier ones. */
4
+ export interface StateTimelineState {
5
+ /** What samples name in `state`. */
6
+ key: string;
7
+ /** Its name in the legend, the tooltip and each row's name ("Healthy", "Loss over 5%"). */
8
+ label: string;
9
+ /** A status tone: `success`, `warning`, `danger`, `info`, `accent`, or `neutral` (gray). */
10
+ tone?: ChartTone;
11
+ /** A chart token or any CSS color; wins over `tone`. Without either, the chart colors in order. */
12
+ color?: ChartColor;
13
+ }
14
+ /** One reading of a row: from `time`, the row was in `state` until the next reading (or `step` passed). */
15
+ export interface StateTimelineSample<T = unknown> {
16
+ /** When it starts: a `Date`, milliseconds since the epoch, or an ISO string. */
17
+ time: Date | number | string;
18
+ /** The state's `key`; `null` for no data (a gap). */
19
+ state: string | null;
20
+ /** A measurement behind the state (a loss rate, a latency), shown in the tooltip with `formatValue`. */
21
+ value?: number;
22
+ /** A note shown in the tooltip ("3 of 120 probes lost"). */
23
+ note?: string;
24
+ /** Your own data. */
25
+ data?: T;
26
+ }
27
+ /** One row: a thing whose state changes over time (a route, a service, a host). */
28
+ export interface StateTimelineRow<T = unknown> {
29
+ /** Its name, beside its lane. Long names are cut short (the full text is in its name and `title`). */
30
+ label: string;
31
+ /** Identifies the row when labels repeat. Defaults to `label`. */
32
+ key?: string;
33
+ /** Its readings. Any order; they're sorted by time. */
34
+ data: readonly StateTimelineSample<T>[];
35
+ }
36
+ /** The timeline's built-in words. Also set app-wide with the kit's `LocaleProvider messages={{ stateTimeline }}`. */
37
+ export interface StateTimelineLabels {
38
+ /** Read after the chart's name while it can take focus. */
39
+ keyboardHint: string;
40
+ /** A time with no reading, in the tooltip and each row's share. */
41
+ noData: string;
42
+ /** The legend list's name, from the chart's `label`. */
43
+ legend: (label: string) => string;
44
+ /** In place of the rows when there are none. */
45
+ empty: string;
46
+ }
47
+ export interface StateTimelineProps<T = unknown> extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "class"> {
48
+ /** The chart's name for assistive technology: what the rows are, what the states mean, the period. */
49
+ label: string;
50
+ /** The states, from calm to severe. Each sample's `state` is one of their keys. */
51
+ states: readonly StateTimelineState[];
52
+ /** The rows, top to bottom. */
53
+ rows: readonly StateTimelineRow<T>[];
54
+ /**
55
+ * How long one reading lasts, in milliseconds: a reading later than this after the last leaves a gap.
56
+ * Defaults to the shortest interval between readings.
57
+ */
58
+ step?: number;
59
+ /** The period shown, `[start, end]`. Defaults to the first reading to the end of the last. */
60
+ range?: readonly [Date | number | string, Date | number | string];
61
+ /**
62
+ * Each lane's height in pixels.
63
+ * @defaultValue 14
64
+ */
65
+ rowHeight?: number;
66
+ /**
67
+ * Space between lanes in pixels.
68
+ * @defaultValue 4
69
+ */
70
+ rowGap?: number;
71
+ /**
72
+ * About how many times to write under the lanes (round times: every 30 minutes, every hour).
73
+ * @defaultValue 8
74
+ */
75
+ ticks?: number;
76
+ /** The time zone times are written in ("UTC"). Defaults to the reader's. */
77
+ timeZone?: string;
78
+ /** How a time is written in the tooltip and the keyboard readout. */
79
+ formatTime?: (date: Date) => string;
80
+ /** How a sample's `value` is written in the tooltip ("2.4% loss"). */
81
+ formatValue?: (value: number) => string;
82
+ /** The states legend above the lanes. @defaultValue true */
83
+ legend?: boolean;
84
+ /**
85
+ * The tooltip at the pointer, also driven by the keyboard (arrow keys on the focused chart).
86
+ * @defaultValue true
87
+ */
88
+ tooltip?: boolean;
89
+ /** The words, in your wording or language (app-wide: `LocaleProvider messages.stateTimeline`). */
90
+ labels?: Partial<StateTimelineLabels>;
91
+ /** Extra classes on the root. */
92
+ class?: JSX.ClassValue;
93
+ }
94
+ /**
95
+ * Many rows on one time axis, each a lane of colored states: route health, service status, host states
96
+ * over hours. Runs of one state are merged into one segment, so hundreds of readings per row stay light;
97
+ * a short failure is never thinner than a pixel. A cursor runs through every lane, with a tooltip for the
98
+ * row under the pointer; the arrow keys walk rows and segments. Plain SVG and DOM, so it renders on the
99
+ * server; each row is named with its share of time per state.
100
+ *
101
+ * @example
102
+ * <StateTimeline
103
+ * label="Route loss, last 12 hours"
104
+ * states={[{ key: "ok", label: "No loss", tone: "success" }, { key: "loss", label: "Loss", tone: "danger" }]}
105
+ * rows={[{ label: "eu → us", data: [{ time: t0, state: "ok" }, { time: t1, state: "loss" }] }]}
106
+ * />
107
+ */
108
+ export declare function StateTimeline<T = unknown>(props: StateTimelineProps<T>): JSX.Element;