uplot-plus 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Scale.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +481 -521
- package/package.json +1 -1
- package/dist/components/ResponsiveChart.d.ts +0 -18
- package/dist/components/ResponsiveChart.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as E, jsxs as Q, Fragment as Pe } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as X, useContext as Le, createContext as
|
|
3
|
-
var U = /* @__PURE__ */ ((t) => (t[t.Top = 0] = "Top", t[t.Right = 1] = "Right", t[t.Bottom = 2] = "Bottom", t[t.Left = 3] = "Left", t))(U || {}), G = /* @__PURE__ */ ((t) => (t[t.Horizontal = 0] = "Horizontal", t[t.Vertical = 1] = "Vertical", t))(G || {}), K = /* @__PURE__ */ ((t) => (t[t.Forward = 1] = "Forward", t[t.Backward = -1] = "Backward", t))(K || {}),
|
|
2
|
+
import { useRef as X, useContext as Le, createContext as De, useEffect as Y, useState as St, useCallback as q, useSyncExternalStore as fe, memo as ze, useLayoutEffect as zt } from "react";
|
|
3
|
+
var U = /* @__PURE__ */ ((t) => (t[t.Top = 0] = "Top", t[t.Right = 1] = "Right", t[t.Bottom = 2] = "Bottom", t[t.Left = 3] = "Left", t))(U || {}), G = /* @__PURE__ */ ((t) => (t[t.Horizontal = 0] = "Horizontal", t[t.Vertical = 1] = "Vertical", t))(G || {}), K = /* @__PURE__ */ ((t) => (t[t.Forward = 1] = "Forward", t[t.Backward = -1] = "Backward", t))(K || {}), N = /* @__PURE__ */ ((t) => (t[t.Linear = 1] = "Linear", t[t.Ordinal = 2] = "Ordinal", t[t.Log = 3] = "Log", t[t.Asinh = 4] = "Asinh", t))(N || {}), yt = /* @__PURE__ */ ((t) => (t[t.Ascending = 1] = "Ascending", t[t.Descending = -1] = "Descending", t[t.Unsorted = 0] = "Unsorted", t))(yt || {});
|
|
4
4
|
function xt(t) {
|
|
5
5
|
return t % 2;
|
|
6
6
|
}
|
|
7
7
|
var tt = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Scales = 1] = "Scales", t[t.Axes = 2] = "Axes", t[t.Paths = 4] = "Paths", t[t.Cursor = 8] = "Cursor", t[t.Select = 16] = "Select", t[t.Size = 32] = "Size", t[t.Full = 63] = "Full", t))(tt || {});
|
|
8
|
-
const J = Math, Ht = J.PI, gt = J.abs, st = J.floor, $ = J.round, Tt = J.ceil, qt = J.min, kt = J.max, wt = J.pow,
|
|
8
|
+
const J = Math, Ht = J.PI, gt = J.abs, st = J.floor, $ = J.round, Tt = J.ceil, qt = J.min, kt = J.max, wt = J.pow, Ot = J.sign, et = J.log10, Mt = J.log2, Fe = (t, e = 1) => J.sinh(t) * e, Wt = (t, e = 1) => J.asinh(t / e), O = 1 / 0, he = Number.isInteger;
|
|
9
9
|
function Vt(t, e) {
|
|
10
10
|
return t[e] ?? 0;
|
|
11
11
|
}
|
|
@@ -16,8 +16,8 @@ function ct(t, e, n = 0, s = e.length - 1) {
|
|
|
16
16
|
o = i ? n + s >> 1 : st((n + s) / 2), Vt(e, o) < t ? n = o : s = o;
|
|
17
17
|
return t - Vt(e, n) <= Vt(e, s) - t ? n : s;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
function
|
|
19
|
+
const de = (t) => t != null, ge = (t) => t != null && t > 0;
|
|
20
|
+
function pe(t) {
|
|
21
21
|
return (e, n, s) => {
|
|
22
22
|
let o = -1, i = -1;
|
|
23
23
|
for (let l = n; l <= s; l++)
|
|
@@ -33,15 +33,15 @@ function me(t) {
|
|
|
33
33
|
return [o, i];
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
const Ft =
|
|
37
|
-
function
|
|
38
|
-
const i = o ?
|
|
39
|
-
let c = t[r] ??
|
|
36
|
+
const Ft = pe(de), me = pe(ge);
|
|
37
|
+
function _e(t, e, n, s = yt.Unsorted, o = !1) {
|
|
38
|
+
const i = o ? me : Ft, l = o ? ge : de, [r, a] = i(t, e, n);
|
|
39
|
+
let c = t[r] ?? O, u = t[r] ?? -O;
|
|
40
40
|
if (r > -1)
|
|
41
41
|
if (s === yt.Ascending)
|
|
42
|
-
c = t[r] ??
|
|
42
|
+
c = t[r] ?? O, u = t[a] ?? -O;
|
|
43
43
|
else if (s === yt.Descending)
|
|
44
|
-
c = t[a] ??
|
|
44
|
+
c = t[a] ?? O, u = t[r] ?? -O;
|
|
45
45
|
else
|
|
46
46
|
for (let d = r; d <= a; d++) {
|
|
47
47
|
const f = t[d];
|
|
@@ -50,18 +50,18 @@ function Re(t, e, n, s = yt.Unsorted, o = !1) {
|
|
|
50
50
|
return [c, u];
|
|
51
51
|
}
|
|
52
52
|
function ut(t, e = 0) {
|
|
53
|
-
if (
|
|
53
|
+
if (he(t))
|
|
54
54
|
return t;
|
|
55
55
|
const n = 10 ** e, s = t * n * (1 + Number.EPSILON);
|
|
56
56
|
return $(s) / n;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
59
|
-
function
|
|
58
|
+
const vt = /* @__PURE__ */ new Map();
|
|
59
|
+
function Re(t) {
|
|
60
60
|
return (String(t).split(".")[1] ?? "").length;
|
|
61
61
|
}
|
|
62
62
|
const Ge = /\.\d*?(?=9{6,}|0{6,})/gm;
|
|
63
63
|
function It(t) {
|
|
64
|
-
if (
|
|
64
|
+
if (he(t) || vt.has(t))
|
|
65
65
|
return t;
|
|
66
66
|
const e = `${t}`, n = e.match(Ge);
|
|
67
67
|
if (n == null)
|
|
@@ -76,16 +76,16 @@ function It(t) {
|
|
|
76
76
|
function Et(t, e, n = !0) {
|
|
77
77
|
return n ? It(Tt(It(t / e)) * e) : Tt(t / e) * e;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function we(t, e, n = !0) {
|
|
80
80
|
return n ? It(st(It(t / e)) * e) : st(t / e) * e;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
const o = [], i = s.map(
|
|
82
|
+
function ve(t, e, n, s) {
|
|
83
|
+
const o = [], i = s.map(Re);
|
|
84
84
|
for (let l = e; l < n; l++) {
|
|
85
85
|
const r = gt(l);
|
|
86
86
|
for (let a = 0; a < s.length; a++) {
|
|
87
87
|
const c = s[a] ?? 0, u = i[a] ?? 0, d = +`${c}e${l}`, f = (l >= 0 ? 0 : r) + (l >= u ? 0 : u), g = d;
|
|
88
|
-
o.push(g),
|
|
88
|
+
o.push(g), vt.set(g, f);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return o;
|
|
@@ -95,33 +95,33 @@ const He = new Intl.NumberFormat(), xe = (t) => He.format(t), Ve = 0.1, lt = {
|
|
|
95
95
|
pad: Ve,
|
|
96
96
|
soft: null
|
|
97
97
|
}, Ct = { pad: 0, soft: null, mode: 0 }, $e = { min: Ct, max: Ct };
|
|
98
|
-
function
|
|
98
|
+
function bt(t, e, n, s) {
|
|
99
99
|
let o;
|
|
100
100
|
typeof n == "number" ? (Ct.pad = n, Ct.soft = null, Ct.mode = 0, o = $e) : o = n;
|
|
101
|
-
const i = o.min, l = o.max, r = i.pad, a = l.pad, c = i.hard ?? -
|
|
102
|
-
let
|
|
103
|
-
const P = et(
|
|
104
|
-
(
|
|
105
|
-
const L =
|
|
106
|
-
return
|
|
101
|
+
const i = o.min, l = o.max, r = i.pad, a = l.pad, c = i.hard ?? -O, u = l.hard ?? O, d = i.soft ?? O, f = l.soft ?? -O, g = i.mode, M = l.mode;
|
|
102
|
+
let S = e - t;
|
|
103
|
+
const P = et(S), h = kt(gt(t), gt(e)), C = et(h), I = gt(C - P);
|
|
104
|
+
(S < 1e-24 || I > 10) && (S = 0, (t === 0 || e === 0) && (S = 1e-24));
|
|
105
|
+
const L = S || h || 1e3, T = et(L), x = wt(10, st(T)), m = L * (S === 0 ? t === 0 ? 0.1 : 1 : r), b = ut(we(t - m, x / 10), 24), y = t >= d && (g === 1 || g === 3 && b <= d || g === 2 && b >= d) ? d : O, D = kt(c, b < y && t >= y ? y : qt(y, b)), p = L * (S === 0 ? e === 0 ? 0.1 : 1 : a), w = ut(Et(e + p, x / 10), 24), v = e <= f && (M === 1 || M === 3 && w >= f || M === 2 && w <= f) ? f : -O, k = qt(u, w > v && e <= v ? v : kt(v, w));
|
|
106
|
+
return D === k && D === 0 ? [-1, 1] : [D, k];
|
|
107
107
|
}
|
|
108
108
|
function Be(t, e, n, s) {
|
|
109
109
|
n === 2 && (s = !0);
|
|
110
|
-
const o =
|
|
110
|
+
const o = Ot(t), i = Ot(e);
|
|
111
111
|
t === e && (o === -1 ? (t *= n, e /= n) : (t /= n, e *= n));
|
|
112
|
-
const l = n === 10 ? et :
|
|
112
|
+
const l = n === 10 ? et : Mt, r = o === 1 ? st : Tt, a = i === 1 ? Tt : st, c = l(gt(t)), u = l(gt(e)), d = r(c), f = a(u);
|
|
113
113
|
let g = wt(n, d), M = wt(n, f);
|
|
114
|
-
return n === 10 && (d < 0 && (g = ut(g, -d)), f < 0 && (M = ut(M, -f))), s ? (t = g * o, e = M * i) : (t =
|
|
114
|
+
return n === 10 && (d < 0 && (g = ut(g, -d)), f < 0 && (M = ut(M, -f))), s ? (t = g * o, e = M * i) : (t = we(t, wt(n, st(c)), !1), e = Et(e, wt(n, st(u)), !1)), [t, e];
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Zt(t) {
|
|
117
117
|
return (et((t ^ t >> 31) - (t >> 31)) | 0) + 1;
|
|
118
118
|
}
|
|
119
119
|
function We(t, e, n, s, o) {
|
|
120
|
-
const i = kt(
|
|
120
|
+
const i = kt(Zt(t), Zt(e)), l = e - t;
|
|
121
121
|
let r = kt(0, ct(o / s * l, n) - 1);
|
|
122
122
|
do {
|
|
123
123
|
const a = n[r] ?? 0, c = s * a / l;
|
|
124
|
-
if (c >= o * 0.9 && i + (a < 5 ?
|
|
124
|
+
if (c >= o * 0.9 && i + (a < 5 ? vt.get(a) ?? 0 : 0) <= 17)
|
|
125
125
|
return [a, c];
|
|
126
126
|
} while (++r < n.length);
|
|
127
127
|
return [0, 0];
|
|
@@ -131,7 +131,7 @@ function Ee(t) {
|
|
|
131
131
|
id: t.id,
|
|
132
132
|
min: t.min ?? null,
|
|
133
133
|
max: t.max ?? null,
|
|
134
|
-
distr: t.distr ??
|
|
134
|
+
distr: t.distr ?? N.Linear,
|
|
135
135
|
log: t.log ?? 10,
|
|
136
136
|
asinh: t.asinh ?? 1,
|
|
137
137
|
ori: t.ori ?? (t.id === "x" ? G.Horizontal : G.Vertical),
|
|
@@ -146,43 +146,43 @@ function Ee(t) {
|
|
|
146
146
|
function at(t) {
|
|
147
147
|
t._min = null, t._max = null;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function Me(t) {
|
|
150
150
|
if (t._min != null) return t._min;
|
|
151
151
|
const { min: e, distr: n } = t;
|
|
152
152
|
if (e == null) return 0;
|
|
153
|
-
if (n ===
|
|
153
|
+
if (n === N.Log) {
|
|
154
154
|
const s = e > 0 ? e : 1e-10;
|
|
155
|
-
t._min = (t.log === 10 ? et :
|
|
156
|
-
} else n ===
|
|
155
|
+
t._min = (t.log === 10 ? et : Mt)(s);
|
|
156
|
+
} else n === N.Asinh ? t._min = Wt(e, t.asinh) : t._min = e;
|
|
157
157
|
return t._min;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function be(t) {
|
|
160
160
|
if (t._max != null) return t._max;
|
|
161
161
|
const { max: e, distr: n } = t;
|
|
162
162
|
if (e == null) return 0;
|
|
163
|
-
if (n ===
|
|
163
|
+
if (n === N.Log) {
|
|
164
164
|
const s = e > 0 ? e : 1e-10;
|
|
165
|
-
t._max = (t.log === 10 ? et :
|
|
166
|
-
} else n ===
|
|
165
|
+
t._max = (t.log === 10 ? et : Mt)(s);
|
|
166
|
+
} else n === N.Asinh ? t._max = Wt(e, t.asinh) : t._max = e;
|
|
167
167
|
return t._max;
|
|
168
168
|
}
|
|
169
169
|
function Xe(t, e) {
|
|
170
170
|
if (e.min == null || e.max == null) return 0;
|
|
171
|
-
const n =
|
|
171
|
+
const n = Me(e), o = be(e) - n;
|
|
172
172
|
if (o === 0) return 0;
|
|
173
173
|
const { distr: i } = e;
|
|
174
|
-
if (i ===
|
|
175
|
-
const l = e.log === 10 ? et :
|
|
174
|
+
if (i === N.Log) {
|
|
175
|
+
const l = e.log === 10 ? et : Mt, r = t > 0 ? t : 1e-10;
|
|
176
176
|
return (l(r) - n) / o;
|
|
177
177
|
}
|
|
178
|
-
return i ===
|
|
178
|
+
return i === N.Asinh ? (Wt(t, e.asinh) - n) / o : (t - n) / o;
|
|
179
179
|
}
|
|
180
180
|
function Ye(t, e) {
|
|
181
181
|
if (e.min == null || e.max == null) return 0;
|
|
182
|
-
const n =
|
|
182
|
+
const n = Me(e), s = be(e);
|
|
183
183
|
if (s === n) return e.min;
|
|
184
184
|
const { distr: o } = e;
|
|
185
|
-
return o ===
|
|
185
|
+
return o === N.Log ? Math.pow(e.log, n + t * (s - n)) : o === N.Asinh ? Fe(n + t * (s - n), e.asinh) : n + t * (s - n);
|
|
186
186
|
}
|
|
187
187
|
function H(t, e, n, s) {
|
|
188
188
|
const o = Xe(t, e);
|
|
@@ -240,20 +240,20 @@ class Ue {
|
|
|
240
240
|
if (!f || f.x.length === 0) continue;
|
|
241
241
|
const g = f.x[0], M = f.x[f.x.length - 1];
|
|
242
242
|
if (g == null || M == null) continue;
|
|
243
|
-
const
|
|
244
|
-
|
|
243
|
+
const S = n.get(u);
|
|
244
|
+
S ? (S.dataMin = Math.min(S.dataMin, g), S.dataMax = Math.max(S.dataMax, M)) : n.set(u, { dataMin: g, dataMax: M });
|
|
245
245
|
}
|
|
246
246
|
for (const [c, { dataMin: u, dataMax: d }] of n) {
|
|
247
247
|
const f = this.scales.get(c);
|
|
248
248
|
if (f) {
|
|
249
249
|
if (f.range) {
|
|
250
|
-
const [g, M] =
|
|
250
|
+
const [g, M] = bt(u, d, {
|
|
251
251
|
min: { pad: ((s = f.range.min) == null ? void 0 : s.pad) ?? 0, soft: ((o = f.range.min) == null ? void 0 : o.soft) ?? null, mode: ((i = f.range.min) == null ? void 0 : i.mode) ?? 0 },
|
|
252
252
|
max: { pad: ((l = f.range.max) == null ? void 0 : l.pad) ?? 0, soft: ((r = f.range.max) == null ? void 0 : r.soft) ?? null, mode: ((a = f.range.max) == null ? void 0 : a.mode) ?? 0 }
|
|
253
253
|
});
|
|
254
254
|
f.min = g, f.max = M;
|
|
255
255
|
} else
|
|
256
|
-
u === d ? [f.min, f.max] =
|
|
256
|
+
u === d ? [f.min, f.max] = bt(u, d, {
|
|
257
257
|
min: { pad: 0.1, soft: null, mode: 0 },
|
|
258
258
|
max: { pad: 0.1, soft: null, mode: 0 }
|
|
259
259
|
}) : (f.min = u, f.max = d);
|
|
@@ -267,29 +267,29 @@ class Ue {
|
|
|
267
267
|
* For each y-scale: range from all series that reference it, within the visible x-window.
|
|
268
268
|
*/
|
|
269
269
|
autoRange(e, n, s) {
|
|
270
|
-
var r, a, c, u, d, f, g, M,
|
|
270
|
+
var r, a, c, u, d, f, g, M, S, P, h, C;
|
|
271
271
|
const o = /* @__PURE__ */ new Map();
|
|
272
272
|
for (const [I, L] of this.groupXScales) {
|
|
273
273
|
const T = this.scales.get(L);
|
|
274
274
|
if (!T || !T.auto) continue;
|
|
275
275
|
const x = e[I];
|
|
276
276
|
if (!x || x.x.length === 0) continue;
|
|
277
|
-
const m = x.x[0],
|
|
278
|
-
if (m == null ||
|
|
277
|
+
const m = x.x[0], b = x.x[x.x.length - 1];
|
|
278
|
+
if (m == null || b == null) continue;
|
|
279
279
|
const y = o.get(L);
|
|
280
|
-
y ? (y.dataMin = Math.min(y.dataMin, m), y.dataMax = Math.max(y.dataMax,
|
|
280
|
+
y ? (y.dataMin = Math.min(y.dataMin, m), y.dataMax = Math.max(y.dataMax, b)) : o.set(L, { dataMin: m, dataMax: b });
|
|
281
281
|
}
|
|
282
282
|
for (const [I, { dataMin: L, dataMax: T }] of o) {
|
|
283
283
|
const x = this.scales.get(I);
|
|
284
284
|
if (x) {
|
|
285
285
|
if (x.range) {
|
|
286
|
-
const [m,
|
|
286
|
+
const [m, b] = bt(L, T, {
|
|
287
287
|
min: { pad: ((r = x.range.min) == null ? void 0 : r.pad) ?? 0, soft: ((a = x.range.min) == null ? void 0 : a.soft) ?? null, mode: ((c = x.range.min) == null ? void 0 : c.mode) ?? 0 },
|
|
288
288
|
max: { pad: ((u = x.range.max) == null ? void 0 : u.pad) ?? 0, soft: ((d = x.range.max) == null ? void 0 : d.soft) ?? null, mode: ((f = x.range.max) == null ? void 0 : f.mode) ?? 0 }
|
|
289
289
|
});
|
|
290
|
-
x.min = m, x.max =
|
|
290
|
+
x.min = m, x.max = b;
|
|
291
291
|
} else
|
|
292
|
-
L === T ? [x.min, x.max] =
|
|
292
|
+
L === T ? [x.min, x.max] = bt(L, T, {
|
|
293
293
|
min: { pad: 0.1, soft: null, mode: 0 },
|
|
294
294
|
max: { pad: 0.1, soft: null, mode: 0 }
|
|
295
295
|
}) : (x.min = L, x.max = T);
|
|
@@ -302,25 +302,25 @@ class Ue {
|
|
|
302
302
|
if (!x) continue;
|
|
303
303
|
const m = x.series[L];
|
|
304
304
|
if (!m || m.length === 0) continue;
|
|
305
|
-
const
|
|
306
|
-
i.set(T,
|
|
305
|
+
const b = s.windows.get(I), y = b ? b[0] : 0, D = b ? b[1] : m.length - 1, p = this.scales.get(T), w = (p == null ? void 0 : p.distr) === N.Log, [v, k] = s.getCachedMinMax(I, L, y, D, 0, w), z = i.get(T), A = l.get(T);
|
|
306
|
+
i.set(T, z != null ? Math.min(z, v) : v), l.set(T, A != null ? Math.max(A, k) : k);
|
|
307
307
|
}
|
|
308
308
|
for (const [I, L] of i) {
|
|
309
309
|
const T = this.scales.get(I);
|
|
310
310
|
if (!T || !T.auto) continue;
|
|
311
|
-
const x = l.get(I) ?? -
|
|
312
|
-
if (L ===
|
|
313
|
-
let m,
|
|
314
|
-
if (T.distr ===
|
|
315
|
-
[m,
|
|
311
|
+
const x = l.get(I) ?? -O;
|
|
312
|
+
if (L === O) continue;
|
|
313
|
+
let m, b;
|
|
314
|
+
if (T.distr === N.Log)
|
|
315
|
+
[m, b] = Be(L, x, T.log, !1);
|
|
316
316
|
else {
|
|
317
317
|
const y = T.range ?? { min: lt, max: lt };
|
|
318
|
-
[m,
|
|
319
|
-
min: { pad: ((g = y.min) == null ? void 0 : g.pad) ?? lt.pad, soft: ((M = y.min) == null ? void 0 : M.soft) ?? lt.soft, mode: ((
|
|
318
|
+
[m, b] = bt(L, x, {
|
|
319
|
+
min: { pad: ((g = y.min) == null ? void 0 : g.pad) ?? lt.pad, soft: ((M = y.min) == null ? void 0 : M.soft) ?? lt.soft, mode: ((S = y.min) == null ? void 0 : S.mode) ?? lt.mode },
|
|
320
320
|
max: { pad: ((P = y.max) == null ? void 0 : P.pad) ?? lt.pad, soft: ((h = y.max) == null ? void 0 : h.soft) ?? lt.soft, mode: ((C = y.max) == null ? void 0 : C.mode) ?? lt.mode }
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
-
T.min = m, T.max =
|
|
323
|
+
T.min = m, T.max = b, at(T);
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
}
|
|
@@ -407,7 +407,7 @@ class Ne {
|
|
|
407
407
|
this.data = e;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
class
|
|
410
|
+
class je {
|
|
411
411
|
constructor() {
|
|
412
412
|
this.data = [], this.windows = /* @__PURE__ */ new Map(), this.minMaxCache = /* @__PURE__ */ new Map(), this.blockTrees = /* @__PURE__ */ new Map();
|
|
413
413
|
}
|
|
@@ -484,7 +484,7 @@ class Oe {
|
|
|
484
484
|
if (!u || u.length === 0) return [1 / 0, -1 / 0];
|
|
485
485
|
let d;
|
|
486
486
|
const f = !l && i === yt.Unsorted ? this.getOrBuildTree(e, n) : void 0;
|
|
487
|
-
return f ? d = f.rangeMinMax(s, o) : d =
|
|
487
|
+
return f ? d = f.rangeMinMax(s, o) : d = _e(u, s, o, i, l), r.set(a, d), d;
|
|
488
488
|
}
|
|
489
489
|
/** Get block tree for a series (exposed for incremental append) */
|
|
490
490
|
getBlockTree(e, n) {
|
|
@@ -530,7 +530,7 @@ class Oe {
|
|
|
530
530
|
return e;
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
class
|
|
533
|
+
class qe {
|
|
534
534
|
constructor() {
|
|
535
535
|
this.state = {
|
|
536
536
|
left: -10,
|
|
@@ -560,33 +560,33 @@ class je {
|
|
|
560
560
|
const g = /* @__PURE__ */ new Map();
|
|
561
561
|
for (const M of i) {
|
|
562
562
|
if (M.show === !1) continue;
|
|
563
|
-
let
|
|
564
|
-
|
|
563
|
+
let S = g.get(M.group);
|
|
564
|
+
S == null && (S = [], g.set(M.group, S)), S.push(M);
|
|
565
565
|
}
|
|
566
566
|
for (let M = 0; M < o.length; M++) {
|
|
567
|
-
const
|
|
568
|
-
if (
|
|
569
|
-
const P =
|
|
567
|
+
const S = o[M];
|
|
568
|
+
if (S == null) continue;
|
|
569
|
+
const P = S.x;
|
|
570
570
|
if (P.length === 0) continue;
|
|
571
571
|
const h = a(M);
|
|
572
572
|
if (h == null) continue;
|
|
573
573
|
const C = l(h);
|
|
574
574
|
if (C == null || C.min == null || C.max == null) continue;
|
|
575
|
-
const [I, L] = r(M), T = s.width, x = s.left, m = it(e + x, C, T, x),
|
|
576
|
-
|
|
577
|
-
const
|
|
575
|
+
const [I, L] = r(M), T = s.width, x = s.left, m = it(e + x, C, T, x), b = ct(m, P, I, L), y = [b];
|
|
576
|
+
b > I && y.push(b - 1), b < L && y.push(b + 1);
|
|
577
|
+
const D = /* @__PURE__ */ new Map();
|
|
578
578
|
for (const p of y) {
|
|
579
579
|
const w = P[p];
|
|
580
580
|
if (w == null) continue;
|
|
581
581
|
const v = H(w, C, T, x);
|
|
582
582
|
for (const k of g.get(M) ?? []) {
|
|
583
|
-
const
|
|
584
|
-
if (
|
|
585
|
-
const A =
|
|
583
|
+
const z = S.series[k.index];
|
|
584
|
+
if (z == null) continue;
|
|
585
|
+
const A = z[p];
|
|
586
586
|
if (A == null) continue;
|
|
587
|
-
let F =
|
|
588
|
-
if (F == null && !
|
|
589
|
-
const
|
|
587
|
+
let F = D.get(k.yScale);
|
|
588
|
+
if (F == null && !D.has(k.yScale) && (F = l(k.yScale), D.set(k.yScale, F)), F == null || F.min == null || F.max == null) continue;
|
|
589
|
+
const _ = s.height, R = s.top, V = H(A, F, _, R), B = e + x - v, W = n + R - V, j = B * B + W * W;
|
|
590
590
|
if (j < c && (c = j, u = M, d = k.index, f = p, j === 0))
|
|
591
591
|
break;
|
|
592
592
|
}
|
|
@@ -615,9 +615,9 @@ class je {
|
|
|
615
615
|
let f = 0, g = n.plotBox.height / 2;
|
|
616
616
|
for (const M of n.seriesConfigs) {
|
|
617
617
|
if (M.group !== 0 || M.show === !1) continue;
|
|
618
|
-
const
|
|
619
|
-
if (
|
|
620
|
-
const P =
|
|
618
|
+
const S = o.series[M.index];
|
|
619
|
+
if (S == null) continue;
|
|
620
|
+
const P = S[c];
|
|
621
621
|
if (P == null) continue;
|
|
622
622
|
const h = n.scaleManager.getScale(M.yScale);
|
|
623
623
|
if (!(h == null || h.min == null || h.max == null)) {
|
|
@@ -628,7 +628,7 @@ class je {
|
|
|
628
628
|
this.state.top = g, this.state.activeSeriesIdx = f;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
class
|
|
631
|
+
class Oe {
|
|
632
632
|
constructor() {
|
|
633
633
|
this.flags = tt.None, this.frameId = null, this.callback = null;
|
|
634
634
|
}
|
|
@@ -669,10 +669,10 @@ class qe {
|
|
|
669
669
|
this.cancel(), this.callback = null, this.flags = tt.None;
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function _t(t, e, n) {
|
|
673
673
|
t.lineTo(e, n);
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Rt(t, e, n) {
|
|
676
676
|
t.lineTo(n, e);
|
|
677
677
|
}
|
|
678
678
|
function Xt(t, e, n, s, o, i) {
|
|
@@ -697,16 +697,16 @@ function Yt(t, e, n, s, o, i) {
|
|
|
697
697
|
d > r && (e === G.Horizontal ? l.rect(r, c, d - r, u) : l.rect(c, r, u, d - r)), r = f;
|
|
698
698
|
return r < a && (e === G.Horizontal ? l.rect(r, c, a - r, u) : l.rect(c, r, u, a - r)), l;
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function Se(t) {
|
|
701
701
|
return (e, n, s, o, i, l) => {
|
|
702
702
|
s !== o && (i !== s && l !== s && t(e, n, s), i !== o && l !== o && t(e, n, o), t(e, n, l));
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
|
-
const Ze =
|
|
705
|
+
const Ze = Se(_t), Je = Se(Rt);
|
|
706
706
|
function Qe() {
|
|
707
707
|
return (t, e, n, s, o, i, l, r, a, c, u, d, f) => {
|
|
708
708
|
const g = (f == null ? void 0 : f.spanGaps) ?? !1;
|
|
709
|
-
if ([a, c] = (s.distr ===
|
|
709
|
+
if ([a, c] = (s.distr === N.Log ? me : Ft)(e, a, c), a === -1)
|
|
710
710
|
return {
|
|
711
711
|
stroke: new Path2D(),
|
|
712
712
|
fill: null,
|
|
@@ -714,9 +714,9 @@ function Qe() {
|
|
|
714
714
|
band: null,
|
|
715
715
|
gaps: null
|
|
716
716
|
};
|
|
717
|
-
const
|
|
717
|
+
const S = (m) => d(H(m, n, o, l)), P = (m) => d(H(m, s, i, r));
|
|
718
718
|
let h, C;
|
|
719
|
-
n.ori === G.Horizontal ? (h =
|
|
719
|
+
n.ori === G.Horizontal ? (h = _t, C = Ze) : (h = Rt, C = Je);
|
|
720
720
|
const I = {
|
|
721
721
|
stroke: new Path2D(),
|
|
722
722
|
fill: null,
|
|
@@ -727,58 +727,58 @@ function Qe() {
|
|
|
727
727
|
let T = !1;
|
|
728
728
|
if (c - a >= o * 4) {
|
|
729
729
|
const m = (A) => it(A, n, o, l);
|
|
730
|
-
let
|
|
731
|
-
const v =
|
|
732
|
-
let
|
|
730
|
+
let b = null, y = 0, D = 0, p = 0, w = S(t[u === K.Forward ? a : c]);
|
|
731
|
+
const v = S(t[a]), k = S(t[c]);
|
|
732
|
+
let z = m(u === K.Forward ? v + 1 : k - 1);
|
|
733
733
|
for (let A = u === K.Forward ? a : c; A >= a && A <= c; A += u) {
|
|
734
|
-
const F = t[A],
|
|
735
|
-
|
|
734
|
+
const F = t[A], R = (u === K.Forward ? F < z : F > z) ? w : S(F), V = e[A];
|
|
735
|
+
R === w ? V != null ? (p = V, b == null ? (h(L, R, P(p)), D = b = y = p) : p < b ? b = p : p > y && (y = p)) : V === null && !g && (T = !0) : (b != null && C(L, w, P(b), P(y), P(D), P(p)), V != null ? (p = V, h(L, R, P(p)), b = y = D = p) : (b = null, y = 0, V === null && !g && (T = !0)), w = R, z = m(w + u));
|
|
736
736
|
}
|
|
737
|
-
|
|
737
|
+
b != null && (b !== y ? C(L, w, P(b), P(y), P(D), P(p)) : h(L, w, P(p)));
|
|
738
738
|
} else
|
|
739
739
|
for (let m = u === K.Forward ? a : c; m >= a && m <= c; m += u) {
|
|
740
|
-
const
|
|
741
|
-
|
|
740
|
+
const b = e[m];
|
|
741
|
+
b === null && !g ? T = !0 : b != null && h(L, S(t[m]), P(b));
|
|
742
742
|
}
|
|
743
743
|
{
|
|
744
|
-
const m = I.fill = new Path2D(L),
|
|
745
|
-
let
|
|
746
|
-
u === K.Backward && ([p,
|
|
744
|
+
const m = I.fill = new Path2D(L), b = (f == null ? void 0 : f.fillTo) ?? s.min ?? 0, y = P(b);
|
|
745
|
+
let D = l, p = l + o;
|
|
746
|
+
u === K.Backward && ([p, D] = [D, p]), h(m, p, y), h(m, D, y);
|
|
747
747
|
}
|
|
748
748
|
if (T) {
|
|
749
|
-
const m = Xt(t, e, a, c, u,
|
|
749
|
+
const m = Xt(t, e, a, c, u, S);
|
|
750
750
|
I.gaps = m, I.clip = Yt(m, n.ori, l, r, o, i);
|
|
751
751
|
}
|
|
752
752
|
return I;
|
|
753
753
|
};
|
|
754
754
|
}
|
|
755
|
-
const
|
|
756
|
-
function
|
|
755
|
+
const Jt = /* @__PURE__ */ new WeakMap();
|
|
756
|
+
function Qt(t, e, n) {
|
|
757
757
|
return typeof e == "string" ? e : tn(t, e, n);
|
|
758
758
|
}
|
|
759
759
|
function tn(t, e, n) {
|
|
760
|
-
const s =
|
|
760
|
+
const s = Jt.get(e);
|
|
761
761
|
if (s != null && s.top === n.top && s.height === n.height)
|
|
762
762
|
return s.grad;
|
|
763
763
|
const o = t.createLinearGradient(0, n.top, 0, n.top + n.height);
|
|
764
764
|
for (const [i, l] of e.stops)
|
|
765
765
|
o.addColorStop(i, l);
|
|
766
|
-
return
|
|
766
|
+
return Jt.set(e, { grad: o, top: n.top, height: n.height }), o;
|
|
767
767
|
}
|
|
768
768
|
function en(t, e, n, s, o) {
|
|
769
769
|
if (e.show === !1) return;
|
|
770
770
|
const i = e.alpha ?? 1;
|
|
771
771
|
t.save(), i < 1 && (t.globalAlpha = i), n.clip && t.clip(n.clip);
|
|
772
772
|
const l = o ?? { top: 0, width: t.canvas.width / s, height: t.canvas.height / s };
|
|
773
|
-
if (e.fill && n.fill && (t.fillStyle =
|
|
773
|
+
if (e.fill && n.fill && (t.fillStyle = Qt(t, e.fill, l), t.fill(n.fill)), e.stroke) {
|
|
774
774
|
const r = (e.width ?? 1) * s;
|
|
775
|
-
t.strokeStyle =
|
|
775
|
+
t.strokeStyle = Qt(t, e.stroke, l), t.lineWidth = r, t.lineJoin = e.join ?? "round", t.lineCap = e.cap ?? "butt", e.dash && t.setLineDash(e.dash.map((d) => d * s));
|
|
776
776
|
const a = e.pxAlign ?? 1, c = r % 2 / 2;
|
|
777
777
|
a === 1 && c > 0 && t.translate(c, c), t.stroke(n.stroke);
|
|
778
778
|
}
|
|
779
779
|
t.restore();
|
|
780
780
|
}
|
|
781
|
-
const nn = Qe(),
|
|
781
|
+
const nn = Qe(), te = 64;
|
|
782
782
|
class sn {
|
|
783
783
|
constructor() {
|
|
784
784
|
this.ctx = null, this.pxRatio = 1, this.pathCache = /* @__PURE__ */ new Map(), this.pathCacheSize = 0, this.bandCache = /* @__PURE__ */ new Map(), this.lruHead = null, this.lruTail = null, this.lruMap = /* @__PURE__ */ new Map(), this.snapshotCanvas = null, this.snapshotValid = !1, this.cachedFillStyle = "", this.cachedStrokeStyle = "", this.cachedLineWidth = -1, this.cachedFont = "", this.cachedTextAlign = "", this.cachedTextBaseline = "", this.cachedGlobalAlpha = -1;
|
|
@@ -864,14 +864,14 @@ class sn {
|
|
|
864
864
|
}
|
|
865
865
|
/** Store paths in cache, evicting oldest 25% when at capacity */
|
|
866
866
|
setCachedPaths(e, n, s, o, i) {
|
|
867
|
-
if (this.pathCacheSize >=
|
|
868
|
-
const u =
|
|
867
|
+
if (this.pathCacheSize >= te) {
|
|
868
|
+
const u = te >> 2;
|
|
869
869
|
let d = this.lruHead;
|
|
870
870
|
for (let f = 0; f < u && d != null; f++) {
|
|
871
871
|
const g = d.next, M = this.pathCache.get(d.group);
|
|
872
872
|
if (M != null) {
|
|
873
|
-
const
|
|
874
|
-
|
|
873
|
+
const S = M.get(d.index);
|
|
874
|
+
S != null && (S.delete(d.key), this.pathCacheSize--, S.size === 0 && M.delete(d.index), M.size === 0 && this.pathCache.delete(d.group));
|
|
875
875
|
}
|
|
876
876
|
this.lruMap.delete(this.lruKey(d.group, d.index, d.key)), d = g;
|
|
877
877
|
}
|
|
@@ -944,7 +944,7 @@ class sn {
|
|
|
944
944
|
const i = e.config.group, l = e.config.index, [r, a] = e.window;
|
|
945
945
|
let c = this.getCachedPaths(i, l, r, a);
|
|
946
946
|
if (c == null) {
|
|
947
|
-
const u = e.config.paths ?? nn, d = e.xScale.dir, f = (
|
|
947
|
+
const u = e.config.paths ?? nn, d = e.xScale.dir, f = (S) => $(S), g = e.config.fillTo, M = typeof g == "function" ? g(e.yScale.min ?? 0, e.yScale.max ?? 0) : g;
|
|
948
948
|
c = u(
|
|
949
949
|
e.dataX,
|
|
950
950
|
e.dataY,
|
|
@@ -976,28 +976,28 @@ class sn {
|
|
|
976
976
|
i.restore(), this.resetPropertyCache();
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
|
-
const
|
|
979
|
+
const ye = [1, 2, 2.5, 5], on = ve(10, -32, 0, ye), ln = ve(10, 0, 32, ye), ft = on.concat(ln);
|
|
980
980
|
function rn(t, e, n, s, o) {
|
|
981
981
|
if (n <= 0 || e < t) return [];
|
|
982
|
-
const i = [], l =
|
|
982
|
+
const i = [], l = vt.get(n) ?? 0, r = o ? t : ut(Et(t, n), l);
|
|
983
983
|
for (let a = r; a <= e; a = ut(a + n, l))
|
|
984
984
|
i.push(Object.is(a, -0) ? 0 : a);
|
|
985
985
|
return i;
|
|
986
986
|
}
|
|
987
|
-
function
|
|
987
|
+
function ee(t) {
|
|
988
988
|
return t.map((e) => xe(e));
|
|
989
989
|
}
|
|
990
990
|
function an(t, e, n) {
|
|
991
991
|
if (t <= 0 || e <= 0 || t >= e) return [];
|
|
992
|
-
const s = [], i = st((n === 10 ? et :
|
|
992
|
+
const s = [], i = st((n === 10 ? et : Mt)(t));
|
|
993
993
|
let l = wt(n, i);
|
|
994
994
|
n === 10 && (l = ft[ct(l, ft)] ?? l);
|
|
995
995
|
let r = l, a = l * n;
|
|
996
996
|
n === 10 && (a = ft[ct(a, ft)] ?? a);
|
|
997
997
|
let c = 0;
|
|
998
998
|
do {
|
|
999
|
-
if (r >= t && s.push(r), r = r + l, n === 10 && !
|
|
1000
|
-
const u =
|
|
999
|
+
if (r >= t && s.push(r), r = r + l, n === 10 && !vt.has(r)) {
|
|
1000
|
+
const u = vt.get(l) ?? 0;
|
|
1001
1001
|
r = ut(r, u);
|
|
1002
1002
|
}
|
|
1003
1003
|
r >= a * (1 - 1e-10) && (l = r, a = l * n, n === 10 && (a = ft[ct(a, ft)] ?? a));
|
|
@@ -1005,7 +1005,7 @@ function an(t, e, n) {
|
|
|
1005
1005
|
return s;
|
|
1006
1006
|
}
|
|
1007
1007
|
function cn(t, e) {
|
|
1008
|
-
const n = e === 10 ? et :
|
|
1008
|
+
const n = e === 10 ? et : Mt;
|
|
1009
1009
|
return t.map((s) => {
|
|
1010
1010
|
if (s === 0) return !0;
|
|
1011
1011
|
if (s < 0) return !1;
|
|
@@ -1120,11 +1120,11 @@ function mn(t, e, n, s) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
return o;
|
|
1122
1122
|
}
|
|
1123
|
-
const
|
|
1123
|
+
const ne = /* @__PURE__ */ new Map();
|
|
1124
1124
|
function wn(t, e) {
|
|
1125
1125
|
const n = JSON.stringify(t) + (e ?? "");
|
|
1126
|
-
let s =
|
|
1127
|
-
return s == null && (s = new Intl.DateTimeFormat(void 0, { ...t, timeZone: e }),
|
|
1126
|
+
let s = ne.get(n);
|
|
1127
|
+
return s == null && (s = new Intl.DateTimeFormat(void 0, { ...t, timeZone: e }), ne.set(n, s)), s;
|
|
1128
1128
|
}
|
|
1129
1129
|
function nt(t, e, n) {
|
|
1130
1130
|
const s = new Date(t * 1e3);
|
|
@@ -1133,10 +1133,10 @@ function nt(t, e, n) {
|
|
|
1133
1133
|
function vn(t, e) {
|
|
1134
1134
|
return nt(t, { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function xn(t, e) {
|
|
1137
1137
|
return nt(t, { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: !1 }, e);
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function Mn(t, e) {
|
|
1140
1140
|
return nt(t, { hour: "2-digit", minute: "2-digit", hour12: !1 }, e);
|
|
1141
1141
|
}
|
|
1142
1142
|
function bn(t, e) {
|
|
@@ -1150,7 +1150,7 @@ function yn(t, e) {
|
|
|
1150
1150
|
}
|
|
1151
1151
|
function kn(t, e, n) {
|
|
1152
1152
|
let s;
|
|
1153
|
-
return e >= At ? s = Sn : e >= dt ? s = yn : e >= rt ? s = bn : e >= ht ? s =
|
|
1153
|
+
return e >= At ? s = Sn : e >= dt ? s = yn : e >= rt ? s = bn : e >= ht ? s = Mn : e >= mt ? s = xn : s = vn, t.map((o) => s(o, n));
|
|
1154
1154
|
}
|
|
1155
1155
|
function Cn(t, e, n, s, o) {
|
|
1156
1156
|
const i = e - t;
|
|
@@ -1177,40 +1177,40 @@ function In(t, e, n, s, o) {
|
|
|
1177
1177
|
} else
|
|
1178
1178
|
l._show || (i = !1, l._show = !0);
|
|
1179
1179
|
const c = r.side, d = xt(c) === G.Horizontal ? n : s, { min: f, max: g } = a;
|
|
1180
|
-
let M,
|
|
1180
|
+
let M, S;
|
|
1181
1181
|
if (a.time) {
|
|
1182
1182
|
const h = r.space ?? 80;
|
|
1183
|
-
[M,
|
|
1183
|
+
[M, S] = Cn(f, g, pn, d, h);
|
|
1184
1184
|
} else
|
|
1185
|
-
[M,
|
|
1186
|
-
if (l._incr = M, l._space =
|
|
1185
|
+
[M, S] = fn(r, f, g, d);
|
|
1186
|
+
if (l._incr = M, l._space = S, S === 0)
|
|
1187
1187
|
continue;
|
|
1188
1188
|
if (r.splits)
|
|
1189
|
-
l._splits = r.splits(f, g, M,
|
|
1189
|
+
l._splits = r.splits(f, g, M, S);
|
|
1190
1190
|
else if (a.time)
|
|
1191
1191
|
l._splits = mn(f, g, M);
|
|
1192
|
-
else if (a.distr ===
|
|
1192
|
+
else if (a.distr === N.Log)
|
|
1193
1193
|
l._splits = an(f, g, a.log);
|
|
1194
1194
|
else {
|
|
1195
|
-
const h = a.distr ===
|
|
1196
|
-
l._splits = rn(f, g, M,
|
|
1195
|
+
const h = a.distr === N.Ordinal;
|
|
1196
|
+
l._splits = rn(f, g, M, S, h);
|
|
1197
1197
|
}
|
|
1198
1198
|
if (r.values)
|
|
1199
|
-
l._values = r.values(l._splits,
|
|
1199
|
+
l._values = r.values(l._splits, S, M);
|
|
1200
1200
|
else if (a.time)
|
|
1201
1201
|
l._values = kn(l._splits, M);
|
|
1202
|
-
else if (a.distr ===
|
|
1203
|
-
const h = cn(l._splits, a.log), C =
|
|
1202
|
+
else if (a.distr === N.Log) {
|
|
1203
|
+
const h = cn(l._splits, a.log), C = ee(l._splits);
|
|
1204
1204
|
l._values = C.map((I, L) => h[L] ? I : "");
|
|
1205
1205
|
} else
|
|
1206
|
-
l._values =
|
|
1206
|
+
l._values = ee(l._splits);
|
|
1207
1207
|
l._rotate = c === U.Bottom ? r.rotate ?? 0 : 0;
|
|
1208
1208
|
const P = l._size;
|
|
1209
1209
|
l._size = Tt(dn(r, l._values)), P !== l._size && (i = !1);
|
|
1210
1210
|
}
|
|
1211
1211
|
return i;
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function se(t, e, n) {
|
|
1214
1214
|
let s = t, o = e, i = 0, l = 0;
|
|
1215
1215
|
for (const r of n) {
|
|
1216
1216
|
if (!r._show)
|
|
@@ -1267,25 +1267,25 @@ function Pn(t, e, n, s) {
|
|
|
1267
1267
|
l.width,
|
|
1268
1268
|
l.height
|
|
1269
1269
|
);
|
|
1270
|
-
o = i === Tn || r, o || (l =
|
|
1270
|
+
o = i === Tn || r, o || (l = se(t, e, n));
|
|
1271
1271
|
}
|
|
1272
|
-
return l =
|
|
1272
|
+
return l = se(t, e, n), An(n, l), l;
|
|
1273
1273
|
}
|
|
1274
|
-
const
|
|
1275
|
-
function
|
|
1274
|
+
const oe = "top", le = "bottom", Ln = "left", Dn = "right";
|
|
1275
|
+
function ie(t, e) {
|
|
1276
1276
|
return e === 1 ? t : t.replace(/(\d+(?:\.\d+)?)px/, (n, s) => `${Math.round(Number(s) * e)}px`);
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1278
|
+
function re(t, e, n, s, o, i, l, r, a, c, u) {
|
|
1279
1279
|
const d = r % 2 / 2;
|
|
1280
1280
|
t.save(), t.translate(d, d), t.strokeStyle = a, t.lineWidth = r, c.length > 0 && t.setLineDash(c), t.beginPath();
|
|
1281
|
-
let f = 0, g = 0, M = 0,
|
|
1281
|
+
let f = 0, g = 0, M = 0, S = 0;
|
|
1282
1282
|
const P = i + (o === U.Top || o === U.Left ? -l : l);
|
|
1283
|
-
s === G.Horizontal ? (g = i,
|
|
1283
|
+
s === G.Horizontal ? (g = i, S = P) : (f = i, M = P);
|
|
1284
1284
|
for (let h = 0; h < e.length; h++)
|
|
1285
|
-
n[h] != null && (s === G.Horizontal ? f = M = e[h] ?? 0 : g =
|
|
1285
|
+
n[h] != null && (s === G.Horizontal ? f = M = e[h] ?? 0 : g = S = e[h] ?? 0, t.moveTo(f, g), t.lineTo(M, S));
|
|
1286
1286
|
t.stroke(), t.restore();
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1288
|
+
function zn(t, e, n, s, o) {
|
|
1289
1289
|
const i = $(s.left * o), l = $(s.top * o), r = $(s.width * o), a = $(s.height * o);
|
|
1290
1290
|
for (const c of e) {
|
|
1291
1291
|
if (!c._show)
|
|
@@ -1293,55 +1293,55 @@ function Dn(t, e, n, s, o) {
|
|
|
1293
1293
|
const u = c.config, d = u.side, f = xt(d), g = n(u.scale);
|
|
1294
1294
|
if (!g || g.min == null || g.max == null)
|
|
1295
1295
|
continue;
|
|
1296
|
-
const M = u.stroke ?? "#000",
|
|
1296
|
+
const M = u.stroke ?? "#000", S = d === U.Top || d === U.Left ? -1 : 1, P = c._splits, h = c._values;
|
|
1297
1297
|
if (!P || !h || c._space === 0)
|
|
1298
1298
|
continue;
|
|
1299
1299
|
const C = f === G.Horizontal ? s.width : s.height, I = f === G.Horizontal ? s.left : s.top, L = P.map((y) => $(H(y, g, C, I) * o)), T = h.map((y) => y === "" ? null : y), x = u.grid;
|
|
1300
1300
|
if ((x == null ? void 0 : x.show) !== !1) {
|
|
1301
|
-
const y = (x == null ? void 0 : x.stroke) ?? "rgba(0,0,0,0.12)",
|
|
1302
|
-
|
|
1301
|
+
const y = (x == null ? void 0 : x.stroke) ?? "rgba(0,0,0,0.12)", D = $(((x == null ? void 0 : x.width) ?? 2) * o), p = ((x == null ? void 0 : x.dash) ?? []).map((k) => k * o), w = f === G.Horizontal ? l : i, v = f === G.Horizontal ? a : r;
|
|
1302
|
+
re(t, L, T, f, 2, w, v, D, y, p);
|
|
1303
1303
|
}
|
|
1304
1304
|
const m = u.ticks;
|
|
1305
1305
|
if ((m == null ? void 0 : m.show) !== !1) {
|
|
1306
|
-
const y = (m == null ? void 0 : m.stroke) ?? M,
|
|
1307
|
-
|
|
1306
|
+
const y = (m == null ? void 0 : m.stroke) ?? M, D = $(((m == null ? void 0 : m.width) ?? 1) * o), p = $(((m == null ? void 0 : m.size) ?? 10) * o), w = ((m == null ? void 0 : m.dash) ?? []).map((k) => k * o), v = $(c._pos * o);
|
|
1307
|
+
re(t, L, T, f, d, v, p, D, y, w);
|
|
1308
1308
|
}
|
|
1309
1309
|
{
|
|
1310
|
-
const y = (m == null ? void 0 : m.show) !== !1 ? ((m == null ? void 0 : m.size) ?? 10) * o : 0,
|
|
1311
|
-
t.font = k, t.fillStyle = M, t.textAlign =
|
|
1310
|
+
const y = (m == null ? void 0 : m.show) !== !1 ? ((m == null ? void 0 : m.size) ?? 10) * o : 0, D = $((u.gap ?? 5) * o), p = $(c._pos * o), w = (y + D) * S, v = p + w, k = ie(u.font ?? "12px system-ui, sans-serif", o), z = f === G.Horizontal ? "center" : d === U.Left ? Dn : Ln, A = f === G.Horizontal ? d === U.Bottom ? oe : le : "middle";
|
|
1311
|
+
t.font = k, t.fillStyle = M, t.textAlign = z, t.textBaseline = A;
|
|
1312
1312
|
const F = c._rotate * -Ht / 180;
|
|
1313
1313
|
if (F !== 0) {
|
|
1314
|
-
const
|
|
1314
|
+
const _ = Math.cos(F), R = Math.sin(F);
|
|
1315
1315
|
for (let V = 0; V < h.length; V++) {
|
|
1316
1316
|
const B = h[V];
|
|
1317
1317
|
if (B == null || B === "")
|
|
1318
1318
|
continue;
|
|
1319
1319
|
const W = L[V] ?? 0;
|
|
1320
|
-
t.setTransform(
|
|
1320
|
+
t.setTransform(_, R, -R, _, W, v), t.fillText(B, 0, 0);
|
|
1321
1321
|
}
|
|
1322
1322
|
t.setTransform(1, 0, 0, 1, 0, 0);
|
|
1323
1323
|
} else
|
|
1324
|
-
for (let
|
|
1325
|
-
const
|
|
1326
|
-
if (
|
|
1324
|
+
for (let _ = 0; _ < h.length; _++) {
|
|
1325
|
+
const R = h[_];
|
|
1326
|
+
if (R == null || R === "")
|
|
1327
1327
|
continue;
|
|
1328
|
-
const V = L[
|
|
1329
|
-
t.fillText(
|
|
1328
|
+
const V = L[_] ?? 0, B = f === G.Horizontal ? V : v, W = f === G.Horizontal ? v : V;
|
|
1329
|
+
t.fillText(R, B, W);
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
1332
|
if (u.label != null) {
|
|
1333
|
-
const y =
|
|
1334
|
-
t.font = y, t.fillStyle = M, t.textAlign = "center", t.textBaseline = d === U.Bottom ?
|
|
1335
|
-
const
|
|
1333
|
+
const y = ie(u.labelFont ?? "bold 12px system-ui, sans-serif", o);
|
|
1334
|
+
t.font = y, t.fillStyle = M, t.textAlign = "center", t.textBaseline = d === U.Bottom ? oe : le;
|
|
1335
|
+
const D = $((c._lpos + (u.labelGap ?? 0) * S) * o);
|
|
1336
1336
|
f === G.Vertical ? (t.save(), t.translate(
|
|
1337
|
-
|
|
1337
|
+
D,
|
|
1338
1338
|
$(l + a / 2)
|
|
1339
|
-
), t.rotate((d === U.Left ? -Ht : Ht) / 2), t.fillText(u.label, 0, 0), t.restore()) : t.fillText(u.label, $(i + r / 2),
|
|
1339
|
+
), t.rotate((d === U.Left ? -Ht : Ht) / 2), t.fillText(u.label, 0, 0), t.restore()) : t.fillText(u.label, $(i + r / 2), D);
|
|
1340
1340
|
}
|
|
1341
|
-
const
|
|
1342
|
-
if ((
|
|
1343
|
-
const y =
|
|
1344
|
-
t.strokeStyle = y, t.lineWidth =
|
|
1341
|
+
const b = u.border;
|
|
1342
|
+
if ((b == null ? void 0 : b.show) !== !1 && b != null) {
|
|
1343
|
+
const y = b.stroke ?? M, D = $((b.width ?? 1) * o), p = (b.dash ?? []).map((v) => v * o), w = $(c._pos * o);
|
|
1344
|
+
t.strokeStyle = y, t.lineWidth = D, p.length > 0 && t.setLineDash(p), t.beginPath(), f === G.Horizontal ? (t.moveTo(i, w), t.lineTo(i + r, w)) : (t.moveTo(w, l), t.lineTo(w, l + a)), t.stroke(), p.length > 0 && t.setLineDash([]);
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
1347
|
}
|
|
@@ -1353,15 +1353,15 @@ const Fn = {
|
|
|
1353
1353
|
showX: !0,
|
|
1354
1354
|
showY: !0
|
|
1355
1355
|
};
|
|
1356
|
-
function
|
|
1356
|
+
function ae(t, e, n, s, o, i, l, r, a) {
|
|
1357
1357
|
var I;
|
|
1358
1358
|
if (e.left < 0 || e.top < 0) return;
|
|
1359
|
-
const c = { ...Fn, ...a }, u = s, d = $(n.left * u), f = $(n.top * u), g = $(n.width * u), M = $(n.height * u),
|
|
1360
|
-
if (t.save(), t.strokeStyle = c.stroke, t.lineWidth =
|
|
1359
|
+
const c = { ...Fn, ...a }, u = s, d = $(n.left * u), f = $(n.top * u), g = $(n.width * u), M = $(n.height * u), S = $(c.width * u), P = S % 2 / 2, h = $((n.left + e.left) * u) + P, C = $((n.top + e.top) * u) + P;
|
|
1360
|
+
if (t.save(), t.strokeStyle = c.stroke, t.lineWidth = S, t.setLineDash(c.dash.map((L) => L * u)), c.showX && (t.beginPath(), t.moveTo(h, f), t.lineTo(h, f + M), t.stroke()), c.showY && (t.beginPath(), t.moveTo(d, C), t.lineTo(d + g, C), t.stroke()), t.setLineDash([]), e.activeGroup >= 0 && e.activeDataIdx >= 0) {
|
|
1361
1361
|
const L = e.activeGroup, T = e.activeSeriesIdx, x = e.activeDataIdx, m = o[L];
|
|
1362
1362
|
if (m != null && T >= 0 && T < m.series.length && x < m.x.length) {
|
|
1363
|
-
const
|
|
1364
|
-
if (
|
|
1363
|
+
const b = m.x[x], y = m.series[T], D = y != null ? y[x] : null;
|
|
1364
|
+
if (b != null && D != null) {
|
|
1365
1365
|
let p = c.stroke, w = !0;
|
|
1366
1366
|
for (const v of i)
|
|
1367
1367
|
if (v.group === L && v.index === T) {
|
|
@@ -1370,10 +1370,10 @@ function ce(t, e, n, s, o, i, l, r, a) {
|
|
|
1370
1370
|
break;
|
|
1371
1371
|
}
|
|
1372
1372
|
if (w) {
|
|
1373
|
-
const v = r(L), k = v != null ? l(v) : void 0,
|
|
1373
|
+
const v = r(L), k = v != null ? l(v) : void 0, z = _n(i, L, T), A = z != null ? l(z) : void 0;
|
|
1374
1374
|
if (k != null && A != null && k.min != null && k.max != null && A.min != null && A.max != null) {
|
|
1375
|
-
const F = $(H(
|
|
1376
|
-
t.beginPath(), t.arc(F,
|
|
1375
|
+
const F = $(H(b, k, n.width, n.left) * u), _ = $(H(D, A, n.height, n.top) * u), R = c.pointRadius * u, V = $(2 * u);
|
|
1376
|
+
t.beginPath(), t.arc(F, _, R, 0, Math.PI * 2), t.fillStyle = "#fff", t.fill(), t.strokeStyle = p, t.lineWidth = V, t.stroke();
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
@@ -1381,24 +1381,24 @@ function ce(t, e, n, s, o, i, l, r, a) {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
t.restore();
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function _n(t, e, n) {
|
|
1385
1385
|
for (const s of t)
|
|
1386
1386
|
if (s.group === e && s.index === n)
|
|
1387
1387
|
return s.yScale;
|
|
1388
1388
|
}
|
|
1389
|
-
const
|
|
1389
|
+
const Rn = {
|
|
1390
1390
|
fill: "rgba(0,0,0,0.07)",
|
|
1391
1391
|
stroke: "rgba(0,0,0,0.15)",
|
|
1392
1392
|
width: 1
|
|
1393
1393
|
};
|
|
1394
|
-
function
|
|
1394
|
+
function ce(t, e, n, s, o) {
|
|
1395
1395
|
if (!e.show || e.width <= 0) return;
|
|
1396
|
-
const i = { ...
|
|
1396
|
+
const i = { ...Rn, ...o }, l = s, r = $((n.left + e.left) * l), a = $((n.top + e.top) * l), c = $(e.width * l), u = $(e.height * l);
|
|
1397
1397
|
t.save(), t.fillStyle = i.fill, t.fillRect(r, a, c, u), i.width > 0 && (t.strokeStyle = i.stroke, t.lineWidth = $(i.width * l), t.strokeRect(r, a, c, u)), t.restore();
|
|
1398
1398
|
}
|
|
1399
1399
|
function Gn(t, e, n, s, o, i, l, r, a, c, u, d) {
|
|
1400
|
-
const f = u / 2 * l, g = Math.max(1, $(u * 0.2)) * l, M = (c == null ? void 0 : c.stroke) ?? d,
|
|
1401
|
-
t.save(), t.strokeStyle = M, t.fillStyle =
|
|
1400
|
+
const f = u / 2 * l, g = Math.max(1, $(u * 0.2)) * l, M = (c == null ? void 0 : c.stroke) ?? d, S = (c == null ? void 0 : c.fill) ?? "#fff";
|
|
1401
|
+
t.save(), t.strokeStyle = M, t.fillStyle = S, t.lineWidth = g, (c == null ? void 0 : c.dash) != null && t.setLineDash(c.dash.map((P) => P * l));
|
|
1402
1402
|
for (let P = r; P <= a; P++) {
|
|
1403
1403
|
const h = n[P];
|
|
1404
1404
|
if (h == null) continue;
|
|
@@ -1422,15 +1422,15 @@ function Vn(t, e, n, s, o, i, l, r, a) {
|
|
|
1422
1422
|
const c = (g) => H(g, s, i.width, i.left) * l, u = (g) => H(g, o, i.height, i.top) * l, d = new Path2D();
|
|
1423
1423
|
let f = !1;
|
|
1424
1424
|
for (let g = r; g <= a; g++) {
|
|
1425
|
-
const M = e[g],
|
|
1426
|
-
if (M == null ||
|
|
1427
|
-
const P = c(
|
|
1425
|
+
const M = e[g], S = t[g];
|
|
1426
|
+
if (M == null || S == null) continue;
|
|
1427
|
+
const P = c(S), h = u(M);
|
|
1428
1428
|
f ? d.lineTo(P, h) : (d.moveTo(P, h), f = !0);
|
|
1429
1429
|
}
|
|
1430
1430
|
if (!f) return null;
|
|
1431
1431
|
for (let g = a; g >= r; g--) {
|
|
1432
|
-
const M = n[g],
|
|
1433
|
-
M == null ||
|
|
1432
|
+
const M = n[g], S = t[g];
|
|
1433
|
+
M == null || S == null || d.lineTo(c(S), u(M));
|
|
1434
1434
|
}
|
|
1435
1435
|
return d.closePath(), d;
|
|
1436
1436
|
}
|
|
@@ -1449,9 +1449,9 @@ function $t(t, e, n, s) {
|
|
|
1449
1449
|
function Bn() {
|
|
1450
1450
|
const t = {
|
|
1451
1451
|
scaleManager: new Ue(),
|
|
1452
|
-
dataStore: new
|
|
1452
|
+
dataStore: new je(),
|
|
1453
1453
|
renderer: new sn(),
|
|
1454
|
-
cursorManager: new
|
|
1454
|
+
cursorManager: new qe(),
|
|
1455
1455
|
selectState: { show: !1, left: 0, top: 0, width: 0, height: 0 },
|
|
1456
1456
|
scaleConfigs: [],
|
|
1457
1457
|
seriesConfigs: [],
|
|
@@ -1464,7 +1464,7 @@ function Bn() {
|
|
|
1464
1464
|
plotBox: { left: 0, top: 0, width: 0, height: 0 },
|
|
1465
1465
|
canvas: null,
|
|
1466
1466
|
listeners: /* @__PURE__ */ new Set(),
|
|
1467
|
-
scheduler: new
|
|
1467
|
+
scheduler: new Oe(),
|
|
1468
1468
|
drawHooks: /* @__PURE__ */ new Set(),
|
|
1469
1469
|
cursorDrawHooks: /* @__PURE__ */ new Set(),
|
|
1470
1470
|
focusedSeries: null,
|
|
@@ -1518,7 +1518,7 @@ function Bn() {
|
|
|
1518
1518
|
s.setContext(u, r);
|
|
1519
1519
|
const f = (c.dirty & ~(tt.Cursor | tt.Select)) === 0, g = (h) => e.getScale(h);
|
|
1520
1520
|
if (f && s.restoreSnapshot(u)) {
|
|
1521
|
-
if (
|
|
1521
|
+
if (ae(
|
|
1522
1522
|
u,
|
|
1523
1523
|
t.cursorManager.state,
|
|
1524
1524
|
t.plotBox,
|
|
@@ -1527,7 +1527,7 @@ function Bn() {
|
|
|
1527
1527
|
o,
|
|
1528
1528
|
g,
|
|
1529
1529
|
(h) => e.getGroupXScaleKey(h)
|
|
1530
|
-
),
|
|
1530
|
+
), ce(u, t.selectState, t.plotBox, r), t.cursorDrawHooks.size > 0) {
|
|
1531
1531
|
u.save(), u.scale(r, r);
|
|
1532
1532
|
const h = $t(u, t.plotBox, r, g);
|
|
1533
1533
|
for (const C of t.cursorDrawHooks)
|
|
@@ -1555,11 +1555,11 @@ function Bn() {
|
|
|
1555
1555
|
top: 10,
|
|
1556
1556
|
width: i - 20,
|
|
1557
1557
|
height: l - 20
|
|
1558
|
-
}, u.clearRect(0, 0, i * r, l * r), t.axisStates.length > 0 &&
|
|
1559
|
-
const
|
|
1558
|
+
}, u.clearRect(0, 0, i * r, l * r), t.axisStates.length > 0 && zn(u, t.axisStates, g, t.plotBox, r);
|
|
1559
|
+
const S = [];
|
|
1560
1560
|
for (const h of o) {
|
|
1561
1561
|
const C = e.getGroupXScaleKey(h.group), I = C != null ? e.getScale(C) : void 0, L = e.getScale(h.yScale);
|
|
1562
|
-
I == null || L == null ||
|
|
1562
|
+
I == null || L == null || S.push({
|
|
1563
1563
|
config: h,
|
|
1564
1564
|
dataX: n.getXValues(h.group),
|
|
1565
1565
|
dataY: n.getYValues(h.group, h.index),
|
|
@@ -1569,8 +1569,8 @@ function Bn() {
|
|
|
1569
1569
|
});
|
|
1570
1570
|
}
|
|
1571
1571
|
u.save(), u.scale(r, r), u.beginPath(), u.rect(t.plotBox.left, t.plotBox.top, t.plotBox.width, t.plotBox.height), u.clip();
|
|
1572
|
-
for (let h = 0; h <
|
|
1573
|
-
const C =
|
|
1572
|
+
for (let h = 0; h < S.length; h++) {
|
|
1573
|
+
const C = S[h];
|
|
1574
1574
|
C != null && (t.focusedSeries != null && h !== t.focusedSeries ? (u.globalAlpha = t.focusAlpha, s.drawSeries(C, t.plotBox, 1), u.globalAlpha = 1) : s.drawSeries(C, t.plotBox, 1));
|
|
1575
1575
|
}
|
|
1576
1576
|
const P = /* @__PURE__ */ new Map();
|
|
@@ -1581,25 +1581,25 @@ function Bn() {
|
|
|
1581
1581
|
if (I == null || L == null || T == null) continue;
|
|
1582
1582
|
const x = e.getScale(L.yScale);
|
|
1583
1583
|
if (x == null) continue;
|
|
1584
|
-
const [m,
|
|
1585
|
-
let p = s.getCachedBandPath(h.group, y,
|
|
1584
|
+
const [m, b] = n.getWindow(h.group), y = h.series[0], D = h.series[1];
|
|
1585
|
+
let p = s.getCachedBandPath(h.group, y, D, m, b);
|
|
1586
1586
|
p == null && (p = Vn(
|
|
1587
1587
|
n.getXValues(h.group),
|
|
1588
1588
|
n.getYValues(h.group, y),
|
|
1589
|
-
n.getYValues(h.group,
|
|
1589
|
+
n.getYValues(h.group, D),
|
|
1590
1590
|
I,
|
|
1591
1591
|
x,
|
|
1592
1592
|
t.plotBox,
|
|
1593
1593
|
r,
|
|
1594
1594
|
m,
|
|
1595
|
-
|
|
1596
|
-
) ?? void 0, p != null && s.setCachedBandPath(h.group, y,
|
|
1595
|
+
b
|
|
1596
|
+
) ?? void 0, p != null && s.setCachedBandPath(h.group, y, D, m, b, p)), p != null && $n(u, h, p);
|
|
1597
1597
|
}
|
|
1598
|
-
for (const h of
|
|
1598
|
+
for (const h of S) {
|
|
1599
1599
|
const C = h.config;
|
|
1600
1600
|
if (C.show === !1) continue;
|
|
1601
|
-
const I = C.points, L = C.width ?? 1, T = (I == null ? void 0 : I.size) ?? 3 + L * 2, x = (I == null ? void 0 : I.space) ?? T * 2, [m,
|
|
1602
|
-
Hn(I == null ? void 0 : I.show, C.group, C.index, m,
|
|
1601
|
+
const I = C.points, L = C.width ?? 1, T = (I == null ? void 0 : I.size) ?? 3 + L * 2, x = (I == null ? void 0 : I.space) ?? T * 2, [m, b] = h.window;
|
|
1602
|
+
Hn(I == null ? void 0 : I.show, C.group, C.index, m, b, t.plotBox.width, x) && Gn(
|
|
1603
1603
|
u,
|
|
1604
1604
|
h.dataX,
|
|
1605
1605
|
h.dataY,
|
|
@@ -1608,7 +1608,7 @@ function Bn() {
|
|
|
1608
1608
|
t.plotBox,
|
|
1609
1609
|
r,
|
|
1610
1610
|
m,
|
|
1611
|
-
|
|
1611
|
+
b,
|
|
1612
1612
|
I,
|
|
1613
1613
|
T,
|
|
1614
1614
|
(typeof C.stroke == "string" ? C.stroke : null) ?? "#000"
|
|
@@ -1639,7 +1639,7 @@ function Bn() {
|
|
|
1639
1639
|
g,
|
|
1640
1640
|
(h) => n.getWindow(h),
|
|
1641
1641
|
(h) => e.getGroupXScaleKey(h)
|
|
1642
|
-
)),
|
|
1642
|
+
)), ae(
|
|
1643
1643
|
u,
|
|
1644
1644
|
t.cursorManager.state,
|
|
1645
1645
|
t.plotBox,
|
|
@@ -1648,7 +1648,7 @@ function Bn() {
|
|
|
1648
1648
|
o,
|
|
1649
1649
|
g,
|
|
1650
1650
|
(h) => e.getGroupXScaleKey(h)
|
|
1651
|
-
),
|
|
1651
|
+
), ce(u, t.selectState, t.plotBox, r), t.cursorDrawHooks.size > 0) {
|
|
1652
1652
|
u.save(), u.scale(r, r);
|
|
1653
1653
|
const h = $t(u, t.plotBox, r, g);
|
|
1654
1654
|
for (const C of t.cursorDrawHooks)
|
|
@@ -1691,9 +1691,9 @@ function En() {
|
|
|
1691
1691
|
const t = X(null);
|
|
1692
1692
|
return t.current === null && (t.current = Bn()), t.current;
|
|
1693
1693
|
}
|
|
1694
|
-
const
|
|
1694
|
+
const ke = De(null);
|
|
1695
1695
|
function ot() {
|
|
1696
|
-
const t = Le(
|
|
1696
|
+
const t = Le(ke);
|
|
1697
1697
|
if (!t)
|
|
1698
1698
|
throw new Error("useChart must be used within a <Chart> component");
|
|
1699
1699
|
return t;
|
|
@@ -1709,57 +1709,57 @@ function Yn(t, e) {
|
|
|
1709
1709
|
const s = { show: !1, left: 0, top: 0, width: 0, height: 0 };
|
|
1710
1710
|
let o = null, i = null, l = !1;
|
|
1711
1711
|
function r(p) {
|
|
1712
|
-
const w = e.getBoundingClientRect(), v = t.plotBox, k = p.clientX - w.left - v.left,
|
|
1713
|
-
return { cx: k, cy:
|
|
1712
|
+
const w = e.getBoundingClientRect(), v = t.plotBox, k = p.clientX - w.left - v.left, z = p.clientY - w.top - v.top;
|
|
1713
|
+
return { cx: k, cy: z };
|
|
1714
1714
|
}
|
|
1715
1715
|
function a(p, w) {
|
|
1716
1716
|
const v = t.plotBox;
|
|
1717
1717
|
return p >= 0 && p <= v.width && w >= 0 && w <= v.height;
|
|
1718
1718
|
}
|
|
1719
1719
|
function c(p, w) {
|
|
1720
|
-
const v = e.getBoundingClientRect(), k = p - v.left,
|
|
1720
|
+
const v = e.getBoundingClientRect(), k = p - v.left, z = w - v.top, A = t.plotBox;
|
|
1721
1721
|
for (const F of t.axisStates) {
|
|
1722
|
-
const
|
|
1722
|
+
const _ = F.config, R = _.side;
|
|
1723
1723
|
if (F._size <= 0) continue;
|
|
1724
|
-
const B =
|
|
1725
|
-
if (
|
|
1726
|
-
const Z = xt(
|
|
1727
|
-
return { scaleId:
|
|
1724
|
+
const B = z >= A.top && z <= A.top + A.height, W = k >= A.left && k <= A.left + A.width;
|
|
1725
|
+
if (R === U.Left && k < A.left && B || R === U.Right && k > A.left + A.width && B || R === U.Top && z < A.top && W || R === U.Bottom && z > A.top + A.height && W) {
|
|
1726
|
+
const Z = xt(R);
|
|
1727
|
+
return { scaleId: _.scale, ori: Z };
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
1730
1730
|
return null;
|
|
1731
1731
|
}
|
|
1732
1732
|
function u(p, w, v) {
|
|
1733
1733
|
const k = t.cursorManager.state;
|
|
1734
|
-
let
|
|
1734
|
+
let z = null;
|
|
1735
1735
|
if (k.activeGroup >= 0 && k.activeDataIdx >= 0) {
|
|
1736
1736
|
const A = t.dataStore.data[k.activeGroup];
|
|
1737
1737
|
if (A != null) {
|
|
1738
|
-
const F = A.x[k.activeDataIdx],
|
|
1739
|
-
if (F != null &&
|
|
1738
|
+
const F = A.x[k.activeDataIdx], _ = A.series[k.activeSeriesIdx], R = _ != null ? _[k.activeDataIdx] : void 0;
|
|
1739
|
+
if (F != null && R != null) {
|
|
1740
1740
|
const V = t.plotBox, B = t.scaleManager.getGroupXScaleKey(k.activeGroup), W = B != null ? t.scaleManager.getScale(B) : void 0, j = t.seriesConfigs.find(
|
|
1741
1741
|
(jt) => jt.group === k.activeGroup && jt.index === k.activeSeriesIdx
|
|
1742
1742
|
), Z = j != null ? t.scaleManager.getScale(j.yScale) : void 0;
|
|
1743
1743
|
let pt = w, Gt = v;
|
|
1744
|
-
(W == null ? void 0 : W.min) != null && W.max != null && (pt = H(F, W, V.width, V.left) - V.left), (Z == null ? void 0 : Z.min) != null && Z.max != null && (Gt = H(
|
|
1745
|
-
const
|
|
1746
|
-
|
|
1744
|
+
(W == null ? void 0 : W.min) != null && W.max != null && (pt = H(F, W, V.width, V.left) - V.left), (Z == null ? void 0 : Z.min) != null && Z.max != null && (Gt = H(R, Z, V.height, V.top) - V.top);
|
|
1745
|
+
const Kt = w - pt, Nt = v - Gt;
|
|
1746
|
+
z = {
|
|
1747
1747
|
group: k.activeGroup,
|
|
1748
1748
|
seriesIdx: k.activeSeriesIdx,
|
|
1749
1749
|
dataIdx: k.activeDataIdx,
|
|
1750
1750
|
xVal: F,
|
|
1751
|
-
yVal:
|
|
1751
|
+
yVal: R,
|
|
1752
1752
|
pxX: pt,
|
|
1753
1753
|
pxY: Gt,
|
|
1754
|
-
dist: Math.sqrt(
|
|
1754
|
+
dist: Math.sqrt(Kt * Kt + Nt * Nt)
|
|
1755
1755
|
};
|
|
1756
1756
|
}
|
|
1757
1757
|
}
|
|
1758
1758
|
}
|
|
1759
|
-
return { plotX: w, plotY: v, point:
|
|
1759
|
+
return { plotX: w, plotY: v, point: z, srcEvent: p };
|
|
1760
1760
|
}
|
|
1761
1761
|
function d(p) {
|
|
1762
|
-
const w = t.plotBox, v = p.left / w.width, k = (p.left + p.width) / w.width,
|
|
1762
|
+
const w = t.plotBox, v = p.left / w.width, k = (p.left + p.width) / w.width, z = {};
|
|
1763
1763
|
for (const A of t.scaleManager.getAllScales()) {
|
|
1764
1764
|
if (A.ori !== G.Horizontal || A.min == null || A.max == null) continue;
|
|
1765
1765
|
const F = it(
|
|
@@ -1767,18 +1767,18 @@ function Yn(t, e) {
|
|
|
1767
1767
|
A,
|
|
1768
1768
|
w.width,
|
|
1769
1769
|
w.left
|
|
1770
|
-
),
|
|
1770
|
+
), _ = it(
|
|
1771
1771
|
w.left + k * w.width,
|
|
1772
1772
|
A,
|
|
1773
1773
|
w.width,
|
|
1774
1774
|
w.left
|
|
1775
1775
|
);
|
|
1776
|
-
|
|
1777
|
-
min: Math.min(F,
|
|
1778
|
-
max: Math.max(F,
|
|
1776
|
+
z[A.id] = {
|
|
1777
|
+
min: Math.min(F, _),
|
|
1778
|
+
max: Math.max(F, _)
|
|
1779
1779
|
};
|
|
1780
1780
|
}
|
|
1781
|
-
return { left: v, right: k, ranges:
|
|
1781
|
+
return { left: v, right: k, ranges: z };
|
|
1782
1782
|
}
|
|
1783
1783
|
function f() {
|
|
1784
1784
|
const p = t.eventCallbacks.onScaleChange;
|
|
@@ -1791,20 +1791,20 @@ function Yn(t, e) {
|
|
|
1791
1791
|
}
|
|
1792
1792
|
function g(p, w) {
|
|
1793
1793
|
if (i != null) {
|
|
1794
|
-
const A = e.getBoundingClientRect(), F = p.clientY - A.top,
|
|
1795
|
-
B != null && (B.min = i.startMin +
|
|
1794
|
+
const A = e.getBoundingClientRect(), F = p.clientY - A.top, _ = t.plotBox, R = (F - i.startY) / _.height, V = i.startMax - i.startMin, B = t.scaleManager.getScale(i.scaleId);
|
|
1795
|
+
B != null && (B.min = i.startMin + R * V, B.max = i.startMax + R * V, B.auto = !1, at(B), t.renderer.clearCache(), t.scheduleRedraw());
|
|
1796
1796
|
return;
|
|
1797
1797
|
}
|
|
1798
1798
|
const v = r(p);
|
|
1799
1799
|
if (v == null) return;
|
|
1800
|
-
const { cx: k, cy:
|
|
1801
|
-
if (!a(k,
|
|
1800
|
+
const { cx: k, cy: z } = v;
|
|
1801
|
+
if (!a(k, z) && n == null) {
|
|
1802
1802
|
t.cursorManager.hide(), t.focusedSeries != null && t.setFocus(null), t.scheduleCursorRedraw();
|
|
1803
1803
|
return;
|
|
1804
1804
|
}
|
|
1805
1805
|
if (t.cursorManager.update(
|
|
1806
1806
|
k,
|
|
1807
|
-
|
|
1807
|
+
z,
|
|
1808
1808
|
t.plotBox,
|
|
1809
1809
|
t.dataStore.data,
|
|
1810
1810
|
t.seriesConfigs,
|
|
@@ -1815,36 +1815,36 @@ function Yn(t, e) {
|
|
|
1815
1815
|
const A = t.cursorManager.state;
|
|
1816
1816
|
if (A.activeGroup >= 0 && A.activeSeriesIdx >= 0) {
|
|
1817
1817
|
const F = t.seriesConfigs.findIndex(
|
|
1818
|
-
(
|
|
1818
|
+
(_) => _.group === A.activeGroup && _.index === A.activeSeriesIdx
|
|
1819
1819
|
);
|
|
1820
1820
|
F >= 0 && t.focusedSeries !== F && (t.focusedSeries = F, t.scheduleRedraw());
|
|
1821
1821
|
}
|
|
1822
1822
|
}
|
|
1823
|
-
if (w != null && t.eventCallbacks.onCursorMove != null && a(k,
|
|
1823
|
+
if (w != null && t.eventCallbacks.onCursorMove != null && a(k, z))
|
|
1824
1824
|
try {
|
|
1825
|
-
t.eventCallbacks.onCursorMove(u(w, k,
|
|
1825
|
+
t.eventCallbacks.onCursorMove(u(w, k, z));
|
|
1826
1826
|
} catch (A) {
|
|
1827
1827
|
console.warn("[uPlot+] event callback error:", A);
|
|
1828
1828
|
}
|
|
1829
1829
|
if (n != null) {
|
|
1830
|
-
const A = n.x, F = t.plotBox,
|
|
1831
|
-
s.show = !0, s.left = Math.min(A,
|
|
1830
|
+
const A = n.x, F = t.plotBox, _ = Math.max(0, Math.min(k, F.width));
|
|
1831
|
+
s.show = !0, s.left = Math.min(A, _), s.top = 0, s.width = Math.abs(_ - A), s.height = F.height, t.selectState = s;
|
|
1832
1832
|
}
|
|
1833
1833
|
n != null ? t.scheduler.mark(tt.Cursor | tt.Select) : t.scheduleCursorRedraw();
|
|
1834
1834
|
}
|
|
1835
1835
|
function M(p) {
|
|
1836
1836
|
g(p, p);
|
|
1837
1837
|
}
|
|
1838
|
-
function
|
|
1838
|
+
function S(p) {
|
|
1839
1839
|
if (p.button !== 0) return;
|
|
1840
1840
|
const w = c(p.clientX, p.clientY);
|
|
1841
1841
|
if (w != null && w.ori === G.Vertical) {
|
|
1842
1842
|
const k = t.scaleManager.getScale(w.scaleId);
|
|
1843
1843
|
if (k != null && k.min != null && k.max != null) {
|
|
1844
|
-
const
|
|
1844
|
+
const z = e.getBoundingClientRect();
|
|
1845
1845
|
i = {
|
|
1846
1846
|
scaleId: w.scaleId,
|
|
1847
|
-
startY: p.clientY -
|
|
1847
|
+
startY: p.clientY - z.top,
|
|
1848
1848
|
startMin: k.min,
|
|
1849
1849
|
startMax: k.max
|
|
1850
1850
|
}, p.preventDefault();
|
|
@@ -1868,8 +1868,8 @@ function Yn(t, e) {
|
|
|
1868
1868
|
let k;
|
|
1869
1869
|
try {
|
|
1870
1870
|
k = t.eventCallbacks.onSelect(v);
|
|
1871
|
-
} catch (
|
|
1872
|
-
console.warn("[uPlot+] event callback error:",
|
|
1871
|
+
} catch (z) {
|
|
1872
|
+
console.warn("[uPlot+] event callback error:", z);
|
|
1873
1873
|
}
|
|
1874
1874
|
k === !1 && (w = !1);
|
|
1875
1875
|
}
|
|
@@ -1942,39 +1942,39 @@ function Yn(t, e) {
|
|
|
1942
1942
|
if (w == null || !a(w.cx, w.cy)) return;
|
|
1943
1943
|
p.preventDefault();
|
|
1944
1944
|
const v = Math.max(0.1, Math.min(10, 1 - p.deltaY * 1e-3)), k = t.plotBox;
|
|
1945
|
-
for (const
|
|
1946
|
-
if (
|
|
1947
|
-
const A = it(w.cx + k.left,
|
|
1948
|
-
|
|
1945
|
+
for (const z of t.scaleManager.getAllScales()) {
|
|
1946
|
+
if (z.ori !== G.Horizontal || z.min == null || z.max == null) continue;
|
|
1947
|
+
const A = it(w.cx + k.left, z, k.width, k.left), F = A - (A - z.min) * v, _ = A + (z.max - A) * v;
|
|
1948
|
+
z.min = Math.min(F, _), z.max = Math.max(F, _), z.auto = !1, at(z);
|
|
1949
1949
|
}
|
|
1950
1950
|
t.renderer.clearCache(), t.scheduleRedraw(), f();
|
|
1951
1951
|
}
|
|
1952
1952
|
function m(p) {
|
|
1953
1953
|
const w = t.plotBox, v = p.left / w.width, k = (p.left + p.width) / w.width;
|
|
1954
|
-
for (const
|
|
1955
|
-
if (
|
|
1954
|
+
for (const z of t.scaleManager.getAllScales()) {
|
|
1955
|
+
if (z.ori !== G.Horizontal || z.min == null || z.max == null) continue;
|
|
1956
1956
|
const A = it(
|
|
1957
1957
|
w.left + v * w.width,
|
|
1958
|
-
|
|
1958
|
+
z,
|
|
1959
1959
|
w.width,
|
|
1960
1960
|
w.left
|
|
1961
1961
|
), F = it(
|
|
1962
1962
|
w.left + k * w.width,
|
|
1963
|
-
|
|
1963
|
+
z,
|
|
1964
1964
|
w.width,
|
|
1965
1965
|
w.left
|
|
1966
1966
|
);
|
|
1967
|
-
|
|
1967
|
+
z.min = Math.min(A, F), z.max = Math.max(A, F), z.auto = !1, at(z);
|
|
1968
1968
|
}
|
|
1969
1969
|
t.renderer.clearCache();
|
|
1970
1970
|
}
|
|
1971
|
-
function
|
|
1971
|
+
function b(p) {
|
|
1972
1972
|
if (p.touches.length === 2) {
|
|
1973
|
-
const k = p.touches[0],
|
|
1973
|
+
const k = p.touches[0], z = p.touches[1], A = z.clientX - k.clientX, F = z.clientY - k.clientY;
|
|
1974
1974
|
o = {
|
|
1975
1975
|
dist: Math.sqrt(A * A + F * F),
|
|
1976
|
-
midX: (k.clientX +
|
|
1977
|
-
midY: (k.clientY +
|
|
1976
|
+
midX: (k.clientX + z.clientX) / 2,
|
|
1977
|
+
midY: (k.clientY + z.clientY) / 2
|
|
1978
1978
|
}, n = null;
|
|
1979
1979
|
return;
|
|
1980
1980
|
}
|
|
@@ -1986,10 +1986,10 @@ function Yn(t, e) {
|
|
|
1986
1986
|
function y(p) {
|
|
1987
1987
|
if (p.touches.length === 2 && o != null) {
|
|
1988
1988
|
p.preventDefault();
|
|
1989
|
-
const v = p.touches[0], k = p.touches[1],
|
|
1989
|
+
const v = p.touches[0], k = p.touches[1], z = k.clientX - v.clientX, A = k.clientY - v.clientY, F = Math.sqrt(z * z + A * A), _ = F / o.dist, R = e.getBoundingClientRect(), V = t.plotBox, B = o.midX - R.left - V.left;
|
|
1990
1990
|
for (const W of t.scaleManager.getAllScales()) {
|
|
1991
1991
|
if (W.ori !== G.Horizontal || W.min == null || W.max == null) continue;
|
|
1992
|
-
const j = it(B + V.left, W, V.width, V.left), Z = j - (j - W.min) /
|
|
1992
|
+
const j = it(B + V.left, W, V.width, V.left), Z = j - (j - W.min) / _, pt = j + (W.max - j) / _;
|
|
1993
1993
|
W.min = Math.min(Z, pt), W.max = Math.max(Z, pt), W.auto = !1, at(W);
|
|
1994
1994
|
}
|
|
1995
1995
|
o.dist = F, t.renderer.clearCache(), t.scheduleRedraw(), f();
|
|
@@ -1998,15 +1998,15 @@ function Yn(t, e) {
|
|
|
1998
1998
|
const w = p.touches[0];
|
|
1999
1999
|
w != null && (g(w, p), n != null && p.preventDefault());
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2001
|
+
function D(p) {
|
|
2002
2002
|
if (o != null) {
|
|
2003
2003
|
o = null;
|
|
2004
2004
|
return;
|
|
2005
2005
|
}
|
|
2006
2006
|
p.changedTouches[0] != null && P();
|
|
2007
2007
|
}
|
|
2008
|
-
return e.addEventListener("mousemove", M), e.addEventListener("mousedown",
|
|
2009
|
-
e.removeEventListener("mousemove", M), e.removeEventListener("mousedown",
|
|
2008
|
+
return e.addEventListener("mousemove", M), e.addEventListener("mousedown", S), e.addEventListener("mouseup", h), e.addEventListener("click", C), e.addEventListener("contextmenu", I), e.addEventListener("mouseleave", L), e.addEventListener("dblclick", T), e.addEventListener("wheel", x, { passive: !1 }), e.addEventListener("touchstart", b, { passive: !0 }), e.addEventListener("touchmove", y, { passive: !1 }), e.addEventListener("touchend", D), () => {
|
|
2009
|
+
e.removeEventListener("mousemove", M), e.removeEventListener("mousedown", S), e.removeEventListener("mouseup", h), e.removeEventListener("click", C), e.removeEventListener("contextmenu", I), e.removeEventListener("mouseleave", L), e.removeEventListener("dblclick", T), e.removeEventListener("wheel", x), e.removeEventListener("touchstart", b), e.removeEventListener("touchmove", y), e.removeEventListener("touchend", D);
|
|
2010
2010
|
};
|
|
2011
2011
|
}
|
|
2012
2012
|
const Bt = /* @__PURE__ */ new Map();
|
|
@@ -2069,7 +2069,7 @@ function Nn(t, e) {
|
|
|
2069
2069
|
};
|
|
2070
2070
|
}, [t, e]);
|
|
2071
2071
|
}
|
|
2072
|
-
function
|
|
2072
|
+
function Ce({
|
|
2073
2073
|
width: t,
|
|
2074
2074
|
height: e,
|
|
2075
2075
|
data: n,
|
|
@@ -2085,17 +2085,17 @@ function Ut({
|
|
|
2085
2085
|
onDblClick: f,
|
|
2086
2086
|
onCursorMove: g,
|
|
2087
2087
|
onCursorLeave: M,
|
|
2088
|
-
onScaleChange:
|
|
2088
|
+
onScaleChange: S,
|
|
2089
2089
|
onSelect: P
|
|
2090
2090
|
}) {
|
|
2091
2091
|
var w;
|
|
2092
|
-
const h = En(), [C, I] =
|
|
2092
|
+
const h = En(), [C, I] = St(null), L = i ?? (typeof window < "u" && window.devicePixelRatio || 1), T = (c == null ? void 0 : c.wheelZoom) ?? !1, x = ((w = c == null ? void 0 : c.focus) == null ? void 0 : w.alpha) ?? ((c == null ? void 0 : c.focus) != null ? 0.15 : 1);
|
|
2093
2093
|
Y(() => {
|
|
2094
2094
|
h.wheelZoom = T, h.focusAlpha = x;
|
|
2095
|
-
}, [h, T, x]), h.eventCallbacks.onClick = u, h.eventCallbacks.onContextMenu = d, h.eventCallbacks.onDblClick = f, h.eventCallbacks.onCursorMove = g, h.eventCallbacks.onCursorLeave = M, h.eventCallbacks.onScaleChange =
|
|
2096
|
-
const m =
|
|
2095
|
+
}, [h, T, x]), h.eventCallbacks.onClick = u, h.eventCallbacks.onContextMenu = d, h.eventCallbacks.onDblClick = f, h.eventCallbacks.onCursorMove = g, h.eventCallbacks.onCursorLeave = M, h.eventCallbacks.onScaleChange = S, h.eventCallbacks.onSelect = P, Xn(h, C), Nn(h, a);
|
|
2096
|
+
const m = q((v) => {
|
|
2097
2097
|
h.canvas = v, v && h.scheduleRedraw();
|
|
2098
|
-
}, [h]),
|
|
2098
|
+
}, [h]), b = q((v) => {
|
|
2099
2099
|
I(v);
|
|
2100
2100
|
}, []);
|
|
2101
2101
|
Y(() => {
|
|
@@ -2105,9 +2105,9 @@ function Ut({
|
|
|
2105
2105
|
}, [h]), Y(() => {
|
|
2106
2106
|
if (C == null || typeof ResizeObserver > "u") return;
|
|
2107
2107
|
const v = new ResizeObserver((k) => {
|
|
2108
|
-
const
|
|
2109
|
-
if (
|
|
2110
|
-
const { width: A, height: F } =
|
|
2108
|
+
const z = k[0];
|
|
2109
|
+
if (z == null) return;
|
|
2110
|
+
const { width: A, height: F } = z.contentRect;
|
|
2111
2111
|
A > 0 && F > 0 && (A !== h.width || F !== h.height) && h.setSize(Math.round(A), Math.round(F));
|
|
2112
2112
|
});
|
|
2113
2113
|
return v.observe(C), () => {
|
|
@@ -2127,11 +2127,11 @@ function Ut({
|
|
|
2127
2127
|
h.scaleManager.setGroupXScale(k, v);
|
|
2128
2128
|
h.scheduleRedraw();
|
|
2129
2129
|
}, [h, n]);
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2130
|
+
const D = X(l);
|
|
2131
|
+
D.current = l, Y(() => {
|
|
2132
2132
|
const v = (k) => {
|
|
2133
|
-
var
|
|
2134
|
-
(
|
|
2133
|
+
var z;
|
|
2134
|
+
(z = D.current) == null || z.call(D, k);
|
|
2135
2135
|
};
|
|
2136
2136
|
return h.drawHooks.add(v), () => {
|
|
2137
2137
|
h.drawHooks.delete(v);
|
|
@@ -2139,14 +2139,14 @@ function Ut({
|
|
|
2139
2139
|
}, [h]);
|
|
2140
2140
|
const p = X(r);
|
|
2141
2141
|
return p.current = r, Y(() => {
|
|
2142
|
-
const v = (k,
|
|
2142
|
+
const v = (k, z) => {
|
|
2143
2143
|
var A;
|
|
2144
|
-
(A = p.current) == null || A.call(p, k,
|
|
2144
|
+
(A = p.current) == null || A.call(p, k, z);
|
|
2145
2145
|
};
|
|
2146
2146
|
return h.cursorDrawHooks.add(v), () => {
|
|
2147
2147
|
h.cursorDrawHooks.delete(v);
|
|
2148
2148
|
};
|
|
2149
|
-
}, [h]), /* @__PURE__ */ E(
|
|
2149
|
+
}, [h]), /* @__PURE__ */ E(ke.Provider, { value: h, children: /* @__PURE__ */ Q(
|
|
2150
2150
|
"div",
|
|
2151
2151
|
{
|
|
2152
2152
|
className: o,
|
|
@@ -2160,7 +2160,7 @@ function Ut({
|
|
|
2160
2160
|
/* @__PURE__ */ E(
|
|
2161
2161
|
"div",
|
|
2162
2162
|
{
|
|
2163
|
-
ref:
|
|
2163
|
+
ref: b,
|
|
2164
2164
|
style: {
|
|
2165
2165
|
position: "relative",
|
|
2166
2166
|
width: `${t}px`,
|
|
@@ -2186,25 +2186,25 @@ function Ut({
|
|
|
2186
2186
|
}
|
|
2187
2187
|
) });
|
|
2188
2188
|
}
|
|
2189
|
-
function
|
|
2189
|
+
function ue(t) {
|
|
2190
2190
|
return t != null && typeof t == "object" && !Array.isArray(t);
|
|
2191
2191
|
}
|
|
2192
|
-
function
|
|
2192
|
+
function jn(t, e) {
|
|
2193
2193
|
const n = Object.keys(t), s = Object.keys(e);
|
|
2194
2194
|
if (n.length !== s.length) return !1;
|
|
2195
2195
|
for (const o of s)
|
|
2196
2196
|
if (t[o] !== e[o]) return !1;
|
|
2197
2197
|
return !0;
|
|
2198
2198
|
}
|
|
2199
|
-
function
|
|
2199
|
+
function Ut(t, e) {
|
|
2200
2200
|
if (t === null) return !1;
|
|
2201
2201
|
const n = t, s = e, o = Object.keys(n), i = Object.keys(s);
|
|
2202
2202
|
if (o.length !== i.length) return !1;
|
|
2203
2203
|
for (const l of i) {
|
|
2204
2204
|
const r = n[l], a = s[l];
|
|
2205
2205
|
if (r !== a)
|
|
2206
|
-
if (
|
|
2207
|
-
if (!
|
|
2206
|
+
if (ue(r) && ue(a)) {
|
|
2207
|
+
if (!jn(r, a)) return !1;
|
|
2208
2208
|
} else
|
|
2209
2209
|
return !1;
|
|
2210
2210
|
}
|
|
@@ -2220,9 +2220,9 @@ function Lt(t) {
|
|
|
2220
2220
|
}, [e, t.id]);
|
|
2221
2221
|
const s = X(null);
|
|
2222
2222
|
return Y(() => {
|
|
2223
|
-
|
|
2223
|
+
Ut(s.current, t) || (s.current = t, e.scaleConfigs = e.scaleConfigs.map(
|
|
2224
2224
|
(o) => o.id === t.id ? { ...t } : o
|
|
2225
|
-
), e.scaleManager.addScale({ ...t }), e.scheduleRedraw());
|
|
2225
|
+
), e.scaleManager.addScale({ ...t }), e.renderer.clearCache(), e.scheduleRedraw());
|
|
2226
2226
|
}), null;
|
|
2227
2227
|
}
|
|
2228
2228
|
function Te(t) {
|
|
@@ -2235,16 +2235,16 @@ function Te(t) {
|
|
|
2235
2235
|
}, [e, t.group, t.index]);
|
|
2236
2236
|
const s = X(null);
|
|
2237
2237
|
return Y(() => {
|
|
2238
|
-
|
|
2238
|
+
Ut(s.current, t) || (s.current = t, e.seriesConfigs = e.seriesConfigs.map(
|
|
2239
2239
|
(o) => o.group === t.group && o.index === t.index ? { ...t, show: t.show ?? !0 } : o
|
|
2240
2240
|
), e.renderer.invalidateSeries(t.group, t.index), e.scheduleRedraw());
|
|
2241
2241
|
}), null;
|
|
2242
2242
|
}
|
|
2243
|
-
function
|
|
2243
|
+
function qn(t) {
|
|
2244
2244
|
return { ...t, side: t.side ?? (t.scale === "x" ? U.Bottom : U.Left), show: t.show ?? !0 };
|
|
2245
2245
|
}
|
|
2246
|
-
function
|
|
2247
|
-
const e = ot(), n =
|
|
2246
|
+
function Dt(t) {
|
|
2247
|
+
const e = ot(), n = qn(t), s = X(n);
|
|
2248
2248
|
s.current = n, Y(() => {
|
|
2249
2249
|
const i = s.current;
|
|
2250
2250
|
return e.axisConfigs = e.axisConfigs.filter(
|
|
@@ -2257,7 +2257,7 @@ function zt(t) {
|
|
|
2257
2257
|
}, [e, n.scale, n.side]);
|
|
2258
2258
|
const o = X(null);
|
|
2259
2259
|
return Y(() => {
|
|
2260
|
-
|
|
2260
|
+
Ut(o.current, t) || (o.current = t, e.axisConfigs = e.axisConfigs.map(
|
|
2261
2261
|
(i) => i.scale === n.scale && i.side === n.side ? n : i
|
|
2262
2262
|
), e.scheduleRedraw());
|
|
2263
2263
|
}), null;
|
|
@@ -2271,7 +2271,7 @@ function cs({ series: t, group: e, fill: n, dir: s }) {
|
|
|
2271
2271
|
};
|
|
2272
2272
|
}, [o, l, r, e, n, s]), null;
|
|
2273
2273
|
}
|
|
2274
|
-
const
|
|
2274
|
+
const On = {
|
|
2275
2275
|
width: 12,
|
|
2276
2276
|
height: 3,
|
|
2277
2277
|
borderRadius: 1,
|
|
@@ -2284,8 +2284,8 @@ const qn = {
|
|
|
2284
2284
|
cursor: "pointer",
|
|
2285
2285
|
fontSize: 12,
|
|
2286
2286
|
fontFamily: "sans-serif"
|
|
2287
|
-
}, Qn =
|
|
2288
|
-
const a =
|
|
2287
|
+
}, Qn = ze(function({ group: e, index: n, label: s, color: o, isHidden: i, valueStr: l, store: r }) {
|
|
2288
|
+
const a = q(() => {
|
|
2289
2289
|
r.toggleSeries(e, n);
|
|
2290
2290
|
}, [r, e, n]);
|
|
2291
2291
|
return /* @__PURE__ */ Q(
|
|
@@ -2294,7 +2294,7 @@ const qn = {
|
|
|
2294
2294
|
onClick: a,
|
|
2295
2295
|
style: { ...Jn, opacity: i ? 0.4 : 1 },
|
|
2296
2296
|
children: [
|
|
2297
|
-
/* @__PURE__ */ E("span", { style: { ...
|
|
2297
|
+
/* @__PURE__ */ E("span", { style: { ...On, backgroundColor: o } }),
|
|
2298
2298
|
/* @__PURE__ */ E("span", { children: s }),
|
|
2299
2299
|
l && /* @__PURE__ */ E("span", { style: Zn, children: l })
|
|
2300
2300
|
]
|
|
@@ -2302,16 +2302,16 @@ const qn = {
|
|
|
2302
2302
|
);
|
|
2303
2303
|
});
|
|
2304
2304
|
function us({ show: t = !0, position: e = "bottom", className: n }) {
|
|
2305
|
-
const s = ot(), o = X({ activeGroup: -1, activeDataIdx: -1, seriesCount: 0, revision: -1 }), i =
|
|
2305
|
+
const s = ot(), o = X({ activeGroup: -1, activeDataIdx: -1, seriesCount: 0, revision: -1 }), i = q(
|
|
2306
2306
|
(u) => s.subscribe(u),
|
|
2307
2307
|
[s]
|
|
2308
|
-
), l =
|
|
2308
|
+
), l = q(() => {
|
|
2309
2309
|
const { activeGroup: u, activeDataIdx: d } = s.cursorManager.state, f = s.seriesConfigs.length, { revision: g } = s, M = o.current;
|
|
2310
2310
|
if (M.activeGroup === u && M.activeDataIdx === d && M.seriesCount === f && M.revision === g)
|
|
2311
2311
|
return M;
|
|
2312
|
-
const
|
|
2313
|
-
return o.current =
|
|
2314
|
-
}, [s]), r =
|
|
2312
|
+
const S = { activeGroup: u, activeDataIdx: d, seriesCount: f, revision: g };
|
|
2313
|
+
return o.current = S, S;
|
|
2314
|
+
}, [s]), r = fe(i, l);
|
|
2315
2315
|
if (!t) return null;
|
|
2316
2316
|
const { activeGroup: a, activeDataIdx: c } = r;
|
|
2317
2317
|
return /* @__PURE__ */ E(
|
|
@@ -2356,28 +2356,28 @@ function fs({
|
|
|
2356
2356
|
children: n,
|
|
2357
2357
|
offset: s = {}
|
|
2358
2358
|
}) {
|
|
2359
|
-
const o = ot(), i = X({ left: -10, top: -10, activeGroup: -1, activeDataIdx: -1, revision: -1 }), l =
|
|
2359
|
+
const o = ot(), i = X({ left: -10, top: -10, activeGroup: -1, activeDataIdx: -1, revision: -1 }), l = q(
|
|
2360
2360
|
(m) => o.subscribe(m),
|
|
2361
2361
|
[o]
|
|
2362
|
-
), r =
|
|
2363
|
-
const m = o.cursorManager.state, { revision:
|
|
2364
|
-
if (y.left === m.left && y.top === m.top && y.activeGroup === m.activeGroup && y.activeDataIdx === m.activeDataIdx && y.revision ===
|
|
2362
|
+
), r = q(() => {
|
|
2363
|
+
const m = o.cursorManager.state, { revision: b } = o, y = i.current;
|
|
2364
|
+
if (y.left === m.left && y.top === m.top && y.activeGroup === m.activeGroup && y.activeDataIdx === m.activeDataIdx && y.revision === b)
|
|
2365
2365
|
return y;
|
|
2366
|
-
const
|
|
2366
|
+
const D = {
|
|
2367
2367
|
left: m.left,
|
|
2368
2368
|
top: m.top,
|
|
2369
2369
|
activeGroup: m.activeGroup,
|
|
2370
2370
|
activeDataIdx: m.activeDataIdx,
|
|
2371
|
-
revision:
|
|
2371
|
+
revision: b
|
|
2372
2372
|
};
|
|
2373
|
-
return i.current =
|
|
2374
|
-
}, [o]), a =
|
|
2373
|
+
return i.current = D, D;
|
|
2374
|
+
}, [o]), a = fe(l, r);
|
|
2375
2375
|
if (!t || a.activeDataIdx < 0 || a.activeGroup < 0 || a.left < 0) return null;
|
|
2376
|
-
const { activeGroup: c, activeDataIdx: u } = a, d = o.plotBox, f = o.dataStore.data[c], g = f != null ? f.x[u] ?? null : null, M = g != null ? parseFloat(g.toPrecision(6)).toString() : "",
|
|
2376
|
+
const { activeGroup: c, activeDataIdx: u } = a, d = o.plotBox, f = o.dataStore.data[c], g = f != null ? f.x[u] ?? null : null, M = g != null ? parseFloat(g.toPrecision(6)).toString() : "", S = [];
|
|
2377
2377
|
for (const m of o.seriesConfigs) {
|
|
2378
2378
|
if (m.show === !1) continue;
|
|
2379
|
-
const
|
|
2380
|
-
|
|
2379
|
+
const b = o.dataStore.getYValues(m.group, m.index), y = m.group === c ? b[u] : null;
|
|
2380
|
+
S.push({
|
|
2381
2381
|
label: m.label ?? `Series ${m.index}`,
|
|
2382
2382
|
value: y,
|
|
2383
2383
|
color: typeof m.stroke == "string" ? m.stroke : "#000",
|
|
@@ -2388,7 +2388,7 @@ function fs({
|
|
|
2388
2388
|
const P = {
|
|
2389
2389
|
x: g,
|
|
2390
2390
|
xLabel: M,
|
|
2391
|
-
items:
|
|
2391
|
+
items: S,
|
|
2392
2392
|
left: a.left + d.left,
|
|
2393
2393
|
top: a.top + d.top
|
|
2394
2394
|
}, h = s.x ?? 12, C = s.y ?? -12, I = a.left + d.left + h + ts > d.left + d.width, L = a.top + d.top + C < d.top, T = I ? P.left - h : P.left + h, x = L ? P.top + Math.abs(C) : P.top + C;
|
|
@@ -2428,7 +2428,7 @@ function fs({
|
|
|
2428
2428
|
},
|
|
2429
2429
|
children: [
|
|
2430
2430
|
/* @__PURE__ */ E("div", { style: { fontWeight: 600, marginBottom: 2 }, children: M }),
|
|
2431
|
-
|
|
2431
|
+
S.map((m) => /* @__PURE__ */ Q("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
2432
2432
|
/* @__PURE__ */ E("span", { style: { width: 8, height: 8, borderRadius: "50%", backgroundColor: m.color, display: "inline-block" } }),
|
|
2433
2433
|
/* @__PURE__ */ Q("span", { children: [
|
|
2434
2434
|
m.label,
|
|
@@ -2450,15 +2450,15 @@ function hs({
|
|
|
2450
2450
|
colors: l,
|
|
2451
2451
|
grips: r = !1
|
|
2452
2452
|
}) {
|
|
2453
|
-
const a = X(null), [c, u] =
|
|
2453
|
+
const a = X(null), [c, u] = St(() => {
|
|
2454
2454
|
if (o != null && n.length > 0) {
|
|
2455
2455
|
const T = n[0];
|
|
2456
2456
|
if (T != null && T.x.length > 1) {
|
|
2457
|
-
const x = T.x[0],
|
|
2458
|
-
if (
|
|
2457
|
+
const x = T.x[0], b = T.x[T.x.length - 1] - x;
|
|
2458
|
+
if (b > 0)
|
|
2459
2459
|
return [
|
|
2460
|
-
Math.max(0, (o[0] - x) /
|
|
2461
|
-
Math.min(1, (o[1] - x) /
|
|
2460
|
+
Math.max(0, (o[0] - x) / b),
|
|
2461
|
+
Math.min(1, (o[1] - x) / b)
|
|
2462
2462
|
];
|
|
2463
2463
|
}
|
|
2464
2464
|
}
|
|
@@ -2468,60 +2468,60 @@ function hs({
|
|
|
2468
2468
|
if (s == null || n.length === 0) return;
|
|
2469
2469
|
const T = n[0];
|
|
2470
2470
|
if (T == null || T.x.length < 2) return;
|
|
2471
|
-
const x = T.x[0],
|
|
2472
|
-
p != null && Math.abs(p[0] - y) < w && Math.abs(p[1] -
|
|
2471
|
+
const x = T.x[0], b = T.x[T.x.length - 1] - x, y = x + c[0] * b, D = x + c[1] * b, p = d.current, w = Math.max(1e-10, Math.abs(D - y) * 1e-12);
|
|
2472
|
+
p != null && Math.abs(p[0] - y) < w && Math.abs(p[1] - D) < w || (d.current = [y, D], s(y, D));
|
|
2473
2473
|
}, [c, n, s]);
|
|
2474
|
-
const f = X(null), g =
|
|
2474
|
+
const f = X(null), g = q((T) => {
|
|
2475
2475
|
const x = a.current;
|
|
2476
2476
|
if (x == null) return 0;
|
|
2477
2477
|
const m = x.getBoundingClientRect();
|
|
2478
2478
|
return Math.max(0, Math.min(1, (T - m.left) / m.width));
|
|
2479
|
-
}, []), M =
|
|
2479
|
+
}, []), M = q((T) => {
|
|
2480
2480
|
const x = a.current;
|
|
2481
2481
|
if (x == null) return;
|
|
2482
|
-
const m = g(T.clientX),
|
|
2483
|
-
let
|
|
2482
|
+
const m = g(T.clientX), b = x.getBoundingClientRect().width, y = b > 0 ? 8 / b : 0;
|
|
2483
|
+
let D;
|
|
2484
2484
|
if (Math.abs(m - c[0]) < y)
|
|
2485
|
-
|
|
2485
|
+
D = "left";
|
|
2486
2486
|
else if (Math.abs(m - c[1]) < y)
|
|
2487
|
-
|
|
2487
|
+
D = "right";
|
|
2488
2488
|
else if (m >= c[0] && m <= c[1])
|
|
2489
|
-
|
|
2489
|
+
D = "move";
|
|
2490
2490
|
else {
|
|
2491
2491
|
const p = c[1] - c[0], w = p / 2, v = Math.max(0, Math.min(1 - p, m - w));
|
|
2492
|
-
u([v, v + p]),
|
|
2492
|
+
u([v, v + p]), D = "move";
|
|
2493
2493
|
}
|
|
2494
2494
|
f.current = {
|
|
2495
|
-
mode:
|
|
2495
|
+
mode: D,
|
|
2496
2496
|
startX: T.clientX,
|
|
2497
2497
|
startFrac: [...c]
|
|
2498
2498
|
}, x.setPointerCapture(T.pointerId), T.preventDefault();
|
|
2499
|
-
}, [c, g]),
|
|
2499
|
+
}, [c, g]), S = q((T) => {
|
|
2500
2500
|
const x = f.current;
|
|
2501
2501
|
if (x == null) return;
|
|
2502
|
-
const m = g(T.clientX),
|
|
2502
|
+
const m = g(T.clientX), b = g(x.startX), y = m - b;
|
|
2503
2503
|
if (x.mode === "move") {
|
|
2504
|
-
const
|
|
2504
|
+
const D = x.startFrac[1] - x.startFrac[0];
|
|
2505
2505
|
let p = x.startFrac[0] + y;
|
|
2506
|
-
p = Math.max(0, Math.min(1 -
|
|
2506
|
+
p = Math.max(0, Math.min(1 - D, p)), u([p, p + D]);
|
|
2507
2507
|
} else if (x.mode === "left") {
|
|
2508
|
-
const
|
|
2509
|
-
u([
|
|
2508
|
+
const D = Math.max(0, Math.min(x.startFrac[1] - 0.01, x.startFrac[0] + y));
|
|
2509
|
+
u([D, x.startFrac[1]]);
|
|
2510
2510
|
} else {
|
|
2511
|
-
const
|
|
2512
|
-
u([x.startFrac[0],
|
|
2511
|
+
const D = Math.min(1, Math.max(x.startFrac[0] + 0.01, x.startFrac[1] + y));
|
|
2512
|
+
u([x.startFrac[0], D]);
|
|
2513
2513
|
}
|
|
2514
|
-
}, [g]), P =
|
|
2514
|
+
}, [g]), P = q((T) => {
|
|
2515
2515
|
f.current = null;
|
|
2516
2516
|
const x = a.current;
|
|
2517
2517
|
x != null && x.releasePointerCapture(T.pointerId);
|
|
2518
2518
|
}, []), h = `${c[0] * 100}%`, C = `${(c[1] - c[0]) * 100}%`, I = n[0], L = I != null ? I.series.length : 0;
|
|
2519
2519
|
return /* @__PURE__ */ Q("div", { className: i, style: { position: "relative", width: t, height: e }, children: [
|
|
2520
|
-
/* @__PURE__ */ Q(
|
|
2520
|
+
/* @__PURE__ */ Q(Ce, { width: t, height: e, data: n, children: [
|
|
2521
2521
|
/* @__PURE__ */ E(Lt, { id: "x" }),
|
|
2522
2522
|
/* @__PURE__ */ E(Lt, { id: "y" }),
|
|
2523
|
-
/* @__PURE__ */ E(
|
|
2524
|
-
/* @__PURE__ */ E(
|
|
2523
|
+
/* @__PURE__ */ E(Dt, { scale: "x", show: !1 }),
|
|
2524
|
+
/* @__PURE__ */ E(Dt, { scale: "y", show: !1 }),
|
|
2525
2525
|
Array.from({ length: L }, (T, x) => /* @__PURE__ */ E(
|
|
2526
2526
|
Te,
|
|
2527
2527
|
{
|
|
@@ -2539,7 +2539,7 @@ function hs({
|
|
|
2539
2539
|
{
|
|
2540
2540
|
ref: a,
|
|
2541
2541
|
onPointerDown: M,
|
|
2542
|
-
onPointerMove:
|
|
2542
|
+
onPointerMove: S,
|
|
2543
2543
|
onPointerUp: P,
|
|
2544
2544
|
style: {
|
|
2545
2545
|
position: "absolute",
|
|
@@ -2667,9 +2667,9 @@ function gs({
|
|
|
2667
2667
|
if (g == null) continue;
|
|
2668
2668
|
const M = d + f * c;
|
|
2669
2669
|
i.fillStyle = "#666", i.font = `${11 * r}px sans-serif`, i.textAlign = "right", i.textBaseline = "middle", i.fillText(g.label, (l.left - 6) * r, M + u / 2);
|
|
2670
|
-
for (const
|
|
2671
|
-
const P = H(
|
|
2672
|
-
C <= 0 || (i.fillStyle =
|
|
2670
|
+
for (const S of g.segments) {
|
|
2671
|
+
const P = H(S.start, a, l.width, l.left) * r, C = H(S.end, a, l.width, l.left) * r - P;
|
|
2672
|
+
C <= 0 || (i.fillStyle = S.color ?? "#4dabf7", i.fillRect(P, M, C, u), S.label != null && C > 20 * r && (i.fillStyle = "#fff", i.font = `${10 * r}px sans-serif`, i.textAlign = "center", i.textBaseline = "middle", i.fillText(S.label, P + C / 2, M + u / 2, C - 4 * r)));
|
|
2673
2673
|
}
|
|
2674
2674
|
}
|
|
2675
2675
|
i.restore();
|
|
@@ -2686,11 +2686,11 @@ function ps({
|
|
|
2686
2686
|
fillTo: r,
|
|
2687
2687
|
className: a
|
|
2688
2688
|
}) {
|
|
2689
|
-
return /* @__PURE__ */ E("div", { style: { pointerEvents: "none" }, className: a, children: /* @__PURE__ */ Q(
|
|
2689
|
+
return /* @__PURE__ */ E("div", { style: { pointerEvents: "none" }, className: a, children: /* @__PURE__ */ Q(Ce, { width: e, height: n, data: t, children: [
|
|
2690
2690
|
/* @__PURE__ */ E(Lt, { id: "x" }),
|
|
2691
2691
|
/* @__PURE__ */ E(Lt, { id: "y" }),
|
|
2692
|
-
/* @__PURE__ */ E(
|
|
2693
|
-
/* @__PURE__ */ E(
|
|
2692
|
+
/* @__PURE__ */ E(Dt, { scale: "x", show: !1 }),
|
|
2693
|
+
/* @__PURE__ */ E(Dt, { scale: "y", show: !1 }),
|
|
2694
2694
|
/* @__PURE__ */ E(
|
|
2695
2695
|
Te,
|
|
2696
2696
|
{
|
|
@@ -2706,45 +2706,6 @@ function ps({
|
|
|
2706
2706
|
)
|
|
2707
2707
|
] }) });
|
|
2708
2708
|
}
|
|
2709
|
-
function ms({
|
|
2710
|
-
minWidth: t = 100,
|
|
2711
|
-
minHeight: e = 100,
|
|
2712
|
-
aspectRatio: n,
|
|
2713
|
-
initialHeight: s = 300,
|
|
2714
|
-
...o
|
|
2715
|
-
}) {
|
|
2716
|
-
const i = X(null), [l, r] = vt(null), a = N(
|
|
2717
|
-
(c) => {
|
|
2718
|
-
const u = Math.max(c.width, t);
|
|
2719
|
-
let d;
|
|
2720
|
-
return n != null ? d = Math.max(u / n, e) : d = Math.max(c.height || s, e), { width: Math.round(u), height: Math.round(d) };
|
|
2721
|
-
},
|
|
2722
|
-
[t, e, n, s]
|
|
2723
|
-
);
|
|
2724
|
-
return Y(() => {
|
|
2725
|
-
const c = i.current;
|
|
2726
|
-
if (c == null) return;
|
|
2727
|
-
const u = c.getBoundingClientRect();
|
|
2728
|
-
if (r(a({ width: u.width, height: u.height })), typeof ResizeObserver > "u") return;
|
|
2729
|
-
const d = new ResizeObserver((f) => {
|
|
2730
|
-
const g = f[0];
|
|
2731
|
-
if (g == null) return;
|
|
2732
|
-
const { width: M, height: b } = g.contentRect;
|
|
2733
|
-
r(a({ width: M, height: b }));
|
|
2734
|
-
});
|
|
2735
|
-
return d.observe(c), () => d.disconnect();
|
|
2736
|
-
}, [a]), /* @__PURE__ */ E(
|
|
2737
|
-
"div",
|
|
2738
|
-
{
|
|
2739
|
-
ref: i,
|
|
2740
|
-
style: {
|
|
2741
|
-
width: "100%",
|
|
2742
|
-
height: n != null ? "auto" : "100%"
|
|
2743
|
-
},
|
|
2744
|
-
children: l != null && /* @__PURE__ */ E(Ut, { ...o, width: l.width, height: l.height })
|
|
2745
|
-
}
|
|
2746
|
-
);
|
|
2747
|
-
}
|
|
2748
2709
|
function es(t, e, n, s = {}) {
|
|
2749
2710
|
const { ctx: o, plotBox: i } = t, l = H(n, e, i.height, i.top);
|
|
2750
2711
|
o.beginPath(), o.moveTo(i.left, l), o.lineTo(i.left + i.width, l), o.strokeStyle = s.stroke ?? "red", o.lineWidth = s.width ?? 1, s.dash && o.setLineDash(s.dash), o.stroke(), s.dash && o.setLineDash([]);
|
|
@@ -2753,7 +2714,7 @@ function ns(t, e, n, s = {}) {
|
|
|
2753
2714
|
const { ctx: o, plotBox: i } = t, l = H(n, e, i.width, i.left);
|
|
2754
2715
|
o.beginPath(), o.moveTo(l, i.top), o.lineTo(l, i.top + i.height), o.strokeStyle = s.stroke ?? "red", o.lineWidth = s.width ?? 1, s.dash && o.setLineDash(s.dash), o.stroke(), s.dash && o.setLineDash([]);
|
|
2755
2716
|
}
|
|
2756
|
-
function
|
|
2717
|
+
function ms(t, e, n, s, o, i, l = {}) {
|
|
2757
2718
|
const { ctx: r, plotBox: a } = t, c = H(s, e, a.width, a.left), u = H(o, n, a.height, a.top);
|
|
2758
2719
|
r.font = l.font ?? "12px sans-serif", r.fillStyle = l.fill ?? "#000", r.textBaseline = "bottom", r.fillText(i, c, u - 4);
|
|
2759
2720
|
}
|
|
@@ -2761,9 +2722,9 @@ function ss(t, e, n, s, o = {}) {
|
|
|
2761
2722
|
const { ctx: i, plotBox: l } = t, r = H(s, e, l.height, l.top), a = H(n, e, l.height, l.top);
|
|
2762
2723
|
i.fillStyle = o.fill ?? "rgba(255,0,0,0.1)", i.fillRect(l.left, Math.min(r, a), l.width, Math.abs(a - r)), o.stroke && (i.strokeStyle = o.stroke, i.lineWidth = o.width ?? 1, o.dash && i.setLineDash(o.dash), i.strokeRect(l.left, Math.min(r, a), l.width, Math.abs(a - r)), o.dash && i.setLineDash([]));
|
|
2763
2724
|
}
|
|
2764
|
-
function
|
|
2725
|
+
function ws(t) {
|
|
2765
2726
|
const e = X(t);
|
|
2766
|
-
return
|
|
2727
|
+
return zt(() => {
|
|
2767
2728
|
e.current = t;
|
|
2768
2729
|
}), Pt((n) => {
|
|
2769
2730
|
const s = e.current, o = s.yScale ?? "y", i = n.getScale(o);
|
|
@@ -2779,9 +2740,9 @@ function vs(t) {
|
|
|
2779
2740
|
}
|
|
2780
2741
|
}), null;
|
|
2781
2742
|
}
|
|
2782
|
-
function
|
|
2743
|
+
function vs(t) {
|
|
2783
2744
|
const e = X(t);
|
|
2784
|
-
return
|
|
2745
|
+
return zt(() => {
|
|
2785
2746
|
e.current = t;
|
|
2786
2747
|
}), Pt((n) => {
|
|
2787
2748
|
const s = e.current, o = s.xScale ?? "x", i = n.getScale(o);
|
|
@@ -2799,7 +2760,7 @@ function Ms(t) {
|
|
|
2799
2760
|
}
|
|
2800
2761
|
function xs(t) {
|
|
2801
2762
|
const e = X(t);
|
|
2802
|
-
return
|
|
2763
|
+
return zt(() => {
|
|
2803
2764
|
e.current = t;
|
|
2804
2765
|
}), Pt((n) => {
|
|
2805
2766
|
const s = e.current, o = n.getScale(s.yScale ?? "y");
|
|
@@ -2811,9 +2772,9 @@ function xs(t) {
|
|
|
2811
2772
|
});
|
|
2812
2773
|
}), null;
|
|
2813
2774
|
}
|
|
2814
|
-
function
|
|
2775
|
+
function Ms(t) {
|
|
2815
2776
|
const e = X(t);
|
|
2816
|
-
return
|
|
2777
|
+
return zt(() => {
|
|
2817
2778
|
e.current = t;
|
|
2818
2779
|
}), Pt((n) => {
|
|
2819
2780
|
const s = e.current, o = n.valToX(s.x, s.xScale ?? "x"), i = n.valToY(s.y, s.yScale ?? "y");
|
|
@@ -2822,46 +2783,46 @@ function bs(t) {
|
|
|
2822
2783
|
l.font = s.font ?? "12px sans-serif", l.fillStyle = s.fill ?? "#000", l.textAlign = s.align ?? "left", l.textBaseline = s.baseline ?? "bottom", l.fillText(s.text, o, i - 4);
|
|
2823
2784
|
}), null;
|
|
2824
2785
|
}
|
|
2825
|
-
function
|
|
2826
|
-
const { window: n, batchSize: s = 1 } = e, o = e.autoStart ?? !0, [i, l] =
|
|
2786
|
+
function bs(t, e) {
|
|
2787
|
+
const { window: n, batchSize: s = 1 } = e, o = e.autoStart ?? !0, [i, l] = St(t), [r, a] = St(!1), [c, u] = St(0), d = X(0), f = X(0), g = X(0), M = X(/* @__PURE__ */ new Map()), S = X(0), P = X(n);
|
|
2827
2788
|
P.current = n;
|
|
2828
|
-
const h =
|
|
2789
|
+
const h = q(
|
|
2829
2790
|
(T, x, ...m) => {
|
|
2830
|
-
let
|
|
2831
|
-
|
|
2791
|
+
let b = M.current.get(T);
|
|
2792
|
+
b == null && (b = { x: [], series: m.map(() => []) }, M.current.set(T, b)), b.x.push(...x);
|
|
2832
2793
|
for (let y = 0; y < m.length; y++) {
|
|
2833
|
-
let
|
|
2834
|
-
|
|
2794
|
+
let D = b.series[y];
|
|
2795
|
+
D == null && (D = [], b.series[y] = D), D.push(...m[y] ?? []);
|
|
2835
2796
|
}
|
|
2836
|
-
|
|
2837
|
-
|
|
2797
|
+
S.current === 0 && (S.current = requestAnimationFrame(() => {
|
|
2798
|
+
S.current = 0;
|
|
2838
2799
|
const y = M.current;
|
|
2839
2800
|
M.current = /* @__PURE__ */ new Map();
|
|
2840
|
-
const
|
|
2801
|
+
const D = P.current;
|
|
2841
2802
|
l((p) => {
|
|
2842
2803
|
const w = p.slice();
|
|
2843
|
-
for (const [v, { x: k, series:
|
|
2804
|
+
for (const [v, { x: k, series: z }] of y) {
|
|
2844
2805
|
const A = w[v];
|
|
2845
2806
|
if (A == null) continue;
|
|
2846
|
-
const F = A.x,
|
|
2847
|
-
const j = B, Z =
|
|
2848
|
-
return
|
|
2807
|
+
const F = A.x, _ = Math.max(0, F.length + k.length - D), R = _ > 0 ? F.slice(_).concat(k) : F.concat(k), V = A.series.map((B, W) => {
|
|
2808
|
+
const j = B, Z = z[W] ?? [];
|
|
2809
|
+
return _ > 0 ? j.slice(_).concat(Z) : j.concat(Z);
|
|
2849
2810
|
});
|
|
2850
|
-
w[v] = { x:
|
|
2811
|
+
w[v] = { x: R, series: V };
|
|
2851
2812
|
}
|
|
2852
2813
|
return w;
|
|
2853
2814
|
});
|
|
2854
2815
|
}));
|
|
2855
2816
|
},
|
|
2856
2817
|
[]
|
|
2857
|
-
), C =
|
|
2818
|
+
), C = q(
|
|
2858
2819
|
(T, ...x) => {
|
|
2859
2820
|
h(0, T, ...x);
|
|
2860
2821
|
},
|
|
2861
2822
|
[h]
|
|
2862
|
-
), I =
|
|
2823
|
+
), I = q(() => {
|
|
2863
2824
|
a(!0);
|
|
2864
|
-
}, []), L =
|
|
2825
|
+
}, []), L = q(() => {
|
|
2865
2826
|
a(!1);
|
|
2866
2827
|
}, []);
|
|
2867
2828
|
return Y(() => {
|
|
@@ -2879,40 +2840,40 @@ function Ss(t, e) {
|
|
|
2879
2840
|
d.current !== 0 && (cancelAnimationFrame(d.current), d.current = 0);
|
|
2880
2841
|
};
|
|
2881
2842
|
}, [r]), Y(() => () => {
|
|
2882
|
-
|
|
2843
|
+
S.current !== 0 && cancelAnimationFrame(S.current);
|
|
2883
2844
|
}, []), Y(() => {
|
|
2884
2845
|
o && a(!0);
|
|
2885
2846
|
}, [o]), { data: i, push: C, pushGroup: h, start: I, stop: L, running: r, fps: c };
|
|
2886
2847
|
}
|
|
2887
|
-
function
|
|
2848
|
+
function Ss(t) {
|
|
2888
2849
|
return (e, n, s, o, i, l, r, a, c, u, d, f, g) => {
|
|
2889
|
-
const M = (g == null ? void 0 : g.align) ?? t ?? 1,
|
|
2850
|
+
const M = (g == null ? void 0 : g.align) ?? t ?? 1, S = (g == null ? void 0 : g.spanGaps) ?? !1;
|
|
2890
2851
|
if ([c, u] = Ft(n, c, u), c === -1)
|
|
2891
2852
|
return { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null };
|
|
2892
|
-
const P = (y) => f(H(y, s, i, r)), h = (y) => f(H(y, o, l, a)), C = s.ori === G.Horizontal ?
|
|
2853
|
+
const P = (y) => f(H(y, s, i, r)), h = (y) => f(H(y, o, l, a)), C = s.ori === G.Horizontal ? _t : Rt, I = { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null }, L = I.stroke;
|
|
2893
2854
|
let T = !1;
|
|
2894
2855
|
const x = d === K.Forward ? c : u;
|
|
2895
|
-
let m = h(n[x]),
|
|
2896
|
-
C(L,
|
|
2856
|
+
let m = h(n[x]), b = P(e[x]);
|
|
2857
|
+
C(L, b, m);
|
|
2897
2858
|
for (let y = x; y >= c && y <= u; y += d) {
|
|
2898
|
-
const
|
|
2899
|
-
if (
|
|
2900
|
-
|
|
2859
|
+
const D = n[y];
|
|
2860
|
+
if (D == null) {
|
|
2861
|
+
D === null && !S && (T = !0);
|
|
2901
2862
|
continue;
|
|
2902
2863
|
}
|
|
2903
|
-
const p = P(e[y]), w = h(
|
|
2864
|
+
const p = P(e[y]), w = h(D);
|
|
2904
2865
|
if (M === 1)
|
|
2905
2866
|
C(L, p, m);
|
|
2906
2867
|
else if (M === -1)
|
|
2907
|
-
C(L,
|
|
2868
|
+
C(L, b, w);
|
|
2908
2869
|
else {
|
|
2909
|
-
const v = f((
|
|
2870
|
+
const v = f((b + p) / 2);
|
|
2910
2871
|
C(L, v, m), C(L, v, w);
|
|
2911
2872
|
}
|
|
2912
|
-
C(L, p, w), m = w,
|
|
2873
|
+
C(L, p, w), m = w, b = p;
|
|
2913
2874
|
}
|
|
2914
2875
|
{
|
|
2915
|
-
const y = I.fill = new Path2D(L),
|
|
2876
|
+
const y = I.fill = new Path2D(L), D = (g == null ? void 0 : g.fillTo) ?? o.min ?? 0, p = h(D);
|
|
2916
2877
|
let w = r, v = r + i;
|
|
2917
2878
|
d === K.Backward && ([v, w] = [w, v]), C(y, v, p), C(y, w, p);
|
|
2918
2879
|
}
|
|
@@ -2923,33 +2884,33 @@ function ys(t) {
|
|
|
2923
2884
|
return I;
|
|
2924
2885
|
};
|
|
2925
2886
|
}
|
|
2926
|
-
function
|
|
2887
|
+
function ys() {
|
|
2927
2888
|
return (t, e, n, s, o, i, l, r, a, c, u, d, f) => {
|
|
2928
|
-
const g = (f == null ? void 0 : f.barWidth) ?? 0.6, M = (f == null ? void 0 : f.barGap) ?? 0,
|
|
2889
|
+
const g = (f == null ? void 0 : f.barWidth) ?? 0.6, M = (f == null ? void 0 : f.barGap) ?? 0, S = (f == null ? void 0 : f.barRadius) ?? 0, P = (f == null ? void 0 : f.barGroupIdx) ?? 0, h = (f == null ? void 0 : f.barGroupCount) ?? 1, C = (v) => d(H(v, n, o, l)), I = (v) => d(H(v, s, i, r));
|
|
2929
2890
|
let L = o;
|
|
2930
2891
|
if (c > a) {
|
|
2931
2892
|
let v = 1 / 0, k = -1;
|
|
2932
|
-
for (let
|
|
2933
|
-
if (e[
|
|
2893
|
+
for (let z = a; z <= c; z++)
|
|
2894
|
+
if (e[z] != null) {
|
|
2934
2895
|
if (k >= 0) {
|
|
2935
|
-
const A = t[
|
|
2936
|
-
|
|
2896
|
+
const A = t[z], F = t[k], _ = Math.abs(C(A) - C(F));
|
|
2897
|
+
_ < v && (v = _);
|
|
2937
2898
|
}
|
|
2938
|
-
k =
|
|
2899
|
+
k = z;
|
|
2939
2900
|
}
|
|
2940
2901
|
v < 1 / 0 && (L = v);
|
|
2941
2902
|
}
|
|
2942
|
-
const T = L * (1 - g), x = Math.max(0, T + M), m = Math.max(1, d(L - x)),
|
|
2903
|
+
const T = L * (1 - g), x = Math.max(0, T + M), m = Math.max(1, d(L - x)), b = h > 1 ? Math.max(1, d(m / Math.max(1, h))) : m, y = (f == null ? void 0 : f.fillTo) ?? s.min ?? 0, D = I(y), p = new Path2D(), w = n.ori === G.Horizontal;
|
|
2943
2904
|
for (let v = u === K.Forward ? a : c; v >= a && v <= c; v += u) {
|
|
2944
2905
|
const k = e[v];
|
|
2945
2906
|
if (k == null) continue;
|
|
2946
|
-
const
|
|
2907
|
+
const z = C(t[v]), A = I(k), F = h > 1 ? (P - (h - 1) / 2) * b : 0, _ = d(z - b / 2 + F), R = Math.min(A, D), B = Math.max(A, D) - R;
|
|
2947
2908
|
if (B !== 0)
|
|
2948
|
-
if (
|
|
2949
|
-
const W = Math.min(
|
|
2950
|
-
os(p, w,
|
|
2909
|
+
if (S > 0) {
|
|
2910
|
+
const W = Math.min(S * b, B / 2);
|
|
2911
|
+
os(p, w, _, R, b, B, W, k < y);
|
|
2951
2912
|
} else
|
|
2952
|
-
w ? p.rect(
|
|
2913
|
+
w ? p.rect(_, R, b, B) : p.rect(R, _, B, b);
|
|
2953
2914
|
}
|
|
2954
2915
|
return {
|
|
2955
2916
|
stroke: p,
|
|
@@ -2969,11 +2930,11 @@ function Ie(t) {
|
|
|
2969
2930
|
const M = (g == null ? void 0 : g.spanGaps) ?? !1;
|
|
2970
2931
|
if ([c, u] = Ft(n, c, u), c === -1)
|
|
2971
2932
|
return { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null };
|
|
2972
|
-
const
|
|
2933
|
+
const S = (b) => f(H(b, s, i, r)), P = (b) => f(H(b, o, l, a)), h = s.ori === G.Horizontal ? _t : Rt, C = [], I = [];
|
|
2973
2934
|
let L = !1;
|
|
2974
|
-
for (let
|
|
2975
|
-
const y = n[
|
|
2976
|
-
y != null ? (C.push(
|
|
2935
|
+
for (let b = d === K.Forward ? c : u; b >= c && b <= u; b += d) {
|
|
2936
|
+
const y = n[b];
|
|
2937
|
+
y != null ? (C.push(S(e[b])), I.push(P(y))) : y === null && !M && (L = !0);
|
|
2977
2938
|
}
|
|
2978
2939
|
const T = s.ori === G.Horizontal, x = t(C, I, T, f), m = {
|
|
2979
2940
|
stroke: x ?? new Path2D(),
|
|
@@ -2983,18 +2944,18 @@ function Ie(t) {
|
|
|
2983
2944
|
gaps: null
|
|
2984
2945
|
};
|
|
2985
2946
|
if (x != null) {
|
|
2986
|
-
const
|
|
2947
|
+
const b = m.fill = new Path2D(x), y = (g == null ? void 0 : g.fillTo) ?? o.min ?? 0, D = P(y);
|
|
2987
2948
|
let p = r, w = r + i;
|
|
2988
|
-
d === K.Backward && ([w, p] = [p, w]), h(
|
|
2949
|
+
d === K.Backward && ([w, p] = [p, w]), h(b, w, D), h(b, p, D);
|
|
2989
2950
|
}
|
|
2990
2951
|
if (L) {
|
|
2991
|
-
const
|
|
2992
|
-
m.gaps =
|
|
2952
|
+
const b = Xt(e, n, c, u, d, S);
|
|
2953
|
+
m.gaps = b, m.clip = Yt(b, s.ori, r, a, i, l);
|
|
2993
2954
|
}
|
|
2994
2955
|
return m;
|
|
2995
2956
|
};
|
|
2996
2957
|
}
|
|
2997
|
-
function
|
|
2958
|
+
function ks() {
|
|
2998
2959
|
return Ie(ls);
|
|
2999
2960
|
}
|
|
3000
2961
|
const ls = (t, e, n, s) => {
|
|
@@ -3014,18 +2975,18 @@ const ls = (t, e, n, s) => {
|
|
|
3014
2975
|
if (g === 0 || M === 0 || M > 0 != g > 0)
|
|
3015
2976
|
a[f] = 0;
|
|
3016
2977
|
else {
|
|
3017
|
-
const
|
|
3018
|
-
a[f] = 3 * (P +
|
|
2978
|
+
const S = d[f] ?? 1, P = d[f - 1] ?? 1;
|
|
2979
|
+
a[f] = 3 * (P + S) / ((2 * S + P) / M + (S + 2 * P) / g), isFinite(a[f] ?? 0) || (a[f] = 0);
|
|
3019
2980
|
}
|
|
3020
2981
|
}
|
|
3021
2982
|
a[o - 1] = c[o - 2] ?? 0;
|
|
3022
2983
|
for (let f = 0; f < o - 1; f++) {
|
|
3023
|
-
const g = d[f] ?? 1, M = t[f] ?? 0,
|
|
2984
|
+
const g = d[f] ?? 1, M = t[f] ?? 0, S = e[f] ?? 0, P = t[f + 1] ?? 0, h = e[f + 1] ?? 0, C = a[f] ?? 0, I = a[f + 1] ?? 0, L = M + g / 3, T = S + C * g / 3, x = P - g / 3, m = h - I * g / 3;
|
|
3024
2985
|
n ? i.bezierCurveTo(L, T, x, m, P, h) : i.bezierCurveTo(T, L, m, x, h, P);
|
|
3025
2986
|
}
|
|
3026
2987
|
return i;
|
|
3027
2988
|
};
|
|
3028
|
-
function
|
|
2989
|
+
function Cs() {
|
|
3029
2990
|
return Ie(is);
|
|
3030
2991
|
}
|
|
3031
2992
|
const is = (t, e, n, s) => {
|
|
@@ -3037,29 +2998,29 @@ const is = (t, e, n, s) => {
|
|
|
3037
2998
|
return n ? i.lineTo(a, c) : i.lineTo(c, a), i;
|
|
3038
2999
|
}
|
|
3039
3000
|
for (let a = 0; a < o - 1; a++) {
|
|
3040
|
-
const c = a === 0 ? 0 : a - 1, u = t[c] ?? 0, d = e[c] ?? 0, f = t[a] ?? 0, g = e[a] ?? 0, M = t[a + 1] ?? 0,
|
|
3041
|
-
let
|
|
3001
|
+
const c = a === 0 ? 0 : a - 1, u = t[c] ?? 0, d = e[c] ?? 0, f = t[a] ?? 0, g = e[a] ?? 0, M = t[a + 1] ?? 0, S = e[a + 1] ?? 0, P = a + 2 < o ? t[a + 2] ?? 0 : M, h = a + 2 < o ? e[a + 2] ?? 0 : S, C = Math.hypot(u - f, d - g), I = Math.hypot(f - M, g - S), L = Math.hypot(M - P, S - h), T = Math.sqrt(L), x = L, m = Math.sqrt(I), b = I, y = Math.sqrt(C), D = C, p = 2 * D + 3 * y * m + b, w = 2 * x + 3 * T * m + b, v = 3 * y * (y + m), k = 3 * T * (T + m);
|
|
3002
|
+
let z, A, F, _;
|
|
3042
3003
|
if (v > 0) {
|
|
3043
|
-
const
|
|
3044
|
-
|
|
3004
|
+
const R = 1 / v;
|
|
3005
|
+
z = (-b * u + p * f + D * M) * R, A = (-b * d + p * g + D * S) * R;
|
|
3045
3006
|
} else
|
|
3046
|
-
|
|
3007
|
+
z = f, A = g;
|
|
3047
3008
|
if (k > 0) {
|
|
3048
|
-
const
|
|
3049
|
-
F = (x * f + w * M -
|
|
3009
|
+
const R = 1 / k;
|
|
3010
|
+
F = (x * f + w * M - b * P) * R, _ = (x * g + w * S - b * h) * R;
|
|
3050
3011
|
} else
|
|
3051
|
-
F = M,
|
|
3052
|
-
n ? i.bezierCurveTo(
|
|
3012
|
+
F = M, _ = S;
|
|
3013
|
+
n ? i.bezierCurveTo(z, A, F, _, M, S) : i.bezierCurveTo(A, z, _, F, S, M);
|
|
3053
3014
|
}
|
|
3054
3015
|
return i;
|
|
3055
3016
|
};
|
|
3056
|
-
function
|
|
3017
|
+
function Ts(t = 4) {
|
|
3057
3018
|
return (e, n, s, o, i, l, r, a, c, u, d, f, g) => {
|
|
3058
|
-
const M = (I) => f(H(I, s, i, r)),
|
|
3019
|
+
const M = (I) => f(H(I, s, i, r)), S = (I) => f(H(I, o, l, a)), P = t / 2, h = new Path2D(), C = s.ori === G.Horizontal;
|
|
3059
3020
|
for (let I = d === K.Forward ? c : u; I >= c && I <= u; I += d) {
|
|
3060
3021
|
const L = n[I];
|
|
3061
3022
|
if (L == null) continue;
|
|
3062
|
-
const T = M(e[I]), x =
|
|
3023
|
+
const T = M(e[I]), x = S(L);
|
|
3063
3024
|
C ? (h.moveTo(T + P, x), h.arc(T, x, P, 0, Math.PI * 2)) : (h.moveTo(x + P, T), h.arc(x, T, P, 0, Math.PI * 2));
|
|
3064
3025
|
}
|
|
3065
3026
|
return {
|
|
@@ -3071,7 +3032,7 @@ function Is(t = 4) {
|
|
|
3071
3032
|
};
|
|
3072
3033
|
};
|
|
3073
3034
|
}
|
|
3074
|
-
function
|
|
3035
|
+
function Is(t) {
|
|
3075
3036
|
return ({ ctx: e, plotBox: n, pxRatio: s }) => {
|
|
3076
3037
|
const {
|
|
3077
3038
|
xValues: o,
|
|
@@ -3087,22 +3048,22 @@ function As(t) {
|
|
|
3087
3048
|
wickWidth: M = 1
|
|
3088
3049
|
} = t;
|
|
3089
3050
|
if (c.min == null || c.max == null || u.min == null || u.max == null) return;
|
|
3090
|
-
const
|
|
3091
|
-
if (
|
|
3092
|
-
const h = Math.max(2, n.width /
|
|
3051
|
+
const S = o.length;
|
|
3052
|
+
if (S === 0) return;
|
|
3053
|
+
const h = Math.max(2, n.width / S * g) * s / 2;
|
|
3093
3054
|
e.save();
|
|
3094
|
-
for (let C = 0; C <
|
|
3055
|
+
for (let C = 0; C < S; C++) {
|
|
3095
3056
|
const I = o[C], L = i[C], T = l[C], x = r[C], m = a[C];
|
|
3096
3057
|
if (I == null || L == null || T == null || x == null || m == null) continue;
|
|
3097
|
-
const
|
|
3098
|
-
e.strokeStyle = k, e.lineWidth = M * s, e.beginPath(), e.moveTo(
|
|
3099
|
-
const
|
|
3100
|
-
e.fillStyle = k, e.fillRect(
|
|
3058
|
+
const b = H(I, c, n.width, n.left) * s, y = H(L, u, n.height, n.top) * s, D = H(T, u, n.height, n.top) * s, p = H(x, u, n.height, n.top) * s, w = H(m, u, n.height, n.top) * s, k = m >= L ? d : f;
|
|
3059
|
+
e.strokeStyle = k, e.lineWidth = M * s, e.beginPath(), e.moveTo(b, D), e.lineTo(b, p), e.stroke();
|
|
3060
|
+
const z = Math.min(y, w), A = Math.abs(w - y);
|
|
3061
|
+
e.fillStyle = k, e.fillRect(b - h, z, h * 2, Math.max(A, 1 * s));
|
|
3101
3062
|
}
|
|
3102
3063
|
e.restore();
|
|
3103
3064
|
};
|
|
3104
3065
|
}
|
|
3105
|
-
function
|
|
3066
|
+
function As(t, e, n = 0) {
|
|
3106
3067
|
const s = e ?? t.series.map((c, u) => u), o = t.x.length, i = [], l = new Float64Array(o);
|
|
3107
3068
|
for (let c = 0; c < s.length; c++) {
|
|
3108
3069
|
const u = s[c];
|
|
@@ -3134,7 +3095,7 @@ function Ps(t, e, n = 0) {
|
|
|
3134
3095
|
bands: a
|
|
3135
3096
|
};
|
|
3136
3097
|
}
|
|
3137
|
-
function
|
|
3098
|
+
function Ps(t) {
|
|
3138
3099
|
const e = /* @__PURE__ */ new Set();
|
|
3139
3100
|
for (const [i] of t)
|
|
3140
3101
|
for (let l = 0; l < i.length; l++) {
|
|
@@ -3159,7 +3120,7 @@ function Ls(t) {
|
|
|
3159
3120
|
}
|
|
3160
3121
|
return [{ x: n, series: o }];
|
|
3161
3122
|
}
|
|
3162
|
-
function
|
|
3123
|
+
function Ls(t) {
|
|
3163
3124
|
const e = (t == null ? void 0 : t.decimals) ?? 1;
|
|
3164
3125
|
return (n) => n.map((s) => {
|
|
3165
3126
|
const o = Math.abs(s);
|
|
@@ -3169,11 +3130,11 @@ function zs(t) {
|
|
|
3169
3130
|
function Ds(t, e = 0) {
|
|
3170
3131
|
return (n) => n.map((s) => s.toFixed(e) + t);
|
|
3171
3132
|
}
|
|
3172
|
-
function
|
|
3133
|
+
function zs(t) {
|
|
3173
3134
|
const e = (t == null ? void 0 : t.utc) ?? !1;
|
|
3174
3135
|
return (n) => n.map((s) => e ? nt(s, { hour: "2-digit", minute: "2-digit", hour12: !1 }, "UTC") : nt(s, { hour: "2-digit", minute: "2-digit", hour12: !1 }));
|
|
3175
3136
|
}
|
|
3176
|
-
function
|
|
3137
|
+
function Fs(t) {
|
|
3177
3138
|
const e = t != null && t.utc ? "UTC" : void 0, n = (t == null ? void 0 : t.format) ?? "short";
|
|
3178
3139
|
return (s) => s.map((o) => nt(o, { month: n }, e));
|
|
3179
3140
|
}
|
|
@@ -3181,7 +3142,7 @@ function _s(t) {
|
|
|
3181
3142
|
const { tz: e, ...n } = t ?? {};
|
|
3182
3143
|
return (s) => s.map((o) => nt(o, n, e));
|
|
3183
3144
|
}
|
|
3184
|
-
function
|
|
3145
|
+
function Rs(t, e = 0) {
|
|
3185
3146
|
return (n) => n.map((s) => {
|
|
3186
3147
|
const o = Math.round(s) - e;
|
|
3187
3148
|
return t[o] ?? String(s);
|
|
@@ -3205,7 +3166,7 @@ function Ae(t) {
|
|
|
3205
3166
|
const s = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(t);
|
|
3206
3167
|
return s ? [Number(s[1]), Number(s[2]), Number(s[3])] : null;
|
|
3207
3168
|
}
|
|
3208
|
-
function
|
|
3169
|
+
function Gs(t, e = 0.8, n = 0) {
|
|
3209
3170
|
const s = Ae(t);
|
|
3210
3171
|
if (s == null)
|
|
3211
3172
|
return { type: "linear", stops: [[0, t], [1, t]] };
|
|
@@ -3218,13 +3179,13 @@ function Hs(t, e = 0.8, n = 0) {
|
|
|
3218
3179
|
]
|
|
3219
3180
|
};
|
|
3220
3181
|
}
|
|
3221
|
-
function
|
|
3182
|
+
function Hs(t, e) {
|
|
3222
3183
|
const n = Ae(t);
|
|
3223
3184
|
if (n == null) return t;
|
|
3224
3185
|
const [s, o, i] = n;
|
|
3225
3186
|
return `rgba(${s},${o},${i},${e})`;
|
|
3226
3187
|
}
|
|
3227
|
-
function
|
|
3188
|
+
function Vs(t, e = 65, n = 50) {
|
|
3228
3189
|
const s = [];
|
|
3229
3190
|
for (let i = 0; i < t; i++) {
|
|
3230
3191
|
const l = i * 137.508 % 360;
|
|
@@ -3233,17 +3194,16 @@ function $s(t, e = 65, n = 50) {
|
|
|
3233
3194
|
return s;
|
|
3234
3195
|
}
|
|
3235
3196
|
export {
|
|
3236
|
-
|
|
3237
|
-
|
|
3197
|
+
Ms as AnnotationLabel,
|
|
3198
|
+
Dt as Axis,
|
|
3238
3199
|
cs as Band,
|
|
3239
|
-
|
|
3200
|
+
Ce as Chart,
|
|
3240
3201
|
K as Direction,
|
|
3241
|
-
|
|
3242
|
-
|
|
3202
|
+
N as Distribution,
|
|
3203
|
+
ws as HLine,
|
|
3243
3204
|
us as Legend,
|
|
3244
3205
|
G as Orientation,
|
|
3245
3206
|
xs as Region,
|
|
3246
|
-
ms as ResponsiveChart,
|
|
3247
3207
|
Lt as Scale,
|
|
3248
3208
|
Te as Series,
|
|
3249
3209
|
U as Side,
|
|
@@ -3251,35 +3211,35 @@ export {
|
|
|
3251
3211
|
ps as Sparkline,
|
|
3252
3212
|
gs as Timeline,
|
|
3253
3213
|
fs as Tooltip,
|
|
3254
|
-
|
|
3214
|
+
vs as VLine,
|
|
3255
3215
|
hs as ZoomRanger,
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3216
|
+
Ps as alignData,
|
|
3217
|
+
ys as bars,
|
|
3218
|
+
Cs as catmullRom,
|
|
3219
|
+
Is as drawCandlesticks,
|
|
3260
3220
|
es as drawHLine,
|
|
3261
|
-
|
|
3221
|
+
ms as drawLabel,
|
|
3262
3222
|
ss as drawRegion,
|
|
3263
3223
|
ns as drawVLine,
|
|
3264
|
-
|
|
3265
|
-
|
|
3224
|
+
Gs as fadeGradient,
|
|
3225
|
+
Ls as fmtCompact,
|
|
3266
3226
|
_s as fmtDateStr,
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3227
|
+
zs as fmtHourMin,
|
|
3228
|
+
Rs as fmtLabels,
|
|
3229
|
+
Fs as fmtMonthName,
|
|
3270
3230
|
Ds as fmtSuffix,
|
|
3271
3231
|
Qe as linear,
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3232
|
+
ks as monotoneCubic,
|
|
3233
|
+
Vs as palette,
|
|
3234
|
+
Ts as points,
|
|
3275
3235
|
it as posToVal,
|
|
3276
3236
|
xt as sideOrientation,
|
|
3277
|
-
|
|
3278
|
-
|
|
3237
|
+
As as stackGroup,
|
|
3238
|
+
Ss as stepped,
|
|
3279
3239
|
ot as useChart,
|
|
3280
3240
|
ds as useCursorDrawHook,
|
|
3281
3241
|
Pt as useDrawHook,
|
|
3282
|
-
|
|
3242
|
+
bs as useStreamingData,
|
|
3283
3243
|
H as valToPos,
|
|
3284
|
-
|
|
3244
|
+
Hs as withAlpha
|
|
3285
3245
|
};
|