@schemavaults/ui 0.107.0 → 0.109.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/components/hooks/index.d.ts +2 -0
- package/dist/components/hooks/index.js +1 -0
- package/dist/components/hooks/index.js.map +1 -1
- package/dist/components/hooks/use-measured-width.d.ts +33 -0
- package/dist/components/hooks/use-measured-width.js +61 -0
- package/dist/components/hooks/use-measured-width.js.map +1 -0
- package/dist/components/ui/bar-chart/bar-chart.d.ts +71 -13
- package/dist/components/ui/bar-chart/bar-chart.js +263 -96
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/bar-list/bar-list.d.ts +63 -0
- package/dist/components/ui/bar-list/bar-list.js +39 -0
- package/dist/components/ui/bar-list/bar-list.js.map +1 -0
- package/dist/components/ui/bar-list/index.d.ts +2 -0
- package/dist/components/ui/bar-list/index.js +2 -0
- package/dist/components/ui/bar-list/index.js.map +1 -0
- package/dist/components/ui/chart-primitives/chart-colors.d.ts +69 -0
- package/dist/components/ui/chart-primitives/chart-colors.js +201 -0
- package/dist/components/ui/chart-primitives/chart-colors.js.map +1 -0
- package/dist/components/ui/chart-primitives/chart-data-table.d.ts +20 -0
- package/dist/components/ui/chart-primitives/chart-data-table.js +11 -0
- package/dist/components/ui/chart-primitives/chart-data-table.js.map +1 -0
- package/dist/components/ui/chart-primitives/chart-format.d.ts +12 -0
- package/dist/components/ui/chart-primitives/chart-format.js +40 -0
- package/dist/components/ui/chart-primitives/chart-format.js.map +1 -0
- package/dist/components/ui/chart-primitives/chart-legend.d.ts +20 -0
- package/dist/components/ui/chart-primitives/chart-legend.js +22 -0
- package/dist/components/ui/chart-primitives/chart-legend.js.map +1 -0
- package/dist/components/ui/chart-primitives/chart-scale.d.ts +59 -0
- package/dist/components/ui/chart-primitives/chart-scale.js +178 -0
- package/dist/components/ui/chart-primitives/chart-scale.js.map +1 -0
- package/dist/components/ui/chart-primitives/chart-tooltip.d.ts +67 -0
- package/dist/components/ui/chart-primitives/chart-tooltip.js +57 -0
- package/dist/components/ui/chart-primitives/chart-tooltip.js.map +1 -0
- package/dist/components/ui/chart-primitives/index.d.ts +12 -0
- package/dist/components/ui/chart-primitives/index.js +7 -0
- package/dist/components/ui/chart-primitives/index.js.map +1 -0
- package/dist/components/ui/chart-primitives/responsive-chart.d.ts +26 -0
- package/dist/components/ui/chart-primitives/responsive-chart.js +25 -0
- package/dist/components/ui/chart-primitives/responsive-chart.js.map +1 -0
- package/dist/components/ui/chart-primitives/use-chart-width.d.ts +30 -0
- package/dist/components/ui/chart-primitives/use-chart-width.js +56 -0
- package/dist/components/ui/chart-primitives/use-chart-width.js.map +1 -0
- package/dist/components/ui/funnel-chart/funnel-chart.d.ts +135 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js +257 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -0
- package/dist/components/ui/funnel-chart/index.d.ts +3 -0
- package/dist/components/ui/funnel-chart/index.js +3 -0
- package/dist/components/ui/funnel-chart/index.js.map +1 -0
- package/dist/components/ui/histogram/bin-values.d.ts +53 -0
- package/dist/components/ui/histogram/bin-values.js +137 -0
- package/dist/components/ui/histogram/bin-values.js.map +1 -0
- package/dist/components/ui/histogram/histogram.d.ts +76 -0
- package/dist/components/ui/histogram/histogram.js +149 -0
- package/dist/components/ui/histogram/histogram.js.map +1 -0
- package/dist/components/ui/histogram/index.d.ts +4 -0
- package/dist/components/ui/histogram/index.js +3 -0
- package/dist/components/ui/histogram/index.js.map +1 -0
- package/dist/components/ui/index.d.ts +8 -0
- package/dist/components/ui/index.js +4 -0
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.d.ts +104 -20
- package/dist/components/ui/line-chart/line-chart.js +285 -139
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.d.ts +35 -7
- package/dist/components/ui/pie-chart/pie-chart.js +200 -88
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/scatter-plot/scatter-plot.d.ts +123 -21
- package/dist/components/ui/scatter-plot/scatter-plot.js +507 -243
- package/dist/components/ui/scatter-plot/scatter-plot.js.map +1 -1
- package/dist/components/ui/sparkline/sparkline.d.ts +15 -5
- package/dist/components/ui/sparkline/sparkline.js +21 -37
- package/dist/components/ui/sparkline/sparkline.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
import { chartPaintClass, chartPaintSwatchStyle, } from "../../ui/chart-primitives/chart-colors";
|
|
6
|
+
import { ChartDataTable } from "../../ui/chart-primitives/chart-data-table";
|
|
7
|
+
import { formatChartNumber } from "../../ui/chart-primitives/chart-format";
|
|
8
|
+
import { niceAxis, roundedBarPath, thinIndices, } from "../../ui/chart-primitives/chart-scale";
|
|
9
|
+
import { ChartLiveRegion, ChartTooltip, ChartTooltipRow, } from "../../ui/chart-primitives/chart-tooltip";
|
|
10
|
+
import { useChartWidth, } from "../../ui/chart-primitives/use-chart-width";
|
|
11
|
+
const MARGIN = { top: 16, right: 8, bottom: 24 };
|
|
12
|
+
/** The surface gap between touching bars. */
|
|
13
|
+
const BAR_GAP = 2;
|
|
14
|
+
/** Room each x-axis label needs before labels start thinning out. */
|
|
15
|
+
const X_LABEL_SPACING = 52;
|
|
16
|
+
/** Approximate width of an 11px tick-label character. */
|
|
17
|
+
const TICK_CHAR_WIDTH = 6.8;
|
|
18
|
+
const SHARE_FORMAT = new Intl.NumberFormat("en-US", {
|
|
19
|
+
style: "percent",
|
|
20
|
+
maximumFractionDigits: 1,
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* A histogram: the counts of adjacent ranges of one quantity, as touching
|
|
24
|
+
* columns on a shared count axis, labelled at the bucket edges.
|
|
25
|
+
*
|
|
26
|
+
* Unlike `BarChart` (unrelated categories, each label under its bar), the
|
|
27
|
+
* x-axis here is continuous: labels sit on the edges between bars, thinned
|
|
28
|
+
* so they never crowd. An open-ended overflow bucket is drawn in the
|
|
29
|
+
* de-emphasis grey with a caption, so a long tail doesn't flatten the rest.
|
|
30
|
+
* Hover or the arrow keys read out a bucket's range, count and share.
|
|
31
|
+
*
|
|
32
|
+
* Bin raw values with `binValues()`.
|
|
33
|
+
*/
|
|
34
|
+
function Histogram({ buckets, label, total, width = "auto", height = 240, color = "chart-1", overflowColor = "other", formatBoundary = formatChartNumber, formatCount = formatChartNumber, describeBucket, countNoun = { singular: "value", plural: "values" }, overflowCaption, showTooltip = true, emptyMessage = "No data", loading = false, className, style, ref, ...props }) {
|
|
35
|
+
const chart = useChartWidth(width, 360, ref);
|
|
36
|
+
const W = chart.width;
|
|
37
|
+
const H = height;
|
|
38
|
+
const hintId = useId();
|
|
39
|
+
const [activeState, setActive] = useState(null);
|
|
40
|
+
/** Whether the bucket was reached with the arrow keys (so it is announced). */
|
|
41
|
+
const [announce, setAnnounce] = useState(false);
|
|
42
|
+
const count = buckets.length;
|
|
43
|
+
// A stale index (the data shrank under the pointer) reads as nothing active.
|
|
44
|
+
const active = activeState !== null && activeState < count ? activeState : null;
|
|
45
|
+
const sampleSize = total ?? buckets.reduce((sum, bucket) => sum + bucket.count, 0);
|
|
46
|
+
const noun = (n) => n === 1 ? countNoun.singular : countNoun.plural;
|
|
47
|
+
const describe = (bucket) => {
|
|
48
|
+
if (describeBucket)
|
|
49
|
+
return describeBucket(bucket);
|
|
50
|
+
if (bucket.upper === null)
|
|
51
|
+
return `${formatBoundary(bucket.lower)} or more`;
|
|
52
|
+
return `${formatBoundary(bucket.lower)} – ${formatBoundary(bucket.upper)}`;
|
|
53
|
+
};
|
|
54
|
+
const maxCount = Math.max(0, ...buckets.map((bucket) => bucket.count));
|
|
55
|
+
const axis = niceAxis(maxCount, 4, 1);
|
|
56
|
+
const marginLeft = Math.ceil(Math.max(...axis.ticks.map((tick) => formatCount(tick).length)) *
|
|
57
|
+
TICK_CHAR_WIDTH) + 12;
|
|
58
|
+
const plotX0 = marginLeft;
|
|
59
|
+
const plotX1 = Math.max(plotX0 + 1, (W ?? 0) - MARGIN.right);
|
|
60
|
+
const plotY0 = MARGIN.top;
|
|
61
|
+
const plotY1 = Math.max(plotY0 + 1, H - MARGIN.bottom);
|
|
62
|
+
const plotW = plotX1 - plotX0;
|
|
63
|
+
const slot = count > 0 ? plotW / count : 0;
|
|
64
|
+
const projectY = (value) => plotY1 - (Math.max(0, value) / axis.top) * (plotY1 - plotY0);
|
|
65
|
+
// Tallest bucket, labelled directly.
|
|
66
|
+
const modeIndex = buckets.findIndex((bucket) => bucket.count === maxCount && maxCount > 0);
|
|
67
|
+
// Edge labels: the lower edge of every bucket plus the closing upper edge
|
|
68
|
+
// (the overflow bucket has none), thinned to ~52px apart.
|
|
69
|
+
const boundaries = buckets.map((bucket, index) => ({ x: plotX0 + index * slot, value: bucket.lower }));
|
|
70
|
+
const lastBucket = buckets[count - 1];
|
|
71
|
+
if (lastBucket && lastBucket.upper !== null) {
|
|
72
|
+
boundaries.push({ x: plotX0 + count * slot, value: lastBucket.upper });
|
|
73
|
+
}
|
|
74
|
+
const maxLabels = Math.max(2, Math.floor(plotW / X_LABEL_SPACING));
|
|
75
|
+
const labelledBoundaries = thinIndices(boundaries.length, maxLabels).map((index) => boundaries[index]);
|
|
76
|
+
const overflow = lastBucket && lastBucket.upper === null ? lastBucket : undefined;
|
|
77
|
+
const barPaint = { colorId: color };
|
|
78
|
+
const overflowPaint = { colorId: overflowColor };
|
|
79
|
+
const barGap = slot > BAR_GAP * 2 ? BAR_GAP : 0;
|
|
80
|
+
const readoutEnabled = showTooltip && count > 0;
|
|
81
|
+
const activeBucket = active === null ? undefined : buckets[active];
|
|
82
|
+
const onKeyDown = (event) => {
|
|
83
|
+
if (!readoutEnabled)
|
|
84
|
+
return;
|
|
85
|
+
const last = count - 1;
|
|
86
|
+
let next = active;
|
|
87
|
+
if (event.key === "ArrowRight" || event.key === "ArrowUp") {
|
|
88
|
+
next = active === null ? 0 : Math.min(last, active + 1);
|
|
89
|
+
}
|
|
90
|
+
else if (event.key === "ArrowLeft" || event.key === "ArrowDown") {
|
|
91
|
+
next = active === null ? last : Math.max(0, active - 1);
|
|
92
|
+
}
|
|
93
|
+
else if (event.key === "Home") {
|
|
94
|
+
next = 0;
|
|
95
|
+
}
|
|
96
|
+
else if (event.key === "End") {
|
|
97
|
+
next = last;
|
|
98
|
+
}
|
|
99
|
+
else if (event.key === "Escape") {
|
|
100
|
+
next = null;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
setActive(next);
|
|
107
|
+
setAnnounce(true);
|
|
108
|
+
};
|
|
109
|
+
const onBlur = (event) => {
|
|
110
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
111
|
+
setActive(null);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const plot = W === null ? null : (_jsxs("svg", { width: W, height: H, viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": label, "aria-describedby": readoutEnabled ? hintId : undefined, tabIndex: readoutEnabled ? 0 : undefined, onKeyDown: onKeyDown, onBlur: onBlur, onPointerLeave: () => setActive(null), className: "block overflow-visible rounded-sm text-[11px] focus:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [count > 0 ? (_jsx("g", { "aria-hidden": "true", "data-slot": "histogram-count-axis", className: "pointer-events-none select-none", children: axis.ticks.map((tick) => (_jsxs("g", { children: [tick > 0 ? (_jsx("line", { x1: plotX0, x2: plotX1, y1: projectY(tick), y2: projectY(tick), strokeWidth: 1, className: "stroke-border" })) : null, _jsx("text", { x: plotX0 - 6, y: projectY(tick), textAnchor: "end", dominantBaseline: "central", className: "fill-muted-foreground tabular-nums", children: formatCount(tick) })] }, `tick-${tick}`))) })) : null, _jsx("g", { "data-slot": "histogram-bars", className: "pointer-events-none", children: buckets.map((bucket, index) => {
|
|
115
|
+
const top = projectY(bucket.count);
|
|
116
|
+
const paint = bucket.upper === null ? overflowPaint : barPaint;
|
|
117
|
+
const dimmed = active !== null && active !== index;
|
|
118
|
+
return (_jsx("path", { d: roundedBarPath(plotX0 + index * slot + barGap / 2, top, Math.max(0, slot - barGap), plotY1 - top, 4), "data-slot": "histogram-bar", "data-overflow": bucket.upper === null ? "true" : undefined, className: cn("transition-opacity", chartPaintClass(paint, "fill"), dimmed && "opacity-40") }, `${bucket.lower}-${bucket.upper}`));
|
|
119
|
+
}) }), modeIndex >= 0 ? (_jsx("text", { "aria-hidden": "true",
|
|
120
|
+
// The first column's label starts at the bar instead of running
|
|
121
|
+
// into the count-axis labels.
|
|
122
|
+
x: modeIndex === 0
|
|
123
|
+
? plotX0 + barGap / 2
|
|
124
|
+
: plotX0 + (modeIndex + 0.5) * slot, y: projectY(maxCount) - 5, textAnchor: modeIndex === 0 ? "start" : "middle", className: "pointer-events-none select-none fill-foreground font-medium tabular-nums", children: formatCount(maxCount) })) : null, _jsx("line", { "aria-hidden": "true", x1: plotX0, x2: plotX1, y1: plotY1, y2: plotY1, strokeWidth: 1, className: "stroke-muted-foreground/50" }), _jsx("g", { "aria-hidden": "true", "data-slot": "histogram-edge-labels", className: "pointer-events-none select-none", children: labelledBoundaries.map(({ x, value }) => (_jsx("text", { x: x, y: plotY1 + 15, textAnchor: "middle", className: "fill-muted-foreground tabular-nums", children: formatBoundary(value) }, `edge-${x}-${value}`))) }), readoutEnabled
|
|
125
|
+
? buckets.map((bucket, index) => (_jsx("rect", { "aria-hidden": "true", x: plotX0 + index * slot, y: plotY0, width: Math.max(0, slot), height: plotY1 - plotY0, fill: "transparent", onPointerEnter: () => {
|
|
126
|
+
setActive(index);
|
|
127
|
+
setAnnounce(false);
|
|
128
|
+
} }, `hit-${bucket.lower}-${bucket.upper}`)))
|
|
129
|
+
: null, count === 0 ? (_jsx("text", { x: W / 2, y: H / 2, textAnchor: "middle", dominantBaseline: "central", className: "fill-muted-foreground text-sm", children: emptyMessage })) : null] }));
|
|
130
|
+
const caption = overflow && overflowCaption !== false
|
|
131
|
+
? (overflowCaption ??
|
|
132
|
+
`The last bar gathers the ${formatCount(overflow.count)} largest ${noun(overflow.count)} (${describe(overflow)}).`)
|
|
133
|
+
: null;
|
|
134
|
+
return (_jsxs("div", { ref: chart.ref, "data-slot": "histogram", "aria-busy": loading || undefined, className: cn("relative flex flex-col gap-1 transition-opacity", chart.rootClassName, loading && "opacity-60", className), style: { ...chart.rootStyle, ...style }, ...props, children: [_jsxs("div", { "data-slot": "histogram-plot", className: "relative w-full shrink-0", style: { height: H }, children: [plot, readoutEnabled && W !== null ? (_jsxs(_Fragment, { children: [_jsx("span", { id: hintId, hidden: true, children: "Use the arrow keys to read each bucket." }), _jsx(ChartLiveRegion, { message: announce && activeBucket
|
|
135
|
+
? `${describe(activeBucket)}: ${formatCount(activeBucket.count)} ${noun(activeBucket.count)}${sampleSize > 0 ? `, ${SHARE_FORMAT.format(activeBucket.count / sampleSize)}` : ""}`
|
|
136
|
+
: "" })] })) : null, showTooltip && activeBucket && active !== null && W !== null ? (_jsxs(ChartTooltip, { x: plotX0 + (active + 0.5) * slot, y: projectY(activeBucket.count), containerWidth: W, children: [_jsx(ChartTooltipRow, { value: `${formatCount(activeBucket.count)} ${noun(activeBucket.count)}`, label: sampleSize > 0
|
|
137
|
+
? SHARE_FORMAT.format(activeBucket.count / sampleSize)
|
|
138
|
+
: undefined }), _jsx("div", { className: "mt-0.5 text-muted-foreground tabular-nums", children: describe(activeBucket) })] })) : null] }), caption !== null && W !== null ? (_jsxs("p", { "data-slot": "histogram-overflow-caption", className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [_jsx("span", { "aria-hidden": "true", className: cn("inline-block size-2.5 shrink-0 rounded-[3px]", chartPaintClass(overflowPaint, "bg")), style: chartPaintSwatchStyle(overflowPaint) }), _jsx("span", { children: caption })] })) : null, W !== null && count > 0 ? (_jsx(ChartDataTable, { caption: label, columns: ["Range", "Count", "Share"], rows: buckets.map((bucket) => ({
|
|
139
|
+
key: `${bucket.lower}-${bucket.upper}`,
|
|
140
|
+
cells: [
|
|
141
|
+
describe(bucket),
|
|
142
|
+
formatCount(bucket.count),
|
|
143
|
+
sampleSize > 0 ? SHARE_FORMAT.format(bucket.count / sampleSize) : "",
|
|
144
|
+
],
|
|
145
|
+
})) })) : null] }));
|
|
146
|
+
}
|
|
147
|
+
Histogram.displayName = "Histogram";
|
|
148
|
+
export { Histogram };
|
|
149
|
+
//# sourceMappingURL=histogram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"histogram.js","sourceRoot":"","sources":["../../../../src/components/ui/histogram/histogram.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAUb,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,eAAe,EACf,qBAAqB,GAGtB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EACL,QAAQ,EACR,cAAc,EACd,WAAW,GACZ,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,GAChB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,aAAa,GAEd,MAAM,kDAAkD,CAAC;AA8D1D,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAW,CAAC;AAC1D,6CAA6C;AAC7C,MAAM,OAAO,GAAW,CAAC,CAAC;AAC1B,qEAAqE;AACrE,MAAM,eAAe,G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C,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;qBACrE;iBACF,CAAC,CAAC,GACH,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC;AACD,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/histogram/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAG5B,cAAc,cAAc,CAAC"}
|
|
@@ -180,6 +180,8 @@ export * from "./tags-input";
|
|
|
180
180
|
export type * from "./tags-input";
|
|
181
181
|
export * from "./number-ticker";
|
|
182
182
|
export type * from "./number-ticker";
|
|
183
|
+
export * from "./chart-primitives";
|
|
184
|
+
export type * from "./chart-primitives";
|
|
183
185
|
export * from "./sparkline";
|
|
184
186
|
export type * from "./sparkline";
|
|
185
187
|
export * from "./aspect-ratio";
|
|
@@ -196,8 +198,14 @@ export * from "./line-chart";
|
|
|
196
198
|
export type * from "./line-chart";
|
|
197
199
|
export * from "./radar-chart";
|
|
198
200
|
export type * from "./radar-chart";
|
|
201
|
+
export * from "./funnel-chart";
|
|
202
|
+
export type * from "./funnel-chart";
|
|
199
203
|
export * from "./scatter-plot";
|
|
200
204
|
export type * from "./scatter-plot";
|
|
205
|
+
export * from "./histogram";
|
|
206
|
+
export type * from "./histogram";
|
|
207
|
+
export * from "./bar-list";
|
|
208
|
+
export type * from "./bar-list";
|
|
201
209
|
export * from "./comparison-slider";
|
|
202
210
|
export type * from "./comparison-slider";
|
|
203
211
|
export * from "./theme-selector";
|
|
@@ -89,6 +89,7 @@ export * from "./toggle";
|
|
|
89
89
|
export * from "./chip";
|
|
90
90
|
export * from "./tags-input";
|
|
91
91
|
export * from "./number-ticker";
|
|
92
|
+
export * from "./chart-primitives";
|
|
92
93
|
export * from "./sparkline";
|
|
93
94
|
export * from "./aspect-ratio";
|
|
94
95
|
export * from "./color-swatch";
|
|
@@ -97,7 +98,10 @@ export * from "./pie-chart";
|
|
|
97
98
|
export * from "./bar-chart";
|
|
98
99
|
export * from "./line-chart";
|
|
99
100
|
export * from "./radar-chart";
|
|
101
|
+
export * from "./funnel-chart";
|
|
100
102
|
export * from "./scatter-plot";
|
|
103
|
+
export * from "./histogram";
|
|
104
|
+
export * from "./bar-list";
|
|
101
105
|
export * from "./comparison-slider";
|
|
102
106
|
export * from "./theme-selector";
|
|
103
107
|
export * from "./tree-view";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAGzB,cAAc,uBAAuB,CAAC;AAGtC,cAAc,aAAa,CAAC;AAG5B,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,mBAAmB,CAAC;AAGlC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC;AAGxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,aAAa,CAAC;AAG5B,cAAc,kCAAkC,CAAC;AAGjD,cAAc,cAAc,CAAC;AAG7B,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAG1B,cAAc,YAAY,CAAC;AAG3B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,QAAQ,CAAC;AAGvB,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;AAG5B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,UAAU,CAAC;AAGzB,cAAc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,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,aAAa,CAAC;AAG5B,cAAc,aAAa,CAAC;AAG5B,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAG9B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,aAAa,CAAC;AAG5B,cAAc,YAAY,CAAC;AAG3B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,aAAa,CAAC;AAG5B,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAG5B,cAAc,0BAA0B,CAAC;AAGzC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,YAAY,CAAC;AAG3B,cAAc,eAAe,CAAC;AAG9B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,eAAe,CAAC;AAG9B,cAAc,QAAQ,CAAC;AAGvB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,eAAe,CAAC;AAG9B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC;AAG1B,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import type { HTMLAttributes, KeyboardEvent, MouseEvent, ReactElement, ReactNode, Ref } from "react";
|
|
3
|
+
import { type ChartColorId, type ChartPaint } from "../../ui/chart-primitives/chart-colors";
|
|
4
|
+
import { type ChartWidth } from "../../ui/chart-primitives/use-chart-width";
|
|
3
5
|
export declare const lineChartSizeIds: ["sm", "md", "lg", "xl"];
|
|
4
6
|
export type LineChartSizeId = (typeof lineChartSizeIds)[number];
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
+
/** Preset series colours; see `chartColorIds`. */
|
|
8
|
+
export declare const lineChartColorIds: ["chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "chart-6", "chart-7", "chart-8", "other", "default", "brand", "primary", "positive", "warning", "destructive", "muted"];
|
|
9
|
+
export type LineChartColorId = ChartColorId;
|
|
7
10
|
export declare const lineChartCurveIds: ["linear", "smooth"];
|
|
8
11
|
export type LineChartCurveId = (typeof lineChartCurveIds)[number];
|
|
9
12
|
export declare const lineChartVariants: (props?: ({
|
|
@@ -32,11 +35,15 @@ export interface LineChartSeries {
|
|
|
32
35
|
label?: string;
|
|
33
36
|
/** Points in plot order. */
|
|
34
37
|
points: ReadonlyArray<LineChartPoint>;
|
|
35
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Preset color. Defaults to the series' palette slot: its position in
|
|
40
|
+
* `seriesOrder` when the chart has one, else in `series`. Ignored if
|
|
41
|
+
* `stroke` is provided.
|
|
42
|
+
*/
|
|
36
43
|
color?: LineChartColorId;
|
|
37
44
|
/**
|
|
38
45
|
* Override the stroke with a raw CSS color (e.g. `"#ff0080"` or
|
|
39
|
-
* `"
|
|
46
|
+
* `"var(--chart-3)"`). Takes precedence over `color`.
|
|
40
47
|
*/
|
|
41
48
|
stroke?: string;
|
|
42
49
|
/** Fill the area between this series' line and the baseline. */
|
|
@@ -60,19 +67,48 @@ export interface LineChartValueLabelContext {
|
|
|
60
67
|
value: number;
|
|
61
68
|
index: number;
|
|
62
69
|
}
|
|
70
|
+
export interface LineChartTooltipValue {
|
|
71
|
+
series: LineChartSeries;
|
|
72
|
+
/** The series' point at this x, if it has one. */
|
|
73
|
+
point: LineChartPoint | undefined;
|
|
74
|
+
/** `null` when the series has no finite value at this x. */
|
|
75
|
+
value: number | null;
|
|
76
|
+
/** `formatY(value)`, or `"—"` for no value. */
|
|
77
|
+
formattedValue: string;
|
|
78
|
+
paint: ChartPaint;
|
|
79
|
+
}
|
|
80
|
+
export interface LineChartTooltipContext {
|
|
81
|
+
/** The x the crosshair snapped to, in domain units (the index in categorical mode). */
|
|
82
|
+
x: number;
|
|
83
|
+
/** The x as the tooltip heading shows it. */
|
|
84
|
+
xLabel: string;
|
|
85
|
+
/** One entry per series, in series order. */
|
|
86
|
+
values: ReadonlyArray<LineChartTooltipValue>;
|
|
87
|
+
}
|
|
63
88
|
export interface LineChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "onClick">, VariantProps<typeof lineChartVariants> {
|
|
64
89
|
/** Series to render, in order (later series are drawn on top). */
|
|
65
90
|
series: ReadonlyArray<LineChartSeries>;
|
|
66
91
|
/** Accessible label describing what the chart represents. */
|
|
67
92
|
label: string;
|
|
68
93
|
/**
|
|
69
|
-
*
|
|
94
|
+
* Canvas width in pixels (defaults are size-aware), or `"auto"` to fill the
|
|
95
|
+
* container and redraw when it resizes. An `"auto"` chart renders an empty
|
|
96
|
+
* placeholder at its height until it has been measured, so the server
|
|
97
|
+
* render carries no pixel width and no tick labels.
|
|
70
98
|
*/
|
|
71
|
-
width?:
|
|
99
|
+
width?: ChartWidth;
|
|
72
100
|
/**
|
|
73
101
|
* Override the rendered canvas height in pixels (defaults are size-aware).
|
|
102
|
+
* A legend, when shown, sits above this box.
|
|
74
103
|
*/
|
|
75
104
|
height?: number;
|
|
105
|
+
/**
|
|
106
|
+
* Every series id the chart can show, in colour-slot order. Pass the full,
|
|
107
|
+
* unfiltered list and a series you filter out of `series` never repaints
|
|
108
|
+
* the others: colour follows the series, not its position. Ids missing
|
|
109
|
+
* from the list are painted `"other"`.
|
|
110
|
+
*/
|
|
111
|
+
seriesOrder?: ReadonlyArray<string>;
|
|
76
112
|
/** Lower bound of the y-axis. Defaults to the smallest value across series. */
|
|
77
113
|
yMin?: number;
|
|
78
114
|
/** Upper bound of the y-axis. Defaults to the largest value across series. */
|
|
@@ -89,7 +125,8 @@ export interface LineChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "on
|
|
|
89
125
|
showAxis?: boolean;
|
|
90
126
|
/**
|
|
91
127
|
* Number of evenly-spaced horizontal gridlines drawn across the value axis.
|
|
92
|
-
* `0` disables gridlines. Defaults to `0`.
|
|
128
|
+
* `0` disables gridlines. Defaults to `0`. With y-axis labels shown, any
|
|
129
|
+
* non-zero count draws a hairline at each tick instead.
|
|
93
130
|
*/
|
|
94
131
|
gridLineCount?: number;
|
|
95
132
|
/**
|
|
@@ -98,34 +135,76 @@ export interface LineChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "on
|
|
|
98
135
|
* index. Pass `null` for an entry to skip it.
|
|
99
136
|
*/
|
|
100
137
|
categories?: ReadonlyArray<string | null>;
|
|
138
|
+
/**
|
|
139
|
+
* Format an x value for the x-axis ticks and the tooltip heading (e.g. a
|
|
140
|
+
* timestamp as a time). Giving it turns the x-axis tick labels on unless
|
|
141
|
+
* `showXAxisLabels` is `false`; `xTickFormatter` wins for the ticks.
|
|
142
|
+
*/
|
|
143
|
+
formatX?: (x: number) => string;
|
|
144
|
+
/**
|
|
145
|
+
* Format a y value for the y-axis ticks and the tooltip. Giving it turns
|
|
146
|
+
* the y-axis tick labels on unless `showYAxisLabels` is `false`;
|
|
147
|
+
* `yTickFormatter` wins for the ticks. Defaults to a thousands-separated
|
|
148
|
+
* number.
|
|
149
|
+
*/
|
|
150
|
+
formatY?: (y: number) => string;
|
|
151
|
+
/** Replace the crosshair readout's content. */
|
|
152
|
+
formatTooltip?: (context: LineChartTooltipContext) => ReactNode;
|
|
153
|
+
/**
|
|
154
|
+
* Show the crosshair readout on hover and keyboard focus. Defaults to
|
|
155
|
+
* `true`.
|
|
156
|
+
*/
|
|
157
|
+
showTooltip?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Show a legend above the plot. Defaults to `true` for two or more series
|
|
160
|
+
* and `false` for one (its title already names it).
|
|
161
|
+
*/
|
|
162
|
+
showLegend?: boolean;
|
|
101
163
|
/**
|
|
102
164
|
* Format an x-tick label from its numeric value. Used when explicit numeric
|
|
103
165
|
* x-values are provided on points. Return `null` to skip the tick.
|
|
104
166
|
*/
|
|
105
167
|
xTickFormatter?: (x: number, index: number) => string | null;
|
|
106
168
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
169
|
+
* About how many x-axis ticks to render in numeric mode. Defaults to `5`.
|
|
170
|
+
* Ignored when `xTickValues` is given. Labels that would overlap are
|
|
171
|
+
* dropped on a narrow chart.
|
|
109
172
|
*/
|
|
110
173
|
xTickCount?: number;
|
|
174
|
+
/**
|
|
175
|
+
* Exact x positions for the numeric x-axis ticks (e.g. every whole hour of
|
|
176
|
+
* a time axis), formatted with `xTickFormatter` or `formatX`. Values
|
|
177
|
+
* outside the x domain are skipped.
|
|
178
|
+
*/
|
|
179
|
+
xTickValues?: ReadonlyArray<number>;
|
|
180
|
+
/**
|
|
181
|
+
* Render numeric x-axis tick labels (formatted with `formatX`). Defaults to
|
|
182
|
+
* on when `formatX` or `xTickFormatter` is given.
|
|
183
|
+
*/
|
|
184
|
+
showXAxisLabels?: boolean;
|
|
111
185
|
/**
|
|
112
186
|
* Format a y-axis tick label from its numeric value. When provided, tick
|
|
113
187
|
* labels are rendered to the left of the y-axis and a left gutter is
|
|
114
|
-
* reserved automatically. Return `null` to skip a tick.
|
|
115
|
-
* formatter (when `showYAxisLabels` is `true` without a custom formatter)
|
|
116
|
-
* renders the raw value.
|
|
188
|
+
* reserved automatically. Return `null` to skip a tick.
|
|
117
189
|
*/
|
|
118
190
|
yTickFormatter?: (y: number, index: number) => string | null;
|
|
119
191
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* `yTickFormatter` is provided or `showYAxisLabels` is `true`.
|
|
192
|
+
* About how many y-axis ticks to draw. Defaults to `5`. Has no effect
|
|
193
|
+
* unless y-axis labels are shown.
|
|
123
194
|
*/
|
|
124
195
|
yTickCount?: number;
|
|
125
196
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
197
|
+
* Place the y-axis ticks (and numeric x-axis ticks) on round values inside
|
|
198
|
+
* the domain (0, 100, 200 …) rather than evenly between its ends (13.7,
|
|
199
|
+
* 27.4 …). Only the ticks move; the lines are drawn the same either way.
|
|
200
|
+
* Defaults to on, except for an axis given an `xTickFormatter` /
|
|
201
|
+
* `yTickFormatter`, which keeps evenly spaced ticks that include both
|
|
202
|
+
* ends (as before). For a time axis, pass `xTickValues` on round times.
|
|
203
|
+
*/
|
|
204
|
+
niceTicks?: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Render y-axis tick labels (formatted with `formatY`). Defaults to on when
|
|
207
|
+
* `formatY` or `yTickFormatter` is given.
|
|
129
208
|
*/
|
|
130
209
|
showYAxisLabels?: boolean;
|
|
131
210
|
/**
|
|
@@ -137,9 +216,14 @@ export interface LineChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "on
|
|
|
137
216
|
showValueLabels?: boolean;
|
|
138
217
|
/**
|
|
139
218
|
* Customize the value-label text. Return `null` to skip a point. Defaults
|
|
140
|
-
* to
|
|
219
|
+
* to `formatY(value)`.
|
|
141
220
|
*/
|
|
142
221
|
valueLabelFormatter?: (context: LineChartValueLabelContext) => string | null;
|
|
222
|
+
/**
|
|
223
|
+
* Hold the current render at reduced opacity while new data loads, rather
|
|
224
|
+
* than flashing a skeleton.
|
|
225
|
+
*/
|
|
226
|
+
loading?: boolean;
|
|
143
227
|
/**
|
|
144
228
|
* Fallback handler invoked for any point that doesn't have its own series-
|
|
145
229
|
* level `onPointClick`. Receives the clicked point and its series.
|
|
@@ -160,7 +244,7 @@ export interface LineChartProps extends Omit<HTMLAttributes<HTMLDivElement>, "on
|
|
|
160
244
|
/** Optional ref forwarded to the wrapper element. */
|
|
161
245
|
ref?: Ref<HTMLDivElement>;
|
|
162
246
|
}
|
|
163
|
-
declare function LineChart({ series, label, size, width, height, yMin, yMax, xMin, xMax, curve, showPoints, showAxis, gridLineCount, categories, xTickFormatter, xTickCount, yTickFormatter, yTickCount, showYAxisLabels, yTickLabelWidth, showValueLabels, valueLabelFormatter, onPointClick, children, className, overlayClassName, valueLabelClassName, categoryLabelClassName, yAxisLabelClassName, axisClassName, ref, ...props }: LineChartProps): ReactElement;
|
|
247
|
+
declare function LineChart({ series, label, size, width, height, seriesOrder, yMin, yMax, xMin, xMax, curve, showPoints, showAxis, gridLineCount, categories, formatX, formatY, formatTooltip, showTooltip, showLegend, xTickFormatter, xTickCount, xTickValues, showXAxisLabels, yTickFormatter, yTickCount, niceTicks, showYAxisLabels, yTickLabelWidth, showValueLabels, valueLabelFormatter, loading, onPointClick, children, className, style, overlayClassName, valueLabelClassName, categoryLabelClassName, yAxisLabelClassName, axisClassName, ref, ...props }: LineChartProps): ReactElement;
|
|
164
248
|
declare namespace LineChart {
|
|
165
249
|
var displayName: string;
|
|
166
250
|
}
|