waveform-analysis 0.1.36 → 0.1.38
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/README.md +34 -33
- package/dist/index.cjs +1 -1
- package/dist/index.js +902 -806
- package/dist/style.css +1 -1
- package/dist/types/components/annotation/WaveformAnnotationEditor.vue.d.ts +4 -0
- package/dist/types/components/annotation/useWaveformChartAnnotations.d.ts +3 -1
- package/dist/types/components/core/constants.d.ts +3 -1
- package/dist/types/components/core/useWaveformChartController.d.ts +2 -0
- package/package.json +1 -1
- package/src/App.test.ts +4 -3
- package/src/App.vue +1 -1
- package/src/components/WaveformChartView.vue +10 -1
- package/src/components/annotation/WaveformAnnotationEditor.css +35 -104
- package/src/components/annotation/WaveformAnnotationEditor.vue +87 -37
- package/src/components/annotation/components.test.ts +134 -20
- package/src/components/annotation/markup.test.ts +18 -2
- package/src/components/annotation/markup.ts +33 -0
- package/src/components/annotation/useWaveformChartAnnotations.ts +53 -12
- package/src/components/core/constants.test.ts +29 -0
- package/src/components/core/constants.ts +31 -9
- package/src/components/waveformChartCases/annotationEditingAndReprojection.test.ts +13 -3
- package/src/components/waveformChartCases/dataAndHoverPerformance.test.ts +40 -0
- package/src/components/waveformChartCases/interactionAndAnnotationCreation.test.ts +24 -14
- package/src/components/waveformChartCases/legendVisibility.test.ts +44 -19
- package/src/components/waveformChartCases/multiAxisAndPagination.test.ts +29 -3
- package/src/components/waveformChartCases/presentationMode.test.ts +26 -5
- package/src/components/waveformChartCases/renderingStyles.test.ts +1 -1
- package/src/components/waveformChartCases/xDomainStrategy.test.ts +60 -0
- package/src/data/simulatedWaveforms.test.ts +7 -3
- package/src/data/simulatedWaveforms.ts +14 -1
- package/src/test/waveformChart.ts +12 -0
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, getCurrentInstance as l, markRaw as u, nextTick as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, reactive as _, ref as v, renderList as y, shallowReactive as b, shallowRef as x, toDisplayString as S, toRefs as C, unref as w, vModelText as T, watch as E, watchEffect as D,
|
|
2
|
-
import { axisBottom as
|
|
3
|
-
import {
|
|
4
|
-
import { ColorPicker as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, getCurrentInstance as l, markRaw as u, nextTick as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, reactive as _, ref as v, renderList as y, shallowReactive as b, shallowRef as x, toDisplayString as S, toRefs as C, unref as w, vModelText as T, watch as E, watchEffect as D, withCtx as O, withDirectives as k, withModifiers as A } from "vue";
|
|
2
|
+
import { axisBottom as j, axisLeft as M, axisRight as N, bisector as P, curveStep as F, curveStepAfter as I, curveStepBefore as L, extent as R, line as z, pointer as B, scaleLinear as V, select as H, symbol as U, symbolCircle as ee, symbolDiamond as te, symbolSquare as ne, symbolTriangle as W, zoom as re, zoomIdentity as G, zoomTransform as K } from "d3";
|
|
3
|
+
import { InputNumber as q, Modal as ie, Pagination as ae } from "ant-design-vue";
|
|
4
|
+
import { ColorPicker as J } from "vue3-colorpicker";
|
|
5
5
|
import "vue3-colorpicker/style.css";
|
|
6
6
|
//#region src/utils/waveformId.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
7
|
+
var oe = 0;
|
|
8
|
+
function se(e = "waveform") {
|
|
9
9
|
let t = l();
|
|
10
|
-
return `${e}-${t ? `v${t.uid}` : `f${++
|
|
10
|
+
return `${e}-${t ? `v${t.uid}` : `f${++oe}`}`;
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/components/annotation/annotationLayout.ts
|
|
14
|
-
function
|
|
14
|
+
function ce(e, t) {
|
|
15
15
|
return e >= Math.min(t[0], t[1]) && e <= Math.max(t[0], t[1]);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function le(e, t, n) {
|
|
18
18
|
let r = Math.max(0, Math.min(e.x, Math.max(0, t - e.width))), i = Math.max(0, Math.min(e.y, Math.max(0, n - e.height)));
|
|
19
19
|
return {
|
|
20
20
|
...e,
|
|
@@ -24,11 +24,11 @@ function ce(e, t, n) {
|
|
|
24
24
|
lineEndY: Math.max(i, Math.min(e.lineEndY, i + e.height))
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let s =
|
|
27
|
+
function ue(e, t, n, r, i, a, o) {
|
|
28
|
+
let s = pe(e, t, n, r, i);
|
|
29
29
|
return s.x >= 0 && s.y >= 0 && s.x + n <= a && s.y + r <= o;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function de(e, t, n, r, i, a) {
|
|
32
32
|
for (let o of [
|
|
33
33
|
"top",
|
|
34
34
|
"bottom",
|
|
@@ -38,10 +38,10 @@ function ue(e, t, n, r, i, a) {
|
|
|
38
38
|
"top-left",
|
|
39
39
|
"bottom-right",
|
|
40
40
|
"bottom-left"
|
|
41
|
-
]) if (
|
|
41
|
+
]) if (ue(e, t, n, r, o, i, a)) return o;
|
|
42
42
|
return "top";
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function fe(e, t, n) {
|
|
45
45
|
let r = e.x + e.width / 2, i = e.y + e.height / 2, a = t - r, o = n - i;
|
|
46
46
|
if (Math.abs(a) * e.height > Math.abs(o) * e.width) {
|
|
47
47
|
let t = a >= 0 ? e.x + e.width : e.x, n = a === 0 ? 0 : (t - r) / a;
|
|
@@ -56,7 +56,7 @@ function de(e, t, n) {
|
|
|
56
56
|
y: s
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function pe(e, t, n, r, i) {
|
|
60
60
|
let a = e - n / 2, o = t - r / 2, s = e + 32, c = e - n - 32, l = t - r - 32, u = t + 32;
|
|
61
61
|
switch (i) {
|
|
62
62
|
case "top": return {
|
|
@@ -93,36 +93,36 @@ function fe(e, t, n, r, i) {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function me(e, t, n) {
|
|
97
97
|
return {
|
|
98
|
-
width: Math.min(t, Math.max(16, Math.min(240, Math.ceil(Math.max(...e.map(
|
|
98
|
+
width: Math.min(t, Math.max(16, Math.min(240, Math.ceil(Math.max(...e.map(Ce), 0)) + 16))),
|
|
99
99
|
height: Math.min(n, Math.max(26, (e.length - 1) * 16 + 14 + 16))
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
let { width: c, height: l } =
|
|
102
|
+
function he(e, t, n, r, i, a, o = 0, s = 0) {
|
|
103
|
+
let { width: c, height: l } = me(n, r, i), u = pe(e, t, c, l, a), d = le({
|
|
104
104
|
x: u.x + o,
|
|
105
105
|
y: u.y + s,
|
|
106
106
|
width: c,
|
|
107
107
|
height: l,
|
|
108
108
|
lineEndX: e,
|
|
109
109
|
lineEndY: t
|
|
110
|
-
}, r, i), f =
|
|
110
|
+
}, r, i), f = fe(d, e, t);
|
|
111
111
|
return {
|
|
112
112
|
...d,
|
|
113
113
|
lineEndX: f.x,
|
|
114
114
|
lineEndY: f.y
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function ge(e, t, n, r) {
|
|
118
118
|
let i = [];
|
|
119
119
|
return e.forEach((e) => {
|
|
120
|
-
if (!
|
|
120
|
+
if (!Te(e)) return;
|
|
121
121
|
let a = t.find((t) => t.series.id === e.seriesId);
|
|
122
122
|
if (!a) return;
|
|
123
123
|
let o = a.xScale.domain(), s = a.yScale.domain();
|
|
124
|
-
if (!
|
|
125
|
-
let c =
|
|
124
|
+
if (!ce(e.x, o) || !ce(e.y, s)) return;
|
|
125
|
+
let c = Ee(e.text), l = a.left ?? 0, u = a.width ?? n, d = a.xScale(e.x), f = l + d, p = a.yScale(e.y) + a.top, m = Math.min(a.height, Math.max(0, r - a.top)), h = p - a.top, g = Number.isFinite(e.labelOffsetX) && e.labelOffsetX !== 0 || Number.isFinite(e.labelOffsetY) && e.labelOffsetY !== 0, { width: _, height: v } = me(c, u, m), y = g ? "top" : de(d, h, _, v, u, m), b = he(d, h, c, u, m, y, Number.isFinite(e.labelOffsetX) ? e.labelOffsetX : 0, Number.isFinite(e.labelOffsetY) ? e.labelOffsetY : 0), x = {
|
|
126
126
|
...b,
|
|
127
127
|
x: b.x + l,
|
|
128
128
|
y: b.y + a.top,
|
|
@@ -137,28 +137,42 @@ function me(e, t, n, r) {
|
|
|
137
137
|
placement: y,
|
|
138
138
|
lines: c,
|
|
139
139
|
box: { ...x },
|
|
140
|
-
style:
|
|
140
|
+
style: we(e.style)
|
|
141
141
|
});
|
|
142
142
|
}), i;
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/components/annotation/markup.ts
|
|
146
|
-
var
|
|
146
|
+
var Y = {
|
|
147
147
|
borderColor: "#1677ff",
|
|
148
148
|
textColor: "#333333",
|
|
149
149
|
backgroundColor: "rgba(255, 255, 255, 0.92)"
|
|
150
|
-
},
|
|
151
|
-
function
|
|
150
|
+
}, _e = "12px Arial, sans-serif", ve = P((e) => e.x);
|
|
151
|
+
function ye(e, t, n) {
|
|
152
|
+
let r = null;
|
|
153
|
+
for (let i of e.series.points) {
|
|
154
|
+
if (!Number.isFinite(i.x) || !Number.isFinite(i.y)) continue;
|
|
155
|
+
let a = e.xScale(i.x), o = e.top + e.yScale(i.y), s = Math.hypot(a - t, o - n);
|
|
156
|
+
(!r || s < r.distance) && (r = {
|
|
157
|
+
point: i,
|
|
158
|
+
screenX: a,
|
|
159
|
+
screenY: o,
|
|
160
|
+
distance: s
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return r;
|
|
164
|
+
}
|
|
165
|
+
function be(e, t) {
|
|
152
166
|
if (!e.length || !Number.isFinite(t)) return null;
|
|
153
|
-
let n =
|
|
167
|
+
let n = ve.center(e, t), r = e[Math.min(n, e.length - 1)], i = e[Math.max(0, n - 1)];
|
|
154
168
|
return Math.abs(t - i.x) < Math.abs(r.x - t) ? i : r;
|
|
155
169
|
}
|
|
156
|
-
function
|
|
170
|
+
function xe(e, t, n = "linear") {
|
|
157
171
|
if (!e.length || !Number.isFinite(t)) return null;
|
|
158
172
|
let r = e[0], i = e[e.length - 1];
|
|
159
173
|
if (t < r.x || t > i.x) return null;
|
|
160
174
|
if (e.length === 1) return t === r.x ? { ...r } : null;
|
|
161
|
-
let a =
|
|
175
|
+
let a = ve.left(e, t), o = e[Math.min(a, e.length - 1)];
|
|
162
176
|
if (o.x === t || a === 0) return {
|
|
163
177
|
x: t,
|
|
164
178
|
y: o.y
|
|
@@ -188,18 +202,29 @@ function _e(e, t, n = "linear") {
|
|
|
188
202
|
y: s.y + (o.y - s.y) * l
|
|
189
203
|
};
|
|
190
204
|
}
|
|
191
|
-
function
|
|
205
|
+
function X(e, t, n, r) {
|
|
192
206
|
return e.flatMap((e) => {
|
|
193
|
-
|
|
207
|
+
if (e.series.lineType === "none") {
|
|
208
|
+
let t = ye(e, n, r);
|
|
209
|
+
return t ? [{
|
|
210
|
+
trackIndex: e.index,
|
|
211
|
+
seriesId: e.series.id,
|
|
212
|
+
name: e.series.name?.trim() || e.series.id,
|
|
213
|
+
color: e.series.color || Y.borderColor,
|
|
214
|
+
unit: e.series.unit,
|
|
215
|
+
...t
|
|
216
|
+
}] : [];
|
|
217
|
+
}
|
|
218
|
+
let i = xe(e.series.points, t, e.series.lineType);
|
|
194
219
|
if (!i) return [];
|
|
195
|
-
let a =
|
|
220
|
+
let a = be(e.series.points, t);
|
|
196
221
|
if (!a) return [];
|
|
197
222
|
let o = e.xScale(i.x), s = e.top + e.yScale(i.y), c = e.xScale(a.x), l = e.top + e.yScale(a.y);
|
|
198
223
|
return [{
|
|
199
224
|
trackIndex: e.index,
|
|
200
225
|
seriesId: e.series.id,
|
|
201
226
|
name: e.series.name?.trim() || e.series.id,
|
|
202
|
-
color: e.series.color ||
|
|
227
|
+
color: e.series.color || Y.borderColor,
|
|
203
228
|
unit: e.series.unit,
|
|
204
229
|
point: a,
|
|
205
230
|
screenX: c,
|
|
@@ -208,24 +233,24 @@ function ve(e, t, n, r) {
|
|
|
208
233
|
}];
|
|
209
234
|
}).sort((e, t) => e.distance - t.distance || e.trackIndex - t.trackIndex);
|
|
210
235
|
}
|
|
211
|
-
var
|
|
212
|
-
function
|
|
236
|
+
var Z;
|
|
237
|
+
function Se(e) {
|
|
213
238
|
return Array.from(e).reduce((e, t) => e + (t.codePointAt(0) > 255 ? 12 : 6.7), 0);
|
|
214
239
|
}
|
|
215
|
-
function
|
|
216
|
-
return
|
|
240
|
+
function Ce(e) {
|
|
241
|
+
return Z === void 0 && (Z = null, typeof document < "u" && typeof CanvasRenderingContext2D < "u" && (Z = document.createElement("canvas").getContext("2d"), Z && (Z.font = _e))), Z?.measureText(e).width ?? Se(e);
|
|
217
242
|
}
|
|
218
|
-
function
|
|
243
|
+
function we(e) {
|
|
219
244
|
return {
|
|
220
|
-
borderColor: e?.borderColor ||
|
|
221
|
-
textColor: e?.textColor ||
|
|
222
|
-
backgroundColor: e?.backgroundColor ||
|
|
245
|
+
borderColor: e?.borderColor || Y.borderColor,
|
|
246
|
+
textColor: e?.textColor || Y.textColor,
|
|
247
|
+
backgroundColor: e?.backgroundColor || Y.backgroundColor
|
|
223
248
|
};
|
|
224
249
|
}
|
|
225
|
-
function
|
|
250
|
+
function Te(e) {
|
|
226
251
|
return !!(e.id && e.seriesId) && Number.isFinite(e.x) && Number.isFinite(e.y) && typeof e.text == "string" && e.text.trim().length > 0;
|
|
227
252
|
}
|
|
228
|
-
function
|
|
253
|
+
function Ee(e, t = 10) {
|
|
229
254
|
let n = [];
|
|
230
255
|
return e.split(/\r?\n/).forEach((e) => {
|
|
231
256
|
let r = Array.from(e);
|
|
@@ -238,30 +263,30 @@ function Se(e, t = 10) {
|
|
|
238
263
|
}
|
|
239
264
|
//#endregion
|
|
240
265
|
//#region src/components/annotation/WaveformAnnotationLayer.vue?vue&type=script&setup=true&lang.ts
|
|
241
|
-
var
|
|
266
|
+
var De = [
|
|
242
267
|
"data-annotation-id",
|
|
243
268
|
"data-placement",
|
|
244
269
|
"onPointerdown",
|
|
245
270
|
"onContextmenu"
|
|
246
|
-
],
|
|
271
|
+
], Oe = ["id"], ke = ["fill"], Ae = [
|
|
247
272
|
"x1",
|
|
248
273
|
"y1",
|
|
249
274
|
"x2",
|
|
250
275
|
"y2",
|
|
251
276
|
"stroke",
|
|
252
277
|
"marker-end"
|
|
253
|
-
],
|
|
278
|
+
], je = [
|
|
254
279
|
"x",
|
|
255
280
|
"y",
|
|
256
281
|
"width",
|
|
257
282
|
"height",
|
|
258
283
|
"fill",
|
|
259
284
|
"stroke"
|
|
260
|
-
],
|
|
285
|
+
], Me = [
|
|
261
286
|
"x",
|
|
262
287
|
"y",
|
|
263
288
|
"fill"
|
|
264
|
-
],
|
|
289
|
+
], Ne = ["x", "dy"], Pe = /*@__PURE__*/ c({
|
|
265
290
|
__name: "WaveformAnnotationLayer",
|
|
266
291
|
props: {
|
|
267
292
|
annotations: {},
|
|
@@ -401,7 +426,7 @@ var Ce = [
|
|
|
401
426
|
}, [a("path", {
|
|
402
427
|
d: "M0,0 L8,4 L0,8 Z",
|
|
403
428
|
fill: t.style.borderColor
|
|
404
|
-
}, null, 8,
|
|
429
|
+
}, null, 8, ke)], 8, Oe)]),
|
|
405
430
|
a("line", {
|
|
406
431
|
class: "waveform-annotation__arrow",
|
|
407
432
|
x1: b(t).lineEndX,
|
|
@@ -410,7 +435,7 @@ var Ce = [
|
|
|
410
435
|
y2: t.anchorY,
|
|
411
436
|
stroke: t.style.borderColor,
|
|
412
437
|
"marker-end": `url(#${M(t.annotation.id)})`
|
|
413
|
-
}, null, 8,
|
|
438
|
+
}, null, 8, Ae),
|
|
414
439
|
a("rect", {
|
|
415
440
|
class: "waveform-annotation__box",
|
|
416
441
|
x: b(t).x,
|
|
@@ -419,27 +444,27 @@ var Ce = [
|
|
|
419
444
|
height: b(t).height,
|
|
420
445
|
fill: t.style.backgroundColor,
|
|
421
446
|
stroke: t.style.borderColor
|
|
422
|
-
}, null, 8,
|
|
447
|
+
}, null, 8, je),
|
|
423
448
|
a("text", {
|
|
424
449
|
class: "waveform-annotation__text",
|
|
425
450
|
x: b(t).x + b(t).width / 2,
|
|
426
451
|
y: b(t).y + b(t).height / 2 - (t.lines.length - 1) * w(16) / 2,
|
|
427
452
|
fill: t.style.textColor,
|
|
428
|
-
style: p({ font: w(
|
|
453
|
+
style: p({ font: w(_e) }),
|
|
429
454
|
"text-anchor": "middle",
|
|
430
455
|
"dominant-baseline": "central"
|
|
431
456
|
}, [(g(!0), i(e, null, y(t.lines, (e, n) => (g(), i("tspan", {
|
|
432
457
|
key: `${t.annotation.id}-${n}`,
|
|
433
458
|
x: b(t).x + b(t).width / 2,
|
|
434
459
|
dy: n === 0 ? 0 : w(16)
|
|
435
|
-
}, S(e), 9,
|
|
436
|
-
], 40,
|
|
460
|
+
}, S(e), 9, Ne))), 128))], 12, Me)
|
|
461
|
+
], 40, De))), 128))], 2)) : r("", !0);
|
|
437
462
|
}
|
|
438
|
-
}),
|
|
463
|
+
}), Fe = (e, t) => {
|
|
439
464
|
let n = e.__vccOpts || e;
|
|
440
465
|
for (let [e, r] of t) n[e] = r;
|
|
441
466
|
return n;
|
|
442
|
-
},
|
|
467
|
+
}, Ie = /*#__PURE__*/ Fe(Pe, [["__scopeId", "data-v-7254383e"]]), Le = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
443
468
|
__name: "WaveformAnnotationContextMenu",
|
|
444
469
|
props: {
|
|
445
470
|
visible: { type: Boolean },
|
|
@@ -462,7 +487,7 @@ var Ce = [
|
|
|
462
487
|
top: `${n.y}px`
|
|
463
488
|
}),
|
|
464
489
|
role: "menu",
|
|
465
|
-
onContextmenu: t[3] ||=
|
|
490
|
+
onContextmenu: t[3] ||= A(() => {}, ["prevent"])
|
|
466
491
|
}, [
|
|
467
492
|
a("button", {
|
|
468
493
|
type: "button",
|
|
@@ -481,50 +506,50 @@ var Ce = [
|
|
|
481
506
|
}, "取消")
|
|
482
507
|
], 36)) : r("", !0);
|
|
483
508
|
}
|
|
484
|
-
}), [["__scopeId", "data-v-c70c98a1"]]),
|
|
509
|
+
}), [["__scopeId", "data-v-c70c98a1"]]), Re = 1;
|
|
485
510
|
function Q(e) {
|
|
486
511
|
throw TypeError(`Invalid waveform annotation file: ${e}`);
|
|
487
512
|
}
|
|
488
|
-
function
|
|
513
|
+
function ze(e) {
|
|
489
514
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
490
515
|
}
|
|
491
|
-
function
|
|
516
|
+
function Be(e, t, n) {
|
|
492
517
|
let r = e[t];
|
|
493
518
|
return (typeof r != "string" || r.trim().length === 0) && Q(`${n}.${t} must be a non-empty string`), r;
|
|
494
519
|
}
|
|
495
|
-
function
|
|
520
|
+
function Ve(e, t, n) {
|
|
496
521
|
let r = e[t];
|
|
497
522
|
if (r !== void 0) return typeof r != "string" && Q(`${n}.${t} must be a string`), r;
|
|
498
523
|
}
|
|
499
|
-
function
|
|
524
|
+
function He(e, t, n) {
|
|
500
525
|
let r = e[t];
|
|
501
526
|
return (typeof r != "number" || !Number.isFinite(r)) && Q(`${n}.${t} must be a finite number`), r;
|
|
502
527
|
}
|
|
503
|
-
function
|
|
528
|
+
function Ue(e, t, n) {
|
|
504
529
|
let r = e[t];
|
|
505
530
|
if (r !== void 0) return (typeof r != "number" || !Number.isFinite(r)) && Q(`${n}.${t} must be a finite number`), r;
|
|
506
531
|
}
|
|
507
|
-
function
|
|
532
|
+
function We(e, t) {
|
|
508
533
|
if (e === void 0) return;
|
|
509
|
-
|
|
510
|
-
let n =
|
|
534
|
+
ze(e) || Q(`${t} must be an object`);
|
|
535
|
+
let n = Ve(e, "borderColor", t), r = Ve(e, "textColor", t), i = Ve(e, "backgroundColor", t);
|
|
511
536
|
return {
|
|
512
537
|
...n !== void 0 && { borderColor: n },
|
|
513
538
|
...r !== void 0 && { textColor: r },
|
|
514
539
|
...i !== void 0 && { backgroundColor: i }
|
|
515
540
|
};
|
|
516
541
|
}
|
|
517
|
-
function
|
|
542
|
+
function Ge(e, t) {
|
|
518
543
|
let n = `annotations[${t}]`;
|
|
519
|
-
|
|
520
|
-
let r =
|
|
544
|
+
ze(e) || Q(`${n} must be an object`);
|
|
545
|
+
let r = Be(e, "text", n);
|
|
521
546
|
r.length > 40 && Q(`${n}.text must not exceed 40 characters`);
|
|
522
|
-
let i =
|
|
547
|
+
let i = Ue(e, "labelOffsetX", n), a = Ue(e, "labelOffsetY", n), o = Ve(e, "createdAt", n), s = We(e.style, `${n}.style`);
|
|
523
548
|
return {
|
|
524
|
-
id:
|
|
525
|
-
seriesId:
|
|
526
|
-
x:
|
|
527
|
-
y:
|
|
549
|
+
id: Be(e, "id", n),
|
|
550
|
+
seriesId: Be(e, "seriesId", n),
|
|
551
|
+
x: He(e, "x", n),
|
|
552
|
+
y: He(e, "y", n),
|
|
528
553
|
text: r,
|
|
529
554
|
...i !== void 0 && { labelOffsetX: i },
|
|
530
555
|
...a !== void 0 && { labelOffsetY: a },
|
|
@@ -532,19 +557,19 @@ function Ve(e, t) {
|
|
|
532
557
|
...o !== void 0 && { createdAt: o }
|
|
533
558
|
};
|
|
534
559
|
}
|
|
535
|
-
function
|
|
536
|
-
let t = e.map(
|
|
560
|
+
function Ke(e) {
|
|
561
|
+
let t = e.map(Ge), n = /* @__PURE__ */ new Set();
|
|
537
562
|
return t.forEach((e, t) => {
|
|
538
563
|
n.has(e.id) && Q(`annotations[${t}].id must be unique`), n.add(e.id);
|
|
539
564
|
}), t;
|
|
540
565
|
}
|
|
541
|
-
function
|
|
566
|
+
function qe(e) {
|
|
542
567
|
return JSON.stringify({
|
|
543
|
-
version:
|
|
544
|
-
annotations:
|
|
568
|
+
version: Re,
|
|
569
|
+
annotations: Ke(e)
|
|
545
570
|
}, null, 2);
|
|
546
571
|
}
|
|
547
|
-
function
|
|
572
|
+
function Je(e) {
|
|
548
573
|
typeof e != "string" && Q("input must be a JSON string");
|
|
549
574
|
let t;
|
|
550
575
|
try {
|
|
@@ -552,11 +577,11 @@ function We(e) {
|
|
|
552
577
|
} catch {
|
|
553
578
|
Q("input is not valid JSON");
|
|
554
579
|
}
|
|
555
|
-
return
|
|
580
|
+
return ze(t) || Q("root must be an object"), t.version !== Re && Q(`version must be ${Re}`), Array.isArray(t.annotations) || Q("annotations must be an array"), Ke(t.annotations);
|
|
556
581
|
}
|
|
557
582
|
//#endregion
|
|
558
583
|
//#region src/components/annotation/useWaveformAnnotationInteraction.ts
|
|
559
|
-
function
|
|
584
|
+
function Ye() {
|
|
560
585
|
let e = v(null), t = v(null);
|
|
561
586
|
return {
|
|
562
587
|
editorDraft: e,
|
|
@@ -598,12 +623,12 @@ function Ge() {
|
|
|
598
623
|
//#region src/utils/domain.ts
|
|
599
624
|
function $(e) {
|
|
600
625
|
if (e.length === 0) return [0, 1];
|
|
601
|
-
let [t = 0, n = 1] =
|
|
626
|
+
let [t = 0, n = 1] = R(e);
|
|
602
627
|
if (t !== n) return [t, n];
|
|
603
628
|
let r = Math.abs(t) * .05 || .5;
|
|
604
629
|
return [t - r, n + r];
|
|
605
630
|
}
|
|
606
|
-
function
|
|
631
|
+
function Xe(e, t = 5, n) {
|
|
607
632
|
let r = e;
|
|
608
633
|
if (n && e.length >= 2) {
|
|
609
634
|
let t = e[0], n = e[1], i = e[e.length - 1], a = e[e.length - 2];
|
|
@@ -625,69 +650,69 @@ function Ke(e, t = 5, n) {
|
|
|
625
650
|
}
|
|
626
651
|
//#endregion
|
|
627
652
|
//#region src/utils/formatters.ts
|
|
628
|
-
var
|
|
629
|
-
function
|
|
653
|
+
var Ze = .001, Qe = 1e3, $e = new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 4 }), et = new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 4 });
|
|
654
|
+
function tt(e, t) {
|
|
630
655
|
let n = e.toFixed(Math.max(0, t));
|
|
631
656
|
return /^-0(?:\.0+)?$/.test(n) ? n.slice(1) : n;
|
|
632
657
|
}
|
|
633
|
-
function
|
|
634
|
-
return Number.isFinite(e) && (e >=
|
|
658
|
+
function nt(e) {
|
|
659
|
+
return Number.isFinite(e) && (e >= Qe || e > 0 && e < Ze);
|
|
635
660
|
}
|
|
636
|
-
function
|
|
661
|
+
function rt(e, t) {
|
|
637
662
|
if (typeof e != "number" || typeof t != "number") return null;
|
|
638
663
|
let n = Math.max(Math.abs(e), Math.abs(t));
|
|
639
|
-
return
|
|
664
|
+
return nt(n) ? Math.floor(Math.log10(n)) : null;
|
|
640
665
|
}
|
|
641
|
-
function
|
|
666
|
+
function it(e) {
|
|
642
667
|
return `E${e >= 0 ? "+" : "-"}${Math.abs(e).toString().padStart(2, "0")}`;
|
|
643
668
|
}
|
|
644
|
-
function
|
|
669
|
+
function at(e) {
|
|
645
670
|
if (Object.is(e, -0)) return "0";
|
|
646
|
-
let t = e === 0 ? 0 : Number(e.toPrecision(5)), n =
|
|
671
|
+
let t = e === 0 ? 0 : Number(e.toPrecision(5)), n = $e.format(t);
|
|
647
672
|
return n === "-0" ? "0" : n;
|
|
648
673
|
}
|
|
649
|
-
function
|
|
674
|
+
function ot(e, t = {}) {
|
|
650
675
|
if (!Number.isFinite(e)) return String(e);
|
|
651
|
-
let n =
|
|
652
|
-
return n !== null && e === i ? `${
|
|
676
|
+
let n = rt(t.axisMin, t.axisMax), r = at(n === null ? e : e / 10 ** n), i = t.topTickValue ?? t.axisMax;
|
|
677
|
+
return n !== null && e === i ? `${it(n)} ${r}` : r;
|
|
653
678
|
}
|
|
654
|
-
function
|
|
655
|
-
return Number.isFinite(e) ? Object.is(e, -0) ? "0" :
|
|
679
|
+
function st(e) {
|
|
680
|
+
return Number.isFinite(e) ? Object.is(e, -0) ? "0" : et.format(e) : String(e);
|
|
656
681
|
}
|
|
657
|
-
function
|
|
682
|
+
function ct(e) {
|
|
658
683
|
if (!Number.isFinite(e)) return String(e);
|
|
659
684
|
if (Object.is(e, -0)) return "0";
|
|
660
685
|
let [t, n] = e.toExponential().split("e"), r = Number(n), i = t.startsWith("-"), a = t.replace("-", "").replace(".", ""), o = r + 1, s;
|
|
661
686
|
return s = o <= 0 ? `0.${"0".repeat(Math.abs(o))}${a}` : o >= a.length ? `${a}${"0".repeat(o - a.length)}` : `${a.slice(0, o)}.${a.slice(o)}`, `${i ? "-" : ""}${s}`;
|
|
662
687
|
}
|
|
663
|
-
function
|
|
688
|
+
function lt(e, t) {
|
|
664
689
|
return t === "ms" ? e * 1e3 : e;
|
|
665
690
|
}
|
|
666
|
-
function
|
|
667
|
-
let a =
|
|
691
|
+
function ut(e, t, n, r, i) {
|
|
692
|
+
let a = lt(e, n);
|
|
668
693
|
return i ? i(a, {
|
|
669
694
|
kind: r,
|
|
670
695
|
rawValue: e,
|
|
671
696
|
timeUnit: n,
|
|
672
697
|
domain: [t[0], t[1]],
|
|
673
|
-
displayDomain: [
|
|
674
|
-
}) :
|
|
698
|
+
displayDomain: [lt(t[0], n), lt(t[1], n)]
|
|
699
|
+
}) : ct(a);
|
|
675
700
|
}
|
|
676
|
-
function
|
|
677
|
-
return
|
|
701
|
+
function dt(e, t, n) {
|
|
702
|
+
return ut(e, t, n, "end");
|
|
678
703
|
}
|
|
679
|
-
function
|
|
680
|
-
return
|
|
704
|
+
function ft(e, t, n) {
|
|
705
|
+
return ut(e, n ?? [e, e], t, "tick");
|
|
681
706
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
707
|
+
function pt(e, t) {
|
|
708
|
+
return st(lt(e, t));
|
|
684
709
|
}
|
|
685
|
-
function
|
|
686
|
-
return Number.isFinite(e) ?
|
|
710
|
+
function mt(e, t) {
|
|
711
|
+
return Number.isFinite(e) ? tt(lt(e, t), 3) : String(e);
|
|
687
712
|
}
|
|
688
713
|
//#endregion
|
|
689
714
|
//#region src/utils/geometry.ts
|
|
690
|
-
function
|
|
715
|
+
function ht(e, t, n) {
|
|
691
716
|
if (e <= 0) return {
|
|
692
717
|
gap: 0,
|
|
693
718
|
axisBand: 0,
|
|
@@ -700,66 +725,55 @@ function dt(e, t, n) {
|
|
|
700
725
|
height: Math.max(1, (n - (e - 1) * (c + l)) / e)
|
|
701
726
|
};
|
|
702
727
|
}
|
|
703
|
-
function
|
|
728
|
+
function gt(e, t, n) {
|
|
704
729
|
return Math.min(Math.max(e, t), n);
|
|
705
730
|
}
|
|
706
731
|
//#endregion
|
|
707
732
|
//#region src/components/core/constants.ts
|
|
708
|
-
var
|
|
733
|
+
var _t = {
|
|
709
734
|
top: 18,
|
|
710
735
|
right: 24,
|
|
711
736
|
bottom: 52,
|
|
712
737
|
left: 64
|
|
713
|
-
},
|
|
738
|
+
}, vt = {
|
|
714
739
|
DEFAULT_MAX_SCALE: 40,
|
|
715
740
|
MIN_SCALE: 1
|
|
716
|
-
},
|
|
717
|
-
"#0960bd",
|
|
718
|
-
"#ff7f0e",
|
|
719
|
-
"#389e0d",
|
|
720
|
-
"#cf1322",
|
|
721
|
-
"#531dab",
|
|
722
|
-
"#08979c",
|
|
723
|
-
"#c41d7f",
|
|
724
|
-
"#434343",
|
|
725
|
-
"#7cb305",
|
|
726
|
-
"#1d39c4"
|
|
727
|
-
], vt = {
|
|
741
|
+
}, yt = .62, bt = 1.2, xt = /* @__PURE__ */ "#0960bd.#ff7f0e.#2ca02c.#d62728.#9467bd.#8c564b.#e377c2.#7f7f7f.#bcbd22.#17becf.#005f73.#0a9396.#ae2012.#bb3e03.#ca6702.#ee9b00.#9b2226.#3a0ca3.#4361ee.#4895ef.#560bad.#7209b7.#b5179e.#f72585.#006d77.#2f3e46.#354f52.#52796f.#800f2f.#31572c".split("."), St = {
|
|
728
742
|
WIDTH: 1.5,
|
|
729
743
|
CAP_WIDTH: 8
|
|
730
|
-
},
|
|
744
|
+
}, Ct = {
|
|
731
745
|
COLOR: "#98a2b3",
|
|
732
746
|
WIDTH: 1,
|
|
733
747
|
DASH: "6 4"
|
|
734
748
|
};
|
|
735
749
|
//#endregion
|
|
736
750
|
//#region src/components/core/yDomain.ts
|
|
737
|
-
function
|
|
751
|
+
function wt(e) {
|
|
738
752
|
if (!(!e || !Number.isFinite(e[0]) || !Number.isFinite(e[1]) || e[0] === e[1])) return e[0] < e[1] ? [e[0], e[1]] : [e[1], e[0]];
|
|
739
753
|
}
|
|
740
|
-
function
|
|
741
|
-
return
|
|
754
|
+
function Tt(e, t) {
|
|
755
|
+
return wt(t?.[e.id]);
|
|
742
756
|
}
|
|
743
|
-
function
|
|
744
|
-
return
|
|
757
|
+
function Et(e, t, n) {
|
|
758
|
+
return wt(n?.[e.id]) ?? wt(t);
|
|
745
759
|
}
|
|
746
|
-
function
|
|
747
|
-
return !!(
|
|
760
|
+
function Dt(e, t, n) {
|
|
761
|
+
return !!(Tt(e, n) || e.visibleSeries.some((e) => Et(e, t, n)));
|
|
748
762
|
}
|
|
749
|
-
function
|
|
763
|
+
function Ot(e) {
|
|
750
764
|
return [Math.min(...e.map((e) => e[0])), Math.max(...e.map((e) => e[1]))];
|
|
751
765
|
}
|
|
752
766
|
//#endregion
|
|
753
767
|
//#region src/core/data.ts
|
|
754
|
-
var
|
|
755
|
-
function
|
|
768
|
+
var kt = St.WIDTH, At = St.CAP_WIDTH;
|
|
769
|
+
function jt(e) {
|
|
756
770
|
return e === "dashed" || e === "dash-dot" ? e : "solid";
|
|
757
771
|
}
|
|
758
|
-
function
|
|
772
|
+
function Mt(e) {
|
|
759
773
|
return typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : void 0;
|
|
760
774
|
}
|
|
761
|
-
function
|
|
762
|
-
let t =
|
|
775
|
+
function Nt(e) {
|
|
776
|
+
let t = Mt(e.error), n = Mt(e.lowerError), r = Mt(e.upperError);
|
|
763
777
|
return {
|
|
764
778
|
x: e.x,
|
|
765
779
|
y: e.y,
|
|
@@ -768,14 +782,14 @@ function kt(e) {
|
|
|
768
782
|
...r === void 0 ? {} : { upperError: r }
|
|
769
783
|
};
|
|
770
784
|
}
|
|
771
|
-
function
|
|
772
|
-
let t =
|
|
785
|
+
function Pt(e) {
|
|
786
|
+
let t = Mt(e.error) ?? 0;
|
|
773
787
|
return {
|
|
774
|
-
lower:
|
|
775
|
-
upper:
|
|
788
|
+
lower: Mt(e.lowerError) ?? t,
|
|
789
|
+
upper: Mt(e.upperError) ?? t
|
|
776
790
|
};
|
|
777
791
|
}
|
|
778
|
-
function
|
|
792
|
+
function Ft(e) {
|
|
779
793
|
if (e.kind === "samples") {
|
|
780
794
|
if (!Number.isFinite(e.sampleRate) || e.sampleRate <= 0) return [];
|
|
781
795
|
let t = Number.isFinite(e.startTime) ? e.startTime ?? 0 : 0, n = [];
|
|
@@ -791,14 +805,14 @@ function jt(e) {
|
|
|
791
805
|
let t = [], n = -Infinity, r = !0;
|
|
792
806
|
for (let i of e.points) {
|
|
793
807
|
if (!Number.isFinite(i.x) || !Number.isFinite(i.y)) continue;
|
|
794
|
-
let e =
|
|
808
|
+
let e = Nt(i);
|
|
795
809
|
e.x < n && (r = !1), n = e.x, t.push(e);
|
|
796
810
|
}
|
|
797
811
|
return r || t.sort((e, t) => e.x - t.x), t;
|
|
798
812
|
}
|
|
799
|
-
function
|
|
813
|
+
function It(e) {
|
|
800
814
|
if (e.kind !== "series") {
|
|
801
|
-
let t =
|
|
815
|
+
let t = Ft(e);
|
|
802
816
|
return t.length > 0 ? [{
|
|
803
817
|
id: "series-0",
|
|
804
818
|
name: "",
|
|
@@ -807,8 +821,8 @@ function Mt(e) {
|
|
|
807
821
|
pointType: "none",
|
|
808
822
|
errorBar: {
|
|
809
823
|
visible: !1,
|
|
810
|
-
width:
|
|
811
|
-
capWidth:
|
|
824
|
+
width: kt,
|
|
825
|
+
capWidth: At
|
|
812
826
|
},
|
|
813
827
|
points: t
|
|
814
828
|
}] : [];
|
|
@@ -818,7 +832,7 @@ function Mt(e) {
|
|
|
818
832
|
let r = e.id?.trim() || `series-${n}`, i = r, a = 1;
|
|
819
833
|
for (; t.has(i);) i = `${r}-${a}`, a++;
|
|
820
834
|
t.add(i);
|
|
821
|
-
let o = e.lineType ?? "linear", s =
|
|
835
|
+
let o = e.lineType ?? "linear", s = jt(e.lineStyle), c = e.pointType ?? "none", l = e.errorBar?.visible === !0, u = o === "none" && c === "none" && !l ? "linear" : o, d = Number(e.errorBar?.width), f = Number(e.errorBar?.capWidth);
|
|
822
836
|
return {
|
|
823
837
|
id: i,
|
|
824
838
|
shotNo: e.shotNo?.trim() || void 0,
|
|
@@ -832,29 +846,29 @@ function Mt(e) {
|
|
|
832
846
|
errorBar: {
|
|
833
847
|
visible: l,
|
|
834
848
|
color: e.errorBar?.color,
|
|
835
|
-
width: Number.isFinite(d) && d > 0 ? d :
|
|
836
|
-
capWidth: Number.isFinite(f) && f > 0 ? f :
|
|
849
|
+
width: Number.isFinite(d) && d > 0 ? d : kt,
|
|
850
|
+
capWidth: Number.isFinite(f) && f > 0 ? f : At
|
|
837
851
|
},
|
|
838
|
-
points:
|
|
852
|
+
points: Ft(e.data)
|
|
839
853
|
};
|
|
840
854
|
}).filter((e) => e.points.length > 0);
|
|
841
855
|
}
|
|
842
856
|
//#endregion
|
|
843
857
|
//#region src/core/renderingStrategies.ts
|
|
844
|
-
function
|
|
858
|
+
function Lt(e, t) {
|
|
845
859
|
return {
|
|
846
860
|
start: Math.max(0, e.start - 1),
|
|
847
861
|
end: Math.min(t, e.end + 1)
|
|
848
862
|
};
|
|
849
863
|
}
|
|
850
|
-
function
|
|
864
|
+
function Rt(e, t) {
|
|
851
865
|
t && e[e.length - 1] !== t && e.push(t);
|
|
852
866
|
}
|
|
853
|
-
var
|
|
854
|
-
let { start: t, end: n } =
|
|
867
|
+
var zt = (e) => {
|
|
868
|
+
let { start: t, end: n } = Lt(e.range, e.points.length);
|
|
855
869
|
return e.points.slice(t, n);
|
|
856
|
-
},
|
|
857
|
-
let { points: t, range: n, domain: r, width: i, options: a } = e, { start: o, end: s } =
|
|
870
|
+
}, Bt = (e) => {
|
|
871
|
+
let { points: t, range: n, domain: r, width: i, options: a } = e, { start: o, end: s } = Lt(n, t.length);
|
|
858
872
|
if (s - o <= 0) return [];
|
|
859
873
|
let c = Math.min(r[0], r[1]), l = Math.max(r[0], r[1]), u = Math.max(4, Math.floor(i * a.maxPointsPerPixel)), d = Math.max(1, Math.floor(u / 4)), f = [], p = l - c || 1, m = Array.from({ length: 4 }, () => -1), h = -1, g = -1, _ = -1, v = -1, y = -1, b = (e, t) => {
|
|
860
874
|
if (e < 0) return t;
|
|
@@ -869,9 +883,9 @@ var Ft = (e) => {
|
|
|
869
883
|
for (; n >= 0 && m[n] > e;) m[n + 1] = m[n], --n;
|
|
870
884
|
m[n + 1] = e;
|
|
871
885
|
}
|
|
872
|
-
for (let n = 0; n < e; n += 1)
|
|
886
|
+
for (let n = 0; n < e; n += 1) Rt(f, t[m[n]]);
|
|
873
887
|
};
|
|
874
|
-
|
|
888
|
+
Rt(f, t[o]);
|
|
875
889
|
for (let e = n.start; e < n.end; e += 1) {
|
|
876
890
|
let n = t[e], r = Math.min(d - 1, Math.max(0, Math.floor((n.x - c) / p * d)));
|
|
877
891
|
if (r !== h) {
|
|
@@ -880,53 +894,53 @@ var Ft = (e) => {
|
|
|
880
894
|
}
|
|
881
895
|
_ = e, n.y < t[v].y && (v = e), n.y > t[y].y && (y = e);
|
|
882
896
|
}
|
|
883
|
-
return x(),
|
|
897
|
+
return x(), Rt(f, t[s - 1]), f;
|
|
884
898
|
};
|
|
885
|
-
function
|
|
899
|
+
function Vt(e) {
|
|
886
900
|
let t = Math.max(4, Math.floor(e.width * e.options.maxPointsPerPixel));
|
|
887
|
-
return !e.options.downsample || e.visibleCount <= e.options.downsampleThreshold || e.visibleCount <= t ?
|
|
901
|
+
return !e.options.downsample || e.visibleCount <= e.options.downsampleThreshold || e.visibleCount <= t ? zt : Bt;
|
|
888
902
|
}
|
|
889
903
|
//#endregion
|
|
890
904
|
//#region src/core/renderingOptions.ts
|
|
891
|
-
var
|
|
905
|
+
var Ht = {
|
|
892
906
|
downsample: !0,
|
|
893
907
|
downsampleThreshold: 2e3,
|
|
894
908
|
maxPointsPerPixel: 4,
|
|
895
909
|
pointMinSpacing: 10,
|
|
896
910
|
errorBarMinSpacing: 12
|
|
897
911
|
};
|
|
898
|
-
function
|
|
912
|
+
function Ut(e) {
|
|
899
913
|
let t = Number(e?.downsampleThreshold), n = Number(e?.maxPointsPerPixel), r = Number(e?.pointMinSpacing), i = Number(e?.errorBarMinSpacing);
|
|
900
914
|
return {
|
|
901
|
-
downsample: e?.downsample ??
|
|
902
|
-
downsampleThreshold: Number.isFinite(t) && t >= 2 ? Math.floor(t) :
|
|
903
|
-
maxPointsPerPixel: Number.isFinite(n) && n > 0 ? n :
|
|
904
|
-
pointMinSpacing: Number.isFinite(r) && r >= 0 ? r :
|
|
905
|
-
errorBarMinSpacing: Number.isFinite(i) && i >= 0 ? i :
|
|
915
|
+
downsample: e?.downsample ?? Ht.downsample,
|
|
916
|
+
downsampleThreshold: Number.isFinite(t) && t >= 2 ? Math.floor(t) : Ht.downsampleThreshold,
|
|
917
|
+
maxPointsPerPixel: Number.isFinite(n) && n > 0 ? n : Ht.maxPointsPerPixel,
|
|
918
|
+
pointMinSpacing: Number.isFinite(r) && r >= 0 ? r : Ht.pointMinSpacing,
|
|
919
|
+
errorBarMinSpacing: Number.isFinite(i) && i >= 0 ? i : Ht.errorBarMinSpacing
|
|
906
920
|
};
|
|
907
921
|
}
|
|
908
922
|
//#endregion
|
|
909
923
|
//#region src/core/rendering.ts
|
|
910
|
-
var
|
|
911
|
-
function
|
|
924
|
+
var Wt = P((e) => e.x), Gt = () => !0;
|
|
925
|
+
function Kt(e, t) {
|
|
912
926
|
let n = Math.min(t[0], t[1]), r = Math.max(t[0], t[1]);
|
|
913
927
|
return {
|
|
914
|
-
start:
|
|
915
|
-
end:
|
|
928
|
+
start: Wt.left(e, n),
|
|
929
|
+
end: Wt.right(e, r)
|
|
916
930
|
};
|
|
917
931
|
}
|
|
918
|
-
function
|
|
932
|
+
function qt(e, t, n) {
|
|
919
933
|
if (!Number.isFinite(n) || n <= 0) return !0;
|
|
920
934
|
let r = Math.ceil(n), i = /* @__PURE__ */ new Set();
|
|
921
935
|
for (let n of e) {
|
|
922
|
-
let e =
|
|
936
|
+
let e = Kt(n.points, t);
|
|
923
937
|
for (let t = e.start; t < e.end; t += 1) if (i.add(n.points[t].x), i.size >= r) return !0;
|
|
924
938
|
}
|
|
925
939
|
return !1;
|
|
926
940
|
}
|
|
927
|
-
function
|
|
941
|
+
function Jt(e, t, n, r, i) {
|
|
928
942
|
let a = Math.max(0, t.start - 1), o = Math.min(e.length, t.end + 1) - a;
|
|
929
|
-
return o <= 0 ? [] :
|
|
943
|
+
return o <= 0 ? [] : Vt({
|
|
930
944
|
visibleCount: o,
|
|
931
945
|
width: r,
|
|
932
946
|
options: i
|
|
@@ -938,12 +952,12 @@ function Wt(e, t, n, r, i) {
|
|
|
938
952
|
options: i
|
|
939
953
|
});
|
|
940
954
|
}
|
|
941
|
-
function
|
|
942
|
-
return !e.length || n <= 0 ? [] :
|
|
955
|
+
function Yt(e, t, n, r) {
|
|
956
|
+
return !e.length || n <= 0 ? [] : Jt(e, Kt(e, t), t, n, r);
|
|
943
957
|
}
|
|
944
|
-
function
|
|
958
|
+
function Xt(e, t, n, r, i, a, o, s) {
|
|
945
959
|
if (!a || i === 0) {
|
|
946
|
-
if (o ===
|
|
960
|
+
if (o === Gt) return e.slice(t.start, t.end);
|
|
947
961
|
let n = [];
|
|
948
962
|
for (let r = t.start; r < t.end; r += 1) o(e[r]) && n.push(e[r]);
|
|
949
963
|
return n;
|
|
@@ -976,36 +990,36 @@ function Kt(e, t, n, r, i, a, o, s) {
|
|
|
976
990
|
let w = (f ?? []).map((e, t) => m?.[t] ?? e).filter((e) => e !== void 0);
|
|
977
991
|
return v && w[0] !== v && w.unshift(v), y && w.at(-1) !== y && w.push(y), w;
|
|
978
992
|
}
|
|
979
|
-
function
|
|
980
|
-
let { lower: t, upper: n } =
|
|
993
|
+
function Zt(e) {
|
|
994
|
+
let { lower: t, upper: n } = Pt(e);
|
|
981
995
|
return t !== 0 || n !== 0;
|
|
982
996
|
}
|
|
983
|
-
function
|
|
997
|
+
function Qt(e, t, n, r, i) {
|
|
984
998
|
if (!e.length || n <= 0) return {
|
|
985
999
|
linePoints: [],
|
|
986
1000
|
pointRenderPoints: [],
|
|
987
1001
|
errorBarRenderPoints: []
|
|
988
1002
|
};
|
|
989
|
-
let a =
|
|
1003
|
+
let a = Kt(e, t), o = i.lineVisible ? Jt(e, a, t, n, r) : [], s = i.errorBarVisible && i.hasErrorPoints;
|
|
990
1004
|
if (i.pointVisible && s) {
|
|
991
|
-
let i =
|
|
1005
|
+
let i = Xt(e, a, t, n, Math.max(r.pointMinSpacing, r.errorBarMinSpacing), r.downsample, Gt, Zt);
|
|
992
1006
|
return {
|
|
993
1007
|
linePoints: o,
|
|
994
1008
|
pointRenderPoints: i,
|
|
995
|
-
errorBarRenderPoints: i.filter(
|
|
1009
|
+
errorBarRenderPoints: i.filter(Zt)
|
|
996
1010
|
};
|
|
997
1011
|
}
|
|
998
1012
|
return {
|
|
999
1013
|
linePoints: o,
|
|
1000
|
-
pointRenderPoints: i.pointVisible ?
|
|
1001
|
-
errorBarRenderPoints: s ?
|
|
1014
|
+
pointRenderPoints: i.pointVisible ? Xt(e, a, t, n, r.pointMinSpacing, r.downsample, Gt) : [],
|
|
1015
|
+
errorBarRenderPoints: s ? Xt(e, a, t, n, r.errorBarMinSpacing, r.downsample, Zt) : []
|
|
1002
1016
|
};
|
|
1003
1017
|
}
|
|
1004
|
-
var
|
|
1018
|
+
var $t = (e, t) => {
|
|
1005
1019
|
let n = typeof e == "number" ? e : Number(e);
|
|
1006
1020
|
return Number.isFinite(n) ? Math.min(10, Math.max(1, Math.floor(n))) : t;
|
|
1007
1021
|
};
|
|
1008
|
-
function
|
|
1022
|
+
function en(e) {
|
|
1009
1023
|
let t = Object.fromEntries(Object.entries(e?.trackLines ?? {}).map(([e, t]) => [e, {
|
|
1010
1024
|
horizontal: typeof t?.horizontal != "boolean" || t.horizontal,
|
|
1011
1025
|
vertical: typeof t?.vertical != "boolean" || t.vertical,
|
|
@@ -1013,37 +1027,37 @@ function Xt(e) {
|
|
|
1013
1027
|
verticalColor: typeof t?.verticalColor == "string" && t.verticalColor.trim() ? t.verticalColor : void 0
|
|
1014
1028
|
}]));
|
|
1015
1029
|
return {
|
|
1016
|
-
rowCount:
|
|
1017
|
-
columnCount:
|
|
1030
|
+
rowCount: $t(e?.rowCount, 2),
|
|
1031
|
+
columnCount: $t(e?.columnCount, 1),
|
|
1018
1032
|
showPagination: e?.showPagination ?? !0,
|
|
1019
1033
|
trackLines: t
|
|
1020
1034
|
};
|
|
1021
1035
|
}
|
|
1022
|
-
function
|
|
1036
|
+
function tn(e) {
|
|
1023
1037
|
return e.rowCount * e.columnCount;
|
|
1024
1038
|
}
|
|
1025
|
-
function
|
|
1026
|
-
return Math.max(1, Math.ceil(Math.max(0, e) /
|
|
1039
|
+
function nn(e, t) {
|
|
1040
|
+
return Math.max(1, Math.ceil(Math.max(0, e) / tn(t)));
|
|
1027
1041
|
}
|
|
1028
|
-
function
|
|
1029
|
-
let r =
|
|
1030
|
-
return e.slice(i, i +
|
|
1042
|
+
function rn(e, t, n) {
|
|
1043
|
+
let r = nn(e.length, n), i = (Math.min(r, Math.max(1, Math.floor(t))) - 1) * tn(n);
|
|
1044
|
+
return e.slice(i, i + tn(n));
|
|
1031
1045
|
}
|
|
1032
|
-
function
|
|
1046
|
+
function an(e) {
|
|
1033
1047
|
return e === "compact" ? 0 : e === "separated" ? 16 : 14;
|
|
1034
1048
|
}
|
|
1035
|
-
function
|
|
1036
|
-
let s =
|
|
1049
|
+
function on(e, t, n, r, i = [], a, o = !0) {
|
|
1050
|
+
let s = an(r), c = Number.isFinite(a) ? Math.max(0, a) : s, l = Math.max(0, n.columnCount - 1) * c, u = /* @__PURE__ */ new Set();
|
|
1037
1051
|
if (o) {
|
|
1038
1052
|
if (r === "independent") for (let e = 0; e < n.rowCount; e += 1) u.add(e);
|
|
1039
1053
|
else if (r === "compact") u.add(n.rowCount - 1);
|
|
1040
|
-
else for (let e = 0; e < n.columnCount; e += 1) for (let t =
|
|
1054
|
+
else for (let e = 0; e < n.columnCount; e += 1) for (let t = tn(n) - 1; t >= 0; --t) if (t % n.columnCount === e && i[t]) {
|
|
1041
1055
|
u.add(Math.floor(t / n.columnCount));
|
|
1042
1056
|
break;
|
|
1043
1057
|
}
|
|
1044
1058
|
}
|
|
1045
1059
|
let d = Math.max(0, n.rowCount - 1) * s, f = u.size * 30, p = Math.max(1, (e - l) / n.columnCount), m = Math.max(1, (t - d - f) / n.rowCount);
|
|
1046
|
-
return Array.from({ length:
|
|
1060
|
+
return Array.from({ length: tn(n) }, (e, t) => {
|
|
1047
1061
|
let r = Math.floor(t / n.columnCount), i = t % n.columnCount, a = u.has(r) ? 30 : 0, o = m + a, l = Array.from({ length: r }, (e, t) => {
|
|
1048
1062
|
let n = u.has(t) ? 30 : 0;
|
|
1049
1063
|
return m + n + s;
|
|
@@ -1062,7 +1076,7 @@ function tn(e, t, n, r, i = [], a, o = !0) {
|
|
|
1062
1076
|
};
|
|
1063
1077
|
});
|
|
1064
1078
|
}
|
|
1065
|
-
function
|
|
1079
|
+
function sn(e, t) {
|
|
1066
1080
|
let n = /* @__PURE__ */ new Set();
|
|
1067
1081
|
for (let r = 0; r < t; r += 1) for (let t = e.length - 1; t >= 0; --t) {
|
|
1068
1082
|
let i = e[t];
|
|
@@ -1075,26 +1089,26 @@ function nn(e, t) {
|
|
|
1075
1089
|
}
|
|
1076
1090
|
//#endregion
|
|
1077
1091
|
//#region src/components/core/xDomain.ts
|
|
1078
|
-
var
|
|
1079
|
-
function
|
|
1080
|
-
return !Number.isFinite(e) || (e ?? 0) < 1 ?
|
|
1092
|
+
var cn = 10;
|
|
1093
|
+
function ln(e) {
|
|
1094
|
+
return !Number.isFinite(e) || (e ?? 0) < 1 ? cn : Math.max(1, Math.trunc(e));
|
|
1081
1095
|
}
|
|
1082
|
-
function
|
|
1096
|
+
function un(e, t, n = !1) {
|
|
1083
1097
|
if (t.type !== "nice" || n && !t.includeExplicit) return [...e];
|
|
1084
|
-
let r =
|
|
1098
|
+
let r = V().domain(e).nice(ln(t.tickCount)).domain();
|
|
1085
1099
|
return t.bounds === "end" ? [e[0], r[1]] : r;
|
|
1086
1100
|
}
|
|
1087
1101
|
//#endregion
|
|
1088
1102
|
//#region src/components/core/trackLayoutBuilder.ts
|
|
1089
|
-
function
|
|
1103
|
+
function dn(e, t, n) {
|
|
1090
1104
|
let r = n.xDomainStrategy ?? { type: "data" }, i = n.initialXDomains?.[e.id] ?? n.initialXDomains?.[t] ?? n.initialXDomain;
|
|
1091
|
-
return i ?
|
|
1105
|
+
return i ? un(i, r, !0) : un(e.xDomain, r);
|
|
1092
1106
|
}
|
|
1093
|
-
function
|
|
1107
|
+
function fn(e) {
|
|
1094
1108
|
let t = e.cells.map((e) => ({
|
|
1095
1109
|
...e,
|
|
1096
1110
|
hasSeries: !!e.series
|
|
1097
|
-
})), n =
|
|
1111
|
+
})), n = sn(t, e.grid.columnCount);
|
|
1098
1112
|
return t.flatMap((t, r) => {
|
|
1099
1113
|
let i = !t.series;
|
|
1100
1114
|
if (i && (e.displayMode !== "compact" || !e.showCompactEmptyTracks)) return [];
|
|
@@ -1120,20 +1134,20 @@ function cn(e) {
|
|
|
1120
1134
|
visibleSeries: [a],
|
|
1121
1135
|
xDomain: a.xDomain,
|
|
1122
1136
|
yDomain: a.yDomain
|
|
1123
|
-
}, s = !i && o.visibleSeries.length > 0, c = o.visibleSeries[0] ?? o.series[0] ?? a, l = e.displayMode === "independent" ?
|
|
1137
|
+
}, s = !i && o.visibleSeries.length > 0, c = o.visibleSeries[0] ?? o.series[0] ?? a, l = e.displayMode === "independent" ? V(dn(o, c.id, e), [0, t.width]) : V(e.sharedZoomDomain, [0, t.width]), u = (e.displayMode === "independent" ? e.independentTransforms[r] ?? G : G).rescaleX(l), d = e.yDomains?.[o.id], f = xn(o, e.overlayMode, e.fixedYDomain, e.fixedYDomains).map((e) => !e.fixed && d ? {
|
|
1124
1138
|
...e,
|
|
1125
1139
|
domain: d
|
|
1126
1140
|
} : e), p = {
|
|
1127
1141
|
left: 0,
|
|
1128
1142
|
right: 0
|
|
1129
1143
|
}, m = f.map((n) => {
|
|
1130
|
-
let r =
|
|
1144
|
+
let r = V(n.domain, [t.plotHeight, 0]);
|
|
1131
1145
|
n.fixed || r.nice();
|
|
1132
1146
|
let i = r.ticks(Math.max(2, Math.floor(t.plotHeight / 55))), [a, o] = r.domain(), s = e.displayMode !== "compact" || t.row === 0, c = s ? i : i.filter((e) => e !== o), l = Array.from(/* @__PURE__ */ new Set([
|
|
1133
1147
|
a,
|
|
1134
1148
|
...c,
|
|
1135
1149
|
...s ? [o] : []
|
|
1136
|
-
])), { tickTextWidth: u } =
|
|
1150
|
+
])), { tickTextWidth: u } = Sn(n.domain, !n.fixed, l), d = u + 7 + 6 + 24 + 4, f = n.side === "left" ? -p.left : t.width + p.right, m = u + 7 + 6 + 24 / 2, h = f + (n.side === "left" ? -m : m);
|
|
1137
1151
|
return p[n.side] += d, {
|
|
1138
1152
|
index: n.index,
|
|
1139
1153
|
side: n.side,
|
|
@@ -1141,24 +1155,24 @@ function cn(e) {
|
|
|
1141
1155
|
labelX: h,
|
|
1142
1156
|
scale: r,
|
|
1143
1157
|
majorTicks: i,
|
|
1144
|
-
minorTicks:
|
|
1158
|
+
minorTicks: Xe(i),
|
|
1145
1159
|
tickValues: l,
|
|
1146
1160
|
seriesList: n.seriesList
|
|
1147
1161
|
};
|
|
1148
|
-
}), h = m[0]?.scale ??
|
|
1149
|
-
start:
|
|
1150
|
-
end:
|
|
1162
|
+
}), h = m[0]?.scale ?? V(o.yDomain, [t.plotHeight, 0]).nice(), g = u.ticks(Math.max(2, Math.floor(t.width / 100))), _ = m[0]?.majorTicks ?? [], v = m[0]?.tickValues ?? [], y = u.domain(), b = {
|
|
1163
|
+
start: ut(y[0], y, e.timeUnit, "start", e.xAxisLabelFormatter),
|
|
1164
|
+
end: ut(y[1], y, e.timeUnit, "end", e.xAxisLabelFormatter)
|
|
1151
1165
|
}, x = b.start.length * 7 + 10, S = b.end.length * 7 + 10, C = g.filter((e) => {
|
|
1152
1166
|
let n = u(e);
|
|
1153
1167
|
return n > x && n < t.width - S;
|
|
1154
1168
|
}), w = o.visibleSeries.map((n) => {
|
|
1155
|
-
let r = m.find((e) => e.seriesList.some((e) => e.id === n.id)), a = r?.scale ?? h, o =
|
|
1169
|
+
let r = m.find((e) => e.seriesList.some((e) => e.id === n.id)), a = r?.scale ?? h, o = Qt(n.points, y, t.width, e.rendering, {
|
|
1156
1170
|
lineVisible: !i && n.lineType !== "none",
|
|
1157
1171
|
pointVisible: n.pointType !== "none",
|
|
1158
1172
|
errorBarVisible: n.errorBar.visible,
|
|
1159
1173
|
hasErrorPoints: n.hasErrorPoints
|
|
1160
|
-
}), s =
|
|
1161
|
-
return n.lineType === "step-start" && s.curve(
|
|
1174
|
+
}), s = z().x((e) => u(e.x)).y((e) => a(e.y));
|
|
1175
|
+
return n.lineType === "step-start" && s.curve(L), n.lineType === "step-middle" && s.curve(F), (n.lineType === "step-end" || n.lineType === "step-after") && s.curve(I), {
|
|
1162
1176
|
series: n,
|
|
1163
1177
|
path: o.linePoints.length ? s(o.linePoints) : null,
|
|
1164
1178
|
pointRenderPoints: o.pointRenderPoints,
|
|
@@ -1186,7 +1200,7 @@ function cn(e) {
|
|
|
1186
1200
|
yScale: h,
|
|
1187
1201
|
yAxes: m,
|
|
1188
1202
|
xMajorTicks: g,
|
|
1189
|
-
xMinorTicks:
|
|
1203
|
+
xMinorTicks: Xe(g, 5, y),
|
|
1190
1204
|
yMajorTicks: _,
|
|
1191
1205
|
yMinorTicks: m[0]?.minorTicks ?? [],
|
|
1192
1206
|
yAxisTickValues: v,
|
|
@@ -1204,8 +1218,8 @@ function cn(e) {
|
|
|
1204
1218
|
}
|
|
1205
1219
|
//#endregion
|
|
1206
1220
|
//#region src/components/core/layout.ts
|
|
1207
|
-
var
|
|
1208
|
-
function
|
|
1221
|
+
var pn = 7, mn = 7, hn = 4, gn = 6, _n = 24;
|
|
1222
|
+
function vn(e) {
|
|
1209
1223
|
return e >= 4 ? [
|
|
1210
1224
|
"left",
|
|
1211
1225
|
"left",
|
|
@@ -1217,13 +1231,13 @@ function mn(e) {
|
|
|
1217
1231
|
"right"
|
|
1218
1232
|
] : e === 2 ? ["left", "right"] : ["left"];
|
|
1219
1233
|
}
|
|
1220
|
-
var
|
|
1221
|
-
function
|
|
1222
|
-
let n =
|
|
1223
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
1234
|
+
var yn = /* @__PURE__ */ new WeakMap();
|
|
1235
|
+
function bn(e, t) {
|
|
1236
|
+
let n = yn.get(e);
|
|
1237
|
+
n || (n = /* @__PURE__ */ new Map(), yn.set(e, n));
|
|
1224
1238
|
let r = n.get(t);
|
|
1225
1239
|
if (r) return r;
|
|
1226
|
-
let i = t === "multi-axis" ? Math.min(e.visibleSeries.length, 4) : Math.min(e.visibleSeries.length, 1), a =
|
|
1240
|
+
let i = t === "multi-axis" ? Math.min(e.visibleSeries.length, 4) : Math.min(e.visibleSeries.length, 1), a = vn(i), o = Array.from({ length: i }, (e, t) => ({
|
|
1227
1241
|
index: t,
|
|
1228
1242
|
side: a[t],
|
|
1229
1243
|
seriesList: [],
|
|
@@ -1240,49 +1254,49 @@ function gn(e, t) {
|
|
|
1240
1254
|
}
|
|
1241
1255
|
}), n.set(t, o), o;
|
|
1242
1256
|
}
|
|
1243
|
-
function
|
|
1244
|
-
let i =
|
|
1245
|
-
return
|
|
1257
|
+
function xn(e, t, n, r) {
|
|
1258
|
+
let i = Tt(e, r);
|
|
1259
|
+
return bn(e, t).map((e) => {
|
|
1246
1260
|
if (i) return {
|
|
1247
1261
|
...e,
|
|
1248
1262
|
domain: i,
|
|
1249
1263
|
fixed: !0
|
|
1250
1264
|
};
|
|
1251
|
-
let t = e.seriesList.map((e) =>
|
|
1265
|
+
let t = e.seriesList.map((e) => Et(e, n, r) ?? e.yDomain), a = e.seriesList.some((e) => Et(e, n, r));
|
|
1252
1266
|
return a ? {
|
|
1253
1267
|
...e,
|
|
1254
|
-
domain:
|
|
1268
|
+
domain: Ot(t),
|
|
1255
1269
|
fixed: a
|
|
1256
1270
|
} : e;
|
|
1257
1271
|
});
|
|
1258
1272
|
}
|
|
1259
|
-
function
|
|
1260
|
-
let r =
|
|
1273
|
+
function Sn(e, t = !0, n) {
|
|
1274
|
+
let r = V(e, [1, 0]);
|
|
1261
1275
|
t && r.nice();
|
|
1262
1276
|
let [i, a] = r.domain(), o = n ?? Array.from(/* @__PURE__ */ new Set([
|
|
1263
1277
|
i,
|
|
1264
1278
|
...r.ticks(10),
|
|
1265
1279
|
a
|
|
1266
1280
|
])), s = Math.max(...o);
|
|
1267
|
-
return { tickTextWidth: Math.max(1, ...o.map((e) =>
|
|
1281
|
+
return { tickTextWidth: Math.max(1, ...o.map((e) => ot(e, {
|
|
1268
1282
|
axisMin: i,
|
|
1269
1283
|
axisMax: a,
|
|
1270
1284
|
topTickValue: s
|
|
1271
|
-
}).length)) *
|
|
1285
|
+
}).length)) * pn };
|
|
1272
1286
|
}
|
|
1273
|
-
function
|
|
1274
|
-
return
|
|
1287
|
+
function Cn(e) {
|
|
1288
|
+
return Sn(e.domain, !e.fixed).tickTextWidth + mn + gn + _n + hn;
|
|
1275
1289
|
}
|
|
1276
|
-
function
|
|
1277
|
-
return
|
|
1290
|
+
function wn(e) {
|
|
1291
|
+
return Sn(e.domain, !e.fixed).tickTextWidth + mn + hn;
|
|
1278
1292
|
}
|
|
1279
|
-
function
|
|
1280
|
-
return
|
|
1293
|
+
function Tn(e, t, n, r) {
|
|
1294
|
+
return xn(e, t, n, r).reduce((n, r) => (n[r.side] += t === "multi-axis" || e.visibleSeries.length === 1 ? Cn(r) : wn(r), n), {
|
|
1281
1295
|
left: 0,
|
|
1282
1296
|
right: 0
|
|
1283
1297
|
});
|
|
1284
1298
|
}
|
|
1285
|
-
function
|
|
1299
|
+
function En(e, t, n) {
|
|
1286
1300
|
let r = (e) => {
|
|
1287
1301
|
let r = t < e.left ? e.left - t : t > e.left + e.width ? t - e.left - e.width : 0;
|
|
1288
1302
|
return n < e.top ? e.top - n : n > e.top + e.height ? n - (e.top + e.height) : r;
|
|
@@ -1301,13 +1315,13 @@ function Sn(e, t, n) {
|
|
|
1301
1315
|
}
|
|
1302
1316
|
//#endregion
|
|
1303
1317
|
//#region src/components/annotation/useWaveformChartAnnotations.ts
|
|
1304
|
-
var
|
|
1305
|
-
function
|
|
1306
|
-
return
|
|
1318
|
+
var Dn = 0;
|
|
1319
|
+
function On() {
|
|
1320
|
+
return Dn += 1, typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `annotation-${Date.now()}-${Dn}`;
|
|
1307
1321
|
}
|
|
1308
|
-
function
|
|
1309
|
-
let { props: t, emit: n, container: r, chartSeries: i, hiddenSeriesIdSet: a, internalHiddenSeriesIds: o, annotationInteraction: s, editorSeriesOptions: c, trackLayouts: l, annotationLayoutsForTrack: u, resolveSeriesYScale: d, chartWidth: f, chartHeight: p, innerWidth: m, resolvedChartLeftMargin: h, titleAreaHeight: g, chartTopMargin: _, activeInteractionMode:
|
|
1310
|
-
function
|
|
1322
|
+
function kn(e) {
|
|
1323
|
+
let { props: t, emit: n, container: r, chartSeries: i, hiddenSeriesIdSet: a, internalHiddenSeriesIds: o, annotationInteraction: s, editorSeriesOptions: c, trackLayouts: l, annotationLayoutsForTrack: u, resolveSeriesYScale: d, chartWidth: f, chartHeight: p, innerWidth: m, resolvedChartLeftMargin: h, titleAreaHeight: g, chartTopMargin: _, activeInteractionMode: y, isPresentationMode: b } = e, x = v("");
|
|
1324
|
+
function S(e) {
|
|
1311
1325
|
if (!i.value.some((t) => t.id === e)) return;
|
|
1312
1326
|
let r = new Set(a.value), s = r.has(e);
|
|
1313
1327
|
s ? r.delete(e) : r.add(e);
|
|
@@ -1318,27 +1332,27 @@ function Tn(e) {
|
|
|
1318
1332
|
hiddenSeriesIds: c
|
|
1319
1333
|
});
|
|
1320
1334
|
}
|
|
1321
|
-
function
|
|
1335
|
+
function C(e, t) {
|
|
1322
1336
|
let n = e.currentTarget;
|
|
1323
1337
|
if (!n) return {
|
|
1324
1338
|
x: f.value / 2,
|
|
1325
1339
|
y: p.value / 2
|
|
1326
1340
|
};
|
|
1327
|
-
let [r, i] =
|
|
1341
|
+
let [r, i] = B(e, n), a = t === void 0 ? void 0 : l.value[t];
|
|
1328
1342
|
return {
|
|
1329
1343
|
x: h.value + (a ? a.left + r : r),
|
|
1330
1344
|
y: g.value + _.value + (a ? a.top + i : i)
|
|
1331
1345
|
};
|
|
1332
1346
|
}
|
|
1333
|
-
function
|
|
1347
|
+
function w(e) {
|
|
1334
1348
|
let t = l.value.find((t) => t.seriesList.some((t) => t.id === e.seriesId));
|
|
1335
1349
|
return {
|
|
1336
1350
|
x: t ? h.value + t.left + t.xScale(e.x) : f.value / 2,
|
|
1337
1351
|
y: t ? g.value + _.value + t.top + d(t, e.seriesId)(e.y) : p.value / 2
|
|
1338
1352
|
};
|
|
1339
1353
|
}
|
|
1340
|
-
function
|
|
1341
|
-
s.openCreate(e,
|
|
1354
|
+
function T(e, t, n) {
|
|
1355
|
+
x.value = "", s.openCreate(e, On, t), c.value = n;
|
|
1342
1356
|
let r = s.editorDraft.value, i = l.value.find((t) => t.index === e.trackIndex)?.seriesList.find((t) => t.id === e.seriesId);
|
|
1343
1357
|
r?.mode === "add" && (r.annotation.style = {
|
|
1344
1358
|
borderColor: i?.color || "#1677ff",
|
|
@@ -1346,10 +1360,18 @@ function Tn(e) {
|
|
|
1346
1360
|
backgroundColor: "rgba(255, 255, 255, 0.92)"
|
|
1347
1361
|
});
|
|
1348
1362
|
}
|
|
1349
|
-
function
|
|
1350
|
-
if (
|
|
1351
|
-
let t = s.editorDraft.value, n = c.value.find((t) => t.seriesId === e), r = l.value.find((t) => t.seriesList.some((t) => t.id === e)), i = r?.seriesList.find((t) => t.id === e), a = i && t ?
|
|
1352
|
-
!t || !n || !r || !
|
|
1363
|
+
function E(e) {
|
|
1364
|
+
if (b.value) return;
|
|
1365
|
+
let t = s.editorDraft.value, n = c.value.find((t) => t.seriesId === e), r = l.value.find((t) => t.seriesList.some((t) => t.id === e)), i = (r?.seriesList.find((t) => t.id === e))?.points.filter((e) => Number.isFinite(e.x) && Number.isFinite(e.y)), a = i && t ? be(i, t.annotation.x) : null;
|
|
1366
|
+
if (!t || !n || !r || !i?.length) {
|
|
1367
|
+
x.value = "当前波形没有有效数据";
|
|
1368
|
+
return;
|
|
1369
|
+
}
|
|
1370
|
+
if (t.annotation.x < i[0].x || t.annotation.x > i.at(-1).x) {
|
|
1371
|
+
x.value = "时间超出当前波形范围";
|
|
1372
|
+
return;
|
|
1373
|
+
}
|
|
1374
|
+
x.value = "", t.annotation = {
|
|
1353
1375
|
...t.annotation,
|
|
1354
1376
|
seriesId: e,
|
|
1355
1377
|
y: a.y,
|
|
@@ -1357,52 +1379,76 @@ function Tn(e) {
|
|
|
1357
1379
|
...t.annotation.style,
|
|
1358
1380
|
borderColor: n.color
|
|
1359
1381
|
}
|
|
1360
|
-
}
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
function D(e) {
|
|
1385
|
+
if (b.value) return;
|
|
1386
|
+
let n = s.editorDraft.value, r = Number(e);
|
|
1387
|
+
if (!n || !Number.isFinite(r)) {
|
|
1388
|
+
x.value = "请输入有效的时间";
|
|
1389
|
+
return;
|
|
1390
|
+
}
|
|
1391
|
+
let i = t.timeUnit === "ms" ? r / 1e3 : r, a = (l.value.find((e) => e.seriesList.some((e) => e.id === n.annotation.seriesId))?.seriesList.find((e) => e.id === n.annotation.seriesId))?.points.filter((e) => Number.isFinite(e.x) && Number.isFinite(e.y));
|
|
1392
|
+
if (!a?.length) {
|
|
1393
|
+
x.value = "当前波形没有有效数据";
|
|
1394
|
+
return;
|
|
1395
|
+
}
|
|
1396
|
+
let o = a[0].x, c = a[a.length - 1].x;
|
|
1397
|
+
if (i < o || i > c) {
|
|
1398
|
+
x.value = "时间超出当前波形范围";
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
let u = be(a, i);
|
|
1402
|
+
x.value = "", n.annotation = {
|
|
1403
|
+
...n.annotation,
|
|
1404
|
+
x: u.x,
|
|
1405
|
+
y: u.y
|
|
1406
|
+
};
|
|
1361
1407
|
}
|
|
1362
|
-
function
|
|
1363
|
-
s.closeEditor(), c.value = [];
|
|
1408
|
+
function O() {
|
|
1409
|
+
x.value = "", s.closeEditor(), c.value = [];
|
|
1364
1410
|
}
|
|
1365
|
-
function
|
|
1411
|
+
function k(e, t, n) {
|
|
1366
1412
|
if (n !== void 0) {
|
|
1367
1413
|
let e = l.value[n];
|
|
1368
1414
|
return e?.hasVisibleSeries ? e : void 0;
|
|
1369
1415
|
}
|
|
1370
|
-
return
|
|
1416
|
+
return En(l.value.filter((e) => e.hasVisibleSeries), e, t);
|
|
1371
1417
|
}
|
|
1372
|
-
function
|
|
1418
|
+
function A(e, t) {
|
|
1373
1419
|
let n = e.currentTarget;
|
|
1374
1420
|
if (!n || !l.value.length) return null;
|
|
1375
|
-
let [r, i] =
|
|
1421
|
+
let [r, i] = B(e, n), a = t === void 0 ? i : i + (l.value[t]?.top ?? 0), o = k(r, a, t);
|
|
1376
1422
|
if (!o) return null;
|
|
1377
1423
|
let s = Math.max(0, Math.min(m.value, r)), c = Math.max(0, Math.min(o.width, s - o.left)), d = o.xScale.invert(c);
|
|
1378
1424
|
return {
|
|
1379
|
-
candidates:
|
|
1380
|
-
editorAnchor:
|
|
1425
|
+
candidates: X(u(o), d, c, a),
|
|
1426
|
+
editorAnchor: C(e, t)
|
|
1381
1427
|
};
|
|
1382
1428
|
}
|
|
1383
|
-
function
|
|
1429
|
+
function j(e) {
|
|
1384
1430
|
let t = e[0];
|
|
1385
1431
|
return !t || t.distance > 12 ? [] : e.filter((e) => e.distance <= 12 && e.distance - t.distance < 5);
|
|
1386
1432
|
}
|
|
1387
|
-
function
|
|
1388
|
-
if (
|
|
1389
|
-
let r =
|
|
1433
|
+
function M(e, n) {
|
|
1434
|
+
if (b.value || !t.annotationsVisible || y.value !== "annotation") return;
|
|
1435
|
+
let r = A(e, n);
|
|
1390
1436
|
if (!r) return;
|
|
1391
|
-
let i =
|
|
1392
|
-
i.length && (e.preventDefault(), e.stopPropagation(),
|
|
1437
|
+
let i = j(r.candidates);
|
|
1438
|
+
i.length && (e.preventDefault(), e.stopPropagation(), T(i[0], r.editorAnchor, r.candidates));
|
|
1393
1439
|
}
|
|
1394
|
-
function
|
|
1440
|
+
function N(e) {
|
|
1395
1441
|
let t = e.target;
|
|
1396
1442
|
t instanceof Element && t.closest("input, textarea, [contenteditable]:not([contenteditable=\"false\"])") || e.preventDefault();
|
|
1397
1443
|
}
|
|
1398
|
-
function
|
|
1399
|
-
if (
|
|
1444
|
+
function P(e, n) {
|
|
1445
|
+
if (b.value || !t.annotationsVisible) return;
|
|
1400
1446
|
e.preventDefault(), e.stopPropagation();
|
|
1401
|
-
let r =
|
|
1402
|
-
!r || !r.candidates.length ||
|
|
1447
|
+
let r = A(e, n);
|
|
1448
|
+
!r || !r.candidates.length || T(j(r.candidates)[0] ?? r.candidates[0], r.editorAnchor, r.candidates);
|
|
1403
1449
|
}
|
|
1404
|
-
function
|
|
1405
|
-
if (
|
|
1450
|
+
function F(e, n) {
|
|
1451
|
+
if (b.value || !t.annotationsVisible || !r.value || (c.value = [], !t.annotations.find((t) => t.id === e))) return;
|
|
1406
1452
|
let i = r.value.getBoundingClientRect(), a = {
|
|
1407
1453
|
x: Math.max(0, Math.min(n.clientX - i.left, f.value)),
|
|
1408
1454
|
y: Math.max(0, Math.min(n.clientY - i.top, p.value))
|
|
@@ -1414,49 +1460,52 @@ function Tn(e) {
|
|
|
1414
1460
|
editorAnchor: a
|
|
1415
1461
|
});
|
|
1416
1462
|
}
|
|
1417
|
-
function
|
|
1418
|
-
|
|
1463
|
+
function I(e, r, i) {
|
|
1464
|
+
b.value || !t.annotations.find((t) => t.id === e) || !Number.isFinite(r) || !Number.isFinite(i) || n("update:annotations", t.annotations.map((t) => t.id === e ? {
|
|
1419
1465
|
...t,
|
|
1420
1466
|
labelOffsetX: r,
|
|
1421
1467
|
labelOffsetY: i
|
|
1422
1468
|
} : t));
|
|
1423
1469
|
}
|
|
1424
|
-
function
|
|
1425
|
-
if (
|
|
1470
|
+
function L() {
|
|
1471
|
+
if (b.value) return;
|
|
1472
|
+
x.value = "";
|
|
1426
1473
|
let e = s.contextMenu.value, n = t.annotations.find((t) => t.id === e?.annotationId);
|
|
1427
1474
|
if (!n) return;
|
|
1428
1475
|
let r = l.value.find((e) => e.seriesList.some((e) => e.id === n.seriesId));
|
|
1429
|
-
c.value = r ?
|
|
1476
|
+
c.value = r ? X(u(r), n.x, r.xScale(n.x), r.top + d(r, n.seriesId)(n.y)) : [], s.openEdit(n, e?.editorAnchor ?? w(n));
|
|
1430
1477
|
}
|
|
1431
|
-
function
|
|
1432
|
-
if (
|
|
1478
|
+
function R() {
|
|
1479
|
+
if (b.value) return;
|
|
1433
1480
|
let e = s.contextMenu.value?.annotationId, r = t.annotations.find((t) => t.id === e);
|
|
1434
1481
|
r && (n("update:annotations", t.annotations.filter((e) => e.id !== r.id)), n("annotation-delete", r), s.closeContextMenu());
|
|
1435
1482
|
}
|
|
1436
|
-
function
|
|
1437
|
-
if (
|
|
1483
|
+
function z(e) {
|
|
1484
|
+
if (b.value) return;
|
|
1438
1485
|
let r = s.editorDraft.value;
|
|
1439
|
-
r
|
|
1486
|
+
!r || x.value || (r.mode === "add" ? (n("update:annotations", [...t.annotations, e]), n("annotation-create", e)) : (n("update:annotations", t.annotations.map((t) => t.id === e.id ? e : t)), n("annotation-update", e, r.previous)), O());
|
|
1440
1487
|
}
|
|
1441
1488
|
return {
|
|
1442
|
-
toggleSeriesVisibility:
|
|
1443
|
-
changeDraftSeries:
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1489
|
+
toggleSeriesVisibility: S,
|
|
1490
|
+
changeDraftSeries: E,
|
|
1491
|
+
changeDraftTime: D,
|
|
1492
|
+
timeError: x,
|
|
1493
|
+
cancelAnnotation: O,
|
|
1494
|
+
resolveTrackAtPointer: k,
|
|
1495
|
+
handleAnnotationClick: M,
|
|
1496
|
+
handleNativeContextMenu: N,
|
|
1497
|
+
handleAnnotationContextMenu: P,
|
|
1498
|
+
handleExistingAnnotationContextMenu: F,
|
|
1499
|
+
handleAnnotationMove: I,
|
|
1500
|
+
editContextAnnotation: L,
|
|
1501
|
+
deleteContextAnnotation: R,
|
|
1502
|
+
confirmAnnotation: z
|
|
1454
1503
|
};
|
|
1455
1504
|
}
|
|
1456
1505
|
//#endregion
|
|
1457
1506
|
//#region src/components/interaction/useWaveformHover.ts
|
|
1458
|
-
var
|
|
1459
|
-
function
|
|
1507
|
+
var An = P((e) => e.x);
|
|
1508
|
+
function jn(e) {
|
|
1460
1509
|
let { emit: t, hoverState: n, suppressHoverUntilMove: r, hoverThrottle: i, selection: a, trackLayouts: o, innerWidth: s, resolvedChartLeftMargin: c, titleAreaHeight: l, chartTopMargin: u, sharedOverlayElement: d, isPresentationMode: f, updateViewportDrag: p, resolveTrackAtPointer: m } = e, h = () => i.cancel(), g = (e) => i.schedule(e), _ = (e) => n.points.length === e.length && e.every((e, t) => {
|
|
1461
1510
|
let r = n.points[t];
|
|
1462
1511
|
return r?.id === e.id && r.trackIndex === e.trackIndex && r.point === e.point;
|
|
@@ -1478,7 +1527,7 @@ function Dn(e) {
|
|
|
1478
1527
|
r.value = !0, y();
|
|
1479
1528
|
}, C = (e = !1) => {
|
|
1480
1529
|
r.value = !e, y();
|
|
1481
|
-
}, w = () => r.value ? (r.value = !1, y(), !0) : !1, T = (e, t) => e.points[
|
|
1530
|
+
}, w = () => r.value ? (r.value = !1, y(), !0) : !1, T = (e, t) => e.points[An.center(e.points, t)];
|
|
1482
1531
|
return {
|
|
1483
1532
|
cancelPendingHover: h,
|
|
1484
1533
|
clearHover: y,
|
|
@@ -1494,7 +1543,7 @@ function Dn(e) {
|
|
|
1494
1543
|
if (w()) return;
|
|
1495
1544
|
let n = e.currentTarget;
|
|
1496
1545
|
if (!n) return;
|
|
1497
|
-
let [r, i] =
|
|
1546
|
+
let [r, i] = B(e, n), d = o.value[t];
|
|
1498
1547
|
!d || !d.hasVisibleSeries || g(() => {
|
|
1499
1548
|
let e = o.value[t];
|
|
1500
1549
|
if (!e || !e.hasVisibleSeries || e !== d) return;
|
|
@@ -1515,7 +1564,7 @@ function Dn(e) {
|
|
|
1515
1564
|
return;
|
|
1516
1565
|
}
|
|
1517
1566
|
if (w() || !d.value || !o.value.length) return;
|
|
1518
|
-
let [t, n] =
|
|
1567
|
+
let [t, n] = B(e, d.value);
|
|
1519
1568
|
g(() => {
|
|
1520
1569
|
let e = m(t, n) ?? o.value.find((e) => e.hasVisibleSeries);
|
|
1521
1570
|
if (!e) return;
|
|
@@ -1533,14 +1582,14 @@ function Dn(e) {
|
|
|
1533
1582
|
}
|
|
1534
1583
|
//#endregion
|
|
1535
1584
|
//#region src/components/interaction/pointerCapture.ts
|
|
1536
|
-
function
|
|
1585
|
+
function Mn(e, t) {
|
|
1537
1586
|
try {
|
|
1538
1587
|
e?.releasePointerCapture?.(t);
|
|
1539
1588
|
} catch {}
|
|
1540
1589
|
}
|
|
1541
1590
|
//#endregion
|
|
1542
1591
|
//#region src/components/interaction/viewportInteractionState.ts
|
|
1543
|
-
function
|
|
1592
|
+
function Nn(e) {
|
|
1544
1593
|
return {
|
|
1545
1594
|
...e,
|
|
1546
1595
|
currentX: e.startX,
|
|
@@ -1549,37 +1598,37 @@ function kn(e) {
|
|
|
1549
1598
|
yDomains: Object.fromEntries(Object.entries(e.yDomains).map(([e, t]) => [e, [...t]]))
|
|
1550
1599
|
};
|
|
1551
1600
|
}
|
|
1552
|
-
function
|
|
1601
|
+
function Pn(e, t) {
|
|
1553
1602
|
return {
|
|
1554
1603
|
...e,
|
|
1555
1604
|
...t
|
|
1556
1605
|
};
|
|
1557
1606
|
}
|
|
1558
|
-
function
|
|
1607
|
+
function Fn(e) {
|
|
1559
1608
|
return {
|
|
1560
1609
|
state: e,
|
|
1561
1610
|
accepted: !1,
|
|
1562
1611
|
completed: null
|
|
1563
1612
|
};
|
|
1564
1613
|
}
|
|
1565
|
-
function
|
|
1614
|
+
function In(e, t) {
|
|
1566
1615
|
switch (t.type) {
|
|
1567
|
-
case "begin": return e ?
|
|
1568
|
-
state:
|
|
1616
|
+
case "begin": return e ? Fn(e) : {
|
|
1617
|
+
state: Nn(t.gesture),
|
|
1569
1618
|
accepted: !0,
|
|
1570
1619
|
completed: null
|
|
1571
1620
|
};
|
|
1572
|
-
case "move": return !e || e.pointerId !== t.pointerId ?
|
|
1573
|
-
state:
|
|
1621
|
+
case "move": return !e || e.pointerId !== t.pointerId ? Fn(e) : {
|
|
1622
|
+
state: Pn(e, t.position),
|
|
1574
1623
|
accepted: !0,
|
|
1575
1624
|
completed: null
|
|
1576
1625
|
};
|
|
1577
|
-
case "finish": return !e || e.pointerId !== t.pointerId ?
|
|
1626
|
+
case "finish": return !e || e.pointerId !== t.pointerId ? Fn(e) : {
|
|
1578
1627
|
state: null,
|
|
1579
1628
|
accepted: !0,
|
|
1580
|
-
completed:
|
|
1629
|
+
completed: Pn(e, t.position)
|
|
1581
1630
|
};
|
|
1582
|
-
case "cancel": return !e || t.pointerId !== void 0 && e.pointerId !== t.pointerId ?
|
|
1631
|
+
case "cancel": return !e || t.pointerId !== void 0 && e.pointerId !== t.pointerId ? Fn(e) : {
|
|
1583
1632
|
state: null,
|
|
1584
1633
|
accepted: !0,
|
|
1585
1634
|
completed: null
|
|
@@ -1593,26 +1642,26 @@ function Mn(e, t) {
|
|
|
1593
1642
|
}
|
|
1594
1643
|
//#endregion
|
|
1595
1644
|
//#region src/components/interaction/zoomConstraints.ts
|
|
1596
|
-
var
|
|
1597
|
-
function
|
|
1645
|
+
var Ln = /* @__PURE__ */ new WeakMap();
|
|
1646
|
+
function Rn(e) {
|
|
1598
1647
|
return e[0] <= e[1] ? [...e] : [e[1], e[0]];
|
|
1599
1648
|
}
|
|
1600
|
-
function
|
|
1649
|
+
function zn(e) {
|
|
1601
1650
|
return Number.isFinite(e) && (e ?? 0) > 0 ? Math.ceil(e) : 0;
|
|
1602
1651
|
}
|
|
1603
|
-
function
|
|
1604
|
-
let n = `${t[0]}\u0000${t[1]}`, r =
|
|
1652
|
+
function Bn(e, t) {
|
|
1653
|
+
let n = `${t[0]}\u0000${t[1]}`, r = Ln.get(e)?.get(n);
|
|
1605
1654
|
if (r) return r;
|
|
1606
1655
|
let i = /* @__PURE__ */ new Set();
|
|
1607
1656
|
for (let n of e) for (let e of n.points) e.x >= t[0] && e.x <= t[1] && i.add(e.x);
|
|
1608
|
-
let a = Array.from(i).sort((e, t) => e - t), o =
|
|
1609
|
-
return o.set(n, a),
|
|
1657
|
+
let a = Array.from(i).sort((e, t) => e - t), o = Ln.get(e) ?? /* @__PURE__ */ new Map();
|
|
1658
|
+
return o.set(n, a), Ln.set(e, o), a;
|
|
1610
1659
|
}
|
|
1611
|
-
function
|
|
1660
|
+
function Vn(e, t, n) {
|
|
1612
1661
|
if (n <= 1) return 0;
|
|
1613
1662
|
let r = 0;
|
|
1614
1663
|
for (let i of e) {
|
|
1615
|
-
let e =
|
|
1664
|
+
let e = Bn(i, t);
|
|
1616
1665
|
if (e.length < n) return t[1] - t[0];
|
|
1617
1666
|
let a = Infinity;
|
|
1618
1667
|
for (let t = 0; t + n <= e.length; t += 1) a = Math.min(a, e[t + n - 1] - e[t]);
|
|
@@ -1621,17 +1670,17 @@ function Ln(e, t, n) {
|
|
|
1621
1670
|
}
|
|
1622
1671
|
return r;
|
|
1623
1672
|
}
|
|
1624
|
-
function
|
|
1625
|
-
let r =
|
|
1673
|
+
function Hn(e, t, n) {
|
|
1674
|
+
let r = Rn(e), i = r[1] - r[0];
|
|
1626
1675
|
if (!Number.isFinite(i) || i <= 0) return 0;
|
|
1627
|
-
let a = Number.isFinite(n.minZoomSpan) && (n.minZoomSpan ?? 0) > 0 ? Math.min(i, n.minZoomSpan) : 0, o =
|
|
1628
|
-
return a > 0 || o > 0 ? Math.max(a, s) : i /
|
|
1676
|
+
let a = Number.isFinite(n.minZoomSpan) && (n.minZoomSpan ?? 0) > 0 ? Math.min(i, n.minZoomSpan) : 0, o = zn(n.minVisiblePoints), s = Vn(t, r, o);
|
|
1677
|
+
return a > 0 || o > 0 ? Math.max(a, s) : i / vt.DEFAULT_MAX_SCALE;
|
|
1629
1678
|
}
|
|
1630
|
-
function
|
|
1679
|
+
function Un(e, t, n, r) {
|
|
1631
1680
|
if (r <= 0) return e;
|
|
1632
1681
|
let i = 2 ** -52 * Math.max(1, Math.abs(t[0]), Math.abs(t[1])) * 16, a = e;
|
|
1633
1682
|
for (let e of n) {
|
|
1634
|
-
let n =
|
|
1683
|
+
let n = Bn(e, t);
|
|
1635
1684
|
if (n.length < r) return [...t];
|
|
1636
1685
|
if (n.filter((e) => e >= a[0] && e <= a[1]).length >= r) continue;
|
|
1637
1686
|
let o, s = Infinity, c = Infinity, l = (a[0] + a[1]) / 2;
|
|
@@ -1643,27 +1692,27 @@ function zn(e, t, n, r) {
|
|
|
1643
1692
|
}
|
|
1644
1693
|
return a;
|
|
1645
1694
|
}
|
|
1646
|
-
function
|
|
1647
|
-
let i =
|
|
1695
|
+
function Wn(e, t, n, r) {
|
|
1696
|
+
let i = Rn(t), a = i[1] - i[0];
|
|
1648
1697
|
if (!Number.isFinite(a) || a <= 0 || Math.abs(e[1] - e[0]) >= a * .999999999999) return i;
|
|
1649
|
-
let o =
|
|
1698
|
+
let o = Un([Math.max(i[0], Math.min(e[0], e[1])), Math.min(i[1], Math.max(e[0], e[1]))], i, n, zn(r.minVisiblePoints)), s = Hn(i, n, r), c = Math.max(s, Math.min(a, o[1] - o[0])), l = (o[0] + o[1]) / 2, u = Math.max(i[0], Math.min(l - c / 2, i[1] - c));
|
|
1650
1699
|
return [u, u + c];
|
|
1651
1700
|
}
|
|
1652
|
-
function
|
|
1701
|
+
function Gn(e, t, n) {
|
|
1653
1702
|
let r = t[1] - t[0], i = e[1] - e[0];
|
|
1654
1703
|
if (!Number.isFinite(r) || !Number.isFinite(i) || r <= 0 || i <= 0) return G;
|
|
1655
|
-
let a = r / i, o =
|
|
1704
|
+
let a = r / i, o = V(t, [0, n]);
|
|
1656
1705
|
return G.translate(-a * o(e[0]), 0).scale(a);
|
|
1657
1706
|
}
|
|
1658
1707
|
//#endregion
|
|
1659
1708
|
//#region src/components/interaction/useWaveformViewport.ts
|
|
1660
|
-
function
|
|
1709
|
+
function Kn(e) {
|
|
1661
1710
|
let { props: n, emit: r, selection: i, spacePressed: a, trackLayouts: o, chartTracks: s, initialXDomain: c, innerWidth: l, innerHeight: u, sharedOverlayElement: f, sharedTransform: p, independentTransforms: m, sharedYDomains: h, independentYDomains: g, isZoomMode: _, isPresentationMode: v, editorSeriesOptions: y, resolveInitialTrackDomain: b, canZoomTrack: S, canZoomSharedTracks: C, configureZoom: w, cancelPendingZoom: T, clearHover: E, resolveTrackAtPointer: D } = e, O = x(), k = (e, t) => {
|
|
1662
1711
|
let n = O.value, r = t?.currentTarget;
|
|
1663
|
-
|
|
1712
|
+
Mn(n, e), r && r !== n && Mn(r, e);
|
|
1664
1713
|
}, A = (e, t) => {
|
|
1665
1714
|
let n = i.value;
|
|
1666
|
-
!n || n.pointerId !== e || (k(e, t), i.value =
|
|
1715
|
+
!n || n.pointerId !== e || (k(e, t), i.value = In(i.value, {
|
|
1667
1716
|
type: "cancel",
|
|
1668
1717
|
pointerId: e
|
|
1669
1718
|
}).state, O.value = void 0);
|
|
@@ -1686,7 +1735,7 @@ function Hn(e) {
|
|
|
1686
1735
|
if (!n.zoomable && !s || !_.value || e.button !== 0) return;
|
|
1687
1736
|
let c = e.currentTarget, d = o.value.find((e) => e.index === t);
|
|
1688
1737
|
if (!d) return;
|
|
1689
|
-
let [f, p] =
|
|
1738
|
+
let [f, p] = B(e, c), m = Math.max(0, Math.min(r ? d.width : l.value, f)), h = Math.max(0, Math.min(r ? d.height : u.value, p)), g = In(i.value, {
|
|
1690
1739
|
type: "begin",
|
|
1691
1740
|
gesture: {
|
|
1692
1741
|
trackIndex: t,
|
|
@@ -1702,18 +1751,18 @@ function Hn(e) {
|
|
|
1702
1751
|
g.accepted && (i.value = g.state, O.value = c, c.setPointerCapture?.(e.pointerId), E(), e.preventDefault());
|
|
1703
1752
|
}, F = (e) => {
|
|
1704
1753
|
if (!f.value) return;
|
|
1705
|
-
let [t, n] =
|
|
1754
|
+
let [t, n] = B(e, f.value), r = D(t, n) ?? o.value.find((e) => e.hasVisibleSeries);
|
|
1706
1755
|
r && P(e, r.index, !1);
|
|
1707
1756
|
}, I = (e, t) => {
|
|
1708
1757
|
let i = t.width || 1, a = t.height || 1, u = e.currentX - e.startX, d = e.currentY - e.startY, f = e.xDomain[1] - e.xDomain[0], _ = e.independent ? b(t) : c.value, v = M([e.xDomain[0] - u / i * f, e.xDomain[1] - u / i * f], _);
|
|
1709
1758
|
if (e.independent) {
|
|
1710
1759
|
let e = [...m.value];
|
|
1711
|
-
e[t.index] =
|
|
1712
|
-
} else p.value =
|
|
1760
|
+
e[t.index] = Gn(v, _, i), m.value = e;
|
|
1761
|
+
} else p.value = Gn(v, _, l.value);
|
|
1713
1762
|
let y = e.independent ? [t] : o.value, x = { ...g.value }, S = { ...h.value };
|
|
1714
1763
|
y.forEach((t) => {
|
|
1715
1764
|
let r = s.value.find((e) => e.id === t.id);
|
|
1716
|
-
if (r &&
|
|
1765
|
+
if (r && Dt(r, n.yDomain, n.yDomains)) return;
|
|
1717
1766
|
let i = t.series.trackId ?? t.series.id, o = e.yDomains[i] ?? t.yScale.domain(), c = r?.yDomain ?? o, l = o[1] - o[0], u = M([o[0] + d / a * l, o[1] + d / a * l], c);
|
|
1718
1767
|
e.independent ? x[t.index] = u : S[i] = u;
|
|
1719
1768
|
}), e.independent ? g.value = x : h.value = S, r("zoom-change", v);
|
|
@@ -1723,7 +1772,7 @@ function Hn(e) {
|
|
|
1723
1772
|
if (!t || !n || e.pointerId !== t.pointerId) return;
|
|
1724
1773
|
let r = o.value.find((e) => e.index === t.trackIndex);
|
|
1725
1774
|
if (!r) return;
|
|
1726
|
-
let [a, s] =
|
|
1775
|
+
let [a, s] = B(e, n), c = Math.max(0, Math.min(t.independent ? r.width : l.value, a)), d = Math.max(0, Math.min(t.independent ? r.height : u.value, s)), f = In(i.value, {
|
|
1727
1776
|
type: "move",
|
|
1728
1777
|
pointerId: e.pointerId,
|
|
1729
1778
|
position: {
|
|
@@ -1737,16 +1786,16 @@ function Hn(e) {
|
|
|
1737
1786
|
}, R = (e) => {
|
|
1738
1787
|
let t = i.value;
|
|
1739
1788
|
!t || e && e.pointerId !== t.pointerId || A(t.pointerId, e);
|
|
1740
|
-
},
|
|
1789
|
+
}, z = (e) => {
|
|
1741
1790
|
let t = o.value.find((t) => t.index === e.trackIndex);
|
|
1742
1791
|
if (!t || (e.independent ? !S(t) : !C())) return;
|
|
1743
1792
|
let i = e.independent ? 0 : t.left, a = Math.max(0, Math.min(t.width, Math.min(e.startX, e.currentX) - i)), s = Math.max(0, Math.min(t.width, Math.max(e.startX, e.currentX) - i));
|
|
1744
1793
|
if (s - a < 6) return;
|
|
1745
|
-
let u = e.independent ? b(t) : c.value, f = e.independent ? [t.seriesList] : o.value.filter((e) => e.hasVisibleSeries).map((e) => e.seriesList), h =
|
|
1794
|
+
let u = e.independent ? b(t) : c.value, f = e.independent ? [t.seriesList] : o.value.filter((e) => e.hasVisibleSeries).map((e) => e.seriesList), h = Wn([t.xScale.invert(a), t.xScale.invert(s)], u, f, n);
|
|
1746
1795
|
if (e.independent) {
|
|
1747
1796
|
let e = [...m.value];
|
|
1748
|
-
e[t.index] =
|
|
1749
|
-
} else p.value =
|
|
1797
|
+
e[t.index] = Gn(h, u, t.width), m.value = e;
|
|
1798
|
+
} else p.value = Gn(h, u, l.value);
|
|
1750
1799
|
let g = e.independent ? [t] : o.value, _ = Object.fromEntries(g.map((e) => [e.series.trackId ?? e.series.id, e.yScale.domain()]));
|
|
1751
1800
|
if (r("zoom-change", h), e.independent) {
|
|
1752
1801
|
let e = _[t.series.trackId ?? t.series.id];
|
|
@@ -1787,7 +1836,7 @@ function Hn(e) {
|
|
|
1787
1836
|
A(t.pointerId, e);
|
|
1788
1837
|
return;
|
|
1789
1838
|
}
|
|
1790
|
-
let [a, s] =
|
|
1839
|
+
let [a, s] = B(e, r), c = Math.max(0, Math.min(t.independent ? n.width : l.value, a)), f = Math.max(0, Math.min(t.independent ? n.height : u.value, s)), p = In(i.value, {
|
|
1791
1840
|
type: "finish",
|
|
1792
1841
|
pointerId: e.pointerId,
|
|
1793
1842
|
position: {
|
|
@@ -1800,7 +1849,7 @@ function Hn(e) {
|
|
|
1800
1849
|
I(p, n), d(w);
|
|
1801
1850
|
return;
|
|
1802
1851
|
}
|
|
1803
|
-
Math.abs(p.currentX - p.startX) >= 6 &&
|
|
1852
|
+
Math.abs(p.currentX - p.startX) >= 6 && z(p);
|
|
1804
1853
|
}
|
|
1805
1854
|
}, H = (e) => {
|
|
1806
1855
|
if (T(), R(), n.displayMode === "independent" && e !== void 0) {
|
|
@@ -1837,7 +1886,7 @@ function Hn(e) {
|
|
|
1837
1886
|
}
|
|
1838
1887
|
//#endregion
|
|
1839
1888
|
//#region src/components/utils/useAnimationFrameThrottle.ts
|
|
1840
|
-
function
|
|
1889
|
+
function qn() {
|
|
1841
1890
|
let e = null, t = null;
|
|
1842
1891
|
function n(n) {
|
|
1843
1892
|
t = n, e === null && (e = requestAnimationFrame(() => {
|
|
@@ -1866,8 +1915,8 @@ function Un() {
|
|
|
1866
1915
|
}
|
|
1867
1916
|
//#endregion
|
|
1868
1917
|
//#region src/components/interaction/useWaveformZoom.ts
|
|
1869
|
-
function
|
|
1870
|
-
let { props: t, emit: n, svgElement: r, sharedOverlayElement: i, sharedTransform: a, independentTransforms: o, trackLayouts: s, initialXDomain: c, sharedZoomDomain: l, innerWidth: u, innerHeight: d, hasChartArea: f, isZoomMode: p, isPresentationMode: m, resolveInitialTrackDomain: h, cancelPendingHover: g } = e, _ = /* @__PURE__ */ new Map(), v =
|
|
1918
|
+
function Jn(e) {
|
|
1919
|
+
let { props: t, emit: n, svgElement: r, sharedOverlayElement: i, sharedTransform: a, independentTransforms: o, trackLayouts: s, initialXDomain: c, sharedZoomDomain: l, innerWidth: u, innerHeight: d, hasChartArea: f, isZoomMode: p, isPresentationMode: m, resolveInitialTrackDomain: h, cancelPendingHover: g } = e, _ = /* @__PURE__ */ new Map(), v = qn(), y = !1, b = null, x = null, S = null, C = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Set(), D, O = () => v.schedule(j), k = (e) => {
|
|
1871
1920
|
y || m.value || (g(), b = e.transform, x = "wheel", O(), P());
|
|
1872
1921
|
}, A = (e, t) => {
|
|
1873
1922
|
y || m.value || (g(), C.set(t, e.transform), w.set(t, "wheel"), O(), P());
|
|
@@ -1880,7 +1929,7 @@ function Wn(e) {
|
|
|
1880
1929
|
if (b) {
|
|
1881
1930
|
let e = b;
|
|
1882
1931
|
b = null, S = x, x = null, a.value = e;
|
|
1883
|
-
let t = e.rescaleX(
|
|
1932
|
+
let t = e.rescaleX(V(c.value, [0, u.value])).domain();
|
|
1884
1933
|
n("zoom-change", [t[0], t[1]]);
|
|
1885
1934
|
}
|
|
1886
1935
|
if (!C.size) return;
|
|
@@ -1951,41 +2000,41 @@ function Wn(e) {
|
|
|
1951
2000
|
let F = () => {
|
|
1952
2001
|
b = null, x = null, S = null, C.clear(), w.clear(), E.clear(), T.clear(), v.cancel(), D !== void 0 && (clearTimeout(D), D = void 0);
|
|
1953
2002
|
}, I = () => {
|
|
1954
|
-
F(), r.value?.querySelectorAll(".waveform-chart__overlay").forEach((e) =>
|
|
2003
|
+
F(), r.value?.querySelectorAll(".waveform-chart__overlay").forEach((e) => H(e).on(".zoom", null)), _.clear();
|
|
1955
2004
|
}, L = (e, n) => {
|
|
1956
2005
|
let r = Math.abs(e[1] - e[0]);
|
|
1957
|
-
if (!Number.isFinite(r) || r <= 0) return
|
|
1958
|
-
let i =
|
|
1959
|
-
return Math.max(
|
|
1960
|
-
}, R = (e, n, r, i) =>
|
|
2006
|
+
if (!Number.isFinite(r) || r <= 0) return vt.MIN_SCALE;
|
|
2007
|
+
let i = Hn(e, n, t);
|
|
2008
|
+
return Math.max(vt.MIN_SCALE, i > 0 ? r / i : vt.DEFAULT_MAX_SCALE);
|
|
2009
|
+
}, R = (e, n, r, i) => Gn(Wn(e.rescaleX(V(n, [0, r])).domain(), n, i, t), n, r), z = (e) => {
|
|
1961
2010
|
let n = Number(t.minVisiblePoints);
|
|
1962
|
-
return
|
|
1963
|
-
},
|
|
2011
|
+
return qt(e.seriesList, e.xScale.domain(), Number.isFinite(n) && n > 0 ? Math.ceil(n) + 1 : n);
|
|
2012
|
+
}, B = () => {
|
|
1964
2013
|
let e = s.value.filter((e) => e.hasVisibleSeries);
|
|
1965
2014
|
return e.length > 0 && e.every(z);
|
|
1966
2015
|
}, U = (e, t) => {
|
|
1967
2016
|
if (e.type !== "wheel") return !1;
|
|
1968
2017
|
let n = e.deltaY;
|
|
1969
|
-
return n < 0 ? t : n > 0 &&
|
|
2018
|
+
return n < 0 ? t : n > 0 && K(e.currentTarget).k > vt.MIN_SCALE;
|
|
1970
2019
|
};
|
|
1971
2020
|
return {
|
|
1972
2021
|
cancelPendingZoom: F,
|
|
1973
2022
|
clearZoomBindings: I,
|
|
1974
2023
|
canZoomTrack: z,
|
|
1975
|
-
canZoomSharedTracks:
|
|
2024
|
+
canZoomSharedTracks: B,
|
|
1976
2025
|
configureZoom: () => {
|
|
1977
2026
|
if (I(), m.value || !t.zoomable || !p.value || !f.value || !s.value.length) return;
|
|
1978
2027
|
if (t.displayMode === "independent") {
|
|
1979
2028
|
s.value.forEach((e) => {
|
|
1980
2029
|
let t = r.value?.querySelector(`[data-independent-overlay-index="${e.index}"]`);
|
|
1981
2030
|
if (!t) return;
|
|
1982
|
-
let n = h(e), i = [e.seriesList], a =
|
|
2031
|
+
let n = h(e), i = [e.seriesList], a = re().filter((t) => {
|
|
1983
2032
|
let n = s.value.find((t) => t.index === e.index) ?? e;
|
|
1984
2033
|
return U(t, z(n));
|
|
1985
2034
|
}).scaleExtent([1, L(n, i)]).constrain((t) => R(t, n, e.width, i)).extent([[0, 0], [e.width, e.height]]).translateExtent([[0, 0], [e.width, e.height]]).on("zoom", (t) => A(t, e.index)).on("end", N);
|
|
1986
2035
|
_.set(e.index, a), y = !0;
|
|
1987
2036
|
try {
|
|
1988
|
-
|
|
2037
|
+
H(t).call(a).on("dblclick.zoom", null).call(a.transform, o.value[e.index] ?? G);
|
|
1989
2038
|
} finally {
|
|
1990
2039
|
y = !1;
|
|
1991
2040
|
}
|
|
@@ -1994,10 +2043,10 @@ function Wn(e) {
|
|
|
1994
2043
|
}
|
|
1995
2044
|
let e = i.value;
|
|
1996
2045
|
if (!e) return;
|
|
1997
|
-
let n = s.value.filter((e) => e.hasVisibleSeries).map((e) => e.seriesList), l =
|
|
2046
|
+
let n = s.value.filter((e) => e.hasVisibleSeries).map((e) => e.seriesList), l = re().filter((e) => U(e, B())).scaleExtent([1, L(c.value, n)]).constrain((e) => R(e, c.value, u.value, n)).extent([[0, 0], [u.value, d.value]]).translateExtent([[0, 0], [u.value, d.value]]).on("zoom", k).on("end", N);
|
|
1998
2047
|
_.set("shared", l), y = !0;
|
|
1999
2048
|
try {
|
|
2000
|
-
|
|
2049
|
+
H(e).call(l).on("dblclick.zoom", null).call(l.transform, a.value);
|
|
2001
2050
|
} finally {
|
|
2002
2051
|
y = !1;
|
|
2003
2052
|
}
|
|
@@ -2006,13 +2055,13 @@ function Wn(e) {
|
|
|
2006
2055
|
}
|
|
2007
2056
|
//#endregion
|
|
2008
2057
|
//#region src/components/core/useWaveformChartLifecycle.ts
|
|
2009
|
-
function
|
|
2058
|
+
function Yn(e) {
|
|
2010
2059
|
return e instanceof Element && !!e.closest("button, input, select, textarea, [contenteditable]:not([contenteditable=\"false\"])");
|
|
2011
2060
|
}
|
|
2012
|
-
function
|
|
2061
|
+
function Xn(e) {
|
|
2013
2062
|
let { props: t, emit: n, container: r, titleMeasureElement: i, resizeObserver: a, observedWidth: o, observedHeight: s, measuredTitleWidth: c, measuredTitleHeight: l, resolvedTitleText: u, titleAreaReserved: f, titleMeasureStyle: p, spacePressed: g, pointerInsideChart: _, currentPage: v, pageCount: y, pagedTracks: b, gridOptions: x, chartSeries: S, chartTracks: C, trackLayouts: w, innerWidth: T, innerHeight: D, activeInteractionMode: O, hiddenSeriesIdSet: k, internalHiddenSeriesIds: A, independentTransforms: j, independentYDomains: M, resolveInitialTrackDomain: N, annotationInteraction: P, editorSeriesOptions: F, isPresentationMode: I, clearHover: L, cancelAnnotation: R, configureZoom: z, resetViewport: B, cancelViewportDrag: V, cancelPendingHover: H, clearZoomBindings: U } = e;
|
|
2014
2063
|
function ee(e) {
|
|
2015
|
-
I.value || e.code !== "Space" || !t.pannable || !_.value ||
|
|
2064
|
+
I.value || e.code !== "Space" || !t.pannable || !_.value || Yn(e.target) || (g.value = !0, e.preventDefault());
|
|
2016
2065
|
}
|
|
2017
2066
|
function te(e) {
|
|
2018
2067
|
e.code === "Space" && (g.value = !1);
|
|
@@ -2028,7 +2077,7 @@ function Kn(e) {
|
|
|
2028
2077
|
if (!(!n || !Number.isFinite(n[0]) || !Number.isFinite(n[1]) || n[0] === n[1])) return e.xScale.domain();
|
|
2029
2078
|
}));
|
|
2030
2079
|
}
|
|
2031
|
-
function
|
|
2080
|
+
function K() {
|
|
2032
2081
|
if (t.displayMode === "independent") {
|
|
2033
2082
|
let e = j.value;
|
|
2034
2083
|
j.value = C.value.map((t, n) => e[n] ?? G);
|
|
@@ -2039,8 +2088,8 @@ function Kn(e) {
|
|
|
2039
2088
|
w.value.forEach((n) => {
|
|
2040
2089
|
let r = W?.[n.index];
|
|
2041
2090
|
if (!r) return;
|
|
2042
|
-
let i = N(n), a =
|
|
2043
|
-
e[n.index] =
|
|
2091
|
+
let i = N(n), a = Wn(r, i, [n.seriesList], t);
|
|
2092
|
+
e[n.index] = Gn(a, i, n.width);
|
|
2044
2093
|
}), j.value = e, W = void 0, d(z);
|
|
2045
2094
|
return;
|
|
2046
2095
|
}
|
|
@@ -2097,7 +2146,7 @@ function Kn(e) {
|
|
|
2097
2146
|
let n = P.editorDraft.value;
|
|
2098
2147
|
n?.mode === "edit" && !e.some((e) => e.id === n.annotation.id) && P.closeEditor();
|
|
2099
2148
|
}, { deep: !0 });
|
|
2100
|
-
function
|
|
2149
|
+
function q() {
|
|
2101
2150
|
if (!f.value || !i.value) {
|
|
2102
2151
|
c.value = 0, l.value = 0;
|
|
2103
2152
|
return;
|
|
@@ -2110,25 +2159,25 @@ function Kn(e) {
|
|
|
2110
2159
|
f,
|
|
2111
2160
|
p
|
|
2112
2161
|
], async () => {
|
|
2113
|
-
c.value = 0, l.value = 0, await d(),
|
|
2162
|
+
c.value = 0, l.value = 0, await d(), q();
|
|
2114
2163
|
}, { immediate: !0 }), h(() => {
|
|
2115
2164
|
window.addEventListener("keydown", ee), window.addEventListener("keyup", te), r.value && (a.value = new ResizeObserver(([e]) => {
|
|
2116
|
-
o.value = Math.max(0, e?.contentRect.width ?? 0), s.value = Math.max(0, e?.contentRect.height ?? 0), d(
|
|
2165
|
+
o.value = Math.max(0, e?.contentRect.width ?? 0), s.value = Math.max(0, e?.contentRect.height ?? 0), d(q);
|
|
2117
2166
|
}), a.value.observe(r.value));
|
|
2118
2167
|
}), m(() => {
|
|
2119
2168
|
window.removeEventListener("keydown", ee), window.removeEventListener("keyup", te), H(), a.value?.disconnect(), U(), F.value = [];
|
|
2120
2169
|
}), {
|
|
2121
2170
|
goToPage: ne,
|
|
2122
2171
|
handleBeforeDataReferenceChange: re,
|
|
2123
|
-
handleDataReferenceChange:
|
|
2172
|
+
handleDataReferenceChange: K
|
|
2124
2173
|
};
|
|
2125
2174
|
}
|
|
2126
2175
|
//#endregion
|
|
2127
2176
|
//#region src/components/core/useWaveformData.ts
|
|
2128
|
-
function
|
|
2177
|
+
function Zn(e, t = !1) {
|
|
2129
2178
|
let n = Infinity, r = -Infinity, i = Infinity, a = -Infinity, o = !1;
|
|
2130
2179
|
for (let s of e) if (s.x < n && (n = s.x), s.x > r && (r = s.x), s.y < i && (i = s.y), s.y > a && (a = s.y), t) {
|
|
2131
|
-
let e =
|
|
2180
|
+
let e = Pt(s);
|
|
2132
2181
|
(e.lower !== 0 || e.upper !== 0) && (o = !0), i = Math.min(i, s.y - e.lower), a = Math.max(a, s.y + e.upper);
|
|
2133
2182
|
}
|
|
2134
2183
|
return {
|
|
@@ -2137,27 +2186,27 @@ function qn(e, t = !1) {
|
|
|
2137
2186
|
hasErrorPoints: o
|
|
2138
2187
|
};
|
|
2139
2188
|
}
|
|
2140
|
-
function
|
|
2141
|
-
return
|
|
2142
|
-
let t =
|
|
2189
|
+
function Qn(e) {
|
|
2190
|
+
return It(e).map((e) => {
|
|
2191
|
+
let t = Zn(e.points, e.errorBar.visible);
|
|
2143
2192
|
return {
|
|
2144
2193
|
...e,
|
|
2145
2194
|
...t
|
|
2146
2195
|
};
|
|
2147
2196
|
});
|
|
2148
2197
|
}
|
|
2149
|
-
function
|
|
2150
|
-
let r = x(
|
|
2198
|
+
function $n(e, t, n) {
|
|
2199
|
+
let r = x(Qn(e()));
|
|
2151
2200
|
return E(e, (e) => {
|
|
2152
|
-
t(), r.value =
|
|
2201
|
+
t(), r.value = Qn(e), n();
|
|
2153
2202
|
}), r;
|
|
2154
2203
|
}
|
|
2155
2204
|
//#endregion
|
|
2156
2205
|
//#region src/components/core/useWaveformLayout.ts
|
|
2157
|
-
function
|
|
2206
|
+
function er(e) {
|
|
2158
2207
|
let { props: n, preparedSeries: r, currentPage: i, hiddenSeriesIdSet: a, chartWidth: o, innerHeight: s, isCleanView: c, sharedTransform: l, independentTransforms: u, sharedYDomains: d, independentYDomains: f, annotationInteraction: p } = e, m = t(() => r.value.map((e, t) => ({
|
|
2159
2208
|
...e,
|
|
2160
|
-
color: e.color ?? (t === 0 ? n.lineColor :
|
|
2209
|
+
color: e.color ?? (t === 0 ? n.lineColor : xt[t % xt.length])
|
|
2161
2210
|
}))), h = t(() => {
|
|
2162
2211
|
let e = /* @__PURE__ */ new Map();
|
|
2163
2212
|
return m.value.forEach((t) => {
|
|
@@ -2175,15 +2224,15 @@ function Xn(e) {
|
|
|
2175
2224
|
yDomain: $(i)
|
|
2176
2225
|
};
|
|
2177
2226
|
});
|
|
2178
|
-
}), g = t(() =>
|
|
2179
|
-
let e = h.value.filter((e) => e.visibleSeries.length > 0).flatMap((e) =>
|
|
2227
|
+
}), g = t(() => en(n.grid)), _ = t(() => Ut(n.rendering)), v = t(() => nn(h.value.length, g.value)), y = t(() => rn(h.value, i.value, g.value)), b = t(() => {
|
|
2228
|
+
let e = h.value.filter((e) => e.visibleSeries.length > 0).flatMap((e) => xn(e, n.overlayMode, n.yDomain, n.yDomains)).map((e) => Sn(e.domain, !e.fixed).tickTextWidth), t = Math.max(7, ...e), r = t + 7 + 4, i = -(7 + t + 6 + 24 / 2);
|
|
2180
2229
|
return {
|
|
2181
2230
|
tickClearance: r,
|
|
2182
2231
|
fullClearance: t + 7 + 6 + 24 + 4,
|
|
2183
2232
|
labelCenterX: i
|
|
2184
2233
|
};
|
|
2185
|
-
}), x = t(() => h.value.some((e) => e.visibleSeries.length === 1 && !!(e.visibleSeries[0]?.name.trim() || n.yLabel))), S = t(() => h.value.some((e) => e.visibleSeries.length > 0)), C = t(() => Math.max(
|
|
2186
|
-
let r =
|
|
2234
|
+
}), x = t(() => h.value.some((e) => e.visibleSeries.length === 1 && !!(e.visibleSeries[0]?.name.trim() || n.yLabel))), S = t(() => h.value.some((e) => e.visibleSeries.length > 0)), C = t(() => Math.max(_t.left, x.value ? b.value.fullClearance : S.value ? b.value.tickClearance : 0)), w = t(() => h.value.reduce((e, t) => {
|
|
2235
|
+
let r = Tn(t, n.overlayMode, n.yDomain, n.yDomains);
|
|
2187
2236
|
return {
|
|
2188
2237
|
left: Math.max(e.left, r.left),
|
|
2189
2238
|
right: Math.max(e.right, r.right)
|
|
@@ -2191,8 +2240,8 @@ function Xn(e) {
|
|
|
2191
2240
|
}, {
|
|
2192
2241
|
left: 0,
|
|
2193
2242
|
right: 0
|
|
2194
|
-
})), T = t(() => n.overlayMode === "multi-axis" ? Math.max(C.value, w.value.left) : C.value), E = t(() => n.overlayMode === "multi-axis" ? Math.max(
|
|
2195
|
-
let e =
|
|
2243
|
+
})), T = t(() => n.overlayMode === "multi-axis" ? Math.max(C.value, w.value.left) : C.value), E = t(() => n.overlayMode === "multi-axis" ? Math.max(_t.right, w.value.right) : _t.right), D = t(() => Math.max(0, o.value - T.value - E.value)), O = t(() => {
|
|
2244
|
+
let e = an(n.displayMode), t = g.value.columnCount, r = t > 1, i = Math.max(e, b.value.fullClearance), a = Math.max(e, b.value.tickClearance), o = (D.value - i * Math.max(0, t - 1)) / t >= 120;
|
|
2196
2245
|
return {
|
|
2197
2246
|
horizontalGap: n.overlayMode === "multi-axis" && r && S.value ? Math.max(e, w.value.left + w.value.right) : r && S.value ? x.value && o ? i : a : e,
|
|
2198
2247
|
hideSecondaryLabels: n.overlayMode !== "multi-axis" && r && x.value && !o
|
|
@@ -2204,14 +2253,14 @@ function Xn(e) {
|
|
|
2204
2253
|
}), $(e);
|
|
2205
2254
|
}), F = t(() => {
|
|
2206
2255
|
let e = n.initialXDomain;
|
|
2207
|
-
return e && Number.isFinite(e[0]) && Number.isFinite(e[1]) && e[0] !== e[1] ?
|
|
2256
|
+
return e && Number.isFinite(e[0]) && Number.isFinite(e[1]) && e[0] !== e[1] ? un(e[0] < e[1] ? e : [e[1], e[0]], n.xDomainStrategy, !0) : un(P.value, n.xDomainStrategy);
|
|
2208
2257
|
}), I = (e) => {
|
|
2209
2258
|
let t = n.initialXDomains?.[e.series.trackId ?? e.series.id] ?? n.initialXDomains?.[e.series.id] ?? n.initialXDomain;
|
|
2210
|
-
return t && Number.isFinite(t[0]) && Number.isFinite(t[1]) && t[0] !== t[1] ?
|
|
2211
|
-
}, L = t(() => l.value.rescaleX(
|
|
2259
|
+
return t && Number.isFinite(t[0]) && Number.isFinite(t[1]) && t[0] !== t[1] ? un(t[0] < t[1] ? t : [t[1], t[0]], n.xDomainStrategy, !0) : un($(e.seriesList.flatMap((e) => e.xDomain)), n.xDomainStrategy);
|
|
2260
|
+
}, L = t(() => l.value.rescaleX(V(F.value, [0, D.value])).domain()), R = t(() => on(D.value, s.value, g.value, n.displayMode, y.value.map(Boolean), O.value.horizontalGap).map((e, t) => ({
|
|
2212
2261
|
...e,
|
|
2213
2262
|
series: y.value[t]
|
|
2214
|
-
}))), z = t(() =>
|
|
2263
|
+
}))), z = t(() => fn({
|
|
2215
2264
|
cells: R.value,
|
|
2216
2265
|
grid: g.value,
|
|
2217
2266
|
displayMode: n.displayMode,
|
|
@@ -2233,11 +2282,11 @@ function Xn(e) {
|
|
|
2233
2282
|
hideSecondaryLabels: c.value || O.value.hideSecondaryLabels,
|
|
2234
2283
|
yAxisLabelX: b.value.labelCenterX,
|
|
2235
2284
|
showCompactEmptyTracks: n.displayMode === "compact" && k.value
|
|
2236
|
-
})),
|
|
2285
|
+
})), B = (e) => e.seriesList.map((t) => ({
|
|
2237
2286
|
...e,
|
|
2238
2287
|
series: t,
|
|
2239
2288
|
yScale: e.seriesPaths.find((e) => e.series.id === t.id)?.yScale ?? e.yScale
|
|
2240
|
-
})), H = (e, t) => e.seriesPaths.find((e) => e.series.id === t)?.yScale ?? e.yScale, U = t(() => z.value.flatMap(
|
|
2289
|
+
})), H = (e, t) => e.seriesPaths.find((e) => e.series.id === t)?.yScale ?? e.yScale, U = t(() => z.value.flatMap(B));
|
|
2241
2290
|
return {
|
|
2242
2291
|
chartSeries: m,
|
|
2243
2292
|
chartTracks: h,
|
|
@@ -2257,10 +2306,10 @@ function Xn(e) {
|
|
|
2257
2306
|
resolveInitialTrackDomain: I,
|
|
2258
2307
|
gridCells: R,
|
|
2259
2308
|
trackLayouts: z,
|
|
2260
|
-
annotationLayoutsForTrack:
|
|
2309
|
+
annotationLayoutsForTrack: B,
|
|
2261
2310
|
resolveSeriesYScale: H,
|
|
2262
2311
|
annotationTrackLayouts: U,
|
|
2263
|
-
renderedAnnotations: t(() => n.annotationsVisible ?
|
|
2312
|
+
renderedAnnotations: t(() => n.annotationsVisible ? ge(n.annotations, U.value, D.value, s.value) : []),
|
|
2264
2313
|
editorSeries: t(() => {
|
|
2265
2314
|
let e = p.editorDraft.value?.annotation.seriesId, t = m.value.find((t) => t.id === e);
|
|
2266
2315
|
return t ? {
|
|
@@ -2275,13 +2324,13 @@ function Xn(e) {
|
|
|
2275
2324
|
}
|
|
2276
2325
|
};
|
|
2277
2326
|
}
|
|
2278
|
-
var
|
|
2279
|
-
function
|
|
2327
|
+
var tr = 1e-6;
|
|
2328
|
+
function nr(e) {
|
|
2280
2329
|
return Number.isFinite(e) ? Math.max(1, e) : 1;
|
|
2281
2330
|
}
|
|
2282
|
-
function
|
|
2283
|
-
let i =
|
|
2284
|
-
if (!(d >
|
|
2331
|
+
function rr({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r }) {
|
|
2332
|
+
let i = nr(e), a = nr(t), o = nr(n), s = Number.isFinite(r) ? r : 0, c = s * Math.PI / 180, l = Math.abs(Math.cos(c)), u = Math.abs(Math.sin(c)), d = (s % 360 + 360) % 360;
|
|
2333
|
+
if (!(d > tr && Math.abs(d - 360) > tr)) {
|
|
2285
2334
|
let e = Math.max(1, Math.ceil(i / o)), t = o, n = a * e;
|
|
2286
2335
|
return {
|
|
2287
2336
|
textWidth: t,
|
|
@@ -2306,7 +2355,7 @@ function $n({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r
|
|
|
2306
2355
|
}
|
|
2307
2356
|
//#endregion
|
|
2308
2357
|
//#region src/components/core/useWaveformPresentation.ts
|
|
2309
|
-
function
|
|
2358
|
+
function ir(e) {
|
|
2310
2359
|
let { props: n, observedWidth: r, observedHeight: i, measuredTitleWidth: a, measuredTitleHeight: o, internalHiddenSeriesIds: s, paginationBandHeight: c } = e, l = t(() => Number.isFinite(n.width) ? Math.max(0, n.width ?? 0) : void 0), u = t(() => Number.isFinite(n.height) ? Math.max(180, n.height ?? 0) : void 0), d = t(() => r.value > 0 ? r.value : l.value ?? 0), f = t(() => i.value > 0 ? i.value : u.value ?? 180), p = t(() => ({
|
|
2311
2360
|
width: l.value === void 0 ? "100%" : `${l.value}px`,
|
|
2312
2361
|
height: u.value === void 0 ? "100%" : `${u.value}px`
|
|
@@ -2314,9 +2363,9 @@ function er(e) {
|
|
|
2314
2363
|
let e = n.zeroLine.width;
|
|
2315
2364
|
return {
|
|
2316
2365
|
visible: n.zeroLine.visible === !0,
|
|
2317
|
-
color: n.zeroLine.color ||
|
|
2318
|
-
width: typeof e == "number" && Number.isFinite(e) && e > 0 ? e :
|
|
2319
|
-
dash: n.zeroLine.dash ??
|
|
2366
|
+
color: n.zeroLine.color || Ct.COLOR,
|
|
2367
|
+
width: typeof e == "number" && Number.isFinite(e) && e > 0 ? e : Ct.WIDTH,
|
|
2368
|
+
dash: n.zeroLine.dash ?? Ct.DASH
|
|
2320
2369
|
};
|
|
2321
2370
|
}), _ = t(() => n.legend.backgroundColor || "rgba(255, 255, 255, 0.7)"), v = t(() => n.legend.interactive === !0), y = t(() => n.hiddenSeriesIds === void 0 ? s.value : new Set(n.hiddenSeriesIds)), b = t(() => Array.from(y.value)), x = (e) => n.legend.trackPositions?.[e] ?? n.legend.position ?? "top-right", S = (e) => {
|
|
2322
2371
|
let t = n.legend.orientation ?? "auto";
|
|
@@ -2338,10 +2387,10 @@ function er(e) {
|
|
|
2338
2387
|
fontStyle: n.title?.textStyle?.fontStyle ?? "normal",
|
|
2339
2388
|
textDecoration: n.title?.textStyle?.textDecoration ?? "none",
|
|
2340
2389
|
letterSpacing: n.title?.textStyle?.letterSpacing ?? "normal",
|
|
2341
|
-
lineHeight: String(
|
|
2390
|
+
lineHeight: String(bt)
|
|
2342
2391
|
})), A = t(() => {
|
|
2343
2392
|
let e = Number.parseFloat(n.title?.textStyle?.letterSpacing ?? ""), t = Number.isFinite(e) ? Math.max(0, C.value.length - 1) * e : 0;
|
|
2344
|
-
return Math.max(1, C.value.length * E.value *
|
|
2393
|
+
return Math.max(1, C.value.length * E.value * yt + t);
|
|
2345
2394
|
}), j = t(() => {
|
|
2346
2395
|
let e = d.value - 48;
|
|
2347
2396
|
return e > 0 ? e : A.value;
|
|
@@ -2351,14 +2400,14 @@ function er(e) {
|
|
|
2351
2400
|
maxWidth: O.value ? "none" : `${j.value}px`,
|
|
2352
2401
|
whiteSpace: O.value ? "nowrap" : "normal",
|
|
2353
2402
|
overflowWrap: O.value ? "normal" : "anywhere"
|
|
2354
|
-
})), N = t(() =>
|
|
2403
|
+
})), N = t(() => rr({
|
|
2355
2404
|
naturalWidth: a.value || A.value,
|
|
2356
2405
|
naturalHeight: o.value || E.value * 1.2,
|
|
2357
2406
|
availableWidth: j.value,
|
|
2358
2407
|
rotation: D.value
|
|
2359
2408
|
})), P = t(() => w.value ? N.value.areaHeight : 0), F = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, I = t(() => ({
|
|
2360
|
-
top: F(n.plotMargin.top,
|
|
2361
|
-
bottom: F(n.plotMargin.bottom,
|
|
2409
|
+
top: F(n.plotMargin.top, _t.top),
|
|
2410
|
+
bottom: F(n.plotMargin.bottom, _t.bottom)
|
|
2362
2411
|
})), L = t(() => I.value.top), R = t(() => Math.max(0, f.value - P.value - c.value));
|
|
2363
2412
|
return {
|
|
2364
2413
|
fixedWidth: l,
|
|
@@ -2407,10 +2456,10 @@ function er(e) {
|
|
|
2407
2456
|
}
|
|
2408
2457
|
//#endregion
|
|
2409
2458
|
//#region src/components/core/useWaveformChartController.ts
|
|
2410
|
-
function
|
|
2459
|
+
function ar(e, t) {
|
|
2411
2460
|
e.value = t instanceof Element ? t : void 0;
|
|
2412
2461
|
}
|
|
2413
|
-
function
|
|
2462
|
+
function or(e, t) {
|
|
2414
2463
|
let n = v(), r = v(), i = v(), a = v(), o = v(0), s = v(0), c = v(0), l = v(0), d = v(0), f = x(G), p = x([]), m = v({}), h = v({}), g = b({
|
|
2415
2464
|
points: [],
|
|
2416
2465
|
trackIndex: null,
|
|
@@ -2418,11 +2467,11 @@ function nr(e, t) {
|
|
|
2418
2467
|
x: 0,
|
|
2419
2468
|
y: 0
|
|
2420
2469
|
}
|
|
2421
|
-
}), y = v(!1), S = v(1), w = x(), T =
|
|
2470
|
+
}), y = v(!1), S = v(1), w = x(), T = se("waveform-clip"), O = v(new Set(e.defaultHiddenSeriesIds)), k = Ye(), A = v([]), j = qn();
|
|
2422
2471
|
E([() => e.yDomain, () => e.yDomains], () => {
|
|
2423
2472
|
m.value = {}, h.value = {};
|
|
2424
2473
|
}, { deep: !0 });
|
|
2425
|
-
let M = x(null), N = v(!1), P = v(!1), F = () => void 0, I = () => void 0, L =
|
|
2474
|
+
let M = x(null), N = v(!1), P = v(!1), F = () => void 0, I = () => void 0, L = $n(() => e.data, () => F(), () => I()), R = ir({
|
|
2426
2475
|
props: e,
|
|
2427
2476
|
observedWidth: o,
|
|
2428
2477
|
observedHeight: s,
|
|
@@ -2430,101 +2479,101 @@ function nr(e, t) {
|
|
|
2430
2479
|
measuredTitleHeight: l,
|
|
2431
2480
|
internalHiddenSeriesIds: O,
|
|
2432
2481
|
paginationBandHeight: d
|
|
2433
|
-
}), { chartWidth: z, chartHeight: B, isCleanView: V, isPresentationMode: H, hiddenSeriesIdSet: U, resolvedTitleText: ee, titleAreaReserved: te, titleMeasureStyle: ne, titleAreaHeight: W, chartTopMargin: re, innerHeight:
|
|
2482
|
+
}), { chartWidth: z, chartHeight: B, isCleanView: V, isPresentationMode: H, hiddenSeriesIdSet: U, resolvedTitleText: ee, titleAreaReserved: te, titleMeasureStyle: ne, titleAreaHeight: W, chartTopMargin: re, innerHeight: K } = R, q = er({
|
|
2434
2483
|
props: e,
|
|
2435
2484
|
preparedSeries: L,
|
|
2436
2485
|
currentPage: S,
|
|
2437
2486
|
hiddenSeriesIdSet: U,
|
|
2438
2487
|
chartWidth: z,
|
|
2439
|
-
innerHeight:
|
|
2488
|
+
innerHeight: K,
|
|
2440
2489
|
isCleanView: V,
|
|
2441
2490
|
sharedTransform: f,
|
|
2442
2491
|
independentTransforms: p,
|
|
2443
2492
|
sharedYDomains: m,
|
|
2444
2493
|
independentYDomains: h,
|
|
2445
2494
|
annotationInteraction: u(k)
|
|
2446
|
-
}), { chartSeries:
|
|
2495
|
+
}), { chartSeries: ie, chartTracks: ae, trackLayouts: J, gridOptions: oe, pageCount: ce, pagedTracks: le, resolvedChartLeftMargin: ue, innerWidth: de, hasChartArea: fe, activeInteractionMode: pe, isZoomMode: me, initialXDomain: he, sharedZoomDomain: ge, resolveInitialTrackDomain: Y, annotationLayoutsForTrack: _e, resolveSeriesYScale: ve } = q;
|
|
2447
2496
|
D(() => {
|
|
2448
|
-
d.value =
|
|
2497
|
+
d.value = oe.value.showPagination && ce.value > 1 && z.value <= 520 ? 40 : 0;
|
|
2449
2498
|
});
|
|
2450
|
-
let
|
|
2499
|
+
let ye = Jn({
|
|
2451
2500
|
props: e,
|
|
2452
2501
|
emit: t,
|
|
2453
2502
|
svgElement: r,
|
|
2454
2503
|
sharedOverlayElement: a,
|
|
2455
2504
|
sharedTransform: f,
|
|
2456
2505
|
independentTransforms: p,
|
|
2457
|
-
trackLayouts:
|
|
2506
|
+
trackLayouts: J,
|
|
2458
2507
|
initialXDomain: he,
|
|
2459
|
-
sharedZoomDomain:
|
|
2460
|
-
innerWidth:
|
|
2461
|
-
innerHeight:
|
|
2462
|
-
hasChartArea:
|
|
2463
|
-
isZoomMode:
|
|
2508
|
+
sharedZoomDomain: ge,
|
|
2509
|
+
innerWidth: de,
|
|
2510
|
+
innerHeight: K,
|
|
2511
|
+
hasChartArea: fe,
|
|
2512
|
+
isZoomMode: me,
|
|
2464
2513
|
isPresentationMode: H,
|
|
2465
|
-
resolveInitialTrackDomain:
|
|
2466
|
-
cancelPendingHover: () =>
|
|
2467
|
-
}),
|
|
2514
|
+
resolveInitialTrackDomain: Y,
|
|
2515
|
+
cancelPendingHover: () => X.cancelPendingHover()
|
|
2516
|
+
}), be = kn({
|
|
2468
2517
|
props: e,
|
|
2469
2518
|
emit: t,
|
|
2470
2519
|
container: n,
|
|
2471
|
-
chartSeries:
|
|
2520
|
+
chartSeries: ie,
|
|
2472
2521
|
hiddenSeriesIdSet: U,
|
|
2473
2522
|
internalHiddenSeriesIds: O,
|
|
2474
2523
|
annotationInteraction: k,
|
|
2475
2524
|
editorSeriesOptions: A,
|
|
2476
|
-
trackLayouts:
|
|
2525
|
+
trackLayouts: J,
|
|
2477
2526
|
annotationLayoutsForTrack: _e,
|
|
2478
2527
|
resolveSeriesYScale: ve,
|
|
2479
2528
|
chartWidth: z,
|
|
2480
2529
|
chartHeight: B,
|
|
2481
|
-
innerWidth:
|
|
2482
|
-
resolvedChartLeftMargin:
|
|
2530
|
+
innerWidth: de,
|
|
2531
|
+
resolvedChartLeftMargin: ue,
|
|
2483
2532
|
titleAreaHeight: W,
|
|
2484
2533
|
chartTopMargin: re,
|
|
2485
|
-
activeInteractionMode:
|
|
2534
|
+
activeInteractionMode: pe,
|
|
2486
2535
|
isPresentationMode: H
|
|
2487
|
-
}),
|
|
2536
|
+
}), xe = Kn({
|
|
2488
2537
|
props: e,
|
|
2489
2538
|
emit: t,
|
|
2490
2539
|
selection: M,
|
|
2491
2540
|
spacePressed: N,
|
|
2492
|
-
trackLayouts:
|
|
2493
|
-
chartTracks:
|
|
2541
|
+
trackLayouts: J,
|
|
2542
|
+
chartTracks: ae,
|
|
2494
2543
|
initialXDomain: he,
|
|
2495
|
-
innerWidth:
|
|
2496
|
-
innerHeight:
|
|
2544
|
+
innerWidth: de,
|
|
2545
|
+
innerHeight: K,
|
|
2497
2546
|
sharedOverlayElement: a,
|
|
2498
2547
|
sharedTransform: f,
|
|
2499
2548
|
independentTransforms: p,
|
|
2500
2549
|
sharedYDomains: m,
|
|
2501
2550
|
independentYDomains: h,
|
|
2502
|
-
isZoomMode:
|
|
2551
|
+
isZoomMode: me,
|
|
2503
2552
|
isPresentationMode: H,
|
|
2504
2553
|
editorSeriesOptions: A,
|
|
2505
|
-
resolveInitialTrackDomain:
|
|
2506
|
-
canZoomTrack:
|
|
2507
|
-
canZoomSharedTracks:
|
|
2508
|
-
configureZoom:
|
|
2509
|
-
cancelPendingZoom:
|
|
2510
|
-
clearHover: () =>
|
|
2511
|
-
resolveTrackAtPointer:
|
|
2512
|
-
}),
|
|
2554
|
+
resolveInitialTrackDomain: Y,
|
|
2555
|
+
canZoomTrack: ye.canZoomTrack,
|
|
2556
|
+
canZoomSharedTracks: ye.canZoomSharedTracks,
|
|
2557
|
+
configureZoom: ye.configureZoom,
|
|
2558
|
+
cancelPendingZoom: ye.cancelPendingZoom,
|
|
2559
|
+
clearHover: () => X.clearHover(),
|
|
2560
|
+
resolveTrackAtPointer: be.resolveTrackAtPointer
|
|
2561
|
+
}), X = jn({
|
|
2513
2562
|
emit: t,
|
|
2514
2563
|
hoverState: g,
|
|
2515
2564
|
suppressHoverUntilMove: y,
|
|
2516
2565
|
hoverThrottle: j,
|
|
2517
2566
|
selection: M,
|
|
2518
|
-
trackLayouts:
|
|
2519
|
-
innerWidth:
|
|
2520
|
-
resolvedChartLeftMargin:
|
|
2567
|
+
trackLayouts: J,
|
|
2568
|
+
innerWidth: de,
|
|
2569
|
+
resolvedChartLeftMargin: ue,
|
|
2521
2570
|
titleAreaHeight: W,
|
|
2522
2571
|
chartTopMargin: re,
|
|
2523
2572
|
sharedOverlayElement: a,
|
|
2524
2573
|
isPresentationMode: H,
|
|
2525
|
-
updateViewportDrag:
|
|
2526
|
-
resolveTrackAtPointer:
|
|
2527
|
-
}),
|
|
2574
|
+
updateViewportDrag: xe.updateViewportDrag,
|
|
2575
|
+
resolveTrackAtPointer: be.resolveTrackAtPointer
|
|
2576
|
+
}), Z = Xn({
|
|
2528
2577
|
props: e,
|
|
2529
2578
|
emit: t,
|
|
2530
2579
|
container: n,
|
|
@@ -2540,40 +2589,40 @@ function nr(e, t) {
|
|
|
2540
2589
|
spacePressed: N,
|
|
2541
2590
|
pointerInsideChart: P,
|
|
2542
2591
|
currentPage: S,
|
|
2543
|
-
pageCount:
|
|
2544
|
-
pagedTracks:
|
|
2545
|
-
gridOptions:
|
|
2546
|
-
chartSeries:
|
|
2547
|
-
chartTracks:
|
|
2548
|
-
trackLayouts:
|
|
2549
|
-
innerWidth:
|
|
2550
|
-
innerHeight:
|
|
2551
|
-
activeInteractionMode:
|
|
2592
|
+
pageCount: ce,
|
|
2593
|
+
pagedTracks: le,
|
|
2594
|
+
gridOptions: oe,
|
|
2595
|
+
chartSeries: ie,
|
|
2596
|
+
chartTracks: ae,
|
|
2597
|
+
trackLayouts: J,
|
|
2598
|
+
innerWidth: de,
|
|
2599
|
+
innerHeight: K,
|
|
2600
|
+
activeInteractionMode: pe,
|
|
2552
2601
|
hiddenSeriesIdSet: U,
|
|
2553
2602
|
internalHiddenSeriesIds: O,
|
|
2554
2603
|
independentTransforms: p,
|
|
2555
2604
|
independentYDomains: h,
|
|
2556
|
-
resolveInitialTrackDomain:
|
|
2605
|
+
resolveInitialTrackDomain: Y,
|
|
2557
2606
|
annotationInteraction: k,
|
|
2558
2607
|
editorSeriesOptions: A,
|
|
2559
2608
|
isPresentationMode: H,
|
|
2560
|
-
clearHover:
|
|
2561
|
-
cancelAnnotation:
|
|
2562
|
-
configureZoom:
|
|
2563
|
-
resetViewport:
|
|
2564
|
-
cancelViewportDrag:
|
|
2565
|
-
cancelPendingHover:
|
|
2566
|
-
clearZoomBindings:
|
|
2609
|
+
clearHover: X.clearHover,
|
|
2610
|
+
cancelAnnotation: be.cancelAnnotation,
|
|
2611
|
+
configureZoom: ye.configureZoom,
|
|
2612
|
+
resetViewport: xe.resetViewport,
|
|
2613
|
+
cancelViewportDrag: xe.cancelViewportDrag,
|
|
2614
|
+
cancelPendingHover: X.cancelPendingHover,
|
|
2615
|
+
clearZoomBindings: ye.clearZoomBindings
|
|
2567
2616
|
});
|
|
2568
|
-
return F =
|
|
2617
|
+
return F = Z.handleBeforeDataReferenceChange, I = Z.handleDataReferenceChange, _({
|
|
2569
2618
|
...C(e),
|
|
2570
2619
|
...R,
|
|
2571
|
-
...
|
|
2572
|
-
...ye,
|
|
2620
|
+
...q,
|
|
2573
2621
|
...be,
|
|
2574
|
-
...
|
|
2575
|
-
|
|
2576
|
-
|
|
2622
|
+
...xe,
|
|
2623
|
+
...X,
|
|
2624
|
+
margin: _t,
|
|
2625
|
+
getPageSize: tn,
|
|
2577
2626
|
currentPage: S,
|
|
2578
2627
|
selection: M,
|
|
2579
2628
|
pointerInsideChart: P,
|
|
@@ -2583,164 +2632,204 @@ function nr(e, t) {
|
|
|
2583
2632
|
contextMenu: k.contextMenu,
|
|
2584
2633
|
editorSeriesOptions: A,
|
|
2585
2634
|
clipPathId: T,
|
|
2586
|
-
goToPage:
|
|
2587
|
-
setContainer: (e) =>
|
|
2588
|
-
setSvgElement: (e) =>
|
|
2589
|
-
setTitleMeasureElement: (e) =>
|
|
2590
|
-
setSharedOverlayElement: (e) =>
|
|
2635
|
+
goToPage: Z.goToPage,
|
|
2636
|
+
setContainer: (e) => ar(n, e),
|
|
2637
|
+
setSvgElement: (e) => ar(r, e),
|
|
2638
|
+
setTitleMeasureElement: (e) => ar(i, e),
|
|
2639
|
+
setSharedOverlayElement: (e) => ar(a, e)
|
|
2591
2640
|
});
|
|
2592
2641
|
}
|
|
2593
2642
|
//#endregion
|
|
2594
2643
|
//#region src/components/annotation/WaveformAnnotationEditor.vue?vue&type=script&setup=true&lang.ts
|
|
2595
|
-
var
|
|
2644
|
+
var sr = ["id"], cr = { class: "waveform-annotation-editor__content" }, lr = {
|
|
2596
2645
|
class: "waveform-annotation-editor__coordinates",
|
|
2597
2646
|
"aria-label": "标注坐标"
|
|
2598
|
-
},
|
|
2647
|
+
}, ur = ["aria-invalid"], dr = {
|
|
2648
|
+
class: "waveform-annotation-editor__coordinate-value",
|
|
2649
|
+
"aria-hidden": "true"
|
|
2650
|
+
}, fr = ["id"], pr = {
|
|
2599
2651
|
key: 0,
|
|
2600
2652
|
class: "waveform-annotation-editor__series",
|
|
2601
2653
|
"aria-label": "标注所属波形"
|
|
2602
|
-
},
|
|
2654
|
+
}, mr = { class: "waveform-annotation-editor__series-label" }, hr = ["value"], gr = ["value"], _r = { key: 1 }, vr = { class: "waveform-annotation-editor__field" }, yr = { class: "waveform-annotation-editor__label-row" }, br = ["maxlength"], xr = { class: "waveform-annotation-editor__colors" }, Sr = {
|
|
2603
2655
|
class: "waveform-annotation-editor__color-field",
|
|
2604
2656
|
title: "调整标注边框色和透明度"
|
|
2605
|
-
},
|
|
2657
|
+
}, Cr = {
|
|
2606
2658
|
class: "waveform-annotation-editor__color-field",
|
|
2607
2659
|
title: "调整标注文字色和透明度"
|
|
2608
|
-
},
|
|
2660
|
+
}, wr = {
|
|
2609
2661
|
class: "waveform-annotation-editor__color-field",
|
|
2610
2662
|
title: "调整标注背景色和透明度"
|
|
2611
|
-
},
|
|
2663
|
+
}, Tr = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
2612
2664
|
__name: "WaveformAnnotationEditor",
|
|
2613
2665
|
props: {
|
|
2614
2666
|
annotation: {},
|
|
2615
2667
|
mode: {},
|
|
2616
2668
|
series: {},
|
|
2617
2669
|
seriesOptions: {},
|
|
2618
|
-
timeUnit: { default: "ms" }
|
|
2670
|
+
timeUnit: { default: "ms" },
|
|
2671
|
+
timeError: { default: "" }
|
|
2619
2672
|
},
|
|
2620
2673
|
emits: [
|
|
2621
2674
|
"confirm",
|
|
2622
2675
|
"cancel",
|
|
2623
|
-
"series-change"
|
|
2676
|
+
"series-change",
|
|
2677
|
+
"time-change"
|
|
2624
2678
|
],
|
|
2625
|
-
setup(
|
|
2626
|
-
let
|
|
2627
|
-
let e =
|
|
2679
|
+
setup(o, { emit: c }) {
|
|
2680
|
+
let l = o, u = c, f = v(), m = se("waveform-annotation-editor-title"), h = v(""), _ = v(""), b = v(!1), x = v(""), C = v(""), D = v(""), A = t(() => b.value && (!_.value.trim() || !Number.isFinite(Number(_.value))) ? "请输入有效的时间" : ""), j = t(() => b.value && (A.value || l.timeError) || ""), M = t(() => h.value.trim().length > 0 && _.value.trim().length > 0 && Number.isFinite(Number(_.value)) && !j.value), N = t(() => h.value.length), P = t(() => {
|
|
2681
|
+
let e = l.seriesOptions?.find((e) => e.seriesId === l.annotation.seriesId);
|
|
2628
2682
|
return e ? {
|
|
2629
2683
|
id: e.seriesId,
|
|
2630
2684
|
name: e.name,
|
|
2631
2685
|
color: e.color,
|
|
2632
2686
|
unit: e.unit
|
|
2633
|
-
} :
|
|
2687
|
+
} : l.series;
|
|
2634
2688
|
});
|
|
2635
|
-
function
|
|
2636
|
-
let e =
|
|
2637
|
-
|
|
2689
|
+
function F() {
|
|
2690
|
+
let e = we(l.annotation.style);
|
|
2691
|
+
h.value = l.annotation.text, _.value = mt(l.annotation.x, l.timeUnit), b.value = !1, x.value = e.borderColor, C.value = e.textColor, D.value = e.backgroundColor, d(() => f.value?.focus());
|
|
2692
|
+
}
|
|
2693
|
+
E(() => l.annotation.id, F, { immediate: !0 });
|
|
2694
|
+
function I(e) {
|
|
2695
|
+
_.value = e == null ? "" : String(e), b.value = !1;
|
|
2638
2696
|
}
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2697
|
+
function L() {
|
|
2698
|
+
b.value = !0, u("time-change", _.value);
|
|
2699
|
+
}
|
|
2700
|
+
async function R() {
|
|
2701
|
+
L(), await d(), M.value && u("confirm", {
|
|
2702
|
+
...l.annotation,
|
|
2703
|
+
text: h.value.trim(),
|
|
2644
2704
|
style: {
|
|
2645
|
-
borderColor:
|
|
2646
|
-
textColor:
|
|
2647
|
-
backgroundColor:
|
|
2705
|
+
borderColor: x.value,
|
|
2706
|
+
textColor: C.value,
|
|
2707
|
+
backgroundColor: D.value.trim() || "rgba(255, 255, 255, 0.92)"
|
|
2648
2708
|
}
|
|
2649
2709
|
});
|
|
2650
2710
|
}
|
|
2651
|
-
function
|
|
2652
|
-
e.key === "Escape" &&
|
|
2711
|
+
function z(e) {
|
|
2712
|
+
e.key === "Escape" && u("cancel"), e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), R());
|
|
2653
2713
|
}
|
|
2654
|
-
function
|
|
2714
|
+
function B(e) {
|
|
2655
2715
|
let t = e.target;
|
|
2656
|
-
t.value &&
|
|
2716
|
+
t.value && u("series-change", t.value);
|
|
2657
2717
|
}
|
|
2658
|
-
return (t,
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
"
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
"
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
"
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
"
|
|
2729
|
-
"
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2718
|
+
return (t, o) => (g(), n(w(ie), {
|
|
2719
|
+
visible: !0,
|
|
2720
|
+
width: 440,
|
|
2721
|
+
"mask-closable": !0,
|
|
2722
|
+
keyboard: !0,
|
|
2723
|
+
"cancel-text": "取消",
|
|
2724
|
+
"ok-text": "保存标注",
|
|
2725
|
+
"ok-button-props": { disabled: !M.value },
|
|
2726
|
+
"wrap-class-name": "waveform-annotation-editor",
|
|
2727
|
+
onCancel: o[4] ||= (e) => u("cancel"),
|
|
2728
|
+
onOk: R
|
|
2729
|
+
}, {
|
|
2730
|
+
title: O(() => [a("span", { id: w(m) }, S(l.mode === "add" ? "添加标注" : "编辑标注"), 9, sr)]),
|
|
2731
|
+
default: O(() => [a("div", cr, [
|
|
2732
|
+
a("div", lr, [
|
|
2733
|
+
a("label", {
|
|
2734
|
+
class: "waveform-annotation-editor__coordinate-input",
|
|
2735
|
+
"aria-invalid": !!j.value
|
|
2736
|
+
}, [
|
|
2737
|
+
o[5] ||= a("b", null, "X", -1),
|
|
2738
|
+
s(w(q), {
|
|
2739
|
+
value: _.value === "" ? void 0 : Number(_.value),
|
|
2740
|
+
controls: !0,
|
|
2741
|
+
step: .001,
|
|
2742
|
+
keyboard: !0,
|
|
2743
|
+
status: j.value ? "error" : void 0,
|
|
2744
|
+
"aria-label": "标注横轴时间",
|
|
2745
|
+
"aria-invalid": !!j.value,
|
|
2746
|
+
"aria-describedby": j.value ? `${w(m)}-time-error` : void 0,
|
|
2747
|
+
onBlur: L,
|
|
2748
|
+
"onUpdate:value": I
|
|
2749
|
+
}, null, 8, [
|
|
2750
|
+
"value",
|
|
2751
|
+
"status",
|
|
2752
|
+
"aria-invalid",
|
|
2753
|
+
"aria-describedby"
|
|
2754
|
+
]),
|
|
2755
|
+
a("code", dr, S(_.value), 1)
|
|
2756
|
+
], 8, ur),
|
|
2757
|
+
j.value ? (g(), i("p", {
|
|
2758
|
+
key: 0,
|
|
2759
|
+
id: `${w(m)}-time-error`,
|
|
2760
|
+
class: "waveform-annotation-editor__coordinate-error",
|
|
2761
|
+
role: "alert"
|
|
2762
|
+
}, S(j.value), 9, fr)) : r("", !0),
|
|
2763
|
+
a("span", null, [o[6] ||= a("b", null, "Y", -1), a("code", null, S(w(ct)(l.annotation.y)), 1)])
|
|
2764
|
+
]),
|
|
2765
|
+
o[13] ||= a("p", {
|
|
2766
|
+
class: "waveform-annotation-editor__coordinate-hint",
|
|
2767
|
+
role: "note"
|
|
2768
|
+
}, " 修改 X 轴后失焦时会自动吸附最近的采样点 ", -1),
|
|
2769
|
+
P.value ? (g(), i("label", pr, [
|
|
2770
|
+
a("i", {
|
|
2771
|
+
style: p({ backgroundColor: P.value.color }),
|
|
2772
|
+
"aria-hidden": "true"
|
|
2773
|
+
}, null, 4),
|
|
2774
|
+
a("span", mr, [o[7] ||= a("small", null, "标注波形", -1), a("b", null, S(P.value.name), 1)]),
|
|
2775
|
+
l.seriesOptions?.length ? (g(), i("select", {
|
|
2776
|
+
key: 0,
|
|
2777
|
+
value: l.annotation.seriesId,
|
|
2778
|
+
"aria-label": "选择标注波形",
|
|
2779
|
+
onChange: B
|
|
2780
|
+
}, [(g(!0), i(e, null, y(l.seriesOptions, (e) => (g(), i("option", {
|
|
2781
|
+
key: e.seriesId,
|
|
2782
|
+
value: e.seriesId
|
|
2783
|
+
}, S(e.name) + S(e.unit ? ` (${e.unit})` : ""), 9, gr))), 128))], 40, hr)) : P.value.unit ? (g(), i("code", _r, S(P.value.unit), 1)) : r("", !0)
|
|
2784
|
+
])) : r("", !0),
|
|
2785
|
+
a("label", vr, [a("span", yr, [o[8] ||= a("b", null, "标注文本", -1), a("small", null, S(N.value) + "/" + S(w(40)), 1)]), k(a("textarea", {
|
|
2786
|
+
ref_key: "textarea",
|
|
2787
|
+
ref: f,
|
|
2788
|
+
"onUpdate:modelValue": o[0] ||= (e) => h.value = e,
|
|
2789
|
+
rows: "4",
|
|
2790
|
+
maxlength: w(40),
|
|
2791
|
+
"aria-label": "标注文本",
|
|
2792
|
+
placeholder: "输入这处波形的说明",
|
|
2793
|
+
onKeydown: z
|
|
2794
|
+
}, null, 40, br), [[T, h.value]])]),
|
|
2795
|
+
a("fieldset", xr, [
|
|
2796
|
+
o[12] ||= a("legend", null, "颜色与透明度", -1),
|
|
2797
|
+
a("label", Sr, [o[9] ||= a("span", null, "边框色", -1), s(w(J), {
|
|
2798
|
+
"pure-color": x.value,
|
|
2799
|
+
"onUpdate:pureColor": o[1] ||= (e) => x.value = e,
|
|
2800
|
+
"aria-label": "标注边框色",
|
|
2801
|
+
"use-type": "pure",
|
|
2802
|
+
"picker-type": "chrome",
|
|
2803
|
+
format: "rgb",
|
|
2804
|
+
"disable-alpha": !1,
|
|
2805
|
+
"blur-close": !0
|
|
2806
|
+
}, null, 8, ["pure-color"])]),
|
|
2807
|
+
a("label", Cr, [o[10] ||= a("span", null, "文字色", -1), s(w(J), {
|
|
2808
|
+
"pure-color": C.value,
|
|
2809
|
+
"onUpdate:pureColor": o[2] ||= (e) => C.value = e,
|
|
2810
|
+
"aria-label": "标注文字色",
|
|
2811
|
+
"use-type": "pure",
|
|
2812
|
+
"picker-type": "chrome",
|
|
2813
|
+
format: "rgb",
|
|
2814
|
+
"disable-alpha": !1,
|
|
2815
|
+
"blur-close": !0
|
|
2816
|
+
}, null, 8, ["pure-color"])]),
|
|
2817
|
+
a("label", wr, [o[11] ||= a("span", null, "背景色", -1), s(w(J), {
|
|
2818
|
+
"pure-color": D.value,
|
|
2819
|
+
"onUpdate:pureColor": o[3] ||= (e) => D.value = e,
|
|
2820
|
+
"aria-label": "标注背景色",
|
|
2821
|
+
"use-type": "pure",
|
|
2822
|
+
"picker-type": "chrome",
|
|
2823
|
+
format: "rgb",
|
|
2824
|
+
"disable-alpha": !1,
|
|
2825
|
+
"blur-close": !0
|
|
2826
|
+
}, null, 8, ["pure-color"])])
|
|
2827
|
+
])
|
|
2828
|
+
])]),
|
|
2829
|
+
_: 1
|
|
2830
|
+
}, 8, ["ok-button-props"]));
|
|
2831
|
+
}
|
|
2832
|
+
}), [["__scopeId", "data-v-8ce79dc8"]]), Er = { class: "waveform-tooltip__series-content" }, Dr = { class: "waveform-tooltip__series-label" }, Or = { class: "waveform-tooltip__value" }, kr = 12, Ar = 8, jr = 238, Mr = 560, Nr = 20, Pr = 20, Fr = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
2744
2833
|
__name: "WaveformTooltip",
|
|
2745
2834
|
props: {
|
|
2746
2835
|
visible: { type: Boolean },
|
|
@@ -2754,26 +2843,26 @@ var rr = ["aria-labelledby"], ir = { class: "waveform-annotation-editor__panel"
|
|
|
2754
2843
|
setup(n) {
|
|
2755
2844
|
let s = n;
|
|
2756
2845
|
function c(e, t) {
|
|
2757
|
-
let n = Math.max(1, t -
|
|
2846
|
+
let n = Math.max(1, t - Nr - 14), r = Math.max(1, Math.floor(n / 7.2));
|
|
2758
2847
|
return Math.max(1, Math.ceil([...e].length / r));
|
|
2759
2848
|
}
|
|
2760
2849
|
function l(e) {
|
|
2761
|
-
let t =
|
|
2762
|
-
return `${e.shotNo?.trim() || "未配置炮号"}: ${e.name}${e.unit ? `(${e.unit})` : ""} (x:${t} y:${
|
|
2850
|
+
let t = pt(s.hoveredPoint?.x ?? e.point.x, s.timeUnit);
|
|
2851
|
+
return `${e.shotNo?.trim() || "未配置炮号"}: ${e.name}${e.unit ? `(${e.unit})` : ""} (x:${t} y:${st(e.point.y)})`;
|
|
2763
2852
|
}
|
|
2764
2853
|
function u(e) {
|
|
2765
|
-
return 16 +
|
|
2854
|
+
return 16 + Pr * s.seriesPoints.reduce((t, n) => t + c(l(n), e), 0) + 5;
|
|
2766
2855
|
}
|
|
2767
2856
|
let d = t(() => {
|
|
2768
2857
|
if (!s.visible || !s.hoveredPoint) return { display: "none" };
|
|
2769
|
-
let e = s.position.x +
|
|
2858
|
+
let e = s.position.x + kr, t = s.position.x - kr - jr, n = s.containerWidth - Ar - e, r = s.position.x - kr - Ar, i = Math.max(1, Math.min(Mr, s.containerWidth - Ar * 2)), a = e + jr <= s.containerWidth - Ar ? {
|
|
2770
2859
|
left: `${e}px`,
|
|
2771
|
-
maxWidth: `${Math.min(
|
|
2772
|
-
} : t >=
|
|
2773
|
-
right: `${s.containerWidth - s.position.x +
|
|
2774
|
-
maxWidth: `${Math.min(
|
|
2860
|
+
maxWidth: `${Math.min(Mr, n)}px`
|
|
2861
|
+
} : t >= Ar ? {
|
|
2862
|
+
right: `${s.containerWidth - s.position.x + kr}px`,
|
|
2863
|
+
maxWidth: `${Math.min(Mr, r)}px`
|
|
2775
2864
|
} : {
|
|
2776
|
-
left: `${
|
|
2865
|
+
left: `${Ar}px`,
|
|
2777
2866
|
maxWidth: `${i}px`
|
|
2778
2867
|
}, o = Number.parseFloat(a.maxWidth);
|
|
2779
2868
|
return {
|
|
@@ -2788,9 +2877,9 @@ var rr = ["aria-labelledby"], ir = { class: "waveform-annotation-editor__panel"
|
|
|
2788
2877
|
}, [(g(!0), i(e, null, y(n.seriesPoints, (t) => (g(), i("span", {
|
|
2789
2878
|
key: `${t.trackIndex}-${t.name}`,
|
|
2790
2879
|
class: "waveform-tooltip__series waveform-chart__tooltip-series"
|
|
2791
|
-
}, [a("i", { style: p({ backgroundColor: t.color }) }, null, 4), a("span",
|
|
2880
|
+
}, [a("i", { style: p({ backgroundColor: t.color }) }, null, 4), a("span", Er, [a("span", Dr, [o(S(t.shotNo?.trim() || "未配置炮号") + ": " + S(t.name), 1), t.unit ? (g(), i(e, { key: 0 }, [o("(" + S(t.unit) + ")", 1)], 64)) : r("", !0)]), a("span", Or, "(x:" + S(w(pt)(n.hoveredPoint.x, n.timeUnit)) + " y:" + S(w(st)(t.point.y)) + ")", 1)])]))), 128))], 4)) : r("", !0);
|
|
2792
2881
|
}
|
|
2793
|
-
}), [["__scopeId", "data-v-1f55d6c8"]]),
|
|
2882
|
+
}), [["__scopeId", "data-v-1f55d6c8"]]), Ir = /* @__PURE__ */ c({
|
|
2794
2883
|
__name: "WaveformHoverHost",
|
|
2795
2884
|
props: {
|
|
2796
2885
|
state: {},
|
|
@@ -2801,7 +2890,7 @@ var rr = ["aria-labelledby"], ir = { class: "waveform-annotation-editor__panel"
|
|
|
2801
2890
|
},
|
|
2802
2891
|
setup(e) {
|
|
2803
2892
|
let r = e, i = t(() => r.state.points[0]?.point ?? null);
|
|
2804
|
-
return (t, r) => (g(), n(
|
|
2893
|
+
return (t, r) => (g(), n(Fr, {
|
|
2805
2894
|
visible: e.visible && i.value !== null,
|
|
2806
2895
|
position: e.state.position,
|
|
2807
2896
|
"time-unit": e.timeUnit,
|
|
@@ -2819,16 +2908,16 @@ var rr = ["aria-labelledby"], ir = { class: "waveform-annotation-editor__panel"
|
|
|
2819
2908
|
"container-height"
|
|
2820
2909
|
]));
|
|
2821
2910
|
}
|
|
2822
|
-
}),
|
|
2823
|
-
circle:
|
|
2824
|
-
square:
|
|
2825
|
-
triangle:
|
|
2826
|
-
diamond:
|
|
2911
|
+
}), Lr = 13, Rr = 2, zr = 14, Br = 8, Vr = 24, Hr = {
|
|
2912
|
+
circle: ee,
|
|
2913
|
+
square: ne,
|
|
2914
|
+
triangle: W,
|
|
2915
|
+
diamond: te
|
|
2827
2916
|
};
|
|
2828
|
-
function
|
|
2829
|
-
return e === "none" ? null :
|
|
2917
|
+
function Ur(e, t = 48) {
|
|
2918
|
+
return e === "none" ? null : U().type(Hr[e]).size(t)() ?? null;
|
|
2830
2919
|
}
|
|
2831
|
-
function
|
|
2920
|
+
function Wr(e, t, n = 48) {
|
|
2832
2921
|
if (e === "none" || t.length === 0) return null;
|
|
2833
2922
|
if (e === "circle") {
|
|
2834
2923
|
let e = Math.sqrt(n / Math.PI);
|
|
@@ -2845,24 +2934,24 @@ function Vr(e, t, n = 48) {
|
|
|
2845
2934
|
let r = Math.sqrt(n / (2 * Math.tan(Math.PI / 6))), i = r * Math.tan(Math.PI / 6);
|
|
2846
2935
|
return t.map(({ x: e, y: t }) => `M${e},${t - r}L${e + i},${t}L${e},${t + r}L${e - i},${t}Z`).join("");
|
|
2847
2936
|
}
|
|
2848
|
-
function
|
|
2937
|
+
function Gr(e) {
|
|
2849
2938
|
return e === "none" ? null : "M1 8H25";
|
|
2850
2939
|
}
|
|
2851
|
-
function
|
|
2940
|
+
function Kr(e) {
|
|
2852
2941
|
if (e === "dashed") return "8 5";
|
|
2853
2942
|
if (e === "dash-dot") return "8 5 1.5 5";
|
|
2854
2943
|
}
|
|
2855
|
-
function
|
|
2856
|
-
let t = (Number.isFinite(e) && e > 0 ? Math.min(e,
|
|
2944
|
+
function qr(e) {
|
|
2945
|
+
let t = (Number.isFinite(e) && e > 0 ? Math.min(e, Vr) : Br) / 2, n = Lr - t, r = Lr + t;
|
|
2857
2946
|
return [
|
|
2858
|
-
`M${n} ${
|
|
2859
|
-
`M${
|
|
2860
|
-
`M${n} ${
|
|
2947
|
+
`M${n} ${Rr}H${r}`,
|
|
2948
|
+
`M${Lr} ${Rr}V${zr}`,
|
|
2949
|
+
`M${n} ${zr}H${r}`
|
|
2861
2950
|
].join("");
|
|
2862
2951
|
}
|
|
2863
2952
|
//#endregion
|
|
2864
2953
|
//#region src/components/rendering/WaveformSeriesLayer.vue?vue&type=script&setup=true&lang.ts
|
|
2865
|
-
var
|
|
2954
|
+
var Jr = ["clip-path"], Yr = ["data-series-id", "data-series-name"], Xr = [
|
|
2866
2955
|
"data-series-id",
|
|
2867
2956
|
"data-series-name",
|
|
2868
2957
|
"data-y-axis-index",
|
|
@@ -2871,11 +2960,11 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
2871
2960
|
"d",
|
|
2872
2961
|
"stroke",
|
|
2873
2962
|
"stroke-dasharray"
|
|
2874
|
-
],
|
|
2963
|
+
], Zr = ["data-series-id"], Qr = [
|
|
2875
2964
|
"d",
|
|
2876
2965
|
"stroke",
|
|
2877
2966
|
"stroke-width"
|
|
2878
|
-
],
|
|
2967
|
+
], $r = ["data-series-id", "data-point-type"], ei = ["d", "fill"], ti = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
2879
2968
|
__name: "WaveformSeriesLayer",
|
|
2880
2969
|
props: {
|
|
2881
2970
|
track: {},
|
|
@@ -2883,11 +2972,11 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
2883
2972
|
},
|
|
2884
2973
|
setup(n) {
|
|
2885
2974
|
let a = n, o = t(() => a.track.seriesPaths.map((e) => {
|
|
2886
|
-
let t =
|
|
2975
|
+
let t = Wr(e.series.pointType, e.pointRenderPoints.map((t) => ({
|
|
2887
2976
|
x: a.track.xScale(t.x),
|
|
2888
2977
|
y: e.yScale(t.y)
|
|
2889
2978
|
}))), n = e.series.errorBar.capWidth / 2, r = e.errorBarRenderPoints.map((t) => {
|
|
2890
|
-
let { lower: r, upper: i } =
|
|
2979
|
+
let { lower: r, upper: i } = Pt(t), o = a.track.xScale(t.x), s = e.yScale(t.y - r), c = e.yScale(t.y + i);
|
|
2891
2980
|
return [
|
|
2892
2981
|
`M${o - n},${s}H${o + n}`,
|
|
2893
2982
|
`M${o},${s}V${c}`,
|
|
@@ -2920,8 +3009,8 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
2920
3009
|
"data-line-style": e.series.lineStyle,
|
|
2921
3010
|
d: e.path,
|
|
2922
3011
|
stroke: e.series.color,
|
|
2923
|
-
"stroke-dasharray": w(
|
|
2924
|
-
}, null, 8,
|
|
3012
|
+
"stroke-dasharray": w(Kr)(e.series.lineStyle)
|
|
3013
|
+
}, null, 8, Xr)) : r("", !0),
|
|
2925
3014
|
e.series.errorBar.visible ? (g(), i("g", {
|
|
2926
3015
|
key: 1,
|
|
2927
3016
|
class: "waveform-track__error-bars waveform-chart__error-bars",
|
|
@@ -2932,7 +3021,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
2932
3021
|
d: e.errorBarPath,
|
|
2933
3022
|
stroke: e.series.errorBar.color || e.series.color,
|
|
2934
3023
|
"stroke-width": e.series.errorBar.width
|
|
2935
|
-
}, null, 8,
|
|
3024
|
+
}, null, 8, Qr)) : r("", !0)], 8, Zr)) : r("", !0),
|
|
2936
3025
|
e.series.pointType === "none" ? r("", !0) : (g(), i("g", {
|
|
2937
3026
|
key: 2,
|
|
2938
3027
|
class: "waveform-track__points waveform-chart__points",
|
|
@@ -2943,20 +3032,20 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
2943
3032
|
class: "waveform-track__point waveform-chart__point",
|
|
2944
3033
|
d: e.pointPath,
|
|
2945
3034
|
fill: e.series.color
|
|
2946
|
-
}, null, 8,
|
|
2947
|
-
], 8,
|
|
3035
|
+
}, null, 8, ei)) : r("", !0)], 8, $r))
|
|
3036
|
+
], 8, Yr))), 128))], 8, Jr)) : r("", !0);
|
|
2948
3037
|
}
|
|
2949
|
-
}), [["__scopeId", "data-v-42a3fd47"]]),
|
|
3038
|
+
}), [["__scopeId", "data-v-42a3fd47"]]), ni = ["transform"], ri = ["transform"], ii = {
|
|
2950
3039
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--start waveform-chart__axis-endpoint waveform-chart__axis-endpoint--start",
|
|
2951
3040
|
x: "0",
|
|
2952
3041
|
y: "7",
|
|
2953
3042
|
dy: "0.71em",
|
|
2954
3043
|
"text-anchor": "start"
|
|
2955
|
-
},
|
|
3044
|
+
}, ai = ["x"], oi = [
|
|
2956
3045
|
"data-y-axis-index",
|
|
2957
3046
|
"data-y-axis-side",
|
|
2958
3047
|
"transform"
|
|
2959
|
-
],
|
|
3048
|
+
], si = { key: 2 }, ci = ["x", "y"], li = ["fill", "transform"], ui = ["data-y-axis-title-index"], di = ["x", "y"], fi = ["fill", "transform"], pi = /* @__PURE__ */ c({
|
|
2960
3049
|
__name: "WaveformTrackAxes",
|
|
2961
3050
|
props: {
|
|
2962
3051
|
track: {},
|
|
@@ -2985,15 +3074,15 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
2985
3074
|
if (n.track.yAxes.forEach((e, t) => {
|
|
2986
3075
|
let r = s.value[t];
|
|
2987
3076
|
if (!r) return;
|
|
2988
|
-
let [i, a] = e.scale.domain(), o = Math.max(...e.tickValues), c = (e.side === "left" ?
|
|
3077
|
+
let [i, a] = e.scale.domain(), o = Math.max(...e.tickValues), c = (e.side === "left" ? M(e.scale) : N(e.scale)).tickFormat((e) => ot(Number(e), {
|
|
2989
3078
|
axisMin: i,
|
|
2990
3079
|
axisMax: a,
|
|
2991
3080
|
topTickValue: o
|
|
2992
|
-
})).tickSize(-4).tickPadding(7).tickSizeOuter(0).tickValues(e.tickValues), l =
|
|
3081
|
+
})).tickSize(-4).tickPadding(7).tickSizeOuter(0).tickValues(e.tickValues), l = H(r);
|
|
2993
3082
|
l.call(c), l.selectAll("path.domain").attr("display", n.axes?.y?.lineVisible === !1 ? "none" : null);
|
|
2994
3083
|
}), !o.value) return;
|
|
2995
|
-
let e =
|
|
2996
|
-
e.call(
|
|
3084
|
+
let e = H(o.value);
|
|
3085
|
+
e.call(j(n.track.xScale).tickValues(n.track.xAxisTickValues).tickFormat((e) => ut(Number(e), n.track.xScale.domain(), n.timeUnit, "tick", n.axes?.x?.labelFormatter)).tickSize(-4).tickPadding(7).tickSizeOuter(0)), e.selectAll("path.domain").attr("display", n.axes?.x?.lineVisible === !1 ? "none" : null);
|
|
2997
3086
|
}
|
|
2998
3087
|
return h(async () => {
|
|
2999
3088
|
await d(), m();
|
|
@@ -3015,7 +3104,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3015
3104
|
ref: o,
|
|
3016
3105
|
class: f(["waveform-track__axis waveform-track__axis--x waveform-chart__axis waveform-chart__axis--x", { "waveform-track__axis--line-hidden": t.axes?.x?.lineVisible === !1 }]),
|
|
3017
3106
|
transform: `translate(0, ${t.track.height})`
|
|
3018
|
-
}, null, 10,
|
|
3107
|
+
}, null, 10, ni)) : r("", !0),
|
|
3019
3108
|
t.track.showXAxis ? (g(), i("g", {
|
|
3020
3109
|
key: 1,
|
|
3021
3110
|
class: "waveform-track__axis-endpoints waveform-chart__axis-endpoints",
|
|
@@ -3023,13 +3112,13 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3023
3112
|
"font-family": "sans-serif",
|
|
3024
3113
|
"font-size": "10",
|
|
3025
3114
|
"aria-hidden": "true"
|
|
3026
|
-
}, [a("text",
|
|
3115
|
+
}, [a("text", ii, S(t.track.endpointLabels.start), 1), a("text", {
|
|
3027
3116
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--end waveform-chart__axis-endpoint waveform-chart__axis-endpoint--end",
|
|
3028
3117
|
x: t.track.width ?? t.innerWidth,
|
|
3029
3118
|
y: "7",
|
|
3030
3119
|
dy: "0.71em",
|
|
3031
3120
|
"text-anchor": "end"
|
|
3032
|
-
}, S(t.track.endpointLabels.end), 9,
|
|
3121
|
+
}, S(t.track.endpointLabels.end), 9, ai)], 8, ri)) : r("", !0),
|
|
3033
3122
|
(g(!0), i(e, null, y(t.track.isEmpty ? [] : t.track.yAxes, (e) => (g(), i("g", {
|
|
3034
3123
|
key: `y-axis-${t.track.index}-${e.index}`,
|
|
3035
3124
|
ref_for: !0,
|
|
@@ -3038,21 +3127,21 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3038
3127
|
"data-y-axis-index": e.index,
|
|
3039
3128
|
"data-y-axis-side": e.side,
|
|
3040
3129
|
transform: `translate(${e.x}, 0)`
|
|
3041
|
-
}, null, 10,
|
|
3042
|
-
!t.cleanView && !t.track.isEmpty && t.track.hasVisibleSeries && t.track.seriesList.length === 1 && t.track.showYAxisLabel && c(t.track.series) && p(t.track.height, t.track.index) ? (g(), i("g",
|
|
3130
|
+
}, null, 10, oi))), 128)),
|
|
3131
|
+
!t.cleanView && !t.track.isEmpty && t.track.hasVisibleSeries && t.track.seriesList.length === 1 && t.track.showYAxisLabel && c(t.track.series) && p(t.track.height, t.track.index) ? (g(), i("g", si, [a("rect", {
|
|
3043
3132
|
class: "waveform-track__y-axis-label-bg waveform-chart__y-axis-label-bg",
|
|
3044
3133
|
x: t.track.yAxisLabelX - 12,
|
|
3045
3134
|
y: t.track.height / 2 - 40,
|
|
3046
3135
|
width: "24",
|
|
3047
3136
|
height: "80",
|
|
3048
3137
|
rx: "2"
|
|
3049
|
-
}, null, 8,
|
|
3138
|
+
}, null, 8, ci), a("text", {
|
|
3050
3139
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
3051
3140
|
fill: t.track.series.color,
|
|
3052
3141
|
transform: `translate(${t.track.yAxisLabelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
3053
3142
|
"text-anchor": "middle",
|
|
3054
3143
|
"dominant-baseline": "central"
|
|
3055
|
-
}, S(c(t.track.series)), 9,
|
|
3144
|
+
}, S(c(t.track.series)), 9, li)])) : r("", !0),
|
|
3056
3145
|
(g(!0), i(e, null, y(!t.cleanView && t.track.yAxes.length > 1 ? t.track.yAxes.filter(l) : [], (e) => (g(), i("g", {
|
|
3057
3146
|
key: `y-axis-title-${t.track.index}-${e.index}`,
|
|
3058
3147
|
class: "waveform-track__multi-axis-title",
|
|
@@ -3064,40 +3153,40 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3064
3153
|
width: "24",
|
|
3065
3154
|
height: "80",
|
|
3066
3155
|
rx: "2"
|
|
3067
|
-
}, null, 8,
|
|
3156
|
+
}, null, 8, di), a("text", {
|
|
3068
3157
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
3069
3158
|
fill: e.seriesList[0].color,
|
|
3070
3159
|
transform: `translate(${e.labelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
3071
3160
|
"text-anchor": "middle",
|
|
3072
3161
|
"dominant-baseline": "central"
|
|
3073
|
-
}, S(c(e.seriesList[0])), 9,
|
|
3162
|
+
}, S(c(e.seriesList[0])), 9, fi)], 8, ui))), 128))
|
|
3074
3163
|
], 64));
|
|
3075
3164
|
}
|
|
3076
|
-
}),
|
|
3165
|
+
}), mi = [
|
|
3077
3166
|
"width",
|
|
3078
3167
|
"height",
|
|
3079
3168
|
"fill"
|
|
3080
|
-
],
|
|
3169
|
+
], hi = ["clip-path"], gi = { class: "waveform-track__grid waveform-track__grid--minor waveform-chart__grid waveform-chart__grid--minor" }, _i = [
|
|
3081
3170
|
"stroke",
|
|
3082
3171
|
"x1",
|
|
3083
3172
|
"x2",
|
|
3084
3173
|
"y2"
|
|
3085
|
-
],
|
|
3174
|
+
], vi = [
|
|
3086
3175
|
"stroke",
|
|
3087
3176
|
"x2",
|
|
3088
3177
|
"y1",
|
|
3089
3178
|
"y2"
|
|
3090
|
-
],
|
|
3179
|
+
], yi = { class: "waveform-track__grid waveform-track__grid--major waveform-chart__grid waveform-chart__grid--major" }, bi = [
|
|
3091
3180
|
"stroke",
|
|
3092
3181
|
"x1",
|
|
3093
3182
|
"x2",
|
|
3094
3183
|
"y2"
|
|
3095
|
-
],
|
|
3184
|
+
], xi = [
|
|
3096
3185
|
"stroke",
|
|
3097
3186
|
"x2",
|
|
3098
3187
|
"y1",
|
|
3099
3188
|
"y2"
|
|
3100
|
-
],
|
|
3189
|
+
], Si = ["clip-path"], Ci = [
|
|
3101
3190
|
"data-y-axis-index",
|
|
3102
3191
|
"x2",
|
|
3103
3192
|
"y1",
|
|
@@ -3105,7 +3194,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3105
3194
|
"stroke",
|
|
3106
3195
|
"stroke-width",
|
|
3107
3196
|
"stroke-dasharray"
|
|
3108
|
-
],
|
|
3197
|
+
], wi = ["x", "y"], Ti = /* @__PURE__ */ c({
|
|
3109
3198
|
__name: "WaveformTrackBackdrop",
|
|
3110
3199
|
props: {
|
|
3111
3200
|
track: {},
|
|
@@ -3130,12 +3219,12 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3130
3219
|
height: t.track.height,
|
|
3131
3220
|
fill: t.frameStyle.backgroundColor,
|
|
3132
3221
|
"aria-hidden": "true"
|
|
3133
|
-
}, null, 8,
|
|
3222
|
+
}, null, 8, mi)) : r("", !0),
|
|
3134
3223
|
!t.track.isEmpty && t.track.hasVisibleSeries && !t.cleanView ? (g(), i("g", {
|
|
3135
3224
|
key: 1,
|
|
3136
3225
|
"clip-path": `url(#${t.clipPathId}-${t.track.index})`,
|
|
3137
3226
|
"aria-hidden": "true"
|
|
3138
|
-
}, [a("g",
|
|
3227
|
+
}, [a("g", gi, [t.track.gridLines.vertical ? (g(!0), i(e, { key: 0 }, y(t.track.xMinorTicks, (e) => (g(), i("line", {
|
|
3139
3228
|
key: `x-minor-${t.track.index}-${e}`,
|
|
3140
3229
|
"data-grid-direction": "vertical",
|
|
3141
3230
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -3143,7 +3232,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3143
3232
|
x2: t.track.xScale(e),
|
|
3144
3233
|
y1: "0",
|
|
3145
3234
|
y2: t.track.height
|
|
3146
|
-
}, null, 8,
|
|
3235
|
+
}, null, 8, _i))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMinorTicks, (e) => (g(), i("line", {
|
|
3147
3236
|
key: `y-minor-${t.track.index}-${e}`,
|
|
3148
3237
|
"data-grid-direction": "horizontal",
|
|
3149
3238
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -3151,7 +3240,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3151
3240
|
x2: t.track.width ?? t.innerWidth,
|
|
3152
3241
|
y1: t.track.yScale(e),
|
|
3153
3242
|
y2: t.track.yScale(e)
|
|
3154
|
-
}, null, 8,
|
|
3243
|
+
}, null, 8, vi))), 128)) : r("", !0)]), a("g", yi, [t.track.gridLines.vertical ? (g(!0), i(e, { key: 0 }, y(t.track.xMajorTicks, (e) => (g(), i("line", {
|
|
3155
3244
|
key: `x-major-${t.track.index}-${e}`,
|
|
3156
3245
|
"data-grid-direction": "vertical",
|
|
3157
3246
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -3159,7 +3248,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3159
3248
|
x2: t.track.xScale(e),
|
|
3160
3249
|
y1: "0",
|
|
3161
3250
|
y2: t.track.height
|
|
3162
|
-
}, null, 8,
|
|
3251
|
+
}, null, 8, bi))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMajorTicks, (e) => (g(), i("line", {
|
|
3163
3252
|
key: `y-major-${t.track.index}-${e}`,
|
|
3164
3253
|
"data-grid-direction": "horizontal",
|
|
3165
3254
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -3167,7 +3256,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3167
3256
|
x2: t.track.width ?? t.innerWidth,
|
|
3168
3257
|
y1: t.track.yScale(e),
|
|
3169
3258
|
y2: t.track.yScale(e)
|
|
3170
|
-
}, null, 8,
|
|
3259
|
+
}, null, 8, xi))), 128)) : r("", !0)])], 8, hi)) : r("", !0),
|
|
3171
3260
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.zeroLine.visible && !t.cleanView ? (g(), i("g", {
|
|
3172
3261
|
key: 2,
|
|
3173
3262
|
class: "waveform-track__zero-lines waveform-chart__zero-lines",
|
|
@@ -3184,7 +3273,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3184
3273
|
stroke: t.zeroLine.color,
|
|
3185
3274
|
"stroke-width": t.zeroLine.width,
|
|
3186
3275
|
"stroke-dasharray": t.zeroLine.dash || void 0
|
|
3187
|
-
}, null, 8,
|
|
3276
|
+
}, null, 8, Ci))], 64))), 128))], 8, Si)) : r("", !0),
|
|
3188
3277
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.frameNumber !== void 0 && !t.cleanView ? (g(), i("text", {
|
|
3189
3278
|
key: 3,
|
|
3190
3279
|
class: "waveform-track__watermark waveform-chart__watermark",
|
|
@@ -3194,10 +3283,10 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3194
3283
|
"text-anchor": "middle",
|
|
3195
3284
|
"dominant-baseline": "central",
|
|
3196
3285
|
"aria-hidden": "true"
|
|
3197
|
-
}, S(t.frameNumber), 13,
|
|
3286
|
+
}, S(t.frameNumber), 13, wi)) : r("", !0)
|
|
3198
3287
|
], 64));
|
|
3199
3288
|
}
|
|
3200
|
-
}),
|
|
3289
|
+
}), Ei = [
|
|
3201
3290
|
"data-track-index",
|
|
3202
3291
|
"data-track-empty",
|
|
3203
3292
|
"data-track-left",
|
|
@@ -3206,19 +3295,19 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3206
3295
|
"data-track-top",
|
|
3207
3296
|
"data-track-height",
|
|
3208
3297
|
"transform"
|
|
3209
|
-
],
|
|
3298
|
+
], Di = [
|
|
3210
3299
|
"width",
|
|
3211
3300
|
"height",
|
|
3212
3301
|
"stroke",
|
|
3213
3302
|
"stroke-width",
|
|
3214
3303
|
"stroke-dasharray",
|
|
3215
3304
|
"stroke-linecap"
|
|
3216
|
-
],
|
|
3305
|
+
], Oi = [
|
|
3217
3306
|
"data-interactive",
|
|
3218
3307
|
"data-independent-overlay-index",
|
|
3219
3308
|
"width",
|
|
3220
3309
|
"height"
|
|
3221
|
-
],
|
|
3310
|
+
], ki = ["x", "y"], Ai = /* @__PURE__ */ c({
|
|
3222
3311
|
__name: "WaveformTrack",
|
|
3223
3312
|
props: {
|
|
3224
3313
|
track: {},
|
|
@@ -3277,7 +3366,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3277
3366
|
"data-track-height": e.track.height,
|
|
3278
3367
|
transform: `translate(${e.track.left ?? 0}, ${e.track.top})`
|
|
3279
3368
|
}, [
|
|
3280
|
-
s(
|
|
3369
|
+
s(Ti, {
|
|
3281
3370
|
track: e.track,
|
|
3282
3371
|
"clip-path-id": e.clipPathId,
|
|
3283
3372
|
"inner-width": e.innerWidth,
|
|
@@ -3294,7 +3383,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3294
3383
|
"frame-style",
|
|
3295
3384
|
"zero-line"
|
|
3296
3385
|
]),
|
|
3297
|
-
s(
|
|
3386
|
+
s(pi, {
|
|
3298
3387
|
track: e.track,
|
|
3299
3388
|
"inner-width": e.innerWidth,
|
|
3300
3389
|
"clean-view": e.cleanView,
|
|
@@ -3320,8 +3409,8 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3320
3409
|
"stroke-dasharray": c.value.borderStyle === "dashed" ? "6 4" : c.value.borderStyle === "dotted" ? "1 3" : void 0,
|
|
3321
3410
|
"stroke-linecap": c.value.borderStyle === "dotted" ? "round" : void 0,
|
|
3322
3411
|
"aria-hidden": "true"
|
|
3323
|
-
}, null, 8,
|
|
3324
|
-
s(
|
|
3412
|
+
}, null, 8, Di)),
|
|
3413
|
+
s(ti, {
|
|
3325
3414
|
track: e.track,
|
|
3326
3415
|
"clip-path-id": e.clipPathId
|
|
3327
3416
|
}, null, 8, ["track", "clip-path-id"]),
|
|
@@ -3343,7 +3432,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3343
3432
|
onPointerleave: n[4] ||= (e) => o("pointer-leave"),
|
|
3344
3433
|
onClick: n[5] ||= (e) => o("click", e),
|
|
3345
3434
|
onContextmenu: n[6] ||= (e) => o("contextmenu", e)
|
|
3346
|
-
}, null, 42,
|
|
3435
|
+
}, null, 42, Oi)) : r("", !0),
|
|
3347
3436
|
!e.track.isEmpty && !e.track.hasVisibleSeries && !e.cleanView ? (g(), i("text", {
|
|
3348
3437
|
key: 2,
|
|
3349
3438
|
class: "waveform-track__no-visible-series",
|
|
@@ -3351,33 +3440,33 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3351
3440
|
y: e.track.height / 2,
|
|
3352
3441
|
"text-anchor": "middle",
|
|
3353
3442
|
"dominant-baseline": "central"
|
|
3354
|
-
}, " 暂无可见曲线 ", 8,
|
|
3355
|
-
], 10,
|
|
3443
|
+
}, " 暂无可见曲线 ", 8, ki)) : r("", !0)
|
|
3444
|
+
], 10, Ei));
|
|
3356
3445
|
}
|
|
3357
|
-
}),
|
|
3446
|
+
}), ji = [
|
|
3358
3447
|
"width",
|
|
3359
3448
|
"height",
|
|
3360
3449
|
"data-position",
|
|
3361
3450
|
"data-orientation"
|
|
3362
|
-
],
|
|
3451
|
+
], Mi = [
|
|
3363
3452
|
"disabled",
|
|
3364
3453
|
"aria-pressed",
|
|
3365
3454
|
"aria-label",
|
|
3366
3455
|
"onClick"
|
|
3367
|
-
],
|
|
3456
|
+
], Ni = [
|
|
3368
3457
|
"data-line-type",
|
|
3369
3458
|
"data-line-style",
|
|
3370
3459
|
"data-point-type",
|
|
3371
3460
|
"data-error-bar-visible"
|
|
3372
|
-
],
|
|
3461
|
+
], Pi = [
|
|
3373
3462
|
"d",
|
|
3374
3463
|
"stroke",
|
|
3375
3464
|
"stroke-dasharray"
|
|
3376
|
-
],
|
|
3465
|
+
], Fi = [
|
|
3377
3466
|
"d",
|
|
3378
3467
|
"stroke",
|
|
3379
3468
|
"stroke-width"
|
|
3380
|
-
],
|
|
3469
|
+
], Ii = ["d", "fill"], Li = ["title"], Ri = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
3381
3470
|
__name: "WaveformLegend",
|
|
3382
3471
|
props: {
|
|
3383
3472
|
series: {},
|
|
@@ -3425,7 +3514,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3425
3514
|
disabled: !n.interactive,
|
|
3426
3515
|
"aria-pressed": n.interactive ? !u(e.id) : void 0,
|
|
3427
3516
|
"aria-label": n.interactive ? `${u(e.id) ? "显示" : "隐藏"}曲线 ${e.name}` : void 0,
|
|
3428
|
-
onClick:
|
|
3517
|
+
onClick: A((t) => d(e.id), ["stop"])
|
|
3429
3518
|
}, [(g(), i("svg", {
|
|
3430
3519
|
class: "waveform-legend__swatch",
|
|
3431
3520
|
viewBox: "0 0 26 16",
|
|
@@ -3435,45 +3524,45 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3435
3524
|
"data-point-type": e.pointType,
|
|
3436
3525
|
"data-error-bar-visible": e.errorBar.visible || void 0
|
|
3437
3526
|
}, [
|
|
3438
|
-
w(
|
|
3527
|
+
w(Gr)(e.lineType) ? (g(), i("path", {
|
|
3439
3528
|
key: 0,
|
|
3440
3529
|
class: "waveform-legend__line",
|
|
3441
|
-
d: w(
|
|
3530
|
+
d: w(Gr)(e.lineType) ?? void 0,
|
|
3442
3531
|
stroke: e.color,
|
|
3443
|
-
"stroke-dasharray": w(
|
|
3532
|
+
"stroke-dasharray": w(Kr)(e.lineStyle),
|
|
3444
3533
|
"stroke-width": "1.5",
|
|
3445
3534
|
fill: "none"
|
|
3446
|
-
}, null, 8,
|
|
3535
|
+
}, null, 8, Pi)) : r("", !0),
|
|
3447
3536
|
e.errorBar.visible ? (g(), i("path", {
|
|
3448
3537
|
key: 1,
|
|
3449
3538
|
class: "waveform-legend__error-bar",
|
|
3450
|
-
d: w(
|
|
3539
|
+
d: w(qr)(e.errorBar.capWidth),
|
|
3451
3540
|
stroke: e.errorBar.color || e.color,
|
|
3452
3541
|
"stroke-width": e.errorBar.width,
|
|
3453
3542
|
"stroke-linecap": "butt",
|
|
3454
3543
|
fill: "none"
|
|
3455
|
-
}, null, 8,
|
|
3544
|
+
}, null, 8, Fi)) : r("", !0),
|
|
3456
3545
|
e.pointType === "none" ? r("", !0) : (g(), i("path", {
|
|
3457
3546
|
key: 2,
|
|
3458
3547
|
class: "waveform-legend__point",
|
|
3459
|
-
d: w(
|
|
3548
|
+
d: w(Ur)(e.pointType, 30) ?? void 0,
|
|
3460
3549
|
fill: e.color,
|
|
3461
3550
|
transform: "translate(13 8)"
|
|
3462
|
-
}, null, 8,
|
|
3463
|
-
], 8,
|
|
3551
|
+
}, null, 8, Ii))
|
|
3552
|
+
], 8, Ni)), a("span", {
|
|
3464
3553
|
class: "waveform-legend__label",
|
|
3465
3554
|
title: e.name
|
|
3466
|
-
}, S(e.name), 9,
|
|
3555
|
+
}, S(e.name), 9, Li)], 10, Mi))), 128))], 6)], 2)], 8, ji));
|
|
3467
3556
|
}
|
|
3468
|
-
}), [["__scopeId", "data-v-2ae12e71"]]),
|
|
3557
|
+
}), [["__scopeId", "data-v-2ae12e71"]]), zi = {
|
|
3469
3558
|
class: "waveform-chart__hover-layer",
|
|
3470
3559
|
"pointer-events": "none",
|
|
3471
3560
|
"aria-hidden": "true"
|
|
3472
|
-
},
|
|
3561
|
+
}, Bi = ["clip-path", "transform"], Vi = [
|
|
3473
3562
|
"x1",
|
|
3474
3563
|
"x2",
|
|
3475
3564
|
"y2"
|
|
3476
|
-
],
|
|
3565
|
+
], Hi = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
3477
3566
|
__name: "WaveformHoverLayer",
|
|
3478
3567
|
props: {
|
|
3479
3568
|
state: {},
|
|
@@ -3496,7 +3585,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3496
3585
|
}] : [];
|
|
3497
3586
|
});
|
|
3498
3587
|
});
|
|
3499
|
-
return (t, r) => (g(), i("g",
|
|
3588
|
+
return (t, r) => (g(), i("g", zi, [(g(!0), i(e, null, y(o.value, (e) => (g(), i("g", {
|
|
3500
3589
|
key: e.track.index,
|
|
3501
3590
|
class: "waveform-track__crosshair waveform-chart__crosshair",
|
|
3502
3591
|
"clip-path": `url(#${n.clipPathId}-${e.track.index})`,
|
|
@@ -3506,9 +3595,9 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3506
3595
|
x2: e.x,
|
|
3507
3596
|
y1: "0",
|
|
3508
3597
|
y2: e.track.height
|
|
3509
|
-
}, null, 8,
|
|
3598
|
+
}, null, 8, Vi)], 8, Bi))), 128))]));
|
|
3510
3599
|
}
|
|
3511
|
-
}), [["__scopeId", "data-v-a6f82099"]]),
|
|
3600
|
+
}), [["__scopeId", "data-v-a6f82099"]]), Ui = [
|
|
3512
3601
|
"data-display-mode",
|
|
3513
3602
|
"data-interaction-mode",
|
|
3514
3603
|
"data-presentation-mode",
|
|
@@ -3517,37 +3606,40 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3517
3606
|
"data-plot-margin-top",
|
|
3518
3607
|
"data-plot-margin-bottom",
|
|
3519
3608
|
"data-title-area-height"
|
|
3520
|
-
],
|
|
3609
|
+
], Wi = [
|
|
3521
3610
|
"role",
|
|
3522
3611
|
"aria-level",
|
|
3523
3612
|
"aria-hidden"
|
|
3524
|
-
],
|
|
3613
|
+
], Gi = ["data-title-scale", "data-title-wrapped"], Ki = [
|
|
3525
3614
|
"width",
|
|
3526
3615
|
"height",
|
|
3527
3616
|
"aria-label"
|
|
3528
|
-
],
|
|
3617
|
+
], qi = ["id"], Ji = ["width", "height"], Yi = ["transform"], Xi = {
|
|
3529
3618
|
key: 0,
|
|
3530
3619
|
class: "waveform-chart__grid-slots",
|
|
3531
3620
|
"aria-hidden": "true"
|
|
3532
|
-
},
|
|
3621
|
+
}, Zi = ["transform"], Qi = ["width", "height"], $i = ["width", "height"], ea = [
|
|
3533
3622
|
"x",
|
|
3534
3623
|
"y",
|
|
3535
3624
|
"width",
|
|
3536
3625
|
"height"
|
|
3537
|
-
],
|
|
3626
|
+
], ta = {
|
|
3538
3627
|
key: 4,
|
|
3539
3628
|
class: "waveform-chart__legend-layer"
|
|
3540
|
-
},
|
|
3629
|
+
}, na = [
|
|
3541
3630
|
"data-legend-track-index",
|
|
3542
3631
|
"data-legend-track-id",
|
|
3543
3632
|
"transform"
|
|
3544
|
-
],
|
|
3633
|
+
], ra = ["x", "y"], ia = ["x", "y"], aa = /* @__PURE__ */ c({
|
|
3545
3634
|
__name: "WaveformChartView",
|
|
3546
3635
|
props: { controller: {} },
|
|
3547
3636
|
setup(t) {
|
|
3548
|
-
let { displayMode: o, activeInteractionMode: c, isCleanView: l, isPresentationMode: u, selection: d, containerStyle: m, overlayMode: h, resolvedChartLeftMargin: _, titleAreaHeight: v, resolvedPlotMargin: b, pointerInsideChart: x, handleNativeContextMenu: T, titleAreaReserved: E, titleAreaStyle: D, titleVisible: O, titleMeasureStyle: k, resolvedTitleText: A, titleVisualStyle: j, titleTextStyle: M, titleLayout: N, chartWidth: P, drawingHeight: F, hasWaveformData: I, requestViewportReset: L, trackLayouts: R, clipPathId: z, chartTopMargin: B, gridCells: V, hasVisibleWaveformData: H, zoomable: U, isZoomMode: ee, innerWidth: te, innerHeight: ne, handleSharedPointerMove: W, beginSharedViewportDrag:
|
|
3637
|
+
let { displayMode: o, activeInteractionMode: c, isCleanView: l, isPresentationMode: u, selection: d, containerStyle: m, overlayMode: h, resolvedChartLeftMargin: _, titleAreaHeight: v, resolvedPlotMargin: b, pointerInsideChart: x, handleNativeContextMenu: T, titleAreaReserved: E, titleAreaStyle: D, titleVisible: O, titleMeasureStyle: k, resolvedTitleText: A, titleVisualStyle: j, titleTextStyle: M, titleLayout: N, chartWidth: P, drawingHeight: F, hasWaveformData: I, requestViewportReset: L, trackLayouts: R, clipPathId: z, chartTopMargin: B, gridCells: V, hasVisibleWaveformData: H, zoomable: U, isZoomMode: ee, innerWidth: te, innerHeight: ne, handleSharedPointerMove: W, beginSharedViewportDrag: re, finishViewportDrag: G, cancelViewportDrag: K, handlePointerLeave: q, handleAnnotationClick: ie, handleAnnotationContextMenu: J, resolveFrameNumber: oe, frameStyle: se, axes: ce, resolvedZeroLine: le, timeUnit: ue, yLabel: de, handleIndependentPointerMove: fe, beginViewportDrag: pe, hoverState: me, showTooltip: he, selectionBox: ge, renderedAnnotations: Y, annotationsVisible: _e, handleExistingAnnotationContextMenu: ve, beginAnnotationDrag: ye, handleAnnotationMove: be, endAnnotationDrag: xe, resolveLegendPosition: X, resolveLegendOrientation: Z, legendBackgroundColor: Se, legendInteractive: Ce, resolvedHiddenSeriesIds: we, toggleSeriesVisibility: Te, resolvedXLabel: Ee, xAxisTitleY: De, hasChartArea: Oe, gridOptions: ke, pageCount: Ae, currentPage: je, getPageSize: Me, chartTracks: Ne, goToPage: Pe, annotationInteraction: Fe, editorDraft: Re, contextMenu: Q, editorSeries: ze, editorSeriesOptions: Be, timeError: Ve, confirmAnnotation: He, cancelAnnotation: Ue, changeDraftSeries: We, changeDraftTime: Ge, editContextAnnotation: Ke, deleteContextAnnotation: qe, chartHeight: Je, setContainer: Ye, setSvgElement: $, setTitleMeasureElement: Xe, setSharedOverlayElement: Ze } = C(t.controller);
|
|
3638
|
+
function Qe() {
|
|
3639
|
+
x.value = !1, q.value();
|
|
3640
|
+
}
|
|
3549
3641
|
return (t, C) => (g(), i("div", {
|
|
3550
|
-
ref: w(
|
|
3642
|
+
ref: w(Ye),
|
|
3551
3643
|
class: f(["waveform-chart", [
|
|
3552
3644
|
`waveform-chart--${w(o)}`,
|
|
3553
3645
|
`waveform-chart--interaction-${w(c)}`,
|
|
@@ -3567,8 +3659,8 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3567
3659
|
"data-plot-margin-bottom": w(b).bottom,
|
|
3568
3660
|
"data-title-area-height": w(v),
|
|
3569
3661
|
onPointerenter: C[8] ||= (e) => x.value = !0,
|
|
3570
|
-
onPointerleave:
|
|
3571
|
-
onContextmenuCapture: C[
|
|
3662
|
+
onPointerleave: Qe,
|
|
3663
|
+
onContextmenuCapture: C[9] ||= (...e) => w(T) && w(T)(...e)
|
|
3572
3664
|
}, [
|
|
3573
3665
|
w(E) ? (g(), i("div", {
|
|
3574
3666
|
key: 0,
|
|
@@ -3578,7 +3670,7 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3578
3670
|
"aria-level": w(O) ? 2 : void 0,
|
|
3579
3671
|
"aria-hidden": w(l) || void 0
|
|
3580
3672
|
}, [a("span", {
|
|
3581
|
-
ref: w(
|
|
3673
|
+
ref: w(Xe),
|
|
3582
3674
|
class: "waveform-chart__title-measure",
|
|
3583
3675
|
style: p(w(k)),
|
|
3584
3676
|
"aria-hidden": "true"
|
|
@@ -3591,9 +3683,9 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3591
3683
|
style: p(w(M)),
|
|
3592
3684
|
"data-title-scale": w(N).scale,
|
|
3593
3685
|
"data-title-wrapped": w(N).wrapped || void 0
|
|
3594
|
-
}, S(w(A)), 13,
|
|
3686
|
+
}, S(w(A)), 13, Gi)], 4)) : r("", !0)], 12, Wi)) : r("", !0),
|
|
3595
3687
|
(g(), i("svg", {
|
|
3596
|
-
ref: w(
|
|
3688
|
+
ref: w($),
|
|
3597
3689
|
class: "waveform-chart__svg",
|
|
3598
3690
|
width: w(P),
|
|
3599
3691
|
height: w(F),
|
|
@@ -3608,9 +3700,9 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3608
3700
|
}, [a("rect", {
|
|
3609
3701
|
width: e.width,
|
|
3610
3702
|
height: e.height
|
|
3611
|
-
}, null, 8,
|
|
3703
|
+
}, null, 8, Ji)], 8, qi))), 128))]),
|
|
3612
3704
|
a("g", { transform: `translate(${w(_)}, ${w(B)})` }, [
|
|
3613
|
-
w(o) !== "compact" && !w(l) ? (g(), i("g",
|
|
3705
|
+
w(o) !== "compact" && !w(l) ? (g(), i("g", Xi, [(g(!0), i(e, null, y(w(V), (e) => (g(), i("g", {
|
|
3614
3706
|
key: `grid-slot-${e.slotIndex}`,
|
|
3615
3707
|
transform: `translate(${e.left}, ${e.top})`
|
|
3616
3708
|
}, [e.series ? r("", !0) : (g(), i("rect", {
|
|
@@ -3618,10 +3710,10 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3618
3710
|
class: "waveform-chart__grid-slot-placeholder",
|
|
3619
3711
|
width: e.width,
|
|
3620
3712
|
height: e.cellHeight
|
|
3621
|
-
}, null, 8,
|
|
3713
|
+
}, null, 8, Qi))], 8, Zi))), 128))])) : r("", !0),
|
|
3622
3714
|
w(o) !== "independent" && w(R).length && w(H) ? (g(), i("rect", {
|
|
3623
3715
|
key: 1,
|
|
3624
|
-
ref: w(
|
|
3716
|
+
ref: w(Ze),
|
|
3625
3717
|
class: f(["waveform-chart__overlay waveform-chart__overlay--shared", {
|
|
3626
3718
|
"is-zoomable": !w(u) && w(U) && w(ee),
|
|
3627
3719
|
"is-annotating": !w(u) && w(c) === "annotation"
|
|
@@ -3629,14 +3721,14 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3629
3721
|
width: w(te),
|
|
3630
3722
|
height: w(ne),
|
|
3631
3723
|
onPointermove: C[0] ||= (...e) => w(W) && w(W)(...e),
|
|
3632
|
-
onPointerdown: C[1] ||= (...e) => w(
|
|
3633
|
-
onPointerup: C[2] ||= (...e) => w(
|
|
3724
|
+
onPointerdown: C[1] ||= (...e) => w(re) && w(re)(...e),
|
|
3725
|
+
onPointerup: C[2] ||= (...e) => w(G) && w(G)(...e),
|
|
3634
3726
|
onPointercancel: C[3] ||= (...e) => w(K) && w(K)(...e),
|
|
3635
|
-
onPointerleave: C[4] ||= (...e) => w(
|
|
3636
|
-
onClick: C[5] ||= (...e) => w(
|
|
3637
|
-
onContextmenu: C[6] ||= (...e) => w(
|
|
3638
|
-
}, null, 42,
|
|
3639
|
-
(g(!0), i(e, null, y(w(R), (e) => (g(), n(w(
|
|
3727
|
+
onPointerleave: C[4] ||= (...e) => w(q) && w(q)(...e),
|
|
3728
|
+
onClick: C[5] ||= (...e) => w(ie) && w(ie)(...e),
|
|
3729
|
+
onContextmenu: C[6] ||= (...e) => w(J) && w(J)(...e)
|
|
3730
|
+
}, null, 42, $i)) : r("", !0),
|
|
3731
|
+
(g(!0), i(e, null, y(w(R), (e) => (g(), n(w(Ai), {
|
|
3640
3732
|
key: `${e.index}-${e.series.name}`,
|
|
3641
3733
|
track: e,
|
|
3642
3734
|
"clip-path-id": w(z),
|
|
@@ -3645,20 +3737,20 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3645
3737
|
interactive: !w(u),
|
|
3646
3738
|
"display-mode": w(o),
|
|
3647
3739
|
"interaction-mode": w(c),
|
|
3648
|
-
"frame-number": w(
|
|
3649
|
-
"frame-style": w(
|
|
3650
|
-
axes: w(
|
|
3740
|
+
"frame-number": w(oe)(e.index),
|
|
3741
|
+
"frame-style": w(se),
|
|
3742
|
+
axes: w(ce),
|
|
3651
3743
|
"clean-view": w(l),
|
|
3652
|
-
"zero-line": w(
|
|
3653
|
-
"time-unit": w(
|
|
3654
|
-
"y-label": w(
|
|
3655
|
-
onPointerMove: (t) => w(
|
|
3656
|
-
onPointerDown: (t) => w(
|
|
3657
|
-
onPointerUp: w(
|
|
3744
|
+
"zero-line": w(le),
|
|
3745
|
+
"time-unit": w(ue),
|
|
3746
|
+
"y-label": w(de),
|
|
3747
|
+
onPointerMove: (t) => w(fe)(t, e.index),
|
|
3748
|
+
onPointerDown: (t) => w(pe)(t, e.index, !0),
|
|
3749
|
+
onPointerUp: w(G),
|
|
3658
3750
|
onPointerCancel: w(K),
|
|
3659
|
-
onPointerLeave: w(
|
|
3660
|
-
onClick: (t) => w(
|
|
3661
|
-
onContextmenu: (t) => w(
|
|
3751
|
+
onPointerLeave: w(q),
|
|
3752
|
+
onClick: (t) => w(ie)(t, e.index),
|
|
3753
|
+
onContextmenu: (t) => w(J)(t, e.index)
|
|
3662
3754
|
}, null, 8, [
|
|
3663
3755
|
"track",
|
|
3664
3756
|
"clip-path-id",
|
|
@@ -3682,8 +3774,8 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3682
3774
|
"onClick",
|
|
3683
3775
|
"onContextmenu"
|
|
3684
3776
|
]))), 128)),
|
|
3685
|
-
s(w(
|
|
3686
|
-
state: w(
|
|
3777
|
+
s(w(Hi), {
|
|
3778
|
+
state: w(me),
|
|
3687
3779
|
tracks: w(R),
|
|
3688
3780
|
"clip-path-id": w(z),
|
|
3689
3781
|
visible: w(he) && !w(u)
|
|
@@ -3693,24 +3785,24 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3693
3785
|
"clip-path-id",
|
|
3694
3786
|
"visible"
|
|
3695
3787
|
]),
|
|
3696
|
-
w(
|
|
3788
|
+
w(ge) && w(d)?.kind === "box" ? (g(), i("rect", {
|
|
3697
3789
|
key: 2,
|
|
3698
3790
|
class: "waveform-chart__zoom-selection",
|
|
3699
|
-
x: w(
|
|
3700
|
-
y: w(
|
|
3701
|
-
width: w(
|
|
3702
|
-
height: w(
|
|
3791
|
+
x: w(ge).x,
|
|
3792
|
+
y: w(ge).y,
|
|
3793
|
+
width: w(ge).width,
|
|
3794
|
+
height: w(ge).height,
|
|
3703
3795
|
"aria-hidden": "true"
|
|
3704
|
-
}, null, 8,
|
|
3705
|
-
w(l) ? r("", !0) : (g(), n(w(
|
|
3796
|
+
}, null, 8, ea)) : r("", !0),
|
|
3797
|
+
w(l) ? r("", !0) : (g(), n(w(Ie), {
|
|
3706
3798
|
key: 3,
|
|
3707
|
-
annotations: w(
|
|
3799
|
+
annotations: w(Y),
|
|
3708
3800
|
visible: w(_e),
|
|
3709
3801
|
interactive: !w(u),
|
|
3710
3802
|
onContextmenu: w(ve),
|
|
3711
|
-
onDragStart: w(
|
|
3712
|
-
onMove: w(
|
|
3713
|
-
onDragEnd: w(
|
|
3803
|
+
onDragStart: w(ye),
|
|
3804
|
+
onMove: w(be),
|
|
3805
|
+
onDragEnd: w(xe)
|
|
3714
3806
|
}, null, 8, [
|
|
3715
3807
|
"annotations",
|
|
3716
3808
|
"visible",
|
|
@@ -3720,17 +3812,17 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3720
3812
|
"onMove",
|
|
3721
3813
|
"onDragEnd"
|
|
3722
3814
|
])),
|
|
3723
|
-
w(l) ? r("", !0) : (g(), i("g",
|
|
3815
|
+
w(l) ? r("", !0) : (g(), i("g", ta, [(g(!0), i(e, null, y(w(R), (e) => (g(), i("g", {
|
|
3724
3816
|
key: `legend-${e.index}-${e.series.name}`,
|
|
3725
3817
|
class: "waveform-chart__legend-track",
|
|
3726
3818
|
"data-legend-track-index": e.index,
|
|
3727
3819
|
"data-legend-track-id": e.id,
|
|
3728
3820
|
transform: `translate(${e.left}, ${e.top})`
|
|
3729
|
-
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(
|
|
3821
|
+
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(Ri), {
|
|
3730
3822
|
key: 0,
|
|
3731
3823
|
series: e.legendSeries,
|
|
3732
|
-
position: w(
|
|
3733
|
-
orientation: w(
|
|
3824
|
+
position: w(X)(e.id),
|
|
3825
|
+
orientation: w(Z)(w(X)(e.id)),
|
|
3734
3826
|
"background-color": w(Se),
|
|
3735
3827
|
interactive: w(Ce),
|
|
3736
3828
|
"hidden-series-ids": w(we),
|
|
@@ -3747,68 +3839,72 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3747
3839
|
"width",
|
|
3748
3840
|
"height",
|
|
3749
3841
|
"onToggle"
|
|
3750
|
-
])) : r("", !0)], 8,
|
|
3751
|
-
], 8,
|
|
3842
|
+
])) : r("", !0)], 8, na))), 128))]))
|
|
3843
|
+
], 8, Yi),
|
|
3752
3844
|
w(Ee) && !w(l) ? (g(), i("text", {
|
|
3753
3845
|
key: 0,
|
|
3754
3846
|
class: "waveform-chart__label waveform-chart__x-label",
|
|
3755
3847
|
x: w(_) + w(te) / 2,
|
|
3756
3848
|
y: w(De),
|
|
3757
3849
|
"text-anchor": "middle"
|
|
3758
|
-
}, S(w(Ee)), 9,
|
|
3850
|
+
}, S(w(Ee)), 9, ra)) : r("", !0),
|
|
3759
3851
|
w(Oe) && !w(I) ? (g(), i("text", {
|
|
3760
3852
|
key: 1,
|
|
3761
3853
|
class: "waveform-chart__empty",
|
|
3762
3854
|
x: w(P) / 2,
|
|
3763
3855
|
y: w(F) / 2,
|
|
3764
3856
|
"text-anchor": "middle"
|
|
3765
|
-
}, " 暂无有效波形数据 ", 8,
|
|
3766
|
-
], 40,
|
|
3767
|
-
w(ke).showPagination && w(Ae) > 1 && !w(l) ? (g(), n(w(
|
|
3857
|
+
}, " 暂无有效波形数据 ", 8, ia)) : r("", !0)
|
|
3858
|
+
], 40, Ki)),
|
|
3859
|
+
w(ke).showPagination && w(Ae) > 1 && !w(l) ? (g(), n(w(ae), {
|
|
3768
3860
|
key: 1,
|
|
3769
3861
|
class: "waveform-chart__pagination",
|
|
3770
3862
|
"aria-label": "波形分页",
|
|
3771
3863
|
current: w(je),
|
|
3772
|
-
"page-size": w(
|
|
3773
|
-
total: w(
|
|
3864
|
+
"page-size": w(Me)(w(ke)),
|
|
3865
|
+
total: w(Ne).length,
|
|
3774
3866
|
"show-size-changer": !1,
|
|
3775
3867
|
"show-quick-jumper": !1,
|
|
3776
|
-
onChange: w(
|
|
3868
|
+
onChange: w(Pe)
|
|
3777
3869
|
}, null, 8, [
|
|
3778
3870
|
"current",
|
|
3779
3871
|
"page-size",
|
|
3780
3872
|
"total",
|
|
3781
3873
|
"onChange"
|
|
3782
3874
|
])) : r("", !0),
|
|
3783
|
-
w(
|
|
3875
|
+
w(Re) && !w(l) && !w(u) ? (g(), n(Tr, {
|
|
3784
3876
|
key: 2,
|
|
3785
|
-
annotation: w(
|
|
3786
|
-
mode: w(
|
|
3877
|
+
annotation: w(Re).annotation,
|
|
3878
|
+
mode: w(Re).mode,
|
|
3787
3879
|
series: w(ze),
|
|
3788
3880
|
"series-options": w(Be),
|
|
3789
|
-
"time-unit": w(
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3881
|
+
"time-unit": w(ue),
|
|
3882
|
+
"time-error": w(Ve),
|
|
3883
|
+
onConfirm: w(He),
|
|
3884
|
+
onCancel: w(Ue),
|
|
3885
|
+
onSeriesChange: w(We),
|
|
3886
|
+
onTimeChange: w(Ge)
|
|
3793
3887
|
}, null, 8, [
|
|
3794
3888
|
"annotation",
|
|
3795
3889
|
"mode",
|
|
3796
3890
|
"series",
|
|
3797
3891
|
"series-options",
|
|
3798
3892
|
"time-unit",
|
|
3893
|
+
"time-error",
|
|
3799
3894
|
"onConfirm",
|
|
3800
3895
|
"onCancel",
|
|
3801
|
-
"onSeriesChange"
|
|
3896
|
+
"onSeriesChange",
|
|
3897
|
+
"onTimeChange"
|
|
3802
3898
|
])) : r("", !0),
|
|
3803
|
-
!w(l) && !w(u) ? (g(), n(w(
|
|
3899
|
+
!w(l) && !w(u) ? (g(), n(w(Le), {
|
|
3804
3900
|
key: 3,
|
|
3805
|
-
visible: w(
|
|
3806
|
-
x: w(
|
|
3807
|
-
y: w(
|
|
3808
|
-
"can-edit": !!w(
|
|
3809
|
-
onEdit: w(
|
|
3810
|
-
onDelete: w(
|
|
3811
|
-
onClose: w(
|
|
3901
|
+
visible: w(Q) !== null,
|
|
3902
|
+
x: w(Q)?.x || 0,
|
|
3903
|
+
y: w(Q)?.y || 0,
|
|
3904
|
+
"can-edit": !!w(Q)?.annotationId,
|
|
3905
|
+
onEdit: w(Ke),
|
|
3906
|
+
onDelete: w(qe),
|
|
3907
|
+
onClose: w(Fe).closeContextMenu
|
|
3812
3908
|
}, null, 8, [
|
|
3813
3909
|
"visible",
|
|
3814
3910
|
"x",
|
|
@@ -3818,12 +3914,12 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3818
3914
|
"onDelete",
|
|
3819
3915
|
"onClose"
|
|
3820
3916
|
])) : r("", !0),
|
|
3821
|
-
s(w(
|
|
3822
|
-
state: w(
|
|
3917
|
+
s(w(Ir), {
|
|
3918
|
+
state: w(me),
|
|
3823
3919
|
visible: w(he) && !w(u),
|
|
3824
|
-
"time-unit": w(
|
|
3920
|
+
"time-unit": w(ue),
|
|
3825
3921
|
"container-width": w(P),
|
|
3826
|
-
"container-height": w(
|
|
3922
|
+
"container-height": w(Je)
|
|
3827
3923
|
}, null, 8, [
|
|
3828
3924
|
"state",
|
|
3829
3925
|
"visible",
|
|
@@ -3831,9 +3927,9 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3831
3927
|
"container-width",
|
|
3832
3928
|
"container-height"
|
|
3833
3929
|
])
|
|
3834
|
-
], 46,
|
|
3930
|
+
], 46, Ui));
|
|
3835
3931
|
}
|
|
3836
|
-
}),
|
|
3932
|
+
}), oa = /* @__PURE__ */ c({
|
|
3837
3933
|
__name: "WaveformChart",
|
|
3838
3934
|
props: {
|
|
3839
3935
|
data: {},
|
|
@@ -3911,9 +4007,9 @@ var Gr = ["clip-path"], Kr = ["data-series-id", "data-series-name"], qr = [
|
|
|
3911
4007
|
"page-change"
|
|
3912
4008
|
],
|
|
3913
4009
|
setup(e, { expose: t, emit: r }) {
|
|
3914
|
-
let i =
|
|
3915
|
-
return t({ resetViewport: i.resetViewport }), (e, t) => (g(), n(
|
|
4010
|
+
let i = or(e, r);
|
|
4011
|
+
return t({ resetViewport: i.resetViewport }), (e, t) => (g(), n(aa, { controller: w(i) }, null, 8, ["controller"]));
|
|
3916
4012
|
}
|
|
3917
4013
|
});
|
|
3918
4014
|
//#endregion
|
|
3919
|
-
export {
|
|
4015
|
+
export { Ht as DEFAULT_WAVEFORM_RENDERING_OPTIONS, oa as WaveformChart, Xe as buildMinorTicks, gt as clamp, lt as displayTime, ft as formatAxisTime, dt as formatEndpointTime, pt as formatTooltipTime, Ft as normalizeWaveformData, It as normalizeWaveformSeries, $ as paddedDomain, Je as parseWaveformAnnotations, ht as resolveTrackGeometry, Ut as resolveWaveformRenderingOptions, Yt as selectRenderablePoints, qe as serializeWaveformAnnotations };
|