@lilt-ui/charts 0.12.1 → 0.12.2
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/CHANGELOG.md +270 -262
- package/dist/finance.js +2 -2
- package/dist/index.js +2 -2
- package/dist/interaction/comparison-layer.d.ts +3 -1
- package/dist/{report-context-DLA3I57K.js → report-context-CIUa6iiD.js} +1 -0
- package/dist/{skeleton-block-ClcPgFdK.js → skeleton-block-DIgcA9t6.js} +476 -371
- package/dist/styles.css +1 -1
- package/dist/watch.js +1 -1
- package/package.json +85 -85
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, a as t, b as n, d as r, f as i, g as a, h as o, i as s, m as c, n as l, o as u, p as d, s as f, t as p, u as m, w as h, x as g, y as _ } from "./report-context-
|
|
1
|
+
import { C as e, a as t, b as n, d as r, f as i, g as a, h as o, i as s, m as c, n as l, o as u, p as d, s as f, t as p, u as m, w as h, x as g, y as _ } from "./report-context-CIUa6iiD.js";
|
|
2
2
|
import { t as v } from "./chart-data-CCwLQeXa.js";
|
|
3
3
|
import { Children as y, Fragment as b, cloneElement as x, createContext as S, isValidElement as C, useCallback as w, useContext as T, useEffect as E, useId as D, useLayoutEffect as O, useMemo as k, useRef as A, useState as j, useSyncExternalStore as M } from "react";
|
|
4
4
|
import { AnimatePresence as ee, animate as te, m as N, motionValue as P, useMotionValue as ne, useMotionValueEvent as re, useTransform as F } from "motion/react";
|
|
@@ -3869,7 +3869,8 @@ function Jr({ snapshot: e, selection: t, series: n, seriesColors: r = {}, paintI
|
|
|
3869
3869
|
}
|
|
3870
3870
|
//#endregion
|
|
3871
3871
|
//#region src/interaction/comparison-layer.tsx
|
|
3872
|
-
|
|
3872
|
+
var Yr = 96;
|
|
3873
|
+
function Xr(e, t, n, r) {
|
|
3873
3874
|
if (r === null) return null;
|
|
3874
3875
|
let i = e.geometry, a = e.xToPixel(n), o = i?.series[t];
|
|
3875
3876
|
for (let e of o?.isolated ?? []) if (Math.abs(e.x - a) < .5) return e.y;
|
|
@@ -3881,8 +3882,20 @@ function Yr(e, t, n, r) {
|
|
|
3881
3882
|
let s = i?.bars[t]?.find((e) => e.valueX === n);
|
|
3882
3883
|
return s ? s.negative ? s.y + s.height : s.y : e.stack?.series.includes(t) ? null : e.yToPixel(r);
|
|
3883
3884
|
}
|
|
3884
|
-
function
|
|
3885
|
-
let
|
|
3885
|
+
function Zr({ snapshot: e, comparison: t, rows: n, reducedMotion: r, onEndpointPointerDown: i, onEndpointPointerMove: a, onEndpointPointerUp: o, onEndpointCancel: s, onEndpointCommit: c, onEndpointKeyDown: l, preview: u = !1, ranging: d = !1 }) {
|
|
3886
|
+
let f = e.xToPixel(t.startX), p = e.xToPixel(t.endX), m = Math.min(f, p), h = Math.max(f, p), g = e.formatX(t.startX), _ = e.formatX(t.endX), v = r ? 0 : .14, y = D(), b = D().replace(/:/g, ""), { top: x, bottom: S } = e.plot, C = d ? h - m < Yr ? [{
|
|
3887
|
+
key: "range",
|
|
3888
|
+
x: (m + h) / 2,
|
|
3889
|
+
text: `${g} → ${_}`
|
|
3890
|
+
}] : [{
|
|
3891
|
+
key: "start",
|
|
3892
|
+
x: f,
|
|
3893
|
+
text: g
|
|
3894
|
+
}, {
|
|
3895
|
+
key: "end",
|
|
3896
|
+
x: p,
|
|
3897
|
+
text: _
|
|
3898
|
+
}] : [], w = Yr / 2, T = (t) => Math.min(Math.max(t, e.plot.left + w), Math.max(e.plot.left + w, e.plot.right - w)), E = r ? "blur(0px)" : "blur(4px)";
|
|
3886
3899
|
return /* @__PURE__ */ L("div", {
|
|
3887
3900
|
"aria-label": "Comparison endpoints",
|
|
3888
3901
|
className: "lilt-chart__comparison",
|
|
@@ -3890,65 +3903,156 @@ function Xr({ snapshot: e, comparison: t, rows: n, reducedMotion: r, onEndpointP
|
|
|
3890
3903
|
children: [
|
|
3891
3904
|
!u && l ? /* @__PURE__ */ I("span", {
|
|
3892
3905
|
className: "lilt-chart__sr-only",
|
|
3893
|
-
id:
|
|
3906
|
+
id: y,
|
|
3894
3907
|
children: "Arrow keys move one observation. Page Up and Page Down move five. Home and End reach the limits. During an edit, Enter keeps it and Escape restores the previous value. Otherwise, Escape leaves focus or clears the comparison."
|
|
3895
3908
|
}) : null,
|
|
3896
3909
|
/* @__PURE__ */ L("svg", {
|
|
3897
3910
|
"aria-hidden": "true",
|
|
3898
3911
|
className: "lilt-chart__comparison-svg",
|
|
3899
|
-
height:
|
|
3912
|
+
height: S + 1,
|
|
3900
3913
|
width: "100%",
|
|
3901
|
-
children: [
|
|
3914
|
+
children: [
|
|
3915
|
+
/* @__PURE__ */ L("defs", { children: [/* @__PURE__ */ L("linearGradient", {
|
|
3916
|
+
id: `${b}-band`,
|
|
3917
|
+
x1: "0",
|
|
3918
|
+
x2: "0",
|
|
3919
|
+
y1: x,
|
|
3920
|
+
y2: S,
|
|
3921
|
+
gradientUnits: "userSpaceOnUse",
|
|
3922
|
+
children: [/* @__PURE__ */ I("stop", {
|
|
3923
|
+
offset: "0",
|
|
3924
|
+
stopColor: "var(--lilt-series-1)",
|
|
3925
|
+
stopOpacity: .14
|
|
3926
|
+
}), /* @__PURE__ */ I("stop", {
|
|
3927
|
+
offset: "1",
|
|
3928
|
+
stopColor: "var(--lilt-series-1)",
|
|
3929
|
+
stopOpacity: .02
|
|
3930
|
+
})]
|
|
3931
|
+
}), /* @__PURE__ */ L("linearGradient", {
|
|
3932
|
+
id: `${b}-wick`,
|
|
3933
|
+
x1: "0",
|
|
3934
|
+
x2: "0",
|
|
3935
|
+
y1: x,
|
|
3936
|
+
y2: S,
|
|
3937
|
+
gradientUnits: "userSpaceOnUse",
|
|
3938
|
+
children: [
|
|
3939
|
+
/* @__PURE__ */ I("stop", {
|
|
3940
|
+
offset: "0",
|
|
3941
|
+
stopColor: "var(--lilt-series-1)",
|
|
3942
|
+
stopOpacity: .9
|
|
3943
|
+
}),
|
|
3944
|
+
/* @__PURE__ */ I("stop", {
|
|
3945
|
+
offset: "0.7",
|
|
3946
|
+
stopColor: "var(--lilt-series-1)",
|
|
3947
|
+
stopOpacity: .4
|
|
3948
|
+
}),
|
|
3949
|
+
/* @__PURE__ */ I("stop", {
|
|
3950
|
+
offset: "1",
|
|
3951
|
+
stopColor: "var(--lilt-series-1)",
|
|
3952
|
+
stopOpacity: .08
|
|
3953
|
+
})
|
|
3954
|
+
]
|
|
3955
|
+
})] }),
|
|
3956
|
+
/* @__PURE__ */ I(N.rect, {
|
|
3957
|
+
className: "lilt-chart__comparison-band",
|
|
3958
|
+
animate: {
|
|
3959
|
+
x: m,
|
|
3960
|
+
width: h - m
|
|
3961
|
+
},
|
|
3962
|
+
fill: `url(#${b}-band)`,
|
|
3963
|
+
height: e.plot.height,
|
|
3964
|
+
initial: !1,
|
|
3965
|
+
transition: {
|
|
3966
|
+
duration: v,
|
|
3967
|
+
ease: [
|
|
3968
|
+
.22,
|
|
3969
|
+
1,
|
|
3970
|
+
.36,
|
|
3971
|
+
1
|
|
3972
|
+
]
|
|
3973
|
+
},
|
|
3974
|
+
y: x
|
|
3975
|
+
}),
|
|
3976
|
+
[f, p].map((r, i) => {
|
|
3977
|
+
let a = i === 0 ? t.startX : t.endX;
|
|
3978
|
+
return /* @__PURE__ */ L("g", { children: [/* @__PURE__ */ I("line", {
|
|
3979
|
+
className: "lilt-chart__comparison-anchor",
|
|
3980
|
+
stroke: `url(#${b}-wick)`,
|
|
3981
|
+
x1: r,
|
|
3982
|
+
x2: r,
|
|
3983
|
+
y1: d ? Math.max(0, x - 6) : x,
|
|
3984
|
+
y2: S
|
|
3985
|
+
}), n.map((t) => {
|
|
3986
|
+
let n = i === 0 ? t.startValue : t.endValue, o = Xr(e, t.id, a, n);
|
|
3987
|
+
return o === null ? null : /* @__PURE__ */ I("circle", {
|
|
3988
|
+
"data-comparison-series": t.id,
|
|
3989
|
+
className: "lilt-chart__comparison-dot",
|
|
3990
|
+
cx: r,
|
|
3991
|
+
cy: o,
|
|
3992
|
+
fill: t.color,
|
|
3993
|
+
style: { fill: t.color },
|
|
3994
|
+
r: 3.5
|
|
3995
|
+
}, t.id);
|
|
3996
|
+
})] }, i);
|
|
3997
|
+
})
|
|
3998
|
+
]
|
|
3999
|
+
}),
|
|
4000
|
+
/* @__PURE__ */ I(ee, {
|
|
4001
|
+
initial: !1,
|
|
4002
|
+
children: C.map((e) => /* @__PURE__ */ I(N.span, {
|
|
4003
|
+
"aria-hidden": "true",
|
|
4004
|
+
className: "lilt-chart__comparison-label",
|
|
4005
|
+
initial: {
|
|
4006
|
+
x: T(e.x),
|
|
4007
|
+
y: r ? 0 : 4,
|
|
4008
|
+
opacity: 0,
|
|
4009
|
+
filter: E
|
|
4010
|
+
},
|
|
3902
4011
|
animate: {
|
|
3903
|
-
x:
|
|
3904
|
-
|
|
4012
|
+
x: T(e.x),
|
|
4013
|
+
y: 0,
|
|
4014
|
+
opacity: 1,
|
|
4015
|
+
filter: "blur(0px)"
|
|
4016
|
+
},
|
|
4017
|
+
exit: {
|
|
4018
|
+
y: r ? 0 : -4,
|
|
4019
|
+
opacity: 0,
|
|
4020
|
+
filter: E
|
|
3905
4021
|
},
|
|
3906
|
-
fill: "var(--lilt-muted)",
|
|
3907
|
-
fillOpacity: .06,
|
|
3908
|
-
height: e.plot.height,
|
|
3909
|
-
initial: !1,
|
|
3910
4022
|
transition: {
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
4023
|
+
x: {
|
|
4024
|
+
duration: v,
|
|
4025
|
+
ease: [
|
|
4026
|
+
.22,
|
|
4027
|
+
1,
|
|
4028
|
+
.36,
|
|
4029
|
+
1
|
|
4030
|
+
]
|
|
4031
|
+
},
|
|
4032
|
+
default: {
|
|
4033
|
+
duration: .16,
|
|
4034
|
+
ease: [
|
|
4035
|
+
.23,
|
|
4036
|
+
1,
|
|
4037
|
+
.32,
|
|
4038
|
+
1
|
|
4039
|
+
]
|
|
4040
|
+
}
|
|
3918
4041
|
},
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
return /* @__PURE__ */ L("g", { children: [/* @__PURE__ */ I("line", {
|
|
3923
|
-
className: "lilt-chart__comparison-anchor",
|
|
3924
|
-
x1: r,
|
|
3925
|
-
x2: r,
|
|
3926
|
-
y1: e.plot.top,
|
|
3927
|
-
y2: e.plot.bottom
|
|
3928
|
-
}), n.map((t) => {
|
|
3929
|
-
let n = i === 0 ? t.startValue : t.endValue, o = Yr(e, t.id, a, n);
|
|
3930
|
-
return o === null ? null : /* @__PURE__ */ I("circle", {
|
|
3931
|
-
"data-comparison-series": t.id,
|
|
3932
|
-
className: "lilt-chart__comparison-dot",
|
|
3933
|
-
cx: r,
|
|
3934
|
-
cy: o,
|
|
3935
|
-
fill: t.color,
|
|
3936
|
-
style: { fill: t.color },
|
|
3937
|
-
r: 3.5
|
|
3938
|
-
}, t.id);
|
|
3939
|
-
})] }, i);
|
|
3940
|
-
})]
|
|
4042
|
+
style: { top: Math.max(0, x - 24) },
|
|
4043
|
+
children: /* @__PURE__ */ I("span", { children: e.text })
|
|
4044
|
+
}, e.key))
|
|
3941
4045
|
}),
|
|
3942
4046
|
!u && l ? ["start", "end"].map((n) => {
|
|
3943
|
-
let r = n === "start" ? t.startX : t.endX, u = e.data.rows.findIndex((e) => e.x === r),
|
|
3944
|
-
if (u < 0 ||
|
|
3945
|
-
let m = t.startX > t.endX,
|
|
4047
|
+
let r = n === "start" ? t.startX : t.endX, u = e.data.rows.findIndex((e) => e.x === r), d = e.data.rows.findIndex((e) => e.x === (n === "start" ? t.endX : t.startX));
|
|
4048
|
+
if (u < 0 || d < 0) return null;
|
|
4049
|
+
let m = t.startX > t.endX, h = m ? n === "start" ? d + 1 : 0 : n === "start" ? 0 : d + 1, v = m ? n === "start" ? e.data.rows.length - 1 : d - 1 : n === "start" ? d - 1 : e.data.rows.length - 1, b = n === "start" ? g : _;
|
|
3946
4050
|
return /* @__PURE__ */ I("div", {
|
|
3947
4051
|
"aria-label": `Comparison ${n}`,
|
|
3948
|
-
"aria-describedby":
|
|
4052
|
+
"aria-describedby": y,
|
|
3949
4053
|
"aria-orientation": "horizontal",
|
|
3950
|
-
"aria-valuemin": Math.max(0,
|
|
3951
|
-
"aria-valuemax": Math.max(0,
|
|
4054
|
+
"aria-valuemin": Math.max(0, h),
|
|
4055
|
+
"aria-valuemax": Math.max(0, v),
|
|
3952
4056
|
"aria-valuenow": Math.max(0, u),
|
|
3953
4057
|
"aria-valuetext": b,
|
|
3954
4058
|
className: "lilt-chart__comparison-handle",
|
|
@@ -3961,7 +4065,7 @@ function Xr({ snapshot: e, comparison: t, rows: n, reducedMotion: r, onEndpointP
|
|
|
3961
4065
|
onPointerUp: (e) => o?.(n, e),
|
|
3962
4066
|
role: "slider",
|
|
3963
4067
|
style: {
|
|
3964
|
-
left: (n === "start" ?
|
|
4068
|
+
left: (n === "start" ? f : p) - 17,
|
|
3965
4069
|
top: e.plot.top + 28,
|
|
3966
4070
|
height: Math.max(0, e.plot.height - 28)
|
|
3967
4071
|
},
|
|
@@ -3977,21 +4081,21 @@ function Xr({ snapshot: e, comparison: t, rows: n, reducedMotion: r, onEndpointP
|
|
|
3977
4081
|
}
|
|
3978
4082
|
//#endregion
|
|
3979
4083
|
//#region src/interaction/tooltip-view.tsx
|
|
3980
|
-
var
|
|
3981
|
-
function
|
|
3982
|
-
return /* @__PURE__ */ I(
|
|
4084
|
+
var Qr = S(null);
|
|
4085
|
+
function $r({ value: e, children: t }) {
|
|
4086
|
+
return /* @__PURE__ */ I(Qr.Provider, {
|
|
3983
4087
|
value: e,
|
|
3984
4088
|
children: t
|
|
3985
4089
|
});
|
|
3986
4090
|
}
|
|
3987
|
-
function
|
|
3988
|
-
let e = T(
|
|
4091
|
+
function ei() {
|
|
4092
|
+
let e = T(Qr);
|
|
3989
4093
|
if (!e) throw Error("Lilt Tooltip must be supplied through ChartPlot.tooltip.");
|
|
3990
4094
|
return e;
|
|
3991
4095
|
}
|
|
3992
4096
|
//#endregion
|
|
3993
4097
|
//#region src/interaction/pin-marker.tsx
|
|
3994
|
-
function
|
|
4098
|
+
function ti({ left: e, top: t, reducedMotion: r, ghost: i = !1, from: a, local: o = !1, onRelease: s }) {
|
|
3995
4099
|
let c = r ? { opacity: 0 } : {
|
|
3996
4100
|
opacity: 0,
|
|
3997
4101
|
scale: .6,
|
|
@@ -4037,7 +4141,7 @@ function ei({ left: e, top: t, reducedMotion: r, ghost: i = !1, from: a, local:
|
|
|
4037
4141
|
}
|
|
4038
4142
|
//#endregion
|
|
4039
4143
|
//#region src/engine/lookup.ts
|
|
4040
|
-
function
|
|
4144
|
+
function ni(e, t, n, r) {
|
|
4041
4145
|
let i = 0, a = e.length;
|
|
4042
4146
|
for (; i < a;) {
|
|
4043
4147
|
let n = i + a >>> 1;
|
|
@@ -4059,13 +4163,13 @@ function ti(e, t, n, r) {
|
|
|
4059
4163
|
}
|
|
4060
4164
|
//#endregion
|
|
4061
4165
|
//#region src/interaction/visibility.ts
|
|
4062
|
-
function
|
|
4166
|
+
function ri(e, t) {
|
|
4063
4167
|
return e.length === t.length && e.every((e) => t.includes(e));
|
|
4064
4168
|
}
|
|
4065
|
-
function
|
|
4169
|
+
function ii(e, t, n) {
|
|
4066
4170
|
if (!e || !n.includes(e.id)) return null;
|
|
4067
|
-
let r = e.expected.filter((e) => n.includes(e)), i = e.previous.filter((e) => n.includes(e)), a =
|
|
4068
|
-
return !a && !
|
|
4171
|
+
let r = e.expected.filter((e) => n.includes(e)), i = e.previous.filter((e) => n.includes(e)), a = ri(t, r);
|
|
4172
|
+
return !a && !ri(t, i) ? null : {
|
|
4069
4173
|
...e,
|
|
4070
4174
|
restore: e.restore.filter((e) => n.includes(e)),
|
|
4071
4175
|
expected: r,
|
|
@@ -4074,9 +4178,9 @@ function ri(e, t, n) {
|
|
|
4074
4178
|
}
|
|
4075
4179
|
//#endregion
|
|
4076
4180
|
//#region src/interaction/chart-sync.ts
|
|
4077
|
-
var
|
|
4078
|
-
function
|
|
4079
|
-
let t =
|
|
4181
|
+
var ai = /* @__PURE__ */ new Map();
|
|
4182
|
+
function oi(e) {
|
|
4183
|
+
let t = ai.get(e);
|
|
4080
4184
|
if (t) return t;
|
|
4081
4185
|
let n = null, r = 0, i = /* @__PURE__ */ new Set();
|
|
4082
4186
|
return t = {
|
|
@@ -4091,18 +4195,18 @@ function ai(e) {
|
|
|
4091
4195
|
subscribe(e) {
|
|
4092
4196
|
return i.add(e), () => i.delete(e);
|
|
4093
4197
|
}
|
|
4094
|
-
},
|
|
4198
|
+
}, ai.set(e, t), t;
|
|
4095
4199
|
}
|
|
4096
|
-
var
|
|
4097
|
-
function
|
|
4098
|
-
let t = e ?
|
|
4200
|
+
var si = "sync", ci = () => () => void 0, li = () => null;
|
|
4201
|
+
function ui(e) {
|
|
4202
|
+
let t = e ? oi(e) : null, n = M(t?.subscribe ?? ci, t?.get ?? li, t?.get ?? li);
|
|
4099
4203
|
return n ? {
|
|
4100
4204
|
value: n.kind === "time" ? new Date(n.key) : n.key,
|
|
4101
4205
|
kind: n.kind,
|
|
4102
4206
|
pinned: n.pinned
|
|
4103
4207
|
} : null;
|
|
4104
4208
|
}
|
|
4105
|
-
function
|
|
4209
|
+
function di(e, t, n, r) {
|
|
4106
4210
|
if (e.kind !== t) return null;
|
|
4107
4211
|
if (t === "category") {
|
|
4108
4212
|
let t = n.indexOf(String(e.key));
|
|
@@ -4117,12 +4221,12 @@ function ui(e, t, n, r) {
|
|
|
4117
4221
|
let o = [...r].sort((e, t) => e - t), s = o.slice(1).map((e, t) => e - o[t]).filter((e) => e > 0).sort((e, t) => e - t), c = s.length ? s[Math.floor(s.length / 2)] : 0;
|
|
4118
4222
|
return Math.abs(r[a] - i) <= c / 2 ? r[a] : null;
|
|
4119
4223
|
}
|
|
4120
|
-
function
|
|
4224
|
+
function fi(e, t, n, r, i, { label: a, release: o } = {}) {
|
|
4121
4225
|
let s = D(), c = A(o);
|
|
4122
4226
|
c.current = o, E(() => {
|
|
4123
4227
|
if (!e) return;
|
|
4124
|
-
let o =
|
|
4125
|
-
t.getSnapshot().inspection?.ownerId === "sync" && (m = !0, t.clearInspection(
|
|
4228
|
+
let o = oi(e), l = n.map((e) => String(e[r] ?? "")), u = n.map(i.position), d = (e) => i.kind === "category" ? l[e] ?? null : e, f = o.releases(), p = !1, m = !1, h = () => {
|
|
4229
|
+
t.getSnapshot().inspection?.ownerId === "sync" && (m = !0, t.clearInspection(si), m = !1);
|
|
4126
4230
|
}, g = () => {
|
|
4127
4231
|
let e = t.getSnapshot().inspection;
|
|
4128
4232
|
if (o.releases() !== f && (f = o.releases(), e?.pinned && !e.local && e.ownerId !== "sync")) {
|
|
@@ -4131,7 +4235,7 @@ function di(e, t, n, r, i, { label: a, release: o } = {}) {
|
|
|
4131
4235
|
}
|
|
4132
4236
|
let n = o.get();
|
|
4133
4237
|
if (n?.source === s || e?.pinned && e.ownerId !== "sync" && (e.local || !n?.pinned)) return;
|
|
4134
|
-
let r = n ?
|
|
4238
|
+
let r = n ? di(n, i.kind, l, u) : null;
|
|
4135
4239
|
if (!n || r === null) {
|
|
4136
4240
|
h();
|
|
4137
4241
|
return;
|
|
@@ -4139,7 +4243,7 @@ function di(e, t, n, r, i, { label: a, release: o } = {}) {
|
|
|
4139
4243
|
t.inspect({
|
|
4140
4244
|
x: r,
|
|
4141
4245
|
pinned: n.pinned,
|
|
4142
|
-
ownerId:
|
|
4246
|
+
ownerId: si,
|
|
4143
4247
|
...n.pinned && n.label ? { from: n.label } : {}
|
|
4144
4248
|
});
|
|
4145
4249
|
}, _ = t.subscribe(() => {
|
|
@@ -4177,19 +4281,19 @@ function di(e, t, n, r, i, { label: a, release: o } = {}) {
|
|
|
4177
4281
|
}
|
|
4178
4282
|
//#endregion
|
|
4179
4283
|
//#region src/use-chart-width.ts
|
|
4180
|
-
function
|
|
4284
|
+
function pi(e) {
|
|
4181
4285
|
let t = e.getBoundingClientRect(), n = (e, t) => e > 0 && Math.abs(e - t) > 1;
|
|
4182
4286
|
return {
|
|
4183
4287
|
width: n(e.offsetWidth, t.width) ? e.offsetWidth : t.width,
|
|
4184
4288
|
height: n(e.offsetHeight, t.height) ? e.offsetHeight : t.height
|
|
4185
4289
|
};
|
|
4186
4290
|
}
|
|
4187
|
-
function
|
|
4291
|
+
function mi() {
|
|
4188
4292
|
let e = A(null), [t, n] = j(0);
|
|
4189
4293
|
return O(() => {
|
|
4190
4294
|
let t = e.current;
|
|
4191
4295
|
if (!t) return;
|
|
4192
|
-
let r = () => n(
|
|
4296
|
+
let r = () => n(pi(t).width);
|
|
4193
4297
|
r();
|
|
4194
4298
|
let i = new ResizeObserver(r);
|
|
4195
4299
|
return i.observe(t), () => i.disconnect();
|
|
@@ -4200,29 +4304,29 @@ function pi() {
|
|
|
4200
4304
|
}
|
|
4201
4305
|
//#endregion
|
|
4202
4306
|
//#region src/chart.tsx
|
|
4203
|
-
var
|
|
4307
|
+
var hi = 14, gi = 80, _i = 520, vi = {}, yi = [], bi = {
|
|
4204
4308
|
inspection: null,
|
|
4205
4309
|
comparison: null,
|
|
4206
4310
|
focus: null
|
|
4207
|
-
},
|
|
4208
|
-
function
|
|
4311
|
+
}, xi = () => () => void 0, Si = () => bi;
|
|
4312
|
+
function Ci(e) {
|
|
4209
4313
|
return {
|
|
4210
4314
|
...Vt,
|
|
4211
4315
|
...e
|
|
4212
4316
|
};
|
|
4213
4317
|
}
|
|
4214
|
-
function
|
|
4318
|
+
function wi(e, t) {
|
|
4215
4319
|
let n = /* @__PURE__ */ new Set([...Object.keys(e ?? {}), ...Object.keys(t ?? {})]);
|
|
4216
4320
|
for (let r of n) if ((e?.[r] ?? null) !== (t?.[r] ?? null)) return !1;
|
|
4217
4321
|
return !0;
|
|
4218
4322
|
}
|
|
4219
|
-
function
|
|
4323
|
+
function Ti(e, t) {
|
|
4220
4324
|
return !e || !t || e.rows.length !== t.rows.length || e.series.length !== t.series.length || e.series.some((e, n) => e.id !== t.series[n]?.id) ? !1 : e.rows.every((n, r) => {
|
|
4221
4325
|
let i = t.rows[r];
|
|
4222
|
-
return !!(i && n.x === i.x && n.categoryId === i.categoryId && e.series.every((e) => n.values[e.id] === i.values[e.id] && n.statuses[e.id] === i.statuses[e.id] &&
|
|
4326
|
+
return !!(i && n.x === i.x && n.categoryId === i.categoryId && e.series.every((e) => n.values[e.id] === i.values[e.id] && n.statuses[e.id] === i.statuses[e.id] && wi(n.fields[e.id], i.fields[e.id])));
|
|
4223
4327
|
});
|
|
4224
4328
|
}
|
|
4225
|
-
function
|
|
4329
|
+
function Ei(e, t, n) {
|
|
4226
4330
|
return n >= 1 ? t : {
|
|
4227
4331
|
...t,
|
|
4228
4332
|
rows: t.rows.map((r, i) => {
|
|
@@ -4237,10 +4341,10 @@ function Ti(e, t, n) {
|
|
|
4237
4341
|
})
|
|
4238
4342
|
};
|
|
4239
4343
|
}
|
|
4240
|
-
function
|
|
4344
|
+
function Di(e) {
|
|
4241
4345
|
return 1 - (1 - e) ** 4;
|
|
4242
4346
|
}
|
|
4243
|
-
function
|
|
4347
|
+
function Oi(e, t, n = !1) {
|
|
4244
4348
|
let [r, i] = j({
|
|
4245
4349
|
width: 0,
|
|
4246
4350
|
height: t
|
|
@@ -4249,7 +4353,7 @@ function Di(e, t, n = !1) {
|
|
|
4249
4353
|
let r = e.current;
|
|
4250
4354
|
if (!r) return;
|
|
4251
4355
|
let a = () => {
|
|
4252
|
-
let e =
|
|
4356
|
+
let e = pi(r);
|
|
4253
4357
|
i((r) => {
|
|
4254
4358
|
let i = {
|
|
4255
4359
|
width: e.width > 0 ? e.width : r.width,
|
|
@@ -4267,7 +4371,7 @@ function Di(e, t, n = !1) {
|
|
|
4267
4371
|
e
|
|
4268
4372
|
]), r;
|
|
4269
4373
|
}
|
|
4270
|
-
function
|
|
4374
|
+
function ki(e, t, n, r) {
|
|
4271
4375
|
return k(() => {
|
|
4272
4376
|
try {
|
|
4273
4377
|
let i = Pe(e, t, n);
|
|
@@ -4288,7 +4392,7 @@ function Oi(e, t, n, r) {
|
|
|
4288
4392
|
r
|
|
4289
4393
|
]);
|
|
4290
4394
|
}
|
|
4291
|
-
function
|
|
4395
|
+
function Ai(e, t, n, r, i, a, o, s, c, l = Ht, u, d = {}, f = 0, p = !0) {
|
|
4292
4396
|
if (!e || e.rows.length === 0 || !Fe(e)) return null;
|
|
4293
4397
|
try {
|
|
4294
4398
|
return tn(e, t, n, r, i, a.width, a.height, o, s, c, l, u, d, f, p);
|
|
@@ -4296,7 +4400,7 @@ function ki(e, t, n, r, i, a, o, s, c, l = Ht, u, d = {}, f = 0, p = !0) {
|
|
|
4296
4400
|
return null;
|
|
4297
4401
|
}
|
|
4298
4402
|
}
|
|
4299
|
-
function
|
|
4403
|
+
function ji(e, t, n) {
|
|
4300
4404
|
return {
|
|
4301
4405
|
snapshot: e,
|
|
4302
4406
|
previousSnapshot: t,
|
|
@@ -4320,17 +4424,17 @@ function Ai(e, t, n) {
|
|
|
4320
4424
|
visibleSeries: n.visibleSeries
|
|
4321
4425
|
};
|
|
4322
4426
|
}
|
|
4323
|
-
function
|
|
4427
|
+
function Mi(e) {
|
|
4324
4428
|
return e.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
4325
4429
|
}
|
|
4326
|
-
function
|
|
4430
|
+
function Ni(e, t, n) {
|
|
4327
4431
|
let r = e.accessor(t);
|
|
4328
4432
|
return r === null ? "No data" : e.formatValue?.(r) ?? n(r);
|
|
4329
4433
|
}
|
|
4330
|
-
function
|
|
4434
|
+
function Pi(e, t) {
|
|
4331
4435
|
return e.data.rows.findIndex((e) => e.sourceIndex === t);
|
|
4332
4436
|
}
|
|
4333
|
-
function
|
|
4437
|
+
function Fi({ data: t, x: n, y: r = vi, series: i, height: a = 340, compactHeight: o, margins: s, arrangement: c = Ht, marks: l = yi, barLayout: u, compact: d = !1, tooltipNode: f, inspectionSeries: p, className: m, style: h, "aria-label": g, children: _, status: v = "ready", loadingStyle: y, empty: b = "dots", interactive: x = !0, error: S, renderRetry: C, motion: te = "auto", animateIn: P = !0, resetKey: re, onSelectionChange: F, controller: R, linkedSelection: ae = "exact", selectedCategoryId: oe, onSelectedCategoryIdChange: se, compare: ce = !1, focus: le = !1, live: ue = !1, brush: de = !1, visibleSeries: fe, onVisibleSeriesChange: pe, toolkit: me, model: z, controllerLinked: he = !1, axis: ge = "minimal", pill: _e = "soft", pillSeries: ve = "nearest", pillValue: ye = "series", pillPosition: be = "auto", axisInset: xe = 0, decimate: Se = !0, runoff: Ce = !1, labelOverhang: we = 0 }) {
|
|
4334
4438
|
let Te = _e || "soft", Ee = JSON.stringify(ge), De = k(() => ct(ge), [Ee]), Oe = ne(0), ke = ne(0), Ae = ne(0), je = ne(0), Me = ne(0), Ne = ne(0), Pe = ne(""), Le = k(() => ({
|
|
4335
4439
|
x: Oe,
|
|
4336
4440
|
pointerX: ke,
|
|
@@ -4359,7 +4463,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4359
4463
|
Te,
|
|
4360
4464
|
ke,
|
|
4361
4465
|
Ce
|
|
4362
|
-
]), Ve = A(null), Ue = A(null), We = A(null), Ge = k(() =>
|
|
4466
|
+
]), Ve = A(null), Ue = A(null), We = A(null), Ge = k(() => Ci(s), [
|
|
4363
4467
|
s?.top,
|
|
4364
4468
|
s?.right,
|
|
4365
4469
|
s?.bottom,
|
|
@@ -4372,7 +4476,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4372
4476
|
u?.width,
|
|
4373
4477
|
u?.gap,
|
|
4374
4478
|
u?.segmentGap
|
|
4375
|
-
]), Ke = a === "fill", qe = a === "fill" ? 340 : a, Je =
|
|
4479
|
+
]), Ke = a === "fill", qe = a === "fill" ? 340 : a, Je = Oi(Ve, qe, Ke), Ye = Je.width > 0 && Je.width < 420, Xe = Je.width > 0 && Je.width < 240, H = k(() => ({
|
|
4376
4480
|
width: Je.width,
|
|
4377
4481
|
height: Ke ? Je.height : Ye && o ? o : qe
|
|
4378
4482
|
}), [
|
|
@@ -4396,7 +4500,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4396
4500
|
...Ge,
|
|
4397
4501
|
left: Ye ? Math.min(65, Ge.left) : Ge.left,
|
|
4398
4502
|
right: Ye ? Math.min(44, Ge.right) : Ge.right
|
|
4399
|
-
}), [Ge, Ye]), W = e(te), et =
|
|
4503
|
+
}), [Ge, Ye]), W = e(te), et = ki(t, i, n, c.stack), G = et.value, tt = G !== null && G.rows.length > 0 && Fe(G), nt = Mi(D()), rt = `${nt}-reveal`, it = `${nt}-grid-fade`, ot = w((e, t) => {
|
|
4400
4504
|
let n = i.findIndex((t) => t.id === e);
|
|
4401
4505
|
return Be(nt, n, t);
|
|
4402
4506
|
}, [nt, i]), st = `${nt}-highlight-mask`, lt = `${nt}-cross-fade`, dt = A(sn()), ft = A(-Infinity), pt = v === "ready" && tt, mt = A(void 0);
|
|
@@ -4415,7 +4519,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4415
4519
|
}, 750);
|
|
4416
4520
|
}, []), Yt = A(null), Xt = A(null), Zt = `${nt}-owner`;
|
|
4417
4521
|
E(() => () => R?.releaseOwner(Zt), [Zt, R]);
|
|
4418
|
-
let Qt = M(R?.subscribe ??
|
|
4522
|
+
let Qt = M(R?.subscribe ?? xi, R?.getSnapshot ?? Si, R?.getSnapshot ?? Si), $t = k(() => ce === !0 ? {} : ce || {}, [ce]), en = k(() => le === !0 ? {} : le || {}, [le]), tn = k(() => ue === !0 ? {} : ue || {}, [ue]), nn = !!ce, an = !!(le || de), un = !!ue, [dn, fn] = j(() => z?.getSnapshot().visibleSeries ?? i.map((e) => e.id)), pn = A(i.map((e) => e.id));
|
|
4419
4523
|
E(() => {
|
|
4420
4524
|
if (fe) return;
|
|
4421
4525
|
let e = i.map((e) => e.id), t = pn.current;
|
|
@@ -4427,8 +4531,8 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4427
4531
|
let mn = fe ?? dn, [hn, gn] = j(null);
|
|
4428
4532
|
E(() => {
|
|
4429
4533
|
gn((e) => {
|
|
4430
|
-
let t =
|
|
4431
|
-
return !e || !t ? t :
|
|
4534
|
+
let t = ii(e, mn, i.map((e) => e.id));
|
|
4535
|
+
return !e || !t ? t : ri(e.restore, t.restore) && ri(e.expected, t.expected) && ri(e.previous, t.previous) ? e : t;
|
|
4432
4536
|
});
|
|
4433
4537
|
}, [i, mn]);
|
|
4434
4538
|
let q = k(() => i.filter((e) => mn.includes(e.id)), [i, mn]), _n = Yn(i.map((e) => e.id), mn, !!c.stack, W), vn = c.stack ? _n : void 0, [yn, bn] = j(null), xn = A(null);
|
|
@@ -4494,7 +4598,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4494
4598
|
pr(G, "initial", null), Pt || kt(!1);
|
|
4495
4599
|
return;
|
|
4496
4600
|
}
|
|
4497
|
-
if (
|
|
4601
|
+
if (Ti(vt.current, G)) {
|
|
4498
4602
|
vt.current !== G && (vt.current = G, _t(G));
|
|
4499
4603
|
return;
|
|
4500
4604
|
}
|
|
@@ -4524,7 +4628,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4524
4628
|
tt
|
|
4525
4629
|
]), E(() => {
|
|
4526
4630
|
if (!jt) return;
|
|
4527
|
-
let e = window.setTimeout(() => Ft(!0),
|
|
4631
|
+
let e = window.setTimeout(() => Ft(!0), gi), t = window.setTimeout(() => {
|
|
4528
4632
|
Mt(!1), Ft(!1), kt(!1);
|
|
4529
4633
|
}, 240);
|
|
4530
4634
|
return () => {
|
|
@@ -4557,7 +4661,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4557
4661
|
W,
|
|
4558
4662
|
K
|
|
4559
4663
|
]);
|
|
4560
|
-
let X = gt ?? (v === "ready" && tt && (!Dt || Pt) ? G : null), hr = K?.kind === "keyed-update" ? rr(St) :
|
|
4664
|
+
let X = gt ?? (v === "ready" && tt && (!Dt || Pt) ? G : null), hr = K?.kind === "keyed-update" ? rr(St) : Di(St), gr = k(() => K?.from && K.kind === "matched-update" ? ur ? Tr(K.from, K.to, St) : Ei(K.from, K.to, hr) : K?.from && K.kind === "keyed-update" ? er(K.from, K.to, hr) : X, [
|
|
4561
4665
|
X,
|
|
4562
4666
|
K,
|
|
4563
4667
|
hr,
|
|
@@ -4567,7 +4671,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4567
4671
|
Wn,
|
|
4568
4672
|
qn,
|
|
4569
4673
|
un
|
|
4570
|
-
]), vr = k(() =>
|
|
4674
|
+
]), vr = k(() => Ai(K?.from ?? null, q, n, r, U, H, K?.fromDomain, _r, i, c, vn, V, xe, Se), [
|
|
4571
4675
|
q,
|
|
4572
4676
|
U,
|
|
4573
4677
|
i,
|
|
@@ -4582,7 +4686,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4582
4686
|
V,
|
|
4583
4687
|
xe,
|
|
4584
4688
|
Se
|
|
4585
|
-
]), yr = k(() =>
|
|
4689
|
+
]), yr = k(() => Ai(X, q, n, r, U, H, void 0, _r, i, c, vn, V, xe, Se), [
|
|
4586
4690
|
X,
|
|
4587
4691
|
q,
|
|
4588
4692
|
n,
|
|
@@ -4603,7 +4707,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4603
4707
|
let e = K?.kind === "matched-update" || K?.kind === "keyed-update", t = or && yr?.yDomain ? ir(or.from, yr.yDomain, rr(or.progress)) : null;
|
|
4604
4708
|
if (!e && !br && !t) return yr;
|
|
4605
4709
|
let a = K?.kind === "keyed-update" && vr && yr ? ir(vr.xDomain, yr.xDomain, hr) : null, o = br?.y ?? t ?? (vr?.yDomain && yr?.yDomain ? [vr.yDomain[0] + (yr.yDomain[0] - vr.yDomain[0]) * hr, vr.yDomain[1] + (yr.yDomain[1] - vr.yDomain[1]) * hr] : void 0);
|
|
4606
|
-
return
|
|
4710
|
+
return Ai(gr, q, n, r, U, H, o, br?.x ?? a ?? _r, i, c, vn, V, xe, Se);
|
|
4607
4711
|
}, [
|
|
4608
4712
|
q,
|
|
4609
4713
|
yr,
|
|
@@ -4624,7 +4728,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4624
4728
|
V,
|
|
4625
4729
|
xe,
|
|
4626
4730
|
Se
|
|
4627
|
-
]), xr = k(() => _r === null ? yr :
|
|
4731
|
+
]), xr = k(() => _r === null ? yr : Ai(X, q, n, r, U, H, void 0, void 0, i, c, vn, V, xe, Se), [
|
|
4628
4732
|
q,
|
|
4629
4733
|
X,
|
|
4630
4734
|
yr,
|
|
@@ -4664,7 +4768,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4664
4768
|
E(() => {
|
|
4665
4769
|
if (Cr === void 0) return;
|
|
4666
4770
|
let e = performance.now(), t = window.requestAnimationFrame(function n(r) {
|
|
4667
|
-
let i = Math.min(1, (r - e) /
|
|
4771
|
+
let i = Math.min(1, (r - e) / _i);
|
|
4668
4772
|
if (i >= 1 || document.hidden) {
|
|
4669
4773
|
sr((e) => e?.id === Cr ? null : e);
|
|
4670
4774
|
return;
|
|
@@ -4778,7 +4882,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4778
4882
|
let i = We.current ?? r.getBoundingClientRect();
|
|
4779
4883
|
if (We.current = i, !i.width || !i.height) return null;
|
|
4780
4884
|
let a = (e.clientX - i.left) / i.width * H.width;
|
|
4781
|
-
return !t && (a < n.plot.left - 8 || a > n.plot.right + 8) ? null :
|
|
4885
|
+
return !t && (a < n.plot.left - 8 || a > n.plot.right + 8) ? null : ni(n.data.rows, n.xDomain, a, n.xToPixel);
|
|
4782
4886
|
}, [H.width, Z]), Nr = w((e) => {
|
|
4783
4887
|
let t = Z?.data.rows[e];
|
|
4784
4888
|
if (!Z || !t) return [];
|
|
@@ -4825,7 +4929,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4825
4929
|
We.current = r;
|
|
4826
4930
|
let i = (t - r.left) / r.width * H.width, a = (n - r.top) / r.height * H.height, o = Nr(e);
|
|
4827
4931
|
if (!o.length) return;
|
|
4828
|
-
let s = !(!c.bars || c.stack), l = s ? o.filter((e) => e.line && Math.abs(e.y - a) <=
|
|
4932
|
+
let s = !(!c.bars || c.stack), l = s ? o.filter((e) => e.line && Math.abs(e.y - a) <= hi).sort((e, t) => Math.abs(e.y - a) - Math.abs(t.y - a))[0] : void 0, u = s ? l ? [l] : o.filter((e) => !e.line) : o;
|
|
4829
4933
|
if (!u.length) return;
|
|
4830
4934
|
let d = u.map((e) => ({
|
|
4831
4935
|
id: e.id,
|
|
@@ -4842,7 +4946,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
4842
4946
|
]), Ir = w((e) => {
|
|
4843
4947
|
if (!(nn && Y && !Gt.current)) {
|
|
4844
4948
|
if (Q.current?.pinned && e.pointerType !== "touch") {
|
|
4845
|
-
Z && Pr(
|
|
4949
|
+
Z && Pr(Pi(Z, Q.current.sourceIndex), e.clientX, e.clientY);
|
|
4846
4950
|
return;
|
|
4847
4951
|
}
|
|
4848
4952
|
Vt.current = e, Bt.current === null && (Bt.current = window.requestAnimationFrame(() => {
|
|
@@ -5033,15 +5137,15 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5033
5137
|
E(() => () => {
|
|
5034
5138
|
cr.current !== null && window.clearTimeout(cr.current);
|
|
5035
5139
|
}, []);
|
|
5036
|
-
let
|
|
5140
|
+
let Xr = w((e) => {
|
|
5037
5141
|
cr.current !== null && window.clearTimeout(cr.current), cr.current = null, tr(null), ar(!1), R ? R.setFocus(e) : Un(e), en.onChange?.(e);
|
|
5038
|
-
}, [R, en]),
|
|
5039
|
-
Br(null), Wn &&
|
|
5142
|
+
}, [R, en]), Qr = w(() => {
|
|
5143
|
+
Br(null), Wn && Xr(null), On(null), An(null);
|
|
5040
5144
|
}, [
|
|
5041
5145
|
Wn,
|
|
5042
5146
|
Br,
|
|
5043
|
-
|
|
5044
|
-
]),
|
|
5147
|
+
Xr
|
|
5148
|
+
]), ei = w(() => {
|
|
5045
5149
|
if (Ln.current) {
|
|
5046
5150
|
Vr();
|
|
5047
5151
|
return;
|
|
@@ -5059,23 +5163,23 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5059
5163
|
return;
|
|
5060
5164
|
}
|
|
5061
5165
|
if (Wn) {
|
|
5062
|
-
|
|
5166
|
+
Xr(null);
|
|
5063
5167
|
return;
|
|
5064
5168
|
}
|
|
5065
5169
|
if (Y) {
|
|
5066
|
-
|
|
5170
|
+
Qr();
|
|
5067
5171
|
return;
|
|
5068
5172
|
}
|
|
5069
5173
|
kr();
|
|
5070
5174
|
}, [
|
|
5071
5175
|
Vr,
|
|
5072
|
-
|
|
5176
|
+
Qr,
|
|
5073
5177
|
kr,
|
|
5074
5178
|
kn,
|
|
5075
5179
|
Dn,
|
|
5076
5180
|
Y,
|
|
5077
5181
|
Wn,
|
|
5078
|
-
|
|
5182
|
+
Xr,
|
|
5079
5183
|
Jt
|
|
5080
5184
|
]);
|
|
5081
5185
|
E(() => {
|
|
@@ -5087,11 +5191,11 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5087
5191
|
let e = n.closest("[data-lilt-chart]");
|
|
5088
5192
|
if (e && e !== t) return;
|
|
5089
5193
|
}
|
|
5090
|
-
n instanceof Element && n.closest("[role=\"dialog\"]") && !t.contains(n) || (t.contains(n) || Lr.current) && (e.preventDefault(), n instanceof Element && n.closest(".lilt-chart__tooltip, .lilt-chart__adaptive-custom, .lilt-chart__comparison-tooltip") && Ve.current?.focus({ preventScroll: !0 }),
|
|
5194
|
+
n instanceof Element && n.closest("[role=\"dialog\"]") && !t.contains(n) || (t.contains(n) || Lr.current) && (e.preventDefault(), n instanceof Element && n.closest(".lilt-chart__tooltip, .lilt-chart__adaptive-custom, .lilt-chart__comparison-tooltip") && Ve.current?.focus({ preventScroll: !0 }), ei());
|
|
5091
5195
|
}
|
|
5092
5196
|
};
|
|
5093
5197
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
5094
|
-
}, [
|
|
5198
|
+
}, [ei]);
|
|
5095
5199
|
let ai = w(() => {
|
|
5096
5200
|
Yr(() => {
|
|
5097
5201
|
Xn(null), Kn(!0), kr(), tn.onFollowingChange?.(!0);
|
|
@@ -5100,7 +5204,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5100
5204
|
kr,
|
|
5101
5205
|
tn,
|
|
5102
5206
|
Yr
|
|
5103
|
-
]),
|
|
5207
|
+
]), oi = X?.rows.at(-1)?.x, ci = qn && X ? X.rows.filter((e) => e.x > qn[1]).length : 0, li = w((e) => {
|
|
5104
5208
|
fe || fn(e), pe?.(e);
|
|
5105
5209
|
}, [pe, fe]), ui = w((e) => {
|
|
5106
5210
|
gn(null), li(e);
|
|
@@ -5126,10 +5230,10 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5126
5230
|
i
|
|
5127
5231
|
]), pi = w(() => {
|
|
5128
5232
|
gn(null), li(i.map((e) => e.id));
|
|
5129
|
-
}, [li, i]),
|
|
5233
|
+
}, [li, i]), mi = ["lilt-chart__plot-host", m].filter(Boolean).join(" "), bi = {
|
|
5130
5234
|
...h,
|
|
5131
5235
|
"--lilt-chart-height": `${H.height || a}px`
|
|
5132
|
-
},
|
|
5236
|
+
}, wi = T(Vn), Fi = !!(G && G.rows.length > 0 && !Fe(G)), Ii = Tt === "empty" || v === "ready" && !!G && (G?.rows.length === 0 || Fi), Li = et.error ?? (v === "error" ? S ?? "Could not load chart data." : null), Ri = mr ? null : K?.kind === "keyed-update" ? "matched-update" : K?.kind ?? (nr ? "matched-update" : null), zi = mr ? 0 : K?.duration ?? (nr ? 420 : 0), Bi = P && !W && Ri === "initial";
|
|
5133
5237
|
Dt && !jt && v === "loading" && (It.current = /* @__PURE__ */ I(In, {
|
|
5134
5238
|
bottom: U.bottom,
|
|
5135
5239
|
height: H.height,
|
|
@@ -5186,7 +5290,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5186
5290
|
_
|
|
5187
5291
|
], f = Ki.current.get(a);
|
|
5188
5292
|
if (f && f.inputs.length === d.length && f.inputs.every((e, t) => Object.is(e, d[t]))) return f.element;
|
|
5189
|
-
let p =
|
|
5293
|
+
let p = ji(e, t, {
|
|
5190
5294
|
series: i,
|
|
5191
5295
|
x: n,
|
|
5192
5296
|
y: r,
|
|
@@ -5217,7 +5321,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5217
5321
|
inputs: d,
|
|
5218
5322
|
element: m
|
|
5219
5323
|
}), m;
|
|
5220
|
-
}, Ji = k(() => Z?.data.rows.filter((e) => e.x >= Z.xDomain[0] && e.x <= Z.xDomain[1]), [Z]), Yi = Ji?.[0], Xi = Ji?.at(-1), Zi = Yi && Z ?
|
|
5324
|
+
}, Ji = k(() => Z?.data.rows.filter((e) => e.x >= Z.xDomain[0] && e.x <= Z.xDomain[1]), [Z]), Yi = Ji?.[0], Xi = Ji?.at(-1), Zi = Yi && Z ? Pi(Z, Yi.sourceIndex) : 0, Qi = Xi && Z ? Pi(Z, Xi.sourceIndex) : 0, $i = wr && Z && wr.x >= Z.xDomain[0] && wr.x <= Z.xDomain[1] ? wr : null, ea = $i && Z ? Pi(Z, $i.sourceIndex) : Qi, ta = q.find((e) => e.id === Rr), na = mn.length === 0, ra = $i?.row ?? Xi?.datum ?? null, ia = $i?.x ?? Xi?.x, aa = ra && ia !== void 0 && Z ? `${Z.formatX(ia)} · ${q.map((e) => `${e.label} ${Ni(e, ra, Z.formatValue)}`).join(" · ")}` : na ? "No series selected" : "No observation available", oa = Qt.inspection?.ownerId === si, sa = !(!Qt.inspection || Qt.inspection.ownerId === Zt || z && Qt.inspection.ownerId === "model"), ca = (J ? {
|
|
5221
5325
|
startX: J.baselineX,
|
|
5222
5326
|
endX: J.probeX
|
|
5223
5327
|
} : kn ?? (Dn !== null && wr ? {
|
|
@@ -5229,7 +5333,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5229
5333
|
} : kn ?? {
|
|
5230
5334
|
startX: Dn,
|
|
5231
5335
|
endX: wr.x
|
|
5232
|
-
}, Rr, $t.percentage) : null, la = nn && x ? ca ?? zr : null, ua = la?.startX, da = la?.endX, fa = Z?.formatValue,
|
|
5336
|
+
}, Rr, $t.percentage) : null, la = nn && x ? ca ?? zr : null, ua = la?.startX, da = la?.endX, fa = Z?.formatValue, pa = k(() => ua !== void 0 && da !== void 0 && X && fa ? He(X, {
|
|
5233
5337
|
startX: ua,
|
|
5234
5338
|
endX: da
|
|
5235
5339
|
}, q, fa, $t.percentage) : [], [
|
|
@@ -5239,7 +5343,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5239
5343
|
q,
|
|
5240
5344
|
fa,
|
|
5241
5345
|
$t.percentage
|
|
5242
|
-
]),
|
|
5346
|
+
]), $ = ua === void 0 ? "" : Z?.formatX(ua) ?? "", ma = da === void 0 ? "" : Z?.formatX(da) ?? "", ha = ca ? "preview" : "complete", ga = !!Wn, _a = k(() => ua === void 0 || da === void 0 || pa.length === 0 ? null : {
|
|
5243
5347
|
kind: "range",
|
|
5244
5348
|
startRow: X?.rows.find((e) => e.x === ua)?.datum ?? null,
|
|
5245
5349
|
endRow: X?.rows.find((e) => e.x === da)?.datum ?? null,
|
|
@@ -5248,20 +5352,20 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5248
5352
|
percentagePolicy: $t.percentage ?? "positive-baseline",
|
|
5249
5353
|
startX: ua,
|
|
5250
5354
|
endX: da,
|
|
5251
|
-
formattedStartX:
|
|
5355
|
+
formattedStartX: $,
|
|
5252
5356
|
formattedEndX: ma,
|
|
5253
5357
|
elapsed: Math.abs(da - ua),
|
|
5254
5358
|
phase: ha,
|
|
5255
5359
|
focused: ga,
|
|
5256
|
-
series:
|
|
5360
|
+
series: pa
|
|
5257
5361
|
}, [
|
|
5258
5362
|
ua,
|
|
5259
5363
|
da,
|
|
5260
|
-
|
|
5364
|
+
$,
|
|
5261
5365
|
ma,
|
|
5262
5366
|
ha,
|
|
5263
5367
|
ga,
|
|
5264
|
-
|
|
5368
|
+
pa,
|
|
5265
5369
|
X,
|
|
5266
5370
|
$t.percentage
|
|
5267
5371
|
]), va = A($t.onChange);
|
|
@@ -5272,20 +5376,20 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5272
5376
|
..._a,
|
|
5273
5377
|
motion: W ? "none" : "auto",
|
|
5274
5378
|
clear: () => {
|
|
5275
|
-
_a.phase === "preview" ?
|
|
5379
|
+
_a.phase === "preview" ? ei() : Qr(), Ve.current?.focus({ preventScroll: !0 });
|
|
5276
5380
|
},
|
|
5277
|
-
focus: _a.phase === "complete" && an && !_a.focused ? () =>
|
|
5381
|
+
focus: _a.phase === "complete" && an && !_a.focused ? () => Xr({
|
|
5278
5382
|
startX: _a.startX,
|
|
5279
5383
|
endX: _a.endX
|
|
5280
5384
|
}) : void 0,
|
|
5281
|
-
fullRange: _a.phase === "complete" && _a.focused ? () =>
|
|
5385
|
+
fullRange: _a.phase === "complete" && _a.focused ? () => Xr(null) : void 0
|
|
5282
5386
|
} : null, [
|
|
5283
5387
|
_a,
|
|
5284
5388
|
W,
|
|
5285
|
-
|
|
5286
|
-
|
|
5389
|
+
ei,
|
|
5390
|
+
Qr,
|
|
5287
5391
|
an,
|
|
5288
|
-
|
|
5392
|
+
Xr
|
|
5289
5393
|
]), ba = () => {
|
|
5290
5394
|
if (!Q.current?.pinned || !nn) return;
|
|
5291
5395
|
let e = Q.current.x;
|
|
@@ -5366,7 +5470,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5366
5470
|
},
|
|
5367
5471
|
onBlur: () => bt(!1),
|
|
5368
5472
|
onKeyDown: (e) => {
|
|
5369
|
-
if (bt(!0), e.key === "Escape" && (e.preventDefault(),
|
|
5473
|
+
if (bt(!0), e.key === "Escape" && (e.preventDefault(), ei()), (e.key === "ArrowUp" || e.key === "ArrowDown") && ve === "nearest" && q.length > 1 && !J) {
|
|
5370
5474
|
let t = Nr(Number(e.currentTarget.value));
|
|
5371
5475
|
if (t.length > 1) {
|
|
5372
5476
|
e.preventDefault();
|
|
@@ -5448,7 +5552,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5448
5552
|
},
|
|
5449
5553
|
onReleaseInspect: kr,
|
|
5450
5554
|
onFocus: (e) => {
|
|
5451
|
-
Cn(e), e && !Q.current?.pinned && !Q.current && Xi && Z && jr(
|
|
5555
|
+
Cn(e), e && !Q.current?.pinned && !Q.current && Xi && Z && jr(Pi(Z, Xi.sourceIndex), !1), !e && !Q.current?.pinned && kr();
|
|
5452
5556
|
},
|
|
5453
5557
|
onVisibleChange: ui,
|
|
5454
5558
|
isolatedId: hn?.id ?? null,
|
|
@@ -5536,11 +5640,11 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5536
5640
|
pressed: !!(J || Dn !== null),
|
|
5537
5641
|
onClick: () => {
|
|
5538
5642
|
if (zr) {
|
|
5539
|
-
|
|
5643
|
+
Qr();
|
|
5540
5644
|
return;
|
|
5541
5645
|
}
|
|
5542
5646
|
if (J || Dn !== null) {
|
|
5543
|
-
|
|
5647
|
+
ei();
|
|
5544
5648
|
return;
|
|
5545
5649
|
}
|
|
5546
5650
|
let e = Q.current ? Z.data.rows.findIndex((e) => e.x === Q.current.x) : Zi, t = Z.data.rows[Math.max(Zi, e)];
|
|
@@ -5560,7 +5664,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5560
5664
|
range: Wn,
|
|
5561
5665
|
seriesId: q[0].id,
|
|
5562
5666
|
reducedMotion: W,
|
|
5563
|
-
onFocus:
|
|
5667
|
+
onFocus: Xr
|
|
5564
5668
|
} : null,
|
|
5565
5669
|
legend: Aa
|
|
5566
5670
|
});
|
|
@@ -5572,7 +5676,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5572
5676
|
"data-lilt-axis-x": De.x,
|
|
5573
5677
|
"data-lilt-axis-y": De.y,
|
|
5574
5678
|
"data-lilt-pill": Te,
|
|
5575
|
-
className:
|
|
5679
|
+
className: mi,
|
|
5576
5680
|
"data-lilt-focused": Wn ? "true" : void 0,
|
|
5577
5681
|
"data-lilt-inspecting": x && wr ? "true" : "false",
|
|
5578
5682
|
"data-lilt-live": un ? Gn ? "following" : "paused" : void 0,
|
|
@@ -5583,7 +5687,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5583
5687
|
"data-lilt-adaptive": Ye || sa ? "true" : void 0,
|
|
5584
5688
|
"data-lilt-fill": Ke ? "true" : void 0,
|
|
5585
5689
|
ref: Ve,
|
|
5586
|
-
style:
|
|
5690
|
+
style: bi,
|
|
5587
5691
|
tabIndex: -1,
|
|
5588
5692
|
children: [
|
|
5589
5693
|
/* @__PURE__ */ L("svg", {
|
|
@@ -5599,7 +5703,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5599
5703
|
},
|
|
5600
5704
|
onKeyDown: (e) => {
|
|
5601
5705
|
if (e.key === "Escape") {
|
|
5602
|
-
e.preventDefault(),
|
|
5706
|
+
e.preventDefault(), ei();
|
|
5603
5707
|
return;
|
|
5604
5708
|
}
|
|
5605
5709
|
if (!d || ![
|
|
@@ -5609,7 +5713,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5609
5713
|
"End"
|
|
5610
5714
|
].includes(e.key)) return;
|
|
5611
5715
|
e.preventDefault();
|
|
5612
|
-
let t = Q.current && Z ?
|
|
5716
|
+
let t = Q.current && Z ? Pi(Z, Q.current.sourceIndex) : Qi, n = e.key === "Home" ? Zi : e.key === "End" ? Qi : Math.min(Qi, Math.max(Zi, t + (e.key === "ArrowRight" ? 1 : -1)));
|
|
5613
5717
|
jr(n, !1);
|
|
5614
5718
|
},
|
|
5615
5719
|
onClick: (e) => {
|
|
@@ -5626,7 +5730,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5626
5730
|
return;
|
|
5627
5731
|
}
|
|
5628
5732
|
if (nn && Y && !Wn && an && n !== void 0 && n >= Math.min(Y.startX, Y.endX) && n <= Math.max(Y.startX, Y.endX)) {
|
|
5629
|
-
|
|
5733
|
+
Xr(Y);
|
|
5630
5734
|
return;
|
|
5631
5735
|
}
|
|
5632
5736
|
if (nn && Y) return;
|
|
@@ -5817,7 +5921,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5817
5921
|
panel: !!f && !d,
|
|
5818
5922
|
peer: sa && !oa
|
|
5819
5923
|
}) : null,
|
|
5820
|
-
/* @__PURE__ */ I(ee, { children: Z && $i?.pinned && !d && (!sa || oa) && !J && !zr ? /* @__PURE__ */ I(
|
|
5924
|
+
/* @__PURE__ */ I(ee, { children: Z && $i?.pinned && !d && (!sa || oa) && !J && !zr ? /* @__PURE__ */ I(ti, {
|
|
5821
5925
|
left: Z.xToPixel($i.x) - 12,
|
|
5822
5926
|
top: Math.max(0, Z.plot.top - 24 - 4),
|
|
5823
5927
|
reducedMotion: W,
|
|
@@ -5826,10 +5930,11 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5826
5930
|
local: !oa && Dr.current,
|
|
5827
5931
|
onRelease: kr
|
|
5828
5932
|
}, "pin") : null }),
|
|
5829
|
-
Z && la ? /* @__PURE__ */ I(
|
|
5933
|
+
Z && la ? /* @__PURE__ */ I(Zr, {
|
|
5830
5934
|
comparison: la,
|
|
5831
|
-
rows:
|
|
5935
|
+
rows: pa,
|
|
5832
5936
|
preview: !(!ca || Pn),
|
|
5937
|
+
ranging: !!ca || Pn !== null,
|
|
5833
5938
|
reducedMotion: W,
|
|
5834
5939
|
snapshot: Z,
|
|
5835
5940
|
onEndpointPointerDown: xa,
|
|
@@ -5839,7 +5944,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5839
5944
|
onEndpointCommit: Wr,
|
|
5840
5945
|
onEndpointKeyDown: wa
|
|
5841
5946
|
}) : null,
|
|
5842
|
-
f ? /* @__PURE__ */ I(
|
|
5947
|
+
f ? /* @__PURE__ */ I($r, {
|
|
5843
5948
|
value: {
|
|
5844
5949
|
inspection: Z && $i && !la ? (() => {
|
|
5845
5950
|
let e = Z.data.rows.find((e) => e.sourceIndex === $i.sourceIndex && e.x === $i.x);
|
|
@@ -5881,11 +5986,11 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5881
5986
|
}) : null,
|
|
5882
5987
|
Ii ? /* @__PURE__ */ I(Jn, {
|
|
5883
5988
|
state: b,
|
|
5884
|
-
shape:
|
|
5989
|
+
shape: wi,
|
|
5885
5990
|
message: Fi ? "No values for this period" : "No data for this period"
|
|
5886
5991
|
}) : null,
|
|
5887
5992
|
na ? /* @__PURE__ */ I(Jn, {
|
|
5888
|
-
shape:
|
|
5993
|
+
shape: wi,
|
|
5889
5994
|
message: "No series selected"
|
|
5890
5995
|
}) : null,
|
|
5891
5996
|
Li ? /* @__PURE__ */ I(zn, {
|
|
@@ -5898,7 +6003,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5898
6003
|
onClick: ai,
|
|
5899
6004
|
type: "button",
|
|
5900
6005
|
children: [ci > 0 ? `${ci} new ${ci === 1 ? "point" : "points"} · ` : "", tn.returnLabel ?? "Return to live"]
|
|
5901
|
-
}) : un &&
|
|
6006
|
+
}) : un && oi !== void 0 ? /* @__PURE__ */ I("span", {
|
|
5902
6007
|
className: "lilt-chart__live-badge",
|
|
5903
6008
|
children: tn.label ?? "Live"
|
|
5904
6009
|
}) : null
|
|
@@ -5908,7 +6013,7 @@ function Pi({ data: t, x: n, y: r = _i, series: i, height: a = 340, compactHeigh
|
|
|
5908
6013
|
}
|
|
5909
6014
|
//#endregion
|
|
5910
6015
|
//#region src/primitives/hover-band.tsx
|
|
5911
|
-
function
|
|
6016
|
+
function Ii() {
|
|
5912
6017
|
let e = `lilt-band-${D().replaceAll(":", "")}`, { snapshot: t } = Gt(), n = ot(), r = t.data.rows, i = r.length > 1 ? Math.abs(t.xToPixel(r[1].x) - t.xToPixel(r[0].x)) : t.plot.width, a = Math.min(i, Math.max(t.columnWidth + 8, i * .86)), o = F(n.columnX, (e) => e - a / 2), s = F(n.columnColor, (e) => e || "var(--lilt-series-1)");
|
|
5913
6018
|
if (!t.bars && !t.columns.length) return null;
|
|
5914
6019
|
let { top: c, height: l } = t.plot;
|
|
@@ -5952,13 +6057,13 @@ function Fi() {
|
|
|
5952
6057
|
}
|
|
5953
6058
|
//#endregion
|
|
5954
6059
|
//#region src/primitives/plot-background.tsx
|
|
5955
|
-
var
|
|
6060
|
+
var Li = {
|
|
5956
6061
|
dots: 12,
|
|
5957
6062
|
grid: 16,
|
|
5958
6063
|
lines: 20
|
|
5959
|
-
},
|
|
5960
|
-
function
|
|
5961
|
-
let n = `lilt-bg-${D().replaceAll(":", "")}`, { snapshot: r, revealProgress: i, transitionDuration: a, reducedMotion: o } = Gt(), s = ot(), { left: c, top: l, width: u, height: d } = r.plot, f =
|
|
6064
|
+
}, Ri = 110;
|
|
6065
|
+
function zi({ kind: e, spotlight: t = !0 }) {
|
|
6066
|
+
let n = `lilt-bg-${D().replaceAll(":", "")}`, { snapshot: r, revealProgress: i, transitionDuration: a, reducedMotion: o } = Gt(), s = ot(), { left: c, top: l, width: u, height: d } = r.plot, f = Li[e], p = i < 1 && !o ? rn(i * a, 0, 320) : 1, m = (t) => /* @__PURE__ */ I("g", {
|
|
5962
6067
|
className: `lilt-chart__texture-${t}`,
|
|
5963
6068
|
children: e === "dots" ? /* @__PURE__ */ I("circle", {
|
|
5964
6069
|
cx: f / 2,
|
|
@@ -6032,8 +6137,8 @@ function Ri({ kind: e, spotlight: t = !0 }) {
|
|
|
6032
6137
|
children: /* @__PURE__ */ I(N.ellipse, {
|
|
6033
6138
|
cx: s.pointerX,
|
|
6034
6139
|
cy: s.y,
|
|
6035
|
-
rx:
|
|
6036
|
-
ry:
|
|
6140
|
+
rx: Ri,
|
|
6141
|
+
ry: Ri,
|
|
6037
6142
|
fill: `url(#${n}-spot-fade)`
|
|
6038
6143
|
})
|
|
6039
6144
|
})] }) : null
|
|
@@ -6062,7 +6167,7 @@ function Ri({ kind: e, spotlight: t = !0 }) {
|
|
|
6062
6167
|
}
|
|
6063
6168
|
//#endregion
|
|
6064
6169
|
//#region src/interaction/comparison-tooltip.tsx
|
|
6065
|
-
function
|
|
6170
|
+
function Bi({ comparison: e, renderContent: t, startX: n, endX: r, top: i, width: a, height: o, className: s, ariaLabel: c }) {
|
|
6066
6171
|
let l = A(null), [u, d] = j(null);
|
|
6067
6172
|
O(() => {
|
|
6068
6173
|
let e = l.current;
|
|
@@ -6100,7 +6205,7 @@ function zi({ comparison: e, renderContent: t, startX: n, endX: r, top: i, width
|
|
|
6100
6205
|
}
|
|
6101
6206
|
//#endregion
|
|
6102
6207
|
//#region src/interaction/adaptive-readout.tsx
|
|
6103
|
-
function
|
|
6208
|
+
function Vi({ snapshot: e, series: t, selection: n, sharedX: r, peer: i, pinned: a, onRelease: o, onCompareFromHere: s, renderContent: c, reducedMotion: l }) {
|
|
6104
6209
|
let u = n ? e.data.rows.find((e) => e.x === n.x) : null, d = e.data.rows.at(-1), f = r === void 0 ? u ?? d : u, p = r ?? f?.x, m = p === void 0 ? "No observation" : e.formatX(p), h = r !== void 0 && f && f.x !== r, g = e.stack?.series ?? [], _ = g.length > 0, v = t.filter((e) => g.includes(e.id)).map((e) => f?.values[e.id] ?? null), y = _ && v.length > 0 && v.every((e) => e !== null) ? v.reduce((e, t) => e + (t ?? 0), 0) : null, b = l ? 0 : 150;
|
|
6105
6210
|
return /* @__PURE__ */ L("div", {
|
|
6106
6211
|
className: "lilt-chart__adaptive-readout",
|
|
@@ -6166,8 +6271,8 @@ function Bi({ snapshot: e, series: t, selection: n, sharedX: r, peer: i, pinned:
|
|
|
6166
6271
|
}
|
|
6167
6272
|
//#endregion
|
|
6168
6273
|
//#region src/interaction/tooltip.tsx
|
|
6169
|
-
function
|
|
6170
|
-
let t =
|
|
6274
|
+
function Hi(e = {}) {
|
|
6275
|
+
let t = ei(), n = De(), r = A(null), [i, a] = j(0), o = A(null), [s, c] = j(0);
|
|
6171
6276
|
if (O(() => {
|
|
6172
6277
|
let e = r.current;
|
|
6173
6278
|
e && e.offsetWidth !== i && a(e.offsetWidth);
|
|
@@ -6175,7 +6280,7 @@ function Vi(e = {}) {
|
|
|
6175
6280
|
t !== s && c(t);
|
|
6176
6281
|
}), e.model && e.model !== n.model) throw Error("Lilt Tooltip model must be the model supplied to its Chart.");
|
|
6177
6282
|
if (e.floating === !1) return null;
|
|
6178
|
-
if (t.comparison) return e.renderComparison ? /* @__PURE__ */ I(
|
|
6283
|
+
if (t.comparison) return e.renderComparison ? /* @__PURE__ */ I(Bi, {
|
|
6179
6284
|
comparison: t.comparison,
|
|
6180
6285
|
renderContent: e.renderComparison,
|
|
6181
6286
|
startX: t.compareStartX,
|
|
@@ -6186,7 +6291,7 @@ function Vi(e = {}) {
|
|
|
6186
6291
|
className: e.className,
|
|
6187
6292
|
ariaLabel: e["aria-label"]
|
|
6188
6293
|
}) : null;
|
|
6189
|
-
if (e.adaptive !== !1 && !t.compact && (t.narrow || t.peer)) return t.adaptive ? /* @__PURE__ */ I(
|
|
6294
|
+
if (e.adaptive !== !1 && !t.compact && (t.narrow || t.peer)) return t.adaptive ? /* @__PURE__ */ I(Vi, {
|
|
6190
6295
|
...t.adaptive,
|
|
6191
6296
|
renderContent: e.renderContent
|
|
6192
6297
|
}) : null;
|
|
@@ -6380,11 +6485,11 @@ function Vi(e = {}) {
|
|
|
6380
6485
|
}
|
|
6381
6486
|
//#endregion
|
|
6382
6487
|
//#region src/marks/contract.ts
|
|
6383
|
-
var
|
|
6384
|
-
function
|
|
6385
|
-
return
|
|
6488
|
+
var Ui = /* @__PURE__ */ new WeakMap();
|
|
6489
|
+
function Wi(e, t) {
|
|
6490
|
+
return Ui.set(e, t), e;
|
|
6386
6491
|
}
|
|
6387
|
-
function
|
|
6492
|
+
function Gi(e) {
|
|
6388
6493
|
let t = [], n = (e) => {
|
|
6389
6494
|
y.forEach(e, (e) => {
|
|
6390
6495
|
if (!C(e)) return;
|
|
@@ -6393,7 +6498,7 @@ function Wi(e) {
|
|
|
6393
6498
|
n(r.children);
|
|
6394
6499
|
return;
|
|
6395
6500
|
}
|
|
6396
|
-
let i = typeof e.type == "function" ?
|
|
6501
|
+
let i = typeof e.type == "function" ? Ui.get(e.type) : void 0;
|
|
6397
6502
|
i && t.push({
|
|
6398
6503
|
series: i.series(r),
|
|
6399
6504
|
layout: i.layout,
|
|
@@ -6406,7 +6511,7 @@ function Wi(e) {
|
|
|
6406
6511
|
};
|
|
6407
6512
|
return n(e), t;
|
|
6408
6513
|
}
|
|
6409
|
-
function
|
|
6514
|
+
function Ki(e, t, n, r) {
|
|
6410
6515
|
let i = t.findIndex((e) => e.id === n), a = t[i];
|
|
6411
6516
|
if (!a) throw Error(`Lilt ${e} references unknown series "${n}".`);
|
|
6412
6517
|
let o = r.filter((e) => !a.fields?.[e]);
|
|
@@ -6416,7 +6521,7 @@ function Gi(e, t, n, r) {
|
|
|
6416
6521
|
index: i
|
|
6417
6522
|
};
|
|
6418
6523
|
}
|
|
6419
|
-
function
|
|
6524
|
+
function qi(e, t, n) {
|
|
6420
6525
|
let r = e.fields[t], i = [];
|
|
6421
6526
|
for (let e of n) {
|
|
6422
6527
|
let t = r?.[e];
|
|
@@ -6425,27 +6530,27 @@ function Ki(e, t, n) {
|
|
|
6425
6530
|
}
|
|
6426
6531
|
return i;
|
|
6427
6532
|
}
|
|
6428
|
-
function
|
|
6533
|
+
function Ji(e, t, n) {
|
|
6429
6534
|
return e.colorAt?.(t.datum) ?? n;
|
|
6430
6535
|
}
|
|
6431
6536
|
//#endregion
|
|
6432
6537
|
//#region src/chart-plot.tsx
|
|
6433
|
-
function
|
|
6538
|
+
function Yi(e, t) {
|
|
6434
6539
|
if (!Number.isFinite(t) || t <= 0) throw Error(`Lilt ${e} must be a positive finite number; received ${t}.`);
|
|
6435
6540
|
}
|
|
6436
|
-
function
|
|
6437
|
-
n !== "fill" &&
|
|
6541
|
+
function Xi({ model: e, children: t, height: n = 340, compactHeight: r, margins: i, bars: a, stack: o, compact: s = !1, tooltip: c, inspectionSeries: l, className: u, style: d, axis: f, pill: p, pillSeries: m, pillValue: h, pillPosition: g, background: _ = "none", spotlight: v = !0, axisInset: y, runoff: b, labelOverhang: x, slots: S = !1, decimate: w }) {
|
|
6542
|
+
n !== "fill" && Yi("ChartPlot height", n), r !== void 0 && Yi("ChartPlot compactHeight", r);
|
|
6438
6543
|
let T = a === !0 ? {} : a;
|
|
6439
6544
|
if (T) {
|
|
6440
|
-
T.width !== void 0 &&
|
|
6545
|
+
T.width !== void 0 && Yi("ChartPlot bars.width", T.width);
|
|
6441
6546
|
for (let [e, t] of [["gap", T.gap], ["segmentGap", T.segmentGap]]) if (t !== void 0 && (!Number.isFinite(t) || t < 0)) throw Error(`Lilt ChartPlot bars.${e} must be a non-negative finite number; received ${t}.`);
|
|
6442
6547
|
}
|
|
6443
|
-
let E = De(), D = k(() =>
|
|
6548
|
+
let E = De(), D = k(() => Gi(t), [t]);
|
|
6444
6549
|
if (e && e !== E.model) throw Error("Lilt ChartPlot model must be the model supplied to its Chart.");
|
|
6445
|
-
let O =
|
|
6550
|
+
let O = Qi(E.props.series.map((e) => e.id), T, o, D, S);
|
|
6446
6551
|
if (E.props.x.type === "category" && (E.linked || E.props.compare || E.props.focus || E.props.live || E.props.brush)) throw Error("Category plots support inspection and visibility; time-range comparison, focus, live, brush and linked controllers require numeric or time x.");
|
|
6447
|
-
let A = c === !1 || c === void 0 ? null : C(c) ? c : /* @__PURE__ */ I(
|
|
6448
|
-
return /* @__PURE__ */ L(
|
|
6552
|
+
let A = c === !1 || c === void 0 ? null : C(c) ? c : /* @__PURE__ */ I(Hi, { ...c });
|
|
6553
|
+
return /* @__PURE__ */ L(Fi, {
|
|
6449
6554
|
...E.props,
|
|
6450
6555
|
className: u,
|
|
6451
6556
|
compactHeight: r,
|
|
@@ -6472,22 +6577,22 @@ function Yi({ model: e, children: t, height: n = 340, compactHeight: r, margins:
|
|
|
6472
6577
|
labelOverhang: x,
|
|
6473
6578
|
decimate: w,
|
|
6474
6579
|
children: [
|
|
6475
|
-
_ === "none" ? null : /* @__PURE__ */ I(
|
|
6580
|
+
_ === "none" ? null : /* @__PURE__ */ I(zi, {
|
|
6476
6581
|
kind: _,
|
|
6477
6582
|
spotlight: v
|
|
6478
6583
|
}),
|
|
6479
|
-
v ? /* @__PURE__ */ I(
|
|
6584
|
+
v ? /* @__PURE__ */ I(Ii, {}) : null,
|
|
6480
6585
|
t
|
|
6481
6586
|
]
|
|
6482
6587
|
});
|
|
6483
6588
|
}
|
|
6484
|
-
function
|
|
6589
|
+
function Zi(e, t, n) {
|
|
6485
6590
|
if (new Set(t).size !== t.length || t.some((e) => !n.includes(e))) throw Error(`Lilt ChartPlot ${e} must list unique IDs from the chart series.`);
|
|
6486
6591
|
}
|
|
6487
|
-
function
|
|
6592
|
+
function Qi(e, t, n, r, i) {
|
|
6488
6593
|
let a = n === void 0 ? void 0 : n === !0 ? {} : typeof n == "string" ? { mode: n } : n;
|
|
6489
|
-
if (a?.series && (
|
|
6490
|
-
t?.series &&
|
|
6594
|
+
if (a?.series && (Zi("stack.series", a.series, e), !a.series.length)) throw Error("Lilt ChartPlot stack.series must not be empty.");
|
|
6595
|
+
t?.series && Zi("bars.series", t.series, e);
|
|
6491
6596
|
let o = a ? e.filter((e) => !a.series || a.series.includes(e)) : null;
|
|
6492
6597
|
if (o && t?.series && (t.series.length !== o.length || t.series.some((e) => !o.includes(e)))) throw Error("Lilt ChartPlot stacked bars draw exactly the stacked series; other series draw as lines.");
|
|
6493
6598
|
let s = t ? o ?? e.filter((e) => !t.series || t.series.includes(e)) : null, c = [...new Set(r.filter((e) => e.layout === "column").map((e) => e.series))];
|
|
@@ -6508,8 +6613,8 @@ function Zi(e, t, n, r, i) {
|
|
|
6508
6613
|
}
|
|
6509
6614
|
//#endregion
|
|
6510
6615
|
//#region src/primitives/runoff.tsx
|
|
6511
|
-
var
|
|
6512
|
-
function
|
|
6616
|
+
var $i = .32;
|
|
6617
|
+
function ea(e, t) {
|
|
6513
6618
|
let { plot: n } = e, r = e.xToPixel(e.xDomain[0]), i = e.xToPixel(e.xDomain[1]), a = t.segments[0]?.points[0], o = t.segments.at(-1)?.points.at(-1), s = a && r - n.left > .5 && Math.abs(a.x - r) < .5, c = o && n.right - i > .5 && Math.abs(o.x - i) < .5;
|
|
6514
6619
|
return !s && !c ? null : {
|
|
6515
6620
|
left: s ? n.left : void 0,
|
|
@@ -6518,13 +6623,13 @@ function $i(e, t) {
|
|
|
6518
6623
|
dataEnd: i
|
|
6519
6624
|
};
|
|
6520
6625
|
}
|
|
6521
|
-
function
|
|
6626
|
+
function ta(e, t, n) {
|
|
6522
6627
|
return e ? {
|
|
6523
6628
|
left: t === 0 ? e.left : void 0,
|
|
6524
6629
|
right: t === n - 1 ? e.right : void 0
|
|
6525
6630
|
} : {};
|
|
6526
6631
|
}
|
|
6527
|
-
function
|
|
6632
|
+
function na(e, t, n, r) {
|
|
6528
6633
|
let i = e.get(t);
|
|
6529
6634
|
if (i && i.left === n.left && i.right === n.right) return i.path;
|
|
6530
6635
|
let a = r(t, n);
|
|
@@ -6534,28 +6639,28 @@ function ta(e, t, n, r) {
|
|
|
6534
6639
|
path: a
|
|
6535
6640
|
}), a;
|
|
6536
6641
|
}
|
|
6537
|
-
var
|
|
6538
|
-
function
|
|
6539
|
-
return
|
|
6642
|
+
var ra = /* @__PURE__ */ new WeakMap(), ia = /* @__PURE__ */ new WeakMap();
|
|
6643
|
+
function aa(e, t) {
|
|
6644
|
+
return na(ra, e, t, oa);
|
|
6540
6645
|
}
|
|
6541
|
-
function
|
|
6646
|
+
function oa(e, { left: t, right: n }) {
|
|
6542
6647
|
let r = e.points[0], i = e.points.at(-1), a = e.path;
|
|
6543
6648
|
return t !== void 0 && (a = `M${t},${r.y} L${a.slice(1)}`), n !== void 0 && (a = `${a} L${n},${i.y}`), a;
|
|
6544
6649
|
}
|
|
6545
|
-
var
|
|
6546
|
-
function
|
|
6547
|
-
return
|
|
6650
|
+
var sa = /(-?[\d.e+-]+),(-?[\d.e+-]+)\s*Z\s*$/, ca = /^\s*L(-?[\d.e+-]+),(-?[\d.e+-]+)/;
|
|
6651
|
+
function la(e, t) {
|
|
6652
|
+
return na(ia, e, t, ua);
|
|
6548
6653
|
}
|
|
6549
|
-
function
|
|
6654
|
+
function ua(e, { left: t, right: n }) {
|
|
6550
6655
|
if (t === void 0 && n === void 0 || !e.areaPath.startsWith(e.path)) return e.areaPath;
|
|
6551
|
-
let r = e.areaPath.slice(e.path.length), i =
|
|
6656
|
+
let r = e.areaPath.slice(e.path.length), i = ca.exec(r), a = sa.exec(r);
|
|
6552
6657
|
if (!i || !a) return e.areaPath;
|
|
6553
6658
|
let o = e.points[0], s = e.points.at(-1), c = e.path;
|
|
6554
6659
|
t !== void 0 && (c = `M${t},${o.y} L${c.slice(1)}`), n !== void 0 && (c = `${c} L${n},${s.y} L${n},${i[2]}`);
|
|
6555
6660
|
let l = t === void 0 ? r : r.replace(/Z\s*$/, `L${t},${a[2]} Z`);
|
|
6556
6661
|
return `${c} ${l.trim()}`;
|
|
6557
6662
|
}
|
|
6558
|
-
function
|
|
6663
|
+
function da(e, t, n) {
|
|
6559
6664
|
let { plot: r } = t;
|
|
6560
6665
|
return [
|
|
6561
6666
|
e,
|
|
@@ -6565,7 +6670,7 @@ function ua(e, t, n) {
|
|
|
6565
6670
|
n.dataEnd
|
|
6566
6671
|
].map((e) => typeof e == "number" ? Math.round(e * 10) : e).join("-");
|
|
6567
6672
|
}
|
|
6568
|
-
function
|
|
6673
|
+
function fa({ id: e, snapshot: t, edges: n }) {
|
|
6569
6674
|
let { plot: r } = t, i = Math.max(1, r.right - r.left), a = (e) => Math.min(1, Math.max(0, (e - r.left) / i));
|
|
6570
6675
|
return /* @__PURE__ */ L("defs", { children: [/* @__PURE__ */ L("linearGradient", {
|
|
6571
6676
|
id: `${e}-ramp`,
|
|
@@ -6578,7 +6683,7 @@ function da({ id: e, snapshot: t, edges: n }) {
|
|
|
6578
6683
|
/* @__PURE__ */ I("stop", {
|
|
6579
6684
|
offset: 0,
|
|
6580
6685
|
stopColor: "white",
|
|
6581
|
-
stopOpacity: n.left === void 0 ? 1 :
|
|
6686
|
+
stopOpacity: n.left === void 0 ? 1 : $i
|
|
6582
6687
|
}),
|
|
6583
6688
|
/* @__PURE__ */ I("stop", {
|
|
6584
6689
|
offset: a(n.dataStart),
|
|
@@ -6591,7 +6696,7 @@ function da({ id: e, snapshot: t, edges: n }) {
|
|
|
6591
6696
|
/* @__PURE__ */ I("stop", {
|
|
6592
6697
|
offset: 1,
|
|
6593
6698
|
stopColor: "white",
|
|
6594
|
-
stopOpacity: n.right === void 0 ? 1 :
|
|
6699
|
+
stopOpacity: n.right === void 0 ? 1 : $i
|
|
6595
6700
|
})
|
|
6596
6701
|
]
|
|
6597
6702
|
}), /* @__PURE__ */ I("mask", {
|
|
@@ -6608,7 +6713,7 @@ function da({ id: e, snapshot: t, edges: n }) {
|
|
|
6608
6713
|
}
|
|
6609
6714
|
//#endregion
|
|
6610
6715
|
//#region src/primitives/area.tsx
|
|
6611
|
-
function
|
|
6716
|
+
function pa({ series: e, className: t, model: n }) {
|
|
6612
6717
|
let r = De(), { runoff: i } = ot();
|
|
6613
6718
|
if (n && n !== r.model) throw Error("Lilt Area model must be the model supplied to its Chart.");
|
|
6614
6719
|
let { snapshot: a, series: o, reducedMotion: s, inspecting: c, paintId: l, focusedSeries: u, visibleSeries: d, revealProgress: f, transitionDuration: p, clipId: m } = Gt(), h = rn(f < 1 ? f * p : Infinity, 40, p * .65), g = (a.drawGeometry ?? a.geometry)?.series[e];
|
|
@@ -6618,7 +6723,7 @@ function fa({ series: e, className: t, model: n }) {
|
|
|
6618
6723
|
className: t,
|
|
6619
6724
|
"data-series": e
|
|
6620
6725
|
});
|
|
6621
|
-
let T = i && !a.stack?.signed ?
|
|
6726
|
+
let T = i && !a.stack?.signed ? ea(a, g) : null, E = T ? da(`${m}-runoff-area-${y}`, a, T) : "", D = T ? /* @__PURE__ */ I(fa, {
|
|
6622
6727
|
id: E,
|
|
6623
6728
|
snapshot: a,
|
|
6624
6729
|
edges: T
|
|
@@ -6644,7 +6749,7 @@ function fa({ series: e, className: t, model: n }) {
|
|
|
6644
6749
|
children: g.segments.map((t, n) => {
|
|
6645
6750
|
let r = t.status === "provisional" ? "hatch" : t.status === "forecast" ? "dots" : C, i = Ve(x, S?.fill, r, l(e, r === "solid" ? "fade" : r));
|
|
6646
6751
|
return /* @__PURE__ */ I("path", {
|
|
6647
|
-
d: T ?
|
|
6752
|
+
d: T ? la(t, ta(T, n, g.segments.length)) : t.areaPath,
|
|
6648
6753
|
"data-lilt-status": t.status && t.status !== "observed" ? t.status : void 0,
|
|
6649
6754
|
fill: i,
|
|
6650
6755
|
mask: S?.fade ? `url(#${l(e, "fade")}-mask)` : void 0,
|
|
@@ -6661,12 +6766,12 @@ function fa({ series: e, className: t, model: n }) {
|
|
|
6661
6766
|
function $(e) {
|
|
6662
6767
|
return Math.round(e * 100) / 100;
|
|
6663
6768
|
}
|
|
6664
|
-
function
|
|
6769
|
+
function ma(e, t, n) {
|
|
6665
6770
|
return e.fields[t]?.[n] ?? null;
|
|
6666
6771
|
}
|
|
6667
|
-
function
|
|
6772
|
+
function ha(e, t, n, r) {
|
|
6668
6773
|
for (let i of t) {
|
|
6669
|
-
let t = r.map((e) => typeof e == "string" ?
|
|
6774
|
+
let t = r.map((e) => typeof e == "string" ? ma(i, n, e) : i.values[n] ?? null);
|
|
6670
6775
|
if (!t.some((e) => e === null)) {
|
|
6671
6776
|
for (let a = 1; a < t.length; a += 1) if (t[a] < t[a - 1]) {
|
|
6672
6777
|
let t = r.map((e) => typeof e == "string" ? e : "value").join(" ≤ ");
|
|
@@ -6675,7 +6780,7 @@ function ma(e, t, n, r) {
|
|
|
6675
6780
|
}
|
|
6676
6781
|
}
|
|
6677
6782
|
}
|
|
6678
|
-
function
|
|
6783
|
+
function ga(e, t, n, r, i) {
|
|
6679
6784
|
let a = [], o = [], s = () => {
|
|
6680
6785
|
if (o.length >= 2) {
|
|
6681
6786
|
let e = o.map((e) => `${$(e.x)},${$(i.y(e.upper))}`), t = o.map((e) => `${$(e.x)},${$(i.y(e.lower))}`).reverse();
|
|
@@ -6684,7 +6789,7 @@ function ha(e, t, n, r, i) {
|
|
|
6684
6789
|
o = [];
|
|
6685
6790
|
};
|
|
6686
6791
|
for (let a of e) {
|
|
6687
|
-
let e =
|
|
6792
|
+
let e = ma(a, t, n), c = ma(a, t, r);
|
|
6688
6793
|
a.x < i.xDomain[0] || a.x > i.xDomain[1] || e === null || c === null ? s() : o.push({
|
|
6689
6794
|
x: i.x(a.x),
|
|
6690
6795
|
lower: e,
|
|
@@ -6693,14 +6798,14 @@ function ha(e, t, n, r, i) {
|
|
|
6693
6798
|
}
|
|
6694
6799
|
return s(), a;
|
|
6695
6800
|
}
|
|
6696
|
-
function
|
|
6801
|
+
function _a(e, t, n, r, i) {
|
|
6697
6802
|
let a = Math.max(0, Math.min(i, n / 2, r / 2));
|
|
6698
6803
|
return a === 0 ? `M${$(e)},${$(t)}h${$(n)}v${$(r)}h${$(-n)}Z` : `M${$(e + a)},${$(t)}h${$(n - 2 * a)}a${a},${a} 0 0 1 ${a},${a}v${$(r - 2 * a)}a${a},${a} 0 0 1 ${-a},${a}h${$(-(n - 2 * a))}a${a},${a} 0 0 1 ${-a},${-a}v${$(-(r - 2 * a))}a${a},${a} 0 0 1 ${a},${-a}Z`;
|
|
6699
6804
|
}
|
|
6700
|
-
function
|
|
6805
|
+
function va(e, t, n) {
|
|
6701
6806
|
return `M${$(e - n)},${$(t)}a${n},${n} 0 1 0 ${n * 2},0a${n},${n} 0 1 0 ${-n * 2},0Z`;
|
|
6702
6807
|
}
|
|
6703
|
-
var
|
|
6808
|
+
var ya = class {
|
|
6704
6809
|
batches = /* @__PURE__ */ new Map();
|
|
6705
6810
|
add(e, t) {
|
|
6706
6811
|
let n = this.batches.get(e);
|
|
@@ -6712,22 +6817,22 @@ var va = class {
|
|
|
6712
6817
|
d: t.join("")
|
|
6713
6818
|
}));
|
|
6714
6819
|
}
|
|
6715
|
-
},
|
|
6716
|
-
sides = new
|
|
6717
|
-
tops = new
|
|
6718
|
-
fronts = new
|
|
6820
|
+
}, ba = class {
|
|
6821
|
+
sides = new ya();
|
|
6822
|
+
tops = new ya();
|
|
6823
|
+
fronts = new ya();
|
|
6719
6824
|
add(e, t) {
|
|
6720
6825
|
this.sides.add(e, t.side), t.top && this.tops.add(e, t.top), this.fronts.add(e, t.front);
|
|
6721
6826
|
}
|
|
6722
6827
|
};
|
|
6723
|
-
function
|
|
6828
|
+
function xa(e) {
|
|
6724
6829
|
let t = Math.max(1, e.columnWidth);
|
|
6725
6830
|
return {
|
|
6726
6831
|
width: t,
|
|
6727
6832
|
half: t / 2
|
|
6728
6833
|
};
|
|
6729
6834
|
}
|
|
6730
|
-
function
|
|
6835
|
+
function Sa(e, t) {
|
|
6731
6836
|
let n = [];
|
|
6732
6837
|
for (let r of e) r.x < t.xDomain[0] || r.x > t.xDomain[1] || n.push({
|
|
6733
6838
|
row: r,
|
|
@@ -6735,46 +6840,46 @@ function xa(e, t) {
|
|
|
6735
6840
|
});
|
|
6736
6841
|
return n;
|
|
6737
6842
|
}
|
|
6738
|
-
function
|
|
6739
|
-
let { width: i } =
|
|
6843
|
+
function Ca(e, t, n, r) {
|
|
6844
|
+
let { width: i } = xa(r), a = r.y(Math.max(t, n)), o = Math.max(1, r.y(Math.min(t, n)) - a);
|
|
6740
6845
|
return mn(e, a - (o === 1 ? .5 : 0), i, o);
|
|
6741
6846
|
}
|
|
6742
|
-
function
|
|
6743
|
-
let { width: i, half: a } =
|
|
6744
|
-
return
|
|
6847
|
+
function wa(e, t, n, r) {
|
|
6848
|
+
let { width: i, half: a } = xa(r), o = r.y(Math.max(t, n)), s = r.y(Math.min(t, n)), c = Math.max(1, s - o);
|
|
6849
|
+
return _a(e - a, o - (c === 1 ? .5 : 0), i, c, Math.min(4, a));
|
|
6745
6850
|
}
|
|
6746
|
-
function
|
|
6747
|
-
return Math.min(12,
|
|
6851
|
+
function Ta(e) {
|
|
6852
|
+
return Math.min(12, xa(e).width * .5) / 2;
|
|
6748
6853
|
}
|
|
6749
|
-
function
|
|
6854
|
+
function Ea(e, t, n, r) {
|
|
6750
6855
|
let i = $(e), a = $(n);
|
|
6751
6856
|
return `M${i},${$(t)}V${a}` + (r >= 1.5 ? `M${$(e - r)},${a}H${$(e + r)}` : "");
|
|
6752
6857
|
}
|
|
6753
|
-
function
|
|
6754
|
-
let i =
|
|
6858
|
+
function Da(e, t, n, r) {
|
|
6859
|
+
let i = Ta(r), a = $(r.y(n)), o = $(r.y(t)), s = i >= 1.5 ? `M${$(e - i)},${a}H${$(e + i)}M${$(e - i)},${o}H${$(e + i)}` : "";
|
|
6755
6860
|
return `M${$(e)},${a}V${o}${s}`;
|
|
6756
6861
|
}
|
|
6757
|
-
function
|
|
6758
|
-
let { width: r, half: i } =
|
|
6862
|
+
function Oa(e, t, n) {
|
|
6863
|
+
let { width: r, half: i } = xa(n), a = Ta(n), o = n.y(t.q3), s = n.y(t.q1), c = $(n.y(t.median));
|
|
6759
6864
|
return {
|
|
6760
|
-
box:
|
|
6865
|
+
box: _a(e - i, o, r, Math.max(1, s - o), Math.min(3, i)),
|
|
6761
6866
|
median: `M${$(e - i)},${c}H${$(e + i)}`,
|
|
6762
|
-
whiskers:
|
|
6867
|
+
whiskers: Ea(e, o, n.y(t.max), a) + Ea(e, s, n.y(t.min), a)
|
|
6763
6868
|
};
|
|
6764
6869
|
}
|
|
6765
|
-
function
|
|
6766
|
-
let { width: r, half: i } =
|
|
6870
|
+
function ka(e, t, n) {
|
|
6871
|
+
let { width: r, half: i } = xa(n), a = Ta(n), o = n.y(t.q3), s = n.y(t.q1), c = pn(e - i, o, r, Math.max(1, s - o)), l = c.rise / 2, u = e - i, d = u + c.frontWidth, f = n.y(t.median);
|
|
6767
6872
|
return {
|
|
6768
6873
|
faces: c,
|
|
6769
6874
|
lift: l,
|
|
6770
6875
|
median: `M${u},${f}H${d}L${d + c.depth},${f - c.rise}`,
|
|
6771
|
-
lower:
|
|
6772
|
-
upper:
|
|
6876
|
+
lower: Ea(e, s - l, n.y(t.min) - l, a),
|
|
6877
|
+
upper: Ea(e, o - l, n.y(t.max) - l, a)
|
|
6773
6878
|
};
|
|
6774
6879
|
}
|
|
6775
6880
|
//#endregion
|
|
6776
6881
|
//#region src/marks/use-range-mark.ts
|
|
6777
|
-
function
|
|
6882
|
+
function Aa(e, t) {
|
|
6778
6883
|
return {
|
|
6779
6884
|
x: e.xToPixel,
|
|
6780
6885
|
y: e.yToPixelFor(t),
|
|
@@ -6782,10 +6887,10 @@ function ka(e, t) {
|
|
|
6782
6887
|
columnWidth: e.columnWidth
|
|
6783
6888
|
};
|
|
6784
6889
|
}
|
|
6785
|
-
function
|
|
6786
|
-
let i = Gt(), { snapshot: a, visibleSeries: o, focusedSeries: s, inspecting: c, revealProgress: l, clipId: u } = i, { descriptor: d, index: f } =
|
|
6890
|
+
function ja(e, t, n, r) {
|
|
6891
|
+
let i = Gt(), { snapshot: a, visibleSeries: o, focusedSeries: s, inspecting: c, revealProgress: l, clipId: u } = i, { descriptor: d, index: f } = Ki(e, i.series, t, n);
|
|
6787
6892
|
if (a.bars?.includes(t) || a.stack?.series.includes(t)) throw Error(`Lilt ${e} draws its own series; do not also draw "${t}" as bars.`);
|
|
6788
|
-
let p = k(() =>
|
|
6893
|
+
let p = k(() => Aa(a, t), [a, t]), m = o.includes(t) ? s && s !== t ? "var(--lilt-focus-muted-opacity, 0.18)" : c ? r === "column" ? "var(--lilt-bar-inspection-muted-opacity, 0.26)" : .3 : 1 : 0;
|
|
6789
6894
|
return {
|
|
6790
6895
|
descriptor: d,
|
|
6791
6896
|
color: ze(d, f),
|
|
@@ -6807,10 +6912,10 @@ function Aa(e, t, n, r) {
|
|
|
6807
6912
|
}
|
|
6808
6913
|
//#endregion
|
|
6809
6914
|
//#region src/primitives/interval-band.tsx
|
|
6810
|
-
var
|
|
6811
|
-
let { paintId: i } = Gt(), a =
|
|
6812
|
-
|
|
6813
|
-
let s =
|
|
6915
|
+
var Ma = Wi(function({ series: e, lower: t, upper: n, className: r }) {
|
|
6916
|
+
let { paintId: i } = Gt(), a = ja("IntervalBand", e, [t, n], "overlay"), o = a.snapshot.data.rows;
|
|
6917
|
+
ha("IntervalBand", o, e, [t, n]);
|
|
6918
|
+
let s = ga(o, e, t, n, a.scales), c = Ve(a.color, void 0, "fade", i(e, "fade"));
|
|
6814
6919
|
return /* @__PURE__ */ I("g", {
|
|
6815
6920
|
"aria-hidden": "true",
|
|
6816
6921
|
className: ["lilt-chart__interval-band", r].filter(Boolean).join(" "),
|
|
@@ -6830,7 +6935,7 @@ var ja = Ui(function({ series: e, lower: t, upper: n, className: r }) {
|
|
|
6830
6935
|
});
|
|
6831
6936
|
//#endregion
|
|
6832
6937
|
//#region src/primitives/line.tsx
|
|
6833
|
-
function
|
|
6938
|
+
function Na(e, t, n) {
|
|
6834
6939
|
let r = t + 9, i = n - 5;
|
|
6835
6940
|
if (i - r < (e.length - 1) * 17) return /* @__PURE__ */ new Map();
|
|
6836
6941
|
let a = [];
|
|
@@ -6841,7 +6946,7 @@ function Ma(e, t, n) {
|
|
|
6841
6946
|
}
|
|
6842
6947
|
return new Map(e.map((e, t) => [e.id, a[t]]));
|
|
6843
6948
|
}
|
|
6844
|
-
function
|
|
6949
|
+
function Pa({ series: e, className: t, model: n }) {
|
|
6845
6950
|
let r = De();
|
|
6846
6951
|
if (n && n !== r.model) throw Error("Lilt Line model must be the model supplied to its Chart.");
|
|
6847
6952
|
let { runoff: i } = ot(), a = A(null), [o, s] = j(!1), { snapshot: c, width: l, series: u, reducedMotion: d, inspecting: f, focusedSeries: p, visibleSeries: m, revealProgress: h, transitionDuration: g, clipId: _ } = Gt(), v = rn(h < 1 ? h * g : Infinity, 0, 180), y = u.find((t) => t.id === e);
|
|
@@ -6856,7 +6961,7 @@ function Na({ series: e, className: t, model: n }) {
|
|
|
6856
6961
|
color: ze(e, u.indexOf(e)),
|
|
6857
6962
|
index: t
|
|
6858
6963
|
} : null;
|
|
6859
|
-
}).filter((e) => e !== null).sort((e, t) => e.y - t.y), E =
|
|
6964
|
+
}).filter((e) => e !== null).sort((e, t) => e.y - t.y), E = Na(T, c.plot.top, c.plot.bottom), D = T.find((t) => t.id === e)?.text, k = l - c.plot.right - 11, M = !!(S?.directLabel && D && E.has(e) && c.plot.width >= 460 && l - c.plot.right >= 96);
|
|
6860
6965
|
O(() => {
|
|
6861
6966
|
if (!M || !D || !a.current) return;
|
|
6862
6967
|
let e = a.current, t = !0, n = () => {
|
|
@@ -6880,7 +6985,7 @@ function Na({ series: e, className: t, model: n }) {
|
|
|
6880
6985
|
className: t,
|
|
6881
6986
|
"data-series": e
|
|
6882
6987
|
});
|
|
6883
|
-
let N = S?.depth && !S.dasharray ? Tn(typeof S.width == "number" ? S.width : 2) : 0, P = i ?
|
|
6988
|
+
let N = S?.depth && !S.dasharray ? Tn(typeof S.width == "number" ? S.width : 2) : 0, P = i ? ea(c, b) : null, ne = P ? da(`${_}-runoff-line-${u.indexOf(y)}`, c, P) : "", re = P ? /* @__PURE__ */ I(fa, {
|
|
6884
6989
|
id: ne,
|
|
6885
6990
|
snapshot: c,
|
|
6886
6991
|
edges: P
|
|
@@ -6927,7 +7032,7 @@ function Na({ series: e, className: t, model: n }) {
|
|
|
6927
7032
|
mask: P ? `url(#${ne})` : void 0,
|
|
6928
7033
|
filter: N ? `url(#${_}-tube-${u.indexOf(y)})` : void 0,
|
|
6929
7034
|
children: b.segments.map((t, n) => {
|
|
6930
|
-
let r = P ?
|
|
7035
|
+
let r = P ? aa(t, ta(P, n, b.segments.length)) : t.path, i = t.status === "provisional" ? "5 4" : t.status === "forecast" ? "2 5" : S?.dasharray;
|
|
6931
7036
|
return N ? /* @__PURE__ */ I("g", {
|
|
6932
7037
|
"data-lilt-path": e,
|
|
6933
7038
|
"data-lilt-status": t.status && t.status !== "observed" ? t.status : void 0,
|
|
@@ -6994,7 +7099,7 @@ function Na({ series: e, className: t, model: n }) {
|
|
|
6994
7099
|
}
|
|
6995
7100
|
//#endregion
|
|
6996
7101
|
//#region src/primitives/bar.tsx
|
|
6997
|
-
function
|
|
7102
|
+
function Fa({ series: e, className: t, model: n }) {
|
|
6998
7103
|
let r = De();
|
|
6999
7104
|
if (n && n !== r.model) throw Error("Lilt Bar model must be the model supplied to its Chart.");
|
|
7000
7105
|
let { snapshot: i, series: a, visibleSeries: o, inspecting: s, focusedSeries: c, reducedMotion: l, revealProgress: u, transitionDuration: d, clipId: f, paintId: p } = Gt(), m = a.find((t) => t.id === e);
|
|
@@ -7130,13 +7235,13 @@ function Pa({ series: e, className: t, model: n }) {
|
|
|
7130
7235
|
}
|
|
7131
7236
|
//#endregion
|
|
7132
7237
|
//#region src/primitives/grid.tsx
|
|
7133
|
-
var
|
|
7238
|
+
var Ia = [
|
|
7134
7239
|
.22,
|
|
7135
7240
|
1,
|
|
7136
7241
|
.36,
|
|
7137
7242
|
1
|
|
7138
7243
|
];
|
|
7139
|
-
function
|
|
7244
|
+
function La({ className: e, pattern: t = "lines", color: n, opacity: r = 1, lineWidth: i, dotSpacing: a = 8, dotRadius: o = .6 } = {}) {
|
|
7140
7245
|
if (!Number.isFinite(r) || r < 0 || r > 1 || i !== void 0 && (!Number.isFinite(i) || i < 0) || !Number.isFinite(a) || a <= 0 || !Number.isFinite(o) || o < 0 || o > a / 2) throw Error("Lilt Grid requires opacity in [0, 1], non-negative lineWidth, positive dotSpacing, and dotRadius within half the spacing.");
|
|
7141
7246
|
let s = `lilt-grid-${D().replaceAll(":", "")}`, { snapshot: c, previousSnapshot: l, axis: u, transitionDuration: d, reducedMotion: f, gridGradientId: p, revealProgress: m } = Gt(), h = ot().axis.y, g = m < 1, _ = rn(g ? m * d : Infinity, 0, 240), v = f ? 0 : d / 1e3, y = new Map((l?.yTicks ?? []).map((e) => [e, l.yToPixel(e)]));
|
|
7142
7247
|
if (t === "dots") return /* @__PURE__ */ L("g", {
|
|
@@ -7234,7 +7339,7 @@ function Ia({ className: e, pattern: t = "lines", color: n, opacity: r = 1, line
|
|
|
7234
7339
|
},
|
|
7235
7340
|
transition: {
|
|
7236
7341
|
duration: g ? 0 : v,
|
|
7237
|
-
ease:
|
|
7342
|
+
ease: Ia
|
|
7238
7343
|
},
|
|
7239
7344
|
vectorEffect: "non-scaling-stroke",
|
|
7240
7345
|
x1: c.plot.left,
|
|
@@ -7245,16 +7350,16 @@ function Ia({ className: e, pattern: t = "lines", color: n, opacity: r = 1, line
|
|
|
7245
7350
|
}
|
|
7246
7351
|
//#endregion
|
|
7247
7352
|
//#region src/primitives/axis-segments.tsx
|
|
7248
|
-
var
|
|
7249
|
-
function
|
|
7250
|
-
let s = F([a, o], ([n, r]) => .55 + (Number(n) >= Math.min(e, t) && Number(n) <= Math.max(e, t) ? Number(r) * .45 : 0)), c = Math.min(e, t) +
|
|
7353
|
+
var Ra = 4, za = 5;
|
|
7354
|
+
function Ba({ from: e, to: t, cross: n, vertical: r, fill: i, cursor: a, active: o }) {
|
|
7355
|
+
let s = F([a, o], ([n, r]) => .55 + (Number(n) >= Math.min(e, t) && Number(n) <= Math.max(e, t) ? Number(r) * .45 : 0)), c = Math.min(e, t) + Ra / 2, l = Math.max(0, Math.abs(t - e) - Ra);
|
|
7251
7356
|
return /* @__PURE__ */ I(N.rect, {
|
|
7252
7357
|
className: "lilt-chart__axis-segment",
|
|
7253
|
-
x: r ? n -
|
|
7254
|
-
y: r ? c : n -
|
|
7255
|
-
width: r ?
|
|
7256
|
-
height: r ? l :
|
|
7257
|
-
rx:
|
|
7358
|
+
x: r ? n - za / 2 : c,
|
|
7359
|
+
y: r ? c : n - za / 2,
|
|
7360
|
+
width: r ? za : l,
|
|
7361
|
+
height: r ? l : za,
|
|
7362
|
+
rx: za / 2,
|
|
7258
7363
|
fill: i,
|
|
7259
7364
|
style: {
|
|
7260
7365
|
opacity: s,
|
|
@@ -7262,7 +7367,7 @@ function za({ from: e, to: t, cross: n, vertical: r, fill: i, cursor: a, active:
|
|
|
7262
7367
|
}
|
|
7263
7368
|
});
|
|
7264
7369
|
}
|
|
7265
|
-
function
|
|
7370
|
+
function Va({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a, opacity: o = 1 }) {
|
|
7266
7371
|
let s = `lilt-axis-scale-${D().replace(/:/g, "")}`, c = [...new Set(e.map((e) => Math.round(e * 2) / 2))].sort((e, t) => e - t);
|
|
7267
7372
|
if (c.length < 2) return null;
|
|
7268
7373
|
let l = n ? c.at(-1) : c[0], u = n ? c[0] : c.at(-1);
|
|
@@ -7286,7 +7391,7 @@ function Ba({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a
|
|
|
7286
7391
|
stopOpacity: e.opacity ?? 1
|
|
7287
7392
|
}
|
|
7288
7393
|
}, t))
|
|
7289
|
-
}) }) : null, c.slice(1).map((e, o) => /* @__PURE__ */ I(
|
|
7394
|
+
}) }) : null, c.slice(1).map((e, o) => /* @__PURE__ */ I(Ba, {
|
|
7290
7395
|
from: c[o],
|
|
7291
7396
|
to: e,
|
|
7292
7397
|
cross: t,
|
|
@@ -7299,13 +7404,13 @@ function Ba({ stops: e, cross: t, vertical: n, gradient: r, cursor: i, active: a
|
|
|
7299
7404
|
}
|
|
7300
7405
|
//#endregion
|
|
7301
7406
|
//#region src/primitives/axes.tsx
|
|
7302
|
-
var
|
|
7407
|
+
var Ha = [
|
|
7303
7408
|
.22,
|
|
7304
7409
|
1,
|
|
7305
7410
|
.36,
|
|
7306
7411
|
1
|
|
7307
|
-
],
|
|
7308
|
-
function
|
|
7412
|
+
], Ua = 64, Wa = 26, Ga = 160, Ka = 4, qa = 6;
|
|
7413
|
+
function Ja(e) {
|
|
7309
7414
|
let { series: t, visibleSeries: n } = Gt();
|
|
7310
7415
|
if (!e) return null;
|
|
7311
7416
|
if (e !== !0) return e.map((e) => ({ color: e }));
|
|
@@ -7320,13 +7425,13 @@ function qa(e) {
|
|
|
7320
7425
|
opacity: 1
|
|
7321
7426
|
}];
|
|
7322
7427
|
}
|
|
7323
|
-
function
|
|
7428
|
+
function Ya(e, t, n) {
|
|
7324
7429
|
return t || n ? { duration: 0 } : {
|
|
7325
7430
|
duration: Math.max(0, e) / 1e3,
|
|
7326
|
-
ease:
|
|
7431
|
+
ease: Ha
|
|
7327
7432
|
};
|
|
7328
7433
|
}
|
|
7329
|
-
function
|
|
7434
|
+
function Xa({ cursor: e, active: t, center: n, reach: r, children: i }) {
|
|
7330
7435
|
let a = F([e, t], ([e, t]) => st(Number(e) - n, r, Number(t))), o = F(a, (e) => e > .995 ? "none" : `blur(${((1 - e) * 1.2).toFixed(2)}px)`);
|
|
7331
7436
|
return /* @__PURE__ */ I(N.g, {
|
|
7332
7437
|
style: {
|
|
@@ -7336,7 +7441,7 @@ function Ya({ cursor: e, active: t, center: n, reach: r, children: i }) {
|
|
|
7336
7441
|
children: i
|
|
7337
7442
|
});
|
|
7338
7443
|
}
|
|
7339
|
-
function
|
|
7444
|
+
function Za({ x: e, reach: t, children: n }) {
|
|
7340
7445
|
let { pointerX: r, inspecting: i, active: a } = ot(), o = F([
|
|
7341
7446
|
r,
|
|
7342
7447
|
i,
|
|
@@ -7347,15 +7452,15 @@ function Xa({ x: e, reach: t, children: n }) {
|
|
|
7347
7452
|
children: n
|
|
7348
7453
|
});
|
|
7349
7454
|
}
|
|
7350
|
-
var
|
|
7455
|
+
var Qa = {
|
|
7351
7456
|
ticks: 4,
|
|
7352
7457
|
dots: 7
|
|
7353
7458
|
};
|
|
7354
|
-
function
|
|
7459
|
+
function $a({ kind: e, x: t, baseline: n, reach: r, cursor: i, active: a }) {
|
|
7355
7460
|
let o = F([i, a], ([e, n]) => {
|
|
7356
7461
|
let i = Math.max(0, 1 - Math.abs(Number(e) - t) / r);
|
|
7357
7462
|
return Number(n) * i * i * (3 - 2 * i);
|
|
7358
|
-
}), s = F(o, (e) => .28 + e * .62), c = n +
|
|
7463
|
+
}), s = F(o, (e) => .28 + e * .62), c = n + Qa[e], l = F(o, (e) => c + 4 + e * 5), u = F(o, (e) => 1.25 + e * 1.5);
|
|
7359
7464
|
return e === "dots" ? /* @__PURE__ */ I(N.circle, {
|
|
7360
7465
|
className: "lilt-chart__ruler-dot",
|
|
7361
7466
|
cx: t,
|
|
@@ -7372,8 +7477,8 @@ function Qa({ kind: e, x: t, baseline: n, reach: r, cursor: i, active: a }) {
|
|
|
7372
7477
|
style: { opacity: s }
|
|
7373
7478
|
});
|
|
7374
7479
|
}
|
|
7375
|
-
function
|
|
7376
|
-
let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = Gt(), u = ot(), d = c === "initial", f = new Map((i?.xTicks ?? []).map((e) => [e, i.xToPixel(e)])), p = r.data.rows, m = u.axis.x, h = m === "segmented", g =
|
|
7480
|
+
function eo({ className: e, edgeInset: t, labels: n } = {}) {
|
|
7481
|
+
let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = Gt(), u = ot(), d = c === "initial", f = new Map((i?.xTicks ?? []).map((e) => [e, i.xToPixel(e)])), p = r.data.rows, m = u.axis.x, h = m === "segmented", g = Ja(u.axis.xGradient), _ = m === "minimal" || m === "dots", v = m === "ruler" ? "ticks" : m === "dots" ? "dots" : null, y = (n ?? (_ ? "ends" : "fit")) === "ends" && p.length ? [.../* @__PURE__ */ new Set([p[0].x, p.at(-1).x])] : null, b = y ?? r.xTicks, x = y ? y.map((e) => ({ value: e })) : a.x, S = new Set(b), C = Math.min(Math.max(0, t ?? 0), (r.plot.right - r.plot.left) / 4), w = Math.max(1, Math.ceil(p.length / Ga)), T = p.filter((e, t) => t % w === 0), E = T.length > 1 ? (r.plot.right - r.plot.left) / (T.length - 1) : 40, D = p.length > 1 ? Math.abs(r.xToPixel(p[1].x) - r.xToPixel(p[0].x)) / 2 : r.plot.width / 2, O = d && !s ? rn(l * o, 0, 320) : 1;
|
|
7377
7482
|
return /* @__PURE__ */ L("g", {
|
|
7378
7483
|
"aria-hidden": "true",
|
|
7379
7484
|
className: [
|
|
@@ -7389,13 +7494,13 @@ function $a({ className: e, edgeInset: t, labels: n } = {}) {
|
|
|
7389
7494
|
y1: r.plot.bottom,
|
|
7390
7495
|
y2: r.plot.bottom
|
|
7391
7496
|
}),
|
|
7392
|
-
h ? /* @__PURE__ */ I(
|
|
7497
|
+
h ? /* @__PURE__ */ I(Va, {
|
|
7393
7498
|
stops: [
|
|
7394
7499
|
r.plot.left,
|
|
7395
7500
|
...b.map((e) => r.xToPixel(e)),
|
|
7396
7501
|
r.plot.right
|
|
7397
7502
|
],
|
|
7398
|
-
cross: r.plot.bottom +
|
|
7503
|
+
cross: r.plot.bottom + qa,
|
|
7399
7504
|
vertical: !1,
|
|
7400
7505
|
gradient: g,
|
|
7401
7506
|
cursor: u.pointerX,
|
|
@@ -7406,7 +7511,7 @@ function $a({ className: e, edgeInset: t, labels: n } = {}) {
|
|
|
7406
7511
|
className: "lilt-chart__ruler",
|
|
7407
7512
|
"data-kind": v,
|
|
7408
7513
|
opacity: O,
|
|
7409
|
-
children: T.map((e) => /* @__PURE__ */ I(
|
|
7514
|
+
children: T.map((e) => /* @__PURE__ */ I($a, {
|
|
7410
7515
|
kind: v,
|
|
7411
7516
|
x: r.xToPixel(e.x),
|
|
7412
7517
|
baseline: r.plot.bottom,
|
|
@@ -7416,13 +7521,13 @@ function $a({ className: e, edgeInset: t, labels: n } = {}) {
|
|
|
7416
7521
|
}, `ruler-${e.x}`))
|
|
7417
7522
|
}) : null,
|
|
7418
7523
|
x.map((e, t) => {
|
|
7419
|
-
let n = S.has(e.value), i = n ? r.xToPixel(e.value) : f.get(e.value) ?? r.xToPixel(e.value), a = f.get(e.value) ?? i, c = d && !s ? rn(l * o, 60 + an(t, x.length, 100), 320) : 1, p = b.indexOf(e.value), m = p < 0 ? t : p, h = r.formatX(e.value), g = h.length * 3.3, _ = m === 0, v = m === b.length - 1, y =
|
|
7420
|
-
return /* @__PURE__ */ I(
|
|
7524
|
+
let n = S.has(e.value), i = n ? r.xToPixel(e.value) : f.get(e.value) ?? r.xToPixel(e.value), a = f.get(e.value) ?? i, c = d && !s ? rn(l * o, 60 + an(t, x.length, 100), 320) : 1, p = b.indexOf(e.value), m = p < 0 ? t : p, h = r.formatX(e.value), g = h.length * 3.3, _ = m === 0, v = m === b.length - 1, y = Ka - u.overhang, w = _ && i - g < r.plot.left + y ? "start" : v && i + g > r.plot.right - y ? "end" : "middle", T = w === "start" ? C : w === "end" ? -C : 0, E = i + T + (w === "start" ? g : w === "end" ? -g : 0);
|
|
7525
|
+
return /* @__PURE__ */ I(Xa, {
|
|
7421
7526
|
cursor: u.x,
|
|
7422
7527
|
active: u.active,
|
|
7423
7528
|
center: E,
|
|
7424
|
-
reach:
|
|
7425
|
-
children: /* @__PURE__ */ I(
|
|
7529
|
+
reach: Ua,
|
|
7530
|
+
children: /* @__PURE__ */ I(Za, {
|
|
7426
7531
|
x: i,
|
|
7427
7532
|
reach: D,
|
|
7428
7533
|
children: /* @__PURE__ */ I(N.text, {
|
|
@@ -7439,7 +7544,7 @@ function $a({ className: e, edgeInset: t, labels: n } = {}) {
|
|
|
7439
7544
|
y: r.plot.bottom + 22 + 9
|
|
7440
7545
|
},
|
|
7441
7546
|
textAnchor: w,
|
|
7442
|
-
transition:
|
|
7547
|
+
transition: Ya(o, s, d),
|
|
7443
7548
|
children: h
|
|
7444
7549
|
})
|
|
7445
7550
|
})
|
|
@@ -7448,8 +7553,8 @@ function $a({ className: e, edgeInset: t, labels: n } = {}) {
|
|
|
7448
7553
|
]
|
|
7449
7554
|
});
|
|
7450
7555
|
}
|
|
7451
|
-
function
|
|
7452
|
-
let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = Gt(), u = ot(), d = c === "initial", f = new Map((i?.yTicks ?? []).map((e) => [e, i.yToPixel(e)])), p = new Set(r.yTicks), m = u.axis.y, h = m === "segmented", g =
|
|
7556
|
+
function to({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
|
|
7557
|
+
let { snapshot: r, previousSnapshot: i, axis: a, transitionDuration: o, reducedMotion: s, transitionKind: c, revealProgress: l } = Gt(), u = ot(), d = c === "initial", f = new Map((i?.yTicks ?? []).map((e) => [e, i.yToPixel(e)])), p = new Set(r.yTicks), m = u.axis.y, h = m === "segmented", g = Ja(u.axis.yGradient), _ = !lt(m), v = m === "dots", y = h || v ? 16 : 12, b = n === "secondary", x = r.secondary, S = b ? _ ? r.plot.right - u.inset : r.plot.right + y : _ ? r.plot.left + u.inset : r.plot.left - y, C = b === _ ? "end" : "start", w = (e) => b && x ? x.format(e * x.factor) : r.formatY(e), T = _ ? -6 : 4, E = r.yTicks.length ? Math.min(...r.yTicks) : null;
|
|
7453
7558
|
return b && !x ? null : /* @__PURE__ */ L("g", {
|
|
7454
7559
|
"aria-hidden": "true",
|
|
7455
7560
|
className: [
|
|
@@ -7460,13 +7565,13 @@ function eo({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
|
|
|
7460
7565
|
"data-inline": _ || void 0,
|
|
7461
7566
|
"data-scale": b ? "secondary" : void 0,
|
|
7462
7567
|
children: [
|
|
7463
|
-
h && !b ? /* @__PURE__ */ I(
|
|
7568
|
+
h && !b ? /* @__PURE__ */ I(Va, {
|
|
7464
7569
|
stops: [
|
|
7465
7570
|
r.plot.top,
|
|
7466
7571
|
...r.yTicks.map((e) => r.yToPixel(e)),
|
|
7467
7572
|
r.plot.bottom
|
|
7468
7573
|
],
|
|
7469
|
-
cross: r.plot.left -
|
|
7574
|
+
cross: r.plot.left - qa,
|
|
7470
7575
|
vertical: !0,
|
|
7471
7576
|
gradient: g,
|
|
7472
7577
|
cursor: u.y,
|
|
@@ -7482,7 +7587,7 @@ function eo({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
|
|
|
7482
7587
|
opacity: n ? c : 0,
|
|
7483
7588
|
y: i
|
|
7484
7589
|
},
|
|
7485
|
-
transition:
|
|
7590
|
+
transition: Ya(o, s, d),
|
|
7486
7591
|
children: [/* @__PURE__ */ I("circle", {
|
|
7487
7592
|
className: "lilt-chart__y-leader-node",
|
|
7488
7593
|
cx: r.plot.left - 7,
|
|
@@ -7503,11 +7608,11 @@ function eo({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
|
|
|
7503
7608
|
t && m !== "minimal" && a.y.map((e, t) => {
|
|
7504
7609
|
if (_ && e.value === E) return null;
|
|
7505
7610
|
let n = p.has(e.value), i = n ? r.yToPixel(e.value) : f.get(e.value) ?? r.yToPixel(e.value), c = f.get(e.value) ?? i + 6, m = d && !s ? rn(l * o, an(t, a.y.length, 80), 280) : 1;
|
|
7506
|
-
return /* @__PURE__ */ I(
|
|
7611
|
+
return /* @__PURE__ */ I(Xa, {
|
|
7507
7612
|
cursor: u.y,
|
|
7508
7613
|
active: u.active,
|
|
7509
7614
|
center: i,
|
|
7510
|
-
reach:
|
|
7615
|
+
reach: Wa,
|
|
7511
7616
|
children: /* @__PURE__ */ I(N.text, {
|
|
7512
7617
|
animate: {
|
|
7513
7618
|
opacity: n ? m : 0,
|
|
@@ -7522,7 +7627,7 @@ function eo({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
|
|
|
7522
7627
|
y: c + T + 6
|
|
7523
7628
|
},
|
|
7524
7629
|
textAnchor: C,
|
|
7525
|
-
transition:
|
|
7630
|
+
transition: Ya(o, s, d),
|
|
7526
7631
|
children: w(e.value)
|
|
7527
7632
|
})
|
|
7528
7633
|
}, `y-${e.value}`);
|
|
@@ -7532,11 +7637,11 @@ function eo({ className: e, showTicks: t = !0, scale: n = "primary" } = {}) {
|
|
|
7532
7637
|
}
|
|
7533
7638
|
//#endregion
|
|
7534
7639
|
//#region src/interaction/legend-meter.tsx
|
|
7535
|
-
function
|
|
7640
|
+
function no(e) {
|
|
7536
7641
|
let t = Math.max(0, ...e.map((e) => e !== null && e > 0 ? e : 0));
|
|
7537
7642
|
return t > 0 ? t : null;
|
|
7538
7643
|
}
|
|
7539
|
-
function
|
|
7644
|
+
function ro({ value: e, scale: t }) {
|
|
7540
7645
|
let n = e !== null && e > 0 && t ? Math.min(1, e / t) : 0;
|
|
7541
7646
|
return /* @__PURE__ */ I("span", {
|
|
7542
7647
|
className: "lilt-chart__legend-meter",
|
|
@@ -7546,11 +7651,11 @@ function no({ value: e, scale: t }) {
|
|
|
7546
7651
|
}
|
|
7547
7652
|
//#endregion
|
|
7548
7653
|
//#region src/interaction/value-legend.tsx
|
|
7549
|
-
var
|
|
7550
|
-
function
|
|
7654
|
+
var io = (e) => e === "tiles" ? "cards" : e;
|
|
7655
|
+
function ao({ items: e, variant: t = "cards", swatch: n = "square", activeId: r, selectedId: i, onHoverIdChange: a, onSelectedIdChange: o, hiddenIds: s = [], onHiddenIdsChange: c, renderLabel: l, renderValue: u, renderSwatch: d, renderItem: f, "aria-label": p = "Values", className: m, style: h }) {
|
|
7551
7656
|
let g = !!c && e.length > 1, _ = !!(a || o || g), v = new Set(s), y = e.filter((e) => !v.has(e.id)).length, b = (e) => c?.(e), x = (e) => {
|
|
7552
7657
|
v.has(e) ? b(s.filter((t) => t !== e)) : y > 1 && b([...s, e]);
|
|
7553
|
-
}, S =
|
|
7658
|
+
}, S = no(e.filter((e) => !v.has(e.id)).map((e) => e.value)), C = (t) => b(e.map((e) => e.id).filter((e) => e !== t));
|
|
7554
7659
|
return /* @__PURE__ */ I("div", {
|
|
7555
7660
|
"data-lilt-chart": "",
|
|
7556
7661
|
role: "group",
|
|
@@ -7579,7 +7684,7 @@ function io({ items: e, variant: t = "cards", swatch: n = "square", activeId: r,
|
|
|
7579
7684
|
className: "lilt-chart__legend-value",
|
|
7580
7685
|
children: u?.(e) ?? e.formattedValue
|
|
7581
7686
|
}),
|
|
7582
|
-
t === "bars" ? /* @__PURE__ */ I(
|
|
7687
|
+
t === "bars" ? /* @__PURE__ */ I(ro, {
|
|
7583
7688
|
value: e.value,
|
|
7584
7689
|
scale: S
|
|
7585
7690
|
}) : null
|
|
@@ -7643,15 +7748,15 @@ function io({ items: e, variant: t = "cards", swatch: n = "square", activeId: r,
|
|
|
7643
7748
|
}
|
|
7644
7749
|
//#endregion
|
|
7645
7750
|
//#region src/primitives/annotations.tsx
|
|
7646
|
-
function
|
|
7751
|
+
function oo(e) {
|
|
7647
7752
|
return e instanceof Date ? e.getTime() : e;
|
|
7648
7753
|
}
|
|
7649
|
-
function
|
|
7754
|
+
function so({ items: e, onSelectionChange: t, className: n }) {
|
|
7650
7755
|
let { snapshot: r, reducedMotion: i } = Gt(), [a, o] = j(null), [s, c] = j(null);
|
|
7651
7756
|
return /* @__PURE__ */ I("g", {
|
|
7652
7757
|
className: ["lilt-chart__annotations", n].filter(Boolean).join(" "),
|
|
7653
7758
|
children: e.map((e, n) => {
|
|
7654
|
-
let l =
|
|
7759
|
+
let l = oo(e.x);
|
|
7655
7760
|
if (l < r.xDomain[0] || l > r.xDomain[1]) return null;
|
|
7656
7761
|
let u = r.xToPixel(l), d = a === e.id || s === e.id;
|
|
7657
7762
|
return /* @__PURE__ */ L("g", {
|
|
@@ -7737,10 +7842,10 @@ function oo({ items: e, onSelectionChange: t, className: n }) {
|
|
|
7737
7842
|
})
|
|
7738
7843
|
});
|
|
7739
7844
|
}
|
|
7740
|
-
function
|
|
7845
|
+
function co({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis: i = "x", className: a }) {
|
|
7741
7846
|
let { snapshot: o } = Gt();
|
|
7742
7847
|
if (i === "y") {
|
|
7743
|
-
let i = o.yDomain, s = Math.max(i?.[0] ?? 0, Math.min(
|
|
7848
|
+
let i = o.yDomain, s = Math.max(i?.[0] ?? 0, Math.min(oo(e), oo(t))), c = Math.min(i?.[1] ?? 0, Math.max(oo(e), oo(t)));
|
|
7744
7849
|
if (!i || s > c) return /* @__PURE__ */ I("g", {});
|
|
7745
7850
|
let l = o.yToPixel(c), u = o.yToPixel(s);
|
|
7746
7851
|
return /* @__PURE__ */ L("g", {
|
|
@@ -7762,7 +7867,7 @@ function so({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis:
|
|
|
7762
7867
|
}) : null]
|
|
7763
7868
|
});
|
|
7764
7869
|
}
|
|
7765
|
-
let s = Math.min(
|
|
7870
|
+
let s = Math.min(oo(e), oo(t)), c = Math.max(oo(e), oo(t)), l = Math.max(o.xDomain[0], s), u = Math.min(o.xDomain[1], c);
|
|
7766
7871
|
if (l > u) return /* @__PURE__ */ I("g", {});
|
|
7767
7872
|
let d = s === -Infinity ? o.plot.left : o.xToPixel(l), f = c === Infinity ? o.plot.right : o.xToPixel(u);
|
|
7768
7873
|
return /* @__PURE__ */ L("g", {
|
|
@@ -7785,7 +7890,7 @@ function so({ from: e, to: t, label: n, color: r = "var(--lilt-series-1)", axis:
|
|
|
7785
7890
|
}
|
|
7786
7891
|
//#endregion
|
|
7787
7892
|
//#region src/primitives/reference-line.tsx
|
|
7788
|
-
function
|
|
7893
|
+
function lo({ value: e, label: t, color: n = "var(--lilt-muted)", className: r }) {
|
|
7789
7894
|
let { snapshot: i } = Gt(), a = i.yDomain;
|
|
7790
7895
|
if (!a || !Number.isFinite(e) || e < a[0] || e > a[1]) return null;
|
|
7791
7896
|
let o = i.yToPixel(e), { left: s, right: c, top: l } = i.plot, u = o - 6 < l + 10 ? o + 14 : o - 6;
|
|
@@ -7809,12 +7914,12 @@ function co({ value: e, label: t, color: n = "var(--lilt-muted)", className: r }
|
|
|
7809
7914
|
}
|
|
7810
7915
|
//#endregion
|
|
7811
7916
|
//#region src/cards/keys.ts
|
|
7812
|
-
var
|
|
7917
|
+
var uo = new Intl.DateTimeFormat("en-US", {
|
|
7813
7918
|
month: "short",
|
|
7814
7919
|
day: "numeric",
|
|
7815
7920
|
timeZone: "UTC"
|
|
7816
|
-
}),
|
|
7817
|
-
function
|
|
7921
|
+
}), fo = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
|
|
7922
|
+
function po(e, t, n, r) {
|
|
7818
7923
|
let i = (e) => e[t], a = e.length > 0 ? i(e[0]) : void 0, o = n ?? (typeof a == "string" ? "category" : a instanceof Date ? "time" : "number");
|
|
7819
7924
|
if (o === "category") {
|
|
7820
7925
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -7834,16 +7939,16 @@ function fo(e, t, n, r) {
|
|
|
7834
7939
|
let t = i(e);
|
|
7835
7940
|
return t instanceof Date ? t.getTime() : Number(t);
|
|
7836
7941
|
},
|
|
7837
|
-
format: (e) => r ? r(new Date(e)) :
|
|
7942
|
+
format: (e) => r ? r(new Date(e)) : uo.format(e)
|
|
7838
7943
|
} : {
|
|
7839
7944
|
kind: o,
|
|
7840
7945
|
position: (e) => Number(i(e)),
|
|
7841
|
-
format: (e) => r ? r(e) :
|
|
7946
|
+
format: (e) => r ? r(e) : fo.format(e)
|
|
7842
7947
|
};
|
|
7843
7948
|
}
|
|
7844
7949
|
//#endregion
|
|
7845
7950
|
//#region src/cards/format.ts
|
|
7846
|
-
function
|
|
7951
|
+
function mo(e, t) {
|
|
7847
7952
|
let n = [];
|
|
7848
7953
|
for (let r of e) {
|
|
7849
7954
|
let e = r[t];
|
|
@@ -7851,14 +7956,14 @@ function po(e, t) {
|
|
|
7851
7956
|
}
|
|
7852
7957
|
return n;
|
|
7853
7958
|
}
|
|
7854
|
-
function
|
|
7959
|
+
function ho(e, t) {
|
|
7855
7960
|
if (!e.length) return null;
|
|
7856
7961
|
if (t === "last") return e.at(-1);
|
|
7857
7962
|
if (t === "max") return me(e);
|
|
7858
7963
|
let n = e.reduce((e, t) => e + t, 0);
|
|
7859
7964
|
return t === "mean" ? n / e.length : n;
|
|
7860
7965
|
}
|
|
7861
|
-
function
|
|
7966
|
+
function go(e, t) {
|
|
7862
7967
|
let n = new Intl.NumberFormat(e, {
|
|
7863
7968
|
maximumFractionDigits: Math.max(1, t?.minimumFractionDigits ?? 0),
|
|
7864
7969
|
minimumFractionDigits: 0,
|
|
@@ -7875,8 +7980,8 @@ function ho(e, t) {
|
|
|
7875
7980
|
plain: _(i)
|
|
7876
7981
|
};
|
|
7877
7982
|
}
|
|
7878
|
-
function
|
|
7879
|
-
let i = JSON.stringify(e ?? null), a = k(() =>
|
|
7983
|
+
function _o({ valueFormat: e, locale: t = "en-US", formatValue: n, formatAxisValue: r }) {
|
|
7984
|
+
let i = JSON.stringify(e ?? null), a = k(() => go(t, e), [t, i]), o = n ?? a.full, s = r ?? a.compact, c = A({
|
|
7880
7985
|
value: o,
|
|
7881
7986
|
axis: s
|
|
7882
7987
|
});
|
|
@@ -7893,12 +7998,12 @@ function go({ valueFormat: e, locale: t = "en-US", formatValue: n, formatAxisVal
|
|
|
7893
7998
|
key: `${t}|${i}`
|
|
7894
7999
|
};
|
|
7895
8000
|
}
|
|
7896
|
-
function
|
|
8001
|
+
function vo(e) {
|
|
7897
8002
|
return (t) => `${t < 0 ? "−" : "+"}${e(Math.abs(t))}`;
|
|
7898
8003
|
}
|
|
7899
8004
|
//#endregion
|
|
7900
8005
|
//#region src/engine/composition.ts
|
|
7901
|
-
function
|
|
8006
|
+
function yo(e) {
|
|
7902
8007
|
if (!e.length) return [];
|
|
7903
8008
|
if (e.some((e) => typeof e != "number" || !Number.isFinite(e) || e < 0)) return e.map(() => null);
|
|
7904
8009
|
let t = e, n = t.reduce((e, t) => Math.max(e, t), 0);
|
|
@@ -7908,8 +8013,8 @@ function vo(e) {
|
|
|
7908
8013
|
}
|
|
7909
8014
|
//#endregion
|
|
7910
8015
|
//#region src/watch/normal-layer.tsx
|
|
7911
|
-
var
|
|
7912
|
-
function
|
|
8016
|
+
var bo = "normalLower", xo = "normalUpper", So = se().x((e) => e.x).y0((e) => e.lower).y1((e) => e.upper).curve(le);
|
|
8017
|
+
function Co({ series: e, flagged: t, part: n }) {
|
|
7913
8018
|
let { snapshot: r, clipId: i, revealProgress: a, visibleSeries: o } = Gt(), s = r.yToPixelFor(e), [c, l] = r.xDomain, u = o.includes(e), d = r.data.rows;
|
|
7914
8019
|
if (n === "band") {
|
|
7915
8020
|
let t = [], n = [];
|
|
@@ -7929,7 +8034,7 @@ function So({ series: e, flagged: t, part: n }) {
|
|
|
7929
8034
|
style: { opacity: +!!u },
|
|
7930
8035
|
children: t.map((e, t) => /* @__PURE__ */ I("path", {
|
|
7931
8036
|
className: "lilt-chart__normal-band",
|
|
7932
|
-
d:
|
|
8037
|
+
d: So(wo(e)) ?? ""
|
|
7933
8038
|
}, t))
|
|
7934
8039
|
});
|
|
7935
8040
|
}
|
|
@@ -7987,7 +8092,7 @@ function So({ series: e, flagged: t, part: n }) {
|
|
|
7987
8092
|
]
|
|
7988
8093
|
});
|
|
7989
8094
|
}
|
|
7990
|
-
function
|
|
8095
|
+
function wo(e) {
|
|
7991
8096
|
return e.map((t, n) => {
|
|
7992
8097
|
let r = e.slice(Math.max(0, n - 1), n + 2);
|
|
7993
8098
|
return {
|
|
@@ -7999,18 +8104,18 @@ function Co(e) {
|
|
|
7999
8104
|
}
|
|
8000
8105
|
//#endregion
|
|
8001
8106
|
//#region src/cards/cartesian-card.tsx
|
|
8002
|
-
function
|
|
8107
|
+
function To(e) {
|
|
8003
8108
|
return e === !0 ? "sum" : e ?? !1;
|
|
8004
8109
|
}
|
|
8005
|
-
var
|
|
8006
|
-
function
|
|
8007
|
-
let [Be, Ve] = j(M ?? O?.[0]?.id), B = O?.find((e) => e.id === Be) ?? O?.[0], He = B?.data ?? _ ??
|
|
8110
|
+
var Eo = [], Do = (e) => e.acceptedRevision;
|
|
8111
|
+
function Oo({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart", data: _, x: v, series: y, headline: b, aggregate: x = "sum", headlineSeries: S, delta: C, deltaTone: w, range: D, ranges: O, defaultRange: M, tiles: ee = !0, legend: te = "tiles", legendSwatch: N, depth: P = !1, height: ne = 240, valueFormat: re, locale: F = "en-US", formatValue: R, formatAxisValue: ae, formatX: oe, xType: se, compare: ce = !1, target: le, forecast: ue, sync: de, axis: fe = "minimal", hover: pe = "pills", hoverStyle: me = "soft", background: z = "dots", spotlight: he = !0, decimate: ge = !0, surface: _e = "elevated", badge: ve, numberStyle: ye, palette: be, bleed: xe = e.kind !== "bar" && e.kind !== "marks", axisInset: Se, pillSeries: we = "nearest", pillValue: Te = "series", pillPosition: Ee = "auto", tooltipIndicator: De = "square", loading: Oe = !1, loadingStyle: ke, empty: Ae, motion: je, className: Me, style: Ne, panes: Pe, live: Fe = !1, heading: Ie, restCaption: Le, normal: Re, onNormalChange: ze }) {
|
|
8112
|
+
let [Be, Ve] = j(M ?? O?.[0]?.id), B = O?.find((e) => e.id === Be) ?? O?.[0], He = B?.data ?? _ ?? Eo, Ue = B ? B.delta : C, We = e.kind === "line" || e.kind === "marks" ? !1 : e.stack, Ge = We !== !1, V = We === "percent", Ke = V ? "last" : x, qe = xe && e.kind !== "bar" && e.kind !== "marks", Je = k(() => {
|
|
8008
8113
|
let e = new Intl.NumberFormat(F, {
|
|
8009
8114
|
style: "percent",
|
|
8010
8115
|
maximumFractionDigits: 1
|
|
8011
8116
|
});
|
|
8012
8117
|
return (t) => e.format(t / 100);
|
|
8013
|
-
}, [F]), Ye =
|
|
8118
|
+
}, [F]), Ye = _o({
|
|
8014
8119
|
valueFormat: re,
|
|
8015
8120
|
locale: F,
|
|
8016
8121
|
formatValue: V ? Je : R,
|
|
@@ -8018,16 +8123,16 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8018
8123
|
}), Xe = Ye.value, H = Ye.key, Ze = JSON.stringify(e), U = y.map((e) => `${e.key}|${e.label}|${e.color}|${e.dashed}|${e.as}|${e.scale}|${JSON.stringify(e.valueFormat ?? null)}`).join(), W = new Set(y.filter((e) => e.as === "line" || e.dashed).map((e) => e.key)), Qe = k(() => {
|
|
8019
8124
|
if (!V) return null;
|
|
8020
8125
|
let e = y.filter((e) => !W.has(e.key));
|
|
8021
|
-
return new Map(He.map((t) => [t, Object.fromEntries(
|
|
8126
|
+
return new Map(He.map((t) => [t, Object.fromEntries(yo(e.map((e) => t[e.key])).map((t, n) => [e[n].key, t]))]));
|
|
8022
8127
|
}, [
|
|
8023
8128
|
V,
|
|
8024
8129
|
He,
|
|
8025
8130
|
U
|
|
8026
|
-
]), $e = k(() => new Map(y.flatMap((e) => e.valueFormat ? [[e.key,
|
|
8131
|
+
]), $e = k(() => new Map(y.flatMap((e) => e.valueFormat ? [[e.key, go(F, e.valueFormat)]] : [])), [U, F]), et = (e) => $e.get(e)?.full ?? Xe, G = k(() => po(He, v, se, oe), [
|
|
8027
8132
|
He,
|
|
8028
8133
|
v,
|
|
8029
8134
|
se
|
|
8030
|
-
]), rt = ue?.from instanceof Date ? ue.from.getTime() : ue?.from, it = k(() => rt === void 0 ? null :
|
|
8135
|
+
]), rt = ue?.from instanceof Date ? ue.from.getTime() : ue?.from, it = k(() => rt === void 0 ? null : Mo(He, v, G, rt), [
|
|
8031
8136
|
He,
|
|
8032
8137
|
v,
|
|
8033
8138
|
G,
|
|
@@ -8036,9 +8141,9 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8036
8141
|
He,
|
|
8037
8142
|
it,
|
|
8038
8143
|
G
|
|
8039
|
-
]), ot = ue?.lower && ue.upper && !Ge && e.kind !== "bar" && e.kind !== "marks" ? S ?? y.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, st = Re && !Ge && (e.kind === "area" || e.kind === "line") ? Re.series ?? S ?? y.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, dt = Re ?
|
|
8144
|
+
]), ot = ue?.lower && ue.upper && !Ge && e.kind !== "bar" && e.kind !== "marks" ? S ?? y.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, st = Re && !Ge && (e.kind === "area" || e.kind === "line") ? Re.series ?? S ?? y.find((e) => e.as !== "line" && !e.dashed)?.key : void 0, dt = Re ? ko(Re) : "", ft = k(() => {
|
|
8040
8145
|
if (!Re || st === void 0) return null;
|
|
8041
|
-
let { when: e, history: t =
|
|
8146
|
+
let { when: e, history: t = Eo, ...n } = Re, r = t.length, i = r ? [...t, ...He] : He;
|
|
8042
8147
|
return {
|
|
8043
8148
|
combined: i,
|
|
8044
8149
|
all: f({
|
|
@@ -8124,19 +8229,19 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8124
8229
|
...ot === t.key && ue?.lower && ue.upper ? {
|
|
8125
8230
|
lower: {
|
|
8126
8231
|
label: `${ue.label ?? "Forecast"} low`,
|
|
8127
|
-
accessor: (e) =>
|
|
8232
|
+
accessor: (e) => jo(e, ue.lower)
|
|
8128
8233
|
},
|
|
8129
8234
|
upper: {
|
|
8130
8235
|
label: `${ue.label ?? "Forecast"} high`,
|
|
8131
|
-
accessor: (e) =>
|
|
8236
|
+
accessor: (e) => jo(e, ue.upper)
|
|
8132
8237
|
}
|
|
8133
8238
|
} : {},
|
|
8134
8239
|
...st === t.key && mt ? {
|
|
8135
|
-
[
|
|
8240
|
+
[bo]: {
|
|
8136
8241
|
label: "Normal low",
|
|
8137
8242
|
accessor: (e) => mt.get(e)?.lower ?? null
|
|
8138
8243
|
},
|
|
8139
|
-
[
|
|
8244
|
+
[xo]: {
|
|
8140
8245
|
label: "Normal high",
|
|
8141
8246
|
accessor: (e) => mt.get(e)?.upper ?? null
|
|
8142
8247
|
}
|
|
@@ -8240,13 +8345,13 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8240
8345
|
series: Tt,
|
|
8241
8346
|
status: Oe ? "loading" : "ready"
|
|
8242
8347
|
}), zt = nt(Rt, (e) => e.inspection);
|
|
8243
|
-
|
|
8348
|
+
fi(de, Rt.getController(), He, v, G, {
|
|
8244
8349
|
label: g,
|
|
8245
8350
|
release: Rt.actions.release
|
|
8246
|
-
}), nt(Rt,
|
|
8351
|
+
}), nt(Rt, Do);
|
|
8247
8352
|
let Bt = new Set(Rt.series.map((e) => e.id)), [Vt, Ht] = j(null), [Ut, Wt] = j([]), Gt = new Set(Ut), Kt = k(() => Tt.map((e, t) => ({
|
|
8248
8353
|
id: e.id,
|
|
8249
|
-
total: Qe ? at.length && !W.has(e.id) ? Qe.get(at.at(-1))?.[e.id] ?? null : null : mo(
|
|
8354
|
+
total: Qe ? at.length && !W.has(e.id) ? Qe.get(at.at(-1))?.[e.id] ?? null : null : ho(mo(at, e.id), y[t]?.aggregate ?? Ke)
|
|
8250
8355
|
})), [
|
|
8251
8356
|
Tt,
|
|
8252
8357
|
at,
|
|
@@ -8261,13 +8366,13 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8261
8366
|
S,
|
|
8262
8367
|
Ge,
|
|
8263
8368
|
Ut
|
|
8264
|
-
]), Yt = !Kt.some((e) => qt.has(e.id) && e.total !== null), Xt = V ? Kt.some((e) => qt.has(e.id) && e.total === null) || !at.length ? null : Kt.reduce((e, t) => e + (qt.has(t.id) ? t.total ?? 0 : 0), 0) : B?.headline ?? b ?? (qt.size === 0 || Yt ? null : Ke === "sum" ? Kt.reduce((e, t) => e + (qt.has(t.id) ? t.total ?? 0 : 0), 0) :
|
|
8369
|
+
]), Yt = !Kt.some((e) => qt.has(e.id) && e.total !== null), Xt = V ? Kt.some((e) => qt.has(e.id) && e.total === null) || !at.length ? null : Kt.reduce((e, t) => e + (qt.has(t.id) ? t.total ?? 0 : 0), 0) : B?.headline ?? b ?? (qt.size === 0 || Yt ? null : Ke === "sum" ? Kt.reduce((e, t) => e + (qt.has(t.id) ? t.total ?? 0 : 0), 0) : ho(Jt, Ke) ?? 0), Zt = pe === "tooltip" || pe === "strip", Qt = Zt ? null : zt, $t = Qt ? new Map(Qt.series.map((e) => [e.id, e.value])) : null, en = nt(Rt, (e) => e.comparison), tn = ce === "badge", nn = !tn && !zt && en?.phase === "complete" ? en : null, rn = tn ? en : null, an = nn ? new Map(nn.series.map((e) => [e.id, e.absoluteChange])) : null, on = (e) => e.series.filter((e) => qt.has(e.id)).reduce((e, t) => ({
|
|
8265
8370
|
start: e.start + (t.startValue ?? 0),
|
|
8266
8371
|
end: e.end + (t.endValue ?? 0)
|
|
8267
8372
|
}), {
|
|
8268
8373
|
start: 0,
|
|
8269
8374
|
end: 0
|
|
8270
|
-
}), sn = nn ? on(nn) : void 0, cn = rn ? on(rn) : void 0, ln = V ? (e) => `${new Intl.NumberFormat(F, { maximumFractionDigits: 1 }).format(e)} pp` : Xe, un =
|
|
8375
|
+
}), sn = nn ? on(nn) : void 0, cn = rn ? on(rn) : void 0, ln = V ? (e) => `${new Intl.NumberFormat(F, { maximumFractionDigits: 1 }).format(e)} pp` : Xe, un = vo(ln), dn = Pt === null ? null : Jt.filter((e) => w === "inverse" ? e <= Pt : e >= Pt).length, fn = Le && He.length ? Le(He) : null, pn = Qt && e.kind === "marks" ? e.describe?.(Qt) ?? null : null, mn = Qt && pt ? pt[Qt.sourceIndex] ?? null : null, hn = mn?.severity ? yt(Qt?.sourceIndex) ?? _t(mn.flags) : null, gn = !!(it !== null && Qt?.series.some((e) => e.status === "forecast")), q = qt.size === 0 || V && nn?.series.some((e) => qt.has(e.id) && (e.startValue === null || e.endValue === null)) ? null : $t ? V && [...qt].some((e) => $t.get(e) == null) ? null : [...$t].reduce((e, [t, n]) => e + (qt.has(t) ? n ?? 0 : 0), 0) : sn ? sn.end - sn.start : Xt, _n = (e) => {
|
|
8271
8376
|
Ht(e), Rt.actions.focusSeries(e);
|
|
8272
8377
|
}, vn = (e) => {
|
|
8273
8378
|
Wt(e), _n(null), Rt.actions.setVisibleSeries(Tt.map((e) => e.id).filter((t) => !e.includes(t)));
|
|
@@ -8276,56 +8381,56 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8276
8381
|
right: bn && Sn ? xn : Cn,
|
|
8277
8382
|
bottom: e.kind === "marks" && e.xAxis === !1 ? 6 : 28,
|
|
8278
8383
|
left: bn ? xn : Cn
|
|
8279
|
-
}, En = Se ?? (xe ? 20 : 0), Dn = Tt.filter((e) => !W.has(e.id)).map((e) => e.id), On = Tt.filter((e) => Bt.has(e.id)), kn = at.length ? G.position(at.at(-1)) : null, An = He.length ? G.position(He.at(-1)) : null, jn = it === null || An === null || it > An ? null : kn === null ? it : e.kind === "bar" ? (kn +
|
|
8280
|
-
/* @__PURE__ */ I(
|
|
8281
|
-
jn === null ? null : /* @__PURE__ */ I(
|
|
8384
|
+
}, En = Se ?? (xe ? 20 : 0), Dn = Tt.filter((e) => !W.has(e.id)).map((e) => e.id), On = Tt.filter((e) => Bt.has(e.id)), kn = at.length ? G.position(at.at(-1)) : null, An = He.length ? G.position(He.at(-1)) : null, jn = it === null || An === null || it > An ? null : kn === null ? it : e.kind === "bar" ? (kn + No(He, G, it)) / 2 : kn, J = /* @__PURE__ */ L(ie, { children: [
|
|
8385
|
+
/* @__PURE__ */ I(La, { pattern: "lines" }),
|
|
8386
|
+
jn === null ? null : /* @__PURE__ */ I(co, {
|
|
8282
8387
|
from: jn,
|
|
8283
8388
|
to: Infinity,
|
|
8284
8389
|
label: ue?.label ?? "Forecast",
|
|
8285
8390
|
color: "var(--lilt-muted)",
|
|
8286
8391
|
className: "lilt-card__forecast"
|
|
8287
8392
|
}),
|
|
8288
|
-
ot && Bt.has(ot) ? /* @__PURE__ */ I(
|
|
8393
|
+
ot && Bt.has(ot) ? /* @__PURE__ */ I(Ma, {
|
|
8289
8394
|
series: ot,
|
|
8290
8395
|
lower: "lower",
|
|
8291
8396
|
upper: "upper"
|
|
8292
8397
|
}) : null,
|
|
8293
|
-
st && Bt.has(st) ? /* @__PURE__ */ I(
|
|
8398
|
+
st && Bt.has(st) ? /* @__PURE__ */ I(Co, {
|
|
8294
8399
|
series: st,
|
|
8295
8400
|
flagged: ht,
|
|
8296
8401
|
part: "band"
|
|
8297
8402
|
}) : null,
|
|
8298
|
-
e.kind === "area" ? On.map((e) => W.has(e.id) ? null : /* @__PURE__ */ I(
|
|
8403
|
+
e.kind === "area" ? On.map((e) => W.has(e.id) ? null : /* @__PURE__ */ I(pa, {
|
|
8299
8404
|
model: Rt,
|
|
8300
8405
|
series: e.id
|
|
8301
8406
|
}, `area-${e.id}`)) : null,
|
|
8302
|
-
e.kind === "bar" ? Dn.filter((e) => Bt.has(e)).map((e) => /* @__PURE__ */ I(
|
|
8407
|
+
e.kind === "bar" ? Dn.filter((e) => Bt.has(e)).map((e) => /* @__PURE__ */ I(Fa, {
|
|
8303
8408
|
model: Rt,
|
|
8304
8409
|
series: e
|
|
8305
8410
|
}, `bar-${e}`)) : null,
|
|
8306
8411
|
e.kind === "marks" ? e.draw(Dn.filter((e) => Bt.has(e))) : null,
|
|
8307
|
-
On.map((t) => (e.kind === "bar" || e.kind === "marks") && !W.has(t.id) ? null : /* @__PURE__ */ I(
|
|
8412
|
+
On.map((t) => (e.kind === "bar" || e.kind === "marks") && !W.has(t.id) ? null : /* @__PURE__ */ I(Pa, {
|
|
8308
8413
|
model: Rt,
|
|
8309
8414
|
series: t.id
|
|
8310
8415
|
}, `line-${t.id}`)),
|
|
8311
|
-
st && Bt.has(st) ? /* @__PURE__ */ I(
|
|
8416
|
+
st && Bt.has(st) ? /* @__PURE__ */ I(Co, {
|
|
8312
8417
|
series: st,
|
|
8313
8418
|
flagged: ht,
|
|
8314
8419
|
part: "flags"
|
|
8315
8420
|
}) : null,
|
|
8316
|
-
Ft.map((e) => /* @__PURE__ */ I(
|
|
8421
|
+
Ft.map((e) => /* @__PURE__ */ I(lo, {
|
|
8317
8422
|
value: e.value,
|
|
8318
8423
|
label: `${e.label} ${Ye.axis(e.value)}`,
|
|
8319
8424
|
className: "lilt-card__limit"
|
|
8320
8425
|
}, e.id)),
|
|
8321
|
-
Pt === null ? null : /* @__PURE__ */ I(
|
|
8426
|
+
Pt === null ? null : /* @__PURE__ */ I(lo, {
|
|
8322
8427
|
value: Pt,
|
|
8323
8428
|
label: `${Nt.label} ${Ye.axis(Pt)}`,
|
|
8324
8429
|
className: "lilt-card__target"
|
|
8325
8430
|
}),
|
|
8326
|
-
e.kind !== "marks" || e.xAxis !== !1 ? /* @__PURE__ */ I(
|
|
8327
|
-
/* @__PURE__ */ I(
|
|
8328
|
-
Sn ? /* @__PURE__ */ I(
|
|
8431
|
+
e.kind !== "marks" || e.xAxis !== !1 ? /* @__PURE__ */ I(eo, { labels: e.kind === "bar" || e.kind === "marks" ? "fit" : void 0 }) : null,
|
|
8432
|
+
/* @__PURE__ */ I(to, {}),
|
|
8433
|
+
Sn ? /* @__PURE__ */ I(to, { scale: "secondary" }) : null
|
|
8329
8434
|
] }), Mn = {
|
|
8330
8435
|
model: Rt,
|
|
8331
8436
|
height: ne,
|
|
@@ -8346,7 +8451,7 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8346
8451
|
adaptive: !1,
|
|
8347
8452
|
layout: pe === "strip" ? "strip" : "float"
|
|
8348
8453
|
} : void 0
|
|
8349
|
-
}, Nn = Ge && Dn.length ? { series: Dn } : void 0, Pn = /* @__PURE__ */ I(
|
|
8454
|
+
}, Nn = Ge && Dn.length ? { series: Dn } : void 0, Pn = /* @__PURE__ */ I(Xi, {
|
|
8350
8455
|
...Mn,
|
|
8351
8456
|
bars: e.kind === "bar" ? Ge ? {
|
|
8352
8457
|
segmentGap: 2,
|
|
@@ -8435,7 +8540,7 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8435
8540
|
Pt !== null && Pt !== 0 && q !== null ? /* @__PURE__ */ I(i, {
|
|
8436
8541
|
value: q / Pt - 1,
|
|
8437
8542
|
tone: w,
|
|
8438
|
-
format:
|
|
8543
|
+
format: Ao
|
|
8439
8544
|
}) : null,
|
|
8440
8545
|
/* @__PURE__ */ L(r, { children: [
|
|
8441
8546
|
Qt.formattedX,
|
|
@@ -8512,9 +8617,9 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8512
8617
|
formatValue: Xe,
|
|
8513
8618
|
formatAxis: Ye.axis
|
|
8514
8619
|
}) : null,
|
|
8515
|
-
ee && te !== !1 ? /* @__PURE__ */ I(
|
|
8620
|
+
ee && te !== !1 ? /* @__PURE__ */ I(ao, {
|
|
8516
8621
|
className: "lilt-card__tiles",
|
|
8517
|
-
variant:
|
|
8622
|
+
variant: io(te),
|
|
8518
8623
|
swatch: N,
|
|
8519
8624
|
"aria-label": `${g} by series`,
|
|
8520
8625
|
activeId: Vt ?? zt?.activeSeriesId ?? null,
|
|
@@ -8529,22 +8634,22 @@ function Do({ shape: e, title: n, header: h = !0, "aria-label": g = n || "Chart"
|
|
|
8529
8634
|
label: e.label,
|
|
8530
8635
|
color: e.color,
|
|
8531
8636
|
value: t,
|
|
8532
|
-
formattedValue: t === null ? "—" : an ?
|
|
8637
|
+
formattedValue: t === null ? "—" : an ? vo(V ? ln : et(e.id))(t) : et(e.id)(t)
|
|
8533
8638
|
};
|
|
8534
8639
|
})
|
|
8535
8640
|
}) : null
|
|
8536
8641
|
]
|
|
8537
8642
|
});
|
|
8538
8643
|
}
|
|
8539
|
-
function
|
|
8644
|
+
function ko({ history: e, ...t }) {
|
|
8540
8645
|
return JSON.stringify(t, (e, t) => typeof t == "function" ? String(t) : t);
|
|
8541
8646
|
}
|
|
8542
|
-
var
|
|
8543
|
-
function
|
|
8647
|
+
var Ao = (e) => `${e >= 0 ? "+" : "−"}${Math.abs(e * 100).toFixed(1)}% vs target`;
|
|
8648
|
+
function jo(e, t) {
|
|
8544
8649
|
let n = e[t];
|
|
8545
8650
|
return typeof n == "number" && Number.isFinite(n) ? n : null;
|
|
8546
8651
|
}
|
|
8547
|
-
function
|
|
8652
|
+
function Mo(e, t, n, r) {
|
|
8548
8653
|
if (n.kind === "category") {
|
|
8549
8654
|
let n = e.findIndex((e) => String(e[t]) === String(r));
|
|
8550
8655
|
return n < 0 ? null : n;
|
|
@@ -8552,7 +8657,7 @@ function jo(e, t, n, r) {
|
|
|
8552
8657
|
let i = Number(r);
|
|
8553
8658
|
return Number.isFinite(i) ? i : null;
|
|
8554
8659
|
}
|
|
8555
|
-
function
|
|
8660
|
+
function No(e, t, n) {
|
|
8556
8661
|
let r = Infinity;
|
|
8557
8662
|
for (let i of e) {
|
|
8558
8663
|
let e = t.position(i);
|
|
@@ -8562,7 +8667,7 @@ function Mo(e, t, n) {
|
|
|
8562
8667
|
}
|
|
8563
8668
|
//#endregion
|
|
8564
8669
|
//#region src/lifecycle/skeleton-block.tsx
|
|
8565
|
-
function
|
|
8670
|
+
function Po({ width: e = "100%", height: t, step: n = 0 }) {
|
|
8566
8671
|
return /* @__PURE__ */ I("span", {
|
|
8567
8672
|
className: "lilt-skeleton__block",
|
|
8568
8673
|
style: {
|
|
@@ -8573,4 +8678,4 @@ function No({ width: e = "100%", height: t, step: n = 0 }) {
|
|
|
8573
8678
|
});
|
|
8574
8679
|
}
|
|
8575
8680
|
//#endregion
|
|
8576
|
-
export { bn as $,
|
|
8681
|
+
export { bn as $, Sa as A, qi as B, Aa as C, Oe as Ct, ha as D, ba as E, Da as F, ui as G, pi as H, pa as I, Jn as J, qn as K, Xi as L, wa as M, Ca as N, ka as O, _a as P, J as Q, Wi as R, Ma as S, De as St, ya as T, mi as U, Hi as V, fi as W, Rn as X, zn as Y, Ln as Z, eo as _, tt as _t, vo as a, q as at, Fa as b, Ce as bt, mo as c, dn as ct, so as d, Gt as dt, Cn as et, co as f, Tt as ft, no as g, G as gt, ro as h, nt as ht, go as i, _n as it, va as j, Oa as k, po as l, pn as lt, io as m, rt as mt, Oo as n, En as nt, ho as o, Sn as ot, ao as p, Ot as pt, Vn as q, To as r, vn as rt, _o as s, mn as st, Po as t, yn as tt, lo as u, an as ut, to as v, et as vt, ja as w, ge as wt, Pa as x, ke as xt, La as y, Pe as yt, Ji as z };
|