@acronis-platform/ui-react 5.2.0 → 5.3.1
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/ui/area-chart/area-chart.js +107 -107
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +162 -162
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/category-bar/category-bar.js +50 -50
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart.js +53 -40
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/composed-chart/composed-chart.js +146 -146
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +97 -97
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/data-table/data-table-bulk-actions-bar.js +1 -1
- package/dist/components/ui/data-table/data-table-bulk-actions-bar.js.map +1 -1
- package/dist/components/ui/data-table/data-table-view-options.js +3 -2
- package/dist/components/ui/data-table/data-table-view-options.js.map +1 -1
- package/dist/components/ui/data-table/data-table.js +136 -132
- package/dist/components/ui/data-table/data-table.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +120 -120
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +58 -58
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +91 -91
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +92 -92
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +37 -37
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +112 -112
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +78 -78
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +57 -57
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/table/table-view-options.js +88 -33
- package/dist/components/ui/table/table-view-options.js.map +1 -1
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +87 -87
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/index.js +111 -111
- package/dist/llms/data-table.md +33 -7
- package/dist/llms/table.md +56 -23
- package/dist/llms.txt +1 -1
- package/dist/react.js +111 -111
- package/dist/src/components/ui/chart/chart.d.ts +1 -0
- package/dist/src/components/ui/chart/index.d.ts +1 -1
- package/dist/src/components/ui/data-table/data-table-view-options.d.ts +1 -1
- package/dist/src/components/ui/data-table/data-table.d.ts +11 -1
- package/dist/src/components/ui/data-table/data-table.docs.d.ts +6 -0
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +3 -2
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +1 -1
- package/dist/src/components/ui/table/table-view-options.d.ts +9 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +3 -2
- package/dist/ui-react.css +1 -1
- package/package.json +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/utils.js";
|
|
3
|
-
import { ChartContainer as t, ChartTooltip as n, ChartTooltipContent as r } from "../chart/chart.js";
|
|
4
|
-
import { resolveAnimation as
|
|
5
|
-
import * as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { Bar as
|
|
3
|
+
import { ChartContainer as t, ChartTooltip as n, ChartTooltipContent as r, toCssKey as i } from "../chart/chart.js";
|
|
4
|
+
import { resolveAnimation as a, resolveAxisDomain as o, resolveRotatedTickAnchor as s, resolveXAxisHeight as c, resolveXAxisTitle as l, resolveYAxisTitle as u } from "../chart/chart-format.js";
|
|
5
|
+
import * as d from "react";
|
|
6
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
+
import { Bar as m, BarChart as h, CartesianGrid as g, XAxis as _, YAxis as v } from "recharts";
|
|
8
8
|
//#region src/components/ui/histogram/histogram.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
9
|
+
var y = (e) => Number(e.toFixed(2));
|
|
10
|
+
function b(e, t, n) {
|
|
11
11
|
let r = e.filter((e) => typeof e == "number" && Number.isFinite(e));
|
|
12
12
|
if (r.length === 0 || t < 1) return [];
|
|
13
13
|
let [i, a] = n ?? [Math.min(...r), Math.max(...r)], o = Math.min(i, a), s = Math.max(i, a), c = o === s ? o + 1 : s, l = (c - o) / t, u = Array.from({ length: t }, (e, n) => {
|
|
@@ -15,7 +15,7 @@ function y(e, t, n) {
|
|
|
15
15
|
return {
|
|
16
16
|
x0: r,
|
|
17
17
|
x1: i,
|
|
18
|
-
label: `${
|
|
18
|
+
label: `${y(r)}–${y(i)}`,
|
|
19
19
|
count: 0
|
|
20
20
|
};
|
|
21
21
|
});
|
|
@@ -26,83 +26,83 @@ function y(e, t, n) {
|
|
|
26
26
|
}
|
|
27
27
|
return u;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
30
|
-
let
|
|
31
|
-
animate:
|
|
32
|
-
animationDuration:
|
|
33
|
-
animationBegin:
|
|
34
|
-
animationEasing:
|
|
35
|
-
}),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
var x = d.forwardRef(({ className: y, config: x, palette: S, values: C, dataKey: w = "count", binCount: T = 10, domain: E, xAxisLabel: D, yAxisLabel: O, yUnit: k, barRadius: A = 0, showGrid: j = !0, showTooltip: M = !0, showXAxis: N = !0, showYAxis: P = !0, xTickFormatter: F, yTickFormatter: I, xAxisAngle: L, xAxisInterval: R, yAxisTickCount: z, yAxisDomain: B, gridDashed: V, gridHorizontal: H, gridVertical: U, tooltipContent: W, animate: G, animationDuration: K, animationBegin: q, animationEasing: J, ...Y }, X) => {
|
|
30
|
+
let Z = a({
|
|
31
|
+
animate: G,
|
|
32
|
+
animationDuration: K,
|
|
33
|
+
animationBegin: q,
|
|
34
|
+
animationEasing: J
|
|
35
|
+
}), Q = l(D), $ = u(O), ee = o(B), te = c(D, L), ne = d.useMemo(() => b(C, T, E), [
|
|
36
|
+
C,
|
|
37
|
+
T,
|
|
38
|
+
E
|
|
39
39
|
]).map((e) => ({
|
|
40
40
|
label: e.label,
|
|
41
|
-
[
|
|
41
|
+
[w]: e.count
|
|
42
42
|
}));
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
ref:
|
|
45
|
-
className: e(
|
|
46
|
-
...
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
-
config:
|
|
49
|
-
palette:
|
|
43
|
+
return /* @__PURE__ */ f("div", {
|
|
44
|
+
ref: X,
|
|
45
|
+
className: e(y),
|
|
46
|
+
...Y,
|
|
47
|
+
children: /* @__PURE__ */ f(t, {
|
|
48
|
+
config: x,
|
|
49
|
+
palette: S,
|
|
50
50
|
className: "size-full [&_.recharts-label]:fill-foreground",
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
data:
|
|
51
|
+
children: /* @__PURE__ */ p(h, {
|
|
52
|
+
data: ne,
|
|
53
53
|
barCategoryGap: 0,
|
|
54
54
|
children: [
|
|
55
|
-
|
|
56
|
-
horizontal:
|
|
57
|
-
vertical:
|
|
58
|
-
strokeDasharray:
|
|
55
|
+
j && /* @__PURE__ */ f(g, {
|
|
56
|
+
horizontal: H ?? !0,
|
|
57
|
+
vertical: U ?? !1,
|
|
58
|
+
strokeDasharray: V ? "3 3" : void 0
|
|
59
59
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ f(_, {
|
|
61
61
|
dataKey: "label",
|
|
62
|
-
hide: !
|
|
62
|
+
hide: !N,
|
|
63
63
|
tickLine: !1,
|
|
64
64
|
axisLine: !1,
|
|
65
|
-
tickFormatter:
|
|
66
|
-
angle:
|
|
67
|
-
interval:
|
|
68
|
-
textAnchor:
|
|
69
|
-
height:
|
|
70
|
-
label:
|
|
65
|
+
tickFormatter: F,
|
|
66
|
+
angle: L,
|
|
67
|
+
interval: R,
|
|
68
|
+
textAnchor: s(L),
|
|
69
|
+
height: te,
|
|
70
|
+
label: Q
|
|
71
71
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ f(v, {
|
|
73
73
|
type: "number",
|
|
74
|
-
hide: !
|
|
74
|
+
hide: !P,
|
|
75
75
|
tickLine: !1,
|
|
76
76
|
axisLine: !1,
|
|
77
77
|
allowDecimals: !1,
|
|
78
|
-
unit:
|
|
79
|
-
tickFormatter:
|
|
80
|
-
tickCount:
|
|
81
|
-
domain:
|
|
82
|
-
width:
|
|
83
|
-
label:
|
|
78
|
+
unit: k,
|
|
79
|
+
tickFormatter: I,
|
|
80
|
+
tickCount: z,
|
|
81
|
+
domain: ee,
|
|
82
|
+
width: O ? 72 : void 0,
|
|
83
|
+
label: $
|
|
84
84
|
}),
|
|
85
|
-
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
dataKey:
|
|
88
|
-
fill: `var(--color-${
|
|
85
|
+
M && /* @__PURE__ */ f(n, { content: W ?? /* @__PURE__ */ f(r, {}) }),
|
|
86
|
+
/* @__PURE__ */ f(m, {
|
|
87
|
+
dataKey: w,
|
|
88
|
+
fill: `var(--color-${i(String(w))})`,
|
|
89
89
|
stroke: "var(--ui-background-surface-primary)",
|
|
90
90
|
strokeWidth: 1,
|
|
91
|
-
radius:
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
radius: A > 0 ? [
|
|
92
|
+
A,
|
|
93
|
+
A,
|
|
94
94
|
0,
|
|
95
95
|
0
|
|
96
96
|
] : void 0,
|
|
97
|
-
...
|
|
97
|
+
...Z
|
|
98
98
|
})
|
|
99
99
|
]
|
|
100
100
|
})
|
|
101
101
|
})
|
|
102
102
|
});
|
|
103
103
|
});
|
|
104
|
-
|
|
104
|
+
x.displayName = "Histogram";
|
|
105
105
|
//#endregion
|
|
106
|
-
export {
|
|
106
|
+
export { x as Histogram, b as computeHistogramBins };
|
|
107
107
|
|
|
108
108
|
//# sourceMappingURL=histogram.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"histogram.js","names":[],"sources":["../../../../src/components/ui/histogram/histogram.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveRotatedTickAnchor,\n resolveXAxisHeight,\n resolveXAxisTitle,\n resolveYAxisTitle,\n type ChartConfig,\n type ChartPalette,\n type CartesianChartProps,\n type ChartAnimationProps,\n} from '../chart';\n\n// A histogram bins a set of continuous samples into equal-width ranges and plots\n// the frequency of each as contiguous bars — distinct from BarChart, whose bars\n// are pre-categorized. The binning is the component's job (a pure helper), so the\n// consumer passes raw `values`, not pre-aggregated rows. Built on the shared\n// `Chart` primitives; no new tokens (the single series' color is caller-supplied\n// via `config`, same `--color-<key>` mechanism as the other chart types).\n\nexport interface HistogramBin {\n /** Lower bound of the bin (inclusive). */\n x0: number;\n /** Upper bound of the bin (exclusive, except the last bin which is inclusive). */\n x1: number;\n /** Human-readable range label, e.g. `\"0–10\"`. */\n label: string;\n /** How many samples fell in the bin. */\n count: number;\n}\n\nconst roundEdge = (n: number) => Number(n.toFixed(2));\n\n/**\n * Split `values` into `binCount` equal-width bins and count the samples in each.\n * The range is `domain` if given, else the data's [min, max]; values outside the\n * domain are dropped, and the max value lands in the last (inclusive) bin.\n * Returns [] when there's nothing to bin. Exported for unit tests; not part of\n * the package's public API.\n */\nexport function computeHistogramBins(\n values: ReadonlyArray<number>,\n binCount: number,\n domain?: [number, number]\n): HistogramBin[] {\n const nums = values.filter(\n (v): v is number => typeof v === 'number' && Number.isFinite(v)\n );\n if (nums.length === 0 || binCount < 1) return [];\n\n const [d0, d1] = domain ?? [Math.min(...nums), Math.max(...nums)];\n // Normalize an inverted domain ([max, min]) so binning stays robust.\n const min = Math.min(d0, d1);\n const hi = Math.max(d0, d1);\n // A zero-width range (all values equal, or a degenerate domain) can't be\n // divided — widen it by 1 so the single bin has extent.\n const max = min === hi ? min + 1 : hi;\n const width = (max - min) / binCount;\n\n const bins: HistogramBin[] = Array.from({ length: binCount }, (_, i) => {\n const x0 = min + i * width;\n const x1 = i === binCount - 1 ? max : min + (i + 1) * width;\n return { x0, x1, label: `${roundEdge(x0)}–${roundEdge(x1)}`, count: 0 };\n });\n\n for (const v of nums) {\n if (v < min || v > max) continue;\n let idx = Math.floor((v - min) / width);\n if (idx >= binCount) idx = binCount - 1; // the max value\n bins[idx].count += 1;\n }\n return bins;\n}\n\nexport interface HistogramProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n CartesianChartProps,\n ChartAnimationProps {\n /**\n * The dataviz palette this chart's series are painted from. Series that\n * state no `color` of their own take a stop of it. See `ChartPalette`.\n */\n palette?: ChartPalette;\n /** Raw continuous samples to bin (non-finite values are ignored). */\n values: ReadonlyArray<number>;\n /**\n * Single-series map of `label` / `icon` / `tone`, keyed by `dataKey` (imported\n * from the shared `Chart` primitives). Series take their colour from the\n * container's `palette`; each entry maps a key to a `label` and an optional\n * `tone`.\n */\n config: ChartConfig;\n /** `config` key that colors + labels the frequency bars. */\n dataKey?: string;\n /** Number of equal-width bins. */\n binCount?: number;\n /** Fix the binning range instead of deriving it from the data's min/max. */\n domain?: [number, number];\n /** Corner radius on the top of each bar. */\n barRadius?: number;\n}\n\nconst Histogram = React.forwardRef<HTMLDivElement, HistogramProps>(\n (\n {\n className,\n config,\n palette,\n values,\n dataKey = 'count',\n binCount = 10,\n domain,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n barRadius = 0,\n showGrid = true,\n showTooltip = true,\n showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const xAxisTitle = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n const xAxisHeight = resolveXAxisHeight(xAxisLabel, xAxisAngle);\n\n const bins = React.useMemo(\n () => computeHistogramBins(values, binCount, domain),\n [values, binCount, domain]\n );\n // Bars carry the bin `label` as the category and `count` under `dataKey`, so\n // the tooltip resolves the frequency from `config[dataKey]`.\n const data = bins.map((bin) => ({ label: bin.label, [dataKey]: bin.count }));\n\n return (\n <div\n ref={ref}\n className={cn(className)}\n {...props}\n >\n <ChartContainer\n config={config}\n palette={palette}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsBarChart data={data} barCategoryGap={0}>\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? false}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n dataKey=\"label\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n allowDecimals={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n <Bar\n dataKey={dataKey}\n fill={`var(--color-${dataKey})`}\n // A hairline in the surface color separates the contiguous bars so\n // they don't blend into one mass (same trick as the Treemap cells).\n stroke=\"var(--ui-background-surface-primary)\"\n strokeWidth={1}\n radius={barRadius > 0 ? [barRadius, barRadius, 0, 0] : undefined}\n {...animation}\n />\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nHistogram.displayName = 'Histogram';\n\nexport { Histogram };\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"histogram.js","names":[],"sources":["../../../../src/components/ui/histogram/histogram.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveRotatedTickAnchor,\n resolveXAxisHeight,\n resolveXAxisTitle,\n resolveYAxisTitle,\n type ChartConfig,\n toCssKey,\n type ChartPalette,\n type CartesianChartProps,\n type ChartAnimationProps,\n} from '../chart';\n\n// A histogram bins a set of continuous samples into equal-width ranges and plots\n// the frequency of each as contiguous bars — distinct from BarChart, whose bars\n// are pre-categorized. The binning is the component's job (a pure helper), so the\n// consumer passes raw `values`, not pre-aggregated rows. Built on the shared\n// `Chart` primitives; no new tokens (the single series' color is caller-supplied\n// via `config`, same `--color-<key>` mechanism as the other chart types).\n\nexport interface HistogramBin {\n /** Lower bound of the bin (inclusive). */\n x0: number;\n /** Upper bound of the bin (exclusive, except the last bin which is inclusive). */\n x1: number;\n /** Human-readable range label, e.g. `\"0–10\"`. */\n label: string;\n /** How many samples fell in the bin. */\n count: number;\n}\n\nconst roundEdge = (n: number) => Number(n.toFixed(2));\n\n/**\n * Split `values` into `binCount` equal-width bins and count the samples in each.\n * The range is `domain` if given, else the data's [min, max]; values outside the\n * domain are dropped, and the max value lands in the last (inclusive) bin.\n * Returns [] when there's nothing to bin. Exported for unit tests; not part of\n * the package's public API.\n */\nexport function computeHistogramBins(\n values: ReadonlyArray<number>,\n binCount: number,\n domain?: [number, number]\n): HistogramBin[] {\n const nums = values.filter(\n (v): v is number => typeof v === 'number' && Number.isFinite(v)\n );\n if (nums.length === 0 || binCount < 1) return [];\n\n const [d0, d1] = domain ?? [Math.min(...nums), Math.max(...nums)];\n // Normalize an inverted domain ([max, min]) so binning stays robust.\n const min = Math.min(d0, d1);\n const hi = Math.max(d0, d1);\n // A zero-width range (all values equal, or a degenerate domain) can't be\n // divided — widen it by 1 so the single bin has extent.\n const max = min === hi ? min + 1 : hi;\n const width = (max - min) / binCount;\n\n const bins: HistogramBin[] = Array.from({ length: binCount }, (_, i) => {\n const x0 = min + i * width;\n const x1 = i === binCount - 1 ? max : min + (i + 1) * width;\n return { x0, x1, label: `${roundEdge(x0)}–${roundEdge(x1)}`, count: 0 };\n });\n\n for (const v of nums) {\n if (v < min || v > max) continue;\n let idx = Math.floor((v - min) / width);\n if (idx >= binCount) idx = binCount - 1; // the max value\n bins[idx].count += 1;\n }\n return bins;\n}\n\nexport interface HistogramProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n CartesianChartProps,\n ChartAnimationProps {\n /**\n * The dataviz palette this chart's series are painted from. Series that\n * state no `color` of their own take a stop of it. See `ChartPalette`.\n */\n palette?: ChartPalette;\n /** Raw continuous samples to bin (non-finite values are ignored). */\n values: ReadonlyArray<number>;\n /**\n * Single-series map of `label` / `icon` / `tone`, keyed by `dataKey` (imported\n * from the shared `Chart` primitives). Series take their colour from the\n * container's `palette`; each entry maps a key to a `label` and an optional\n * `tone`.\n */\n config: ChartConfig;\n /** `config` key that colors + labels the frequency bars. */\n dataKey?: string;\n /** Number of equal-width bins. */\n binCount?: number;\n /** Fix the binning range instead of deriving it from the data's min/max. */\n domain?: [number, number];\n /** Corner radius on the top of each bar. */\n barRadius?: number;\n}\n\nconst Histogram = React.forwardRef<HTMLDivElement, HistogramProps>(\n (\n {\n className,\n config,\n palette,\n values,\n dataKey = 'count',\n binCount = 10,\n domain,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n barRadius = 0,\n showGrid = true,\n showTooltip = true,\n showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const xAxisTitle = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n const xAxisHeight = resolveXAxisHeight(xAxisLabel, xAxisAngle);\n\n const bins = React.useMemo(\n () => computeHistogramBins(values, binCount, domain),\n [values, binCount, domain]\n );\n // Bars carry the bin `label` as the category and `count` under `dataKey`, so\n // the tooltip resolves the frequency from `config[dataKey]`.\n const data = bins.map((bin) => ({ label: bin.label, [dataKey]: bin.count }));\n\n return (\n <div\n ref={ref}\n className={cn(className)}\n {...props}\n >\n <ChartContainer\n config={config}\n palette={palette}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsBarChart data={data} barCategoryGap={0}>\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? false}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n dataKey=\"label\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n allowDecimals={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n <Bar\n dataKey={dataKey}\n fill={`var(--color-${toCssKey(String(dataKey))})`}\n // A hairline in the surface color separates the contiguous bars so\n // they don't blend into one mass (same trick as the Treemap cells).\n stroke=\"var(--ui-background-surface-primary)\"\n strokeWidth={1}\n radius={barRadius > 0 ? [barRadius, barRadius, 0, 0] : undefined}\n {...animation}\n />\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nHistogram.displayName = 'Histogram';\n\nexport { Histogram };\n"],"mappings":"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"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/utils.js";
|
|
3
3
|
import { cva as t } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
-
import { ChartContainer as n, ChartLegend as r, ChartLegendContent as i, ChartTooltip as a, ChartTooltipContent as o } from "../chart/chart.js";
|
|
5
|
-
import { CHART_LABEL_MARGIN as
|
|
4
|
+
import { ChartContainer as n, ChartLegend as r, ChartLegendContent as i, ChartTooltip as a, ChartTooltipContent as o, toCssKey as s } from "../chart/chart.js";
|
|
5
|
+
import { CHART_LABEL_MARGIN as c, dropProjectionPayload as l, resolveAnimation as u, resolveAxisDomain as d, resolveBrushProps as f, resolveChartReferenceValue as p, resolveLabelFillClass as ee, resolveReferenceLineProps as te, resolveRotatedTickAnchor as ne, resolveXAxisHeight as re, resolveXAxisTitle as ie, resolveYAxisTitle as ae, toLabelFormatter as oe, toReferenceLineList as se } from "../chart/chart-format.js";
|
|
6
6
|
import * as m from "react";
|
|
7
7
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
-
import { Area as
|
|
8
|
+
import { Area as ce, Brush as le, CartesianGrid as v, ComposedChart as y, LabelList as ue, Line as b, LineChart as de, ReferenceLine as fe, Text as pe, XAxis as me, YAxis as he, usePlotArea as x, useXAxisScale as S } from "recharts";
|
|
9
9
|
//#region src/components/ui/line-chart/line-chart.tsx
|
|
10
|
-
var
|
|
10
|
+
var C = t("", {
|
|
11
11
|
variants: {
|
|
12
12
|
curve: {
|
|
13
13
|
linear: "",
|
|
@@ -29,7 +29,7 @@ var S = t("", {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
function ge({ projectionStart: e, prevTick: t, clipId: n, dataKeys: r }) {
|
|
32
|
-
let i =
|
|
32
|
+
let i = S(), a = x();
|
|
33
33
|
if (!i || !a) return null;
|
|
34
34
|
let o = i(t), s = i(e);
|
|
35
35
|
if (o == null || s == null) return null;
|
|
@@ -63,15 +63,15 @@ function ge({ projectionStart: e, prevTick: t, clipId: n, dataKeys: r }) {
|
|
|
63
63
|
})
|
|
64
64
|
] });
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
function w(e) {
|
|
68
|
-
return e?.filter((e) => !String(e.dataKey).startsWith(C));
|
|
69
|
-
}
|
|
66
|
+
var w = "__band_";
|
|
70
67
|
function T(e) {
|
|
68
|
+
return e?.filter((e) => !String(e.dataKey).startsWith(w));
|
|
69
|
+
}
|
|
70
|
+
function E(e) {
|
|
71
71
|
return function(t) {
|
|
72
72
|
let n = {
|
|
73
73
|
...t,
|
|
74
|
-
payload:
|
|
74
|
+
payload: T(t.payload)
|
|
75
75
|
};
|
|
76
76
|
return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
|
|
77
77
|
};
|
|
@@ -80,24 +80,24 @@ function _e(e) {
|
|
|
80
80
|
return function(t) {
|
|
81
81
|
let n = {
|
|
82
82
|
...t,
|
|
83
|
-
payload:
|
|
83
|
+
payload: l(t.payload)
|
|
84
84
|
};
|
|
85
85
|
return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
var
|
|
89
|
-
let
|
|
88
|
+
var D = m.forwardRef(({ className: t, config: h, palette: x, data: S, dataKeys: D, comparisonKeys: O, deltaBands: ve, xKey: k, xAxisLabel: A, yAxisLabel: j, yUnit: ye, curve: M = "monotone", lineStyle: N = "solid", strokeWidth: P = 2, showDots: be = !1, dotSize: xe = 3, showActiveDot: Se, connectNulls: F = !1, lineSettings: I, referenceLine: Ce, projectionStart: L, showGrid: we = !0, showTooltip: Te = !0, showLegend: Ee = !0, showXAxis: De = !0, showYAxis: Oe = !0, xTickFormatter: R, yTickFormatter: ke, xAxisAngle: z, xAxisInterval: Ae, yAxisTickCount: je, yAxisDomain: B, gridDashed: Me, gridHorizontal: Ne, gridVertical: Pe, tooltipContent: V, animate: Fe, animationDuration: Ie, animationBegin: Le, animationEasing: Re, showLabels: H = !1, labelPosition: ze, labelFormatter: Be, showBrush: Ve = !1, brushHeight: He, brushAriaLabel: Ue, ...We }, Ge) => {
|
|
89
|
+
let U = u({
|
|
90
90
|
animate: Fe,
|
|
91
91
|
animationDuration: Ie,
|
|
92
92
|
animationBegin: Le,
|
|
93
93
|
animationEasing: Re
|
|
94
|
-
}), Ke = ze ?? "top", qe =
|
|
94
|
+
}), Ke = ze ?? "top", qe = d(B), Je = se(Ce), W = (e) => I?.[e]?.color ?? `var(--color-${s(e)})`, G = (e) => I?.[e]?.curveType ?? M ?? "monotone", Ye = H || Object.values(I ?? {}).some((e) => e.showLabel), Xe = re(A, z), K = m.useMemo(() => L === void 0 ? -1 : S.findIndex((e) => e[k] === L), [
|
|
95
95
|
L,
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
S,
|
|
97
|
+
k
|
|
98
98
|
]), q = K > 0, J = m.useMemo(() => {
|
|
99
99
|
if (!q) return;
|
|
100
|
-
let e = new Set(
|
|
100
|
+
let e = new Set(S.slice(K).map((e) => e[k]));
|
|
101
101
|
return ({ payload: t, index: n, ...r }) => /* @__PURE__ */ g(pe, {
|
|
102
102
|
...r,
|
|
103
103
|
fontSize: 12,
|
|
@@ -107,168 +107,168 @@ var E = m.forwardRef(({ className: t, config: h, palette: b, data: x, dataKeys:
|
|
|
107
107
|
}, [
|
|
108
108
|
q,
|
|
109
109
|
K,
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
S,
|
|
111
|
+
k,
|
|
112
112
|
R
|
|
113
|
-
]), Y = m.useMemo(() => q ?
|
|
113
|
+
]), Y = m.useMemo(() => q ? S.map((e) => ({
|
|
114
114
|
...e,
|
|
115
|
-
...Object.fromEntries(
|
|
116
|
-
})) :
|
|
115
|
+
...Object.fromEntries(D.map((t) => [`_proj_${t}`, e[t]]))
|
|
116
|
+
})) : S, [
|
|
117
117
|
q,
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
S,
|
|
119
|
+
D
|
|
120
120
|
]), X = m.useMemo(() => {
|
|
121
|
-
if (!(K <= 0)) return
|
|
121
|
+
if (!(K <= 0)) return S[K - 1]?.[k];
|
|
122
122
|
}, [
|
|
123
123
|
K,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
]), Z = `line-proj-${m.useId().replace(/:/g, "")}`,
|
|
127
|
-
if (!
|
|
128
|
-
let e =
|
|
124
|
+
S,
|
|
125
|
+
k
|
|
126
|
+
]), Z = `line-proj-${m.useId().replace(/:/g, "")}`, Ze = m.useMemo(() => {
|
|
127
|
+
if (!V) return;
|
|
128
|
+
let e = E(V);
|
|
129
129
|
return q ? _e(e) : e;
|
|
130
|
-
}, [
|
|
131
|
-
field: `${
|
|
130
|
+
}, [V, q]), Qe = ie(A), $e = ae(j), Q = (ve ?? []).map(([e, t], n) => ({
|
|
131
|
+
field: `${w}${n}`,
|
|
132
132
|
current: e,
|
|
133
133
|
comparison: t
|
|
134
|
-
})), $ = Q.length > 0,
|
|
134
|
+
})), $ = Q.length > 0, et = Ze ?? ($ || q ? ((e) => /* @__PURE__ */ g(o, {
|
|
135
135
|
active: e.active,
|
|
136
136
|
label: e.label,
|
|
137
|
-
payload:
|
|
138
|
-
})) : /* @__PURE__ */ g(o, {})),
|
|
137
|
+
payload: l(T(e.payload))
|
|
138
|
+
})) : /* @__PURE__ */ g(o, {})), tt = $ || q ? ((e) => /* @__PURE__ */ g(i, {
|
|
139
139
|
verticalAlign: e.verticalAlign,
|
|
140
|
-
payload:
|
|
141
|
-
})) : /* @__PURE__ */ g(i, {}),
|
|
140
|
+
payload: l(T(e.payload))
|
|
141
|
+
})) : /* @__PURE__ */ g(i, {}), nt = Q.length ? Y.map((e) => {
|
|
142
142
|
let t = { ...e };
|
|
143
143
|
for (let { field: n, current: r, comparison: i } of Q) {
|
|
144
144
|
let a = e[r], o = e[i];
|
|
145
145
|
t[n] = typeof a == "number" && typeof o == "number" ? [Math.min(a, o), Math.max(a, o)] : void 0;
|
|
146
146
|
}
|
|
147
147
|
return t;
|
|
148
|
-
}) : Y,
|
|
148
|
+
}) : Y, rt = Q.length > 0 ? y : de;
|
|
149
149
|
return /* @__PURE__ */ g("div", {
|
|
150
150
|
ref: Ge,
|
|
151
|
-
"data-curve":
|
|
152
|
-
"data-line-style":
|
|
153
|
-
className: e(
|
|
154
|
-
curve:
|
|
155
|
-
lineStyle:
|
|
151
|
+
"data-curve": M,
|
|
152
|
+
"data-line-style": N,
|
|
153
|
+
className: e(C({
|
|
154
|
+
curve: M,
|
|
155
|
+
lineStyle: N
|
|
156
156
|
}), t),
|
|
157
157
|
...We,
|
|
158
158
|
children: /* @__PURE__ */ g(n, {
|
|
159
159
|
config: h,
|
|
160
|
-
palette:
|
|
160
|
+
palette: x,
|
|
161
161
|
className: "size-full [&_.recharts-label]:fill-foreground",
|
|
162
|
-
children: /* @__PURE__ */ _(
|
|
163
|
-
data:
|
|
164
|
-
margin: Ye ?
|
|
162
|
+
children: /* @__PURE__ */ _(rt, {
|
|
163
|
+
data: nt,
|
|
164
|
+
margin: Ye ? c : void 0,
|
|
165
165
|
children: [
|
|
166
|
-
|
|
166
|
+
we && /* @__PURE__ */ g(v, {
|
|
167
167
|
horizontal: Ne ?? !0,
|
|
168
168
|
vertical: Pe ?? !1,
|
|
169
169
|
strokeDasharray: Me ? "3 3" : void 0
|
|
170
170
|
}),
|
|
171
171
|
/* @__PURE__ */ g(me, {
|
|
172
|
-
dataKey:
|
|
172
|
+
dataKey: k,
|
|
173
173
|
type: "category",
|
|
174
|
-
hide: !
|
|
174
|
+
hide: !De,
|
|
175
175
|
tickLine: !1,
|
|
176
176
|
axisLine: !1,
|
|
177
177
|
tickMargin: 8,
|
|
178
178
|
tickFormatter: J ? void 0 : R,
|
|
179
179
|
tick: J,
|
|
180
180
|
angle: z,
|
|
181
|
-
interval:
|
|
182
|
-
textAnchor:
|
|
183
|
-
height:
|
|
184
|
-
label:
|
|
181
|
+
interval: Ae,
|
|
182
|
+
textAnchor: ne(z),
|
|
183
|
+
height: Xe,
|
|
184
|
+
label: Qe
|
|
185
185
|
}),
|
|
186
186
|
/* @__PURE__ */ g(he, {
|
|
187
187
|
type: "number",
|
|
188
|
-
hide: !
|
|
188
|
+
hide: !Oe,
|
|
189
189
|
tickLine: !1,
|
|
190
190
|
axisLine: !1,
|
|
191
191
|
unit: ye,
|
|
192
|
-
tickFormatter:
|
|
193
|
-
tickCount:
|
|
192
|
+
tickFormatter: ke,
|
|
193
|
+
tickCount: je,
|
|
194
194
|
domain: qe,
|
|
195
|
-
width:
|
|
196
|
-
label:
|
|
195
|
+
width: j ? 72 : void 0,
|
|
196
|
+
label: $e
|
|
197
197
|
}),
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
Te && /* @__PURE__ */ g(a, { content: et }),
|
|
199
|
+
Ee && /* @__PURE__ */ g(r, { content: tt }),
|
|
200
200
|
q && X != null && /* @__PURE__ */ g(ge, {
|
|
201
201
|
projectionStart: L,
|
|
202
202
|
prevTick: X,
|
|
203
203
|
clipId: Z,
|
|
204
|
-
dataKeys:
|
|
204
|
+
dataKeys: D
|
|
205
205
|
}),
|
|
206
|
-
Q.map(({ field: e, current: t }) => /* @__PURE__ */ g(
|
|
206
|
+
Q.map(({ field: e, current: t }) => /* @__PURE__ */ g(ce, {
|
|
207
207
|
dataKey: e,
|
|
208
|
-
type:
|
|
208
|
+
type: G(t),
|
|
209
209
|
stroke: "none",
|
|
210
|
-
fill:
|
|
210
|
+
fill: W(t),
|
|
211
211
|
fillOpacity: .12,
|
|
212
212
|
connectNulls: F,
|
|
213
213
|
dot: !1,
|
|
214
214
|
activeDot: !1,
|
|
215
215
|
clipPath: q ? `url(#${Z}-actual)` : void 0,
|
|
216
|
-
...
|
|
216
|
+
...U,
|
|
217
217
|
legendType: "none",
|
|
218
218
|
tooltipType: "none"
|
|
219
219
|
}, e)),
|
|
220
|
-
|
|
221
|
-
let n =
|
|
222
|
-
return /* @__PURE__ */ g(
|
|
220
|
+
D.map((e, t) => {
|
|
221
|
+
let n = O?.includes(e), r = I?.[e], i = !n && (r?.showDots ?? be), a = r?.dotSize ?? xe, o = !n && (Se ?? i), s = r?.dashed ?? N === "dashed", c = r?.showLabel ?? H, l = r?.labelPosition ?? Ke;
|
|
222
|
+
return /* @__PURE__ */ g(b, {
|
|
223
223
|
className: q && !n ? `actual-${Z}-${t}` : void 0,
|
|
224
|
-
type:
|
|
224
|
+
type: G(e),
|
|
225
225
|
dataKey: e,
|
|
226
|
-
stroke:
|
|
227
|
-
strokeWidth: r?.strokeWidth ??
|
|
226
|
+
stroke: W(e),
|
|
227
|
+
strokeWidth: r?.strokeWidth ?? P,
|
|
228
228
|
strokeDasharray: n || s ? "5 5" : void 0,
|
|
229
229
|
strokeOpacity: n ? .5 : void 0,
|
|
230
230
|
dot: i ? { r: a } : !1,
|
|
231
231
|
activeDot: o ? { r: a + 2 } : !1,
|
|
232
232
|
connectNulls: F,
|
|
233
|
-
...
|
|
234
|
-
children: c && /* @__PURE__ */ g(
|
|
233
|
+
...U,
|
|
234
|
+
children: c && /* @__PURE__ */ g(ue, {
|
|
235
235
|
dataKey: e,
|
|
236
236
|
position: l,
|
|
237
|
-
formatter:
|
|
238
|
-
className:
|
|
237
|
+
formatter: oe(Be),
|
|
238
|
+
className: ee(l),
|
|
239
239
|
fontSize: 12
|
|
240
240
|
})
|
|
241
241
|
}, e);
|
|
242
242
|
}),
|
|
243
|
-
q &&
|
|
244
|
-
if (
|
|
243
|
+
q && D.map((e, t) => {
|
|
244
|
+
if (O?.includes(e)) return null;
|
|
245
245
|
let n = I?.[e];
|
|
246
|
-
return /* @__PURE__ */ g(
|
|
246
|
+
return /* @__PURE__ */ g(b, {
|
|
247
247
|
className: `proj-${Z}-${t}`,
|
|
248
|
-
type:
|
|
248
|
+
type: G(e),
|
|
249
249
|
dataKey: `_proj_${e}`,
|
|
250
250
|
name: e,
|
|
251
|
-
stroke:
|
|
252
|
-
strokeWidth: n?.strokeWidth ??
|
|
251
|
+
stroke: W(e),
|
|
252
|
+
strokeWidth: n?.strokeWidth ?? P,
|
|
253
253
|
strokeDasharray: "5 5",
|
|
254
254
|
dot: !1,
|
|
255
255
|
activeDot: !1,
|
|
256
256
|
legendType: "none",
|
|
257
257
|
tooltipType: "none",
|
|
258
|
-
...
|
|
258
|
+
...U
|
|
259
259
|
}, `_proj_${e}`);
|
|
260
260
|
}),
|
|
261
261
|
Je.map((e, t) => {
|
|
262
|
-
let n =
|
|
263
|
-
return n === void 0 ? null : /* @__PURE__ */ g(
|
|
262
|
+
let n = p(e, S, D);
|
|
263
|
+
return n === void 0 ? null : /* @__PURE__ */ g(fe, {
|
|
264
264
|
y: n,
|
|
265
|
-
...
|
|
265
|
+
...te(e.label, e.labelPosition)
|
|
266
266
|
}, `${e.label ?? "ref"}-${t}`);
|
|
267
267
|
}),
|
|
268
|
-
Ve && /* @__PURE__ */ g(
|
|
269
|
-
dataKey:
|
|
268
|
+
Ve && /* @__PURE__ */ g(le, {
|
|
269
|
+
dataKey: k,
|
|
270
270
|
tickFormatter: R,
|
|
271
|
-
...
|
|
271
|
+
...f({
|
|
272
272
|
brushHeight: He,
|
|
273
273
|
brushAriaLabel: Ue
|
|
274
274
|
})
|
|
@@ -278,8 +278,8 @@ var E = m.forwardRef(({ className: t, config: h, palette: b, data: x, dataKeys:
|
|
|
278
278
|
})
|
|
279
279
|
});
|
|
280
280
|
});
|
|
281
|
-
|
|
281
|
+
D.displayName = "LineChart";
|
|
282
282
|
//#endregion
|
|
283
|
-
export {
|
|
283
|
+
export { D as LineChart, E as createBandStrippedTooltip, T as dropBandSeries, C as lineChartVariants };
|
|
284
284
|
|
|
285
285
|
//# sourceMappingURL=line-chart.js.map
|