@synnaxlabs/pluto 0.21.7 → 0.21.9
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/dist/{Center-hbwH7rg9.js → Center-BK9Rcaa0.js} +2 -2
- package/dist/{Center-hbwH7rg9.js.map → Center-BK9Rcaa0.js.map} +1 -1
- package/dist/{Center-5NJ61qfA.cjs → Center-Cc_rR5pQ.cjs} +2 -2
- package/dist/{Center-5NJ61qfA.cjs.map → Center-Cc_rR5pQ.cjs.map} +1 -1
- package/dist/{Keyboard-DaFraUsQ.cjs → Keyboard-Byx8rGZt.cjs} +3 -3
- package/dist/{Keyboard-DaFraUsQ.cjs.map → Keyboard-Byx8rGZt.cjs.map} +1 -1
- package/dist/{Keyboard-nDIAR7Rj.js → Keyboard-D31SwhYT.js} +3 -3
- package/dist/{Keyboard-nDIAR7Rj.js.map → Keyboard-D31SwhYT.js.map} +1 -1
- package/dist/{LinePlot-BZDm4uxJ.cjs → LinePlot-Bnb8Ufob.cjs} +96 -65
- package/dist/LinePlot-Bnb8Ufob.cjs.map +1 -0
- package/dist/{LinePlot-tOiSUMjC.js → LinePlot-KYwy1D7H.js} +281 -250
- package/dist/LinePlot-KYwy1D7H.js.map +1 -0
- package/dist/{Link-BdWFvK8v.cjs → Link-Bq38h1dw.cjs} +2 -2
- package/dist/{Link-BdWFvK8v.cjs.map → Link-Bq38h1dw.cjs.map} +1 -1
- package/dist/{Link-d3CXVSaO.js → Link-DQKdkwWL.js} +2 -2
- package/dist/{Link-d3CXVSaO.js.map → Link-DQKdkwWL.js.map} +1 -1
- package/dist/{List-DcsWFiLT.js → List-BmP_se57.js} +3 -3
- package/dist/{List-DcsWFiLT.js.map → List-BmP_se57.js.map} +1 -1
- package/dist/{List-PlMTfEHi.cjs → List-BnB-C5vQ.cjs} +3 -3
- package/dist/{List-PlMTfEHi.cjs.map → List-BnB-C5vQ.cjs.map} +1 -1
- package/dist/{Toggle-C6Z8WPT3.cjs → Toggle-D3iCEbO1.cjs} +46 -46
- package/dist/{Toggle-C6Z8WPT3.cjs.map → Toggle-D3iCEbO1.cjs.map} +1 -1
- package/dist/{Toggle-DGLgYCOX.js → Toggle-bT5RpwfA.js} +399 -399
- package/dist/{Toggle-DGLgYCOX.js.map → Toggle-bT5RpwfA.js.map} +1 -1
- package/dist/Video-B4sma9fk.cjs +14 -0
- package/dist/Video-B4sma9fk.cjs.map +1 -0
- package/dist/Video-Cp6XjjOK.js +15 -0
- package/dist/Video-Cp6XjjOK.js.map +1 -0
- package/dist/{aggregator-BgImZc4o.js → aggregator-B8fg7W2s.js} +106 -106
- package/dist/aggregator-B8fg7W2s.js.map +1 -0
- package/dist/{aggregator-BpfMBUD1.cjs → aggregator-Bh2Kyzkg.cjs} +100 -100
- package/dist/aggregator-Bh2Kyzkg.cjs.map +1 -0
- package/dist/align.cjs +1 -1
- package/dist/align.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/{color-DV-YGUvp.js → color-CjdRh-aN.js} +2 -2
- package/dist/{color-DV-YGUvp.js.map → color-CjdRh-aN.js.map} +1 -1
- package/dist/{color-BVVyrgRF.cjs → color-DBNbbjJy.cjs} +2 -2
- package/dist/{color-BVVyrgRF.cjs.map → color-DBNbbjJy.cjs.map} +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/{css-Pf9qxhQ4.cjs → css-Ci8WUD5E.cjs} +112 -108
- package/dist/css-Ci8WUD5E.cjs.map +1 -0
- package/dist/{css-DoalWJF6.js → css-DKKmdhSr.js} +114 -110
- package/dist/css-DKKmdhSr.js.map +1 -0
- package/dist/css.cjs +2 -2
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +3 -3
- package/dist/ether.js +5 -5
- package/dist/{external-Cu6T11fi.cjs → external-9_cqFQy3.cjs} +6 -6
- package/dist/{external-Cu6T11fi.cjs.map → external-9_cqFQy3.cjs.map} +1 -1
- package/dist/{external-Blx0rtt2.cjs → external-B-zN2e5z.cjs} +6 -6
- package/dist/{external-Blx0rtt2.cjs.map → external-B-zN2e5z.cjs.map} +1 -1
- package/dist/{external-DeheWVb-.js → external-BM82B8W2.js} +6 -6
- package/dist/{external-DeheWVb-.js.map → external-BM82B8W2.js.map} +1 -1
- package/dist/{external-96EinZfY.js → external-BYqTC99W.js} +3 -3
- package/dist/external-BYqTC99W.js.map +1 -0
- package/dist/{external-5przQjJD.js → external-BfZYUV3z.js} +11 -11
- package/dist/{external-5przQjJD.js.map → external-BfZYUV3z.js.map} +1 -1
- package/dist/{external-SxB9IH0p.js → external-BpqCp_M1.js} +2 -2
- package/dist/external-BpqCp_M1.js.map +1 -0
- package/dist/{external-C6GmnG49.js → external-BrW40HJx.js} +6 -6
- package/dist/{external-C6GmnG49.js.map → external-BrW40HJx.js.map} +1 -1
- package/dist/{external-1osPryUV.js → external-CAOQcoqL.js} +5 -5
- package/dist/{external-1osPryUV.js.map → external-CAOQcoqL.js.map} +1 -1
- package/dist/{external-D8dWmF4U.cjs → external-CIVsFXOp.cjs} +2 -2
- package/dist/external-CIVsFXOp.cjs.map +1 -0
- package/dist/{external-BAdU6u03.js → external-CnNdgPsB.js} +5 -5
- package/dist/{external-BAdU6u03.js.map → external-CnNdgPsB.js.map} +1 -1
- package/dist/{external-DiFhWWS-.js → external-CwjCCHPi.js} +7 -7
- package/dist/{external-DiFhWWS-.js.map → external-CwjCCHPi.js.map} +1 -1
- package/dist/{external-DarqsFzT.js → external-DNHMAfGi.js} +5 -5
- package/dist/{external-DarqsFzT.js.map → external-DNHMAfGi.js.map} +1 -1
- package/dist/{external-0PM7JrzG.cjs → external-DVQ2SRoH.cjs} +5 -5
- package/dist/{external-0PM7JrzG.cjs.map → external-DVQ2SRoH.cjs.map} +1 -1
- package/dist/{external-16K8slq8.cjs → external-D_yXh8rn.cjs} +11 -11
- package/dist/{external-16K8slq8.cjs.map → external-D_yXh8rn.cjs.map} +1 -1
- package/dist/{external-CPx8XA9-.cjs → external-Df0D1YYb.cjs} +7 -7
- package/dist/{external-CPx8XA9-.cjs.map → external-Df0D1YYb.cjs.map} +1 -1
- package/dist/{external-DvGqQHd8.cjs → external-DhPBdJpR.cjs} +3 -3
- package/dist/external-DhPBdJpR.cjs.map +1 -0
- package/dist/{external-D7XrxOVE.cjs → external-DhiN6pEk.cjs} +4 -4
- package/dist/{external-D7XrxOVE.cjs.map → external-DhiN6pEk.cjs.map} +1 -1
- package/dist/{external-CsO29OsF.cjs → external-DjYXzP7v.cjs} +7 -7
- package/dist/{external-CsO29OsF.cjs.map → external-DjYXzP7v.cjs.map} +1 -1
- package/dist/{external-B3ly2-jy.js → external-FWIwgLzc.js} +7 -7
- package/dist/{external-B3ly2-jy.js.map → external-FWIwgLzc.js.map} +1 -1
- package/dist/{external-B0z7uXZV.cjs → external-Iv2mRce8.cjs} +5 -5
- package/dist/{external-B0z7uXZV.cjs.map → external-Iv2mRce8.cjs.map} +1 -1
- package/dist/{external-CzJYG1hX.cjs → external-P6zP6dBA.cjs} +3 -3
- package/dist/external-P6zP6dBA.cjs.map +1 -0
- package/dist/{external-D4ur_D1S.cjs → external-d-vI8EHK.cjs} +5 -5
- package/dist/{external-D4ur_D1S.cjs.map → external-d-vI8EHK.cjs.map} +1 -1
- package/dist/{external-DQkw1ko0.js → external-giUMrk8w.js} +4 -4
- package/dist/{external-DQkw1ko0.js.map → external-giUMrk8w.js.map} +1 -1
- package/dist/{external-CgMwmBnF.js → external-zG96smqq.js} +3 -3
- package/dist/external-zG96smqq.js.map +1 -0
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +30 -30
- package/dist/index.js +55 -55
- package/dist/index.js.map +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/telem/client/cache/cache.d.ts +3 -8
- package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
- package/dist/src/telem/client/cache/dynamic.d.ts +13 -3
- package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
- package/dist/src/telem/client/client.d.ts +1 -1
- package/dist/src/video/Video.d.ts +2 -2
- package/dist/src/video/Video.d.ts.map +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/theming.cjs +2 -2
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +1 -1
- package/dist/LinePlot-BZDm4uxJ.cjs.map +0 -1
- package/dist/LinePlot-tOiSUMjC.js.map +0 -1
- package/dist/Video-B1oW8NLd.js +0 -11
- package/dist/Video-B1oW8NLd.js.map +0 -1
- package/dist/Video-BGNx94bQ.cjs +0 -10
- package/dist/Video-BGNx94bQ.cjs.map +0 -1
- package/dist/aggregator-BgImZc4o.js.map +0 -1
- package/dist/aggregator-BpfMBUD1.cjs.map +0 -1
- package/dist/css-DoalWJF6.js.map +0 -1
- package/dist/css-Pf9qxhQ4.cjs.map +0 -1
- package/dist/external-96EinZfY.js.map +0 -1
- package/dist/external-CgMwmBnF.js.map +0 -1
- package/dist/external-CzJYG1hX.cjs.map +0 -1
- package/dist/external-D8dWmF4U.cjs.map +0 -1
- package/dist/external-DvGqQHd8.cjs.map +0 -1
- package/dist/external-SxB9IH0p.js.map +0 -1
|
@@ -5,9 +5,9 @@ var __publicField = (obj, key, value2) => {
|
|
|
5
5
|
return value2;
|
|
6
6
|
};
|
|
7
7
|
var _a, _b2, _c, _d, _e;
|
|
8
|
-
import { Q as fe, _,
|
|
8
|
+
import { Q as fe, _, m, U, w, q as A$1, x as g, T as ft, M as q, N, v as variantZ, W as g$1, Y as Composite, Z as bb, y as _b, $ as Ae, a0 as C$1, X, E as is, a1 as Mutex, a2 as o$1, c as S, a3 as nanoid, a4 as Ue, a5 as Leaf, n as w$1, a6 as prettyParse, k as dimensions, u as use$1, f as fontString, a7 as r, A as A$2, D as dk, z as n$1, a8 as j_, a9 as gs, aa as useAggregate, ab as J$1, ac as D_, ad as Se, o as specZ$1, ae as getDefaultExportFromCjs, af as useOptionalAggregate, l as levelZ, ag as nk } from "./aggregator-B8fg7W2s.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
|
-
import { u, l as d$1, D, A, Z as ZERO, L, T as To,
|
|
10
|
+
import { u, l as d$1, D, A, Z as ZERO, j as C, L, T as To, h as k, q as q$1, _ as _$1, C as CSS, a as Color$1, J, d as f, Y } from "./css-DKKmdhSr.js";
|
|
11
11
|
import React__default, { createContext, memo, useMemo, forwardRef, useEffect, useRef, useContext, useState, useCallback } from "react";
|
|
12
12
|
import "react-dom";
|
|
13
13
|
const a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -354,7 +354,7 @@ class StatusSource extends Noop {
|
|
|
354
354
|
key: "noop",
|
|
355
355
|
variant: "disabled",
|
|
356
356
|
message: "unknown",
|
|
357
|
-
time:
|
|
357
|
+
time: m.now()
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
}
|
|
@@ -624,11 +624,11 @@ class ChannelData extends AbstractSource {
|
|
|
624
624
|
async value() {
|
|
625
625
|
const { timeRange, channel, useIndexOfChannel: indexOfChannel } = this.props;
|
|
626
626
|
if (timeRange.isZero || channel === 0)
|
|
627
|
-
return [
|
|
627
|
+
return [C.ZERO, []];
|
|
628
628
|
const chan = await fetchChannelProperties(this.client, channel, indexOfChannel);
|
|
629
629
|
if (!this.valid)
|
|
630
630
|
await this.readFixed(chan.key);
|
|
631
|
-
let b =
|
|
631
|
+
let b = C.max(this.data.map((d2) => d2.bounds));
|
|
632
632
|
if (chan.dataType.equals(g.TIMESTAMP))
|
|
633
633
|
b = {
|
|
634
634
|
upper: Math.min(b.upper, Number(this.props.timeRange.end.valueOf())),
|
|
@@ -648,8 +648,8 @@ __publicField(ChannelData, "TYPE", "series-source");
|
|
|
648
648
|
const streamChannelDataPropsZ = z.object({
|
|
649
649
|
channel: z.number().or(z.string()),
|
|
650
650
|
useIndexOfChannel: z.boolean().optional().default(false),
|
|
651
|
-
timeSpan:
|
|
652
|
-
keepFor:
|
|
651
|
+
timeSpan: w.z,
|
|
652
|
+
keepFor: w.z.optional()
|
|
653
653
|
});
|
|
654
654
|
class StreamChannelData extends AbstractSource {
|
|
655
655
|
constructor(client, props) {
|
|
@@ -664,12 +664,12 @@ class StreamChannelData extends AbstractSource {
|
|
|
664
664
|
async value() {
|
|
665
665
|
const { channel, useIndexOfChannel, timeSpan } = this.props;
|
|
666
666
|
if (channel === 0)
|
|
667
|
-
return [
|
|
668
|
-
const now2 =
|
|
667
|
+
return [C.ZERO, []];
|
|
668
|
+
const now2 = m.now();
|
|
669
669
|
const ch = await fetchChannelProperties(this.client, channel, useIndexOfChannel);
|
|
670
670
|
if (!this.valid)
|
|
671
671
|
await this.read(ch.key);
|
|
672
|
-
let b =
|
|
672
|
+
let b = C.max(
|
|
673
673
|
this.data.filter((d2) => d2.timeRange.end.after(now2.sub(timeSpan))).map((d2) => d2.bounds)
|
|
674
674
|
);
|
|
675
675
|
if (ch.dataType.equals(g.TIMESTAMP))
|
|
@@ -680,7 +680,7 @@ class StreamChannelData extends AbstractSource {
|
|
|
680
680
|
return [b, this.data];
|
|
681
681
|
}
|
|
682
682
|
async read(key) {
|
|
683
|
-
const tr =
|
|
683
|
+
const tr = m.now().spanRange(-this.props.timeSpan);
|
|
684
684
|
const res = await this.client.read(tr, [key]);
|
|
685
685
|
const newData = res[key].data;
|
|
686
686
|
newData.forEach((d2) => d2.acquire());
|
|
@@ -701,7 +701,7 @@ class StreamChannelData extends AbstractSource {
|
|
|
701
701
|
this.stopStreaming = await this.client.stream(handler, [key]);
|
|
702
702
|
}
|
|
703
703
|
gcOutOfRangeData() {
|
|
704
|
-
const threshold =
|
|
704
|
+
const threshold = m.now().sub(this.props.keepFor ?? this.props.timeSpan);
|
|
705
705
|
const toGC = this.data.findIndex((d2) => d2.timeRange.end.before(threshold));
|
|
706
706
|
if (toGC === -1)
|
|
707
707
|
return;
|
|
@@ -790,7 +790,7 @@ class FixedSeries extends AbstractSource {
|
|
|
790
790
|
);
|
|
791
791
|
}
|
|
792
792
|
async value() {
|
|
793
|
-
const b =
|
|
793
|
+
const b = C.max(this.data.map((x) => x.bounds));
|
|
794
794
|
return [b, this.data];
|
|
795
795
|
}
|
|
796
796
|
}
|
|
@@ -831,7 +831,7 @@ class IterativeSeries extends AbstractSource {
|
|
|
831
831
|
};
|
|
832
832
|
return [b2, d2];
|
|
833
833
|
}
|
|
834
|
-
const b =
|
|
834
|
+
const b = C.max(d2.map((x) => x.bounds));
|
|
835
835
|
return [b, d2];
|
|
836
836
|
}
|
|
837
837
|
start(rate) {
|
|
@@ -939,7 +939,7 @@ const _SetPoint = class _SetPoint extends UnarySinkTransformer {
|
|
|
939
939
|
__publicField(_SetPoint, "TYPE", "boolean-numeric-converter-sink");
|
|
940
940
|
__publicField(_SetPoint, "propsZ", setpointProps);
|
|
941
941
|
let SetPoint = _SetPoint;
|
|
942
|
-
const withinBoundsProps = z.object({ trueBound:
|
|
942
|
+
const withinBoundsProps = z.object({ trueBound: C.bounds });
|
|
943
943
|
const withinBounds = (props) => ({
|
|
944
944
|
props,
|
|
945
945
|
type: WithinBounds.TYPE,
|
|
@@ -953,12 +953,12 @@ const _WithinBounds = class _WithinBounds extends UnarySourceTransformer {
|
|
|
953
953
|
__publicField(this, "curr", null);
|
|
954
954
|
}
|
|
955
955
|
shouldNotify(value2) {
|
|
956
|
-
const shouldNotify =
|
|
957
|
-
this.curr =
|
|
956
|
+
const shouldNotify = C.contains(this.props.trueBound, value2) !== this.curr;
|
|
957
|
+
this.curr = C.contains(this.props.trueBound, value2);
|
|
958
958
|
return shouldNotify;
|
|
959
959
|
}
|
|
960
960
|
transform(value2) {
|
|
961
|
-
this.curr =
|
|
961
|
+
this.curr = C.contains(this.props.trueBound, value2);
|
|
962
962
|
return this.curr;
|
|
963
963
|
}
|
|
964
964
|
};
|
|
@@ -1207,11 +1207,11 @@ const convertSeriesFloat32 = (series, offset) => {
|
|
|
1207
1207
|
};
|
|
1208
1208
|
const zeroCacheGCMetrics = () => ({
|
|
1209
1209
|
purgedSeries: 0,
|
|
1210
|
-
purgedBytes: C.bytes(0)
|
|
1210
|
+
purgedBytes: C$1.bytes(0)
|
|
1211
1211
|
});
|
|
1212
1212
|
const DEFAULT_STATIC_PROPS = {
|
|
1213
1213
|
instrumentation: g$1.NOOP,
|
|
1214
|
-
staleEntryThreshold:
|
|
1214
|
+
staleEntryThreshold: w.seconds(20)
|
|
1215
1215
|
};
|
|
1216
1216
|
class Static {
|
|
1217
1217
|
constructor(props) {
|
|
@@ -1264,7 +1264,7 @@ class Static {
|
|
|
1264
1264
|
gc() {
|
|
1265
1265
|
const res = zeroCacheGCMetrics();
|
|
1266
1266
|
const newData = this.data.filter((s) => {
|
|
1267
|
-
const shouldKeep = s.data.refCount === 0 &&
|
|
1267
|
+
const shouldKeep = s.data.refCount === 0 && m.since(s.addedAt).lessThan(this.props.staleEntryThreshold);
|
|
1268
1268
|
if (!shouldKeep)
|
|
1269
1269
|
res.purgedBytes = res.purgedBytes.add(s.data.byteCapacity);
|
|
1270
1270
|
return shouldKeep;
|
|
@@ -1281,16 +1281,16 @@ class Static {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
writeOne(series) {
|
|
1283
1283
|
const {
|
|
1284
|
-
instrumentation: { L:
|
|
1284
|
+
instrumentation: { L: L2 }
|
|
1285
1285
|
} = this.props;
|
|
1286
1286
|
if (series.length === 0)
|
|
1287
1287
|
return;
|
|
1288
|
-
const insertionPlan =
|
|
1288
|
+
const insertionPlan = C.buildInsertionPlan(
|
|
1289
1289
|
this.data.map((s) => s.data.alignmentBounds),
|
|
1290
1290
|
series.alignmentBounds
|
|
1291
1291
|
);
|
|
1292
1292
|
if (insertionPlan === null)
|
|
1293
|
-
return
|
|
1293
|
+
return L2.debug("Found no viable insertion plan", {
|
|
1294
1294
|
inserting: series.digest,
|
|
1295
1295
|
cacheContents: this.data.map((s) => s.data.digest)
|
|
1296
1296
|
});
|
|
@@ -1300,24 +1300,24 @@ class Static {
|
|
|
1300
1300
|
return;
|
|
1301
1301
|
this.data.splice(insertInto, deleteInBetween, {
|
|
1302
1302
|
data: series,
|
|
1303
|
-
addedAt:
|
|
1303
|
+
addedAt: m.now()
|
|
1304
1304
|
});
|
|
1305
1305
|
}
|
|
1306
1306
|
checkIntegrity(write) {
|
|
1307
1307
|
const {
|
|
1308
|
-
instrumentation: { L:
|
|
1308
|
+
instrumentation: { L: L2 }
|
|
1309
1309
|
} = this.props;
|
|
1310
1310
|
const allBounds = this.data.map((s) => s.data.alignmentBounds);
|
|
1311
1311
|
const invalid = allBounds.some((b, i2) => {
|
|
1312
1312
|
return allBounds.some((b2, j) => {
|
|
1313
1313
|
if (i2 === j)
|
|
1314
1314
|
return false;
|
|
1315
|
-
const ok =
|
|
1315
|
+
const ok = C.overlapsWith(b, b2);
|
|
1316
1316
|
return ok;
|
|
1317
1317
|
});
|
|
1318
1318
|
});
|
|
1319
1319
|
if (invalid) {
|
|
1320
|
-
|
|
1320
|
+
L2.debug("Cache is in an invalid state - bounds overlap!", () => ({
|
|
1321
1321
|
write: write.map((s) => s.digest),
|
|
1322
1322
|
cacheContents: this.data.map((s) => s.data.digest)
|
|
1323
1323
|
}));
|
|
@@ -1325,6 +1325,10 @@ class Static {
|
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
1328
|
+
const MIN_SIZE = 100;
|
|
1329
|
+
const MAX_SIZE = 1e6;
|
|
1330
|
+
const DEF_SIZE = 1e4;
|
|
1331
|
+
const MAX_DEF_WRITES = 100;
|
|
1328
1332
|
class Dynamic {
|
|
1329
1333
|
/**
|
|
1330
1334
|
* @constructor
|
|
@@ -1337,10 +1341,17 @@ class Dynamic {
|
|
|
1337
1341
|
__publicField(this, "counter", 0);
|
|
1338
1342
|
/** Current buffer */
|
|
1339
1343
|
__publicField(this, "buffer");
|
|
1344
|
+
__publicField(this, "avgRate", 0);
|
|
1345
|
+
__publicField(this, "timeOfLastWrite");
|
|
1346
|
+
__publicField(this, "totalWrites", 0);
|
|
1347
|
+
__publicField(this, "now", () => m.now());
|
|
1340
1348
|
this.props = props;
|
|
1341
1349
|
this.buffer = null;
|
|
1350
|
+
if (props.testingNow != null)
|
|
1351
|
+
this.now = props.testingNow;
|
|
1352
|
+
this.timeOfLastWrite = this.now();
|
|
1342
1353
|
}
|
|
1343
|
-
/** @returns the number of samples
|
|
1354
|
+
/** @returns the number of samples currently held in the cache. */
|
|
1344
1355
|
get length() {
|
|
1345
1356
|
var _a2;
|
|
1346
1357
|
return ((_a2 = this.buffer) == null ? void 0 : _a2.length) ?? 0;
|
|
@@ -1370,7 +1381,7 @@ class Dynamic {
|
|
|
1370
1381
|
return N.alloc({
|
|
1371
1382
|
capacity,
|
|
1372
1383
|
dataType: g.FLOAT32,
|
|
1373
|
-
timeRange: start2.range(
|
|
1384
|
+
timeRange: start2.range(m.MAX),
|
|
1374
1385
|
sampleOffset: this.props.dataType.equals(g.TIMESTAMP) ? BigInt(start2.valueOf()) : 0,
|
|
1375
1386
|
glBufferUsage: "dynamic",
|
|
1376
1387
|
alignment,
|
|
@@ -1378,15 +1389,15 @@ class Dynamic {
|
|
|
1378
1389
|
});
|
|
1379
1390
|
}
|
|
1380
1391
|
_write(series) {
|
|
1381
|
-
const
|
|
1392
|
+
const cap = this.nextBufferSize();
|
|
1382
1393
|
const res = { flushed: [], allocated: [] };
|
|
1383
1394
|
if (this.buffer == null) {
|
|
1384
|
-
this.buffer = this.allocate(cap, series.alignment,
|
|
1395
|
+
this.buffer = this.allocate(cap, series.alignment, this.now());
|
|
1385
1396
|
res.allocated.push(this.buffer);
|
|
1386
1397
|
} else if (Math.abs(
|
|
1387
1398
|
Number(this.buffer.alignment + BigInt(this.buffer.length) - series.alignment)
|
|
1388
1399
|
) > 1) {
|
|
1389
|
-
const now22 =
|
|
1400
|
+
const now22 = this.now();
|
|
1390
1401
|
this.buffer.timeRange.end = now22;
|
|
1391
1402
|
res.flushed.push(this.buffer);
|
|
1392
1403
|
this.buffer = this.allocate(cap, series.alignment, now22);
|
|
@@ -1394,9 +1405,11 @@ class Dynamic {
|
|
|
1394
1405
|
}
|
|
1395
1406
|
const converted = convertSeriesFloat32(series, this.buffer.sampleOffset);
|
|
1396
1407
|
const amountWritten = this.buffer.write(converted);
|
|
1397
|
-
if (amountWritten === series.length)
|
|
1408
|
+
if (amountWritten === series.length) {
|
|
1409
|
+
this.updateAvgRate(series);
|
|
1398
1410
|
return res;
|
|
1399
|
-
|
|
1411
|
+
}
|
|
1412
|
+
const now2 = this.now();
|
|
1400
1413
|
this.buffer.timeRange.end = now2;
|
|
1401
1414
|
res.flushed.push(this.buffer);
|
|
1402
1415
|
this.buffer = this.allocate(cap, series.alignment + BigInt(amountWritten), now2);
|
|
@@ -1406,6 +1419,24 @@ class Dynamic {
|
|
|
1406
1419
|
res.allocated.push(...nextRes.allocated);
|
|
1407
1420
|
return res;
|
|
1408
1421
|
}
|
|
1422
|
+
updateAvgRate(series) {
|
|
1423
|
+
if (typeof this.props.dynamicBufferSize === "number")
|
|
1424
|
+
return;
|
|
1425
|
+
const newRate = series.length / this.now().span(this.timeOfLastWrite).seconds;
|
|
1426
|
+
if (this.totalWrites > 0 && isFinite(newRate) && newRate > 0)
|
|
1427
|
+
this.avgRate = (this.avgRate * (this.totalWrites - 1) + newRate) / this.totalWrites;
|
|
1428
|
+
this.totalWrites++;
|
|
1429
|
+
this.timeOfLastWrite = this.now();
|
|
1430
|
+
}
|
|
1431
|
+
nextBufferSize() {
|
|
1432
|
+
const { dynamicBufferSize } = this.props;
|
|
1433
|
+
if (typeof dynamicBufferSize === "number")
|
|
1434
|
+
return dynamicBufferSize;
|
|
1435
|
+
if (this.totalWrites < MAX_DEF_WRITES)
|
|
1436
|
+
return DEF_SIZE;
|
|
1437
|
+
const size = L.roundToNearestMagnitude(this.avgRate * dynamicBufferSize.seconds);
|
|
1438
|
+
return Math.round(Math.max(Math.min(size, MAX_SIZE), MIN_SIZE));
|
|
1439
|
+
}
|
|
1409
1440
|
/**
|
|
1410
1441
|
* Closes the cache and releases all resources associated with it. After close()
|
|
1411
1442
|
* is called, the cache should not be used again.
|
|
@@ -1465,7 +1496,7 @@ class Unary {
|
|
|
1465
1496
|
this.ins.L.warn(
|
|
1466
1497
|
`Ignoring attempted garbage collection on a closed cache for channel ${this.channel.name}`
|
|
1467
1498
|
);
|
|
1468
|
-
return { purgedSeries: 0, purgedBytes: C.bytes(0) };
|
|
1499
|
+
return { purgedSeries: 0, purgedBytes: C$1.bytes(0) };
|
|
1469
1500
|
}
|
|
1470
1501
|
return this.static.gc();
|
|
1471
1502
|
}
|
|
@@ -1475,7 +1506,7 @@ class Unary {
|
|
|
1475
1506
|
this.static.close();
|
|
1476
1507
|
}
|
|
1477
1508
|
}
|
|
1478
|
-
const CACHE_BUFFER_SIZE =
|
|
1509
|
+
const CACHE_BUFFER_SIZE = X.seconds(60);
|
|
1479
1510
|
class Cache {
|
|
1480
1511
|
constructor(props) {
|
|
1481
1512
|
__publicField(this, "props");
|
|
@@ -1563,7 +1594,7 @@ class Reader {
|
|
|
1563
1594
|
});
|
|
1564
1595
|
this.props = {
|
|
1565
1596
|
instrumentation: g$1.NOOP,
|
|
1566
|
-
batchDebounce:
|
|
1597
|
+
batchDebounce: w.milliseconds(50),
|
|
1567
1598
|
...props
|
|
1568
1599
|
};
|
|
1569
1600
|
this.debouncedRead = o$1(() => {
|
|
@@ -1600,7 +1631,7 @@ class Reader {
|
|
|
1600
1631
|
tr: tr.toPrettyString(),
|
|
1601
1632
|
channels,
|
|
1602
1633
|
responses: responseDigests(Object.values(responses)),
|
|
1603
|
-
time:
|
|
1634
|
+
time: w.milliseconds(performance.now() - start2).toString()
|
|
1604
1635
|
}));
|
|
1605
1636
|
return responses;
|
|
1606
1637
|
}
|
|
@@ -1634,7 +1665,7 @@ class Reader {
|
|
|
1634
1665
|
tr: tr.toPrettyString(),
|
|
1635
1666
|
channels,
|
|
1636
1667
|
responses: responseDigests(Object.values(responses)),
|
|
1637
|
-
time:
|
|
1668
|
+
time: w.milliseconds(performance.now() - start2).toString()
|
|
1638
1669
|
}));
|
|
1639
1670
|
return responses;
|
|
1640
1671
|
}
|
|
@@ -1651,7 +1682,7 @@ class Reader {
|
|
|
1651
1682
|
requests.forEach((_2, k2) => {
|
|
1652
1683
|
const [tr, keys] = k2;
|
|
1653
1684
|
const groupWith = compressedToFetch.find(
|
|
1654
|
-
([r2]) => r2.start.span(tr.start).lessThan(
|
|
1685
|
+
([r2]) => r2.start.span(tr.start).lessThan(w.milliseconds(5)) && r2.end.span(tr.end).lessThan(w.milliseconds(5))
|
|
1655
1686
|
);
|
|
1656
1687
|
if (groupWith == null)
|
|
1657
1688
|
compressedToFetch.push([tr, keys]);
|
|
@@ -2124,19 +2155,19 @@ class SugaredOffscreenCanvasRenderingContext2D {
|
|
|
2124
2155
|
return this.wrapped.fill();
|
|
2125
2156
|
this.wrapped.fill(path, fillRule);
|
|
2126
2157
|
}
|
|
2127
|
-
isPointInPath(path, x,
|
|
2128
|
-
return this.wrapped.isPointInPath(path, x,
|
|
2158
|
+
isPointInPath(path, x, y, fillRule) {
|
|
2159
|
+
return this.wrapped.isPointInPath(path, x, y, fillRule);
|
|
2129
2160
|
}
|
|
2130
|
-
isPointInStroke(path, x,
|
|
2131
|
-
return this.wrapped.isPointInStroke(path, x,
|
|
2161
|
+
isPointInStroke(path, x, y) {
|
|
2162
|
+
return this.wrapped.isPointInStroke(path, x, y);
|
|
2132
2163
|
}
|
|
2133
2164
|
stroke(path) {
|
|
2134
2165
|
if (path == null)
|
|
2135
2166
|
return this.wrapped.stroke();
|
|
2136
2167
|
this.wrapped.stroke(path);
|
|
2137
2168
|
}
|
|
2138
|
-
createConicGradient(startAngle, x,
|
|
2139
|
-
return this.wrapped.createConicGradient(startAngle, x,
|
|
2169
|
+
createConicGradient(startAngle, x, y) {
|
|
2170
|
+
return this.wrapped.createConicGradient(startAngle, x, y);
|
|
2140
2171
|
}
|
|
2141
2172
|
createLinearGradient(x0, y0, x1, y1) {
|
|
2142
2173
|
return this.wrapped.createLinearGradient(x0, y0, x1, y1);
|
|
@@ -2183,10 +2214,10 @@ class SugaredOffscreenCanvasRenderingContext2D {
|
|
|
2183
2214
|
set imageSmoothingQuality(value2) {
|
|
2184
2215
|
this.wrapped.imageSmoothingQuality = value2;
|
|
2185
2216
|
}
|
|
2186
|
-
arc(x,
|
|
2217
|
+
arc(x, y, radius, startAngle, endAngle, counterclockwise) {
|
|
2187
2218
|
this.wrapped.arc(
|
|
2188
2219
|
this.scale_.x.pos(x),
|
|
2189
|
-
this.scale_.y.pos(
|
|
2220
|
+
this.scale_.y.pos(y),
|
|
2190
2221
|
this.scale_.x.dim(radius),
|
|
2191
2222
|
startAngle,
|
|
2192
2223
|
endAngle,
|
|
@@ -2202,23 +2233,23 @@ class SugaredOffscreenCanvasRenderingContext2D {
|
|
|
2202
2233
|
this.scale_.x.dim(radius)
|
|
2203
2234
|
);
|
|
2204
2235
|
}
|
|
2205
|
-
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x,
|
|
2236
|
+
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
|
|
2206
2237
|
this.wrapped.bezierCurveTo(
|
|
2207
2238
|
this.scale_.x.pos(cp1x),
|
|
2208
2239
|
this.scale_.y.pos(cp1y),
|
|
2209
2240
|
this.scale_.x.pos(cp2x),
|
|
2210
2241
|
this.scale_.y.pos(cp2y),
|
|
2211
2242
|
this.scale_.x.pos(x),
|
|
2212
|
-
this.scale_.y.pos(
|
|
2243
|
+
this.scale_.y.pos(y)
|
|
2213
2244
|
);
|
|
2214
2245
|
}
|
|
2215
2246
|
closePath() {
|
|
2216
2247
|
this.wrapped.closePath();
|
|
2217
2248
|
}
|
|
2218
|
-
ellipse(x,
|
|
2249
|
+
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) {
|
|
2219
2250
|
this.wrapped.ellipse(
|
|
2220
2251
|
this.scale_.x.pos(x),
|
|
2221
|
-
this.scale_.y.pos(
|
|
2252
|
+
this.scale_.y.pos(y),
|
|
2222
2253
|
this.scale_.x.dim(radiusX),
|
|
2223
2254
|
this.scale_.y.dim(radiusY),
|
|
2224
2255
|
rotation,
|
|
@@ -2227,32 +2258,32 @@ class SugaredOffscreenCanvasRenderingContext2D {
|
|
|
2227
2258
|
counterclockwise
|
|
2228
2259
|
);
|
|
2229
2260
|
}
|
|
2230
|
-
lineTo(x,
|
|
2231
|
-
this.wrapped.lineTo(this.scale_.x.pos(x), this.scale_.y.pos(
|
|
2261
|
+
lineTo(x, y) {
|
|
2262
|
+
this.wrapped.lineTo(this.scale_.x.pos(x), this.scale_.y.pos(y));
|
|
2232
2263
|
}
|
|
2233
|
-
moveTo(x,
|
|
2234
|
-
this.wrapped.moveTo(this.scale_.x.pos(x), this.scale_.y.pos(
|
|
2264
|
+
moveTo(x, y) {
|
|
2265
|
+
this.wrapped.moveTo(this.scale_.x.pos(x), this.scale_.y.pos(y));
|
|
2235
2266
|
}
|
|
2236
|
-
quadraticCurveTo(cpx, cpy, x,
|
|
2267
|
+
quadraticCurveTo(cpx, cpy, x, y) {
|
|
2237
2268
|
this.wrapped.quadraticCurveTo(
|
|
2238
2269
|
this.scale_.x.pos(cpx),
|
|
2239
2270
|
this.scale_.y.pos(cpy),
|
|
2240
2271
|
this.scale_.x.pos(x),
|
|
2241
|
-
this.scale_.y.pos(
|
|
2272
|
+
this.scale_.y.pos(y)
|
|
2242
2273
|
);
|
|
2243
2274
|
}
|
|
2244
|
-
rect(x,
|
|
2275
|
+
rect(x, y, w2, h2) {
|
|
2245
2276
|
this.wrapped.rect(
|
|
2246
2277
|
this.scale_.x.pos(x),
|
|
2247
|
-
this.scale_.y.pos(
|
|
2278
|
+
this.scale_.y.pos(y),
|
|
2248
2279
|
this.scale_.x.dim(w2),
|
|
2249
2280
|
this.scale_.y.dim(h2)
|
|
2250
2281
|
);
|
|
2251
2282
|
}
|
|
2252
|
-
roundRect(x,
|
|
2283
|
+
roundRect(x, y, w2, h2, radii) {
|
|
2253
2284
|
this.wrapped.roundRect(
|
|
2254
2285
|
this.scale_.x.pos(x),
|
|
2255
|
-
this.scale_.y.pos(
|
|
2286
|
+
this.scale_.y.pos(y),
|
|
2256
2287
|
this.scale_.x.dim(w2),
|
|
2257
2288
|
this.scale_.y.dim(h2),
|
|
2258
2289
|
typeof radii === "number" ? this.scale_.x.dim(radii) : radii
|
|
@@ -2289,21 +2320,21 @@ class SugaredOffscreenCanvasRenderingContext2D {
|
|
|
2289
2320
|
const scaled = Array.from(segments).map((v) => this.scale_.x.dim(v));
|
|
2290
2321
|
this.wrapped.setLineDash(scaled);
|
|
2291
2322
|
}
|
|
2292
|
-
clearRect(x,
|
|
2293
|
-
this.wrapped.clearRect(x,
|
|
2323
|
+
clearRect(x, y, w2, h2) {
|
|
2324
|
+
this.wrapped.clearRect(x, y, w2, h2);
|
|
2294
2325
|
}
|
|
2295
|
-
fillRect(x,
|
|
2326
|
+
fillRect(x, y, w2, h2) {
|
|
2296
2327
|
this.wrapped.fillRect(
|
|
2297
2328
|
this.scale_.x.pos(x),
|
|
2298
|
-
this.scale_.y.pos(
|
|
2329
|
+
this.scale_.y.pos(y),
|
|
2299
2330
|
this.scale_.x.dim(w2),
|
|
2300
2331
|
this.scale_.y.dim(h2)
|
|
2301
2332
|
);
|
|
2302
2333
|
}
|
|
2303
|
-
strokeRect(x,
|
|
2334
|
+
strokeRect(x, y, w2, h2) {
|
|
2304
2335
|
this.wrapped.strokeRect(
|
|
2305
2336
|
this.scale_.x.pos(x),
|
|
2306
|
-
this.scale_.y.pos(
|
|
2337
|
+
this.scale_.y.pos(y),
|
|
2307
2338
|
this.scale_.x.dim(w2),
|
|
2308
2339
|
this.scale_.y.dim(h2)
|
|
2309
2340
|
);
|
|
@@ -2335,11 +2366,11 @@ class SugaredOffscreenCanvasRenderingContext2D {
|
|
|
2335
2366
|
save() {
|
|
2336
2367
|
this.wrapped.save();
|
|
2337
2368
|
}
|
|
2338
|
-
fillText(text, x,
|
|
2369
|
+
fillText(text, x, y, maxWidth) {
|
|
2339
2370
|
this.wrapped.fillText(
|
|
2340
2371
|
text,
|
|
2341
2372
|
this.scale_.x.pos(x),
|
|
2342
|
-
this.scale_.y.pos(
|
|
2373
|
+
this.scale_.y.pos(y),
|
|
2343
2374
|
maxWidth != null ? this.scale_.x.dim(maxWidth) : void 0
|
|
2344
2375
|
);
|
|
2345
2376
|
}
|
|
@@ -2349,11 +2380,11 @@ class SugaredOffscreenCanvasRenderingContext2D {
|
|
|
2349
2380
|
this.wrapped.font = scaleFontSize(this.wrapped.font, this.scale_.x);
|
|
2350
2381
|
return metrics;
|
|
2351
2382
|
}
|
|
2352
|
-
strokeText(text, x,
|
|
2383
|
+
strokeText(text, x, y, maxWidth) {
|
|
2353
2384
|
this.wrapped.strokeText(
|
|
2354
2385
|
text,
|
|
2355
2386
|
this.scale_.x.pos(x),
|
|
2356
|
-
this.scale_.y.pos(
|
|
2387
|
+
this.scale_.y.pos(y),
|
|
2357
2388
|
maxWidth != null ? this.scale_.x.dim(maxWidth) : void 0
|
|
2358
2389
|
);
|
|
2359
2390
|
}
|
|
@@ -2396,8 +2427,8 @@ class SugaredOffscreenCanvasRenderingContext2D {
|
|
|
2396
2427
|
rotate(angle) {
|
|
2397
2428
|
this.wrapped.rotate(angle);
|
|
2398
2429
|
}
|
|
2399
|
-
scale(x,
|
|
2400
|
-
this.wrapped.scale(x,
|
|
2430
|
+
scale(x, y) {
|
|
2431
|
+
this.wrapped.scale(x, y);
|
|
2401
2432
|
}
|
|
2402
2433
|
scissor(region, overScan = q$1.ZERO) {
|
|
2403
2434
|
const p = new Path2D();
|
|
@@ -2413,8 +2444,8 @@ class SugaredOffscreenCanvasRenderingContext2D {
|
|
|
2413
2444
|
transform(a2, b, c, d2, e, f2) {
|
|
2414
2445
|
this.wrapped.transform(a2, b, c, d2, e, f2);
|
|
2415
2446
|
}
|
|
2416
|
-
translate(x,
|
|
2417
|
-
this.wrapped.translate(x,
|
|
2447
|
+
translate(x, y) {
|
|
2448
|
+
this.wrapped.translate(x, y);
|
|
2418
2449
|
}
|
|
2419
2450
|
}
|
|
2420
2451
|
const FONT_REGEX = /(\d+(\.\d+)?)px/;
|
|
@@ -2600,8 +2631,8 @@ class Loop {
|
|
|
2600
2631
|
}
|
|
2601
2632
|
}
|
|
2602
2633
|
const end = performance.now();
|
|
2603
|
-
const span =
|
|
2604
|
-
if (span.greaterThan(
|
|
2634
|
+
const span = w.milliseconds(end - start2);
|
|
2635
|
+
if (span.greaterThan(w.milliseconds(25))) {
|
|
2605
2636
|
console.warn(
|
|
2606
2637
|
`Render loop for ${this.requests.size} took longer than 16ms to execute: ${span.milliseconds}`
|
|
2607
2638
|
);
|
|
@@ -2830,7 +2861,7 @@ const safelyGetDataValue = (series, index, data) => {
|
|
|
2830
2861
|
return NaN;
|
|
2831
2862
|
return Number(data[series].at(index));
|
|
2832
2863
|
};
|
|
2833
|
-
const DEFAULT_OVERLAP_THRESHOLD =
|
|
2864
|
+
const DEFAULT_OVERLAP_THRESHOLD = w.milliseconds(2);
|
|
2834
2865
|
({
|
|
2835
2866
|
key: "",
|
|
2836
2867
|
position: q$1.NAN,
|
|
@@ -2858,10 +2889,10 @@ const _Context = class _Context extends GLProgram {
|
|
|
2858
2889
|
this.uniformXY("u_scale", transform.scale);
|
|
2859
2890
|
this.uniformXY("u_offset", transform.offset);
|
|
2860
2891
|
}
|
|
2861
|
-
draw({ x, y
|
|
2892
|
+
draw({ x, y, count, downsample, xOffset, yOffset }, instances) {
|
|
2862
2893
|
const { gl } = this.ctx;
|
|
2863
2894
|
this.bindAttrBuffer("x", x.glBuffer, downsample, xOffset);
|
|
2864
|
-
this.bindAttrBuffer("y",
|
|
2895
|
+
this.bindAttrBuffer("y", y.glBuffer, downsample, yOffset);
|
|
2865
2896
|
gl.drawArraysInstanced(gl.LINE_STRIP, 0, count / downsample, instances);
|
|
2866
2897
|
}
|
|
2867
2898
|
static create(ctx) {
|
|
@@ -2982,7 +3013,7 @@ class Line extends Leaf {
|
|
|
2982
3013
|
result.value.x = safelyGetDataValue(series, index, xData);
|
|
2983
3014
|
const [, yData] = await yTelem.value();
|
|
2984
3015
|
const ySeries = yData.find(
|
|
2985
|
-
(ys) =>
|
|
3016
|
+
(ys) => C.contains(ys.alignmentBounds, xSeries.alignment + BigInt(index))
|
|
2986
3017
|
);
|
|
2987
3018
|
if (ySeries == null)
|
|
2988
3019
|
return result;
|
|
@@ -3002,7 +3033,7 @@ class Line extends Leaf {
|
|
|
3002
3033
|
const { dataToDecimalScale } = props;
|
|
3003
3034
|
const [[, xData], [, yData]] = await Promise.all([xTelem.value(), yTelem.value()]);
|
|
3004
3035
|
xData.forEach((x) => x.updateGLBuffer(prog.ctx.gl));
|
|
3005
|
-
yData.forEach((
|
|
3036
|
+
yData.forEach((y) => y.updateGLBuffer(prog.ctx.gl));
|
|
3006
3037
|
const ops = buildDrawOperations(
|
|
3007
3038
|
xData,
|
|
3008
3039
|
yData,
|
|
@@ -3070,29 +3101,29 @@ const buildDrawOperations = (xSeries, ySeries, downsample, overlapThreshold) =>
|
|
|
3070
3101
|
const ops = [];
|
|
3071
3102
|
xSeries.forEach((x) => {
|
|
3072
3103
|
const compatibleYSeries = findSeriesThatOverlapWith(x, ySeries, overlapThreshold);
|
|
3073
|
-
compatibleYSeries.forEach((
|
|
3104
|
+
compatibleYSeries.forEach((y) => {
|
|
3074
3105
|
let xOffset = 0;
|
|
3075
3106
|
let yOffset = 0;
|
|
3076
|
-
if (x.alignment <
|
|
3077
|
-
xOffset = Number(
|
|
3078
|
-
else if (
|
|
3079
|
-
yOffset = Number(x.alignment -
|
|
3080
|
-
const count = Math.min(x.length - xOffset,
|
|
3107
|
+
if (x.alignment < y.alignment)
|
|
3108
|
+
xOffset = Number(y.alignment - x.alignment);
|
|
3109
|
+
else if (y.alignment < x.alignment)
|
|
3110
|
+
yOffset = Number(x.alignment - y.alignment);
|
|
3111
|
+
const count = Math.min(x.length - xOffset, y.length - yOffset);
|
|
3081
3112
|
if (count === 0)
|
|
3082
3113
|
return;
|
|
3083
|
-
ops.push({ x, y
|
|
3114
|
+
ops.push({ x, y, xOffset, yOffset, count, downsample });
|
|
3084
3115
|
});
|
|
3085
3116
|
});
|
|
3086
3117
|
return ops;
|
|
3087
3118
|
};
|
|
3088
|
-
const findSeriesThatOverlapWith = (x,
|
|
3119
|
+
const findSeriesThatOverlapWith = (x, y, overlapThreshold) => y.filter((ys) => {
|
|
3089
3120
|
const haveTimeRanges = x._timeRange != null && ys._timeRange != null;
|
|
3090
3121
|
if (!haveTimeRanges)
|
|
3091
3122
|
throw new is(
|
|
3092
3123
|
`Encountered series without time range in buildDrawOperations. X series present: ${x._timeRange != null}, Y series present: ${ys._timeRange != null}`
|
|
3093
3124
|
);
|
|
3094
3125
|
const timeRangesOverlap = x.timeRange.overlapsWith(ys.timeRange, overlapThreshold);
|
|
3095
|
-
const alignmentsOverlap =
|
|
3126
|
+
const alignmentsOverlap = C.overlapsWith(
|
|
3096
3127
|
x.alignmentBounds,
|
|
3097
3128
|
ys.alignmentBounds
|
|
3098
3129
|
);
|
|
@@ -3535,9 +3566,9 @@ function color_formatRgb() {
|
|
|
3535
3566
|
return this.rgb().formatRgb();
|
|
3536
3567
|
}
|
|
3537
3568
|
function color(format2) {
|
|
3538
|
-
var
|
|
3569
|
+
var m2, l2;
|
|
3539
3570
|
format2 = (format2 + "").trim().toLowerCase();
|
|
3540
|
-
return (
|
|
3571
|
+
return (m2 = reHex.exec(format2)) ? (l2 = m2[1].length, m2 = parseInt(m2[1], 16), l2 === 6 ? rgbn(m2) : l2 === 3 ? new Rgb(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l2 === 8 ? rgba(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l2 === 4 ? rgba(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger.exec(format2)) ? new Rgb(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent.exec(format2)) ? new Rgb(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger.exec(format2)) ? rgba(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent.exec(format2)) ? rgba(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
|
|
3541
3572
|
}
|
|
3542
3573
|
function rgbn(n2) {
|
|
3543
3574
|
return new Rgb(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1);
|
|
@@ -3697,22 +3728,22 @@ function linear$1(a2, d2) {
|
|
|
3697
3728
|
return a2 + t * d2;
|
|
3698
3729
|
};
|
|
3699
3730
|
}
|
|
3700
|
-
function exponential(a2, b,
|
|
3701
|
-
return a2 = Math.pow(a2,
|
|
3702
|
-
return Math.pow(a2 + t * b,
|
|
3731
|
+
function exponential(a2, b, y) {
|
|
3732
|
+
return a2 = Math.pow(a2, y), b = Math.pow(b, y) - a2, y = 1 / y, function(t) {
|
|
3733
|
+
return Math.pow(a2 + t * b, y);
|
|
3703
3734
|
};
|
|
3704
3735
|
}
|
|
3705
|
-
function gamma(
|
|
3706
|
-
return (
|
|
3707
|
-
return b - a2 ? exponential(a2, b,
|
|
3736
|
+
function gamma(y) {
|
|
3737
|
+
return (y = +y) === 1 ? nogamma : function(a2, b) {
|
|
3738
|
+
return b - a2 ? exponential(a2, b, y) : constant$3(isNaN(a2) ? b : a2);
|
|
3708
3739
|
};
|
|
3709
3740
|
}
|
|
3710
3741
|
function nogamma(a2, b) {
|
|
3711
3742
|
var d2 = b - a2;
|
|
3712
3743
|
return d2 ? linear$1(a2, d2) : constant$3(isNaN(a2) ? b : a2);
|
|
3713
3744
|
}
|
|
3714
|
-
const interpolateRgb = function rgbGamma(
|
|
3715
|
-
var color2 = gamma(
|
|
3745
|
+
const interpolateRgb = function rgbGamma(y) {
|
|
3746
|
+
var color2 = gamma(y);
|
|
3716
3747
|
function rgb$1(start2, end) {
|
|
3717
3748
|
var r2 = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g2 = color2(start2.g, end.g), b = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
|
|
3718
3749
|
return function(t) {
|
|
@@ -3866,8 +3897,8 @@ function decompose(a2, b, c, d2, e, f2) {
|
|
|
3866
3897
|
}
|
|
3867
3898
|
var svgNode;
|
|
3868
3899
|
function parseCss(value2) {
|
|
3869
|
-
const
|
|
3870
|
-
return
|
|
3900
|
+
const m2 = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value2 + "");
|
|
3901
|
+
return m2.isIdentity ? identity$4 : decompose(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);
|
|
3871
3902
|
}
|
|
3872
3903
|
function parseSvg(value2) {
|
|
3873
3904
|
if (value2 == null)
|
|
@@ -4045,8 +4076,8 @@ function transformer() {
|
|
|
4045
4076
|
function scale(x) {
|
|
4046
4077
|
return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate2)))(transform(clamp2(x)));
|
|
4047
4078
|
}
|
|
4048
|
-
scale.invert = function(
|
|
4049
|
-
return clamp2(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(
|
|
4079
|
+
scale.invert = function(y) {
|
|
4080
|
+
return clamp2(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
|
|
4050
4081
|
};
|
|
4051
4082
|
scale.domain = function(_2) {
|
|
4052
4083
|
return arguments.length ? (domain = Array.from(_2, number$1), rescale()) : domain.slice();
|
|
@@ -4730,8 +4761,8 @@ function utcDate(d2) {
|
|
|
4730
4761
|
}
|
|
4731
4762
|
return new Date(Date.UTC(d2.y, d2.m, d2.d, d2.H, d2.M, d2.S, d2.L));
|
|
4732
4763
|
}
|
|
4733
|
-
function newDate(
|
|
4734
|
-
return { y
|
|
4764
|
+
function newDate(y, m2, d2) {
|
|
4765
|
+
return { y, m: m2, d: d2, H: 0, M: 0, S: 0, L: 0 };
|
|
4735
4766
|
}
|
|
4736
4767
|
function formatLocale(locale2) {
|
|
4737
4768
|
var locale_dateTime = locale2.dateTime, locale_date = locale2.date, locale_time = locale2.time, locale_periods = locale2.periods, locale_weekdays = locale2.days, locale_shortWeekdays = locale2.shortDays, locale_months = locale2.months, locale_shortMonths = locale2.shortMonths;
|
|
@@ -4917,9 +4948,9 @@ function formatLocale(locale2) {
|
|
|
4917
4948
|
};
|
|
4918
4949
|
}
|
|
4919
4950
|
function parseSpecifier(d2, specifier, string, j) {
|
|
4920
|
-
var i2 = 0, n2 = specifier.length,
|
|
4951
|
+
var i2 = 0, n2 = specifier.length, m2 = string.length, c, parse;
|
|
4921
4952
|
while (i2 < n2) {
|
|
4922
|
-
if (j >=
|
|
4953
|
+
if (j >= m2)
|
|
4923
4954
|
return -1;
|
|
4924
4955
|
c = specifier.charCodeAt(i2++);
|
|
4925
4956
|
if (c === 37) {
|
|
@@ -5297,8 +5328,8 @@ function calendar(ticks2, tickInterval, year, month, week, day, hour, minute, se
|
|
|
5297
5328
|
function tickFormat2(date2) {
|
|
5298
5329
|
return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2);
|
|
5299
5330
|
}
|
|
5300
|
-
scale.invert = function(
|
|
5301
|
-
return new Date(invert(
|
|
5331
|
+
scale.invert = function(y) {
|
|
5332
|
+
return new Date(invert(y));
|
|
5302
5333
|
};
|
|
5303
5334
|
scale.domain = function(_2) {
|
|
5304
5335
|
return arguments.length ? domain(Array.from(_2, number)) : domain().map(date);
|
|
@@ -5341,8 +5372,8 @@ class TimeTickFactory {
|
|
|
5341
5372
|
generate({ decimalToDataScale: scale, size }) {
|
|
5342
5373
|
const range = [0, size];
|
|
5343
5374
|
const domain = [
|
|
5344
|
-
new
|
|
5345
|
-
new
|
|
5375
|
+
new m(scale.pos(0)).date(),
|
|
5376
|
+
new m(scale.pos(1)).date()
|
|
5346
5377
|
];
|
|
5347
5378
|
const d3Scale = time().domain(domain).range(range);
|
|
5348
5379
|
const ticks2 = d3Scale.ticks(calcTickCount(size, this.props.tickSpacing));
|
|
@@ -5352,7 +5383,7 @@ class TimeTickFactory {
|
|
|
5352
5383
|
}));
|
|
5353
5384
|
}
|
|
5354
5385
|
tickLabel(date2) {
|
|
5355
|
-
const value2 = new
|
|
5386
|
+
const value2 = new m(date2).date();
|
|
5356
5387
|
let formatted = `:${value2.getSeconds()}`;
|
|
5357
5388
|
const ms = value2.getMilliseconds();
|
|
5358
5389
|
if (ms !== 0) {
|
|
@@ -5549,48 +5580,48 @@ class Canvas {
|
|
|
5549
5580
|
maybeDrawGrid(size, ticks2, f2) {
|
|
5550
5581
|
const { showGrid, gridColor } = this.state;
|
|
5551
5582
|
if (showGrid) {
|
|
5552
|
-
const startBound =
|
|
5553
|
-
const endBound =
|
|
5583
|
+
const startBound = C.construct(-1, 1);
|
|
5584
|
+
const endBound = C.construct(size - 1, size + 1);
|
|
5554
5585
|
this.ctx.lower2d.strokeStyle = gridColor.hex;
|
|
5555
5586
|
ticks2.filter(
|
|
5556
|
-
({ position }) => !
|
|
5587
|
+
({ position }) => !C.contains(startBound, position) && !C.contains(endBound, position)
|
|
5557
5588
|
).forEach((tick) => this.drawLine(...f2(tick)));
|
|
5558
5589
|
}
|
|
5559
5590
|
}
|
|
5560
5591
|
}
|
|
5561
5592
|
const coreAxisStateZ = axisStateZ.extend({
|
|
5562
|
-
bounds:
|
|
5593
|
+
bounds: C.bounds.optional(),
|
|
5563
5594
|
autoBounds: z.object({
|
|
5564
5595
|
lower: z.boolean().optional().default(true),
|
|
5565
5596
|
upper: z.boolean().optional().default(true)
|
|
5566
5597
|
}).or(z.boolean().optional().default(true)),
|
|
5567
5598
|
autoBoundPadding: z.number().optional(),
|
|
5568
|
-
autoBoundUpdateInterval:
|
|
5599
|
+
autoBoundUpdateInterval: w.z.optional().default(w.seconds(2)),
|
|
5569
5600
|
size: z.number().optional().default(0),
|
|
5570
5601
|
label: z.string().optional().default(""),
|
|
5571
5602
|
labelSize: z.number().optional().default(0)
|
|
5572
5603
|
}).partial({ color: true, font: true, gridColor: true });
|
|
5573
5604
|
const AXIS_SIZE_UPADTE_UPPER_THRESHOLD = 2;
|
|
5574
5605
|
const AXIS_SIZE_UPDATE_LOWER_THRESHOLD = 7;
|
|
5575
|
-
const withinSizeThreshold = (prev, next) =>
|
|
5606
|
+
const withinSizeThreshold = (prev, next) => C.contains(
|
|
5576
5607
|
{
|
|
5577
5608
|
lower: prev - AXIS_SIZE_UPDATE_LOWER_THRESHOLD,
|
|
5578
5609
|
upper: prev + AXIS_SIZE_UPADTE_UPPER_THRESHOLD
|
|
5579
5610
|
},
|
|
5580
5611
|
next
|
|
5581
5612
|
);
|
|
5582
|
-
const EMPTY_LINEAR_BOUNDS =
|
|
5583
|
-
const now$1 =
|
|
5613
|
+
const EMPTY_LINEAR_BOUNDS = C.DECIMAL;
|
|
5614
|
+
const now$1 = m.now();
|
|
5584
5615
|
const EMPTY_TIME_BOUNDS = {
|
|
5585
5616
|
lower: Number(now$1.valueOf()),
|
|
5586
|
-
upper: Number(now$1.add(
|
|
5617
|
+
upper: Number(now$1.add(w.HOUR).valueOf())
|
|
5587
5618
|
};
|
|
5588
5619
|
const emptyBounds = (type) => type === "linear" ? EMPTY_LINEAR_BOUNDS : EMPTY_TIME_BOUNDS;
|
|
5589
5620
|
const autoBounds = (b, padding = 0.1, type) => {
|
|
5590
|
-
const
|
|
5591
|
-
if (!
|
|
5621
|
+
const m2 = C.max(b.filter(C.isFinite));
|
|
5622
|
+
if (!C.isFinite(m2))
|
|
5592
5623
|
return emptyBounds(type);
|
|
5593
|
-
const { lower: lower2, upper } =
|
|
5624
|
+
const { lower: lower2, upper } = m2;
|
|
5594
5625
|
if (upper === lower2)
|
|
5595
5626
|
return { lower: lower2 - 1, upper: upper + 1 };
|
|
5596
5627
|
const _padding = (upper - lower2) * padding;
|
|
@@ -5951,7 +5982,7 @@ class YAxis extends CoreAxis {
|
|
|
5951
5982
|
__publicField(this, "schema", coreAxisStateZ);
|
|
5952
5983
|
}
|
|
5953
5984
|
async xBounds() {
|
|
5954
|
-
return
|
|
5985
|
+
return C.max(
|
|
5955
5986
|
await Promise.all(this.lines.map(async (el) => await el.xBounds()))
|
|
5956
5987
|
);
|
|
5957
5988
|
}
|
|
@@ -6021,8 +6052,8 @@ class YAxis extends CoreAxis {
|
|
|
6021
6052
|
}
|
|
6022
6053
|
__publicField(YAxis, "TYPE", "YAxis");
|
|
6023
6054
|
const annotationStateZ = z.object({
|
|
6024
|
-
start:
|
|
6025
|
-
end:
|
|
6055
|
+
start: m.z,
|
|
6056
|
+
end: m.z
|
|
6026
6057
|
});
|
|
6027
6058
|
class Annotation extends Leaf {
|
|
6028
6059
|
constructor() {
|
|
@@ -6691,7 +6722,7 @@ function requireUseSyncExternalStoreShim_production_min() {
|
|
|
6691
6722
|
function h2(a2, b) {
|
|
6692
6723
|
return a2 === b && (0 !== a2 || 1 / a2 === 1 / b) || a2 !== a2 && b !== b;
|
|
6693
6724
|
}
|
|
6694
|
-
var k2 = "function" === typeof Object.is ? Object.is : h2, l2 = e.useState,
|
|
6725
|
+
var k2 = "function" === typeof Object.is ? Object.is : h2, l2 = e.useState, m2 = e.useEffect, n2 = e.useLayoutEffect, p = e.useDebugValue;
|
|
6695
6726
|
function q2(a2, b) {
|
|
6696
6727
|
var d2 = b(), f2 = l2({ inst: { value: d2, getSnapshot: b } }), c = f2[0].inst, g2 = f2[1];
|
|
6697
6728
|
n2(function() {
|
|
@@ -6699,7 +6730,7 @@ function requireUseSyncExternalStoreShim_production_min() {
|
|
|
6699
6730
|
c.getSnapshot = b;
|
|
6700
6731
|
r2(c) && g2({ inst: c });
|
|
6701
6732
|
}, [a2, d2, b]);
|
|
6702
|
-
|
|
6733
|
+
m2(function() {
|
|
6703
6734
|
r2(c) && g2({ inst: c });
|
|
6704
6735
|
return a2(function() {
|
|
6705
6736
|
r2(c) && g2({ inst: c });
|
|
@@ -6772,8 +6803,8 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
6772
6803
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
6773
6804
|
}
|
|
6774
6805
|
}
|
|
6775
|
-
function is2(x,
|
|
6776
|
-
return x ===
|
|
6806
|
+
function is2(x, y) {
|
|
6807
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
6777
6808
|
}
|
|
6778
6809
|
var objectIs = typeof Object.is === "function" ? Object.is : is2;
|
|
6779
6810
|
var useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue2 = React.useDebugValue;
|
|
@@ -6916,11 +6947,11 @@ function requireWithSelector_production_min() {
|
|
|
6916
6947
|
d3 = a4;
|
|
6917
6948
|
return k2 = e3;
|
|
6918
6949
|
}
|
|
6919
|
-
var c2 = false, d3, k2,
|
|
6950
|
+
var c2 = false, d3, k2, m2 = void 0 === e ? null : e;
|
|
6920
6951
|
return [function() {
|
|
6921
6952
|
return a3(b());
|
|
6922
|
-
}, null ===
|
|
6923
|
-
return a3(
|
|
6953
|
+
}, null === m2 ? void 0 : function() {
|
|
6954
|
+
return a3(m2());
|
|
6924
6955
|
}];
|
|
6925
6956
|
}, [b, e, l2, g2]);
|
|
6926
6957
|
var d2 = r2(a2, c[0], c[1]);
|
|
@@ -6955,8 +6986,8 @@ function requireWithSelector_development() {
|
|
|
6955
6986
|
}
|
|
6956
6987
|
var React = React__default;
|
|
6957
6988
|
var shim2 = requireShim();
|
|
6958
|
-
function is2(x,
|
|
6959
|
-
return x ===
|
|
6989
|
+
function is2(x, y) {
|
|
6990
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
6960
6991
|
}
|
|
6961
6992
|
var objectIs = typeof Object.is === "function" ? Object.is : is2;
|
|
6962
6993
|
var useSyncExternalStore = shim2.useSyncExternalStore;
|
|
@@ -7252,7 +7283,7 @@ function selector(selector2) {
|
|
|
7252
7283
|
function selection_select(select2) {
|
|
7253
7284
|
if (typeof select2 !== "function")
|
|
7254
7285
|
select2 = selector(select2);
|
|
7255
|
-
for (var groups = this._groups,
|
|
7286
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
7256
7287
|
for (var group = groups[j], n2 = group.length, subgroup = subgroups[j] = new Array(n2), node, subnode, i2 = 0; i2 < n2; ++i2) {
|
|
7257
7288
|
if ((node = group[i2]) && (subnode = select2.call(node, node.__data__, i2, group))) {
|
|
7258
7289
|
if ("__data__" in node)
|
|
@@ -7284,7 +7315,7 @@ function selection_selectAll(select2) {
|
|
|
7284
7315
|
select2 = arrayAll(select2);
|
|
7285
7316
|
else
|
|
7286
7317
|
select2 = selectorAll(select2);
|
|
7287
|
-
for (var groups = this._groups,
|
|
7318
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j = 0; j < m2; ++j) {
|
|
7288
7319
|
for (var group = groups[j], n2 = group.length, node, i2 = 0; i2 < n2; ++i2) {
|
|
7289
7320
|
if (node = group[i2]) {
|
|
7290
7321
|
subgroups.push(select2.call(node, node.__data__, i2, group));
|
|
@@ -7331,7 +7362,7 @@ function selection_selectChildren(match) {
|
|
|
7331
7362
|
function selection_filter(match) {
|
|
7332
7363
|
if (typeof match !== "function")
|
|
7333
7364
|
match = matcher(match);
|
|
7334
|
-
for (var groups = this._groups,
|
|
7365
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
7335
7366
|
for (var group = groups[j], n2 = group.length, subgroup = subgroups[j] = [], node, i2 = 0; i2 < n2; ++i2) {
|
|
7336
7367
|
if ((node = group[i2]) && match.call(node, node.__data__, i2, group)) {
|
|
7337
7368
|
subgroup.push(node);
|
|
@@ -7426,7 +7457,7 @@ function selection_data(value2, key) {
|
|
|
7426
7457
|
var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
|
|
7427
7458
|
if (typeof value2 !== "function")
|
|
7428
7459
|
value2 = constant$2(value2);
|
|
7429
|
-
for (var
|
|
7460
|
+
for (var m2 = groups.length, update = new Array(m2), enter = new Array(m2), exit = new Array(m2), j = 0; j < m2; ++j) {
|
|
7430
7461
|
var parent = parents[j], group = groups[j], groupLength = group.length, data = arraylike(value2.call(parent, parent && parent.__data__, j, parents)), dataLength = data.length, enterGroup = enter[j] = new Array(dataLength), updateGroup = update[j] = new Array(dataLength), exitGroup = exit[j] = new Array(groupLength);
|
|
7431
7462
|
bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
|
|
7432
7463
|
for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
|
|
@@ -7472,7 +7503,7 @@ function selection_join(onenter, onupdate, onexit) {
|
|
|
7472
7503
|
}
|
|
7473
7504
|
function selection_merge(context) {
|
|
7474
7505
|
var selection2 = context.selection ? context.selection() : context;
|
|
7475
|
-
for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length,
|
|
7506
|
+
for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m2; ++j) {
|
|
7476
7507
|
for (var group0 = groups0[j], group1 = groups1[j], n2 = group0.length, merge = merges[j] = new Array(n2), node, i2 = 0; i2 < n2; ++i2) {
|
|
7477
7508
|
if (node = group0[i2] || group1[i2]) {
|
|
7478
7509
|
merge[i2] = node;
|
|
@@ -7485,7 +7516,7 @@ function selection_merge(context) {
|
|
|
7485
7516
|
return new Selection$1(merges, this._parents);
|
|
7486
7517
|
}
|
|
7487
7518
|
function selection_order() {
|
|
7488
|
-
for (var groups = this._groups, j = -1,
|
|
7519
|
+
for (var groups = this._groups, j = -1, m2 = groups.length; ++j < m2; ) {
|
|
7489
7520
|
for (var group = groups[j], i2 = group.length - 1, next = group[i2], node; --i2 >= 0; ) {
|
|
7490
7521
|
if (node = group[i2]) {
|
|
7491
7522
|
if (next && node.compareDocumentPosition(next) ^ 4)
|
|
@@ -7502,7 +7533,7 @@ function selection_sort(compare) {
|
|
|
7502
7533
|
function compareNode(a2, b) {
|
|
7503
7534
|
return a2 && b ? compare(a2.__data__, b.__data__) : !a2 - !b;
|
|
7504
7535
|
}
|
|
7505
|
-
for (var groups = this._groups,
|
|
7536
|
+
for (var groups = this._groups, m2 = groups.length, sortgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
7506
7537
|
for (var group = groups[j], n2 = group.length, sortgroup = sortgroups[j] = new Array(n2), node, i2 = 0; i2 < n2; ++i2) {
|
|
7507
7538
|
if (node = group[i2]) {
|
|
7508
7539
|
sortgroup[i2] = node;
|
|
@@ -7525,7 +7556,7 @@ function selection_nodes() {
|
|
|
7525
7556
|
return Array.from(this);
|
|
7526
7557
|
}
|
|
7527
7558
|
function selection_node() {
|
|
7528
|
-
for (var groups = this._groups, j = 0,
|
|
7559
|
+
for (var groups = this._groups, j = 0, m2 = groups.length; j < m2; ++j) {
|
|
7529
7560
|
for (var group = groups[j], i2 = 0, n2 = group.length; i2 < n2; ++i2) {
|
|
7530
7561
|
var node = group[i2];
|
|
7531
7562
|
if (node)
|
|
@@ -7544,7 +7575,7 @@ function selection_empty() {
|
|
|
7544
7575
|
return !this.node();
|
|
7545
7576
|
}
|
|
7546
7577
|
function selection_each(callback) {
|
|
7547
|
-
for (var groups = this._groups, j = 0,
|
|
7578
|
+
for (var groups = this._groups, j = 0, m2 = groups.length; j < m2; ++j) {
|
|
7548
7579
|
for (var group = groups[j], i2 = 0, n2 = group.length, node; i2 < n2; ++i2) {
|
|
7549
7580
|
if (node = group[i2])
|
|
7550
7581
|
callback.call(node, node.__data__, i2, group);
|
|
@@ -7816,7 +7847,7 @@ function onRemove(typename) {
|
|
|
7816
7847
|
var on = this.__on;
|
|
7817
7848
|
if (!on)
|
|
7818
7849
|
return;
|
|
7819
|
-
for (var j = 0, i2 = -1,
|
|
7850
|
+
for (var j = 0, i2 = -1, m2 = on.length, o2; j < m2; ++j) {
|
|
7820
7851
|
if (o2 = on[j], (!typename.type || o2.type === typename.type) && o2.name === typename.name) {
|
|
7821
7852
|
this.removeEventListener(o2.type, o2.listener, o2.options);
|
|
7822
7853
|
} else {
|
|
@@ -7833,7 +7864,7 @@ function onAdd(typename, value2, options) {
|
|
|
7833
7864
|
return function() {
|
|
7834
7865
|
var on = this.__on, o2, listener = contextListener(value2);
|
|
7835
7866
|
if (on)
|
|
7836
|
-
for (var j = 0,
|
|
7867
|
+
for (var j = 0, m2 = on.length; j < m2; ++j) {
|
|
7837
7868
|
if ((o2 = on[j]).type === typename.type && o2.name === typename.name) {
|
|
7838
7869
|
this.removeEventListener(o2.type, o2.listener, o2.options);
|
|
7839
7870
|
this.addEventListener(o2.type, o2.listener = listener, o2.options = options);
|
|
@@ -7854,7 +7885,7 @@ function selection_on(typename, value2, options) {
|
|
|
7854
7885
|
if (arguments.length < 2) {
|
|
7855
7886
|
var on = this.node().__on;
|
|
7856
7887
|
if (on)
|
|
7857
|
-
for (var j = 0,
|
|
7888
|
+
for (var j = 0, m2 = on.length, o2; j < m2; ++j) {
|
|
7858
7889
|
for (i2 = 0, o2 = on[j]; i2 < n2; ++i2) {
|
|
7859
7890
|
if ((t = typenames[i2]).type === o2.type && t.name === o2.name) {
|
|
7860
7891
|
return o2.value;
|
|
@@ -7895,7 +7926,7 @@ function selection_dispatch(type, params) {
|
|
|
7895
7926
|
return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type, params));
|
|
7896
7927
|
}
|
|
7897
7928
|
function* selection_iterator() {
|
|
7898
|
-
for (var groups = this._groups, j = 0,
|
|
7929
|
+
for (var groups = this._groups, j = 0, m2 = groups.length; j < m2; ++j) {
|
|
7899
7930
|
for (var group = groups[j], i2 = 0, n2 = group.length, node; i2 < n2; ++i2) {
|
|
7900
7931
|
if (node = group[i2])
|
|
7901
7932
|
yield node;
|
|
@@ -8020,7 +8051,7 @@ function DragEvent(type, {
|
|
|
8020
8051
|
identifier,
|
|
8021
8052
|
active,
|
|
8022
8053
|
x,
|
|
8023
|
-
y
|
|
8054
|
+
y,
|
|
8024
8055
|
dx,
|
|
8025
8056
|
dy,
|
|
8026
8057
|
dispatch: dispatch2
|
|
@@ -8033,7 +8064,7 @@ function DragEvent(type, {
|
|
|
8033
8064
|
identifier: { value: identifier, enumerable: true, configurable: true },
|
|
8034
8065
|
active: { value: active, enumerable: true, configurable: true },
|
|
8035
8066
|
x: { value: x, enumerable: true, configurable: true },
|
|
8036
|
-
y: { value:
|
|
8067
|
+
y: { value: y, enumerable: true, configurable: true },
|
|
8037
8068
|
dx: { value: dx, enumerable: true, configurable: true },
|
|
8038
8069
|
dy: { value: dy, enumerable: true, configurable: true },
|
|
8039
8070
|
_: { value: dispatch2 }
|
|
@@ -8657,7 +8688,7 @@ function transition_easeVarying(value2) {
|
|
|
8657
8688
|
function transition_filter(match) {
|
|
8658
8689
|
if (typeof match !== "function")
|
|
8659
8690
|
match = matcher(match);
|
|
8660
|
-
for (var groups = this._groups,
|
|
8691
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
8661
8692
|
for (var group = groups[j], n2 = group.length, subgroup = subgroups[j] = [], node, i2 = 0; i2 < n2; ++i2) {
|
|
8662
8693
|
if ((node = group[i2]) && match.call(node, node.__data__, i2, group)) {
|
|
8663
8694
|
subgroup.push(node);
|
|
@@ -8669,7 +8700,7 @@ function transition_filter(match) {
|
|
|
8669
8700
|
function transition_merge(transition) {
|
|
8670
8701
|
if (transition._id !== this._id)
|
|
8671
8702
|
throw new Error();
|
|
8672
|
-
for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length,
|
|
8703
|
+
for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m2; ++j) {
|
|
8673
8704
|
for (var group0 = groups0[j], group1 = groups1[j], n2 = group0.length, merge = merges[j] = new Array(n2), node, i2 = 0; i2 < n2; ++i2) {
|
|
8674
8705
|
if (node = group0[i2] || group1[i2]) {
|
|
8675
8706
|
merge[i2] = node;
|
|
@@ -8719,7 +8750,7 @@ function transition_select(select2) {
|
|
|
8719
8750
|
var name = this._name, id2 = this._id;
|
|
8720
8751
|
if (typeof select2 !== "function")
|
|
8721
8752
|
select2 = selector(select2);
|
|
8722
|
-
for (var groups = this._groups,
|
|
8753
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
|
|
8723
8754
|
for (var group = groups[j], n2 = group.length, subgroup = subgroups[j] = new Array(n2), node, subnode, i2 = 0; i2 < n2; ++i2) {
|
|
8724
8755
|
if ((node = group[i2]) && (subnode = select2.call(node, node.__data__, i2, group))) {
|
|
8725
8756
|
if ("__data__" in node)
|
|
@@ -8735,7 +8766,7 @@ function transition_selectAll(select2) {
|
|
|
8735
8766
|
var name = this._name, id2 = this._id;
|
|
8736
8767
|
if (typeof select2 !== "function")
|
|
8737
8768
|
select2 = selectorAll(select2);
|
|
8738
|
-
for (var groups = this._groups,
|
|
8769
|
+
for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j = 0; j < m2; ++j) {
|
|
8739
8770
|
for (var group = groups[j], n2 = group.length, node, i2 = 0; i2 < n2; ++i2) {
|
|
8740
8771
|
if (node = group[i2]) {
|
|
8741
8772
|
for (var children2 = select2.call(node, node.__data__, i2, group), child, inherit2 = get(node, id2), k2 = 0, l2 = children2.length; k2 < l2; ++k2) {
|
|
@@ -8863,7 +8894,7 @@ function transition_textTween(value2) {
|
|
|
8863
8894
|
}
|
|
8864
8895
|
function transition_transition() {
|
|
8865
8896
|
var name = this._name, id0 = this._id, id1 = newId();
|
|
8866
|
-
for (var groups = this._groups,
|
|
8897
|
+
for (var groups = this._groups, m2 = groups.length, j = 0; j < m2; ++j) {
|
|
8867
8898
|
for (var group = groups[j], n2 = group.length, node, i2 = 0; i2 < n2; ++i2) {
|
|
8868
8899
|
if (node = group[i2]) {
|
|
8869
8900
|
var inherit2 = get(node, id0);
|
|
@@ -8968,7 +8999,7 @@ function selection_transition(name) {
|
|
|
8968
8999
|
} else {
|
|
8969
9000
|
id2 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
|
|
8970
9001
|
}
|
|
8971
|
-
for (var groups = this._groups,
|
|
9002
|
+
for (var groups = this._groups, m2 = groups.length, j = 0; j < m2; ++j) {
|
|
8972
9003
|
for (var group = groups[j], n2 = group.length, node, i2 = 0; i2 < n2; ++i2) {
|
|
8973
9004
|
if (node = group[i2]) {
|
|
8974
9005
|
schedule(node, name, id2, i2, group, timing || inherit(node, id2));
|
|
@@ -8994,18 +9025,18 @@ function ZoomEvent(type, {
|
|
|
8994
9025
|
_: { value: dispatch2 }
|
|
8995
9026
|
});
|
|
8996
9027
|
}
|
|
8997
|
-
function Transform(k2, x,
|
|
9028
|
+
function Transform(k2, x, y) {
|
|
8998
9029
|
this.k = k2;
|
|
8999
9030
|
this.x = x;
|
|
9000
|
-
this.y =
|
|
9031
|
+
this.y = y;
|
|
9001
9032
|
}
|
|
9002
9033
|
Transform.prototype = {
|
|
9003
9034
|
constructor: Transform,
|
|
9004
9035
|
scale: function(k2) {
|
|
9005
9036
|
return k2 === 1 ? this : new Transform(this.k * k2, this.x, this.y);
|
|
9006
9037
|
},
|
|
9007
|
-
translate: function(x,
|
|
9008
|
-
return x === 0 &
|
|
9038
|
+
translate: function(x, y) {
|
|
9039
|
+
return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
|
|
9009
9040
|
},
|
|
9010
9041
|
apply: function(point) {
|
|
9011
9042
|
return [point[0] * this.k + this.x, point[1] * this.k + this.y];
|
|
@@ -9013,8 +9044,8 @@ Transform.prototype = {
|
|
|
9013
9044
|
applyX: function(x) {
|
|
9014
9045
|
return x * this.k + this.x;
|
|
9015
9046
|
},
|
|
9016
|
-
applyY: function(
|
|
9017
|
-
return
|
|
9047
|
+
applyY: function(y) {
|
|
9048
|
+
return y * this.k + this.y;
|
|
9018
9049
|
},
|
|
9019
9050
|
invert: function(location) {
|
|
9020
9051
|
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
|
@@ -9022,14 +9053,14 @@ Transform.prototype = {
|
|
|
9022
9053
|
invertX: function(x) {
|
|
9023
9054
|
return (x - this.x) / this.k;
|
|
9024
9055
|
},
|
|
9025
|
-
invertY: function(
|
|
9026
|
-
return (
|
|
9056
|
+
invertY: function(y) {
|
|
9057
|
+
return (y - this.y) / this.k;
|
|
9027
9058
|
},
|
|
9028
9059
|
rescaleX: function(x) {
|
|
9029
9060
|
return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
|
|
9030
9061
|
},
|
|
9031
|
-
rescaleY: function(
|
|
9032
|
-
return
|
|
9062
|
+
rescaleY: function(y) {
|
|
9063
|
+
return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
|
|
9033
9064
|
},
|
|
9034
9065
|
toString: function() {
|
|
9035
9066
|
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
@@ -9103,20 +9134,20 @@ function zoom() {
|
|
|
9103
9134
|
return constrain(translate(scale(t02, k1), p0, p1), e, translateExtent);
|
|
9104
9135
|
}, p, event);
|
|
9105
9136
|
};
|
|
9106
|
-
zoom2.translateBy = function(selection2, x,
|
|
9137
|
+
zoom2.translateBy = function(selection2, x, y, event) {
|
|
9107
9138
|
zoom2.transform(selection2, function() {
|
|
9108
9139
|
return constrain(this.__zoom.translate(
|
|
9109
9140
|
typeof x === "function" ? x.apply(this, arguments) : x,
|
|
9110
|
-
typeof
|
|
9141
|
+
typeof y === "function" ? y.apply(this, arguments) : y
|
|
9111
9142
|
), extent.apply(this, arguments), translateExtent);
|
|
9112
9143
|
}, null, event);
|
|
9113
9144
|
};
|
|
9114
|
-
zoom2.translateTo = function(selection2, x,
|
|
9145
|
+
zoom2.translateTo = function(selection2, x, y, p, event) {
|
|
9115
9146
|
zoom2.transform(selection2, function() {
|
|
9116
9147
|
var e = extent.apply(this, arguments), t = this.__zoom, p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p;
|
|
9117
9148
|
return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(
|
|
9118
9149
|
typeof x === "function" ? -x.apply(this, arguments) : -x,
|
|
9119
|
-
typeof
|
|
9150
|
+
typeof y === "function" ? -y.apply(this, arguments) : -y
|
|
9120
9151
|
), e, translateExtent);
|
|
9121
9152
|
}, p, event);
|
|
9122
9153
|
};
|
|
@@ -9125,8 +9156,8 @@ function zoom() {
|
|
|
9125
9156
|
return k2 === transform.k ? transform : new Transform(k2, transform.x, transform.y);
|
|
9126
9157
|
}
|
|
9127
9158
|
function translate(transform, p0, p1) {
|
|
9128
|
-
var x = p0[0] - p1[0] * transform.k,
|
|
9129
|
-
return x === transform.x &&
|
|
9159
|
+
var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;
|
|
9160
|
+
return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);
|
|
9130
9161
|
}
|
|
9131
9162
|
function centroid(extent2) {
|
|
9132
9163
|
return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
|
|
@@ -9437,7 +9468,7 @@ function Attribution({ proOptions, position = "bottom-right" }) {
|
|
|
9437
9468
|
React__default.createElement("a", { href: "https://reactflow.dev", target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution" }, "React Flow")
|
|
9438
9469
|
);
|
|
9439
9470
|
}
|
|
9440
|
-
const EdgeText = ({ x, y
|
|
9471
|
+
const EdgeText = ({ x, y, label, labelStyle = {}, labelShowBg = true, labelBgStyle = {}, labelBgPadding = [2, 4], labelBgBorderRadius = 2, children: children2, className, ...rest }) => {
|
|
9441
9472
|
const edgeRef = useRef(null);
|
|
9442
9473
|
const [edgeTextBbox, setEdgeTextBbox] = useState({ x: 0, y: 0, width: 0, height: 0 });
|
|
9443
9474
|
const edgeTextClasses = cc(["react-flow__edge-textwrapper", className]);
|
|
@@ -9457,7 +9488,7 @@ const EdgeText = ({ x, y: y2, label, labelStyle = {}, labelShowBg = true, labelB
|
|
|
9457
9488
|
}
|
|
9458
9489
|
return React__default.createElement(
|
|
9459
9490
|
"g",
|
|
9460
|
-
{ transform: `translate(${x - edgeTextBbox.width / 2} ${
|
|
9491
|
+
{ transform: `translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`, className: edgeTextClasses, visibility: edgeTextBbox.width ? "visible" : "hidden", ...rest },
|
|
9461
9492
|
labelShowBg && React__default.createElement("rect", { width: edgeTextBbox.width + 2 * labelBgPadding[0], x: -labelBgPadding[0], y: -labelBgPadding[1], height: edgeTextBbox.height + 2 * labelBgPadding[1], className: "react-flow__edge-textbg", style: labelBgStyle, rx: labelBgBorderRadius, ry: labelBgBorderRadius }),
|
|
9462
9493
|
React__default.createElement("text", { className: "react-flow__edge-text", y: edgeTextBbox.height / 2, dy: "0.3em", ref: edgeRef, style: labelStyle }, label),
|
|
9463
9494
|
children2
|
|
@@ -9496,17 +9527,17 @@ const getBoundsOfBoxes = (box1, box2) => ({
|
|
|
9496
9527
|
x2: Math.max(box1.x2, box2.x2),
|
|
9497
9528
|
y2: Math.max(box1.y2, box2.y2)
|
|
9498
9529
|
});
|
|
9499
|
-
const rectToBox = ({ x, y
|
|
9530
|
+
const rectToBox = ({ x, y, width, height }) => ({
|
|
9500
9531
|
x,
|
|
9501
|
-
y
|
|
9532
|
+
y,
|
|
9502
9533
|
x2: x + width,
|
|
9503
|
-
y2:
|
|
9534
|
+
y2: y + height
|
|
9504
9535
|
});
|
|
9505
|
-
const boxToRect = ({ x, y
|
|
9536
|
+
const boxToRect = ({ x, y, x2, y2 }) => ({
|
|
9506
9537
|
x,
|
|
9507
|
-
y
|
|
9538
|
+
y,
|
|
9508
9539
|
width: x2 - x,
|
|
9509
|
-
height:
|
|
9540
|
+
height: y2 - y
|
|
9510
9541
|
});
|
|
9511
9542
|
const nodeToRect = (node) => ({
|
|
9512
9543
|
...node.positionAbsolute || { x: 0, y: 0 },
|
|
@@ -9772,18 +9803,18 @@ function getPoints({ source, sourcePosition = Position.Bottom, target, targetPos
|
|
|
9772
9803
|
}
|
|
9773
9804
|
function getBend(a2, b, c, size) {
|
|
9774
9805
|
const bendSize = Math.min(distance(a2, b) / 2, distance(b, c) / 2, size);
|
|
9775
|
-
const { x, y
|
|
9776
|
-
if (a2.x === x && x === c.x || a2.y ===
|
|
9777
|
-
return `L${x} ${
|
|
9806
|
+
const { x, y } = b;
|
|
9807
|
+
if (a2.x === x && x === c.x || a2.y === y && y === c.y) {
|
|
9808
|
+
return `L${x} ${y}`;
|
|
9778
9809
|
}
|
|
9779
|
-
if (a2.y ===
|
|
9810
|
+
if (a2.y === y) {
|
|
9780
9811
|
const xDir2 = a2.x < c.x ? -1 : 1;
|
|
9781
9812
|
const yDir2 = a2.y < c.y ? 1 : -1;
|
|
9782
|
-
return `L ${x + bendSize * xDir2},${
|
|
9813
|
+
return `L ${x + bendSize * xDir2},${y}Q ${x},${y} ${x},${y + bendSize * yDir2}`;
|
|
9783
9814
|
}
|
|
9784
9815
|
const xDir = a2.x < c.x ? 1 : -1;
|
|
9785
9816
|
const yDir = a2.y < c.y ? -1 : 1;
|
|
9786
|
-
return `L ${x},${
|
|
9817
|
+
return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`;
|
|
9787
9818
|
}
|
|
9788
9819
|
function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius = 5, centerX, centerY, offset = 20 }) {
|
|
9789
9820
|
const [points, labelX, labelY, offsetX, offsetY] = getPoints({
|
|
@@ -9970,10 +10001,10 @@ const updateEdge = (oldEdge, newConnection, edges, options = { shouldReplaceId:
|
|
|
9970
10001
|
};
|
|
9971
10002
|
return edges.filter((e) => e.id !== oldEdgeId).concat(edge);
|
|
9972
10003
|
};
|
|
9973
|
-
const pointToRendererPoint = ({ x, y
|
|
10004
|
+
const pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid, [snapX, snapY]) => {
|
|
9974
10005
|
const position = {
|
|
9975
10006
|
x: (x - tx) / tScale,
|
|
9976
|
-
y: (
|
|
10007
|
+
y: (y - ty) / tScale
|
|
9977
10008
|
};
|
|
9978
10009
|
if (snapToGrid) {
|
|
9979
10010
|
return {
|
|
@@ -9983,10 +10014,10 @@ const pointToRendererPoint = ({ x, y: y2 }, [tx, ty, tScale], snapToGrid, [snapX
|
|
|
9983
10014
|
}
|
|
9984
10015
|
return position;
|
|
9985
10016
|
};
|
|
9986
|
-
const rendererPointToPoint = ({ x, y
|
|
10017
|
+
const rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {
|
|
9987
10018
|
return {
|
|
9988
10019
|
x: x * tScale + tx,
|
|
9989
|
-
y:
|
|
10020
|
+
y: y * tScale + ty
|
|
9990
10021
|
};
|
|
9991
10022
|
};
|
|
9992
10023
|
const getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {
|
|
@@ -10019,10 +10050,10 @@ const getNodesBounds = (nodes, nodeOrigin = [0, 0]) => {
|
|
|
10019
10050
|
return { x: 0, y: 0, width: 0, height: 0 };
|
|
10020
10051
|
}
|
|
10021
10052
|
const box = nodes.reduce((currBox, node) => {
|
|
10022
|
-
const { x, y
|
|
10053
|
+
const { x, y } = getNodePositionWithOrigin(node, nodeOrigin).positionAbsolute;
|
|
10023
10054
|
return getBoundsOfBoxes(currBox, rectToBox({
|
|
10024
10055
|
x,
|
|
10025
|
-
y
|
|
10056
|
+
y,
|
|
10026
10057
|
width: node.width || 0,
|
|
10027
10058
|
height: node.height || 0
|
|
10028
10059
|
}));
|
|
@@ -10072,8 +10103,8 @@ const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding =
|
|
|
10072
10103
|
const boundsCenterX = bounds.x + bounds.width / 2;
|
|
10073
10104
|
const boundsCenterY = bounds.y + bounds.height / 2;
|
|
10074
10105
|
const x = width / 2 - boundsCenterX * clampedZoom;
|
|
10075
|
-
const
|
|
10076
|
-
return { x, y
|
|
10106
|
+
const y = height / 2 - boundsCenterY * clampedZoom;
|
|
10107
|
+
return { x, y, zoom: clampedZoom };
|
|
10077
10108
|
};
|
|
10078
10109
|
const getD3Transition = (selection2, duration = 0) => {
|
|
10079
10110
|
return selection2.transition().duration(duration);
|
|
@@ -10094,8 +10125,8 @@ function getHandles(node, handleBounds, type, currentHandle) {
|
|
|
10094
10125
|
}, []);
|
|
10095
10126
|
}
|
|
10096
10127
|
function getClosestHandle(event, doc, pos, connectionRadius, handles, validator) {
|
|
10097
|
-
const { x, y
|
|
10098
|
-
const domNodes = doc.elementsFromPoint(x,
|
|
10128
|
+
const { x, y } = getEventPosition(event);
|
|
10129
|
+
const domNodes = doc.elementsFromPoint(x, y);
|
|
10099
10130
|
const handleBelow = domNodes.find((el) => el.classList.contains("react-flow__handle"));
|
|
10100
10131
|
if (handleBelow) {
|
|
10101
10132
|
const handleNodeId = handleBelow.getAttribute("data-nodeid");
|
|
@@ -10229,8 +10260,8 @@ function handlePointerDown({ event, handleId, nodeId, onConnect, isTarget, getSt
|
|
|
10229
10260
|
const { connectionMode, domNode, autoPanOnConnect, connectionRadius, onConnectStart, panBy, getNodes, cancelConnection } = getState();
|
|
10230
10261
|
let autoPanId = 0;
|
|
10231
10262
|
let closestHandle;
|
|
10232
|
-
const { x, y
|
|
10233
|
-
const clickedHandle = doc == null ? void 0 : doc.elementFromPoint(x,
|
|
10263
|
+
const { x, y } = getEventPosition(event);
|
|
10264
|
+
const clickedHandle = doc == null ? void 0 : doc.elementFromPoint(x, y);
|
|
10234
10265
|
const handleType = getHandleType(edgeUpdaterType, clickedHandle);
|
|
10235
10266
|
const containerBounds = domNode == null ? void 0 : domNode.getBoundingClientRect();
|
|
10236
10267
|
if (!containerBounds || !handleType) {
|
|
@@ -10694,13 +10725,13 @@ function updateAbsoluteNodePositions(nodeInternals, nodeOrigin, parentNodes) {
|
|
|
10694
10725
|
throw new Error(`Parent node ${parentId} not found`);
|
|
10695
10726
|
}
|
|
10696
10727
|
if (parentId || (parentNodes == null ? void 0 : parentNodes[node.id])) {
|
|
10697
|
-
const { x, y
|
|
10728
|
+
const { x, y, z: z2 } = calculateXYZPosition(node, nodeInternals, {
|
|
10698
10729
|
...node.position,
|
|
10699
10730
|
z: ((_a2 = node[internalsSymbol]) == null ? void 0 : _a2.z) ?? 0
|
|
10700
10731
|
}, nodeOrigin);
|
|
10701
10732
|
node.positionAbsolute = {
|
|
10702
10733
|
x,
|
|
10703
|
-
y
|
|
10734
|
+
y
|
|
10704
10735
|
};
|
|
10705
10736
|
node[internalsSymbol].z = z2;
|
|
10706
10737
|
if (parentNodes == null ? void 0 : parentNodes[node.id]) {
|
|
@@ -10757,8 +10788,8 @@ function fitView(get2, options = {}) {
|
|
|
10757
10788
|
const nodesInitialized = nodes.every((n2) => n2.width && n2.height);
|
|
10758
10789
|
if (nodes.length > 0 && nodesInitialized) {
|
|
10759
10790
|
const bounds = getNodesBounds(nodes, nodeOrigin);
|
|
10760
|
-
const { x, y
|
|
10761
|
-
const nextTransform = identity.translate(x,
|
|
10791
|
+
const { x, y, zoom: zoom2 } = getViewportForBounds(bounds, width, height, options.minZoom ?? minZoom, options.maxZoom ?? maxZoom, options.padding ?? 0.1);
|
|
10792
|
+
const nextTransform = identity.translate(x, y).scale(zoom2);
|
|
10762
10793
|
if (typeof options.duration === "number" && options.duration > 0) {
|
|
10763
10794
|
d3Zoom.transform(getD3Transition(d3Selection, options.duration), nextTransform);
|
|
10764
10795
|
} else {
|
|
@@ -10838,27 +10869,27 @@ const useViewportHelper = () => {
|
|
|
10838
10869
|
zoomTo: (zoomLevel, options) => d3Zoom.scaleTo(getD3Transition(d3Selection, options == null ? void 0 : options.duration), zoomLevel),
|
|
10839
10870
|
getZoom: () => store.getState().transform[2],
|
|
10840
10871
|
setViewport: (transform, options) => {
|
|
10841
|
-
const [x,
|
|
10842
|
-
const nextTransform = identity.translate(transform.x ?? x, transform.y ??
|
|
10872
|
+
const [x, y, zoom2] = store.getState().transform;
|
|
10873
|
+
const nextTransform = identity.translate(transform.x ?? x, transform.y ?? y).scale(transform.zoom ?? zoom2);
|
|
10843
10874
|
d3Zoom.transform(getD3Transition(d3Selection, options == null ? void 0 : options.duration), nextTransform);
|
|
10844
10875
|
},
|
|
10845
10876
|
getViewport: () => {
|
|
10846
|
-
const [x,
|
|
10847
|
-
return { x, y
|
|
10877
|
+
const [x, y, zoom2] = store.getState().transform;
|
|
10878
|
+
return { x, y, zoom: zoom2 };
|
|
10848
10879
|
},
|
|
10849
10880
|
fitView: (options) => fitView(store.getState, options),
|
|
10850
|
-
setCenter: (x,
|
|
10881
|
+
setCenter: (x, y, options) => {
|
|
10851
10882
|
const { width, height, maxZoom } = store.getState();
|
|
10852
10883
|
const nextZoom = typeof (options == null ? void 0 : options.zoom) !== "undefined" ? options.zoom : maxZoom;
|
|
10853
10884
|
const centerX = width / 2 - x * nextZoom;
|
|
10854
|
-
const centerY = height / 2 -
|
|
10885
|
+
const centerY = height / 2 - y * nextZoom;
|
|
10855
10886
|
const transform = identity.translate(centerX, centerY).scale(nextZoom);
|
|
10856
10887
|
d3Zoom.transform(getD3Transition(d3Selection, options == null ? void 0 : options.duration), transform);
|
|
10857
10888
|
},
|
|
10858
10889
|
fitBounds: (bounds, options) => {
|
|
10859
10890
|
const { width, height, minZoom, maxZoom } = store.getState();
|
|
10860
|
-
const { x, y
|
|
10861
|
-
const transform = identity.translate(x,
|
|
10891
|
+
const { x, y, zoom: zoom2 } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, (options == null ? void 0 : options.padding) ?? 0.1);
|
|
10892
|
+
const transform = identity.translate(x, y).scale(zoom2);
|
|
10862
10893
|
d3Zoom.transform(getD3Transition(d3Selection, options == null ? void 0 : options.duration), transform);
|
|
10863
10894
|
},
|
|
10864
10895
|
// @deprecated Use `screenToFlowPosition`.
|
|
@@ -10960,13 +10991,13 @@ function useReactFlow() {
|
|
|
10960
10991
|
}, []);
|
|
10961
10992
|
const toObject = useCallback(() => {
|
|
10962
10993
|
const { getNodes: getNodes2, edges = [], transform } = store.getState();
|
|
10963
|
-
const [x,
|
|
10994
|
+
const [x, y, zoom2] = transform;
|
|
10964
10995
|
return {
|
|
10965
10996
|
nodes: getNodes2().map((n2) => ({ ...n2 })),
|
|
10966
10997
|
edges: edges.map((e) => ({ ...e })),
|
|
10967
10998
|
viewport: {
|
|
10968
10999
|
x,
|
|
10969
|
-
y
|
|
11000
|
+
y,
|
|
10970
11001
|
zoom: zoom2
|
|
10971
11002
|
}
|
|
10972
11003
|
};
|
|
@@ -11571,16 +11602,16 @@ const Pane = memo(({ isSelecting, selectionMode = SelectionMode.Full, panOnDrag,
|
|
|
11571
11602
|
if (!elementsSelectable || !isSelecting || event.button !== 0 || event.target !== container.current || !containerBounds.current) {
|
|
11572
11603
|
return;
|
|
11573
11604
|
}
|
|
11574
|
-
const { x, y
|
|
11605
|
+
const { x, y } = getEventPosition(event, containerBounds.current);
|
|
11575
11606
|
resetSelectedElements();
|
|
11576
11607
|
store.setState({
|
|
11577
11608
|
userSelectionRect: {
|
|
11578
11609
|
width: 0,
|
|
11579
11610
|
height: 0,
|
|
11580
11611
|
startX: x,
|
|
11581
|
-
startY:
|
|
11612
|
+
startY: y,
|
|
11582
11613
|
x,
|
|
11583
|
-
y
|
|
11614
|
+
y
|
|
11584
11615
|
}
|
|
11585
11616
|
});
|
|
11586
11617
|
onSelectionStart == null ? void 0 : onSelectionStart(event);
|
|
@@ -11811,10 +11842,10 @@ function useGetPointerPosition() {
|
|
|
11811
11842
|
const getPointerPosition = useCallback(({ sourceEvent: sourceEvent2 }) => {
|
|
11812
11843
|
const { transform, snapGrid, snapToGrid } = store.getState();
|
|
11813
11844
|
const x = sourceEvent2.touches ? sourceEvent2.touches[0].clientX : sourceEvent2.clientX;
|
|
11814
|
-
const
|
|
11845
|
+
const y = sourceEvent2.touches ? sourceEvent2.touches[0].clientY : sourceEvent2.clientY;
|
|
11815
11846
|
const pointerPos = {
|
|
11816
11847
|
x: (x - transform[0]) / transform[2],
|
|
11817
|
-
y: (
|
|
11848
|
+
y: (y - transform[1]) / transform[2]
|
|
11818
11849
|
};
|
|
11819
11850
|
return {
|
|
11820
11851
|
xSnapped: snapToGrid ? snapGrid[0] * Math.round(pointerPos.x / snapGrid[0]) : pointerPos.x,
|
|
@@ -11842,9 +11873,9 @@ function useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, n
|
|
|
11842
11873
|
useEffect(() => {
|
|
11843
11874
|
if (nodeRef == null ? void 0 : nodeRef.current) {
|
|
11844
11875
|
const selection2 = select(nodeRef.current);
|
|
11845
|
-
const updateNodes = ({ x, y
|
|
11876
|
+
const updateNodes = ({ x, y }) => {
|
|
11846
11877
|
const { nodeInternals, onNodeDrag, onSelectionDrag, updateNodePositions, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onError } = store.getState();
|
|
11847
|
-
lastPos.current = { x, y
|
|
11878
|
+
lastPos.current = { x, y };
|
|
11848
11879
|
let hasChange = false;
|
|
11849
11880
|
let nodesBox = { x: 0, y: 0, x2: 0, y2: 0 };
|
|
11850
11881
|
if (dragItems.current.length > 1 && nodeExtent) {
|
|
@@ -11852,7 +11883,7 @@ function useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, n
|
|
|
11852
11883
|
nodesBox = rectToBox(rect);
|
|
11853
11884
|
}
|
|
11854
11885
|
dragItems.current = dragItems.current.map((n2) => {
|
|
11855
|
-
const nextPosition = { x: x - n2.distance.x, y:
|
|
11886
|
+
const nextPosition = { x: x - n2.distance.x, y: y - n2.distance.y };
|
|
11856
11887
|
if (snapToGrid) {
|
|
11857
11888
|
nextPosition.x = snapGrid[0] * Math.round(nextPosition.x / snapGrid[0]);
|
|
11858
11889
|
nextPosition.y = snapGrid[1] * Math.round(nextPosition.y / snapGrid[1]);
|
|
@@ -11954,8 +11985,8 @@ function useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, n
|
|
|
11954
11985
|
}
|
|
11955
11986
|
if (!dragStarted.current) {
|
|
11956
11987
|
const x = pointerPos.xSnapped - (((_a2 = lastPos == null ? void 0 : lastPos.current) == null ? void 0 : _a2.x) ?? 0);
|
|
11957
|
-
const
|
|
11958
|
-
const distance2 = Math.sqrt(x * x +
|
|
11988
|
+
const y = pointerPos.ySnapped - (((_b3 = lastPos == null ? void 0 : lastPos.current) == null ? void 0 : _b3.y) ?? 0);
|
|
11989
|
+
const distance2 = Math.sqrt(x * x + y * y);
|
|
11959
11990
|
if (distance2 > nodeDragThreshold) {
|
|
11960
11991
|
startDrag(event);
|
|
11961
11992
|
}
|
|
@@ -12279,16 +12310,16 @@ function createNodeTypes(nodeTypes) {
|
|
|
12279
12310
|
...specialTypes
|
|
12280
12311
|
};
|
|
12281
12312
|
}
|
|
12282
|
-
const getPositionWithOrigin = ({ x, y
|
|
12313
|
+
const getPositionWithOrigin = ({ x, y, width, height, origin }) => {
|
|
12283
12314
|
if (!width || !height) {
|
|
12284
|
-
return { x, y
|
|
12315
|
+
return { x, y };
|
|
12285
12316
|
}
|
|
12286
12317
|
if (origin[0] < 0 || origin[1] < 0 || origin[0] > 1 || origin[1] > 1) {
|
|
12287
|
-
return { x, y
|
|
12318
|
+
return { x, y };
|
|
12288
12319
|
}
|
|
12289
12320
|
return {
|
|
12290
12321
|
x: x - width * origin[0],
|
|
12291
|
-
y:
|
|
12322
|
+
y: y - height * origin[1]
|
|
12292
12323
|
};
|
|
12293
12324
|
};
|
|
12294
12325
|
const selector$5 = (s) => ({
|
|
@@ -12358,12 +12389,12 @@ const shiftX = (x, shift, position) => {
|
|
|
12358
12389
|
return x + shift;
|
|
12359
12390
|
return x;
|
|
12360
12391
|
};
|
|
12361
|
-
const shiftY = (
|
|
12392
|
+
const shiftY = (y, shift, position) => {
|
|
12362
12393
|
if (position === Position.Top)
|
|
12363
|
-
return
|
|
12394
|
+
return y - shift;
|
|
12364
12395
|
if (position === Position.Bottom)
|
|
12365
|
-
return
|
|
12366
|
-
return
|
|
12396
|
+
return y + shift;
|
|
12397
|
+
return y;
|
|
12367
12398
|
};
|
|
12368
12399
|
const EdgeUpdaterClassName = "react-flow__edgeupdater";
|
|
12369
12400
|
const EdgeAnchor = ({ position, centerX, centerY, radius = 10, onMouseDown, onMouseEnter, onMouseOut, type }) => React__default.createElement("circle", { onMouseDown, onMouseEnter, onMouseOut, className: cc([EdgeUpdaterClassName, `${EdgeUpdaterClassName}-${type}`]), cx: shiftX(centerX, radius, position), cy: shiftY(centerY, radius, position), r: radius, stroke: "transparent", fill: "transparent" });
|
|
@@ -12493,29 +12524,29 @@ function createEdgeTypes(edgeTypes) {
|
|
|
12493
12524
|
}
|
|
12494
12525
|
function getHandlePosition(position, nodeRect, handle = null) {
|
|
12495
12526
|
const x = ((handle == null ? void 0 : handle.x) || 0) + nodeRect.x;
|
|
12496
|
-
const
|
|
12527
|
+
const y = ((handle == null ? void 0 : handle.y) || 0) + nodeRect.y;
|
|
12497
12528
|
const width = (handle == null ? void 0 : handle.width) || nodeRect.width;
|
|
12498
12529
|
const height = (handle == null ? void 0 : handle.height) || nodeRect.height;
|
|
12499
12530
|
switch (position) {
|
|
12500
12531
|
case Position.Top:
|
|
12501
12532
|
return {
|
|
12502
12533
|
x: x + width / 2,
|
|
12503
|
-
y
|
|
12534
|
+
y
|
|
12504
12535
|
};
|
|
12505
12536
|
case Position.Right:
|
|
12506
12537
|
return {
|
|
12507
12538
|
x: x + width,
|
|
12508
|
-
y:
|
|
12539
|
+
y: y + height / 2
|
|
12509
12540
|
};
|
|
12510
12541
|
case Position.Bottom:
|
|
12511
12542
|
return {
|
|
12512
12543
|
x: x + width / 2,
|
|
12513
|
-
y:
|
|
12544
|
+
y: y + height
|
|
12514
12545
|
};
|
|
12515
12546
|
case Position.Left:
|
|
12516
12547
|
return {
|
|
12517
12548
|
x,
|
|
12518
|
-
y:
|
|
12549
|
+
y: y + height / 2
|
|
12519
12550
|
};
|
|
12520
12551
|
}
|
|
12521
12552
|
}
|
|
@@ -12697,7 +12728,7 @@ const MarkerDefinitions = ({ defaultColor, rfId }) => {
|
|
|
12697
12728
|
const markers = useStore(
|
|
12698
12729
|
useCallback(markerSelector({ defaultColor, rfId }), [defaultColor, rfId]),
|
|
12699
12730
|
// the id includes all marker options, so we just need to look at that part of the marker
|
|
12700
|
-
(a2, b) => !(a2.length !== b.length || a2.some((
|
|
12731
|
+
(a2, b) => !(a2.length !== b.length || a2.some((m2, i2) => m2.id !== b[i2].id))
|
|
12701
12732
|
);
|
|
12702
12733
|
return React__default.createElement("defs", null, markers.map((marker) => React__default.createElement(Marker, { id: marker.id, key: marker.id, type: marker.type, color: marker.color, width: marker.width, height: marker.height, markerUnits: marker.markerUnits, strokeWidth: marker.strokeWidth, orient: marker.orient })));
|
|
12703
12734
|
};
|
|
@@ -13452,11 +13483,11 @@ class Tooltip extends Leaf {
|
|
|
13452
13483
|
const validValues = values.filter((c) => q$1.isFinite(c.value));
|
|
13453
13484
|
const { draw } = this.internal;
|
|
13454
13485
|
const avgXPosition = validValues.reduce((p, c) => p + c.position.x, 0) / validValues.length;
|
|
13455
|
-
const avgXValue = new
|
|
13486
|
+
const avgXValue = new m(
|
|
13456
13487
|
validValues.reduce((p, c) => p + c.value.x, 0) / validValues.length
|
|
13457
13488
|
);
|
|
13458
13489
|
const rulePosition = scale_.x.pos(avgXPosition);
|
|
13459
|
-
if (!
|
|
13490
|
+
if (!C.contains(To.xBounds(region), rulePosition))
|
|
13460
13491
|
return;
|
|
13461
13492
|
draw.rule({
|
|
13462
13493
|
stroke: this.state.ruleColor,
|
|
@@ -13642,7 +13673,7 @@ class Measure extends Leaf {
|
|
|
13642
13673
|
const s = k.XY.scale(To.DECIMAL).scale(props.region);
|
|
13643
13674
|
const onePos = s.pos(oneValue.position);
|
|
13644
13675
|
const twoPos = s.pos(twoValue.position);
|
|
13645
|
-
const xDist = new
|
|
13676
|
+
const xDist = new w(Math.abs(oneValue.value.x - twoValue.value.x));
|
|
13646
13677
|
const yDist = Math.abs(oneValue.value.y - twoValue.value.y);
|
|
13647
13678
|
const slope = yDist / xDist.seconds;
|
|
13648
13679
|
draw.line({
|
|
@@ -13666,7 +13697,7 @@ class Measure extends Leaf {
|
|
|
13666
13697
|
lineWidth: strokeWidth
|
|
13667
13698
|
});
|
|
13668
13699
|
draw.textContainer({
|
|
13669
|
-
text: [xDist.truncate(
|
|
13700
|
+
text: [xDist.truncate(w.MILLISECOND).toString()],
|
|
13670
13701
|
direction: "x",
|
|
13671
13702
|
position: q$1.construct((onePos.x + twoPos.x) / 2, twoPos.y),
|
|
13672
13703
|
level: "small"
|
|
@@ -13851,7 +13882,7 @@ const value = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
13851
13882
|
Value
|
|
13852
13883
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
13853
13884
|
const selectedStateZ = nk.payloadZ.extend({
|
|
13854
|
-
viewport:
|
|
13885
|
+
viewport: C.bounds
|
|
13855
13886
|
});
|
|
13856
13887
|
const providerStateZ = z.object({
|
|
13857
13888
|
cursor: q$1.xy.or(z.null()),
|
|
@@ -13890,7 +13921,7 @@ class Provider extends Leaf {
|
|
|
13890
13921
|
}
|
|
13891
13922
|
async fetchInitial(timeRange) {
|
|
13892
13923
|
const { internal: i2 } = this;
|
|
13893
|
-
if (i2.client == null || this.fetchedInitial.roughlyEquals(timeRange,
|
|
13924
|
+
if (i2.client == null || this.fetchedInitial.roughlyEquals(timeRange, w.minutes(1)))
|
|
13894
13925
|
return;
|
|
13895
13926
|
this.fetchedInitial = timeRange;
|
|
13896
13927
|
const ranges = await i2.client.ranges.retrieve(timeRange);
|
|
@@ -13922,7 +13953,7 @@ class Provider extends Leaf {
|
|
|
13922
13953
|
startPos = Y(startPos, To.left(region) - 2, To.right(region) - 1);
|
|
13923
13954
|
let hovered = false;
|
|
13924
13955
|
if (cursor != null)
|
|
13925
|
-
hovered =
|
|
13956
|
+
hovered = C.contains({ lower: startPos, upper: endPos }, cursor);
|
|
13926
13957
|
if (hovered)
|
|
13927
13958
|
hoveredState = {
|
|
13928
13959
|
key: r2.key,
|
|
@@ -14105,7 +14136,7 @@ class LinePlot extends Composite {
|
|
|
14105
14136
|
region,
|
|
14106
14137
|
canvases
|
|
14107
14138
|
};
|
|
14108
|
-
await Promise.all(this.measures.map(async (
|
|
14139
|
+
await Promise.all(this.measures.map(async (m2) => await m2.render(p)));
|
|
14109
14140
|
}
|
|
14110
14141
|
calculatePlot() {
|
|
14111
14142
|
return calculatePlotBox(this.state.grid, this.state.container);
|
|
@@ -14307,4 +14338,4 @@ export {
|
|
|
14307
14338
|
value as y,
|
|
14308
14339
|
canvas as z
|
|
14309
14340
|
};
|
|
14310
|
-
//# sourceMappingURL=LinePlot-
|
|
14341
|
+
//# sourceMappingURL=LinePlot-KYwy1D7H.js.map
|