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