waveform-analysis 0.1.30 → 0.1.32
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 +12 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +827 -602
- package/dist/style.css +1 -1
- package/dist/types/components/WaveformChart.vue.d.ts +2 -2
- package/dist/types/components/core/useWaveformChartController.d.ts +2 -14
- 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/waveformChartTypes.d.ts +8 -5
- package/dist/types/components/data/types.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/core/rendering.d.ts +1 -4
- package/dist/types/core/renderingStrategies.d.ts +22 -0
- package/dist/types/demo/types.d.ts +0 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/chart.d.ts +5 -0
- package/dist/types/types/index.d.ts +1 -1
- package/package.json +5 -1
- package/src/App.vue +0 -4
- package/src/components/WaveformChartView.vue +2 -2
- 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/waveformChartTypes.ts +6 -4
- package/src/components/data/types.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 +101 -75
- 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/waveformChartCases/viewportConstraintsAndReset.test.ts +0 -65
- package/src/components/waveformChartCases/viewportLifecycle.test.ts +132 -0
- package/src/components/waveformChartCases/viewportReset.test.ts +114 -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 +1 -2
- package/src/demo/types.ts +0 -1
- package/src/index.ts +1 -0
- package/src/types/chart.ts +6 -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,17 +1,17 @@
|
|
|
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 U, symbolDiamond as ee, symbolSquare 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
17
|
function se(e, t, n) {
|
|
@@ -93,14 +93,14 @@ function de(e, t, n, r, i) {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function J(e, t, n) {
|
|
97
97
|
return {
|
|
98
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,
|
|
@@ -114,15 +114,15 @@ function pe(e, t, n, r, i, a, o = 0, s = 0) {
|
|
|
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 me(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 ve(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,
|
|
@@ -213,19 +213,19 @@ function ye(e) {
|
|
|
213
213
|
return Array.from(e).reduce((e, t) => e + (t.codePointAt(0) > 255 ? 12 : 6.7), 0);
|
|
214
214
|
}
|
|
215
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 =
|
|
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 Ce(e, t = 10) {
|
|
|
238
238
|
}
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/components/annotation/WaveformAnnotationLayer.vue?vue&type=script&setup=true&lang.ts
|
|
241
|
-
var
|
|
241
|
+
var 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 we = [
|
|
|
401
401
|
}, [a("path", {
|
|
402
402
|
d: "M0,0 L8,4 L0,8 Z",
|
|
403
403
|
fill: t.style.borderColor
|
|
404
|
-
}, null, 8,
|
|
404
|
+
}, null, 8, Te)], 8, we)]),
|
|
405
405
|
a("line", {
|
|
406
406
|
class: "waveform-annotation__arrow",
|
|
407
407
|
x1: b(t).lineEndX,
|
|
@@ -410,7 +410,7 @@ var we = [
|
|
|
410
410
|
y2: t.anchorY,
|
|
411
411
|
stroke: t.style.borderColor,
|
|
412
412
|
"marker-end": `url(#${M(t.annotation.id)})`
|
|
413
|
-
}, null, 8,
|
|
413
|
+
}, null, 8, Ee),
|
|
414
414
|
a("rect", {
|
|
415
415
|
class: "waveform-annotation__box",
|
|
416
416
|
x: b(t).x,
|
|
@@ -419,27 +419,27 @@ var we = [
|
|
|
419
419
|
height: b(t).height,
|
|
420
420
|
fill: t.style.backgroundColor,
|
|
421
421
|
stroke: t.style.borderColor
|
|
422
|
-
}, null, 8,
|
|
422
|
+
}, null, 8, 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
|
-
}, Me = /*#__PURE__*/
|
|
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 },
|
|
@@ -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,148 +1660,167 @@ 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 W;
|
|
1507
|
-
let a = r / i, o = B(t, [0, n]);
|
|
1508
|
-
return W.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
|
-
v.value || !n.zoomable || !_.value
|
|
1806
|
+
if (!(v.value || !n.zoomable || !_.value)) {
|
|
1807
|
+
if (n.displayMode === "independent") {
|
|
1808
|
+
let t = (e.target instanceof Element ? e.target : null)?.closest("[data-independent-overlay-index]"), n = Number(t?.getAttribute("data-independent-overlay-index")), i = o.value.find((e) => e.index === n);
|
|
1809
|
+
if (!i) return;
|
|
1810
|
+
e.preventDefault(), H(n), r("zoom-reset", {
|
|
1811
|
+
trackIndex: n,
|
|
1812
|
+
seriesIds: i.legendSeries.map((e) => e.id)
|
|
1813
|
+
});
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
e.preventDefault(), H(), r("zoom-reset", {});
|
|
1817
|
+
}
|
|
1640
1818
|
}
|
|
1641
1819
|
};
|
|
1642
1820
|
}
|
|
1643
1821
|
//#endregion
|
|
1644
1822
|
//#region src/components/utils/useAnimationFrameThrottle.ts
|
|
1645
|
-
function
|
|
1823
|
+
function zn() {
|
|
1646
1824
|
let e = null, t = null;
|
|
1647
1825
|
function n(n) {
|
|
1648
1826
|
t = n, e === null && (e = requestAnimationFrame(() => {
|
|
@@ -1671,8 +1849,8 @@ function xn() {
|
|
|
1671
1849
|
}
|
|
1672
1850
|
//#endregion
|
|
1673
1851
|
//#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 =
|
|
1852
|
+
function Bn(e) {
|
|
1853
|
+
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
1854
|
y || m.value || (g(), b = e.transform, x = "wheel", O(), P());
|
|
1677
1855
|
}, A = (e, t) => {
|
|
1678
1856
|
y || m.value || (g(), C.set(t, e.transform), w.set(t, "wheel"), O(), P());
|
|
@@ -1757,34 +1935,40 @@ function Sn(e) {
|
|
|
1757
1935
|
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
1936
|
}, I = () => {
|
|
1759
1937
|
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;
|
|
1938
|
+
}, L = (e, n) => {
|
|
1763
1939
|
let r = Math.abs(e[1] - e[0]);
|
|
1764
|
-
|
|
1765
|
-
|
|
1940
|
+
if (!Number.isFinite(r) || r <= 0) return mt.MIN_SCALE;
|
|
1941
|
+
let i = Pn(e, n, t);
|
|
1942
|
+
return Math.max(mt.MIN_SCALE, i > 0 ? r / i : mt.DEFAULT_MAX_SCALE);
|
|
1943
|
+
}, R = (e, n, r, i) => Ln(In(e.rescaleX(B(n, [0, r])).domain(), n, i, t), n, r), z = (e) => {
|
|
1944
|
+
let n = Number(t.minVisiblePoints);
|
|
1945
|
+
return Ut(e.seriesList, e.xScale.domain(), Number.isFinite(n) && n > 0 ? Math.ceil(n) + 1 : n);
|
|
1946
|
+
}, H = () => {
|
|
1766
1947
|
let e = s.value.filter((e) => e.hasVisibleSeries);
|
|
1767
|
-
return e.length > 0 && e.every(
|
|
1768
|
-
},
|
|
1948
|
+
return e.length > 0 && e.every(z);
|
|
1949
|
+
}, U = (e, t) => {
|
|
1769
1950
|
if (e.type !== "wheel") return !1;
|
|
1770
1951
|
let n = e.deltaY;
|
|
1771
|
-
return n < 0 ? t : n > 0 &&
|
|
1952
|
+
return n < 0 ? t : n > 0 && ne(e.currentTarget).k > mt.MIN_SCALE;
|
|
1772
1953
|
};
|
|
1773
1954
|
return {
|
|
1774
1955
|
cancelPendingZoom: F,
|
|
1775
1956
|
clearZoomBindings: I,
|
|
1776
|
-
canZoomTrack:
|
|
1777
|
-
canZoomSharedTracks:
|
|
1957
|
+
canZoomTrack: z,
|
|
1958
|
+
canZoomSharedTracks: H,
|
|
1778
1959
|
configureZoom: () => {
|
|
1779
1960
|
if (I(), m.value || !t.zoomable || !p.value || !f.value || !s.value.length) return;
|
|
1780
1961
|
if (t.displayMode === "independent") {
|
|
1781
1962
|
s.value.forEach((e) => {
|
|
1782
1963
|
let t = r.value?.querySelector(`[data-independent-overlay-index="${e.index}"]`);
|
|
1783
1964
|
if (!t) return;
|
|
1784
|
-
let n = h(e), i =
|
|
1785
|
-
|
|
1965
|
+
let n = h(e), i = [e.seriesList], a = G().filter((t) => {
|
|
1966
|
+
let n = s.value.find((t) => t.index === e.index) ?? e;
|
|
1967
|
+
return U(t, z(n));
|
|
1968
|
+
}).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);
|
|
1969
|
+
_.set(e.index, a), y = !0;
|
|
1786
1970
|
try {
|
|
1787
|
-
V(t).call(
|
|
1971
|
+
V(t).call(a).on("dblclick.zoom", null).call(a.transform, o.value[e.index] ?? K);
|
|
1788
1972
|
} finally {
|
|
1789
1973
|
y = !1;
|
|
1790
1974
|
}
|
|
@@ -1793,10 +1977,10 @@ function Sn(e) {
|
|
|
1793
1977
|
}
|
|
1794
1978
|
let e = i.value;
|
|
1795
1979
|
if (!e) return;
|
|
1796
|
-
let n =
|
|
1797
|
-
_.set("shared",
|
|
1980
|
+
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);
|
|
1981
|
+
_.set("shared", l), y = !0;
|
|
1798
1982
|
try {
|
|
1799
|
-
V(e).call(
|
|
1983
|
+
V(e).call(l).on("dblclick.zoom", null).call(l.transform, a.value);
|
|
1800
1984
|
} finally {
|
|
1801
1985
|
y = !1;
|
|
1802
1986
|
}
|
|
@@ -1805,34 +1989,54 @@ function Sn(e) {
|
|
|
1805
1989
|
}
|
|
1806
1990
|
//#endregion
|
|
1807
1991
|
//#region src/components/core/useWaveformChartLifecycle.ts
|
|
1808
|
-
function
|
|
1992
|
+
function Vn(e) {
|
|
1809
1993
|
return e instanceof Element && !!e.closest("button, input, select, textarea, [contenteditable]:not([contenteditable=\"false\"])");
|
|
1810
1994
|
}
|
|
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
|
|
1814
|
-
|
|
1995
|
+
function Hn(e) {
|
|
1996
|
+
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;
|
|
1997
|
+
function ee(e) {
|
|
1998
|
+
I.value || e.code !== "Space" || !t.pannable || !_.value || Vn(e.target) || (g.value = !0, e.preventDefault());
|
|
1815
1999
|
}
|
|
1816
|
-
function
|
|
2000
|
+
function W(e) {
|
|
1817
2001
|
e.code === "Space" && (g.value = !1);
|
|
1818
2002
|
}
|
|
1819
|
-
function
|
|
2003
|
+
function te(e) {
|
|
1820
2004
|
let r = Math.min(y.value, Math.max(1, Math.floor(e)));
|
|
1821
|
-
r !== v.value && (v.value = r,
|
|
2005
|
+
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
2006
|
}
|
|
1823
|
-
|
|
2007
|
+
let G;
|
|
2008
|
+
function ne() {
|
|
2009
|
+
t.displayMode === "independent" && (G = w.value.map((e) => {
|
|
2010
|
+
let n = t.initialXDomains?.[e.series.trackId ?? e.series.id] ?? t.initialXDomains?.[e.series.id] ?? t.initialXDomain;
|
|
2011
|
+
if (!(!n || !Number.isFinite(n[0]) || !Number.isFinite(n[1]) || n[0] === n[1])) return e.xScale.domain();
|
|
2012
|
+
}));
|
|
2013
|
+
}
|
|
2014
|
+
function re() {
|
|
1824
2015
|
if (t.displayMode === "independent") {
|
|
1825
|
-
let e =
|
|
1826
|
-
|
|
2016
|
+
let e = j.value;
|
|
2017
|
+
j.value = C.value.map((t, n) => e[n] ?? K);
|
|
1827
2018
|
}
|
|
1828
|
-
|
|
2019
|
+
L(), F.value = [], d(() => {
|
|
2020
|
+
if (t.displayMode === "independent" && G) {
|
|
2021
|
+
let e = C.value.map(() => K);
|
|
2022
|
+
w.value.forEach((n) => {
|
|
2023
|
+
let r = G?.[n.index];
|
|
2024
|
+
if (!r) return;
|
|
2025
|
+
let i = N(n), a = In(r, i, [n.seriesList], t);
|
|
2026
|
+
e[n.index] = Ln(a, i, n.width);
|
|
2027
|
+
}), j.value = e, G = void 0, d(z);
|
|
2028
|
+
return;
|
|
2029
|
+
}
|
|
2030
|
+
G = void 0, z();
|
|
2031
|
+
});
|
|
1829
2032
|
}
|
|
1830
2033
|
E([
|
|
1831
|
-
w,
|
|
1832
2034
|
T,
|
|
2035
|
+
D,
|
|
1833
2036
|
() => t.zoomable,
|
|
1834
|
-
|
|
2037
|
+
I,
|
|
1835
2038
|
() => t.minZoomSpan,
|
|
2039
|
+
() => t.minVisiblePoints,
|
|
1836
2040
|
() => t.initialXDomain,
|
|
1837
2041
|
() => t.initialXDomains,
|
|
1838
2042
|
() => t.displayMode,
|
|
@@ -1840,42 +2044,42 @@ function wn(e) {
|
|
|
1840
2044
|
v,
|
|
1841
2045
|
() => x.value.rowCount,
|
|
1842
2046
|
() => x.value.columnCount,
|
|
1843
|
-
|
|
2047
|
+
O
|
|
1844
2048
|
], async () => {
|
|
1845
|
-
await d(),
|
|
2049
|
+
await d(), z();
|
|
1846
2050
|
}, { immediate: !0 }), E(() => t.displayMode, () => {
|
|
1847
2051
|
let e = v.value;
|
|
1848
|
-
v.value = 1,
|
|
2052
|
+
v.value = 1, B(), e !== 1 && n("page-change", 1, y.value);
|
|
1849
2053
|
}), E([
|
|
1850
2054
|
y,
|
|
1851
2055
|
() => t.grid?.rowCount,
|
|
1852
2056
|
() => t.grid?.columnCount
|
|
1853
2057
|
], () => {
|
|
1854
2058
|
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 && (
|
|
2059
|
+
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);
|
|
2060
|
+
}), E(O, () => {
|
|
2061
|
+
F.value = [];
|
|
2062
|
+
}), E(I, (e) => {
|
|
2063
|
+
g.value = !1, e && (V(), U(), L(), P.closeContextMenu(), R());
|
|
1860
2064
|
}), E(() => S.value.map((e) => e.id).join("\0"), () => {
|
|
1861
2065
|
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 !==
|
|
2066
|
+
let e = new Set(S.value.map((e) => e.id)), n = new Set(Array.from(A.value).filter((t) => e.has(t)));
|
|
2067
|
+
(n.size !== A.value.size || Array.from(A.value).some((e) => !n.has(e))) && (A.value = n);
|
|
1864
2068
|
}, { 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 &&
|
|
2069
|
+
L(), F.value = [];
|
|
2070
|
+
let e = P.editorDraft.value?.annotation.seriesId;
|
|
2071
|
+
e && (!S.value.some((t) => t.id === e) || k.value.has(e)) && P.closeEditor();
|
|
2072
|
+
let n = P.contextMenu.value?.annotationId, r = t.annotations.find((e) => e.id === n);
|
|
2073
|
+
r && k.value.has(r.seriesId) && P.closeContextMenu(), d(z);
|
|
1870
2074
|
}), E(() => t.annotationsVisible, (e) => {
|
|
1871
|
-
e || (
|
|
2075
|
+
e || (P.closeContextMenu(), R());
|
|
1872
2076
|
}), 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) &&
|
|
2077
|
+
let t = P.contextMenu.value?.annotationId;
|
|
2078
|
+
t && !e.some((e) => e.id === t) && P.closeContextMenu();
|
|
2079
|
+
let n = P.editorDraft.value;
|
|
2080
|
+
n?.mode === "edit" && !e.some((e) => e.id === n.annotation.id) && P.closeEditor();
|
|
1877
2081
|
}, { deep: !0 });
|
|
1878
|
-
function
|
|
2082
|
+
function q() {
|
|
1879
2083
|
if (!f.value || !i.value) {
|
|
1880
2084
|
c.value = 0, l.value = 0;
|
|
1881
2085
|
return;
|
|
@@ -1888,21 +2092,22 @@ function wn(e) {
|
|
|
1888
2092
|
f,
|
|
1889
2093
|
p
|
|
1890
2094
|
], async () => {
|
|
1891
|
-
c.value = 0, l.value = 0, await d(),
|
|
2095
|
+
c.value = 0, l.value = 0, await d(), q();
|
|
1892
2096
|
}, { 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(
|
|
2097
|
+
window.addEventListener("keydown", ee), window.addEventListener("keyup", W), r.value && (a.value = new ResizeObserver(([e]) => {
|
|
2098
|
+
o.value = Math.max(0, e?.contentRect.width ?? 0), s.value = Math.max(0, e?.contentRect.height ?? 0), d(q);
|
|
1895
2099
|
}), a.value.observe(r.value));
|
|
1896
2100
|
}), m(() => {
|
|
1897
|
-
window.removeEventListener("keydown",
|
|
2101
|
+
window.removeEventListener("keydown", ee), window.removeEventListener("keyup", W), H(), a.value?.disconnect(), U(), F.value = [];
|
|
1898
2102
|
}), {
|
|
1899
|
-
goToPage:
|
|
1900
|
-
|
|
2103
|
+
goToPage: te,
|
|
2104
|
+
handleBeforeDataReferenceChange: ne,
|
|
2105
|
+
handleDataReferenceChange: re
|
|
1901
2106
|
};
|
|
1902
2107
|
}
|
|
1903
2108
|
//#endregion
|
|
1904
2109
|
//#region src/components/core/useWaveformData.ts
|
|
1905
|
-
function
|
|
2110
|
+
function Un(e, t = !1) {
|
|
1906
2111
|
let n = Infinity, r = -Infinity, i = Infinity, a = -Infinity, o = !1;
|
|
1907
2112
|
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
2113
|
let e = At(s);
|
|
@@ -1914,24 +2119,24 @@ function Tn(e, t = !1) {
|
|
|
1914
2119
|
hasErrorPoints: o
|
|
1915
2120
|
};
|
|
1916
2121
|
}
|
|
1917
|
-
function
|
|
2122
|
+
function Wn(e) {
|
|
1918
2123
|
return Mt(e).map((e) => {
|
|
1919
|
-
let t =
|
|
2124
|
+
let t = Un(e.points, e.errorBar.visible);
|
|
1920
2125
|
return {
|
|
1921
2126
|
...e,
|
|
1922
2127
|
...t
|
|
1923
2128
|
};
|
|
1924
2129
|
});
|
|
1925
2130
|
}
|
|
1926
|
-
function
|
|
1927
|
-
let
|
|
2131
|
+
function Gn(e, t, n) {
|
|
2132
|
+
let r = x(Wn(e()));
|
|
1928
2133
|
return E(e, (e) => {
|
|
1929
|
-
|
|
1930
|
-
}),
|
|
2134
|
+
t(), r.value = Wn(e), n();
|
|
2135
|
+
}), r;
|
|
1931
2136
|
}
|
|
1932
2137
|
//#endregion
|
|
1933
2138
|
//#region src/components/core/useWaveformLayout.ts
|
|
1934
|
-
function
|
|
2139
|
+
function Kn(e) {
|
|
1935
2140
|
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
2141
|
...e,
|
|
1937
2142
|
color: e.color ?? (t === 0 ? n.lineColor : _t[t % _t.length])
|
|
@@ -1952,15 +2157,15 @@ function On(e) {
|
|
|
1952
2157
|
yDomain: $(i)
|
|
1953
2158
|
};
|
|
1954
2159
|
});
|
|
1955
|
-
}), g = t(() =>
|
|
1956
|
-
let e = h.value.filter((e) => e.visibleSeries.length > 0).flatMap((e) =>
|
|
2160
|
+
}), 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(() => {
|
|
2161
|
+
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
2162
|
return {
|
|
1958
2163
|
tickClearance: r,
|
|
1959
2164
|
fullClearance: t + 7 + 6 + 24 + 4,
|
|
1960
2165
|
labelCenterX: i
|
|
1961
2166
|
};
|
|
1962
2167
|
}), 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 =
|
|
2168
|
+
let r = _n(t, n.overlayMode, n.yDomain, n.yDomains);
|
|
1964
2169
|
return {
|
|
1965
2170
|
left: Math.max(e.left, r.left),
|
|
1966
2171
|
right: Math.max(e.right, r.right)
|
|
@@ -1969,7 +2174,7 @@ function On(e) {
|
|
|
1969
2174
|
left: 0,
|
|
1970
2175
|
right: 0
|
|
1971
2176
|
})), 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 =
|
|
2177
|
+
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
2178
|
return {
|
|
1974
2179
|
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
2180
|
hideSecondaryLabels: n.overlayMode !== "multi-axis" && r && x.value && !o
|
|
@@ -1985,10 +2190,10 @@ function On(e) {
|
|
|
1985
2190
|
}), I = (e) => {
|
|
1986
2191
|
let t = n.initialXDomains?.[e.series.trackId ?? e.series.id] ?? n.initialXDomains?.[e.series.id] ?? n.initialXDomain;
|
|
1987
2192
|
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(() =>
|
|
2193
|
+
}, 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
2194
|
...e,
|
|
1990
2195
|
series: y.value[t]
|
|
1991
|
-
}))), z = t(() =>
|
|
2196
|
+
}))), z = t(() => rn({
|
|
1992
2197
|
cells: R.value,
|
|
1993
2198
|
grid: g.value,
|
|
1994
2199
|
displayMode: n.displayMode,
|
|
@@ -2036,7 +2241,7 @@ function On(e) {
|
|
|
2036
2241
|
annotationLayoutsForTrack: V,
|
|
2037
2242
|
resolveSeriesYScale: H,
|
|
2038
2243
|
annotationTrackLayouts: U,
|
|
2039
|
-
renderedAnnotations: t(() => n.annotationsVisible ?
|
|
2244
|
+
renderedAnnotations: t(() => n.annotationsVisible ? pe(n.annotations, U.value, D.value, s.value) : []),
|
|
2040
2245
|
editorSeries: t(() => {
|
|
2041
2246
|
let e = p.editorDraft.value?.annotation.seriesId, t = m.value.find((t) => t.id === e);
|
|
2042
2247
|
return t ? {
|
|
@@ -2051,13 +2256,13 @@ function On(e) {
|
|
|
2051
2256
|
}
|
|
2052
2257
|
};
|
|
2053
2258
|
}
|
|
2054
|
-
var
|
|
2055
|
-
function
|
|
2259
|
+
var qn = 1e-6;
|
|
2260
|
+
function Jn(e) {
|
|
2056
2261
|
return Number.isFinite(e) ? Math.max(1, e) : 1;
|
|
2057
2262
|
}
|
|
2058
|
-
function
|
|
2059
|
-
let i =
|
|
2060
|
-
if (!(d >
|
|
2263
|
+
function Yn({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r }) {
|
|
2264
|
+
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;
|
|
2265
|
+
if (!(d > qn && Math.abs(d - 360) > qn)) {
|
|
2061
2266
|
let e = Math.max(1, Math.ceil(i / o)), t = o, n = a * e;
|
|
2062
2267
|
return {
|
|
2063
2268
|
textWidth: t,
|
|
@@ -2082,7 +2287,7 @@ function jn({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r
|
|
|
2082
2287
|
}
|
|
2083
2288
|
//#endregion
|
|
2084
2289
|
//#region src/components/core/useWaveformPresentation.ts
|
|
2085
|
-
function
|
|
2290
|
+
function Xn(e) {
|
|
2086
2291
|
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(() => ({
|
|
2087
2292
|
width: l.value === void 0 ? "100%" : `${l.value}px`,
|
|
2088
2293
|
height: u.value === void 0 ? "100%" : `${u.value}px`
|
|
@@ -2127,7 +2332,7 @@ function Mn(e) {
|
|
|
2127
2332
|
maxWidth: O.value ? "none" : `${j.value}px`,
|
|
2128
2333
|
whiteSpace: O.value ? "nowrap" : "normal",
|
|
2129
2334
|
overflowWrap: O.value ? "normal" : "anywhere"
|
|
2130
|
-
})), N = t(() =>
|
|
2335
|
+
})), N = t(() => Yn({
|
|
2131
2336
|
naturalWidth: a.value || A.value,
|
|
2132
2337
|
naturalHeight: o.value || E.value * 1.2,
|
|
2133
2338
|
availableWidth: j.value,
|
|
@@ -2183,22 +2388,22 @@ function Mn(e) {
|
|
|
2183
2388
|
}
|
|
2184
2389
|
//#endregion
|
|
2185
2390
|
//#region src/components/core/useWaveformChartController.ts
|
|
2186
|
-
function
|
|
2391
|
+
function Zn(e, t) {
|
|
2187
2392
|
e.value = t instanceof Element ? t : void 0;
|
|
2188
2393
|
}
|
|
2189
|
-
function
|
|
2190
|
-
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(
|
|
2394
|
+
function Qn(e, t) {
|
|
2395
|
+
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({
|
|
2191
2396
|
points: [],
|
|
2192
2397
|
trackIndex: null,
|
|
2193
2398
|
position: {
|
|
2194
2399
|
x: 0,
|
|
2195
2400
|
y: 0
|
|
2196
2401
|
}
|
|
2197
|
-
}), y = v(!1), S = v(1), w = x(), T =
|
|
2402
|
+
}), y = v(!1), S = v(1), w = x(), T = ae("waveform-clip"), O = v(new Set(e.defaultHiddenSeriesIds)), k = Ge(), A = v([]), j = zn();
|
|
2198
2403
|
E([() => e.yDomain, () => e.yDomains], () => {
|
|
2199
2404
|
m.value = {}, h.value = {};
|
|
2200
2405
|
}, { deep: !0 });
|
|
2201
|
-
let M =
|
|
2406
|
+
let M = x(null), N = v(!1), P = v(!1), F = () => void 0, I = () => void 0, L = Gn(() => e.data, () => F(), () => I()), R = Xn({
|
|
2202
2407
|
props: e,
|
|
2203
2408
|
observedWidth: o,
|
|
2204
2409
|
observedHeight: s,
|
|
@@ -2206,101 +2411,101 @@ function Pn(e, t) {
|
|
|
2206
2411
|
measuredTitleHeight: l,
|
|
2207
2412
|
internalHiddenSeriesIds: O,
|
|
2208
2413
|
paginationBandHeight: d
|
|
2209
|
-
}), { chartWidth:
|
|
2414
|
+
}), { 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({
|
|
2210
2415
|
props: e,
|
|
2211
|
-
preparedSeries:
|
|
2416
|
+
preparedSeries: L,
|
|
2212
2417
|
currentPage: S,
|
|
2213
|
-
hiddenSeriesIdSet:
|
|
2214
|
-
chartWidth:
|
|
2215
|
-
innerHeight:
|
|
2216
|
-
isCleanView:
|
|
2418
|
+
hiddenSeriesIdSet: U,
|
|
2419
|
+
chartWidth: z,
|
|
2420
|
+
innerHeight: re,
|
|
2421
|
+
isCleanView: V,
|
|
2217
2422
|
sharedTransform: f,
|
|
2218
2423
|
independentTransforms: p,
|
|
2219
2424
|
sharedYDomains: m,
|
|
2220
2425
|
independentYDomains: h,
|
|
2221
2426
|
annotationInteraction: u(k)
|
|
2222
|
-
}), { chartSeries:
|
|
2427
|
+
}), { 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;
|
|
2223
2428
|
D(() => {
|
|
2224
|
-
d.value =
|
|
2429
|
+
d.value = ce.value.showPagination && le.value > 1 && z.value <= 520 ? 40 : 0;
|
|
2225
2430
|
});
|
|
2226
|
-
let
|
|
2431
|
+
let X = Bn({
|
|
2227
2432
|
props: e,
|
|
2228
2433
|
emit: t,
|
|
2229
2434
|
svgElement: r,
|
|
2230
2435
|
sharedOverlayElement: a,
|
|
2231
2436
|
sharedTransform: f,
|
|
2232
2437
|
independentTransforms: p,
|
|
2233
|
-
trackLayouts:
|
|
2438
|
+
trackLayouts: se,
|
|
2234
2439
|
initialXDomain: me,
|
|
2235
2440
|
sharedZoomDomain: he,
|
|
2236
|
-
innerWidth:
|
|
2237
|
-
innerHeight:
|
|
2238
|
-
hasChartArea:
|
|
2239
|
-
isZoomMode:
|
|
2240
|
-
isPresentationMode:
|
|
2441
|
+
innerWidth: J,
|
|
2442
|
+
innerHeight: re,
|
|
2443
|
+
hasChartArea: fe,
|
|
2444
|
+
isZoomMode: Y,
|
|
2445
|
+
isPresentationMode: H,
|
|
2241
2446
|
resolveInitialTrackDomain: ge,
|
|
2242
|
-
cancelPendingHover: () =>
|
|
2243
|
-
}),
|
|
2447
|
+
cancelPendingHover: () => Z.cancelPendingHover()
|
|
2448
|
+
}), ye = xn({
|
|
2244
2449
|
props: e,
|
|
2245
2450
|
emit: t,
|
|
2246
2451
|
container: n,
|
|
2247
|
-
chartSeries:
|
|
2248
|
-
hiddenSeriesIdSet:
|
|
2452
|
+
chartSeries: ie,
|
|
2453
|
+
hiddenSeriesIdSet: U,
|
|
2249
2454
|
internalHiddenSeriesIds: O,
|
|
2250
2455
|
annotationInteraction: k,
|
|
2251
2456
|
editorSeriesOptions: A,
|
|
2252
|
-
trackLayouts:
|
|
2457
|
+
trackLayouts: se,
|
|
2253
2458
|
annotationLayoutsForTrack: _e,
|
|
2254
2459
|
resolveSeriesYScale: ve,
|
|
2255
|
-
chartWidth:
|
|
2256
|
-
chartHeight:
|
|
2257
|
-
innerWidth:
|
|
2258
|
-
resolvedChartLeftMargin:
|
|
2259
|
-
titleAreaHeight:
|
|
2260
|
-
chartTopMargin:
|
|
2261
|
-
activeInteractionMode:
|
|
2262
|
-
isPresentationMode:
|
|
2263
|
-
}),
|
|
2460
|
+
chartWidth: z,
|
|
2461
|
+
chartHeight: B,
|
|
2462
|
+
innerWidth: J,
|
|
2463
|
+
resolvedChartLeftMargin: de,
|
|
2464
|
+
titleAreaHeight: G,
|
|
2465
|
+
chartTopMargin: ne,
|
|
2466
|
+
activeInteractionMode: pe,
|
|
2467
|
+
isPresentationMode: H
|
|
2468
|
+
}), be = Rn({
|
|
2264
2469
|
props: e,
|
|
2265
2470
|
emit: t,
|
|
2266
2471
|
selection: M,
|
|
2267
2472
|
spacePressed: N,
|
|
2268
|
-
trackLayouts:
|
|
2269
|
-
chartTracks:
|
|
2473
|
+
trackLayouts: se,
|
|
2474
|
+
chartTracks: oe,
|
|
2270
2475
|
initialXDomain: me,
|
|
2271
|
-
innerWidth:
|
|
2272
|
-
innerHeight:
|
|
2476
|
+
innerWidth: J,
|
|
2477
|
+
innerHeight: re,
|
|
2273
2478
|
sharedOverlayElement: a,
|
|
2274
2479
|
sharedTransform: f,
|
|
2275
2480
|
independentTransforms: p,
|
|
2276
2481
|
sharedYDomains: m,
|
|
2277
2482
|
independentYDomains: h,
|
|
2278
|
-
isZoomMode:
|
|
2279
|
-
isPresentationMode:
|
|
2483
|
+
isZoomMode: Y,
|
|
2484
|
+
isPresentationMode: H,
|
|
2280
2485
|
editorSeriesOptions: A,
|
|
2281
2486
|
resolveInitialTrackDomain: ge,
|
|
2282
|
-
canZoomTrack:
|
|
2283
|
-
canZoomSharedTracks:
|
|
2284
|
-
configureZoom:
|
|
2285
|
-
cancelPendingZoom:
|
|
2286
|
-
clearHover: () =>
|
|
2287
|
-
resolveTrackAtPointer:
|
|
2288
|
-
}),
|
|
2487
|
+
canZoomTrack: X.canZoomTrack,
|
|
2488
|
+
canZoomSharedTracks: X.canZoomSharedTracks,
|
|
2489
|
+
configureZoom: X.configureZoom,
|
|
2490
|
+
cancelPendingZoom: X.cancelPendingZoom,
|
|
2491
|
+
clearHover: () => Z.clearHover(),
|
|
2492
|
+
resolveTrackAtPointer: ye.resolveTrackAtPointer
|
|
2493
|
+
}), Z = Cn({
|
|
2289
2494
|
emit: t,
|
|
2290
2495
|
hoverState: g,
|
|
2291
2496
|
suppressHoverUntilMove: y,
|
|
2292
2497
|
hoverThrottle: j,
|
|
2293
2498
|
selection: M,
|
|
2294
|
-
trackLayouts:
|
|
2295
|
-
innerWidth:
|
|
2296
|
-
resolvedChartLeftMargin:
|
|
2297
|
-
titleAreaHeight:
|
|
2298
|
-
chartTopMargin:
|
|
2499
|
+
trackLayouts: se,
|
|
2500
|
+
innerWidth: J,
|
|
2501
|
+
resolvedChartLeftMargin: de,
|
|
2502
|
+
titleAreaHeight: G,
|
|
2503
|
+
chartTopMargin: ne,
|
|
2299
2504
|
sharedOverlayElement: a,
|
|
2300
|
-
isPresentationMode:
|
|
2301
|
-
updateViewportDrag:
|
|
2302
|
-
resolveTrackAtPointer:
|
|
2303
|
-
}), xe =
|
|
2505
|
+
isPresentationMode: H,
|
|
2506
|
+
updateViewportDrag: be.updateViewportDrag,
|
|
2507
|
+
resolveTrackAtPointer: ye.resolveTrackAtPointer
|
|
2508
|
+
}), xe = Hn({
|
|
2304
2509
|
props: e,
|
|
2305
2510
|
emit: t,
|
|
2306
2511
|
container: n,
|
|
@@ -2310,44 +2515,46 @@ function Pn(e, t) {
|
|
|
2310
2515
|
observedHeight: s,
|
|
2311
2516
|
measuredTitleWidth: c,
|
|
2312
2517
|
measuredTitleHeight: l,
|
|
2313
|
-
resolvedTitleText:
|
|
2314
|
-
titleAreaReserved:
|
|
2518
|
+
resolvedTitleText: ee,
|
|
2519
|
+
titleAreaReserved: W,
|
|
2315
2520
|
titleMeasureStyle: te,
|
|
2316
2521
|
spacePressed: N,
|
|
2317
2522
|
pointerInsideChart: P,
|
|
2318
2523
|
currentPage: S,
|
|
2319
|
-
pageCount:
|
|
2320
|
-
pagedTracks:
|
|
2321
|
-
gridOptions:
|
|
2322
|
-
chartSeries:
|
|
2323
|
-
chartTracks:
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2524
|
+
pageCount: le,
|
|
2525
|
+
pagedTracks: ue,
|
|
2526
|
+
gridOptions: ce,
|
|
2527
|
+
chartSeries: ie,
|
|
2528
|
+
chartTracks: oe,
|
|
2529
|
+
trackLayouts: se,
|
|
2530
|
+
innerWidth: J,
|
|
2531
|
+
innerHeight: re,
|
|
2532
|
+
activeInteractionMode: pe,
|
|
2533
|
+
hiddenSeriesIdSet: U,
|
|
2328
2534
|
internalHiddenSeriesIds: O,
|
|
2329
2535
|
independentTransforms: p,
|
|
2330
2536
|
independentYDomains: h,
|
|
2537
|
+
resolveInitialTrackDomain: ge,
|
|
2331
2538
|
annotationInteraction: k,
|
|
2332
2539
|
editorSeriesOptions: A,
|
|
2333
|
-
isPresentationMode:
|
|
2334
|
-
clearHover:
|
|
2335
|
-
cancelAnnotation:
|
|
2336
|
-
configureZoom:
|
|
2337
|
-
resetViewport:
|
|
2338
|
-
cancelViewportDrag:
|
|
2339
|
-
cancelPendingHover:
|
|
2340
|
-
clearZoomBindings:
|
|
2540
|
+
isPresentationMode: H,
|
|
2541
|
+
clearHover: Z.clearHover,
|
|
2542
|
+
cancelAnnotation: ye.cancelAnnotation,
|
|
2543
|
+
configureZoom: X.configureZoom,
|
|
2544
|
+
resetViewport: be.resetViewport,
|
|
2545
|
+
cancelViewportDrag: be.cancelViewportDrag,
|
|
2546
|
+
cancelPendingHover: Z.cancelPendingHover,
|
|
2547
|
+
clearZoomBindings: X.clearZoomBindings
|
|
2341
2548
|
});
|
|
2342
|
-
return F = xe.handleDataReferenceChange, _({
|
|
2549
|
+
return F = xe.handleBeforeDataReferenceChange, I = xe.handleDataReferenceChange, _({
|
|
2343
2550
|
...C(e),
|
|
2344
|
-
...
|
|
2345
|
-
...
|
|
2346
|
-
...X,
|
|
2551
|
+
...R,
|
|
2552
|
+
...q,
|
|
2347
2553
|
...ye,
|
|
2348
2554
|
...be,
|
|
2555
|
+
...Z,
|
|
2349
2556
|
margin: pt,
|
|
2350
|
-
getPageSize:
|
|
2557
|
+
getPageSize: Zt,
|
|
2351
2558
|
currentPage: S,
|
|
2352
2559
|
selection: M,
|
|
2353
2560
|
pointerInsideChart: P,
|
|
@@ -2358,31 +2565,31 @@ function Pn(e, t) {
|
|
|
2358
2565
|
editorSeriesOptions: A,
|
|
2359
2566
|
clipPathId: T,
|
|
2360
2567
|
goToPage: xe.goToPage,
|
|
2361
|
-
setContainer: (e) =>
|
|
2362
|
-
setSvgElement: (e) =>
|
|
2363
|
-
setTitleMeasureElement: (e) =>
|
|
2364
|
-
setSharedOverlayElement: (e) =>
|
|
2568
|
+
setContainer: (e) => Zn(n, e),
|
|
2569
|
+
setSvgElement: (e) => Zn(r, e),
|
|
2570
|
+
setTitleMeasureElement: (e) => Zn(i, e),
|
|
2571
|
+
setSharedOverlayElement: (e) => Zn(a, e)
|
|
2365
2572
|
});
|
|
2366
2573
|
}
|
|
2367
2574
|
//#endregion
|
|
2368
2575
|
//#region src/components/annotation/WaveformAnnotationEditor.vue?vue&type=script&setup=true&lang.ts
|
|
2369
|
-
var
|
|
2576
|
+
var $n = ["aria-labelledby"], er = { class: "waveform-annotation-editor__panel" }, tr = { class: "waveform-annotation-editor__header" }, nr = ["id"], rr = {
|
|
2370
2577
|
class: "waveform-annotation-editor__coordinates",
|
|
2371
2578
|
"aria-label": "标注坐标"
|
|
2372
|
-
},
|
|
2579
|
+
}, ir = {
|
|
2373
2580
|
key: 0,
|
|
2374
2581
|
class: "waveform-annotation-editor__series",
|
|
2375
2582
|
"aria-label": "标注所属波形"
|
|
2376
|
-
},
|
|
2583
|
+
}, 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 = {
|
|
2377
2584
|
class: "waveform-annotation-editor__color-field",
|
|
2378
2585
|
title: "调整标注边框色和透明度"
|
|
2379
|
-
},
|
|
2586
|
+
}, mr = {
|
|
2380
2587
|
class: "waveform-annotation-editor__color-field",
|
|
2381
2588
|
title: "调整标注文字色和透明度"
|
|
2382
|
-
},
|
|
2589
|
+
}, hr = {
|
|
2383
2590
|
class: "waveform-annotation-editor__color-field",
|
|
2384
2591
|
title: "调整标注背景色和透明度"
|
|
2385
|
-
},
|
|
2592
|
+
}, gr = { class: "waveform-annotation-editor__actions" }, _r = ["disabled"], vr = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
2386
2593
|
__name: "WaveformAnnotationEditor",
|
|
2387
2594
|
props: {
|
|
2388
2595
|
annotation: {},
|
|
@@ -2397,7 +2604,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2397
2604
|
"series-change"
|
|
2398
2605
|
],
|
|
2399
2606
|
setup(n, { emit: o }) {
|
|
2400
|
-
let c = n, l = o, u = v(), f =
|
|
2607
|
+
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(() => {
|
|
2401
2608
|
let e = c.seriesOptions?.find((e) => e.seriesId === c.annotation.seriesId);
|
|
2402
2609
|
return e ? {
|
|
2403
2610
|
id: e.seriesId,
|
|
@@ -2407,7 +2614,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2407
2614
|
} : c.series;
|
|
2408
2615
|
});
|
|
2409
2616
|
function A() {
|
|
2410
|
-
let e =
|
|
2617
|
+
let e = Z(c.annotation.style);
|
|
2411
2618
|
m.value = c.annotation.text, h.value = e.borderColor, _.value = e.textColor, b.value = e.backgroundColor, d(() => u.value?.focus());
|
|
2412
2619
|
}
|
|
2413
2620
|
E(() => c.annotation, A, { immediate: !0 });
|
|
@@ -2435,21 +2642,21 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2435
2642
|
"aria-modal": "true",
|
|
2436
2643
|
"aria-labelledby": w(f),
|
|
2437
2644
|
onClick: n[6] ||= k((e) => l("cancel"), ["self"])
|
|
2438
|
-
}, [a("section",
|
|
2439
|
-
a("header",
|
|
2645
|
+
}, [a("section", er, [
|
|
2646
|
+
a("header", tr, [a("div", null, [a("h2", { id: w(f) }, S(c.mode === "add" ? "添加标注" : "编辑标注"), 9, nr)]), a("button", {
|
|
2440
2647
|
type: "button",
|
|
2441
2648
|
class: "waveform-annotation-editor__close",
|
|
2442
2649
|
"aria-label": "关闭标注编辑器",
|
|
2443
2650
|
title: "关闭",
|
|
2444
2651
|
onClick: n[0] ||= (e) => l("cancel")
|
|
2445
2652
|
}, " × ")]),
|
|
2446
|
-
a("div",
|
|
2447
|
-
D.value ? (g(), i("label",
|
|
2653
|
+
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)])]),
|
|
2654
|
+
D.value ? (g(), i("label", ir, [
|
|
2448
2655
|
a("i", {
|
|
2449
2656
|
style: p({ backgroundColor: D.value.color }),
|
|
2450
2657
|
"aria-hidden": "true"
|
|
2451
2658
|
}, null, 4),
|
|
2452
|
-
a("span",
|
|
2659
|
+
a("span", ar, [n[8] ||= a("small", null, "标注波形", -1), a("b", null, S(D.value.name), 1)]),
|
|
2453
2660
|
c.seriesOptions?.length ? (g(), i("select", {
|
|
2454
2661
|
key: 0,
|
|
2455
2662
|
value: c.annotation.seriesId,
|
|
@@ -2458,9 +2665,9 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2458
2665
|
}, [(g(!0), i(e, null, y(c.seriesOptions, (e) => (g(), i("option", {
|
|
2459
2666
|
key: e.seriesId,
|
|
2460
2667
|
value: e.seriesId
|
|
2461
|
-
}, S(e.name) + S(e.unit ? ` (${e.unit})` : ""), 9,
|
|
2668
|
+
}, 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)
|
|
2462
2669
|
])) : r("", !0),
|
|
2463
|
-
a("label",
|
|
2670
|
+
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", {
|
|
2464
2671
|
ref_key: "textarea",
|
|
2465
2672
|
ref: u,
|
|
2466
2673
|
"onUpdate:modelValue": n[1] ||= (e) => m.value = e,
|
|
@@ -2469,10 +2676,10 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2469
2676
|
"aria-label": "标注文本",
|
|
2470
2677
|
placeholder: "输入这处波形的说明",
|
|
2471
2678
|
onKeydown: M
|
|
2472
|
-
}, null, 40,
|
|
2473
|
-
a("fieldset",
|
|
2679
|
+
}, null, 40, dr), [[T, m.value]])]),
|
|
2680
|
+
a("fieldset", fr, [
|
|
2474
2681
|
n[13] ||= a("legend", null, "颜色与透明度", -1),
|
|
2475
|
-
a("label",
|
|
2682
|
+
a("label", pr, [n[10] ||= a("span", null, "边框色", -1), s(w(q), {
|
|
2476
2683
|
"pure-color": h.value,
|
|
2477
2684
|
"onUpdate:pureColor": n[2] ||= (e) => h.value = e,
|
|
2478
2685
|
"aria-label": "标注边框色",
|
|
@@ -2482,7 +2689,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2482
2689
|
"disable-alpha": !1,
|
|
2483
2690
|
"blur-close": !0
|
|
2484
2691
|
}, null, 8, ["pure-color"])]),
|
|
2485
|
-
a("label",
|
|
2692
|
+
a("label", mr, [n[11] ||= a("span", null, "文字色", -1), s(w(q), {
|
|
2486
2693
|
"pure-color": _.value,
|
|
2487
2694
|
"onUpdate:pureColor": n[3] ||= (e) => _.value = e,
|
|
2488
2695
|
"aria-label": "标注文字色",
|
|
@@ -2492,7 +2699,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2492
2699
|
"disable-alpha": !1,
|
|
2493
2700
|
"blur-close": !0
|
|
2494
2701
|
}, null, 8, ["pure-color"])]),
|
|
2495
|
-
a("label",
|
|
2702
|
+
a("label", hr, [n[12] ||= a("span", null, "背景色", -1), s(w(q), {
|
|
2496
2703
|
"pure-color": b.value,
|
|
2497
2704
|
"onUpdate:pureColor": n[4] ||= (e) => b.value = e,
|
|
2498
2705
|
"aria-label": "标注背景色",
|
|
@@ -2503,7 +2710,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2503
2710
|
"blur-close": !0
|
|
2504
2711
|
}, null, 8, ["pure-color"])])
|
|
2505
2712
|
]),
|
|
2506
|
-
a("footer",
|
|
2713
|
+
a("footer", gr, [a("button", {
|
|
2507
2714
|
type: "button",
|
|
2508
2715
|
onClick: n[5] ||= (e) => l("cancel")
|
|
2509
2716
|
}, "取消"), a("button", {
|
|
@@ -2511,10 +2718,10 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2511
2718
|
class: "is-primary",
|
|
2512
2719
|
disabled: !x.value,
|
|
2513
2720
|
onClick: j
|
|
2514
|
-
}, " 保存标注 ", 8,
|
|
2515
|
-
])], 8,
|
|
2721
|
+
}, " 保存标注 ", 8, _r)])
|
|
2722
|
+
])], 8, $n));
|
|
2516
2723
|
}
|
|
2517
|
-
}), [["__scopeId", "data-v-52818b45"]]),
|
|
2724
|
+
}), [["__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({
|
|
2518
2725
|
__name: "WaveformTooltip",
|
|
2519
2726
|
props: {
|
|
2520
2727
|
visible: { type: Boolean },
|
|
@@ -2526,32 +2733,50 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2526
2733
|
containerHeight: {}
|
|
2527
2734
|
},
|
|
2528
2735
|
setup(n) {
|
|
2529
|
-
let s = n
|
|
2736
|
+
let s = n;
|
|
2737
|
+
function c(e, t) {
|
|
2738
|
+
let n = Math.max(1, t - Or - 14), r = Math.max(1, Math.floor(n / 7.2));
|
|
2739
|
+
return Math.max(1, Math.ceil([...e].length / r));
|
|
2740
|
+
}
|
|
2741
|
+
function l(e) {
|
|
2742
|
+
let t = f(e.point);
|
|
2743
|
+
return `${e.name ? `${e.name}: ` : ""}${rt(e.point.y)}${e.unit ? ` ${e.unit}` : ""}${t ? ` ${t}` : ""}`;
|
|
2744
|
+
}
|
|
2745
|
+
function u(e, t) {
|
|
2746
|
+
let n = s.seriesPoints.reduce((t, n) => t + c(l(n), e), 0);
|
|
2747
|
+
return 16 + kr * (c(t, e) + n) + 5;
|
|
2748
|
+
}
|
|
2749
|
+
let d = t(() => {
|
|
2530
2750
|
if (!s.visible || !s.hoveredPoint) return { display: "none" };
|
|
2531
|
-
let e =
|
|
2751
|
+
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 ? {
|
|
2752
|
+
left: `${e}px`,
|
|
2753
|
+
maxWidth: `${Math.min(Dr, n)}px`
|
|
2754
|
+
} : t >= Tr ? {
|
|
2755
|
+
right: `${s.containerWidth - s.position.x + wr}px`,
|
|
2756
|
+
maxWidth: `${Math.min(Dr, r)}px`
|
|
2757
|
+
} : {
|
|
2758
|
+
left: `${Tr}px`,
|
|
2759
|
+
maxWidth: `${i}px`
|
|
2760
|
+
}, o = Number.parseFloat(a.maxWidth), c = `${s.timeUnit}: ${lt(s.hoveredPoint.x, s.timeUnit)}`;
|
|
2532
2761
|
return {
|
|
2533
|
-
...
|
|
2534
|
-
top: `${Math.max(8, Math.min(s.position.y - 18, s.containerHeight -
|
|
2762
|
+
...a,
|
|
2763
|
+
top: `${Math.max(8, Math.min(s.position.y - 18, s.containerHeight - u(o, c) - 8))}px`
|
|
2535
2764
|
};
|
|
2536
2765
|
});
|
|
2537
|
-
function
|
|
2766
|
+
function f(e) {
|
|
2538
2767
|
let { lower: t, upper: n } = At(e);
|
|
2539
2768
|
return t === 0 && n === 0 ? null : `(+${rt(n)} / -${rt(t)})`;
|
|
2540
2769
|
}
|
|
2541
2770
|
return (t, s) => n.visible && n.hoveredPoint ? (g(), i("div", {
|
|
2542
2771
|
key: 0,
|
|
2543
2772
|
class: "waveform-tooltip waveform-chart__tooltip",
|
|
2544
|
-
style: p(
|
|
2545
|
-
}, [a("span",
|
|
2773
|
+
style: p(d.value)
|
|
2774
|
+
}, [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", {
|
|
2546
2775
|
key: `${e.trackIndex}-${e.name}`,
|
|
2547
2776
|
class: "waveform-tooltip__series waveform-chart__tooltip-series"
|
|
2548
|
-
}, [
|
|
2549
|
-
a("i", { style: p({ backgroundColor: e.color }) }, null, 4),
|
|
2550
|
-
e.name ? (g(), i("strong", nr, S(e.name) + ":", 1)) : r("", !0),
|
|
2551
|
-
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)])
|
|
2552
|
-
]))), 128))], 4)) : r("", !0);
|
|
2777
|
+
}, [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);
|
|
2553
2778
|
}
|
|
2554
|
-
}), [["__scopeId", "data-v-
|
|
2779
|
+
}), [["__scopeId", "data-v-93daa641"]]), jr = /* @__PURE__ */ c({
|
|
2555
2780
|
__name: "WaveformHoverHost",
|
|
2556
2781
|
props: {
|
|
2557
2782
|
state: {},
|
|
@@ -2562,7 +2787,7 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2562
2787
|
},
|
|
2563
2788
|
setup(e) {
|
|
2564
2789
|
let r = e, i = t(() => r.state.points[0]?.point ?? null);
|
|
2565
|
-
return (t, r) => (g(), n(
|
|
2790
|
+
return (t, r) => (g(), n(Ar, {
|
|
2566
2791
|
visible: e.visible && i.value !== null,
|
|
2567
2792
|
position: e.state.position,
|
|
2568
2793
|
"time-unit": e.timeUnit,
|
|
@@ -2580,16 +2805,16 @@ var Fn = ["aria-labelledby"], In = { class: "waveform-annotation-editor__panel"
|
|
|
2580
2805
|
"container-height"
|
|
2581
2806
|
]));
|
|
2582
2807
|
}
|
|
2583
|
-
}),
|
|
2808
|
+
}), Mr = 13, Nr = 2, Pr = 14, Fr = 8, Ir = 24, Lr = {
|
|
2584
2809
|
circle: U,
|
|
2585
|
-
square:
|
|
2586
|
-
triangle:
|
|
2810
|
+
square: W,
|
|
2811
|
+
triangle: te,
|
|
2587
2812
|
diamond: ee
|
|
2588
2813
|
};
|
|
2589
|
-
function
|
|
2590
|
-
return e === "none" ? null : H().type(
|
|
2814
|
+
function Rr(e, t = 48) {
|
|
2815
|
+
return e === "none" ? null : H().type(Lr[e]).size(t)() ?? null;
|
|
2591
2816
|
}
|
|
2592
|
-
function
|
|
2817
|
+
function zr(e, t, n = 48) {
|
|
2593
2818
|
if (e === "none" || t.length === 0) return null;
|
|
2594
2819
|
if (e === "circle") {
|
|
2595
2820
|
let e = Math.sqrt(n / Math.PI);
|
|
@@ -2606,24 +2831,24 @@ function _r(e, t, n = 48) {
|
|
|
2606
2831
|
let r = Math.sqrt(n / (2 * Math.tan(Math.PI / 6))), i = r * Math.tan(Math.PI / 6);
|
|
2607
2832
|
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("");
|
|
2608
2833
|
}
|
|
2609
|
-
function
|
|
2834
|
+
function Br(e) {
|
|
2610
2835
|
return e === "none" ? null : "M1 8H25";
|
|
2611
2836
|
}
|
|
2612
|
-
function
|
|
2837
|
+
function Vr(e) {
|
|
2613
2838
|
if (e === "dashed") return "8 5";
|
|
2614
2839
|
if (e === "dash-dot") return "8 5 1.5 5";
|
|
2615
2840
|
}
|
|
2616
|
-
function
|
|
2617
|
-
let t = (Number.isFinite(e) && e > 0 ? Math.min(e,
|
|
2841
|
+
function Hr(e) {
|
|
2842
|
+
let t = (Number.isFinite(e) && e > 0 ? Math.min(e, Ir) : Fr) / 2, n = Mr - t, r = Mr + t;
|
|
2618
2843
|
return [
|
|
2619
|
-
`M${n} ${
|
|
2620
|
-
`M${
|
|
2621
|
-
`M${n} ${
|
|
2844
|
+
`M${n} ${Nr}H${r}`,
|
|
2845
|
+
`M${Mr} ${Nr}V${Pr}`,
|
|
2846
|
+
`M${n} ${Pr}H${r}`
|
|
2622
2847
|
].join("");
|
|
2623
2848
|
}
|
|
2624
2849
|
//#endregion
|
|
2625
2850
|
//#region src/components/rendering/WaveformSeriesLayer.vue?vue&type=script&setup=true&lang.ts
|
|
2626
|
-
var
|
|
2851
|
+
var Ur = ["clip-path"], Wr = ["data-series-id", "data-series-name"], Gr = [
|
|
2627
2852
|
"data-series-id",
|
|
2628
2853
|
"data-series-name",
|
|
2629
2854
|
"data-y-axis-index",
|
|
@@ -2632,11 +2857,11 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2632
2857
|
"d",
|
|
2633
2858
|
"stroke",
|
|
2634
2859
|
"stroke-dasharray"
|
|
2635
|
-
],
|
|
2860
|
+
], Kr = ["data-series-id"], qr = [
|
|
2636
2861
|
"d",
|
|
2637
2862
|
"stroke",
|
|
2638
2863
|
"stroke-width"
|
|
2639
|
-
],
|
|
2864
|
+
], Jr = ["data-series-id", "data-point-type"], Yr = ["d", "fill"], Xr = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
2640
2865
|
__name: "WaveformSeriesLayer",
|
|
2641
2866
|
props: {
|
|
2642
2867
|
track: {},
|
|
@@ -2644,7 +2869,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2644
2869
|
},
|
|
2645
2870
|
setup(n) {
|
|
2646
2871
|
let a = n, o = t(() => a.track.seriesPaths.map((e) => {
|
|
2647
|
-
let t =
|
|
2872
|
+
let t = zr(e.series.pointType, e.pointRenderPoints.map((t) => ({
|
|
2648
2873
|
x: a.track.xScale(t.x),
|
|
2649
2874
|
y: e.yScale(t.y)
|
|
2650
2875
|
}))), n = e.series.errorBar.capWidth / 2, r = e.errorBarRenderPoints.map((t) => {
|
|
@@ -2681,8 +2906,8 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2681
2906
|
"data-line-style": e.series.lineStyle,
|
|
2682
2907
|
d: e.path,
|
|
2683
2908
|
stroke: e.series.color,
|
|
2684
|
-
"stroke-dasharray": w(
|
|
2685
|
-
}, null, 8,
|
|
2909
|
+
"stroke-dasharray": w(Vr)(e.series.lineStyle)
|
|
2910
|
+
}, null, 8, Gr)) : r("", !0),
|
|
2686
2911
|
e.series.errorBar.visible ? (g(), i("g", {
|
|
2687
2912
|
key: 1,
|
|
2688
2913
|
class: "waveform-track__error-bars waveform-chart__error-bars",
|
|
@@ -2693,7 +2918,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2693
2918
|
d: e.errorBarPath,
|
|
2694
2919
|
stroke: e.series.errorBar.color || e.series.color,
|
|
2695
2920
|
"stroke-width": e.series.errorBar.width
|
|
2696
|
-
}, null, 8,
|
|
2921
|
+
}, null, 8, qr)) : r("", !0)], 8, Kr)) : r("", !0),
|
|
2697
2922
|
e.series.pointType === "none" ? r("", !0) : (g(), i("g", {
|
|
2698
2923
|
key: 2,
|
|
2699
2924
|
class: "waveform-track__points waveform-chart__points",
|
|
@@ -2704,20 +2929,20 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2704
2929
|
class: "waveform-track__point waveform-chart__point",
|
|
2705
2930
|
d: e.pointPath,
|
|
2706
2931
|
fill: e.series.color
|
|
2707
|
-
}, null, 8,
|
|
2708
|
-
], 8,
|
|
2932
|
+
}, null, 8, Yr)) : r("", !0)], 8, Jr))
|
|
2933
|
+
], 8, Wr))), 128))], 8, Ur)) : r("", !0);
|
|
2709
2934
|
}
|
|
2710
|
-
}), [["__scopeId", "data-v-42a3fd47"]]),
|
|
2935
|
+
}), [["__scopeId", "data-v-42a3fd47"]]), Zr = ["transform"], Qr = ["transform"], $r = {
|
|
2711
2936
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--start waveform-chart__axis-endpoint waveform-chart__axis-endpoint--start",
|
|
2712
2937
|
x: "0",
|
|
2713
2938
|
y: "7",
|
|
2714
2939
|
dy: "0.71em",
|
|
2715
2940
|
"text-anchor": "start"
|
|
2716
|
-
},
|
|
2941
|
+
}, ei = ["x"], ti = [
|
|
2717
2942
|
"data-y-axis-index",
|
|
2718
2943
|
"data-y-axis-side",
|
|
2719
2944
|
"transform"
|
|
2720
|
-
],
|
|
2945
|
+
], ni = { key: 2 }, ri = ["x", "y"], ii = ["fill", "transform"], ai = ["data-y-axis-title-index"], oi = ["x", "y"], si = ["fill", "transform"], ci = /* @__PURE__ */ c({
|
|
2721
2946
|
__name: "WaveformTrackAxes",
|
|
2722
2947
|
props: {
|
|
2723
2948
|
track: {},
|
|
@@ -2776,7 +3001,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2776
3001
|
ref: o,
|
|
2777
3002
|
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 }]),
|
|
2778
3003
|
transform: `translate(0, ${t.track.height})`
|
|
2779
|
-
}, null, 10,
|
|
3004
|
+
}, null, 10, Zr)) : r("", !0),
|
|
2780
3005
|
t.track.showXAxis ? (g(), i("g", {
|
|
2781
3006
|
key: 1,
|
|
2782
3007
|
class: "waveform-track__axis-endpoints waveform-chart__axis-endpoints",
|
|
@@ -2784,13 +3009,13 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2784
3009
|
"font-family": "sans-serif",
|
|
2785
3010
|
"font-size": "10",
|
|
2786
3011
|
"aria-hidden": "true"
|
|
2787
|
-
}, [a("text",
|
|
3012
|
+
}, [a("text", $r, S(t.track.endpointLabels.start), 1), a("text", {
|
|
2788
3013
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--end waveform-chart__axis-endpoint waveform-chart__axis-endpoint--end",
|
|
2789
3014
|
x: t.track.width ?? t.innerWidth,
|
|
2790
3015
|
y: "7",
|
|
2791
3016
|
dy: "0.71em",
|
|
2792
3017
|
"text-anchor": "end"
|
|
2793
|
-
}, S(t.track.endpointLabels.end), 9,
|
|
3018
|
+
}, S(t.track.endpointLabels.end), 9, ei)], 8, Qr)) : r("", !0),
|
|
2794
3019
|
(g(!0), i(e, null, y(t.track.isEmpty ? [] : t.track.yAxes, (e) => (g(), i("g", {
|
|
2795
3020
|
key: `y-axis-${t.track.index}-${e.index}`,
|
|
2796
3021
|
ref_for: !0,
|
|
@@ -2799,21 +3024,21 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2799
3024
|
"data-y-axis-index": e.index,
|
|
2800
3025
|
"data-y-axis-side": e.side,
|
|
2801
3026
|
transform: `translate(${e.x}, 0)`
|
|
2802
|
-
}, null, 10,
|
|
2803
|
-
!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",
|
|
3027
|
+
}, null, 10, ti))), 128)),
|
|
3028
|
+
!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", {
|
|
2804
3029
|
class: "waveform-track__y-axis-label-bg waveform-chart__y-axis-label-bg",
|
|
2805
3030
|
x: t.track.yAxisLabelX - 12,
|
|
2806
3031
|
y: t.track.height / 2 - 40,
|
|
2807
3032
|
width: "24",
|
|
2808
3033
|
height: "80",
|
|
2809
3034
|
rx: "2"
|
|
2810
|
-
}, null, 8,
|
|
3035
|
+
}, null, 8, ri), a("text", {
|
|
2811
3036
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
2812
3037
|
fill: t.track.series.color,
|
|
2813
3038
|
transform: `translate(${t.track.yAxisLabelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
2814
3039
|
"text-anchor": "middle",
|
|
2815
3040
|
"dominant-baseline": "central"
|
|
2816
|
-
}, S(c(t.track.series)), 9,
|
|
3041
|
+
}, S(c(t.track.series)), 9, ii)])) : r("", !0),
|
|
2817
3042
|
(g(!0), i(e, null, y(!t.cleanView && t.track.yAxes.length > 1 ? t.track.yAxes.filter(l) : [], (e) => (g(), i("g", {
|
|
2818
3043
|
key: `y-axis-title-${t.track.index}-${e.index}`,
|
|
2819
3044
|
class: "waveform-track__multi-axis-title",
|
|
@@ -2825,40 +3050,40 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2825
3050
|
width: "24",
|
|
2826
3051
|
height: "80",
|
|
2827
3052
|
rx: "2"
|
|
2828
|
-
}, null, 8,
|
|
3053
|
+
}, null, 8, oi), a("text", {
|
|
2829
3054
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
2830
3055
|
fill: e.seriesList[0].color,
|
|
2831
3056
|
transform: `translate(${e.labelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
2832
3057
|
"text-anchor": "middle",
|
|
2833
3058
|
"dominant-baseline": "central"
|
|
2834
|
-
}, S(c(e.seriesList[0])), 9,
|
|
3059
|
+
}, S(c(e.seriesList[0])), 9, si)], 8, ai))), 128))
|
|
2835
3060
|
], 64));
|
|
2836
3061
|
}
|
|
2837
|
-
}),
|
|
3062
|
+
}), li = [
|
|
2838
3063
|
"width",
|
|
2839
3064
|
"height",
|
|
2840
3065
|
"fill"
|
|
2841
|
-
],
|
|
3066
|
+
], ui = ["clip-path"], di = { class: "waveform-track__grid waveform-track__grid--minor waveform-chart__grid waveform-chart__grid--minor" }, fi = [
|
|
2842
3067
|
"stroke",
|
|
2843
3068
|
"x1",
|
|
2844
3069
|
"x2",
|
|
2845
3070
|
"y2"
|
|
2846
|
-
],
|
|
3071
|
+
], pi = [
|
|
2847
3072
|
"stroke",
|
|
2848
3073
|
"x2",
|
|
2849
3074
|
"y1",
|
|
2850
3075
|
"y2"
|
|
2851
|
-
],
|
|
3076
|
+
], mi = { class: "waveform-track__grid waveform-track__grid--major waveform-chart__grid waveform-chart__grid--major" }, hi = [
|
|
2852
3077
|
"stroke",
|
|
2853
3078
|
"x1",
|
|
2854
3079
|
"x2",
|
|
2855
3080
|
"y2"
|
|
2856
|
-
],
|
|
3081
|
+
], gi = [
|
|
2857
3082
|
"stroke",
|
|
2858
3083
|
"x2",
|
|
2859
3084
|
"y1",
|
|
2860
3085
|
"y2"
|
|
2861
|
-
],
|
|
3086
|
+
], _i = ["clip-path"], vi = [
|
|
2862
3087
|
"data-y-axis-index",
|
|
2863
3088
|
"x2",
|
|
2864
3089
|
"y1",
|
|
@@ -2866,7 +3091,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2866
3091
|
"stroke",
|
|
2867
3092
|
"stroke-width",
|
|
2868
3093
|
"stroke-dasharray"
|
|
2869
|
-
],
|
|
3094
|
+
], yi = ["x", "y"], bi = /* @__PURE__ */ c({
|
|
2870
3095
|
__name: "WaveformTrackBackdrop",
|
|
2871
3096
|
props: {
|
|
2872
3097
|
track: {},
|
|
@@ -2891,12 +3116,12 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2891
3116
|
height: t.track.height,
|
|
2892
3117
|
fill: t.frameStyle.backgroundColor,
|
|
2893
3118
|
"aria-hidden": "true"
|
|
2894
|
-
}, null, 8,
|
|
3119
|
+
}, null, 8, li)) : r("", !0),
|
|
2895
3120
|
!t.track.isEmpty && t.track.hasVisibleSeries && !t.cleanView ? (g(), i("g", {
|
|
2896
3121
|
key: 1,
|
|
2897
3122
|
"clip-path": `url(#${t.clipPathId}-${t.track.index})`,
|
|
2898
3123
|
"aria-hidden": "true"
|
|
2899
|
-
}, [a("g",
|
|
3124
|
+
}, [a("g", di, [t.track.gridLines.vertical ? (g(!0), i(e, { key: 0 }, y(t.track.xMinorTicks, (e) => (g(), i("line", {
|
|
2900
3125
|
key: `x-minor-${t.track.index}-${e}`,
|
|
2901
3126
|
"data-grid-direction": "vertical",
|
|
2902
3127
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -2904,7 +3129,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2904
3129
|
x2: t.track.xScale(e),
|
|
2905
3130
|
y1: "0",
|
|
2906
3131
|
y2: t.track.height
|
|
2907
|
-
}, null, 8,
|
|
3132
|
+
}, null, 8, fi))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMinorTicks, (e) => (g(), i("line", {
|
|
2908
3133
|
key: `y-minor-${t.track.index}-${e}`,
|
|
2909
3134
|
"data-grid-direction": "horizontal",
|
|
2910
3135
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -2912,7 +3137,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2912
3137
|
x2: t.track.width ?? t.innerWidth,
|
|
2913
3138
|
y1: t.track.yScale(e),
|
|
2914
3139
|
y2: t.track.yScale(e)
|
|
2915
|
-
}, null, 8,
|
|
3140
|
+
}, 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", {
|
|
2916
3141
|
key: `x-major-${t.track.index}-${e}`,
|
|
2917
3142
|
"data-grid-direction": "vertical",
|
|
2918
3143
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -2920,7 +3145,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2920
3145
|
x2: t.track.xScale(e),
|
|
2921
3146
|
y1: "0",
|
|
2922
3147
|
y2: t.track.height
|
|
2923
|
-
}, null, 8,
|
|
3148
|
+
}, null, 8, hi))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMajorTicks, (e) => (g(), i("line", {
|
|
2924
3149
|
key: `y-major-${t.track.index}-${e}`,
|
|
2925
3150
|
"data-grid-direction": "horizontal",
|
|
2926
3151
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -2928,7 +3153,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2928
3153
|
x2: t.track.width ?? t.innerWidth,
|
|
2929
3154
|
y1: t.track.yScale(e),
|
|
2930
3155
|
y2: t.track.yScale(e)
|
|
2931
|
-
}, null, 8,
|
|
3156
|
+
}, null, 8, gi))), 128)) : r("", !0)])], 8, ui)) : r("", !0),
|
|
2932
3157
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.zeroLine.visible && !t.cleanView ? (g(), i("g", {
|
|
2933
3158
|
key: 2,
|
|
2934
3159
|
class: "waveform-track__zero-lines waveform-chart__zero-lines",
|
|
@@ -2945,7 +3170,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2945
3170
|
stroke: t.zeroLine.color,
|
|
2946
3171
|
"stroke-width": t.zeroLine.width,
|
|
2947
3172
|
"stroke-dasharray": t.zeroLine.dash || void 0
|
|
2948
|
-
}, null, 8,
|
|
3173
|
+
}, null, 8, vi))], 64))), 128))], 8, _i)) : r("", !0),
|
|
2949
3174
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.frameNumber !== void 0 && !t.cleanView ? (g(), i("text", {
|
|
2950
3175
|
key: 3,
|
|
2951
3176
|
class: "waveform-track__watermark waveform-chart__watermark",
|
|
@@ -2955,10 +3180,10 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2955
3180
|
"text-anchor": "middle",
|
|
2956
3181
|
"dominant-baseline": "central",
|
|
2957
3182
|
"aria-hidden": "true"
|
|
2958
|
-
}, S(t.frameNumber), 13,
|
|
3183
|
+
}, S(t.frameNumber), 13, yi)) : r("", !0)
|
|
2959
3184
|
], 64));
|
|
2960
3185
|
}
|
|
2961
|
-
}),
|
|
3186
|
+
}), xi = [
|
|
2962
3187
|
"data-track-index",
|
|
2963
3188
|
"data-track-empty",
|
|
2964
3189
|
"data-track-left",
|
|
@@ -2967,19 +3192,19 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
2967
3192
|
"data-track-top",
|
|
2968
3193
|
"data-track-height",
|
|
2969
3194
|
"transform"
|
|
2970
|
-
],
|
|
3195
|
+
], Si = [
|
|
2971
3196
|
"width",
|
|
2972
3197
|
"height",
|
|
2973
3198
|
"stroke",
|
|
2974
3199
|
"stroke-width",
|
|
2975
3200
|
"stroke-dasharray",
|
|
2976
3201
|
"stroke-linecap"
|
|
2977
|
-
],
|
|
3202
|
+
], Ci = [
|
|
2978
3203
|
"data-interactive",
|
|
2979
3204
|
"data-independent-overlay-index",
|
|
2980
3205
|
"width",
|
|
2981
3206
|
"height"
|
|
2982
|
-
],
|
|
3207
|
+
], wi = ["x", "y"], Ti = /* @__PURE__ */ c({
|
|
2983
3208
|
__name: "WaveformTrack",
|
|
2984
3209
|
props: {
|
|
2985
3210
|
track: {},
|
|
@@ -3038,7 +3263,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3038
3263
|
"data-track-height": e.track.height,
|
|
3039
3264
|
transform: `translate(${e.track.left ?? 0}, ${e.track.top})`
|
|
3040
3265
|
}, [
|
|
3041
|
-
s(
|
|
3266
|
+
s(bi, {
|
|
3042
3267
|
track: e.track,
|
|
3043
3268
|
"clip-path-id": e.clipPathId,
|
|
3044
3269
|
"inner-width": e.innerWidth,
|
|
@@ -3055,7 +3280,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3055
3280
|
"frame-style",
|
|
3056
3281
|
"zero-line"
|
|
3057
3282
|
]),
|
|
3058
|
-
s(
|
|
3283
|
+
s(ci, {
|
|
3059
3284
|
track: e.track,
|
|
3060
3285
|
"inner-width": e.innerWidth,
|
|
3061
3286
|
"clean-view": e.cleanView,
|
|
@@ -3081,8 +3306,8 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3081
3306
|
"stroke-dasharray": c.value.borderStyle === "dashed" ? "6 4" : c.value.borderStyle === "dotted" ? "1 3" : void 0,
|
|
3082
3307
|
"stroke-linecap": c.value.borderStyle === "dotted" ? "round" : void 0,
|
|
3083
3308
|
"aria-hidden": "true"
|
|
3084
|
-
}, null, 8,
|
|
3085
|
-
s(
|
|
3309
|
+
}, null, 8, Si)),
|
|
3310
|
+
s(Xr, {
|
|
3086
3311
|
track: e.track,
|
|
3087
3312
|
"clip-path-id": e.clipPathId
|
|
3088
3313
|
}, null, 8, ["track", "clip-path-id"]),
|
|
@@ -3104,7 +3329,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3104
3329
|
onPointerleave: n[4] ||= (e) => o("pointer-leave"),
|
|
3105
3330
|
onClick: n[5] ||= (e) => o("click", e),
|
|
3106
3331
|
onContextmenu: n[6] ||= (e) => o("contextmenu", e)
|
|
3107
|
-
}, null, 42,
|
|
3332
|
+
}, null, 42, Ci)) : r("", !0),
|
|
3108
3333
|
!e.track.isEmpty && !e.track.hasVisibleSeries && !e.cleanView ? (g(), i("text", {
|
|
3109
3334
|
key: 2,
|
|
3110
3335
|
class: "waveform-track__no-visible-series",
|
|
@@ -3112,33 +3337,33 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3112
3337
|
y: e.track.height / 2,
|
|
3113
3338
|
"text-anchor": "middle",
|
|
3114
3339
|
"dominant-baseline": "central"
|
|
3115
|
-
}, " 暂无可见曲线 ", 8,
|
|
3116
|
-
], 10,
|
|
3340
|
+
}, " 暂无可见曲线 ", 8, wi)) : r("", !0)
|
|
3341
|
+
], 10, xi));
|
|
3117
3342
|
}
|
|
3118
|
-
}),
|
|
3343
|
+
}), Ei = [
|
|
3119
3344
|
"width",
|
|
3120
3345
|
"height",
|
|
3121
3346
|
"data-position",
|
|
3122
3347
|
"data-orientation"
|
|
3123
|
-
],
|
|
3348
|
+
], Di = [
|
|
3124
3349
|
"disabled",
|
|
3125
3350
|
"aria-pressed",
|
|
3126
3351
|
"aria-label",
|
|
3127
3352
|
"onClick"
|
|
3128
|
-
],
|
|
3353
|
+
], Oi = [
|
|
3129
3354
|
"data-line-type",
|
|
3130
3355
|
"data-line-style",
|
|
3131
3356
|
"data-point-type",
|
|
3132
3357
|
"data-error-bar-visible"
|
|
3133
|
-
],
|
|
3358
|
+
], ki = [
|
|
3134
3359
|
"d",
|
|
3135
3360
|
"stroke",
|
|
3136
3361
|
"stroke-dasharray"
|
|
3137
|
-
],
|
|
3362
|
+
], Ai = [
|
|
3138
3363
|
"d",
|
|
3139
3364
|
"stroke",
|
|
3140
3365
|
"stroke-width"
|
|
3141
|
-
],
|
|
3366
|
+
], ji = ["d", "fill"], Mi = ["title"], Ni = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
3142
3367
|
__name: "WaveformLegend",
|
|
3143
3368
|
props: {
|
|
3144
3369
|
series: {},
|
|
@@ -3196,45 +3421,45 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3196
3421
|
"data-point-type": e.pointType,
|
|
3197
3422
|
"data-error-bar-visible": e.errorBar.visible || void 0
|
|
3198
3423
|
}, [
|
|
3199
|
-
w(
|
|
3424
|
+
w(Br)(e.lineType) ? (g(), i("path", {
|
|
3200
3425
|
key: 0,
|
|
3201
3426
|
class: "waveform-legend__line",
|
|
3202
|
-
d: w(
|
|
3427
|
+
d: w(Br)(e.lineType) ?? void 0,
|
|
3203
3428
|
stroke: e.color,
|
|
3204
|
-
"stroke-dasharray": w(
|
|
3429
|
+
"stroke-dasharray": w(Vr)(e.lineStyle),
|
|
3205
3430
|
"stroke-width": "1.5",
|
|
3206
3431
|
fill: "none"
|
|
3207
|
-
}, null, 8,
|
|
3432
|
+
}, null, 8, ki)) : r("", !0),
|
|
3208
3433
|
e.errorBar.visible ? (g(), i("path", {
|
|
3209
3434
|
key: 1,
|
|
3210
3435
|
class: "waveform-legend__error-bar",
|
|
3211
|
-
d: w(
|
|
3436
|
+
d: w(Hr)(e.errorBar.capWidth),
|
|
3212
3437
|
stroke: e.errorBar.color || e.color,
|
|
3213
3438
|
"stroke-width": e.errorBar.width,
|
|
3214
3439
|
"stroke-linecap": "butt",
|
|
3215
3440
|
fill: "none"
|
|
3216
|
-
}, null, 8,
|
|
3441
|
+
}, null, 8, Ai)) : r("", !0),
|
|
3217
3442
|
e.pointType === "none" ? r("", !0) : (g(), i("path", {
|
|
3218
3443
|
key: 2,
|
|
3219
3444
|
class: "waveform-legend__point",
|
|
3220
|
-
d: w(
|
|
3445
|
+
d: w(Rr)(e.pointType, 30) ?? void 0,
|
|
3221
3446
|
fill: e.color,
|
|
3222
3447
|
transform: "translate(13 8)"
|
|
3223
|
-
}, null, 8,
|
|
3224
|
-
], 8,
|
|
3448
|
+
}, null, 8, ji))
|
|
3449
|
+
], 8, Oi)), a("span", {
|
|
3225
3450
|
class: "waveform-legend__label",
|
|
3226
3451
|
title: e.name
|
|
3227
|
-
}, S(e.name), 9,
|
|
3452
|
+
}, S(e.name), 9, Mi)], 10, Di))), 128))], 6)], 2)], 8, Ei));
|
|
3228
3453
|
}
|
|
3229
|
-
}), [["__scopeId", "data-v-2ae12e71"]]),
|
|
3454
|
+
}), [["__scopeId", "data-v-2ae12e71"]]), Pi = {
|
|
3230
3455
|
class: "waveform-chart__hover-layer",
|
|
3231
3456
|
"pointer-events": "none",
|
|
3232
3457
|
"aria-hidden": "true"
|
|
3233
|
-
},
|
|
3458
|
+
}, Fi = ["clip-path", "transform"], Ii = [
|
|
3234
3459
|
"x1",
|
|
3235
3460
|
"x2",
|
|
3236
3461
|
"y2"
|
|
3237
|
-
],
|
|
3462
|
+
], Li = /*#__PURE__*/ je(/* @__PURE__ */ c({
|
|
3238
3463
|
__name: "WaveformHoverLayer",
|
|
3239
3464
|
props: {
|
|
3240
3465
|
state: {},
|
|
@@ -3257,7 +3482,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3257
3482
|
}] : [];
|
|
3258
3483
|
});
|
|
3259
3484
|
});
|
|
3260
|
-
return (t, r) => (g(), i("g",
|
|
3485
|
+
return (t, r) => (g(), i("g", Pi, [(g(!0), i(e, null, y(o.value, (e) => (g(), i("g", {
|
|
3261
3486
|
key: e.track.index,
|
|
3262
3487
|
class: "waveform-track__crosshair waveform-chart__crosshair",
|
|
3263
3488
|
"clip-path": `url(#${n.clipPathId}-${e.track.index})`,
|
|
@@ -3267,9 +3492,9 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3267
3492
|
x2: e.x,
|
|
3268
3493
|
y1: "0",
|
|
3269
3494
|
y2: e.track.height
|
|
3270
|
-
}, null, 8,
|
|
3495
|
+
}, null, 8, Ii)], 8, Fi))), 128))]));
|
|
3271
3496
|
}
|
|
3272
|
-
}), [["__scopeId", "data-v-a6f82099"]]),
|
|
3497
|
+
}), [["__scopeId", "data-v-a6f82099"]]), Ri = [
|
|
3273
3498
|
"data-display-mode",
|
|
3274
3499
|
"data-interaction-mode",
|
|
3275
3500
|
"data-presentation-mode",
|
|
@@ -3278,35 +3503,35 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3278
3503
|
"data-plot-margin-top",
|
|
3279
3504
|
"data-plot-margin-bottom",
|
|
3280
3505
|
"data-title-area-height"
|
|
3281
|
-
],
|
|
3506
|
+
], zi = [
|
|
3282
3507
|
"role",
|
|
3283
3508
|
"aria-level",
|
|
3284
3509
|
"aria-hidden"
|
|
3285
|
-
],
|
|
3510
|
+
], Bi = ["data-title-scale", "data-title-wrapped"], Vi = [
|
|
3286
3511
|
"width",
|
|
3287
3512
|
"height",
|
|
3288
3513
|
"aria-label"
|
|
3289
|
-
],
|
|
3514
|
+
], Hi = ["id"], Ui = ["width", "height"], Wi = ["transform"], Gi = {
|
|
3290
3515
|
key: 0,
|
|
3291
3516
|
class: "waveform-chart__grid-slots",
|
|
3292
3517
|
"aria-hidden": "true"
|
|
3293
|
-
},
|
|
3518
|
+
}, Ki = ["transform"], qi = ["width", "height"], Ji = ["width", "height"], Yi = [
|
|
3294
3519
|
"x",
|
|
3295
3520
|
"y",
|
|
3296
3521
|
"width",
|
|
3297
3522
|
"height"
|
|
3298
|
-
],
|
|
3523
|
+
], Xi = {
|
|
3299
3524
|
key: 4,
|
|
3300
3525
|
class: "waveform-chart__legend-layer"
|
|
3301
|
-
},
|
|
3526
|
+
}, Zi = [
|
|
3302
3527
|
"data-legend-track-index",
|
|
3303
3528
|
"data-legend-track-id",
|
|
3304
3529
|
"transform"
|
|
3305
|
-
],
|
|
3530
|
+
], Qi = ["x", "y"], $i = ["x", "y"], ea = /* @__PURE__ */ c({
|
|
3306
3531
|
__name: "WaveformChartView",
|
|
3307
3532
|
props: { controller: {} },
|
|
3308
3533
|
setup(t) {
|
|
3309
|
-
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:
|
|
3534
|
+
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);
|
|
3310
3535
|
return (t, C) => (g(), i("div", {
|
|
3311
3536
|
ref: w(Ke),
|
|
3312
3537
|
class: f(["waveform-chart", [
|
|
@@ -3315,7 +3540,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3315
3540
|
{
|
|
3316
3541
|
"waveform-chart--clean": w(l),
|
|
3317
3542
|
"waveform-chart--presentation": w(u),
|
|
3318
|
-
"waveform-chart--panning": w(d)?.
|
|
3543
|
+
"waveform-chart--panning": w(d)?.kind === "pan"
|
|
3319
3544
|
}
|
|
3320
3545
|
]]),
|
|
3321
3546
|
style: p(w(m)),
|
|
@@ -3352,7 +3577,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3352
3577
|
style: p(w(M)),
|
|
3353
3578
|
"data-title-scale": w(N).scale,
|
|
3354
3579
|
"data-title-wrapped": w(N).wrapped || void 0
|
|
3355
|
-
}, S(w(A)), 13,
|
|
3580
|
+
}, S(w(A)), 13, Bi)], 4)) : r("", !0)], 12, zi)) : r("", !0),
|
|
3356
3581
|
(g(), i("svg", {
|
|
3357
3582
|
ref: w(qe),
|
|
3358
3583
|
class: "waveform-chart__svg",
|
|
@@ -3369,9 +3594,9 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3369
3594
|
}, [a("rect", {
|
|
3370
3595
|
width: e.width,
|
|
3371
3596
|
height: e.height
|
|
3372
|
-
}, null, 8,
|
|
3597
|
+
}, null, 8, Ui)], 8, Hi))), 128))]),
|
|
3373
3598
|
a("g", { transform: `translate(${w(_)}, ${w(B)})` }, [
|
|
3374
|
-
w(o) !== "compact" && !w(l) ? (g(), i("g",
|
|
3599
|
+
w(o) !== "compact" && !w(l) ? (g(), i("g", Gi, [(g(!0), i(e, null, y(w(V), (e) => (g(), i("g", {
|
|
3375
3600
|
key: `grid-slot-${e.slotIndex}`,
|
|
3376
3601
|
transform: `translate(${e.left}, ${e.top})`
|
|
3377
3602
|
}, [e.series ? r("", !0) : (g(), i("rect", {
|
|
@@ -3379,7 +3604,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3379
3604
|
class: "waveform-chart__grid-slot-placeholder",
|
|
3380
3605
|
width: e.width,
|
|
3381
3606
|
height: e.cellHeight
|
|
3382
|
-
}, null, 8,
|
|
3607
|
+
}, null, 8, qi))], 8, Ki))), 128))])) : r("", !0),
|
|
3383
3608
|
w(o) !== "independent" && w(R).length && w(H) ? (g(), i("rect", {
|
|
3384
3609
|
key: 1,
|
|
3385
3610
|
ref: w(Ye),
|
|
@@ -3387,21 +3612,21 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3387
3612
|
"is-zoomable": !w(u) && w(U) && w(ee),
|
|
3388
3613
|
"is-annotating": !w(u) && w(c) === "annotation"
|
|
3389
3614
|
}]),
|
|
3390
|
-
width: w(
|
|
3391
|
-
height: w(
|
|
3392
|
-
onPointermove: C[0] ||= (...e) => w(
|
|
3393
|
-
onPointerdown: C[1] ||= (...e) => w(
|
|
3394
|
-
onPointerup: C[2] ||= (...e) => w(
|
|
3395
|
-
onPointercancel: C[3] ||= (...e) => w(
|
|
3396
|
-
onPointerleave: C[4] ||= (...e) => w(
|
|
3397
|
-
onClick: C[5] ||= (...e) => w(
|
|
3398
|
-
onContextmenu: C[6] ||= (...e) => w(
|
|
3399
|
-
}, null, 42,
|
|
3400
|
-
(g(!0), i(e, null, y(w(R), (e) => (g(), n(w(
|
|
3615
|
+
width: w(W),
|
|
3616
|
+
height: w(te),
|
|
3617
|
+
onPointermove: C[0] ||= (...e) => w(G) && w(G)(...e),
|
|
3618
|
+
onPointerdown: C[1] ||= (...e) => w(K) && w(K)(...e),
|
|
3619
|
+
onPointerup: C[2] ||= (...e) => w(ne) && w(ne)(...e),
|
|
3620
|
+
onPointercancel: C[3] ||= (...e) => w(q) && w(q)(...e),
|
|
3621
|
+
onPointerleave: C[4] ||= (...e) => w(ie) && w(ie)(...e),
|
|
3622
|
+
onClick: C[5] ||= (...e) => w(ae) && w(ae)(...e),
|
|
3623
|
+
onContextmenu: C[6] ||= (...e) => w(oe) && w(oe)(...e)
|
|
3624
|
+
}, null, 42, Ji)) : r("", !0),
|
|
3625
|
+
(g(!0), i(e, null, y(w(R), (e) => (g(), n(w(Ti), {
|
|
3401
3626
|
key: `${e.index}-${e.series.name}`,
|
|
3402
3627
|
track: e,
|
|
3403
3628
|
"clip-path-id": w(z),
|
|
3404
|
-
"inner-width": w(
|
|
3629
|
+
"inner-width": w(W),
|
|
3405
3630
|
zoomable: w(U),
|
|
3406
3631
|
interactive: !w(u),
|
|
3407
3632
|
"display-mode": w(o),
|
|
@@ -3412,14 +3637,14 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3412
3637
|
"clean-view": w(l),
|
|
3413
3638
|
"zero-line": w(ue),
|
|
3414
3639
|
"time-unit": w(de),
|
|
3415
|
-
"y-label": w(
|
|
3416
|
-
onPointerMove: (t) => w(
|
|
3417
|
-
onPointerDown: (t) => w(
|
|
3418
|
-
onPointerUp: w(
|
|
3419
|
-
onPointerCancel: w(
|
|
3420
|
-
onPointerLeave: w(
|
|
3421
|
-
onClick: (t) => w(
|
|
3422
|
-
onContextmenu: (t) => w(
|
|
3640
|
+
"y-label": w(J),
|
|
3641
|
+
onPointerMove: (t) => w(fe)(t, e.index),
|
|
3642
|
+
onPointerDown: (t) => w(pe)(t, e.index, !0),
|
|
3643
|
+
onPointerUp: w(ne),
|
|
3644
|
+
onPointerCancel: w(q),
|
|
3645
|
+
onPointerLeave: w(ie),
|
|
3646
|
+
onClick: (t) => w(ae)(t, e.index),
|
|
3647
|
+
onContextmenu: (t) => w(oe)(t, e.index)
|
|
3423
3648
|
}, null, 8, [
|
|
3424
3649
|
"track",
|
|
3425
3650
|
"clip-path-id",
|
|
@@ -3443,32 +3668,32 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3443
3668
|
"onClick",
|
|
3444
3669
|
"onContextmenu"
|
|
3445
3670
|
]))), 128)),
|
|
3446
|
-
s(w(
|
|
3447
|
-
state: w(
|
|
3671
|
+
s(w(Li), {
|
|
3672
|
+
state: w(Y),
|
|
3448
3673
|
tracks: w(R),
|
|
3449
3674
|
"clip-path-id": w(z),
|
|
3450
|
-
visible: w(
|
|
3675
|
+
visible: w(me) && !w(u)
|
|
3451
3676
|
}, null, 8, [
|
|
3452
3677
|
"state",
|
|
3453
3678
|
"tracks",
|
|
3454
3679
|
"clip-path-id",
|
|
3455
3680
|
"visible"
|
|
3456
3681
|
]),
|
|
3457
|
-
w(
|
|
3682
|
+
w(he) && w(d)?.kind === "box" ? (g(), i("rect", {
|
|
3458
3683
|
key: 2,
|
|
3459
3684
|
class: "waveform-chart__zoom-selection",
|
|
3460
|
-
x: w(
|
|
3461
|
-
y: w(
|
|
3462
|
-
width: w(
|
|
3463
|
-
height: w(
|
|
3685
|
+
x: w(he).x,
|
|
3686
|
+
y: w(he).y,
|
|
3687
|
+
width: w(he).width,
|
|
3688
|
+
height: w(he).height,
|
|
3464
3689
|
"aria-hidden": "true"
|
|
3465
|
-
}, null, 8,
|
|
3690
|
+
}, null, 8, Yi)) : r("", !0),
|
|
3466
3691
|
w(l) ? r("", !0) : (g(), n(w(Me), {
|
|
3467
3692
|
key: 3,
|
|
3468
|
-
annotations: w(
|
|
3469
|
-
visible: w(
|
|
3693
|
+
annotations: w(ge),
|
|
3694
|
+
visible: w(_e),
|
|
3470
3695
|
interactive: !w(u),
|
|
3471
|
-
onContextmenu: w(
|
|
3696
|
+
onContextmenu: w(ve),
|
|
3472
3697
|
onDragStart: w(X),
|
|
3473
3698
|
onMove: w(ye),
|
|
3474
3699
|
onDragEnd: w(be)
|
|
@@ -3481,23 +3706,23 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3481
3706
|
"onMove",
|
|
3482
3707
|
"onDragEnd"
|
|
3483
3708
|
])),
|
|
3484
|
-
w(l) ? r("", !0) : (g(), i("g",
|
|
3709
|
+
w(l) ? r("", !0) : (g(), i("g", Xi, [(g(!0), i(e, null, y(w(R), (e) => (g(), i("g", {
|
|
3485
3710
|
key: `legend-${e.index}-${e.series.name}`,
|
|
3486
3711
|
class: "waveform-chart__legend-track",
|
|
3487
3712
|
"data-legend-track-index": e.index,
|
|
3488
3713
|
"data-legend-track-id": e.id,
|
|
3489
3714
|
transform: `translate(${e.left}, ${e.top})`
|
|
3490
|
-
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(
|
|
3715
|
+
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(Ni), {
|
|
3491
3716
|
key: 0,
|
|
3492
3717
|
series: e.legendSeries,
|
|
3493
|
-
position: w(
|
|
3494
|
-
orientation: w(
|
|
3495
|
-
"background-color": w(
|
|
3496
|
-
interactive: w(
|
|
3497
|
-
"hidden-series-ids": w(
|
|
3498
|
-
width: e.width ?? w(
|
|
3718
|
+
position: w(Z)(e.id),
|
|
3719
|
+
orientation: w(xe)(w(Z)(e.id)),
|
|
3720
|
+
"background-color": w(Se),
|
|
3721
|
+
interactive: w(Ce),
|
|
3722
|
+
"hidden-series-ids": w(we),
|
|
3723
|
+
width: e.width ?? w(W),
|
|
3499
3724
|
height: e.height,
|
|
3500
|
-
onToggle: w(
|
|
3725
|
+
onToggle: w(Te)
|
|
3501
3726
|
}, null, 8, [
|
|
3502
3727
|
"series",
|
|
3503
3728
|
"position",
|
|
@@ -3508,29 +3733,29 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3508
3733
|
"width",
|
|
3509
3734
|
"height",
|
|
3510
3735
|
"onToggle"
|
|
3511
|
-
])) : r("", !0)], 8,
|
|
3512
|
-
], 8,
|
|
3513
|
-
w(
|
|
3736
|
+
])) : r("", !0)], 8, Zi))), 128))]))
|
|
3737
|
+
], 8, Wi),
|
|
3738
|
+
w(Ee) && !w(l) ? (g(), i("text", {
|
|
3514
3739
|
key: 0,
|
|
3515
3740
|
class: "waveform-chart__label waveform-chart__x-label",
|
|
3516
|
-
x: w(_) + w(
|
|
3517
|
-
y: w(
|
|
3741
|
+
x: w(_) + w(W) / 2,
|
|
3742
|
+
y: w(De),
|
|
3518
3743
|
"text-anchor": "middle"
|
|
3519
|
-
}, S(w(
|
|
3520
|
-
w(
|
|
3744
|
+
}, S(w(Ee)), 9, Qi)) : r("", !0),
|
|
3745
|
+
w(Oe) && !w(I) ? (g(), i("text", {
|
|
3521
3746
|
key: 1,
|
|
3522
3747
|
class: "waveform-chart__empty",
|
|
3523
3748
|
x: w(P) / 2,
|
|
3524
3749
|
y: w(F) / 2,
|
|
3525
3750
|
"text-anchor": "middle"
|
|
3526
|
-
}, " 暂无有效波形数据 ", 8,
|
|
3527
|
-
], 40,
|
|
3528
|
-
w(
|
|
3751
|
+
}, " 暂无有效波形数据 ", 8, $i)) : r("", !0)
|
|
3752
|
+
], 40, Vi)),
|
|
3753
|
+
w(ke).showPagination && w(Ae) > 1 && !w(l) ? (g(), n(w(re), {
|
|
3529
3754
|
key: 1,
|
|
3530
3755
|
class: "waveform-chart__pagination",
|
|
3531
3756
|
"aria-label": "波形分页",
|
|
3532
|
-
current: w(
|
|
3533
|
-
"page-size": w(Pe)(w(
|
|
3757
|
+
current: w(je),
|
|
3758
|
+
"page-size": w(Pe)(w(ke)),
|
|
3534
3759
|
total: w(Q).length,
|
|
3535
3760
|
"show-size-changer": !1,
|
|
3536
3761
|
"show-quick-jumper": !1,
|
|
@@ -3541,7 +3766,7 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3541
3766
|
"total",
|
|
3542
3767
|
"onChange"
|
|
3543
3768
|
])) : r("", !0),
|
|
3544
|
-
w(Le) && !w(l) && !w(u) ? (g(), n(
|
|
3769
|
+
w(Le) && !w(l) && !w(u) ? (g(), n(vr, {
|
|
3545
3770
|
key: 2,
|
|
3546
3771
|
annotation: w(Le).annotation,
|
|
3547
3772
|
mode: w(Le).mode,
|
|
@@ -3579,9 +3804,9 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3579
3804
|
"onDelete",
|
|
3580
3805
|
"onClose"
|
|
3581
3806
|
])) : r("", !0),
|
|
3582
|
-
s(w(
|
|
3583
|
-
state: w(
|
|
3584
|
-
visible: w(
|
|
3807
|
+
s(w(jr), {
|
|
3808
|
+
state: w(Y),
|
|
3809
|
+
visible: w(me) && !w(u),
|
|
3585
3810
|
"time-unit": w(de),
|
|
3586
3811
|
"container-width": w(P),
|
|
3587
3812
|
"container-height": w($)
|
|
@@ -3592,9 +3817,9 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3592
3817
|
"container-width",
|
|
3593
3818
|
"container-height"
|
|
3594
3819
|
])
|
|
3595
|
-
], 46,
|
|
3820
|
+
], 46, Ri));
|
|
3596
3821
|
}
|
|
3597
|
-
}),
|
|
3822
|
+
}), ta = /* @__PURE__ */ c({
|
|
3598
3823
|
__name: "WaveformChart",
|
|
3599
3824
|
props: {
|
|
3600
3825
|
data: {},
|
|
@@ -3671,9 +3896,9 @@ var xr = ["clip-path"], Sr = ["data-series-id", "data-series-name"], Cr = [
|
|
|
3671
3896
|
"page-change"
|
|
3672
3897
|
],
|
|
3673
3898
|
setup(e, { expose: t, emit: r }) {
|
|
3674
|
-
let i =
|
|
3675
|
-
return t({ resetViewport: i.resetViewport }), (e, t) => (g(), n(
|
|
3899
|
+
let i = Qn(e, r);
|
|
3900
|
+
return t({ resetViewport: i.resetViewport }), (e, t) => (g(), n(ea, { controller: w(i) }, null, 8, ["controller"]));
|
|
3676
3901
|
}
|
|
3677
3902
|
});
|
|
3678
3903
|
//#endregion
|
|
3679
|
-
export {
|
|
3904
|
+
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 };
|