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