uplot-plus 0.1.2 → 0.1.4
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/components/Tooltip.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 +914 -966
- 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
|
-
import { jsx as
|
|
2
|
-
import { useRef 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 || {}),
|
|
4
|
-
function
|
|
1
|
+
import { jsx as X, jsxs as Q, Fragment as Pe } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as E, 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
|
+
function Mt(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,
|
|
8
|
+
const J = Math, _t = J.PI, gt = J.abs, st = J.floor, $ = J.round, Tt = J.ceil, qt = J.min, kt = J.max, wt = J.pow, Zt = J.sign, et = J.log10, xt = J.log2, Fe = (t, e = 1) => J.sinh(t) * e, Wt = (t, e = 1) => J.asinh(t / e), Z = 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 =
|
|
36
|
+
const Ft = pe(de), me = pe(ge);
|
|
37
37
|
function Re(t, e, n, s = yt.Unsorted, o = !1) {
|
|
38
|
-
const i = o ?
|
|
39
|
-
let c = t[r] ??
|
|
38
|
+
const i = o ? me : Ft, l = o ? ge : de, [r, a] = i(t, e, n);
|
|
39
|
+
let c = t[r] ?? Z, u = t[r] ?? -Z;
|
|
40
40
|
if (r > -1)
|
|
41
41
|
if (s === yt.Ascending)
|
|
42
|
-
c = t[r] ??
|
|
42
|
+
c = t[r] ?? Z, u = t[a] ?? -Z;
|
|
43
43
|
else if (s === yt.Descending)
|
|
44
|
-
c = t[a] ??
|
|
44
|
+
c = t[a] ?? Z, u = t[r] ?? -Z;
|
|
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 He(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,52 +76,52 @@ 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(He);
|
|
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;
|
|
92
92
|
}
|
|
93
|
-
const
|
|
93
|
+
const _e = new Intl.NumberFormat(), Me = (t) => _e.format(t), Ve = 0.1, lt = {
|
|
94
94
|
mode: 3,
|
|
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
|
|
104
|
-
(
|
|
105
|
-
const
|
|
106
|
-
return z ===
|
|
101
|
+
const i = o.min, l = o.max, r = i.pad, a = l.pad, c = i.hard ?? -Z, u = l.hard ?? Z, d = i.soft ?? Z, f = l.soft ?? -Z, g = i.mode, v = l.mode;
|
|
102
|
+
let x = e - t;
|
|
103
|
+
const L = et(x), h = kt(gt(t), gt(e)), I = et(h), P = gt(I - L);
|
|
104
|
+
(x < 1e-24 || P > 10) && (x = 0, (t === 0 || e === 0) && (x = 1e-24));
|
|
105
|
+
const D = x || h || 1e3, T = et(D), M = wt(10, st(T)), S = D * (x === 0 ? t === 0 ? 0.1 : 1 : r), b = ut(we(t - S, M / 10), 24), C = t >= d && (g === 1 || g === 3 && b <= d || g === 2 && b >= d) ? d : Z, z = kt(c, b < C && t >= C ? C : qt(C, b)), p = D * (x === 0 ? e === 0 ? 0.1 : 1 : a), m = ut(Et(e + p, M / 10), 24), w = e <= f && (v === 1 || v === 3 && m >= f || v === 2 && m <= f) ? f : -Z, y = qt(u, m > w && e <= w ? w : kt(w, m));
|
|
106
|
+
return z === y && z === 0 ? [-1, 1] : [z, y];
|
|
107
107
|
}
|
|
108
108
|
function Be(t, e, n, s) {
|
|
109
109
|
n === 2 && (s = !0);
|
|
110
110
|
const o = Zt(t), i = Zt(e);
|
|
111
111
|
t === e && (o === -1 ? (t *= n, e /= n) : (t /= n, e *= n));
|
|
112
|
-
const l = n === 10 ? et :
|
|
113
|
-
let g = wt(n, d),
|
|
114
|
-
return n === 10 && (d < 0 && (g = ut(g, -d)), f < 0 && (
|
|
112
|
+
const l = n === 10 ? et : xt, 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
|
+
let g = wt(n, d), v = wt(n, f);
|
|
114
|
+
return n === 10 && (d < 0 && (g = ut(g, -d)), f < 0 && (v = ut(v, -f))), s ? (t = g * o, e = v * 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 Ot(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(Ot(t), Ot(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,45 +146,45 @@ function Ee(t) {
|
|
|
146
146
|
function at(t) {
|
|
147
147
|
t._min = null, t._max = null;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function xe(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 : xt)(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 : xt)(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 = xe(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 : xt, 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 = xe(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
|
-
function
|
|
187
|
+
function _(t, e, n, s) {
|
|
188
188
|
const o = Xe(t, e);
|
|
189
189
|
let i;
|
|
190
190
|
return e.ori === G.Horizontal ? i = e.dir === K.Forward ? o : 1 - o : i = e.dir === K.Forward ? 1 - o : o, s + i * n;
|
|
@@ -238,22 +238,22 @@ class Ue {
|
|
|
238
238
|
if (!d || !d.auto) continue;
|
|
239
239
|
const f = e[c];
|
|
240
240
|
if (!f || f.x.length === 0) continue;
|
|
241
|
-
const g = f.x[0],
|
|
242
|
-
if (g == null ||
|
|
243
|
-
const
|
|
244
|
-
|
|
241
|
+
const g = f.x[0], v = f.x[f.x.length - 1];
|
|
242
|
+
if (g == null || v == null) continue;
|
|
243
|
+
const x = n.get(u);
|
|
244
|
+
x ? (x.dataMin = Math.min(x.dataMin, g), x.dataMax = Math.max(x.dataMax, v)) : n.set(u, { dataMin: g, dataMax: v });
|
|
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,
|
|
250
|
+
const [g, v] = 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
|
-
f.min = g, f.max =
|
|
254
|
+
f.min = g, f.max = v;
|
|
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,60 +267,60 @@ 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,
|
|
270
|
+
var r, a, c, u, d, f, g, v, x, L, h, I;
|
|
271
271
|
const o = /* @__PURE__ */ new Map();
|
|
272
|
-
for (const [
|
|
273
|
-
const T = this.scales.get(
|
|
272
|
+
for (const [P, D] of this.groupXScales) {
|
|
273
|
+
const T = this.scales.get(D);
|
|
274
274
|
if (!T || !T.auto) continue;
|
|
275
|
-
const
|
|
276
|
-
if (!
|
|
277
|
-
const
|
|
278
|
-
if (
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
for (const [
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
285
|
-
if (
|
|
286
|
-
const [
|
|
287
|
-
min: { pad: ((r =
|
|
288
|
-
max: { pad: ((u =
|
|
275
|
+
const M = e[P];
|
|
276
|
+
if (!M || M.x.length === 0) continue;
|
|
277
|
+
const S = M.x[0], b = M.x[M.x.length - 1];
|
|
278
|
+
if (S == null || b == null) continue;
|
|
279
|
+
const C = o.get(D);
|
|
280
|
+
C ? (C.dataMin = Math.min(C.dataMin, S), C.dataMax = Math.max(C.dataMax, b)) : o.set(D, { dataMin: S, dataMax: b });
|
|
281
|
+
}
|
|
282
|
+
for (const [P, { dataMin: D, dataMax: T }] of o) {
|
|
283
|
+
const M = this.scales.get(P);
|
|
284
|
+
if (M) {
|
|
285
|
+
if (M.range) {
|
|
286
|
+
const [S, b] = bt(D, T, {
|
|
287
|
+
min: { pad: ((r = M.range.min) == null ? void 0 : r.pad) ?? 0, soft: ((a = M.range.min) == null ? void 0 : a.soft) ?? null, mode: ((c = M.range.min) == null ? void 0 : c.mode) ?? 0 },
|
|
288
|
+
max: { pad: ((u = M.range.max) == null ? void 0 : u.pad) ?? 0, soft: ((d = M.range.max) == null ? void 0 : d.soft) ?? null, mode: ((f = M.range.max) == null ? void 0 : f.mode) ?? 0 }
|
|
289
289
|
});
|
|
290
|
-
|
|
290
|
+
M.min = S, M.max = b;
|
|
291
291
|
} else
|
|
292
|
-
|
|
292
|
+
D === T ? [M.min, M.max] = bt(D, T, {
|
|
293
293
|
min: { pad: 0.1, soft: null, mode: 0 },
|
|
294
294
|
max: { pad: 0.1, soft: null, mode: 0 }
|
|
295
|
-
}) : (
|
|
296
|
-
at(
|
|
295
|
+
}) : (M.min = D, M.max = T);
|
|
296
|
+
at(M);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
300
|
-
for (const { group:
|
|
301
|
-
const
|
|
302
|
-
if (!
|
|
303
|
-
const
|
|
304
|
-
if (!
|
|
305
|
-
const
|
|
306
|
-
i.set(T,
|
|
307
|
-
}
|
|
308
|
-
for (const [
|
|
309
|
-
const T = this.scales.get(
|
|
300
|
+
for (const { group: P, index: D, yScale: T } of n) {
|
|
301
|
+
const M = e[P];
|
|
302
|
+
if (!M) continue;
|
|
303
|
+
const S = M.series[D];
|
|
304
|
+
if (!S || S.length === 0) continue;
|
|
305
|
+
const b = s.windows.get(P), C = b ? b[0] : 0, z = b ? b[1] : S.length - 1, p = this.scales.get(T), m = (p == null ? void 0 : p.distr) === N.Log, [w, y] = s.getCachedMinMax(P, D, C, z, 0, m), k = i.get(T), A = l.get(T);
|
|
306
|
+
i.set(T, k != null ? Math.min(k, w) : w), l.set(T, A != null ? Math.max(A, y) : y);
|
|
307
|
+
}
|
|
308
|
+
for (const [P, D] of i) {
|
|
309
|
+
const T = this.scales.get(P);
|
|
310
310
|
if (!T || !T.auto) continue;
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
313
|
-
let
|
|
314
|
-
if (T.distr ===
|
|
315
|
-
[
|
|
311
|
+
const M = l.get(P) ?? -Z;
|
|
312
|
+
if (D === Z) continue;
|
|
313
|
+
let S, b;
|
|
314
|
+
if (T.distr === N.Log)
|
|
315
|
+
[S, b] = Be(D, M, T.log, !1);
|
|
316
316
|
else {
|
|
317
|
-
const
|
|
318
|
-
[
|
|
319
|
-
min: { pad: ((g =
|
|
320
|
-
max: { pad: ((
|
|
317
|
+
const C = T.range ?? { min: lt, max: lt };
|
|
318
|
+
[S, b] = bt(D, M, {
|
|
319
|
+
min: { pad: ((g = C.min) == null ? void 0 : g.pad) ?? lt.pad, soft: ((v = C.min) == null ? void 0 : v.soft) ?? lt.soft, mode: ((x = C.min) == null ? void 0 : x.mode) ?? lt.mode },
|
|
320
|
+
max: { pad: ((L = C.max) == null ? void 0 : L.pad) ?? lt.pad, soft: ((h = C.max) == null ? void 0 : h.soft) ?? lt.soft, mode: ((I = C.max) == null ? void 0 : I.mode) ?? lt.mode }
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
-
T.min =
|
|
323
|
+
T.min = S, T.max = b, at(T);
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
}
|
|
@@ -363,8 +363,8 @@ class Ne {
|
|
|
363
363
|
g != null && (g < l && (l = g), g > r && (r = g));
|
|
364
364
|
}
|
|
365
365
|
for (let f = a + 1; f < c; f++) {
|
|
366
|
-
const g = i[f * 2] ?? 1 / 0,
|
|
367
|
-
g < l && (l = g),
|
|
366
|
+
const g = i[f * 2] ?? 1 / 0, v = i[f * 2 + 1] ?? -1 / 0;
|
|
367
|
+
g < l && (l = g), v > r && (r = v);
|
|
368
368
|
}
|
|
369
369
|
const d = c * o;
|
|
370
370
|
for (let f = d; f <= n; f++) {
|
|
@@ -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
|
}
|
|
@@ -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,
|
|
@@ -558,36 +558,36 @@ class je {
|
|
|
558
558
|
this.state.left = e, this.state.top = n;
|
|
559
559
|
let c = 1 / 0, u = -1, d = -1, f = -1;
|
|
560
560
|
const g = /* @__PURE__ */ new Map();
|
|
561
|
-
for (const
|
|
562
|
-
if (
|
|
563
|
-
let
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
for (let
|
|
567
|
-
const
|
|
568
|
-
if (
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
571
|
-
const h = a(
|
|
561
|
+
for (const v of i) {
|
|
562
|
+
if (v.show === !1) continue;
|
|
563
|
+
let x = g.get(v.group);
|
|
564
|
+
x == null && (x = [], g.set(v.group, x)), x.push(v);
|
|
565
|
+
}
|
|
566
|
+
for (let v = 0; v < o.length; v++) {
|
|
567
|
+
const x = o[v];
|
|
568
|
+
if (x == null) continue;
|
|
569
|
+
const L = x.x;
|
|
570
|
+
if (L.length === 0) continue;
|
|
571
|
+
const h = a(v);
|
|
572
572
|
if (h == null) continue;
|
|
573
|
-
const
|
|
574
|
-
if (
|
|
575
|
-
const [
|
|
576
|
-
|
|
573
|
+
const I = l(h);
|
|
574
|
+
if (I == null || I.min == null || I.max == null) continue;
|
|
575
|
+
const [P, D] = r(v), T = s.width, M = s.left, S = it(e + M, I, T, M), b = ct(S, L, P, D), C = [b];
|
|
576
|
+
b > P && C.push(b - 1), b < D && C.push(b + 1);
|
|
577
577
|
const z = /* @__PURE__ */ new Map();
|
|
578
|
-
for (const p of
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
581
|
-
const
|
|
582
|
-
for (const
|
|
583
|
-
const
|
|
584
|
-
if (
|
|
585
|
-
const A =
|
|
578
|
+
for (const p of C) {
|
|
579
|
+
const m = L[p];
|
|
580
|
+
if (m == null) continue;
|
|
581
|
+
const w = _(m, I, T, M);
|
|
582
|
+
for (const y of g.get(v) ?? []) {
|
|
583
|
+
const k = x.series[y.index];
|
|
584
|
+
if (k == null) continue;
|
|
585
|
+
const A = k[p];
|
|
586
586
|
if (A == null) continue;
|
|
587
|
-
let F = z.get(
|
|
588
|
-
if (F == null && !z.has(
|
|
589
|
-
const R = s.height,
|
|
590
|
-
if (j < c && (c = j, u =
|
|
587
|
+
let F = z.get(y.yScale);
|
|
588
|
+
if (F == null && !z.has(y.yScale) && (F = l(y.yScale), z.set(y.yScale, F)), F == null || F.min == null || F.max == null) continue;
|
|
589
|
+
const R = s.height, H = s.top, V = _(A, F, R, H), B = e + M - w, W = n + H - V, j = B * B + W * W;
|
|
590
|
+
if (j < c && (c = j, u = v, d = y.index, f = p, j === 0))
|
|
591
591
|
break;
|
|
592
592
|
}
|
|
593
593
|
if (c === 0) break;
|
|
@@ -610,25 +610,25 @@ class je {
|
|
|
610
610
|
if (l == null || l.min == null || l.max == null) return;
|
|
611
611
|
const [r, a] = n.dataStore.getWindow(0), c = ct(e, o.x, r, a), u = o.x[c];
|
|
612
612
|
if (u == null) return;
|
|
613
|
-
const d =
|
|
613
|
+
const d = _(u, l, n.plotBox.width, n.plotBox.left);
|
|
614
614
|
this.state.left = d - n.plotBox.left, this.state.activeGroup = 0, this.state.activeDataIdx = c;
|
|
615
615
|
let f = 0, g = n.plotBox.height / 2;
|
|
616
|
-
for (const
|
|
617
|
-
if (
|
|
618
|
-
const
|
|
619
|
-
if (
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
const h = n.scaleManager.getScale(
|
|
616
|
+
for (const v of n.seriesConfigs) {
|
|
617
|
+
if (v.group !== 0 || v.show === !1) continue;
|
|
618
|
+
const x = o.series[v.index];
|
|
619
|
+
if (x == null) continue;
|
|
620
|
+
const L = x[c];
|
|
621
|
+
if (L == null) continue;
|
|
622
|
+
const h = n.scaleManager.getScale(v.yScale);
|
|
623
623
|
if (!(h == null || h.min == null || h.max == null)) {
|
|
624
|
-
g =
|
|
624
|
+
g = _(L, h, n.plotBox.height, n.plotBox.top) - n.plotBox.top, f = v.index;
|
|
625
625
|
break;
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
628
|
this.state.top = g, this.state.activeSeriesIdx = f;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
class
|
|
631
|
+
class Ze {
|
|
632
632
|
constructor() {
|
|
633
633
|
this.flags = tt.None, this.frameId = null, this.callback = null;
|
|
634
634
|
}
|
|
@@ -672,7 +672,7 @@ class qe {
|
|
|
672
672
|
function Rt(t, e, n) {
|
|
673
673
|
t.lineTo(e, n);
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Ht(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
|
|
705
|
+
const Oe = Se(Rt), Je = Se(Ht);
|
|
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,71 +714,71 @@ function Qe() {
|
|
|
714
714
|
band: null,
|
|
715
715
|
gaps: null
|
|
716
716
|
};
|
|
717
|
-
const
|
|
718
|
-
let h,
|
|
719
|
-
n.ori === G.Horizontal ? (h = Rt,
|
|
720
|
-
const
|
|
717
|
+
const x = (S) => d(_(S, n, o, l)), L = (S) => d(_(S, s, i, r));
|
|
718
|
+
let h, I;
|
|
719
|
+
n.ori === G.Horizontal ? (h = Rt, I = Oe) : (h = Ht, I = Je);
|
|
720
|
+
const P = {
|
|
721
721
|
stroke: new Path2D(),
|
|
722
722
|
fill: null,
|
|
723
723
|
clip: null,
|
|
724
724
|
band: null,
|
|
725
725
|
gaps: null
|
|
726
|
-
},
|
|
726
|
+
}, D = P.stroke;
|
|
727
727
|
let T = !1;
|
|
728
728
|
if (c - a >= o * 4) {
|
|
729
|
-
const
|
|
730
|
-
let
|
|
731
|
-
const
|
|
732
|
-
let
|
|
729
|
+
const S = (A) => it(A, n, o, l);
|
|
730
|
+
let b = null, C = 0, z = 0, p = 0, m = x(t[u === K.Forward ? a : c]);
|
|
731
|
+
const w = x(t[a]), y = x(t[c]);
|
|
732
|
+
let k = S(u === K.Forward ? w + 1 : y - 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], H = (u === K.Forward ? F < k : F > k) ? m : x(F), V = e[A];
|
|
735
|
+
H === m ? V != null ? (p = V, b == null ? (h(D, H, L(p)), z = b = C = p) : p < b ? b = p : p > C && (C = p)) : V === null && !g && (T = !0) : (b != null && I(D, m, L(b), L(C), L(z), L(p)), V != null ? (p = V, h(D, H, L(p)), b = C = z = p) : (b = null, C = 0, V === null && !g && (T = !0)), m = H, k = S(m + u));
|
|
736
736
|
}
|
|
737
|
-
|
|
737
|
+
b != null && (b !== C ? I(D, m, L(b), L(C), L(z), L(p)) : h(D, m, L(p)));
|
|
738
738
|
} else
|
|
739
|
-
for (let
|
|
740
|
-
const
|
|
741
|
-
|
|
739
|
+
for (let S = u === K.Forward ? a : c; S >= a && S <= c; S += u) {
|
|
740
|
+
const b = e[S];
|
|
741
|
+
b === null && !g ? T = !0 : b != null && h(D, x(t[S]), L(b));
|
|
742
742
|
}
|
|
743
743
|
{
|
|
744
|
-
const
|
|
744
|
+
const S = P.fill = new Path2D(D), b = (f == null ? void 0 : f.fillTo) ?? s.min ?? 0, C = L(b);
|
|
745
745
|
let z = l, p = l + o;
|
|
746
|
-
u === K.Backward && ([p, z] = [z, p]), h(
|
|
746
|
+
u === K.Backward && ([p, z] = [z, p]), h(S, p, C), h(S, z, C);
|
|
747
747
|
}
|
|
748
748
|
if (T) {
|
|
749
|
-
const
|
|
750
|
-
|
|
749
|
+
const S = Xt(t, e, a, c, u, x);
|
|
750
|
+
P.gaps = S, P.clip = Yt(S, n.ori, l, r, o, i);
|
|
751
751
|
}
|
|
752
|
-
return
|
|
752
|
+
return P;
|
|
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
|
-
const g = d.next,
|
|
872
|
-
if (
|
|
873
|
-
const
|
|
874
|
-
|
|
871
|
+
const g = d.next, v = this.pathCache.get(d.group);
|
|
872
|
+
if (v != null) {
|
|
873
|
+
const x = v.get(d.index);
|
|
874
|
+
x != null && (x.delete(d.key), this.pathCacheSize--, x.size === 0 && v.delete(d.index), v.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 = (x) => $(x), g = e.config.fillTo, v = 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,
|
|
@@ -958,7 +958,7 @@ class sn {
|
|
|
958
958
|
a,
|
|
959
959
|
d,
|
|
960
960
|
f,
|
|
961
|
-
{ fillTo:
|
|
961
|
+
{ fillTo: v, spanGaps: e.config.spanGaps }
|
|
962
962
|
), this.setCachedPaths(i, l, r, a, c);
|
|
963
963
|
}
|
|
964
964
|
en(o, e.config, c, s, n);
|
|
@@ -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
|
|
988
|
-
return t.map((e) =>
|
|
987
|
+
function ee(t) {
|
|
988
|
+
return t.map((e) => Me(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 : xt)(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 : xt;
|
|
1009
1009
|
return t.map((s) => {
|
|
1010
1010
|
if (s === 0) return !0;
|
|
1011
1011
|
if (s < 0) return !1;
|
|
@@ -1014,13 +1014,13 @@ function cn(t, e) {
|
|
|
1014
1014
|
});
|
|
1015
1015
|
}
|
|
1016
1016
|
function un(t, e) {
|
|
1017
|
-
const s =
|
|
1017
|
+
const s = Me(Math.max(Math.abs(t), Math.abs(e))).length * 7;
|
|
1018
1018
|
return Math.max(50, s + 16);
|
|
1019
1019
|
}
|
|
1020
1020
|
function fn(t, e, n, s) {
|
|
1021
1021
|
if (s <= 0)
|
|
1022
1022
|
return [0, 0];
|
|
1023
|
-
const o =
|
|
1023
|
+
const o = Mt(t.side) === G.Vertical, i = t.space ?? (o ? 30 : un(e, n)), l = t.incrs ?? ft;
|
|
1024
1024
|
return We(e, n, l, s, i);
|
|
1025
1025
|
}
|
|
1026
1026
|
const hn = 50;
|
|
@@ -1029,7 +1029,7 @@ function dn(t, e, n) {
|
|
|
1029
1029
|
if (t.size != null)
|
|
1030
1030
|
return t.size;
|
|
1031
1031
|
const s = ((r = t.ticks) == null ? void 0 : r.show) !== !1 ? ((a = t.ticks) == null ? void 0 : a.size) ?? 10 : 0, o = t.gap ?? 5, i = 12;
|
|
1032
|
-
if (
|
|
1032
|
+
if (Mt(t.side) === G.Vertical && e != null) {
|
|
1033
1033
|
let c = 0;
|
|
1034
1034
|
for (const d of e)
|
|
1035
1035
|
d.length > c && (c = d.length);
|
|
@@ -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);
|
|
@@ -1176,46 +1176,46 @@ function In(t, e, n, s, o) {
|
|
|
1176
1176
|
continue;
|
|
1177
1177
|
} else
|
|
1178
1178
|
l._show || (i = !1, l._show = !0);
|
|
1179
|
-
const c = r.side, d =
|
|
1180
|
-
let
|
|
1179
|
+
const c = r.side, d = Mt(c) === G.Horizontal ? n : s, { min: f, max: g } = a;
|
|
1180
|
+
let v, x;
|
|
1181
1181
|
if (a.time) {
|
|
1182
1182
|
const h = r.space ?? 80;
|
|
1183
|
-
[
|
|
1183
|
+
[v, x] = Cn(f, g, pn, d, h);
|
|
1184
1184
|
} else
|
|
1185
|
-
[
|
|
1186
|
-
if (l._incr =
|
|
1185
|
+
[v, x] = fn(r, f, g, d);
|
|
1186
|
+
if (l._incr = v, l._space = x, x === 0)
|
|
1187
1187
|
continue;
|
|
1188
1188
|
if (r.splits)
|
|
1189
|
-
l._splits = r.splits(f, g,
|
|
1189
|
+
l._splits = r.splits(f, g, v, x);
|
|
1190
1190
|
else if (a.time)
|
|
1191
|
-
l._splits = mn(f, g,
|
|
1192
|
-
else if (a.distr ===
|
|
1191
|
+
l._splits = mn(f, g, v);
|
|
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,
|
|
1195
|
+
const h = a.distr === N.Ordinal;
|
|
1196
|
+
l._splits = rn(f, g, v, x, h);
|
|
1197
1197
|
}
|
|
1198
1198
|
if (r.values)
|
|
1199
|
-
l._values = r.values(l._splits,
|
|
1199
|
+
l._values = r.values(l._splits, x, v);
|
|
1200
1200
|
else if (a.time)
|
|
1201
|
-
l._values = kn(l._splits,
|
|
1202
|
-
else if (a.distr ===
|
|
1203
|
-
const h = cn(l._splits, a.log),
|
|
1204
|
-
l._values =
|
|
1201
|
+
l._values = kn(l._splits, v);
|
|
1202
|
+
else if (a.distr === N.Log) {
|
|
1203
|
+
const h = cn(l._splits, a.log), I = ee(l._splits);
|
|
1204
|
+
l._values = I.map((P, D) => h[D] ? P : "");
|
|
1205
1205
|
} else
|
|
1206
|
-
l._values =
|
|
1206
|
+
l._values = ee(l._splits);
|
|
1207
1207
|
l._rotate = c === U.Bottom ? r.rotate ?? 0 : 0;
|
|
1208
|
-
const
|
|
1209
|
-
l._size = Tt(dn(r, l._values)),
|
|
1208
|
+
const L = l._size;
|
|
1209
|
+
l._size = Tt(dn(r, l._values)), L !== 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)
|
|
1217
1217
|
continue;
|
|
1218
|
-
const a = r.config.side, c =
|
|
1218
|
+
const a = r.config.side, c = Mt(a) === G.Vertical, u = r.config.label != null ? r.config.labelSize ?? 20 : 0, d = r._size + u;
|
|
1219
1219
|
d > 0 && (c ? (s -= d, a === U.Left && (i += d)) : (o -= d, a === U.Top && (l += d)));
|
|
1220
1220
|
}
|
|
1221
1221
|
return {
|
|
@@ -1267,81 +1267,81 @@ 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,
|
|
1282
|
-
const
|
|
1283
|
-
s === G.Horizontal ? (g = i,
|
|
1281
|
+
let f = 0, g = 0, v = 0, x = 0;
|
|
1282
|
+
const L = i + (o === U.Top || o === U.Left ? -l : l);
|
|
1283
|
+
s === G.Horizontal ? (g = i, x = L) : (f = i, v = L);
|
|
1284
1284
|
for (let h = 0; h < e.length; h++)
|
|
1285
|
-
n[h] != null && (s === G.Horizontal ? f =
|
|
1285
|
+
n[h] != null && (s === G.Horizontal ? f = v = e[h] ?? 0 : g = x = e[h] ?? 0, t.moveTo(f, g), t.lineTo(v, x));
|
|
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)
|
|
1292
1292
|
continue;
|
|
1293
|
-
const u = c.config, d = u.side, f =
|
|
1293
|
+
const u = c.config, d = u.side, f = Mt(d), g = n(u.scale);
|
|
1294
1294
|
if (!g || g.min == null || g.max == null)
|
|
1295
1295
|
continue;
|
|
1296
|
-
const
|
|
1297
|
-
if (!
|
|
1296
|
+
const v = u.stroke ?? "#000", x = d === U.Top || d === U.Left ? -1 : 1, L = c._splits, h = c._values;
|
|
1297
|
+
if (!L || !h || c._space === 0)
|
|
1298
1298
|
continue;
|
|
1299
|
-
const
|
|
1300
|
-
if ((
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1299
|
+
const I = f === G.Horizontal ? s.width : s.height, P = f === G.Horizontal ? s.left : s.top, D = L.map((C) => $(_(C, g, I, P) * o)), T = h.map((C) => C === "" ? null : C), M = u.grid;
|
|
1300
|
+
if ((M == null ? void 0 : M.show) !== !1) {
|
|
1301
|
+
const C = (M == null ? void 0 : M.stroke) ?? "rgba(0,0,0,0.12)", z = $(((M == null ? void 0 : M.width) ?? 2) * o), p = ((M == null ? void 0 : M.dash) ?? []).map((y) => y * o), m = f === G.Horizontal ? l : i, w = f === G.Horizontal ? a : r;
|
|
1302
|
+
re(t, D, T, f, 2, m, w, z, C, p);
|
|
1303
1303
|
}
|
|
1304
|
-
const
|
|
1305
|
-
if ((
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1304
|
+
const S = u.ticks;
|
|
1305
|
+
if ((S == null ? void 0 : S.show) !== !1) {
|
|
1306
|
+
const C = (S == null ? void 0 : S.stroke) ?? v, z = $(((S == null ? void 0 : S.width) ?? 1) * o), p = $(((S == null ? void 0 : S.size) ?? 10) * o), m = ((S == null ? void 0 : S.dash) ?? []).map((y) => y * o), w = $(c._pos * o);
|
|
1307
|
+
re(t, D, T, f, d, w, p, z, C, m);
|
|
1308
1308
|
}
|
|
1309
1309
|
{
|
|
1310
|
-
const
|
|
1311
|
-
t.font =
|
|
1312
|
-
const F = c._rotate * -
|
|
1310
|
+
const C = (S == null ? void 0 : S.show) !== !1 ? ((S == null ? void 0 : S.size) ?? 10) * o : 0, z = $((u.gap ?? 5) * o), p = $(c._pos * o), m = (C + z) * x, w = p + m, y = ie(u.font ?? "12px system-ui, sans-serif", o), k = f === G.Horizontal ? "center" : d === U.Left ? Dn : Ln, A = f === G.Horizontal ? d === U.Bottom ? oe : le : "middle";
|
|
1311
|
+
t.font = y, t.fillStyle = v, t.textAlign = k, t.textBaseline = A;
|
|
1312
|
+
const F = c._rotate * -_t / 180;
|
|
1313
1313
|
if (F !== 0) {
|
|
1314
|
-
const R = Math.cos(F),
|
|
1314
|
+
const R = Math.cos(F), H = 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
|
-
const W =
|
|
1320
|
-
t.setTransform(R,
|
|
1319
|
+
const W = D[V] ?? 0;
|
|
1320
|
+
t.setTransform(R, H, -H, R, W, w), t.fillText(B, 0, 0);
|
|
1321
1321
|
}
|
|
1322
1322
|
t.setTransform(1, 0, 0, 1, 0, 0);
|
|
1323
1323
|
} else
|
|
1324
1324
|
for (let R = 0; R < h.length; R++) {
|
|
1325
|
-
const
|
|
1326
|
-
if (
|
|
1325
|
+
const H = h[R];
|
|
1326
|
+
if (H == null || H === "")
|
|
1327
1327
|
continue;
|
|
1328
|
-
const V =
|
|
1329
|
-
t.fillText(
|
|
1328
|
+
const V = D[R] ?? 0, B = f === G.Horizontal ? V : w, W = f === G.Horizontal ? w : V;
|
|
1329
|
+
t.fillText(H, B, W);
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
1332
|
if (u.label != null) {
|
|
1333
|
-
const
|
|
1334
|
-
t.font =
|
|
1335
|
-
const z = $((c._lpos + (u.labelGap ?? 0) *
|
|
1333
|
+
const C = ie(u.labelFont ?? "bold 12px system-ui, sans-serif", o);
|
|
1334
|
+
t.font = C, t.fillStyle = v, t.textAlign = "center", t.textBaseline = d === U.Bottom ? oe : le;
|
|
1335
|
+
const z = $((c._lpos + (u.labelGap ?? 0) * x) * o);
|
|
1336
1336
|
f === G.Vertical ? (t.save(), t.translate(
|
|
1337
1337
|
z,
|
|
1338
1338
|
$(l + a / 2)
|
|
1339
|
-
), t.rotate((d === U.Left ? -
|
|
1339
|
+
), t.rotate((d === U.Left ? -_t : _t) / 2), t.fillText(u.label, 0, 0), t.restore()) : t.fillText(u.label, $(i + r / 2), z);
|
|
1340
1340
|
}
|
|
1341
|
-
const
|
|
1342
|
-
if ((
|
|
1343
|
-
const
|
|
1344
|
-
t.strokeStyle =
|
|
1341
|
+
const b = u.border;
|
|
1342
|
+
if ((b == null ? void 0 : b.show) !== !1 && b != null) {
|
|
1343
|
+
const C = b.stroke ?? v, z = $((b.width ?? 1) * o), p = (b.dash ?? []).map((w) => w * o), m = $(c._pos * o);
|
|
1344
|
+
t.strokeStyle = C, t.lineWidth = z, p.length > 0 && t.setLineDash(p), t.beginPath(), f === G.Horizontal ? (t.moveTo(i, m), t.lineTo(i + r, m)) : (t.moveTo(m, l), t.lineTo(m, l + a)), t.stroke(), p.length > 0 && t.setLineDash([]);
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
1347
|
}
|
|
@@ -1353,27 +1353,27 @@ const Fn = {
|
|
|
1353
1353
|
showX: !0,
|
|
1354
1354
|
showY: !0
|
|
1355
1355
|
};
|
|
1356
|
-
function
|
|
1357
|
-
var
|
|
1356
|
+
function ae(t, e, n, s, o, i, l, r, a) {
|
|
1357
|
+
var P;
|
|
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),
|
|
1360
|
-
if (t.save(), t.strokeStyle = c.stroke, t.lineWidth =
|
|
1361
|
-
const
|
|
1362
|
-
if (
|
|
1363
|
-
const
|
|
1364
|
-
if (
|
|
1365
|
-
let p = c.stroke,
|
|
1366
|
-
for (const
|
|
1367
|
-
if (
|
|
1368
|
-
const
|
|
1369
|
-
p = (typeof
|
|
1359
|
+
const c = { ...Fn, ...a }, u = s, d = $(n.left * u), f = $(n.top * u), g = $(n.width * u), v = $(n.height * u), x = $(c.width * u), L = x % 2 / 2, h = $((n.left + e.left) * u) + L, I = $((n.top + e.top) * u) + L;
|
|
1360
|
+
if (t.save(), t.strokeStyle = c.stroke, t.lineWidth = x, t.setLineDash(c.dash.map((D) => D * u)), c.showX && (t.beginPath(), t.moveTo(h, f), t.lineTo(h, f + v), t.stroke()), c.showY && (t.beginPath(), t.moveTo(d, I), t.lineTo(d + g, I), t.stroke()), t.setLineDash([]), e.activeGroup >= 0 && e.activeDataIdx >= 0) {
|
|
1361
|
+
const D = e.activeGroup, T = e.activeSeriesIdx, M = e.activeDataIdx, S = o[D];
|
|
1362
|
+
if (S != null && T >= 0 && T < S.series.length && M < S.x.length) {
|
|
1363
|
+
const b = S.x[M], C = S.series[T], z = C != null ? C[M] : null;
|
|
1364
|
+
if (b != null && z != null) {
|
|
1365
|
+
let p = c.stroke, m = !0;
|
|
1366
|
+
for (const w of i)
|
|
1367
|
+
if (w.group === D && w.index === T) {
|
|
1368
|
+
const y = w.stroke;
|
|
1369
|
+
p = (typeof y == "string" ? y : void 0) ?? c.stroke, m = ((P = w.cursor) == null ? void 0 : P.show) !== !1;
|
|
1370
1370
|
break;
|
|
1371
1371
|
}
|
|
1372
|
-
if (
|
|
1373
|
-
const
|
|
1374
|
-
if (
|
|
1375
|
-
const F = $(
|
|
1376
|
-
t.beginPath(), t.arc(F, R,
|
|
1372
|
+
if (m) {
|
|
1373
|
+
const w = r(D), y = w != null ? l(w) : void 0, k = Rn(i, D, T), A = k != null ? l(k) : void 0;
|
|
1374
|
+
if (y != null && A != null && y.min != null && y.max != null && A.min != null && A.max != null) {
|
|
1375
|
+
const F = $(_(b, y, n.width, n.left) * u), R = $(_(z, A, n.height, n.top) * u), H = c.pointRadius * u, V = $(2 * u);
|
|
1376
|
+
t.beginPath(), t.arc(F, R, H, 0, Math.PI * 2), t.fillStyle = "#fff", t.fill(), t.strokeStyle = p, t.lineWidth = V, t.stroke();
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
@@ -1386,30 +1386,30 @@ function Rn(t, e, n) {
|
|
|
1386
1386
|
if (s.group === e && s.index === n)
|
|
1387
1387
|
return s.yScale;
|
|
1388
1388
|
}
|
|
1389
|
-
const
|
|
1389
|
+
const Hn = {
|
|
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 = { ...Hn, ...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,
|
|
1401
|
-
t.save(), t.strokeStyle =
|
|
1402
|
-
for (let
|
|
1403
|
-
const h = n[
|
|
1400
|
+
const f = u / 2 * l, g = Math.max(1, $(u * 0.2)) * l, v = (c == null ? void 0 : c.stroke) ?? d, x = (c == null ? void 0 : c.fill) ?? "#fff";
|
|
1401
|
+
t.save(), t.strokeStyle = v, t.fillStyle = x, t.lineWidth = g, (c == null ? void 0 : c.dash) != null && t.setLineDash(c.dash.map((L) => L * l));
|
|
1402
|
+
for (let L = r; L <= a; L++) {
|
|
1403
|
+
const h = n[L];
|
|
1404
1404
|
if (h == null) continue;
|
|
1405
|
-
const
|
|
1406
|
-
if (
|
|
1407
|
-
const
|
|
1408
|
-
t.beginPath(), t.arc(
|
|
1405
|
+
const I = e[L];
|
|
1406
|
+
if (I == null) continue;
|
|
1407
|
+
const P = $(_(I, s, i.width, i.left) * l), D = $(_(h, o, i.height, i.top) * l);
|
|
1408
|
+
t.beginPath(), t.arc(P, D, f, 0, Math.PI * 2), t.fill(), t.stroke();
|
|
1409
1409
|
}
|
|
1410
1410
|
t.restore();
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function _n(t, e, n, s, o, i, l) {
|
|
1413
1413
|
if (typeof t == "function")
|
|
1414
1414
|
return t(e, n, s, o, i);
|
|
1415
1415
|
if (t === !0) return !0;
|
|
@@ -1419,18 +1419,18 @@ function Hn(t, e, n, s, o, i, l) {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
function Vn(t, e, n, s, o, i, l, r, a) {
|
|
1421
1421
|
if (r > a || r < 0) return null;
|
|
1422
|
-
const c = (g) =>
|
|
1422
|
+
const c = (g) => _(g, s, i.width, i.left) * l, u = (g) => _(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
|
|
1426
|
-
if (
|
|
1427
|
-
const
|
|
1428
|
-
f ? d.lineTo(
|
|
1425
|
+
const v = e[g], x = t[g];
|
|
1426
|
+
if (v == null || x == null) continue;
|
|
1427
|
+
const L = c(x), h = u(v);
|
|
1428
|
+
f ? d.lineTo(L, h) : (d.moveTo(L, h), f = !0);
|
|
1429
1429
|
}
|
|
1430
1430
|
if (!f) return null;
|
|
1431
1431
|
for (let g = a; g >= r; g--) {
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1432
|
+
const v = n[g], x = t[g];
|
|
1433
|
+
v == null || x == null || d.lineTo(c(x), u(v));
|
|
1434
1434
|
}
|
|
1435
1435
|
return d.closePath(), d;
|
|
1436
1436
|
}
|
|
@@ -1440,18 +1440,18 @@ function $n(t, e, n) {
|
|
|
1440
1440
|
function $t(t, e, n, s) {
|
|
1441
1441
|
return { ctx: t, plotBox: e, pxRatio: n, getScale: s, valToX: (l, r = "x") => {
|
|
1442
1442
|
const a = s(r);
|
|
1443
|
-
return a == null || a.min == null || a.max == null ? null :
|
|
1443
|
+
return a == null || a.min == null || a.max == null ? null : _(l, a, e.width, e.left);
|
|
1444
1444
|
}, valToY: (l, r) => {
|
|
1445
1445
|
const a = s(r);
|
|
1446
|
-
return a == null || a.min == null || a.max == null ? null :
|
|
1446
|
+
return a == null || a.min == null || a.max == null ? null : _(l, a, e.height, e.top);
|
|
1447
1447
|
} };
|
|
1448
1448
|
}
|
|
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 Ze(),
|
|
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,14 +1527,14 @@ 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
|
-
for (const
|
|
1533
|
+
for (const I of t.cursorDrawHooks)
|
|
1534
1534
|
try {
|
|
1535
|
-
|
|
1536
|
-
} catch (
|
|
1537
|
-
console.warn("[uPlot+] draw hook error:",
|
|
1535
|
+
I(h, t.cursorManager.state);
|
|
1536
|
+
} catch (P) {
|
|
1537
|
+
console.warn("[uPlot+] draw hook error:", P);
|
|
1538
1538
|
}
|
|
1539
1539
|
u.restore();
|
|
1540
1540
|
}
|
|
@@ -1542,64 +1542,64 @@ function Bn() {
|
|
|
1542
1542
|
return;
|
|
1543
1543
|
}
|
|
1544
1544
|
e.autoRangeX(n.data), n.updateWindows((h) => {
|
|
1545
|
-
const
|
|
1546
|
-
return
|
|
1545
|
+
const I = e.getGroupXScaleKey(h);
|
|
1546
|
+
return I != null ? e.getScale(I) : void 0;
|
|
1547
1547
|
});
|
|
1548
|
-
const
|
|
1548
|
+
const v = o.map((h) => ({
|
|
1549
1549
|
group: h.group,
|
|
1550
1550
|
index: h.index,
|
|
1551
1551
|
yScale: h.yScale
|
|
1552
1552
|
}));
|
|
1553
|
-
e.autoRange(n.data,
|
|
1553
|
+
e.autoRange(n.data, v, n), Wn(t), t.axisStates.length > 0 ? t.plotBox = Pn(i, l, t.axisStates, g) : t.plotBox = {
|
|
1554
1554
|
left: 10,
|
|
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 x = [];
|
|
1560
1560
|
for (const h of o) {
|
|
1561
|
-
const
|
|
1562
|
-
|
|
1561
|
+
const I = e.getGroupXScaleKey(h.group), P = I != null ? e.getScale(I) : void 0, D = e.getScale(h.yScale);
|
|
1562
|
+
P == null || D == null || x.push({
|
|
1563
1563
|
config: h,
|
|
1564
1564
|
dataX: n.getXValues(h.group),
|
|
1565
1565
|
dataY: n.getYValues(h.group, h.index),
|
|
1566
|
-
xScale:
|
|
1567
|
-
yScale:
|
|
1566
|
+
xScale: P,
|
|
1567
|
+
yScale: D,
|
|
1568
1568
|
window: n.getWindow(h.group)
|
|
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
|
|
1574
|
-
|
|
1572
|
+
for (let h = 0; h < x.length; h++) {
|
|
1573
|
+
const I = x[h];
|
|
1574
|
+
I != null && (t.focusedSeries != null && h !== t.focusedSeries ? (u.globalAlpha = t.focusAlpha, s.drawSeries(I, t.plotBox, 1), u.globalAlpha = 1) : s.drawSeries(I, t.plotBox, 1));
|
|
1575
1575
|
}
|
|
1576
|
-
const
|
|
1576
|
+
const L = /* @__PURE__ */ new Map();
|
|
1577
1577
|
for (const h of o)
|
|
1578
|
-
|
|
1578
|
+
L.set(`${h.group}-${h.index}`, h);
|
|
1579
1579
|
for (const h of t.bandConfigs) {
|
|
1580
|
-
const
|
|
1581
|
-
if (
|
|
1582
|
-
const
|
|
1583
|
-
if (
|
|
1584
|
-
const [
|
|
1585
|
-
let p = s.getCachedBandPath(h.group,
|
|
1580
|
+
const I = e.getGroupXScaleKey(h.group), P = I != null ? e.getScale(I) : void 0, D = L.get(`${h.group}-${h.series[0]}`), T = L.get(`${h.group}-${h.series[1]}`);
|
|
1581
|
+
if (P == null || D == null || T == null) continue;
|
|
1582
|
+
const M = e.getScale(D.yScale);
|
|
1583
|
+
if (M == null) continue;
|
|
1584
|
+
const [S, b] = n.getWindow(h.group), C = h.series[0], z = h.series[1];
|
|
1585
|
+
let p = s.getCachedBandPath(h.group, C, z, S, b);
|
|
1586
1586
|
p == null && (p = Vn(
|
|
1587
1587
|
n.getXValues(h.group),
|
|
1588
|
-
n.getYValues(h.group,
|
|
1588
|
+
n.getYValues(h.group, C),
|
|
1589
1589
|
n.getYValues(h.group, z),
|
|
1590
|
-
|
|
1591
|
-
|
|
1590
|
+
P,
|
|
1591
|
+
M,
|
|
1592
1592
|
t.plotBox,
|
|
1593
1593
|
r,
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
) ?? void 0, p != null && s.setCachedBandPath(h.group,
|
|
1594
|
+
S,
|
|
1595
|
+
b
|
|
1596
|
+
) ?? void 0, p != null && s.setCachedBandPath(h.group, C, z, S, b, p)), p != null && $n(u, h, p);
|
|
1597
1597
|
}
|
|
1598
|
-
for (const h of
|
|
1599
|
-
const
|
|
1600
|
-
if (
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1598
|
+
for (const h of x) {
|
|
1599
|
+
const I = h.config;
|
|
1600
|
+
if (I.show === !1) continue;
|
|
1601
|
+
const P = I.points, D = I.width ?? 1, T = (P == null ? void 0 : P.size) ?? 3 + D * 2, M = (P == null ? void 0 : P.space) ?? T * 2, [S, b] = h.window;
|
|
1602
|
+
_n(P == null ? void 0 : P.show, I.group, I.index, S, b, t.plotBox.width, M) && Gn(
|
|
1603
1603
|
u,
|
|
1604
1604
|
h.dataX,
|
|
1605
1605
|
h.dataY,
|
|
@@ -1607,11 +1607,11 @@ function Bn() {
|
|
|
1607
1607
|
h.yScale,
|
|
1608
1608
|
t.plotBox,
|
|
1609
1609
|
r,
|
|
1610
|
-
m,
|
|
1611
1610
|
S,
|
|
1612
|
-
|
|
1611
|
+
b,
|
|
1612
|
+
P,
|
|
1613
1613
|
T,
|
|
1614
|
-
(typeof
|
|
1614
|
+
(typeof I.stroke == "string" ? I.stroke : null) ?? "#000"
|
|
1615
1615
|
);
|
|
1616
1616
|
}
|
|
1617
1617
|
if (u.restore(), t.drawHooks.size > 0) {
|
|
@@ -1622,11 +1622,11 @@ function Bn() {
|
|
|
1622
1622
|
t.plotBox.height * r
|
|
1623
1623
|
), u.clip(), u.scale(r, r);
|
|
1624
1624
|
const h = $t(u, t.plotBox, r, g);
|
|
1625
|
-
for (const
|
|
1625
|
+
for (const I of t.drawHooks)
|
|
1626
1626
|
try {
|
|
1627
|
-
|
|
1628
|
-
} catch (
|
|
1629
|
-
console.warn("[uPlot+] draw hook error:",
|
|
1627
|
+
I(h);
|
|
1628
|
+
} catch (P) {
|
|
1629
|
+
console.warn("[uPlot+] draw hook error:", P);
|
|
1630
1630
|
}
|
|
1631
1631
|
u.restore();
|
|
1632
1632
|
}
|
|
@@ -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,14 +1648,14 @@ 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
|
-
for (const
|
|
1654
|
+
for (const I of t.cursorDrawHooks)
|
|
1655
1655
|
try {
|
|
1656
|
-
|
|
1657
|
-
} catch (
|
|
1658
|
-
console.warn("[uPlot+] draw hook error:",
|
|
1656
|
+
I(h, t.cursorManager.state);
|
|
1657
|
+
} catch (P) {
|
|
1658
|
+
console.warn("[uPlot+] draw hook error:", P);
|
|
1659
1659
|
}
|
|
1660
1660
|
u.restore();
|
|
1661
1661
|
}
|
|
@@ -1663,12 +1663,12 @@ function Bn() {
|
|
|
1663
1663
|
if (t._prevScaleRanges.size > 0 && t.eventCallbacks.onScaleChange != null)
|
|
1664
1664
|
for (const h of e.getAllScales()) {
|
|
1665
1665
|
if (h.min == null || h.max == null) continue;
|
|
1666
|
-
const
|
|
1667
|
-
if (
|
|
1666
|
+
const I = t._prevScaleRanges.get(h.id);
|
|
1667
|
+
if (I == null || I.min !== h.min || I.max !== h.max)
|
|
1668
1668
|
try {
|
|
1669
1669
|
t.eventCallbacks.onScaleChange(h.id, h.min, h.max);
|
|
1670
|
-
} catch (
|
|
1671
|
-
console.warn("[uPlot+] event callback error:",
|
|
1670
|
+
} catch (P) {
|
|
1671
|
+
console.warn("[uPlot+] event callback error:", P);
|
|
1672
1672
|
}
|
|
1673
1673
|
}
|
|
1674
1674
|
t._prevScaleRanges.clear();
|
|
@@ -1688,12 +1688,12 @@ function Wn(t) {
|
|
|
1688
1688
|
});
|
|
1689
1689
|
}
|
|
1690
1690
|
function En() {
|
|
1691
|
-
const t =
|
|
1691
|
+
const t = E(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,102 +1709,102 @@ 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
|
|
1713
|
-
return { cx:
|
|
1712
|
+
const m = e.getBoundingClientRect(), w = t.plotBox, y = p.clientX - m.left - w.left, k = p.clientY - m.top - w.top;
|
|
1713
|
+
return { cx: y, cy: k };
|
|
1714
1714
|
}
|
|
1715
|
-
function a(p,
|
|
1716
|
-
const
|
|
1717
|
-
return p >= 0 && p <=
|
|
1715
|
+
function a(p, m) {
|
|
1716
|
+
const w = t.plotBox;
|
|
1717
|
+
return p >= 0 && p <= w.width && m >= 0 && m <= w.height;
|
|
1718
1718
|
}
|
|
1719
|
-
function c(p,
|
|
1720
|
-
const
|
|
1719
|
+
function c(p, m) {
|
|
1720
|
+
const w = e.getBoundingClientRect(), y = p - w.left, k = m - w.top, A = t.plotBox;
|
|
1721
1721
|
for (const F of t.axisStates) {
|
|
1722
|
-
const R = F.config,
|
|
1722
|
+
const R = F.config, H = R.side;
|
|
1723
1723
|
if (F._size <= 0) continue;
|
|
1724
|
-
const B =
|
|
1725
|
-
if (
|
|
1726
|
-
const
|
|
1727
|
-
return { scaleId: R.scale, ori:
|
|
1724
|
+
const B = k >= A.top && k <= A.top + A.height, W = y >= A.left && y <= A.left + A.width;
|
|
1725
|
+
if (H === U.Left && y < A.left && B || H === U.Right && y > A.left + A.width && B || H === U.Top && k < A.top && W || H === U.Bottom && k > A.top + A.height && W) {
|
|
1726
|
+
const O = Mt(H);
|
|
1727
|
+
return { scaleId: R.scale, ori: O };
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
1730
1730
|
return null;
|
|
1731
1731
|
}
|
|
1732
|
-
function u(p,
|
|
1733
|
-
const
|
|
1734
|
-
let
|
|
1735
|
-
if (
|
|
1736
|
-
const A = t.dataStore.data[
|
|
1732
|
+
function u(p, m, w) {
|
|
1733
|
+
const y = t.cursorManager.state;
|
|
1734
|
+
let k = null;
|
|
1735
|
+
if (y.activeGroup >= 0 && y.activeDataIdx >= 0) {
|
|
1736
|
+
const A = t.dataStore.data[y.activeGroup];
|
|
1737
1737
|
if (A != null) {
|
|
1738
|
-
const F = A.x[
|
|
1739
|
-
if (F != null &&
|
|
1740
|
-
const V = t.plotBox, B = t.scaleManager.getGroupXScaleKey(
|
|
1741
|
-
(jt) => jt.group ===
|
|
1742
|
-
),
|
|
1743
|
-
let pt =
|
|
1744
|
-
(W == null ? void 0 : W.min) != null && W.max != null && (pt =
|
|
1745
|
-
const
|
|
1746
|
-
|
|
1747
|
-
group:
|
|
1748
|
-
seriesIdx:
|
|
1749
|
-
dataIdx:
|
|
1738
|
+
const F = A.x[y.activeDataIdx], R = A.series[y.activeSeriesIdx], H = R != null ? R[y.activeDataIdx] : void 0;
|
|
1739
|
+
if (F != null && H != null) {
|
|
1740
|
+
const V = t.plotBox, B = t.scaleManager.getGroupXScaleKey(y.activeGroup), W = B != null ? t.scaleManager.getScale(B) : void 0, j = t.seriesConfigs.find(
|
|
1741
|
+
(jt) => jt.group === y.activeGroup && jt.index === y.activeSeriesIdx
|
|
1742
|
+
), O = j != null ? t.scaleManager.getScale(j.yScale) : void 0;
|
|
1743
|
+
let pt = m, Gt = w;
|
|
1744
|
+
(W == null ? void 0 : W.min) != null && W.max != null && (pt = _(F, W, V.width, V.left) - V.left), (O == null ? void 0 : O.min) != null && O.max != null && (Gt = _(H, O, V.height, V.top) - V.top);
|
|
1745
|
+
const Kt = m - pt, Nt = w - Gt;
|
|
1746
|
+
k = {
|
|
1747
|
+
group: y.activeGroup,
|
|
1748
|
+
seriesIdx: y.activeSeriesIdx,
|
|
1749
|
+
dataIdx: y.activeDataIdx,
|
|
1750
1750
|
xVal: F,
|
|
1751
|
-
yVal:
|
|
1751
|
+
yVal: H,
|
|
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:
|
|
1759
|
+
return { plotX: m, plotY: w, point: k, srcEvent: p };
|
|
1760
1760
|
}
|
|
1761
1761
|
function d(p) {
|
|
1762
|
-
const
|
|
1762
|
+
const m = t.plotBox, w = p.left / m.width, y = (p.left + p.width) / m.width, k = {};
|
|
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(
|
|
1766
|
-
|
|
1766
|
+
m.left + w * m.width,
|
|
1767
1767
|
A,
|
|
1768
|
-
|
|
1769
|
-
|
|
1768
|
+
m.width,
|
|
1769
|
+
m.left
|
|
1770
1770
|
), R = it(
|
|
1771
|
-
|
|
1771
|
+
m.left + y * m.width,
|
|
1772
1772
|
A,
|
|
1773
|
-
|
|
1774
|
-
|
|
1773
|
+
m.width,
|
|
1774
|
+
m.left
|
|
1775
1775
|
);
|
|
1776
|
-
|
|
1776
|
+
k[A.id] = {
|
|
1777
1777
|
min: Math.min(F, R),
|
|
1778
1778
|
max: Math.max(F, R)
|
|
1779
1779
|
};
|
|
1780
1780
|
}
|
|
1781
|
-
return { left:
|
|
1781
|
+
return { left: w, right: y, ranges: k };
|
|
1782
1782
|
}
|
|
1783
1783
|
function f() {
|
|
1784
1784
|
const p = t.eventCallbacks.onScaleChange;
|
|
1785
1785
|
if (p != null)
|
|
1786
|
-
for (const
|
|
1787
|
-
if (
|
|
1788
|
-
const
|
|
1789
|
-
(
|
|
1786
|
+
for (const m of t.scaleManager.getAllScales()) {
|
|
1787
|
+
if (m.min == null || m.max == null) continue;
|
|
1788
|
+
const w = t._prevScaleRanges.get(m.id);
|
|
1789
|
+
(w == null || w.min !== m.min || w.max !== m.max) && p(m.id, m.min, m.max);
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
|
-
function g(p,
|
|
1792
|
+
function g(p, m) {
|
|
1793
1793
|
if (i != null) {
|
|
1794
|
-
const A = e.getBoundingClientRect(), F = p.clientY - A.top, R = t.plotBox,
|
|
1795
|
-
B != null && (B.min = i.startMin +
|
|
1794
|
+
const A = e.getBoundingClientRect(), F = p.clientY - A.top, R = t.plotBox, H = (F - i.startY) / R.height, V = i.startMax - i.startMin, B = t.scaleManager.getScale(i.scaleId);
|
|
1795
|
+
B != null && (B.min = i.startMin + H * V, B.max = i.startMax + H * V, B.auto = !1, at(B), t.renderer.clearCache(), t.scheduleRedraw());
|
|
1796
1796
|
return;
|
|
1797
1797
|
}
|
|
1798
|
-
const
|
|
1799
|
-
if (
|
|
1800
|
-
const { cx:
|
|
1801
|
-
if (!a(
|
|
1798
|
+
const w = r(p);
|
|
1799
|
+
if (w == null) return;
|
|
1800
|
+
const { cx: y, cy: k } = w;
|
|
1801
|
+
if (!a(y, k) && 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
|
+
y,
|
|
1806
1807
|
k,
|
|
1807
|
-
D,
|
|
1808
1808
|
t.plotBox,
|
|
1809
1809
|
t.dataStore.data,
|
|
1810
1810
|
t.seriesConfigs,
|
|
@@ -1820,41 +1820,41 @@ function Yn(t, e) {
|
|
|
1820
1820
|
F >= 0 && t.focusedSeries !== F && (t.focusedSeries = F, t.scheduleRedraw());
|
|
1821
1821
|
}
|
|
1822
1822
|
}
|
|
1823
|
-
if (
|
|
1823
|
+
if (m != null && t.eventCallbacks.onCursorMove != null && a(y, k))
|
|
1824
1824
|
try {
|
|
1825
|
-
t.eventCallbacks.onCursorMove(u(
|
|
1825
|
+
t.eventCallbacks.onCursorMove(u(m, y, k));
|
|
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, R = Math.max(0, Math.min(
|
|
1830
|
+
const A = n.x, F = t.plotBox, R = Math.max(0, Math.min(y, F.width));
|
|
1831
1831
|
s.show = !0, s.left = Math.min(A, R), s.top = 0, s.width = Math.abs(R - 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
|
-
function
|
|
1835
|
+
function v(p) {
|
|
1836
1836
|
g(p, p);
|
|
1837
1837
|
}
|
|
1838
|
-
function
|
|
1838
|
+
function x(p) {
|
|
1839
1839
|
if (p.button !== 0) return;
|
|
1840
|
-
const
|
|
1841
|
-
if (
|
|
1842
|
-
const
|
|
1843
|
-
if (
|
|
1844
|
-
const
|
|
1840
|
+
const m = c(p.clientX, p.clientY);
|
|
1841
|
+
if (m != null && m.ori === G.Vertical) {
|
|
1842
|
+
const y = t.scaleManager.getScale(m.scaleId);
|
|
1843
|
+
if (y != null && y.min != null && y.max != null) {
|
|
1844
|
+
const k = e.getBoundingClientRect();
|
|
1845
1845
|
i = {
|
|
1846
|
-
scaleId:
|
|
1847
|
-
startY: p.clientY -
|
|
1848
|
-
startMin:
|
|
1849
|
-
startMax:
|
|
1846
|
+
scaleId: m.scaleId,
|
|
1847
|
+
startY: p.clientY - k.top,
|
|
1848
|
+
startMin: y.min,
|
|
1849
|
+
startMax: y.max
|
|
1850
1850
|
}, p.preventDefault();
|
|
1851
1851
|
return;
|
|
1852
1852
|
}
|
|
1853
1853
|
}
|
|
1854
|
-
const
|
|
1855
|
-
|
|
1854
|
+
const w = r(p);
|
|
1855
|
+
w != null && a(w.cx, w.cy) && (n = { x: w.cx, y: w.cy }, l = !1, s.show = !1, s.left = 0, s.width = 0, t.selectState = s);
|
|
1856
1856
|
}
|
|
1857
|
-
function
|
|
1857
|
+
function L(p) {
|
|
1858
1858
|
if (i != null) {
|
|
1859
1859
|
f(), i = null;
|
|
1860
1860
|
return;
|
|
@@ -1862,151 +1862,151 @@ function Yn(t, e) {
|
|
|
1862
1862
|
if (n != null) {
|
|
1863
1863
|
if (s.width > 5) {
|
|
1864
1864
|
l = !0;
|
|
1865
|
-
let
|
|
1865
|
+
let m = !0;
|
|
1866
1866
|
if (t.eventCallbacks.onSelect != null) {
|
|
1867
|
-
const
|
|
1868
|
-
let
|
|
1867
|
+
const w = d(s);
|
|
1868
|
+
let y;
|
|
1869
1869
|
try {
|
|
1870
|
-
|
|
1871
|
-
} catch (
|
|
1872
|
-
console.warn("[uPlot+] event callback error:",
|
|
1870
|
+
y = t.eventCallbacks.onSelect(w);
|
|
1871
|
+
} catch (k) {
|
|
1872
|
+
console.warn("[uPlot+] event callback error:", k);
|
|
1873
1873
|
}
|
|
1874
|
-
|
|
1874
|
+
y === !1 && (m = !1);
|
|
1875
1875
|
}
|
|
1876
|
-
|
|
1876
|
+
m && (S(s), f());
|
|
1877
1877
|
}
|
|
1878
1878
|
n = null, s.show = !1, s.left = 0, s.width = 0, t.selectState = s, t.scheduleRedraw();
|
|
1879
1879
|
}
|
|
1880
1880
|
}
|
|
1881
1881
|
function h(p) {
|
|
1882
|
-
|
|
1882
|
+
L();
|
|
1883
1883
|
}
|
|
1884
|
-
function
|
|
1884
|
+
function I(p) {
|
|
1885
1885
|
if (l) {
|
|
1886
1886
|
l = !1;
|
|
1887
1887
|
return;
|
|
1888
1888
|
}
|
|
1889
|
-
const
|
|
1890
|
-
if (
|
|
1891
|
-
const
|
|
1892
|
-
if (
|
|
1889
|
+
const m = t.eventCallbacks.onClick;
|
|
1890
|
+
if (m == null) return;
|
|
1891
|
+
const w = r(p);
|
|
1892
|
+
if (w != null && a(w.cx, w.cy))
|
|
1893
1893
|
try {
|
|
1894
|
-
|
|
1895
|
-
} catch (
|
|
1896
|
-
console.warn("[uPlot+] event callback error:",
|
|
1894
|
+
m(u(p, w.cx, w.cy));
|
|
1895
|
+
} catch (y) {
|
|
1896
|
+
console.warn("[uPlot+] event callback error:", y);
|
|
1897
1897
|
}
|
|
1898
1898
|
}
|
|
1899
|
-
function
|
|
1900
|
-
const
|
|
1901
|
-
if (
|
|
1902
|
-
const
|
|
1903
|
-
if (
|
|
1899
|
+
function P(p) {
|
|
1900
|
+
const m = t.eventCallbacks.onContextMenu;
|
|
1901
|
+
if (m == null) return;
|
|
1902
|
+
const w = r(p);
|
|
1903
|
+
if (w != null && a(w.cx, w.cy)) {
|
|
1904
1904
|
p.preventDefault();
|
|
1905
1905
|
try {
|
|
1906
|
-
|
|
1907
|
-
} catch (
|
|
1908
|
-
console.warn("[uPlot+] event callback error:",
|
|
1906
|
+
m(u(p, w.cx, w.cy));
|
|
1907
|
+
} catch (y) {
|
|
1908
|
+
console.warn("[uPlot+] event callback error:", y);
|
|
1909
1909
|
}
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
|
-
function
|
|
1913
|
-
var
|
|
1912
|
+
function D(p) {
|
|
1913
|
+
var m, w;
|
|
1914
1914
|
t.cursorManager.hide(), t.focusedSeries != null && t.setFocus(null), n != null && (n = null, s.show = !1, s.width = 0, t.selectState = s), i != null && (i = null), t.scheduleCursorRedraw();
|
|
1915
1915
|
try {
|
|
1916
|
-
(
|
|
1917
|
-
} catch (
|
|
1918
|
-
console.warn("[uPlot+] event callback error:",
|
|
1916
|
+
(w = (m = t.eventCallbacks).onCursorLeave) == null || w.call(m);
|
|
1917
|
+
} catch (y) {
|
|
1918
|
+
console.warn("[uPlot+] event callback error:", y);
|
|
1919
1919
|
}
|
|
1920
1920
|
}
|
|
1921
1921
|
function T(p) {
|
|
1922
1922
|
if (t.eventCallbacks.onDblClick != null) {
|
|
1923
|
-
const
|
|
1924
|
-
if (
|
|
1925
|
-
let
|
|
1923
|
+
const m = r(p);
|
|
1924
|
+
if (m != null && a(m.cx, m.cy)) {
|
|
1925
|
+
let w;
|
|
1926
1926
|
try {
|
|
1927
|
-
|
|
1928
|
-
} catch (
|
|
1929
|
-
console.warn("[uPlot+] event callback error:",
|
|
1927
|
+
w = t.eventCallbacks.onDblClick(u(p, m.cx, m.cy));
|
|
1928
|
+
} catch (y) {
|
|
1929
|
+
console.warn("[uPlot+] event callback error:", y);
|
|
1930
1930
|
}
|
|
1931
|
-
if (
|
|
1931
|
+
if (w === !1)
|
|
1932
1932
|
return;
|
|
1933
1933
|
}
|
|
1934
1934
|
}
|
|
1935
|
-
for (const
|
|
1936
|
-
t.scaleManager.addScale(
|
|
1935
|
+
for (const m of t.scaleConfigs)
|
|
1936
|
+
t.scaleManager.addScale(m);
|
|
1937
1937
|
t.renderer.clearCache(), t.scheduleRedraw();
|
|
1938
1938
|
}
|
|
1939
|
-
function
|
|
1939
|
+
function M(p) {
|
|
1940
1940
|
if (!t.wheelZoom) return;
|
|
1941
|
-
const
|
|
1942
|
-
if (
|
|
1941
|
+
const m = r(p);
|
|
1942
|
+
if (m == null || !a(m.cx, m.cy)) return;
|
|
1943
1943
|
p.preventDefault();
|
|
1944
|
-
const
|
|
1945
|
-
for (const
|
|
1946
|
-
if (
|
|
1947
|
-
const A = it(
|
|
1948
|
-
|
|
1944
|
+
const w = Math.max(0.1, Math.min(10, 1 - p.deltaY * 1e-3)), y = t.plotBox;
|
|
1945
|
+
for (const k of t.scaleManager.getAllScales()) {
|
|
1946
|
+
if (k.ori !== G.Horizontal || k.min == null || k.max == null) continue;
|
|
1947
|
+
const A = it(m.cx + y.left, k, y.width, y.left), F = A - (A - k.min) * w, R = A + (k.max - A) * w;
|
|
1948
|
+
k.min = Math.min(F, R), k.max = Math.max(F, R), k.auto = !1, at(k);
|
|
1949
1949
|
}
|
|
1950
1950
|
t.renderer.clearCache(), t.scheduleRedraw(), f();
|
|
1951
1951
|
}
|
|
1952
|
-
function
|
|
1953
|
-
const
|
|
1954
|
-
for (const
|
|
1955
|
-
if (
|
|
1952
|
+
function S(p) {
|
|
1953
|
+
const m = t.plotBox, w = p.left / m.width, y = (p.left + p.width) / m.width;
|
|
1954
|
+
for (const k of t.scaleManager.getAllScales()) {
|
|
1955
|
+
if (k.ori !== G.Horizontal || k.min == null || k.max == null) continue;
|
|
1956
1956
|
const A = it(
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1957
|
+
m.left + w * m.width,
|
|
1958
|
+
k,
|
|
1959
|
+
m.width,
|
|
1960
|
+
m.left
|
|
1961
1961
|
), F = it(
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1962
|
+
m.left + y * m.width,
|
|
1963
|
+
k,
|
|
1964
|
+
m.width,
|
|
1965
|
+
m.left
|
|
1966
1966
|
);
|
|
1967
|
-
|
|
1967
|
+
k.min = Math.min(A, F), k.max = Math.max(A, F), k.auto = !1, at(k);
|
|
1968
1968
|
}
|
|
1969
1969
|
t.renderer.clearCache();
|
|
1970
1970
|
}
|
|
1971
|
-
function
|
|
1971
|
+
function b(p) {
|
|
1972
1972
|
if (p.touches.length === 2) {
|
|
1973
|
-
const
|
|
1973
|
+
const y = p.touches[0], k = p.touches[1], A = k.clientX - y.clientX, F = k.clientY - y.clientY;
|
|
1974
1974
|
o = {
|
|
1975
1975
|
dist: Math.sqrt(A * A + F * F),
|
|
1976
|
-
midX: (
|
|
1977
|
-
midY: (
|
|
1976
|
+
midX: (y.clientX + k.clientX) / 2,
|
|
1977
|
+
midY: (y.clientY + k.clientY) / 2
|
|
1978
1978
|
}, n = null;
|
|
1979
1979
|
return;
|
|
1980
1980
|
}
|
|
1981
|
-
const
|
|
1982
|
-
if (
|
|
1983
|
-
const
|
|
1984
|
-
|
|
1981
|
+
const m = p.touches[0];
|
|
1982
|
+
if (m == null) return;
|
|
1983
|
+
const w = r(m);
|
|
1984
|
+
w != null && a(w.cx, w.cy) && (n = { x: w.cx, y: w.cy }, l = !1);
|
|
1985
1985
|
}
|
|
1986
|
-
function
|
|
1986
|
+
function C(p) {
|
|
1987
1987
|
if (p.touches.length === 2 && o != null) {
|
|
1988
1988
|
p.preventDefault();
|
|
1989
|
-
const
|
|
1989
|
+
const w = p.touches[0], y = p.touches[1], k = y.clientX - w.clientX, A = y.clientY - w.clientY, F = Math.sqrt(k * k + A * A), R = F / o.dist, H = e.getBoundingClientRect(), V = t.plotBox, B = o.midX - H.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),
|
|
1993
|
-
W.min = Math.min(
|
|
1992
|
+
const j = it(B + V.left, W, V.width, V.left), O = j - (j - W.min) / R, pt = j + (W.max - j) / R;
|
|
1993
|
+
W.min = Math.min(O, pt), W.max = Math.max(O, pt), W.auto = !1, at(W);
|
|
1994
1994
|
}
|
|
1995
1995
|
o.dist = F, t.renderer.clearCache(), t.scheduleRedraw(), f();
|
|
1996
1996
|
return;
|
|
1997
1997
|
}
|
|
1998
|
-
const
|
|
1999
|
-
|
|
1998
|
+
const m = p.touches[0];
|
|
1999
|
+
m != null && (g(m, p), n != null && p.preventDefault());
|
|
2000
2000
|
}
|
|
2001
2001
|
function z(p) {
|
|
2002
2002
|
if (o != null) {
|
|
2003
2003
|
o = null;
|
|
2004
2004
|
return;
|
|
2005
2005
|
}
|
|
2006
|
-
p.changedTouches[0] != null &&
|
|
2006
|
+
p.changedTouches[0] != null && L();
|
|
2007
2007
|
}
|
|
2008
|
-
return e.addEventListener("mousemove",
|
|
2009
|
-
e.removeEventListener("mousemove",
|
|
2008
|
+
return e.addEventListener("mousemove", v), e.addEventListener("mousedown", x), e.addEventListener("mouseup", h), e.addEventListener("click", I), e.addEventListener("contextmenu", P), e.addEventListener("mouseleave", D), e.addEventListener("dblclick", T), e.addEventListener("wheel", M, { passive: !1 }), e.addEventListener("touchstart", b, { passive: !0 }), e.addEventListener("touchmove", C, { passive: !1 }), e.addEventListener("touchend", z), () => {
|
|
2009
|
+
e.removeEventListener("mousemove", v), e.removeEventListener("mousedown", x), e.removeEventListener("mouseup", h), e.removeEventListener("click", I), e.removeEventListener("contextmenu", P), e.removeEventListener("mouseleave", D), e.removeEventListener("dblclick", T), e.removeEventListener("wheel", M), e.removeEventListener("touchstart", b), e.removeEventListener("touchmove", C), e.removeEventListener("touchend", z);
|
|
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,
|
|
@@ -2084,69 +2084,69 @@ function Ut({
|
|
|
2084
2084
|
onContextMenu: d,
|
|
2085
2085
|
onDblClick: f,
|
|
2086
2086
|
onCursorMove: g,
|
|
2087
|
-
onCursorLeave:
|
|
2088
|
-
onScaleChange:
|
|
2089
|
-
onSelect:
|
|
2087
|
+
onCursorLeave: v,
|
|
2088
|
+
onScaleChange: x,
|
|
2089
|
+
onSelect: L
|
|
2090
2090
|
}) {
|
|
2091
|
-
var
|
|
2092
|
-
const h = En(), [
|
|
2091
|
+
var m;
|
|
2092
|
+
const h = En(), [I, P] = St(null), D = i ?? (typeof window < "u" && window.devicePixelRatio || 1), T = (c == null ? void 0 : c.wheelZoom) ?? !1, M = ((m = c == null ? void 0 : c.focus) == null ? void 0 : m.alpha) ?? ((c == null ? void 0 : c.focus) != null ? 0.15 : 1);
|
|
2093
2093
|
Y(() => {
|
|
2094
|
-
h.wheelZoom = T, h.focusAlpha =
|
|
2095
|
-
}, [h, T,
|
|
2096
|
-
const
|
|
2097
|
-
h.canvas =
|
|
2098
|
-
}, [h]),
|
|
2099
|
-
|
|
2094
|
+
h.wheelZoom = T, h.focusAlpha = M;
|
|
2095
|
+
}, [h, T, M]), h.eventCallbacks.onClick = u, h.eventCallbacks.onContextMenu = d, h.eventCallbacks.onDblClick = f, h.eventCallbacks.onCursorMove = g, h.eventCallbacks.onCursorLeave = v, h.eventCallbacks.onScaleChange = x, h.eventCallbacks.onSelect = L, Xn(h, I), Nn(h, a);
|
|
2096
|
+
const S = q((w) => {
|
|
2097
|
+
h.canvas = w, w && h.scheduleRedraw();
|
|
2098
|
+
}, [h]), b = q((w) => {
|
|
2099
|
+
P(w);
|
|
2100
2100
|
}, []);
|
|
2101
2101
|
Y(() => {
|
|
2102
|
-
h.pxRatio =
|
|
2103
|
-
}, [h, t, e,
|
|
2102
|
+
h.pxRatio = D, h.setSize(t, e);
|
|
2103
|
+
}, [h, t, e, D]), Y(() => () => {
|
|
2104
2104
|
h.canvas = null, h.scheduler.cancel(), h.focusedSeries = null;
|
|
2105
2105
|
}, [h]), Y(() => {
|
|
2106
|
-
if (
|
|
2107
|
-
const
|
|
2108
|
-
const
|
|
2109
|
-
if (
|
|
2110
|
-
const { width: A, height: F } =
|
|
2106
|
+
if (I == null || typeof ResizeObserver > "u") return;
|
|
2107
|
+
const w = new ResizeObserver((y) => {
|
|
2108
|
+
const k = y[0];
|
|
2109
|
+
if (k == null) return;
|
|
2110
|
+
const { width: A, height: F } = k.contentRect;
|
|
2111
2111
|
A > 0 && F > 0 && (A !== h.width || F !== h.height) && h.setSize(Math.round(A), Math.round(F));
|
|
2112
2112
|
});
|
|
2113
|
-
return
|
|
2114
|
-
|
|
2113
|
+
return w.observe(I), () => {
|
|
2114
|
+
w.disconnect();
|
|
2115
2115
|
};
|
|
2116
|
-
}, [h,
|
|
2117
|
-
const
|
|
2116
|
+
}, [h, I]);
|
|
2117
|
+
const C = E(n);
|
|
2118
2118
|
Y(() => {
|
|
2119
|
-
if (n ===
|
|
2120
|
-
|
|
2121
|
-
const
|
|
2122
|
-
h.scaleManager.getScale(
|
|
2123
|
-
id:
|
|
2119
|
+
if (n === C.current && h.dataStore.data.length > 0) return;
|
|
2120
|
+
C.current = n, h.dataStore.setData(n), h.renderer.clearCache();
|
|
2121
|
+
const w = "x";
|
|
2122
|
+
h.scaleManager.getScale(w) || h.registerScale({
|
|
2123
|
+
id: w,
|
|
2124
2124
|
auto: !0
|
|
2125
2125
|
});
|
|
2126
|
-
for (let
|
|
2127
|
-
h.scaleManager.setGroupXScale(
|
|
2126
|
+
for (let y = 0; y < n.length; y++)
|
|
2127
|
+
h.scaleManager.setGroupXScale(y, w);
|
|
2128
2128
|
h.scheduleRedraw();
|
|
2129
2129
|
}, [h, n]);
|
|
2130
|
-
const z =
|
|
2130
|
+
const z = E(l);
|
|
2131
2131
|
z.current = l, Y(() => {
|
|
2132
|
-
const
|
|
2133
|
-
var
|
|
2134
|
-
(
|
|
2132
|
+
const w = (y) => {
|
|
2133
|
+
var k;
|
|
2134
|
+
(k = z.current) == null || k.call(z, y);
|
|
2135
2135
|
};
|
|
2136
|
-
return h.drawHooks.add(
|
|
2137
|
-
h.drawHooks.delete(
|
|
2136
|
+
return h.drawHooks.add(w), () => {
|
|
2137
|
+
h.drawHooks.delete(w);
|
|
2138
2138
|
};
|
|
2139
2139
|
}, [h]);
|
|
2140
|
-
const p =
|
|
2140
|
+
const p = E(r);
|
|
2141
2141
|
return p.current = r, Y(() => {
|
|
2142
|
-
const
|
|
2142
|
+
const w = (y, k) => {
|
|
2143
2143
|
var A;
|
|
2144
|
-
(A = p.current) == null || A.call(p,
|
|
2144
|
+
(A = p.current) == null || A.call(p, y, k);
|
|
2145
2145
|
};
|
|
2146
|
-
return h.cursorDrawHooks.add(
|
|
2147
|
-
h.cursorDrawHooks.delete(
|
|
2146
|
+
return h.cursorDrawHooks.add(w), () => {
|
|
2147
|
+
h.cursorDrawHooks.delete(w);
|
|
2148
2148
|
};
|
|
2149
|
-
}, [h]), /* @__PURE__ */
|
|
2149
|
+
}, [h]), /* @__PURE__ */ X(ke.Provider, { value: h, children: /* @__PURE__ */ Q(
|
|
2150
2150
|
"div",
|
|
2151
2151
|
{
|
|
2152
2152
|
className: o,
|
|
@@ -2157,10 +2157,10 @@ function Ut({
|
|
|
2157
2157
|
width: `${t}px`
|
|
2158
2158
|
},
|
|
2159
2159
|
children: [
|
|
2160
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ X(
|
|
2161
2161
|
"div",
|
|
2162
2162
|
{
|
|
2163
|
-
ref:
|
|
2163
|
+
ref: b,
|
|
2164
2164
|
style: {
|
|
2165
2165
|
position: "relative",
|
|
2166
2166
|
width: `${t}px`,
|
|
@@ -2168,10 +2168,10 @@ function Ut({
|
|
|
2168
2168
|
cursor: "crosshair",
|
|
2169
2169
|
order: 0
|
|
2170
2170
|
},
|
|
2171
|
-
children: /* @__PURE__ */
|
|
2171
|
+
children: /* @__PURE__ */ X(
|
|
2172
2172
|
"canvas",
|
|
2173
2173
|
{
|
|
2174
|
-
ref:
|
|
2174
|
+
ref: S,
|
|
2175
2175
|
style: {
|
|
2176
2176
|
position: "absolute",
|
|
2177
2177
|
left: 0,
|
|
@@ -2186,65 +2186,65 @@ 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
|
}
|
|
2211
2211
|
return !0;
|
|
2212
2212
|
}
|
|
2213
2213
|
function Lt(t) {
|
|
2214
|
-
const e = ot(), n =
|
|
2214
|
+
const e = ot(), n = E(t);
|
|
2215
2215
|
n.current = t, Y(() => {
|
|
2216
2216
|
const o = n.current;
|
|
2217
2217
|
return e.registerScale({ ...o }), e.scheduleRedraw(), () => {
|
|
2218
2218
|
e.unregisterScale(o.id), e.scheduleRedraw();
|
|
2219
2219
|
};
|
|
2220
2220
|
}, [e, t.id]);
|
|
2221
|
-
const s =
|
|
2221
|
+
const s = E(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) {
|
|
2229
|
-
const e = ot(), n =
|
|
2229
|
+
const e = ot(), n = E(t);
|
|
2230
2230
|
n.current = t, Y(() => {
|
|
2231
2231
|
const o = n.current;
|
|
2232
2232
|
return e.registerSeries({ ...o, show: o.show ?? !0 }), e.renderer.clearCache(), e.scheduleRedraw(), () => {
|
|
2233
2233
|
e.unregisterSeries(o.group, o.index), e.renderer.clearCache(), e.scheduleRedraw();
|
|
2234
2234
|
};
|
|
2235
2235
|
}, [e, t.group, t.index]);
|
|
2236
|
-
const s =
|
|
2236
|
+
const s = E(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 = E(n);
|
|
2248
2248
|
s.current = n, Y(() => {
|
|
2249
2249
|
const i = s.current;
|
|
2250
2250
|
return e.axisConfigs = e.axisConfigs.filter(
|
|
@@ -2255,15 +2255,15 @@ function zt(t) {
|
|
|
2255
2255
|
), e.scheduleRedraw();
|
|
2256
2256
|
};
|
|
2257
2257
|
}, [e, n.scale, n.side]);
|
|
2258
|
-
const o =
|
|
2258
|
+
const o = E(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;
|
|
2264
2264
|
}
|
|
2265
|
-
function
|
|
2266
|
-
const o = ot(), i =
|
|
2265
|
+
function as({ series: t, group: e, fill: n, dir: s }) {
|
|
2266
|
+
const o = ot(), i = E(null), l = t[0], r = t[1];
|
|
2267
2267
|
return Y(() => {
|
|
2268
2268
|
const a = { series: [l, r], group: e, fill: n, dir: s };
|
|
2269
2269
|
return i.current != null && (o.bandConfigs = o.bandConfigs.filter((c) => c !== i.current)), i.current = a, o.bandConfigs.push(a), o.scheduleRedraw(), () => {
|
|
@@ -2271,12 +2271,12 @@ 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 Zn = {
|
|
2275
2275
|
width: 12,
|
|
2276
2276
|
height: 3,
|
|
2277
2277
|
borderRadius: 1,
|
|
2278
2278
|
display: "inline-block"
|
|
2279
|
-
},
|
|
2279
|
+
}, On = { fontWeight: 600 }, Jn = {
|
|
2280
2280
|
display: "inline-flex",
|
|
2281
2281
|
alignItems: "center",
|
|
2282
2282
|
gap: 4,
|
|
@@ -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,27 +2294,27 @@ const qn = {
|
|
|
2294
2294
|
onClick: a,
|
|
2295
2295
|
style: { ...Jn, opacity: i ? 0.4 : 1 },
|
|
2296
2296
|
children: [
|
|
2297
|
-
/* @__PURE__ */
|
|
2298
|
-
/* @__PURE__ */
|
|
2299
|
-
l && /* @__PURE__ */
|
|
2297
|
+
/* @__PURE__ */ X("span", { style: { ...Zn, backgroundColor: o } }),
|
|
2298
|
+
/* @__PURE__ */ X("span", { children: s }),
|
|
2299
|
+
l && /* @__PURE__ */ X("span", { style: On, children: l })
|
|
2300
2300
|
]
|
|
2301
2301
|
}
|
|
2302
2302
|
);
|
|
2303
2303
|
});
|
|
2304
|
-
function
|
|
2305
|
-
const s = ot(), o =
|
|
2304
|
+
function cs({ show: t = !0, position: e = "bottom", className: n }) {
|
|
2305
|
+
const s = ot(), o = E({ activeGroup: -1, activeDataIdx: -1, seriesCount: 0, revision: -1 }), i = q(
|
|
2306
2306
|
(u) => s.subscribe(u),
|
|
2307
2307
|
[s]
|
|
2308
|
-
), l =
|
|
2309
|
-
const { activeGroup: u, activeDataIdx: d } = s.cursorManager.state, f = s.seriesConfigs.length, { revision: g } = s,
|
|
2310
|
-
if (
|
|
2311
|
-
return
|
|
2312
|
-
const
|
|
2313
|
-
return o.current =
|
|
2314
|
-
}, [s]), r =
|
|
2308
|
+
), l = q(() => {
|
|
2309
|
+
const { activeGroup: u, activeDataIdx: d } = s.cursorManager.state, f = s.seriesConfigs.length, { revision: g } = s, v = o.current;
|
|
2310
|
+
if (v.activeGroup === u && v.activeDataIdx === d && v.seriesCount === f && v.revision === g)
|
|
2311
|
+
return v;
|
|
2312
|
+
const x = { activeGroup: u, activeDataIdx: d, seriesCount: f, revision: g };
|
|
2313
|
+
return o.current = x, x;
|
|
2314
|
+
}, [s]), r = fe(i, l);
|
|
2315
2315
|
if (!t) return null;
|
|
2316
2316
|
const { activeGroup: a, activeDataIdx: c } = r;
|
|
2317
|
-
return /* @__PURE__ */
|
|
2317
|
+
return /* @__PURE__ */ X(
|
|
2318
2318
|
"div",
|
|
2319
2319
|
{
|
|
2320
2320
|
className: n,
|
|
@@ -2329,10 +2329,10 @@ function us({ show: t = !0, position: e = "bottom", className: n }) {
|
|
|
2329
2329
|
const d = typeof u.stroke == "string" ? u.stroke : "#000";
|
|
2330
2330
|
let f = "";
|
|
2331
2331
|
if (c >= 0 && a >= 0) {
|
|
2332
|
-
const
|
|
2333
|
-
|
|
2332
|
+
const v = s.dataStore.getYValues(u.group, u.index)[c];
|
|
2333
|
+
v != null && (f = typeof v == "number" ? v.toPrecision(4) : String(v));
|
|
2334
2334
|
}
|
|
2335
|
-
return /* @__PURE__ */
|
|
2335
|
+
return /* @__PURE__ */ X(
|
|
2336
2336
|
Qn,
|
|
2337
2337
|
{
|
|
2338
2338
|
group: u.group,
|
|
@@ -2349,74 +2349,62 @@ function us({ show: t = !0, position: e = "bottom", className: n }) {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
);
|
|
2351
2351
|
}
|
|
2352
|
-
|
|
2353
|
-
function fs({
|
|
2352
|
+
function us({
|
|
2354
2353
|
show: t = !0,
|
|
2355
2354
|
className: e,
|
|
2356
2355
|
children: n,
|
|
2357
2356
|
offset: s = {}
|
|
2358
2357
|
}) {
|
|
2359
|
-
|
|
2360
|
-
|
|
2358
|
+
var w, y;
|
|
2359
|
+
const o = ot(), i = E({ left: -10, top: -10, activeGroup: -1, activeDataIdx: -1, revision: -1 }), l = E(null), r = q(
|
|
2360
|
+
(k) => o.subscribe(k),
|
|
2361
2361
|
[o]
|
|
2362
|
-
),
|
|
2363
|
-
const
|
|
2364
|
-
if (
|
|
2365
|
-
return
|
|
2366
|
-
const
|
|
2367
|
-
left:
|
|
2368
|
-
top:
|
|
2369
|
-
activeGroup:
|
|
2370
|
-
activeDataIdx:
|
|
2371
|
-
revision:
|
|
2362
|
+
), a = q(() => {
|
|
2363
|
+
const k = o.cursorManager.state, { revision: A } = o, F = i.current;
|
|
2364
|
+
if (F.left === k.left && F.top === k.top && F.activeGroup === k.activeGroup && F.activeDataIdx === k.activeDataIdx && F.revision === A)
|
|
2365
|
+
return F;
|
|
2366
|
+
const R = {
|
|
2367
|
+
left: k.left,
|
|
2368
|
+
top: k.top,
|
|
2369
|
+
activeGroup: k.activeGroup,
|
|
2370
|
+
activeDataIdx: k.activeDataIdx,
|
|
2371
|
+
revision: A
|
|
2372
2372
|
};
|
|
2373
|
-
return i.current =
|
|
2374
|
-
}, [o]),
|
|
2375
|
-
if (!t ||
|
|
2376
|
-
const { activeGroup:
|
|
2377
|
-
for (const
|
|
2378
|
-
if (
|
|
2379
|
-
const
|
|
2380
|
-
|
|
2381
|
-
label:
|
|
2382
|
-
value:
|
|
2383
|
-
color: typeof
|
|
2384
|
-
group:
|
|
2385
|
-
index:
|
|
2373
|
+
return i.current = R, R;
|
|
2374
|
+
}, [o]), c = fe(r, a);
|
|
2375
|
+
if (!t || c.activeDataIdx < 0 || c.activeGroup < 0 || c.left < 0) return null;
|
|
2376
|
+
const { activeGroup: u, activeDataIdx: d } = c, f = o.plotBox, g = o.dataStore.data[u], v = g != null ? g.x[d] ?? null : null, x = v != null ? parseFloat(v.toPrecision(6)).toString() : "", L = [];
|
|
2377
|
+
for (const k of o.seriesConfigs) {
|
|
2378
|
+
if (k.show === !1) continue;
|
|
2379
|
+
const A = o.dataStore.getYValues(k.group, k.index), F = k.group === u ? A[d] : null;
|
|
2380
|
+
L.push({
|
|
2381
|
+
label: k.label ?? `Series ${k.index}`,
|
|
2382
|
+
value: F,
|
|
2383
|
+
color: typeof k.stroke == "string" ? k.stroke : "#000",
|
|
2384
|
+
group: k.group,
|
|
2385
|
+
index: k.index
|
|
2386
2386
|
});
|
|
2387
2387
|
}
|
|
2388
|
-
const
|
|
2389
|
-
x:
|
|
2390
|
-
xLabel:
|
|
2391
|
-
items:
|
|
2392
|
-
left:
|
|
2393
|
-
top:
|
|
2394
|
-
},
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
top: x,
|
|
2403
|
-
transform: I ? "translateX(-100%)" : void 0,
|
|
2404
|
-
pointerEvents: "none",
|
|
2405
|
-
zIndex: 100
|
|
2406
|
-
},
|
|
2407
|
-
children: n(P)
|
|
2408
|
-
}
|
|
2409
|
-
) : /* @__PURE__ */ Q(
|
|
2388
|
+
const h = {
|
|
2389
|
+
x: v,
|
|
2390
|
+
xLabel: x,
|
|
2391
|
+
items: L,
|
|
2392
|
+
left: c.left + f.left,
|
|
2393
|
+
top: c.top + f.top
|
|
2394
|
+
}, I = s.x ?? 12, P = s.y ?? -12, D = ((w = l.current) == null ? void 0 : w.offsetWidth) ?? 0, T = ((y = l.current) == null ? void 0 : y.offsetHeight) ?? 0, M = c.left + f.left, S = c.top + f.top, b = f.left + f.width, C = f.top + f.height, z = Math.max(f.left, Math.min(M + I, b - D)), p = Math.max(f.top, Math.min(S + P, C - T)), m = {
|
|
2395
|
+
position: "absolute",
|
|
2396
|
+
left: z,
|
|
2397
|
+
top: p,
|
|
2398
|
+
pointerEvents: "none",
|
|
2399
|
+
zIndex: 100
|
|
2400
|
+
};
|
|
2401
|
+
return n ? /* @__PURE__ */ X("div", { ref: l, className: e, style: m, children: n(h) }) : /* @__PURE__ */ Q(
|
|
2410
2402
|
"div",
|
|
2411
2403
|
{
|
|
2404
|
+
ref: l,
|
|
2412
2405
|
className: e,
|
|
2413
2406
|
style: {
|
|
2414
|
-
|
|
2415
|
-
left: T,
|
|
2416
|
-
top: x,
|
|
2417
|
-
transform: I ? "translateX(-100%)" : void 0,
|
|
2418
|
-
pointerEvents: "none",
|
|
2419
|
-
zIndex: 100,
|
|
2407
|
+
...m,
|
|
2420
2408
|
background: "rgba(0,0,0,0.85)",
|
|
2421
2409
|
color: "#fff",
|
|
2422
2410
|
padding: "6px 10px",
|
|
@@ -2427,20 +2415,20 @@ function fs({
|
|
|
2427
2415
|
lineHeight: 1.5
|
|
2428
2416
|
},
|
|
2429
2417
|
children: [
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
|
|
2432
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ X("div", { style: { fontWeight: 600, marginBottom: 2 }, children: x }),
|
|
2419
|
+
L.map((k) => /* @__PURE__ */ Q("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
2420
|
+
/* @__PURE__ */ X("span", { style: { width: 8, height: 8, borderRadius: "50%", backgroundColor: k.color, display: "inline-block" } }),
|
|
2433
2421
|
/* @__PURE__ */ Q("span", { children: [
|
|
2434
|
-
|
|
2422
|
+
k.label,
|
|
2435
2423
|
":"
|
|
2436
2424
|
] }),
|
|
2437
|
-
/* @__PURE__ */
|
|
2438
|
-
] }, `${
|
|
2425
|
+
/* @__PURE__ */ X("span", { style: { fontWeight: 600 }, children: k.value != null ? k.value.toPrecision(4) : "—" })
|
|
2426
|
+
] }, `${k.group}:${k.index}`))
|
|
2439
2427
|
]
|
|
2440
2428
|
}
|
|
2441
2429
|
);
|
|
2442
2430
|
}
|
|
2443
|
-
function
|
|
2431
|
+
function fs({
|
|
2444
2432
|
width: t,
|
|
2445
2433
|
height: e,
|
|
2446
2434
|
data: n,
|
|
@@ -2450,97 +2438,97 @@ function hs({
|
|
|
2450
2438
|
colors: l,
|
|
2451
2439
|
grips: r = !1
|
|
2452
2440
|
}) {
|
|
2453
|
-
const a =
|
|
2441
|
+
const a = E(null), [c, u] = St(() => {
|
|
2454
2442
|
if (o != null && n.length > 0) {
|
|
2455
2443
|
const T = n[0];
|
|
2456
2444
|
if (T != null && T.x.length > 1) {
|
|
2457
|
-
const
|
|
2458
|
-
if (
|
|
2445
|
+
const M = T.x[0], b = T.x[T.x.length - 1] - M;
|
|
2446
|
+
if (b > 0)
|
|
2459
2447
|
return [
|
|
2460
|
-
Math.max(0, (o[0] -
|
|
2461
|
-
Math.min(1, (o[1] -
|
|
2448
|
+
Math.max(0, (o[0] - M) / b),
|
|
2449
|
+
Math.min(1, (o[1] - M) / b)
|
|
2462
2450
|
];
|
|
2463
2451
|
}
|
|
2464
2452
|
}
|
|
2465
2453
|
return [0.25, 0.75];
|
|
2466
|
-
}), d =
|
|
2454
|
+
}), d = E(null);
|
|
2467
2455
|
Y(() => {
|
|
2468
2456
|
if (s == null || n.length === 0) return;
|
|
2469
2457
|
const T = n[0];
|
|
2470
2458
|
if (T == null || T.x.length < 2) return;
|
|
2471
|
-
const
|
|
2472
|
-
p != null && Math.abs(p[0] -
|
|
2459
|
+
const M = T.x[0], b = T.x[T.x.length - 1] - M, C = M + c[0] * b, z = M + c[1] * b, p = d.current, m = Math.max(1e-10, Math.abs(z - C) * 1e-12);
|
|
2460
|
+
p != null && Math.abs(p[0] - C) < m && Math.abs(p[1] - z) < m || (d.current = [C, z], s(C, z));
|
|
2473
2461
|
}, [c, n, s]);
|
|
2474
|
-
const f =
|
|
2475
|
-
const
|
|
2476
|
-
if (
|
|
2477
|
-
const
|
|
2478
|
-
return Math.max(0, Math.min(1, (T -
|
|
2479
|
-
}, []),
|
|
2480
|
-
const
|
|
2481
|
-
if (
|
|
2482
|
-
const
|
|
2462
|
+
const f = E(null), g = q((T) => {
|
|
2463
|
+
const M = a.current;
|
|
2464
|
+
if (M == null) return 0;
|
|
2465
|
+
const S = M.getBoundingClientRect();
|
|
2466
|
+
return Math.max(0, Math.min(1, (T - S.left) / S.width));
|
|
2467
|
+
}, []), v = q((T) => {
|
|
2468
|
+
const M = a.current;
|
|
2469
|
+
if (M == null) return;
|
|
2470
|
+
const S = g(T.clientX), b = M.getBoundingClientRect().width, C = b > 0 ? 8 / b : 0;
|
|
2483
2471
|
let z;
|
|
2484
|
-
if (Math.abs(
|
|
2472
|
+
if (Math.abs(S - c[0]) < C)
|
|
2485
2473
|
z = "left";
|
|
2486
|
-
else if (Math.abs(
|
|
2474
|
+
else if (Math.abs(S - c[1]) < C)
|
|
2487
2475
|
z = "right";
|
|
2488
|
-
else if (
|
|
2476
|
+
else if (S >= c[0] && S <= c[1])
|
|
2489
2477
|
z = "move";
|
|
2490
2478
|
else {
|
|
2491
|
-
const p = c[1] - c[0],
|
|
2492
|
-
u([
|
|
2479
|
+
const p = c[1] - c[0], m = p / 2, w = Math.max(0, Math.min(1 - p, S - m));
|
|
2480
|
+
u([w, w + p]), z = "move";
|
|
2493
2481
|
}
|
|
2494
2482
|
f.current = {
|
|
2495
2483
|
mode: z,
|
|
2496
2484
|
startX: T.clientX,
|
|
2497
2485
|
startFrac: [...c]
|
|
2498
|
-
},
|
|
2499
|
-
}, [c, g]),
|
|
2500
|
-
const
|
|
2501
|
-
if (
|
|
2502
|
-
const
|
|
2503
|
-
if (
|
|
2504
|
-
const z =
|
|
2505
|
-
let p =
|
|
2486
|
+
}, M.setPointerCapture(T.pointerId), T.preventDefault();
|
|
2487
|
+
}, [c, g]), x = q((T) => {
|
|
2488
|
+
const M = f.current;
|
|
2489
|
+
if (M == null) return;
|
|
2490
|
+
const S = g(T.clientX), b = g(M.startX), C = S - b;
|
|
2491
|
+
if (M.mode === "move") {
|
|
2492
|
+
const z = M.startFrac[1] - M.startFrac[0];
|
|
2493
|
+
let p = M.startFrac[0] + C;
|
|
2506
2494
|
p = Math.max(0, Math.min(1 - z, p)), u([p, p + z]);
|
|
2507
|
-
} else if (
|
|
2508
|
-
const z = Math.max(0, Math.min(
|
|
2509
|
-
u([z,
|
|
2495
|
+
} else if (M.mode === "left") {
|
|
2496
|
+
const z = Math.max(0, Math.min(M.startFrac[1] - 0.01, M.startFrac[0] + C));
|
|
2497
|
+
u([z, M.startFrac[1]]);
|
|
2510
2498
|
} else {
|
|
2511
|
-
const z = Math.min(1, Math.max(
|
|
2512
|
-
u([
|
|
2499
|
+
const z = Math.min(1, Math.max(M.startFrac[0] + 0.01, M.startFrac[1] + C));
|
|
2500
|
+
u([M.startFrac[0], z]);
|
|
2513
2501
|
}
|
|
2514
|
-
}, [g]),
|
|
2502
|
+
}, [g]), L = q((T) => {
|
|
2515
2503
|
f.current = null;
|
|
2516
|
-
const
|
|
2517
|
-
|
|
2518
|
-
}, []), h = `${c[0] * 100}%`,
|
|
2504
|
+
const M = a.current;
|
|
2505
|
+
M != null && M.releasePointerCapture(T.pointerId);
|
|
2506
|
+
}, []), h = `${c[0] * 100}%`, I = `${(c[1] - c[0]) * 100}%`, P = n[0], D = P != null ? P.series.length : 0;
|
|
2519
2507
|
return /* @__PURE__ */ Q("div", { className: i, style: { position: "relative", width: t, height: e }, children: [
|
|
2520
|
-
/* @__PURE__ */ Q(
|
|
2521
|
-
/* @__PURE__ */
|
|
2522
|
-
/* @__PURE__ */
|
|
2523
|
-
/* @__PURE__ */
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
Array.from({ length:
|
|
2508
|
+
/* @__PURE__ */ Q(Ce, { width: t, height: e, data: n, children: [
|
|
2509
|
+
/* @__PURE__ */ X(Lt, { id: "x" }),
|
|
2510
|
+
/* @__PURE__ */ X(Lt, { id: "y" }),
|
|
2511
|
+
/* @__PURE__ */ X(Dt, { scale: "x", show: !1 }),
|
|
2512
|
+
/* @__PURE__ */ X(Dt, { scale: "y", show: !1 }),
|
|
2513
|
+
Array.from({ length: D }, (T, M) => /* @__PURE__ */ X(
|
|
2526
2514
|
Te,
|
|
2527
2515
|
{
|
|
2528
2516
|
group: 0,
|
|
2529
|
-
index:
|
|
2517
|
+
index: M,
|
|
2530
2518
|
yScale: "y",
|
|
2531
|
-
stroke: l != null && l[
|
|
2519
|
+
stroke: l != null && l[M] != null ? l[M] : `hsl(${M * 137}, 60%, 50%)`,
|
|
2532
2520
|
width: 1
|
|
2533
2521
|
},
|
|
2534
|
-
|
|
2522
|
+
M
|
|
2535
2523
|
))
|
|
2536
2524
|
] }),
|
|
2537
2525
|
/* @__PURE__ */ Q(
|
|
2538
2526
|
"div",
|
|
2539
2527
|
{
|
|
2540
2528
|
ref: a,
|
|
2541
|
-
onPointerDown:
|
|
2542
|
-
onPointerMove:
|
|
2543
|
-
onPointerUp:
|
|
2529
|
+
onPointerDown: v,
|
|
2530
|
+
onPointerMove: x,
|
|
2531
|
+
onPointerUp: L,
|
|
2544
2532
|
style: {
|
|
2545
2533
|
position: "absolute",
|
|
2546
2534
|
top: 0,
|
|
@@ -2551,7 +2539,7 @@ function hs({
|
|
|
2551
2539
|
touchAction: "none"
|
|
2552
2540
|
},
|
|
2553
2541
|
children: [
|
|
2554
|
-
/* @__PURE__ */
|
|
2542
|
+
/* @__PURE__ */ X(
|
|
2555
2543
|
"div",
|
|
2556
2544
|
{
|
|
2557
2545
|
style: {
|
|
@@ -2565,7 +2553,7 @@ function hs({
|
|
|
2565
2553
|
}
|
|
2566
2554
|
}
|
|
2567
2555
|
),
|
|
2568
|
-
/* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ X(
|
|
2569
2557
|
"div",
|
|
2570
2558
|
{
|
|
2571
2559
|
style: {
|
|
@@ -2579,14 +2567,14 @@ function hs({
|
|
|
2579
2567
|
}
|
|
2580
2568
|
}
|
|
2581
2569
|
),
|
|
2582
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ X(
|
|
2583
2571
|
"div",
|
|
2584
2572
|
{
|
|
2585
2573
|
style: {
|
|
2586
2574
|
position: "absolute",
|
|
2587
2575
|
top: 0,
|
|
2588
2576
|
left: h,
|
|
2589
|
-
width:
|
|
2577
|
+
width: I,
|
|
2590
2578
|
height: "100%",
|
|
2591
2579
|
borderLeft: "2px solid rgba(0,100,255,0.8)",
|
|
2592
2580
|
borderRight: "2px solid rgba(0,100,255,0.8)",
|
|
@@ -2595,7 +2583,7 @@ function hs({
|
|
|
2595
2583
|
pointerEvents: "none"
|
|
2596
2584
|
},
|
|
2597
2585
|
children: r && /* @__PURE__ */ Q(Pe, { children: [
|
|
2598
|
-
/* @__PURE__ */
|
|
2586
|
+
/* @__PURE__ */ X("div", { style: {
|
|
2599
2587
|
position: "absolute",
|
|
2600
2588
|
left: -5,
|
|
2601
2589
|
top: "50%",
|
|
@@ -2607,7 +2595,7 @@ function hs({
|
|
|
2607
2595
|
cursor: "ew-resize",
|
|
2608
2596
|
pointerEvents: "auto"
|
|
2609
2597
|
} }),
|
|
2610
|
-
/* @__PURE__ */
|
|
2598
|
+
/* @__PURE__ */ X("div", { style: {
|
|
2611
2599
|
position: "absolute",
|
|
2612
2600
|
right: -5,
|
|
2613
2601
|
top: "50%",
|
|
@@ -2628,7 +2616,7 @@ function hs({
|
|
|
2628
2616
|
] });
|
|
2629
2617
|
}
|
|
2630
2618
|
function Pt(t) {
|
|
2631
|
-
const e = ot(), n =
|
|
2619
|
+
const e = ot(), n = E(t);
|
|
2632
2620
|
n.current = t, Y(() => {
|
|
2633
2621
|
const s = (o) => n.current(o);
|
|
2634
2622
|
return e.drawHooks.add(s), () => {
|
|
@@ -2636,8 +2624,8 @@ function Pt(t) {
|
|
|
2636
2624
|
};
|
|
2637
2625
|
}, [e]);
|
|
2638
2626
|
}
|
|
2639
|
-
function
|
|
2640
|
-
const e = ot(), n =
|
|
2627
|
+
function hs(t) {
|
|
2628
|
+
const e = ot(), n = E(t);
|
|
2641
2629
|
n.current = t, Y(() => {
|
|
2642
2630
|
const s = (o, i) => n.current(o, i);
|
|
2643
2631
|
return e.cursorDrawHooks.add(s), () => {
|
|
@@ -2645,7 +2633,7 @@ function ds(t) {
|
|
|
2645
2633
|
};
|
|
2646
2634
|
}, [e]);
|
|
2647
2635
|
}
|
|
2648
|
-
function
|
|
2636
|
+
function ds({
|
|
2649
2637
|
lanes: t,
|
|
2650
2638
|
laneHeight: e = 24,
|
|
2651
2639
|
gap: n = 2,
|
|
@@ -2665,17 +2653,17 @@ function gs({
|
|
|
2665
2653
|
for (let f = 0; f < t.length; f++) {
|
|
2666
2654
|
const g = t[f];
|
|
2667
2655
|
if (g == null) continue;
|
|
2668
|
-
const
|
|
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,
|
|
2670
|
-
for (const
|
|
2671
|
-
const
|
|
2672
|
-
|
|
2656
|
+
const v = d + f * c;
|
|
2657
|
+
i.fillStyle = "#666", i.font = `${11 * r}px sans-serif`, i.textAlign = "right", i.textBaseline = "middle", i.fillText(g.label, (l.left - 6) * r, v + u / 2);
|
|
2658
|
+
for (const x of g.segments) {
|
|
2659
|
+
const L = _(x.start, a, l.width, l.left) * r, I = _(x.end, a, l.width, l.left) * r - L;
|
|
2660
|
+
I <= 0 || (i.fillStyle = x.color ?? "#4dabf7", i.fillRect(L, v, I, u), x.label != null && I > 20 * r && (i.fillStyle = "#fff", i.font = `${10 * r}px sans-serif`, i.textAlign = "center", i.textBaseline = "middle", i.fillText(x.label, L + I / 2, v + u / 2, I - 4 * r)));
|
|
2673
2661
|
}
|
|
2674
2662
|
}
|
|
2675
2663
|
i.restore();
|
|
2676
2664
|
}), null;
|
|
2677
2665
|
}
|
|
2678
|
-
function
|
|
2666
|
+
function gs({
|
|
2679
2667
|
data: t,
|
|
2680
2668
|
width: e = 150,
|
|
2681
2669
|
height: n = 30,
|
|
@@ -2686,12 +2674,12 @@ function ps({
|
|
|
2686
2674
|
fillTo: r,
|
|
2687
2675
|
className: a
|
|
2688
2676
|
}) {
|
|
2689
|
-
return /* @__PURE__ */
|
|
2690
|
-
/* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
2677
|
+
return /* @__PURE__ */ X("div", { style: { pointerEvents: "none" }, className: a, children: /* @__PURE__ */ Q(Ce, { width: e, height: n, data: t, children: [
|
|
2678
|
+
/* @__PURE__ */ X(Lt, { id: "x" }),
|
|
2679
|
+
/* @__PURE__ */ X(Lt, { id: "y" }),
|
|
2680
|
+
/* @__PURE__ */ X(Dt, { scale: "x", show: !1 }),
|
|
2681
|
+
/* @__PURE__ */ X(Dt, { scale: "y", show: !1 }),
|
|
2682
|
+
/* @__PURE__ */ X(
|
|
2695
2683
|
Te,
|
|
2696
2684
|
{
|
|
2697
2685
|
group: 0,
|
|
@@ -2706,68 +2694,29 @@ function ps({
|
|
|
2706
2694
|
)
|
|
2707
2695
|
] }) });
|
|
2708
2696
|
}
|
|
2709
|
-
function
|
|
2710
|
-
|
|
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
|
-
function es(t, e, n, s = {}) {
|
|
2749
|
-
const { ctx: o, plotBox: i } = t, l = H(n, e, i.height, i.top);
|
|
2697
|
+
function ts(t, e, n, s = {}) {
|
|
2698
|
+
const { ctx: o, plotBox: i } = t, l = _(n, e, i.height, i.top);
|
|
2750
2699
|
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([]);
|
|
2751
2700
|
}
|
|
2752
|
-
function
|
|
2753
|
-
const { ctx: o, plotBox: i } = t, l =
|
|
2701
|
+
function es(t, e, n, s = {}) {
|
|
2702
|
+
const { ctx: o, plotBox: i } = t, l = _(n, e, i.width, i.left);
|
|
2754
2703
|
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
2704
|
}
|
|
2756
|
-
function
|
|
2757
|
-
const { ctx: r, plotBox: a } = t, c =
|
|
2705
|
+
function ps(t, e, n, s, o, i, l = {}) {
|
|
2706
|
+
const { ctx: r, plotBox: a } = t, c = _(s, e, a.width, a.left), u = _(o, n, a.height, a.top);
|
|
2758
2707
|
r.font = l.font ?? "12px sans-serif", r.fillStyle = l.fill ?? "#000", r.textBaseline = "bottom", r.fillText(i, c, u - 4);
|
|
2759
2708
|
}
|
|
2760
|
-
function
|
|
2761
|
-
const { ctx: i, plotBox: l } = t, r =
|
|
2709
|
+
function ns(t, e, n, s, o = {}) {
|
|
2710
|
+
const { ctx: i, plotBox: l } = t, r = _(s, e, l.height, l.top), a = _(n, e, l.height, l.top);
|
|
2762
2711
|
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
2712
|
}
|
|
2764
|
-
function
|
|
2765
|
-
const e =
|
|
2766
|
-
return
|
|
2713
|
+
function ms(t) {
|
|
2714
|
+
const e = E(t);
|
|
2715
|
+
return zt(() => {
|
|
2767
2716
|
e.current = t;
|
|
2768
2717
|
}), Pt((n) => {
|
|
2769
2718
|
const s = e.current, o = s.yScale ?? "y", i = n.getScale(o);
|
|
2770
|
-
if (i != null && (
|
|
2719
|
+
if (i != null && (ts(n, i, s.value, {
|
|
2771
2720
|
stroke: s.stroke,
|
|
2772
2721
|
width: s.width,
|
|
2773
2722
|
dash: s.dash
|
|
@@ -2779,13 +2728,13 @@ function vs(t) {
|
|
|
2779
2728
|
}
|
|
2780
2729
|
}), null;
|
|
2781
2730
|
}
|
|
2782
|
-
function
|
|
2783
|
-
const e =
|
|
2784
|
-
return
|
|
2731
|
+
function ws(t) {
|
|
2732
|
+
const e = E(t);
|
|
2733
|
+
return zt(() => {
|
|
2785
2734
|
e.current = t;
|
|
2786
2735
|
}), Pt((n) => {
|
|
2787
2736
|
const s = e.current, o = s.xScale ?? "x", i = n.getScale(o);
|
|
2788
|
-
if (i != null && (
|
|
2737
|
+
if (i != null && (es(n, i, s.value, {
|
|
2789
2738
|
stroke: s.stroke,
|
|
2790
2739
|
width: s.width,
|
|
2791
2740
|
dash: s.dash
|
|
@@ -2797,13 +2746,13 @@ function Ms(t) {
|
|
|
2797
2746
|
}
|
|
2798
2747
|
}), null;
|
|
2799
2748
|
}
|
|
2800
|
-
function
|
|
2801
|
-
const e =
|
|
2802
|
-
return
|
|
2749
|
+
function vs(t) {
|
|
2750
|
+
const e = E(t);
|
|
2751
|
+
return zt(() => {
|
|
2803
2752
|
e.current = t;
|
|
2804
2753
|
}), Pt((n) => {
|
|
2805
2754
|
const s = e.current, o = n.getScale(s.yScale ?? "y");
|
|
2806
|
-
o != null &&
|
|
2755
|
+
o != null && ns(n, o, s.yMin, s.yMax, {
|
|
2807
2756
|
fill: s.fill,
|
|
2808
2757
|
stroke: s.stroke,
|
|
2809
2758
|
width: s.strokeWidth,
|
|
@@ -2811,9 +2760,9 @@ function xs(t) {
|
|
|
2811
2760
|
});
|
|
2812
2761
|
}), null;
|
|
2813
2762
|
}
|
|
2814
|
-
function
|
|
2815
|
-
const e =
|
|
2816
|
-
return
|
|
2763
|
+
function Ms(t) {
|
|
2764
|
+
const e = E(t);
|
|
2765
|
+
return zt(() => {
|
|
2817
2766
|
e.current = t;
|
|
2818
2767
|
}), Pt((n) => {
|
|
2819
2768
|
const s = e.current, o = n.valToX(s.x, s.xScale ?? "x"), i = n.valToY(s.y, s.yScale ?? "y");
|
|
@@ -2822,46 +2771,46 @@ function bs(t) {
|
|
|
2822
2771
|
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
2772
|
}), null;
|
|
2824
2773
|
}
|
|
2825
|
-
function
|
|
2826
|
-
const { window: n, batchSize: s = 1 } = e, o = e.autoStart ?? !0, [i, l] =
|
|
2827
|
-
|
|
2828
|
-
const h =
|
|
2829
|
-
(T,
|
|
2830
|
-
let
|
|
2831
|
-
|
|
2832
|
-
for (let
|
|
2833
|
-
let z =
|
|
2834
|
-
z == null && (z = [],
|
|
2774
|
+
function xs(t, e) {
|
|
2775
|
+
const { window: n, batchSize: s = 1 } = e, o = e.autoStart ?? !0, [i, l] = St(t), [r, a] = St(!1), [c, u] = St(0), d = E(0), f = E(0), g = E(0), v = E(/* @__PURE__ */ new Map()), x = E(0), L = E(n);
|
|
2776
|
+
L.current = n;
|
|
2777
|
+
const h = q(
|
|
2778
|
+
(T, M, ...S) => {
|
|
2779
|
+
let b = v.current.get(T);
|
|
2780
|
+
b == null && (b = { x: [], series: S.map(() => []) }, v.current.set(T, b)), b.x.push(...M);
|
|
2781
|
+
for (let C = 0; C < S.length; C++) {
|
|
2782
|
+
let z = b.series[C];
|
|
2783
|
+
z == null && (z = [], b.series[C] = z), z.push(...S[C] ?? []);
|
|
2835
2784
|
}
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
const
|
|
2839
|
-
|
|
2840
|
-
const z =
|
|
2785
|
+
x.current === 0 && (x.current = requestAnimationFrame(() => {
|
|
2786
|
+
x.current = 0;
|
|
2787
|
+
const C = v.current;
|
|
2788
|
+
v.current = /* @__PURE__ */ new Map();
|
|
2789
|
+
const z = L.current;
|
|
2841
2790
|
l((p) => {
|
|
2842
|
-
const
|
|
2843
|
-
for (const [
|
|
2844
|
-
const A = w
|
|
2791
|
+
const m = p.slice();
|
|
2792
|
+
for (const [w, { x: y, series: k }] of C) {
|
|
2793
|
+
const A = m[w];
|
|
2845
2794
|
if (A == null) continue;
|
|
2846
|
-
const F = A.x, R = Math.max(0, F.length +
|
|
2847
|
-
const j = B,
|
|
2848
|
-
return R > 0 ? j.slice(R).concat(
|
|
2795
|
+
const F = A.x, R = Math.max(0, F.length + y.length - z), H = R > 0 ? F.slice(R).concat(y) : F.concat(y), V = A.series.map((B, W) => {
|
|
2796
|
+
const j = B, O = k[W] ?? [];
|
|
2797
|
+
return R > 0 ? j.slice(R).concat(O) : j.concat(O);
|
|
2849
2798
|
});
|
|
2850
|
-
w
|
|
2799
|
+
m[w] = { x: H, series: V };
|
|
2851
2800
|
}
|
|
2852
|
-
return
|
|
2801
|
+
return m;
|
|
2853
2802
|
});
|
|
2854
2803
|
}));
|
|
2855
2804
|
},
|
|
2856
2805
|
[]
|
|
2857
|
-
),
|
|
2858
|
-
(T, ...
|
|
2859
|
-
h(0, T, ...
|
|
2806
|
+
), I = q(
|
|
2807
|
+
(T, ...M) => {
|
|
2808
|
+
h(0, T, ...M);
|
|
2860
2809
|
},
|
|
2861
2810
|
[h]
|
|
2862
|
-
),
|
|
2811
|
+
), P = q(() => {
|
|
2863
2812
|
a(!0);
|
|
2864
|
-
}, []),
|
|
2813
|
+
}, []), D = q(() => {
|
|
2865
2814
|
a(!1);
|
|
2866
2815
|
}, []);
|
|
2867
2816
|
return Y(() => {
|
|
@@ -2870,86 +2819,86 @@ function Ss(t, e) {
|
|
|
2870
2819
|
return;
|
|
2871
2820
|
}
|
|
2872
2821
|
g.current = performance.now(), f.current = 0;
|
|
2873
|
-
const T = (
|
|
2822
|
+
const T = (M) => {
|
|
2874
2823
|
f.current++;
|
|
2875
|
-
const
|
|
2876
|
-
|
|
2824
|
+
const S = M - g.current;
|
|
2825
|
+
S >= 1e3 && (u(Math.round(f.current * 1e3 / S)), f.current = 0, g.current = M), d.current = requestAnimationFrame(T);
|
|
2877
2826
|
};
|
|
2878
2827
|
return d.current = requestAnimationFrame(T), () => {
|
|
2879
2828
|
d.current !== 0 && (cancelAnimationFrame(d.current), d.current = 0);
|
|
2880
2829
|
};
|
|
2881
2830
|
}, [r]), Y(() => () => {
|
|
2882
|
-
|
|
2831
|
+
x.current !== 0 && cancelAnimationFrame(x.current);
|
|
2883
2832
|
}, []), Y(() => {
|
|
2884
2833
|
o && a(!0);
|
|
2885
|
-
}, [o]), { data: i, push:
|
|
2834
|
+
}, [o]), { data: i, push: I, pushGroup: h, start: P, stop: D, running: r, fps: c };
|
|
2886
2835
|
}
|
|
2887
|
-
function
|
|
2836
|
+
function bs(t) {
|
|
2888
2837
|
return (e, n, s, o, i, l, r, a, c, u, d, f, g) => {
|
|
2889
|
-
const
|
|
2838
|
+
const v = (g == null ? void 0 : g.align) ?? t ?? 1, x = (g == null ? void 0 : g.spanGaps) ?? !1;
|
|
2890
2839
|
if ([c, u] = Ft(n, c, u), c === -1)
|
|
2891
2840
|
return { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null };
|
|
2892
|
-
const
|
|
2841
|
+
const L = (C) => f(_(C, s, i, r)), h = (C) => f(_(C, o, l, a)), I = s.ori === G.Horizontal ? Rt : Ht, P = { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null }, D = P.stroke;
|
|
2893
2842
|
let T = !1;
|
|
2894
|
-
const
|
|
2895
|
-
let
|
|
2896
|
-
|
|
2897
|
-
for (let
|
|
2898
|
-
const z = n[
|
|
2843
|
+
const M = d === K.Forward ? c : u;
|
|
2844
|
+
let S = h(n[M]), b = L(e[M]);
|
|
2845
|
+
I(D, b, S);
|
|
2846
|
+
for (let C = M; C >= c && C <= u; C += d) {
|
|
2847
|
+
const z = n[C];
|
|
2899
2848
|
if (z == null) {
|
|
2900
|
-
z === null && !
|
|
2849
|
+
z === null && !x && (T = !0);
|
|
2901
2850
|
continue;
|
|
2902
2851
|
}
|
|
2903
|
-
const p =
|
|
2904
|
-
if (
|
|
2905
|
-
|
|
2906
|
-
else if (
|
|
2907
|
-
|
|
2852
|
+
const p = L(e[C]), m = h(z);
|
|
2853
|
+
if (v === 1)
|
|
2854
|
+
I(D, p, S);
|
|
2855
|
+
else if (v === -1)
|
|
2856
|
+
I(D, b, m);
|
|
2908
2857
|
else {
|
|
2909
|
-
const
|
|
2910
|
-
|
|
2858
|
+
const w = f((b + p) / 2);
|
|
2859
|
+
I(D, w, S), I(D, w, m);
|
|
2911
2860
|
}
|
|
2912
|
-
|
|
2861
|
+
I(D, p, m), S = m, b = p;
|
|
2913
2862
|
}
|
|
2914
2863
|
{
|
|
2915
|
-
const
|
|
2916
|
-
let
|
|
2917
|
-
d === K.Backward && ([
|
|
2864
|
+
const C = P.fill = new Path2D(D), z = (g == null ? void 0 : g.fillTo) ?? o.min ?? 0, p = h(z);
|
|
2865
|
+
let m = r, w = r + i;
|
|
2866
|
+
d === K.Backward && ([w, m] = [m, w]), I(C, w, p), I(C, m, p);
|
|
2918
2867
|
}
|
|
2919
2868
|
if (T) {
|
|
2920
|
-
const
|
|
2921
|
-
|
|
2869
|
+
const C = Xt(e, n, c, u, d, L);
|
|
2870
|
+
P.gaps = C, P.clip = Yt(C, s.ori, r, a, i, l);
|
|
2922
2871
|
}
|
|
2923
|
-
return
|
|
2872
|
+
return P;
|
|
2924
2873
|
};
|
|
2925
2874
|
}
|
|
2926
|
-
function
|
|
2875
|
+
function Ss() {
|
|
2927
2876
|
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,
|
|
2929
|
-
let
|
|
2877
|
+
const g = (f == null ? void 0 : f.barWidth) ?? 0.6, v = (f == null ? void 0 : f.barGap) ?? 0, x = (f == null ? void 0 : f.barRadius) ?? 0, L = (f == null ? void 0 : f.barGroupIdx) ?? 0, h = (f == null ? void 0 : f.barGroupCount) ?? 1, I = (w) => d(_(w, n, o, l)), P = (w) => d(_(w, s, i, r));
|
|
2878
|
+
let D = o;
|
|
2930
2879
|
if (c > a) {
|
|
2931
|
-
let
|
|
2932
|
-
for (let
|
|
2933
|
-
if (e[
|
|
2934
|
-
if (
|
|
2935
|
-
const A = t[
|
|
2936
|
-
R <
|
|
2880
|
+
let w = 1 / 0, y = -1;
|
|
2881
|
+
for (let k = a; k <= c; k++)
|
|
2882
|
+
if (e[k] != null) {
|
|
2883
|
+
if (y >= 0) {
|
|
2884
|
+
const A = t[k], F = t[y], R = Math.abs(I(A) - I(F));
|
|
2885
|
+
R < w && (w = R);
|
|
2937
2886
|
}
|
|
2938
|
-
|
|
2887
|
+
y = k;
|
|
2939
2888
|
}
|
|
2940
|
-
|
|
2889
|
+
w < 1 / 0 && (D = w);
|
|
2941
2890
|
}
|
|
2942
|
-
const T =
|
|
2943
|
-
for (let
|
|
2944
|
-
const
|
|
2945
|
-
if (
|
|
2946
|
-
const
|
|
2891
|
+
const T = D * (1 - g), M = Math.max(0, T + v), S = Math.max(1, d(D - M)), b = h > 1 ? Math.max(1, d(S / Math.max(1, h))) : S, C = (f == null ? void 0 : f.fillTo) ?? s.min ?? 0, z = P(C), p = new Path2D(), m = n.ori === G.Horizontal;
|
|
2892
|
+
for (let w = u === K.Forward ? a : c; w >= a && w <= c; w += u) {
|
|
2893
|
+
const y = e[w];
|
|
2894
|
+
if (y == null) continue;
|
|
2895
|
+
const k = I(t[w]), A = P(y), F = h > 1 ? (L - (h - 1) / 2) * b : 0, R = d(k - b / 2 + F), H = Math.min(A, z), B = Math.max(A, z) - H;
|
|
2947
2896
|
if (B !== 0)
|
|
2948
|
-
if (
|
|
2949
|
-
const W = Math.min(
|
|
2950
|
-
|
|
2897
|
+
if (x > 0) {
|
|
2898
|
+
const W = Math.min(x * b, B / 2);
|
|
2899
|
+
ss(p, m, R, H, b, B, W, y < C);
|
|
2951
2900
|
} else
|
|
2952
|
-
|
|
2901
|
+
m ? p.rect(R, H, b, B) : p.rect(H, R, B, b);
|
|
2953
2902
|
}
|
|
2954
2903
|
return {
|
|
2955
2904
|
stroke: p,
|
|
@@ -2961,43 +2910,43 @@ function ks() {
|
|
|
2961
2910
|
};
|
|
2962
2911
|
};
|
|
2963
2912
|
}
|
|
2964
|
-
function
|
|
2913
|
+
function ss(t, e, n, s, o, i, l, r) {
|
|
2965
2914
|
l = Math.min(l, o / 2, i / 2), e ? r ? (t.moveTo(n, s), t.lineTo(n + o, s), t.lineTo(n + o, s + i - l), t.arc(n + o - l, s + i - l, l, 0, Math.PI / 2), t.lineTo(n + l, s + i), t.arc(n + l, s + i - l, l, Math.PI / 2, Math.PI), t.closePath()) : (t.moveTo(n, s + i), t.lineTo(n, s + l), t.arc(n + l, s + l, l, Math.PI, Math.PI * 1.5), t.lineTo(n + o - l, s), t.arc(n + o - l, s + l, l, Math.PI * 1.5, 0), t.lineTo(n + o, s + i), t.closePath()) : r ? (t.moveTo(s, n), t.lineTo(s, n + o), t.lineTo(s + i - l, n + o), t.arc(s + i - l, n + o - l, l, Math.PI / 2, 0, !0), t.lineTo(s + i, n + l), t.arc(s + i - l, n + l, l, 0, -Math.PI / 2, !0), t.closePath()) : (t.moveTo(s + i, n), t.lineTo(s + l, n), t.arc(s + l, n + l, l, -Math.PI / 2, Math.PI, !0), t.lineTo(s, n + o - l), t.arc(s + l, n + o - l, l, Math.PI, Math.PI / 2, !0), t.lineTo(s + i, n + o), t.closePath());
|
|
2966
2915
|
}
|
|
2967
2916
|
function Ie(t) {
|
|
2968
2917
|
return (e, n, s, o, i, l, r, a, c, u, d, f, g) => {
|
|
2969
|
-
const
|
|
2918
|
+
const v = (g == null ? void 0 : g.spanGaps) ?? !1;
|
|
2970
2919
|
if ([c, u] = Ft(n, c, u), c === -1)
|
|
2971
2920
|
return { stroke: new Path2D(), fill: null, clip: null, band: null, gaps: null };
|
|
2972
|
-
const
|
|
2973
|
-
let
|
|
2974
|
-
for (let
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2977
|
-
}
|
|
2978
|
-
const T = s.ori === G.Horizontal,
|
|
2979
|
-
stroke:
|
|
2921
|
+
const x = (b) => f(_(b, s, i, r)), L = (b) => f(_(b, o, l, a)), h = s.ori === G.Horizontal ? Rt : Ht, I = [], P = [];
|
|
2922
|
+
let D = !1;
|
|
2923
|
+
for (let b = d === K.Forward ? c : u; b >= c && b <= u; b += d) {
|
|
2924
|
+
const C = n[b];
|
|
2925
|
+
C != null ? (I.push(x(e[b])), P.push(L(C))) : C === null && !v && (D = !0);
|
|
2926
|
+
}
|
|
2927
|
+
const T = s.ori === G.Horizontal, M = t(I, P, T, f), S = {
|
|
2928
|
+
stroke: M ?? new Path2D(),
|
|
2980
2929
|
fill: null,
|
|
2981
2930
|
clip: null,
|
|
2982
2931
|
band: null,
|
|
2983
2932
|
gaps: null
|
|
2984
2933
|
};
|
|
2985
|
-
if (
|
|
2986
|
-
const
|
|
2987
|
-
let p = r,
|
|
2988
|
-
d === K.Backward && ([
|
|
2934
|
+
if (M != null) {
|
|
2935
|
+
const b = S.fill = new Path2D(M), C = (g == null ? void 0 : g.fillTo) ?? o.min ?? 0, z = L(C);
|
|
2936
|
+
let p = r, m = r + i;
|
|
2937
|
+
d === K.Backward && ([m, p] = [p, m]), h(b, m, z), h(b, p, z);
|
|
2989
2938
|
}
|
|
2990
|
-
if (
|
|
2991
|
-
const
|
|
2992
|
-
|
|
2939
|
+
if (D) {
|
|
2940
|
+
const b = Xt(e, n, c, u, d, x);
|
|
2941
|
+
S.gaps = b, S.clip = Yt(b, s.ori, r, a, i, l);
|
|
2993
2942
|
}
|
|
2994
|
-
return
|
|
2943
|
+
return S;
|
|
2995
2944
|
};
|
|
2996
2945
|
}
|
|
2997
|
-
function
|
|
2998
|
-
return Ie(
|
|
2946
|
+
function ys() {
|
|
2947
|
+
return Ie(os);
|
|
2999
2948
|
}
|
|
3000
|
-
const
|
|
2949
|
+
const os = (t, e, n, s) => {
|
|
3001
2950
|
const o = t.length;
|
|
3002
2951
|
if (o < 2) return null;
|
|
3003
2952
|
const i = new Path2D(), l = t[0] ?? 0, r = e[0] ?? 0;
|
|
@@ -3010,25 +2959,25 @@ const ls = (t, e, n, s) => {
|
|
|
3010
2959
|
u[f] = (e[f + 1] ?? 0) - (e[f] ?? 0), d[f] = (t[f + 1] ?? 0) - (t[f] ?? 0), c[f] = d[f] !== 0 ? (u[f] ?? 0) / (d[f] ?? 1) : 0;
|
|
3011
2960
|
a[0] = c[0] ?? 0;
|
|
3012
2961
|
for (let f = 1; f < o - 1; f++) {
|
|
3013
|
-
const g = c[f] ?? 0,
|
|
3014
|
-
if (g === 0 ||
|
|
2962
|
+
const g = c[f] ?? 0, v = c[f - 1] ?? 0;
|
|
2963
|
+
if (g === 0 || v === 0 || v > 0 != g > 0)
|
|
3015
2964
|
a[f] = 0;
|
|
3016
2965
|
else {
|
|
3017
|
-
const
|
|
3018
|
-
a[f] = 3 * (
|
|
2966
|
+
const x = d[f] ?? 1, L = d[f - 1] ?? 1;
|
|
2967
|
+
a[f] = 3 * (L + x) / ((2 * x + L) / v + (x + 2 * L) / g), isFinite(a[f] ?? 0) || (a[f] = 0);
|
|
3019
2968
|
}
|
|
3020
2969
|
}
|
|
3021
2970
|
a[o - 1] = c[o - 2] ?? 0;
|
|
3022
2971
|
for (let f = 0; f < o - 1; f++) {
|
|
3023
|
-
const g = d[f] ?? 1,
|
|
3024
|
-
n ? i.bezierCurveTo(
|
|
2972
|
+
const g = d[f] ?? 1, v = t[f] ?? 0, x = e[f] ?? 0, L = t[f + 1] ?? 0, h = e[f + 1] ?? 0, I = a[f] ?? 0, P = a[f + 1] ?? 0, D = v + g / 3, T = x + I * g / 3, M = L - g / 3, S = h - P * g / 3;
|
|
2973
|
+
n ? i.bezierCurveTo(D, T, M, S, L, h) : i.bezierCurveTo(T, D, S, M, h, L);
|
|
3025
2974
|
}
|
|
3026
2975
|
return i;
|
|
3027
2976
|
};
|
|
3028
|
-
function
|
|
3029
|
-
return Ie(
|
|
2977
|
+
function ks() {
|
|
2978
|
+
return Ie(ls);
|
|
3030
2979
|
}
|
|
3031
|
-
const
|
|
2980
|
+
const ls = (t, e, n, s) => {
|
|
3032
2981
|
const o = t.length;
|
|
3033
2982
|
if (o < 2) return null;
|
|
3034
2983
|
const i = new Path2D(), l = s(t[0] ?? 0), r = s(e[0] ?? 0);
|
|
@@ -3037,30 +2986,30 @@ const is = (t, e, n, s) => {
|
|
|
3037
2986
|
return n ? i.lineTo(a, c) : i.lineTo(c, a), i;
|
|
3038
2987
|
}
|
|
3039
2988
|
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,
|
|
3041
|
-
let
|
|
3042
|
-
if (
|
|
3043
|
-
const
|
|
3044
|
-
|
|
2989
|
+
const c = a === 0 ? 0 : a - 1, u = t[c] ?? 0, d = e[c] ?? 0, f = t[a] ?? 0, g = e[a] ?? 0, v = t[a + 1] ?? 0, x = e[a + 1] ?? 0, L = a + 2 < o ? t[a + 2] ?? 0 : v, h = a + 2 < o ? e[a + 2] ?? 0 : x, I = Math.hypot(u - f, d - g), P = Math.hypot(f - v, g - x), D = Math.hypot(v - L, x - h), T = Math.sqrt(D), M = D, S = Math.sqrt(P), b = P, C = Math.sqrt(I), z = I, p = 2 * z + 3 * C * S + b, m = 2 * M + 3 * T * S + b, w = 3 * C * (C + S), y = 3 * T * (T + S);
|
|
2990
|
+
let k, A, F, R;
|
|
2991
|
+
if (w > 0) {
|
|
2992
|
+
const H = 1 / w;
|
|
2993
|
+
k = (-b * u + p * f + z * v) * H, A = (-b * d + p * g + z * x) * H;
|
|
3045
2994
|
} else
|
|
3046
|
-
|
|
3047
|
-
if (
|
|
3048
|
-
const
|
|
3049
|
-
F = (
|
|
2995
|
+
k = f, A = g;
|
|
2996
|
+
if (y > 0) {
|
|
2997
|
+
const H = 1 / y;
|
|
2998
|
+
F = (M * f + m * v - b * L) * H, R = (M * g + m * x - b * h) * H;
|
|
3050
2999
|
} else
|
|
3051
|
-
F =
|
|
3052
|
-
n ? i.bezierCurveTo(
|
|
3000
|
+
F = v, R = x;
|
|
3001
|
+
n ? i.bezierCurveTo(k, A, F, R, v, x) : i.bezierCurveTo(A, k, R, F, x, v);
|
|
3053
3002
|
}
|
|
3054
3003
|
return i;
|
|
3055
3004
|
};
|
|
3056
|
-
function
|
|
3005
|
+
function Cs(t = 4) {
|
|
3057
3006
|
return (e, n, s, o, i, l, r, a, c, u, d, f, g) => {
|
|
3058
|
-
const
|
|
3059
|
-
for (let
|
|
3060
|
-
const
|
|
3061
|
-
if (
|
|
3062
|
-
const T =
|
|
3063
|
-
|
|
3007
|
+
const v = (P) => f(_(P, s, i, r)), x = (P) => f(_(P, o, l, a)), L = t / 2, h = new Path2D(), I = s.ori === G.Horizontal;
|
|
3008
|
+
for (let P = d === K.Forward ? c : u; P >= c && P <= u; P += d) {
|
|
3009
|
+
const D = n[P];
|
|
3010
|
+
if (D == null) continue;
|
|
3011
|
+
const T = v(e[P]), M = x(D);
|
|
3012
|
+
I ? (h.moveTo(T + L, M), h.arc(T, M, L, 0, Math.PI * 2)) : (h.moveTo(M + L, T), h.arc(M, T, L, 0, Math.PI * 2));
|
|
3064
3013
|
}
|
|
3065
3014
|
return {
|
|
3066
3015
|
stroke: h,
|
|
@@ -3071,7 +3020,7 @@ function Is(t = 4) {
|
|
|
3071
3020
|
};
|
|
3072
3021
|
};
|
|
3073
3022
|
}
|
|
3074
|
-
function
|
|
3023
|
+
function Ts(t) {
|
|
3075
3024
|
return ({ ctx: e, plotBox: n, pxRatio: s }) => {
|
|
3076
3025
|
const {
|
|
3077
3026
|
xValues: o,
|
|
@@ -3084,25 +3033,25 @@ function As(t) {
|
|
|
3084
3033
|
upColor: d = "#26a69a",
|
|
3085
3034
|
downColor: f = "#ef5350",
|
|
3086
3035
|
bodyWidth: g = 0.6,
|
|
3087
|
-
wickWidth:
|
|
3036
|
+
wickWidth: v = 1
|
|
3088
3037
|
} = t;
|
|
3089
3038
|
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 /
|
|
3039
|
+
const x = o.length;
|
|
3040
|
+
if (x === 0) return;
|
|
3041
|
+
const h = Math.max(2, n.width / x * g) * s / 2;
|
|
3093
3042
|
e.save();
|
|
3094
|
-
for (let
|
|
3095
|
-
const
|
|
3096
|
-
if (
|
|
3097
|
-
const
|
|
3098
|
-
e.strokeStyle =
|
|
3099
|
-
const
|
|
3100
|
-
e.fillStyle =
|
|
3043
|
+
for (let I = 0; I < x; I++) {
|
|
3044
|
+
const P = o[I], D = i[I], T = l[I], M = r[I], S = a[I];
|
|
3045
|
+
if (P == null || D == null || T == null || M == null || S == null) continue;
|
|
3046
|
+
const b = _(P, c, n.width, n.left) * s, C = _(D, u, n.height, n.top) * s, z = _(T, u, n.height, n.top) * s, p = _(M, u, n.height, n.top) * s, m = _(S, u, n.height, n.top) * s, y = S >= D ? d : f;
|
|
3047
|
+
e.strokeStyle = y, e.lineWidth = v * s, e.beginPath(), e.moveTo(b, z), e.lineTo(b, p), e.stroke();
|
|
3048
|
+
const k = Math.min(C, m), A = Math.abs(m - C);
|
|
3049
|
+
e.fillStyle = y, e.fillRect(b - h, k, h * 2, Math.max(A, 1 * s));
|
|
3101
3050
|
}
|
|
3102
3051
|
e.restore();
|
|
3103
3052
|
};
|
|
3104
3053
|
}
|
|
3105
|
-
function
|
|
3054
|
+
function Is(t, e, n = 0) {
|
|
3106
3055
|
const s = e ?? t.series.map((c, u) => u), o = t.x.length, i = [], l = new Float64Array(o);
|
|
3107
3056
|
for (let c = 0; c < s.length; c++) {
|
|
3108
3057
|
const u = s[c];
|
|
@@ -3111,8 +3060,8 @@ function Ps(t, e, n = 0) {
|
|
|
3111
3060
|
if (d == null) continue;
|
|
3112
3061
|
const f = new Array(o);
|
|
3113
3062
|
for (let g = 0; g < o; g++) {
|
|
3114
|
-
const
|
|
3115
|
-
|
|
3063
|
+
const v = d[g];
|
|
3064
|
+
v != null ? (l[g] = l[g] + v, f[g] = l[g]) : f[g] = null;
|
|
3116
3065
|
}
|
|
3117
3066
|
i.push(f);
|
|
3118
3067
|
}
|
|
@@ -3134,7 +3083,7 @@ function Ps(t, e, n = 0) {
|
|
|
3134
3083
|
bands: a
|
|
3135
3084
|
};
|
|
3136
3085
|
}
|
|
3137
|
-
function
|
|
3086
|
+
function As(t) {
|
|
3138
3087
|
const e = /* @__PURE__ */ new Set();
|
|
3139
3088
|
for (const [i] of t)
|
|
3140
3089
|
for (let l = 0; l < i.length; l++) {
|
|
@@ -3159,29 +3108,29 @@ function Ls(t) {
|
|
|
3159
3108
|
}
|
|
3160
3109
|
return [{ x: n, series: o }];
|
|
3161
3110
|
}
|
|
3162
|
-
function
|
|
3111
|
+
function Ps(t) {
|
|
3163
3112
|
const e = (t == null ? void 0 : t.decimals) ?? 1;
|
|
3164
3113
|
return (n) => n.map((s) => {
|
|
3165
3114
|
const o = Math.abs(s);
|
|
3166
3115
|
return o >= 1e9 ? (s / 1e9).toFixed(e) + "B" : o >= 1e6 ? (s / 1e6).toFixed(e) + "M" : o >= 1e3 ? (s / 1e3).toFixed(e) + "K" : s.toFixed(o >= 1 ? 0 : e);
|
|
3167
3116
|
});
|
|
3168
3117
|
}
|
|
3169
|
-
function
|
|
3118
|
+
function Ls(t, e = 0) {
|
|
3170
3119
|
return (n) => n.map((s) => s.toFixed(e) + t);
|
|
3171
3120
|
}
|
|
3172
|
-
function
|
|
3121
|
+
function Ds(t) {
|
|
3173
3122
|
const e = (t == null ? void 0 : t.utc) ?? !1;
|
|
3174
3123
|
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
3124
|
}
|
|
3176
|
-
function
|
|
3125
|
+
function zs(t) {
|
|
3177
3126
|
const e = t != null && t.utc ? "UTC" : void 0, n = (t == null ? void 0 : t.format) ?? "short";
|
|
3178
3127
|
return (s) => s.map((o) => nt(o, { month: n }, e));
|
|
3179
3128
|
}
|
|
3180
|
-
function
|
|
3129
|
+
function Fs(t) {
|
|
3181
3130
|
const { tz: e, ...n } = t ?? {};
|
|
3182
3131
|
return (s) => s.map((o) => nt(o, n, e));
|
|
3183
3132
|
}
|
|
3184
|
-
function
|
|
3133
|
+
function Rs(t, e = 0) {
|
|
3185
3134
|
return (n) => n.map((s) => {
|
|
3186
3135
|
const o = Math.round(s) - e;
|
|
3187
3136
|
return t[o] ?? String(s);
|
|
@@ -3218,13 +3167,13 @@ function Hs(t, e = 0.8, n = 0) {
|
|
|
3218
3167
|
]
|
|
3219
3168
|
};
|
|
3220
3169
|
}
|
|
3221
|
-
function
|
|
3170
|
+
function Gs(t, e) {
|
|
3222
3171
|
const n = Ae(t);
|
|
3223
3172
|
if (n == null) return t;
|
|
3224
3173
|
const [s, o, i] = n;
|
|
3225
3174
|
return `rgba(${s},${o},${i},${e})`;
|
|
3226
3175
|
}
|
|
3227
|
-
function
|
|
3176
|
+
function _s(t, e = 65, n = 50) {
|
|
3228
3177
|
const s = [];
|
|
3229
3178
|
for (let i = 0; i < t; i++) {
|
|
3230
3179
|
const l = i * 137.508 % 360;
|
|
@@ -3233,53 +3182,52 @@ function $s(t, e = 65, n = 50) {
|
|
|
3233
3182
|
return s;
|
|
3234
3183
|
}
|
|
3235
3184
|
export {
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3185
|
+
Ms as AnnotationLabel,
|
|
3186
|
+
Dt as Axis,
|
|
3187
|
+
as as Band,
|
|
3188
|
+
Ce as Chart,
|
|
3240
3189
|
K as Direction,
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3190
|
+
N as Distribution,
|
|
3191
|
+
ms as HLine,
|
|
3192
|
+
cs as Legend,
|
|
3244
3193
|
G as Orientation,
|
|
3245
|
-
|
|
3246
|
-
ms as ResponsiveChart,
|
|
3194
|
+
vs as Region,
|
|
3247
3195
|
Lt as Scale,
|
|
3248
3196
|
Te as Series,
|
|
3249
3197
|
U as Side,
|
|
3250
3198
|
yt as SortOrder,
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3199
|
+
gs as Sparkline,
|
|
3200
|
+
ds as Timeline,
|
|
3201
|
+
us as Tooltip,
|
|
3202
|
+
ws as VLine,
|
|
3203
|
+
fs as ZoomRanger,
|
|
3204
|
+
As as alignData,
|
|
3205
|
+
Ss as bars,
|
|
3206
|
+
ks as catmullRom,
|
|
3207
|
+
Ts as drawCandlesticks,
|
|
3208
|
+
ts as drawHLine,
|
|
3209
|
+
ps as drawLabel,
|
|
3210
|
+
ns as drawRegion,
|
|
3211
|
+
es as drawVLine,
|
|
3264
3212
|
Hs as fadeGradient,
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3213
|
+
Ps as fmtCompact,
|
|
3214
|
+
Fs as fmtDateStr,
|
|
3215
|
+
Ds as fmtHourMin,
|
|
3216
|
+
Rs as fmtLabels,
|
|
3217
|
+
zs as fmtMonthName,
|
|
3218
|
+
Ls as fmtSuffix,
|
|
3271
3219
|
Qe as linear,
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3220
|
+
ys as monotoneCubic,
|
|
3221
|
+
_s as palette,
|
|
3222
|
+
Cs as points,
|
|
3275
3223
|
it as posToVal,
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3224
|
+
Mt as sideOrientation,
|
|
3225
|
+
Is as stackGroup,
|
|
3226
|
+
bs as stepped,
|
|
3279
3227
|
ot as useChart,
|
|
3280
|
-
|
|
3228
|
+
hs as useCursorDrawHook,
|
|
3281
3229
|
Pt as useDrawHook,
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3230
|
+
xs as useStreamingData,
|
|
3231
|
+
_ as valToPos,
|
|
3232
|
+
Gs as withAlpha
|
|
3285
3233
|
};
|