waveform-analysis 0.1.29 → 0.1.31
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 +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +937 -714
- package/dist/style.css +1 -1
- package/dist/types/components/WaveformChart.vue.d.ts +1 -0
- package/dist/types/components/core/constants.d.ts +2 -0
- package/dist/types/components/core/useWaveformChartController.d.ts +8 -15
- package/dist/types/components/core/useWaveformChartLifecycle.d.ts +4 -1
- package/dist/types/components/core/useWaveformData.d.ts +1 -1
- package/dist/types/components/core/useWaveformLayout.d.ts +0 -1
- package/dist/types/components/core/useWaveformPresentation.d.ts +5 -0
- package/dist/types/components/core/waveformChartTypes.d.ts +9 -5
- package/dist/types/components/data/types.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/interaction/pointerCapture.d.ts +1 -0
- package/dist/types/components/interaction/viewportInteractionState.d.ts +39 -0
- package/dist/types/components/interaction/zoomConstraints.d.ts +14 -0
- package/dist/types/components/waveform.d.ts +1 -1
- package/dist/types/core/rendering.d.ts +1 -4
- package/dist/types/core/renderingStrategies.d.ts +22 -0
- package/dist/types/demo/types.d.ts +4 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/chart.d.ts +7 -0
- package/dist/types/types/index.d.ts +1 -1
- package/package.json +5 -1
- package/src/App.vue +10 -4
- package/src/components/WaveformChart.vue +1 -0
- package/src/components/WaveformChartView.vue +15 -12
- package/src/components/core/constants.ts +3 -0
- package/src/components/core/useWaveformChartController.ts +7 -2
- package/src/components/core/useWaveformChartLifecycle.ts +47 -3
- package/src/components/core/useWaveformData.ts +6 -1
- package/src/components/core/useWaveformLayout.ts +0 -3
- package/src/components/core/useWaveformPresentation.ts +17 -2
- package/src/components/core/waveformChartTypes.ts +7 -3
- package/src/components/data/types.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/components/interaction/WaveformTooltip.test.ts +39 -0
- package/src/components/interaction/WaveformTooltip.vue +72 -22
- package/src/components/interaction/pointerCapture.ts +10 -0
- package/src/components/interaction/useWaveformHover.ts +1 -1
- package/src/components/interaction/useWaveformViewport.ts +86 -74
- package/src/components/interaction/useWaveformZoom.ts +46 -14
- package/src/components/interaction/viewportInteractionState.test.ts +101 -0
- package/src/components/interaction/viewportInteractionState.ts +89 -0
- package/src/components/interaction/zoomConstraints.ts +167 -0
- package/src/components/waveform.ts +1 -0
- package/src/components/waveformChartCases/sizingAndTitles.test.ts +59 -0
- package/src/components/waveformChartCases/viewportLifecycle.test.ts +132 -0
- package/src/components/waveformChartCases/zoomPointConstraints.test.ts +248 -0
- package/src/core/rendering.ts +11 -81
- package/src/core/renderingStrategies.test.ts +90 -0
- package/src/core/renderingStrategies.ts +131 -0
- package/src/data/simulatedWaveforms.ts +9 -10
- package/src/demo/DemoChartHost.vue +2 -2
- package/src/demo/DemoGridFrameControls.vue +29 -0
- package/src/demo/plotMarginControls.test.ts +29 -0
- package/src/demo/types.ts +4 -1
- package/src/index.ts +1 -0
- package/src/styles.css +1 -0
- package/src/types/chart.ts +8 -0
- package/src/types/index.ts +1 -0
- package/src/utils/formatters.test.ts +4 -3
- package/src/utils/formatters.ts +1 -2
- package/src/utils/sampling.ts +2 -1
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
|
|
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 U, symbolDiamond as ee, symbolSquare as W, symbolTriangle as te, zoom as G, zoomIdentity as K, zoomTransform as ne } from "d3";
|
|
3
|
+
import { Pagination as re } from "ant-design-vue";
|
|
4
|
+
import { ColorPicker as q } from "vue3-colorpicker";
|
|
5
5
|
import "vue3-colorpicker/style.css";
|
|
6
6
|
//#region src/utils/waveformId.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
7
|
+
var ie = 0;
|
|
8
|
+
function ae(e = "waveform") {
|
|
9
9
|
let t = l();
|
|
10
|
-
return `${e}-${t ? `v${t.uid}` : `f${++
|
|
10
|
+
return `${e}-${t ? `v${t.uid}` : `f${++ie}`}`;
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/components/annotation/annotationLayout.ts
|
|
14
|
-
function
|
|
14
|
+
function oe(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 se(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 ue(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 ce(e, t, n, r, i, a, o) {
|
|
28
|
+
let s = de(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 le(e, t, n, r, i, a) {
|
|
32
32
|
for (let o of [
|
|
33
33
|
"top",
|
|
34
34
|
"bottom",
|
|
@@ -38,10 +38,10 @@ function fe(e, t, n, r, i, a) {
|
|
|
38
38
|
"top-left",
|
|
39
39
|
"bottom-right",
|
|
40
40
|
"bottom-left"
|
|
41
|
-
]) if (
|
|
41
|
+
]) if (ce(e, t, n, r, o, i, a)) return o;
|
|
42
42
|
return "top";
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ue(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 G(e, t, n) {
|
|
|
56
56
|
y: s
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function de(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 pe(e, t, n, r, i) {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function J(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(be), 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 fe(e, t, n, r, i, a, o = 0, s = 0) {
|
|
103
|
+
let { width: c, height: l } = J(n, r, i), u = de(e, t, c, l, a), d = se({
|
|
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 = ue(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 pe(e, t, n, r) {
|
|
118
118
|
let i = [];
|
|
119
119
|
return e.forEach((e) => {
|
|
120
|
-
if (!
|
|
120
|
+
if (!xe(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 (!oe(e.x, o) || !oe(e.y, s)) return;
|
|
125
|
+
let c = Se(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 } = J(c, u, m), y = g ? "top" : le(d, h, _, v, u, m), b = fe(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 ge(e, t, n, r) {
|
|
|
137
137
|
placement: y,
|
|
138
138
|
lines: c,
|
|
139
139
|
box: { ...x },
|
|
140
|
-
style:
|
|
140
|
+
style: Z(e.style)
|
|
141
141
|
});
|
|
142
142
|
}), i;
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/components/annotation/markup.ts
|
|
146
|
-
var
|
|
146
|
+
var Y = {
|
|
147
147
|
borderColor: "#1677ff",
|
|
148
148
|
textColor: "#333333",
|
|
149
149
|
backgroundColor: "rgba(255, 255, 255, 0.92)"
|
|
150
|
-
},
|
|
151
|
-
function
|
|
150
|
+
}, me = "12px Arial, sans-serif", he = N((e) => e.x);
|
|
151
|
+
function ge(e, t) {
|
|
152
152
|
if (!e.length || !Number.isFinite(t)) return null;
|
|
153
|
-
let n =
|
|
153
|
+
let n = he.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 _e(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 = he.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 be(e, t, n = "linear") {
|
|
|
188
188
|
y: s.y + (o.y - s.y) * l
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function ve(e, t, n, r) {
|
|
192
192
|
return e.flatMap((e) => {
|
|
193
|
-
let i =
|
|
193
|
+
let i = _e(e.series.points, t, e.series.lineType);
|
|
194
194
|
if (!i) return [];
|
|
195
|
-
let a =
|
|
195
|
+
let a = ge(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 || Y.borderColor,
|
|
203
203
|
unit: e.series.unit,
|
|
204
204
|
point: a,
|
|
205
205
|
screenX: c,
|
|
@@ -208,24 +208,24 @@ function q(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 X;
|
|
212
|
+
function ye(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 be(e) {
|
|
216
|
+
return X === void 0 && (X = null, typeof document < "u" && typeof CanvasRenderingContext2D < "u" && (X = document.createElement("canvas").getContext("2d"), X && (X.font = me))), X?.measureText(e).width ?? ye(e);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Z(e) {
|
|
219
219
|
return {
|
|
220
|
-
borderColor: e?.borderColor ||
|
|
221
|
-
textColor: e?.textColor ||
|
|
222
|
-
backgroundColor: e?.backgroundColor ||
|
|
220
|
+
borderColor: e?.borderColor || Y.borderColor,
|
|
221
|
+
textColor: e?.textColor || Y.textColor,
|
|
222
|
+
backgroundColor: e?.backgroundColor || Y.backgroundColor
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function xe(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 Se(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 we(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 Ce = [
|
|
242
242
|
"data-annotation-id",
|
|
243
243
|
"data-placement",
|
|
244
244
|
"onPointerdown",
|
|
245
245
|
"onContextmenu"
|
|
246
|
-
],
|
|
246
|
+
], we = ["id"], Te = ["fill"], Ee = [
|
|
247
247
|
"x1",
|
|
248
248
|
"y1",
|
|
249
249
|
"x2",
|
|
250
250
|
"y2",
|
|
251
251
|
"stroke",
|
|
252
252
|
"marker-end"
|
|
253
|
-
],
|
|
253
|
+
], De = [
|
|
254
254
|
"x",
|
|
255
255
|
"y",
|
|
256
256
|
"width",
|
|
257
257
|
"height",
|
|
258
258
|
"fill",
|
|
259
259
|
"stroke"
|
|
260
|
-
],
|
|
260
|
+
], Oe = [
|
|
261
261
|
"x",
|
|
262
262
|
"y",
|
|
263
263
|
"fill"
|
|
264
|
-
],
|
|
264
|
+
], ke = ["x", "dy"], Ae = /*@__PURE__*/ c({
|
|
265
265
|
__name: "WaveformAnnotationLayer",
|
|
266
266
|
props: {
|
|
267
267
|
annotations: {},
|
|
@@ -401,7 +401,7 @@ var Te = [
|
|
|
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, Te)], 8, we)]),
|
|
405
405
|
a("line", {
|
|
406
406
|
class: "waveform-annotation__arrow",
|
|
407
407
|
x1: b(t).lineEndX,
|
|
@@ -410,7 +410,7 @@ var Te = [
|
|
|
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, Ee),
|
|
414
414
|
a("rect", {
|
|
415
415
|
class: "waveform-annotation__box",
|
|
416
416
|
x: b(t).x,
|
|
@@ -419,27 +419,27 @@ var Te = [
|
|
|
419
419
|
height: b(t).height,
|
|
420
420
|
fill: t.style.backgroundColor,
|
|
421
421
|
stroke: t.style.borderColor
|
|
422
|
-
}, null, 8,
|
|
422
|
+
}, null, 8, De),
|
|
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(me) }),
|
|
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, ke))), 128))], 12, Oe)
|
|
436
|
+
], 40, Ce))), 128))], 2)) : r("", !0);
|
|
437
437
|
}
|
|
438
|
-
}),
|
|
438
|
+
}), je = (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
|
+
}, Me = /*#__PURE__*/ je(Ae, [["__scopeId", "data-v-7254383e"]]), Ne = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
443
443
|
__name: "WaveformAnnotationContextMenu",
|
|
444
444
|
props: {
|
|
445
445
|
visible: { type: Boolean },
|
|
@@ -481,33 +481,33 @@ var Te = [
|
|
|
481
481
|
}, "取消")
|
|
482
482
|
], 36)) : r("", !0);
|
|
483
483
|
}
|
|
484
|
-
}), [["__scopeId", "data-v-c70c98a1"]]),
|
|
485
|
-
function
|
|
484
|
+
}), [["__scopeId", "data-v-c70c98a1"]]), Pe = 1;
|
|
485
|
+
function Q(e) {
|
|
486
486
|
throw TypeError(`Invalid waveform annotation file: ${e}`);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Fe(e) {
|
|
489
489
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Ie(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) && Q(`${n}.${t} must be a non-empty string`), r;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Le(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" && Q(`${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)) && Q(`${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)) && Q(`${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
|
+
Fe(e) || Q(`${t} must be an object`);
|
|
510
|
+
let n = Le(e, "borderColor", t), r = Le(e, "textColor", t), i = Le(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
|
+
Fe(e) || Q(`${n} must be an object`);
|
|
520
|
+
let r = Ie(e, "text", n);
|
|
521
|
+
r.length > 40 && Q(`${n}.text must not exceed 40 characters`);
|
|
522
|
+
let i = ze(e, "labelOffsetX", n), a = ze(e, "labelOffsetY", n), o = Le(e, "createdAt", n), s = Be(e.style, `${n}.style`);
|
|
523
523
|
return {
|
|
524
|
-
id:
|
|
525
|
-
seriesId:
|
|
524
|
+
id: Ie(e, "id", n),
|
|
525
|
+
seriesId: Ie(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) && Q(`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: Pe,
|
|
544
544
|
annotations: He(e)
|
|
545
545
|
}, null, 2);
|
|
546
546
|
}
|
|
547
547
|
function We(e) {
|
|
548
|
-
typeof e != "string" &&
|
|
548
|
+
typeof e != "string" && Q("input must be a JSON string");
|
|
549
549
|
let t;
|
|
550
550
|
try {
|
|
551
551
|
t = JSON.parse(e);
|
|
552
552
|
} catch {
|
|
553
|
-
|
|
553
|
+
Q("input is not valid JSON");
|
|
554
554
|
}
|
|
555
|
-
return
|
|
555
|
+
return Fe(t) || Q("root must be an object"), t.version !== Pe && Q(`version must be ${Pe}`), Array.isArray(t.annotations) || Q("annotations must be an array"), He(t.annotations);
|
|
556
556
|
}
|
|
557
557
|
//#endregion
|
|
558
558
|
//#region src/components/annotation/useWaveformAnnotationInteraction.ts
|
|
@@ -635,7 +635,7 @@ function Qe(e) {
|
|
|
635
635
|
}
|
|
636
636
|
function $e(e, t) {
|
|
637
637
|
if (typeof e != "number" || typeof t != "number") return null;
|
|
638
|
-
let n = Math.
|
|
638
|
+
let n = Math.max(Math.abs(e), Math.abs(t));
|
|
639
639
|
return Qe(n) ? Math.floor(Math.log10(n)) : null;
|
|
640
640
|
}
|
|
641
641
|
function et(e) {
|
|
@@ -839,84 +839,110 @@ function Mt(e) {
|
|
|
839
839
|
}).filter((e) => e.points.length > 0);
|
|
840
840
|
}
|
|
841
841
|
//#endregion
|
|
842
|
+
//#region src/core/renderingStrategies.ts
|
|
843
|
+
function Nt(e, t) {
|
|
844
|
+
return {
|
|
845
|
+
start: Math.max(0, e.start - 1),
|
|
846
|
+
end: Math.min(t, e.end + 1)
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
function Pt(e, t) {
|
|
850
|
+
t && e[e.length - 1] !== t && e.push(t);
|
|
851
|
+
}
|
|
852
|
+
var Ft = (e) => {
|
|
853
|
+
let { start: t, end: n } = Nt(e.range, e.points.length);
|
|
854
|
+
return e.points.slice(t, n);
|
|
855
|
+
}, It = (e) => {
|
|
856
|
+
let { points: t, range: n, domain: r, width: i, options: a } = e, { start: o, end: s } = Nt(n, t.length);
|
|
857
|
+
if (s - o <= 0) return [];
|
|
858
|
+
let c = Math.min(r[0], r[1]), l = Math.max(r[0], r[1]), u = Math.max(4, Math.floor(i * a.maxPointsPerPixel)), d = Math.max(1, Math.floor(u / 4)), f = [], p = l - c || 1, m = Array.from({ length: 4 }, () => -1), h = -1, g = -1, _ = -1, v = -1, y = -1, b = (e, t) => {
|
|
859
|
+
if (e < 0) return t;
|
|
860
|
+
for (let n = 0; n < t; n += 1) if (m[n] === e) return t;
|
|
861
|
+
return m[t] = e, t + 1;
|
|
862
|
+
}, x = () => {
|
|
863
|
+
if (g < 0) return;
|
|
864
|
+
let e = 0;
|
|
865
|
+
e = b(g, e), e = b(v, e), e = b(y, e), e = b(_, e);
|
|
866
|
+
for (let t = 1; t < e; t += 1) {
|
|
867
|
+
let e = m[t], n = t - 1;
|
|
868
|
+
for (; n >= 0 && m[n] > e;) m[n + 1] = m[n], --n;
|
|
869
|
+
m[n + 1] = e;
|
|
870
|
+
}
|
|
871
|
+
for (let n = 0; n < e; n += 1) Pt(f, t[m[n]]);
|
|
872
|
+
};
|
|
873
|
+
Pt(f, t[o]);
|
|
874
|
+
for (let e = n.start; e < n.end; e += 1) {
|
|
875
|
+
let n = t[e], r = Math.min(d - 1, Math.max(0, Math.floor((n.x - c) / p * d)));
|
|
876
|
+
if (r !== h) {
|
|
877
|
+
x(), h = r, g = e, _ = e, v = e, y = e;
|
|
878
|
+
continue;
|
|
879
|
+
}
|
|
880
|
+
_ = e, n.y < t[v].y && (v = e), n.y > t[y].y && (y = e);
|
|
881
|
+
}
|
|
882
|
+
return x(), Pt(f, t[s - 1]), f;
|
|
883
|
+
};
|
|
884
|
+
function Lt(e) {
|
|
885
|
+
let t = Math.max(4, Math.floor(e.width * e.options.maxPointsPerPixel));
|
|
886
|
+
return !e.options.downsample || e.visibleCount <= e.options.downsampleThreshold || e.visibleCount <= t ? Ft : It;
|
|
887
|
+
}
|
|
888
|
+
//#endregion
|
|
842
889
|
//#region src/core/renderingOptions.ts
|
|
843
|
-
var
|
|
890
|
+
var Rt = {
|
|
844
891
|
downsample: !0,
|
|
845
892
|
downsampleThreshold: 2e3,
|
|
846
893
|
maxPointsPerPixel: 4,
|
|
847
894
|
pointMinSpacing: 10,
|
|
848
895
|
errorBarMinSpacing: 12
|
|
849
896
|
};
|
|
850
|
-
function
|
|
897
|
+
function zt(e) {
|
|
851
898
|
let t = Number(e?.downsampleThreshold), n = Number(e?.maxPointsPerPixel), r = Number(e?.pointMinSpacing), i = Number(e?.errorBarMinSpacing);
|
|
852
899
|
return {
|
|
853
|
-
downsample: e?.downsample ??
|
|
854
|
-
downsampleThreshold: Number.isFinite(t) && t >= 2 ? Math.floor(t) :
|
|
855
|
-
maxPointsPerPixel: Number.isFinite(n) && n > 0 ? n :
|
|
856
|
-
pointMinSpacing: Number.isFinite(r) && r >= 0 ? r :
|
|
857
|
-
errorBarMinSpacing: Number.isFinite(i) && i >= 0 ? i :
|
|
900
|
+
downsample: e?.downsample ?? Rt.downsample,
|
|
901
|
+
downsampleThreshold: Number.isFinite(t) && t >= 2 ? Math.floor(t) : Rt.downsampleThreshold,
|
|
902
|
+
maxPointsPerPixel: Number.isFinite(n) && n > 0 ? n : Rt.maxPointsPerPixel,
|
|
903
|
+
pointMinSpacing: Number.isFinite(r) && r >= 0 ? r : Rt.pointMinSpacing,
|
|
904
|
+
errorBarMinSpacing: Number.isFinite(i) && i >= 0 ? i : Rt.errorBarMinSpacing
|
|
858
905
|
};
|
|
859
906
|
}
|
|
860
907
|
//#endregion
|
|
861
908
|
//#region src/core/rendering.ts
|
|
862
|
-
var
|
|
863
|
-
function
|
|
909
|
+
var Bt = N((e) => e.x), Vt = () => !0;
|
|
910
|
+
function Ht(e, t) {
|
|
864
911
|
let n = Math.min(t[0], t[1]), r = Math.max(t[0], t[1]);
|
|
865
912
|
return {
|
|
866
|
-
start:
|
|
867
|
-
end:
|
|
913
|
+
start: Bt.left(e, n),
|
|
914
|
+
end: Bt.right(e, r)
|
|
868
915
|
};
|
|
869
916
|
}
|
|
870
|
-
function
|
|
917
|
+
function Ut(e, t, n) {
|
|
871
918
|
if (!Number.isFinite(n) || n <= 0) return !0;
|
|
872
919
|
let r = Math.ceil(n), i = /* @__PURE__ */ new Set();
|
|
873
920
|
for (let n of e) {
|
|
874
|
-
let e =
|
|
921
|
+
let e = Ht(n.points, t);
|
|
875
922
|
for (let t = e.start; t < e.end; t += 1) if (i.add(n.points[t].x), i.size >= r) return !0;
|
|
876
923
|
}
|
|
877
924
|
return !1;
|
|
878
925
|
}
|
|
879
|
-
function
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
}, x = () => {
|
|
893
|
-
if (g < 0) return;
|
|
894
|
-
let t = 0;
|
|
895
|
-
t = b(g, t), t = b(v, t), t = b(y, t), t = b(_, t);
|
|
896
|
-
for (let e = 1; e < t; e += 1) {
|
|
897
|
-
let t = m[e], n = e - 1;
|
|
898
|
-
for (; n >= 0 && m[n] > t;) m[n + 1] = m[n], --n;
|
|
899
|
-
m[n + 1] = t;
|
|
900
|
-
}
|
|
901
|
-
for (let n = 0; n < t; n += 1) zt(f, e[m[n]]);
|
|
902
|
-
};
|
|
903
|
-
zt(f, e[s]);
|
|
904
|
-
for (let n = t.start; n < t.end; n += 1) {
|
|
905
|
-
let t = e[n], r = Math.min(d - 1, Math.max(0, Math.floor((t.x - a) / p * d)));
|
|
906
|
-
if (r !== h) {
|
|
907
|
-
x(), h = r, g = n, _ = n, v = n, y = n;
|
|
908
|
-
continue;
|
|
909
|
-
}
|
|
910
|
-
_ = n, t.y < e[v].y && (v = n), t.y > e[y].y && (y = n);
|
|
911
|
-
}
|
|
912
|
-
return x(), zt(f, e[c - 1]), f;
|
|
926
|
+
function Wt(e, t, n, r, i) {
|
|
927
|
+
let a = Math.max(0, t.start - 1), o = Math.min(e.length, t.end + 1) - a;
|
|
928
|
+
return o <= 0 ? [] : Lt({
|
|
929
|
+
visibleCount: o,
|
|
930
|
+
width: r,
|
|
931
|
+
options: i
|
|
932
|
+
})({
|
|
933
|
+
points: e,
|
|
934
|
+
range: t,
|
|
935
|
+
domain: n,
|
|
936
|
+
width: r,
|
|
937
|
+
options: i
|
|
938
|
+
});
|
|
913
939
|
}
|
|
914
|
-
function
|
|
915
|
-
return !e.length || n <= 0 ? [] :
|
|
940
|
+
function Gt(e, t, n, r) {
|
|
941
|
+
return !e.length || n <= 0 ? [] : Wt(e, Ht(e, t), t, n, r);
|
|
916
942
|
}
|
|
917
|
-
function
|
|
943
|
+
function Kt(e, t, n, r, i, a, o, s) {
|
|
918
944
|
if (!a || i === 0) {
|
|
919
|
-
if (o ===
|
|
945
|
+
if (o === Vt) return e.slice(t.start, t.end);
|
|
920
946
|
let n = [];
|
|
921
947
|
for (let r = t.start; r < t.end; r += 1) o(e[r]) && n.push(e[r]);
|
|
922
948
|
return n;
|
|
@@ -949,36 +975,36 @@ function Ht(e, t, n, r, i, a, o, s) {
|
|
|
949
975
|
let w = (f ?? []).map((e, t) => m?.[t] ?? e).filter((e) => e !== void 0);
|
|
950
976
|
return v && w[0] !== v && w.unshift(v), y && w.at(-1) !== y && w.push(y), w;
|
|
951
977
|
}
|
|
952
|
-
function
|
|
978
|
+
function qt(e) {
|
|
953
979
|
let { lower: t, upper: n } = At(e);
|
|
954
980
|
return t !== 0 || n !== 0;
|
|
955
981
|
}
|
|
956
|
-
function
|
|
982
|
+
function Jt(e, t, n, r, i) {
|
|
957
983
|
if (!e.length || n <= 0) return {
|
|
958
984
|
linePoints: [],
|
|
959
985
|
pointRenderPoints: [],
|
|
960
986
|
errorBarRenderPoints: []
|
|
961
987
|
};
|
|
962
|
-
let a =
|
|
988
|
+
let a = Ht(e, t), o = i.lineVisible ? Wt(e, a, t, n, r) : [], s = i.errorBarVisible && i.hasErrorPoints;
|
|
963
989
|
if (i.pointVisible && s) {
|
|
964
|
-
let i =
|
|
990
|
+
let i = Kt(e, a, t, n, Math.max(r.pointMinSpacing, r.errorBarMinSpacing), r.downsample, Vt, qt);
|
|
965
991
|
return {
|
|
966
992
|
linePoints: o,
|
|
967
993
|
pointRenderPoints: i,
|
|
968
|
-
errorBarRenderPoints: i.filter(
|
|
994
|
+
errorBarRenderPoints: i.filter(qt)
|
|
969
995
|
};
|
|
970
996
|
}
|
|
971
997
|
return {
|
|
972
998
|
linePoints: o,
|
|
973
|
-
pointRenderPoints: i.pointVisible ?
|
|
974
|
-
errorBarRenderPoints: s ?
|
|
999
|
+
pointRenderPoints: i.pointVisible ? Kt(e, a, t, n, r.pointMinSpacing, r.downsample, Vt) : [],
|
|
1000
|
+
errorBarRenderPoints: s ? Kt(e, a, t, n, r.errorBarMinSpacing, r.downsample, qt) : []
|
|
975
1001
|
};
|
|
976
1002
|
}
|
|
977
|
-
var
|
|
1003
|
+
var Yt = (e, t) => {
|
|
978
1004
|
let n = typeof e == "number" ? e : Number(e);
|
|
979
1005
|
return Number.isFinite(n) ? Math.min(10, Math.max(1, Math.floor(n))) : t;
|
|
980
1006
|
};
|
|
981
|
-
function
|
|
1007
|
+
function Xt(e) {
|
|
982
1008
|
let t = Object.fromEntries(Object.entries(e?.trackLines ?? {}).map(([e, t]) => [e, {
|
|
983
1009
|
horizontal: typeof t?.horizontal != "boolean" || t.horizontal,
|
|
984
1010
|
vertical: typeof t?.vertical != "boolean" || t.vertical,
|
|
@@ -986,37 +1012,37 @@ function Kt(e) {
|
|
|
986
1012
|
verticalColor: typeof t?.verticalColor == "string" && t.verticalColor.trim() ? t.verticalColor : void 0
|
|
987
1013
|
}]));
|
|
988
1014
|
return {
|
|
989
|
-
rowCount:
|
|
990
|
-
columnCount:
|
|
1015
|
+
rowCount: Yt(e?.rowCount, 2),
|
|
1016
|
+
columnCount: Yt(e?.columnCount, 1),
|
|
991
1017
|
showPagination: e?.showPagination ?? !0,
|
|
992
1018
|
trackLines: t
|
|
993
1019
|
};
|
|
994
1020
|
}
|
|
995
|
-
function
|
|
1021
|
+
function Zt(e) {
|
|
996
1022
|
return e.rowCount * e.columnCount;
|
|
997
1023
|
}
|
|
998
|
-
function
|
|
999
|
-
return Math.max(1, Math.ceil(Math.max(0, e) /
|
|
1024
|
+
function Qt(e, t) {
|
|
1025
|
+
return Math.max(1, Math.ceil(Math.max(0, e) / Zt(t)));
|
|
1000
1026
|
}
|
|
1001
|
-
function
|
|
1002
|
-
let r =
|
|
1003
|
-
return e.slice(i, i +
|
|
1027
|
+
function $t(e, t, n) {
|
|
1028
|
+
let r = Qt(e.length, n), i = (Math.min(r, Math.max(1, Math.floor(t))) - 1) * Zt(n);
|
|
1029
|
+
return e.slice(i, i + Zt(n));
|
|
1004
1030
|
}
|
|
1005
|
-
function
|
|
1031
|
+
function en(e) {
|
|
1006
1032
|
return e === "compact" ? 0 : e === "separated" ? 16 : 14;
|
|
1007
1033
|
}
|
|
1008
|
-
function
|
|
1009
|
-
let s =
|
|
1034
|
+
function tn(e, t, n, r, i = [], a, o = !0) {
|
|
1035
|
+
let s = en(r), c = Number.isFinite(a) ? Math.max(0, a) : s, l = Math.max(0, n.columnCount - 1) * c, u = /* @__PURE__ */ new Set();
|
|
1010
1036
|
if (o) {
|
|
1011
1037
|
if (r === "independent") for (let e = 0; e < n.rowCount; e += 1) u.add(e);
|
|
1012
1038
|
else if (r === "compact") u.add(n.rowCount - 1);
|
|
1013
|
-
else for (let e = 0; e < n.columnCount; e += 1) for (let t =
|
|
1039
|
+
else for (let e = 0; e < n.columnCount; e += 1) for (let t = Zt(n) - 1; t >= 0; --t) if (t % n.columnCount === e && i[t]) {
|
|
1014
1040
|
u.add(Math.floor(t / n.columnCount));
|
|
1015
1041
|
break;
|
|
1016
1042
|
}
|
|
1017
1043
|
}
|
|
1018
1044
|
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);
|
|
1019
|
-
return Array.from({ length:
|
|
1045
|
+
return Array.from({ length: Zt(n) }, (e, t) => {
|
|
1020
1046
|
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) => {
|
|
1021
1047
|
let n = u.has(t) ? 30 : 0;
|
|
1022
1048
|
return m + n + s;
|
|
@@ -1035,7 +1061,7 @@ function Zt(e, t, n, r, i = [], a, o = !0) {
|
|
|
1035
1061
|
};
|
|
1036
1062
|
});
|
|
1037
1063
|
}
|
|
1038
|
-
function
|
|
1064
|
+
function nn(e, t) {
|
|
1039
1065
|
let n = /* @__PURE__ */ new Set();
|
|
1040
1066
|
for (let r = 0; r < t; r += 1) for (let t = e.length - 1; t >= 0; --t) {
|
|
1041
1067
|
let i = e[t];
|
|
@@ -1048,11 +1074,11 @@ function Qt(e, t) {
|
|
|
1048
1074
|
}
|
|
1049
1075
|
//#endregion
|
|
1050
1076
|
//#region src/components/core/trackLayoutBuilder.ts
|
|
1051
|
-
function
|
|
1077
|
+
function rn(e) {
|
|
1052
1078
|
let t = e.cells.map((e) => ({
|
|
1053
1079
|
...e,
|
|
1054
1080
|
hasSeries: !!e.series
|
|
1055
|
-
})), n =
|
|
1081
|
+
})), n = nn(t, e.grid.columnCount);
|
|
1056
1082
|
return t.flatMap((t, r) => {
|
|
1057
1083
|
let i = !t.series;
|
|
1058
1084
|
if (i && (e.displayMode !== "compact" || !e.showCompactEmptyTracks)) return [];
|
|
@@ -1078,7 +1104,7 @@ function $t(e) {
|
|
|
1078
1104
|
visibleSeries: [a],
|
|
1079
1105
|
xDomain: a.xDomain,
|
|
1080
1106
|
yDomain: a.yDomain
|
|
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] ??
|
|
1107
|
+
}, 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] ?? K : K).rescaleX(l), d = e.yDomains?.[o.id], f = pn(o, e.overlayMode, e.fixedYDomain, e.fixedYDomains).map((e) => !e.fixed && d ? {
|
|
1082
1108
|
...e,
|
|
1083
1109
|
domain: d
|
|
1084
1110
|
} : e), p = {
|
|
@@ -1091,7 +1117,7 @@ function $t(e) {
|
|
|
1091
1117
|
a,
|
|
1092
1118
|
...c,
|
|
1093
1119
|
...s ? [o] : []
|
|
1094
|
-
])), { tickTextWidth: u } =
|
|
1120
|
+
])), { tickTextWidth: u } = mn(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);
|
|
1095
1121
|
return p[n.side] += d, {
|
|
1096
1122
|
index: n.index,
|
|
1097
1123
|
side: n.side,
|
|
@@ -1110,7 +1136,7 @@ function $t(e) {
|
|
|
1110
1136
|
let n = u(e);
|
|
1111
1137
|
return n > x && n < t.width - S;
|
|
1112
1138
|
}), w = o.visibleSeries.map((n) => {
|
|
1113
|
-
let r = m.find((e) => e.seriesList.some((e) => e.id === n.id)), a = r?.scale ?? h, o =
|
|
1139
|
+
let r = m.find((e) => e.seriesList.some((e) => e.id === n.id)), a = r?.scale ?? h, o = Jt(n.points, y, t.width, e.rendering, {
|
|
1114
1140
|
lineVisible: !i && n.lineType !== "none",
|
|
1115
1141
|
pointVisible: n.pointType !== "none",
|
|
1116
1142
|
errorBarVisible: n.errorBar.visible,
|
|
@@ -1162,8 +1188,8 @@ function $t(e) {
|
|
|
1162
1188
|
}
|
|
1163
1189
|
//#endregion
|
|
1164
1190
|
//#region src/components/core/layout.ts
|
|
1165
|
-
var
|
|
1166
|
-
function
|
|
1191
|
+
var an = 7, on = 7, sn = 4, cn = 6, ln = 24;
|
|
1192
|
+
function un(e) {
|
|
1167
1193
|
return e >= 4 ? [
|
|
1168
1194
|
"left",
|
|
1169
1195
|
"left",
|
|
@@ -1175,13 +1201,13 @@ function on(e) {
|
|
|
1175
1201
|
"right"
|
|
1176
1202
|
] : e === 2 ? ["left", "right"] : ["left"];
|
|
1177
1203
|
}
|
|
1178
|
-
var
|
|
1179
|
-
function
|
|
1180
|
-
let n =
|
|
1181
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
1204
|
+
var dn = /* @__PURE__ */ new WeakMap();
|
|
1205
|
+
function fn(e, t) {
|
|
1206
|
+
let n = dn.get(e);
|
|
1207
|
+
n || (n = /* @__PURE__ */ new Map(), dn.set(e, n));
|
|
1182
1208
|
let r = n.get(t);
|
|
1183
1209
|
if (r) return r;
|
|
1184
|
-
let i = t === "multi-axis" ? Math.min(e.visibleSeries.length, 4) : Math.min(e.visibleSeries.length, 1), a =
|
|
1210
|
+
let i = t === "multi-axis" ? Math.min(e.visibleSeries.length, 4) : Math.min(e.visibleSeries.length, 1), a = un(i), o = Array.from({ length: i }, (e, t) => ({
|
|
1185
1211
|
index: t,
|
|
1186
1212
|
side: a[t],
|
|
1187
1213
|
seriesList: [],
|
|
@@ -1198,9 +1224,9 @@ function cn(e, t) {
|
|
|
1198
1224
|
}
|
|
1199
1225
|
}), n.set(t, o), o;
|
|
1200
1226
|
}
|
|
1201
|
-
function
|
|
1227
|
+
function pn(e, t, n, r) {
|
|
1202
1228
|
let i = xt(e, r);
|
|
1203
|
-
return
|
|
1229
|
+
return fn(e, t).map((e) => {
|
|
1204
1230
|
if (i) return {
|
|
1205
1231
|
...e,
|
|
1206
1232
|
domain: i,
|
|
@@ -1214,7 +1240,7 @@ function ln(e, t, n, r) {
|
|
|
1214
1240
|
} : e;
|
|
1215
1241
|
});
|
|
1216
1242
|
}
|
|
1217
|
-
function
|
|
1243
|
+
function mn(e, t = !0, n) {
|
|
1218
1244
|
let r = B(e, [1, 0]);
|
|
1219
1245
|
t && r.nice();
|
|
1220
1246
|
let [i, a] = r.domain(), o = n ?? Array.from(/* @__PURE__ */ new Set([
|
|
@@ -1226,21 +1252,21 @@ function un(e, t = !0, n) {
|
|
|
1226
1252
|
axisMin: i,
|
|
1227
1253
|
axisMax: a,
|
|
1228
1254
|
topTickValue: s
|
|
1229
|
-
}).length)) *
|
|
1255
|
+
}).length)) * an };
|
|
1230
1256
|
}
|
|
1231
|
-
function
|
|
1232
|
-
return
|
|
1257
|
+
function hn(e) {
|
|
1258
|
+
return mn(e.domain, !e.fixed).tickTextWidth + on + cn + ln + sn;
|
|
1233
1259
|
}
|
|
1234
|
-
function
|
|
1235
|
-
return
|
|
1260
|
+
function gn(e) {
|
|
1261
|
+
return mn(e.domain, !e.fixed).tickTextWidth + on + sn;
|
|
1236
1262
|
}
|
|
1237
|
-
function
|
|
1238
|
-
return
|
|
1263
|
+
function _n(e, t, n, r) {
|
|
1264
|
+
return pn(e, t, n, r).reduce((n, r) => (n[r.side] += t === "multi-axis" || e.visibleSeries.length === 1 ? hn(r) : gn(r), n), {
|
|
1239
1265
|
left: 0,
|
|
1240
1266
|
right: 0
|
|
1241
1267
|
});
|
|
1242
1268
|
}
|
|
1243
|
-
function
|
|
1269
|
+
function vn(e, t, n) {
|
|
1244
1270
|
let r = (e) => {
|
|
1245
1271
|
let r = t < e.left ? e.left - t : t > e.left + e.width ? t - e.left - e.width : 0;
|
|
1246
1272
|
return n < e.top ? e.top - n : n > e.top + e.height ? n - (e.top + e.height) : r;
|
|
@@ -1259,11 +1285,11 @@ function mn(e, t, n) {
|
|
|
1259
1285
|
}
|
|
1260
1286
|
//#endregion
|
|
1261
1287
|
//#region src/components/annotation/useWaveformChartAnnotations.ts
|
|
1262
|
-
var
|
|
1263
|
-
function
|
|
1264
|
-
return
|
|
1288
|
+
var yn = 0;
|
|
1289
|
+
function bn() {
|
|
1290
|
+
return yn += 1, typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `annotation-${Date.now()}-${yn}`;
|
|
1265
1291
|
}
|
|
1266
|
-
function
|
|
1292
|
+
function xn(e) {
|
|
1267
1293
|
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;
|
|
1268
1294
|
function b(e) {
|
|
1269
1295
|
if (!i.value.some((t) => t.id === e)) return;
|
|
@@ -1296,7 +1322,7 @@ function _n(e) {
|
|
|
1296
1322
|
};
|
|
1297
1323
|
}
|
|
1298
1324
|
function C(e, t, n) {
|
|
1299
|
-
s.openCreate(e,
|
|
1325
|
+
s.openCreate(e, bn, t), c.value = n;
|
|
1300
1326
|
let r = s.editorDraft.value, i = l.value.find((t) => t.index === e.trackIndex)?.seriesList.find((t) => t.id === e.seriesId);
|
|
1301
1327
|
r?.mode === "add" && (r.annotation.style = {
|
|
1302
1328
|
borderColor: i?.color || "#1677ff",
|
|
@@ -1306,7 +1332,7 @@ function _n(e) {
|
|
|
1306
1332
|
}
|
|
1307
1333
|
function w(e) {
|
|
1308
1334
|
if (y.value) return;
|
|
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 ?
|
|
1335
|
+
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 ? _e(i.points, t.annotation.x, i.lineType) : null;
|
|
1310
1336
|
!t || !n || !r || !a || (t.annotation = {
|
|
1311
1337
|
...t.annotation,
|
|
1312
1338
|
seriesId: e,
|
|
@@ -1325,7 +1351,7 @@ function _n(e) {
|
|
|
1325
1351
|
let e = l.value[n];
|
|
1326
1352
|
return e?.hasVisibleSeries ? e : void 0;
|
|
1327
1353
|
}
|
|
1328
|
-
return
|
|
1354
|
+
return vn(l.value.filter((e) => e.hasVisibleSeries), e, t);
|
|
1329
1355
|
}
|
|
1330
1356
|
function D(e, t) {
|
|
1331
1357
|
let n = e.currentTarget;
|
|
@@ -1334,7 +1360,7 @@ function _n(e) {
|
|
|
1334
1360
|
if (!o) return null;
|
|
1335
1361
|
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);
|
|
1336
1362
|
return {
|
|
1337
|
-
candidates:
|
|
1363
|
+
candidates: ve(u(o), d, c, a),
|
|
1338
1364
|
editorAnchor: x(e, t)
|
|
1339
1365
|
};
|
|
1340
1366
|
}
|
|
@@ -1384,7 +1410,7 @@ function _n(e) {
|
|
|
1384
1410
|
let e = s.contextMenu.value, n = t.annotations.find((t) => t.id === e?.annotationId);
|
|
1385
1411
|
if (!n) return;
|
|
1386
1412
|
let r = l.value.find((e) => e.seriesList.some((e) => e.id === n.seriesId));
|
|
1387
|
-
c.value = r ?
|
|
1413
|
+
c.value = r ? ve(u(r), n.x, r.xScale(n.x), r.top + d(r, n.seriesId)(n.y)) : [], s.openEdit(n, e?.editorAnchor ?? S(n));
|
|
1388
1414
|
}
|
|
1389
1415
|
function F() {
|
|
1390
1416
|
if (y.value) return;
|
|
@@ -1413,8 +1439,8 @@ function _n(e) {
|
|
|
1413
1439
|
}
|
|
1414
1440
|
//#endregion
|
|
1415
1441
|
//#region src/components/interaction/useWaveformHover.ts
|
|
1416
|
-
var
|
|
1417
|
-
function
|
|
1442
|
+
var Sn = N((e) => e.x);
|
|
1443
|
+
function Cn(e) {
|
|
1418
1444
|
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) => {
|
|
1419
1445
|
let r = n.points[t];
|
|
1420
1446
|
return r?.id === e.id && r.trackIndex === e.trackIndex && r.point === e.point;
|
|
@@ -1435,7 +1461,7 @@ function yn(e) {
|
|
|
1435
1461
|
r.value = !0, y();
|
|
1436
1462
|
}, C = (e = !1) => {
|
|
1437
1463
|
r.value = !e, y();
|
|
1438
|
-
}, w = () => r.value ? (r.value = !1, y(), !0) : !1, T = (e, t) => e.points[
|
|
1464
|
+
}, w = () => r.value ? (r.value = !1, y(), !0) : !1, T = (e, t) => e.points[Sn.center(e.points, t)];
|
|
1439
1465
|
return {
|
|
1440
1466
|
cancelPendingHover: h,
|
|
1441
1467
|
clearHover: y,
|
|
@@ -1467,7 +1493,7 @@ function yn(e) {
|
|
|
1467
1493
|
},
|
|
1468
1494
|
handleSharedPointerMove: (e) => {
|
|
1469
1495
|
if (f.value) return;
|
|
1470
|
-
if (a.value
|
|
1496
|
+
if (a.value && !a.value.independent) {
|
|
1471
1497
|
p(e);
|
|
1472
1498
|
return;
|
|
1473
1499
|
}
|
|
@@ -1489,9 +1515,142 @@ function yn(e) {
|
|
|
1489
1515
|
};
|
|
1490
1516
|
}
|
|
1491
1517
|
//#endregion
|
|
1518
|
+
//#region src/components/interaction/pointerCapture.ts
|
|
1519
|
+
function wn(e, t) {
|
|
1520
|
+
try {
|
|
1521
|
+
e?.releasePointerCapture?.(t);
|
|
1522
|
+
} catch {}
|
|
1523
|
+
}
|
|
1524
|
+
//#endregion
|
|
1525
|
+
//#region src/components/interaction/viewportInteractionState.ts
|
|
1526
|
+
function Tn(e) {
|
|
1527
|
+
return {
|
|
1528
|
+
...e,
|
|
1529
|
+
currentX: e.startX,
|
|
1530
|
+
currentY: e.startY,
|
|
1531
|
+
xDomain: [...e.xDomain],
|
|
1532
|
+
yDomains: Object.fromEntries(Object.entries(e.yDomains).map(([e, t]) => [e, [...t]]))
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
function En(e, t) {
|
|
1536
|
+
return {
|
|
1537
|
+
...e,
|
|
1538
|
+
...t
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
function Dn(e) {
|
|
1542
|
+
return {
|
|
1543
|
+
state: e,
|
|
1544
|
+
accepted: !1,
|
|
1545
|
+
completed: null
|
|
1546
|
+
};
|
|
1547
|
+
}
|
|
1548
|
+
function On(e, t) {
|
|
1549
|
+
switch (t.type) {
|
|
1550
|
+
case "begin": return e ? Dn(e) : {
|
|
1551
|
+
state: Tn(t.gesture),
|
|
1552
|
+
accepted: !0,
|
|
1553
|
+
completed: null
|
|
1554
|
+
};
|
|
1555
|
+
case "move": return !e || e.pointerId !== t.pointerId ? Dn(e) : {
|
|
1556
|
+
state: En(e, t.position),
|
|
1557
|
+
accepted: !0,
|
|
1558
|
+
completed: null
|
|
1559
|
+
};
|
|
1560
|
+
case "finish": return !e || e.pointerId !== t.pointerId ? Dn(e) : {
|
|
1561
|
+
state: null,
|
|
1562
|
+
accepted: !0,
|
|
1563
|
+
completed: En(e, t.position)
|
|
1564
|
+
};
|
|
1565
|
+
case "cancel": return !e || t.pointerId !== void 0 && e.pointerId !== t.pointerId ? Dn(e) : {
|
|
1566
|
+
state: null,
|
|
1567
|
+
accepted: !0,
|
|
1568
|
+
completed: null
|
|
1569
|
+
};
|
|
1570
|
+
case "reset": return {
|
|
1571
|
+
state: null,
|
|
1572
|
+
accepted: !0,
|
|
1573
|
+
completed: null
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
//#endregion
|
|
1578
|
+
//#region src/components/interaction/zoomConstraints.ts
|
|
1579
|
+
var kn = /* @__PURE__ */ new WeakMap();
|
|
1580
|
+
function An(e) {
|
|
1581
|
+
return e[0] <= e[1] ? [...e] : [e[1], e[0]];
|
|
1582
|
+
}
|
|
1583
|
+
function jn(e) {
|
|
1584
|
+
return Number.isFinite(e) && (e ?? 0) > 0 ? Math.ceil(e) : 0;
|
|
1585
|
+
}
|
|
1586
|
+
function Mn(e, t) {
|
|
1587
|
+
let n = `${t[0]}\u0000${t[1]}`, r = kn.get(e)?.get(n);
|
|
1588
|
+
if (r) return r;
|
|
1589
|
+
let i = /* @__PURE__ */ new Set();
|
|
1590
|
+
for (let n of e) for (let e of n.points) e.x >= t[0] && e.x <= t[1] && i.add(e.x);
|
|
1591
|
+
let a = Array.from(i).sort((e, t) => e - t), o = kn.get(e) ?? /* @__PURE__ */ new Map();
|
|
1592
|
+
return o.set(n, a), kn.set(e, o), a;
|
|
1593
|
+
}
|
|
1594
|
+
function Nn(e, t, n) {
|
|
1595
|
+
if (n <= 1) return 0;
|
|
1596
|
+
let r = 0;
|
|
1597
|
+
for (let i of e) {
|
|
1598
|
+
let e = Mn(i, t);
|
|
1599
|
+
if (e.length < n) return t[1] - t[0];
|
|
1600
|
+
let a = Infinity;
|
|
1601
|
+
for (let t = 0; t + n <= e.length; t += 1) a = Math.min(a, e[t + n - 1] - e[t]);
|
|
1602
|
+
let o = 2 ** -52 * Math.max(1, Math.abs(t[0]), Math.abs(t[1])) * 16;
|
|
1603
|
+
r = Math.max(r, a + o);
|
|
1604
|
+
}
|
|
1605
|
+
return r;
|
|
1606
|
+
}
|
|
1607
|
+
function Pn(e, t, n) {
|
|
1608
|
+
let r = An(e), i = r[1] - r[0];
|
|
1609
|
+
if (!Number.isFinite(i) || i <= 0) return 0;
|
|
1610
|
+
let a = Number.isFinite(n.minZoomSpan) && (n.minZoomSpan ?? 0) > 0 ? Math.min(i, n.minZoomSpan) : 0, o = jn(n.minVisiblePoints), s = Nn(t, r, o);
|
|
1611
|
+
return a > 0 || o > 0 ? Math.max(a, s) : i / mt.DEFAULT_MAX_SCALE;
|
|
1612
|
+
}
|
|
1613
|
+
function Fn(e, t, n, r) {
|
|
1614
|
+
if (r <= 0) return e;
|
|
1615
|
+
let i = 2 ** -52 * Math.max(1, Math.abs(t[0]), Math.abs(t[1])) * 16, a = e;
|
|
1616
|
+
for (let e of n) {
|
|
1617
|
+
let n = Mn(e, t);
|
|
1618
|
+
if (n.length < r) return [...t];
|
|
1619
|
+
if (n.filter((e) => e >= a[0] && e <= a[1]).length >= r) continue;
|
|
1620
|
+
let o, s = Infinity, c = Infinity, l = (a[0] + a[1]) / 2;
|
|
1621
|
+
for (let e = 0; e + r <= n.length; e += 1) {
|
|
1622
|
+
let u = [Math.max(t[0], Math.min(a[0], n[e] - i)), Math.min(t[1], Math.max(a[1], n[e + r - 1] + i))], d = u[1] - u[0], f = Math.abs((u[0] + u[1]) / 2 - l);
|
|
1623
|
+
(d < s || d === s && f < c) && (o = u, s = d, c = f);
|
|
1624
|
+
}
|
|
1625
|
+
a = o ?? [...t];
|
|
1626
|
+
}
|
|
1627
|
+
return a;
|
|
1628
|
+
}
|
|
1629
|
+
function In(e, t, n, r) {
|
|
1630
|
+
let i = An(t), a = i[1] - i[0];
|
|
1631
|
+
if (!Number.isFinite(a) || a <= 0 || Math.abs(e[1] - e[0]) >= a * .999999999999) return i;
|
|
1632
|
+
let o = Fn([Math.max(i[0], Math.min(e[0], e[1])), Math.min(i[1], Math.max(e[0], e[1]))], i, n, jn(r.minVisiblePoints)), s = Pn(i, n, r), c = Math.max(s, Math.min(a, o[1] - o[0])), l = (o[0] + o[1]) / 2, u = Math.max(i[0], Math.min(l - c / 2, i[1] - c));
|
|
1633
|
+
return [u, u + c];
|
|
1634
|
+
}
|
|
1635
|
+
function Ln(e, t, n) {
|
|
1636
|
+
let r = t[1] - t[0], i = e[1] - e[0];
|
|
1637
|
+
if (!Number.isFinite(r) || !Number.isFinite(i) || r <= 0 || i <= 0) return K;
|
|
1638
|
+
let a = r / i, o = B(t, [0, n]);
|
|
1639
|
+
return K.translate(-a * o(e[0]), 0).scale(a);
|
|
1640
|
+
}
|
|
1641
|
+
//#endregion
|
|
1492
1642
|
//#region src/components/interaction/useWaveformViewport.ts
|
|
1493
|
-
function
|
|
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:
|
|
1643
|
+
function Rn(e) {
|
|
1644
|
+
let { props: n, emit: r, selection: i, spacePressed: a, trackLayouts: o, chartTracks: s, initialXDomain: c, innerWidth: l, innerHeight: u, sharedOverlayElement: f, sharedTransform: p, independentTransforms: m, sharedYDomains: h, independentYDomains: g, isZoomMode: _, isPresentationMode: v, editorSeriesOptions: y, resolveInitialTrackDomain: b, canZoomTrack: S, canZoomSharedTracks: C, configureZoom: w, cancelPendingZoom: T, clearHover: E, resolveTrackAtPointer: D } = e, O = x(), k = (e, t) => {
|
|
1645
|
+
let n = O.value, r = t?.currentTarget;
|
|
1646
|
+
wn(n, e), r && r !== n && wn(r, e);
|
|
1647
|
+
}, A = (e, t) => {
|
|
1648
|
+
let n = i.value;
|
|
1649
|
+
!n || n.pointerId !== e || (k(e, t), i.value = On(i.value, {
|
|
1650
|
+
type: "cancel",
|
|
1651
|
+
pointerId: e
|
|
1652
|
+
}).state, O.value = void 0);
|
|
1653
|
+
}, j = t(() => {
|
|
1495
1654
|
let e = i.value;
|
|
1496
1655
|
if (!e) return null;
|
|
1497
1656
|
let t = o.value.find((t) => t.index === e.trackIndex);
|
|
@@ -1501,139 +1660,147 @@ function bn(e) {
|
|
|
1501
1660
|
width: Math.abs(e.currentX - e.startX),
|
|
1502
1661
|
height: Math.abs(e.currentY - e.startY)
|
|
1503
1662
|
};
|
|
1504
|
-
}),
|
|
1505
|
-
let r = t[1] - t[0], i = e[1] - e[0];
|
|
1506
|
-
if (!Number.isFinite(r) || !Number.isFinite(i) || r <= 0 || i <= 0) return U;
|
|
1507
|
-
let a = r / i, o = B(t, [0, n]);
|
|
1508
|
-
return U.translate(-a * o(e[0]), 0).scale(a);
|
|
1509
|
-
}, k = (e) => {
|
|
1510
|
-
let t = Math.abs(e[1] - e[0]);
|
|
1511
|
-
if (!Number.isFinite(t) || t <= 0) return 0;
|
|
1512
|
-
let r = n.minZoomSpan;
|
|
1513
|
-
return Number.isFinite(r) && (r ?? 0) > 0 ? Math.min(t, r) : t / 40;
|
|
1514
|
-
}, A = (e, t) => {
|
|
1515
|
-
let n = t[0] <= t[1] ? [...t] : [t[1], t[0]], r = n[1] - n[0];
|
|
1516
|
-
if (!Number.isFinite(r) || r <= 0) return n;
|
|
1517
|
-
let i = Math.min(e[0], e[1]), a = Math.max(e[0], e[1]), o = k(n), s = Math.max(o, Math.min(r, a - i)), c = (i + a) / 2, l = Math.max(n[0], Math.min(c - s / 2, n[1] - s));
|
|
1518
|
-
return [l, l + s];
|
|
1519
|
-
}, j = (e, t) => {
|
|
1663
|
+
}), M = (e, t) => {
|
|
1520
1664
|
let n = e[1] - e[0];
|
|
1521
1665
|
return n >= t[1] - t[0] ? [...t] : e[0] < t[0] ? [t[0], t[0] + n] : e[1] > t[1] ? [t[1] - n, t[1]] : e;
|
|
1522
|
-
},
|
|
1666
|
+
}, N = () => Object.fromEntries(o.value.map((e) => [e.series.trackId ?? e.series.id, e.yScale.domain()])), P = (e, t, r) => {
|
|
1523
1667
|
if (v.value) return;
|
|
1524
1668
|
let s = n.pannable && a.value;
|
|
1525
1669
|
if (!n.zoomable && !s || !_.value || e.button !== 0) return;
|
|
1526
1670
|
let c = e.currentTarget, d = o.value.find((e) => e.index === t);
|
|
1527
1671
|
if (!d) return;
|
|
1528
|
-
let [f, p] = z(e, c), m = Math.max(0, Math.min(r ? d.width : l.value, f)), h = Math.max(0, Math.min(r ? d.height : u.value, p))
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
},
|
|
1672
|
+
let [f, p] = z(e, c), m = Math.max(0, Math.min(r ? d.width : l.value, f)), h = Math.max(0, Math.min(r ? d.height : u.value, p)), g = On(i.value, {
|
|
1673
|
+
type: "begin",
|
|
1674
|
+
gesture: {
|
|
1675
|
+
trackIndex: t,
|
|
1676
|
+
independent: r,
|
|
1677
|
+
startX: m,
|
|
1678
|
+
startY: h,
|
|
1679
|
+
pointerId: e.pointerId,
|
|
1680
|
+
kind: s ? "pan" : "box",
|
|
1681
|
+
xDomain: d.xScale.domain(),
|
|
1682
|
+
yDomains: N()
|
|
1683
|
+
}
|
|
1684
|
+
});
|
|
1685
|
+
g.accepted && (i.value = g.state, O.value = c, c.setPointerCapture?.(e.pointerId), E(), e.preventDefault());
|
|
1686
|
+
}, F = (e) => {
|
|
1543
1687
|
if (!f.value) return;
|
|
1544
|
-
let [t, n] = z(e, f.value), r =
|
|
1545
|
-
r &&
|
|
1546
|
-
},
|
|
1547
|
-
let i = t.width || 1, a = t.height || 1, u = e.currentX - e.startX, d = e.currentY - e.startY, f = e.xDomain[1] - e.xDomain[0], _ = e.independent ? b(t) : c.value, v =
|
|
1688
|
+
let [t, n] = z(e, f.value), r = D(t, n) ?? o.value.find((e) => e.hasVisibleSeries);
|
|
1689
|
+
r && P(e, r.index, !1);
|
|
1690
|
+
}, I = (e, t) => {
|
|
1691
|
+
let i = t.width || 1, a = t.height || 1, u = e.currentX - e.startX, d = e.currentY - e.startY, f = e.xDomain[1] - e.xDomain[0], _ = e.independent ? b(t) : c.value, v = M([e.xDomain[0] - u / i * f, e.xDomain[1] - u / i * f], _);
|
|
1548
1692
|
if (e.independent) {
|
|
1549
1693
|
let e = [...m.value];
|
|
1550
|
-
e[t.index] =
|
|
1551
|
-
} else p.value =
|
|
1694
|
+
e[t.index] = Ln(v, _, i), m.value = e;
|
|
1695
|
+
} else p.value = Ln(v, _, l.value);
|
|
1552
1696
|
let y = e.independent ? [t] : o.value, x = { ...g.value }, S = { ...h.value };
|
|
1553
1697
|
y.forEach((t) => {
|
|
1554
1698
|
let r = s.value.find((e) => e.id === t.id);
|
|
1555
1699
|
if (r && Ct(r, n.yDomain, n.yDomains)) return;
|
|
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 =
|
|
1700
|
+
let i = t.series.trackId ?? t.series.id, o = e.yDomains[i] ?? t.yScale.domain(), c = r?.yDomain ?? o, l = o[1] - o[0], u = M([o[0] + d / a * l, o[1] + d / a * l], c);
|
|
1557
1701
|
e.independent ? x[t.index] = u : S[i] = u;
|
|
1558
1702
|
}), e.independent ? g.value = x : h.value = S, r("zoom-change", v);
|
|
1559
|
-
}, I = (e) => {
|
|
1560
|
-
if (v.value) return;
|
|
1561
|
-
let t = i.value;
|
|
1562
|
-
if (!t || e.pointerId !== t.pointerId) return;
|
|
1563
|
-
let n = o.value.find((e) => e.index === t.trackIndex);
|
|
1564
|
-
if (!n) return;
|
|
1565
|
-
let [r, a] = z(e, t.overlay);
|
|
1566
|
-
t.currentX = Math.max(0, Math.min(t.independent ? n.width : l.value, r)), t.currentY = Math.max(0, Math.min(t.independent ? n.height : u.value, a)), i.value = { ...t }, t.mode === "pan" && F(t, n), e.preventDefault();
|
|
1567
1703
|
}, L = (e) => {
|
|
1568
|
-
|
|
1569
|
-
|
|
1704
|
+
if (v.value) return;
|
|
1705
|
+
let t = i.value, n = O.value;
|
|
1706
|
+
if (!t || !n || e.pointerId !== t.pointerId) return;
|
|
1707
|
+
let r = o.value.find((e) => e.index === t.trackIndex);
|
|
1708
|
+
if (!r) return;
|
|
1709
|
+
let [a, s] = z(e, n), c = Math.max(0, Math.min(t.independent ? r.width : l.value, a)), d = Math.max(0, Math.min(t.independent ? r.height : u.value, s)), f = On(i.value, {
|
|
1710
|
+
type: "move",
|
|
1711
|
+
pointerId: e.pointerId,
|
|
1712
|
+
position: {
|
|
1713
|
+
currentX: c,
|
|
1714
|
+
currentY: d
|
|
1715
|
+
}
|
|
1716
|
+
});
|
|
1717
|
+
if (!f.accepted || !f.state) return;
|
|
1718
|
+
let p = f.state;
|
|
1719
|
+
i.value = p, p.kind === "pan" && I(p, r), e.preventDefault();
|
|
1570
1720
|
}, R = (e) => {
|
|
1721
|
+
let t = i.value;
|
|
1722
|
+
!t || e && e.pointerId !== t.pointerId || A(t.pointerId, e);
|
|
1723
|
+
}, B = (e) => {
|
|
1571
1724
|
let t = o.value.find((t) => t.index === e.trackIndex);
|
|
1572
|
-
if (!t || (e.independent ? !
|
|
1573
|
-
let
|
|
1574
|
-
if (
|
|
1575
|
-
let
|
|
1725
|
+
if (!t || (e.independent ? !S(t) : !C())) return;
|
|
1726
|
+
let i = e.independent ? 0 : t.left, a = Math.max(0, Math.min(t.width, Math.min(e.startX, e.currentX) - i)), s = Math.max(0, Math.min(t.width, Math.max(e.startX, e.currentX) - i));
|
|
1727
|
+
if (s - a < 6) return;
|
|
1728
|
+
let u = e.independent ? b(t) : c.value, f = e.independent ? [t.seriesList] : o.value.filter((e) => e.hasVisibleSeries).map((e) => e.seriesList), h = In([t.xScale.invert(a), t.xScale.invert(s)], u, f, n);
|
|
1576
1729
|
if (e.independent) {
|
|
1577
1730
|
let e = [...m.value];
|
|
1578
|
-
e[t.index] =
|
|
1579
|
-
} else p.value =
|
|
1580
|
-
let
|
|
1581
|
-
if (r("zoom-change",
|
|
1582
|
-
let e =
|
|
1731
|
+
e[t.index] = Ln(h, u, t.width), m.value = e;
|
|
1732
|
+
} else p.value = Ln(h, u, l.value);
|
|
1733
|
+
let g = e.independent ? [t] : o.value, _ = Object.fromEntries(g.map((e) => [e.series.trackId ?? e.series.id, e.yScale.domain()]));
|
|
1734
|
+
if (r("zoom-change", h), e.independent) {
|
|
1735
|
+
let e = _[t.series.trackId ?? t.series.id];
|
|
1583
1736
|
r("zoom-end", {
|
|
1584
|
-
start:
|
|
1585
|
-
end:
|
|
1737
|
+
start: h[0],
|
|
1738
|
+
end: h[1],
|
|
1586
1739
|
trackIndex: t.index,
|
|
1587
1740
|
seriesIds: t.seriesList.map((e) => e.id),
|
|
1588
1741
|
yStart: e?.[0],
|
|
1589
1742
|
yEnd: e?.[1],
|
|
1590
1743
|
gesture: "box"
|
|
1591
1744
|
});
|
|
1592
|
-
} else if (
|
|
1593
|
-
let e = Object.values(
|
|
1745
|
+
} else if (g.length === 1) {
|
|
1746
|
+
let e = Object.values(_)[0];
|
|
1594
1747
|
r("zoom-end", {
|
|
1595
|
-
start:
|
|
1596
|
-
end:
|
|
1748
|
+
start: h[0],
|
|
1749
|
+
end: h[1],
|
|
1597
1750
|
yStart: e?.[0],
|
|
1598
1751
|
yEnd: e?.[1],
|
|
1599
1752
|
gesture: "box"
|
|
1600
1753
|
});
|
|
1601
1754
|
} else r("zoom-end", {
|
|
1602
|
-
start:
|
|
1603
|
-
end:
|
|
1604
|
-
yRanges:
|
|
1755
|
+
start: h[0],
|
|
1756
|
+
end: h[1],
|
|
1757
|
+
yRanges: _,
|
|
1605
1758
|
gesture: "box"
|
|
1606
1759
|
});
|
|
1607
|
-
d(
|
|
1760
|
+
d(w);
|
|
1608
1761
|
}, V = (e) => {
|
|
1609
1762
|
if (v.value) {
|
|
1610
|
-
|
|
1763
|
+
R();
|
|
1611
1764
|
return;
|
|
1612
1765
|
}
|
|
1613
1766
|
let t = i.value;
|
|
1614
|
-
if (!
|
|
1615
|
-
|
|
1616
|
-
|
|
1767
|
+
if (!t || e.pointerId !== t.pointerId) return;
|
|
1768
|
+
let n = o.value.find((e) => e.index === t.trackIndex), r = O.value;
|
|
1769
|
+
if (!n || !r || !r.parentNode) {
|
|
1770
|
+
A(t.pointerId, e);
|
|
1771
|
+
return;
|
|
1772
|
+
}
|
|
1773
|
+
let [a, s] = z(e, r), c = Math.max(0, Math.min(t.independent ? n.width : l.value, a)), f = Math.max(0, Math.min(t.independent ? n.height : u.value, s)), p = On(i.value, {
|
|
1774
|
+
type: "finish",
|
|
1775
|
+
pointerId: e.pointerId,
|
|
1776
|
+
position: {
|
|
1777
|
+
currentX: c,
|
|
1778
|
+
currentY: f
|
|
1779
|
+
}
|
|
1780
|
+
}).completed;
|
|
1781
|
+
if (p) {
|
|
1782
|
+
if (i.value = null, k(p.pointerId, e), O.value = void 0, e.preventDefault(), p.kind === "pan") {
|
|
1783
|
+
I(p, n), d(w);
|
|
1617
1784
|
return;
|
|
1618
1785
|
}
|
|
1619
|
-
Math.abs(
|
|
1786
|
+
Math.abs(p.currentX - p.startX) >= 6 && B(p);
|
|
1620
1787
|
}
|
|
1621
1788
|
}, H = (e) => {
|
|
1622
|
-
if (
|
|
1789
|
+
if (T(), R(), n.displayMode === "independent" && e !== void 0) {
|
|
1623
1790
|
let t = [...m.value];
|
|
1624
|
-
t[e] =
|
|
1791
|
+
t[e] = K, m.value = t;
|
|
1625
1792
|
let n = { ...g.value };
|
|
1626
1793
|
delete n[e], g.value = n;
|
|
1627
|
-
} else p.value =
|
|
1628
|
-
|
|
1794
|
+
} else p.value = K, m.value = s.value.map(() => K), h.value = {}, g.value = {};
|
|
1795
|
+
E(), y.value = [], d(w);
|
|
1629
1796
|
};
|
|
1630
1797
|
return {
|
|
1631
|
-
selectionBox:
|
|
1632
|
-
beginViewportDrag:
|
|
1633
|
-
beginSharedViewportDrag:
|
|
1634
|
-
updateViewportDrag:
|
|
1798
|
+
selectionBox: j,
|
|
1799
|
+
beginViewportDrag: P,
|
|
1800
|
+
beginSharedViewportDrag: F,
|
|
1801
|
+
updateViewportDrag: L,
|
|
1635
1802
|
finishViewportDrag: V,
|
|
1636
|
-
cancelViewportDrag:
|
|
1803
|
+
cancelViewportDrag: R,
|
|
1637
1804
|
resetViewport: H,
|
|
1638
1805
|
requestViewportReset: (e) => {
|
|
1639
1806
|
v.value || !n.zoomable || !_.value || (e.preventDefault(), H(), r("zoom-reset"));
|
|
@@ -1642,7 +1809,7 @@ function bn(e) {
|
|
|
1642
1809
|
}
|
|
1643
1810
|
//#endregion
|
|
1644
1811
|
//#region src/components/utils/useAnimationFrameThrottle.ts
|
|
1645
|
-
function
|
|
1812
|
+
function zn() {
|
|
1646
1813
|
let e = null, t = null;
|
|
1647
1814
|
function n(n) {
|
|
1648
1815
|
t = n, e === null && (e = requestAnimationFrame(() => {
|
|
@@ -1671,8 +1838,8 @@ function xn() {
|
|
|
1671
1838
|
}
|
|
1672
1839
|
//#endregion
|
|
1673
1840
|
//#region src/components/interaction/useWaveformZoom.ts
|
|
1674
|
-
function
|
|
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 =
|
|
1841
|
+
function Bn(e) {
|
|
1842
|
+
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 = zn(), 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) => {
|
|
1676
1843
|
y || m.value || (g(), b = e.transform, x = "wheel", O(), P());
|
|
1677
1844
|
}, A = (e, t) => {
|
|
1678
1845
|
y || m.value || (g(), C.set(t, e.transform), w.set(t, "wheel"), O(), P());
|
|
@@ -1757,34 +1924,40 @@ function Sn(e) {
|
|
|
1757
1924
|
b = null, x = null, S = null, C.clear(), w.clear(), E.clear(), T.clear(), v.cancel(), D !== void 0 && (clearTimeout(D), D = void 0);
|
|
1758
1925
|
}, I = () => {
|
|
1759
1926
|
F(), r.value?.querySelectorAll(".waveform-chart__overlay").forEach((e) => V(e).on(".zoom", null)), _.clear();
|
|
1760
|
-
}, L = (e) => {
|
|
1761
|
-
let n = t.minZoomSpan;
|
|
1762
|
-
if (!Number.isFinite(n) || (n ?? 0) <= 0) return mt.DEFAULT_MAX_SCALE;
|
|
1927
|
+
}, L = (e, n) => {
|
|
1763
1928
|
let r = Math.abs(e[1] - e[0]);
|
|
1764
|
-
|
|
1765
|
-
|
|
1929
|
+
if (!Number.isFinite(r) || r <= 0) return mt.MIN_SCALE;
|
|
1930
|
+
let i = Pn(e, n, t);
|
|
1931
|
+
return Math.max(mt.MIN_SCALE, i > 0 ? r / i : mt.DEFAULT_MAX_SCALE);
|
|
1932
|
+
}, R = (e, n, r, i) => Ln(In(e.rescaleX(B(n, [0, r])).domain(), n, i, t), n, r), z = (e) => {
|
|
1933
|
+
let n = Number(t.minVisiblePoints);
|
|
1934
|
+
return Ut(e.seriesList, e.xScale.domain(), Number.isFinite(n) && n > 0 ? Math.ceil(n) + 1 : n);
|
|
1935
|
+
}, H = () => {
|
|
1766
1936
|
let e = s.value.filter((e) => e.hasVisibleSeries);
|
|
1767
|
-
return e.length > 0 && e.every(
|
|
1768
|
-
},
|
|
1937
|
+
return e.length > 0 && e.every(z);
|
|
1938
|
+
}, U = (e, t) => {
|
|
1769
1939
|
if (e.type !== "wheel") return !1;
|
|
1770
1940
|
let n = e.deltaY;
|
|
1771
|
-
return n < 0 ? t : n > 0 &&
|
|
1941
|
+
return n < 0 ? t : n > 0 && ne(e.currentTarget).k > mt.MIN_SCALE;
|
|
1772
1942
|
};
|
|
1773
1943
|
return {
|
|
1774
1944
|
cancelPendingZoom: F,
|
|
1775
1945
|
clearZoomBindings: I,
|
|
1776
|
-
canZoomTrack:
|
|
1777
|
-
canZoomSharedTracks:
|
|
1946
|
+
canZoomTrack: z,
|
|
1947
|
+
canZoomSharedTracks: H,
|
|
1778
1948
|
configureZoom: () => {
|
|
1779
1949
|
if (I(), m.value || !t.zoomable || !p.value || !f.value || !s.value.length) return;
|
|
1780
1950
|
if (t.displayMode === "independent") {
|
|
1781
1951
|
s.value.forEach((e) => {
|
|
1782
1952
|
let t = r.value?.querySelector(`[data-independent-overlay-index="${e.index}"]`);
|
|
1783
1953
|
if (!t) return;
|
|
1784
|
-
let n = h(e), i =
|
|
1785
|
-
|
|
1954
|
+
let n = h(e), i = [e.seriesList], a = G().filter((t) => {
|
|
1955
|
+
let n = s.value.find((t) => t.index === e.index) ?? e;
|
|
1956
|
+
return U(t, z(n));
|
|
1957
|
+
}).scaleExtent([1, L(n, i)]).constrain((t) => R(t, n, e.width, i)).extent([[0, 0], [e.width, e.height]]).translateExtent([[0, 0], [e.width, e.height]]).on("zoom", (t) => A(t, e.index)).on("end", N);
|
|
1958
|
+
_.set(e.index, a), y = !0;
|
|
1786
1959
|
try {
|
|
1787
|
-
V(t).call(
|
|
1960
|
+
V(t).call(a).on("dblclick.zoom", null).call(a.transform, o.value[e.index] ?? K);
|
|
1788
1961
|
} finally {
|
|
1789
1962
|
y = !1;
|
|
1790
1963
|
}
|
|
@@ -1793,10 +1966,10 @@ function Sn(e) {
|
|
|
1793
1966
|
}
|
|
1794
1967
|
let e = i.value;
|
|
1795
1968
|
if (!e) return;
|
|
1796
|
-
let n =
|
|
1797
|
-
_.set("shared",
|
|
1969
|
+
let n = s.value.filter((e) => e.hasVisibleSeries).map((e) => e.seriesList), l = G().filter((e) => U(e, H())).scaleExtent([1, L(c.value, n)]).constrain((e) => R(e, c.value, u.value, n)).extent([[0, 0], [u.value, d.value]]).translateExtent([[0, 0], [u.value, d.value]]).on("zoom", k).on("end", N);
|
|
1970
|
+
_.set("shared", l), y = !0;
|
|
1798
1971
|
try {
|
|
1799
|
-
V(e).call(
|
|
1972
|
+
V(e).call(l).on("dblclick.zoom", null).call(l.transform, a.value);
|
|
1800
1973
|
} finally {
|
|
1801
1974
|
y = !1;
|
|
1802
1975
|
}
|
|
@@ -1805,34 +1978,54 @@ function Sn(e) {
|
|
|
1805
1978
|
}
|
|
1806
1979
|
//#endregion
|
|
1807
1980
|
//#region src/components/core/useWaveformChartLifecycle.ts
|
|
1808
|
-
function
|
|
1981
|
+
function Vn(e) {
|
|
1809
1982
|
return e instanceof Element && !!e.closest("button, input, select, textarea, [contenteditable]:not([contenteditable=\"false\"])");
|
|
1810
1983
|
}
|
|
1811
|
-
function
|
|
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,
|
|
1813
|
-
function H(e) {
|
|
1814
|
-
P.value || e.code !== "Space" || !t.pannable || !_.value || Cn(e.target) || (g.value = !0, e.preventDefault());
|
|
1815
|
-
}
|
|
1984
|
+
function Hn(e) {
|
|
1985
|
+
let { props: t, emit: n, container: r, titleMeasureElement: i, resizeObserver: a, observedWidth: o, observedHeight: s, measuredTitleWidth: c, measuredTitleHeight: l, resolvedTitleText: u, titleAreaReserved: f, titleMeasureStyle: p, spacePressed: g, pointerInsideChart: _, currentPage: v, pageCount: y, pagedTracks: b, gridOptions: x, chartSeries: S, chartTracks: C, trackLayouts: w, innerWidth: T, innerHeight: D, activeInteractionMode: O, hiddenSeriesIdSet: k, internalHiddenSeriesIds: A, independentTransforms: j, independentYDomains: M, resolveInitialTrackDomain: N, annotationInteraction: P, editorSeriesOptions: F, isPresentationMode: I, clearHover: L, cancelAnnotation: R, configureZoom: z, resetViewport: B, cancelViewportDrag: V, cancelPendingHover: H, clearZoomBindings: U } = e;
|
|
1816
1986
|
function ee(e) {
|
|
1987
|
+
I.value || e.code !== "Space" || !t.pannable || !_.value || Vn(e.target) || (g.value = !0, e.preventDefault());
|
|
1988
|
+
}
|
|
1989
|
+
function W(e) {
|
|
1817
1990
|
e.code === "Space" && (g.value = !1);
|
|
1818
1991
|
}
|
|
1819
1992
|
function te(e) {
|
|
1820
1993
|
let r = Math.min(y.value, Math.max(1, Math.floor(e)));
|
|
1821
|
-
r !== v.value && (v.value = r,
|
|
1994
|
+
r !== v.value && (v.value = r, L(), P.closeContextMenu(), R(), t.displayMode === "independent" && (j.value = b.value.map(() => K), M.value = {}), d(z), n("page-change", r, y.value));
|
|
1822
1995
|
}
|
|
1996
|
+
let G;
|
|
1823
1997
|
function ne() {
|
|
1998
|
+
t.displayMode === "independent" && (G = w.value.map((e) => {
|
|
1999
|
+
let n = t.initialXDomains?.[e.series.trackId ?? e.series.id] ?? t.initialXDomains?.[e.series.id] ?? t.initialXDomain;
|
|
2000
|
+
if (!(!n || !Number.isFinite(n[0]) || !Number.isFinite(n[1]) || n[0] === n[1])) return e.xScale.domain();
|
|
2001
|
+
}));
|
|
2002
|
+
}
|
|
2003
|
+
function re() {
|
|
1824
2004
|
if (t.displayMode === "independent") {
|
|
1825
|
-
let e =
|
|
1826
|
-
|
|
2005
|
+
let e = j.value;
|
|
2006
|
+
j.value = C.value.map((t, n) => e[n] ?? K);
|
|
1827
2007
|
}
|
|
1828
|
-
|
|
2008
|
+
L(), F.value = [], d(() => {
|
|
2009
|
+
if (t.displayMode === "independent" && G) {
|
|
2010
|
+
let e = C.value.map(() => K);
|
|
2011
|
+
w.value.forEach((n) => {
|
|
2012
|
+
let r = G?.[n.index];
|
|
2013
|
+
if (!r) return;
|
|
2014
|
+
let i = N(n), a = In(r, i, [n.seriesList], t);
|
|
2015
|
+
e[n.index] = Ln(a, i, n.width);
|
|
2016
|
+
}), j.value = e, G = void 0, d(z);
|
|
2017
|
+
return;
|
|
2018
|
+
}
|
|
2019
|
+
G = void 0, z();
|
|
2020
|
+
});
|
|
1829
2021
|
}
|
|
1830
2022
|
E([
|
|
1831
|
-
w,
|
|
1832
2023
|
T,
|
|
2024
|
+
D,
|
|
1833
2025
|
() => t.zoomable,
|
|
1834
|
-
|
|
2026
|
+
I,
|
|
1835
2027
|
() => t.minZoomSpan,
|
|
2028
|
+
() => t.minVisiblePoints,
|
|
1836
2029
|
() => t.initialXDomain,
|
|
1837
2030
|
() => t.initialXDomains,
|
|
1838
2031
|
() => t.displayMode,
|
|
@@ -1840,42 +2033,42 @@ function wn(e) {
|
|
|
1840
2033
|
v,
|
|
1841
2034
|
() => x.value.rowCount,
|
|
1842
2035
|
() => x.value.columnCount,
|
|
1843
|
-
|
|
2036
|
+
O
|
|
1844
2037
|
], async () => {
|
|
1845
|
-
await d(),
|
|
2038
|
+
await d(), z();
|
|
1846
2039
|
}, { immediate: !0 }), E(() => t.displayMode, () => {
|
|
1847
2040
|
let e = v.value;
|
|
1848
|
-
v.value = 1,
|
|
2041
|
+
v.value = 1, B(), e !== 1 && n("page-change", 1, y.value);
|
|
1849
2042
|
}), E([
|
|
1850
2043
|
y,
|
|
1851
2044
|
() => t.grid?.rowCount,
|
|
1852
2045
|
() => t.grid?.columnCount
|
|
1853
2046
|
], () => {
|
|
1854
2047
|
let e = v.value;
|
|
1855
|
-
v.value = v.value > y.value ? y.value : v.value === 1 ? v.value : 1, e !== v.value && n("page-change", v.value, y.value),
|
|
1856
|
-
}), E(
|
|
1857
|
-
|
|
1858
|
-
}), E(
|
|
1859
|
-
g.value = !1, e && (
|
|
2048
|
+
v.value = v.value > y.value ? y.value : v.value === 1 ? v.value : 1, e !== v.value && n("page-change", v.value, y.value), L(), d(z);
|
|
2049
|
+
}), E(O, () => {
|
|
2050
|
+
F.value = [];
|
|
2051
|
+
}), E(I, (e) => {
|
|
2052
|
+
g.value = !1, e && (V(), U(), L(), P.closeContextMenu(), R());
|
|
1860
2053
|
}), E(() => S.value.map((e) => e.id).join("\0"), () => {
|
|
1861
2054
|
if (t.hiddenSeriesIds !== void 0) return;
|
|
1862
|
-
let e = new Set(S.value.map((e) => e.id)), n = new Set(Array.from(
|
|
1863
|
-
(n.size !==
|
|
2055
|
+
let e = new Set(S.value.map((e) => e.id)), n = new Set(Array.from(A.value).filter((t) => e.has(t)));
|
|
2056
|
+
(n.size !== A.value.size || Array.from(A.value).some((e) => !n.has(e))) && (A.value = n);
|
|
1864
2057
|
}, { immediate: !0 }), E(() => C.value.flatMap((e) => e.visibleSeries.map((e) => e.id)).join("\0"), () => {
|
|
1865
|
-
|
|
1866
|
-
let e =
|
|
1867
|
-
e && (!S.value.some((t) => t.id === e) ||
|
|
1868
|
-
let n =
|
|
1869
|
-
r &&
|
|
2058
|
+
L(), F.value = [];
|
|
2059
|
+
let e = P.editorDraft.value?.annotation.seriesId;
|
|
2060
|
+
e && (!S.value.some((t) => t.id === e) || k.value.has(e)) && P.closeEditor();
|
|
2061
|
+
let n = P.contextMenu.value?.annotationId, r = t.annotations.find((e) => e.id === n);
|
|
2062
|
+
r && k.value.has(r.seriesId) && P.closeContextMenu(), d(z);
|
|
1870
2063
|
}), E(() => t.annotationsVisible, (e) => {
|
|
1871
|
-
e || (
|
|
2064
|
+
e || (P.closeContextMenu(), R());
|
|
1872
2065
|
}), E(() => t.annotations, (e) => {
|
|
1873
|
-
let t =
|
|
1874
|
-
t && !e.some((e) => e.id === t) &&
|
|
1875
|
-
let n =
|
|
1876
|
-
n?.mode === "edit" && !e.some((e) => e.id === n.annotation.id) &&
|
|
2066
|
+
let t = P.contextMenu.value?.annotationId;
|
|
2067
|
+
t && !e.some((e) => e.id === t) && P.closeContextMenu();
|
|
2068
|
+
let n = P.editorDraft.value;
|
|
2069
|
+
n?.mode === "edit" && !e.some((e) => e.id === n.annotation.id) && P.closeEditor();
|
|
1877
2070
|
}, { deep: !0 });
|
|
1878
|
-
function
|
|
2071
|
+
function q() {
|
|
1879
2072
|
if (!f.value || !i.value) {
|
|
1880
2073
|
c.value = 0, l.value = 0;
|
|
1881
2074
|
return;
|
|
@@ -1888,21 +2081,22 @@ function wn(e) {
|
|
|
1888
2081
|
f,
|
|
1889
2082
|
p
|
|
1890
2083
|
], async () => {
|
|
1891
|
-
c.value = 0, l.value = 0, await d(),
|
|
2084
|
+
c.value = 0, l.value = 0, await d(), q();
|
|
1892
2085
|
}, { immediate: !0 }), h(() => {
|
|
1893
|
-
window.addEventListener("keydown",
|
|
1894
|
-
o.value = Math.max(0, e?.contentRect.width ?? 0), s.value = Math.max(0, e?.contentRect.height ?? 0), d(
|
|
2086
|
+
window.addEventListener("keydown", ee), window.addEventListener("keyup", W), r.value && (a.value = new ResizeObserver(([e]) => {
|
|
2087
|
+
o.value = Math.max(0, e?.contentRect.width ?? 0), s.value = Math.max(0, e?.contentRect.height ?? 0), d(q);
|
|
1895
2088
|
}), a.value.observe(r.value));
|
|
1896
2089
|
}), m(() => {
|
|
1897
|
-
window.removeEventListener("keydown",
|
|
2090
|
+
window.removeEventListener("keydown", ee), window.removeEventListener("keyup", W), H(), a.value?.disconnect(), U(), F.value = [];
|
|
1898
2091
|
}), {
|
|
1899
2092
|
goToPage: te,
|
|
1900
|
-
|
|
2093
|
+
handleBeforeDataReferenceChange: ne,
|
|
2094
|
+
handleDataReferenceChange: re
|
|
1901
2095
|
};
|
|
1902
2096
|
}
|
|
1903
2097
|
//#endregion
|
|
1904
2098
|
//#region src/components/core/useWaveformData.ts
|
|
1905
|
-
function
|
|
2099
|
+
function Un(e, t = !1) {
|
|
1906
2100
|
let n = Infinity, r = -Infinity, i = Infinity, a = -Infinity, o = !1;
|
|
1907
2101
|
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) {
|
|
1908
2102
|
let e = At(s);
|
|
@@ -1914,24 +2108,24 @@ function Tn(e, t = !1) {
|
|
|
1914
2108
|
hasErrorPoints: o
|
|
1915
2109
|
};
|
|
1916
2110
|
}
|
|
1917
|
-
function
|
|
2111
|
+
function Wn(e) {
|
|
1918
2112
|
return Mt(e).map((e) => {
|
|
1919
|
-
let t =
|
|
2113
|
+
let t = Un(e.points, e.errorBar.visible);
|
|
1920
2114
|
return {
|
|
1921
2115
|
...e,
|
|
1922
2116
|
...t
|
|
1923
2117
|
};
|
|
1924
2118
|
});
|
|
1925
2119
|
}
|
|
1926
|
-
function
|
|
1927
|
-
let
|
|
2120
|
+
function Gn(e, t, n) {
|
|
2121
|
+
let r = x(Wn(e()));
|
|
1928
2122
|
return E(e, (e) => {
|
|
1929
|
-
|
|
1930
|
-
}),
|
|
2123
|
+
t(), r.value = Wn(e), n();
|
|
2124
|
+
}), r;
|
|
1931
2125
|
}
|
|
1932
2126
|
//#endregion
|
|
1933
2127
|
//#region src/components/core/useWaveformLayout.ts
|
|
1934
|
-
function
|
|
2128
|
+
function Kn(e) {
|
|
1935
2129
|
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) => ({
|
|
1936
2130
|
...e,
|
|
1937
2131
|
color: e.color ?? (t === 0 ? n.lineColor : _t[t % _t.length])
|
|
@@ -1952,15 +2146,15 @@ function On(e) {
|
|
|
1952
2146
|
yDomain: $(i)
|
|
1953
2147
|
};
|
|
1954
2148
|
});
|
|
1955
|
-
}), g = t(() =>
|
|
1956
|
-
let e = h.value.filter((e) => e.visibleSeries.length > 0).flatMap((e) =>
|
|
2149
|
+
}), g = t(() => Xt(n.grid)), _ = t(() => zt(n.rendering)), v = t(() => Qt(h.value.length, g.value)), y = t(() => $t(h.value, i.value, g.value)), b = t(() => {
|
|
2150
|
+
let e = h.value.filter((e) => e.visibleSeries.length > 0).flatMap((e) => pn(e, n.overlayMode, n.yDomain, n.yDomains)).map((e) => mn(e.domain, !e.fixed).tickTextWidth), t = Math.max(7, ...e), r = t + 7 + 4, i = -(7 + t + 6 + 24 / 2);
|
|
1957
2151
|
return {
|
|
1958
2152
|
tickClearance: r,
|
|
1959
2153
|
fullClearance: t + 7 + 6 + 24 + 4,
|
|
1960
2154
|
labelCenterX: i
|
|
1961
2155
|
};
|
|
1962
2156
|
}), 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 =
|
|
2157
|
+
let r = _n(t, n.overlayMode, n.yDomain, n.yDomains);
|
|
1964
2158
|
return {
|
|
1965
2159
|
left: Math.max(e.left, r.left),
|
|
1966
2160
|
right: Math.max(e.right, r.right)
|
|
@@ -1969,7 +2163,7 @@ function On(e) {
|
|
|
1969
2163
|
left: 0,
|
|
1970
2164
|
right: 0
|
|
1971
2165
|
})), 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 =
|
|
2166
|
+
let e = en(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;
|
|
1973
2167
|
return {
|
|
1974
2168
|
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,
|
|
1975
2169
|
hideSecondaryLabels: n.overlayMode !== "multi-axis" && r && x.value && !o
|
|
@@ -1985,10 +2179,10 @@ function On(e) {
|
|
|
1985
2179
|
}), I = (e) => {
|
|
1986
2180
|
let t = n.initialXDomains?.[e.series.trackId ?? e.series.id] ?? n.initialXDomains?.[e.series.id] ?? n.initialXDomain;
|
|
1987
2181
|
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));
|
|
1988
|
-
}, L = t(() => l.value.rescaleX(B(F.value, [0, D.value])).domain()), R = t(() =>
|
|
2182
|
+
}, L = t(() => l.value.rescaleX(B(F.value, [0, D.value])).domain()), R = t(() => tn(D.value, s.value, g.value, n.displayMode, y.value.map(Boolean), O.value.horizontalGap).map((e, t) => ({
|
|
1989
2183
|
...e,
|
|
1990
2184
|
series: y.value[t]
|
|
1991
|
-
}))), z = t(() =>
|
|
2185
|
+
}))), z = t(() => rn({
|
|
1992
2186
|
cells: R.value,
|
|
1993
2187
|
grid: g.value,
|
|
1994
2188
|
displayMode: n.displayMode,
|
|
@@ -2013,7 +2207,7 @@ function On(e) {
|
|
|
2013
2207
|
...e,
|
|
2014
2208
|
series: t,
|
|
2015
2209
|
yScale: e.seriesPaths.find((e) => e.series.id === t.id)?.yScale ?? e.yScale
|
|
2016
|
-
})), H = (e, t) => e.seriesPaths.find((e) => e.series.id === t)?.yScale ?? e.yScale,
|
|
2210
|
+
})), H = (e, t) => e.seriesPaths.find((e) => e.series.id === t)?.yScale ?? e.yScale, U = t(() => z.value.flatMap(V));
|
|
2017
2211
|
return {
|
|
2018
2212
|
chartSeries: m,
|
|
2019
2213
|
chartTracks: h,
|
|
@@ -2035,9 +2229,8 @@ function On(e) {
|
|
|
2035
2229
|
trackLayouts: z,
|
|
2036
2230
|
annotationLayoutsForTrack: V,
|
|
2037
2231
|
resolveSeriesYScale: H,
|
|
2038
|
-
annotationTrackLayouts:
|
|
2039
|
-
renderedAnnotations: t(() => n.annotationsVisible ?
|
|
2040
|
-
xAxisTitleY: t(() => s.value + 30 + 10),
|
|
2232
|
+
annotationTrackLayouts: U,
|
|
2233
|
+
renderedAnnotations: t(() => n.annotationsVisible ? pe(n.annotations, U.value, D.value, s.value) : []),
|
|
2041
2234
|
editorSeries: t(() => {
|
|
2042
2235
|
let e = p.editorDraft.value?.annotation.seriesId, t = m.value.find((t) => t.id === e);
|
|
2043
2236
|
return t ? {
|
|
@@ -2052,13 +2245,13 @@ function On(e) {
|
|
|
2052
2245
|
}
|
|
2053
2246
|
};
|
|
2054
2247
|
}
|
|
2055
|
-
var
|
|
2056
|
-
function
|
|
2248
|
+
var qn = 1e-6;
|
|
2249
|
+
function Jn(e) {
|
|
2057
2250
|
return Number.isFinite(e) ? Math.max(1, e) : 1;
|
|
2058
2251
|
}
|
|
2059
|
-
function
|
|
2060
|
-
let i =
|
|
2061
|
-
if (!(d >
|
|
2252
|
+
function Yn({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r }) {
|
|
2253
|
+
let i = Jn(e), a = Jn(t), o = Jn(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;
|
|
2254
|
+
if (!(d > qn && Math.abs(d - 360) > qn)) {
|
|
2062
2255
|
let e = Math.max(1, Math.ceil(i / o)), t = o, n = a * e;
|
|
2063
2256
|
return {
|
|
2064
2257
|
textWidth: t,
|
|
@@ -2083,7 +2276,7 @@ function jn({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r
|
|
|
2083
2276
|
}
|
|
2084
2277
|
//#endregion
|
|
2085
2278
|
//#region src/components/core/useWaveformPresentation.ts
|
|
2086
|
-
function
|
|
2279
|
+
function Xn(e) {
|
|
2087
2280
|
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(() => ({
|
|
2088
2281
|
width: l.value === void 0 ? "100%" : `${l.value}px`,
|
|
2089
2282
|
height: u.value === void 0 ? "100%" : `${u.value}px`
|
|
@@ -2128,12 +2321,15 @@ function Mn(e) {
|
|
|
2128
2321
|
maxWidth: O.value ? "none" : `${j.value}px`,
|
|
2129
2322
|
whiteSpace: O.value ? "nowrap" : "normal",
|
|
2130
2323
|
overflowWrap: O.value ? "normal" : "anywhere"
|
|
2131
|
-
})), N = t(() =>
|
|
2324
|
+
})), N = t(() => Yn({
|
|
2132
2325
|
naturalWidth: a.value || A.value,
|
|
2133
2326
|
naturalHeight: o.value || E.value * 1.2,
|
|
2134
2327
|
availableWidth: j.value,
|
|
2135
2328
|
rotation: D.value
|
|
2136
|
-
})), P = t(() => w.value ? N.value.areaHeight : 0), F = t
|
|
2329
|
+
})), P = t(() => w.value ? N.value.areaHeight : 0), F = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, I = t(() => ({
|
|
2330
|
+
top: F(n.plotMargin.top, pt.top),
|
|
2331
|
+
bottom: F(n.plotMargin.bottom, pt.bottom)
|
|
2332
|
+
})), L = t(() => I.value.top), R = t(() => Math.max(0, f.value - P.value - c.value));
|
|
2137
2333
|
return {
|
|
2138
2334
|
fixedWidth: l,
|
|
2139
2335
|
fixedHeight: u,
|
|
@@ -2155,9 +2351,11 @@ function Mn(e) {
|
|
|
2155
2351
|
titleMeasureStyle: M,
|
|
2156
2352
|
titleLayout: N,
|
|
2157
2353
|
titleAreaHeight: P,
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2354
|
+
resolvedPlotMargin: I,
|
|
2355
|
+
chartTopMargin: L,
|
|
2356
|
+
drawingHeight: R,
|
|
2357
|
+
xAxisTitleY: t(() => Math.max(0, R.value - 12)),
|
|
2358
|
+
innerHeight: t(() => Math.max(0, R.value - I.value.top - I.value.bottom)),
|
|
2161
2359
|
titleAreaStyle: t(() => ({
|
|
2162
2360
|
height: `${P.value}px`,
|
|
2163
2361
|
justifyContent: n.title?.align === "left" ? "flex-start" : n.title?.align === "right" ? "flex-end" : "center"
|
|
@@ -2179,22 +2377,22 @@ function Mn(e) {
|
|
|
2179
2377
|
}
|
|
2180
2378
|
//#endregion
|
|
2181
2379
|
//#region src/components/core/useWaveformChartController.ts
|
|
2182
|
-
function
|
|
2380
|
+
function Zn(e, t) {
|
|
2183
2381
|
e.value = t instanceof Element ? t : void 0;
|
|
2184
2382
|
}
|
|
2185
|
-
function
|
|
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(
|
|
2383
|
+
function Qn(e, t) {
|
|
2384
|
+
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(K), p = x([]), m = v({}), h = v({}), g = b({
|
|
2187
2385
|
points: [],
|
|
2188
2386
|
trackIndex: null,
|
|
2189
2387
|
position: {
|
|
2190
2388
|
x: 0,
|
|
2191
2389
|
y: 0
|
|
2192
2390
|
}
|
|
2193
|
-
}), y = v(!1), S = v(1), w = x(), T =
|
|
2391
|
+
}), y = v(!1), S = v(1), w = x(), T = ae("waveform-clip"), O = v(new Set(e.defaultHiddenSeriesIds)), k = Ge(), A = v([]), j = zn();
|
|
2194
2392
|
E([() => e.yDomain, () => e.yDomains], () => {
|
|
2195
2393
|
m.value = {}, h.value = {};
|
|
2196
2394
|
}, { deep: !0 });
|
|
2197
|
-
let M =
|
|
2395
|
+
let M = x(null), N = v(!1), P = v(!1), F = () => void 0, I = () => void 0, L = Gn(() => e.data, () => F(), () => I()), R = Xn({
|
|
2198
2396
|
props: e,
|
|
2199
2397
|
observedWidth: o,
|
|
2200
2398
|
observedHeight: s,
|
|
@@ -2202,101 +2400,101 @@ function Pn(e, t) {
|
|
|
2202
2400
|
measuredTitleHeight: l,
|
|
2203
2401
|
internalHiddenSeriesIds: O,
|
|
2204
2402
|
paginationBandHeight: d
|
|
2205
|
-
}), { chartWidth:
|
|
2403
|
+
}), { chartWidth: z, chartHeight: B, isCleanView: V, isPresentationMode: H, hiddenSeriesIdSet: U, resolvedTitleText: ee, titleAreaReserved: W, titleMeasureStyle: te, titleAreaHeight: G, chartTopMargin: ne, innerHeight: re } = R, q = Kn({
|
|
2206
2404
|
props: e,
|
|
2207
|
-
preparedSeries:
|
|
2405
|
+
preparedSeries: L,
|
|
2208
2406
|
currentPage: S,
|
|
2209
|
-
hiddenSeriesIdSet:
|
|
2210
|
-
chartWidth:
|
|
2211
|
-
innerHeight:
|
|
2212
|
-
isCleanView:
|
|
2407
|
+
hiddenSeriesIdSet: U,
|
|
2408
|
+
chartWidth: z,
|
|
2409
|
+
innerHeight: re,
|
|
2410
|
+
isCleanView: V,
|
|
2213
2411
|
sharedTransform: f,
|
|
2214
2412
|
independentTransforms: p,
|
|
2215
2413
|
sharedYDomains: m,
|
|
2216
2414
|
independentYDomains: h,
|
|
2217
2415
|
annotationInteraction: u(k)
|
|
2218
|
-
}), { chartSeries:
|
|
2416
|
+
}), { chartSeries: ie, chartTracks: oe, trackLayouts: se, gridOptions: ce, pageCount: le, pagedTracks: ue, resolvedChartLeftMargin: de, innerWidth: J, hasChartArea: fe, activeInteractionMode: pe, isZoomMode: Y, initialXDomain: me, sharedZoomDomain: he, resolveInitialTrackDomain: ge, annotationLayoutsForTrack: _e, resolveSeriesYScale: ve } = q;
|
|
2219
2417
|
D(() => {
|
|
2220
|
-
d.value =
|
|
2418
|
+
d.value = ce.value.showPagination && le.value > 1 && z.value <= 520 ? 40 : 0;
|
|
2221
2419
|
});
|
|
2222
|
-
let
|
|
2420
|
+
let X = Bn({
|
|
2223
2421
|
props: e,
|
|
2224
2422
|
emit: t,
|
|
2225
2423
|
svgElement: r,
|
|
2226
2424
|
sharedOverlayElement: a,
|
|
2227
2425
|
sharedTransform: f,
|
|
2228
2426
|
independentTransforms: p,
|
|
2229
|
-
trackLayouts:
|
|
2230
|
-
initialXDomain:
|
|
2231
|
-
sharedZoomDomain:
|
|
2232
|
-
innerWidth:
|
|
2233
|
-
innerHeight:
|
|
2234
|
-
hasChartArea:
|
|
2235
|
-
isZoomMode:
|
|
2236
|
-
isPresentationMode:
|
|
2237
|
-
resolveInitialTrackDomain:
|
|
2238
|
-
cancelPendingHover: () =>
|
|
2239
|
-
}),
|
|
2427
|
+
trackLayouts: se,
|
|
2428
|
+
initialXDomain: me,
|
|
2429
|
+
sharedZoomDomain: he,
|
|
2430
|
+
innerWidth: J,
|
|
2431
|
+
innerHeight: re,
|
|
2432
|
+
hasChartArea: fe,
|
|
2433
|
+
isZoomMode: Y,
|
|
2434
|
+
isPresentationMode: H,
|
|
2435
|
+
resolveInitialTrackDomain: ge,
|
|
2436
|
+
cancelPendingHover: () => Z.cancelPendingHover()
|
|
2437
|
+
}), ye = xn({
|
|
2240
2438
|
props: e,
|
|
2241
2439
|
emit: t,
|
|
2242
2440
|
container: n,
|
|
2243
|
-
chartSeries:
|
|
2244
|
-
hiddenSeriesIdSet:
|
|
2441
|
+
chartSeries: ie,
|
|
2442
|
+
hiddenSeriesIdSet: U,
|
|
2245
2443
|
internalHiddenSeriesIds: O,
|
|
2246
2444
|
annotationInteraction: k,
|
|
2247
2445
|
editorSeriesOptions: A,
|
|
2248
|
-
trackLayouts:
|
|
2249
|
-
annotationLayoutsForTrack:
|
|
2250
|
-
resolveSeriesYScale:
|
|
2251
|
-
chartWidth:
|
|
2252
|
-
chartHeight:
|
|
2253
|
-
innerWidth:
|
|
2254
|
-
resolvedChartLeftMargin:
|
|
2255
|
-
titleAreaHeight:
|
|
2256
|
-
chartTopMargin:
|
|
2257
|
-
activeInteractionMode:
|
|
2258
|
-
isPresentationMode:
|
|
2259
|
-
}),
|
|
2446
|
+
trackLayouts: se,
|
|
2447
|
+
annotationLayoutsForTrack: _e,
|
|
2448
|
+
resolveSeriesYScale: ve,
|
|
2449
|
+
chartWidth: z,
|
|
2450
|
+
chartHeight: B,
|
|
2451
|
+
innerWidth: J,
|
|
2452
|
+
resolvedChartLeftMargin: de,
|
|
2453
|
+
titleAreaHeight: G,
|
|
2454
|
+
chartTopMargin: ne,
|
|
2455
|
+
activeInteractionMode: pe,
|
|
2456
|
+
isPresentationMode: H
|
|
2457
|
+
}), be = Rn({
|
|
2260
2458
|
props: e,
|
|
2261
2459
|
emit: t,
|
|
2262
2460
|
selection: M,
|
|
2263
2461
|
spacePressed: N,
|
|
2264
|
-
trackLayouts:
|
|
2265
|
-
chartTracks:
|
|
2266
|
-
initialXDomain:
|
|
2267
|
-
innerWidth:
|
|
2268
|
-
innerHeight:
|
|
2462
|
+
trackLayouts: se,
|
|
2463
|
+
chartTracks: oe,
|
|
2464
|
+
initialXDomain: me,
|
|
2465
|
+
innerWidth: J,
|
|
2466
|
+
innerHeight: re,
|
|
2269
2467
|
sharedOverlayElement: a,
|
|
2270
2468
|
sharedTransform: f,
|
|
2271
2469
|
independentTransforms: p,
|
|
2272
2470
|
sharedYDomains: m,
|
|
2273
2471
|
independentYDomains: h,
|
|
2274
|
-
isZoomMode:
|
|
2275
|
-
isPresentationMode:
|
|
2472
|
+
isZoomMode: Y,
|
|
2473
|
+
isPresentationMode: H,
|
|
2276
2474
|
editorSeriesOptions: A,
|
|
2277
|
-
resolveInitialTrackDomain:
|
|
2278
|
-
canZoomTrack:
|
|
2279
|
-
canZoomSharedTracks:
|
|
2280
|
-
configureZoom:
|
|
2281
|
-
cancelPendingZoom:
|
|
2282
|
-
clearHover: () =>
|
|
2283
|
-
resolveTrackAtPointer:
|
|
2284
|
-
}),
|
|
2475
|
+
resolveInitialTrackDomain: ge,
|
|
2476
|
+
canZoomTrack: X.canZoomTrack,
|
|
2477
|
+
canZoomSharedTracks: X.canZoomSharedTracks,
|
|
2478
|
+
configureZoom: X.configureZoom,
|
|
2479
|
+
cancelPendingZoom: X.cancelPendingZoom,
|
|
2480
|
+
clearHover: () => Z.clearHover(),
|
|
2481
|
+
resolveTrackAtPointer: ye.resolveTrackAtPointer
|
|
2482
|
+
}), Z = Cn({
|
|
2285
2483
|
emit: t,
|
|
2286
2484
|
hoverState: g,
|
|
2287
2485
|
suppressHoverUntilMove: y,
|
|
2288
2486
|
hoverThrottle: j,
|
|
2289
2487
|
selection: M,
|
|
2290
|
-
trackLayouts:
|
|
2291
|
-
innerWidth:
|
|
2292
|
-
resolvedChartLeftMargin:
|
|
2293
|
-
titleAreaHeight:
|
|
2294
|
-
chartTopMargin:
|
|
2488
|
+
trackLayouts: se,
|
|
2489
|
+
innerWidth: J,
|
|
2490
|
+
resolvedChartLeftMargin: de,
|
|
2491
|
+
titleAreaHeight: G,
|
|
2492
|
+
chartTopMargin: ne,
|
|
2295
2493
|
sharedOverlayElement: a,
|
|
2296
|
-
isPresentationMode:
|
|
2297
|
-
updateViewportDrag:
|
|
2298
|
-
resolveTrackAtPointer:
|
|
2299
|
-
}),
|
|
2494
|
+
isPresentationMode: H,
|
|
2495
|
+
updateViewportDrag: be.updateViewportDrag,
|
|
2496
|
+
resolveTrackAtPointer: ye.resolveTrackAtPointer
|
|
2497
|
+
}), xe = Hn({
|
|
2300
2498
|
props: e,
|
|
2301
2499
|
emit: t,
|
|
2302
2500
|
container: n,
|
|
@@ -2307,43 +2505,45 @@ function Pn(e, t) {
|
|
|
2307
2505
|
measuredTitleWidth: c,
|
|
2308
2506
|
measuredTitleHeight: l,
|
|
2309
2507
|
resolvedTitleText: ee,
|
|
2310
|
-
titleAreaReserved:
|
|
2311
|
-
titleMeasureStyle:
|
|
2508
|
+
titleAreaReserved: W,
|
|
2509
|
+
titleMeasureStyle: te,
|
|
2312
2510
|
spacePressed: N,
|
|
2313
2511
|
pointerInsideChart: P,
|
|
2314
2512
|
currentPage: S,
|
|
2315
|
-
pageCount:
|
|
2316
|
-
pagedTracks:
|
|
2317
|
-
gridOptions:
|
|
2318
|
-
chartSeries:
|
|
2319
|
-
chartTracks:
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2513
|
+
pageCount: le,
|
|
2514
|
+
pagedTracks: ue,
|
|
2515
|
+
gridOptions: ce,
|
|
2516
|
+
chartSeries: ie,
|
|
2517
|
+
chartTracks: oe,
|
|
2518
|
+
trackLayouts: se,
|
|
2519
|
+
innerWidth: J,
|
|
2520
|
+
innerHeight: re,
|
|
2521
|
+
activeInteractionMode: pe,
|
|
2522
|
+
hiddenSeriesIdSet: U,
|
|
2324
2523
|
internalHiddenSeriesIds: O,
|
|
2325
2524
|
independentTransforms: p,
|
|
2326
2525
|
independentYDomains: h,
|
|
2526
|
+
resolveInitialTrackDomain: ge,
|
|
2327
2527
|
annotationInteraction: k,
|
|
2328
2528
|
editorSeriesOptions: A,
|
|
2329
|
-
isPresentationMode:
|
|
2330
|
-
clearHover:
|
|
2331
|
-
cancelAnnotation:
|
|
2332
|
-
configureZoom:
|
|
2333
|
-
resetViewport:
|
|
2334
|
-
cancelViewportDrag:
|
|
2335
|
-
cancelPendingHover:
|
|
2336
|
-
clearZoomBindings:
|
|
2529
|
+
isPresentationMode: H,
|
|
2530
|
+
clearHover: Z.clearHover,
|
|
2531
|
+
cancelAnnotation: ye.cancelAnnotation,
|
|
2532
|
+
configureZoom: X.configureZoom,
|
|
2533
|
+
resetViewport: be.resetViewport,
|
|
2534
|
+
cancelViewportDrag: be.cancelViewportDrag,
|
|
2535
|
+
cancelPendingHover: Z.cancelPendingHover,
|
|
2536
|
+
clearZoomBindings: X.clearZoomBindings
|
|
2337
2537
|
});
|
|
2338
|
-
return F =
|
|
2538
|
+
return F = xe.handleBeforeDataReferenceChange, I = xe.handleDataReferenceChange, _({
|
|
2339
2539
|
...C(e),
|
|
2340
|
-
...
|
|
2341
|
-
...
|
|
2342
|
-
...
|
|
2343
|
-
...
|
|
2344
|
-
...
|
|
2540
|
+
...R,
|
|
2541
|
+
...q,
|
|
2542
|
+
...ye,
|
|
2543
|
+
...be,
|
|
2544
|
+
...Z,
|
|
2345
2545
|
margin: pt,
|
|
2346
|
-
getPageSize:
|
|
2546
|
+
getPageSize: Zt,
|
|
2347
2547
|
currentPage: S,
|
|
2348
2548
|
selection: M,
|
|
2349
2549
|
pointerInsideChart: P,
|
|
@@ -2353,32 +2553,32 @@ function Pn(e, t) {
|
|
|
2353
2553
|
contextMenu: k.contextMenu,
|
|
2354
2554
|
editorSeriesOptions: A,
|
|
2355
2555
|
clipPathId: T,
|
|
2356
|
-
goToPage:
|
|
2357
|
-
setContainer: (e) =>
|
|
2358
|
-
setSvgElement: (e) =>
|
|
2359
|
-
setTitleMeasureElement: (e) =>
|
|
2360
|
-
setSharedOverlayElement: (e) =>
|
|
2556
|
+
goToPage: xe.goToPage,
|
|
2557
|
+
setContainer: (e) => Zn(n, e),
|
|
2558
|
+
setSvgElement: (e) => Zn(r, e),
|
|
2559
|
+
setTitleMeasureElement: (e) => Zn(i, e),
|
|
2560
|
+
setSharedOverlayElement: (e) => Zn(a, e)
|
|
2361
2561
|
});
|
|
2362
2562
|
}
|
|
2363
2563
|
//#endregion
|
|
2364
2564
|
//#region src/components/annotation/WaveformAnnotationEditor.vue?vue&type=script&setup=true&lang.ts
|
|
2365
|
-
var
|
|
2565
|
+
var $n = ["aria-labelledby"], er = { class: "waveform-annotation-editor__panel" }, tr = { class: "waveform-annotation-editor__header" }, nr = ["id"], rr = {
|
|
2366
2566
|
class: "waveform-annotation-editor__coordinates",
|
|
2367
2567
|
"aria-label": "标注坐标"
|
|
2368
|
-
},
|
|
2568
|
+
}, ir = {
|
|
2369
2569
|
key: 0,
|
|
2370
2570
|
class: "waveform-annotation-editor__series",
|
|
2371
2571
|
"aria-label": "标注所属波形"
|
|
2372
|
-
},
|
|
2572
|
+
}, ar = { class: "waveform-annotation-editor__series-label" }, or = ["value"], sr = ["value"], cr = { key: 1 }, lr = { class: "waveform-annotation-editor__field" }, ur = { class: "waveform-annotation-editor__label-row" }, dr = ["maxlength"], fr = { class: "waveform-annotation-editor__colors" }, pr = {
|
|
2373
2573
|
class: "waveform-annotation-editor__color-field",
|
|
2374
2574
|
title: "调整标注边框色和透明度"
|
|
2375
|
-
},
|
|
2575
|
+
}, mr = {
|
|
2376
2576
|
class: "waveform-annotation-editor__color-field",
|
|
2377
2577
|
title: "调整标注文字色和透明度"
|
|
2378
|
-
},
|
|
2578
|
+
}, hr = {
|
|
2379
2579
|
class: "waveform-annotation-editor__color-field",
|
|
2380
2580
|
title: "调整标注背景色和透明度"
|
|
2381
|
-
},
|
|
2581
|
+
}, gr = { class: "waveform-annotation-editor__actions" }, _r = ["disabled"], vr = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
2382
2582
|
__name: "WaveformAnnotationEditor",
|
|
2383
2583
|
props: {
|
|
2384
2584
|
annotation: {},
|
|
@@ -2393,7 +2593,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2393
2593
|
"series-change"
|
|
2394
2594
|
],
|
|
2395
2595
|
setup(n, { emit: o }) {
|
|
2396
|
-
let c = n, l = o, u = v(), f =
|
|
2596
|
+
let c = n, l = o, u = v(), f = ae("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(() => {
|
|
2397
2597
|
let e = c.seriesOptions?.find((e) => e.seriesId === c.annotation.seriesId);
|
|
2398
2598
|
return e ? {
|
|
2399
2599
|
id: e.seriesId,
|
|
@@ -2403,7 +2603,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2403
2603
|
} : c.series;
|
|
2404
2604
|
});
|
|
2405
2605
|
function A() {
|
|
2406
|
-
let e =
|
|
2606
|
+
let e = Z(c.annotation.style);
|
|
2407
2607
|
m.value = c.annotation.text, h.value = e.borderColor, _.value = e.textColor, b.value = e.backgroundColor, d(() => u.value?.focus());
|
|
2408
2608
|
}
|
|
2409
2609
|
E(() => c.annotation, A, { immediate: !0 });
|
|
@@ -2431,21 +2631,21 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2431
2631
|
"aria-modal": "true",
|
|
2432
2632
|
"aria-labelledby": w(f),
|
|
2433
2633
|
onClick: n[6] ||= k((e) => l("cancel"), ["self"])
|
|
2434
|
-
}, [a("section",
|
|
2435
|
-
a("header",
|
|
2634
|
+
}, [a("section", er, [
|
|
2635
|
+
a("header", tr, [a("div", null, [a("h2", { id: w(f) }, S(c.mode === "add" ? "添加标注" : "编辑标注"), 9, nr)]), a("button", {
|
|
2436
2636
|
type: "button",
|
|
2437
2637
|
class: "waveform-annotation-editor__close",
|
|
2438
2638
|
"aria-label": "关闭标注编辑器",
|
|
2439
2639
|
title: "关闭",
|
|
2440
2640
|
onClick: n[0] ||= (e) => l("cancel")
|
|
2441
2641
|
}, " × ")]),
|
|
2442
|
-
a("div",
|
|
2443
|
-
D.value ? (g(), i("label",
|
|
2642
|
+
a("div", rr, [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)])]),
|
|
2643
|
+
D.value ? (g(), i("label", ir, [
|
|
2444
2644
|
a("i", {
|
|
2445
2645
|
style: p({ backgroundColor: D.value.color }),
|
|
2446
2646
|
"aria-hidden": "true"
|
|
2447
2647
|
}, null, 4),
|
|
2448
|
-
a("span",
|
|
2648
|
+
a("span", ar, [n[8] ||= a("small", null, "标注波形", -1), a("b", null, S(D.value.name), 1)]),
|
|
2449
2649
|
c.seriesOptions?.length ? (g(), i("select", {
|
|
2450
2650
|
key: 0,
|
|
2451
2651
|
value: c.annotation.seriesId,
|
|
@@ -2454,9 +2654,9 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2454
2654
|
}, [(g(!0), i(e, null, y(c.seriesOptions, (e) => (g(), i("option", {
|
|
2455
2655
|
key: e.seriesId,
|
|
2456
2656
|
value: e.seriesId
|
|
2457
|
-
}, S(e.name) + S(e.unit ? ` (${e.unit})` : ""), 9,
|
|
2657
|
+
}, S(e.name) + S(e.unit ? ` (${e.unit})` : ""), 9, sr))), 128))], 40, or)) : D.value.unit ? (g(), i("code", cr, S(D.value.unit), 1)) : r("", !0)
|
|
2458
2658
|
])) : r("", !0),
|
|
2459
|
-
a("label",
|
|
2659
|
+
a("label", lr, [a("span", ur, [n[9] ||= a("b", null, "标注文本", -1), a("small", null, S(C.value) + "/" + S(w(40)), 1)]), O(a("textarea", {
|
|
2460
2660
|
ref_key: "textarea",
|
|
2461
2661
|
ref: u,
|
|
2462
2662
|
"onUpdate:modelValue": n[1] ||= (e) => m.value = e,
|
|
@@ -2465,10 +2665,10 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2465
2665
|
"aria-label": "标注文本",
|
|
2466
2666
|
placeholder: "输入这处波形的说明",
|
|
2467
2667
|
onKeydown: M
|
|
2468
|
-
}, null, 40,
|
|
2469
|
-
a("fieldset",
|
|
2668
|
+
}, null, 40, dr), [[T, m.value]])]),
|
|
2669
|
+
a("fieldset", fr, [
|
|
2470
2670
|
n[13] ||= a("legend", null, "颜色与透明度", -1),
|
|
2471
|
-
a("label",
|
|
2671
|
+
a("label", pr, [n[10] ||= a("span", null, "边框色", -1), s(w(q), {
|
|
2472
2672
|
"pure-color": h.value,
|
|
2473
2673
|
"onUpdate:pureColor": n[2] ||= (e) => h.value = e,
|
|
2474
2674
|
"aria-label": "标注边框色",
|
|
@@ -2478,7 +2678,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2478
2678
|
"disable-alpha": !1,
|
|
2479
2679
|
"blur-close": !0
|
|
2480
2680
|
}, null, 8, ["pure-color"])]),
|
|
2481
|
-
a("label",
|
|
2681
|
+
a("label", mr, [n[11] ||= a("span", null, "文字色", -1), s(w(q), {
|
|
2482
2682
|
"pure-color": _.value,
|
|
2483
2683
|
"onUpdate:pureColor": n[3] ||= (e) => _.value = e,
|
|
2484
2684
|
"aria-label": "标注文字色",
|
|
@@ -2488,7 +2688,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2488
2688
|
"disable-alpha": !1,
|
|
2489
2689
|
"blur-close": !0
|
|
2490
2690
|
}, null, 8, ["pure-color"])]),
|
|
2491
|
-
a("label",
|
|
2691
|
+
a("label", hr, [n[12] ||= a("span", null, "背景色", -1), s(w(q), {
|
|
2492
2692
|
"pure-color": b.value,
|
|
2493
2693
|
"onUpdate:pureColor": n[4] ||= (e) => b.value = e,
|
|
2494
2694
|
"aria-label": "标注背景色",
|
|
@@ -2499,7 +2699,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2499
2699
|
"blur-close": !0
|
|
2500
2700
|
}, null, 8, ["pure-color"])])
|
|
2501
2701
|
]),
|
|
2502
|
-
a("footer",
|
|
2702
|
+
a("footer", gr, [a("button", {
|
|
2503
2703
|
type: "button",
|
|
2504
2704
|
onClick: n[5] ||= (e) => l("cancel")
|
|
2505
2705
|
}, "取消"), a("button", {
|
|
@@ -2507,10 +2707,10 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2507
2707
|
class: "is-primary",
|
|
2508
2708
|
disabled: !x.value,
|
|
2509
2709
|
onClick: j
|
|
2510
|
-
}, " 保存标注 ", 8,
|
|
2511
|
-
])], 8,
|
|
2710
|
+
}, " 保存标注 ", 8, _r)])
|
|
2711
|
+
])], 8, $n));
|
|
2512
2712
|
}
|
|
2513
|
-
}), [["__scopeId", "data-v-52818b45"]]),
|
|
2713
|
+
}), [["__scopeId", "data-v-52818b45"]]), yr = { class: "waveform-tooltip__time waveform-chart__tooltip-time" }, br = { class: "waveform-tooltip__series-content" }, xr = { key: 0 }, Sr = { class: "waveform-tooltip__value" }, Cr = { key: 0 }, wr = 12, Tr = 8, Er = 238, Dr = 320, Or = 20, kr = 20, Ar = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
2514
2714
|
__name: "WaveformTooltip",
|
|
2515
2715
|
props: {
|
|
2516
2716
|
visible: { type: Boolean },
|
|
@@ -2522,32 +2722,50 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2522
2722
|
containerHeight: {}
|
|
2523
2723
|
},
|
|
2524
2724
|
setup(n) {
|
|
2525
|
-
let s = n
|
|
2725
|
+
let s = n;
|
|
2726
|
+
function c(e, t) {
|
|
2727
|
+
let n = Math.max(1, t - Or - 14), r = Math.max(1, Math.floor(n / 7.2));
|
|
2728
|
+
return Math.max(1, Math.ceil([...e].length / r));
|
|
2729
|
+
}
|
|
2730
|
+
function l(e) {
|
|
2731
|
+
let t = f(e.point);
|
|
2732
|
+
return `${e.name ? `${e.name}: ` : ""}${rt(e.point.y)}${e.unit ? ` ${e.unit}` : ""}${t ? ` ${t}` : ""}`;
|
|
2733
|
+
}
|
|
2734
|
+
function u(e, t) {
|
|
2735
|
+
let n = s.seriesPoints.reduce((t, n) => t + c(l(n), e), 0);
|
|
2736
|
+
return 16 + kr * (c(t, e) + n) + 5;
|
|
2737
|
+
}
|
|
2738
|
+
let d = t(() => {
|
|
2526
2739
|
if (!s.visible || !s.hoveredPoint) return { display: "none" };
|
|
2527
|
-
let e =
|
|
2740
|
+
let e = s.position.x + wr, t = s.position.x - wr - Er, n = s.containerWidth - Tr - e, r = s.position.x - wr - Tr, i = Math.max(1, Math.min(Dr, s.containerWidth - Tr * 2)), a = e + Er <= s.containerWidth - Tr ? {
|
|
2741
|
+
left: `${e}px`,
|
|
2742
|
+
maxWidth: `${Math.min(Dr, n)}px`
|
|
2743
|
+
} : t >= Tr ? {
|
|
2744
|
+
right: `${s.containerWidth - s.position.x + wr}px`,
|
|
2745
|
+
maxWidth: `${Math.min(Dr, r)}px`
|
|
2746
|
+
} : {
|
|
2747
|
+
left: `${Tr}px`,
|
|
2748
|
+
maxWidth: `${i}px`
|
|
2749
|
+
}, o = Number.parseFloat(a.maxWidth), c = `${s.timeUnit}: ${lt(s.hoveredPoint.x, s.timeUnit)}`;
|
|
2528
2750
|
return {
|
|
2529
|
-
...
|
|
2530
|
-
top: `${Math.max(8, Math.min(s.position.y - 18, s.containerHeight -
|
|
2751
|
+
...a,
|
|
2752
|
+
top: `${Math.max(8, Math.min(s.position.y - 18, s.containerHeight - u(o, c) - 8))}px`
|
|
2531
2753
|
};
|
|
2532
2754
|
});
|
|
2533
|
-
function
|
|
2755
|
+
function f(e) {
|
|
2534
2756
|
let { lower: t, upper: n } = At(e);
|
|
2535
2757
|
return t === 0 && n === 0 ? null : `(+${rt(n)} / -${rt(t)})`;
|
|
2536
2758
|
}
|
|
2537
2759
|
return (t, s) => n.visible && n.hoveredPoint ? (g(), i("div", {
|
|
2538
2760
|
key: 0,
|
|
2539
2761
|
class: "waveform-tooltip waveform-chart__tooltip",
|
|
2540
|
-
style: p(
|
|
2541
|
-
}, [a("span",
|
|
2762
|
+
style: p(d.value)
|
|
2763
|
+
}, [a("span", yr, S(n.timeUnit) + ": " + S(w(lt)(n.hoveredPoint.x, n.timeUnit)), 1), (g(!0), i(e, null, y(n.seriesPoints, (e) => (g(), i("span", {
|
|
2542
2764
|
key: `${e.trackIndex}-${e.name}`,
|
|
2543
2765
|
class: "waveform-tooltip__series waveform-chart__tooltip-series"
|
|
2544
|
-
}, [
|
|
2545
|
-
a("i", { style: p({ backgroundColor: e.color }) }, null, 4),
|
|
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)])
|
|
2548
|
-
]))), 128))], 4)) : r("", !0);
|
|
2766
|
+
}, [a("i", { style: p({ backgroundColor: e.color }) }, null, 4), a("span", br, [e.name ? (g(), i("strong", xr, S(e.name) + ":", 1)) : r("", !0), a("span", Sr, [o(S(w(rt)(e.point.y)) + S(e.unit ? ` ${e.unit}` : "") + " ", 1), f(e.point) ? (g(), i("small", Cr, S(f(e.point)), 1)) : r("", !0)])])]))), 128))], 4)) : r("", !0);
|
|
2549
2767
|
}
|
|
2550
|
-
}), [["__scopeId", "data-v-
|
|
2768
|
+
}), [["__scopeId", "data-v-93daa641"]]), jr = /* @__PURE__ */ c({
|
|
2551
2769
|
__name: "WaveformHoverHost",
|
|
2552
2770
|
props: {
|
|
2553
2771
|
state: {},
|
|
@@ -2558,7 +2776,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2558
2776
|
},
|
|
2559
2777
|
setup(e) {
|
|
2560
2778
|
let r = e, i = t(() => r.state.points[0]?.point ?? null);
|
|
2561
|
-
return (t, r) => (g(), n(
|
|
2779
|
+
return (t, r) => (g(), n(Ar, {
|
|
2562
2780
|
visible: e.visible && i.value !== null,
|
|
2563
2781
|
position: e.state.position,
|
|
2564
2782
|
"time-unit": e.timeUnit,
|
|
@@ -2576,16 +2794,16 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2576
2794
|
"container-height"
|
|
2577
2795
|
]));
|
|
2578
2796
|
}
|
|
2579
|
-
}),
|
|
2580
|
-
circle:
|
|
2581
|
-
square:
|
|
2582
|
-
triangle:
|
|
2583
|
-
diamond:
|
|
2797
|
+
}), Mr = 13, Nr = 2, Pr = 14, Fr = 8, Ir = 24, Lr = {
|
|
2798
|
+
circle: U,
|
|
2799
|
+
square: W,
|
|
2800
|
+
triangle: te,
|
|
2801
|
+
diamond: ee
|
|
2584
2802
|
};
|
|
2585
|
-
function
|
|
2586
|
-
return e === "none" ? null : H().type(
|
|
2803
|
+
function Rr(e, t = 48) {
|
|
2804
|
+
return e === "none" ? null : H().type(Lr[e]).size(t)() ?? null;
|
|
2587
2805
|
}
|
|
2588
|
-
function
|
|
2806
|
+
function zr(e, t, n = 48) {
|
|
2589
2807
|
if (e === "none" || t.length === 0) return null;
|
|
2590
2808
|
if (e === "circle") {
|
|
2591
2809
|
let e = Math.sqrt(n / Math.PI);
|
|
@@ -2602,24 +2820,24 @@ function _r(e, t, n = 48) {
|
|
|
2602
2820
|
let r = Math.sqrt(n / (2 * Math.tan(Math.PI / 6))), i = r * Math.tan(Math.PI / 6);
|
|
2603
2821
|
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("");
|
|
2604
2822
|
}
|
|
2605
|
-
function
|
|
2823
|
+
function Br(e) {
|
|
2606
2824
|
return e === "none" ? null : "M1 8H25";
|
|
2607
2825
|
}
|
|
2608
|
-
function
|
|
2826
|
+
function Vr(e) {
|
|
2609
2827
|
if (e === "dashed") return "8 5";
|
|
2610
2828
|
if (e === "dash-dot") return "8 5 1.5 5";
|
|
2611
2829
|
}
|
|
2612
|
-
function
|
|
2613
|
-
let t = (Number.isFinite(e) && e > 0 ? Math.min(e,
|
|
2830
|
+
function Hr(e) {
|
|
2831
|
+
let t = (Number.isFinite(e) && e > 0 ? Math.min(e, Ir) : Fr) / 2, n = Mr - t, r = Mr + t;
|
|
2614
2832
|
return [
|
|
2615
|
-
`M${n} ${
|
|
2616
|
-
`M${
|
|
2617
|
-
`M${n} ${
|
|
2833
|
+
`M${n} ${Nr}H${r}`,
|
|
2834
|
+
`M${Mr} ${Nr}V${Pr}`,
|
|
2835
|
+
`M${n} ${Pr}H${r}`
|
|
2618
2836
|
].join("");
|
|
2619
2837
|
}
|
|
2620
2838
|
//#endregion
|
|
2621
2839
|
//#region src/components/rendering/WaveformSeriesLayer.vue?vue&type=script&setup=true&lang.ts
|
|
2622
|
-
var
|
|
2840
|
+
var Ur = ["clip-path"], Wr = ["data-series-id", "data-series-name"], Gr = [
|
|
2623
2841
|
"data-series-id",
|
|
2624
2842
|
"data-series-name",
|
|
2625
2843
|
"data-y-axis-index",
|
|
@@ -2628,11 +2846,11 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2628
2846
|
"d",
|
|
2629
2847
|
"stroke",
|
|
2630
2848
|
"stroke-dasharray"
|
|
2631
|
-
],
|
|
2849
|
+
], Kr = ["data-series-id"], qr = [
|
|
2632
2850
|
"d",
|
|
2633
2851
|
"stroke",
|
|
2634
2852
|
"stroke-width"
|
|
2635
|
-
],
|
|
2853
|
+
], Jr = ["data-series-id", "data-point-type"], Yr = ["d", "fill"], Xr = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
2636
2854
|
__name: "WaveformSeriesLayer",
|
|
2637
2855
|
props: {
|
|
2638
2856
|
track: {},
|
|
@@ -2640,7 +2858,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2640
2858
|
},
|
|
2641
2859
|
setup(n) {
|
|
2642
2860
|
let a = n, o = t(() => a.track.seriesPaths.map((e) => {
|
|
2643
|
-
let t =
|
|
2861
|
+
let t = zr(e.series.pointType, e.pointRenderPoints.map((t) => ({
|
|
2644
2862
|
x: a.track.xScale(t.x),
|
|
2645
2863
|
y: e.yScale(t.y)
|
|
2646
2864
|
}))), n = e.series.errorBar.capWidth / 2, r = e.errorBarRenderPoints.map((t) => {
|
|
@@ -2677,8 +2895,8 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2677
2895
|
"data-line-style": e.series.lineStyle,
|
|
2678
2896
|
d: e.path,
|
|
2679
2897
|
stroke: e.series.color,
|
|
2680
|
-
"stroke-dasharray": w(
|
|
2681
|
-
}, null, 8,
|
|
2898
|
+
"stroke-dasharray": w(Vr)(e.series.lineStyle)
|
|
2899
|
+
}, null, 8, Gr)) : r("", !0),
|
|
2682
2900
|
e.series.errorBar.visible ? (g(), i("g", {
|
|
2683
2901
|
key: 1,
|
|
2684
2902
|
class: "waveform-track__error-bars waveform-chart__error-bars",
|
|
@@ -2689,7 +2907,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2689
2907
|
d: e.errorBarPath,
|
|
2690
2908
|
stroke: e.series.errorBar.color || e.series.color,
|
|
2691
2909
|
"stroke-width": e.series.errorBar.width
|
|
2692
|
-
}, null, 8,
|
|
2910
|
+
}, null, 8, qr)) : r("", !0)], 8, Kr)) : r("", !0),
|
|
2693
2911
|
e.series.pointType === "none" ? r("", !0) : (g(), i("g", {
|
|
2694
2912
|
key: 2,
|
|
2695
2913
|
class: "waveform-track__points waveform-chart__points",
|
|
@@ -2700,20 +2918,20 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2700
2918
|
class: "waveform-track__point waveform-chart__point",
|
|
2701
2919
|
d: e.pointPath,
|
|
2702
2920
|
fill: e.series.color
|
|
2703
|
-
}, null, 8,
|
|
2704
|
-
], 8,
|
|
2921
|
+
}, null, 8, Yr)) : r("", !0)], 8, Jr))
|
|
2922
|
+
], 8, Wr))), 128))], 8, Ur)) : r("", !0);
|
|
2705
2923
|
}
|
|
2706
|
-
}), [["__scopeId", "data-v-42a3fd47"]]),
|
|
2924
|
+
}), [["__scopeId", "data-v-42a3fd47"]]), Zr = ["transform"], Qr = ["transform"], $r = {
|
|
2707
2925
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--start waveform-chart__axis-endpoint waveform-chart__axis-endpoint--start",
|
|
2708
2926
|
x: "0",
|
|
2709
2927
|
y: "7",
|
|
2710
2928
|
dy: "0.71em",
|
|
2711
2929
|
"text-anchor": "start"
|
|
2712
|
-
},
|
|
2930
|
+
}, ei = ["x"], ti = [
|
|
2713
2931
|
"data-y-axis-index",
|
|
2714
2932
|
"data-y-axis-side",
|
|
2715
2933
|
"transform"
|
|
2716
|
-
],
|
|
2934
|
+
], ni = { key: 2 }, ri = ["x", "y"], ii = ["fill", "transform"], ai = ["data-y-axis-title-index"], oi = ["x", "y"], si = ["fill", "transform"], ci = /* @__PURE__ */ c({
|
|
2717
2935
|
__name: "WaveformTrackAxes",
|
|
2718
2936
|
props: {
|
|
2719
2937
|
track: {},
|
|
@@ -2772,7 +2990,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2772
2990
|
ref: o,
|
|
2773
2991
|
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 }]),
|
|
2774
2992
|
transform: `translate(0, ${t.track.height})`
|
|
2775
|
-
}, null, 10,
|
|
2993
|
+
}, null, 10, Zr)) : r("", !0),
|
|
2776
2994
|
t.track.showXAxis ? (g(), i("g", {
|
|
2777
2995
|
key: 1,
|
|
2778
2996
|
class: "waveform-track__axis-endpoints waveform-chart__axis-endpoints",
|
|
@@ -2780,13 +2998,13 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2780
2998
|
"font-family": "sans-serif",
|
|
2781
2999
|
"font-size": "10",
|
|
2782
3000
|
"aria-hidden": "true"
|
|
2783
|
-
}, [a("text",
|
|
3001
|
+
}, [a("text", $r, S(t.track.endpointLabels.start), 1), a("text", {
|
|
2784
3002
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--end waveform-chart__axis-endpoint waveform-chart__axis-endpoint--end",
|
|
2785
3003
|
x: t.track.width ?? t.innerWidth,
|
|
2786
3004
|
y: "7",
|
|
2787
3005
|
dy: "0.71em",
|
|
2788
3006
|
"text-anchor": "end"
|
|
2789
|
-
}, S(t.track.endpointLabels.end), 9,
|
|
3007
|
+
}, S(t.track.endpointLabels.end), 9, ei)], 8, Qr)) : r("", !0),
|
|
2790
3008
|
(g(!0), i(e, null, y(t.track.isEmpty ? [] : t.track.yAxes, (e) => (g(), i("g", {
|
|
2791
3009
|
key: `y-axis-${t.track.index}-${e.index}`,
|
|
2792
3010
|
ref_for: !0,
|
|
@@ -2795,21 +3013,21 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2795
3013
|
"data-y-axis-index": e.index,
|
|
2796
3014
|
"data-y-axis-side": e.side,
|
|
2797
3015
|
transform: `translate(${e.x}, 0)`
|
|
2798
|
-
}, null, 10,
|
|
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",
|
|
3016
|
+
}, null, 10, ti))), 128)),
|
|
3017
|
+
!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", ni, [a("rect", {
|
|
2800
3018
|
class: "waveform-track__y-axis-label-bg waveform-chart__y-axis-label-bg",
|
|
2801
3019
|
x: t.track.yAxisLabelX - 12,
|
|
2802
3020
|
y: t.track.height / 2 - 40,
|
|
2803
3021
|
width: "24",
|
|
2804
3022
|
height: "80",
|
|
2805
3023
|
rx: "2"
|
|
2806
|
-
}, null, 8,
|
|
3024
|
+
}, null, 8, ri), a("text", {
|
|
2807
3025
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
2808
3026
|
fill: t.track.series.color,
|
|
2809
3027
|
transform: `translate(${t.track.yAxisLabelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
2810
3028
|
"text-anchor": "middle",
|
|
2811
3029
|
"dominant-baseline": "central"
|
|
2812
|
-
}, S(c(t.track.series)), 9,
|
|
3030
|
+
}, S(c(t.track.series)), 9, ii)])) : r("", !0),
|
|
2813
3031
|
(g(!0), i(e, null, y(!t.cleanView && t.track.yAxes.length > 1 ? t.track.yAxes.filter(l) : [], (e) => (g(), i("g", {
|
|
2814
3032
|
key: `y-axis-title-${t.track.index}-${e.index}`,
|
|
2815
3033
|
class: "waveform-track__multi-axis-title",
|
|
@@ -2821,40 +3039,40 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2821
3039
|
width: "24",
|
|
2822
3040
|
height: "80",
|
|
2823
3041
|
rx: "2"
|
|
2824
|
-
}, null, 8,
|
|
3042
|
+
}, null, 8, oi), a("text", {
|
|
2825
3043
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
2826
3044
|
fill: e.seriesList[0].color,
|
|
2827
3045
|
transform: `translate(${e.labelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
2828
3046
|
"text-anchor": "middle",
|
|
2829
3047
|
"dominant-baseline": "central"
|
|
2830
|
-
}, S(c(e.seriesList[0])), 9,
|
|
3048
|
+
}, S(c(e.seriesList[0])), 9, si)], 8, ai))), 128))
|
|
2831
3049
|
], 64));
|
|
2832
3050
|
}
|
|
2833
|
-
}),
|
|
3051
|
+
}), li = [
|
|
2834
3052
|
"width",
|
|
2835
3053
|
"height",
|
|
2836
3054
|
"fill"
|
|
2837
|
-
],
|
|
3055
|
+
], ui = ["clip-path"], di = { class: "waveform-track__grid waveform-track__grid--minor waveform-chart__grid waveform-chart__grid--minor" }, fi = [
|
|
2838
3056
|
"stroke",
|
|
2839
3057
|
"x1",
|
|
2840
3058
|
"x2",
|
|
2841
3059
|
"y2"
|
|
2842
|
-
],
|
|
3060
|
+
], pi = [
|
|
2843
3061
|
"stroke",
|
|
2844
3062
|
"x2",
|
|
2845
3063
|
"y1",
|
|
2846
3064
|
"y2"
|
|
2847
|
-
],
|
|
3065
|
+
], mi = { class: "waveform-track__grid waveform-track__grid--major waveform-chart__grid waveform-chart__grid--major" }, hi = [
|
|
2848
3066
|
"stroke",
|
|
2849
3067
|
"x1",
|
|
2850
3068
|
"x2",
|
|
2851
3069
|
"y2"
|
|
2852
|
-
],
|
|
3070
|
+
], gi = [
|
|
2853
3071
|
"stroke",
|
|
2854
3072
|
"x2",
|
|
2855
3073
|
"y1",
|
|
2856
3074
|
"y2"
|
|
2857
|
-
],
|
|
3075
|
+
], _i = ["clip-path"], vi = [
|
|
2858
3076
|
"data-y-axis-index",
|
|
2859
3077
|
"x2",
|
|
2860
3078
|
"y1",
|
|
@@ -2862,7 +3080,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2862
3080
|
"stroke",
|
|
2863
3081
|
"stroke-width",
|
|
2864
3082
|
"stroke-dasharray"
|
|
2865
|
-
],
|
|
3083
|
+
], yi = ["x", "y"], bi = /* @__PURE__ */ c({
|
|
2866
3084
|
__name: "WaveformTrackBackdrop",
|
|
2867
3085
|
props: {
|
|
2868
3086
|
track: {},
|
|
@@ -2887,12 +3105,12 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2887
3105
|
height: t.track.height,
|
|
2888
3106
|
fill: t.frameStyle.backgroundColor,
|
|
2889
3107
|
"aria-hidden": "true"
|
|
2890
|
-
}, null, 8,
|
|
3108
|
+
}, null, 8, li)) : r("", !0),
|
|
2891
3109
|
!t.track.isEmpty && t.track.hasVisibleSeries && !t.cleanView ? (g(), i("g", {
|
|
2892
3110
|
key: 1,
|
|
2893
3111
|
"clip-path": `url(#${t.clipPathId}-${t.track.index})`,
|
|
2894
3112
|
"aria-hidden": "true"
|
|
2895
|
-
}, [a("g",
|
|
3113
|
+
}, [a("g", di, [t.track.gridLines.vertical ? (g(!0), i(e, { key: 0 }, y(t.track.xMinorTicks, (e) => (g(), i("line", {
|
|
2896
3114
|
key: `x-minor-${t.track.index}-${e}`,
|
|
2897
3115
|
"data-grid-direction": "vertical",
|
|
2898
3116
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -2900,7 +3118,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2900
3118
|
x2: t.track.xScale(e),
|
|
2901
3119
|
y1: "0",
|
|
2902
3120
|
y2: t.track.height
|
|
2903
|
-
}, null, 8,
|
|
3121
|
+
}, null, 8, fi))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMinorTicks, (e) => (g(), i("line", {
|
|
2904
3122
|
key: `y-minor-${t.track.index}-${e}`,
|
|
2905
3123
|
"data-grid-direction": "horizontal",
|
|
2906
3124
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -2908,7 +3126,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2908
3126
|
x2: t.track.width ?? t.innerWidth,
|
|
2909
3127
|
y1: t.track.yScale(e),
|
|
2910
3128
|
y2: t.track.yScale(e)
|
|
2911
|
-
}, null, 8,
|
|
3129
|
+
}, null, 8, pi))), 128)) : r("", !0)]), a("g", mi, [t.track.gridLines.vertical ? (g(!0), i(e, { key: 0 }, y(t.track.xMajorTicks, (e) => (g(), i("line", {
|
|
2912
3130
|
key: `x-major-${t.track.index}-${e}`,
|
|
2913
3131
|
"data-grid-direction": "vertical",
|
|
2914
3132
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -2916,7 +3134,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2916
3134
|
x2: t.track.xScale(e),
|
|
2917
3135
|
y1: "0",
|
|
2918
3136
|
y2: t.track.height
|
|
2919
|
-
}, null, 8,
|
|
3137
|
+
}, null, 8, hi))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMajorTicks, (e) => (g(), i("line", {
|
|
2920
3138
|
key: `y-major-${t.track.index}-${e}`,
|
|
2921
3139
|
"data-grid-direction": "horizontal",
|
|
2922
3140
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -2924,7 +3142,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2924
3142
|
x2: t.track.width ?? t.innerWidth,
|
|
2925
3143
|
y1: t.track.yScale(e),
|
|
2926
3144
|
y2: t.track.yScale(e)
|
|
2927
|
-
}, null, 8,
|
|
3145
|
+
}, null, 8, gi))), 128)) : r("", !0)])], 8, ui)) : r("", !0),
|
|
2928
3146
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.zeroLine.visible && !t.cleanView ? (g(), i("g", {
|
|
2929
3147
|
key: 2,
|
|
2930
3148
|
class: "waveform-track__zero-lines waveform-chart__zero-lines",
|
|
@@ -2941,7 +3159,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2941
3159
|
stroke: t.zeroLine.color,
|
|
2942
3160
|
"stroke-width": t.zeroLine.width,
|
|
2943
3161
|
"stroke-dasharray": t.zeroLine.dash || void 0
|
|
2944
|
-
}, null, 8,
|
|
3162
|
+
}, null, 8, vi))], 64))), 128))], 8, _i)) : r("", !0),
|
|
2945
3163
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.frameNumber !== void 0 && !t.cleanView ? (g(), i("text", {
|
|
2946
3164
|
key: 3,
|
|
2947
3165
|
class: "waveform-track__watermark waveform-chart__watermark",
|
|
@@ -2951,10 +3169,10 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2951
3169
|
"text-anchor": "middle",
|
|
2952
3170
|
"dominant-baseline": "central",
|
|
2953
3171
|
"aria-hidden": "true"
|
|
2954
|
-
}, S(t.frameNumber), 13,
|
|
3172
|
+
}, S(t.frameNumber), 13, yi)) : r("", !0)
|
|
2955
3173
|
], 64));
|
|
2956
3174
|
}
|
|
2957
|
-
}),
|
|
3175
|
+
}), xi = [
|
|
2958
3176
|
"data-track-index",
|
|
2959
3177
|
"data-track-empty",
|
|
2960
3178
|
"data-track-left",
|
|
@@ -2963,19 +3181,19 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2963
3181
|
"data-track-top",
|
|
2964
3182
|
"data-track-height",
|
|
2965
3183
|
"transform"
|
|
2966
|
-
],
|
|
3184
|
+
], Si = [
|
|
2967
3185
|
"width",
|
|
2968
3186
|
"height",
|
|
2969
3187
|
"stroke",
|
|
2970
3188
|
"stroke-width",
|
|
2971
3189
|
"stroke-dasharray",
|
|
2972
3190
|
"stroke-linecap"
|
|
2973
|
-
],
|
|
3191
|
+
], Ci = [
|
|
2974
3192
|
"data-interactive",
|
|
2975
3193
|
"data-independent-overlay-index",
|
|
2976
3194
|
"width",
|
|
2977
3195
|
"height"
|
|
2978
|
-
],
|
|
3196
|
+
], wi = ["x", "y"], Ti = /* @__PURE__ */ c({
|
|
2979
3197
|
__name: "WaveformTrack",
|
|
2980
3198
|
props: {
|
|
2981
3199
|
track: {},
|
|
@@ -3034,7 +3252,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3034
3252
|
"data-track-height": e.track.height,
|
|
3035
3253
|
transform: `translate(${e.track.left ?? 0}, ${e.track.top})`
|
|
3036
3254
|
}, [
|
|
3037
|
-
s(
|
|
3255
|
+
s(bi, {
|
|
3038
3256
|
track: e.track,
|
|
3039
3257
|
"clip-path-id": e.clipPathId,
|
|
3040
3258
|
"inner-width": e.innerWidth,
|
|
@@ -3051,7 +3269,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3051
3269
|
"frame-style",
|
|
3052
3270
|
"zero-line"
|
|
3053
3271
|
]),
|
|
3054
|
-
s(
|
|
3272
|
+
s(ci, {
|
|
3055
3273
|
track: e.track,
|
|
3056
3274
|
"inner-width": e.innerWidth,
|
|
3057
3275
|
"clean-view": e.cleanView,
|
|
@@ -3077,8 +3295,8 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3077
3295
|
"stroke-dasharray": c.value.borderStyle === "dashed" ? "6 4" : c.value.borderStyle === "dotted" ? "1 3" : void 0,
|
|
3078
3296
|
"stroke-linecap": c.value.borderStyle === "dotted" ? "round" : void 0,
|
|
3079
3297
|
"aria-hidden": "true"
|
|
3080
|
-
}, null, 8,
|
|
3081
|
-
s(
|
|
3298
|
+
}, null, 8, Si)),
|
|
3299
|
+
s(Xr, {
|
|
3082
3300
|
track: e.track,
|
|
3083
3301
|
"clip-path-id": e.clipPathId
|
|
3084
3302
|
}, null, 8, ["track", "clip-path-id"]),
|
|
@@ -3100,7 +3318,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3100
3318
|
onPointerleave: n[4] ||= (e) => o("pointer-leave"),
|
|
3101
3319
|
onClick: n[5] ||= (e) => o("click", e),
|
|
3102
3320
|
onContextmenu: n[6] ||= (e) => o("contextmenu", e)
|
|
3103
|
-
}, null, 42,
|
|
3321
|
+
}, null, 42, Ci)) : r("", !0),
|
|
3104
3322
|
!e.track.isEmpty && !e.track.hasVisibleSeries && !e.cleanView ? (g(), i("text", {
|
|
3105
3323
|
key: 2,
|
|
3106
3324
|
class: "waveform-track__no-visible-series",
|
|
@@ -3108,33 +3326,33 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3108
3326
|
y: e.track.height / 2,
|
|
3109
3327
|
"text-anchor": "middle",
|
|
3110
3328
|
"dominant-baseline": "central"
|
|
3111
|
-
}, " 暂无可见曲线 ", 8,
|
|
3112
|
-
], 10,
|
|
3329
|
+
}, " 暂无可见曲线 ", 8, wi)) : r("", !0)
|
|
3330
|
+
], 10, xi));
|
|
3113
3331
|
}
|
|
3114
|
-
}),
|
|
3332
|
+
}), Ei = [
|
|
3115
3333
|
"width",
|
|
3116
3334
|
"height",
|
|
3117
3335
|
"data-position",
|
|
3118
3336
|
"data-orientation"
|
|
3119
|
-
],
|
|
3337
|
+
], Di = [
|
|
3120
3338
|
"disabled",
|
|
3121
3339
|
"aria-pressed",
|
|
3122
3340
|
"aria-label",
|
|
3123
3341
|
"onClick"
|
|
3124
|
-
],
|
|
3342
|
+
], Oi = [
|
|
3125
3343
|
"data-line-type",
|
|
3126
3344
|
"data-line-style",
|
|
3127
3345
|
"data-point-type",
|
|
3128
3346
|
"data-error-bar-visible"
|
|
3129
|
-
],
|
|
3347
|
+
], ki = [
|
|
3130
3348
|
"d",
|
|
3131
3349
|
"stroke",
|
|
3132
3350
|
"stroke-dasharray"
|
|
3133
|
-
],
|
|
3351
|
+
], Ai = [
|
|
3134
3352
|
"d",
|
|
3135
3353
|
"stroke",
|
|
3136
3354
|
"stroke-width"
|
|
3137
|
-
],
|
|
3355
|
+
], ji = ["d", "fill"], Mi = ["title"], Ni = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
3138
3356
|
__name: "WaveformLegend",
|
|
3139
3357
|
props: {
|
|
3140
3358
|
series: {},
|
|
@@ -3192,45 +3410,45 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3192
3410
|
"data-point-type": e.pointType,
|
|
3193
3411
|
"data-error-bar-visible": e.errorBar.visible || void 0
|
|
3194
3412
|
}, [
|
|
3195
|
-
w(
|
|
3413
|
+
w(Br)(e.lineType) ? (g(), i("path", {
|
|
3196
3414
|
key: 0,
|
|
3197
3415
|
class: "waveform-legend__line",
|
|
3198
|
-
d: w(
|
|
3416
|
+
d: w(Br)(e.lineType) ?? void 0,
|
|
3199
3417
|
stroke: e.color,
|
|
3200
|
-
"stroke-dasharray": w(
|
|
3418
|
+
"stroke-dasharray": w(Vr)(e.lineStyle),
|
|
3201
3419
|
"stroke-width": "1.5",
|
|
3202
3420
|
fill: "none"
|
|
3203
|
-
}, null, 8,
|
|
3421
|
+
}, null, 8, ki)) : r("", !0),
|
|
3204
3422
|
e.errorBar.visible ? (g(), i("path", {
|
|
3205
3423
|
key: 1,
|
|
3206
3424
|
class: "waveform-legend__error-bar",
|
|
3207
|
-
d: w(
|
|
3425
|
+
d: w(Hr)(e.errorBar.capWidth),
|
|
3208
3426
|
stroke: e.errorBar.color || e.color,
|
|
3209
3427
|
"stroke-width": e.errorBar.width,
|
|
3210
3428
|
"stroke-linecap": "butt",
|
|
3211
3429
|
fill: "none"
|
|
3212
|
-
}, null, 8,
|
|
3430
|
+
}, null, 8, Ai)) : r("", !0),
|
|
3213
3431
|
e.pointType === "none" ? r("", !0) : (g(), i("path", {
|
|
3214
3432
|
key: 2,
|
|
3215
3433
|
class: "waveform-legend__point",
|
|
3216
|
-
d: w(
|
|
3434
|
+
d: w(Rr)(e.pointType, 30) ?? void 0,
|
|
3217
3435
|
fill: e.color,
|
|
3218
3436
|
transform: "translate(13 8)"
|
|
3219
|
-
}, null, 8,
|
|
3220
|
-
], 8,
|
|
3437
|
+
}, null, 8, ji))
|
|
3438
|
+
], 8, Oi)), a("span", {
|
|
3221
3439
|
class: "waveform-legend__label",
|
|
3222
3440
|
title: e.name
|
|
3223
|
-
}, S(e.name), 9,
|
|
3441
|
+
}, S(e.name), 9, Mi)], 10, Di))), 128))], 6)], 2)], 8, Ei));
|
|
3224
3442
|
}
|
|
3225
|
-
}), [["__scopeId", "data-v-2ae12e71"]]),
|
|
3443
|
+
}), [["__scopeId", "data-v-2ae12e71"]]), Pi = {
|
|
3226
3444
|
class: "waveform-chart__hover-layer",
|
|
3227
3445
|
"pointer-events": "none",
|
|
3228
3446
|
"aria-hidden": "true"
|
|
3229
|
-
},
|
|
3447
|
+
}, Fi = ["clip-path", "transform"], Ii = [
|
|
3230
3448
|
"x1",
|
|
3231
3449
|
"x2",
|
|
3232
3450
|
"y2"
|
|
3233
|
-
],
|
|
3451
|
+
], Li = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
3234
3452
|
__name: "WaveformHoverLayer",
|
|
3235
3453
|
props: {
|
|
3236
3454
|
state: {},
|
|
@@ -3253,7 +3471,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3253
3471
|
}] : [];
|
|
3254
3472
|
});
|
|
3255
3473
|
});
|
|
3256
|
-
return (t, r) => (g(), i("g",
|
|
3474
|
+
return (t, r) => (g(), i("g", Pi, [(g(!0), i(e, null, y(o.value, (e) => (g(), i("g", {
|
|
3257
3475
|
key: e.track.index,
|
|
3258
3476
|
class: "waveform-track__crosshair waveform-chart__crosshair",
|
|
3259
3477
|
"clip-path": `url(#${n.clipPathId}-${e.track.index})`,
|
|
@@ -3263,53 +3481,55 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3263
3481
|
x2: e.x,
|
|
3264
3482
|
y1: "0",
|
|
3265
3483
|
y2: e.track.height
|
|
3266
|
-
}, null, 8,
|
|
3484
|
+
}, null, 8, Ii)], 8, Fi))), 128))]));
|
|
3267
3485
|
}
|
|
3268
|
-
}), [["__scopeId", "data-v-a6f82099"]]),
|
|
3486
|
+
}), [["__scopeId", "data-v-a6f82099"]]), Ri = [
|
|
3269
3487
|
"data-display-mode",
|
|
3270
3488
|
"data-interaction-mode",
|
|
3271
3489
|
"data-presentation-mode",
|
|
3272
3490
|
"data-overlay-mode",
|
|
3273
3491
|
"data-chart-left-margin",
|
|
3492
|
+
"data-plot-margin-top",
|
|
3493
|
+
"data-plot-margin-bottom",
|
|
3274
3494
|
"data-title-area-height"
|
|
3275
|
-
],
|
|
3495
|
+
], zi = [
|
|
3276
3496
|
"role",
|
|
3277
3497
|
"aria-level",
|
|
3278
3498
|
"aria-hidden"
|
|
3279
|
-
],
|
|
3499
|
+
], Bi = ["data-title-scale", "data-title-wrapped"], Vi = [
|
|
3280
3500
|
"width",
|
|
3281
3501
|
"height",
|
|
3282
3502
|
"aria-label"
|
|
3283
|
-
],
|
|
3503
|
+
], Hi = ["id"], Ui = ["width", "height"], Wi = ["transform"], Gi = {
|
|
3284
3504
|
key: 0,
|
|
3285
3505
|
class: "waveform-chart__grid-slots",
|
|
3286
3506
|
"aria-hidden": "true"
|
|
3287
|
-
},
|
|
3507
|
+
}, Ki = ["transform"], qi = ["width", "height"], Ji = ["width", "height"], Yi = [
|
|
3288
3508
|
"x",
|
|
3289
3509
|
"y",
|
|
3290
3510
|
"width",
|
|
3291
3511
|
"height"
|
|
3292
|
-
],
|
|
3512
|
+
], Xi = {
|
|
3293
3513
|
key: 4,
|
|
3294
3514
|
class: "waveform-chart__legend-layer"
|
|
3295
|
-
},
|
|
3515
|
+
}, Zi = [
|
|
3296
3516
|
"data-legend-track-index",
|
|
3297
3517
|
"data-legend-track-id",
|
|
3298
3518
|
"transform"
|
|
3299
|
-
],
|
|
3519
|
+
], Qi = ["x", "y"], $i = ["x", "y"], ea = /* @__PURE__ */ c({
|
|
3300
3520
|
__name: "WaveformChartView",
|
|
3301
3521
|
props: { controller: {} },
|
|
3302
3522
|
setup(t) {
|
|
3303
|
-
let { displayMode: o, activeInteractionMode: c, isCleanView: l, isPresentationMode: u, selection: d, containerStyle: m, overlayMode: h, resolvedChartLeftMargin: _, titleAreaHeight: v,
|
|
3523
|
+
let { displayMode: o, activeInteractionMode: c, isCleanView: l, isPresentationMode: u, selection: d, containerStyle: m, overlayMode: h, resolvedChartLeftMargin: _, titleAreaHeight: v, resolvedPlotMargin: b, pointerInsideChart: x, handleNativeContextMenu: T, titleAreaReserved: E, titleAreaStyle: D, titleVisible: O, titleMeasureStyle: k, resolvedTitleText: A, titleVisualStyle: j, titleTextStyle: M, titleLayout: N, chartWidth: P, drawingHeight: F, hasWaveformData: I, requestViewportReset: L, trackLayouts: R, clipPathId: z, chartTopMargin: B, gridCells: V, hasVisibleWaveformData: H, zoomable: U, isZoomMode: ee, innerWidth: W, innerHeight: te, handleSharedPointerMove: G, beginSharedViewportDrag: K, finishViewportDrag: ne, cancelViewportDrag: q, handlePointerLeave: ie, handleAnnotationClick: ae, handleAnnotationContextMenu: oe, resolveFrameNumber: se, frameStyle: ce, axes: le, resolvedZeroLine: ue, timeUnit: de, yLabel: J, handleIndependentPointerMove: fe, beginViewportDrag: pe, hoverState: Y, showTooltip: me, selectionBox: he, renderedAnnotations: ge, annotationsVisible: _e, handleExistingAnnotationContextMenu: ve, beginAnnotationDrag: X, handleAnnotationMove: ye, endAnnotationDrag: be, resolveLegendPosition: Z, resolveLegendOrientation: xe, legendBackgroundColor: Se, legendInteractive: Ce, resolvedHiddenSeriesIds: we, toggleSeriesVisibility: Te, resolvedXLabel: Ee, xAxisTitleY: De, hasChartArea: Oe, gridOptions: ke, pageCount: Ae, currentPage: je, getPageSize: Pe, chartTracks: Q, goToPage: Fe, annotationInteraction: Ie, editorDraft: Le, contextMenu: Re, editorSeries: ze, editorSeriesOptions: Be, confirmAnnotation: Ve, cancelAnnotation: He, changeDraftSeries: Ue, editContextAnnotation: We, deleteContextAnnotation: Ge, chartHeight: $, setContainer: Ke, setSvgElement: qe, setTitleMeasureElement: Je, setSharedOverlayElement: Ye } = C(t.controller);
|
|
3304
3524
|
return (t, C) => (g(), i("div", {
|
|
3305
|
-
ref: w(
|
|
3525
|
+
ref: w(Ke),
|
|
3306
3526
|
class: f(["waveform-chart", [
|
|
3307
3527
|
`waveform-chart--${w(o)}`,
|
|
3308
3528
|
`waveform-chart--interaction-${w(c)}`,
|
|
3309
3529
|
{
|
|
3310
3530
|
"waveform-chart--clean": w(l),
|
|
3311
3531
|
"waveform-chart--presentation": w(u),
|
|
3312
|
-
"waveform-chart--panning": w(d)?.
|
|
3532
|
+
"waveform-chart--panning": w(d)?.kind === "pan"
|
|
3313
3533
|
}
|
|
3314
3534
|
]]),
|
|
3315
3535
|
style: p(w(m)),
|
|
@@ -3318,52 +3538,54 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3318
3538
|
"data-presentation-mode": w(u),
|
|
3319
3539
|
"data-overlay-mode": w(h),
|
|
3320
3540
|
"data-chart-left-margin": w(_),
|
|
3541
|
+
"data-plot-margin-top": w(b).top,
|
|
3542
|
+
"data-plot-margin-bottom": w(b).bottom,
|
|
3321
3543
|
"data-title-area-height": w(v),
|
|
3322
|
-
onPointerenter: C[8] ||= (e) =>
|
|
3323
|
-
onPointerleave: C[9] ||= (e) =>
|
|
3324
|
-
onContextmenuCapture: C[10] ||= (...e) => w(
|
|
3544
|
+
onPointerenter: C[8] ||= (e) => x.value = !0,
|
|
3545
|
+
onPointerleave: C[9] ||= (e) => x.value = !1,
|
|
3546
|
+
onContextmenuCapture: C[10] ||= (...e) => w(T) && w(T)(...e)
|
|
3325
3547
|
}, [
|
|
3326
|
-
w(
|
|
3548
|
+
w(E) ? (g(), i("div", {
|
|
3327
3549
|
key: 0,
|
|
3328
3550
|
class: "waveform-chart__title-area",
|
|
3329
|
-
style: p(w(
|
|
3330
|
-
role: w(
|
|
3331
|
-
"aria-level": w(
|
|
3551
|
+
style: p(w(D)),
|
|
3552
|
+
role: w(O) ? "heading" : void 0,
|
|
3553
|
+
"aria-level": w(O) ? 2 : void 0,
|
|
3332
3554
|
"aria-hidden": w(l) || void 0
|
|
3333
3555
|
}, [a("span", {
|
|
3334
|
-
ref: w(
|
|
3556
|
+
ref: w(Je),
|
|
3335
3557
|
class: "waveform-chart__title-measure",
|
|
3336
|
-
style: p(w(
|
|
3558
|
+
style: p(w(k)),
|
|
3337
3559
|
"aria-hidden": "true"
|
|
3338
|
-
}, S(w(
|
|
3560
|
+
}, S(w(A)), 5), w(O) ? (g(), i("span", {
|
|
3339
3561
|
key: 0,
|
|
3340
3562
|
class: "waveform-chart__title-visual",
|
|
3341
|
-
style: p(w(
|
|
3563
|
+
style: p(w(j))
|
|
3342
3564
|
}, [a("span", {
|
|
3343
3565
|
class: "waveform-chart__title-text",
|
|
3344
|
-
style: p(w(
|
|
3345
|
-
"data-title-scale": w(
|
|
3346
|
-
"data-title-wrapped": w(
|
|
3347
|
-
}, S(w(
|
|
3566
|
+
style: p(w(M)),
|
|
3567
|
+
"data-title-scale": w(N).scale,
|
|
3568
|
+
"data-title-wrapped": w(N).wrapped || void 0
|
|
3569
|
+
}, S(w(A)), 13, Bi)], 4)) : r("", !0)], 12, zi)) : r("", !0),
|
|
3348
3570
|
(g(), i("svg", {
|
|
3349
|
-
ref: w(
|
|
3571
|
+
ref: w(qe),
|
|
3350
3572
|
class: "waveform-chart__svg",
|
|
3351
|
-
width: w(
|
|
3352
|
-
height: w(
|
|
3573
|
+
width: w(P),
|
|
3574
|
+
height: w(F),
|
|
3353
3575
|
role: "img",
|
|
3354
|
-
"aria-label": w(
|
|
3355
|
-
onDblclick: C[7] ||= (...e) => w(
|
|
3576
|
+
"aria-label": w(I) ? "波形折线图" : "暂无波形数据",
|
|
3577
|
+
onDblclick: C[7] ||= (...e) => w(L) && w(L)(...e)
|
|
3356
3578
|
}, [
|
|
3357
|
-
a("defs", null, [(g(!0), i(e, null, y(w(
|
|
3358
|
-
id: `${w(
|
|
3359
|
-
key: `${w(
|
|
3579
|
+
a("defs", null, [(g(!0), i(e, null, y(w(R), (e) => (g(), i("clipPath", {
|
|
3580
|
+
id: `${w(z)}-${e.index}`,
|
|
3581
|
+
key: `${w(z)}-${e.index}`,
|
|
3360
3582
|
clipPathUnits: "userSpaceOnUse"
|
|
3361
3583
|
}, [a("rect", {
|
|
3362
3584
|
width: e.width,
|
|
3363
3585
|
height: e.height
|
|
3364
|
-
}, null, 8,
|
|
3365
|
-
a("g", { transform: `translate(${w(_)}, ${w(
|
|
3366
|
-
w(o) !== "compact" && !w(l) ? (g(), i("g",
|
|
3586
|
+
}, null, 8, Ui)], 8, Hi))), 128))]),
|
|
3587
|
+
a("g", { transform: `translate(${w(_)}, ${w(B)})` }, [
|
|
3588
|
+
w(o) !== "compact" && !w(l) ? (g(), i("g", Gi, [(g(!0), i(e, null, y(w(V), (e) => (g(), i("g", {
|
|
3367
3589
|
key: `grid-slot-${e.slotIndex}`,
|
|
3368
3590
|
transform: `translate(${e.left}, ${e.top})`
|
|
3369
3591
|
}, [e.series ? r("", !0) : (g(), i("rect", {
|
|
@@ -3371,47 +3593,47 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3371
3593
|
class: "waveform-chart__grid-slot-placeholder",
|
|
3372
3594
|
width: e.width,
|
|
3373
3595
|
height: e.cellHeight
|
|
3374
|
-
}, null, 8,
|
|
3375
|
-
w(o) !== "independent" && w(
|
|
3596
|
+
}, null, 8, qi))], 8, Ki))), 128))])) : r("", !0),
|
|
3597
|
+
w(o) !== "independent" && w(R).length && w(H) ? (g(), i("rect", {
|
|
3376
3598
|
key: 1,
|
|
3377
|
-
ref: w(
|
|
3599
|
+
ref: w(Ye),
|
|
3378
3600
|
class: f(["waveform-chart__overlay waveform-chart__overlay--shared", {
|
|
3379
|
-
"is-zoomable": !w(u) && w(
|
|
3601
|
+
"is-zoomable": !w(u) && w(U) && w(ee),
|
|
3380
3602
|
"is-annotating": !w(u) && w(c) === "annotation"
|
|
3381
3603
|
}]),
|
|
3382
|
-
width: w(
|
|
3383
|
-
height: w(
|
|
3384
|
-
onPointermove: C[0] ||= (...e) => w(
|
|
3385
|
-
onPointerdown: C[1] ||= (...e) => w(
|
|
3386
|
-
onPointerup: C[2] ||= (...e) => w(
|
|
3387
|
-
onPointercancel: C[3] ||= (...e) => w(
|
|
3388
|
-
onPointerleave: C[4] ||= (...e) => w(
|
|
3389
|
-
onClick: C[5] ||= (...e) => w(
|
|
3390
|
-
onContextmenu: C[6] ||= (...e) => w(
|
|
3391
|
-
}, null, 42,
|
|
3392
|
-
(g(!0), i(e, null, y(w(
|
|
3604
|
+
width: w(W),
|
|
3605
|
+
height: w(te),
|
|
3606
|
+
onPointermove: C[0] ||= (...e) => w(G) && w(G)(...e),
|
|
3607
|
+
onPointerdown: C[1] ||= (...e) => w(K) && w(K)(...e),
|
|
3608
|
+
onPointerup: C[2] ||= (...e) => w(ne) && w(ne)(...e),
|
|
3609
|
+
onPointercancel: C[3] ||= (...e) => w(q) && w(q)(...e),
|
|
3610
|
+
onPointerleave: C[4] ||= (...e) => w(ie) && w(ie)(...e),
|
|
3611
|
+
onClick: C[5] ||= (...e) => w(ae) && w(ae)(...e),
|
|
3612
|
+
onContextmenu: C[6] ||= (...e) => w(oe) && w(oe)(...e)
|
|
3613
|
+
}, null, 42, Ji)) : r("", !0),
|
|
3614
|
+
(g(!0), i(e, null, y(w(R), (e) => (g(), n(w(Ti), {
|
|
3393
3615
|
key: `${e.index}-${e.series.name}`,
|
|
3394
3616
|
track: e,
|
|
3395
|
-
"clip-path-id": w(
|
|
3396
|
-
"inner-width": w(
|
|
3397
|
-
zoomable: w(
|
|
3617
|
+
"clip-path-id": w(z),
|
|
3618
|
+
"inner-width": w(W),
|
|
3619
|
+
zoomable: w(U),
|
|
3398
3620
|
interactive: !w(u),
|
|
3399
3621
|
"display-mode": w(o),
|
|
3400
3622
|
"interaction-mode": w(c),
|
|
3401
|
-
"frame-number": w(
|
|
3402
|
-
"frame-style": w(
|
|
3403
|
-
axes: w(
|
|
3623
|
+
"frame-number": w(se)(e.index),
|
|
3624
|
+
"frame-style": w(ce),
|
|
3625
|
+
axes: w(le),
|
|
3404
3626
|
"clean-view": w(l),
|
|
3405
|
-
"zero-line": w(
|
|
3406
|
-
"time-unit": w(
|
|
3407
|
-
"y-label": w(
|
|
3408
|
-
onPointerMove: (t) => w(
|
|
3409
|
-
onPointerDown: (t) => w(
|
|
3410
|
-
onPointerUp: w(
|
|
3411
|
-
onPointerCancel: w(
|
|
3412
|
-
onPointerLeave: w(
|
|
3413
|
-
onClick: (t) => w(
|
|
3414
|
-
onContextmenu: (t) => w(
|
|
3627
|
+
"zero-line": w(ue),
|
|
3628
|
+
"time-unit": w(de),
|
|
3629
|
+
"y-label": w(J),
|
|
3630
|
+
onPointerMove: (t) => w(fe)(t, e.index),
|
|
3631
|
+
onPointerDown: (t) => w(pe)(t, e.index, !0),
|
|
3632
|
+
onPointerUp: w(ne),
|
|
3633
|
+
onPointerCancel: w(q),
|
|
3634
|
+
onPointerLeave: w(ie),
|
|
3635
|
+
onClick: (t) => w(ae)(t, e.index),
|
|
3636
|
+
onContextmenu: (t) => w(oe)(t, e.index)
|
|
3415
3637
|
}, null, 8, [
|
|
3416
3638
|
"track",
|
|
3417
3639
|
"clip-path-id",
|
|
@@ -3435,35 +3657,35 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3435
3657
|
"onClick",
|
|
3436
3658
|
"onContextmenu"
|
|
3437
3659
|
]))), 128)),
|
|
3438
|
-
s(w(
|
|
3439
|
-
state: w(
|
|
3440
|
-
tracks: w(
|
|
3441
|
-
"clip-path-id": w(
|
|
3442
|
-
visible: w(
|
|
3660
|
+
s(w(Li), {
|
|
3661
|
+
state: w(Y),
|
|
3662
|
+
tracks: w(R),
|
|
3663
|
+
"clip-path-id": w(z),
|
|
3664
|
+
visible: w(me) && !w(u)
|
|
3443
3665
|
}, null, 8, [
|
|
3444
3666
|
"state",
|
|
3445
3667
|
"tracks",
|
|
3446
3668
|
"clip-path-id",
|
|
3447
3669
|
"visible"
|
|
3448
3670
|
]),
|
|
3449
|
-
w(
|
|
3671
|
+
w(he) && w(d)?.kind === "box" ? (g(), i("rect", {
|
|
3450
3672
|
key: 2,
|
|
3451
3673
|
class: "waveform-chart__zoom-selection",
|
|
3452
|
-
x: w(
|
|
3453
|
-
y: w(
|
|
3454
|
-
width: w(
|
|
3455
|
-
height: w(
|
|
3674
|
+
x: w(he).x,
|
|
3675
|
+
y: w(he).y,
|
|
3676
|
+
width: w(he).width,
|
|
3677
|
+
height: w(he).height,
|
|
3456
3678
|
"aria-hidden": "true"
|
|
3457
|
-
}, null, 8,
|
|
3458
|
-
w(l) ? r("", !0) : (g(), n(w(
|
|
3679
|
+
}, null, 8, Yi)) : r("", !0),
|
|
3680
|
+
w(l) ? r("", !0) : (g(), n(w(Me), {
|
|
3459
3681
|
key: 3,
|
|
3460
|
-
annotations: w(
|
|
3461
|
-
visible: w(
|
|
3682
|
+
annotations: w(ge),
|
|
3683
|
+
visible: w(_e),
|
|
3462
3684
|
interactive: !w(u),
|
|
3463
|
-
onContextmenu: w(
|
|
3464
|
-
onDragStart: w(
|
|
3465
|
-
onMove: w(
|
|
3466
|
-
onDragEnd: w(
|
|
3685
|
+
onContextmenu: w(ve),
|
|
3686
|
+
onDragStart: w(X),
|
|
3687
|
+
onMove: w(ye),
|
|
3688
|
+
onDragEnd: w(be)
|
|
3467
3689
|
}, null, 8, [
|
|
3468
3690
|
"annotations",
|
|
3469
3691
|
"visible",
|
|
@@ -3473,23 +3695,23 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3473
3695
|
"onMove",
|
|
3474
3696
|
"onDragEnd"
|
|
3475
3697
|
])),
|
|
3476
|
-
w(l) ? r("", !0) : (g(), i("g",
|
|
3698
|
+
w(l) ? r("", !0) : (g(), i("g", Xi, [(g(!0), i(e, null, y(w(R), (e) => (g(), i("g", {
|
|
3477
3699
|
key: `legend-${e.index}-${e.series.name}`,
|
|
3478
3700
|
class: "waveform-chart__legend-track",
|
|
3479
3701
|
"data-legend-track-index": e.index,
|
|
3480
3702
|
"data-legend-track-id": e.id,
|
|
3481
3703
|
transform: `translate(${e.left}, ${e.top})`
|
|
3482
|
-
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(
|
|
3704
|
+
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(Ni), {
|
|
3483
3705
|
key: 0,
|
|
3484
3706
|
series: e.legendSeries,
|
|
3485
|
-
position: w(
|
|
3486
|
-
orientation: w(
|
|
3487
|
-
"background-color": w(
|
|
3488
|
-
interactive: w(
|
|
3489
|
-
"hidden-series-ids": w(
|
|
3490
|
-
width: e.width ?? w(
|
|
3707
|
+
position: w(Z)(e.id),
|
|
3708
|
+
orientation: w(xe)(w(Z)(e.id)),
|
|
3709
|
+
"background-color": w(Se),
|
|
3710
|
+
interactive: w(Ce),
|
|
3711
|
+
"hidden-series-ids": w(we),
|
|
3712
|
+
width: e.width ?? w(W),
|
|
3491
3713
|
height: e.height,
|
|
3492
|
-
onToggle: w(
|
|
3714
|
+
onToggle: w(Te)
|
|
3493
3715
|
}, null, 8, [
|
|
3494
3716
|
"series",
|
|
3495
3717
|
"position",
|
|
@@ -3500,49 +3722,49 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3500
3722
|
"width",
|
|
3501
3723
|
"height",
|
|
3502
3724
|
"onToggle"
|
|
3503
|
-
])) : r("", !0)], 8,
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
class: "waveform-chart__label waveform-chart__x-label",
|
|
3507
|
-
x: w(te) / 2,
|
|
3508
|
-
y: w(Oe),
|
|
3509
|
-
"text-anchor": "middle"
|
|
3510
|
-
}, S(w(De)), 9, Ai)) : r("", !0)
|
|
3511
|
-
], 8, Si),
|
|
3512
|
-
w(ke) && !w(F) ? (g(), i("text", {
|
|
3725
|
+
])) : r("", !0)], 8, Zi))), 128))]))
|
|
3726
|
+
], 8, Wi),
|
|
3727
|
+
w(Ee) && !w(l) ? (g(), i("text", {
|
|
3513
3728
|
key: 0,
|
|
3729
|
+
class: "waveform-chart__label waveform-chart__x-label",
|
|
3730
|
+
x: w(_) + w(W) / 2,
|
|
3731
|
+
y: w(De),
|
|
3732
|
+
"text-anchor": "middle"
|
|
3733
|
+
}, S(w(Ee)), 9, Qi)) : r("", !0),
|
|
3734
|
+
w(Oe) && !w(I) ? (g(), i("text", {
|
|
3735
|
+
key: 1,
|
|
3514
3736
|
class: "waveform-chart__empty",
|
|
3515
|
-
x: w(
|
|
3516
|
-
y: w(
|
|
3737
|
+
x: w(P) / 2,
|
|
3738
|
+
y: w(F) / 2,
|
|
3517
3739
|
"text-anchor": "middle"
|
|
3518
|
-
}, " 暂无有效波形数据 ", 8,
|
|
3519
|
-
], 40,
|
|
3520
|
-
w(
|
|
3740
|
+
}, " 暂无有效波形数据 ", 8, $i)) : r("", !0)
|
|
3741
|
+
], 40, Vi)),
|
|
3742
|
+
w(ke).showPagination && w(Ae) > 1 && !w(l) ? (g(), n(w(re), {
|
|
3521
3743
|
key: 1,
|
|
3522
3744
|
class: "waveform-chart__pagination",
|
|
3523
3745
|
"aria-label": "波形分页",
|
|
3524
|
-
current: w(
|
|
3525
|
-
"page-size": w(
|
|
3526
|
-
total: w(
|
|
3746
|
+
current: w(je),
|
|
3747
|
+
"page-size": w(Pe)(w(ke)),
|
|
3748
|
+
total: w(Q).length,
|
|
3527
3749
|
"show-size-changer": !1,
|
|
3528
3750
|
"show-quick-jumper": !1,
|
|
3529
|
-
onChange: w(
|
|
3751
|
+
onChange: w(Fe)
|
|
3530
3752
|
}, null, 8, [
|
|
3531
3753
|
"current",
|
|
3532
3754
|
"page-size",
|
|
3533
3755
|
"total",
|
|
3534
3756
|
"onChange"
|
|
3535
3757
|
])) : r("", !0),
|
|
3536
|
-
w(Le) && !w(l) && !w(u) ? (g(), n(
|
|
3758
|
+
w(Le) && !w(l) && !w(u) ? (g(), n(vr, {
|
|
3537
3759
|
key: 2,
|
|
3538
3760
|
annotation: w(Le).annotation,
|
|
3539
3761
|
mode: w(Le).mode,
|
|
3540
|
-
series: w(
|
|
3541
|
-
"series-options": w(
|
|
3542
|
-
"time-unit": w(
|
|
3543
|
-
onConfirm: w(
|
|
3544
|
-
onCancel: w(
|
|
3545
|
-
onSeriesChange: w(
|
|
3762
|
+
series: w(ze),
|
|
3763
|
+
"series-options": w(Be),
|
|
3764
|
+
"time-unit": w(de),
|
|
3765
|
+
onConfirm: w(Ve),
|
|
3766
|
+
onCancel: w(He),
|
|
3767
|
+
onSeriesChange: w(Ue)
|
|
3546
3768
|
}, null, 8, [
|
|
3547
3769
|
"annotation",
|
|
3548
3770
|
"mode",
|
|
@@ -3553,14 +3775,14 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3553
3775
|
"onCancel",
|
|
3554
3776
|
"onSeriesChange"
|
|
3555
3777
|
])) : r("", !0),
|
|
3556
|
-
!w(l) && !w(u) ? (g(), n(w(
|
|
3778
|
+
!w(l) && !w(u) ? (g(), n(w(Ne), {
|
|
3557
3779
|
key: 3,
|
|
3558
|
-
visible: w(
|
|
3559
|
-
x: w(
|
|
3560
|
-
y: w(
|
|
3561
|
-
"can-edit": !!w(
|
|
3562
|
-
onEdit: w(
|
|
3563
|
-
onDelete: w(
|
|
3780
|
+
visible: w(Re) !== null,
|
|
3781
|
+
x: w(Re)?.x || 0,
|
|
3782
|
+
y: w(Re)?.y || 0,
|
|
3783
|
+
"can-edit": !!w(Re)?.annotationId,
|
|
3784
|
+
onEdit: w(We),
|
|
3785
|
+
onDelete: w(Ge),
|
|
3564
3786
|
onClose: w(Ie).closeContextMenu
|
|
3565
3787
|
}, null, 8, [
|
|
3566
3788
|
"visible",
|
|
@@ -3571,12 +3793,12 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3571
3793
|
"onDelete",
|
|
3572
3794
|
"onClose"
|
|
3573
3795
|
])) : r("", !0),
|
|
3574
|
-
s(w(
|
|
3575
|
-
state: w(
|
|
3576
|
-
visible: w(
|
|
3577
|
-
"time-unit": w(
|
|
3578
|
-
"container-width": w(
|
|
3579
|
-
"container-height": w(
|
|
3796
|
+
s(w(jr), {
|
|
3797
|
+
state: w(Y),
|
|
3798
|
+
visible: w(me) && !w(u),
|
|
3799
|
+
"time-unit": w(de),
|
|
3800
|
+
"container-width": w(P),
|
|
3801
|
+
"container-height": w($)
|
|
3580
3802
|
}, null, 8, [
|
|
3581
3803
|
"state",
|
|
3582
3804
|
"visible",
|
|
@@ -3584,9 +3806,9 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3584
3806
|
"container-width",
|
|
3585
3807
|
"container-height"
|
|
3586
3808
|
])
|
|
3587
|
-
], 46,
|
|
3809
|
+
], 46, Ri));
|
|
3588
3810
|
}
|
|
3589
|
-
}),
|
|
3811
|
+
}), ta = /* @__PURE__ */ c({
|
|
3590
3812
|
__name: "WaveformChart",
|
|
3591
3813
|
props: {
|
|
3592
3814
|
data: {},
|
|
@@ -3631,6 +3853,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3631
3853
|
showPagination: !0
|
|
3632
3854
|
}) },
|
|
3633
3855
|
rendering: { default: () => ({}) },
|
|
3856
|
+
plotMargin: { default: () => ({}) },
|
|
3634
3857
|
title: {},
|
|
3635
3858
|
legend: { default: () => ({
|
|
3636
3859
|
position: "top-right",
|
|
@@ -3662,9 +3885,9 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3662
3885
|
"page-change"
|
|
3663
3886
|
],
|
|
3664
3887
|
setup(e, { expose: t, emit: r }) {
|
|
3665
|
-
let i =
|
|
3666
|
-
return t({ resetViewport: i.resetViewport }), (e, t) => (g(), n(
|
|
3888
|
+
let i = Qn(e, r);
|
|
3889
|
+
return t({ resetViewport: i.resetViewport }), (e, t) => (g(), n(ea, { controller: w(i) }, null, 8, ["controller"]));
|
|
3667
3890
|
}
|
|
3668
3891
|
});
|
|
3669
3892
|
//#endregion
|
|
3670
|
-
export {
|
|
3893
|
+
export { Rt as DEFAULT_WAVEFORM_RENDERING_OPTIONS, ta 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, zt as resolveWaveformRenderingOptions, Gt as selectRenderablePoints, Ue as serializeWaveformAnnotations };
|