waveform-analysis 0.1.46 → 0.1.48
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 +44 -30
- package/dist/index.cjs +1 -1
- package/dist/index.js +460 -461
- package/dist/types/components/core/grid.d.ts +3 -0
- package/dist/types/components/core/layout.d.ts +2 -2
- package/dist/types/components/core/trackLayoutBuilder.d.ts +1 -0
- package/dist/types/components/core/types.d.ts +2 -1
- package/dist/types/components/interaction/useWaveformViewport.d.ts +2 -1
- package/dist/types/types/chart.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/WaveformChartView.vue +2 -2
- package/src/components/core/grid.test.ts +13 -1
- package/src/components/core/grid.ts +14 -4
- package/src/components/core/layout.ts +15 -6
- package/src/components/core/trackLayoutBuilder.ts +17 -23
- package/src/components/core/types.ts +2 -1
- package/src/components/core/useWaveformLayout.ts +24 -12
- package/src/components/core/yAxisNice.test.ts +174 -0
- package/src/components/interaction/useWaveformHover.ts +2 -1
- package/src/components/interaction/useWaveformViewport.ts +20 -15
- package/src/components/interaction/useWaveformZoom.ts +1 -1
- package/src/components/rendering/WaveformTrack.vue +1 -0
- package/src/components/rendering/WaveformTrackAxes.vue +3 -2
- package/src/components/waveformChartCases/multiAxisAndPagination.test.ts +49 -0
- package/src/components/waveformChartCases/trackOrder.test.ts +261 -0
- package/src/demo/xAxisLabelControls.test.ts +1 -1
- package/src/types/chart.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -621,14 +621,14 @@ function Ye() {
|
|
|
621
621
|
}
|
|
622
622
|
//#endregion
|
|
623
623
|
//#region src/utils/domain.ts
|
|
624
|
-
function
|
|
624
|
+
function $(e) {
|
|
625
625
|
if (e.length === 0) return [0, 1];
|
|
626
626
|
let [t = 0, n = 1] = R(e);
|
|
627
627
|
if (t !== n) return [t, n];
|
|
628
628
|
let r = Math.abs(t) * .05 || .5;
|
|
629
629
|
return [t - r, n + r];
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function Xe(e, t = 5, n) {
|
|
632
632
|
let r = e;
|
|
633
633
|
if (n && e.length >= 2) {
|
|
634
634
|
let t = e[0], n = e[1], i = e[e.length - 1], a = e[e.length - 2];
|
|
@@ -650,71 +650,71 @@ function Ze(e, t = 5, n) {
|
|
|
650
650
|
}
|
|
651
651
|
//#endregion
|
|
652
652
|
//#region src/utils/formatters.ts
|
|
653
|
-
var
|
|
654
|
-
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) {
|
|
655
655
|
let n = e.toFixed(Math.max(0, t));
|
|
656
656
|
return /^-0(?:\.0+)?$/.test(n) ? n.slice(1) : n;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
return Number.isFinite(e) && (e >=
|
|
658
|
+
function nt(e) {
|
|
659
|
+
return Number.isFinite(e) && (e >= Qe || e > 0 && e < Ze);
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function rt(e, t) {
|
|
662
662
|
if (typeof e != "number" || typeof t != "number") return null;
|
|
663
663
|
let n = Math.max(Math.abs(e), Math.abs(t));
|
|
664
|
-
return
|
|
664
|
+
return nt(n) ? Math.floor(Math.log10(n)) : null;
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function it(e) {
|
|
667
667
|
return `E${e >= 0 ? "+" : "-"}${Math.abs(e).toString().padStart(2, "0")}`;
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function at(e) {
|
|
670
670
|
if (Object.is(e, -0)) return "0";
|
|
671
|
-
let t = e === 0 ? 0 : Number(e.toPrecision(5)), n =
|
|
671
|
+
let t = e === 0 ? 0 : Number(e.toPrecision(5)), n = $e.format(t);
|
|
672
672
|
return n === "-0" ? "0" : n;
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function ot(e, t = {}) {
|
|
675
675
|
if (!Number.isFinite(e)) return String(e);
|
|
676
|
-
let n =
|
|
676
|
+
let n = rt(t.axisMin, t.axisMax), r = at(n === null ? e : e / 10 ** n);
|
|
677
677
|
if (e !== (t.topTickValue ?? t.axisMax)) return r;
|
|
678
678
|
let i = t.unit?.trim(), a = i ? `(${i}) ` : "";
|
|
679
|
-
return `${n === null ? "" : `${
|
|
679
|
+
return `${n === null ? "" : `${it(n)} `}${a}${r}`;
|
|
680
680
|
}
|
|
681
|
-
function
|
|
682
|
-
return Number.isFinite(e) ? Object.is(e, -0) ? "0" :
|
|
681
|
+
function st(e) {
|
|
682
|
+
return Number.isFinite(e) ? Object.is(e, -0) ? "0" : et.format(e) : String(e);
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function ct(e) {
|
|
685
685
|
if (!Number.isFinite(e)) return String(e);
|
|
686
686
|
if (Object.is(e, -0)) return "0";
|
|
687
687
|
let [t, n] = e.toExponential().split("e"), r = Number(n), i = t.startsWith("-"), a = t.replace("-", "").replace(".", ""), o = r + 1, s;
|
|
688
688
|
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}`;
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function lt(e, t) {
|
|
691
691
|
return t === "ms" ? e * 1e3 : e;
|
|
692
692
|
}
|
|
693
|
-
function
|
|
694
|
-
let a =
|
|
693
|
+
function ut(e, t, n, r, i) {
|
|
694
|
+
let a = lt(e, n);
|
|
695
695
|
return i ? i(a, {
|
|
696
696
|
kind: r,
|
|
697
697
|
rawValue: e,
|
|
698
698
|
timeUnit: n,
|
|
699
699
|
domain: [t[0], t[1]],
|
|
700
|
-
displayDomain: [
|
|
701
|
-
}) :
|
|
700
|
+
displayDomain: [lt(t[0], n), lt(t[1], n)]
|
|
701
|
+
}) : ct(a);
|
|
702
|
+
}
|
|
703
|
+
function dt(e, t, n) {
|
|
704
|
+
return ut(e, t, n, "end");
|
|
702
705
|
}
|
|
703
706
|
function ft(e, t, n) {
|
|
704
|
-
return
|
|
707
|
+
return ut(e, n ?? [e, e], t, "tick");
|
|
705
708
|
}
|
|
706
|
-
function pt(e, t
|
|
707
|
-
return
|
|
709
|
+
function pt(e, t) {
|
|
710
|
+
return st(lt(e, t));
|
|
708
711
|
}
|
|
709
712
|
function mt(e, t) {
|
|
710
|
-
return
|
|
711
|
-
}
|
|
712
|
-
function ht(e, t) {
|
|
713
|
-
return Number.isFinite(e) ? nt(ut(e, t), 3) : String(e);
|
|
713
|
+
return Number.isFinite(e) ? tt(lt(e, t), 3) : String(e);
|
|
714
714
|
}
|
|
715
715
|
//#endregion
|
|
716
716
|
//#region src/utils/geometry.ts
|
|
717
|
-
function
|
|
717
|
+
function ht(e, t, n) {
|
|
718
718
|
if (e <= 0) return {
|
|
719
719
|
gap: 0,
|
|
720
720
|
axisBand: 0,
|
|
@@ -727,55 +727,55 @@ function gt(e, t, n) {
|
|
|
727
727
|
height: Math.max(1, (n - (e - 1) * (c + l)) / e)
|
|
728
728
|
};
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function gt(e, t, n) {
|
|
731
731
|
return Math.min(Math.max(e, t), n);
|
|
732
732
|
}
|
|
733
733
|
//#endregion
|
|
734
734
|
//#region src/components/core/constants.ts
|
|
735
|
-
var
|
|
735
|
+
var _t = {
|
|
736
736
|
top: 18,
|
|
737
737
|
right: 24,
|
|
738
738
|
bottom: 52,
|
|
739
739
|
left: 80
|
|
740
|
-
},
|
|
740
|
+
}, vt = {
|
|
741
741
|
DEFAULT_MAX_SCALE: 40,
|
|
742
742
|
MIN_SCALE: 1
|
|
743
|
-
},
|
|
743
|
+
}, 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 = {
|
|
744
744
|
WIDTH: 1.5,
|
|
745
745
|
CAP_WIDTH: 8
|
|
746
|
-
},
|
|
746
|
+
}, Ct = {
|
|
747
747
|
COLOR: "#98a2b3",
|
|
748
748
|
WIDTH: 1,
|
|
749
749
|
DASH: "6 4"
|
|
750
750
|
};
|
|
751
751
|
//#endregion
|
|
752
752
|
//#region src/components/core/yDomain.ts
|
|
753
|
-
function
|
|
753
|
+
function wt(e) {
|
|
754
754
|
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]];
|
|
755
755
|
}
|
|
756
|
-
function
|
|
757
|
-
return
|
|
756
|
+
function Tt(e, t) {
|
|
757
|
+
return wt(t?.[e.id]);
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
return
|
|
759
|
+
function Et(e, t, n) {
|
|
760
|
+
return wt(n?.[e.id]) ?? wt(t);
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
return !!(
|
|
762
|
+
function Dt(e, t, n) {
|
|
763
|
+
return !!(Tt(e, n) || e.visibleSeries.some((e) => Et(e, t, n)));
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Ot(e) {
|
|
766
766
|
return [Math.min(...e.map((e) => e[0])), Math.max(...e.map((e) => e[1]))];
|
|
767
767
|
}
|
|
768
768
|
//#endregion
|
|
769
769
|
//#region src/core/data.ts
|
|
770
|
-
var
|
|
771
|
-
function
|
|
770
|
+
var kt = St.WIDTH, At = St.CAP_WIDTH;
|
|
771
|
+
function jt(e) {
|
|
772
772
|
return e === "dashed" || e === "dash-dot" ? e : "solid";
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function Mt(e) {
|
|
775
775
|
return typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : void 0;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
778
|
-
let t =
|
|
777
|
+
function Nt(e) {
|
|
778
|
+
let t = Mt(e.error), n = Mt(e.lowerError), r = Mt(e.upperError);
|
|
779
779
|
return {
|
|
780
780
|
x: e.x,
|
|
781
781
|
y: e.y,
|
|
@@ -784,14 +784,14 @@ function Pt(e) {
|
|
|
784
784
|
...r === void 0 ? {} : { upperError: r }
|
|
785
785
|
};
|
|
786
786
|
}
|
|
787
|
-
function
|
|
788
|
-
let t =
|
|
787
|
+
function Pt(e) {
|
|
788
|
+
let t = Mt(e.error) ?? 0;
|
|
789
789
|
return {
|
|
790
|
-
lower:
|
|
791
|
-
upper:
|
|
790
|
+
lower: Mt(e.lowerError) ?? t,
|
|
791
|
+
upper: Mt(e.upperError) ?? t
|
|
792
792
|
};
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function Ft(e) {
|
|
795
795
|
if (e.kind === "samples") {
|
|
796
796
|
if (!Number.isFinite(e.sampleRate) || e.sampleRate <= 0) return [];
|
|
797
797
|
let t = Number.isFinite(e.startTime) ? e.startTime ?? 0 : 0, n = [];
|
|
@@ -807,14 +807,14 @@ function It(e) {
|
|
|
807
807
|
let t = [], n = -Infinity, r = !0;
|
|
808
808
|
for (let i of e.points) {
|
|
809
809
|
if (!Number.isFinite(i.x) || !Number.isFinite(i.y)) continue;
|
|
810
|
-
let e =
|
|
810
|
+
let e = Nt(i);
|
|
811
811
|
e.x < n && (r = !1), n = e.x, t.push(e);
|
|
812
812
|
}
|
|
813
813
|
return r || t.sort((e, t) => e.x - t.x), t;
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function It(e) {
|
|
816
816
|
if (e.kind !== "series") {
|
|
817
|
-
let t =
|
|
817
|
+
let t = Ft(e);
|
|
818
818
|
return t.length > 0 ? [{
|
|
819
819
|
id: "series-0",
|
|
820
820
|
name: "",
|
|
@@ -823,8 +823,8 @@ function Lt(e) {
|
|
|
823
823
|
pointType: "none",
|
|
824
824
|
errorBar: {
|
|
825
825
|
visible: !1,
|
|
826
|
-
width:
|
|
827
|
-
capWidth:
|
|
826
|
+
width: kt,
|
|
827
|
+
capWidth: At
|
|
828
828
|
},
|
|
829
829
|
points: t
|
|
830
830
|
}] : [];
|
|
@@ -834,7 +834,7 @@ function Lt(e) {
|
|
|
834
834
|
let r = e.id?.trim() || `series-${n}`, i = r, a = 1;
|
|
835
835
|
for (; t.has(i);) i = `${r}-${a}`, a++;
|
|
836
836
|
t.add(i);
|
|
837
|
-
let o = e.lineType ?? "linear", s =
|
|
837
|
+
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);
|
|
838
838
|
return {
|
|
839
839
|
id: i,
|
|
840
840
|
shotNo: e.shotNo?.trim() || void 0,
|
|
@@ -848,29 +848,29 @@ function Lt(e) {
|
|
|
848
848
|
errorBar: {
|
|
849
849
|
visible: l,
|
|
850
850
|
color: e.errorBar?.color,
|
|
851
|
-
width: Number.isFinite(d) && d > 0 ? d :
|
|
852
|
-
capWidth: Number.isFinite(f) && f > 0 ? f :
|
|
851
|
+
width: Number.isFinite(d) && d > 0 ? d : kt,
|
|
852
|
+
capWidth: Number.isFinite(f) && f > 0 ? f : At
|
|
853
853
|
},
|
|
854
|
-
points:
|
|
854
|
+
points: Ft(e.data)
|
|
855
855
|
};
|
|
856
856
|
}).filter((e) => e.points.length > 0);
|
|
857
857
|
}
|
|
858
858
|
//#endregion
|
|
859
859
|
//#region src/core/renderingStrategies.ts
|
|
860
|
-
function
|
|
860
|
+
function Lt(e, t) {
|
|
861
861
|
return {
|
|
862
862
|
start: Math.max(0, e.start - 1),
|
|
863
863
|
end: Math.min(t, e.end + 1)
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function Rt(e, t) {
|
|
867
867
|
t && e[e.length - 1] !== t && e.push(t);
|
|
868
868
|
}
|
|
869
|
-
var
|
|
870
|
-
let { start: t, end: n } =
|
|
869
|
+
var zt = (e) => {
|
|
870
|
+
let { start: t, end: n } = Lt(e.range, e.points.length);
|
|
871
871
|
return e.points.slice(t, n);
|
|
872
|
-
},
|
|
873
|
-
let { points: t, range: n, domain: r, width: i, options: a } = e, { start: o, end: s } =
|
|
872
|
+
}, Bt = (e) => {
|
|
873
|
+
let { points: t, range: n, domain: r, width: i, options: a } = e, { start: o, end: s } = Lt(n, t.length);
|
|
874
874
|
if (s - o <= 0) return [];
|
|
875
875
|
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) => {
|
|
876
876
|
if (e < 0) return t;
|
|
@@ -885,9 +885,9 @@ var Bt = (e) => {
|
|
|
885
885
|
for (; n >= 0 && m[n] > e;) m[n + 1] = m[n], --n;
|
|
886
886
|
m[n + 1] = e;
|
|
887
887
|
}
|
|
888
|
-
for (let n = 0; n < e; n += 1)
|
|
888
|
+
for (let n = 0; n < e; n += 1) Rt(f, t[m[n]]);
|
|
889
889
|
};
|
|
890
|
-
|
|
890
|
+
Rt(f, t[o]);
|
|
891
891
|
for (let e = n.start; e < n.end; e += 1) {
|
|
892
892
|
let n = t[e], r = Math.min(d - 1, Math.max(0, Math.floor((n.x - c) / p * d)));
|
|
893
893
|
if (r !== h) {
|
|
@@ -896,53 +896,53 @@ var Bt = (e) => {
|
|
|
896
896
|
}
|
|
897
897
|
_ = e, n.y < t[v].y && (v = e), n.y > t[y].y && (y = e);
|
|
898
898
|
}
|
|
899
|
-
return x(),
|
|
899
|
+
return x(), Rt(f, t[s - 1]), f;
|
|
900
900
|
};
|
|
901
|
-
function
|
|
901
|
+
function Vt(e) {
|
|
902
902
|
let t = Math.max(4, Math.floor(e.width * e.options.maxPointsPerPixel));
|
|
903
|
-
return !e.options.downsample || e.visibleCount <= e.options.downsampleThreshold || e.visibleCount <= t ?
|
|
903
|
+
return !e.options.downsample || e.visibleCount <= e.options.downsampleThreshold || e.visibleCount <= t ? zt : Bt;
|
|
904
904
|
}
|
|
905
905
|
//#endregion
|
|
906
906
|
//#region src/core/renderingOptions.ts
|
|
907
|
-
var
|
|
907
|
+
var Ht = {
|
|
908
908
|
downsample: !0,
|
|
909
909
|
downsampleThreshold: 2e3,
|
|
910
910
|
maxPointsPerPixel: 4,
|
|
911
911
|
pointMinSpacing: 10,
|
|
912
912
|
errorBarMinSpacing: 12
|
|
913
913
|
};
|
|
914
|
-
function
|
|
914
|
+
function Ut(e) {
|
|
915
915
|
let t = Number(e?.downsampleThreshold), n = Number(e?.maxPointsPerPixel), r = Number(e?.pointMinSpacing), i = Number(e?.errorBarMinSpacing);
|
|
916
916
|
return {
|
|
917
|
-
downsample: e?.downsample ??
|
|
918
|
-
downsampleThreshold: Number.isFinite(t) && t >= 2 ? Math.floor(t) :
|
|
919
|
-
maxPointsPerPixel: Number.isFinite(n) && n > 0 ? n :
|
|
920
|
-
pointMinSpacing: Number.isFinite(r) && r >= 0 ? r :
|
|
921
|
-
errorBarMinSpacing: Number.isFinite(i) && i >= 0 ? i :
|
|
917
|
+
downsample: e?.downsample ?? Ht.downsample,
|
|
918
|
+
downsampleThreshold: Number.isFinite(t) && t >= 2 ? Math.floor(t) : Ht.downsampleThreshold,
|
|
919
|
+
maxPointsPerPixel: Number.isFinite(n) && n > 0 ? n : Ht.maxPointsPerPixel,
|
|
920
|
+
pointMinSpacing: Number.isFinite(r) && r >= 0 ? r : Ht.pointMinSpacing,
|
|
921
|
+
errorBarMinSpacing: Number.isFinite(i) && i >= 0 ? i : Ht.errorBarMinSpacing
|
|
922
922
|
};
|
|
923
923
|
}
|
|
924
924
|
//#endregion
|
|
925
925
|
//#region src/core/rendering.ts
|
|
926
|
-
var
|
|
927
|
-
function
|
|
926
|
+
var Wt = P((e) => e.x), Gt = () => !0;
|
|
927
|
+
function Kt(e, t) {
|
|
928
928
|
let n = Math.min(t[0], t[1]), r = Math.max(t[0], t[1]);
|
|
929
929
|
return {
|
|
930
|
-
start:
|
|
931
|
-
end:
|
|
930
|
+
start: Wt.left(e, n),
|
|
931
|
+
end: Wt.right(e, r)
|
|
932
932
|
};
|
|
933
933
|
}
|
|
934
|
-
function
|
|
934
|
+
function qt(e, t, n) {
|
|
935
935
|
if (!Number.isFinite(n) || n <= 0) return !0;
|
|
936
936
|
let r = Math.ceil(n), i = /* @__PURE__ */ new Set();
|
|
937
937
|
for (let n of e) {
|
|
938
|
-
let e =
|
|
938
|
+
let e = Kt(n.points, t);
|
|
939
939
|
for (let t = e.start; t < e.end; t += 1) if (i.add(n.points[t].x), i.size >= r) return !0;
|
|
940
940
|
}
|
|
941
941
|
return !1;
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function Jt(e, t, n, r, i) {
|
|
944
944
|
let a = Math.max(0, t.start - 1), o = Math.min(e.length, t.end + 1) - a;
|
|
945
|
-
return o <= 0 ? [] :
|
|
945
|
+
return o <= 0 ? [] : Vt({
|
|
946
946
|
visibleCount: o,
|
|
947
947
|
width: r,
|
|
948
948
|
options: i
|
|
@@ -954,12 +954,12 @@ function Yt(e, t, n, r, i) {
|
|
|
954
954
|
options: i
|
|
955
955
|
});
|
|
956
956
|
}
|
|
957
|
-
function
|
|
958
|
-
return !e.length || n <= 0 ? [] :
|
|
957
|
+
function Yt(e, t, n, r) {
|
|
958
|
+
return !e.length || n <= 0 ? [] : Jt(e, Kt(e, t), t, n, r);
|
|
959
959
|
}
|
|
960
|
-
function
|
|
960
|
+
function Xt(e, t, n, r, i, a, o, s) {
|
|
961
961
|
if (!a || i === 0) {
|
|
962
|
-
if (o ===
|
|
962
|
+
if (o === Gt) return e.slice(t.start, t.end);
|
|
963
963
|
let n = [];
|
|
964
964
|
for (let r = t.start; r < t.end; r += 1) o(e[r]) && n.push(e[r]);
|
|
965
965
|
return n;
|
|
@@ -992,34 +992,38 @@ function Zt(e, t, n, r, i, a, o, s) {
|
|
|
992
992
|
let w = (f ?? []).map((e, t) => m?.[t] ?? e).filter((e) => e !== void 0);
|
|
993
993
|
return v && w[0] !== v && w.unshift(v), y && w.at(-1) !== y && w.push(y), w;
|
|
994
994
|
}
|
|
995
|
-
function
|
|
996
|
-
let { lower: t, upper: n } =
|
|
995
|
+
function Zt(e) {
|
|
996
|
+
let { lower: t, upper: n } = Pt(e);
|
|
997
997
|
return t !== 0 || n !== 0;
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function Qt(e, t, n, r, i) {
|
|
1000
1000
|
if (!e.length || n <= 0) return {
|
|
1001
1001
|
linePoints: [],
|
|
1002
1002
|
pointRenderPoints: [],
|
|
1003
1003
|
errorBarRenderPoints: []
|
|
1004
1004
|
};
|
|
1005
|
-
let a =
|
|
1005
|
+
let a = Kt(e, t), o = i.lineVisible ? Jt(e, a, t, n, r) : [], s = i.errorBarVisible && i.hasErrorPoints;
|
|
1006
1006
|
if (i.pointVisible && s) {
|
|
1007
|
-
let i =
|
|
1007
|
+
let i = Xt(e, a, t, n, Math.max(r.pointMinSpacing, r.errorBarMinSpacing), r.downsample, Gt, Zt);
|
|
1008
1008
|
return {
|
|
1009
1009
|
linePoints: o,
|
|
1010
1010
|
pointRenderPoints: i,
|
|
1011
|
-
errorBarRenderPoints: i.filter(
|
|
1011
|
+
errorBarRenderPoints: i.filter(Zt)
|
|
1012
1012
|
};
|
|
1013
1013
|
}
|
|
1014
1014
|
return {
|
|
1015
1015
|
linePoints: o,
|
|
1016
|
-
pointRenderPoints: i.pointVisible ?
|
|
1017
|
-
errorBarRenderPoints: s ?
|
|
1016
|
+
pointRenderPoints: i.pointVisible ? Xt(e, a, t, n, r.pointMinSpacing, r.downsample, Gt) : [],
|
|
1017
|
+
errorBarRenderPoints: s ? Xt(e, a, t, n, r.errorBarMinSpacing, r.downsample, Zt) : []
|
|
1018
1018
|
};
|
|
1019
1019
|
}
|
|
1020
|
-
var
|
|
1020
|
+
var $t = (e, t) => {
|
|
1021
1021
|
let n = typeof e == "number" ? e : Number(e);
|
|
1022
1022
|
return Number.isFinite(n) ? Math.min(10, Math.max(1, Math.floor(n))) : t;
|
|
1023
|
+
}, en = (e) => {
|
|
1024
|
+
if (!Array.isArray(e)) return [];
|
|
1025
|
+
let t = e.filter((e) => typeof e == "string").map((e) => e.trim()).filter(Boolean);
|
|
1026
|
+
return Array.from(new Set(t));
|
|
1023
1027
|
};
|
|
1024
1028
|
function tn(e) {
|
|
1025
1029
|
let t = Object.fromEntries(Object.entries(e?.trackLines ?? {}).map(([e, t]) => [e, {
|
|
@@ -1029,10 +1033,11 @@ function tn(e) {
|
|
|
1029
1033
|
verticalColor: typeof t?.verticalColor == "string" && t.verticalColor.trim() ? t.verticalColor : void 0
|
|
1030
1034
|
}]));
|
|
1031
1035
|
return {
|
|
1032
|
-
rowCount:
|
|
1033
|
-
columnCount:
|
|
1036
|
+
rowCount: $t(e?.rowCount, 2),
|
|
1037
|
+
columnCount: $t(e?.columnCount, 1),
|
|
1034
1038
|
showPagination: e?.showPagination ?? !0,
|
|
1035
1039
|
fillIncompleteLastRow: e?.fillIncompleteLastRow ?? !1,
|
|
1040
|
+
trackOrder: en(e?.trackOrder),
|
|
1036
1041
|
trackLines: t
|
|
1037
1042
|
};
|
|
1038
1043
|
}
|
|
@@ -1114,64 +1119,50 @@ function pn(e) {
|
|
|
1114
1119
|
hasSeries: !!e.series
|
|
1115
1120
|
})), n = cn(t, e.grid.columnCount);
|
|
1116
1121
|
return t.flatMap((t, r) => {
|
|
1117
|
-
let i = !t.series;
|
|
1118
|
-
if (
|
|
1119
|
-
let a = {
|
|
1122
|
+
let i = !t.series || t.series.series.length === 0;
|
|
1123
|
+
if (!t.series && (e.displayMode !== "compact" || !e.showCompactEmptyTracks)) return [];
|
|
1124
|
+
let a = t.series ?? {
|
|
1120
1125
|
id: `empty-grid-slot-${t.slotIndex}`,
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
lineType: "linear",
|
|
1124
|
-
lineStyle: "solid",
|
|
1125
|
-
pointType: "none",
|
|
1126
|
-
errorBar: {
|
|
1127
|
-
visible: !1,
|
|
1128
|
-
width: 1.5,
|
|
1129
|
-
capWidth: 8
|
|
1130
|
-
},
|
|
1131
|
-
points: [],
|
|
1126
|
+
series: [],
|
|
1127
|
+
visibleSeries: [],
|
|
1132
1128
|
xDomain: [0, 1],
|
|
1133
|
-
yDomain: [0, 1]
|
|
1134
|
-
|
|
1135
|
-
}, o = t.series ?? {
|
|
1136
|
-
id: a.id,
|
|
1137
|
-
series: [a],
|
|
1138
|
-
visibleSeries: [a],
|
|
1139
|
-
xDomain: a.xDomain,
|
|
1140
|
-
yDomain: a.yDomain
|
|
1141
|
-
}, s = !i && o.visibleSeries.length > 0, c = o.visibleSeries[0] ?? o.series[0] ?? a, l = e.displayMode === "independent" ? V(fn(o, c.id, e), [0, t.width]) : V(e.sharedZoomDomain, [0, t.width]), u = (e.displayMode === "independent" ? e.independentTransforms[r] ?? W : W).rescaleX(l), d = e.yDomains?.[o.id], f = Cn(o, e.overlayMode, e.fixedYDomain, e.fixedYDomains).map((e) => !e.fixed && d ? {
|
|
1129
|
+
yDomain: [0, 1]
|
|
1130
|
+
}, o = !i && a.visibleSeries.length > 0, s = a.visibleSeries[0] ?? a.series[0] ?? null, c = e.displayMode === "independent" ? V(fn(a, s?.id ?? a.id, e), [0, t.width]) : V(e.sharedZoomDomain, [0, t.width]), l = (e.displayMode === "independent" ? e.independentTransforms[r] ?? W : W).rescaleX(c), u = e.yDomains?.[a.id], d = Cn(a, e.overlayMode, e.fixedYDomain, e.fixedYDomains).map((e) => !e.fixed && u ? {
|
|
1142
1131
|
...e,
|
|
1143
|
-
domain:
|
|
1144
|
-
} : e),
|
|
1132
|
+
domain: u
|
|
1133
|
+
} : e), f = {
|
|
1145
1134
|
left: 0,
|
|
1146
1135
|
right: 0
|
|
1147
|
-
},
|
|
1136
|
+
}, p = d.map((n) => {
|
|
1148
1137
|
let r = yn(t.plotHeight, e.yAxisSplitNumber), i = Math.max(1, r - 1), a = V(n.domain, [t.plotHeight, 0]);
|
|
1149
|
-
a.nice(i);
|
|
1150
|
-
let [o, s] = a.domain(), c = Array.from({ length: r }, (e, t) => o + (s - o) * t / (r - 1)), l = e.displayMode !== "compact" || t.row === 0 ? c : c.slice(0, -1), { tickTextWidth: u } = wn(a.domain(), !1, l, n.seriesList[0]?.unit, r), d = u + 7 + 0 + 12 + 4,
|
|
1151
|
-
return
|
|
1138
|
+
e.yAxisNice !== !1 && a.nice(i);
|
|
1139
|
+
let [o, s] = a.domain(), c = Array.from({ length: r }, (e, t) => o + (s - o) * t / (r - 1)), l = e.displayMode !== "compact" || t.row === 0 ? c : c.slice(0, -1), { tickTextWidth: u } = wn(a.domain(), !1, l, n.seriesList[0]?.unit, r), d = u + 7 + 0 + 12 + 4, p = n.side === "left" ? -f.left : t.width + f.right, m = u + 7 + 0 + 12 / 2, h = p + (n.side === "left" ? -m : m);
|
|
1140
|
+
return f[n.side] += d, {
|
|
1152
1141
|
index: n.index,
|
|
1153
1142
|
side: n.side,
|
|
1154
|
-
x:
|
|
1143
|
+
x: p,
|
|
1155
1144
|
labelX: h,
|
|
1156
1145
|
scale: a,
|
|
1157
1146
|
majorTicks: c,
|
|
1158
|
-
minorTicks:
|
|
1147
|
+
minorTicks: Xe(c, 2),
|
|
1159
1148
|
tickValues: l,
|
|
1160
1149
|
seriesList: n.seriesList
|
|
1161
1150
|
};
|
|
1162
|
-
}),
|
|
1163
|
-
|
|
1164
|
-
|
|
1151
|
+
}), m = V(a.yDomain, [t.plotHeight, 0]);
|
|
1152
|
+
e.yAxisNice !== !1 && m.nice();
|
|
1153
|
+
let h = p[0]?.scale ?? m, g = l.ticks(Math.max(2, Math.floor(t.width / 100))), _ = p[0]?.majorTicks ?? [], v = p[0]?.tickValues ?? [], y = l.domain(), b = {
|
|
1154
|
+
start: ut(y[0], y, e.timeUnit, "start", e.xAxisLabelFormatter),
|
|
1155
|
+
end: ut(y[1], y, e.timeUnit, "end", e.xAxisLabelFormatter)
|
|
1165
1156
|
}, x = b.start.length * 7 + 10, S = b.end.length * 7 + 10, C = g.filter((e) => {
|
|
1166
|
-
let n =
|
|
1157
|
+
let n = l(e);
|
|
1167
1158
|
return n > x && n < t.width - S;
|
|
1168
|
-
}), w =
|
|
1169
|
-
let r =
|
|
1159
|
+
}), w = a.visibleSeries.map((n) => {
|
|
1160
|
+
let r = p.find((e) => e.seriesList.some((e) => e.id === n.id)), a = r?.scale ?? h, o = Qt(n.points, y, t.width, e.rendering, {
|
|
1170
1161
|
lineVisible: !i && n.lineType !== "none",
|
|
1171
1162
|
pointVisible: n.pointType !== "none",
|
|
1172
1163
|
errorBarVisible: n.errorBar.visible,
|
|
1173
1164
|
hasErrorPoints: n.hasErrorPoints
|
|
1174
|
-
}), s = z().x((e) =>
|
|
1165
|
+
}), s = z().x((e) => l(e.x)).y((e) => a(e.y));
|
|
1175
1166
|
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), {
|
|
1176
1167
|
series: n,
|
|
1177
1168
|
path: o.linePoints.length ? s(o.linePoints) : null,
|
|
@@ -1182,13 +1173,13 @@ function pn(e) {
|
|
|
1182
1173
|
};
|
|
1183
1174
|
});
|
|
1184
1175
|
return {
|
|
1185
|
-
id:
|
|
1176
|
+
id: a.id,
|
|
1186
1177
|
index: r,
|
|
1187
|
-
series:
|
|
1188
|
-
seriesList:
|
|
1189
|
-
legendSeries:
|
|
1178
|
+
series: s,
|
|
1179
|
+
seriesList: a.visibleSeries,
|
|
1180
|
+
legendSeries: a.series,
|
|
1190
1181
|
isEmpty: i,
|
|
1191
|
-
hasVisibleSeries:
|
|
1182
|
+
hasVisibleSeries: o,
|
|
1192
1183
|
column: t.column,
|
|
1193
1184
|
showYAxisLabel: !e.hideSecondaryLabels || t.column === 0,
|
|
1194
1185
|
yAxisLabelX: e.yAxisLabelX,
|
|
@@ -1196,23 +1187,23 @@ function pn(e) {
|
|
|
1196
1187
|
top: t.top,
|
|
1197
1188
|
width: t.width,
|
|
1198
1189
|
height: t.plotHeight,
|
|
1199
|
-
xScale:
|
|
1190
|
+
xScale: l,
|
|
1200
1191
|
yScale: h,
|
|
1201
|
-
yAxes:
|
|
1192
|
+
yAxes: p,
|
|
1202
1193
|
xMajorTicks: g,
|
|
1203
|
-
xMinorTicks:
|
|
1194
|
+
xMinorTicks: Xe(g, 3, y),
|
|
1204
1195
|
yMajorTicks: _,
|
|
1205
|
-
yMinorTicks:
|
|
1196
|
+
yMinorTicks: p[0]?.minorTicks ?? [],
|
|
1206
1197
|
yAxisTickValues: v,
|
|
1207
1198
|
xAxisTickValues: C,
|
|
1208
1199
|
endpointLabels: b,
|
|
1209
1200
|
path: w[0]?.path ?? null,
|
|
1210
1201
|
seriesPaths: w,
|
|
1211
|
-
gridLines: e.grid.trackLines[
|
|
1202
|
+
gridLines: e.grid.trackLines[a.id] ?? {
|
|
1212
1203
|
horizontal: !0,
|
|
1213
1204
|
vertical: !0
|
|
1214
1205
|
},
|
|
1215
|
-
showXAxis: (i ||
|
|
1206
|
+
showXAxis: (i || o) && (e.displayMode === "independent" || (e.displayMode === "compact" ? t.isLastRow ?? t.row === e.grid.rowCount - 1 : n.has(t.slotIndex)))
|
|
1216
1207
|
};
|
|
1217
1208
|
});
|
|
1218
1209
|
}
|
|
@@ -1253,22 +1244,22 @@ function Sn(e, t) {
|
|
|
1253
1244
|
if (t === "single-axis") n.domain = e.yDomain;
|
|
1254
1245
|
else {
|
|
1255
1246
|
let t = n.seriesList.flatMap((e) => e.yDomain);
|
|
1256
|
-
n.domain = t.length > 0 ?
|
|
1247
|
+
n.domain = t.length > 0 ? $(t) : e.yDomain;
|
|
1257
1248
|
}
|
|
1258
1249
|
}), n.set(t, o), o;
|
|
1259
1250
|
}
|
|
1260
1251
|
function Cn(e, t, n, r) {
|
|
1261
|
-
let i =
|
|
1252
|
+
let i = Tt(e, r);
|
|
1262
1253
|
return Sn(e, t).map((e) => {
|
|
1263
1254
|
if (i) return {
|
|
1264
1255
|
...e,
|
|
1265
1256
|
domain: i,
|
|
1266
1257
|
fixed: !0
|
|
1267
1258
|
};
|
|
1268
|
-
let t = e.seriesList.map((e) =>
|
|
1259
|
+
let t = e.seriesList.map((e) => Et(e, n, r) ?? e.yDomain), a = e.seriesList.some((e) => Et(e, n, r));
|
|
1269
1260
|
return a ? {
|
|
1270
1261
|
...e,
|
|
1271
|
-
domain:
|
|
1262
|
+
domain: Ot(t),
|
|
1272
1263
|
fixed: a
|
|
1273
1264
|
} : e;
|
|
1274
1265
|
});
|
|
@@ -1277,21 +1268,21 @@ function wn(e, t = !0, n, r, i = 10) {
|
|
|
1277
1268
|
let a = typeof i == "number" && Number.isFinite(i) ? Math.max(2, Math.floor(i)) : 10, o = V(e, [1, 0]);
|
|
1278
1269
|
t && o.nice(a);
|
|
1279
1270
|
let [s, c] = o.domain(), l = n ?? o.ticks(a), u = Math.max(...l);
|
|
1280
|
-
return { tickTextWidth: Math.max(1, ...l.map((e) =>
|
|
1271
|
+
return { tickTextWidth: Math.max(1, ...l.map((e) => ot(e, {
|
|
1281
1272
|
axisMin: s,
|
|
1282
1273
|
axisMax: c,
|
|
1283
1274
|
topTickValue: u,
|
|
1284
1275
|
unit: r
|
|
1285
1276
|
}).length)) * mn };
|
|
1286
1277
|
}
|
|
1287
|
-
function Tn(e, t) {
|
|
1288
|
-
return wn(e.domain,
|
|
1278
|
+
function Tn(e, t, n = !0) {
|
|
1279
|
+
return wn(e.domain, n, void 0, e.seriesList[0]?.unit, t).tickTextWidth + hn + _n + vn + gn;
|
|
1289
1280
|
}
|
|
1290
|
-
function En(e, t) {
|
|
1291
|
-
return wn(e.domain,
|
|
1281
|
+
function En(e, t, n = !0) {
|
|
1282
|
+
return wn(e.domain, n, void 0, e.seriesList[0]?.unit, t).tickTextWidth + hn + gn;
|
|
1292
1283
|
}
|
|
1293
|
-
function Dn(e, t, n, r, i) {
|
|
1294
|
-
return Cn(e, t, n, r).reduce((n, r) => (n[r.side] += t === "multi-axis" || e.visibleSeries.length === 1 ? Tn(r, i) : En(r, i), n), {
|
|
1284
|
+
function Dn(e, t, n, r, i, a = !0) {
|
|
1285
|
+
return Cn(e, t, n, r).reduce((n, r) => (n[r.side] += t === "multi-axis" || e.visibleSeries.length === 1 ? Tn(r, i, a) : En(r, i, a), n), {
|
|
1295
1286
|
left: 0,
|
|
1296
1287
|
right: 0
|
|
1297
1288
|
});
|
|
@@ -1566,10 +1557,10 @@ function Nn(e) {
|
|
|
1566
1557
|
if (w() || !d.value || !o.value.length) return;
|
|
1567
1558
|
let [t, n] = B(e, d.value);
|
|
1568
1559
|
g(() => {
|
|
1569
|
-
let e = m(t, n) ?? o.value.find((e) => e.hasVisibleSeries);
|
|
1570
|
-
if (!
|
|
1571
|
-
let
|
|
1572
|
-
v(
|
|
1560
|
+
let e = m(t, n), r = (e?.hasVisibleSeries ? e : void 0) ?? o.value.find((e) => e.hasVisibleSeries);
|
|
1561
|
+
if (!r) return;
|
|
1562
|
+
let i = Math.max(0, Math.min(r.width, t - r.left)), a = r.xScale.invert(i), s = o.value.flatMap((e) => e.seriesList.map((t) => x(t, e.index, T(t, a) ?? null)));
|
|
1563
|
+
v(s, null, a, {
|
|
1573
1564
|
x: c.value + t,
|
|
1574
1565
|
y: l.value + u.value + n
|
|
1575
1566
|
});
|
|
@@ -1671,7 +1662,7 @@ function Wn(e, t, n) {
|
|
|
1671
1662
|
let r = Bn(e), i = r[1] - r[0];
|
|
1672
1663
|
if (!Number.isFinite(i) || i <= 0) return 0;
|
|
1673
1664
|
let a = Number.isFinite(n.minZoomSpan) && (n.minZoomSpan ?? 0) > 0 ? Math.min(i, n.minZoomSpan) : 0, o = Vn(n.minVisiblePoints), s = Un(t, r, o);
|
|
1674
|
-
return a > 0 || o > 0 ? Math.max(a, s) : i /
|
|
1665
|
+
return a > 0 || o > 0 ? Math.max(a, s) : i / vt.DEFAULT_MAX_SCALE;
|
|
1675
1666
|
}
|
|
1676
1667
|
function Gn(e, t, n, r) {
|
|
1677
1668
|
if (r <= 0) return e;
|
|
@@ -1695,7 +1686,7 @@ function Kn(e, t, n, r) {
|
|
|
1695
1686
|
let o = Gn([Math.max(i[0], Math.min(e[0], e[1])), Math.min(i[1], Math.max(e[0], e[1]))], i, n, Vn(r.minVisiblePoints)), s = Wn(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));
|
|
1696
1687
|
return [u, u + c];
|
|
1697
1688
|
}
|
|
1698
|
-
function
|
|
1689
|
+
function qn(e, t, n) {
|
|
1699
1690
|
let r = t[1] - t[0], i = e[1] - e[0];
|
|
1700
1691
|
if (!Number.isFinite(r) || !Number.isFinite(i) || r <= 0 || i <= 0) return W;
|
|
1701
1692
|
let a = r / i, o = V(t, [0, n]);
|
|
@@ -1703,7 +1694,7 @@ function $(e, t, n) {
|
|
|
1703
1694
|
}
|
|
1704
1695
|
//#endregion
|
|
1705
1696
|
//#region src/components/interaction/viewportDomain.ts
|
|
1706
|
-
function
|
|
1697
|
+
function Jn(e) {
|
|
1707
1698
|
return (t, n) => {
|
|
1708
1699
|
if (!(!Number.isFinite(t[0]) || !Number.isFinite(t[1]) || t[0] === t[1])) {
|
|
1709
1700
|
if (e.cancelPendingZoom(), e.cancelViewportDrag(), e.props.displayMode === "independent") {
|
|
@@ -1712,11 +1703,11 @@ function qn(e) {
|
|
|
1712
1703
|
let r = e.trackLayouts.value.find((e) => e.index === n);
|
|
1713
1704
|
if (!r) return;
|
|
1714
1705
|
let a = e.resolveInitialTrackDomain(r), o = Kn(t, a, [r.seriesList], e.props);
|
|
1715
|
-
i[n] =
|
|
1706
|
+
i[n] = qn(o, a, r.width);
|
|
1716
1707
|
}), e.independentTransforms.value = i;
|
|
1717
1708
|
} else {
|
|
1718
1709
|
let n = e.initialXDomain.value, r = Kn(t, n, e.trackLayouts.value.filter((e) => e.hasVisibleSeries).map((e) => e.seriesList), e.props);
|
|
1719
|
-
e.sharedTransform.value =
|
|
1710
|
+
e.sharedTransform.value = qn(r, n, e.innerWidth.value);
|
|
1720
1711
|
}
|
|
1721
1712
|
e.clearHover(), e.editorSeriesOptions.value = [], d(e.configureZoom);
|
|
1722
1713
|
}
|
|
@@ -1724,7 +1715,7 @@ function qn(e) {
|
|
|
1724
1715
|
}
|
|
1725
1716
|
//#endregion
|
|
1726
1717
|
//#region src/components/interaction/useWaveformViewport.ts
|
|
1727
|
-
function
|
|
1718
|
+
function Yn(e) {
|
|
1728
1719
|
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) => {
|
|
1729
1720
|
let n = O.value, r = t?.currentTarget;
|
|
1730
1721
|
Pn(n, e), r && r !== n && Pn(r, e);
|
|
@@ -1747,7 +1738,7 @@ function Jn(e) {
|
|
|
1747
1738
|
}), M = (e, t) => {
|
|
1748
1739
|
let n = e[1] - e[0];
|
|
1749
1740
|
return n >= t[1] - t[0] ? [...t] : e[0] < t[0] ? [t[0], t[0] + n] : e[1] > t[1] ? [t[1] - n, t[1]] : e;
|
|
1750
|
-
}, N = () => Object.fromEntries(o.value.map((e) => [e.series
|
|
1741
|
+
}, N = () => Object.fromEntries(o.value.filter((e) => e.hasVisibleSeries).map((e) => [e.series?.trackId ?? e.series?.id ?? e.id, e.yScale.domain()])), P = (e, t, r) => {
|
|
1751
1742
|
if (v.value) return;
|
|
1752
1743
|
let s = n.pannable && a.value;
|
|
1753
1744
|
if (!n.zoomable && !s || !_.value || e.button !== 0) return;
|
|
@@ -1769,19 +1760,19 @@ function Jn(e) {
|
|
|
1769
1760
|
g.accepted && (i.value = g.state, O.value = c, c.setPointerCapture?.(e.pointerId), E(), e.preventDefault());
|
|
1770
1761
|
}, F = (e) => {
|
|
1771
1762
|
if (!f.value) return;
|
|
1772
|
-
let [t, n] = B(e, f.value), r = D(t, n) ?? o.value.find((e) => e.hasVisibleSeries);
|
|
1773
|
-
|
|
1763
|
+
let [t, n] = B(e, f.value), r = D(t, n), i = (r?.hasVisibleSeries ? r : void 0) ?? o.value.find((e) => e.hasVisibleSeries);
|
|
1764
|
+
i && P(e, i.index, !1);
|
|
1774
1765
|
}, I = (e, t) => {
|
|
1775
1766
|
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], _);
|
|
1776
1767
|
if (e.independent) {
|
|
1777
1768
|
let e = [...m.value];
|
|
1778
|
-
e[t.index] =
|
|
1779
|
-
} else p.value =
|
|
1780
|
-
let y = e.independent ? [t] : o.value, x = { ...g.value }, S = { ...h.value };
|
|
1769
|
+
e[t.index] = qn(v, _, i), m.value = e;
|
|
1770
|
+
} else p.value = qn(v, _, l.value);
|
|
1771
|
+
let y = e.independent ? [t] : o.value.filter((e) => e.hasVisibleSeries), x = { ...g.value }, S = { ...h.value };
|
|
1781
1772
|
y.forEach((t) => {
|
|
1782
1773
|
let r = s.value.find((e) => e.id === t.id);
|
|
1783
|
-
if (r &&
|
|
1784
|
-
let i = t.series
|
|
1774
|
+
if (r && Dt(r, n.yDomain, n.yDomains)) return;
|
|
1775
|
+
let i = t.series?.trackId ?? t.series?.id ?? t.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);
|
|
1785
1776
|
e.independent ? x[t.index] = u : S[i] = u;
|
|
1786
1777
|
}), e.independent ? g.value = x : h.value = S, r("zoom-change", v);
|
|
1787
1778
|
}, L = (e) => {
|
|
@@ -1812,11 +1803,11 @@ function Jn(e) {
|
|
|
1812
1803
|
let u = e.independent ? b(t) : c.value, f = e.independent ? [t.seriesList] : o.value.filter((e) => e.hasVisibleSeries).map((e) => e.seriesList), h = Kn([t.xScale.invert(a), t.xScale.invert(s)], u, f, n);
|
|
1813
1804
|
if (e.independent) {
|
|
1814
1805
|
let e = [...m.value];
|
|
1815
|
-
e[t.index] =
|
|
1816
|
-
} else p.value =
|
|
1817
|
-
let g = e.independent ? [t] : o.value, _ = Object.fromEntries(g.map((e) => [e.series
|
|
1806
|
+
e[t.index] = qn(h, u, t.width), m.value = e;
|
|
1807
|
+
} else p.value = qn(h, u, l.value);
|
|
1808
|
+
let g = e.independent ? [t] : o.value.filter((e) => e.hasVisibleSeries), _ = Object.fromEntries(g.map((e) => [e.series?.trackId ?? e.series?.id ?? e.id, e.yScale.domain()]));
|
|
1818
1809
|
if (r("zoom-change", h), e.independent) {
|
|
1819
|
-
let e = _[t.series
|
|
1810
|
+
let e = _[t.series?.trackId ?? t.series?.id ?? t.id];
|
|
1820
1811
|
r("zoom-end", {
|
|
1821
1812
|
start: h[0],
|
|
1822
1813
|
end: h[1],
|
|
@@ -1886,7 +1877,7 @@ function Jn(e) {
|
|
|
1886
1877
|
finishViewportDrag: V,
|
|
1887
1878
|
cancelViewportDrag: R,
|
|
1888
1879
|
resetViewport: H,
|
|
1889
|
-
setViewportDomain:
|
|
1880
|
+
setViewportDomain: Jn({
|
|
1890
1881
|
props: n,
|
|
1891
1882
|
trackLayouts: o,
|
|
1892
1883
|
initialXDomain: c,
|
|
@@ -1918,7 +1909,7 @@ function Jn(e) {
|
|
|
1918
1909
|
}
|
|
1919
1910
|
//#endregion
|
|
1920
1911
|
//#region src/components/utils/useAnimationFrameThrottle.ts
|
|
1921
|
-
function
|
|
1912
|
+
function Xn() {
|
|
1922
1913
|
let e = null, t = null;
|
|
1923
1914
|
function n(n) {
|
|
1924
1915
|
t = n, e === null && (e = requestAnimationFrame(() => {
|
|
@@ -1947,8 +1938,8 @@ function Yn() {
|
|
|
1947
1938
|
}
|
|
1948
1939
|
//#endregion
|
|
1949
1940
|
//#region src/components/interaction/useWaveformZoom.ts
|
|
1950
|
-
function
|
|
1951
|
-
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 =
|
|
1941
|
+
function Zn(e) {
|
|
1942
|
+
let { props: t, emit: n, svgElement: r, sharedOverlayElement: i, sharedTransform: a, independentTransforms: o, trackLayouts: s, initialXDomain: c, sharedZoomDomain: l, innerWidth: u, innerHeight: d, hasChartArea: f, isZoomMode: p, isPresentationMode: m, resolveInitialTrackDomain: h, cancelPendingHover: g } = e, _ = /* @__PURE__ */ new Map(), v = Xn(), y = !1, b = null, x = null, S = null, C = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Set(), D, O = () => v.schedule(j), k = (e) => {
|
|
1952
1943
|
y || m.value || (g(), b = e.transform, x = "wheel", O(), P());
|
|
1953
1944
|
}, A = (e, t) => {
|
|
1954
1945
|
y || m.value || (g(), C.set(t, e.transform), w.set(t, "wheel"), O(), P());
|
|
@@ -2017,7 +2008,7 @@ function Xn(e) {
|
|
|
2017
2008
|
} else n("zoom-end", {
|
|
2018
2009
|
start: e[0],
|
|
2019
2010
|
end: e[1],
|
|
2020
|
-
yRanges: Object.fromEntries(r.map((e) => [e.series
|
|
2011
|
+
yRanges: Object.fromEntries(r.map((e) => [e.series?.trackId ?? e.series?.id ?? e.id, e.yScale.domain()])),
|
|
2021
2012
|
gesture: "wheel"
|
|
2022
2013
|
});
|
|
2023
2014
|
S = null;
|
|
@@ -2035,19 +2026,19 @@ function Xn(e) {
|
|
|
2035
2026
|
F(), r.value?.querySelectorAll(".waveform-chart__overlay").forEach((e) => H(e).on(".zoom", null)), _.clear();
|
|
2036
2027
|
}, L = (e, n) => {
|
|
2037
2028
|
let r = Math.abs(e[1] - e[0]);
|
|
2038
|
-
if (!Number.isFinite(r) || r <= 0) return
|
|
2029
|
+
if (!Number.isFinite(r) || r <= 0) return vt.MIN_SCALE;
|
|
2039
2030
|
let i = Wn(e, n, t);
|
|
2040
|
-
return Math.max(
|
|
2041
|
-
}, R = (e, n, r, i) =>
|
|
2031
|
+
return Math.max(vt.MIN_SCALE, i > 0 ? r / i : vt.DEFAULT_MAX_SCALE);
|
|
2032
|
+
}, R = (e, n, r, i) => qn(Kn(e.rescaleX(V(n, [0, r])).domain(), n, i, t), n, r), z = (e) => {
|
|
2042
2033
|
let n = Number(t.minVisiblePoints);
|
|
2043
|
-
return
|
|
2034
|
+
return qt(e.seriesList, e.xScale.domain(), Number.isFinite(n) && n > 0 ? Math.ceil(n) + 1 : n);
|
|
2044
2035
|
}, B = () => {
|
|
2045
2036
|
let e = s.value.filter((e) => e.hasVisibleSeries);
|
|
2046
2037
|
return e.length > 0 && e.every(z);
|
|
2047
2038
|
}, U = (e, t) => {
|
|
2048
2039
|
if (e.type !== "wheel") return !1;
|
|
2049
2040
|
let n = e.deltaY;
|
|
2050
|
-
return n < 0 ? t : n > 0 && G(e.currentTarget).k >
|
|
2041
|
+
return n < 0 ? t : n > 0 && G(e.currentTarget).k > vt.MIN_SCALE;
|
|
2051
2042
|
};
|
|
2052
2043
|
return {
|
|
2053
2044
|
cancelPendingZoom: F,
|
|
@@ -2087,13 +2078,13 @@ function Xn(e) {
|
|
|
2087
2078
|
}
|
|
2088
2079
|
//#endregion
|
|
2089
2080
|
//#region src/components/core/useWaveformChartLifecycle.ts
|
|
2090
|
-
function
|
|
2081
|
+
function Qn(e) {
|
|
2091
2082
|
return e instanceof Element && !!e.closest("button, input, select, textarea, [contenteditable]:not([contenteditable=\"false\"])");
|
|
2092
2083
|
}
|
|
2093
|
-
function
|
|
2084
|
+
function $n(e) {
|
|
2094
2085
|
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, sharedZoomDomain: O, initialXDomain: k, sharedTransform: A, activeInteractionMode: j, hiddenSeriesIdSet: M, internalHiddenSeriesIds: N, independentTransforms: P, independentYDomains: F, resolveInitialTrackDomain: I, annotationInteraction: L, editorSeriesOptions: R, isPresentationMode: z, clearHover: B, cancelAnnotation: V, configureZoom: H, resetViewport: U, cancelViewportDrag: ee, cancelPendingHover: te, clearZoomBindings: ne } = e;
|
|
2095
2086
|
function re(e) {
|
|
2096
|
-
z.value || e.code !== "Space" || !t.pannable || !_.value ||
|
|
2087
|
+
z.value || e.code !== "Space" || !t.pannable || !_.value || Qn(e.target) || (g.value = !0, e.preventDefault());
|
|
2097
2088
|
}
|
|
2098
2089
|
function ie(e) {
|
|
2099
2090
|
e.code === "Space" && (g.value = !1);
|
|
@@ -2127,11 +2118,11 @@ function Qn(e) {
|
|
|
2127
2118
|
let r = q?.[n.index];
|
|
2128
2119
|
if (!r) return;
|
|
2129
2120
|
let i = I(n), a = Kn(r, i, [n.seriesList], t);
|
|
2130
|
-
e[n.index] =
|
|
2121
|
+
e[n.index] = qn(a, i, n.width);
|
|
2131
2122
|
}), P.value = e, q = void 0;
|
|
2132
2123
|
} else if (t.displayMode !== "independent" && K) {
|
|
2133
2124
|
let e = k.value, n = w.value.filter((e) => e.hasVisibleSeries).map((e) => e.seriesList), r = Kn(K, e, n, t);
|
|
2134
|
-
A.value =
|
|
2125
|
+
A.value = qn(r, e, T.value), K = void 0;
|
|
2135
2126
|
}
|
|
2136
2127
|
H();
|
|
2137
2128
|
});
|
|
@@ -2216,65 +2207,70 @@ function Qn(e) {
|
|
|
2216
2207
|
}
|
|
2217
2208
|
//#endregion
|
|
2218
2209
|
//#region src/components/core/useWaveformData.ts
|
|
2219
|
-
function
|
|
2210
|
+
function er(e, t = !1) {
|
|
2220
2211
|
let n = Infinity, r = -Infinity, i = Infinity, a = -Infinity, o = !1;
|
|
2221
2212
|
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) {
|
|
2222
|
-
let e =
|
|
2213
|
+
let e = Pt(s);
|
|
2223
2214
|
(e.lower !== 0 || e.upper !== 0) && (o = !0), i = Math.min(i, s.y - e.lower), a = Math.max(a, s.y + e.upper);
|
|
2224
2215
|
}
|
|
2225
2216
|
return {
|
|
2226
|
-
xDomain:
|
|
2227
|
-
yDomain:
|
|
2217
|
+
xDomain: $(Number.isFinite(n) ? [n, r] : []),
|
|
2218
|
+
yDomain: $(Number.isFinite(i) ? [i, a] : []),
|
|
2228
2219
|
hasErrorPoints: o
|
|
2229
2220
|
};
|
|
2230
2221
|
}
|
|
2231
|
-
function
|
|
2232
|
-
return
|
|
2233
|
-
let t =
|
|
2222
|
+
function tr(e) {
|
|
2223
|
+
return It(e).map((e) => {
|
|
2224
|
+
let t = er(e.points, e.errorBar.visible);
|
|
2234
2225
|
return {
|
|
2235
2226
|
...e,
|
|
2236
2227
|
...t
|
|
2237
2228
|
};
|
|
2238
2229
|
});
|
|
2239
2230
|
}
|
|
2240
|
-
function
|
|
2241
|
-
let r = x(
|
|
2231
|
+
function nr(e, t, n) {
|
|
2232
|
+
let r = x(tr(e()));
|
|
2242
2233
|
return E(e, (e) => {
|
|
2243
|
-
t(), r.value =
|
|
2234
|
+
t(), r.value = tr(e), n();
|
|
2244
2235
|
}), r;
|
|
2245
2236
|
}
|
|
2246
2237
|
//#endregion
|
|
2247
2238
|
//#region src/components/core/useWaveformLayout.ts
|
|
2248
|
-
function
|
|
2239
|
+
function rr(e) {
|
|
2249
2240
|
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) => ({
|
|
2250
2241
|
...e,
|
|
2251
|
-
color: e.color ?? (t === 0 ? n.lineColor :
|
|
2252
|
-
}))), h = t(() => {
|
|
2242
|
+
color: e.color ?? (t === 0 ? n.lineColor : xt[t % xt.length])
|
|
2243
|
+
}))), h = t(() => tn(n.grid)), g = t(() => {
|
|
2253
2244
|
let e = /* @__PURE__ */ new Map();
|
|
2254
|
-
|
|
2245
|
+
m.value.forEach((t) => {
|
|
2255
2246
|
let n = t.trackId || t.id, r = e.get(n);
|
|
2256
2247
|
r ? r.push(t) : e.set(n, [t]);
|
|
2257
|
-
})
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2248
|
+
});
|
|
2249
|
+
let t = h.value.trackOrder ?? [];
|
|
2250
|
+
return [...t, ...Array.from(e.keys()).filter((e) => !t.includes(e))].map((t) => {
|
|
2251
|
+
let n = e.get(t) ?? [], r = n.filter((e) => !a.value.has(e.id)), i = [], o = [];
|
|
2252
|
+
return r.forEach((e) => {
|
|
2253
|
+
i.push(e.xDomain[0], e.xDomain[1]), o.push(e.yDomain[0], e.yDomain[1]);
|
|
2261
2254
|
}), {
|
|
2262
|
-
id:
|
|
2263
|
-
series:
|
|
2264
|
-
visibleSeries:
|
|
2265
|
-
xDomain:
|
|
2266
|
-
yDomain:
|
|
2255
|
+
id: t,
|
|
2256
|
+
series: n,
|
|
2257
|
+
visibleSeries: r,
|
|
2258
|
+
xDomain: i.length ? $(i) : [0, 1],
|
|
2259
|
+
yDomain: o.length ? $(o) : [0, 1]
|
|
2267
2260
|
};
|
|
2268
2261
|
});
|
|
2269
|
-
}),
|
|
2270
|
-
let e =
|
|
2262
|
+
}), _ = t(() => Ut(n.rendering)), v = t(() => rn(g.value.length, h.value)), y = t(() => an(g.value, i.value, h.value)), b = t(() => {
|
|
2263
|
+
let e = y.value.filter((e) => e.series.length > 0);
|
|
2264
|
+
return h.value.fillIncompleteLastRow && e.length > 0 ? e : y.value;
|
|
2265
|
+
}), x = t(() => {
|
|
2266
|
+
let e = g.value.filter((e) => e.visibleSeries.length > 0).flatMap((e) => Cn(e, n.overlayMode, n.yDomain, n.yDomains)).map((e) => wn(e.domain, n.axes?.y?.nice !== !1, void 0, e.seriesList[0]?.unit, n.axes?.y?.splitNumber).tickTextWidth), t = Math.max(7, ...e), r = t + 7 + 4, i = -(7 + t + 0 + 12 / 2);
|
|
2271
2267
|
return {
|
|
2272
2268
|
tickClearance: r,
|
|
2273
2269
|
fullClearance: t + 7 + 0 + 12 + 4,
|
|
2274
2270
|
labelCenterX: i
|
|
2275
2271
|
};
|
|
2276
|
-
}),
|
|
2277
|
-
let r = Dn(t, n.overlayMode, n.yDomain, n.yDomains, n.axes?.y?.splitNumber);
|
|
2272
|
+
}), S = t(() => g.value.some((e) => e.visibleSeries.length === 1 && !!(e.visibleSeries[0]?.name.trim() || n.yLabel))), C = t(() => g.value.some((e) => e.visibleSeries.length > 0)), w = t(() => Math.max(_t.left, S.value ? x.value.fullClearance : C.value ? x.value.tickClearance : 0)), T = t(() => g.value.reduce((e, t) => {
|
|
2273
|
+
let r = Dn(t, n.overlayMode, n.yDomain, n.yDomains, n.axes?.y?.splitNumber, n.axes?.y?.nice !== !1);
|
|
2278
2274
|
return {
|
|
2279
2275
|
left: Math.max(e.left, r.left),
|
|
2280
2276
|
right: Math.max(e.right, r.right)
|
|
@@ -2282,77 +2278,78 @@ function nr(e) {
|
|
|
2282
2278
|
}, {
|
|
2283
2279
|
left: 0,
|
|
2284
2280
|
right: 0
|
|
2285
|
-
})),
|
|
2286
|
-
let e = on(n.displayMode), t =
|
|
2281
|
+
})), E = t(() => n.overlayMode === "multi-axis" ? Math.max(w.value, T.value.left) : w.value), D = t(() => n.overlayMode === "multi-axis" ? Math.max(_t.right, T.value.right) : _t.right), O = t(() => Math.max(0, o.value - E.value - D.value)), k = t(() => {
|
|
2282
|
+
let e = on(n.displayMode), t = h.value.columnCount, r = t > 1, i = Math.max(e, x.value.fullClearance), a = Math.max(e, x.value.tickClearance), o = (O.value - i * Math.max(0, t - 1)) / t >= 120;
|
|
2287
2283
|
return {
|
|
2288
|
-
horizontalGap: n.overlayMode === "multi-axis" && r &&
|
|
2289
|
-
hideSecondaryLabels: n.overlayMode !== "multi-axis" && r &&
|
|
2284
|
+
horizontalGap: n.overlayMode === "multi-axis" && r && C.value ? Math.max(e, T.value.left + T.value.right) : r && C.value ? S.value && o ? i : a : e,
|
|
2285
|
+
hideSecondaryLabels: n.overlayMode !== "multi-axis" && r && S.value && !o
|
|
2290
2286
|
};
|
|
2291
|
-
}),
|
|
2287
|
+
}), A = t(() => m.value.length > 0), j = t(() => O.value > 0 && s.value > 0), M = t(() => n.xLabel ?? `时间(${n.timeUnit})`), N = t(() => n.interactionMode), P = t(() => N.value !== "annotation"), F = t(() => {
|
|
2292
2288
|
let e = [];
|
|
2293
|
-
return
|
|
2289
|
+
return g.value.forEach((t) => {
|
|
2294
2290
|
t.visibleSeries.length && e.push(t.xDomain[0], t.xDomain[1]);
|
|
2295
|
-
}),
|
|
2296
|
-
}),
|
|
2291
|
+
}), $(e);
|
|
2292
|
+
}), I = t(() => {
|
|
2297
2293
|
let e = n.initialXDomain;
|
|
2298
|
-
return e && Number.isFinite(e[0]) && Number.isFinite(e[1]) && e[0] !== e[1] ? dn(e[0] < e[1] ? e : [e[1], e[0]], n.xDomainStrategy, !0) : dn(
|
|
2299
|
-
}),
|
|
2300
|
-
let t = n.initialXDomains?.[e.series
|
|
2301
|
-
return t && Number.isFinite(t[0]) && Number.isFinite(t[1]) && t[0] !== t[1] ? dn(t[0] < t[1] ? t : [t[1], t[0]], n.xDomainStrategy, !0) : dn(
|
|
2302
|
-
},
|
|
2294
|
+
return e && Number.isFinite(e[0]) && Number.isFinite(e[1]) && e[0] !== e[1] ? dn(e[0] < e[1] ? e : [e[1], e[0]], n.xDomainStrategy, !0) : dn(F.value, n.xDomainStrategy);
|
|
2295
|
+
}), L = (e) => {
|
|
2296
|
+
let t = n.initialXDomains?.[e.series?.trackId ?? e.series?.id ?? e.id] ?? (e.series ? n.initialXDomains?.[e.series.id] : void 0) ?? n.initialXDomain;
|
|
2297
|
+
return t && Number.isFinite(t[0]) && Number.isFinite(t[1]) && t[0] !== t[1] ? dn(t[0] < t[1] ? t : [t[1], t[0]], n.xDomainStrategy, !0) : dn($(e.seriesList.flatMap((e) => e.xDomain)), n.xDomainStrategy);
|
|
2298
|
+
}, R = t(() => l.value.rescaleX(V(I.value, [0, O.value])).domain()), z = t(() => sn(O.value, s.value, h.value, n.displayMode, b.value.map(Boolean), k.value.horizontalGap).map((e, t) => ({
|
|
2303
2299
|
...e,
|
|
2304
|
-
series:
|
|
2305
|
-
}))),
|
|
2306
|
-
cells:
|
|
2307
|
-
grid:
|
|
2300
|
+
series: b.value[t]
|
|
2301
|
+
}))), B = t(() => pn({
|
|
2302
|
+
cells: z.value,
|
|
2303
|
+
grid: h.value,
|
|
2308
2304
|
displayMode: n.displayMode,
|
|
2309
2305
|
overlayMode: n.overlayMode,
|
|
2310
2306
|
independentTransforms: u.value,
|
|
2311
|
-
sharedZoomDomain:
|
|
2312
|
-
initialXDomain: n.initialXDomain ?
|
|
2307
|
+
sharedZoomDomain: R.value,
|
|
2308
|
+
initialXDomain: n.initialXDomain ? I.value : void 0,
|
|
2313
2309
|
initialXDomains: n.initialXDomains,
|
|
2314
2310
|
xDomainStrategy: n.xDomainStrategy,
|
|
2315
2311
|
fixedYDomain: n.yDomain,
|
|
2316
2312
|
fixedYDomains: n.yDomains,
|
|
2317
|
-
yDomains: n.displayMode === "independent" ? Object.fromEntries(
|
|
2313
|
+
yDomains: n.displayMode === "independent" ? Object.fromEntries(g.value.flatMap((e, t) => {
|
|
2318
2314
|
let n = f.value[t];
|
|
2319
2315
|
return n ? [[e.id, n]] : [];
|
|
2320
2316
|
})) : d.value,
|
|
2321
2317
|
timeUnit: n.timeUnit,
|
|
2322
2318
|
xAxisLabelFormatter: n.axes?.x?.labelFormatter,
|
|
2323
2319
|
yAxisSplitNumber: n.axes?.y?.splitNumber,
|
|
2320
|
+
yAxisNice: n.axes?.y?.nice,
|
|
2324
2321
|
rendering: _.value,
|
|
2325
|
-
hideSecondaryLabels: c.value ||
|
|
2326
|
-
yAxisLabelX:
|
|
2327
|
-
showCompactEmptyTracks: n.displayMode === "compact" &&
|
|
2328
|
-
})),
|
|
2322
|
+
hideSecondaryLabels: c.value || k.value.hideSecondaryLabels,
|
|
2323
|
+
yAxisLabelX: x.value.labelCenterX,
|
|
2324
|
+
showCompactEmptyTracks: n.displayMode === "compact" && A.value
|
|
2325
|
+
})), H = (e) => e.seriesList.map((t) => ({
|
|
2329
2326
|
...e,
|
|
2330
2327
|
series: t,
|
|
2331
2328
|
yScale: e.seriesPaths.find((e) => e.series.id === t.id)?.yScale ?? e.yScale
|
|
2332
|
-
})),
|
|
2329
|
+
})), U = (e, t) => e.seriesPaths.find((e) => e.series.id === t)?.yScale ?? e.yScale, ee = t(() => B.value.flatMap(H));
|
|
2333
2330
|
return {
|
|
2334
2331
|
chartSeries: m,
|
|
2335
|
-
chartTracks:
|
|
2336
|
-
gridOptions:
|
|
2332
|
+
chartTracks: g,
|
|
2333
|
+
gridOptions: h,
|
|
2337
2334
|
pageCount: v,
|
|
2338
2335
|
pagedTracks: y,
|
|
2339
|
-
resolvedChartLeftMargin:
|
|
2340
|
-
innerWidth:
|
|
2341
|
-
hasVisibleWaveformData:
|
|
2342
|
-
hasWaveformData:
|
|
2343
|
-
hasChartArea:
|
|
2344
|
-
resolvedXLabel:
|
|
2345
|
-
activeInteractionMode:
|
|
2346
|
-
isZoomMode:
|
|
2347
|
-
initialXDomain:
|
|
2348
|
-
sharedZoomDomain:
|
|
2349
|
-
resolveInitialTrackDomain:
|
|
2350
|
-
gridCells:
|
|
2351
|
-
trackLayouts:
|
|
2352
|
-
annotationLayoutsForTrack:
|
|
2353
|
-
resolveSeriesYScale:
|
|
2354
|
-
annotationTrackLayouts:
|
|
2355
|
-
renderedAnnotations: t(() => n.annotationsVisible ? ge(n.annotations,
|
|
2336
|
+
resolvedChartLeftMargin: E,
|
|
2337
|
+
innerWidth: O,
|
|
2338
|
+
hasVisibleWaveformData: C,
|
|
2339
|
+
hasWaveformData: A,
|
|
2340
|
+
hasChartArea: j,
|
|
2341
|
+
resolvedXLabel: M,
|
|
2342
|
+
activeInteractionMode: N,
|
|
2343
|
+
isZoomMode: P,
|
|
2344
|
+
initialXDomain: I,
|
|
2345
|
+
sharedZoomDomain: R,
|
|
2346
|
+
resolveInitialTrackDomain: L,
|
|
2347
|
+
gridCells: z,
|
|
2348
|
+
trackLayouts: B,
|
|
2349
|
+
annotationLayoutsForTrack: H,
|
|
2350
|
+
resolveSeriesYScale: U,
|
|
2351
|
+
annotationTrackLayouts: ee,
|
|
2352
|
+
renderedAnnotations: t(() => n.annotationsVisible ? ge(n.annotations, ee.value, O.value, s.value) : []),
|
|
2356
2353
|
editorSeries: t(() => {
|
|
2357
2354
|
let e = p.editorDraft.value?.annotation.seriesId, t = m.value.find((t) => t.id === e);
|
|
2358
2355
|
return t ? {
|
|
@@ -2363,17 +2360,17 @@ function nr(e) {
|
|
|
2363
2360
|
} : void 0;
|
|
2364
2361
|
}),
|
|
2365
2362
|
resolveFrameNumber: (e) => {
|
|
2366
|
-
if (!(n.frameNumber === void 0 || n.frameNumber === null)) return
|
|
2363
|
+
if (!(n.frameNumber === void 0 || n.frameNumber === null)) return g.value.length === 1 ? n.frameNumber : typeof n.frameNumber == "number" ? n.frameNumber + e : `${n.frameNumber}-${e + 1}`;
|
|
2367
2364
|
}
|
|
2368
2365
|
};
|
|
2369
2366
|
}
|
|
2370
|
-
var
|
|
2371
|
-
function
|
|
2367
|
+
var ir = 1e-6;
|
|
2368
|
+
function ar(e) {
|
|
2372
2369
|
return Number.isFinite(e) ? Math.max(1, e) : 1;
|
|
2373
2370
|
}
|
|
2374
|
-
function
|
|
2375
|
-
let i =
|
|
2376
|
-
if (!(d >
|
|
2371
|
+
function or({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r }) {
|
|
2372
|
+
let i = ar(e), a = ar(t), o = ar(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;
|
|
2373
|
+
if (!(d > ir && Math.abs(d - 360) > ir)) {
|
|
2377
2374
|
let e = Math.max(1, Math.ceil(i / o)), t = o, n = a * e;
|
|
2378
2375
|
return {
|
|
2379
2376
|
textWidth: t,
|
|
@@ -2398,7 +2395,7 @@ function ar({ naturalWidth: e, naturalHeight: t, availableWidth: n, rotation: r
|
|
|
2398
2395
|
}
|
|
2399
2396
|
//#endregion
|
|
2400
2397
|
//#region src/components/core/useWaveformPresentation.ts
|
|
2401
|
-
function
|
|
2398
|
+
function sr(e) {
|
|
2402
2399
|
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(() => ({
|
|
2403
2400
|
width: l.value === void 0 ? "100%" : `${l.value}px`,
|
|
2404
2401
|
height: u.value === void 0 ? "100%" : `${u.value}px`
|
|
@@ -2406,9 +2403,9 @@ function or(e) {
|
|
|
2406
2403
|
let e = n.zeroLine.width;
|
|
2407
2404
|
return {
|
|
2408
2405
|
visible: n.zeroLine.visible === !0,
|
|
2409
|
-
color: n.zeroLine.color ||
|
|
2410
|
-
width: typeof e == "number" && Number.isFinite(e) && e > 0 ? e :
|
|
2411
|
-
dash: n.zeroLine.dash ??
|
|
2406
|
+
color: n.zeroLine.color || Ct.COLOR,
|
|
2407
|
+
width: typeof e == "number" && Number.isFinite(e) && e > 0 ? e : Ct.WIDTH,
|
|
2408
|
+
dash: n.zeroLine.dash ?? Ct.DASH
|
|
2412
2409
|
};
|
|
2413
2410
|
}), _ = 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) => {
|
|
2414
2411
|
let t = n.legend.orientation ?? "auto";
|
|
@@ -2430,10 +2427,10 @@ function or(e) {
|
|
|
2430
2427
|
fontStyle: n.title?.textStyle?.fontStyle ?? "normal",
|
|
2431
2428
|
textDecoration: n.title?.textStyle?.textDecoration ?? "none",
|
|
2432
2429
|
letterSpacing: n.title?.textStyle?.letterSpacing ?? "normal",
|
|
2433
|
-
lineHeight: String(
|
|
2430
|
+
lineHeight: String(bt)
|
|
2434
2431
|
})), A = t(() => {
|
|
2435
2432
|
let e = Number.parseFloat(n.title?.textStyle?.letterSpacing ?? ""), t = Number.isFinite(e) ? Math.max(0, C.value.length - 1) * e : 0;
|
|
2436
|
-
return Math.max(1, C.value.length * E.value *
|
|
2433
|
+
return Math.max(1, C.value.length * E.value * yt + t);
|
|
2437
2434
|
}), j = t(() => {
|
|
2438
2435
|
let e = d.value - 48;
|
|
2439
2436
|
return e > 0 ? e : A.value;
|
|
@@ -2443,14 +2440,14 @@ function or(e) {
|
|
|
2443
2440
|
maxWidth: O.value ? "none" : `${j.value}px`,
|
|
2444
2441
|
whiteSpace: O.value ? "nowrap" : "normal",
|
|
2445
2442
|
overflowWrap: O.value ? "normal" : "anywhere"
|
|
2446
|
-
})), N = t(() =>
|
|
2443
|
+
})), N = t(() => or({
|
|
2447
2444
|
naturalWidth: a.value || A.value,
|
|
2448
2445
|
naturalHeight: o.value || E.value * 1.2,
|
|
2449
2446
|
availableWidth: j.value,
|
|
2450
2447
|
rotation: D.value
|
|
2451
2448
|
})), P = t(() => w.value ? N.value.areaHeight : 0), F = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, I = t(() => ({
|
|
2452
|
-
top: F(n.plotMargin.top,
|
|
2453
|
-
bottom: F(n.plotMargin.bottom,
|
|
2449
|
+
top: F(n.plotMargin.top, _t.top),
|
|
2450
|
+
bottom: F(n.plotMargin.bottom, _t.bottom)
|
|
2454
2451
|
})), L = t(() => I.value.top), R = t(() => Math.max(0, f.value - P.value - c.value));
|
|
2455
2452
|
return {
|
|
2456
2453
|
fixedWidth: l,
|
|
@@ -2499,10 +2496,10 @@ function or(e) {
|
|
|
2499
2496
|
}
|
|
2500
2497
|
//#endregion
|
|
2501
2498
|
//#region src/components/core/useWaveformChartController.ts
|
|
2502
|
-
function
|
|
2499
|
+
function cr(e, t) {
|
|
2503
2500
|
e.value = t instanceof Element ? t : void 0;
|
|
2504
2501
|
}
|
|
2505
|
-
function
|
|
2502
|
+
function lr(e, t) {
|
|
2506
2503
|
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(W), p = x([]), m = v({}), h = v({}), g = b({
|
|
2507
2504
|
points: [],
|
|
2508
2505
|
trackIndex: null,
|
|
@@ -2511,11 +2508,11 @@ function cr(e, t) {
|
|
|
2511
2508
|
x: 0,
|
|
2512
2509
|
y: 0
|
|
2513
2510
|
}
|
|
2514
|
-
}), y = v(!1), S = v(1), w = x(), T = se("waveform-clip"), O = v(new Set(e.defaultHiddenSeriesIds)), k = Ye(), A = v([]), j =
|
|
2511
|
+
}), y = v(!1), S = v(1), w = x(), T = se("waveform-clip"), O = v(new Set(e.defaultHiddenSeriesIds)), k = Ye(), A = v([]), j = Xn();
|
|
2515
2512
|
E([() => e.yDomain, () => e.yDomains], () => {
|
|
2516
2513
|
m.value = {}, h.value = {};
|
|
2517
2514
|
}, { deep: !0 });
|
|
2518
|
-
let M = x(null), N = v(!1), P = v(!1), F = () => void 0, I = () => void 0, L =
|
|
2515
|
+
let M = x(null), N = v(!1), P = v(!1), F = () => void 0, I = () => void 0, L = nr(() => e.data, () => F(), () => I()), R = sr({
|
|
2519
2516
|
props: e,
|
|
2520
2517
|
observedWidth: o,
|
|
2521
2518
|
observedHeight: s,
|
|
@@ -2523,7 +2520,7 @@ function cr(e, t) {
|
|
|
2523
2520
|
measuredTitleHeight: l,
|
|
2524
2521
|
internalHiddenSeriesIds: O,
|
|
2525
2522
|
paginationBandHeight: d
|
|
2526
|
-
}), { chartWidth: z, chartHeight: B, isCleanView: V, isPresentationMode: H, hiddenSeriesIdSet: U, resolvedTitleText: ee, titleAreaReserved: te, titleMeasureStyle: ne, titleAreaHeight: re, chartTopMargin: ie, innerHeight: G } = R, K =
|
|
2523
|
+
}), { chartWidth: z, chartHeight: B, isCleanView: V, isPresentationMode: H, hiddenSeriesIdSet: U, resolvedTitleText: ee, titleAreaReserved: te, titleMeasureStyle: ne, titleAreaHeight: re, chartTopMargin: ie, innerHeight: G } = R, K = rr({
|
|
2527
2524
|
props: e,
|
|
2528
2525
|
preparedSeries: L,
|
|
2529
2526
|
currentPage: S,
|
|
@@ -2540,7 +2537,7 @@ function cr(e, t) {
|
|
|
2540
2537
|
D(() => {
|
|
2541
2538
|
d.value = oe.value.showPagination && ce.value > 1 && z.value <= 520 ? 40 : 0;
|
|
2542
2539
|
});
|
|
2543
|
-
let ye =
|
|
2540
|
+
let ye = Zn({
|
|
2544
2541
|
props: e,
|
|
2545
2542
|
emit: t,
|
|
2546
2543
|
svgElement: r,
|
|
@@ -2577,7 +2574,7 @@ function cr(e, t) {
|
|
|
2577
2574
|
chartTopMargin: ie,
|
|
2578
2575
|
activeInteractionMode: pe,
|
|
2579
2576
|
isPresentationMode: H
|
|
2580
|
-
}), xe =
|
|
2577
|
+
}), xe = Yn({
|
|
2581
2578
|
props: e,
|
|
2582
2579
|
emit: t,
|
|
2583
2580
|
selection: M,
|
|
@@ -2617,7 +2614,7 @@ function cr(e, t) {
|
|
|
2617
2614
|
isPresentationMode: H,
|
|
2618
2615
|
updateViewportDrag: xe.updateViewportDrag,
|
|
2619
2616
|
resolveTrackAtPointer: be.resolveTrackAtPointer
|
|
2620
|
-
}), Z =
|
|
2617
|
+
}), Z = $n({
|
|
2621
2618
|
props: e,
|
|
2622
2619
|
emit: t,
|
|
2623
2620
|
container: n,
|
|
@@ -2668,7 +2665,7 @@ function cr(e, t) {
|
|
|
2668
2665
|
...be,
|
|
2669
2666
|
...xe,
|
|
2670
2667
|
...X,
|
|
2671
|
-
margin:
|
|
2668
|
+
margin: _t,
|
|
2672
2669
|
getPageSize: nn,
|
|
2673
2670
|
currentPage: S,
|
|
2674
2671
|
selection: M,
|
|
@@ -2680,34 +2677,34 @@ function cr(e, t) {
|
|
|
2680
2677
|
editorSeriesOptions: A,
|
|
2681
2678
|
clipPathId: T,
|
|
2682
2679
|
goToPage: Z.goToPage,
|
|
2683
|
-
setContainer: (e) =>
|
|
2684
|
-
setSvgElement: (e) =>
|
|
2685
|
-
setTitleMeasureElement: (e) =>
|
|
2686
|
-
setSharedOverlayElement: (e) =>
|
|
2680
|
+
setContainer: (e) => cr(n, e),
|
|
2681
|
+
setSvgElement: (e) => cr(r, e),
|
|
2682
|
+
setTitleMeasureElement: (e) => cr(i, e),
|
|
2683
|
+
setSharedOverlayElement: (e) => cr(a, e)
|
|
2687
2684
|
});
|
|
2688
2685
|
}
|
|
2689
2686
|
//#endregion
|
|
2690
2687
|
//#region src/components/annotation/WaveformAnnotationEditor.vue?vue&type=script&setup=true&lang.ts
|
|
2691
|
-
var
|
|
2688
|
+
var ur = ["id"], dr = { class: "waveform-annotation-editor__content" }, fr = {
|
|
2692
2689
|
class: "waveform-annotation-editor__coordinates",
|
|
2693
2690
|
"aria-label": "标注坐标"
|
|
2694
|
-
},
|
|
2691
|
+
}, pr = ["aria-invalid"], mr = {
|
|
2695
2692
|
class: "waveform-annotation-editor__coordinate-value",
|
|
2696
2693
|
"aria-hidden": "true"
|
|
2697
|
-
},
|
|
2694
|
+
}, hr = ["id"], gr = {
|
|
2698
2695
|
key: 0,
|
|
2699
2696
|
class: "waveform-annotation-editor__series",
|
|
2700
2697
|
"aria-label": "标注所属波形"
|
|
2701
|
-
},
|
|
2698
|
+
}, _r = { class: "waveform-annotation-editor__series-label" }, vr = ["value"], yr = ["value"], br = { key: 1 }, xr = { class: "waveform-annotation-editor__field" }, Sr = { class: "waveform-annotation-editor__label-row" }, Cr = ["maxlength"], wr = { class: "waveform-annotation-editor__colors" }, Tr = {
|
|
2702
2699
|
class: "waveform-annotation-editor__color-field",
|
|
2703
2700
|
title: "调整标注边框色和透明度"
|
|
2704
|
-
},
|
|
2701
|
+
}, Er = {
|
|
2705
2702
|
class: "waveform-annotation-editor__color-field",
|
|
2706
2703
|
title: "调整标注文字色和透明度"
|
|
2707
|
-
},
|
|
2704
|
+
}, Dr = {
|
|
2708
2705
|
class: "waveform-annotation-editor__color-field",
|
|
2709
2706
|
title: "调整标注背景色和透明度"
|
|
2710
|
-
},
|
|
2707
|
+
}, Or = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
2711
2708
|
__name: "WaveformAnnotationEditor",
|
|
2712
2709
|
props: {
|
|
2713
2710
|
annotation: {},
|
|
@@ -2735,7 +2732,7 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2735
2732
|
});
|
|
2736
2733
|
function F() {
|
|
2737
2734
|
let e = we(l.annotation.style);
|
|
2738
|
-
h.value = l.annotation.text, _.value =
|
|
2735
|
+
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());
|
|
2739
2736
|
}
|
|
2740
2737
|
E(() => l.annotation.id, F, { immediate: !0 });
|
|
2741
2738
|
function I(e) {
|
|
@@ -2775,9 +2772,9 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2775
2772
|
onCancel: o[4] ||= (e) => u("cancel"),
|
|
2776
2773
|
onOk: R
|
|
2777
2774
|
}, {
|
|
2778
|
-
title: O(() => [a("span", { id: w(m) }, S(l.mode === "add" ? "添加标注" : "编辑标注"), 9,
|
|
2779
|
-
default: O(() => [a("div",
|
|
2780
|
-
a("div",
|
|
2775
|
+
title: O(() => [a("span", { id: w(m) }, S(l.mode === "add" ? "添加标注" : "编辑标注"), 9, ur)]),
|
|
2776
|
+
default: O(() => [a("div", dr, [
|
|
2777
|
+
a("div", fr, [
|
|
2781
2778
|
a("label", {
|
|
2782
2779
|
class: "waveform-annotation-editor__coordinate-input",
|
|
2783
2780
|
"aria-invalid": !!j.value
|
|
@@ -2800,26 +2797,26 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2800
2797
|
"aria-invalid",
|
|
2801
2798
|
"aria-describedby"
|
|
2802
2799
|
]),
|
|
2803
|
-
a("code",
|
|
2804
|
-
], 8,
|
|
2800
|
+
a("code", mr, S(_.value), 1)
|
|
2801
|
+
], 8, pr),
|
|
2805
2802
|
j.value ? (g(), i("p", {
|
|
2806
2803
|
key: 0,
|
|
2807
2804
|
id: `${w(m)}-time-error`,
|
|
2808
2805
|
class: "waveform-annotation-editor__coordinate-error",
|
|
2809
2806
|
role: "alert"
|
|
2810
|
-
}, S(j.value), 9,
|
|
2811
|
-
a("span", null, [o[6] ||= a("b", null, "Y", -1), a("code", null, S(w(
|
|
2807
|
+
}, S(j.value), 9, hr)) : r("", !0),
|
|
2808
|
+
a("span", null, [o[6] ||= a("b", null, "Y", -1), a("code", null, S(w(ct)(l.annotation.y)), 1)])
|
|
2812
2809
|
]),
|
|
2813
2810
|
o[13] ||= a("p", {
|
|
2814
2811
|
class: "waveform-annotation-editor__coordinate-hint",
|
|
2815
2812
|
role: "note"
|
|
2816
2813
|
}, " 修改 X 轴后失焦时会自动吸附最近的采样点 ", -1),
|
|
2817
|
-
P.value ? (g(), i("label",
|
|
2814
|
+
P.value ? (g(), i("label", gr, [
|
|
2818
2815
|
a("i", {
|
|
2819
2816
|
style: p({ backgroundColor: P.value.color }),
|
|
2820
2817
|
"aria-hidden": "true"
|
|
2821
2818
|
}, null, 4),
|
|
2822
|
-
a("span",
|
|
2819
|
+
a("span", _r, [o[7] ||= a("small", null, "标注波形", -1), a("b", null, S(P.value.name), 1)]),
|
|
2823
2820
|
l.seriesOptions?.length ? (g(), i("select", {
|
|
2824
2821
|
key: 0,
|
|
2825
2822
|
value: l.annotation.seriesId,
|
|
@@ -2828,9 +2825,9 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2828
2825
|
}, [(g(!0), i(e, null, y(l.seriesOptions, (e) => (g(), i("option", {
|
|
2829
2826
|
key: e.seriesId,
|
|
2830
2827
|
value: e.seriesId
|
|
2831
|
-
}, S(e.name) + S(e.unit ? ` (${e.unit})` : ""), 9,
|
|
2828
|
+
}, S(e.name) + S(e.unit ? ` (${e.unit})` : ""), 9, yr))), 128))], 40, vr)) : P.value.unit ? (g(), i("code", br, S(P.value.unit), 1)) : r("", !0)
|
|
2832
2829
|
])) : r("", !0),
|
|
2833
|
-
a("label",
|
|
2830
|
+
a("label", xr, [a("span", Sr, [o[8] ||= a("b", null, "标注文本", -1), a("small", null, S(N.value) + "/" + S(w(40)), 1)]), k(a("textarea", {
|
|
2834
2831
|
ref_key: "textarea",
|
|
2835
2832
|
ref: f,
|
|
2836
2833
|
"onUpdate:modelValue": o[0] ||= (e) => h.value = e,
|
|
@@ -2839,10 +2836,10 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2839
2836
|
"aria-label": "标注文本",
|
|
2840
2837
|
placeholder: "输入这处波形的说明",
|
|
2841
2838
|
onKeydown: z
|
|
2842
|
-
}, null, 40,
|
|
2843
|
-
a("fieldset",
|
|
2839
|
+
}, null, 40, Cr), [[T, h.value]])]),
|
|
2840
|
+
a("fieldset", wr, [
|
|
2844
2841
|
o[12] ||= a("legend", null, "颜色与透明度", -1),
|
|
2845
|
-
a("label",
|
|
2842
|
+
a("label", Tr, [o[9] ||= a("span", null, "边框色", -1), s(w(J), {
|
|
2846
2843
|
"pure-color": x.value,
|
|
2847
2844
|
"onUpdate:pureColor": o[1] ||= (e) => x.value = e,
|
|
2848
2845
|
"aria-label": "标注边框色",
|
|
@@ -2852,7 +2849,7 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2852
2849
|
"disable-alpha": !1,
|
|
2853
2850
|
"blur-close": !0
|
|
2854
2851
|
}, null, 8, ["pure-color"])]),
|
|
2855
|
-
a("label",
|
|
2852
|
+
a("label", Er, [o[10] ||= a("span", null, "文字色", -1), s(w(J), {
|
|
2856
2853
|
"pure-color": C.value,
|
|
2857
2854
|
"onUpdate:pureColor": o[2] ||= (e) => C.value = e,
|
|
2858
2855
|
"aria-label": "标注文字色",
|
|
@@ -2862,7 +2859,7 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2862
2859
|
"disable-alpha": !1,
|
|
2863
2860
|
"blur-close": !0
|
|
2864
2861
|
}, null, 8, ["pure-color"])]),
|
|
2865
|
-
a("label",
|
|
2862
|
+
a("label", Dr, [o[11] ||= a("span", null, "背景色", -1), s(w(J), {
|
|
2866
2863
|
"pure-color": D.value,
|
|
2867
2864
|
"onUpdate:pureColor": o[3] ||= (e) => D.value = e,
|
|
2868
2865
|
"aria-label": "标注背景色",
|
|
@@ -2877,13 +2874,13 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2877
2874
|
_: 1
|
|
2878
2875
|
}, 8, ["ok-button-props"]));
|
|
2879
2876
|
}
|
|
2880
|
-
}), [["__scopeId", "data-v-42466cf9"]]),
|
|
2877
|
+
}), [["__scopeId", "data-v-42466cf9"]]), kr = { class: "waveform-tooltip__series-content" }, Ar = { class: "waveform-tooltip__series-label" }, jr = {
|
|
2881
2878
|
key: 0,
|
|
2882
2879
|
class: "waveform-tooltip__value"
|
|
2883
|
-
},
|
|
2880
|
+
}, Mr = {
|
|
2884
2881
|
key: 1,
|
|
2885
2882
|
class: "waveform-tooltip__value waveform-tooltip__value--missing"
|
|
2886
|
-
},
|
|
2883
|
+
}, Nr = 12, Pr = 8, Fr = 238, Ir = 560, Lr = 20, Rr = 20, zr = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
2887
2884
|
__name: "WaveformTooltip",
|
|
2888
2885
|
props: {
|
|
2889
2886
|
visible: { type: Boolean },
|
|
@@ -2897,26 +2894,26 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2897
2894
|
setup(n) {
|
|
2898
2895
|
let s = n;
|
|
2899
2896
|
function c(e, t) {
|
|
2900
|
-
let n = Math.max(1, t -
|
|
2897
|
+
let n = Math.max(1, t - Lr - 14), r = Math.max(1, Math.floor(n / 7.2));
|
|
2901
2898
|
return Math.max(1, Math.ceil([...e].length / r));
|
|
2902
2899
|
}
|
|
2903
2900
|
function l(e) {
|
|
2904
|
-
let t = e.point ? `(x:${
|
|
2901
|
+
let t = e.point ? `(x:${pt(e.point.x, s.timeUnit)} y:${st(e.point.y)})` : "无数据";
|
|
2905
2902
|
return `${e.shotNo?.trim() || "未配置炮号"}: ${e.name}${e.unit ? `(${e.unit})` : ""} ${t}`;
|
|
2906
2903
|
}
|
|
2907
2904
|
function u(e) {
|
|
2908
|
-
return 16 +
|
|
2905
|
+
return 16 + Rr * s.seriesPoints.reduce((t, n) => t + c(l(n), e), 0) + 5;
|
|
2909
2906
|
}
|
|
2910
2907
|
let d = t(() => {
|
|
2911
2908
|
if (!s.visible || !s.hoveredPoint) return { display: "none" };
|
|
2912
|
-
let e = s.position.x +
|
|
2909
|
+
let e = s.position.x + Nr, t = s.position.x - Nr - Fr, n = s.containerWidth - Pr - e, r = s.position.x - Nr - Pr, i = Math.max(1, Math.min(Ir, s.containerWidth - Pr * 2)), a = e + Fr <= s.containerWidth - Pr ? {
|
|
2913
2910
|
left: `${e}px`,
|
|
2914
|
-
maxWidth: `${Math.min(
|
|
2915
|
-
} : t >=
|
|
2916
|
-
right: `${s.containerWidth - s.position.x +
|
|
2917
|
-
maxWidth: `${Math.min(
|
|
2911
|
+
maxWidth: `${Math.min(Ir, n)}px`
|
|
2912
|
+
} : t >= Pr ? {
|
|
2913
|
+
right: `${s.containerWidth - s.position.x + Nr}px`,
|
|
2914
|
+
maxWidth: `${Math.min(Ir, r)}px`
|
|
2918
2915
|
} : {
|
|
2919
|
-
left: `${
|
|
2916
|
+
left: `${Pr}px`,
|
|
2920
2917
|
maxWidth: `${i}px`
|
|
2921
2918
|
}, o = Number.parseFloat(a.maxWidth);
|
|
2922
2919
|
return {
|
|
@@ -2931,9 +2928,9 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2931
2928
|
}, [(g(!0), i(e, null, y(n.seriesPoints, (t) => (g(), i("span", {
|
|
2932
2929
|
key: `${t.trackIndex}-${t.name}`,
|
|
2933
2930
|
class: "waveform-tooltip__series waveform-chart__tooltip-series"
|
|
2934
|
-
}, [a("i", { style: p({ backgroundColor: t.color }) }, null, 4), a("span",
|
|
2931
|
+
}, [a("i", { style: p({ backgroundColor: t.color }) }, null, 4), a("span", kr, [a("span", Ar, [o(S(t.shotNo?.trim() || "未配置炮号") + ": " + S(t.name), 1), t.unit ? (g(), i(e, { key: 0 }, [o("(" + S(t.unit) + ")", 1)], 64)) : r("", !0)]), t.point ? (g(), i("span", jr, "(x:" + S(w(pt)(t.point.x, n.timeUnit)) + " y:" + S(w(st)(t.point.y)) + ")", 1)) : (g(), i("span", Mr, "无数据"))])]))), 128))], 4)) : r("", !0);
|
|
2935
2932
|
}
|
|
2936
|
-
}), [["__scopeId", "data-v-b9ed144d"]]),
|
|
2933
|
+
}), [["__scopeId", "data-v-b9ed144d"]]), Br = /* @__PURE__ */ c({
|
|
2937
2934
|
__name: "WaveformHoverHost",
|
|
2938
2935
|
props: {
|
|
2939
2936
|
state: {},
|
|
@@ -2944,7 +2941,7 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2944
2941
|
},
|
|
2945
2942
|
setup(e) {
|
|
2946
2943
|
let r = e, i = t(() => r.state.points.find((e) => e.point)?.point ?? null);
|
|
2947
|
-
return (t, r) => (g(), n(
|
|
2944
|
+
return (t, r) => (g(), n(zr, {
|
|
2948
2945
|
visible: e.visible && i.value !== null,
|
|
2949
2946
|
position: e.state.position,
|
|
2950
2947
|
"time-unit": e.timeUnit,
|
|
@@ -2962,16 +2959,16 @@ var lr = ["id"], ur = { class: "waveform-annotation-editor__content" }, dr = {
|
|
|
2962
2959
|
"container-height"
|
|
2963
2960
|
]));
|
|
2964
2961
|
}
|
|
2965
|
-
}),
|
|
2962
|
+
}), Vr = 13, Hr = 2, Ur = 14, Wr = 8, Gr = 24, Kr = {
|
|
2966
2963
|
circle: ee,
|
|
2967
2964
|
square: ne,
|
|
2968
2965
|
triangle: re,
|
|
2969
2966
|
diamond: te
|
|
2970
2967
|
};
|
|
2971
|
-
function
|
|
2972
|
-
return e === "none" ? null : U().type(
|
|
2968
|
+
function qr(e, t = 48) {
|
|
2969
|
+
return e === "none" ? null : U().type(Kr[e]).size(t)() ?? null;
|
|
2973
2970
|
}
|
|
2974
|
-
function
|
|
2971
|
+
function Jr(e, t, n = 48) {
|
|
2975
2972
|
if (e === "none" || t.length === 0) return null;
|
|
2976
2973
|
if (e === "circle") {
|
|
2977
2974
|
let e = Math.sqrt(n / Math.PI);
|
|
@@ -2988,24 +2985,24 @@ function qr(e, t, n = 48) {
|
|
|
2988
2985
|
let r = Math.sqrt(n / (2 * Math.tan(Math.PI / 6))), i = r * Math.tan(Math.PI / 6);
|
|
2989
2986
|
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("");
|
|
2990
2987
|
}
|
|
2991
|
-
function
|
|
2988
|
+
function Yr(e) {
|
|
2992
2989
|
return e === "none" ? null : "M1 8H25";
|
|
2993
2990
|
}
|
|
2994
|
-
function
|
|
2991
|
+
function Xr(e) {
|
|
2995
2992
|
if (e === "dashed") return "8 5";
|
|
2996
2993
|
if (e === "dash-dot") return "8 5 1.5 5";
|
|
2997
2994
|
}
|
|
2998
|
-
function
|
|
2999
|
-
let t = (Number.isFinite(e) && e > 0 ? Math.min(e,
|
|
2995
|
+
function Zr(e) {
|
|
2996
|
+
let t = (Number.isFinite(e) && e > 0 ? Math.min(e, Gr) : Wr) / 2, n = Vr - t, r = Vr + t;
|
|
3000
2997
|
return [
|
|
3001
|
-
`M${n} ${
|
|
3002
|
-
`M${
|
|
3003
|
-
`M${n} ${
|
|
2998
|
+
`M${n} ${Hr}H${r}`,
|
|
2999
|
+
`M${Vr} ${Hr}V${Ur}`,
|
|
3000
|
+
`M${n} ${Ur}H${r}`
|
|
3004
3001
|
].join("");
|
|
3005
3002
|
}
|
|
3006
3003
|
//#endregion
|
|
3007
3004
|
//#region src/components/rendering/WaveformSeriesLayer.vue?vue&type=script&setup=true&lang.ts
|
|
3008
|
-
var
|
|
3005
|
+
var Qr = ["clip-path"], $r = ["data-series-id", "data-series-name"], ei = [
|
|
3009
3006
|
"data-series-id",
|
|
3010
3007
|
"data-series-name",
|
|
3011
3008
|
"data-y-axis-index",
|
|
@@ -3014,11 +3011,11 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3014
3011
|
"d",
|
|
3015
3012
|
"stroke",
|
|
3016
3013
|
"stroke-dasharray"
|
|
3017
|
-
],
|
|
3014
|
+
], ti = ["data-series-id"], ni = [
|
|
3018
3015
|
"d",
|
|
3019
3016
|
"stroke",
|
|
3020
3017
|
"stroke-width"
|
|
3021
|
-
],
|
|
3018
|
+
], ri = ["data-series-id", "data-point-type"], ii = ["d", "fill"], ai = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
3022
3019
|
__name: "WaveformSeriesLayer",
|
|
3023
3020
|
props: {
|
|
3024
3021
|
track: {},
|
|
@@ -3026,11 +3023,11 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3026
3023
|
},
|
|
3027
3024
|
setup(n) {
|
|
3028
3025
|
let a = n, o = t(() => a.track.seriesPaths.map((e) => {
|
|
3029
|
-
let t =
|
|
3026
|
+
let t = Jr(e.series.pointType, e.pointRenderPoints.map((t) => ({
|
|
3030
3027
|
x: a.track.xScale(t.x),
|
|
3031
3028
|
y: e.yScale(t.y)
|
|
3032
3029
|
}))), n = e.series.errorBar.capWidth / 2, r = e.errorBarRenderPoints.map((t) => {
|
|
3033
|
-
let { lower: r, upper: i } =
|
|
3030
|
+
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);
|
|
3034
3031
|
return [
|
|
3035
3032
|
`M${o - n},${s}H${o + n}`,
|
|
3036
3033
|
`M${o},${s}V${c}`,
|
|
@@ -3063,8 +3060,8 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3063
3060
|
"data-line-style": e.series.lineStyle,
|
|
3064
3061
|
d: e.path,
|
|
3065
3062
|
stroke: e.series.color,
|
|
3066
|
-
"stroke-dasharray": w(
|
|
3067
|
-
}, null, 8,
|
|
3063
|
+
"stroke-dasharray": w(Xr)(e.series.lineStyle)
|
|
3064
|
+
}, null, 8, ei)) : r("", !0),
|
|
3068
3065
|
e.series.errorBar.visible ? (g(), i("g", {
|
|
3069
3066
|
key: 1,
|
|
3070
3067
|
class: "waveform-track__error-bars waveform-chart__error-bars",
|
|
@@ -3075,7 +3072,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3075
3072
|
d: e.errorBarPath,
|
|
3076
3073
|
stroke: e.series.errorBar.color || e.series.color,
|
|
3077
3074
|
"stroke-width": e.series.errorBar.width
|
|
3078
|
-
}, null, 8,
|
|
3075
|
+
}, null, 8, ni)) : r("", !0)], 8, ti)) : r("", !0),
|
|
3079
3076
|
e.series.pointType === "none" ? r("", !0) : (g(), i("g", {
|
|
3080
3077
|
key: 2,
|
|
3081
3078
|
class: "waveform-track__points waveform-chart__points",
|
|
@@ -3086,28 +3083,28 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3086
3083
|
class: "waveform-track__point waveform-chart__point",
|
|
3087
3084
|
d: e.pointPath,
|
|
3088
3085
|
fill: e.series.color
|
|
3089
|
-
}, null, 8,
|
|
3090
|
-
], 8,
|
|
3086
|
+
}, null, 8, ii)) : r("", !0)], 8, ri))
|
|
3087
|
+
], 8, $r))), 128))], 8, Qr)) : r("", !0);
|
|
3091
3088
|
}
|
|
3092
|
-
}), [["__scopeId", "data-v-42a3fd47"]]),
|
|
3089
|
+
}), [["__scopeId", "data-v-42a3fd47"]]), oi = ["transform"], si = ["transform"], ci = {
|
|
3093
3090
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--start waveform-chart__axis-endpoint waveform-chart__axis-endpoint--start",
|
|
3094
3091
|
x: "0",
|
|
3095
3092
|
y: "7",
|
|
3096
3093
|
dy: "0.71em",
|
|
3097
3094
|
"text-anchor": "start"
|
|
3098
|
-
},
|
|
3095
|
+
}, li = ["x"], ui = [
|
|
3099
3096
|
"data-y-axis-index",
|
|
3100
3097
|
"data-y-axis-side",
|
|
3101
3098
|
"transform"
|
|
3102
|
-
],
|
|
3099
|
+
], di = { key: 2 }, fi = [
|
|
3103
3100
|
"x",
|
|
3104
3101
|
"y",
|
|
3105
3102
|
"width"
|
|
3106
|
-
],
|
|
3103
|
+
], pi = ["fill", "transform"], mi = ["data-y-axis-title-index"], hi = [
|
|
3107
3104
|
"x",
|
|
3108
3105
|
"y",
|
|
3109
3106
|
"width"
|
|
3110
|
-
],
|
|
3107
|
+
], gi = ["fill", "transform"], _i = /* @__PURE__ */ c({
|
|
3111
3108
|
__name: "WaveformTrackAxes",
|
|
3112
3109
|
props: {
|
|
3113
3110
|
track: {},
|
|
@@ -3136,7 +3133,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3136
3133
|
if (n.track.yAxes.forEach((e, t) => {
|
|
3137
3134
|
let r = s.value[t];
|
|
3138
3135
|
if (!r) return;
|
|
3139
|
-
let [i, a] = e.scale.domain(), o = Math.max(...e.tickValues), c = e.seriesList[0]?.unit, l = (e.side === "left" ? M(e.scale) : N(e.scale)).tickFormat((e) =>
|
|
3136
|
+
let [i, a] = e.scale.domain(), o = Math.max(...e.tickValues), c = e.seriesList[0]?.unit, l = (e.side === "left" ? M(e.scale) : N(e.scale)).tickFormat((e) => ot(Number(e), {
|
|
3140
3137
|
axisMin: i,
|
|
3141
3138
|
axisMax: a,
|
|
3142
3139
|
topTickValue: o,
|
|
@@ -3145,7 +3142,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3145
3142
|
u.call(l), u.selectAll("path.domain").attr("display", n.axes?.y?.lineVisible === !1 ? "none" : null);
|
|
3146
3143
|
}), !o.value) return;
|
|
3147
3144
|
let e = H(o.value);
|
|
3148
|
-
e.call(j(n.track.xScale).tickValues(n.track.xAxisTickValues).tickFormat((e) =>
|
|
3145
|
+
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);
|
|
3149
3146
|
}
|
|
3150
3147
|
return h(async () => {
|
|
3151
3148
|
await d(), m();
|
|
@@ -3167,7 +3164,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3167
3164
|
ref: o,
|
|
3168
3165
|
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 }]),
|
|
3169
3166
|
transform: `translate(0, ${t.track.height})`
|
|
3170
|
-
}, null, 10,
|
|
3167
|
+
}, null, 10, oi)) : r("", !0),
|
|
3171
3168
|
t.track.showXAxis ? (g(), i("g", {
|
|
3172
3169
|
key: 1,
|
|
3173
3170
|
class: "waveform-track__axis-endpoints waveform-chart__axis-endpoints",
|
|
@@ -3175,13 +3172,13 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3175
3172
|
"font-family": "sans-serif",
|
|
3176
3173
|
"font-size": "10",
|
|
3177
3174
|
"aria-hidden": "true"
|
|
3178
|
-
}, [a("text",
|
|
3175
|
+
}, [a("text", ci, S(t.track.endpointLabels.start), 1), a("text", {
|
|
3179
3176
|
class: "waveform-track__axis-endpoint waveform-track__axis-endpoint--end waveform-chart__axis-endpoint waveform-chart__axis-endpoint--end",
|
|
3180
3177
|
x: t.track.width ?? t.innerWidth,
|
|
3181
3178
|
y: "7",
|
|
3182
3179
|
dy: "0.71em",
|
|
3183
3180
|
"text-anchor": "end"
|
|
3184
|
-
}, S(t.track.endpointLabels.end), 9,
|
|
3181
|
+
}, S(t.track.endpointLabels.end), 9, li)], 8, si)) : r("", !0),
|
|
3185
3182
|
(g(!0), i(e, null, y(t.track.isEmpty ? [] : t.track.yAxes, (e) => (g(), i("g", {
|
|
3186
3183
|
key: `y-axis-${t.track.index}-${e.index}`,
|
|
3187
3184
|
ref_for: !0,
|
|
@@ -3190,21 +3187,21 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3190
3187
|
"data-y-axis-index": e.index,
|
|
3191
3188
|
"data-y-axis-side": e.side,
|
|
3192
3189
|
transform: `translate(${e.x}, 0)`
|
|
3193
|
-
}, null, 10,
|
|
3194
|
-
!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",
|
|
3190
|
+
}, null, 10, ui))), 128)),
|
|
3191
|
+
!t.cleanView && !t.track.isEmpty && t.track.hasVisibleSeries && t.track.seriesList.length === 1 && t.track.showYAxisLabel && t.track.series && c(t.track.series) && p(t.track.height, t.track.index) ? (g(), i("g", di, [a("rect", {
|
|
3195
3192
|
class: "waveform-track__y-axis-label-bg waveform-chart__y-axis-label-bg",
|
|
3196
3193
|
x: t.track.yAxisLabelX - w(12) / 2,
|
|
3197
3194
|
y: t.track.height / 2 - 40,
|
|
3198
3195
|
width: w(12),
|
|
3199
3196
|
height: "80",
|
|
3200
3197
|
rx: "2"
|
|
3201
|
-
}, null, 8,
|
|
3198
|
+
}, null, 8, fi), a("text", {
|
|
3202
3199
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
3203
|
-
fill: t.track.series
|
|
3200
|
+
fill: t.track.series?.color,
|
|
3204
3201
|
transform: `translate(${t.track.yAxisLabelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
3205
3202
|
"text-anchor": "middle",
|
|
3206
3203
|
"dominant-baseline": "central"
|
|
3207
|
-
}, S(c(t.track.series)), 9,
|
|
3204
|
+
}, S(t.track.series ? c(t.track.series) : ""), 9, pi)])) : r("", !0),
|
|
3208
3205
|
(g(!0), i(e, null, y(!t.cleanView && t.track.yAxes.length > 1 ? t.track.yAxes.filter(l) : [], (e) => (g(), i("g", {
|
|
3209
3206
|
key: `y-axis-title-${t.track.index}-${e.index}`,
|
|
3210
3207
|
class: "waveform-track__multi-axis-title",
|
|
@@ -3216,40 +3213,40 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3216
3213
|
width: w(12),
|
|
3217
3214
|
height: "80",
|
|
3218
3215
|
rx: "2"
|
|
3219
|
-
}, null, 8,
|
|
3216
|
+
}, null, 8, hi), a("text", {
|
|
3220
3217
|
class: "waveform-track__y-axis-label waveform-chart__y-axis-label",
|
|
3221
3218
|
fill: e.seriesList[0].color,
|
|
3222
3219
|
transform: `translate(${e.labelX}, ${t.track.height / 2}) rotate(-90)`,
|
|
3223
3220
|
"text-anchor": "middle",
|
|
3224
3221
|
"dominant-baseline": "central"
|
|
3225
|
-
}, S(c(e.seriesList[0])), 9,
|
|
3222
|
+
}, S(c(e.seriesList[0])), 9, gi)], 8, mi))), 128))
|
|
3226
3223
|
], 64));
|
|
3227
3224
|
}
|
|
3228
|
-
}),
|
|
3225
|
+
}), vi = [
|
|
3229
3226
|
"width",
|
|
3230
3227
|
"height",
|
|
3231
3228
|
"fill"
|
|
3232
|
-
],
|
|
3229
|
+
], yi = ["clip-path"], bi = { class: "waveform-track__grid waveform-track__grid--minor waveform-chart__grid waveform-chart__grid--minor" }, xi = [
|
|
3233
3230
|
"stroke",
|
|
3234
3231
|
"x1",
|
|
3235
3232
|
"x2",
|
|
3236
3233
|
"y2"
|
|
3237
|
-
],
|
|
3234
|
+
], Si = [
|
|
3238
3235
|
"stroke",
|
|
3239
3236
|
"x2",
|
|
3240
3237
|
"y1",
|
|
3241
3238
|
"y2"
|
|
3242
|
-
],
|
|
3239
|
+
], Ci = { class: "waveform-track__grid waveform-track__grid--major waveform-chart__grid waveform-chart__grid--major" }, wi = [
|
|
3243
3240
|
"stroke",
|
|
3244
3241
|
"x1",
|
|
3245
3242
|
"x2",
|
|
3246
3243
|
"y2"
|
|
3247
|
-
],
|
|
3244
|
+
], Ti = [
|
|
3248
3245
|
"stroke",
|
|
3249
3246
|
"x2",
|
|
3250
3247
|
"y1",
|
|
3251
3248
|
"y2"
|
|
3252
|
-
],
|
|
3249
|
+
], Ei = ["clip-path"], Di = [
|
|
3253
3250
|
"data-y-axis-index",
|
|
3254
3251
|
"x2",
|
|
3255
3252
|
"y1",
|
|
@@ -3257,7 +3254,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3257
3254
|
"stroke",
|
|
3258
3255
|
"stroke-width",
|
|
3259
3256
|
"stroke-dasharray"
|
|
3260
|
-
],
|
|
3257
|
+
], Oi = ["x", "y"], ki = /* @__PURE__ */ c({
|
|
3261
3258
|
__name: "WaveformTrackBackdrop",
|
|
3262
3259
|
props: {
|
|
3263
3260
|
track: {},
|
|
@@ -3282,12 +3279,12 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3282
3279
|
height: t.track.height,
|
|
3283
3280
|
fill: t.frameStyle.backgroundColor,
|
|
3284
3281
|
"aria-hidden": "true"
|
|
3285
|
-
}, null, 8,
|
|
3282
|
+
}, null, 8, vi)) : r("", !0),
|
|
3286
3283
|
!t.track.isEmpty && t.track.hasVisibleSeries && !t.cleanView ? (g(), i("g", {
|
|
3287
3284
|
key: 1,
|
|
3288
3285
|
"clip-path": `url(#${t.clipPathId}-${t.track.index})`,
|
|
3289
3286
|
"aria-hidden": "true"
|
|
3290
|
-
}, [a("g",
|
|
3287
|
+
}, [a("g", bi, [t.track.gridLines.vertical ? (g(!0), i(e, { key: 0 }, y(t.track.xMinorTicks, (e) => (g(), i("line", {
|
|
3291
3288
|
key: `x-minor-${t.track.index}-${e}`,
|
|
3292
3289
|
"data-grid-direction": "vertical",
|
|
3293
3290
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -3295,7 +3292,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3295
3292
|
x2: t.track.xScale(e),
|
|
3296
3293
|
y1: "0",
|
|
3297
3294
|
y2: t.track.height
|
|
3298
|
-
}, null, 8,
|
|
3295
|
+
}, null, 8, xi))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMinorTicks, (e) => (g(), i("line", {
|
|
3299
3296
|
key: `y-minor-${t.track.index}-${e}`,
|
|
3300
3297
|
"data-grid-direction": "horizontal",
|
|
3301
3298
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -3303,7 +3300,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3303
3300
|
x2: t.track.width ?? t.innerWidth,
|
|
3304
3301
|
y1: t.track.yScale(e),
|
|
3305
3302
|
y2: t.track.yScale(e)
|
|
3306
|
-
}, null, 8,
|
|
3303
|
+
}, null, 8, Si))), 128)) : r("", !0)]), a("g", Ci, [t.track.gridLines.vertical ? (g(!0), i(e, { key: 0 }, y(t.track.xMajorTicks, (e) => (g(), i("line", {
|
|
3307
3304
|
key: `x-major-${t.track.index}-${e}`,
|
|
3308
3305
|
"data-grid-direction": "vertical",
|
|
3309
3306
|
stroke: t.track.gridLines.verticalColor,
|
|
@@ -3311,7 +3308,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3311
3308
|
x2: t.track.xScale(e),
|
|
3312
3309
|
y1: "0",
|
|
3313
3310
|
y2: t.track.height
|
|
3314
|
-
}, null, 8,
|
|
3311
|
+
}, null, 8, wi))), 128)) : r("", !0), t.track.gridLines.horizontal ? (g(!0), i(e, { key: 1 }, y(t.track.yMajorTicks, (e) => (g(), i("line", {
|
|
3315
3312
|
key: `y-major-${t.track.index}-${e}`,
|
|
3316
3313
|
"data-grid-direction": "horizontal",
|
|
3317
3314
|
stroke: t.track.gridLines.horizontalColor,
|
|
@@ -3319,7 +3316,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3319
3316
|
x2: t.track.width ?? t.innerWidth,
|
|
3320
3317
|
y1: t.track.yScale(e),
|
|
3321
3318
|
y2: t.track.yScale(e)
|
|
3322
|
-
}, null, 8,
|
|
3319
|
+
}, null, 8, Ti))), 128)) : r("", !0)])], 8, yi)) : r("", !0),
|
|
3323
3320
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.zeroLine.visible && !t.cleanView ? (g(), i("g", {
|
|
3324
3321
|
key: 2,
|
|
3325
3322
|
class: "waveform-track__zero-lines waveform-chart__zero-lines",
|
|
@@ -3336,7 +3333,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3336
3333
|
stroke: t.zeroLine.color,
|
|
3337
3334
|
"stroke-width": t.zeroLine.width,
|
|
3338
3335
|
"stroke-dasharray": t.zeroLine.dash || void 0
|
|
3339
|
-
}, null, 8,
|
|
3336
|
+
}, null, 8, Di))], 64))), 128))], 8, Ei)) : r("", !0),
|
|
3340
3337
|
!t.track.isEmpty && t.track.hasVisibleSeries && t.frameNumber !== void 0 && !t.cleanView ? (g(), i("text", {
|
|
3341
3338
|
key: 3,
|
|
3342
3339
|
class: "waveform-track__watermark waveform-chart__watermark",
|
|
@@ -3346,11 +3343,12 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3346
3343
|
"text-anchor": "middle",
|
|
3347
3344
|
"dominant-baseline": "central",
|
|
3348
3345
|
"aria-hidden": "true"
|
|
3349
|
-
}, S(t.frameNumber), 13,
|
|
3346
|
+
}, S(t.frameNumber), 13, Oi)) : r("", !0)
|
|
3350
3347
|
], 64));
|
|
3351
3348
|
}
|
|
3352
|
-
}),
|
|
3349
|
+
}), Ai = [
|
|
3353
3350
|
"data-track-index",
|
|
3351
|
+
"data-track-id",
|
|
3354
3352
|
"data-track-empty",
|
|
3355
3353
|
"data-track-left",
|
|
3356
3354
|
"data-track-width",
|
|
@@ -3358,19 +3356,19 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3358
3356
|
"data-track-top",
|
|
3359
3357
|
"data-track-height",
|
|
3360
3358
|
"transform"
|
|
3361
|
-
],
|
|
3359
|
+
], ji = [
|
|
3362
3360
|
"width",
|
|
3363
3361
|
"height",
|
|
3364
3362
|
"stroke",
|
|
3365
3363
|
"stroke-width",
|
|
3366
3364
|
"stroke-dasharray",
|
|
3367
3365
|
"stroke-linecap"
|
|
3368
|
-
],
|
|
3366
|
+
], Mi = [
|
|
3369
3367
|
"data-interactive",
|
|
3370
3368
|
"data-independent-overlay-index",
|
|
3371
3369
|
"width",
|
|
3372
3370
|
"height"
|
|
3373
|
-
],
|
|
3371
|
+
], Ni = ["x", "y"], Pi = /* @__PURE__ */ c({
|
|
3374
3372
|
__name: "WaveformTrack",
|
|
3375
3373
|
props: {
|
|
3376
3374
|
track: {},
|
|
@@ -3421,6 +3419,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3421
3419
|
return (t, n) => (g(), i("g", {
|
|
3422
3420
|
class: f(["waveform-track waveform-chart__track", { "waveform-track--empty waveform-chart__track--empty": e.track.isEmpty }]),
|
|
3423
3421
|
"data-track-index": e.track.index,
|
|
3422
|
+
"data-track-id": e.track.id,
|
|
3424
3423
|
"data-track-empty": e.track.isEmpty || void 0,
|
|
3425
3424
|
"data-track-left": e.track.left,
|
|
3426
3425
|
"data-track-width": e.track.width,
|
|
@@ -3429,7 +3428,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3429
3428
|
"data-track-height": e.track.height,
|
|
3430
3429
|
transform: `translate(${e.track.left ?? 0}, ${e.track.top})`
|
|
3431
3430
|
}, [
|
|
3432
|
-
s(
|
|
3431
|
+
s(ki, {
|
|
3433
3432
|
track: e.track,
|
|
3434
3433
|
"clip-path-id": e.clipPathId,
|
|
3435
3434
|
"inner-width": e.innerWidth,
|
|
@@ -3446,7 +3445,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3446
3445
|
"frame-style",
|
|
3447
3446
|
"zero-line"
|
|
3448
3447
|
]),
|
|
3449
|
-
s(
|
|
3448
|
+
s(_i, {
|
|
3450
3449
|
track: e.track,
|
|
3451
3450
|
"inner-width": e.innerWidth,
|
|
3452
3451
|
"clean-view": e.cleanView,
|
|
@@ -3472,8 +3471,8 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3472
3471
|
"stroke-dasharray": c.value.borderStyle === "dashed" ? "6 4" : c.value.borderStyle === "dotted" ? "1 3" : void 0,
|
|
3473
3472
|
"stroke-linecap": c.value.borderStyle === "dotted" ? "round" : void 0,
|
|
3474
3473
|
"aria-hidden": "true"
|
|
3475
|
-
}, null, 8,
|
|
3476
|
-
s(
|
|
3474
|
+
}, null, 8, ji)),
|
|
3475
|
+
s(ai, {
|
|
3477
3476
|
track: e.track,
|
|
3478
3477
|
"clip-path-id": e.clipPathId
|
|
3479
3478
|
}, null, 8, ["track", "clip-path-id"]),
|
|
@@ -3495,7 +3494,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3495
3494
|
onPointerleave: n[4] ||= (e) => o("pointer-leave"),
|
|
3496
3495
|
onClick: n[5] ||= (e) => o("click", e),
|
|
3497
3496
|
onContextmenu: n[6] ||= (e) => o("contextmenu", e)
|
|
3498
|
-
}, null, 42,
|
|
3497
|
+
}, null, 42, Mi)) : r("", !0),
|
|
3499
3498
|
!e.track.isEmpty && !e.track.hasVisibleSeries && !e.cleanView ? (g(), i("text", {
|
|
3500
3499
|
key: 2,
|
|
3501
3500
|
class: "waveform-track__no-visible-series",
|
|
@@ -3503,33 +3502,33 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3503
3502
|
y: e.track.height / 2,
|
|
3504
3503
|
"text-anchor": "middle",
|
|
3505
3504
|
"dominant-baseline": "central"
|
|
3506
|
-
}, " 暂无可见曲线 ", 8,
|
|
3507
|
-
], 10,
|
|
3505
|
+
}, " 暂无可见曲线 ", 8, Ni)) : r("", !0)
|
|
3506
|
+
], 10, Ai));
|
|
3508
3507
|
}
|
|
3509
|
-
}),
|
|
3508
|
+
}), Fi = [
|
|
3510
3509
|
"width",
|
|
3511
3510
|
"height",
|
|
3512
3511
|
"data-position",
|
|
3513
3512
|
"data-orientation"
|
|
3514
|
-
],
|
|
3513
|
+
], Ii = [
|
|
3515
3514
|
"disabled",
|
|
3516
3515
|
"aria-pressed",
|
|
3517
3516
|
"aria-label",
|
|
3518
3517
|
"onClick"
|
|
3519
|
-
],
|
|
3518
|
+
], Li = [
|
|
3520
3519
|
"data-line-type",
|
|
3521
3520
|
"data-line-style",
|
|
3522
3521
|
"data-point-type",
|
|
3523
3522
|
"data-error-bar-visible"
|
|
3524
|
-
],
|
|
3523
|
+
], Ri = [
|
|
3525
3524
|
"d",
|
|
3526
3525
|
"stroke",
|
|
3527
3526
|
"stroke-dasharray"
|
|
3528
|
-
],
|
|
3527
|
+
], zi = [
|
|
3529
3528
|
"d",
|
|
3530
3529
|
"stroke",
|
|
3531
3530
|
"stroke-width"
|
|
3532
|
-
],
|
|
3531
|
+
], Bi = ["d", "fill"], Vi = ["title"], Hi = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
3533
3532
|
__name: "WaveformLegend",
|
|
3534
3533
|
props: {
|
|
3535
3534
|
series: {},
|
|
@@ -3587,45 +3586,45 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3587
3586
|
"data-point-type": e.pointType,
|
|
3588
3587
|
"data-error-bar-visible": e.errorBar.visible || void 0
|
|
3589
3588
|
}, [
|
|
3590
|
-
w(
|
|
3589
|
+
w(Yr)(e.lineType) ? (g(), i("path", {
|
|
3591
3590
|
key: 0,
|
|
3592
3591
|
class: "waveform-legend__line",
|
|
3593
|
-
d: w(
|
|
3592
|
+
d: w(Yr)(e.lineType) ?? void 0,
|
|
3594
3593
|
stroke: e.color,
|
|
3595
|
-
"stroke-dasharray": w(
|
|
3594
|
+
"stroke-dasharray": w(Xr)(e.lineStyle),
|
|
3596
3595
|
"stroke-width": "1.5",
|
|
3597
3596
|
fill: "none"
|
|
3598
|
-
}, null, 8,
|
|
3597
|
+
}, null, 8, Ri)) : r("", !0),
|
|
3599
3598
|
e.errorBar.visible ? (g(), i("path", {
|
|
3600
3599
|
key: 1,
|
|
3601
3600
|
class: "waveform-legend__error-bar",
|
|
3602
|
-
d: w(
|
|
3601
|
+
d: w(Zr)(e.errorBar.capWidth),
|
|
3603
3602
|
stroke: e.errorBar.color || e.color,
|
|
3604
3603
|
"stroke-width": e.errorBar.width,
|
|
3605
3604
|
"stroke-linecap": "butt",
|
|
3606
3605
|
fill: "none"
|
|
3607
|
-
}, null, 8,
|
|
3606
|
+
}, null, 8, zi)) : r("", !0),
|
|
3608
3607
|
e.pointType === "none" ? r("", !0) : (g(), i("path", {
|
|
3609
3608
|
key: 2,
|
|
3610
3609
|
class: "waveform-legend__point",
|
|
3611
|
-
d: w(
|
|
3610
|
+
d: w(qr)(e.pointType, 30) ?? void 0,
|
|
3612
3611
|
fill: e.color,
|
|
3613
3612
|
transform: "translate(13 8)"
|
|
3614
|
-
}, null, 8,
|
|
3615
|
-
], 8,
|
|
3613
|
+
}, null, 8, Bi))
|
|
3614
|
+
], 8, Li)), a("span", {
|
|
3616
3615
|
class: "waveform-legend__label",
|
|
3617
3616
|
title: e.name
|
|
3618
|
-
}, S(e.name), 9,
|
|
3617
|
+
}, S(e.name), 9, Vi)], 10, Ii))), 128))], 6)], 2)], 8, Fi));
|
|
3619
3618
|
}
|
|
3620
|
-
}), [["__scopeId", "data-v-2ae12e71"]]),
|
|
3619
|
+
}), [["__scopeId", "data-v-2ae12e71"]]), Ui = {
|
|
3621
3620
|
class: "waveform-chart__hover-layer",
|
|
3622
3621
|
"pointer-events": "none",
|
|
3623
3622
|
"aria-hidden": "true"
|
|
3624
|
-
},
|
|
3623
|
+
}, Wi = ["clip-path", "transform"], Gi = [
|
|
3625
3624
|
"x1",
|
|
3626
3625
|
"x2",
|
|
3627
3626
|
"y2"
|
|
3628
|
-
],
|
|
3627
|
+
], Ki = /*#__PURE__*/ Fe(/* @__PURE__ */ c({
|
|
3629
3628
|
__name: "WaveformHoverLayer",
|
|
3630
3629
|
props: {
|
|
3631
3630
|
state: {},
|
|
@@ -3638,7 +3637,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3638
3637
|
track: e,
|
|
3639
3638
|
x: e.xScale(r.state.queryX)
|
|
3640
3639
|
}] : []));
|
|
3641
|
-
return (t, r) => (g(), i("g",
|
|
3640
|
+
return (t, r) => (g(), i("g", Ui, [(g(!0), i(e, null, y(o.value, (e) => (g(), i("g", {
|
|
3642
3641
|
key: e.track.index,
|
|
3643
3642
|
class: "waveform-track__crosshair waveform-chart__crosshair",
|
|
3644
3643
|
"clip-path": `url(#${n.clipPathId}-${e.track.index})`,
|
|
@@ -3648,9 +3647,9 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3648
3647
|
x2: e.x,
|
|
3649
3648
|
y1: "0",
|
|
3650
3649
|
y2: e.track.height
|
|
3651
|
-
}, null, 8,
|
|
3650
|
+
}, null, 8, Gi)], 8, Wi))), 128))]));
|
|
3652
3651
|
}
|
|
3653
|
-
}), [["__scopeId", "data-v-044318c2"]]),
|
|
3652
|
+
}), [["__scopeId", "data-v-044318c2"]]), qi = [
|
|
3654
3653
|
"data-display-mode",
|
|
3655
3654
|
"data-interaction-mode",
|
|
3656
3655
|
"data-presentation-mode",
|
|
@@ -3659,36 +3658,36 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3659
3658
|
"data-plot-margin-top",
|
|
3660
3659
|
"data-plot-margin-bottom",
|
|
3661
3660
|
"data-title-area-height"
|
|
3662
|
-
],
|
|
3661
|
+
], Ji = [
|
|
3663
3662
|
"role",
|
|
3664
3663
|
"aria-level",
|
|
3665
3664
|
"aria-hidden"
|
|
3666
|
-
],
|
|
3665
|
+
], Yi = ["data-title-scale", "data-title-wrapped"], Xi = [
|
|
3667
3666
|
"width",
|
|
3668
3667
|
"height",
|
|
3669
3668
|
"aria-label"
|
|
3670
|
-
],
|
|
3669
|
+
], Zi = ["id"], Qi = ["width", "height"], $i = ["transform"], ea = {
|
|
3671
3670
|
key: 0,
|
|
3672
3671
|
class: "waveform-chart__grid-slots",
|
|
3673
3672
|
"aria-hidden": "true"
|
|
3674
|
-
},
|
|
3673
|
+
}, ta = ["transform"], na = ["width", "height"], ra = ["width", "height"], ia = [
|
|
3675
3674
|
"x",
|
|
3676
3675
|
"y",
|
|
3677
3676
|
"width",
|
|
3678
3677
|
"height"
|
|
3679
|
-
],
|
|
3678
|
+
], aa = {
|
|
3680
3679
|
key: 4,
|
|
3681
3680
|
class: "waveform-chart__legend-layer"
|
|
3682
|
-
},
|
|
3681
|
+
}, oa = [
|
|
3683
3682
|
"data-legend-track-index",
|
|
3684
3683
|
"data-legend-track-id",
|
|
3685
3684
|
"transform"
|
|
3686
|
-
],
|
|
3685
|
+
], sa = ["x", "y"], ca = ["x", "y"], la = /* @__PURE__ */ c({
|
|
3687
3686
|
__name: "WaveformChartView",
|
|
3688
3687
|
props: { controller: {} },
|
|
3689
3688
|
setup(t) {
|
|
3690
|
-
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: re, beginSharedViewportDrag: ie, finishViewportDrag: W, cancelViewportDrag: G, handlePointerLeave: K, handleAnnotationClick: q, 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:
|
|
3691
|
-
function
|
|
3689
|
+
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: re, beginSharedViewportDrag: ie, finishViewportDrag: W, cancelViewportDrag: G, handlePointerLeave: K, handleAnnotationClick: q, 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);
|
|
3690
|
+
function Qe() {
|
|
3692
3691
|
x.value = !1, K.value();
|
|
3693
3692
|
}
|
|
3694
3693
|
return (t, C) => (g(), i("div", {
|
|
@@ -3712,7 +3711,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3712
3711
|
"data-plot-margin-bottom": w(b).bottom,
|
|
3713
3712
|
"data-title-area-height": w(v),
|
|
3714
3713
|
onPointerenter: C[8] ||= (e) => x.value = !0,
|
|
3715
|
-
onPointerleave:
|
|
3714
|
+
onPointerleave: Qe,
|
|
3716
3715
|
onContextmenuCapture: C[9] ||= (...e) => w(T) && w(T)(...e)
|
|
3717
3716
|
}, [
|
|
3718
3717
|
w(E) ? (g(), i("div", {
|
|
@@ -3723,7 +3722,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3723
3722
|
"aria-level": w(O) ? 2 : void 0,
|
|
3724
3723
|
"aria-hidden": w(l) || void 0
|
|
3725
3724
|
}, [a("span", {
|
|
3726
|
-
ref: w(
|
|
3725
|
+
ref: w(Xe),
|
|
3727
3726
|
class: "waveform-chart__title-measure",
|
|
3728
3727
|
style: p(w(k)),
|
|
3729
3728
|
"aria-hidden": "true"
|
|
@@ -3736,9 +3735,9 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3736
3735
|
style: p(w(M)),
|
|
3737
3736
|
"data-title-scale": w(N).scale,
|
|
3738
3737
|
"data-title-wrapped": w(N).wrapped || void 0
|
|
3739
|
-
}, S(w(A)), 13,
|
|
3738
|
+
}, S(w(A)), 13, Yi)], 4)) : r("", !0)], 12, Ji)) : r("", !0),
|
|
3740
3739
|
(g(), i("svg", {
|
|
3741
|
-
ref: w(
|
|
3740
|
+
ref: w($),
|
|
3742
3741
|
class: "waveform-chart__svg",
|
|
3743
3742
|
width: w(P),
|
|
3744
3743
|
height: w(F),
|
|
@@ -3753,9 +3752,9 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3753
3752
|
}, [a("rect", {
|
|
3754
3753
|
width: e.width,
|
|
3755
3754
|
height: e.height
|
|
3756
|
-
}, null, 8,
|
|
3755
|
+
}, null, 8, Qi)], 8, Zi))), 128))]),
|
|
3757
3756
|
a("g", { transform: `translate(${w(_)}, ${w(B)})` }, [
|
|
3758
|
-
w(o) !== "compact" && !w(l) ? (g(), i("g",
|
|
3757
|
+
w(o) !== "compact" && !w(l) ? (g(), i("g", ea, [(g(!0), i(e, null, y(w(V), (e) => (g(), i("g", {
|
|
3759
3758
|
key: `grid-slot-${e.slotIndex}`,
|
|
3760
3759
|
transform: `translate(${e.left}, ${e.top})`
|
|
3761
3760
|
}, [e.series ? r("", !0) : (g(), i("rect", {
|
|
@@ -3763,10 +3762,10 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3763
3762
|
class: "waveform-chart__grid-slot-placeholder",
|
|
3764
3763
|
width: e.width,
|
|
3765
3764
|
height: e.cellHeight
|
|
3766
|
-
}, null, 8,
|
|
3765
|
+
}, null, 8, na))], 8, ta))), 128))])) : r("", !0),
|
|
3767
3766
|
w(o) !== "independent" && w(R).length && w(H) ? (g(), i("rect", {
|
|
3768
3767
|
key: 1,
|
|
3769
|
-
ref: w(
|
|
3768
|
+
ref: w(Ze),
|
|
3770
3769
|
class: f(["waveform-chart__overlay waveform-chart__overlay--shared", {
|
|
3771
3770
|
"is-zoomable": !w(u) && w(U) && w(ee),
|
|
3772
3771
|
"is-annotating": !w(u) && w(c) === "annotation"
|
|
@@ -3780,9 +3779,9 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3780
3779
|
onPointerleave: C[4] ||= (...e) => w(K) && w(K)(...e),
|
|
3781
3780
|
onClick: C[5] ||= (...e) => w(q) && w(q)(...e),
|
|
3782
3781
|
onContextmenu: C[6] ||= (...e) => w(J) && w(J)(...e)
|
|
3783
|
-
}, null, 42,
|
|
3784
|
-
(g(!0), i(e, null, y(w(R), (e) => (g(), n(w(
|
|
3785
|
-
key: `${e.index}-${e.
|
|
3782
|
+
}, null, 42, ra)) : r("", !0),
|
|
3783
|
+
(g(!0), i(e, null, y(w(R), (e) => (g(), n(w(Pi), {
|
|
3784
|
+
key: `${e.index}-${e.id}`,
|
|
3786
3785
|
track: e,
|
|
3787
3786
|
"clip-path-id": w(z),
|
|
3788
3787
|
"inner-width": w(te),
|
|
@@ -3827,7 +3826,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3827
3826
|
"onClick",
|
|
3828
3827
|
"onContextmenu"
|
|
3829
3828
|
]))), 128)),
|
|
3830
|
-
s(w(
|
|
3829
|
+
s(w(Ki), {
|
|
3831
3830
|
state: w(me),
|
|
3832
3831
|
tracks: w(R),
|
|
3833
3832
|
"clip-path-id": w(z),
|
|
@@ -3846,7 +3845,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3846
3845
|
width: w(ge).width,
|
|
3847
3846
|
height: w(ge).height,
|
|
3848
3847
|
"aria-hidden": "true"
|
|
3849
|
-
}, null, 8,
|
|
3848
|
+
}, null, 8, ia)) : r("", !0),
|
|
3850
3849
|
w(l) ? r("", !0) : (g(), n(w(Ie), {
|
|
3851
3850
|
key: 3,
|
|
3852
3851
|
annotations: w(Y),
|
|
@@ -3865,13 +3864,13 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3865
3864
|
"onMove",
|
|
3866
3865
|
"onDragEnd"
|
|
3867
3866
|
])),
|
|
3868
|
-
w(l) ? r("", !0) : (g(), i("g",
|
|
3869
|
-
key: `legend-${e.index}-${e.
|
|
3867
|
+
w(l) ? r("", !0) : (g(), i("g", aa, [(g(!0), i(e, null, y(w(R), (e) => (g(), i("g", {
|
|
3868
|
+
key: `legend-${e.index}-${e.id}`,
|
|
3870
3869
|
class: "waveform-chart__legend-track",
|
|
3871
3870
|
"data-legend-track-index": e.index,
|
|
3872
3871
|
"data-legend-track-id": e.id,
|
|
3873
3872
|
transform: `translate(${e.left}, ${e.top})`
|
|
3874
|
-
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(
|
|
3873
|
+
}, [!e.isEmpty && e.legendSeries.length > 1 ? (g(), n(w(Hi), {
|
|
3875
3874
|
key: 0,
|
|
3876
3875
|
series: e.legendSeries,
|
|
3877
3876
|
position: w(X)(e.id),
|
|
@@ -3892,23 +3891,23 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3892
3891
|
"width",
|
|
3893
3892
|
"height",
|
|
3894
3893
|
"onToggle"
|
|
3895
|
-
])) : r("", !0)], 8,
|
|
3896
|
-
], 8,
|
|
3894
|
+
])) : r("", !0)], 8, oa))), 128))]))
|
|
3895
|
+
], 8, $i),
|
|
3897
3896
|
w(Ee) && !w(l) ? (g(), i("text", {
|
|
3898
3897
|
key: 0,
|
|
3899
3898
|
class: "waveform-chart__label waveform-chart__x-label",
|
|
3900
3899
|
x: w(_) + w(te) / 2,
|
|
3901
3900
|
y: w(De),
|
|
3902
3901
|
"text-anchor": "middle"
|
|
3903
|
-
}, S(w(Ee)), 9,
|
|
3902
|
+
}, S(w(Ee)), 9, sa)) : r("", !0),
|
|
3904
3903
|
w(Oe) && !w(I) ? (g(), i("text", {
|
|
3905
3904
|
key: 1,
|
|
3906
3905
|
class: "waveform-chart__empty",
|
|
3907
3906
|
x: w(P) / 2,
|
|
3908
3907
|
y: w(F) / 2,
|
|
3909
3908
|
"text-anchor": "middle"
|
|
3910
|
-
}, " 暂无有效波形数据 ", 8,
|
|
3911
|
-
], 40,
|
|
3909
|
+
}, " 暂无有效波形数据 ", 8, ca)) : r("", !0)
|
|
3910
|
+
], 40, Xi)),
|
|
3912
3911
|
w(ke).showPagination && w(Ae) > 1 && !w(l) ? (g(), n(w(ae), {
|
|
3913
3912
|
key: 1,
|
|
3914
3913
|
class: "waveform-chart__pagination",
|
|
@@ -3925,7 +3924,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3925
3924
|
"total",
|
|
3926
3925
|
"onChange"
|
|
3927
3926
|
])) : r("", !0),
|
|
3928
|
-
w(Re) && !w(l) && !w(u) ? (g(), n(
|
|
3927
|
+
w(Re) && !w(l) && !w(u) ? (g(), n(Or, {
|
|
3929
3928
|
key: 2,
|
|
3930
3929
|
annotation: w(Re).annotation,
|
|
3931
3930
|
mode: w(Re).mode,
|
|
@@ -3967,7 +3966,7 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3967
3966
|
"onDelete",
|
|
3968
3967
|
"onClose"
|
|
3969
3968
|
])) : r("", !0),
|
|
3970
|
-
s(w(
|
|
3969
|
+
s(w(Br), {
|
|
3971
3970
|
state: w(me),
|
|
3972
3971
|
visible: w(he) && !w(u),
|
|
3973
3972
|
"time-unit": w(ue),
|
|
@@ -3980,9 +3979,9 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
3980
3979
|
"container-width",
|
|
3981
3980
|
"container-height"
|
|
3982
3981
|
])
|
|
3983
|
-
], 46,
|
|
3982
|
+
], 46, qi));
|
|
3984
3983
|
}
|
|
3985
|
-
}),
|
|
3984
|
+
}), ua = /* @__PURE__ */ c({
|
|
3986
3985
|
__name: "WaveformChart",
|
|
3987
3986
|
props: {
|
|
3988
3987
|
data: {},
|
|
@@ -4060,12 +4059,12 @@ var Zr = ["clip-path"], Qr = ["data-series-id", "data-series-name"], $r = [
|
|
|
4060
4059
|
"page-change"
|
|
4061
4060
|
],
|
|
4062
4061
|
setup(e, { expose: t, emit: r }) {
|
|
4063
|
-
let i =
|
|
4062
|
+
let i = lr(e, r);
|
|
4064
4063
|
return t({
|
|
4065
4064
|
resetViewport: i.resetViewport,
|
|
4066
4065
|
setViewportDomain: i.setViewportDomain
|
|
4067
|
-
}), (e, t) => (g(), n(
|
|
4066
|
+
}), (e, t) => (g(), n(la, { controller: w(i) }, null, 8, ["controller"]));
|
|
4068
4067
|
}
|
|
4069
4068
|
});
|
|
4070
4069
|
//#endregion
|
|
4071
|
-
export {
|
|
4070
|
+
export { Ht as DEFAULT_WAVEFORM_RENDERING_OPTIONS, ua 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 };
|