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