waveform-analysis 0.1.28 → 0.1.29
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 +57 -33
- package/dist/index.cjs +1 -1
- package/dist/index.js +552 -548
- package/dist/types/components/core/trackLayoutBuilder.d.ts +2 -1
- package/dist/types/demo/types.d.ts +9 -0
- package/dist/types/demo/useDemoXAxisLabelControls.d.ts +32 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/chart.d.ts +15 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/formatters.d.ts +5 -2
- package/dist/types/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/App.vue +7 -1
- package/src/components/core/trackLayoutBuilder.ts +22 -4
- package/src/components/core/useWaveformLayout.ts +1 -0
- package/src/components/rendering/WaveformTrackAxes.vue +6 -3
- package/src/components/waveformChartCases/frameGridAndFormatting.test.ts +70 -3
- package/src/demo/DemoGridFrameControls.vue +70 -0
- package/src/demo/types.ts +9 -0
- package/src/demo/useDemoXAxisLabelControls.ts +77 -0
- package/src/demo/xAxisLabelControls.test.ts +86 -0
- package/src/index.ts +3 -0
- package/src/styles.css +8 -0
- package/src/types/chart.ts +21 -0
- package/src/types/index.ts +3 -0
- package/src/utils/formatters.test.ts +37 -5
- package/src/utils/formatters.ts +26 -16
- package/src/utils/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
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, withDirectives as O, withModifiers as k } from "vue";
|
|
2
|
-
import { axisBottom as A, axisLeft as j, axisRight as M, bisector as N, curveStep as P, curveStepAfter as F, curveStepBefore as I, extent as L, line as R, pointer as z, scaleLinear as B, select as V, symbol as H, symbolCircle as ee, symbolDiamond as te, symbolSquare as ne, symbolTriangle as re, zoom as ie, zoomIdentity as U, zoomTransform as
|
|
3
|
-
import { Pagination as
|
|
4
|
-
import { ColorPicker as
|
|
2
|
+
import { axisBottom as A, axisLeft as j, axisRight as M, bisector as N, curveStep as P, curveStepAfter as F, curveStepBefore as I, extent as L, line as R, pointer as z, scaleLinear as B, select as V, symbol as H, symbolCircle as ee, symbolDiamond as te, symbolSquare as ne, symbolTriangle as re, zoom as ie, zoomIdentity as U, zoomTransform as ae } from "d3";
|
|
3
|
+
import { Pagination as oe } from "ant-design-vue";
|
|
4
|
+
import { ColorPicker as W } from "vue3-colorpicker";
|
|
5
5
|
import "vue3-colorpicker/style.css";
|
|
6
6
|
//#region src/utils/waveformId.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
7
|
+
var se = 0;
|
|
8
|
+
function ce(e = "waveform") {
|
|
9
9
|
let t = l();
|
|
10
|
-
return `${e}-${t ? `v${t.uid}` : `f${++
|
|
10
|
+
return `${e}-${t ? `v${t.uid}` : `f${++se}`}`;
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/components/annotation/annotationLayout.ts
|
|
14
|
-
function
|
|
14
|
+
function le(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 ue(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 le(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 de(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 fe(e, t, n, r, i, a) {
|
|
32
32
|
for (let o of [
|
|
33
33
|
"top",
|
|
34
34
|
"bottom",
|
|
@@ -38,10 +38,10 @@ function de(e, t, n, r, i, a) {
|
|
|
38
38
|
"top-left",
|
|
39
39
|
"bottom-right",
|
|
40
40
|
"bottom-left"
|
|
41
|
-
]) if (
|
|
41
|
+
]) if (de(e, t, n, r, o, i, a)) return o;
|
|
42
42
|
return "top";
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function G(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 K(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(Y), 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 = ue({
|
|
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 = G(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 (!Ce(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 (!le(e.x, o) || !le(e.y, s)) return;
|
|
125
|
+
let c = we(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" : fe(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,28 @@ function he(e, t, n, r) {
|
|
|
137
137
|
placement: y,
|
|
138
138
|
lines: c,
|
|
139
139
|
box: { ...x },
|
|
140
|
-
style:
|
|
140
|
+
style: Se(e.style)
|
|
141
141
|
});
|
|
142
142
|
}), i;
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/components/annotation/markup.ts
|
|
146
|
-
var
|
|
146
|
+
var _e = {
|
|
147
147
|
borderColor: "#1677ff",
|
|
148
148
|
textColor: "#333333",
|
|
149
149
|
backgroundColor: "rgba(255, 255, 255, 0.92)"
|
|
150
|
-
},
|
|
151
|
-
function
|
|
150
|
+
}, K = "12px Arial, sans-serif", ve = N((e) => e.x);
|
|
151
|
+
function ye(e, t) {
|
|
152
152
|
if (!e.length || !Number.isFinite(t)) return null;
|
|
153
|
-
let n =
|
|
153
|
+
let n = ve.center(e, t), r = e[Math.min(n, e.length - 1)], i = e[Math.max(0, n - 1)];
|
|
154
154
|
return Math.abs(t - i.x) < Math.abs(r.x - t) ? i : r;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function be(e, t, n = "linear") {
|
|
157
157
|
if (!e.length || !Number.isFinite(t)) return null;
|
|
158
158
|
let r = e[0], i = e[e.length - 1];
|
|
159
159
|
if (t < r.x || t > i.x) return null;
|
|
160
160
|
if (e.length === 1) return t === r.x ? { ...r } : null;
|
|
161
|
-
let a =
|
|
161
|
+
let a = ve.left(e, t), o = e[Math.min(a, e.length - 1)];
|
|
162
162
|
if (o.x === t || a === 0) return {
|
|
163
163
|
x: t,
|
|
164
164
|
y: o.y
|
|
@@ -188,18 +188,18 @@ function ye(e, t, n = "linear") {
|
|
|
188
188
|
y: s.y + (o.y - s.y) * l
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function q(e, t, n, r) {
|
|
192
192
|
return e.flatMap((e) => {
|
|
193
|
-
let i =
|
|
193
|
+
let i = be(e.series.points, t, e.series.lineType);
|
|
194
194
|
if (!i) return [];
|
|
195
|
-
let a =
|
|
195
|
+
let a = ye(e.series.points, t);
|
|
196
196
|
if (!a) return [];
|
|
197
197
|
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
198
|
return [{
|
|
199
199
|
trackIndex: e.index,
|
|
200
200
|
seriesId: e.series.id,
|
|
201
201
|
name: e.series.name?.trim() || e.series.id,
|
|
202
|
-
color: e.series.color ||
|
|
202
|
+
color: e.series.color || _e.borderColor,
|
|
203
203
|
unit: e.series.unit,
|
|
204
204
|
point: a,
|
|
205
205
|
screenX: c,
|
|
@@ -208,24 +208,24 @@ function J(e, t, n, r) {
|
|
|
208
208
|
}];
|
|
209
209
|
}).sort((e, t) => e.distance - t.distance || e.trackIndex - t.trackIndex);
|
|
210
210
|
}
|
|
211
|
-
var
|
|
212
|
-
function
|
|
211
|
+
var J;
|
|
212
|
+
function xe(e) {
|
|
213
213
|
return Array.from(e).reduce((e, t) => e + (t.codePointAt(0) > 255 ? 12 : 6.7), 0);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
return
|
|
215
|
+
function Y(e) {
|
|
216
|
+
return J === void 0 && (J = null, typeof document < "u" && typeof CanvasRenderingContext2D < "u" && (J = document.createElement("canvas").getContext("2d"), J && (J.font = K))), J?.measureText(e).width ?? xe(e);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Se(e) {
|
|
219
219
|
return {
|
|
220
|
-
borderColor: e?.borderColor ||
|
|
221
|
-
textColor: e?.textColor ||
|
|
222
|
-
backgroundColor: e?.backgroundColor ||
|
|
220
|
+
borderColor: e?.borderColor || _e.borderColor,
|
|
221
|
+
textColor: e?.textColor || _e.textColor,
|
|
222
|
+
backgroundColor: e?.backgroundColor || _e.backgroundColor
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Ce(e) {
|
|
226
226
|
return !!(e.id && e.seriesId) && Number.isFinite(e.x) && Number.isFinite(e.y) && typeof e.text == "string" && e.text.trim().length > 0;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function we(e, t = 10) {
|
|
229
229
|
let n = [];
|
|
230
230
|
return e.split(/\r?\n/).forEach((e) => {
|
|
231
231
|
let r = Array.from(e);
|
|
@@ -238,30 +238,30 @@ function Ce(e, t = 10) {
|
|
|
238
238
|
}
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/components/annotation/WaveformAnnotationLayer.vue?vue&type=script&setup=true&lang.ts
|
|
241
|
-
var
|
|
241
|
+
var Te = [
|
|
242
242
|
"data-annotation-id",
|
|
243
243
|
"data-placement",
|
|
244
244
|
"onPointerdown",
|
|
245
245
|
"onContextmenu"
|
|
246
|
-
],
|
|
246
|
+
], Ee = ["id"], De = ["fill"], Oe = [
|
|
247
247
|
"x1",
|
|
248
248
|
"y1",
|
|
249
249
|
"x2",
|
|
250
250
|
"y2",
|
|
251
251
|
"stroke",
|
|
252
252
|
"marker-end"
|
|
253
|
-
],
|
|
253
|
+
], ke = [
|
|
254
254
|
"x",
|
|
255
255
|
"y",
|
|
256
256
|
"width",
|
|
257
257
|
"height",
|
|
258
258
|
"fill",
|
|
259
259
|
"stroke"
|
|
260
|
-
],
|
|
260
|
+
], Ae = [
|
|
261
261
|
"x",
|
|
262
262
|
"y",
|
|
263
263
|
"fill"
|
|
264
|
-
],
|
|
264
|
+
], je = ["x", "dy"], Me = /*@__PURE__*/ c({
|
|
265
265
|
__name: "WaveformAnnotationLayer",
|
|
266
266
|
props: {
|
|
267
267
|
annotations: {},
|
|
@@ -401,7 +401,7 @@ var we = [
|
|
|
401
401
|
}, [a("path", {
|
|
402
402
|
d: "M0,0 L8,4 L0,8 Z",
|
|
403
403
|
fill: t.style.borderColor
|
|
404
|
-
}, null, 8,
|
|
404
|
+
}, null, 8, De)], 8, Ee)]),
|
|
405
405
|
a("line", {
|
|
406
406
|
class: "waveform-annotation__arrow",
|
|
407
407
|
x1: b(t).lineEndX,
|
|
@@ -410,7 +410,7 @@ var we = [
|
|
|
410
410
|
y2: t.anchorY,
|
|
411
411
|
stroke: t.style.borderColor,
|
|
412
412
|
"marker-end": `url(#${M(t.annotation.id)})`
|
|
413
|
-
}, null, 8,
|
|
413
|
+
}, null, 8, Oe),
|
|
414
414
|
a("rect", {
|
|
415
415
|
class: "waveform-annotation__box",
|
|
416
416
|
x: b(t).x,
|
|
@@ -419,27 +419,27 @@ var we = [
|
|
|
419
419
|
height: b(t).height,
|
|
420
420
|
fill: t.style.backgroundColor,
|
|
421
421
|
stroke: t.style.borderColor
|
|
422
|
-
}, null, 8,
|
|
422
|
+
}, null, 8, ke),
|
|
423
423
|
a("text", {
|
|
424
424
|
class: "waveform-annotation__text",
|
|
425
425
|
x: b(t).x + b(t).width / 2,
|
|
426
426
|
y: b(t).y + b(t).height / 2 - (t.lines.length - 1) * w(16) / 2,
|
|
427
427
|
fill: t.style.textColor,
|
|
428
|
-
style: p({ font: w(
|
|
428
|
+
style: p({ font: w(K) }),
|
|
429
429
|
"text-anchor": "middle",
|
|
430
430
|
"dominant-baseline": "central"
|
|
431
431
|
}, [(g(!0), i(e, null, y(t.lines, (e, n) => (g(), i("tspan", {
|
|
432
432
|
key: `${t.annotation.id}-${n}`,
|
|
433
433
|
x: b(t).x + b(t).width / 2,
|
|
434
434
|
dy: n === 0 ? 0 : w(16)
|
|
435
|
-
}, S(e), 9,
|
|
436
|
-
], 40,
|
|
435
|
+
}, S(e), 9, je))), 128))], 12, Ae)
|
|
436
|
+
], 40, Te))), 128))], 2)) : r("", !0);
|
|
437
437
|
}
|
|
438
|
-
}),
|
|
438
|
+
}), X = (e, t) => {
|
|
439
439
|
let n = e.__vccOpts || e;
|
|
440
440
|
for (let [e, r] of t) n[e] = r;
|
|
441
441
|
return n;
|
|
442
|
-
},
|
|
442
|
+
}, Ne = /*#__PURE__*/ X(Me, [["__scopeId", "data-v-7254383e"]]), Pe = /*#__PURE__*/ X(/* @__PURE__ */ c({
|
|
443
443
|
__name: "WaveformAnnotationContextMenu",
|
|
444
444
|
props: {
|
|
445
445
|
visible: { type: Boolean },
|
|
@@ -481,33 +481,33 @@ var we = [
|
|
|
481
481
|
}, "取消")
|
|
482
482
|
], 36)) : r("", !0);
|
|
483
483
|
}
|
|
484
|
-
}), [["__scopeId", "data-v-c70c98a1"]]),
|
|
485
|
-
function
|
|
484
|
+
}), [["__scopeId", "data-v-c70c98a1"]]), Fe = 1;
|
|
485
|
+
function Z(e) {
|
|
486
486
|
throw TypeError(`Invalid waveform annotation file: ${e}`);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Ie(e) {
|
|
489
489
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Le(e, t, n) {
|
|
492
492
|
let r = e[t];
|
|
493
|
-
return (typeof r != "string" || r.trim().length === 0) &&
|
|
493
|
+
return (typeof r != "string" || r.trim().length === 0) && Z(`${n}.${t} must be a non-empty string`), r;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Q(e, t, n) {
|
|
496
496
|
let r = e[t];
|
|
497
|
-
if (r !== void 0) return typeof r != "string" &&
|
|
497
|
+
if (r !== void 0) return typeof r != "string" && Z(`${n}.${t} must be a string`), r;
|
|
498
498
|
}
|
|
499
499
|
function Re(e, t, n) {
|
|
500
500
|
let r = e[t];
|
|
501
|
-
return (typeof r != "number" || !Number.isFinite(r)) &&
|
|
501
|
+
return (typeof r != "number" || !Number.isFinite(r)) && Z(`${n}.${t} must be a finite number`), r;
|
|
502
502
|
}
|
|
503
503
|
function ze(e, t, n) {
|
|
504
504
|
let r = e[t];
|
|
505
|
-
if (r !== void 0) return (typeof r != "number" || !Number.isFinite(r)) &&
|
|
505
|
+
if (r !== void 0) return (typeof r != "number" || !Number.isFinite(r)) && Z(`${n}.${t} must be a finite number`), r;
|
|
506
506
|
}
|
|
507
507
|
function Be(e, t) {
|
|
508
508
|
if (e === void 0) return;
|
|
509
|
-
|
|
510
|
-
let n =
|
|
509
|
+
Ie(e) || Z(`${t} must be an object`);
|
|
510
|
+
let n = Q(e, "borderColor", t), r = Q(e, "textColor", t), i = Q(e, "backgroundColor", t);
|
|
511
511
|
return {
|
|
512
512
|
...n !== void 0 && { borderColor: n },
|
|
513
513
|
...r !== void 0 && { textColor: r },
|
|
@@ -516,13 +516,13 @@ function Be(e, t) {
|
|
|
516
516
|
}
|
|
517
517
|
function Ve(e, t) {
|
|
518
518
|
let n = `annotations[${t}]`;
|
|
519
|
-
|
|
520
|
-
let r =
|
|
521
|
-
r.length > 40 &&
|
|
522
|
-
let i = ze(e, "labelOffsetX", n), a = ze(e, "labelOffsetY", n), o =
|
|
519
|
+
Ie(e) || Z(`${n} must be an object`);
|
|
520
|
+
let r = Le(e, "text", n);
|
|
521
|
+
r.length > 40 && Z(`${n}.text must not exceed 40 characters`);
|
|
522
|
+
let i = ze(e, "labelOffsetX", n), a = ze(e, "labelOffsetY", n), o = Q(e, "createdAt", n), s = Be(e.style, `${n}.style`);
|
|
523
523
|
return {
|
|
524
|
-
id:
|
|
525
|
-
seriesId:
|
|
524
|
+
id: Le(e, "id", n),
|
|
525
|
+
seriesId: Le(e, "seriesId", n),
|
|
526
526
|
x: Re(e, "x", n),
|
|
527
527
|
y: Re(e, "y", n),
|
|
528
528
|
text: r,
|
|
@@ -535,24 +535,24 @@ function Ve(e, t) {
|
|
|
535
535
|
function He(e) {
|
|
536
536
|
let t = e.map(Ve), n = /* @__PURE__ */ new Set();
|
|
537
537
|
return t.forEach((e, t) => {
|
|
538
|
-
n.has(e.id) &&
|
|
538
|
+
n.has(e.id) && Z(`annotations[${t}].id must be unique`), n.add(e.id);
|
|
539
539
|
}), t;
|
|
540
540
|
}
|
|
541
541
|
function Ue(e) {
|
|
542
542
|
return JSON.stringify({
|
|
543
|
-
version:
|
|
543
|
+
version: Fe,
|
|
544
544
|
annotations: He(e)
|
|
545
545
|
}, null, 2);
|
|
546
546
|
}
|
|
547
547
|
function We(e) {
|
|
548
|
-
typeof e != "string" &&
|
|
548
|
+
typeof e != "string" && Z("input must be a JSON string");
|
|
549
549
|
let t;
|
|
550
550
|
try {
|
|
551
551
|
t = JSON.parse(e);
|
|
552
552
|
} catch {
|
|
553
|
-
|
|
553
|
+
Z("input is not valid JSON");
|
|
554
554
|
}
|
|
555
|
-
return
|
|
555
|
+
return Ie(t) || Z("root must be an object"), t.version !== Fe && Z(`version must be ${Fe}`), Array.isArray(t.annotations) || Z("annotations must be an array"), He(t.annotations);
|
|
556
556
|
}
|
|
557
557
|
//#endregion
|
|
558
558
|
//#region src/components/annotation/useWaveformAnnotationInteraction.ts
|
|
@@ -625,67 +625,69 @@ function Ke(e, t = 5, n) {
|
|
|
625
625
|
}
|
|
626
626
|
//#endregion
|
|
627
627
|
//#region src/utils/formatters.ts
|
|
628
|
-
var qe = .001, Je = 1e3, Ye = new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 4 }), Xe = new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 4 })
|
|
629
|
-
|
|
630
|
-
useGrouping: !1
|
|
631
|
-
});
|
|
632
|
-
function Qe(e, t) {
|
|
628
|
+
var qe = .001, Je = 1e3, Ye = new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 4 }), Xe = new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 4 });
|
|
629
|
+
function Ze(e, t) {
|
|
633
630
|
let n = e.toFixed(Math.max(0, t));
|
|
634
631
|
return /^-0(?:\.0+)?$/.test(n) ? n.slice(1) : n;
|
|
635
632
|
}
|
|
636
|
-
function
|
|
633
|
+
function Qe(e) {
|
|
637
634
|
return Number.isFinite(e) && (e >= Je || e > 0 && e < qe);
|
|
638
635
|
}
|
|
639
|
-
function
|
|
636
|
+
function $e(e, t) {
|
|
640
637
|
if (typeof e != "number" || typeof t != "number") return null;
|
|
641
638
|
let n = Math.abs(Math.max(e, t));
|
|
642
|
-
return
|
|
639
|
+
return Qe(n) ? Math.floor(Math.log10(n)) : null;
|
|
643
640
|
}
|
|
644
|
-
function
|
|
641
|
+
function et(e) {
|
|
645
642
|
return `E${e >= 0 ? "+" : "-"}${Math.abs(e).toString().padStart(2, "0")}`;
|
|
646
643
|
}
|
|
647
|
-
function
|
|
644
|
+
function tt(e) {
|
|
648
645
|
if (Object.is(e, -0)) return "0";
|
|
649
646
|
let t = e === 0 ? 0 : Number(e.toPrecision(5)), n = Ye.format(t);
|
|
650
647
|
return n === "-0" ? "0" : n;
|
|
651
648
|
}
|
|
652
|
-
function
|
|
649
|
+
function nt(e, t = {}) {
|
|
653
650
|
if (!Number.isFinite(e)) return String(e);
|
|
654
|
-
let n =
|
|
655
|
-
return n !== null && e === i ? `${
|
|
651
|
+
let n = $e(t.axisMin, t.axisMax), r = tt(n === null ? e : e / 10 ** n), i = t.topTickValue ?? t.axisMax;
|
|
652
|
+
return n !== null && e === i ? `${et(n)} ${r}` : r;
|
|
656
653
|
}
|
|
657
|
-
function
|
|
654
|
+
function rt(e) {
|
|
658
655
|
return Number.isFinite(e) ? Object.is(e, -0) ? "0" : Xe.format(e) : String(e);
|
|
659
656
|
}
|
|
660
|
-
function
|
|
661
|
-
if (!Number.isFinite(e)) return String(e);
|
|
662
|
-
let t = Ze.format(e);
|
|
663
|
-
return t === "-0" ? "0" : t;
|
|
664
|
-
}
|
|
665
|
-
function ot(e) {
|
|
657
|
+
function it(e) {
|
|
666
658
|
if (!Number.isFinite(e)) return String(e);
|
|
667
659
|
if (Object.is(e, -0)) return "0";
|
|
668
660
|
let [t, n] = e.toExponential().split("e"), r = Number(n), i = t.startsWith("-"), a = t.replace("-", "").replace(".", ""), o = r + 1, s;
|
|
669
661
|
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}`;
|
|
670
662
|
}
|
|
671
|
-
function
|
|
663
|
+
function at(e, t) {
|
|
672
664
|
return t === "ms" ? e * 1e3 : e;
|
|
673
665
|
}
|
|
666
|
+
function ot(e, t, n, r, i) {
|
|
667
|
+
let a = at(e, n);
|
|
668
|
+
return i ? i(a, {
|
|
669
|
+
kind: r,
|
|
670
|
+
rawValue: e,
|
|
671
|
+
timeUnit: n,
|
|
672
|
+
domain: [t[0], t[1]],
|
|
673
|
+
displayDomain: [at(t[0], n), at(t[1], n)]
|
|
674
|
+
}) : it(a);
|
|
675
|
+
}
|
|
676
|
+
function st(e, t, n) {
|
|
677
|
+
return ot(e, t, n, "end");
|
|
678
|
+
}
|
|
674
679
|
function ct(e, t, n) {
|
|
675
|
-
return
|
|
680
|
+
return ot(e, n ?? [e, e], t, "tick");
|
|
676
681
|
}
|
|
677
|
-
function lt(e, t
|
|
678
|
-
return at(
|
|
682
|
+
function lt(e, t) {
|
|
683
|
+
return rt(at(e, t));
|
|
679
684
|
}
|
|
680
685
|
function ut(e, t) {
|
|
681
|
-
return
|
|
682
|
-
}
|
|
683
|
-
function dt(e, t) {
|
|
684
|
-
return Number.isFinite(e) ? Qe(st(e, t), 3) : String(e);
|
|
686
|
+
return Number.isFinite(e) ? Ze(at(e, t), 3) : String(e);
|
|
685
687
|
}
|
|
686
688
|
//#endregion
|
|
687
689
|
//#region src/utils/geometry.ts
|
|
688
|
-
function
|
|
690
|
+
function dt(e, t, n) {
|
|
689
691
|
if (e <= 0) return {
|
|
690
692
|
gap: 0,
|
|
691
693
|
axisBand: 0,
|
|
@@ -698,20 +700,20 @@ function ft(e, t, n) {
|
|
|
698
700
|
height: Math.max(1, (n - (e - 1) * (c + l)) / e)
|
|
699
701
|
};
|
|
700
702
|
}
|
|
701
|
-
function
|
|
703
|
+
function ft(e, t, n) {
|
|
702
704
|
return Math.min(Math.max(e, t), n);
|
|
703
705
|
}
|
|
704
706
|
//#endregion
|
|
705
707
|
//#region src/components/core/constants.ts
|
|
706
|
-
var
|
|
708
|
+
var pt = {
|
|
707
709
|
top: 18,
|
|
708
710
|
right: 24,
|
|
709
711
|
bottom: 52,
|
|
710
712
|
left: 64
|
|
711
|
-
},
|
|
713
|
+
}, mt = {
|
|
712
714
|
DEFAULT_MAX_SCALE: 40,
|
|
713
715
|
MIN_SCALE: 1
|
|
714
|
-
},
|
|
716
|
+
}, ht = .62, gt = 1.2, _t = [
|
|
715
717
|
"#0960bd",
|
|
716
718
|
"#ff7f0e",
|
|
717
719
|
"#389e0d",
|
|
@@ -722,42 +724,42 @@ var mt = {
|
|
|
722
724
|
"#434343",
|
|
723
725
|
"#7cb305",
|
|
724
726
|
"#1d39c4"
|
|
725
|
-
],
|
|
727
|
+
], vt = {
|
|
726
728
|
WIDTH: 1.5,
|
|
727
729
|
CAP_WIDTH: 8
|
|
728
|
-
},
|
|
730
|
+
}, yt = {
|
|
729
731
|
COLOR: "#98a2b3",
|
|
730
732
|
WIDTH: 1,
|
|
731
733
|
DASH: "6 4"
|
|
732
734
|
};
|
|
733
735
|
//#endregion
|
|
734
736
|
//#region src/components/core/yDomain.ts
|
|
735
|
-
function
|
|
737
|
+
function bt(e) {
|
|
736
738
|
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]];
|
|
737
739
|
}
|
|
738
|
-
function
|
|
739
|
-
return
|
|
740
|
+
function xt(e, t) {
|
|
741
|
+
return bt(t?.[e.id]);
|
|
740
742
|
}
|
|
741
|
-
function
|
|
742
|
-
return
|
|
743
|
+
function St(e, t, n) {
|
|
744
|
+
return bt(n?.[e.id]) ?? bt(t);
|
|
743
745
|
}
|
|
744
|
-
function
|
|
745
|
-
return !!(
|
|
746
|
+
function Ct(e, t, n) {
|
|
747
|
+
return !!(xt(e, n) || e.visibleSeries.some((e) => St(e, t, n)));
|
|
746
748
|
}
|
|
747
|
-
function
|
|
749
|
+
function wt(e) {
|
|
748
750
|
return [Math.min(...e.map((e) => e[0])), Math.max(...e.map((e) => e[1]))];
|
|
749
751
|
}
|
|
750
752
|
//#endregion
|
|
751
753
|
//#region src/core/data.ts
|
|
752
|
-
var
|
|
753
|
-
function
|
|
754
|
+
var Tt = vt.WIDTH, Et = vt.CAP_WIDTH;
|
|
755
|
+
function Dt(e) {
|
|
754
756
|
return e === "dashed" || e === "dash-dot" ? e : "solid";
|
|
755
757
|
}
|
|
756
|
-
function
|
|
758
|
+
function Ot(e) {
|
|
757
759
|
return typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : void 0;
|
|
758
760
|
}
|
|
759
|
-
function
|
|
760
|
-
let t =
|
|
761
|
+
function kt(e) {
|
|
762
|
+
let t = Ot(e.error), n = Ot(e.lowerError), r = Ot(e.upperError);
|
|
761
763
|
return {
|
|
762
764
|
x: e.x,
|
|
763
765
|
y: e.y,
|
|
@@ -766,14 +768,14 @@ function At(e) {
|
|
|
766
768
|
...r === void 0 ? {} : { upperError: r }
|
|
767
769
|
};
|
|
768
770
|
}
|
|
769
|
-
function
|
|
770
|
-
let t =
|
|
771
|
+
function At(e) {
|
|
772
|
+
let t = Ot(e.error) ?? 0;
|
|
771
773
|
return {
|
|
772
|
-
lower:
|
|
773
|
-
upper:
|
|
774
|
+
lower: Ot(e.lowerError) ?? t,
|
|
775
|
+
upper: Ot(e.upperError) ?? t
|
|
774
776
|
};
|
|
775
777
|
}
|
|
776
|
-
function
|
|
778
|
+
function jt(e) {
|
|
777
779
|
if (e.kind === "samples") {
|
|
778
780
|
if (!Number.isFinite(e.sampleRate) || e.sampleRate <= 0) return [];
|
|
779
781
|
let t = Number.isFinite(e.startTime) ? e.startTime ?? 0 : 0, n = [];
|
|
@@ -789,14 +791,14 @@ function Mt(e) {
|
|
|
789
791
|
let t = [], n = -Infinity, r = !0;
|
|
790
792
|
for (let i of e.points) {
|
|
791
793
|
if (!Number.isFinite(i.x) || !Number.isFinite(i.y)) continue;
|
|
792
|
-
let e =
|
|
794
|
+
let e = kt(i);
|
|
793
795
|
e.x < n && (r = !1), n = e.x, t.push(e);
|
|
794
796
|
}
|
|
795
797
|
return r || t.sort((e, t) => e.x - t.x), t;
|
|
796
798
|
}
|
|
797
|
-
function
|
|
799
|
+
function Mt(e) {
|
|
798
800
|
if (e.kind !== "series") {
|
|
799
|
-
let t =
|
|
801
|
+
let t = jt(e);
|
|
800
802
|
return t.length > 0 ? [{
|
|
801
803
|
id: "series-0",
|
|
802
804
|
name: "",
|
|
@@ -805,8 +807,8 @@ function Nt(e) {
|
|
|
805
807
|
pointType: "none",
|
|
806
808
|
errorBar: {
|
|
807
809
|
visible: !1,
|
|
808
|
-
width:
|
|
809
|
-
capWidth:
|
|
810
|
+
width: Tt,
|
|
811
|
+
capWidth: Et
|
|
810
812
|
},
|
|
811
813
|
points: t
|
|
812
814
|
}] : [];
|
|
@@ -816,7 +818,7 @@ function Nt(e) {
|
|
|
816
818
|
let r = e.id?.trim() || `series-${n}`, i = r, a = 1;
|
|
817
819
|
for (; t.has(i);) i = `${r}-${a}`, a++;
|
|
818
820
|
t.add(i);
|
|
819
|
-
let o = e.lineType ?? "linear", s =
|
|
821
|
+
let o = e.lineType ?? "linear", s = Dt(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);
|
|
820
822
|
return {
|
|
821
823
|
id: i,
|
|
822
824
|
trackId: e.trackId?.trim() || void 0,
|
|
@@ -829,55 +831,55 @@ function Nt(e) {
|
|
|
829
831
|
errorBar: {
|
|
830
832
|
visible: l,
|
|
831
833
|
color: e.errorBar?.color,
|
|
832
|
-
width: Number.isFinite(d) && d > 0 ? d :
|
|
833
|
-
capWidth: Number.isFinite(f) && f > 0 ? f :
|
|
834
|
+
width: Number.isFinite(d) && d > 0 ? d : Tt,
|
|
835
|
+
capWidth: Number.isFinite(f) && f > 0 ? f : Et
|
|
834
836
|
},
|
|
835
|
-
points:
|
|
837
|
+
points: jt(e.data)
|
|
836
838
|
};
|
|
837
839
|
}).filter((e) => e.points.length > 0);
|
|
838
840
|
}
|
|
839
841
|
//#endregion
|
|
840
842
|
//#region src/core/renderingOptions.ts
|
|
841
|
-
var
|
|
843
|
+
var Nt = {
|
|
842
844
|
downsample: !0,
|
|
843
845
|
downsampleThreshold: 2e3,
|
|
844
846
|
maxPointsPerPixel: 4,
|
|
845
847
|
pointMinSpacing: 10,
|
|
846
848
|
errorBarMinSpacing: 12
|
|
847
849
|
};
|
|
848
|
-
function
|
|
850
|
+
function Pt(e) {
|
|
849
851
|
let t = Number(e?.downsampleThreshold), n = Number(e?.maxPointsPerPixel), r = Number(e?.pointMinSpacing), i = Number(e?.errorBarMinSpacing);
|
|
850
852
|
return {
|
|
851
|
-
downsample: e?.downsample ??
|
|
852
|
-
downsampleThreshold: Number.isFinite(t) && t >= 2 ? Math.floor(t) :
|
|
853
|
-
maxPointsPerPixel: Number.isFinite(n) && n > 0 ? n :
|
|
854
|
-
pointMinSpacing: Number.isFinite(r) && r >= 0 ? r :
|
|
855
|
-
errorBarMinSpacing: Number.isFinite(i) && i >= 0 ? i :
|
|
853
|
+
downsample: e?.downsample ?? Nt.downsample,
|
|
854
|
+
downsampleThreshold: Number.isFinite(t) && t >= 2 ? Math.floor(t) : Nt.downsampleThreshold,
|
|
855
|
+
maxPointsPerPixel: Number.isFinite(n) && n > 0 ? n : Nt.maxPointsPerPixel,
|
|
856
|
+
pointMinSpacing: Number.isFinite(r) && r >= 0 ? r : Nt.pointMinSpacing,
|
|
857
|
+
errorBarMinSpacing: Number.isFinite(i) && i >= 0 ? i : Nt.errorBarMinSpacing
|
|
856
858
|
};
|
|
857
859
|
}
|
|
858
860
|
//#endregion
|
|
859
861
|
//#region src/core/rendering.ts
|
|
860
|
-
var
|
|
861
|
-
function
|
|
862
|
+
var Ft = N((e) => e.x), It = () => !0;
|
|
863
|
+
function Lt(e, t) {
|
|
862
864
|
let n = Math.min(t[0], t[1]), r = Math.max(t[0], t[1]);
|
|
863
865
|
return {
|
|
864
|
-
start:
|
|
865
|
-
end:
|
|
866
|
+
start: Ft.left(e, n),
|
|
867
|
+
end: Ft.right(e, r)
|
|
866
868
|
};
|
|
867
869
|
}
|
|
868
|
-
function
|
|
870
|
+
function Rt(e, t, n) {
|
|
869
871
|
if (!Number.isFinite(n) || n <= 0) return !0;
|
|
870
872
|
let r = Math.ceil(n), i = /* @__PURE__ */ new Set();
|
|
871
873
|
for (let n of e) {
|
|
872
|
-
let e =
|
|
874
|
+
let e = Lt(n.points, t);
|
|
873
875
|
for (let t = e.start; t < e.end; t += 1) if (i.add(n.points[t].x), i.size >= r) return !0;
|
|
874
876
|
}
|
|
875
877
|
return !1;
|
|
876
878
|
}
|
|
877
|
-
function
|
|
879
|
+
function zt(e, t) {
|
|
878
880
|
t && e[e.length - 1] !== t && e.push(t);
|
|
879
881
|
}
|
|
880
|
-
function
|
|
882
|
+
function Bt(e, t, n, r, i) {
|
|
881
883
|
let a = Math.min(n[0], n[1]), o = Math.max(n[0], n[1]), s = Math.max(0, t.start - 1), c = Math.min(e.length, t.end + 1), l = c - s;
|
|
882
884
|
if (l <= 0) return [];
|
|
883
885
|
if (!i.downsample || l <= i.downsampleThreshold) return e.slice(s, c);
|
|
@@ -896,9 +898,9 @@ function Vt(e, t, n, r, i) {
|
|
|
896
898
|
for (; n >= 0 && m[n] > t;) m[n + 1] = m[n], --n;
|
|
897
899
|
m[n + 1] = t;
|
|
898
900
|
}
|
|
899
|
-
for (let n = 0; n < t; n += 1)
|
|
901
|
+
for (let n = 0; n < t; n += 1) zt(f, e[m[n]]);
|
|
900
902
|
};
|
|
901
|
-
|
|
903
|
+
zt(f, e[s]);
|
|
902
904
|
for (let n = t.start; n < t.end; n += 1) {
|
|
903
905
|
let t = e[n], r = Math.min(d - 1, Math.max(0, Math.floor((t.x - a) / p * d)));
|
|
904
906
|
if (r !== h) {
|
|
@@ -907,14 +909,14 @@ function Vt(e, t, n, r, i) {
|
|
|
907
909
|
}
|
|
908
910
|
_ = n, t.y < e[v].y && (v = n), t.y > e[y].y && (y = n);
|
|
909
911
|
}
|
|
910
|
-
return x(),
|
|
912
|
+
return x(), zt(f, e[c - 1]), f;
|
|
911
913
|
}
|
|
912
|
-
function
|
|
913
|
-
return !e.length || n <= 0 ? [] :
|
|
914
|
+
function Vt(e, t, n, r) {
|
|
915
|
+
return !e.length || n <= 0 ? [] : Bt(e, Lt(e, t), t, n, r);
|
|
914
916
|
}
|
|
915
|
-
function
|
|
917
|
+
function Ht(e, t, n, r, i, a, o, s) {
|
|
916
918
|
if (!a || i === 0) {
|
|
917
|
-
if (o ===
|
|
919
|
+
if (o === It) return e.slice(t.start, t.end);
|
|
918
920
|
let n = [];
|
|
919
921
|
for (let r = t.start; r < t.end; r += 1) o(e[r]) && n.push(e[r]);
|
|
920
922
|
return n;
|
|
@@ -947,36 +949,36 @@ function Ut(e, t, n, r, i, a, o, s) {
|
|
|
947
949
|
let w = (f ?? []).map((e, t) => m?.[t] ?? e).filter((e) => e !== void 0);
|
|
948
950
|
return v && w[0] !== v && w.unshift(v), y && w.at(-1) !== y && w.push(y), w;
|
|
949
951
|
}
|
|
950
|
-
function
|
|
951
|
-
let { lower: t, upper: n } =
|
|
952
|
+
function Ut(e) {
|
|
953
|
+
let { lower: t, upper: n } = At(e);
|
|
952
954
|
return t !== 0 || n !== 0;
|
|
953
955
|
}
|
|
954
|
-
function
|
|
956
|
+
function Wt(e, t, n, r, i) {
|
|
955
957
|
if (!e.length || n <= 0) return {
|
|
956
958
|
linePoints: [],
|
|
957
959
|
pointRenderPoints: [],
|
|
958
960
|
errorBarRenderPoints: []
|
|
959
961
|
};
|
|
960
|
-
let a =
|
|
962
|
+
let a = Lt(e, t), o = i.lineVisible ? Bt(e, a, t, n, r) : [], s = i.errorBarVisible && i.hasErrorPoints;
|
|
961
963
|
if (i.pointVisible && s) {
|
|
962
|
-
let i =
|
|
964
|
+
let i = Ht(e, a, t, n, Math.max(r.pointMinSpacing, r.errorBarMinSpacing), r.downsample, It, Ut);
|
|
963
965
|
return {
|
|
964
966
|
linePoints: o,
|
|
965
967
|
pointRenderPoints: i,
|
|
966
|
-
errorBarRenderPoints: i.filter(
|
|
968
|
+
errorBarRenderPoints: i.filter(Ut)
|
|
967
969
|
};
|
|
968
970
|
}
|
|
969
971
|
return {
|
|
970
972
|
linePoints: o,
|
|
971
|
-
pointRenderPoints: i.pointVisible ?
|
|
972
|
-
errorBarRenderPoints: s ?
|
|
973
|
+
pointRenderPoints: i.pointVisible ? Ht(e, a, t, n, r.pointMinSpacing, r.downsample, It) : [],
|
|
974
|
+
errorBarRenderPoints: s ? Ht(e, a, t, n, r.errorBarMinSpacing, r.downsample, Ut) : []
|
|
973
975
|
};
|
|
974
976
|
}
|
|
975
|
-
var
|
|
977
|
+
var Gt = (e, t) => {
|
|
976
978
|
let n = typeof e == "number" ? e : Number(e);
|
|
977
979
|
return Number.isFinite(n) ? Math.min(10, Math.max(1, Math.floor(n))) : t;
|
|
978
980
|
};
|
|
979
|
-
function
|
|
981
|
+
function Kt(e) {
|
|
980
982
|
let t = Object.fromEntries(Object.entries(e?.trackLines ?? {}).map(([e, t]) => [e, {
|
|
981
983
|
horizontal: typeof t?.horizontal != "boolean" || t.horizontal,
|
|
982
984
|
vertical: typeof t?.vertical != "boolean" || t.vertical,
|
|
@@ -984,37 +986,37 @@ function qt(e) {
|
|
|
984
986
|
verticalColor: typeof t?.verticalColor == "string" && t.verticalColor.trim() ? t.verticalColor : void 0
|
|
985
987
|
}]));
|
|
986
988
|
return {
|
|
987
|
-
rowCount:
|
|
988
|
-
columnCount:
|
|
989
|
+
rowCount: Gt(e?.rowCount, 2),
|
|
990
|
+
columnCount: Gt(e?.columnCount, 1),
|
|
989
991
|
showPagination: e?.showPagination ?? !0,
|
|
990
992
|
trackLines: t
|
|
991
993
|
};
|
|
992
994
|
}
|
|
993
|
-
function
|
|
995
|
+
function qt(e) {
|
|
994
996
|
return e.rowCount * e.columnCount;
|
|
995
997
|
}
|
|
996
|
-
function
|
|
997
|
-
return Math.max(1, Math.ceil(Math.max(0, e) /
|
|
998
|
+
function Jt(e, t) {
|
|
999
|
+
return Math.max(1, Math.ceil(Math.max(0, e) / qt(t)));
|
|
998
1000
|
}
|
|
999
|
-
function
|
|
1000
|
-
let r =
|
|
1001
|
-
return e.slice(i, i +
|
|
1001
|
+
function Yt(e, t, n) {
|
|
1002
|
+
let r = Jt(e.length, n), i = (Math.min(r, Math.max(1, Math.floor(t))) - 1) * qt(n);
|
|
1003
|
+
return e.slice(i, i + qt(n));
|
|
1002
1004
|
}
|
|
1003
|
-
function
|
|
1005
|
+
function Xt(e) {
|
|
1004
1006
|
return e === "compact" ? 0 : e === "separated" ? 16 : 14;
|
|
1005
1007
|
}
|
|
1006
|
-
function
|
|
1007
|
-
let s =
|
|
1008
|
+
function Zt(e, t, n, r, i = [], a, o = !0) {
|
|
1009
|
+
let s = Xt(r), c = Number.isFinite(a) ? Math.max(0, a) : s, l = Math.max(0, n.columnCount - 1) * c, u = /* @__PURE__ */ new Set();
|
|
1008
1010
|
if (o) {
|
|
1009
1011
|
if (r === "independent") for (let e = 0; e < n.rowCount; e += 1) u.add(e);
|
|
1010
1012
|
else if (r === "compact") u.add(n.rowCount - 1);
|
|
1011
|
-
else for (let e = 0; e < n.columnCount; e += 1) for (let t =
|
|
1013
|
+
else for (let e = 0; e < n.columnCount; e += 1) for (let t = qt(n) - 1; t >= 0; --t) if (t % n.columnCount === e && i[t]) {
|
|
1012
1014
|
u.add(Math.floor(t / n.columnCount));
|
|
1013
1015
|
break;
|
|
1014
1016
|
}
|
|
1015
1017
|
}
|
|
1016
1018
|
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);
|
|
1017
|
-
return Array.from({ length:
|
|
1019
|
+
return Array.from({ length: qt(n) }, (e, t) => {
|
|
1018
1020
|
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) => {
|
|
1019
1021
|
let n = u.has(t) ? 30 : 0;
|
|
1020
1022
|
return m + n + s;
|
|
@@ -1033,7 +1035,7 @@ function Qt(e, t, n, r, i = [], a, o = !0) {
|
|
|
1033
1035
|
};
|
|
1034
1036
|
});
|
|
1035
1037
|
}
|
|
1036
|
-
function
|
|
1038
|
+
function Qt(e, t) {
|
|
1037
1039
|
let n = /* @__PURE__ */ new Set();
|
|
1038
1040
|
for (let r = 0; r < t; r += 1) for (let t = e.length - 1; t >= 0; --t) {
|
|
1039
1041
|
let i = e[t];
|
|
@@ -1046,11 +1048,11 @@ function $t(e, t) {
|
|
|
1046
1048
|
}
|
|
1047
1049
|
//#endregion
|
|
1048
1050
|
//#region src/components/core/trackLayoutBuilder.ts
|
|
1049
|
-
function
|
|
1051
|
+
function $t(e) {
|
|
1050
1052
|
let t = e.cells.map((e) => ({
|
|
1051
1053
|
...e,
|
|
1052
1054
|
hasSeries: !!e.series
|
|
1053
|
-
})), n =
|
|
1055
|
+
})), n = Qt(t, e.grid.columnCount);
|
|
1054
1056
|
return t.flatMap((t, r) => {
|
|
1055
1057
|
let i = !t.series;
|
|
1056
1058
|
if (i && (e.displayMode !== "compact" || !e.showCompactEmptyTracks)) return [];
|
|
@@ -1076,7 +1078,7 @@ function en(e) {
|
|
|
1076
1078
|
visibleSeries: [a],
|
|
1077
1079
|
xDomain: a.xDomain,
|
|
1078
1080
|
yDomain: a.yDomain
|
|
1079
|
-
}, s = !i && o.visibleSeries.length > 0, c = o.visibleSeries[0] ?? o.series[0] ?? a, l = e.displayMode === "independent" ? B(e.initialXDomains?.[o.id] ?? e.initialXDomains?.[c.id] ?? e.initialXDomain ?? o.xDomain, [0, t.width]) : B(e.sharedZoomDomain, [0, t.width]), u = (e.displayMode === "independent" ? e.independentTransforms[r] ?? U : U).rescaleX(l), d = e.yDomains?.[o.id], f =
|
|
1081
|
+
}, s = !i && o.visibleSeries.length > 0, c = o.visibleSeries[0] ?? o.series[0] ?? a, l = e.displayMode === "independent" ? B(e.initialXDomains?.[o.id] ?? e.initialXDomains?.[c.id] ?? e.initialXDomain ?? o.xDomain, [0, t.width]) : B(e.sharedZoomDomain, [0, t.width]), u = (e.displayMode === "independent" ? e.independentTransforms[r] ?? U : U).rescaleX(l), d = e.yDomains?.[o.id], f = ln(o, e.overlayMode, e.fixedYDomain, e.fixedYDomains).map((e) => !e.fixed && d ? {
|
|
1080
1082
|
...e,
|
|
1081
1083
|
domain: d
|
|
1082
1084
|
} : e), p = {
|
|
@@ -1089,7 +1091,7 @@ function en(e) {
|
|
|
1089
1091
|
a,
|
|
1090
1092
|
...c,
|
|
1091
1093
|
...s ? [o] : []
|
|
1092
|
-
])), { tickTextWidth: u } =
|
|
1094
|
+
])), { tickTextWidth: u } = un(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);
|
|
1093
1095
|
return p[n.side] += d, {
|
|
1094
1096
|
index: n.index,
|
|
1095
1097
|
side: n.side,
|
|
@@ -1102,13 +1104,13 @@ function en(e) {
|
|
|
1102
1104
|
seriesList: n.seriesList
|
|
1103
1105
|
};
|
|
1104
1106
|
}), h = m[0]?.scale ?? B(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 = {
|
|
1105
|
-
start:
|
|
1106
|
-
end:
|
|
1107
|
+
start: ot(y[0], y, e.timeUnit, "start", e.xAxisLabelFormatter),
|
|
1108
|
+
end: ot(y[1], y, e.timeUnit, "end", e.xAxisLabelFormatter)
|
|
1107
1109
|
}, x = b.start.length * 7 + 10, S = b.end.length * 7 + 10, C = g.filter((e) => {
|
|
1108
1110
|
let n = u(e);
|
|
1109
1111
|
return n > x && n < t.width - S;
|
|
1110
1112
|
}), w = o.visibleSeries.map((n) => {
|
|
1111
|
-
let r = m.find((e) => e.seriesList.some((e) => e.id === n.id)), a = r?.scale ?? h, o =
|
|
1113
|
+
let r = m.find((e) => e.seriesList.some((e) => e.id === n.id)), a = r?.scale ?? h, o = Wt(n.points, y, t.width, e.rendering, {
|
|
1112
1114
|
lineVisible: !i && n.lineType !== "none",
|
|
1113
1115
|
pointVisible: n.pointType !== "none",
|
|
1114
1116
|
errorBarVisible: n.errorBar.visible,
|
|
@@ -1160,8 +1162,8 @@ function en(e) {
|
|
|
1160
1162
|
}
|
|
1161
1163
|
//#endregion
|
|
1162
1164
|
//#region src/components/core/layout.ts
|
|
1163
|
-
var
|
|
1164
|
-
function
|
|
1165
|
+
var en = 7, tn = 7, nn = 4, rn = 6, an = 24;
|
|
1166
|
+
function on(e) {
|
|
1165
1167
|
return e >= 4 ? [
|
|
1166
1168
|
"left",
|
|
1167
1169
|
"left",
|
|
@@ -1173,13 +1175,13 @@ function sn(e) {
|
|
|
1173
1175
|
"right"
|
|
1174
1176
|
] : e === 2 ? ["left", "right"] : ["left"];
|
|
1175
1177
|
}
|
|
1176
|
-
var
|
|
1177
|
-
function
|
|
1178
|
-
let n =
|
|
1179
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
1178
|
+
var sn = /* @__PURE__ */ new WeakMap();
|
|
1179
|
+
function cn(e, t) {
|
|
1180
|
+
let n = sn.get(e);
|
|
1181
|
+
n || (n = /* @__PURE__ */ new Map(), sn.set(e, n));
|
|
1180
1182
|
let r = n.get(t);
|
|
1181
1183
|
if (r) return r;
|
|
1182
|
-
let i = t === "multi-axis" ? Math.min(e.visibleSeries.length, 4) : Math.min(e.visibleSeries.length, 1), a =
|
|
1184
|
+
let i = t === "multi-axis" ? Math.min(e.visibleSeries.length, 4) : Math.min(e.visibleSeries.length, 1), a = on(i), o = Array.from({ length: i }, (e, t) => ({
|
|
1183
1185
|
index: t,
|
|
1184
1186
|
side: a[t],
|
|
1185
1187
|
seriesList: [],
|
|
@@ -1196,23 +1198,23 @@ function ln(e, t) {
|
|
|
1196
1198
|
}
|
|
1197
1199
|
}), n.set(t, o), o;
|
|
1198
1200
|
}
|
|
1199
|
-
function
|
|
1200
|
-
let i =
|
|
1201
|
-
return
|
|
1201
|
+
function ln(e, t, n, r) {
|
|
1202
|
+
let i = xt(e, r);
|
|
1203
|
+
return cn(e, t).map((e) => {
|
|
1202
1204
|
if (i) return {
|
|
1203
1205
|
...e,
|
|
1204
1206
|
domain: i,
|
|
1205
1207
|
fixed: !0
|
|
1206
1208
|
};
|
|
1207
|
-
let t = e.seriesList.map((e) =>
|
|
1209
|
+
let t = e.seriesList.map((e) => St(e, n, r) ?? e.yDomain), a = e.seriesList.some((e) => St(e, n, r));
|
|
1208
1210
|
return a ? {
|
|
1209
1211
|
...e,
|
|
1210
|
-
domain:
|
|
1212
|
+
domain: wt(t),
|
|
1211
1213
|
fixed: a
|
|
1212
1214
|
} : e;
|
|
1213
1215
|
});
|
|
1214
1216
|
}
|
|
1215
|
-
function
|
|
1217
|
+
function un(e, t = !0, n) {
|
|
1216
1218
|
let r = B(e, [1, 0]);
|
|
1217
1219
|
t && r.nice();
|
|
1218
1220
|
let [i, a] = r.domain(), o = n ?? Array.from(/* @__PURE__ */ new Set([
|
|
@@ -1220,25 +1222,25 @@ function dn(e, t = !0, n) {
|
|
|
1220
1222
|
...r.ticks(10),
|
|
1221
1223
|
a
|
|
1222
1224
|
])), s = Math.max(...o);
|
|
1223
|
-
return { tickTextWidth: Math.max(1, ...o.map((e) =>
|
|
1225
|
+
return { tickTextWidth: Math.max(1, ...o.map((e) => nt(e, {
|
|
1224
1226
|
axisMin: i,
|
|
1225
1227
|
axisMax: a,
|
|
1226
1228
|
topTickValue: s
|
|
1227
|
-
}).length)) *
|
|
1229
|
+
}).length)) * en };
|
|
1228
1230
|
}
|
|
1229
|
-
function
|
|
1230
|
-
return
|
|
1231
|
+
function dn(e) {
|
|
1232
|
+
return un(e.domain, !e.fixed).tickTextWidth + tn + rn + an + nn;
|
|
1231
1233
|
}
|
|
1232
|
-
function
|
|
1233
|
-
return
|
|
1234
|
+
function fn(e) {
|
|
1235
|
+
return un(e.domain, !e.fixed).tickTextWidth + tn + nn;
|
|
1234
1236
|
}
|
|
1235
|
-
function
|
|
1236
|
-
return
|
|
1237
|
+
function pn(e, t, n, r) {
|
|
1238
|
+
return ln(e, t, n, r).reduce((n, r) => (n[r.side] += t === "multi-axis" || e.visibleSeries.length === 1 ? dn(r) : fn(r), n), {
|
|
1237
1239
|
left: 0,
|
|
1238
1240
|
right: 0
|
|
1239
1241
|
});
|
|
1240
1242
|
}
|
|
1241
|
-
function
|
|
1243
|
+
function mn(e, t, n) {
|
|
1242
1244
|
let r = (e) => {
|
|
1243
1245
|
let r = t < e.left ? e.left - t : t > e.left + e.width ? t - e.left - e.width : 0;
|
|
1244
1246
|
return n < e.top ? e.top - n : n > e.top + e.height ? n - (e.top + e.height) : r;
|
|
@@ -1257,11 +1259,11 @@ function hn(e, t, n) {
|
|
|
1257
1259
|
}
|
|
1258
1260
|
//#endregion
|
|
1259
1261
|
//#region src/components/annotation/useWaveformChartAnnotations.ts
|
|
1260
|
-
var
|
|
1261
|
-
function
|
|
1262
|
-
return
|
|
1262
|
+
var hn = 0;
|
|
1263
|
+
function gn() {
|
|
1264
|
+
return hn += 1, typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `annotation-${Date.now()}-${hn}`;
|
|
1263
1265
|
}
|
|
1264
|
-
function
|
|
1266
|
+
function _n(e) {
|
|
1265
1267
|
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: v, isPresentationMode: y } = e;
|
|
1266
1268
|
function b(e) {
|
|
1267
1269
|
if (!i.value.some((t) => t.id === e)) return;
|
|
@@ -1294,7 +1296,7 @@ function vn(e) {
|
|
|
1294
1296
|
};
|
|
1295
1297
|
}
|
|
1296
1298
|
function C(e, t, n) {
|
|
1297
|
-
s.openCreate(e,
|
|
1299
|
+
s.openCreate(e, gn, t), c.value = n;
|
|
1298
1300
|
let r = s.editorDraft.value, i = l.value.find((t) => t.index === e.trackIndex)?.seriesList.find((t) => t.id === e.seriesId);
|
|
1299
1301
|
r?.mode === "add" && (r.annotation.style = {
|
|
1300
1302
|
borderColor: i?.color || "#1677ff",
|
|
@@ -1304,7 +1306,7 @@ function vn(e) {
|
|
|
1304
1306
|
}
|
|
1305
1307
|
function w(e) {
|
|
1306
1308
|
if (y.value) return;
|
|
1307
|
-
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 ?
|
|
1309
|
+
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 ? be(i.points, t.annotation.x, i.lineType) : null;
|
|
1308
1310
|
!t || !n || !r || !a || (t.annotation = {
|
|
1309
1311
|
...t.annotation,
|
|
1310
1312
|
seriesId: e,
|
|
@@ -1323,7 +1325,7 @@ function vn(e) {
|
|
|
1323
1325
|
let e = l.value[n];
|
|
1324
1326
|
return e?.hasVisibleSeries ? e : void 0;
|
|
1325
1327
|
}
|
|
1326
|
-
return
|
|
1328
|
+
return mn(l.value.filter((e) => e.hasVisibleSeries), e, t);
|
|
1327
1329
|
}
|
|
1328
1330
|
function D(e, t) {
|
|
1329
1331
|
let n = e.currentTarget;
|
|
@@ -1332,7 +1334,7 @@ function vn(e) {
|
|
|
1332
1334
|
if (!o) return null;
|
|
1333
1335
|
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);
|
|
1334
1336
|
return {
|
|
1335
|
-
candidates:
|
|
1337
|
+
candidates: q(u(o), d, c, a),
|
|
1336
1338
|
editorAnchor: x(e, t)
|
|
1337
1339
|
};
|
|
1338
1340
|
}
|
|
@@ -1382,7 +1384,7 @@ function vn(e) {
|
|
|
1382
1384
|
let e = s.contextMenu.value, n = t.annotations.find((t) => t.id === e?.annotationId);
|
|
1383
1385
|
if (!n) return;
|
|
1384
1386
|
let r = l.value.find((e) => e.seriesList.some((e) => e.id === n.seriesId));
|
|
1385
|
-
c.value = r ?
|
|
1387
|
+
c.value = r ? q(u(r), n.x, r.xScale(n.x), r.top + d(r, n.seriesId)(n.y)) : [], s.openEdit(n, e?.editorAnchor ?? S(n));
|
|
1386
1388
|
}
|
|
1387
1389
|
function F() {
|
|
1388
1390
|
if (y.value) return;
|
|
@@ -1411,8 +1413,8 @@ function vn(e) {
|
|
|
1411
1413
|
}
|
|
1412
1414
|
//#endregion
|
|
1413
1415
|
//#region src/components/interaction/useWaveformHover.ts
|
|
1414
|
-
var
|
|
1415
|
-
function
|
|
1416
|
+
var vn = N((e) => e.x);
|
|
1417
|
+
function yn(e) {
|
|
1416
1418
|
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) => {
|
|
1417
1419
|
let r = n.points[t];
|
|
1418
1420
|
return r?.id === e.id && r.trackIndex === e.trackIndex && r.point === e.point;
|
|
@@ -1433,7 +1435,7 @@ function bn(e) {
|
|
|
1433
1435
|
r.value = !0, y();
|
|
1434
1436
|
}, C = (e = !1) => {
|
|
1435
1437
|
r.value = !e, y();
|
|
1436
|
-
}, w = () => r.value ? (r.value = !1, y(), !0) : !1, T = (e, t) => e.points[
|
|
1438
|
+
}, w = () => r.value ? (r.value = !1, y(), !0) : !1, T = (e, t) => e.points[vn.center(e.points, t)];
|
|
1437
1439
|
return {
|
|
1438
1440
|
cancelPendingHover: h,
|
|
1439
1441
|
clearHover: y,
|
|
@@ -1488,7 +1490,7 @@ function bn(e) {
|
|
|
1488
1490
|
}
|
|
1489
1491
|
//#endregion
|
|
1490
1492
|
//#region src/components/interaction/useWaveformViewport.ts
|
|
1491
|
-
function
|
|
1493
|
+
function bn(e) {
|
|
1492
1494
|
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: x, canZoomSharedTracks: S, configureZoom: C, cancelPendingZoom: w, clearHover: T, resolveTrackAtPointer: E } = e, D = t(() => {
|
|
1493
1495
|
let e = i.value;
|
|
1494
1496
|
if (!e) return null;
|
|
@@ -1550,7 +1552,7 @@ function xn(e) {
|
|
|
1550
1552
|
let y = e.independent ? [t] : o.value, x = { ...g.value }, S = { ...h.value };
|
|
1551
1553
|
y.forEach((t) => {
|
|
1552
1554
|
let r = s.value.find((e) => e.id === t.id);
|
|
1553
|
-
if (r &&
|
|
1555
|
+
if (r && Ct(r, n.yDomain, n.yDomains)) return;
|
|
1554
1556
|
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 = j([o[0] + d / a * l, o[1] + d / a * l], c);
|
|
1555
1557
|
e.independent ? x[t.index] = u : S[i] = u;
|
|
1556
1558
|
}), e.independent ? g.value = x : h.value = S, r("zoom-change", v);
|
|
@@ -1640,7 +1642,7 @@ function xn(e) {
|
|
|
1640
1642
|
}
|
|
1641
1643
|
//#endregion
|
|
1642
1644
|
//#region src/components/utils/useAnimationFrameThrottle.ts
|
|
1643
|
-
function
|
|
1645
|
+
function xn() {
|
|
1644
1646
|
let e = null, t = null;
|
|
1645
1647
|
function n(n) {
|
|
1646
1648
|
t = n, e === null && (e = requestAnimationFrame(() => {
|
|
@@ -1669,8 +1671,8 @@ function Sn() {
|
|
|
1669
1671
|
}
|
|
1670
1672
|
//#endregion
|
|
1671
1673
|
//#region src/components/interaction/useWaveformZoom.ts
|
|
1672
|
-
function
|
|
1673
|
-
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 =
|
|
1674
|
+
function Sn(e) {
|
|
1675
|
+
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 = xn(), 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) => {
|
|
1674
1676
|
y || m.value || (g(), b = e.transform, x = "wheel", O(), P());
|
|
1675
1677
|
}, A = (e, t) => {
|
|
1676
1678
|
y || m.value || (g(), C.set(t, e.transform), w.set(t, "wheel"), O(), P());
|
|
@@ -1757,16 +1759,16 @@ function Cn(e) {
|
|
|
1757
1759
|
F(), r.value?.querySelectorAll(".waveform-chart__overlay").forEach((e) => V(e).on(".zoom", null)), _.clear();
|
|
1758
1760
|
}, L = (e) => {
|
|
1759
1761
|
let n = t.minZoomSpan;
|
|
1760
|
-
if (!Number.isFinite(n) || (n ?? 0) <= 0) return
|
|
1762
|
+
if (!Number.isFinite(n) || (n ?? 0) <= 0) return mt.DEFAULT_MAX_SCALE;
|
|
1761
1763
|
let r = Math.abs(e[1] - e[0]);
|
|
1762
|
-
return !Number.isFinite(r) || r <= 0 ?
|
|
1763
|
-
}, R = (e) =>
|
|
1764
|
+
return !Number.isFinite(r) || r <= 0 ? mt.MIN_SCALE : Math.min(mt.DEFAULT_MAX_SCALE, Math.max(mt.MIN_SCALE, r / (n ?? r)));
|
|
1765
|
+
}, R = (e) => Rt(e.seriesList, e.xScale.domain(), Number(t.minVisiblePoints)), z = () => {
|
|
1764
1766
|
let e = s.value.filter((e) => e.hasVisibleSeries);
|
|
1765
1767
|
return e.length > 0 && e.every(R);
|
|
1766
1768
|
}, H = (e, t) => {
|
|
1767
1769
|
if (e.type !== "wheel") return !1;
|
|
1768
1770
|
let n = e.deltaY;
|
|
1769
|
-
return n < 0 ? t : n > 0 &&
|
|
1771
|
+
return n < 0 ? t : n > 0 && ae(e.currentTarget).k > mt.MIN_SCALE;
|
|
1770
1772
|
};
|
|
1771
1773
|
return {
|
|
1772
1774
|
cancelPendingZoom: F,
|
|
@@ -1803,13 +1805,13 @@ function Cn(e) {
|
|
|
1803
1805
|
}
|
|
1804
1806
|
//#endregion
|
|
1805
1807
|
//#region src/components/core/useWaveformChartLifecycle.ts
|
|
1806
|
-
function
|
|
1808
|
+
function Cn(e) {
|
|
1807
1809
|
return e instanceof Element && !!e.closest("button, input, select, textarea, [contenteditable]:not([contenteditable=\"false\"])");
|
|
1808
1810
|
}
|
|
1809
|
-
function
|
|
1811
|
+
function wn(e) {
|
|
1810
1812
|
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, innerWidth: w, innerHeight: T, activeInteractionMode: D, hiddenSeriesIdSet: O, internalHiddenSeriesIds: k, independentTransforms: A, independentYDomains: j, annotationInteraction: M, editorSeriesOptions: N, isPresentationMode: P, clearHover: F, cancelAnnotation: I, configureZoom: L, resetViewport: R, cancelViewportDrag: z, cancelPendingHover: B, clearZoomBindings: V } = e;
|
|
1811
1813
|
function H(e) {
|
|
1812
|
-
P.value || e.code !== "Space" || !t.pannable || !_.value ||
|
|
1814
|
+
P.value || e.code !== "Space" || !t.pannable || !_.value || Cn(e.target) || (g.value = !0, e.preventDefault());
|
|
1813
1815
|
}
|
|
1814
1816
|
function ee(e) {
|
|
1815
1817
|
e.code === "Space" && (g.value = !1);
|
|
@@ -1900,10 +1902,10 @@ function Tn(e) {
|
|
|
1900
1902
|
}
|
|
1901
1903
|
//#endregion
|
|
1902
1904
|
//#region src/components/core/useWaveformData.ts
|
|
1903
|
-
function
|
|
1905
|
+
function Tn(e, t = !1) {
|
|
1904
1906
|
let n = Infinity, r = -Infinity, i = Infinity, a = -Infinity, o = !1;
|
|
1905
1907
|
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) {
|
|
1906
|
-
let e =
|
|
1908
|
+
let e = At(s);
|
|
1907
1909
|
(e.lower !== 0 || e.upper !== 0) && (o = !0), i = Math.min(i, s.y - e.lower), a = Math.max(a, s.y + e.upper);
|
|
1908
1910
|
}
|
|
1909
1911
|
return {
|
|
@@ -1912,27 +1914,27 @@ function En(e, t = !1) {
|
|
|
1912
1914
|
hasErrorPoints: o
|
|
1913
1915
|
};
|
|
1914
1916
|
}
|
|
1915
|
-
function
|
|
1916
|
-
return
|
|
1917
|
-
let t =
|
|
1917
|
+
function En(e) {
|
|
1918
|
+
return Mt(e).map((e) => {
|
|
1919
|
+
let t = Tn(e.points, e.errorBar.visible);
|
|
1918
1920
|
return {
|
|
1919
1921
|
...e,
|
|
1920
1922
|
...t
|
|
1921
1923
|
};
|
|
1922
1924
|
});
|
|
1923
1925
|
}
|
|
1924
|
-
function
|
|
1925
|
-
let n = x(
|
|
1926
|
+
function Dn(e, t) {
|
|
1927
|
+
let n = x(En(e()));
|
|
1926
1928
|
return E(e, (e) => {
|
|
1927
|
-
n.value =
|
|
1929
|
+
n.value = En(e), t();
|
|
1928
1930
|
}), n;
|
|
1929
1931
|
}
|
|
1930
1932
|
//#endregion
|
|
1931
1933
|
//#region src/components/core/useWaveformLayout.ts
|
|
1932
|
-
function
|
|
1934
|
+
function On(e) {
|
|
1933
1935
|
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) => ({
|
|
1934
1936
|
...e,
|
|
1935
|
-
color: e.color ?? (t === 0 ? n.lineColor :
|
|
1937
|
+
color: e.color ?? (t === 0 ? n.lineColor : _t[t % _t.length])
|
|
1936
1938
|
}))), h = t(() => {
|
|
1937
1939
|
let e = /* @__PURE__ */ new Map();
|
|
1938
1940
|
return m.value.forEach((t) => {
|
|
@@ -1950,15 +1952,15 @@ function kn(e) {
|
|
|
1950
1952
|
yDomain: $(i)
|
|
1951
1953
|
};
|
|
1952
1954
|
});
|
|
1953
|
-
}), g = t(() =>
|
|
1954
|
-
let e = h.value.filter((e) => e.visibleSeries.length > 0).flatMap((e) =>
|
|
1955
|
+
}), g = t(() => Kt(n.grid)), _ = t(() => Pt(n.rendering)), v = t(() => Jt(h.value.length, g.value)), y = t(() => Yt(h.value, i.value, g.value)), b = t(() => {
|
|
1956
|
+
let e = h.value.filter((e) => e.visibleSeries.length > 0).flatMap((e) => ln(e, n.overlayMode, n.yDomain, n.yDomains)).map((e) => un(e.domain, !e.fixed).tickTextWidth), t = Math.max(7, ...e), r = t + 7 + 4, i = -(7 + t + 6 + 24 / 2);
|
|
1955
1957
|
return {
|
|
1956
1958
|
tickClearance: r,
|
|
1957
1959
|
fullClearance: t + 7 + 6 + 24 + 4,
|
|
1958
1960
|
labelCenterX: i
|
|
1959
1961
|
};
|
|
1960
|
-
}), 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(
|
|
1961
|
-
let r =
|
|
1962
|
+
}), 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(pt.left, x.value ? b.value.fullClearance : S.value ? b.value.tickClearance : 0)), w = t(() => h.value.reduce((e, t) => {
|
|
1963
|
+
let r = pn(t, n.overlayMode, n.yDomain, n.yDomains);
|
|
1962
1964
|
return {
|
|
1963
1965
|
left: Math.max(e.left, r.left),
|
|
1964
1966
|
right: Math.max(e.right, r.right)
|
|
@@ -1966,8 +1968,8 @@ function kn(e) {
|
|
|
1966
1968
|
}, {
|
|
1967
1969
|
left: 0,
|
|
1968
1970
|
right: 0
|
|
1969
|
-
})), T = t(() => n.overlayMode === "multi-axis" ? Math.max(C.value, w.value.left) : C.value), E = t(() => n.overlayMode === "multi-axis" ? Math.max(
|
|
1970
|
-
let e =
|
|
1971
|
+
})), T = t(() => n.overlayMode === "multi-axis" ? Math.max(C.value, w.value.left) : C.value), E = t(() => n.overlayMode === "multi-axis" ? Math.max(pt.right, w.value.right) : pt.right), D = t(() => Math.max(0, o.value - T.value - E.value)), O = t(() => {
|
|
1972
|
+
let e = Xt(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;
|
|
1971
1973
|
return {
|
|
1972
1974
|
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,
|
|
1973
1975
|
hideSecondaryLabels: n.overlayMode !== "multi-axis" && r && x.value && !o
|
|
@@ -1983,10 +1985,10 @@ function kn(e) {
|
|
|
1983
1985
|
}), I = (e) => {
|
|
1984
1986
|
let t = n.initialXDomains?.[e.series.trackId ?? e.series.id] ?? n.initialXDomains?.[e.series.id] ?? n.initialXDomain;
|
|
1985
1987
|
return t && Number.isFinite(t[0]) && Number.isFinite(t[1]) && t[0] !== t[1] ? t[0] < t[1] ? t : [t[1], t[0]] : $(e.seriesList.flatMap((e) => e.xDomain));
|
|
1986
|
-
}, L = t(() => l.value.rescaleX(B(F.value, [0, D.value])).domain()), R = t(() =>
|
|
1988
|
+
}, L = t(() => l.value.rescaleX(B(F.value, [0, D.value])).domain()), R = t(() => Zt(D.value, s.value, g.value, n.displayMode, y.value.map(Boolean), O.value.horizontalGap).map((e, t) => ({
|
|
1987
1989
|
...e,
|
|
1988
1990
|
series: y.value[t]
|
|
1989
|
-
}))), z = t(() =>
|
|
1991
|
+
}))), z = t(() => $t({
|
|
1990
1992
|
cells: R.value,
|
|
1991
1993
|
grid: g.value,
|
|
1992
1994
|
displayMode: n.displayMode,
|
|
@@ -2002,6 +2004,7 @@ function kn(e) {
|
|
|
2002
2004
|
return n ? [[e.id, n]] : [];
|
|
2003
2005
|
})) : d.value,
|
|
2004
2006
|
timeUnit: n.timeUnit,
|
|
2007
|
+
xAxisLabelFormatter: n.axes?.x?.labelFormatter,
|
|
2005
2008
|
rendering: _.value,
|
|
2006
2009
|
hideSecondaryLabels: c.value || O.value.hideSecondaryLabels,
|
|
2007
2010
|
yAxisLabelX: b.value.labelCenterX,
|
|
@@ -2033,7 +2036,7 @@ function kn(e) {
|
|
|
2033
2036
|
annotationLayoutsForTrack: V,
|
|
2034
2037
|
resolveSeriesYScale: H,
|
|
2035
2038
|
annotationTrackLayouts: ee,
|
|
2036
|
-
renderedAnnotations: t(() => n.annotationsVisible ?
|
|
2039
|
+
renderedAnnotations: t(() => n.annotationsVisible ? ge(n.annotations, ee.value, D.value, s.value) : []),
|
|
2037
2040
|
xAxisTitleY: t(() => s.value + 30 + 10),
|
|
2038
2041
|
editorSeries: t(() => {
|
|
2039
2042
|
let e = p.editorDraft.value?.annotation.seriesId, t = m.value.find((t) => t.id === e);
|
|
@@ -2049,13 +2052,13 @@ function kn(e) {
|
|
|
2049
2052
|
}
|
|
2050
2053
|
};
|
|
2051
2054
|
}
|
|
2052
|
-
var
|
|
2053
|
-
function
|
|
2055
|
+
var kn = 1e-6;
|
|
2056
|
+
function An(e) {
|
|
2054
2057
|
return Number.isFinite(e) ? Math.max(1, e) : 1;
|
|
2055
2058
|
}
|
|
2056
|
-
function
|
|
2057
|
-
let i =
|
|
2058
|
-
if (!(d >
|
|
2059
|
+
function jn({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r }) {
|
|
2060
|
+
let i = An(e), a = An(t), o = An(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;
|
|
2061
|
+
if (!(d > kn && Math.abs(d - 360) > kn)) {
|
|
2059
2062
|
let e = Math.max(1, Math.ceil(i / o)), t = o, n = a * e;
|
|
2060
2063
|
return {
|
|
2061
2064
|
textWidth: t,
|
|
@@ -2080,7 +2083,7 @@ function Mn({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r
|
|
|
2080
2083
|
}
|
|
2081
2084
|
//#endregion
|
|
2082
2085
|
//#region src/components/core/useWaveformPresentation.ts
|
|
2083
|
-
function
|
|
2086
|
+
function Mn(e) {
|
|
2084
2087
|
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(() => ({
|
|
2085
2088
|
width: l.value === void 0 ? "100%" : `${l.value}px`,
|
|
2086
2089
|
height: u.value === void 0 ? "100%" : `${u.value}px`
|
|
@@ -2088,9 +2091,9 @@ function Nn(e) {
|
|
|
2088
2091
|
let e = n.zeroLine.width;
|
|
2089
2092
|
return {
|
|
2090
2093
|
visible: n.zeroLine.visible === !0,
|
|
2091
|
-
color: n.zeroLine.color ||
|
|
2092
|
-
width: typeof e == "number" && Number.isFinite(e) && e > 0 ? e :
|
|
2093
|
-
dash: n.zeroLine.dash ??
|
|
2094
|
+
color: n.zeroLine.color || yt.COLOR,
|
|
2095
|
+
width: typeof e == "number" && Number.isFinite(e) && e > 0 ? e : yt.WIDTH,
|
|
2096
|
+
dash: n.zeroLine.dash ?? yt.DASH
|
|
2094
2097
|
};
|
|
2095
2098
|
}), _ = 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) => {
|
|
2096
2099
|
let t = n.legend.orientation ?? "auto";
|
|
@@ -2112,10 +2115,10 @@ function Nn(e) {
|
|
|
2112
2115
|
fontStyle: n.title?.textStyle?.fontStyle ?? "normal",
|
|
2113
2116
|
textDecoration: n.title?.textStyle?.textDecoration ?? "none",
|
|
2114
2117
|
letterSpacing: n.title?.textStyle?.letterSpacing ?? "normal",
|
|
2115
|
-
lineHeight: String(
|
|
2118
|
+
lineHeight: String(gt)
|
|
2116
2119
|
})), A = t(() => {
|
|
2117
2120
|
let e = Number.parseFloat(n.title?.textStyle?.letterSpacing ?? ""), t = Number.isFinite(e) ? Math.max(0, C.value.length - 1) * e : 0;
|
|
2118
|
-
return Math.max(1, C.value.length * E.value *
|
|
2121
|
+
return Math.max(1, C.value.length * E.value * ht + t);
|
|
2119
2122
|
}), j = t(() => {
|
|
2120
2123
|
let e = d.value - 48;
|
|
2121
2124
|
return e > 0 ? e : A.value;
|
|
@@ -2125,12 +2128,12 @@ function Nn(e) {
|
|
|
2125
2128
|
maxWidth: O.value ? "none" : `${j.value}px`,
|
|
2126
2129
|
whiteSpace: O.value ? "nowrap" : "normal",
|
|
2127
2130
|
overflowWrap: O.value ? "normal" : "anywhere"
|
|
2128
|
-
})), N = t(() =>
|
|
2131
|
+
})), N = t(() => jn({
|
|
2129
2132
|
naturalWidth: a.value || A.value,
|
|
2130
2133
|
naturalHeight: o.value || E.value * 1.2,
|
|
2131
2134
|
availableWidth: j.value,
|
|
2132
2135
|
rotation: D.value
|
|
2133
|
-
})), P = t(() => w.value ? N.value.areaHeight : 0), F = t(() =>
|
|
2136
|
+
})), P = t(() => w.value ? N.value.areaHeight : 0), F = t(() => pt.top), I = t(() => Math.max(0, f.value - P.value - c.value));
|
|
2134
2137
|
return {
|
|
2135
2138
|
fixedWidth: l,
|
|
2136
2139
|
fixedHeight: u,
|
|
@@ -2154,7 +2157,7 @@ function Nn(e) {
|
|
|
2154
2157
|
titleAreaHeight: P,
|
|
2155
2158
|
chartTopMargin: F,
|
|
2156
2159
|
drawingHeight: I,
|
|
2157
|
-
innerHeight: t(() => Math.max(0, I.value -
|
|
2160
|
+
innerHeight: t(() => Math.max(0, I.value - pt.top - pt.bottom)),
|
|
2158
2161
|
titleAreaStyle: t(() => ({
|
|
2159
2162
|
height: `${P.value}px`,
|
|
2160
2163
|
justifyContent: n.title?.align === "left" ? "flex-start" : n.title?.align === "right" ? "flex-end" : "center"
|
|
@@ -2176,10 +2179,10 @@ function Nn(e) {
|
|
|
2176
2179
|
}
|
|
2177
2180
|
//#endregion
|
|
2178
2181
|
//#region src/components/core/useWaveformChartController.ts
|
|
2179
|
-
function
|
|
2182
|
+
function Nn(e, t) {
|
|
2180
2183
|
e.value = t instanceof Element ? t : void 0;
|
|
2181
2184
|
}
|
|
2182
|
-
function
|
|
2185
|
+
function Pn(e, t) {
|
|
2183
2186
|
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(U), p = x([]), m = v({}), h = v({}), g = b({
|
|
2184
2187
|
points: [],
|
|
2185
2188
|
trackIndex: null,
|
|
@@ -2187,11 +2190,11 @@ function Fn(e, t) {
|
|
|
2187
2190
|
x: 0,
|
|
2188
2191
|
y: 0
|
|
2189
2192
|
}
|
|
2190
|
-
}), y = v(!1), S = v(1), w = x(), T =
|
|
2193
|
+
}), y = v(!1), S = v(1), w = x(), T = ce("waveform-clip"), O = v(new Set(e.defaultHiddenSeriesIds)), k = Ge(), A = v([]), j = xn();
|
|
2191
2194
|
E([() => e.yDomain, () => e.yDomains], () => {
|
|
2192
2195
|
m.value = {}, h.value = {};
|
|
2193
2196
|
}, { deep: !0 });
|
|
2194
|
-
let M = v(null), N = v(!1), P = v(!1), F = () => void 0, I =
|
|
2197
|
+
let M = v(null), N = v(!1), P = v(!1), F = () => void 0, I = Dn(() => e.data, () => F()), L = Mn({
|
|
2195
2198
|
props: e,
|
|
2196
2199
|
observedWidth: o,
|
|
2197
2200
|
observedHeight: s,
|
|
@@ -2199,101 +2202,101 @@ function Fn(e, t) {
|
|
|
2199
2202
|
measuredTitleHeight: l,
|
|
2200
2203
|
internalHiddenSeriesIds: O,
|
|
2201
2204
|
paginationBandHeight: d
|
|
2202
|
-
}), { chartWidth: R, chartHeight: z, isCleanView: B, isPresentationMode: V, hiddenSeriesIdSet: H, resolvedTitleText: ee, titleAreaReserved: te, titleMeasureStyle: ne, titleAreaHeight: re, chartTopMargin: ie, innerHeight:
|
|
2205
|
+
}), { chartWidth: R, chartHeight: z, isCleanView: B, isPresentationMode: V, hiddenSeriesIdSet: H, resolvedTitleText: ee, titleAreaReserved: te, titleMeasureStyle: ne, titleAreaHeight: re, chartTopMargin: ie, innerHeight: ae } = L, oe = On({
|
|
2203
2206
|
props: e,
|
|
2204
2207
|
preparedSeries: I,
|
|
2205
2208
|
currentPage: S,
|
|
2206
2209
|
hiddenSeriesIdSet: H,
|
|
2207
2210
|
chartWidth: R,
|
|
2208
|
-
innerHeight:
|
|
2211
|
+
innerHeight: ae,
|
|
2209
2212
|
isCleanView: B,
|
|
2210
2213
|
sharedTransform: f,
|
|
2211
2214
|
independentTransforms: p,
|
|
2212
2215
|
sharedYDomains: m,
|
|
2213
2216
|
independentYDomains: h,
|
|
2214
2217
|
annotationInteraction: u(k)
|
|
2215
|
-
}), { chartSeries:
|
|
2218
|
+
}), { chartSeries: W, chartTracks: se, gridOptions: le, pageCount: ue, pagedTracks: de, resolvedChartLeftMargin: fe, innerWidth: G, hasChartArea: pe, activeInteractionMode: me, isZoomMode: he, initialXDomain: ge, sharedZoomDomain: _e, resolveInitialTrackDomain: K, trackLayouts: ve, annotationLayoutsForTrack: ye, resolveSeriesYScale: be } = oe;
|
|
2216
2219
|
D(() => {
|
|
2217
|
-
d.value =
|
|
2220
|
+
d.value = le.value.showPagination && ue.value > 1 && R.value <= 520 ? 40 : 0;
|
|
2218
2221
|
});
|
|
2219
|
-
let
|
|
2222
|
+
let q = Sn({
|
|
2220
2223
|
props: e,
|
|
2221
2224
|
emit: t,
|
|
2222
2225
|
svgElement: r,
|
|
2223
2226
|
sharedOverlayElement: a,
|
|
2224
2227
|
sharedTransform: f,
|
|
2225
2228
|
independentTransforms: p,
|
|
2226
|
-
trackLayouts:
|
|
2227
|
-
initialXDomain:
|
|
2228
|
-
sharedZoomDomain:
|
|
2229
|
-
innerWidth:
|
|
2230
|
-
innerHeight:
|
|
2231
|
-
hasChartArea:
|
|
2232
|
-
isZoomMode:
|
|
2229
|
+
trackLayouts: ve,
|
|
2230
|
+
initialXDomain: ge,
|
|
2231
|
+
sharedZoomDomain: _e,
|
|
2232
|
+
innerWidth: G,
|
|
2233
|
+
innerHeight: ae,
|
|
2234
|
+
hasChartArea: pe,
|
|
2235
|
+
isZoomMode: he,
|
|
2233
2236
|
isPresentationMode: V,
|
|
2234
|
-
resolveInitialTrackDomain:
|
|
2235
|
-
cancelPendingHover: () =>
|
|
2236
|
-
}),
|
|
2237
|
+
resolveInitialTrackDomain: K,
|
|
2238
|
+
cancelPendingHover: () => Y.cancelPendingHover()
|
|
2239
|
+
}), J = _n({
|
|
2237
2240
|
props: e,
|
|
2238
2241
|
emit: t,
|
|
2239
2242
|
container: n,
|
|
2240
|
-
chartSeries:
|
|
2243
|
+
chartSeries: W,
|
|
2241
2244
|
hiddenSeriesIdSet: H,
|
|
2242
2245
|
internalHiddenSeriesIds: O,
|
|
2243
2246
|
annotationInteraction: k,
|
|
2244
2247
|
editorSeriesOptions: A,
|
|
2245
|
-
trackLayouts:
|
|
2246
|
-
annotationLayoutsForTrack:
|
|
2247
|
-
resolveSeriesYScale:
|
|
2248
|
+
trackLayouts: ve,
|
|
2249
|
+
annotationLayoutsForTrack: ye,
|
|
2250
|
+
resolveSeriesYScale: be,
|
|
2248
2251
|
chartWidth: R,
|
|
2249
2252
|
chartHeight: z,
|
|
2250
|
-
innerWidth:
|
|
2251
|
-
resolvedChartLeftMargin:
|
|
2253
|
+
innerWidth: G,
|
|
2254
|
+
resolvedChartLeftMargin: fe,
|
|
2252
2255
|
titleAreaHeight: re,
|
|
2253
2256
|
chartTopMargin: ie,
|
|
2254
|
-
activeInteractionMode:
|
|
2257
|
+
activeInteractionMode: me,
|
|
2255
2258
|
isPresentationMode: V
|
|
2256
|
-
}),
|
|
2259
|
+
}), xe = bn({
|
|
2257
2260
|
props: e,
|
|
2258
2261
|
emit: t,
|
|
2259
2262
|
selection: M,
|
|
2260
2263
|
spacePressed: N,
|
|
2261
|
-
trackLayouts:
|
|
2262
|
-
chartTracks:
|
|
2263
|
-
initialXDomain:
|
|
2264
|
-
innerWidth:
|
|
2265
|
-
innerHeight:
|
|
2264
|
+
trackLayouts: ve,
|
|
2265
|
+
chartTracks: se,
|
|
2266
|
+
initialXDomain: ge,
|
|
2267
|
+
innerWidth: G,
|
|
2268
|
+
innerHeight: ae,
|
|
2266
2269
|
sharedOverlayElement: a,
|
|
2267
2270
|
sharedTransform: f,
|
|
2268
2271
|
independentTransforms: p,
|
|
2269
2272
|
sharedYDomains: m,
|
|
2270
2273
|
independentYDomains: h,
|
|
2271
|
-
isZoomMode:
|
|
2274
|
+
isZoomMode: he,
|
|
2272
2275
|
isPresentationMode: V,
|
|
2273
2276
|
editorSeriesOptions: A,
|
|
2274
|
-
resolveInitialTrackDomain:
|
|
2275
|
-
canZoomTrack:
|
|
2276
|
-
canZoomSharedTracks:
|
|
2277
|
-
configureZoom:
|
|
2278
|
-
cancelPendingZoom:
|
|
2279
|
-
clearHover: () =>
|
|
2280
|
-
resolveTrackAtPointer:
|
|
2281
|
-
}),
|
|
2277
|
+
resolveInitialTrackDomain: K,
|
|
2278
|
+
canZoomTrack: q.canZoomTrack,
|
|
2279
|
+
canZoomSharedTracks: q.canZoomSharedTracks,
|
|
2280
|
+
configureZoom: q.configureZoom,
|
|
2281
|
+
cancelPendingZoom: q.cancelPendingZoom,
|
|
2282
|
+
clearHover: () => Y.clearHover(),
|
|
2283
|
+
resolveTrackAtPointer: J.resolveTrackAtPointer
|
|
2284
|
+
}), Y = yn({
|
|
2282
2285
|
emit: t,
|
|
2283
2286
|
hoverState: g,
|
|
2284
2287
|
suppressHoverUntilMove: y,
|
|
2285
2288
|
hoverThrottle: j,
|
|
2286
2289
|
selection: M,
|
|
2287
|
-
trackLayouts:
|
|
2288
|
-
innerWidth:
|
|
2289
|
-
resolvedChartLeftMargin:
|
|
2290
|
+
trackLayouts: ve,
|
|
2291
|
+
innerWidth: G,
|
|
2292
|
+
resolvedChartLeftMargin: fe,
|
|
2290
2293
|
titleAreaHeight: re,
|
|
2291
2294
|
chartTopMargin: ie,
|
|
2292
2295
|
sharedOverlayElement: a,
|
|
2293
2296
|
isPresentationMode: V,
|
|
2294
|
-
updateViewportDrag:
|
|
2295
|
-
resolveTrackAtPointer:
|
|
2296
|
-
}),
|
|
2297
|
+
updateViewportDrag: xe.updateViewportDrag,
|
|
2298
|
+
resolveTrackAtPointer: J.resolveTrackAtPointer
|
|
2299
|
+
}), Se = wn({
|
|
2297
2300
|
props: e,
|
|
2298
2301
|
emit: t,
|
|
2299
2302
|
container: n,
|
|
@@ -2309,14 +2312,14 @@ function Fn(e, t) {
|
|
|
2309
2312
|
spacePressed: N,
|
|
2310
2313
|
pointerInsideChart: P,
|
|
2311
2314
|
currentPage: S,
|
|
2312
|
-
pageCount:
|
|
2313
|
-
pagedTracks:
|
|
2314
|
-
gridOptions:
|
|
2315
|
-
chartSeries:
|
|
2316
|
-
chartTracks:
|
|
2317
|
-
innerWidth:
|
|
2318
|
-
innerHeight:
|
|
2319
|
-
activeInteractionMode:
|
|
2315
|
+
pageCount: ue,
|
|
2316
|
+
pagedTracks: de,
|
|
2317
|
+
gridOptions: le,
|
|
2318
|
+
chartSeries: W,
|
|
2319
|
+
chartTracks: se,
|
|
2320
|
+
innerWidth: G,
|
|
2321
|
+
innerHeight: ae,
|
|
2322
|
+
activeInteractionMode: me,
|
|
2320
2323
|
hiddenSeriesIdSet: H,
|
|
2321
2324
|
internalHiddenSeriesIds: O,
|
|
2322
2325
|
independentTransforms: p,
|
|
@@ -2324,23 +2327,23 @@ function Fn(e, t) {
|
|
|
2324
2327
|
annotationInteraction: k,
|
|
2325
2328
|
editorSeriesOptions: A,
|
|
2326
2329
|
isPresentationMode: V,
|
|
2327
|
-
clearHover:
|
|
2328
|
-
cancelAnnotation:
|
|
2329
|
-
configureZoom:
|
|
2330
|
-
resetViewport:
|
|
2331
|
-
cancelViewportDrag:
|
|
2332
|
-
cancelPendingHover:
|
|
2333
|
-
clearZoomBindings:
|
|
2330
|
+
clearHover: Y.clearHover,
|
|
2331
|
+
cancelAnnotation: J.cancelAnnotation,
|
|
2332
|
+
configureZoom: q.configureZoom,
|
|
2333
|
+
resetViewport: xe.resetViewport,
|
|
2334
|
+
cancelViewportDrag: xe.cancelViewportDrag,
|
|
2335
|
+
cancelPendingHover: Y.cancelPendingHover,
|
|
2336
|
+
clearZoomBindings: q.clearZoomBindings
|
|
2334
2337
|
});
|
|
2335
|
-
return F =
|
|
2338
|
+
return F = Se.handleDataReferenceChange, _({
|
|
2336
2339
|
...C(e),
|
|
2337
2340
|
...L,
|
|
2338
|
-
...
|
|
2341
|
+
...oe,
|
|
2342
|
+
...J,
|
|
2343
|
+
...xe,
|
|
2339
2344
|
...Y,
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
margin: mt,
|
|
2343
|
-
getPageSize: Jt,
|
|
2345
|
+
margin: pt,
|
|
2346
|
+
getPageSize: qt,
|
|
2344
2347
|
currentPage: S,
|
|
2345
2348
|
selection: M,
|
|
2346
2349
|
pointerInsideChart: P,
|
|
@@ -2350,32 +2353,32 @@ function Fn(e, t) {
|
|
|
2350
2353
|
contextMenu: k.contextMenu,
|
|
2351
2354
|
editorSeriesOptions: A,
|
|
2352
2355
|
clipPathId: T,
|
|
2353
|
-
goToPage:
|
|
2354
|
-
setContainer: (e) =>
|
|
2355
|
-
setSvgElement: (e) =>
|
|
2356
|
-
setTitleMeasureElement: (e) =>
|
|
2357
|
-
setSharedOverlayElement: (e) =>
|
|
2356
|
+
goToPage: Se.goToPage,
|
|
2357
|
+
setContainer: (e) => Nn(n, e),
|
|
2358
|
+
setSvgElement: (e) => Nn(r, e),
|
|
2359
|
+
setTitleMeasureElement: (e) => Nn(i, e),
|
|
2360
|
+
setSharedOverlayElement: (e) => Nn(a, e)
|
|
2358
2361
|
});
|
|
2359
2362
|
}
|
|
2360
2363
|
//#endregion
|
|
2361
2364
|
//#region src/components/annotation/WaveformAnnotationEditor.vue?vue&type=script&setup=true&lang.ts
|
|
2362
|
-
var
|
|
2365
|
+
var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel" }, Ln = { class: "waveform-annotation-editor__header" }, Rn = ["id"], zn = {
|
|
2363
2366
|
class: "waveform-annotation-editor__coordinates",
|
|
2364
2367
|
"aria-label": "标注坐标"
|
|
2365
|
-
},
|
|
2368
|
+
}, Bn = {
|
|
2366
2369
|
key: 0,
|
|
2367
2370
|
class: "waveform-annotation-editor__series",
|
|
2368
2371
|
"aria-label": "标注所属波形"
|
|
2369
|
-
},
|
|
2372
|
+
}, Vn = { class: "waveform-annotation-editor__series-label" }, Hn = ["value"], Un = ["value"], Wn = { key: 1 }, Gn = { class: "waveform-annotation-editor__field" }, Kn = { class: "waveform-annotation-editor__label-row" }, qn = ["maxlength"], Jn = { class: "waveform-annotation-editor__colors" }, Yn = {
|
|
2370
2373
|
class: "waveform-annotation-editor__color-field",
|
|
2371
2374
|
title: "调整标注边框色和透明度"
|
|
2372
|
-
},
|
|
2375
|
+
}, Xn = {
|
|
2373
2376
|
class: "waveform-annotation-editor__color-field",
|
|
2374
2377
|
title: "调整标注文字色和透明度"
|
|
2375
|
-
},
|
|
2378
|
+
}, Zn = {
|
|
2376
2379
|
class: "waveform-annotation-editor__color-field",
|
|
2377
2380
|
title: "调整标注背景色和透明度"
|
|
2378
|
-
},
|
|
2381
|
+
}, Qn = { class: "waveform-annotation-editor__actions" }, $n = ["disabled"], er = /*#__PURE__*/ X(/* @__PURE__ */ c({
|
|
2379
2382
|
__name: "WaveformAnnotationEditor",
|
|
2380
2383
|
props: {
|
|
2381
2384
|
annotation: {},
|
|
@@ -2390,7 +2393,7 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2390
2393
|
"series-change"
|
|
2391
2394
|
],
|
|
2392
2395
|
setup(n, { emit: o }) {
|
|
2393
|
-
let c = n, l = o, u = v(), f =
|
|
2396
|
+
let c = n, l = o, u = v(), f = ce("waveform-annotation-editor-title"), m = v(""), h = v(""), _ = v(""), b = v(""), x = t(() => m.value.trim().length > 0), C = t(() => m.value.length), D = t(() => {
|
|
2394
2397
|
let e = c.seriesOptions?.find((e) => e.seriesId === c.annotation.seriesId);
|
|
2395
2398
|
return e ? {
|
|
2396
2399
|
id: e.seriesId,
|
|
@@ -2400,7 +2403,7 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2400
2403
|
} : c.series;
|
|
2401
2404
|
});
|
|
2402
2405
|
function A() {
|
|
2403
|
-
let e =
|
|
2406
|
+
let e = Se(c.annotation.style);
|
|
2404
2407
|
m.value = c.annotation.text, h.value = e.borderColor, _.value = e.textColor, b.value = e.backgroundColor, d(() => u.value?.focus());
|
|
2405
2408
|
}
|
|
2406
2409
|
E(() => c.annotation, A, { immediate: !0 });
|
|
@@ -2428,21 +2431,21 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2428
2431
|
"aria-modal": "true",
|
|
2429
2432
|
"aria-labelledby": w(f),
|
|
2430
2433
|
onClick: n[6] ||= k((e) => l("cancel"), ["self"])
|
|
2431
|
-
}, [a("section",
|
|
2432
|
-
a("header",
|
|
2434
|
+
}, [a("section", In, [
|
|
2435
|
+
a("header", Ln, [a("div", null, [a("h2", { id: w(f) }, S(c.mode === "add" ? "添加标注" : "编辑标注"), 9, Rn)]), a("button", {
|
|
2433
2436
|
type: "button",
|
|
2434
2437
|
class: "waveform-annotation-editor__close",
|
|
2435
2438
|
"aria-label": "关闭标注编辑器",
|
|
2436
2439
|
title: "关闭",
|
|
2437
2440
|
onClick: n[0] ||= (e) => l("cancel")
|
|
2438
2441
|
}, " × ")]),
|
|
2439
|
-
a("div",
|
|
2440
|
-
D.value ? (g(), i("label",
|
|
2442
|
+
a("div", zn, [a("span", null, [a("b", null, "X (" + S(c.timeUnit) + ")", 1), a("code", null, S(w(ut)(c.annotation.x, c.timeUnit)), 1)]), a("span", null, [n[7] ||= a("b", null, "Y", -1), a("code", null, S(w(it)(c.annotation.y)), 1)])]),
|
|
2443
|
+
D.value ? (g(), i("label", Bn, [
|
|
2441
2444
|
a("i", {
|
|
2442
2445
|
style: p({ backgroundColor: D.value.color }),
|
|
2443
2446
|
"aria-hidden": "true"
|
|
2444
2447
|
}, null, 4),
|
|
2445
|
-
a("span",
|
|
2448
|
+
a("span", Vn, [n[8] ||= a("small", null, "标注波形", -1), a("b", null, S(D.value.name), 1)]),
|
|
2446
2449
|
c.seriesOptions?.length ? (g(), i("select", {
|
|
2447
2450
|
key: 0,
|
|
2448
2451
|
value: c.annotation.seriesId,
|
|
@@ -2451,9 +2454,9 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2451
2454
|
}, [(g(!0), i(e, null, y(c.seriesOptions, (e) => (g(), i("option", {
|
|
2452
2455
|
key: e.seriesId,
|
|
2453
2456
|
value: e.seriesId
|
|
2454
|
-
}, S(e.name) + S(e.unit ? ` (${e.unit})` : ""), 9,
|
|
2457
|
+
}, S(e.name) + S(e.unit ? ` (${e.unit})` : ""), 9, Un))), 128))], 40, Hn)) : D.value.unit ? (g(), i("code", Wn, S(D.value.unit), 1)) : r("", !0)
|
|
2455
2458
|
])) : r("", !0),
|
|
2456
|
-
a("label",
|
|
2459
|
+
a("label", Gn, [a("span", Kn, [n[9] ||= a("b", null, "标注文本", -1), a("small", null, S(C.value) + "/" + S(w(40)), 1)]), O(a("textarea", {
|
|
2457
2460
|
ref_key: "textarea",
|
|
2458
2461
|
ref: u,
|
|
2459
2462
|
"onUpdate:modelValue": n[1] ||= (e) => m.value = e,
|
|
@@ -2462,10 +2465,10 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2462
2465
|
"aria-label": "标注文本",
|
|
2463
2466
|
placeholder: "输入这处波形的说明",
|
|
2464
2467
|
onKeydown: M
|
|
2465
|
-
}, null, 40,
|
|
2466
|
-
a("fieldset",
|
|
2468
|
+
}, null, 40, qn), [[T, m.value]])]),
|
|
2469
|
+
a("fieldset", Jn, [
|
|
2467
2470
|
n[13] ||= a("legend", null, "颜色与透明度", -1),
|
|
2468
|
-
a("label",
|
|
2471
|
+
a("label", Yn, [n[10] ||= a("span", null, "边框色", -1), s(w(W), {
|
|
2469
2472
|
"pure-color": h.value,
|
|
2470
2473
|
"onUpdate:pureColor": n[2] ||= (e) => h.value = e,
|
|
2471
2474
|
"aria-label": "标注边框色",
|
|
@@ -2475,7 +2478,7 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2475
2478
|
"disable-alpha": !1,
|
|
2476
2479
|
"blur-close": !0
|
|
2477
2480
|
}, null, 8, ["pure-color"])]),
|
|
2478
|
-
a("label",
|
|
2481
|
+
a("label", Xn, [n[11] ||= a("span", null, "文字色", -1), s(w(W), {
|
|
2479
2482
|
"pure-color": _.value,
|
|
2480
2483
|
"onUpdate:pureColor": n[3] ||= (e) => _.value = e,
|
|
2481
2484
|
"aria-label": "标注文字色",
|
|
@@ -2485,7 +2488,7 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2485
2488
|
"disable-alpha": !1,
|
|
2486
2489
|
"blur-close": !0
|
|
2487
2490
|
}, null, 8, ["pure-color"])]),
|
|
2488
|
-
a("label",
|
|
2491
|
+
a("label", Zn, [n[12] ||= a("span", null, "背景色", -1), s(w(W), {
|
|
2489
2492
|
"pure-color": b.value,
|
|
2490
2493
|
"onUpdate:pureColor": n[4] ||= (e) => b.value = e,
|
|
2491
2494
|
"aria-label": "标注背景色",
|
|
@@ -2496,7 +2499,7 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2496
2499
|
"blur-close": !0
|
|
2497
2500
|
}, null, 8, ["pure-color"])])
|
|
2498
2501
|
]),
|
|
2499
|
-
a("footer",
|
|
2502
|
+
a("footer", Qn, [a("button", {
|
|
2500
2503
|
type: "button",
|
|
2501
2504
|
onClick: n[5] ||= (e) => l("cancel")
|
|
2502
2505
|
}, "取消"), a("button", {
|
|
@@ -2504,10 +2507,10 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2504
2507
|
class: "is-primary",
|
|
2505
2508
|
disabled: !x.value,
|
|
2506
2509
|
onClick: j
|
|
2507
|
-
}, " 保存标注 ", 8,
|
|
2508
|
-
])], 8,
|
|
2510
|
+
}, " 保存标注 ", 8, $n)])
|
|
2511
|
+
])], 8, Fn));
|
|
2509
2512
|
}
|
|
2510
|
-
}), [["__scopeId", "data-v-52818b45"]]),
|
|
2513
|
+
}), [["__scopeId", "data-v-52818b45"]]), tr = { class: "waveform-tooltip__time waveform-chart__tooltip-time" }, nr = { key: 0 }, rr = { class: "waveform-tooltip__value" }, ir = { key: 0 }, ar = 12, or = 8, sr = 238, cr = /*#__PURE__*/ X(/* @__PURE__ */ c({
|
|
2511
2514
|
__name: "WaveformTooltip",
|
|
2512
2515
|
props: {
|
|
2513
2516
|
visible: { type: Boolean },
|
|
@@ -2521,30 +2524,30 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2521
2524
|
setup(n) {
|
|
2522
2525
|
let s = n, c = t(() => {
|
|
2523
2526
|
if (!s.visible || !s.hoveredPoint) return { display: "none" };
|
|
2524
|
-
let e = 44 + s.seriesPoints.length * 22, t = s.position.x +
|
|
2527
|
+
let e = 44 + s.seriesPoints.length * 22, t = s.position.x + ar, n = s.position.x - ar - sr;
|
|
2525
2528
|
return {
|
|
2526
|
-
...t +
|
|
2529
|
+
...t + sr <= s.containerWidth - or ? { left: `${t}px` } : n >= or ? { right: `${s.containerWidth - s.position.x + ar}px` } : { left: `${or}px` },
|
|
2527
2530
|
top: `${Math.max(8, Math.min(s.position.y - 18, s.containerHeight - e - 8))}px`
|
|
2528
2531
|
};
|
|
2529
2532
|
});
|
|
2530
2533
|
function l(e) {
|
|
2531
|
-
let { lower: t, upper: n } =
|
|
2532
|
-
return t === 0 && n === 0 ? null : `(+${
|
|
2534
|
+
let { lower: t, upper: n } = At(e);
|
|
2535
|
+
return t === 0 && n === 0 ? null : `(+${rt(n)} / -${rt(t)})`;
|
|
2533
2536
|
}
|
|
2534
2537
|
return (t, s) => n.visible && n.hoveredPoint ? (g(), i("div", {
|
|
2535
2538
|
key: 0,
|
|
2536
2539
|
class: "waveform-tooltip waveform-chart__tooltip",
|
|
2537
2540
|
style: p(c.value)
|
|
2538
|
-
}, [a("span",
|
|
2541
|
+
}, [a("span", tr, S(n.timeUnit) + ": " + S(w(lt)(n.hoveredPoint.x, n.timeUnit)), 1), (g(!0), i(e, null, y(n.seriesPoints, (e) => (g(), i("span", {
|
|
2539
2542
|
key: `${e.trackIndex}-${e.name}`,
|
|
2540
2543
|
class: "waveform-tooltip__series waveform-chart__tooltip-series"
|
|
2541
2544
|
}, [
|
|
2542
2545
|
a("i", { style: p({ backgroundColor: e.color }) }, null, 4),
|
|
2543
|
-
e.name ? (g(), i("strong",
|
|
2544
|
-
a("span",
|
|
2546
|
+
e.name ? (g(), i("strong", nr, S(e.name) + ":", 1)) : r("", !0),
|
|
2547
|
+
a("span", rr, [o(S(w(rt)(e.point.y)) + S(e.unit ? ` ${e.unit}` : "") + " ", 1), l(e.point) ? (g(), i("small", ir, S(l(e.point)), 1)) : r("", !0)])
|
|
2545
2548
|
]))), 128))], 4)) : r("", !0);
|
|
2546
2549
|
}
|
|
2547
|
-
}), [["__scopeId", "data-v-b8b5592a"]]),
|
|
2550
|
+
}), [["__scopeId", "data-v-b8b5592a"]]), lr = /* @__PURE__ */ c({
|
|
2548
2551
|
__name: "WaveformHoverHost",
|
|
2549
2552
|
props: {
|
|
2550
2553
|
state: {},
|
|
@@ -2555,7 +2558,7 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2555
2558
|
},
|
|
2556
2559
|
setup(e) {
|
|
2557
2560
|
let r = e, i = t(() => r.state.points[0]?.point ?? null);
|
|
2558
|
-
return (t, r) => (g(), n(
|
|
2561
|
+
return (t, r) => (g(), n(cr, {
|
|
2559
2562
|
visible: e.visible && i.value !== null,
|
|
2560
2563
|
position: e.state.position,
|
|
2561
2564
|
"time-unit": e.timeUnit,
|
|
@@ -2573,16 +2576,16 @@ var In = ["aria-labelledby"], Ln = { class: "waveform-annotation-editor__panel"
|
|
|
2573
2576
|
"container-height"
|
|
2574
2577
|
]));
|
|
2575
2578
|
}
|
|
2576
|
-
}),
|
|
2579
|
+
}), ur = 13, dr = 2, fr = 14, pr = 8, mr = 24, hr = {
|
|
2577
2580
|
circle: ee,
|
|
2578
2581
|
square: ne,
|
|
2579
2582
|
triangle: re,
|
|
2580
2583
|
diamond: te
|
|
2581
2584
|
};
|
|
2582
|
-
function
|
|
2583
|
-
return e === "none" ? null : H().type(
|
|
2585
|
+
function gr(e, t = 48) {
|
|
2586
|
+
return e === "none" ? null : H().type(hr[e]).size(t)() ?? null;
|
|
2584
2587
|
}
|
|
2585
|
-
function
|
|
2588
|
+
function _r(e, t, n = 48) {
|
|
2586
2589
|
if (e === "none" || t.length === 0) return null;
|
|
2587
2590
|
if (e === "circle") {
|
|
2588
2591
|
let e = Math.sqrt(n / Math.PI);
|
|
@@ -2599,24 +2602,24 @@ function vr(e, t, n = 48) {
|
|
|
2599
2602
|
let r = Math.sqrt(n / (2 * Math.tan(Math.PI / 6))), i = r * Math.tan(Math.PI / 6);
|
|
2600
2603
|
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("");
|
|
2601
2604
|
}
|
|
2602
|
-
function
|
|
2605
|
+
function vr(e) {
|
|
2603
2606
|
return e === "none" ? null : "M1 8H25";
|
|
2604
2607
|
}
|
|
2605
|
-
function
|
|
2608
|
+
function yr(e) {
|
|
2606
2609
|
if (e === "dashed") return "8 5";
|
|
2607
2610
|
if (e === "dash-dot") return "8 5 1.5 5";
|
|
2608
2611
|
}
|
|
2609
|
-
function
|
|
2610
|
-
let t = (Number.isFinite(e) && e > 0 ? Math.min(e,
|
|
2612
|
+
function br(e) {
|
|
2613
|
+
let t = (Number.isFinite(e) && e > 0 ? Math.min(e, mr) : pr) / 2, n = ur - t, r = ur + t;
|
|
2611
2614
|
return [
|
|
2612
|
-
`M${n} ${
|
|
2613
|
-
`M${
|
|
2614
|
-
`M${n} ${
|
|
2615
|
+
`M${n} ${dr}H${r}`,
|
|
2616
|
+
`M${ur} ${dr}V${fr}`,
|
|
2617
|
+
`M${n} ${fr}H${r}`
|
|
2615
2618
|
].join("");
|
|
2616
2619
|
}
|
|
2617
2620
|
//#endregion
|
|
2618
2621
|
//#region src/components/rendering/WaveformSeriesLayer.vue?vue&type=script&setup=true&lang.ts
|
|
2619
|
-
var
|
|
2622
|
+
var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
2620
2623
|
"data-series-id",
|
|
2621
2624
|
"data-series-name",
|
|
2622
2625
|
"data-y-axis-index",
|
|
@@ -2625,11 +2628,11 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2625
2628
|
"d",
|
|
2626
2629
|
"stroke",
|
|
2627
2630
|
"stroke-dasharray"
|
|
2628
|
-
],
|
|
2631
|
+
], wr = ["data-series-id"], Tr = [
|
|
2629
2632
|
"d",
|
|
2630
2633
|
"stroke",
|
|
2631
2634
|
"stroke-width"
|
|
2632
|
-
],
|
|
2635
|
+
], Er = ["data-series-id", "data-point-type"], Dr = ["d", "fill"], Or = /*#__PURE__*/ X(/* @__PURE__ */ c({
|
|
2633
2636
|
__name: "WaveformSeriesLayer",
|
|
2634
2637
|
props: {
|
|
2635
2638
|
track: {},
|
|
@@ -2637,11 +2640,11 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2637
2640
|
},
|
|
2638
2641
|
setup(n) {
|
|
2639
2642
|
let a = n, o = t(() => a.track.seriesPaths.map((e) => {
|
|
2640
|
-
let t =
|
|
2643
|
+
let t = _r(e.series.pointType, e.pointRenderPoints.map((t) => ({
|
|
2641
2644
|
x: a.track.xScale(t.x),
|
|
2642
2645
|
y: e.yScale(t.y)
|
|
2643
2646
|
}))), n = e.series.errorBar.capWidth / 2, r = e.errorBarRenderPoints.map((t) => {
|
|
2644
|
-
let { lower: r, upper: i } =
|
|
2647
|
+
let { lower: r, upper: i } = At(t), o = a.track.xScale(t.x), s = e.yScale(t.y - r), c = e.yScale(t.y + i);
|
|
2645
2648
|
return [
|
|
2646
2649
|
`M${o - n},${s}H${o + n}`,
|
|
2647
2650
|
`M${o},${s}V${c}`,
|
|
@@ -2674,8 +2677,8 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2674
2677
|
"data-line-style": e.series.lineStyle,
|
|
2675
2678
|
d: e.path,
|
|
2676
2679
|
stroke: e.series.color,
|
|
2677
|
-
"stroke-dasharray": w(
|
|
2678
|
-
}, null, 8,
|
|
2680
|
+
"stroke-dasharray": w(yr)(e.series.lineStyle)
|
|
2681
|
+
}, null, 8, Cr)) : r("", !0),
|
|
2679
2682
|
e.series.errorBar.visible ? (g(), i("g", {
|
|
2680
2683
|
key: 1,
|
|
2681
2684
|
class: "waveform-track__error-bars waveform-chart__error-bars",
|
|
@@ -2686,7 +2689,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2686
2689
|
d: e.errorBarPath,
|
|
2687
2690
|
stroke: e.series.errorBar.color || e.series.color,
|
|
2688
2691
|
"stroke-width": e.series.errorBar.width
|
|
2689
|
-
}, null, 8,
|
|
2692
|
+
}, null, 8, Tr)) : r("", !0)], 8, wr)) : r("", !0),
|
|
2690
2693
|
e.series.pointType === "none" ? r("", !0) : (g(), i("g", {
|
|
2691
2694
|
key: 2,
|
|
2692
2695
|
class: "waveform-track__points waveform-chart__points",
|
|
@@ -2697,20 +2700,20 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2697
2700
|
class: "waveform-track__point waveform-chart__point",
|
|
2698
2701
|
d: e.pointPath,
|
|
2699
2702
|
fill: e.series.color
|
|
2700
|
-
}, null, 8,
|
|
2701
|
-
], 8,
|
|
2703
|
+
}, null, 8, Dr)) : r("", !0)], 8, Er))
|
|
2704
|
+
], 8, Sr))), 128))], 8, xr)) : r("", !0);
|
|
2702
2705
|
}
|
|
2703
|
-
}), [["__scopeId", "data-v-42a3fd47"]]),
|
|
2706
|
+
}), [["__scopeId", "data-v-42a3fd47"]]), kr = ["transform"], Ar = ["transform"], jr = {
|
|
2704
2707
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--start waveform-chart__axis-endpoint waveform-chart__axis-endpoint--start",
|
|
2705
2708
|
x: "0",
|
|
2706
2709
|
y: "7",
|
|
2707
2710
|
dy: "0.71em",
|
|
2708
2711
|
"text-anchor": "start"
|
|
2709
|
-
},
|
|
2712
|
+
}, Mr = ["x"], Nr = [
|
|
2710
2713
|
"data-y-axis-index",
|
|
2711
2714
|
"data-y-axis-side",
|
|
2712
2715
|
"transform"
|
|
2713
|
-
],
|
|
2716
|
+
], Pr = { key: 2 }, Fr = ["x", "y"], Ir = ["fill", "transform"], Lr = ["data-y-axis-title-index"], Rr = ["x", "y"], zr = ["fill", "transform"], Br = /* @__PURE__ */ c({
|
|
2714
2717
|
__name: "WaveformTrackAxes",
|
|
2715
2718
|
props: {
|
|
2716
2719
|
track: {},
|
|
@@ -2739,7 +2742,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2739
2742
|
if (n.track.yAxes.forEach((e, t) => {
|
|
2740
2743
|
let r = s.value[t];
|
|
2741
2744
|
if (!r) return;
|
|
2742
|
-
let [i, a] = e.scale.domain(), o = Math.max(...e.tickValues), c = (e.side === "left" ? j(e.scale) : M(e.scale)).tickFormat((e) =>
|
|
2745
|
+
let [i, a] = e.scale.domain(), o = Math.max(...e.tickValues), c = (e.side === "left" ? j(e.scale) : M(e.scale)).tickFormat((e) => nt(Number(e), {
|
|
2743
2746
|
axisMin: i,
|
|
2744
2747
|
axisMax: a,
|
|
2745
2748
|
topTickValue: o
|
|
@@ -2747,7 +2750,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2747
2750
|
l.call(c), l.selectAll("path.domain").attr("display", n.axes?.y?.lineVisible === !1 ? "none" : null);
|
|
2748
2751
|
}), !o.value) return;
|
|
2749
2752
|
let e = V(o.value);
|
|
2750
|
-
e.call(A(n.track.xScale).tickValues(n.track.xAxisTickValues).tickFormat((e) =>
|
|
2753
|
+
e.call(A(n.track.xScale).tickValues(n.track.xAxisTickValues).tickFormat((e) => ot(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);
|
|
2751
2754
|
}
|
|
2752
2755
|
return h(async () => {
|
|
2753
2756
|
await d(), m();
|
|
@@ -2757,6 +2760,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2757
2760
|
() => n.track.xAxisTickValues,
|
|
2758
2761
|
() => n.track.yAxisTickValues,
|
|
2759
2762
|
() => n.timeUnit,
|
|
2763
|
+
() => n.axes?.x?.labelFormatter,
|
|
2760
2764
|
() => n.axes?.x?.lineVisible,
|
|
2761
2765
|
() => n.axes?.y?.lineVisible
|
|
2762
2766
|
], async () => {
|
|
@@ -2768,7 +2772,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2768
2772
|
ref: o,
|
|
2769
2773
|
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 }]),
|
|
2770
2774
|
transform: `translate(0, ${t.track.height})`
|
|
2771
|
-
}, null, 10,
|
|
2775
|
+
}, null, 10, kr)) : r("", !0),
|
|
2772
2776
|
t.track.showXAxis ? (g(), i("g", {
|
|
2773
2777
|
key: 1,
|
|
2774
2778
|
class: "waveform-track__axis-endpoints waveform-chart__axis-endpoints",
|
|
@@ -2776,13 +2780,13 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2776
2780
|
"font-family": "sans-serif",
|
|
2777
2781
|
"font-size": "10",
|
|
2778
2782
|
"aria-hidden": "true"
|
|
2779
|
-
}, [a("text",
|
|
2783
|
+
}, [a("text", jr, S(t.track.endpointLabels.start), 1), a("text", {
|
|
2780
2784
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--end waveform-chart__axis-endpoint waveform-chart__axis-endpoint--end",
|
|
2781
2785
|
x: t.track.width ?? t.innerWidth,
|
|
2782
2786
|
y: "7",
|
|
2783
2787
|
dy: "0.71em",
|
|
2784
2788
|
"text-anchor": "end"
|
|
2785
|
-
}, S(t.track.endpointLabels.end), 9,
|
|
2789
|
+
}, S(t.track.endpointLabels.end), 9, Mr)], 8, Ar)) : r("", !0),
|
|
2786
2790
|
(g(!0), i(e, null, y(t.track.isEmpty ? [] : t.track.yAxes, (e) => (g(), i("g", {
|
|
2787
2791
|
key: `y-axis-${t.track.index}-${e.index}`,
|
|
2788
2792
|
ref_for: !0,
|
|
@@ -2791,21 +2795,21 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2791
2795
|
"data-y-axis-index": e.index,
|
|
2792
2796
|
"data-y-axis-side": e.side,
|
|
2793
2797
|
transform: `translate(${e.x}, 0)`
|
|
2794
|
-
}, null, 10,
|
|
2795
|
-
!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",
|
|
2798
|
+
}, null, 10, Nr))), 128)),
|
|
2799
|
+
!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", Pr, [a("rect", {
|
|
2796
2800
|
class: "waveform-track__y-axis-label-bg waveform-chart__y-axis-label-bg",
|
|
2797
2801
|
x: t.track.yAxisLabelX - 12,
|
|
2798
2802
|
y: t.track.height / 2 - 40,
|
|
2799
2803
|
width: "24",
|
|
2800
2804
|
height: "80",
|
|
2801
2805
|
rx: "2"
|
|
2802
|
-
}, null, 8,
|
|
2806
|
+
}, null, 8, Fr), a("text", {
|
|
2803
2807
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
2804
2808
|
fill: t.track.series.color,
|
|
2805
2809
|
transform: `translate(${t.track.yAxisLabelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
2806
2810
|
"text-anchor": "middle",
|
|
2807
2811
|
"dominant-baseline": "central"
|
|
2808
|
-
}, S(c(t.track.series)), 9,
|
|
2812
|
+
}, S(c(t.track.series)), 9, Ir)])) : r("", !0),
|
|
2809
2813
|
(g(!0), i(e, null, y(!t.cleanView && t.track.yAxes.length > 1 ? t.track.yAxes.filter(l) : [], (e) => (g(), i("g", {
|
|
2810
2814
|
key: `y-axis-title-${t.track.index}-${e.index}`,
|
|
2811
2815
|
class: "waveform-track__multi-axis-title",
|
|
@@ -2817,40 +2821,40 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2817
2821
|
width: "24",
|
|
2818
2822
|
height: "80",
|
|
2819
2823
|
rx: "2"
|
|
2820
|
-
}, null, 8,
|
|
2824
|
+
}, null, 8, Rr), a("text", {
|
|
2821
2825
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
2822
2826
|
fill: e.seriesList[0].color,
|
|
2823
2827
|
transform: `translate(${e.labelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
2824
2828
|
"text-anchor": "middle",
|
|
2825
2829
|
"dominant-baseline": "central"
|
|
2826
|
-
}, S(c(e.seriesList[0])), 9,
|
|
2830
|
+
}, S(c(e.seriesList[0])), 9, zr)], 8, Lr))), 128))
|
|
2827
2831
|
], 64));
|
|
2828
2832
|
}
|
|
2829
|
-
}),
|
|
2833
|
+
}), Vr = [
|
|
2830
2834
|
"width",
|
|
2831
2835
|
"height",
|
|
2832
2836
|
"fill"
|
|
2833
|
-
],
|
|
2837
|
+
], Hr = ["clip-path"], Ur = { class: "waveform-track__grid waveform-track__grid--minor waveform-chart__grid waveform-chart__grid--minor" }, Wr = [
|
|
2834
2838
|
"stroke",
|
|
2835
2839
|
"x1",
|
|
2836
2840
|
"x2",
|
|
2837
2841
|
"y2"
|
|
2838
|
-
],
|
|
2842
|
+
], Gr = [
|
|
2839
2843
|
"stroke",
|
|
2840
2844
|
"x2",
|
|
2841
2845
|
"y1",
|
|
2842
2846
|
"y2"
|
|
2843
|
-
],
|
|
2847
|
+
], Kr = { class: "waveform-track__grid waveform-track__grid--major waveform-chart__grid waveform-chart__grid--major" }, qr = [
|
|
2844
2848
|
"stroke",
|
|
2845
2849
|
"x1",
|
|
2846
2850
|
"x2",
|
|
2847
2851
|
"y2"
|
|
2848
|
-
],
|
|
2852
|
+
], Jr = [
|
|
2849
2853
|
"stroke",
|
|
2850
2854
|
"x2",
|
|
2851
2855
|
"y1",
|
|
2852
2856
|
"y2"
|
|
2853
|
-
],
|
|
2857
|
+
], Yr = ["clip-path"], Xr = [
|
|
2854
2858
|
"data-y-axis-index",
|
|
2855
2859
|
"x2",
|
|
2856
2860
|
"y1",
|
|
@@ -2858,7 +2862,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2858
2862
|
"stroke",
|
|
2859
2863
|
"stroke-width",
|
|
2860
2864
|
"stroke-dasharray"
|
|
2861
|
-
],
|
|
2865
|
+
], Zr = ["x", "y"], Qr = /* @__PURE__ */ c({
|
|
2862
2866
|
__name: "WaveformTrackBackdrop",
|
|
2863
2867
|
props: {
|
|
2864
2868
|
track: {},
|
|
@@ -2883,12 +2887,12 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2883
2887
|
height: t.track.height,
|
|
2884
2888
|
fill: t.frameStyle.backgroundColor,
|
|
2885
2889
|
"aria-hidden": "true"
|
|
2886
|
-
}, null, 8,
|
|
2890
|
+
}, null, 8, Vr)) : r("", !0),
|
|
2887
2891
|
!t.track.isEmpty && t.track.hasVisibleSeries && !t.cleanView ? (g(), i("g", {
|
|
2888
2892
|
key: 1,
|
|
2889
2893
|
"clip-path": `url(#${t.clipPathId}-${t.track.index})`,
|
|
2890
2894
|
"aria-hidden": "true"
|
|
2891
|
-
}, [a("g",
|
|
2895
|
+
}, [a("g", Ur, [t.track.gridLines.vertical ? (g(!0), i(e, { key: 0 }, y(t.track.xMinorTicks, (e) => (g(), i("line", {
|
|
2892
2896
|
key: `x-minor-${t.track.index}-${e}`,
|
|
2893
2897
|
"data-grid-direction": "vertical",
|
|
2894
2898
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -2896,7 +2900,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2896
2900
|
x2: t.track.xScale(e),
|
|
2897
2901
|
y1: "0",
|
|
2898
2902
|
y2: t.track.height
|
|
2899
|
-
}, null, 8,
|
|
2903
|
+
}, null, 8, Wr))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMinorTicks, (e) => (g(), i("line", {
|
|
2900
2904
|
key: `y-minor-${t.track.index}-${e}`,
|
|
2901
2905
|
"data-grid-direction": "horizontal",
|
|
2902
2906
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -2904,7 +2908,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2904
2908
|
x2: t.track.width ?? t.innerWidth,
|
|
2905
2909
|
y1: t.track.yScale(e),
|
|
2906
2910
|
y2: t.track.yScale(e)
|
|
2907
|
-
}, null, 8,
|
|
2911
|
+
}, null, 8, Gr))), 128)) : r("", !0)]), a("g", Kr, [t.track.gridLines.vertical ? (g(!0), i(e, { key: 0 }, y(t.track.xMajorTicks, (e) => (g(), i("line", {
|
|
2908
2912
|
key: `x-major-${t.track.index}-${e}`,
|
|
2909
2913
|
"data-grid-direction": "vertical",
|
|
2910
2914
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -2912,7 +2916,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2912
2916
|
x2: t.track.xScale(e),
|
|
2913
2917
|
y1: "0",
|
|
2914
2918
|
y2: t.track.height
|
|
2915
|
-
}, null, 8,
|
|
2919
|
+
}, null, 8, qr))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMajorTicks, (e) => (g(), i("line", {
|
|
2916
2920
|
key: `y-major-${t.track.index}-${e}`,
|
|
2917
2921
|
"data-grid-direction": "horizontal",
|
|
2918
2922
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -2920,7 +2924,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2920
2924
|
x2: t.track.width ?? t.innerWidth,
|
|
2921
2925
|
y1: t.track.yScale(e),
|
|
2922
2926
|
y2: t.track.yScale(e)
|
|
2923
|
-
}, null, 8,
|
|
2927
|
+
}, null, 8, Jr))), 128)) : r("", !0)])], 8, Hr)) : r("", !0),
|
|
2924
2928
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.zeroLine.visible && !t.cleanView ? (g(), i("g", {
|
|
2925
2929
|
key: 2,
|
|
2926
2930
|
class: "waveform-track__zero-lines waveform-chart__zero-lines",
|
|
@@ -2937,7 +2941,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2937
2941
|
stroke: t.zeroLine.color,
|
|
2938
2942
|
"stroke-width": t.zeroLine.width,
|
|
2939
2943
|
"stroke-dasharray": t.zeroLine.dash || void 0
|
|
2940
|
-
}, null, 8,
|
|
2944
|
+
}, null, 8, Xr))], 64))), 128))], 8, Yr)) : r("", !0),
|
|
2941
2945
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.frameNumber !== void 0 && !t.cleanView ? (g(), i("text", {
|
|
2942
2946
|
key: 3,
|
|
2943
2947
|
class: "waveform-track__watermark waveform-chart__watermark",
|
|
@@ -2947,10 +2951,10 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2947
2951
|
"text-anchor": "middle",
|
|
2948
2952
|
"dominant-baseline": "central",
|
|
2949
2953
|
"aria-hidden": "true"
|
|
2950
|
-
}, S(t.frameNumber), 13,
|
|
2954
|
+
}, S(t.frameNumber), 13, Zr)) : r("", !0)
|
|
2951
2955
|
], 64));
|
|
2952
2956
|
}
|
|
2953
|
-
}),
|
|
2957
|
+
}), $r = [
|
|
2954
2958
|
"data-track-index",
|
|
2955
2959
|
"data-track-empty",
|
|
2956
2960
|
"data-track-left",
|
|
@@ -2959,19 +2963,19 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
2959
2963
|
"data-track-top",
|
|
2960
2964
|
"data-track-height",
|
|
2961
2965
|
"transform"
|
|
2962
|
-
],
|
|
2966
|
+
], ei = [
|
|
2963
2967
|
"width",
|
|
2964
2968
|
"height",
|
|
2965
2969
|
"stroke",
|
|
2966
2970
|
"stroke-width",
|
|
2967
2971
|
"stroke-dasharray",
|
|
2968
2972
|
"stroke-linecap"
|
|
2969
|
-
],
|
|
2973
|
+
], ti = [
|
|
2970
2974
|
"data-interactive",
|
|
2971
2975
|
"data-independent-overlay-index",
|
|
2972
2976
|
"width",
|
|
2973
2977
|
"height"
|
|
2974
|
-
],
|
|
2978
|
+
], ni = ["x", "y"], ri = /* @__PURE__ */ c({
|
|
2975
2979
|
__name: "WaveformTrack",
|
|
2976
2980
|
props: {
|
|
2977
2981
|
track: {},
|
|
@@ -3030,7 +3034,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3030
3034
|
"data-track-height": e.track.height,
|
|
3031
3035
|
transform: `translate(${e.track.left ?? 0}, ${e.track.top})`
|
|
3032
3036
|
}, [
|
|
3033
|
-
s(
|
|
3037
|
+
s(Qr, {
|
|
3034
3038
|
track: e.track,
|
|
3035
3039
|
"clip-path-id": e.clipPathId,
|
|
3036
3040
|
"inner-width": e.innerWidth,
|
|
@@ -3047,7 +3051,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3047
3051
|
"frame-style",
|
|
3048
3052
|
"zero-line"
|
|
3049
3053
|
]),
|
|
3050
|
-
s(
|
|
3054
|
+
s(Br, {
|
|
3051
3055
|
track: e.track,
|
|
3052
3056
|
"inner-width": e.innerWidth,
|
|
3053
3057
|
"clean-view": e.cleanView,
|
|
@@ -3073,8 +3077,8 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3073
3077
|
"stroke-dasharray": c.value.borderStyle === "dashed" ? "6 4" : c.value.borderStyle === "dotted" ? "1 3" : void 0,
|
|
3074
3078
|
"stroke-linecap": c.value.borderStyle === "dotted" ? "round" : void 0,
|
|
3075
3079
|
"aria-hidden": "true"
|
|
3076
|
-
}, null, 8,
|
|
3077
|
-
s(
|
|
3080
|
+
}, null, 8, ei)),
|
|
3081
|
+
s(Or, {
|
|
3078
3082
|
track: e.track,
|
|
3079
3083
|
"clip-path-id": e.clipPathId
|
|
3080
3084
|
}, null, 8, ["track", "clip-path-id"]),
|
|
@@ -3096,7 +3100,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3096
3100
|
onPointerleave: n[4] ||= (e) => o("pointer-leave"),
|
|
3097
3101
|
onClick: n[5] ||= (e) => o("click", e),
|
|
3098
3102
|
onContextmenu: n[6] ||= (e) => o("contextmenu", e)
|
|
3099
|
-
}, null, 42,
|
|
3103
|
+
}, null, 42, ti)) : r("", !0),
|
|
3100
3104
|
!e.track.isEmpty && !e.track.hasVisibleSeries && !e.cleanView ? (g(), i("text", {
|
|
3101
3105
|
key: 2,
|
|
3102
3106
|
class: "waveform-track__no-visible-series",
|
|
@@ -3104,33 +3108,33 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3104
3108
|
y: e.track.height / 2,
|
|
3105
3109
|
"text-anchor": "middle",
|
|
3106
3110
|
"dominant-baseline": "central"
|
|
3107
|
-
}, " 暂无可见曲线 ", 8,
|
|
3108
|
-
], 10,
|
|
3111
|
+
}, " 暂无可见曲线 ", 8, ni)) : r("", !0)
|
|
3112
|
+
], 10, $r));
|
|
3109
3113
|
}
|
|
3110
|
-
}),
|
|
3114
|
+
}), ii = [
|
|
3111
3115
|
"width",
|
|
3112
3116
|
"height",
|
|
3113
3117
|
"data-position",
|
|
3114
3118
|
"data-orientation"
|
|
3115
|
-
],
|
|
3119
|
+
], ai = [
|
|
3116
3120
|
"disabled",
|
|
3117
3121
|
"aria-pressed",
|
|
3118
3122
|
"aria-label",
|
|
3119
3123
|
"onClick"
|
|
3120
|
-
],
|
|
3124
|
+
], oi = [
|
|
3121
3125
|
"data-line-type",
|
|
3122
3126
|
"data-line-style",
|
|
3123
3127
|
"data-point-type",
|
|
3124
3128
|
"data-error-bar-visible"
|
|
3125
|
-
],
|
|
3129
|
+
], si = [
|
|
3126
3130
|
"d",
|
|
3127
3131
|
"stroke",
|
|
3128
3132
|
"stroke-dasharray"
|
|
3129
|
-
],
|
|
3133
|
+
], ci = [
|
|
3130
3134
|
"d",
|
|
3131
3135
|
"stroke",
|
|
3132
3136
|
"stroke-width"
|
|
3133
|
-
],
|
|
3137
|
+
], li = ["d", "fill"], ui = ["title"], di = /*#__PURE__*/ X(/* @__PURE__ */ c({
|
|
3134
3138
|
__name: "WaveformLegend",
|
|
3135
3139
|
props: {
|
|
3136
3140
|
series: {},
|
|
@@ -3188,45 +3192,45 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3188
3192
|
"data-point-type": e.pointType,
|
|
3189
3193
|
"data-error-bar-visible": e.errorBar.visible || void 0
|
|
3190
3194
|
}, [
|
|
3191
|
-
w(
|
|
3195
|
+
w(vr)(e.lineType) ? (g(), i("path", {
|
|
3192
3196
|
key: 0,
|
|
3193
3197
|
class: "waveform-legend__line",
|
|
3194
|
-
d: w(
|
|
3198
|
+
d: w(vr)(e.lineType) ?? void 0,
|
|
3195
3199
|
stroke: e.color,
|
|
3196
|
-
"stroke-dasharray": w(
|
|
3200
|
+
"stroke-dasharray": w(yr)(e.lineStyle),
|
|
3197
3201
|
"stroke-width": "1.5",
|
|
3198
3202
|
fill: "none"
|
|
3199
|
-
}, null, 8,
|
|
3203
|
+
}, null, 8, si)) : r("", !0),
|
|
3200
3204
|
e.errorBar.visible ? (g(), i("path", {
|
|
3201
3205
|
key: 1,
|
|
3202
3206
|
class: "waveform-legend__error-bar",
|
|
3203
|
-
d: w(
|
|
3207
|
+
d: w(br)(e.errorBar.capWidth),
|
|
3204
3208
|
stroke: e.errorBar.color || e.color,
|
|
3205
3209
|
"stroke-width": e.errorBar.width,
|
|
3206
3210
|
"stroke-linecap": "butt",
|
|
3207
3211
|
fill: "none"
|
|
3208
|
-
}, null, 8,
|
|
3212
|
+
}, null, 8, ci)) : r("", !0),
|
|
3209
3213
|
e.pointType === "none" ? r("", !0) : (g(), i("path", {
|
|
3210
3214
|
key: 2,
|
|
3211
3215
|
class: "waveform-legend__point",
|
|
3212
|
-
d: w(
|
|
3216
|
+
d: w(gr)(e.pointType, 30) ?? void 0,
|
|
3213
3217
|
fill: e.color,
|
|
3214
3218
|
transform: "translate(13 8)"
|
|
3215
|
-
}, null, 8,
|
|
3216
|
-
], 8,
|
|
3219
|
+
}, null, 8, li))
|
|
3220
|
+
], 8, oi)), a("span", {
|
|
3217
3221
|
class: "waveform-legend__label",
|
|
3218
3222
|
title: e.name
|
|
3219
|
-
}, S(e.name), 9,
|
|
3223
|
+
}, S(e.name), 9, ui)], 10, ai))), 128))], 6)], 2)], 8, ii));
|
|
3220
3224
|
}
|
|
3221
|
-
}), [["__scopeId", "data-v-2ae12e71"]]),
|
|
3225
|
+
}), [["__scopeId", "data-v-2ae12e71"]]), fi = {
|
|
3222
3226
|
class: "waveform-chart__hover-layer",
|
|
3223
3227
|
"pointer-events": "none",
|
|
3224
3228
|
"aria-hidden": "true"
|
|
3225
|
-
},
|
|
3229
|
+
}, pi = ["clip-path", "transform"], mi = [
|
|
3226
3230
|
"x1",
|
|
3227
3231
|
"x2",
|
|
3228
3232
|
"y2"
|
|
3229
|
-
],
|
|
3233
|
+
], hi = /*#__PURE__*/ X(/* @__PURE__ */ c({
|
|
3230
3234
|
__name: "WaveformHoverLayer",
|
|
3231
3235
|
props: {
|
|
3232
3236
|
state: {},
|
|
@@ -3249,7 +3253,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3249
3253
|
}] : [];
|
|
3250
3254
|
});
|
|
3251
3255
|
});
|
|
3252
|
-
return (t, r) => (g(), i("g",
|
|
3256
|
+
return (t, r) => (g(), i("g", fi, [(g(!0), i(e, null, y(o.value, (e) => (g(), i("g", {
|
|
3253
3257
|
key: e.track.index,
|
|
3254
3258
|
class: "waveform-track__crosshair waveform-chart__crosshair",
|
|
3255
3259
|
"clip-path": `url(#${n.clipPathId}-${e.track.index})`,
|
|
@@ -3259,44 +3263,44 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3259
3263
|
x2: e.x,
|
|
3260
3264
|
y1: "0",
|
|
3261
3265
|
y2: e.track.height
|
|
3262
|
-
}, null, 8,
|
|
3266
|
+
}, null, 8, mi)], 8, pi))), 128))]));
|
|
3263
3267
|
}
|
|
3264
|
-
}), [["__scopeId", "data-v-a6f82099"]]),
|
|
3268
|
+
}), [["__scopeId", "data-v-a6f82099"]]), gi = [
|
|
3265
3269
|
"data-display-mode",
|
|
3266
3270
|
"data-interaction-mode",
|
|
3267
3271
|
"data-presentation-mode",
|
|
3268
3272
|
"data-overlay-mode",
|
|
3269
3273
|
"data-chart-left-margin",
|
|
3270
3274
|
"data-title-area-height"
|
|
3271
|
-
],
|
|
3275
|
+
], _i = [
|
|
3272
3276
|
"role",
|
|
3273
3277
|
"aria-level",
|
|
3274
3278
|
"aria-hidden"
|
|
3275
|
-
],
|
|
3279
|
+
], vi = ["data-title-scale", "data-title-wrapped"], yi = [
|
|
3276
3280
|
"width",
|
|
3277
3281
|
"height",
|
|
3278
3282
|
"aria-label"
|
|
3279
|
-
],
|
|
3283
|
+
], bi = ["id"], xi = ["width", "height"], Si = ["transform"], Ci = {
|
|
3280
3284
|
key: 0,
|
|
3281
3285
|
class: "waveform-chart__grid-slots",
|
|
3282
3286
|
"aria-hidden": "true"
|
|
3283
|
-
},
|
|
3287
|
+
}, wi = ["transform"], Ti = ["width", "height"], Ei = ["width", "height"], Di = [
|
|
3284
3288
|
"x",
|
|
3285
3289
|
"y",
|
|
3286
3290
|
"width",
|
|
3287
3291
|
"height"
|
|
3288
|
-
],
|
|
3292
|
+
], Oi = {
|
|
3289
3293
|
key: 4,
|
|
3290
3294
|
class: "waveform-chart__legend-layer"
|
|
3291
|
-
},
|
|
3295
|
+
}, ki = [
|
|
3292
3296
|
"data-legend-track-index",
|
|
3293
3297
|
"data-legend-track-id",
|
|
3294
3298
|
"transform"
|
|
3295
|
-
],
|
|
3299
|
+
], Ai = ["x", "y"], ji = ["x", "y"], Mi = /* @__PURE__ */ c({
|
|
3296
3300
|
__name: "WaveformChartView",
|
|
3297
3301
|
props: { controller: {} },
|
|
3298
3302
|
setup(t) {
|
|
3299
|
-
let { displayMode: o, activeInteractionMode: c, isCleanView: l, isPresentationMode: u, selection: d, containerStyle: m, overlayMode: h, resolvedChartLeftMargin: _, titleAreaHeight: v, pointerInsideChart: b, handleNativeContextMenu: x, titleAreaReserved: T, titleAreaStyle: E, titleVisible: D, titleMeasureStyle: O, resolvedTitleText: k, titleVisualStyle: A, titleTextStyle: j, titleLayout: M, chartWidth: N, drawingHeight: P, hasWaveformData: F, requestViewportReset: I, trackLayouts: L, clipPathId: R, chartTopMargin: z, gridCells: B, hasVisibleWaveformData: V, zoomable: H, isZoomMode: ee, innerWidth: te, innerHeight: ne, handleSharedPointerMove: re, beginSharedViewportDrag: ie, finishViewportDrag: U, cancelViewportDrag:
|
|
3303
|
+
let { displayMode: o, activeInteractionMode: c, isCleanView: l, isPresentationMode: u, selection: d, containerStyle: m, overlayMode: h, resolvedChartLeftMargin: _, titleAreaHeight: v, pointerInsideChart: b, handleNativeContextMenu: x, titleAreaReserved: T, titleAreaStyle: E, titleVisible: D, titleMeasureStyle: O, resolvedTitleText: k, titleVisualStyle: A, titleTextStyle: j, titleLayout: M, chartWidth: N, drawingHeight: P, hasWaveformData: F, requestViewportReset: I, trackLayouts: L, clipPathId: R, chartTopMargin: z, gridCells: B, hasVisibleWaveformData: V, zoomable: H, isZoomMode: ee, innerWidth: te, innerHeight: ne, handleSharedPointerMove: re, beginSharedViewportDrag: ie, finishViewportDrag: U, cancelViewportDrag: ae, handlePointerLeave: W, handleAnnotationClick: se, handleAnnotationContextMenu: ce, resolveFrameNumber: le, frameStyle: ue, axes: de, resolvedZeroLine: fe, timeUnit: G, yLabel: pe, handleIndependentPointerMove: me, beginViewportDrag: he, hoverState: ge, showTooltip: _e, selectionBox: K, renderedAnnotations: ve, annotationsVisible: ye, handleExistingAnnotationContextMenu: be, beginAnnotationDrag: q, handleAnnotationMove: J, endAnnotationDrag: xe, resolveLegendPosition: Y, resolveLegendOrientation: Se, legendBackgroundColor: Ce, legendInteractive: we, resolvedHiddenSeriesIds: Te, toggleSeriesVisibility: Ee, resolvedXLabel: De, xAxisTitleY: Oe, hasChartArea: ke, gridOptions: Ae, pageCount: je, currentPage: Me, getPageSize: X, chartTracks: Fe, goToPage: Z, annotationInteraction: Ie, editorDraft: Le, contextMenu: Q, editorSeries: Re, editorSeriesOptions: ze, confirmAnnotation: Be, cancelAnnotation: Ve, changeDraftSeries: He, editContextAnnotation: Ue, deleteContextAnnotation: We, chartHeight: Ge, setContainer: $, setSvgElement: Ke, setTitleMeasureElement: qe, setSharedOverlayElement: Je } = C(t.controller);
|
|
3300
3304
|
return (t, C) => (g(), i("div", {
|
|
3301
3305
|
ref: w($),
|
|
3302
3306
|
class: f(["waveform-chart", [
|
|
@@ -3340,7 +3344,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3340
3344
|
style: p(w(j)),
|
|
3341
3345
|
"data-title-scale": w(M).scale,
|
|
3342
3346
|
"data-title-wrapped": w(M).wrapped || void 0
|
|
3343
|
-
}, S(w(k)), 13,
|
|
3347
|
+
}, S(w(k)), 13, vi)], 4)) : r("", !0)], 12, _i)) : r("", !0),
|
|
3344
3348
|
(g(), i("svg", {
|
|
3345
3349
|
ref: w(Ke),
|
|
3346
3350
|
class: "waveform-chart__svg",
|
|
@@ -3357,9 +3361,9 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3357
3361
|
}, [a("rect", {
|
|
3358
3362
|
width: e.width,
|
|
3359
3363
|
height: e.height
|
|
3360
|
-
}, null, 8,
|
|
3364
|
+
}, null, 8, xi)], 8, bi))), 128))]),
|
|
3361
3365
|
a("g", { transform: `translate(${w(_)}, ${w(z)})` }, [
|
|
3362
|
-
w(o) !== "compact" && !w(l) ? (g(), i("g",
|
|
3366
|
+
w(o) !== "compact" && !w(l) ? (g(), i("g", Ci, [(g(!0), i(e, null, y(w(B), (e) => (g(), i("g", {
|
|
3363
3367
|
key: `grid-slot-${e.slotIndex}`,
|
|
3364
3368
|
transform: `translate(${e.left}, ${e.top})`
|
|
3365
3369
|
}, [e.series ? r("", !0) : (g(), i("rect", {
|
|
@@ -3367,7 +3371,7 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3367
3371
|
class: "waveform-chart__grid-slot-placeholder",
|
|
3368
3372
|
width: e.width,
|
|
3369
3373
|
height: e.cellHeight
|
|
3370
|
-
}, null, 8,
|
|
3374
|
+
}, null, 8, Ti))], 8, wi))), 128))])) : r("", !0),
|
|
3371
3375
|
w(o) !== "independent" && w(L).length && w(V) ? (g(), i("rect", {
|
|
3372
3376
|
key: 1,
|
|
3373
3377
|
ref: w(Je),
|
|
@@ -3380,12 +3384,12 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3380
3384
|
onPointermove: C[0] ||= (...e) => w(re) && w(re)(...e),
|
|
3381
3385
|
onPointerdown: C[1] ||= (...e) => w(ie) && w(ie)(...e),
|
|
3382
3386
|
onPointerup: C[2] ||= (...e) => w(U) && w(U)(...e),
|
|
3383
|
-
onPointercancel: C[3] ||= (...e) => w(
|
|
3384
|
-
onPointerleave: C[4] ||= (...e) => w(
|
|
3385
|
-
onClick: C[5] ||= (...e) => w(
|
|
3386
|
-
onContextmenu: C[6] ||= (...e) => w(
|
|
3387
|
-
}, null, 42,
|
|
3388
|
-
(g(!0), i(e, null, y(w(L), (e) => (g(), n(w(
|
|
3387
|
+
onPointercancel: C[3] ||= (...e) => w(ae) && w(ae)(...e),
|
|
3388
|
+
onPointerleave: C[4] ||= (...e) => w(W) && w(W)(...e),
|
|
3389
|
+
onClick: C[5] ||= (...e) => w(se) && w(se)(...e),
|
|
3390
|
+
onContextmenu: C[6] ||= (...e) => w(ce) && w(ce)(...e)
|
|
3391
|
+
}, null, 42, Ei)) : r("", !0),
|
|
3392
|
+
(g(!0), i(e, null, y(w(L), (e) => (g(), n(w(ri), {
|
|
3389
3393
|
key: `${e.index}-${e.series.name}`,
|
|
3390
3394
|
track: e,
|
|
3391
3395
|
"clip-path-id": w(R),
|
|
@@ -3394,20 +3398,20 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3394
3398
|
interactive: !w(u),
|
|
3395
3399
|
"display-mode": w(o),
|
|
3396
3400
|
"interaction-mode": w(c),
|
|
3397
|
-
"frame-number": w(
|
|
3398
|
-
"frame-style": w(
|
|
3399
|
-
axes: w(
|
|
3401
|
+
"frame-number": w(le)(e.index),
|
|
3402
|
+
"frame-style": w(ue),
|
|
3403
|
+
axes: w(de),
|
|
3400
3404
|
"clean-view": w(l),
|
|
3401
|
-
"zero-line": w(
|
|
3402
|
-
"time-unit": w(
|
|
3403
|
-
"y-label": w(
|
|
3404
|
-
onPointerMove: (t) => w(
|
|
3405
|
-
onPointerDown: (t) => w(
|
|
3405
|
+
"zero-line": w(fe),
|
|
3406
|
+
"time-unit": w(G),
|
|
3407
|
+
"y-label": w(pe),
|
|
3408
|
+
onPointerMove: (t) => w(me)(t, e.index),
|
|
3409
|
+
onPointerDown: (t) => w(he)(t, e.index, !0),
|
|
3406
3410
|
onPointerUp: w(U),
|
|
3407
|
-
onPointerCancel: w(
|
|
3408
|
-
onPointerLeave: w(
|
|
3409
|
-
onClick: (t) => w(
|
|
3410
|
-
onContextmenu: (t) => w(
|
|
3411
|
+
onPointerCancel: w(ae),
|
|
3412
|
+
onPointerLeave: w(W),
|
|
3413
|
+
onClick: (t) => w(se)(t, e.index),
|
|
3414
|
+
onContextmenu: (t) => w(ce)(t, e.index)
|
|
3411
3415
|
}, null, 8, [
|
|
3412
3416
|
"track",
|
|
3413
3417
|
"clip-path-id",
|
|
@@ -3431,35 +3435,35 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3431
3435
|
"onClick",
|
|
3432
3436
|
"onContextmenu"
|
|
3433
3437
|
]))), 128)),
|
|
3434
|
-
s(w(
|
|
3435
|
-
state: w(
|
|
3438
|
+
s(w(hi), {
|
|
3439
|
+
state: w(ge),
|
|
3436
3440
|
tracks: w(L),
|
|
3437
3441
|
"clip-path-id": w(R),
|
|
3438
|
-
visible: w(
|
|
3442
|
+
visible: w(_e) && !w(u)
|
|
3439
3443
|
}, null, 8, [
|
|
3440
3444
|
"state",
|
|
3441
3445
|
"tracks",
|
|
3442
3446
|
"clip-path-id",
|
|
3443
3447
|
"visible"
|
|
3444
3448
|
]),
|
|
3445
|
-
w(
|
|
3449
|
+
w(K) && w(d)?.mode === "box" ? (g(), i("rect", {
|
|
3446
3450
|
key: 2,
|
|
3447
3451
|
class: "waveform-chart__zoom-selection",
|
|
3448
|
-
x: w(
|
|
3449
|
-
y: w(
|
|
3450
|
-
width: w(
|
|
3451
|
-
height: w(
|
|
3452
|
+
x: w(K).x,
|
|
3453
|
+
y: w(K).y,
|
|
3454
|
+
width: w(K).width,
|
|
3455
|
+
height: w(K).height,
|
|
3452
3456
|
"aria-hidden": "true"
|
|
3453
|
-
}, null, 8,
|
|
3454
|
-
w(l) ? r("", !0) : (g(), n(w(
|
|
3457
|
+
}, null, 8, Di)) : r("", !0),
|
|
3458
|
+
w(l) ? r("", !0) : (g(), n(w(Ne), {
|
|
3455
3459
|
key: 3,
|
|
3456
|
-
annotations: w(
|
|
3457
|
-
visible: w(
|
|
3460
|
+
annotations: w(ve),
|
|
3461
|
+
visible: w(ye),
|
|
3458
3462
|
interactive: !w(u),
|
|
3459
|
-
onContextmenu: w(
|
|
3460
|
-
onDragStart: w(
|
|
3461
|
-
onMove: w(
|
|
3462
|
-
onDragEnd: w(
|
|
3463
|
+
onContextmenu: w(be),
|
|
3464
|
+
onDragStart: w(q),
|
|
3465
|
+
onMove: w(J),
|
|
3466
|
+
onDragEnd: w(xe)
|
|
3463
3467
|
}, null, 8, [
|
|
3464
3468
|
"annotations",
|
|
3465
3469
|
"visible",
|
|
@@ -3469,23 +3473,23 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3469
3473
|
"onMove",
|
|
3470
3474
|
"onDragEnd"
|
|
3471
3475
|
])),
|
|
3472
|
-
w(l) ? r("", !0) : (g(), i("g",
|
|
3476
|
+
w(l) ? r("", !0) : (g(), i("g", Oi, [(g(!0), i(e, null, y(w(L), (e) => (g(), i("g", {
|
|
3473
3477
|
key: `legend-${e.index}-${e.series.name}`,
|
|
3474
3478
|
class: "waveform-chart__legend-track",
|
|
3475
3479
|
"data-legend-track-index": e.index,
|
|
3476
3480
|
"data-legend-track-id": e.id,
|
|
3477
3481
|
transform: `translate(${e.left}, ${e.top})`
|
|
3478
|
-
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(
|
|
3482
|
+
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(di), {
|
|
3479
3483
|
key: 0,
|
|
3480
3484
|
series: e.legendSeries,
|
|
3481
|
-
position: w(
|
|
3482
|
-
orientation: w(
|
|
3483
|
-
"background-color": w(
|
|
3484
|
-
interactive: w(
|
|
3485
|
-
"hidden-series-ids": w(
|
|
3485
|
+
position: w(Y)(e.id),
|
|
3486
|
+
orientation: w(Se)(w(Y)(e.id)),
|
|
3487
|
+
"background-color": w(Ce),
|
|
3488
|
+
interactive: w(we),
|
|
3489
|
+
"hidden-series-ids": w(Te),
|
|
3486
3490
|
width: e.width ?? w(te),
|
|
3487
3491
|
height: e.height,
|
|
3488
|
-
onToggle: w(
|
|
3492
|
+
onToggle: w(Ee)
|
|
3489
3493
|
}, null, 8, [
|
|
3490
3494
|
"series",
|
|
3491
3495
|
"position",
|
|
@@ -3496,46 +3500,46 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3496
3500
|
"width",
|
|
3497
3501
|
"height",
|
|
3498
3502
|
"onToggle"
|
|
3499
|
-
])) : r("", !0)], 8,
|
|
3500
|
-
w(
|
|
3503
|
+
])) : r("", !0)], 8, ki))), 128))])),
|
|
3504
|
+
w(De) && !w(l) ? (g(), i("text", {
|
|
3501
3505
|
key: 5,
|
|
3502
3506
|
class: "waveform-chart__label waveform-chart__x-label",
|
|
3503
3507
|
x: w(te) / 2,
|
|
3504
|
-
y: w(
|
|
3508
|
+
y: w(Oe),
|
|
3505
3509
|
"text-anchor": "middle"
|
|
3506
|
-
}, S(w(
|
|
3507
|
-
], 8,
|
|
3508
|
-
w(
|
|
3510
|
+
}, S(w(De)), 9, Ai)) : r("", !0)
|
|
3511
|
+
], 8, Si),
|
|
3512
|
+
w(ke) && !w(F) ? (g(), i("text", {
|
|
3509
3513
|
key: 0,
|
|
3510
3514
|
class: "waveform-chart__empty",
|
|
3511
3515
|
x: w(N) / 2,
|
|
3512
3516
|
y: w(P) / 2,
|
|
3513
3517
|
"text-anchor": "middle"
|
|
3514
|
-
}, " 暂无有效波形数据 ", 8,
|
|
3515
|
-
], 40,
|
|
3516
|
-
w(
|
|
3518
|
+
}, " 暂无有效波形数据 ", 8, ji)) : r("", !0)
|
|
3519
|
+
], 40, yi)),
|
|
3520
|
+
w(Ae).showPagination && w(je) > 1 && !w(l) ? (g(), n(w(oe), {
|
|
3517
3521
|
key: 1,
|
|
3518
3522
|
class: "waveform-chart__pagination",
|
|
3519
3523
|
"aria-label": "波形分页",
|
|
3520
|
-
current: w(
|
|
3521
|
-
"page-size": w(
|
|
3522
|
-
total: w(
|
|
3524
|
+
current: w(Me),
|
|
3525
|
+
"page-size": w(X)(w(Ae)),
|
|
3526
|
+
total: w(Fe).length,
|
|
3523
3527
|
"show-size-changer": !1,
|
|
3524
3528
|
"show-quick-jumper": !1,
|
|
3525
|
-
onChange: w(
|
|
3529
|
+
onChange: w(Z)
|
|
3526
3530
|
}, null, 8, [
|
|
3527
3531
|
"current",
|
|
3528
3532
|
"page-size",
|
|
3529
3533
|
"total",
|
|
3530
3534
|
"onChange"
|
|
3531
3535
|
])) : r("", !0),
|
|
3532
|
-
w(
|
|
3536
|
+
w(Le) && !w(l) && !w(u) ? (g(), n(er, {
|
|
3533
3537
|
key: 2,
|
|
3534
|
-
annotation: w(
|
|
3535
|
-
mode: w(
|
|
3538
|
+
annotation: w(Le).annotation,
|
|
3539
|
+
mode: w(Le).mode,
|
|
3536
3540
|
series: w(Re),
|
|
3537
3541
|
"series-options": w(ze),
|
|
3538
|
-
"time-unit": w(
|
|
3542
|
+
"time-unit": w(G),
|
|
3539
3543
|
onConfirm: w(Be),
|
|
3540
3544
|
onCancel: w(Ve),
|
|
3541
3545
|
onSeriesChange: w(He)
|
|
@@ -3549,15 +3553,15 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3549
3553
|
"onCancel",
|
|
3550
3554
|
"onSeriesChange"
|
|
3551
3555
|
])) : r("", !0),
|
|
3552
|
-
!w(l) && !w(u) ? (g(), n(w(
|
|
3556
|
+
!w(l) && !w(u) ? (g(), n(w(Pe), {
|
|
3553
3557
|
key: 3,
|
|
3554
|
-
visible: w(
|
|
3555
|
-
x: w(
|
|
3556
|
-
y: w(
|
|
3557
|
-
"can-edit": !!w(
|
|
3558
|
+
visible: w(Q) !== null,
|
|
3559
|
+
x: w(Q)?.x || 0,
|
|
3560
|
+
y: w(Q)?.y || 0,
|
|
3561
|
+
"can-edit": !!w(Q)?.annotationId,
|
|
3558
3562
|
onEdit: w(Ue),
|
|
3559
3563
|
onDelete: w(We),
|
|
3560
|
-
onClose: w(
|
|
3564
|
+
onClose: w(Ie).closeContextMenu
|
|
3561
3565
|
}, null, 8, [
|
|
3562
3566
|
"visible",
|
|
3563
3567
|
"x",
|
|
@@ -3567,10 +3571,10 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3567
3571
|
"onDelete",
|
|
3568
3572
|
"onClose"
|
|
3569
3573
|
])) : r("", !0),
|
|
3570
|
-
s(w(
|
|
3571
|
-
state: w(
|
|
3572
|
-
visible: w(
|
|
3573
|
-
"time-unit": w(
|
|
3574
|
+
s(w(lr), {
|
|
3575
|
+
state: w(ge),
|
|
3576
|
+
visible: w(_e) && !w(u),
|
|
3577
|
+
"time-unit": w(G),
|
|
3574
3578
|
"container-width": w(N),
|
|
3575
3579
|
"container-height": w(Ge)
|
|
3576
3580
|
}, null, 8, [
|
|
@@ -3580,9 +3584,9 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3580
3584
|
"container-width",
|
|
3581
3585
|
"container-height"
|
|
3582
3586
|
])
|
|
3583
|
-
], 46,
|
|
3587
|
+
], 46, gi));
|
|
3584
3588
|
}
|
|
3585
|
-
}),
|
|
3589
|
+
}), Ni = /* @__PURE__ */ c({
|
|
3586
3590
|
__name: "WaveformChart",
|
|
3587
3591
|
props: {
|
|
3588
3592
|
data: {},
|
|
@@ -3658,9 +3662,9 @@ var Sr = ["clip-path"], Cr = ["data-series-id", "data-series-name"], wr = [
|
|
|
3658
3662
|
"page-change"
|
|
3659
3663
|
],
|
|
3660
3664
|
setup(e, { expose: t, emit: r }) {
|
|
3661
|
-
let i =
|
|
3662
|
-
return t({ resetViewport: i.resetViewport }), (e, t) => (g(), n(
|
|
3665
|
+
let i = Pn(e, r);
|
|
3666
|
+
return t({ resetViewport: i.resetViewport }), (e, t) => (g(), n(Mi, { controller: w(i) }, null, 8, ["controller"]));
|
|
3663
3667
|
}
|
|
3664
3668
|
});
|
|
3665
3669
|
//#endregion
|
|
3666
|
-
export {
|
|
3670
|
+
export { Nt as DEFAULT_WAVEFORM_RENDERING_OPTIONS, Ni as WaveformChart, Ke as buildMinorTicks, ft as clamp, at as displayTime, ct as formatAxisTime, st as formatEndpointTime, lt as formatTooltipTime, jt as normalizeWaveformData, Mt as normalizeWaveformSeries, $ as paddedDomain, We as parseWaveformAnnotations, dt as resolveTrackGeometry, Pt as resolveWaveformRenderingOptions, Vt as selectRenderablePoints, Ue as serializeWaveformAnnotations };
|