@acronis-platform/ui-react 5.4.1 → 5.4.3
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 -105
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +135 -132
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/chart/chart-format.js +36 -31
- package/dist/components/ui/chart/chart-format.js.map +1 -1
- package/dist/components/ui/chart/chart.js +9 -7
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/chart/use-x-axis-layout.js +71 -0
- package/dist/components/ui/chart/use-x-axis-layout.js.map +1 -0
- package/dist/components/ui/composed-chart/composed-chart.js +141 -139
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +70 -67
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +54 -51
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +119 -117
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +53 -51
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/llms/area-chart.md +10 -1
- package/dist/llms/bar-chart.md +10 -1
- package/dist/llms/composed-chart.md +10 -1
- package/dist/llms/confidence-cone.md +10 -1
- package/dist/llms/histogram.md +10 -1
- package/dist/llms/line-chart.md +10 -1
- package/dist/llms/scatter-chart.md +10 -1
- package/dist/llms.txt +1 -1
- package/dist/src/components/ui/chart/chart-format.d.ts +10 -4
- package/dist/src/components/ui/chart/chart.d.ts +1 -1
- package/dist/src/components/ui/chart/use-x-axis-layout.d.ts +28 -0
- package/dist/ui-react.css +1 -1
- package/package.json +2 -2
|
@@ -2,12 +2,13 @@
|
|
|
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
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,
|
|
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, resolveXAxisTickLabels as re, resolveXAxisTitle as ie, resolveYAxisTitle as ae, toLabelFormatter as oe, toReferenceLineList as se } from "../chart/chart-format.js";
|
|
6
|
+
import { mergeXAxisLayoutMargin as ce, useXAxisLayout as le } from "../chart/use-x-axis-layout.js";
|
|
6
7
|
import * as m from "react";
|
|
7
8
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
-
import { Area as
|
|
9
|
+
import { Area as ue, Brush as de, CartesianGrid as fe, ComposedChart as pe, LabelList as me, Line as v, LineChart as he, ReferenceLine as ge, Text as _e, XAxis as ve, YAxis as ye, usePlotArea as y, useXAxisScale as b } from "recharts";
|
|
9
10
|
//#region src/components/ui/line-chart/line-chart.tsx
|
|
10
|
-
var
|
|
11
|
+
var x = t("", {
|
|
11
12
|
variants: {
|
|
12
13
|
curve: {
|
|
13
14
|
linear: "",
|
|
@@ -28,8 +29,8 @@ var C = t("", {
|
|
|
28
29
|
lineStyle: "solid"
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
|
-
function
|
|
32
|
-
let i =
|
|
32
|
+
function be({ projectionStart: e, prevTick: t, clipId: n, dataKeys: r }) {
|
|
33
|
+
let i = b(), a = y();
|
|
33
34
|
if (!i || !a) return null;
|
|
34
35
|
let o = i(t), s = i(e);
|
|
35
36
|
if (o == null || s == null) return null;
|
|
@@ -63,20 +64,20 @@ function ge({ projectionStart: e, prevTick: t, clipId: n, dataKeys: r }) {
|
|
|
63
64
|
})
|
|
64
65
|
] });
|
|
65
66
|
}
|
|
66
|
-
var
|
|
67
|
-
function
|
|
68
|
-
return e?.filter((e) => !String(e.dataKey).startsWith(
|
|
67
|
+
var S = "__band_";
|
|
68
|
+
function C(e) {
|
|
69
|
+
return e?.filter((e) => !String(e.dataKey).startsWith(S));
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function w(e) {
|
|
71
72
|
return function(t) {
|
|
72
73
|
let n = {
|
|
73
74
|
...t,
|
|
74
|
-
payload:
|
|
75
|
+
payload: C(t.payload)
|
|
75
76
|
};
|
|
76
77
|
return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function xe(e) {
|
|
80
81
|
return function(t) {
|
|
81
82
|
let n = {
|
|
82
83
|
...t,
|
|
@@ -85,192 +86,193 @@ function _e(e) {
|
|
|
85
86
|
return typeof e == "function" ? /* @__PURE__ */ g(e, { ...n }) : m.cloneElement(e, n);
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
|
-
var
|
|
89
|
-
let
|
|
90
|
-
animate:
|
|
91
|
-
animationDuration:
|
|
92
|
-
animationBegin:
|
|
93
|
-
animationEasing:
|
|
94
|
-
}),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
var T = m.forwardRef(({ className: t, config: h, palette: y, data: b, dataKeys: T, comparisonKeys: E, deltaBands: Se, xKey: D, xAxisLabel: O, yAxisLabel: k, yUnit: Ce, curve: A = "monotone", lineStyle: j = "solid", strokeWidth: M = 2, showDots: we = !1, dotSize: Te = 3, showActiveDot: Ee, connectNulls: N = !1, lineSettings: P, referenceLine: De, projectionStart: F, showGrid: Oe = !0, showTooltip: ke = !0, showLegend: Ae = !0, showXAxis: je = !0, showYAxis: Me = !0, xTickFormatter: I, yTickFormatter: Ne, xAxisAngle: L, xAxisInterval: Pe, yAxisTickCount: Fe, yAxisDomain: Ie, gridDashed: Le, gridHorizontal: Re, gridVertical: ze, tooltipContent: R, animate: Be, animationDuration: Ve, animationBegin: z, animationEasing: He, showLabels: B = !1, labelPosition: Ue, labelFormatter: We, showBrush: Ge = !1, brushHeight: Ke, brushAriaLabel: qe, ...Je }, Ye) => {
|
|
90
|
+
let V = u({
|
|
91
|
+
animate: Be,
|
|
92
|
+
animationDuration: Ve,
|
|
93
|
+
animationBegin: z,
|
|
94
|
+
animationEasing: He
|
|
95
|
+
}), Xe = Ue ?? "top", Ze = d(Ie), Qe = se(De), H = (e) => P?.[e]?.color ?? `var(--color-${s(e)})`, U = (e) => P?.[e]?.curveType ?? A ?? "monotone", $e = B || Object.values(P ?? {}).some((e) => e.showLabel), et = re(b.map((e) => e[D]), I), W = m.useRef(null), G = le(W, L, O, et.join("\0")), tt = ce($e ? c : void 0, G.margin), K = m.useMemo(() => F === void 0 ? -1 : b.findIndex((e) => e[D] === F), [
|
|
96
|
+
F,
|
|
97
|
+
b,
|
|
98
|
+
D
|
|
98
99
|
]), q = K > 0, J = m.useMemo(() => {
|
|
99
100
|
if (!q) return;
|
|
100
|
-
let e = new Set(
|
|
101
|
-
return ({ payload: t, index: n, ...r }) => /* @__PURE__ */ g(
|
|
101
|
+
let e = new Set(b.slice(K).map((e) => e[D]));
|
|
102
|
+
return ({ payload: t, index: n, ...r }) => /* @__PURE__ */ g(_e, {
|
|
102
103
|
...r,
|
|
103
104
|
fontSize: 12,
|
|
104
105
|
className: e.has(t.value) ? "fill-[var(--ui-text-on-surface-disabled)]" : "fill-muted-foreground",
|
|
105
|
-
children:
|
|
106
|
+
children: I ? I(t.value, n) : t.value
|
|
106
107
|
});
|
|
107
108
|
}, [
|
|
108
109
|
q,
|
|
109
110
|
K,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
]), Y = m.useMemo(() => q ?
|
|
111
|
+
b,
|
|
112
|
+
D,
|
|
113
|
+
I
|
|
114
|
+
]), Y = m.useMemo(() => q ? b.map((e) => ({
|
|
114
115
|
...e,
|
|
115
|
-
...Object.fromEntries(
|
|
116
|
-
})) :
|
|
116
|
+
...Object.fromEntries(T.map((t) => [`_proj_${t}`, e[t]]))
|
|
117
|
+
})) : b, [
|
|
117
118
|
q,
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
b,
|
|
120
|
+
T
|
|
120
121
|
]), X = m.useMemo(() => {
|
|
121
|
-
if (!(K <= 0)) return
|
|
122
|
+
if (!(K <= 0)) return b[K - 1]?.[D];
|
|
122
123
|
}, [
|
|
123
124
|
K,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
]), Z = `line-proj-${m.useId().replace(/:/g, "")}`,
|
|
127
|
-
if (!
|
|
128
|
-
let e =
|
|
129
|
-
return q ?
|
|
130
|
-
}, [
|
|
131
|
-
field: `${
|
|
125
|
+
b,
|
|
126
|
+
D
|
|
127
|
+
]), Z = `line-proj-${m.useId().replace(/:/g, "")}`, nt = m.useMemo(() => {
|
|
128
|
+
if (!R) return;
|
|
129
|
+
let e = w(R);
|
|
130
|
+
return q ? xe(e) : e;
|
|
131
|
+
}, [R, q]), rt = ie(O), it = ae(k), Q = (Se ?? []).map(([e, t], n) => ({
|
|
132
|
+
field: `${S}${n}`,
|
|
132
133
|
current: e,
|
|
133
134
|
comparison: t
|
|
134
|
-
})), $ = Q.length > 0,
|
|
135
|
+
})), $ = Q.length > 0, at = nt ?? ($ || q ? ((e) => /* @__PURE__ */ g(o, {
|
|
135
136
|
active: e.active,
|
|
136
137
|
label: e.label,
|
|
137
|
-
payload: l(
|
|
138
|
-
})) : /* @__PURE__ */ g(o, {})),
|
|
138
|
+
payload: l(C(e.payload))
|
|
139
|
+
})) : /* @__PURE__ */ g(o, {})), ot = $ || q ? ((e) => /* @__PURE__ */ g(i, {
|
|
139
140
|
verticalAlign: e.verticalAlign,
|
|
140
|
-
payload: l(
|
|
141
|
-
})) : /* @__PURE__ */ g(i, {}),
|
|
141
|
+
payload: l(C(e.payload))
|
|
142
|
+
})) : /* @__PURE__ */ g(i, {}), st = Q.length ? Y.map((e) => {
|
|
142
143
|
let t = { ...e };
|
|
143
144
|
for (let { field: n, current: r, comparison: i } of Q) {
|
|
144
145
|
let a = e[r], o = e[i];
|
|
145
146
|
t[n] = typeof a == "number" && typeof o == "number" ? [Math.min(a, o), Math.max(a, o)] : void 0;
|
|
146
147
|
}
|
|
147
148
|
return t;
|
|
148
|
-
}) : Y,
|
|
149
|
+
}) : Y, ct = Q.length > 0 ? pe : he;
|
|
149
150
|
return /* @__PURE__ */ g("div", {
|
|
150
|
-
ref:
|
|
151
|
-
"data-curve":
|
|
152
|
-
"data-line-style":
|
|
153
|
-
className: e(
|
|
154
|
-
curve:
|
|
155
|
-
lineStyle:
|
|
151
|
+
ref: Ye,
|
|
152
|
+
"data-curve": A,
|
|
153
|
+
"data-line-style": j,
|
|
154
|
+
className: e(x({
|
|
155
|
+
curve: A,
|
|
156
|
+
lineStyle: j
|
|
156
157
|
}), t),
|
|
157
|
-
...
|
|
158
|
+
...Je,
|
|
158
159
|
children: /* @__PURE__ */ g(n, {
|
|
160
|
+
ref: W,
|
|
159
161
|
config: h,
|
|
160
|
-
palette:
|
|
162
|
+
palette: y,
|
|
161
163
|
className: "size-full [&_.recharts-label]:fill-foreground",
|
|
162
|
-
children: /* @__PURE__ */ _(
|
|
163
|
-
data:
|
|
164
|
-
margin:
|
|
164
|
+
children: /* @__PURE__ */ _(ct, {
|
|
165
|
+
data: st,
|
|
166
|
+
margin: tt,
|
|
165
167
|
children: [
|
|
166
|
-
|
|
167
|
-
horizontal:
|
|
168
|
-
vertical:
|
|
169
|
-
strokeDasharray:
|
|
168
|
+
Oe && /* @__PURE__ */ g(fe, {
|
|
169
|
+
horizontal: Re ?? !0,
|
|
170
|
+
vertical: ze ?? !1,
|
|
171
|
+
strokeDasharray: Le ? "3 3" : void 0
|
|
170
172
|
}),
|
|
171
|
-
/* @__PURE__ */ g(
|
|
172
|
-
dataKey:
|
|
173
|
+
/* @__PURE__ */ g(ve, {
|
|
174
|
+
dataKey: D,
|
|
173
175
|
type: "category",
|
|
174
|
-
hide: !
|
|
176
|
+
hide: !je,
|
|
175
177
|
tickLine: !1,
|
|
176
178
|
axisLine: !1,
|
|
177
179
|
tickMargin: 8,
|
|
178
|
-
tickFormatter: J ? void 0 :
|
|
180
|
+
tickFormatter: J ? void 0 : I,
|
|
179
181
|
tick: J,
|
|
180
|
-
angle:
|
|
181
|
-
interval:
|
|
182
|
-
textAnchor: ne(
|
|
183
|
-
height:
|
|
184
|
-
label:
|
|
182
|
+
angle: L,
|
|
183
|
+
interval: Pe,
|
|
184
|
+
textAnchor: ne(L),
|
|
185
|
+
height: G.height,
|
|
186
|
+
label: rt
|
|
185
187
|
}),
|
|
186
|
-
/* @__PURE__ */ g(
|
|
188
|
+
/* @__PURE__ */ g(ye, {
|
|
187
189
|
type: "number",
|
|
188
|
-
hide: !
|
|
190
|
+
hide: !Me,
|
|
189
191
|
tickLine: !1,
|
|
190
192
|
axisLine: !1,
|
|
191
|
-
unit:
|
|
192
|
-
tickFormatter:
|
|
193
|
-
tickCount:
|
|
194
|
-
domain:
|
|
195
|
-
width:
|
|
196
|
-
label:
|
|
193
|
+
unit: Ce,
|
|
194
|
+
tickFormatter: Ne,
|
|
195
|
+
tickCount: Fe,
|
|
196
|
+
domain: Ze,
|
|
197
|
+
width: k ? 72 : void 0,
|
|
198
|
+
label: it
|
|
197
199
|
}),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
q && X != null && /* @__PURE__ */ g(
|
|
201
|
-
projectionStart:
|
|
200
|
+
ke && /* @__PURE__ */ g(a, { content: at }),
|
|
201
|
+
Ae && /* @__PURE__ */ g(r, { content: ot }),
|
|
202
|
+
q && X != null && /* @__PURE__ */ g(be, {
|
|
203
|
+
projectionStart: F,
|
|
202
204
|
prevTick: X,
|
|
203
205
|
clipId: Z,
|
|
204
|
-
dataKeys:
|
|
206
|
+
dataKeys: T
|
|
205
207
|
}),
|
|
206
|
-
Q.map(({ field: e, current: t }) => /* @__PURE__ */ g(
|
|
208
|
+
Q.map(({ field: e, current: t }) => /* @__PURE__ */ g(ue, {
|
|
207
209
|
dataKey: e,
|
|
208
|
-
type:
|
|
210
|
+
type: U(t),
|
|
209
211
|
stroke: "none",
|
|
210
|
-
fill:
|
|
212
|
+
fill: H(t),
|
|
211
213
|
fillOpacity: .12,
|
|
212
|
-
connectNulls:
|
|
214
|
+
connectNulls: N,
|
|
213
215
|
dot: !1,
|
|
214
216
|
activeDot: !1,
|
|
215
217
|
clipPath: q ? `url(#${Z}-actual)` : void 0,
|
|
216
|
-
...
|
|
218
|
+
...V,
|
|
217
219
|
legendType: "none",
|
|
218
220
|
tooltipType: "none"
|
|
219
221
|
}, e)),
|
|
220
|
-
|
|
221
|
-
let n =
|
|
222
|
-
return /* @__PURE__ */ g(
|
|
222
|
+
T.map((e, t) => {
|
|
223
|
+
let n = E?.includes(e), r = P?.[e], i = !n && (r?.showDots ?? we), a = r?.dotSize ?? Te, o = !n && (Ee ?? i), s = r?.dashed ?? j === "dashed", c = r?.showLabel ?? B, l = r?.labelPosition ?? Xe;
|
|
224
|
+
return /* @__PURE__ */ g(v, {
|
|
223
225
|
className: q && !n ? `actual-${Z}-${t}` : void 0,
|
|
224
|
-
type:
|
|
226
|
+
type: U(e),
|
|
225
227
|
dataKey: e,
|
|
226
|
-
stroke:
|
|
227
|
-
strokeWidth: r?.strokeWidth ??
|
|
228
|
+
stroke: H(e),
|
|
229
|
+
strokeWidth: r?.strokeWidth ?? M,
|
|
228
230
|
strokeDasharray: n || s ? "5 5" : void 0,
|
|
229
231
|
strokeOpacity: n ? .5 : void 0,
|
|
230
232
|
dot: i ? { r: a } : !1,
|
|
231
233
|
activeDot: o ? { r: a + 2 } : !1,
|
|
232
|
-
connectNulls:
|
|
233
|
-
...
|
|
234
|
-
children: c && /* @__PURE__ */ g(
|
|
234
|
+
connectNulls: N,
|
|
235
|
+
...V,
|
|
236
|
+
children: c && /* @__PURE__ */ g(me, {
|
|
235
237
|
dataKey: e,
|
|
236
238
|
position: l,
|
|
237
|
-
formatter: oe(
|
|
239
|
+
formatter: oe(We),
|
|
238
240
|
className: ee(l),
|
|
239
241
|
fontSize: 12
|
|
240
242
|
})
|
|
241
243
|
}, e);
|
|
242
244
|
}),
|
|
243
|
-
q &&
|
|
244
|
-
if (
|
|
245
|
-
let n =
|
|
246
|
-
return /* @__PURE__ */ g(
|
|
245
|
+
q && T.map((e, t) => {
|
|
246
|
+
if (E?.includes(e)) return null;
|
|
247
|
+
let n = P?.[e];
|
|
248
|
+
return /* @__PURE__ */ g(v, {
|
|
247
249
|
className: `proj-${Z}-${t}`,
|
|
248
|
-
type:
|
|
250
|
+
type: U(e),
|
|
249
251
|
dataKey: `_proj_${e}`,
|
|
250
252
|
name: e,
|
|
251
|
-
stroke:
|
|
252
|
-
strokeWidth: n?.strokeWidth ??
|
|
253
|
+
stroke: H(e),
|
|
254
|
+
strokeWidth: n?.strokeWidth ?? M,
|
|
253
255
|
strokeDasharray: "5 5",
|
|
254
256
|
dot: !1,
|
|
255
257
|
activeDot: !1,
|
|
256
258
|
legendType: "none",
|
|
257
259
|
tooltipType: "none",
|
|
258
|
-
...
|
|
260
|
+
...V
|
|
259
261
|
}, `_proj_${e}`);
|
|
260
262
|
}),
|
|
261
|
-
|
|
262
|
-
let n = p(e,
|
|
263
|
-
return n === void 0 ? null : /* @__PURE__ */ g(
|
|
263
|
+
Qe.map((e, t) => {
|
|
264
|
+
let n = p(e, b, T);
|
|
265
|
+
return n === void 0 ? null : /* @__PURE__ */ g(ge, {
|
|
264
266
|
y: n,
|
|
265
267
|
...te(e.label, e.labelPosition)
|
|
266
268
|
}, `${e.label ?? "ref"}-${t}`);
|
|
267
269
|
}),
|
|
268
|
-
|
|
269
|
-
dataKey:
|
|
270
|
-
tickFormatter:
|
|
270
|
+
Ge && /* @__PURE__ */ g(de, {
|
|
271
|
+
dataKey: D,
|
|
272
|
+
tickFormatter: I,
|
|
271
273
|
...f({
|
|
272
|
-
brushHeight:
|
|
273
|
-
brushAriaLabel:
|
|
274
|
+
brushHeight: Ke,
|
|
275
|
+
brushAriaLabel: qe
|
|
274
276
|
})
|
|
275
277
|
})
|
|
276
278
|
]
|
|
@@ -278,8 +280,8 @@ var D = m.forwardRef(({ className: t, config: h, palette: x, data: S, dataKeys:
|
|
|
278
280
|
})
|
|
279
281
|
});
|
|
280
282
|
});
|
|
281
|
-
|
|
283
|
+
T.displayName = "LineChart";
|
|
282
284
|
//#endregion
|
|
283
|
-
export {
|
|
285
|
+
export { T as LineChart, w as createBandStrippedTooltip, C as dropBandSeries, x as lineChartVariants };
|
|
284
286
|
|
|
285
287
|
//# sourceMappingURL=line-chart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-chart.js","names":[],"sources":["../../../../src/components/ui/line-chart/line-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Area,\n Brush,\n CartesianGrid,\n ComposedChart,\n LabelList,\n Line,\n LineChart as RechartsLineChart,\n ReferenceLine,\n Text,\n XAxis,\n YAxis,\n useXAxisScale,\n usePlotArea,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n CHART_LABEL_FONT_SIZE,\n CHART_LABEL_MARGIN,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveBrushProps,\n dropProjectionPayload,\n resolveChartReferenceValue,\n resolveLabelFillClass,\n resolveReferenceLineProps,\n resolveRotatedTickAnchor,\n resolveXAxisHeight,\n resolveXAxisTitle,\n resolveYAxisTitle,\n toLabelFormatter,\n toReferenceLineList,\n type ChartConfig,\n type ChartPalette,\n type ChartLegendContentProps,\n type ChartTooltipContentProps,\n type CartesianChartProps,\n type ChartAnimationProps,\n type ChartBrushProps,\n type ChartCurveType,\n type ChartDataLabelProps,\n toCssKey,\n type ChartReferenceLine,\n type CartesianLabelPosition,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Line-chart variant set: `curve` (how the segments\n// interpolate between points — straight, smoothed, or stepped; the seven values\n// are documented on the shared `ChartCurveType`) and `lineStyle` (a solid or\n// dashed stroke). \"single\" vs \"multi\" line is not a variant — it\n// falls out of how many `dataKeys` the caller plots. The classes stay empty\n// because recharts' SVG — not CSS — draws the lines: `curve` drives each\n// `<Line type>` and `lineStyle` drives its `strokeDasharray`. CVA is kept so the\n// variant set is a first-class, spec-conformant part of the API (matched against\n// ui-spec's api.yaml enums) and exposed via `VariantProps`; the resolved values\n// are also mirrored onto `data-curve` / `data-line-style` for styling hooks and\n// tests.\nconst lineChartVariants = cva('', {\n variants: {\n curve: {\n linear: '',\n monotone: '',\n natural: '',\n basis: '',\n step: '',\n stepBefore: '',\n stepAfter: '',\n },\n lineStyle: {\n solid: '',\n dashed: '',\n },\n },\n defaultVariants: {\n curve: 'monotone',\n lineStyle: 'solid',\n },\n});\n\n// Renders two <clipPath> defs (actual / projection), a CSS <style> that clips\n// each recharts Line layer to its half, and a dashed separator line at the\n// visual midpoint between the last actual tick and the first projection tick.\n//\n// recharts' StaticCurve explicitly overwrites any clipPath prop passed to\n// <Line> with its own plot-area URL, so the prop-based approach used by\n// <Area> cannot be used here. Instead we apply CSS clip-path to the outer <g>\n// that recharts wraps each Line series in (targeted via a unique className we\n// set on the <Line> component). CSS clip-path on a class selector (specificity\n// 0,1,0) beats the SVG presentation attribute recharts sets on the inner\n// <path> (specificity 0), so the two clips compose: outer = our half, inner =\n// recharts' plot-area — net effect is the correct half within the plot area.\nfunction ProjectionClip({\n projectionStart,\n prevTick,\n clipId,\n dataKeys,\n}: {\n projectionStart: string | number;\n prevTick: string | number;\n clipId: string;\n dataKeys: string[];\n}) {\n const xScale = useXAxisScale();\n const plotArea = usePlotArea();\n if (!xScale || !plotArea) return null;\n const prevX = xScale(prevTick as string);\n const currX = xScale(projectionStart as string);\n if (prevX == null || currX == null) return null;\n const midX = (prevX + currX) / 2;\n const { x, y, width, height } = plotArea;\n const css = dataKeys\n .map(\n (_, i) =>\n `.actual-${clipId}-${i}{clip-path:url(#${clipId}-actual)}` +\n `.proj-${clipId}-${i}{clip-path:url(#${clipId}-projection)}`\n )\n .join('');\n return (\n <>\n <defs>\n <clipPath id={`${clipId}-actual`}>\n <rect x={x} y={y} width={midX - x} height={height} />\n </clipPath>\n <clipPath id={`${clipId}-projection`}>\n <rect x={midX} y={y} width={x + width - midX} height={height} />\n </clipPath>\n </defs>\n <style>{css}</style>\n <line\n x1={midX}\n y1={y}\n x2={midX}\n y2={y + height}\n stroke=\"var(--ui-border-on-surface-border)\"\n strokeDasharray=\"4 4\"\n />\n </>\n );\n}\n\n// Reserved field prefix for the synthetic delta-band range series. Each band\n// mints one `__band_<n>` field that feeds an <Area>; it must never surface in\n// the tooltip or legend (those describe only real, caller-supplied series).\nconst BAND_FIELD_PREFIX = '__band_';\n\n/**\n * Drop the synthetic delta-band range series from a recharts tooltip/legend\n * payload, keeping the real series (and their order). recharts already excludes\n * the band via `legendType`/`tooltipType=\"none\"`, so this is a second, explicit\n * guard — hence it's unit-tested rather than relying on that behavior.\n */\nexport function dropBandSeries<T extends { dataKey?: unknown }>(\n payload: readonly T[] | undefined\n): T[] | undefined {\n return payload?.filter(\n (item) => !String(item.dataKey).startsWith(BAND_FIELD_PREFIX)\n );\n}\n\ntype TooltipContentType = NonNullable<\n React.ComponentProps<typeof ChartTooltip>['content']\n>;\ntype TooltipContentFn = Extract<TooltipContentType, (...args: never[]) => unknown>;\ntype LegendContentFn = Extract<\n React.ComponentProps<typeof ChartLegend>['content'],\n (...args: never[]) => unknown\n>;\ntype LegendContentProps = Parameters<LegendContentFn>[0];\ntype TooltipRenderProps = Parameters<TooltipContentFn>[0];\n\n/**\n * Wrap a caller-supplied `tooltipContent` so the synthetic delta bands are\n * stripped from the payload before it renders, while preserving recharts' own\n * mount semantics — a function is mounted via `createElement` (its own component\n * identity + hook state), an element via `cloneElement`. This mirrors what the\n * pass-through charts get by handing `content` straight to recharts, so a\n * function-form tooltip keeps its state across re-renders here too. The returned\n * component is a stable content type (memoize it on `tooltipContent`).\n */\nexport function createBandStrippedTooltip(tooltipContent: TooltipContentType) {\n return function BandStrippedTooltip(props: TooltipRenderProps) {\n const merged = {\n ...props,\n payload: dropBandSeries(props.payload),\n } as TooltipRenderProps;\n if (typeof tooltipContent === 'function') {\n const Comp = tooltipContent as React.FunctionComponent<TooltipRenderProps>;\n return <Comp {...merged} />;\n }\n // Element-form tooltip: cloneElement is the React-idiomatic way to\n // re-render an existing element with new props (preserves refs & keys).\n return React.cloneElement(tooltipContent, merged);\n };\n}\n\nfunction createProjectionTooltip(tooltipContent: TooltipContentType) {\n return function ProjectionTooltip(props: TooltipRenderProps) {\n const merged = {\n ...props,\n payload: dropProjectionPayload(props.payload),\n } as TooltipRenderProps;\n if (typeof tooltipContent === 'function') {\n const Comp = tooltipContent as React.FunctionComponent<TooltipRenderProps>;\n return <Comp {...merged} />;\n }\n // Element-form tooltip: cloneElement is the React-idiomatic way to\n // re-render an existing element with new props (preserves refs & keys).\n return React.cloneElement(tooltipContent, merged);\n };\n}\n\n/**\n * Style override for one series, keyed by its `dataKeys` entry. Anything left\n * unset falls back to the chart-wide prop, so an entry only states what differs\n * — e.g. one thicker, dashed \"target\" line among otherwise identical series.\n *\n * A series listed in `comparisonKeys` keeps its dashed, dimmed, dot-less\n * treatment: `color`, `strokeWidth` and `curveType` still apply to it, but\n * `showDots` / `dotSize` do not (the overlay is defined by having no dots).\n */\nexport interface LineChartLineSettings {\n /** Stroke color. Defaults to the series' `config` color. */\n color?: string;\n /** Stroke width. Defaults to the chart's `strokeWidth`. */\n strokeWidth?: number;\n /** Dash this series' stroke, whatever the chart-wide `lineStyle` is. */\n dashed?: boolean;\n /** Interpolation for this series only. Defaults to the chart's `curve`. */\n curveType?: ChartCurveType;\n /** Render this series' per-point dots. Defaults to the chart's `showDots`. */\n showDots?: boolean;\n /** Dot radius for this series, in px. Defaults to the chart's `dotSize`. */\n dotSize?: number;\n /** Show/hide this series' value labels, overriding the chart's `showLabels`. */\n showLabel?: boolean;\n /** Position of this series' value labels. Defaults to the chart's `labelPosition`. */\n labelPosition?: CartesianLabelPosition;\n}\n\nexport interface LineChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof lineChartVariants>,\n CartesianChartProps,\n ChartAnimationProps,\n ChartBrushProps,\n ChartDataLabelProps {\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 /** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the line unless `connectNulls`). */\n data: ReadonlyArray<Record<string, string | number | null>>;\n /**\n * Per-series map of `label` / `icon` / `tone` (from the shared `Chart`\n * primitives). Series take their colour from the container's `palette`; each\n * entry maps a key to a `label` and an optional `tone`.\n */\n config: ChartConfig;\n /** Series to plot — one `<Line>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /**\n * Subset of `dataKeys` to render as comparison/trend overlays (e.g. a\n * previous quarter or year) — dashed, dimmed, and dot-less, so they read as\n * secondary to the current-period lines. Keeps each series' own `config` color.\n */\n comparisonKeys?: string[];\n /**\n * Pairs of `[currentKey, comparisonKey]` to shade a delta band between — a\n * dimmed area filling the gap between the two series at each point,\n * visualizing the QoQ/YoY difference. Tinted with the first key's `config`\n * color. Rows where either value isn't numeric are left un-banded.\n *\n * Each pair mints an internal `__band_<n>` field (kept out of the tooltip and\n * legend), so avoid data/`config` keys with that reserved prefix.\n */\n deltaBands?: Array<[string, string]>;\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /** Stroke width of each line. */\n strokeWidth?: number;\n /** Render a dot at each data point. */\n showDots?: boolean;\n /** Radius of each point's dot, in px. Its hover dot is 2px larger. */\n dotSize?: number;\n /**\n * Enlarge the hovered point's dot. Defaults to following `showDots`, so pass\n * it explicitly to get hover dots on a dot-less line (`showDots={false}`\n * with `showActiveDot`) or a static-only line (dots without the hover one).\n */\n showActiveDot?: boolean;\n /** Bridge `null` gaps in the data instead of breaking the line. */\n connectNulls?: boolean;\n /**\n * Per-series style overrides, keyed by `dataKeys` entry. Series with no entry\n * render from the chart-wide props.\n */\n lineSettings?: Record<string, LineChartLineSettings>;\n /**\n * One or more dashed reference/average lines on the value axis — a target, a\n * threshold, or a series mean. Pass a single object or an array to draw\n * several at once.\n */\n referenceLine?: ChartReferenceLine | ChartReferenceLine[];\n /**\n * The category value (matching an `xKey` entry) at which the projection\n * zone starts. Ticks from this point onward render in the disabled text\n * color (`--ui-text-on-surface-disabled`). The chart data and series\n * themselves are not affected — only the X-axis tick appearance changes.\n *\n * Use this when displaying a forecast/projection range where future\n * data points should be visually de-emphasized on the axis.\n */\n projectionStart?: string | number;\n showLegend?: boolean;\n /** Position of the value labels when `showLabels` is on. Defaults to `top`. */\n labelPosition?: CartesianLabelPosition;\n}\n\nconst LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(\n (\n {\n className,\n config,\n palette,\n data,\n dataKeys,\n comparisonKeys,\n deltaBands,\n xKey,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n curve = 'monotone',\n lineStyle = 'solid',\n strokeWidth = 2,\n showDots = false,\n dotSize = 3,\n showActiveDot,\n connectNulls = false,\n lineSettings,\n referenceLine,\n projectionStart,\n showGrid = true,\n showTooltip = true,\n showLegend = 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 showLabels = false,\n labelPosition,\n labelFormatter,\n showBrush = false,\n brushHeight,\n brushAriaLabel,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const lineLabelPosition = labelPosition ?? 'top';\n const yDomain = resolveAxisDomain(yAxisDomain);\n const referenceLines = toReferenceLineList(referenceLine);\n\n // A series' own `color` and `curveType` overrides also drive its delta band,\n // so the band keeps following the line it belongs to instead of the\n // chart-wide defaults.\n const colorFor = (key: string) =>\n lineSettings?.[key]?.color ?? `var(--color-${toCssKey(key)})`;\n const curveFor = (key: string) =>\n lineSettings?.[key]?.curveType ?? curve ?? 'monotone';\n\n // The plot inset is needed as soon as *any* series carries outside labels —\n // a per-series `showLabel` counts, not only the chart-wide `showLabels`.\n const hasLabels =\n showLabels ||\n Object.values(lineSettings ?? {}).some((settings) => settings.showLabel);\n\n const xAxisHeight = resolveXAxisHeight(xAxisLabel, xAxisAngle);\n\n const projStartIndex = React.useMemo(() => {\n if (projectionStart === undefined) return -1;\n return data.findIndex((row) => row[xKey] === projectionStart);\n }, [projectionStart, data, xKey]);\n // projStartIndex === 0 (boundary at the first tick) is excluded: there is no\n // \"previous tick\" to define the clip midpoint, so clipPath defs can't be\n // emitted, which would make all series invisible. Treat it as no-projection.\n const hasProjection = projStartIndex > 0;\n\n // Build the projection tick renderer when projectionStart is set. Each tick\n // past (and including) the start value renders in the disabled text color;\n // ticks before it stay in the muted-foreground color. Returns undefined when\n // projectionStart is absent or not found so recharts uses its own renderer.\n const projectionTick = React.useMemo(() => {\n if (!hasProjection) return undefined;\n const projectedValues = new Set(\n data.slice(projStartIndex).map((row) => row[xKey])\n );\n const ProjectionTick = ({\n payload,\n index,\n ...tickProps\n }: {\n payload: { value: string | number };\n index?: number;\n [key: string]: unknown;\n }) => (\n <Text\n {...(tickProps as React.ComponentProps<typeof Text>)}\n fontSize={12}\n className={\n projectedValues.has(payload.value)\n ? 'fill-[var(--ui-text-on-surface-disabled)]'\n : 'fill-muted-foreground'\n }\n >\n {xTickFormatter\n ? xTickFormatter(payload.value as never, index)\n : payload.value}\n </Text>\n );\n return ProjectionTick;\n }, [hasProjection, projStartIndex, data, xKey, xTickFormatter]);\n\n // When projection is active, copy each series value to `_proj_${key}` — same\n // data, no nulls. Both the actual and projection <Line> see the identical curve;\n // the clipPath (computed in ProjectionClip) restricts which half each paints.\n const projectionData = React.useMemo(() => {\n if (!hasProjection) return data;\n return data.map((row) => ({\n ...row,\n ...Object.fromEntries(\n dataKeys.map((k) => [`_proj_${k}`, row[k]])\n ),\n }));\n }, [hasProjection, data, dataKeys]);\n\n // The tick immediately before the projection boundary — needed to compute the\n // visual midpoint where the clip edge and separator line are placed.\n const prevTickValue = React.useMemo(() => {\n if (projStartIndex <= 0) return undefined;\n return data[projStartIndex - 1]?.[xKey];\n }, [projStartIndex, data, xKey]);\n\n const clipId = `line-proj-${React.useId().replace(/:/g, '')}`;\n\n // Memoized so recharts sees a stable content type across renders — a fresh\n // wrapper each render would remount the caller's tooltip and reset its state.\n const customTooltip = React.useMemo(() => {\n if (!tooltipContent) return undefined;\n const bandStripped = createBandStrippedTooltip(tooltipContent);\n return hasProjection ? createProjectionTooltip(bandStripped) : bandStripped;\n }, [tooltipContent, hasProjection]);\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n // Each delta band becomes a synthetic `[min, max]` range field per row that\n // a recharts <Area> shades. Rows where either series isn't numeric are left\n // un-banded (the area breaks there).\n const bands = (deltaBands ?? []).map(([current, comparison], index) => ({\n field: `${BAND_FIELD_PREFIX}${index}`,\n current,\n comparison,\n }));\n\n // A delta band is a synthetic `__band_*` series feeding an <Area>, not a\n // trend of its own — so it has to be stripped from the tooltip rows and the\n // legend entries before either is rendered. A caller's own tooltip is\n // already wrapped for that above; these cover the two default contents.\n const hasBands = bands.length > 0;\n const tooltipNode =\n customTooltip ??\n (hasBands || hasProjection ? (\n (props: TooltipRenderProps) => (\n <ChartTooltipContent\n active={props.active}\n label={props.label}\n payload={\n dropProjectionPayload(\n dropBandSeries(props.payload)\n ) as ChartTooltipContentProps['payload']\n }\n />\n )\n ) : (\n <ChartTooltipContent />\n ));\n const legendNode = hasBands || hasProjection ? (\n (props: LegendContentProps) => (\n <ChartLegendContent\n verticalAlign={props.verticalAlign}\n payload={\n dropProjectionPayload(\n dropBandSeries(props.payload)\n ) as ChartLegendContentProps['payload']\n }\n />\n )\n ) : (\n <ChartLegendContent />\n );\n // Bands are computed over the full (projection-augmented) rows; when\n // projection is active the band <Area> is clipped to the actual zone.\n const chartData = bands.length\n ? projectionData.map((row) => {\n const augmented: Record<string, unknown> = { ...row };\n for (const { field, current, comparison } of bands) {\n const a = row[current];\n const b = row[comparison];\n augmented[field] =\n typeof a === 'number' && typeof b === 'number'\n ? [Math.min(a, b), Math.max(a, b)]\n : undefined;\n }\n return augmented;\n })\n : projectionData;\n\n // Only a delta band needs an <Area>, which recharts renders under\n // ComposedChart, not LineChart. Escalate to ComposedChart only then, so\n // plain line charts keep the LineChart base (and their baselines) untouched.\n const RootChart = bands.length > 0 ? ComposedChart : RechartsLineChart;\n\n return (\n <div\n ref={ref}\n data-curve={curve}\n data-line-style={lineStyle}\n className={cn(lineChartVariants({ curve, lineStyle }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n palette={palette}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RootChart\n data={chartData as readonly unknown[]}\n margin={hasLabels ? CHART_LABEL_MARGIN : undefined}\n >\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? false}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={projectionTick ? undefined : xTickFormatter}\n tick={projectionTick}\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 unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && <ChartTooltip content={tooltipNode} />}\n {showLegend && <ChartLegend content={legendNode} />}\n {hasProjection && prevTickValue != null && (\n <ProjectionClip\n projectionStart={projectionStart!}\n prevTick={prevTickValue}\n clipId={clipId}\n dataKeys={dataKeys}\n />\n )}\n {/* Delta bands render before the lines so the lines draw on top.\n When projection is active, clip bands to the actual zone — the\n comparison series they measure against is absent past the\n boundary, so an unclipped band would shade a region with no\n visible far edge. */}\n {bands.map(({ field, current }) => (\n <Area\n key={field}\n dataKey={field}\n // An <Area> takes one interpolation, so a pair whose two series\n // set different `curveType`s can only follow the current one.\n type={curveFor(current)}\n stroke=\"none\"\n fill={colorFor(current)}\n fillOpacity={0.12}\n connectNulls={connectNulls}\n dot={false}\n activeDot={false}\n clipPath={hasProjection ? `url(#${clipId}-actual)` : undefined}\n {...animation}\n legendType=\"none\"\n tooltipType=\"none\"\n />\n ))}\n {dataKeys.map((key, index) => {\n // Comparison series read as secondary: always dashed, dimmed, and\n // dot-less, regardless of the global lineStyle / showDots.\n const isComparison = comparisonKeys?.includes(key);\n const settings = lineSettings?.[key];\n const seriesDots =\n !isComparison && (settings?.showDots ?? showDots);\n const dotRadius = settings?.dotSize ?? dotSize;\n // The hover dot follows the static dots unless asked otherwise, so\n // a chart that sets neither renders exactly as before.\n const activeDot = !isComparison && (showActiveDot ?? seriesDots);\n const seriesDashed = settings?.dashed ?? lineStyle === 'dashed';\n const seriesLabel = settings?.showLabel ?? showLabels;\n const seriesLabelPosition =\n settings?.labelPosition ?? lineLabelPosition;\n // Comparison series have no projection counterpart — they render\n // unclipped across the full width so they don't vanish at the\n // projection boundary.\n return (\n <Line\n key={key}\n className={hasProjection && !isComparison ? `actual-${clipId}-${index}` : undefined}\n type={curveFor(key)}\n dataKey={key}\n stroke={colorFor(key)}\n strokeWidth={settings?.strokeWidth ?? strokeWidth}\n strokeDasharray={isComparison || seriesDashed ? '5 5' : undefined}\n strokeOpacity={isComparison ? 0.5 : undefined}\n dot={seriesDots ? { r: dotRadius } : false}\n activeDot={activeDot ? { r: dotRadius + 2 } : false}\n connectNulls={connectNulls}\n {...animation}\n >\n {seriesLabel && (\n <LabelList\n dataKey={key}\n position={seriesLabelPosition}\n formatter={toLabelFormatter(labelFormatter)}\n className={resolveLabelFillClass(seriesLabelPosition)}\n fontSize={CHART_LABEL_FONT_SIZE}\n />\n )}\n </Line>\n );\n })}\n {hasProjection &&\n dataKeys.map((key, index) => {\n const isComparison = comparisonKeys?.includes(key);\n if (isComparison) return null;\n const settings = lineSettings?.[key];\n return (\n <Line\n key={`_proj_${key}`}\n className={`proj-${clipId}-${index}`}\n type={curveFor(key)}\n dataKey={`_proj_${key}`}\n name={key}\n stroke={colorFor(key)}\n strokeWidth={settings?.strokeWidth ?? strokeWidth}\n strokeDasharray=\"5 5\"\n dot={false}\n activeDot={false}\n legendType=\"none\"\n tooltipType=\"none\"\n {...animation}\n />\n );\n })}\n {/* Annotations draw over the series they describe. */}\n {referenceLines.map((ref, index) => {\n const value = resolveChartReferenceValue(ref, data, dataKeys);\n if (value === undefined) return null;\n return (\n <ReferenceLine\n key={`${ref.label ?? 'ref'}-${index}`}\n y={value}\n {...resolveReferenceLineProps(ref.label, ref.labelPosition)}\n />\n );\n })}\n {showBrush && (\n <Brush\n dataKey={xKey}\n tickFormatter={xTickFormatter}\n {...resolveBrushProps({ brushHeight, brushAriaLabel })}\n />\n )}\n </RootChart>\n </ChartContainer>\n </div>\n );\n }\n);\nLineChart.displayName = 'LineChart';\n\nexport { LineChart, lineChartVariants };\n"],"mappings":";;;;;;;;;AAoEA,IAAM,IAAoB,EAAI,IAAI;CAChC,UAAU;EACR,OAAO;GACL,QAAQ;GACR,UAAU;GACV,SAAS;GACT,OAAO;GACP,MAAM;GACN,YAAY;GACZ,WAAW;EACb;EACA,WAAW;GACT,OAAO;GACP,QAAQ;EACV;CACF;CACA,iBAAiB;EACf,OAAO;EACP,WAAW;CACb;AACF,CAAC;AAcD,SAAS,GAAe,EACtB,oBACA,aACA,WACA,eAMC;CACD,IAAM,IAAS,EAAc,GACvB,IAAW,EAAY;CAC7B,IAAI,CAAC,KAAU,CAAC,GAAU,OAAO;CACjC,IAAM,IAAQ,EAAO,CAAkB,GACjC,IAAQ,EAAO,CAAyB;CAC9C,IAAI,KAAS,QAAQ,KAAS,MAAM,OAAO;CAC3C,IAAM,KAAQ,IAAQ,KAAS,GACzB,EAAE,MAAG,MAAG,UAAO,cAAW,GAC1B,IAAM,EACT,KACE,GAAG,MACF,WAAW,EAAO,GAAG,EAAE,kBAAkB,EAAO,iBACvC,EAAO,GAAG,EAAE,kBAAkB,EAAO,cAClD,CAAC,CACA,KAAK,EAAE;CACV,OACE,kBAAA,GAAA,EAAA,UAAA;EACE,kBAAC,QAAD,EAAA,UAAA,CACE,kBAAC,YAAD;GAAU,IAAI,GAAG,EAAO;GACtB,UAAA,kBAAC,QAAD;IAAS;IAAM;IAAG,OAAO,IAAO;IAAW;GAAS,CAAA;EAC5C,CAAA,GACV,kBAAC,YAAD;GAAU,IAAI,GAAG,EAAO;GACtB,UAAA,kBAAC,QAAD;IAAM,GAAG;IAAS;IAAG,OAAO,IAAI,IAAQ;IAAc;GAAS,CAAA;EACvD,CAAA,CACN,EAAA,CAAA;EACN,kBAAC,SAAD,EAAA,UAAQ,EAAW,CAAA;EACnB,kBAAC,QAAD;GACE,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,I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../../src/components/ui/line-chart/line-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Area,\n Brush,\n CartesianGrid,\n ComposedChart,\n LabelList,\n Line,\n LineChart as RechartsLineChart,\n ReferenceLine,\n Text,\n XAxis,\n YAxis,\n useXAxisScale,\n usePlotArea,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n CHART_LABEL_FONT_SIZE,\n CHART_LABEL_MARGIN,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveBrushProps,\n dropProjectionPayload,\n resolveChartReferenceValue,\n resolveLabelFillClass,\n resolveReferenceLineProps,\n resolveRotatedTickAnchor,\n resolveXAxisTitle,\n resolveYAxisTitle,\n toLabelFormatter,\n toReferenceLineList,\n type ChartConfig,\n type ChartPalette,\n type ChartLegendContentProps,\n type ChartTooltipContentProps,\n type CartesianChartProps,\n type ChartAnimationProps,\n type ChartBrushProps,\n type ChartCurveType,\n type ChartDataLabelProps,\n toCssKey,\n type ChartReferenceLine,\n type CartesianLabelPosition,\n} from '../chart';\nimport {\n mergeXAxisLayoutMargin,\n useXAxisLayout,\n} from '../chart/use-x-axis-layout';\nimport { resolveXAxisTickLabels } from '../chart/chart-format';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Line-chart variant set: `curve` (how the segments\n// interpolate between points — straight, smoothed, or stepped; the seven values\n// are documented on the shared `ChartCurveType`) and `lineStyle` (a solid or\n// dashed stroke). \"single\" vs \"multi\" line is not a variant — it\n// falls out of how many `dataKeys` the caller plots. The classes stay empty\n// because recharts' SVG — not CSS — draws the lines: `curve` drives each\n// `<Line type>` and `lineStyle` drives its `strokeDasharray`. CVA is kept so the\n// variant set is a first-class, spec-conformant part of the API (matched against\n// ui-spec's api.yaml enums) and exposed via `VariantProps`; the resolved values\n// are also mirrored onto `data-curve` / `data-line-style` for styling hooks and\n// tests.\nconst lineChartVariants = cva('', {\n variants: {\n curve: {\n linear: '',\n monotone: '',\n natural: '',\n basis: '',\n step: '',\n stepBefore: '',\n stepAfter: '',\n },\n lineStyle: {\n solid: '',\n dashed: '',\n },\n },\n defaultVariants: {\n curve: 'monotone',\n lineStyle: 'solid',\n },\n});\n\n// Renders two <clipPath> defs (actual / projection), a CSS <style> that clips\n// each recharts Line layer to its half, and a dashed separator line at the\n// visual midpoint between the last actual tick and the first projection tick.\n//\n// recharts' StaticCurve explicitly overwrites any clipPath prop passed to\n// <Line> with its own plot-area URL, so the prop-based approach used by\n// <Area> cannot be used here. Instead we apply CSS clip-path to the outer <g>\n// that recharts wraps each Line series in (targeted via a unique className we\n// set on the <Line> component). CSS clip-path on a class selector (specificity\n// 0,1,0) beats the SVG presentation attribute recharts sets on the inner\n// <path> (specificity 0), so the two clips compose: outer = our half, inner =\n// recharts' plot-area — net effect is the correct half within the plot area.\nfunction ProjectionClip({\n projectionStart,\n prevTick,\n clipId,\n dataKeys,\n}: {\n projectionStart: string | number;\n prevTick: string | number;\n clipId: string;\n dataKeys: string[];\n}) {\n const xScale = useXAxisScale();\n const plotArea = usePlotArea();\n if (!xScale || !plotArea) return null;\n const prevX = xScale(prevTick as string);\n const currX = xScale(projectionStart as string);\n if (prevX == null || currX == null) return null;\n const midX = (prevX + currX) / 2;\n const { x, y, width, height } = plotArea;\n const css = dataKeys\n .map(\n (_, i) =>\n `.actual-${clipId}-${i}{clip-path:url(#${clipId}-actual)}` +\n `.proj-${clipId}-${i}{clip-path:url(#${clipId}-projection)}`\n )\n .join('');\n return (\n <>\n <defs>\n <clipPath id={`${clipId}-actual`}>\n <rect x={x} y={y} width={midX - x} height={height} />\n </clipPath>\n <clipPath id={`${clipId}-projection`}>\n <rect x={midX} y={y} width={x + width - midX} height={height} />\n </clipPath>\n </defs>\n <style>{css}</style>\n <line\n x1={midX}\n y1={y}\n x2={midX}\n y2={y + height}\n stroke=\"var(--ui-border-on-surface-border)\"\n strokeDasharray=\"4 4\"\n />\n </>\n );\n}\n\n// Reserved field prefix for the synthetic delta-band range series. Each band\n// mints one `__band_<n>` field that feeds an <Area>; it must never surface in\n// the tooltip or legend (those describe only real, caller-supplied series).\nconst BAND_FIELD_PREFIX = '__band_';\n\n/**\n * Drop the synthetic delta-band range series from a recharts tooltip/legend\n * payload, keeping the real series (and their order). recharts already excludes\n * the band via `legendType`/`tooltipType=\"none\"`, so this is a second, explicit\n * guard — hence it's unit-tested rather than relying on that behavior.\n */\nexport function dropBandSeries<T extends { dataKey?: unknown }>(\n payload: readonly T[] | undefined\n): T[] | undefined {\n return payload?.filter(\n (item) => !String(item.dataKey).startsWith(BAND_FIELD_PREFIX)\n );\n}\n\ntype TooltipContentType = NonNullable<\n React.ComponentProps<typeof ChartTooltip>['content']\n>;\ntype TooltipContentFn = Extract<TooltipContentType, (...args: never[]) => unknown>;\ntype LegendContentFn = Extract<\n React.ComponentProps<typeof ChartLegend>['content'],\n (...args: never[]) => unknown\n>;\ntype LegendContentProps = Parameters<LegendContentFn>[0];\ntype TooltipRenderProps = Parameters<TooltipContentFn>[0];\n\n/**\n * Wrap a caller-supplied `tooltipContent` so the synthetic delta bands are\n * stripped from the payload before it renders, while preserving recharts' own\n * mount semantics — a function is mounted via `createElement` (its own component\n * identity + hook state), an element via `cloneElement`. This mirrors what the\n * pass-through charts get by handing `content` straight to recharts, so a\n * function-form tooltip keeps its state across re-renders here too. The returned\n * component is a stable content type (memoize it on `tooltipContent`).\n */\nexport function createBandStrippedTooltip(tooltipContent: TooltipContentType) {\n return function BandStrippedTooltip(props: TooltipRenderProps) {\n const merged = {\n ...props,\n payload: dropBandSeries(props.payload),\n } as TooltipRenderProps;\n if (typeof tooltipContent === 'function') {\n const Comp = tooltipContent as React.FunctionComponent<TooltipRenderProps>;\n return <Comp {...merged} />;\n }\n // Element-form tooltip: cloneElement is the React-idiomatic way to\n // re-render an existing element with new props (preserves refs & keys).\n return React.cloneElement(tooltipContent, merged);\n };\n}\n\nfunction createProjectionTooltip(tooltipContent: TooltipContentType) {\n return function ProjectionTooltip(props: TooltipRenderProps) {\n const merged = {\n ...props,\n payload: dropProjectionPayload(props.payload),\n } as TooltipRenderProps;\n if (typeof tooltipContent === 'function') {\n const Comp = tooltipContent as React.FunctionComponent<TooltipRenderProps>;\n return <Comp {...merged} />;\n }\n // Element-form tooltip: cloneElement is the React-idiomatic way to\n // re-render an existing element with new props (preserves refs & keys).\n return React.cloneElement(tooltipContent, merged);\n };\n}\n\n/**\n * Style override for one series, keyed by its `dataKeys` entry. Anything left\n * unset falls back to the chart-wide prop, so an entry only states what differs\n * — e.g. one thicker, dashed \"target\" line among otherwise identical series.\n *\n * A series listed in `comparisonKeys` keeps its dashed, dimmed, dot-less\n * treatment: `color`, `strokeWidth` and `curveType` still apply to it, but\n * `showDots` / `dotSize` do not (the overlay is defined by having no dots).\n */\nexport interface LineChartLineSettings {\n /** Stroke color. Defaults to the series' `config` color. */\n color?: string;\n /** Stroke width. Defaults to the chart's `strokeWidth`. */\n strokeWidth?: number;\n /** Dash this series' stroke, whatever the chart-wide `lineStyle` is. */\n dashed?: boolean;\n /** Interpolation for this series only. Defaults to the chart's `curve`. */\n curveType?: ChartCurveType;\n /** Render this series' per-point dots. Defaults to the chart's `showDots`. */\n showDots?: boolean;\n /** Dot radius for this series, in px. Defaults to the chart's `dotSize`. */\n dotSize?: number;\n /** Show/hide this series' value labels, overriding the chart's `showLabels`. */\n showLabel?: boolean;\n /** Position of this series' value labels. Defaults to the chart's `labelPosition`. */\n labelPosition?: CartesianLabelPosition;\n}\n\nexport interface LineChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof lineChartVariants>,\n CartesianChartProps,\n ChartAnimationProps,\n ChartBrushProps,\n ChartDataLabelProps {\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 /** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the line unless `connectNulls`). */\n data: ReadonlyArray<Record<string, string | number | null>>;\n /**\n * Per-series map of `label` / `icon` / `tone` (from the shared `Chart`\n * primitives). Series take their colour from the container's `palette`; each\n * entry maps a key to a `label` and an optional `tone`.\n */\n config: ChartConfig;\n /** Series to plot — one `<Line>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /**\n * Subset of `dataKeys` to render as comparison/trend overlays (e.g. a\n * previous quarter or year) — dashed, dimmed, and dot-less, so they read as\n * secondary to the current-period lines. Keeps each series' own `config` color.\n */\n comparisonKeys?: string[];\n /**\n * Pairs of `[currentKey, comparisonKey]` to shade a delta band between — a\n * dimmed area filling the gap between the two series at each point,\n * visualizing the QoQ/YoY difference. Tinted with the first key's `config`\n * color. Rows where either value isn't numeric are left un-banded.\n *\n * Each pair mints an internal `__band_<n>` field (kept out of the tooltip and\n * legend), so avoid data/`config` keys with that reserved prefix.\n */\n deltaBands?: Array<[string, string]>;\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /** Stroke width of each line. */\n strokeWidth?: number;\n /** Render a dot at each data point. */\n showDots?: boolean;\n /** Radius of each point's dot, in px. Its hover dot is 2px larger. */\n dotSize?: number;\n /**\n * Enlarge the hovered point's dot. Defaults to following `showDots`, so pass\n * it explicitly to get hover dots on a dot-less line (`showDots={false}`\n * with `showActiveDot`) or a static-only line (dots without the hover one).\n */\n showActiveDot?: boolean;\n /** Bridge `null` gaps in the data instead of breaking the line. */\n connectNulls?: boolean;\n /**\n * Per-series style overrides, keyed by `dataKeys` entry. Series with no entry\n * render from the chart-wide props.\n */\n lineSettings?: Record<string, LineChartLineSettings>;\n /**\n * One or more dashed reference/average lines on the value axis — a target, a\n * threshold, or a series mean. Pass a single object or an array to draw\n * several at once.\n */\n referenceLine?: ChartReferenceLine | ChartReferenceLine[];\n /**\n * The category value (matching an `xKey` entry) at which the projection\n * zone starts. Ticks from this point onward render in the disabled text\n * color (`--ui-text-on-surface-disabled`). The chart data and series\n * themselves are not affected — only the X-axis tick appearance changes.\n *\n * Use this when displaying a forecast/projection range where future\n * data points should be visually de-emphasized on the axis.\n */\n projectionStart?: string | number;\n showLegend?: boolean;\n /** Position of the value labels when `showLabels` is on. Defaults to `top`. */\n labelPosition?: CartesianLabelPosition;\n}\n\nconst LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(\n (\n {\n className,\n config,\n palette,\n data,\n dataKeys,\n comparisonKeys,\n deltaBands,\n xKey,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n curve = 'monotone',\n lineStyle = 'solid',\n strokeWidth = 2,\n showDots = false,\n dotSize = 3,\n showActiveDot,\n connectNulls = false,\n lineSettings,\n referenceLine,\n projectionStart,\n showGrid = true,\n showTooltip = true,\n showLegend = 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 showLabels = false,\n labelPosition,\n labelFormatter,\n showBrush = false,\n brushHeight,\n brushAriaLabel,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const lineLabelPosition = labelPosition ?? 'top';\n const yDomain = resolveAxisDomain(yAxisDomain);\n const referenceLines = toReferenceLineList(referenceLine);\n\n // A series' own `color` and `curveType` overrides also drive its delta band,\n // so the band keeps following the line it belongs to instead of the\n // chart-wide defaults.\n const colorFor = (key: string) =>\n lineSettings?.[key]?.color ?? `var(--color-${toCssKey(key)})`;\n const curveFor = (key: string) =>\n lineSettings?.[key]?.curveType ?? curve ?? 'monotone';\n\n // The plot inset is needed as soon as *any* series carries outside labels —\n // a per-series `showLabel` counts, not only the chart-wide `showLabels`.\n const hasLabels =\n showLabels ||\n Object.values(lineSettings ?? {}).some((settings) => settings.showLabel);\n\n const xAxisTickLabels = resolveXAxisTickLabels(\n data.map((row) => row[xKey]),\n xTickFormatter\n );\n const chartContainerRef = React.useRef<HTMLDivElement>(null);\n const xAxisLayout = useXAxisLayout(\n chartContainerRef,\n xAxisAngle,\n xAxisLabel,\n xAxisTickLabels.join('\\u0000')\n );\n const chartMargin = mergeXAxisLayoutMargin(\n hasLabels ? CHART_LABEL_MARGIN : undefined,\n xAxisLayout.margin\n );\n\n const projStartIndex = React.useMemo(() => {\n if (projectionStart === undefined) return -1;\n return data.findIndex((row) => row[xKey] === projectionStart);\n }, [projectionStart, data, xKey]);\n // projStartIndex === 0 (boundary at the first tick) is excluded: there is no\n // \"previous tick\" to define the clip midpoint, so clipPath defs can't be\n // emitted, which would make all series invisible. Treat it as no-projection.\n const hasProjection = projStartIndex > 0;\n\n // Build the projection tick renderer when projectionStart is set. Each tick\n // past (and including) the start value renders in the disabled text color;\n // ticks before it stay in the muted-foreground color. Returns undefined when\n // projectionStart is absent or not found so recharts uses its own renderer.\n const projectionTick = React.useMemo(() => {\n if (!hasProjection) return undefined;\n const projectedValues = new Set(\n data.slice(projStartIndex).map((row) => row[xKey])\n );\n const ProjectionTick = ({\n payload,\n index,\n ...tickProps\n }: {\n payload: { value: string | number };\n index?: number;\n [key: string]: unknown;\n }) => (\n <Text\n {...(tickProps as React.ComponentProps<typeof Text>)}\n fontSize={12}\n className={\n projectedValues.has(payload.value)\n ? 'fill-[var(--ui-text-on-surface-disabled)]'\n : 'fill-muted-foreground'\n }\n >\n {xTickFormatter\n ? xTickFormatter(payload.value as never, index)\n : payload.value}\n </Text>\n );\n return ProjectionTick;\n }, [hasProjection, projStartIndex, data, xKey, xTickFormatter]);\n\n // When projection is active, copy each series value to `_proj_${key}` — same\n // data, no nulls. Both the actual and projection <Line> see the identical curve;\n // the clipPath (computed in ProjectionClip) restricts which half each paints.\n const projectionData = React.useMemo(() => {\n if (!hasProjection) return data;\n return data.map((row) => ({\n ...row,\n ...Object.fromEntries(\n dataKeys.map((k) => [`_proj_${k}`, row[k]])\n ),\n }));\n }, [hasProjection, data, dataKeys]);\n\n // The tick immediately before the projection boundary — needed to compute the\n // visual midpoint where the clip edge and separator line are placed.\n const prevTickValue = React.useMemo(() => {\n if (projStartIndex <= 0) return undefined;\n return data[projStartIndex - 1]?.[xKey];\n }, [projStartIndex, data, xKey]);\n\n const clipId = `line-proj-${React.useId().replace(/:/g, '')}`;\n\n // Memoized so recharts sees a stable content type across renders — a fresh\n // wrapper each render would remount the caller's tooltip and reset its state.\n const customTooltip = React.useMemo(() => {\n if (!tooltipContent) return undefined;\n const bandStripped = createBandStrippedTooltip(tooltipContent);\n return hasProjection ? createProjectionTooltip(bandStripped) : bandStripped;\n }, [tooltipContent, hasProjection]);\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n // Each delta band becomes a synthetic `[min, max]` range field per row that\n // a recharts <Area> shades. Rows where either series isn't numeric are left\n // un-banded (the area breaks there).\n const bands = (deltaBands ?? []).map(([current, comparison], index) => ({\n field: `${BAND_FIELD_PREFIX}${index}`,\n current,\n comparison,\n }));\n\n // A delta band is a synthetic `__band_*` series feeding an <Area>, not a\n // trend of its own — so it has to be stripped from the tooltip rows and the\n // legend entries before either is rendered. A caller's own tooltip is\n // already wrapped for that above; these cover the two default contents.\n const hasBands = bands.length > 0;\n const tooltipNode =\n customTooltip ??\n (hasBands || hasProjection ? (\n (props: TooltipRenderProps) => (\n <ChartTooltipContent\n active={props.active}\n label={props.label}\n payload={\n dropProjectionPayload(\n dropBandSeries(props.payload)\n ) as ChartTooltipContentProps['payload']\n }\n />\n )\n ) : (\n <ChartTooltipContent />\n ));\n const legendNode = hasBands || hasProjection ? (\n (props: LegendContentProps) => (\n <ChartLegendContent\n verticalAlign={props.verticalAlign}\n payload={\n dropProjectionPayload(\n dropBandSeries(props.payload)\n ) as ChartLegendContentProps['payload']\n }\n />\n )\n ) : (\n <ChartLegendContent />\n );\n // Bands are computed over the full (projection-augmented) rows; when\n // projection is active the band <Area> is clipped to the actual zone.\n const chartData = bands.length\n ? projectionData.map((row) => {\n const augmented: Record<string, unknown> = { ...row };\n for (const { field, current, comparison } of bands) {\n const a = row[current];\n const b = row[comparison];\n augmented[field] =\n typeof a === 'number' && typeof b === 'number'\n ? [Math.min(a, b), Math.max(a, b)]\n : undefined;\n }\n return augmented;\n })\n : projectionData;\n\n // Only a delta band needs an <Area>, which recharts renders under\n // ComposedChart, not LineChart. Escalate to ComposedChart only then, so\n // plain line charts keep the LineChart base (and their baselines) untouched.\n const RootChart = bands.length > 0 ? ComposedChart : RechartsLineChart;\n\n return (\n <div\n ref={ref}\n data-curve={curve}\n data-line-style={lineStyle}\n className={cn(lineChartVariants({ curve, lineStyle }), className)}\n {...props}\n >\n <ChartContainer\n ref={chartContainerRef}\n config={config}\n palette={palette}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RootChart\n data={chartData as readonly unknown[]}\n margin={chartMargin}\n >\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? false}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={projectionTick ? undefined : xTickFormatter}\n tick={projectionTick}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n height={xAxisLayout.height}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && <ChartTooltip content={tooltipNode} />}\n {showLegend && <ChartLegend content={legendNode} />}\n {hasProjection && prevTickValue != null && (\n <ProjectionClip\n projectionStart={projectionStart!}\n prevTick={prevTickValue}\n clipId={clipId}\n dataKeys={dataKeys}\n />\n )}\n {/* Delta bands render before the lines so the lines draw on top.\n When projection is active, clip bands to the actual zone — the\n comparison series they measure against is absent past the\n boundary, so an unclipped band would shade a region with no\n visible far edge. */}\n {bands.map(({ field, current }) => (\n <Area\n key={field}\n dataKey={field}\n // An <Area> takes one interpolation, so a pair whose two series\n // set different `curveType`s can only follow the current one.\n type={curveFor(current)}\n stroke=\"none\"\n fill={colorFor(current)}\n fillOpacity={0.12}\n connectNulls={connectNulls}\n dot={false}\n activeDot={false}\n clipPath={hasProjection ? `url(#${clipId}-actual)` : undefined}\n {...animation}\n legendType=\"none\"\n tooltipType=\"none\"\n />\n ))}\n {dataKeys.map((key, index) => {\n // Comparison series read as secondary: always dashed, dimmed, and\n // dot-less, regardless of the global lineStyle / showDots.\n const isComparison = comparisonKeys?.includes(key);\n const settings = lineSettings?.[key];\n const seriesDots =\n !isComparison && (settings?.showDots ?? showDots);\n const dotRadius = settings?.dotSize ?? dotSize;\n // The hover dot follows the static dots unless asked otherwise, so\n // a chart that sets neither renders exactly as before.\n const activeDot = !isComparison && (showActiveDot ?? seriesDots);\n const seriesDashed = settings?.dashed ?? lineStyle === 'dashed';\n const seriesLabel = settings?.showLabel ?? showLabels;\n const seriesLabelPosition =\n settings?.labelPosition ?? lineLabelPosition;\n // Comparison series have no projection counterpart — they render\n // unclipped across the full width so they don't vanish at the\n // projection boundary.\n return (\n <Line\n key={key}\n className={hasProjection && !isComparison ? `actual-${clipId}-${index}` : undefined}\n type={curveFor(key)}\n dataKey={key}\n stroke={colorFor(key)}\n strokeWidth={settings?.strokeWidth ?? strokeWidth}\n strokeDasharray={isComparison || seriesDashed ? '5 5' : undefined}\n strokeOpacity={isComparison ? 0.5 : undefined}\n dot={seriesDots ? { r: dotRadius } : false}\n activeDot={activeDot ? { r: dotRadius + 2 } : false}\n connectNulls={connectNulls}\n {...animation}\n >\n {seriesLabel && (\n <LabelList\n dataKey={key}\n position={seriesLabelPosition}\n formatter={toLabelFormatter(labelFormatter)}\n className={resolveLabelFillClass(seriesLabelPosition)}\n fontSize={CHART_LABEL_FONT_SIZE}\n />\n )}\n </Line>\n );\n })}\n {hasProjection &&\n dataKeys.map((key, index) => {\n const isComparison = comparisonKeys?.includes(key);\n if (isComparison) return null;\n const settings = lineSettings?.[key];\n return (\n <Line\n key={`_proj_${key}`}\n className={`proj-${clipId}-${index}`}\n type={curveFor(key)}\n dataKey={`_proj_${key}`}\n name={key}\n stroke={colorFor(key)}\n strokeWidth={settings?.strokeWidth ?? strokeWidth}\n strokeDasharray=\"5 5\"\n dot={false}\n activeDot={false}\n legendType=\"none\"\n tooltipType=\"none\"\n {...animation}\n />\n );\n })}\n {/* Annotations draw over the series they describe. */}\n {referenceLines.map((ref, index) => {\n const value = resolveChartReferenceValue(ref, data, dataKeys);\n if (value === undefined) return null;\n return (\n <ReferenceLine\n key={`${ref.label ?? 'ref'}-${index}`}\n y={value}\n {...resolveReferenceLineProps(ref.label, ref.labelPosition)}\n />\n );\n })}\n {showBrush && (\n <Brush\n dataKey={xKey}\n tickFormatter={xTickFormatter}\n {...resolveBrushProps({ brushHeight, brushAriaLabel })}\n />\n )}\n </RootChart>\n </ChartContainer>\n </div>\n );\n }\n);\nLineChart.displayName = 'LineChart';\n\nexport { LineChart, lineChartVariants };\n"],"mappings":";;;;;;;;;;AAwEA,IAAM,IAAoB,EAAI,IAAI;CAChC,UAAU;EACR,OAAO;GACL,QAAQ;GACR,UAAU;GACV,SAAS;GACT,OAAO;GACP,MAAM;GACN,YAAY;GACZ,WAAW;EACb;EACA,WAAW;GACT,OAAO;GACP,QAAQ;EACV;CACF;CACA,iBAAiB;EACf,OAAO;EACP,WAAW;CACb;AACF,CAAC;AAcD,SAAS,GAAe,EACtB,oBACA,aACA,WACA,eAMC;CACD,IAAM,IAAS,EAAc,GAC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