@graphty/graphty-element 2.2.2 → 2.2.3
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/chunks/{XRPivotCameraController-SqoNytFf.js → XRPivotCameraController-DENGN2uV.js} +1 -1
- package/dist/chunks/{capability-check-Gdo5o38b.js → capability-check-BC3Qn6fS.js} +1 -1
- package/dist/chunks/{index-DnKqD4ge.js → index-COss7yTG.js} +700 -690
- package/dist/graphty-catalog.json +1 -1
- package/dist/graphty.bundle.js +15510 -15500
- package/dist/graphty.js +1 -1
- package/dist/src/Edge.d.ts +2 -0
- package/dist/src/Node.d.ts +3 -0
- package/package.json +5 -5
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Oi = (l) => {
|
|
2
2
|
throw TypeError(l);
|
|
3
3
|
};
|
|
4
|
-
var Ft = (l, e, t) => e.has(l) ||
|
|
5
|
-
var g = (l, e, t) => (Ft(l, e, "read from private field"), t ? t.call(l) : e.get(l)), T = (l, e, t) => e.has(l) ?
|
|
6
|
-
import { LitElement as
|
|
4
|
+
var Ft = (l, e, t) => e.has(l) || Oi("Cannot " + t);
|
|
5
|
+
var g = (l, e, t) => (Ft(l, e, "read from private field"), t ? t.call(l) : e.get(l)), T = (l, e, t) => e.has(l) ? Oi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), M = (l, e, t, i) => (Ft(l, e, "write to private field"), i ? i.call(l, t) : e.set(l, t), t), ne = (l, e, t) => (Ft(l, e, "access private method"), t);
|
|
6
|
+
import { LitElement as Gs, css as $s } from "lit";
|
|
7
7
|
import { property as D } from "lit/decorators.js";
|
|
8
|
-
import { l as
|
|
9
|
-
import { k as
|
|
8
|
+
import { l as q, _ as ie, V as Vs } from "./VoiceInputAdapter-BueUG885.js";
|
|
9
|
+
import { k as Hs, l as us, G as Ws, A as js, m as qs, n as Ri, p as Ks } from "./GraphSession-DDrQWABb.js";
|
|
10
10
|
import vt from "papaparse";
|
|
11
11
|
import { D as Z } from "./DataSource-DEg3igzS.js";
|
|
12
12
|
import { XMLParser as gs } from "fast-xml-parser";
|
|
13
|
-
import * as
|
|
13
|
+
import * as Zs from "jmespath";
|
|
14
14
|
import gt from "jmespath";
|
|
15
15
|
import { z as E } from "zod/v4";
|
|
16
|
-
import { D as
|
|
17
|
-
import { a as V, W as
|
|
18
|
-
import { A as N, j as fs, e as
|
|
16
|
+
import { D as Xs, N as Qs, h as Js, C as Ys, i as er, R as tr, j as Qt, m as ps, n as ir, K as sr, F as ms, A as rr, o as ar, q as or, r as nr, M as cr, t as hr, u as lr, v as dr, w as ur, x as gr, y as pr, z as mr, E as fr, H as yr, G as wr, I as vr, J as br, O as Sr, Q as Er, T as Cr, V as Mr, W as xr, X as Tr, Y as Pr, Z as Ar, _ as Or, $ as Rr, a0 as Ir, a1 as Dr, a2 as ge, a3 as Lr, c as Ii, b as Fr } from "./scales-DKsbJE2L.js";
|
|
17
|
+
import { a as V, W as Nr, A as kr } from "./paletteRegistry-NrWOKT-A.js";
|
|
18
|
+
import { A as N, j as fs, e as zr, m as Jt, o as _r, k as Br, h as Ur, i as Gr } from "./Algorithm-RQ629NLb.js";
|
|
19
19
|
import "@babylonjs/core/Culling/ray";
|
|
20
20
|
import "@babylonjs/core/Animations/animatable";
|
|
21
|
-
import { Effect as Me, Vector2 as
|
|
22
|
-
import { C as
|
|
23
|
-
import { b as
|
|
24
|
-
import { G as
|
|
25
|
-
import { u as
|
|
21
|
+
import { Effect as Me, Vector2 as $r, Vector3 as v, Mesh as H, StandardMaterial as Se, Color3 as F, MeshBuilder as J, VertexData as B, ShaderMaterial as Et, BoundingInfo as Vr, Camera as pt, GreasedLineMeshColorMode as Hr, RawTexture as Di, Engine as Ct, DynamicTexture as ys, Texture as Wr, AbstractMesh as jr, Ray as qr, Quaternion as ae, Matrix as De, Viewport as Kr, HighlightLayer as Zr, InstancedMesh as ws, GlowLayer as Xr, MaterialPluginBase as Qr, ShaderLanguage as bt, ActionManager as Li, ExecuteCodeAction as Jr, PointerEventTypes as Y, Color4 as Ee, Observable as Nt, KeyboardEventTypes as Fi, TransformNode as yi, Axis as kt, Space as zt, UniversalCamera as Yr, Scalar as ea, FreeCamera as ta, Logger as Ni, WebGPUEngine as ki, Scene as ia, HemisphericLight as sa, PerfCounter as se, SceneInstrumentation as ra, EngineInstrumentation as aa, CreateScreenshotAsync as oa, DefaultRenderingPipeline as na, FxaaPostProcess as ca, PhotoDome as ha, CubicEase as _t, EasingFunction as Bt, Animation as A } from "@babylonjs/core";
|
|
22
|
+
import { C as wi, j as vi, t as vs, b as bs } from "./cameras-ii4vngYY.js";
|
|
23
|
+
import { b as Ss, G as ue } from "./GraphtyLogger-5KEttFUo.js";
|
|
24
|
+
import { G as oe, i as Yt } from "./GraphtyError-BwcnblTH.js";
|
|
25
|
+
import { u as la, b as zi } from "./detect-CqN0mC6u.js";
|
|
26
26
|
import { z as I } from "zod";
|
|
27
|
-
import { INVALID_INDEX as
|
|
28
|
-
import { E as
|
|
29
|
-
import { CreateGreasedLine as
|
|
30
|
-
import { c as
|
|
31
|
-
import
|
|
32
|
-
import
|
|
27
|
+
import { INVALID_INDEX as K } from "@graphty/graph-format";
|
|
28
|
+
import { E as Es, a as Cs, b as da, d as ua, R as ga, e as ee, P as z, S as Re } from "./NodeStyle-DKj7HjMJ.js";
|
|
29
|
+
import { CreateGreasedLine as _i } from "@babylonjs/core/Meshes/Builders/greasedLineBuilder";
|
|
30
|
+
import { c as pa, D as Ms, G as ma, b as fa, a as ya } from "./GraphStyle-D0PXnZKu.js";
|
|
31
|
+
import wa from "p-queue";
|
|
32
|
+
import va from "toposort";
|
|
33
33
|
import xe from "hammerjs";
|
|
34
34
|
import "@babylonjs/core/Meshes/instancedMesh";
|
|
35
|
-
import { Vector2 as
|
|
35
|
+
import { Vector2 as xs } from "@babylonjs/core/Maths/math.vector";
|
|
36
36
|
import { Observable as W } from "@babylonjs/core/Misc/observable";
|
|
37
|
-
import { K as
|
|
37
|
+
import { K as ba } from "./types-B7bX5c0K.js";
|
|
38
38
|
import "./sequential-Zym81qm7.js";
|
|
39
39
|
import "./common-DWNKjpH_.js";
|
|
40
|
-
const
|
|
40
|
+
const Sa = E.strictObject({
|
|
41
41
|
/*
|
|
42
42
|
* Whether dropping a dragged node fixes it where the reader put it.
|
|
43
43
|
*
|
|
@@ -53,7 +53,7 @@ const ba = E.strictObject({
|
|
|
53
53
|
* on would have meant a session that froze one node per drag with no way out.
|
|
54
54
|
*/
|
|
55
55
|
pinOnDrag: E.boolean().default(!0)
|
|
56
|
-
}).prefault({}),
|
|
56
|
+
}).prefault({}), Ea = E.strictObject({
|
|
57
57
|
/*
|
|
58
58
|
* Whether node labels that would be drawn on top of each other are thinned out.
|
|
59
59
|
*
|
|
@@ -64,7 +64,7 @@ const ba = E.strictObject({
|
|
|
64
64
|
* the selection changes, and never on a frame where none of them did.
|
|
65
65
|
*/
|
|
66
66
|
declutter: E.boolean().default(!1)
|
|
67
|
-
}).prefault({}),
|
|
67
|
+
}).prefault({}), Ca = E.strictObject({
|
|
68
68
|
type: E.string().default("ngraph"),
|
|
69
69
|
preSteps: E.number().default(0),
|
|
70
70
|
stepMultiplier: E.number().default(1),
|
|
@@ -91,40 +91,40 @@ const ba = E.strictObject({
|
|
|
91
91
|
* entry per batch. A CPU simulation ignores it: its step is synchronous.
|
|
92
92
|
*/
|
|
93
93
|
maxInFlight: E.number().int().min(1).max(4).default(2)
|
|
94
|
-
}),
|
|
94
|
+
}), Ts = E.strictObject({
|
|
95
95
|
// dimensions: z.int().min(2).max(3).default(3),
|
|
96
|
-
layout:
|
|
97
|
-
node:
|
|
98
|
-
labels:
|
|
96
|
+
layout: Ca.prefault({}),
|
|
97
|
+
node: Sa,
|
|
98
|
+
labels: Ea,
|
|
99
99
|
fetchNodes: E.optional(E.instanceof(Function)),
|
|
100
100
|
fetchEdges: E.optional(E.instanceof(Function))
|
|
101
|
-
}), Ca = E.looseObject({
|
|
102
|
-
selector: E.string(),
|
|
103
|
-
style: Es
|
|
104
101
|
}), Ma = E.looseObject({
|
|
105
102
|
selector: E.string(),
|
|
106
|
-
style:
|
|
107
|
-
}), xa = E.
|
|
103
|
+
style: Cs
|
|
104
|
+
}), xa = E.looseObject({
|
|
105
|
+
selector: E.string(),
|
|
106
|
+
style: Es
|
|
107
|
+
}), Ta = E.object({
|
|
108
108
|
name: E.string()
|
|
109
|
-
}).loose(),
|
|
110
|
-
node:
|
|
111
|
-
edge:
|
|
112
|
-
metadata:
|
|
113
|
-
}).partial(),
|
|
109
|
+
}).loose(), Pa = E.looseObject({
|
|
110
|
+
node: Ma,
|
|
111
|
+
edge: xa,
|
|
112
|
+
metadata: Ta.optional()
|
|
113
|
+
}).partial(), Aa = E.strictObject({
|
|
114
114
|
templateName: E.string().optional(),
|
|
115
115
|
templateCreator: E.string().optional(),
|
|
116
116
|
templateCreationTimestamp: E.iso.datetime().optional(),
|
|
117
117
|
templateModificationTimestamp: E.iso.datetime().optional()
|
|
118
|
-
}),
|
|
118
|
+
}), Oa = E.strictObject({
|
|
119
119
|
graphtyTemplate: E.literal(!0),
|
|
120
120
|
majorVersion: E.literal("1"),
|
|
121
|
-
metadata:
|
|
122
|
-
graph:
|
|
121
|
+
metadata: Aa.optional(),
|
|
122
|
+
graph: pa.prefault({}),
|
|
123
123
|
/** Accepted and ignored. See {@link StyleLayer}; style layers are `session.styles`. */
|
|
124
|
-
layers: E.array(
|
|
125
|
-
data:
|
|
126
|
-
behavior:
|
|
127
|
-
}),
|
|
124
|
+
layers: E.array(Pa).prefault([]),
|
|
125
|
+
data: Hs.prefault({}),
|
|
126
|
+
behavior: Ts.prefault({})
|
|
127
|
+
}), Ra = E.discriminatedUnion("majorVersion", [Oa]), Ia = {
|
|
128
128
|
enabled: !1,
|
|
129
129
|
ui: {
|
|
130
130
|
enabled: !0,
|
|
@@ -154,20 +154,20 @@ const ba = E.strictObject({
|
|
|
154
154
|
enabled: !1,
|
|
155
155
|
easeTime: 200
|
|
156
156
|
}
|
|
157
|
-
},
|
|
157
|
+
}, Da = /* @__PURE__ */ new Set([
|
|
158
158
|
"snapshot-replaced",
|
|
159
159
|
"snapshot-dropped"
|
|
160
160
|
]);
|
|
161
|
-
function
|
|
162
|
-
return !
|
|
161
|
+
function La(l) {
|
|
162
|
+
return !Da.has(l.type);
|
|
163
163
|
}
|
|
164
|
-
const
|
|
164
|
+
const Fa = {
|
|
165
165
|
"node-click": "graphty-node-click",
|
|
166
166
|
"node-hover": "graphty-node-hover",
|
|
167
167
|
"node-drag-start": "graphty-node-drag-start",
|
|
168
168
|
"node-drag-end": "graphty-node-drag-end"
|
|
169
169
|
};
|
|
170
|
-
function
|
|
170
|
+
function Na(l) {
|
|
171
171
|
switch (l.type) {
|
|
172
172
|
case "node-click":
|
|
173
173
|
return {
|
|
@@ -190,11 +190,11 @@ function Fa(l) {
|
|
|
190
190
|
return null;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
const
|
|
193
|
+
const ka = [
|
|
194
194
|
["source", "target"],
|
|
195
195
|
["src", "dst"],
|
|
196
196
|
["from", "to"]
|
|
197
|
-
],
|
|
197
|
+
], Bi = [",", " ", ";", "|"];
|
|
198
198
|
function Ut(l) {
|
|
199
199
|
const e = /* @__PURE__ */ new Map();
|
|
200
200
|
let t = !1;
|
|
@@ -205,13 +205,13 @@ function Ut(l) {
|
|
|
205
205
|
if (!t && (i === `
|
|
206
206
|
` || i === "\r"))
|
|
207
207
|
break;
|
|
208
|
-
!t &&
|
|
208
|
+
!t && Bi.includes(i) && e.set(i, (e.get(i) ?? 0) + 1);
|
|
209
209
|
}
|
|
210
|
-
return
|
|
210
|
+
return Bi.reduce(
|
|
211
211
|
(i, s) => (e.get(s) ?? 0) > (e.get(i) ?? 0) ? s : i
|
|
212
212
|
);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function za(l) {
|
|
215
215
|
if (l.some((t) => /:(ID|LABEL|TYPE|START_ID|END_ID)/.test(t)))
|
|
216
216
|
return {
|
|
217
217
|
variant: "neo4j",
|
|
@@ -242,7 +242,7 @@ function ka(l) {
|
|
|
242
242
|
targetColumn: "target",
|
|
243
243
|
interactionColumn: "interaction"
|
|
244
244
|
};
|
|
245
|
-
const e =
|
|
245
|
+
const e = ka.find(([t, i]) => l.includes(t) && l.includes(i));
|
|
246
246
|
return e ? {
|
|
247
247
|
variant: "edge-list",
|
|
248
248
|
hasHeaders: !0,
|
|
@@ -260,7 +260,7 @@ function ka(l) {
|
|
|
260
260
|
delimiter: ","
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Ui(l, e) {
|
|
264
264
|
let t = 0, i = 0;
|
|
265
265
|
for (const s of l) {
|
|
266
266
|
const r = s[e];
|
|
@@ -274,7 +274,7 @@ function Bi(l, e) {
|
|
|
274
274
|
function Gt(l, e, t) {
|
|
275
275
|
return !(e in l) && !(t in l);
|
|
276
276
|
}
|
|
277
|
-
const
|
|
277
|
+
const Si = class Si extends Z {
|
|
278
278
|
/**
|
|
279
279
|
* Creates a new CSVDataSource instance.
|
|
280
280
|
* @param config - Configuration options for CSV parsing and data loading
|
|
@@ -350,7 +350,7 @@ const bi = class bi extends Z {
|
|
|
350
350
|
};
|
|
351
351
|
} else
|
|
352
352
|
r = {
|
|
353
|
-
...
|
|
353
|
+
...za(s),
|
|
354
354
|
delimiter: t
|
|
355
355
|
};
|
|
356
356
|
const a = r.variant === "neo4j" ? !1 : r.hasHeaders, o = vt.parse(e, {
|
|
@@ -504,7 +504,7 @@ const bi = class bi extends Z {
|
|
|
504
504
|
(t.length > 0 || i.length > 0) && (yield { nodes: t, edges: i });
|
|
505
505
|
}
|
|
506
506
|
*parseGephiFormat(e, t) {
|
|
507
|
-
const i = [], s = /* @__PURE__ */ new Set(), r = t.sourceColumn ?? "Source", a = t.targetColumn ?? "Target", o =
|
|
507
|
+
const i = [], s = /* @__PURE__ */ new Set(), r = t.sourceColumn ?? "Source", a = t.targetColumn ?? "Target", o = Ui(e, t.typeColumn ?? "Type");
|
|
508
508
|
o !== null && this.declareDirection(o.directed, o.statedBy, o.conflictingEdges);
|
|
509
509
|
for (let c = 0; c < e.length; c++)
|
|
510
510
|
try {
|
|
@@ -610,7 +610,7 @@ const bi = class bi extends Z {
|
|
|
610
610
|
dynamicTyping: !0,
|
|
611
611
|
skipEmptyLines: !0,
|
|
612
612
|
transformHeader: (c) => c.trim()
|
|
613
|
-
}).data, n =
|
|
613
|
+
}).data, n = Ui(o, "Type");
|
|
614
614
|
n !== null && this.declareDirection(n.directed, n.statedBy, n.conflictingEdges);
|
|
615
615
|
for (const c of o) {
|
|
616
616
|
const { source: h, src: d, Source: u, target: p, dst: m, Target: y, ...w } = c;
|
|
@@ -624,9 +624,9 @@ const bi = class bi extends Z {
|
|
|
624
624
|
yield* this.chunkData(i, s);
|
|
625
625
|
}
|
|
626
626
|
};
|
|
627
|
-
|
|
628
|
-
let
|
|
629
|
-
const
|
|
627
|
+
Si.type = "csv";
|
|
628
|
+
let ei = Si;
|
|
629
|
+
const Ei = class Ei extends Z {
|
|
630
630
|
/**
|
|
631
631
|
* Creates a new DOTDataSource instance.
|
|
632
632
|
* @param config - Configuration options for DOT parsing and data loading
|
|
@@ -973,9 +973,9 @@ const Si = class Si extends Z {
|
|
|
973
973
|
return e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : /^-?\d+$/.test(e) ? parseInt(e, 10) : /^-?\d+\.\d+$/.test(e) ? parseFloat(e) : e;
|
|
974
974
|
}
|
|
975
975
|
};
|
|
976
|
-
|
|
977
|
-
let
|
|
978
|
-
function
|
|
976
|
+
Ei.type = "dot";
|
|
977
|
+
let ti = Ei;
|
|
978
|
+
function Gi(l) {
|
|
979
979
|
switch (l.trim().toLowerCase()) {
|
|
980
980
|
case "directed":
|
|
981
981
|
return !0;
|
|
@@ -986,7 +986,7 @@ function Ui(l) {
|
|
|
986
986
|
return null;
|
|
987
987
|
}
|
|
988
988
|
}
|
|
989
|
-
function
|
|
989
|
+
function _a(l, e, t) {
|
|
990
990
|
return !l.written && e > 0 ? {
|
|
991
991
|
directed: !0,
|
|
992
992
|
statedBy: `type="directed" on ${e} edge(s), with no defaultedgetype on <graph>`,
|
|
@@ -997,7 +997,7 @@ function za(l, e, t) {
|
|
|
997
997
|
conflicts: l.directed ? t : e
|
|
998
998
|
};
|
|
999
999
|
}
|
|
1000
|
-
const
|
|
1000
|
+
const Ci = class Ci extends Z {
|
|
1001
1001
|
/**
|
|
1002
1002
|
* Creates a new GEXFDataSource instance.
|
|
1003
1003
|
* @param config - Configuration options for GEXF parsing and data loading
|
|
@@ -1033,7 +1033,7 @@ const Ei = class Ei extends Z {
|
|
|
1033
1033
|
const { graph: r } = s;
|
|
1034
1034
|
if (!r)
|
|
1035
1035
|
throw new Error("Invalid GEXF: missing <graph> element");
|
|
1036
|
-
const a = this.parseAttributeDefinitions(r.attributes, "node"), o = this.parseAttributeDefinitions(r.attributes, "edge"), n = this.parseNodes(r.nodes?.node, a), c = this.readDefaultEdgeType(r), { edges: h, statedDirected: d, statedUndirected: u } = this.parseEdges(r.edges?.edge, o), p =
|
|
1036
|
+
const a = this.parseAttributeDefinitions(r.attributes, "node"), o = this.parseAttributeDefinitions(r.attributes, "edge"), n = this.parseNodes(r.nodes?.node, a), c = this.readDefaultEdgeType(r), { edges: h, statedDirected: d, statedUndirected: u } = this.parseEdges(r.edges?.edge, o), p = _a(c, d, u);
|
|
1037
1037
|
this.declareDirection(p.directed, p.statedBy, p.conflicts), yield* this.chunkData(n, h);
|
|
1038
1038
|
}
|
|
1039
1039
|
/**
|
|
@@ -1062,7 +1062,7 @@ const Ei = class Ei extends Z {
|
|
|
1062
1062
|
readDefaultEdgeType(e) {
|
|
1063
1063
|
const t = e["@_defaultedgetype"];
|
|
1064
1064
|
if (typeof t == "string") {
|
|
1065
|
-
const i =
|
|
1065
|
+
const i = Gi(t);
|
|
1066
1066
|
return i !== null ? { directed: i, written: !0, statedBy: `defaultedgetype="${t}"` } : {
|
|
1067
1067
|
directed: !1,
|
|
1068
1068
|
written: !1,
|
|
@@ -1178,7 +1178,7 @@ const Ei = class Ei extends Z {
|
|
|
1178
1178
|
const d = { source: c, target: h };
|
|
1179
1179
|
if (n["@_id"] && (d.gexfId = n["@_id"]), n["@_label"] && (d.label = n["@_label"]), n["@_weight"] && (d.weight = parseFloat(n["@_weight"])), n["@_type"]) {
|
|
1180
1180
|
d.type = n["@_type"];
|
|
1181
|
-
const u =
|
|
1181
|
+
const u = Gi(n["@_type"]);
|
|
1182
1182
|
u === !0 ? r++ : u === !1 && a++;
|
|
1183
1183
|
}
|
|
1184
1184
|
if (n.attvalues?.attvalue) {
|
|
@@ -1213,9 +1213,9 @@ const Ei = class Ei extends Z {
|
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
1215
|
};
|
|
1216
|
-
|
|
1217
|
-
let
|
|
1218
|
-
function
|
|
1216
|
+
Ci.type = "gexf";
|
|
1217
|
+
let ii = Ci;
|
|
1218
|
+
function Ba(l) {
|
|
1219
1219
|
const e = l.directed;
|
|
1220
1220
|
if (typeof e == "number")
|
|
1221
1221
|
return { directed: e !== 0, statedBy: `directed ${String(e)}` };
|
|
@@ -1228,7 +1228,7 @@ function _a(l) {
|
|
|
1228
1228
|
}
|
|
1229
1229
|
return { directed: !1, statedBy: "the GML default for an absent directed key (undirected)" };
|
|
1230
1230
|
}
|
|
1231
|
-
const
|
|
1231
|
+
const Mi = class Mi extends Z {
|
|
1232
1232
|
/**
|
|
1233
1233
|
* Creates a new GMLDataSource instance.
|
|
1234
1234
|
* @param config - Configuration options for GML parsing and data loading
|
|
@@ -1247,7 +1247,7 @@ const Ci = class Ci extends Z {
|
|
|
1247
1247
|
const e = await this.getContent(), t = this.parseGML(e);
|
|
1248
1248
|
if (!t)
|
|
1249
1249
|
return;
|
|
1250
|
-
const i = this.extractNodes(t), s = this.extractEdges(t), r =
|
|
1250
|
+
const i = this.extractNodes(t), s = this.extractEdges(t), r = Ba(t);
|
|
1251
1251
|
this.declareDirection(r.directed, r.statedBy), yield* this.chunkData(i, s);
|
|
1252
1252
|
}
|
|
1253
1253
|
parseGML(e) {
|
|
@@ -1379,23 +1379,23 @@ const Ci = class Ci extends Z {
|
|
|
1379
1379
|
return t;
|
|
1380
1380
|
}
|
|
1381
1381
|
};
|
|
1382
|
-
|
|
1383
|
-
let
|
|
1384
|
-
function
|
|
1382
|
+
Mi.type = "gml";
|
|
1383
|
+
let si = Mi;
|
|
1384
|
+
function Ua(l) {
|
|
1385
1385
|
const e = l["@_edgedefault"];
|
|
1386
1386
|
if (typeof e != "string")
|
|
1387
1387
|
return null;
|
|
1388
1388
|
const t = e.trim().toLowerCase();
|
|
1389
1389
|
return t !== "directed" && t !== "undirected" ? null : { directed: t === "directed", statedBy: `edgedefault="${e}"` };
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function Ga(l) {
|
|
1392
1392
|
const e = l["@_directed"];
|
|
1393
1393
|
if (typeof e != "string")
|
|
1394
1394
|
return null;
|
|
1395
1395
|
const t = e.trim().toLowerCase();
|
|
1396
1396
|
return t === "true" ? !0 : t === "false" ? !1 : null;
|
|
1397
1397
|
}
|
|
1398
|
-
const
|
|
1398
|
+
const xi = class xi extends Z {
|
|
1399
1399
|
/**
|
|
1400
1400
|
* Creates a new GraphMLDataSource instance.
|
|
1401
1401
|
* @param config - Configuration options for GraphML parsing and data loading
|
|
@@ -1430,7 +1430,7 @@ const Mi = class Mi extends Z {
|
|
|
1430
1430
|
const r = this.parseKeyDefinitions(s.key), { graph: a } = s;
|
|
1431
1431
|
if (!a)
|
|
1432
1432
|
return;
|
|
1433
|
-
const o = this.parseNodes(a.node, r), n =
|
|
1433
|
+
const o = this.parseNodes(a.node, r), n = Ua(a), { edges: c, conflicts: h } = this.parseEdges(a.edge, r, n?.directed ?? null);
|
|
1434
1434
|
n !== null && this.declareDirection(n.directed, n.statedBy, h), yield* this.chunkData(o, c);
|
|
1435
1435
|
}
|
|
1436
1436
|
parseKeyDefinitions(e) {
|
|
@@ -1519,7 +1519,7 @@ const Mi = class Mi extends Z {
|
|
|
1519
1519
|
});
|
|
1520
1520
|
continue;
|
|
1521
1521
|
}
|
|
1522
|
-
const h = { source: n, target: c }, d =
|
|
1522
|
+
const h = { source: n, target: c }, d = Ga(o);
|
|
1523
1523
|
if (d !== null && (h.directed = d, i !== null && d !== i && a++), o.data) {
|
|
1524
1524
|
const u = Array.isArray(o.data) ? o.data : [o.data];
|
|
1525
1525
|
for (const p of u) {
|
|
@@ -1633,15 +1633,15 @@ const Mi = class Mi extends Z {
|
|
|
1633
1633
|
return t;
|
|
1634
1634
|
}
|
|
1635
1635
|
};
|
|
1636
|
-
|
|
1637
|
-
let
|
|
1638
|
-
const
|
|
1636
|
+
xi.type = "graphml";
|
|
1637
|
+
let ri = xi;
|
|
1638
|
+
const $a = E.strictObject({
|
|
1639
1639
|
path: E.string().default("nodes"),
|
|
1640
1640
|
schema: E.custom().or(E.null()).default(null)
|
|
1641
|
-
}).prefault({}),
|
|
1641
|
+
}).prefault({}), Va = E.strictObject({
|
|
1642
1642
|
path: E.string().default("edges"),
|
|
1643
1643
|
schema: E.custom().or(E.null()).default(null)
|
|
1644
|
-
}).prefault({}),
|
|
1644
|
+
}).prefault({}), Ha = E.object({
|
|
1645
1645
|
data: E.string().optional(),
|
|
1646
1646
|
file: E.instanceof(File).optional(),
|
|
1647
1647
|
url: E.string().optional(),
|
|
@@ -1650,22 +1650,22 @@ const Ga = E.strictObject({
|
|
|
1650
1650
|
nodeIdPath: E.string().optional(),
|
|
1651
1651
|
edgeSrcIdPath: E.string().optional(),
|
|
1652
1652
|
edgeDstIdPath: E.string().optional(),
|
|
1653
|
-
node:
|
|
1654
|
-
edge:
|
|
1653
|
+
node: $a,
|
|
1654
|
+
edge: Va
|
|
1655
1655
|
});
|
|
1656
|
-
function
|
|
1656
|
+
function Wa(l) {
|
|
1657
1657
|
if (l === null || typeof l != "object" || Array.isArray(l))
|
|
1658
1658
|
return null;
|
|
1659
1659
|
const e = l.directed;
|
|
1660
1660
|
return typeof e != "boolean" ? null : { directed: e, statedBy: `"directed": ${String(e)}` };
|
|
1661
1661
|
}
|
|
1662
|
-
const
|
|
1662
|
+
const Ti = class Ti extends Z {
|
|
1663
1663
|
/**
|
|
1664
1664
|
* Creates a new JsonDataSource instance.
|
|
1665
1665
|
* @param anyOpts - Configuration options for JSON parsing and data extraction
|
|
1666
1666
|
*/
|
|
1667
1667
|
constructor(e) {
|
|
1668
|
-
const t =
|
|
1668
|
+
const t = Ha.parse(e);
|
|
1669
1669
|
super(t.errorLimit ?? 100, t.chunkSize ?? Z.DEFAULT_CHUNK_SIZE), this.opts = t, t.node.schema && (this.nodeSchema = t.node.schema), t.edge.schema && (this.edgeSchema = t.edge.schema);
|
|
1670
1670
|
}
|
|
1671
1671
|
getConfig() {
|
|
@@ -1701,7 +1701,7 @@ const xi = class xi extends Z {
|
|
|
1701
1701
|
yield* this.chunkData([], []);
|
|
1702
1702
|
return;
|
|
1703
1703
|
}
|
|
1704
|
-
const i =
|
|
1704
|
+
const i = Wa(e);
|
|
1705
1705
|
i !== null && this.declareDirection(i.directed, i.statedBy);
|
|
1706
1706
|
let s = [];
|
|
1707
1707
|
try {
|
|
@@ -1826,13 +1826,13 @@ const xi = class xi extends Z {
|
|
|
1826
1826
|
return !0;
|
|
1827
1827
|
}
|
|
1828
1828
|
};
|
|
1829
|
-
|
|
1830
|
-
let
|
|
1831
|
-
function
|
|
1829
|
+
Ti.type = "json";
|
|
1830
|
+
let ai = Ti;
|
|
1831
|
+
function ja(l, e) {
|
|
1832
1832
|
const t = l.filter((i) => i.directed).length;
|
|
1833
1833
|
return t > 0 ? { directed: !0, statedBy: "*Arcs", conflictingEdges: l.length - t } : l.length > 0 ? { directed: !1, statedBy: "*Edges", conflictingEdges: 0 } : e.arcs ? { directed: !0, statedBy: "*Arcs", conflictingEdges: 0 } : e.edges ? { directed: !1, statedBy: "*Edges", conflictingEdges: 0 } : null;
|
|
1834
1834
|
}
|
|
1835
|
-
const
|
|
1835
|
+
const Pi = class Pi extends Z {
|
|
1836
1836
|
/**
|
|
1837
1837
|
* Creates a new PajekDataSource instance.
|
|
1838
1838
|
* @param config - Configuration options for Pajek parsing and data loading
|
|
@@ -1848,7 +1848,7 @@ const Ti = class Ti extends Z {
|
|
|
1848
1848
|
* @yields DataSourceChunk objects containing parsed nodes and edges
|
|
1849
1849
|
*/
|
|
1850
1850
|
async *sourceFetchData() {
|
|
1851
|
-
const e = await this.getContent(), { vertices: t, edges: i, headers: s } = this.parsePajek(e), r = t.map((n) => this.vertexToNode(n)), a = i.map((n) => this.edgeToEdgeData(n)), o =
|
|
1851
|
+
const e = await this.getContent(), { vertices: t, edges: i, headers: s } = this.parsePajek(e), r = t.map((n) => this.vertexToNode(n)), a = i.map((n) => this.edgeToEdgeData(n)), o = ja(i, s);
|
|
1852
1852
|
o !== null && this.declareDirection(o.directed, o.statedBy, o.conflictingEdges), yield* this.chunkData(r, a);
|
|
1853
1853
|
}
|
|
1854
1854
|
parsePajek(e) {
|
|
@@ -1963,34 +1963,32 @@ const Ti = class Ti extends Z {
|
|
|
1963
1963
|
return e.weight !== void 0 && (t.weight = e.weight), t;
|
|
1964
1964
|
}
|
|
1965
1965
|
};
|
|
1966
|
-
|
|
1967
|
-
let
|
|
1966
|
+
Pi.type = "pajek";
|
|
1967
|
+
let oi = Pi;
|
|
1968
|
+
Z.register(ai);
|
|
1968
1969
|
Z.register(ri);
|
|
1970
|
+
Z.register(ei);
|
|
1969
1971
|
Z.register(si);
|
|
1970
|
-
Z.register(Yt);
|
|
1971
1972
|
Z.register(ii);
|
|
1972
1973
|
Z.register(ti);
|
|
1973
|
-
Z.register(
|
|
1974
|
-
Z.register(ai);
|
|
1975
|
-
V.register(Ks);
|
|
1976
|
-
V.register(Zs);
|
|
1974
|
+
Z.register(oi);
|
|
1977
1975
|
V.register(Xs);
|
|
1978
1976
|
V.register(Qs);
|
|
1979
1977
|
V.register(Js);
|
|
1980
1978
|
V.register(Ys);
|
|
1981
|
-
V.register(Xt);
|
|
1982
|
-
V.register(ps);
|
|
1983
1979
|
V.register(er);
|
|
1984
1980
|
V.register(tr);
|
|
1985
|
-
V.register(
|
|
1981
|
+
V.register(Qt);
|
|
1982
|
+
V.register(ps);
|
|
1986
1983
|
V.register(ir);
|
|
1987
1984
|
V.register(sr);
|
|
1985
|
+
V.register(ms);
|
|
1988
1986
|
V.register(rr);
|
|
1989
1987
|
V.register(ar);
|
|
1990
1988
|
V.register(or);
|
|
1991
1989
|
V.register(nr);
|
|
1992
|
-
|
|
1993
|
-
|
|
1990
|
+
V.register(cr);
|
|
1991
|
+
V.register(hr);
|
|
1994
1992
|
N.register(lr);
|
|
1995
1993
|
N.register(dr);
|
|
1996
1994
|
N.register(ur);
|
|
@@ -2012,23 +2010,25 @@ N.register(Pr);
|
|
|
2012
2010
|
N.register(Ar);
|
|
2013
2011
|
N.register(Or);
|
|
2014
2012
|
N.register(Rr);
|
|
2015
|
-
|
|
2016
|
-
|
|
2013
|
+
N.register(Ir);
|
|
2014
|
+
N.register(Dr);
|
|
2015
|
+
const ce = 10;
|
|
2016
|
+
function qa() {
|
|
2017
2017
|
return Object.freeze({
|
|
2018
|
-
min: { x: -
|
|
2019
|
-
max: { x:
|
|
2018
|
+
min: { x: -ce, y: -ce, z: -ce },
|
|
2019
|
+
max: { x: ce, y: ce, z: ce },
|
|
2020
2020
|
center: { x: 0, y: 0, z: 0 },
|
|
2021
|
-
size: { x:
|
|
2022
|
-
maxDimension:
|
|
2021
|
+
size: { x: ce * 2, y: ce * 2, z: ce * 2 },
|
|
2022
|
+
maxDimension: ce * 2,
|
|
2023
2023
|
measured: 0
|
|
2024
2024
|
});
|
|
2025
2025
|
}
|
|
2026
|
-
function
|
|
2026
|
+
function Ka(l) {
|
|
2027
2027
|
let e = 1 / 0, t = 1 / 0, i = 1 / 0, s = -1 / 0, r = -1 / 0, a = -1 / 0, o = 0;
|
|
2028
2028
|
for (const c of l)
|
|
2029
2029
|
e = Math.min(e, c.x), t = Math.min(t, c.y), i = Math.min(i, c.z), s = Math.max(s, c.x), r = Math.max(r, c.y), a = Math.max(a, c.z), o++;
|
|
2030
2030
|
if (o === 0)
|
|
2031
|
-
return
|
|
2031
|
+
return qa();
|
|
2032
2032
|
const n = { x: s - e, y: r - t, z: a - i };
|
|
2033
2033
|
return Object.freeze({
|
|
2034
2034
|
min: { x: e, y: t, z: i },
|
|
@@ -2039,18 +2039,18 @@ function qa(l) {
|
|
|
2039
2039
|
measured: o
|
|
2040
2040
|
});
|
|
2041
2041
|
}
|
|
2042
|
-
const
|
|
2043
|
-
function
|
|
2042
|
+
const Za = 0.8, Xa = 1.05, Qa = 1.1, Ja = 0.65, $t = 0.577, Dt = 1.5, Ya = 0.615;
|
|
2043
|
+
function eo(l) {
|
|
2044
2044
|
const { bounds: e } = l, { center: t } = e;
|
|
2045
2045
|
if (l.mode === "2d") {
|
|
2046
2046
|
const a = Math.max(e.size.x, e.size.y / l.aspect);
|
|
2047
2047
|
return {
|
|
2048
2048
|
type: "orthographic",
|
|
2049
|
-
zoom: l.viewport.width / (a *
|
|
2049
|
+
zoom: l.viewport.width / (a * Xa),
|
|
2050
2050
|
pan: { x: t.x, y: t.y }
|
|
2051
2051
|
};
|
|
2052
2052
|
}
|
|
2053
|
-
const i = l.fov ??
|
|
2053
|
+
const i = l.fov ?? Za, r = e.maxDimension / Math.tan(i / 2) * Qa * Ja;
|
|
2054
2054
|
return {
|
|
2055
2055
|
type: "arcRotate",
|
|
2056
2056
|
position: {
|
|
@@ -2061,7 +2061,7 @@ function Ya(l) {
|
|
|
2061
2061
|
target: t
|
|
2062
2062
|
};
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2064
|
+
function to(l) {
|
|
2065
2065
|
const { center: e } = l.bounds;
|
|
2066
2066
|
if (l.mode === "2d")
|
|
2067
2067
|
return {
|
|
@@ -2076,7 +2076,7 @@ function eo(l) {
|
|
|
2076
2076
|
target: e
|
|
2077
2077
|
};
|
|
2078
2078
|
}
|
|
2079
|
-
function
|
|
2079
|
+
function io(l) {
|
|
2080
2080
|
const { center: e } = l.bounds, t = l.bounds.maxDimension * Dt;
|
|
2081
2081
|
return {
|
|
2082
2082
|
type: "arcRotate",
|
|
@@ -2084,7 +2084,7 @@ function to(l) {
|
|
|
2084
2084
|
target: e
|
|
2085
2085
|
};
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2087
|
+
function so(l) {
|
|
2088
2088
|
const { center: e } = l.bounds, t = l.bounds.maxDimension * Dt;
|
|
2089
2089
|
return {
|
|
2090
2090
|
type: "arcRotate",
|
|
@@ -2092,48 +2092,48 @@ function io(l) {
|
|
|
2092
2092
|
target: e
|
|
2093
2093
|
};
|
|
2094
2094
|
}
|
|
2095
|
-
function
|
|
2095
|
+
function ro(l) {
|
|
2096
2096
|
return {
|
|
2097
2097
|
type: "arcRotate",
|
|
2098
2098
|
alpha: Math.PI / 4,
|
|
2099
|
-
beta:
|
|
2099
|
+
beta: Ya,
|
|
2100
2100
|
radius: l.bounds.maxDimension * Dt,
|
|
2101
2101
|
target: l.bounds.center
|
|
2102
2102
|
};
|
|
2103
2103
|
}
|
|
2104
|
-
const
|
|
2105
|
-
fitToGraph:
|
|
2106
|
-
topView:
|
|
2107
|
-
sideView:
|
|
2108
|
-
frontView:
|
|
2109
|
-
isometric:
|
|
2104
|
+
const $i = Object.freeze({
|
|
2105
|
+
fitToGraph: eo,
|
|
2106
|
+
topView: to,
|
|
2107
|
+
sideView: io,
|
|
2108
|
+
frontView: so,
|
|
2109
|
+
isometric: ro
|
|
2110
2110
|
});
|
|
2111
|
-
function
|
|
2112
|
-
return Object.hasOwn(
|
|
2111
|
+
function ao(l) {
|
|
2112
|
+
return Object.hasOwn($i, l) ? $i[l] : void 0;
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2114
|
+
function ni() {
|
|
2115
2115
|
return [
|
|
2116
|
-
...
|
|
2117
|
-
...
|
|
2116
|
+
...wi.map((l) => l.id),
|
|
2117
|
+
...zr().map((l) => l.id)
|
|
2118
2118
|
];
|
|
2119
2119
|
}
|
|
2120
2120
|
function Vt(l) {
|
|
2121
|
-
return
|
|
2121
|
+
return wi.some((e) => e.id === l) || fs(l) !== void 0;
|
|
2122
2122
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const e =
|
|
2123
|
+
function oo(l) {
|
|
2124
|
+
const e = ao(l);
|
|
2125
2125
|
if (e !== void 0) {
|
|
2126
|
-
const i =
|
|
2126
|
+
const i = wi.find((s) => s.id === l);
|
|
2127
2127
|
return i === void 0 ? void 0 : { descriptor: i, compute: e };
|
|
2128
2128
|
}
|
|
2129
2129
|
const t = fs(l);
|
|
2130
2130
|
return t === void 0 ? void 0 : { descriptor: t.descriptor, compute: t.compute };
|
|
2131
2131
|
}
|
|
2132
|
-
function
|
|
2133
|
-
const t =
|
|
2132
|
+
function no(l, e) {
|
|
2133
|
+
const t = oo(l);
|
|
2134
2134
|
if (t === void 0) {
|
|
2135
|
-
const o =
|
|
2136
|
-
throw new
|
|
2135
|
+
const o = ni();
|
|
2136
|
+
throw new oe({
|
|
2137
2137
|
code: "E_UNKNOWN_CAMERA",
|
|
2138
2138
|
message: `no camera view is named "${l}". The views that can be named are: ${o.join(", ")}`,
|
|
2139
2139
|
source: "view",
|
|
@@ -2142,7 +2142,7 @@ function oo(l, e) {
|
|
|
2142
2142
|
}
|
|
2143
2143
|
const { descriptor: i, compute: s } = t;
|
|
2144
2144
|
if (!i.modes.includes(e.mode))
|
|
2145
|
-
throw new
|
|
2145
|
+
throw new oe({
|
|
2146
2146
|
code: "E_UNSUPPORTED",
|
|
2147
2147
|
message: `the camera view "${l}" cannot be computed while the element is drawing in ${e.mode}: it declares ${i.modes.join(" and ")}`,
|
|
2148
2148
|
source: "view",
|
|
@@ -2153,7 +2153,7 @@ function oo(l, e) {
|
|
|
2153
2153
|
modes: [...i.modes]
|
|
2154
2154
|
}
|
|
2155
2155
|
});
|
|
2156
|
-
const r =
|
|
2156
|
+
const r = Ss(i.options, e.options ?? {}, { kind: "camera", id: l }), a = {
|
|
2157
2157
|
bounds: e.bounds,
|
|
2158
2158
|
mode: e.mode,
|
|
2159
2159
|
aspect: e.aspect,
|
|
@@ -2164,7 +2164,7 @@ function oo(l, e) {
|
|
|
2164
2164
|
};
|
|
2165
2165
|
return s(a);
|
|
2166
2166
|
}
|
|
2167
|
-
const
|
|
2167
|
+
const co = I.object({
|
|
2168
2168
|
/**
|
|
2169
2169
|
* Enable/disable XR functionality globally
|
|
2170
2170
|
* @default true
|
|
@@ -2295,7 +2295,7 @@ const no = I.object({
|
|
|
2295
2295
|
*/
|
|
2296
2296
|
easeTime: I.number().positive().default(200)
|
|
2297
2297
|
}).default({})
|
|
2298
|
-
}).default({}),
|
|
2298
|
+
}).default({}), ho = {
|
|
2299
2299
|
notification: {
|
|
2300
2300
|
backgroundColor: "rgba(255, 59, 48, 1)",
|
|
2301
2301
|
textColor: "white",
|
|
@@ -2412,7 +2412,7 @@ const no = I.object({
|
|
|
2412
2412
|
}, mt = {
|
|
2413
2413
|
getBadgeStyle(l) {
|
|
2414
2414
|
if (l)
|
|
2415
|
-
return
|
|
2415
|
+
return ho[l];
|
|
2416
2416
|
},
|
|
2417
2417
|
applyBadgeBehaviors(l, e) {
|
|
2418
2418
|
const t = l._badgeType;
|
|
@@ -2438,8 +2438,8 @@ const no = I.object({
|
|
|
2438
2438
|
applyIconBehavior(l, e) {
|
|
2439
2439
|
e.icon && !e.text ? l.text = e.icon : e.icon && e.text && ((e.iconPosition ?? "left") === "left" ? l.text = `${e.icon} ${e.text}` : l.text = `${e.text} ${e.icon}`);
|
|
2440
2440
|
}
|
|
2441
|
-
},
|
|
2442
|
-
function
|
|
2441
|
+
}, ci = "#FFFFFF", Ps = Cs.parse(da), As = Es.parse(ua), Vi = Object.freeze([]);
|
|
2442
|
+
function ke(l, e, t) {
|
|
2443
2443
|
const i = e.split(".");
|
|
2444
2444
|
let s = l;
|
|
2445
2445
|
for (let r = 0; r < i.length - 1; r++) {
|
|
@@ -2453,10 +2453,10 @@ function ct(l, e, t) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
s[i[i.length - 1]] = t;
|
|
2455
2455
|
}
|
|
2456
|
-
function
|
|
2456
|
+
function lo(l) {
|
|
2457
2457
|
return l.split(".").slice(0, -1).join(".");
|
|
2458
2458
|
}
|
|
2459
|
-
const
|
|
2459
|
+
const uo = {
|
|
2460
2460
|
enabled: "enabled",
|
|
2461
2461
|
font: "font",
|
|
2462
2462
|
sizePx: "fontSize",
|
|
@@ -2501,47 +2501,47 @@ const lo = {
|
|
|
2501
2501
|
smartOverflow: "smartOverflow",
|
|
2502
2502
|
maxNumber: "maxNumber",
|
|
2503
2503
|
overflowSuffix: "overflowSuffix"
|
|
2504
|
-
},
|
|
2505
|
-
function
|
|
2504
|
+
}, go = new Set(Object.keys(ga.shape));
|
|
2505
|
+
function po(l) {
|
|
2506
2506
|
const e = mt.getBadgeStyle(l) ?? {}, t = {};
|
|
2507
2507
|
for (const [i, s] of Object.entries(e))
|
|
2508
|
-
|
|
2508
|
+
go.has(i) && s !== void 0 && (t[i] = s);
|
|
2509
2509
|
return t;
|
|
2510
2510
|
}
|
|
2511
|
-
function
|
|
2512
|
-
const e = {}, t =
|
|
2511
|
+
function mo(l) {
|
|
2512
|
+
const e = {}, t = uo;
|
|
2513
2513
|
for (const [i, s] of Object.entries(l)) {
|
|
2514
2514
|
const r = t[i];
|
|
2515
2515
|
r !== void 0 && s !== void 0 && (e[r] = s);
|
|
2516
2516
|
}
|
|
2517
2517
|
if (l.weight !== void 0 && (e.fontWeight = String(l.weight)), l.outline !== void 0 && (e.textOutline = !0, e.textOutlineColor = l.outline), l.gradientColors !== void 0 && (e.backgroundGradientColors = [...l.gradientColors]), l.badge !== void 0)
|
|
2518
|
-
for (const [i, s] of Object.entries(
|
|
2518
|
+
for (const [i, s] of Object.entries(po(l.badge)))
|
|
2519
2519
|
e[i] ??= s;
|
|
2520
2520
|
return e;
|
|
2521
2521
|
}
|
|
2522
|
-
function
|
|
2523
|
-
const i =
|
|
2522
|
+
function Os(l, e, t) {
|
|
2523
|
+
const i = bs[e];
|
|
2524
2524
|
if (!i.renderable)
|
|
2525
2525
|
return;
|
|
2526
2526
|
if (i.accepts === "labelStyle") {
|
|
2527
|
-
for (const [r, a] of Object.entries(
|
|
2528
|
-
|
|
2527
|
+
for (const [r, a] of Object.entries(mo(t)))
|
|
2528
|
+
ke(l, `${i.stylePath}.${r}`, a);
|
|
2529
2529
|
return;
|
|
2530
2530
|
}
|
|
2531
|
-
const s =
|
|
2532
|
-
|
|
2531
|
+
const s = vi(t);
|
|
2532
|
+
ke(l, i.stylePath, s === null ? t : s.hex), i.accepts === "text" && ke(l, `${lo(i.stylePath)}.enabled`, !0);
|
|
2533
2533
|
}
|
|
2534
|
-
function
|
|
2535
|
-
const e = (t) =>
|
|
2534
|
+
function Rs(l) {
|
|
2535
|
+
const e = (t) => bs[t]?.accepts === "labelStyle" ? 1 : 0;
|
|
2536
2536
|
return Object.entries(l).sort(([t], [i]) => e(t) - e(i));
|
|
2537
2537
|
}
|
|
2538
|
-
function
|
|
2538
|
+
function fo(l, e) {
|
|
2539
2539
|
const t = {};
|
|
2540
2540
|
let i = null, s;
|
|
2541
|
-
for (const [r, a] of
|
|
2541
|
+
for (const [r, a] of Rs(l)) {
|
|
2542
2542
|
const o = r;
|
|
2543
2543
|
if (o === "node.color") {
|
|
2544
|
-
const n =
|
|
2544
|
+
const n = vi(a);
|
|
2545
2545
|
i = n === null ? null : { r: n.r, g: n.g, b: n.b, a: n.a };
|
|
2546
2546
|
continue;
|
|
2547
2547
|
}
|
|
@@ -2549,32 +2549,40 @@ function mo(l, e) {
|
|
|
2549
2549
|
s = typeof a == "number" ? a : void 0;
|
|
2550
2550
|
continue;
|
|
2551
2551
|
}
|
|
2552
|
-
|
|
2552
|
+
Os(t, o, a);
|
|
2553
2553
|
}
|
|
2554
|
-
return
|
|
2554
|
+
return ke(
|
|
2555
2555
|
t,
|
|
2556
2556
|
"texture.color",
|
|
2557
|
-
s === void 0 ?
|
|
2557
|
+
s === void 0 ? ci : { colorType: "solid", value: ci, opacity: s }
|
|
2558
2558
|
), {
|
|
2559
2559
|
meshKey: s === void 0 ? `s${String(e)}` : `s${String(e)}o${String(s)}`,
|
|
2560
|
-
style:
|
|
2560
|
+
style: q.defaultsDeep(t, q.cloneDeep(Ps)),
|
|
2561
2561
|
color: i
|
|
2562
2562
|
};
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2564
|
+
function yo(l, e) {
|
|
2565
2565
|
const t = {};
|
|
2566
|
-
for (const [a, o] of
|
|
2567
|
-
|
|
2568
|
-
const i =
|
|
2569
|
-
return { meshKey: `s${String(e)}|${i?.hex ?? ""}|${s === void 0 ? "" : String(s)}`, style:
|
|
2566
|
+
for (const [a, o] of Rs(l))
|
|
2567
|
+
Os(t, a, o);
|
|
2568
|
+
const i = vi(l["edge.color"]), s = l["edge.opacity"];
|
|
2569
|
+
return { meshKey: `s${String(e)}|${i?.hex ?? ""}|${s === void 0 ? "" : String(s)}`, style: Is(q.defaultsDeep(t, q.cloneDeep(As))) };
|
|
2570
2570
|
}
|
|
2571
|
-
const
|
|
2572
|
-
|
|
2573
|
-
|
|
2571
|
+
const wo = ["line.color", "arrowHead.color", "arrowTail.color"];
|
|
2572
|
+
function Is(l) {
|
|
2573
|
+
for (const e of wo) {
|
|
2574
|
+
const t = q.get(l, e), i = vs(typeof t == "string" ? t : void 0);
|
|
2575
|
+
i !== null && ke(l, e, i.hex);
|
|
2576
|
+
}
|
|
2577
|
+
return l;
|
|
2578
|
+
}
|
|
2579
|
+
const Ds = "graphty-bootstrap";
|
|
2580
|
+
let Ht = null, Wt = null;
|
|
2581
|
+
function Ls() {
|
|
2574
2582
|
if (Ht === null) {
|
|
2575
|
-
const l =
|
|
2576
|
-
|
|
2577
|
-
meshKey:
|
|
2583
|
+
const l = q.cloneDeep(Ps), e = vs(typeof l.texture?.color == "string" ? l.texture.color : void 0);
|
|
2584
|
+
ke(l, "texture.color", ci), Ht = {
|
|
2585
|
+
meshKey: Ds,
|
|
2578
2586
|
style: l,
|
|
2579
2587
|
color: e === null ? null : { r: e.r, g: e.g, b: e.b, a: e.a }
|
|
2580
2588
|
};
|
|
@@ -2582,9 +2590,9 @@ function Is() {
|
|
|
2582
2590
|
return Ht;
|
|
2583
2591
|
}
|
|
2584
2592
|
function Mt() {
|
|
2585
|
-
return
|
|
2593
|
+
return Wt === null && (Wt = { meshKey: Ds, style: Is(q.cloneDeep(As)) }), Wt;
|
|
2586
2594
|
}
|
|
2587
|
-
class
|
|
2595
|
+
class vo {
|
|
2588
2596
|
constructor() {
|
|
2589
2597
|
this.paint = null, this.pendingNodes = /* @__PURE__ */ new Set(), this.pendingEdges = /* @__PURE__ */ new Set(), this.stopListening = null;
|
|
2590
2598
|
}
|
|
@@ -2651,7 +2659,7 @@ class yo {
|
|
|
2651
2659
|
*/
|
|
2652
2660
|
takeNodes() {
|
|
2653
2661
|
if (this.pendingNodes.size === 0)
|
|
2654
|
-
return
|
|
2662
|
+
return Vi;
|
|
2655
2663
|
const e = [...this.pendingNodes];
|
|
2656
2664
|
return this.pendingNodes.clear(), e;
|
|
2657
2665
|
}
|
|
@@ -2661,7 +2669,7 @@ class yo {
|
|
|
2661
2669
|
*/
|
|
2662
2670
|
takeEdges() {
|
|
2663
2671
|
if (this.pendingEdges.size === 0)
|
|
2664
|
-
return
|
|
2672
|
+
return Vi;
|
|
2665
2673
|
const e = [...this.pendingEdges];
|
|
2666
2674
|
return this.pendingEdges.clear(), e;
|
|
2667
2675
|
}
|
|
@@ -2686,7 +2694,7 @@ class yo {
|
|
|
2686
2694
|
*/
|
|
2687
2695
|
nodePaint(e) {
|
|
2688
2696
|
const { paint: t } = this;
|
|
2689
|
-
return t === null || e < 0 ? null :
|
|
2697
|
+
return t === null || e < 0 ? null : fo(t.styleOf("node", e), t.meshKeyOf("node", e));
|
|
2690
2698
|
}
|
|
2691
2699
|
/**
|
|
2692
2700
|
* What one edge is painted.
|
|
@@ -2695,7 +2703,7 @@ class yo {
|
|
|
2695
2703
|
*/
|
|
2696
2704
|
edgePaint(e) {
|
|
2697
2705
|
const { paint: t } = this;
|
|
2698
|
-
return t === null || e < 0 ? null :
|
|
2706
|
+
return t === null || e < 0 ? null : yo(t.styleOf("edge", e), t.meshKeyOf("edge", e));
|
|
2699
2707
|
}
|
|
2700
2708
|
/**
|
|
2701
2709
|
* How many distinct source meshes one kind of element needs.
|
|
@@ -2883,7 +2891,7 @@ void main(void) {
|
|
|
2883
2891
|
this.registeredScene = e;
|
|
2884
2892
|
const t = e.getEngine();
|
|
2885
2893
|
e.onBeforeRenderObservable.add(() => {
|
|
2886
|
-
const i = t.getRenderWidth(), s = t.getRenderHeight(), r = new
|
|
2894
|
+
const i = t.getRenderWidth(), s = t.getRenderHeight(), r = new $r(i, s);
|
|
2887
2895
|
for (const a of this.activeMaterials)
|
|
2888
2896
|
try {
|
|
2889
2897
|
a.setVector2("resolution", r);
|
|
@@ -3205,7 +3213,7 @@ void main(void) {
|
|
|
3205
3213
|
};
|
|
3206
3214
|
dt.shadersRegistered = !1, dt.activeMaterials = /* @__PURE__ */ new Set(), dt.registeredScene = null;
|
|
3207
3215
|
let xt = dt;
|
|
3208
|
-
class
|
|
3216
|
+
class hi {
|
|
3209
3217
|
/**
|
|
3210
3218
|
* Apply 2D material to a mesh
|
|
3211
3219
|
*
|
|
@@ -3872,7 +3880,7 @@ void main() {
|
|
|
3872
3880
|
), r = F.FromHexString(t.color);
|
|
3873
3881
|
return s.setVector3("color", new v(r.r, r.g, r.b)), s.setFloat("size", t.size), s.setFloat("opacity", t.opacity ?? 1), s.setVector3("lineDirection", new v(1, 0, 0)), s.setFloat("clipEndX", t.clipEndX ?? -1), this.activeMaterials.add(s), s.onDisposeObservable.add(() => {
|
|
3874
3882
|
Le.releaseMaterial(s);
|
|
3875
|
-
}), this.registerCameraCallback(i), s.backFaceCulling = !1, e.material = s, this.applyShaderBoundingInfo(e, t.size), e;
|
|
3883
|
+
}), this.registerCameraCallback(i), s.blockDirtyMechanism = !0, s.backFaceCulling = !1, e.material = s, this.applyShaderBoundingInfo(e, t.size), e;
|
|
3876
3884
|
}
|
|
3877
3885
|
/**
|
|
3878
3886
|
* Resize a shadered mesh's bounding volume to match what the vertex shader actually draws,
|
|
@@ -3923,7 +3931,7 @@ void main() {
|
|
|
3923
3931
|
e.alwaysSelectAsActiveMesh = !0;
|
|
3924
3932
|
return;
|
|
3925
3933
|
}
|
|
3926
|
-
e.alwaysSelectAsActiveMesh = !1, e.setBoundingInfo(new
|
|
3934
|
+
e.alwaysSelectAsActiveMesh = !1, e.setBoundingInfo(new Vr(new v(-a, -a, -a), new v(a, a, a)));
|
|
3927
3935
|
}
|
|
3928
3936
|
/**
|
|
3929
3937
|
* Set the line direction for a filled arrow mesh
|
|
@@ -3949,7 +3957,7 @@ void main() {
|
|
|
3949
3957
|
*/
|
|
3950
3958
|
static create2DArrow(e, t, i, s, r, a) {
|
|
3951
3959
|
const o = this.getGeometryForType(e, a), n = new H(`arrow-2d-${e}`, a);
|
|
3952
|
-
return o.applyToMesh(n), n.scaling.setAll(t),
|
|
3960
|
+
return o.applyToMesh(n), n.scaling.setAll(t), hi.apply2DMaterial(n, s, r, a), n;
|
|
3953
3961
|
}
|
|
3954
3962
|
/**
|
|
3955
3963
|
* Get geometry for a specific arrow type
|
|
@@ -4010,19 +4018,19 @@ void main() {
|
|
|
4010
4018
|
};
|
|
4011
4019
|
Le.shadersRegistered = !1, Le.activeMaterials = /* @__PURE__ */ new Set(), Le.cameraCallbackRegistered = !1;
|
|
4012
4020
|
let _ = Le;
|
|
4013
|
-
function
|
|
4021
|
+
function bo(l) {
|
|
4014
4022
|
return l + l * 0.5;
|
|
4015
4023
|
}
|
|
4016
|
-
function
|
|
4024
|
+
function So(l, e, t) {
|
|
4017
4025
|
if (t !== void 0)
|
|
4018
4026
|
return Math.max(2, Math.floor(t));
|
|
4019
4027
|
const i = l - 2 * e;
|
|
4020
4028
|
if (i < 0)
|
|
4021
4029
|
return 2;
|
|
4022
|
-
const s =
|
|
4030
|
+
const s = bo(e), r = s - e, a = Math.floor((i - r) / s);
|
|
4023
4031
|
return 2 + Math.max(0, a);
|
|
4024
4032
|
}
|
|
4025
|
-
function
|
|
4033
|
+
function Eo(l, e, t) {
|
|
4026
4034
|
const i = e / 2, s = i, r = l - i;
|
|
4027
4035
|
if (t <= 2)
|
|
4028
4036
|
return [s, r];
|
|
@@ -4060,7 +4068,7 @@ const fe = class fe {
|
|
|
4060
4068
|
const s = this.calculatePositions(e, t);
|
|
4061
4069
|
for (let a = 0; a < this.meshes.length; a++)
|
|
4062
4070
|
this.meshes[a].position = s[a], this.is2DMode || _.setLineDirection(this.meshes[a], this.lineDirection);
|
|
4063
|
-
|
|
4071
|
+
he[this.pattern].connected && this.meshes.length > 0 && this.clipLastSegment(i), this.lastLength = i;
|
|
4064
4072
|
}
|
|
4065
4073
|
/**
|
|
4066
4074
|
* Clip the last segment to fit exactly to line end
|
|
@@ -4127,7 +4135,7 @@ const fe = class fe {
|
|
|
4127
4135
|
createInitialMeshes(e, t) {
|
|
4128
4136
|
const i = v.Distance(e, t);
|
|
4129
4137
|
this.lastLength = i, this.lineDirection = t.subtract(e).normalize();
|
|
4130
|
-
const s =
|
|
4138
|
+
const s = he[this.pattern], r = this.calculateOptimalMeshCount(i, s);
|
|
4131
4139
|
for (let o = 0; o < r; o++) {
|
|
4132
4140
|
const n = this.createPatternMesh(o);
|
|
4133
4141
|
this.meshes.push(n);
|
|
@@ -4143,7 +4151,7 @@ const fe = class fe {
|
|
|
4143
4151
|
* @returns True if mesh count needs adjustment
|
|
4144
4152
|
*/
|
|
4145
4153
|
needsMeshCountAdjustment(e) {
|
|
4146
|
-
const t =
|
|
4154
|
+
const t = he[this.pattern], i = this.meshes.length, s = this.calculateOptimalMeshCount(e, t);
|
|
4147
4155
|
return Math.abs(i - s) > 1;
|
|
4148
4156
|
}
|
|
4149
4157
|
/**
|
|
@@ -4152,7 +4160,7 @@ const fe = class fe {
|
|
|
4152
4160
|
* @param newLength - New length of the line
|
|
4153
4161
|
*/
|
|
4154
4162
|
adjustMeshCount(e) {
|
|
4155
|
-
const t =
|
|
4163
|
+
const t = he[this.pattern], i = this.calculateOptimalMeshCount(e, t), s = this.meshes.length;
|
|
4156
4164
|
if (i > s)
|
|
4157
4165
|
for (let r = 0; r < i - s; r++) {
|
|
4158
4166
|
const a = s + r, o = this.createPatternMesh(a);
|
|
@@ -4174,7 +4182,7 @@ const fe = class fe {
|
|
|
4174
4182
|
* @returns Array of positions for each pattern mesh
|
|
4175
4183
|
*/
|
|
4176
4184
|
calculatePositions(e, t) {
|
|
4177
|
-
const i =
|
|
4185
|
+
const i = he[this.pattern];
|
|
4178
4186
|
return i.connected ? this.calculateConnectedPositions(e, t, i) : this.calculateDiscretePositions(e, t);
|
|
4179
4187
|
}
|
|
4180
4188
|
/**
|
|
@@ -4207,7 +4215,7 @@ const fe = class fe {
|
|
|
4207
4215
|
*/
|
|
4208
4216
|
calculateDiscretePositions(e, t) {
|
|
4209
4217
|
const i = t.subtract(e).normalize(), s = v.Distance(e, t), r = this.getRenderedMeshSize();
|
|
4210
|
-
return
|
|
4218
|
+
return Eo(s, r, this.meshes.length).map((o) => e.add(i.scale(o)));
|
|
4211
4219
|
}
|
|
4212
4220
|
/**
|
|
4213
4221
|
* Calculate positions for connected patterns (sinewave, zigzag)
|
|
@@ -4250,7 +4258,7 @@ const fe = class fe {
|
|
|
4250
4258
|
* @returns The rendered mesh size parallel to the line
|
|
4251
4259
|
*/
|
|
4252
4260
|
getRenderedMeshSize() {
|
|
4253
|
-
const t =
|
|
4261
|
+
const t = he[this.pattern].shapes[0], i = t.aspectRatio ?? 1;
|
|
4254
4262
|
switch (t.type) {
|
|
4255
4263
|
case "circle":
|
|
4256
4264
|
case "star":
|
|
@@ -4277,7 +4285,7 @@ const fe = class fe {
|
|
|
4277
4285
|
const i = Math.ceil(e / fe.SEGMENT_LENGTH);
|
|
4278
4286
|
return Math.max(1, i);
|
|
4279
4287
|
}
|
|
4280
|
-
return
|
|
4288
|
+
return So(e, this.getRenderedMeshSize(), this.patternCount);
|
|
4281
4289
|
}
|
|
4282
4290
|
/**
|
|
4283
4291
|
* Create a single pattern mesh
|
|
@@ -4286,7 +4294,7 @@ const fe = class fe {
|
|
|
4286
4294
|
* @returns The created pattern mesh
|
|
4287
4295
|
*/
|
|
4288
4296
|
createPatternMesh(e) {
|
|
4289
|
-
const t =
|
|
4297
|
+
const t = he[this.pattern];
|
|
4290
4298
|
let i;
|
|
4291
4299
|
if (t.shapes.length > 1) {
|
|
4292
4300
|
const r = e % t.shapes.length;
|
|
@@ -4308,7 +4316,7 @@ const fe = class fe {
|
|
|
4308
4316
|
};
|
|
4309
4317
|
fe.SEGMENT_LENGTH = 0.75;
|
|
4310
4318
|
let te = fe;
|
|
4311
|
-
const
|
|
4319
|
+
const he = {
|
|
4312
4320
|
dot: {
|
|
4313
4321
|
shapes: [{ type: "circle", size: 1 }],
|
|
4314
4322
|
spacing: { min: 0.2, ideal: 0.5, max: 1 },
|
|
@@ -4407,7 +4415,7 @@ const ce = {
|
|
|
4407
4415
|
* @returns A PatternedLineMesh instance
|
|
4408
4416
|
*/
|
|
4409
4417
|
static create(e, t, i, s, r, a, o, n, c) {
|
|
4410
|
-
return this.registerCameraCallback(o),
|
|
4418
|
+
return this.registerCameraCallback(o), he[e].connected ? this.createContinuousMesh(e, t, i, s, r, a, o, n, c) : new te(e, t, i, s, r, a, o, n, c);
|
|
4411
4419
|
}
|
|
4412
4420
|
/**
|
|
4413
4421
|
* Create connected pattern using repeating segment meshes with ZERO spacing
|
|
@@ -4441,10 +4449,10 @@ const ce = {
|
|
|
4441
4449
|
* @returns The created pattern mesh
|
|
4442
4450
|
*/
|
|
4443
4451
|
static createPatternMesh(e, t, i, s, r, a, o, n) {
|
|
4444
|
-
if (
|
|
4452
|
+
if (he[e].connected) {
|
|
4445
4453
|
const p = this.createConnectedSegmentGeometry(e, t, o), m = `pattern-${e}`, y = new H(m, r);
|
|
4446
4454
|
if (p.applyToMesh(y), n) {
|
|
4447
|
-
|
|
4455
|
+
hi.apply2DMaterial(y, i, s, r);
|
|
4448
4456
|
const w = y.getVerticesData("position"), S = y.getIndices();
|
|
4449
4457
|
if (w && S && !y.getVerticesData("normal")) {
|
|
4450
4458
|
const x = [];
|
|
@@ -4459,7 +4467,7 @@ const ce = {
|
|
|
4459
4467
|
}
|
|
4460
4468
|
const h = a ? this.getGeometryForShapeType(a) : this.getGeometryForPattern(e), d = a ? `pattern-${e}-${a}` : `pattern-${e}`, u = new H(d, r);
|
|
4461
4469
|
if (h.applyToMesh(u), n) {
|
|
4462
|
-
|
|
4470
|
+
hi.apply2DMaterial(u, i, s, r);
|
|
4463
4471
|
const p = this.getGeometryDiameter(e, a), m = t / p;
|
|
4464
4472
|
u.scaling.set(m, m, m);
|
|
4465
4473
|
const y = u.getVerticesData("position"), w = u.getIndices();
|
|
@@ -4789,7 +4797,7 @@ const ce = {
|
|
|
4789
4797
|
* @returns The perpendicular diameter of the geometry
|
|
4790
4798
|
*/
|
|
4791
4799
|
static getGeometryDiameter(e, t) {
|
|
4792
|
-
const i =
|
|
4800
|
+
const i = he[e], s = t ?? this.getDefaultShapeType(e), a = (i.shapes.find((o) => o.type === s) ?? i.shapes[0]).aspectRatio ?? 1;
|
|
4793
4801
|
switch (s) {
|
|
4794
4802
|
case "circle":
|
|
4795
4803
|
case "star":
|
|
@@ -4854,7 +4862,7 @@ const ce = {
|
|
|
4854
4862
|
};
|
|
4855
4863
|
Rt.activeMaterials = /* @__PURE__ */ new Set(), Rt.cameraCallbackRegistered = !1;
|
|
4856
4864
|
let ft = Rt;
|
|
4857
|
-
class
|
|
4865
|
+
class Fs {
|
|
4858
4866
|
/**
|
|
4859
4867
|
* Create a 2D line mesh
|
|
4860
4868
|
*
|
|
@@ -5116,7 +5124,7 @@ void main() {
|
|
|
5116
5124
|
// undefined means follow the spacing rule
|
|
5117
5125
|
);
|
|
5118
5126
|
if (o === "solid" && this.is2DMode(s))
|
|
5119
|
-
return
|
|
5127
|
+
return Fs.create(
|
|
5120
5128
|
new v(0, 0, -0.5),
|
|
5121
5129
|
// Placeholder start (Edge.update() will set real positions)
|
|
5122
5130
|
new v(0, 0, 0.5),
|
|
@@ -5267,7 +5275,7 @@ void main() {
|
|
|
5267
5275
|
);
|
|
5268
5276
|
return t.line?.opacity !== void 0 && (o.visibility = t.line.opacity), o;
|
|
5269
5277
|
}
|
|
5270
|
-
const r =
|
|
5278
|
+
const r = _i(
|
|
5271
5279
|
"edge-plain",
|
|
5272
5280
|
{
|
|
5273
5281
|
points: this.UNIT_VECTOR_POINTS
|
|
@@ -5281,21 +5289,21 @@ void main() {
|
|
|
5281
5289
|
return t.line?.opacity !== void 0 && (r.visibility = t.line.opacity), r;
|
|
5282
5290
|
}
|
|
5283
5291
|
static createAnimatedLine(e, t, i) {
|
|
5284
|
-
const s = F.FromHexString(ee.MOVING_LINE_BASE_COLOR), r = F.FromHexString(e.color), a = this.createAnimatedTexture(s, r, i), o =
|
|
5292
|
+
const s = F.FromHexString(ee.MOVING_LINE_BASE_COLOR), r = F.FromHexString(e.color), a = this.createAnimatedTexture(s, r, i), o = _i(
|
|
5285
5293
|
"edge-moving",
|
|
5286
5294
|
{
|
|
5287
5295
|
points: this.UNIT_VECTOR_POINTS
|
|
5288
5296
|
},
|
|
5289
5297
|
{
|
|
5290
5298
|
width: e.width,
|
|
5291
|
-
colorMode:
|
|
5299
|
+
colorMode: Hr.COLOR_MODE_MULTIPLY
|
|
5292
5300
|
},
|
|
5293
5301
|
i
|
|
5294
5302
|
);
|
|
5295
5303
|
return this.applyAnimatedTexture(o, a, i, t.line?.animationSpeed), t.line?.opacity !== void 0 && (o.visibility = t.line.opacity), o;
|
|
5296
5304
|
}
|
|
5297
5305
|
static createAnimatedTexture(e, t, i) {
|
|
5298
|
-
const s = Math.floor(e.r * 255), r = Math.floor(e.g * 255), a = Math.floor(e.b * 255), o = Math.floor(t.r * 255), n = Math.floor(t.g * 255), c = Math.floor(t.b * 255), h = new Uint8Array([s, r, a, o, n, c]), d = new
|
|
5306
|
+
const s = Math.floor(e.r * 255), r = Math.floor(e.g * 255), a = Math.floor(e.b * 255), o = Math.floor(t.r * 255), n = Math.floor(t.g * 255), c = Math.floor(t.b * 255), h = new Uint8Array([s, r, a, o, n, c]), d = new Di(
|
|
5299
5307
|
h,
|
|
5300
5308
|
h.length / 3,
|
|
5301
5309
|
1,
|
|
@@ -5305,7 +5313,7 @@ void main() {
|
|
|
5305
5313
|
!0,
|
|
5306
5314
|
Ct.TEXTURE_NEAREST_NEAREST
|
|
5307
5315
|
);
|
|
5308
|
-
return d.wrapU =
|
|
5316
|
+
return d.wrapU = Di.WRAP_ADDRESSMODE, d.name = "moving-texture", d;
|
|
5309
5317
|
}
|
|
5310
5318
|
static applyAnimatedTexture(e, t, i, s) {
|
|
5311
5319
|
const r = e.material;
|
|
@@ -5516,7 +5524,7 @@ void main() {
|
|
|
5516
5524
|
};
|
|
5517
5525
|
Fe.UNIT_VECTOR_POINTS = [0, 0, -0.5, 0, 0, 0.5], Fe.shadersRegistered = !1, Fe.USE_CUSTOM_RENDERER = !0;
|
|
5518
5526
|
let G = Fe;
|
|
5519
|
-
class
|
|
5527
|
+
class Co {
|
|
5520
5528
|
/**
|
|
5521
5529
|
* Creates a speech bubble path with pointer in clockwise direction
|
|
5522
5530
|
* @param ctx - Canvas rendering context
|
|
@@ -5811,7 +5819,7 @@ class So {
|
|
|
5811
5819
|
) : (e.lineTo(t + s + n, d), e.lineTo(t + s, Math.max(d - o / 2, i + a))), e.lineTo(t + s, i + a), e.quadraticCurveTo(t + s, i, t + s - a, i);
|
|
5812
5820
|
}
|
|
5813
5821
|
}
|
|
5814
|
-
class
|
|
5822
|
+
class Mo {
|
|
5815
5823
|
/**
|
|
5816
5824
|
* Creates a new rich text animator
|
|
5817
5825
|
* @param scene - Babylon.js scene
|
|
@@ -5896,7 +5904,7 @@ class Eo {
|
|
|
5896
5904
|
this.sceneCallback && (this.scene.unregisterBeforeRender(this.sceneCallback), this.sceneCallback = null);
|
|
5897
5905
|
}
|
|
5898
5906
|
}
|
|
5899
|
-
class
|
|
5907
|
+
class xo {
|
|
5900
5908
|
/**
|
|
5901
5909
|
* Creates a new rich text parser
|
|
5902
5910
|
* @param defaultStyle - Default text style to use as base
|
|
@@ -5987,7 +5995,7 @@ class Co {
|
|
|
5987
5995
|
return { maxWidth: s, totalHeight: r };
|
|
5988
5996
|
}
|
|
5989
5997
|
}
|
|
5990
|
-
class
|
|
5998
|
+
class To {
|
|
5991
5999
|
/**
|
|
5992
6000
|
* Creates a new rich text renderer
|
|
5993
6001
|
* @param options - Rendering configuration options
|
|
@@ -6054,8 +6062,8 @@ class Mo {
|
|
|
6054
6062
|
e.save(), e.strokeStyle = this.options.textOutlineColor, e.lineWidth = this.options.textOutlineWidth * 2, e.lineJoin = this.options.textOutlineJoin, e.miterLimit = 2, e.strokeText(t, i, s), e.restore();
|
|
6055
6063
|
}
|
|
6056
6064
|
}
|
|
6057
|
-
const
|
|
6058
|
-
class
|
|
6065
|
+
const Po = 1;
|
|
6066
|
+
class ct {
|
|
6059
6067
|
/**
|
|
6060
6068
|
* Creates a new rich text label
|
|
6061
6069
|
* @param scene - Babylon.js scene
|
|
@@ -6135,14 +6143,14 @@ class nt {
|
|
|
6135
6143
|
color: s.borderColor,
|
|
6136
6144
|
spacing: 0
|
|
6137
6145
|
}
|
|
6138
|
-
]), this.options = s, this.id = `richLabel_${Math.random().toString(36).substring(2, 11)}`, t.progress !== void 0 && (this._progressValue = Math.max(0, Math.min(1, t.progress))), this.parser = new
|
|
6146
|
+
]), this.options = s, this.id = `richLabel_${Math.random().toString(36).substring(2, 11)}`, t.progress !== void 0 && (this._progressValue = Math.max(0, Math.min(1, t.progress))), this.parser = new xo({
|
|
6139
6147
|
font: this.options.font,
|
|
6140
6148
|
size: this.options.fontSize,
|
|
6141
6149
|
weight: this.options.fontWeight,
|
|
6142
6150
|
style: "normal",
|
|
6143
6151
|
color: this.options.textColor,
|
|
6144
6152
|
background: null
|
|
6145
|
-
}), this.renderer = new
|
|
6153
|
+
}), this.renderer = new To({
|
|
6146
6154
|
textAlignment: this.options.textAlign,
|
|
6147
6155
|
marginLeft: this.options.marginLeft,
|
|
6148
6156
|
marginRight: this.options.marginRight,
|
|
@@ -6159,7 +6167,7 @@ class nt {
|
|
|
6159
6167
|
textOutlineColor: this.options.textOutlineColor,
|
|
6160
6168
|
textOutlineWidth: this.options.textOutlineWidth,
|
|
6161
6169
|
textOutlineJoin: this.options.textOutlineJoin
|
|
6162
|
-
}), this.pointerRenderer = new
|
|
6170
|
+
}), this.pointerRenderer = new Co(), this.options.animation !== "none" && (this.animator = new Mo(this.scene, {
|
|
6163
6171
|
animation: this.options.animation,
|
|
6164
6172
|
animationSpeed: this.options.animationSpeed
|
|
6165
6173
|
})), this._create();
|
|
@@ -6171,7 +6179,7 @@ class nt {
|
|
|
6171
6179
|
* @returns A new RichTextLabel instance
|
|
6172
6180
|
*/
|
|
6173
6181
|
static createLabel(e, t) {
|
|
6174
|
-
return new
|
|
6182
|
+
return new ct(e, t);
|
|
6175
6183
|
}
|
|
6176
6184
|
_create() {
|
|
6177
6185
|
this._parseRichText(), this._calculateDimensions(), this._createTexture(), this._createMaterial(), this._createMesh(), this.options.attachTo ? this._attachToTarget() : this.mesh && (this.mesh.position = new v(this.options.position.x, this.options.position.y, this.options.position.z), this.originalPosition ??= this.mesh.position.clone()), this.options.depthFadeEnabled && this._setupDepthFading();
|
|
@@ -6250,7 +6258,7 @@ class nt {
|
|
|
6250
6258
|
},
|
|
6251
6259
|
this.scene,
|
|
6252
6260
|
!0
|
|
6253
|
-
), this.texture.hasAlpha = !0, this.texture.updateSamplingMode(
|
|
6261
|
+
), this.texture.hasAlpha = !0, this.texture.updateSamplingMode(Wr.TRILINEAR_SAMPLINGMODE), this._drawContent();
|
|
6254
6262
|
}
|
|
6255
6263
|
_drawContent() {
|
|
6256
6264
|
if (!this.texture)
|
|
@@ -6449,7 +6457,7 @@ class nt {
|
|
|
6449
6457
|
sideOrientation: H.DOUBLESIDE
|
|
6450
6458
|
},
|
|
6451
6459
|
this.scene
|
|
6452
|
-
), this.mesh.material = this.material, this.mesh.billboardMode = this.options.billboardMode, this.options.onTop === !0 && (this.mesh.renderingGroupId =
|
|
6460
|
+
), this.mesh.material = this.material, this.mesh.billboardMode = this.options.billboardMode, this.options.onTop === !0 && (this.mesh.renderingGroupId = Po);
|
|
6453
6461
|
}
|
|
6454
6462
|
_attachToTarget() {
|
|
6455
6463
|
const e = this.options.attachTo, t = this.options.attachPosition, i = this.options.attachOffset;
|
|
@@ -6461,7 +6469,7 @@ class nt {
|
|
|
6461
6469
|
min: s.clone(),
|
|
6462
6470
|
max: s.clone()
|
|
6463
6471
|
};
|
|
6464
|
-
else if (e && "getBoundingInfo" in e && e instanceof
|
|
6472
|
+
else if (e && "getBoundingInfo" in e && e instanceof jr) {
|
|
6465
6473
|
this.mesh.parent = e, s = v.Zero();
|
|
6466
6474
|
const h = e.getBoundingInfo();
|
|
6467
6475
|
r = {
|
|
@@ -6636,7 +6644,7 @@ class nt {
|
|
|
6636
6644
|
return this.id;
|
|
6637
6645
|
}
|
|
6638
6646
|
}
|
|
6639
|
-
const Hi = "center", Wi = 0,
|
|
6647
|
+
const Hi = "center", Wi = 0, jt = "top", qt = 0.3;
|
|
6640
6648
|
function ji(l, e) {
|
|
6641
6649
|
return e !== null && l?.enabled === !0 ? l : void 0;
|
|
6642
6650
|
}
|
|
@@ -6657,7 +6665,7 @@ class Tt {
|
|
|
6657
6665
|
* @param opts - Optional configuration options
|
|
6658
6666
|
*/
|
|
6659
6667
|
constructor(e, t, i, s, r, a, o = {}) {
|
|
6660
|
-
this.index =
|
|
6668
|
+
this.index = K, this.arrowMesh = null, this.arrowTailMesh = null, this.sessionPaint = null, this.label = null, this.arrowHeadText = null, this.arrowTailText = null, this._arrowHeadTextOffset = qt, this._arrowTailTextOffset = qt, this._arrowHeadTextAttachPosition = jt, this._arrowTailTextAttachPosition = jt, this._labelOffset = Wi, this._labelAttachPosition = Hi, this.drawnStyle = null, this._loggedLineDirection = !1, this._lastSrcPos = null, this._lastDstPos = null, this.disposed = !1, this.renderVisible = !0, this.selected = !1, this.parentGraph = e, this.srcId = t, this.dstId = i, this.id = us(s), this.opts = o, this.data = a;
|
|
6661
6669
|
const n = this.context.getDataManager().nodeCache.get(t);
|
|
6662
6670
|
if (!n)
|
|
6663
6671
|
throw new Error(
|
|
@@ -6668,9 +6676,9 @@ class Tt {
|
|
|
6668
6676
|
throw new Error(
|
|
6669
6677
|
`Attempting to create edge '${t}->${i}', Node '${i}' hasn't been created yet.`
|
|
6670
6678
|
);
|
|
6671
|
-
this.srcNode = n, this.dstNode = c, this.ray = new
|
|
6679
|
+
this.srcNode = n, this.dstNode = c, this.ray = new qr(this.srcNode.mesh.position, this.dstNode.mesh.position.subtract(this.srcNode.mesh.position)), this.meshKey = r.meshKey;
|
|
6672
6680
|
const { style: h } = r;
|
|
6673
|
-
this.arrowMesh = G.createArrowHead(
|
|
6681
|
+
this.drawnStyle = h, this.arrowMesh = G.createArrowHead(
|
|
6674
6682
|
this.context.getMeshCache(),
|
|
6675
6683
|
r.meshKey,
|
|
6676
6684
|
{
|
|
@@ -6844,11 +6852,11 @@ class Tt {
|
|
|
6844
6852
|
*/
|
|
6845
6853
|
paintFrom(e, t) {
|
|
6846
6854
|
const i = this.mesh instanceof te ? !1 : this.mesh.isDisposed();
|
|
6847
|
-
if (e === this.meshKey && !i) {
|
|
6848
|
-
this.syncContent(t, !1);
|
|
6855
|
+
if ((e === this.meshKey || ie.isEqual(t, this.drawnStyle)) && !i) {
|
|
6856
|
+
this.meshKey = e, this.drawnStyle = t, this.syncContent(t, !1);
|
|
6849
6857
|
return;
|
|
6850
6858
|
}
|
|
6851
|
-
this.meshKey = e, this._lastSrcPos = null, this._lastDstPos = null, this.mesh instanceof te ? this.mesh.dispose() : this.mesh.isDisposed() || this.mesh.dispose(), this.arrowMesh && !this.arrowMesh.isDisposed() && this.arrowMesh.dispose(), this.arrowMesh = G.createArrowHead(
|
|
6859
|
+
this.meshKey = e, this.drawnStyle = t, this._lastSrcPos = null, this._lastDstPos = null, this.mesh instanceof te ? this.mesh.dispose() : this.mesh.isDisposed() || this.mesh.dispose(), this.arrowMesh && !this.arrowMesh.isDisposed() && this.arrowMesh.dispose(), this.arrowMesh = G.createArrowHead(
|
|
6852
6860
|
this.context.getMeshCache(),
|
|
6853
6861
|
e,
|
|
6854
6862
|
{
|
|
@@ -6871,12 +6879,12 @@ class Tt {
|
|
|
6871
6879
|
},
|
|
6872
6880
|
this.context.getScene()
|
|
6873
6881
|
);
|
|
6874
|
-
let
|
|
6882
|
+
let r, a;
|
|
6875
6883
|
if (t.line?.bezier) {
|
|
6876
|
-
const
|
|
6877
|
-
if (
|
|
6878
|
-
const { srcPoint:
|
|
6879
|
-
|
|
6884
|
+
const n = this.context.getLayoutManager().layoutEngine?.getEdgePosition(this);
|
|
6885
|
+
if (n) {
|
|
6886
|
+
const { srcPoint: c, dstPoint: h } = this.transformArrowCap();
|
|
6887
|
+
r = c ?? new v(n.src.x, n.src.y, n.src.z), a = h ?? new v(n.dst.x, n.dst.y, n.dst.z);
|
|
6880
6888
|
}
|
|
6881
6889
|
}
|
|
6882
6890
|
this.mesh = G.create(
|
|
@@ -6888,17 +6896,17 @@ class Tt {
|
|
|
6888
6896
|
},
|
|
6889
6897
|
t,
|
|
6890
6898
|
this.context.getScene(),
|
|
6891
|
-
|
|
6892
|
-
|
|
6899
|
+
r,
|
|
6900
|
+
a
|
|
6893
6901
|
), this.mesh.isPickable = !1, this.mesh.metadata = this.mesh.metadata ?? {}, this.mesh.metadata.parentEdge = this;
|
|
6894
|
-
const
|
|
6895
|
-
if (
|
|
6902
|
+
const o = this.context.getScene().getTransformNodeByName("graph-root");
|
|
6903
|
+
if (o) {
|
|
6896
6904
|
if (this.mesh instanceof te)
|
|
6897
|
-
for (const
|
|
6898
|
-
|
|
6905
|
+
for (const n of this.mesh.meshes)
|
|
6906
|
+
n.parent = o;
|
|
6899
6907
|
else
|
|
6900
|
-
this.mesh.parent =
|
|
6901
|
-
this.arrowMesh && (this.arrowMesh.parent =
|
|
6908
|
+
this.mesh.parent = o;
|
|
6909
|
+
this.arrowMesh && (this.arrowMesh.parent = o), this.arrowTailMesh && (this.arrowTailMesh.parent = o);
|
|
6902
6910
|
}
|
|
6903
6911
|
this.syncContent(t, !0), this.applyRenderState();
|
|
6904
6912
|
}
|
|
@@ -6923,28 +6931,28 @@ class Tt {
|
|
|
6923
6931
|
syncContent(e, t) {
|
|
6924
6932
|
let i = !1;
|
|
6925
6933
|
const s = e.label?.enabled === !0 ? e.label : void 0, r = s === void 0 ? void 0 : this.extractLabelText(s);
|
|
6926
|
-
if (t || r !== this.drawnLabelText || !
|
|
6934
|
+
if (t || r !== this.drawnLabelText || !ie.isEqual(s, this.drawnLabelStyle)) {
|
|
6927
6935
|
if (this.label?.dispose(), this.label = null, s !== void 0) {
|
|
6928
6936
|
const { label: n, offset: c, attachPosition: h } = this.createLabel(e);
|
|
6929
6937
|
this.label = n, this._labelOffset = c, this._labelAttachPosition = h;
|
|
6930
6938
|
}
|
|
6931
|
-
this.drawnLabelText = r, this.drawnLabelStyle = s === void 0 ? void 0 :
|
|
6939
|
+
this.drawnLabelText = r, this.drawnLabelStyle = s === void 0 ? void 0 : ie.cloneDeep(s), i = !0;
|
|
6932
6940
|
}
|
|
6933
6941
|
const a = ji(e.arrowHead?.text, this.arrowMesh);
|
|
6934
|
-
if (t || !
|
|
6942
|
+
if (t || !ie.isEqual(a, this.drawnArrowHeadText)) {
|
|
6935
6943
|
if (this.arrowHeadText?.dispose(), this.arrowHeadText = null, a !== void 0) {
|
|
6936
6944
|
const { label: n, offset: c, attachPosition: h } = this.createArrowText(a, "arrowHead");
|
|
6937
6945
|
this.arrowHeadText = n, this._arrowHeadTextOffset = c, this._arrowHeadTextAttachPosition = h;
|
|
6938
6946
|
}
|
|
6939
|
-
this.drawnArrowHeadText = a === void 0 ? void 0 :
|
|
6947
|
+
this.drawnArrowHeadText = a === void 0 ? void 0 : ie.cloneDeep(a), i = !0;
|
|
6940
6948
|
}
|
|
6941
6949
|
const o = ji(e.arrowTail?.text, this.arrowTailMesh);
|
|
6942
|
-
if (t || !
|
|
6950
|
+
if (t || !ie.isEqual(o, this.drawnArrowTailText)) {
|
|
6943
6951
|
if (this.arrowTailText?.dispose(), this.arrowTailText = null, o !== void 0) {
|
|
6944
6952
|
const { label: n, offset: c, attachPosition: h } = this.createArrowText(o, "arrowTail");
|
|
6945
6953
|
this.arrowTailText = n, this._arrowTailTextOffset = c, this._arrowTailTextAttachPosition = h;
|
|
6946
6954
|
}
|
|
6947
|
-
this.drawnArrowTailText = o === void 0 ? void 0 :
|
|
6955
|
+
this.drawnArrowTailText = o === void 0 ? void 0 : ie.cloneDeep(o), i = !0;
|
|
6948
6956
|
}
|
|
6949
6957
|
i && this.invalidatePositionCache();
|
|
6950
6958
|
}
|
|
@@ -7077,7 +7085,7 @@ class Tt {
|
|
|
7077
7085
|
* @param dstPoint - The destination point position
|
|
7078
7086
|
*/
|
|
7079
7087
|
transformEdgeMesh(e, t) {
|
|
7080
|
-
this.mesh instanceof te ? this.mesh.update(e, t) : this.mesh.metadata?.is2DLine ?
|
|
7088
|
+
this.mesh instanceof te ? this.mesh.update(e, t) : this.mesh.metadata?.is2DLine ? Fs.updatePositions(this.mesh, e, t) : this.mesh.metadata?.isBezierCurve || G.transformMesh(this.mesh, e, t);
|
|
7081
7089
|
}
|
|
7082
7090
|
/**
|
|
7083
7091
|
* Calculates and applies transformations for arrow head and tail meshes.
|
|
@@ -7137,7 +7145,7 @@ class Tt {
|
|
|
7137
7145
|
this.arrowMesh.metadata?.is2D && n.scaleFactor !== void 0 && (n.scaleFactor = 1);
|
|
7138
7146
|
const c = t.subtract(e).normalize(), h = G.calculateArrowPosition(t, c, o, n);
|
|
7139
7147
|
if (this.context.getStatsManager().endMeasurement("Edge.transformArrowCap.mainPath"), this.arrowMesh.position = h, this.arrowMesh.metadata?.is2D) {
|
|
7140
|
-
const u = Math.atan2(c.y, c.x), p =
|
|
7148
|
+
const u = Math.atan2(c.y, c.x), p = ae.RotationAxis(v.Right(), Math.PI / 2), m = ae.RotationAxis(v.Forward(), u);
|
|
7141
7149
|
this.arrowMesh.rotationQuaternion = m.multiply(p);
|
|
7142
7150
|
} else if (r && [
|
|
7143
7151
|
"normal",
|
|
@@ -7172,7 +7180,7 @@ class Tt {
|
|
|
7172
7180
|
S
|
|
7173
7181
|
), C = c.scale(-1);
|
|
7174
7182
|
if (this.arrowTailMesh.position = x, this.arrowTailMesh.metadata?.is2D) {
|
|
7175
|
-
const k = Math.atan2(C.y, C.x), U =
|
|
7183
|
+
const k = Math.atan2(C.y, C.x), U = ae.RotationAxis(v.Right(), Math.PI / 2), $ = ae.RotationAxis(v.Forward(), k);
|
|
7176
7184
|
this.arrowTailMesh.rotationQuaternion = $.multiply(U);
|
|
7177
7185
|
} else if ([
|
|
7178
7186
|
"normal",
|
|
@@ -7264,7 +7272,7 @@ class Tt {
|
|
|
7264
7272
|
createLabel(e) {
|
|
7265
7273
|
const t = this.extractLabelText(e.label), i = this.placementOf(e.label, Hi, Wi), s = this.createLabelOptions(t, e.label, i);
|
|
7266
7274
|
return {
|
|
7267
|
-
label: new
|
|
7275
|
+
label: new ct(this.context.getScene(), s),
|
|
7268
7276
|
offset: i.attachOffset,
|
|
7269
7277
|
attachPosition: i.attachPosition
|
|
7270
7278
|
};
|
|
@@ -7287,7 +7295,7 @@ class Tt {
|
|
|
7287
7295
|
return String(e.text);
|
|
7288
7296
|
} else if (e.textPath && typeof e.textPath == "string")
|
|
7289
7297
|
try {
|
|
7290
|
-
const t =
|
|
7298
|
+
const t = Zs.search(this.data, e.textPath);
|
|
7291
7299
|
if (t != null)
|
|
7292
7300
|
return String(t);
|
|
7293
7301
|
} catch {
|
|
@@ -7363,16 +7371,16 @@ class Tt {
|
|
|
7363
7371
|
* @returns The caption, and where to hang it from the cap.
|
|
7364
7372
|
*/
|
|
7365
7373
|
createArrowText(e, t) {
|
|
7366
|
-
const i = t === "arrowHead" ? "→" : "←", s = this.extractLabelText(e), r = s === "" ? i : s, a = this.placementOf(e,
|
|
7374
|
+
const i = t === "arrowHead" ? "→" : "←", s = this.extractLabelText(e), r = s === "" ? i : s, a = this.placementOf(e, jt, qt), o = this.createLabelOptions(r, e, a);
|
|
7367
7375
|
return {
|
|
7368
|
-
label: new
|
|
7376
|
+
label: new ct(this.context.getScene(), o),
|
|
7369
7377
|
offset: a.attachOffset,
|
|
7370
7378
|
attachPosition: a.attachPosition
|
|
7371
7379
|
};
|
|
7372
7380
|
}
|
|
7373
7381
|
}
|
|
7374
|
-
const
|
|
7375
|
-
class
|
|
7382
|
+
const Ao = Object.freeze([]);
|
|
7383
|
+
class Oo {
|
|
7376
7384
|
constructor() {
|
|
7377
7385
|
this.map = /* @__PURE__ */ new Map();
|
|
7378
7386
|
}
|
|
@@ -7408,7 +7416,7 @@ class Po {
|
|
|
7408
7416
|
* @returns The edges, which is an empty array when there are none
|
|
7409
7417
|
*/
|
|
7410
7418
|
get(e, t) {
|
|
7411
|
-
return this.map.get(e)?.get(t) ??
|
|
7419
|
+
return this.map.get(e)?.get(t) ?? Ao;
|
|
7412
7420
|
}
|
|
7413
7421
|
/**
|
|
7414
7422
|
* The first edge running from one node to another, for a caller whose question has one answer.
|
|
@@ -7454,17 +7462,17 @@ class Po {
|
|
|
7454
7462
|
this.map.clear();
|
|
7455
7463
|
}
|
|
7456
7464
|
}
|
|
7457
|
-
const
|
|
7458
|
-
function
|
|
7465
|
+
const Ro = "graphty";
|
|
7466
|
+
function Io(l, e) {
|
|
7459
7467
|
return Object.entries(l).every(([t, i]) => e[t] === i);
|
|
7460
7468
|
}
|
|
7461
|
-
function
|
|
7469
|
+
function Do(l, e) {
|
|
7462
7470
|
const t = l.legacyKeys.find(
|
|
7463
|
-
(i) => i.params !== void 0 &&
|
|
7471
|
+
(i) => i.params !== void 0 && Io(i.params, e)
|
|
7464
7472
|
);
|
|
7465
7473
|
return t !== void 0 ? t : l.legacyKeys.find((i) => i.params === void 0) ?? l.legacyKeys[0];
|
|
7466
7474
|
}
|
|
7467
|
-
class
|
|
7475
|
+
class Lo {
|
|
7468
7476
|
/**
|
|
7469
7477
|
* Creates an instance of AlgorithmManager
|
|
7470
7478
|
* @param eventManager - Event manager for emitting algorithm events
|
|
@@ -7509,9 +7517,9 @@ class Io {
|
|
|
7509
7517
|
* @throws A `GraphtyError` when nothing registers the key, or whatever the work threw.
|
|
7510
7518
|
*/
|
|
7511
7519
|
async execute(e, t) {
|
|
7512
|
-
const i = t === void 0 ?
|
|
7520
|
+
const i = t === void 0 ? Jt(e.algorithm) : void 0, s = t ?? i?.descriptor;
|
|
7513
7521
|
if (s === void 0)
|
|
7514
|
-
throw new
|
|
7522
|
+
throw new oe({
|
|
7515
7523
|
code: "E_UNKNOWN_ALGORITHM",
|
|
7516
7524
|
message: `No algorithm is registered under "${e.algorithm}".`,
|
|
7517
7525
|
source: "run",
|
|
@@ -7520,14 +7528,14 @@ class Io {
|
|
|
7520
7528
|
});
|
|
7521
7529
|
const r = t === void 0 && i !== void 0 ? { namespace: i.namespace, type: i.type, options: e.params } : this.targetFor(t, e.params), a = N.get(this.graph, r.namespace, r.type, r.options);
|
|
7522
7530
|
if (a === null)
|
|
7523
|
-
throw new
|
|
7531
|
+
throw new oe({
|
|
7524
7532
|
code: "E_UNKNOWN_ALGORITHM",
|
|
7525
7533
|
message: `The "${e.algorithm}" algorithm resolves to "${r.namespace}:${r.type}", which nothing registers.`,
|
|
7526
7534
|
source: "run",
|
|
7527
7535
|
target: { kind: "run", id: e.runId },
|
|
7528
7536
|
details: { algorithm: e.algorithm, registryKey: `${r.namespace}:${r.type}` }
|
|
7529
7537
|
});
|
|
7530
|
-
const o = await this.compute(a, e, s), { caveats: n } = o.summary(), c =
|
|
7538
|
+
const o = await this.compute(a, e, s), { caveats: n } = o.summary(), c = _r(this.graph.getDataManager()), h = c === 0 ? n : {
|
|
7531
7539
|
...n,
|
|
7532
7540
|
notes: [
|
|
7533
7541
|
...n.notes,
|
|
@@ -7625,8 +7633,8 @@ class Io {
|
|
|
7625
7633
|
* @returns The target.
|
|
7626
7634
|
*/
|
|
7627
7635
|
targetFor(e, t) {
|
|
7628
|
-
const i =
|
|
7629
|
-
return { namespace:
|
|
7636
|
+
const i = Do(e, t);
|
|
7637
|
+
return { namespace: Ro, type: i.key, options: { ...i.params, ...t } };
|
|
7630
7638
|
}
|
|
7631
7639
|
/**
|
|
7632
7640
|
* Do the work.
|
|
@@ -7649,23 +7657,23 @@ class Io {
|
|
|
7649
7657
|
report: (r) => {
|
|
7650
7658
|
t.report(r);
|
|
7651
7659
|
},
|
|
7652
|
-
yieldNow:
|
|
7660
|
+
yieldNow: Fo
|
|
7653
7661
|
},
|
|
7654
7662
|
t.runId,
|
|
7655
7663
|
i.fields
|
|
7656
|
-
) ??
|
|
7664
|
+
) ?? No(t, i);
|
|
7657
7665
|
}
|
|
7658
7666
|
}
|
|
7659
|
-
function
|
|
7667
|
+
function Fo() {
|
|
7660
7668
|
return new Promise((l) => {
|
|
7661
7669
|
setTimeout(l, 0);
|
|
7662
7670
|
});
|
|
7663
7671
|
}
|
|
7664
|
-
function
|
|
7665
|
-
return
|
|
7672
|
+
function No(l, e) {
|
|
7673
|
+
return Nr({
|
|
7666
7674
|
runId: l.runId,
|
|
7667
7675
|
shape: e.shape,
|
|
7668
|
-
fields: e.fields.map((t) => ({ ...t, path:
|
|
7676
|
+
fields: e.fields.map((t) => ({ ...t, path: kr(l.runId, t.name) })),
|
|
7669
7677
|
measured: { nodes: 0, edges: 0 },
|
|
7670
7678
|
caveats: {
|
|
7671
7679
|
exact: !0,
|
|
@@ -7679,11 +7687,11 @@ function Lo(l, e) {
|
|
|
7679
7687
|
durationMs: 0
|
|
7680
7688
|
});
|
|
7681
7689
|
}
|
|
7682
|
-
const
|
|
7690
|
+
const Kt = Object.freeze([
|
|
7683
7691
|
{ source: "source", target: "target", resolvedFrom: "source/target" },
|
|
7684
7692
|
{ source: "src", target: "dst", resolvedFrom: "src/dst" },
|
|
7685
7693
|
{ source: "from", target: "to", resolvedFrom: "from/to" }
|
|
7686
|
-
]),
|
|
7694
|
+
]), ko = 50;
|
|
7687
7695
|
function Pe(l, e) {
|
|
7688
7696
|
try {
|
|
7689
7697
|
return gt.search(l, e);
|
|
@@ -7691,15 +7699,15 @@ function Pe(l, e) {
|
|
|
7691
7699
|
return null;
|
|
7692
7700
|
}
|
|
7693
7701
|
}
|
|
7694
|
-
function
|
|
7702
|
+
function zo(l) {
|
|
7695
7703
|
const e = /* @__PURE__ */ new Set();
|
|
7696
7704
|
for (const t of l)
|
|
7697
7705
|
for (const i of Object.keys(t))
|
|
7698
|
-
if (e.add(i), e.size >=
|
|
7706
|
+
if (e.add(i), e.size >= ko)
|
|
7699
7707
|
return [...e];
|
|
7700
7708
|
return [...e];
|
|
7701
7709
|
}
|
|
7702
|
-
function
|
|
7710
|
+
function Ns(l, e) {
|
|
7703
7711
|
if (e.source !== null && e.target !== null)
|
|
7704
7712
|
return { source: e.source, target: e.target, resolvedFrom: "declared" };
|
|
7705
7713
|
if (e.source !== null || e.target !== null)
|
|
@@ -7709,25 +7717,25 @@ function Ls(l, e) {
|
|
|
7709
7717
|
resolvedFrom: "declared"
|
|
7710
7718
|
};
|
|
7711
7719
|
if (l.length === 0)
|
|
7712
|
-
return
|
|
7713
|
-
for (const i of
|
|
7720
|
+
return Kt[0];
|
|
7721
|
+
for (const i of Kt)
|
|
7714
7722
|
for (const s of l) {
|
|
7715
7723
|
const r = Pe(s, i.source), a = Pe(s, i.target);
|
|
7716
7724
|
if (r != null && a !== null && a !== void 0)
|
|
7717
7725
|
return i;
|
|
7718
7726
|
}
|
|
7719
|
-
const t =
|
|
7720
|
-
throw new
|
|
7727
|
+
const t = zo(l);
|
|
7728
|
+
throw new oe({
|
|
7721
7729
|
code: "E_EDGE_ENDPOINTS_UNRESOLVED",
|
|
7722
7730
|
source: "data",
|
|
7723
7731
|
message: `No edge endpoint columns found. The element looked for source/target, src/dst and from/to, and these records carry ${t.length === 0 ? "no top-level keys at all" : t.join(", ")}. Name the columns with data.knownFields.edgeSrcIdPath and edgeDstIdPath.`,
|
|
7724
|
-
details: { columns: t, tried:
|
|
7732
|
+
details: { columns: t, tried: Kt.map((i) => i.resolvedFrom), records: l.length }
|
|
7725
7733
|
});
|
|
7726
7734
|
}
|
|
7727
|
-
function
|
|
7735
|
+
function li(l) {
|
|
7728
7736
|
return typeof l == "string" || typeof l == "number" && Number.isFinite(l);
|
|
7729
7737
|
}
|
|
7730
|
-
function
|
|
7738
|
+
function _o(l) {
|
|
7731
7739
|
const { position: e } = l;
|
|
7732
7740
|
if (e === null || typeof e != "object")
|
|
7733
7741
|
return null;
|
|
@@ -7742,26 +7750,26 @@ function ko(l) {
|
|
|
7742
7750
|
}
|
|
7743
7751
|
return typeof t != "number" || typeof i != "number" || typeof s != "number" || !Number.isFinite(t) || !Number.isFinite(i) || !Number.isFinite(s) ? null : [t, i, s];
|
|
7744
7752
|
}
|
|
7745
|
-
function
|
|
7746
|
-
if (!
|
|
7747
|
-
return { index:
|
|
7748
|
-
const i = l.builder.nodeCount, s = l.builder.addNode(e), r = l.builder.nodeCount === i, a =
|
|
7753
|
+
function Bo(l, e, t) {
|
|
7754
|
+
if (!li(e))
|
|
7755
|
+
return { index: K, merged: !1 };
|
|
7756
|
+
const i = l.builder.nodeCount, s = l.builder.addNode(e), r = l.builder.nodeCount === i, a = _o(t);
|
|
7749
7757
|
return a !== null && l.builder.setNodeValue(l.seedColumn, s, a), l.touch(), { index: s, merged: r };
|
|
7750
7758
|
}
|
|
7751
|
-
function
|
|
7759
|
+
function Uo(l, e) {
|
|
7752
7760
|
const t = e === null ? void 0 : l[e];
|
|
7753
7761
|
if (typeof t == "number" && Number.isFinite(t))
|
|
7754
7762
|
return { weight: t, source: "path" };
|
|
7755
7763
|
const i = l.value;
|
|
7756
7764
|
return typeof i == "number" && Number.isFinite(i) ? { weight: i, source: "legacy" } : { weight: 1, source: "default" };
|
|
7757
7765
|
}
|
|
7758
|
-
function
|
|
7759
|
-
if (!
|
|
7760
|
-
return { index:
|
|
7766
|
+
function Go(l, e, t, i) {
|
|
7767
|
+
if (!li(e) || !li(t))
|
|
7768
|
+
return { index: K, edgeId: K };
|
|
7761
7769
|
const s = l.builder.addEdge(e, t, i), r = l.nextEdgeId();
|
|
7762
7770
|
return l.builder.setEdgeValue(l.edgeIdColumn, s, r), l.touch(), { index: s, edgeId: r };
|
|
7763
7771
|
}
|
|
7764
|
-
function
|
|
7772
|
+
function $o(l, e, t) {
|
|
7765
7773
|
const { builder: i } = l;
|
|
7766
7774
|
return i.directed === e ? (i.directedLocked || l.recordDirectionFromFile(t), "unchanged") : i.directedLocked ? "config-wins" : i.edgeCount > 0 ? "edges-present" : (i.setDirected(e), l.recordDirectionFromFile(t), l.touch(), "applied");
|
|
7767
7775
|
}
|
|
@@ -7802,7 +7810,7 @@ function Ki(l, e) {
|
|
|
7802
7810
|
})
|
|
7803
7811
|
});
|
|
7804
7812
|
}
|
|
7805
|
-
class
|
|
7813
|
+
class Vo {
|
|
7806
7814
|
constructor() {
|
|
7807
7815
|
this.meshCacheMap = /* @__PURE__ */ new Map(), this.hits = 0, this.misses = 0;
|
|
7808
7816
|
}
|
|
@@ -7838,10 +7846,10 @@ class Go {
|
|
|
7838
7846
|
return this.meshCacheMap.size;
|
|
7839
7847
|
}
|
|
7840
7848
|
}
|
|
7841
|
-
const
|
|
7849
|
+
const Ho = new v(1, 0, 0), Wo = new v(0, 1, 0), jo = 16;
|
|
7842
7850
|
class Pt {
|
|
7843
7851
|
constructor(e, t) {
|
|
7844
|
-
this.scene = e, this.context = t, this.passes = 0, this.entries = /* @__PURE__ */ new Map(), this.order = [], this.grid = /* @__PURE__ */ new Map(), this.columns = 1, this.rows = 1, this.dirty = !0, this.wasOn = !1, this.camera = null, this.view = new Float64Array(16), this.projection = new Float64Array(16), this.width = -1, this.height = -1, this.edgeVersion = -1, this.degrees = /* @__PURE__ */ new Map(), this.transform = new De(), this.toPixels = new De(), this.worldToPixels = new De(), this.viewport = new
|
|
7852
|
+
this.scene = e, this.context = t, this.passes = 0, this.entries = /* @__PURE__ */ new Map(), this.order = [], this.grid = /* @__PURE__ */ new Map(), this.columns = 1, this.rows = 1, this.dirty = !0, this.wasOn = !1, this.camera = null, this.view = new Float64Array(16), this.projection = new Float64Array(16), this.width = -1, this.height = -1, this.edgeVersion = -1, this.degrees = /* @__PURE__ */ new Map(), this.transform = new De(), this.toPixels = new De(), this.worldToPixels = new De(), this.viewport = new Kr(0, 0, 0, 0), this.right = new v(), this.up = new v(), this.centre = new v(), this.corner = new v(), this.centreOnScreen = new v(), this.cornerOnScreen = new v(), this.observer = e.onBeforeRenderObservable.add(() => {
|
|
7845
7853
|
this.run();
|
|
7846
7854
|
}), e.onDisposeObservable.addOnce(() => {
|
|
7847
7855
|
this.dispose();
|
|
@@ -7918,7 +7926,7 @@ class Pt {
|
|
|
7918
7926
|
this.toPixels
|
|
7919
7927
|
), this.transform.multiplyToRef(this.toPixels, this.worldToPixels);
|
|
7920
7928
|
const a = e.getViewMatrix().m;
|
|
7921
|
-
e.getDirectionToRef(
|
|
7929
|
+
e.getDirectionToRef(Ho, this.right), e.getDirectionToRef(Wo, this.up), this.refreshDegrees();
|
|
7922
7930
|
const { order: o } = this;
|
|
7923
7931
|
o.length = 0;
|
|
7924
7932
|
let n = 0, c = 0;
|
|
@@ -7936,8 +7944,8 @@ class Pt {
|
|
|
7936
7944
|
}
|
|
7937
7945
|
if (o.length === 0)
|
|
7938
7946
|
return;
|
|
7939
|
-
o.sort(
|
|
7940
|
-
const h = Math.max(
|
|
7947
|
+
o.sort(qo);
|
|
7948
|
+
const h = Math.max(jo, Math.max(n, c) / o.length);
|
|
7941
7949
|
this.columns = Math.max(1, Math.ceil(i.width / h)), this.rows = Math.max(1, Math.ceil(i.height / h));
|
|
7942
7950
|
for (const d of this.grid.values())
|
|
7943
7951
|
d.length = 0;
|
|
@@ -8021,7 +8029,7 @@ class Pt {
|
|
|
8021
8029
|
this.degrees = i, this.edgeVersion = t;
|
|
8022
8030
|
}
|
|
8023
8031
|
}
|
|
8024
|
-
function
|
|
8032
|
+
function qo(l, e) {
|
|
8025
8033
|
return l.selected !== e.selected ? l.selected ? -1 : 1 : l.degree !== e.degree ? e.degree - l.degree : l.idKey === e.idKey ? 0 : l.idKey < e.idKey ? -1 : 1;
|
|
8026
8034
|
}
|
|
8027
8035
|
function pe(l, e, t) {
|
|
@@ -8034,7 +8042,7 @@ function Zi(l, e) {
|
|
|
8034
8042
|
return !1;
|
|
8035
8043
|
return !0;
|
|
8036
8044
|
}
|
|
8037
|
-
const
|
|
8045
|
+
const Ko = "#FFFF00", Xi = "#FFFFFF", It = class It {
|
|
8038
8046
|
/**
|
|
8039
8047
|
* Check if an effect layer has been disposed.
|
|
8040
8048
|
* Neither HighlightLayer nor GlowLayer has an isDisposed property, so we check whether the
|
|
@@ -8064,7 +8072,7 @@ const jo = "#FFFF00", Xi = "#FFFFFF", It = class It {
|
|
|
8064
8072
|
const t = e.metadata?.highlightLayer;
|
|
8065
8073
|
if (t && !this.isLayerDisposed(t, e))
|
|
8066
8074
|
return t;
|
|
8067
|
-
const i = new
|
|
8075
|
+
const i = new Zr(this.HIGHLIGHT_LAYER_NAME, e, {
|
|
8068
8076
|
isStroke: !0,
|
|
8069
8077
|
blurHorizontalSize: 0.5,
|
|
8070
8078
|
blurVerticalSize: 0.5
|
|
@@ -8094,7 +8102,7 @@ const jo = "#FFFF00", Xi = "#FFFFFF", It = class It {
|
|
|
8094
8102
|
static applyOutlineEffect(e, t) {
|
|
8095
8103
|
const i = e.getScene(), s = this.resolveRenderedMesh(e);
|
|
8096
8104
|
if (t?.outline) {
|
|
8097
|
-
const a = this.extractColorValue(t.outline.color), o = F.FromHexString(a ??
|
|
8105
|
+
const a = this.extractColorValue(t.outline.color), o = F.FromHexString(a ?? Ko);
|
|
8098
8106
|
this.getOrCreateHighlightLayer(i).addMesh(s, o);
|
|
8099
8107
|
return;
|
|
8100
8108
|
}
|
|
@@ -8146,7 +8154,7 @@ const jo = "#FFFF00", Xi = "#FFFFFF", It = class It {
|
|
|
8146
8154
|
const t = e.metadata?.glowLayer;
|
|
8147
8155
|
if (t && !this.isLayerDisposed(t, e))
|
|
8148
8156
|
return t;
|
|
8149
|
-
const i = new
|
|
8157
|
+
const i = new Xr(this.GLOW_LAYER_NAME, e, {
|
|
8150
8158
|
excludeByDefault: !0
|
|
8151
8159
|
}), s = /* @__PURE__ */ new Map();
|
|
8152
8160
|
i.customEmissiveColorSelector = (a, o, n, c) => {
|
|
@@ -8300,7 +8308,7 @@ const jo = "#FFFF00", Xi = "#FFFFFF", It = class It {
|
|
|
8300
8308
|
};
|
|
8301
8309
|
It.HIGHLIGHT_LAYER_NAME = "graphty-selection-highlight", It.GLOW_LAYER_NAME = "graphty-node-glow";
|
|
8302
8310
|
let ht = It;
|
|
8303
|
-
const
|
|
8311
|
+
const di = "GraphtyInstanceColorShading", Zo = 900, Qi = {
|
|
8304
8312
|
glsl: {
|
|
8305
8313
|
stock: String.raw`vec3\s+finalDiffuse\s*=\s*clamp\(\s*diffuseBase\s*\*\s*diffuseColor\s*\+\s*` + String.raw`emissiveColor\s*\+\s*vAmbientColor\s*,\s*0\.0\s*,\s*1\.0\s*\)\s*\*\s*baseColor\.rgb\s*;`,
|
|
8306
8314
|
shaded: "vec3 finalDiffuse=clamp((diffuseBase*diffuseColor+emissiveColor+vAmbientColor)*baseColor.rgb,0.0,1.0);"
|
|
@@ -8310,20 +8318,20 @@ const li = "GraphtyInstanceColorShading", qo = 900, Qi = {
|
|
|
8310
8318
|
shaded: "var finalDiffuse: vec3f=clamp((diffuseBase*diffuseColor+emissiveColor+uniforms.vAmbientColor)*baseColor.rgb,vec3f(0.0),vec3f(1.0));"
|
|
8311
8319
|
}
|
|
8312
8320
|
};
|
|
8313
|
-
class
|
|
8321
|
+
class Xo extends Qr {
|
|
8314
8322
|
/**
|
|
8315
8323
|
* Attaches the plugin to one material and switches it on.
|
|
8316
8324
|
* @param material - The material to shade.
|
|
8317
8325
|
*/
|
|
8318
8326
|
constructor(e) {
|
|
8319
|
-
super(e,
|
|
8327
|
+
super(e, di, Zo, {}, !0, !0);
|
|
8320
8328
|
}
|
|
8321
8329
|
/**
|
|
8322
8330
|
* The name Babylon keys this plugin's shader define on.
|
|
8323
8331
|
* @returns The class name.
|
|
8324
8332
|
*/
|
|
8325
8333
|
getClassName() {
|
|
8326
|
-
return
|
|
8334
|
+
return di;
|
|
8327
8335
|
}
|
|
8328
8336
|
/**
|
|
8329
8337
|
* Whether this plugin can be attached to a material written in the given shader language.
|
|
@@ -8351,10 +8359,10 @@ class Ko extends Zr {
|
|
|
8351
8359
|
return { [`!${i.stock}`]: i.shaded };
|
|
8352
8360
|
}
|
|
8353
8361
|
}
|
|
8354
|
-
function
|
|
8355
|
-
l.pluginManager?.getPlugin(
|
|
8362
|
+
function Qo(l) {
|
|
8363
|
+
l.pluginManager?.getPlugin(di) || new Xo(l);
|
|
8356
8364
|
}
|
|
8357
|
-
const
|
|
8365
|
+
const Jo = 1e-3, Yo = 128, en = 32, Ji = /* @__PURE__ */ new WeakMap(), b = class b {
|
|
8358
8366
|
/**
|
|
8359
8367
|
* Create a node mesh with caching
|
|
8360
8368
|
* @param cache - Mesh cache for reusing geometry
|
|
@@ -8383,7 +8391,7 @@ const Xo = 1e-3, Qo = 128, Jo = 32, Ji = /* @__PURE__ */ new WeakMap(), b = clas
|
|
|
8383
8391
|
const s = this.shapeCreators.get(t.shape.type);
|
|
8384
8392
|
if (!s)
|
|
8385
8393
|
throw new TypeError(`unknown shape: ${t.shape.type}`);
|
|
8386
|
-
const r = Math.max(t.shape.size ?? e.size,
|
|
8394
|
+
const r = Math.max(t.shape.size ?? e.size, Jo);
|
|
8387
8395
|
return s(r, i);
|
|
8388
8396
|
}
|
|
8389
8397
|
/**
|
|
@@ -8431,7 +8439,7 @@ const Xo = 1e-3, Qo = 128, Jo = 32, Ji = /* @__PURE__ */ new WeakMap(), b = clas
|
|
|
8431
8439
|
const [c] = o.colors;
|
|
8432
8440
|
c && (a = F.FromHexString(c));
|
|
8433
8441
|
}
|
|
8434
|
-
return n ? (t && (s.disableLighting = !0, s.emissiveTexture = n), s.diffuseTexture = n) : a && (t ? (s.disableLighting = !0, s.emissiveColor = a) : (s.diffuseColor = a, s.emissiveColor = a.scale(0.2),
|
|
8442
|
+
return n ? (t && (s.disableLighting = !0, s.emissiveTexture = n), s.diffuseTexture = n) : a && (t ? (s.disableLighting = !0, s.emissiveColor = a) : (s.diffuseColor = a, s.emissiveColor = a.scale(0.2), Qo(s))), s.wireframe = e.effect?.wireframe ?? !1, s.freeze(), s;
|
|
8435
8443
|
}
|
|
8436
8444
|
static extractColor(e) {
|
|
8437
8445
|
if (typeof e == "string")
|
|
@@ -8515,7 +8523,7 @@ const Xo = 1e-3, Qo = 128, Jo = 32, Ji = /* @__PURE__ */ new WeakMap(), b = clas
|
|
|
8515
8523
|
const r = s.get(i);
|
|
8516
8524
|
if (r)
|
|
8517
8525
|
return r;
|
|
8518
|
-
if (s.size >=
|
|
8526
|
+
if (s.size >= en)
|
|
8519
8527
|
return;
|
|
8520
8528
|
const a = this.createGradientTexture(e, t, i);
|
|
8521
8529
|
if (a)
|
|
@@ -8547,7 +8555,7 @@ const Xo = 1e-3, Qo = 128, Jo = 32, Ji = /* @__PURE__ */ new WeakMap(), b = clas
|
|
|
8547
8555
|
* @returns The painted texture, or undefined if no 2D canvas is available
|
|
8548
8556
|
*/
|
|
8549
8557
|
static createGradientTexture(e, t, i) {
|
|
8550
|
-
const s =
|
|
8558
|
+
const s = Yo;
|
|
8551
8559
|
let r;
|
|
8552
8560
|
try {
|
|
8553
8561
|
r = new ys(`node-gradient-${i}`, { width: s, height: s }, t, !1);
|
|
@@ -8747,8 +8755,8 @@ b.shapeCreators = /* @__PURE__ */ new Map(), b.registerShapeCreator("box", (e) =
|
|
|
8747
8755
|
(e, t) => b.createPolyhedron(z.ELONGATED_PENTAGONAL_CUPOLA, e, t)
|
|
8748
8756
|
);
|
|
8749
8757
|
let At = b;
|
|
8750
|
-
const
|
|
8751
|
-
class
|
|
8758
|
+
const tn = 300, sn = 5;
|
|
8759
|
+
class rn {
|
|
8752
8760
|
/**
|
|
8753
8761
|
* Creates a new drag handler for a node.
|
|
8754
8762
|
* @param node - The graph node to enable dragging on
|
|
@@ -8890,7 +8898,7 @@ class tn {
|
|
|
8890
8898
|
if (this.dragState.dragging) {
|
|
8891
8899
|
if (this.clickState && !this.clickState.hasMoved) {
|
|
8892
8900
|
const s = this.scene.pointerX - this.clickState.pointerDownPosition.x, r = this.scene.pointerY - this.clickState.pointerDownPosition.y;
|
|
8893
|
-
Math.sqrt(s * s + r * r) >
|
|
8901
|
+
Math.sqrt(s * s + r * r) > sn && (this.clickState.hasMoved = !0);
|
|
8894
8902
|
}
|
|
8895
8903
|
const t = this.scene.createPickingRay(
|
|
8896
8904
|
this.scene.pointerX,
|
|
@@ -8935,7 +8943,7 @@ class tn {
|
|
|
8935
8943
|
* @returns True if the interaction qualifies as a click
|
|
8936
8944
|
*/
|
|
8937
8945
|
isClick() {
|
|
8938
|
-
return this.clickState ? Date.now() - this.clickState.pointerDownTime <
|
|
8946
|
+
return this.clickState ? Date.now() - this.clickState.pointerDownTime < tn && !this.clickState.hasMoved : !1;
|
|
8939
8947
|
}
|
|
8940
8948
|
/**
|
|
8941
8949
|
* Handle a click on this node - select it and emit node-click event.
|
|
@@ -8988,7 +8996,7 @@ class Yi {
|
|
|
8988
8996
|
*/
|
|
8989
8997
|
static addDefaultBehaviors(e, t = {}) {
|
|
8990
8998
|
e.mesh.isPickable = !0, e.pinOnDrag = t.pinOnDrag ?? !0;
|
|
8991
|
-
const i = new
|
|
8999
|
+
const i = new rn(e);
|
|
8992
9000
|
e.dragHandler = i, this.addClickBehavior(e);
|
|
8993
9001
|
}
|
|
8994
9002
|
/**
|
|
@@ -9005,12 +9013,12 @@ class Yi {
|
|
|
9005
9013
|
*/
|
|
9006
9014
|
static addClickBehavior(e) {
|
|
9007
9015
|
const t = this.getContext(e), i = t.getScene();
|
|
9008
|
-
e.mesh.actionManager = e.mesh.actionManager ?? new
|
|
9016
|
+
e.mesh.actionManager = e.mesh.actionManager ?? new Li(i);
|
|
9009
9017
|
const s = e.parentGraph;
|
|
9010
9018
|
e.mesh.actionManager.registerAction(
|
|
9011
|
-
new
|
|
9019
|
+
new Jr(
|
|
9012
9020
|
{
|
|
9013
|
-
trigger:
|
|
9021
|
+
trigger: Li.OnDoublePickTrigger
|
|
9014
9022
|
// trigger: ActionManager.OnLongPressTrigger,
|
|
9015
9023
|
},
|
|
9016
9024
|
() => {
|
|
@@ -9018,7 +9026,7 @@ class Yi {
|
|
|
9018
9026
|
if (!r || !a)
|
|
9019
9027
|
return;
|
|
9020
9028
|
t.setRunning(!0);
|
|
9021
|
-
const o = a(e, s), n = Array.from(o), c =
|
|
9029
|
+
const o = a(e, s), n = Array.from(o), c = Ns(n, { source: null, target: null }), h = /* @__PURE__ */ new Set();
|
|
9022
9030
|
n.forEach((p) => {
|
|
9023
9031
|
h.add(Pe(p, c.source)), h.add(Pe(p, c.target));
|
|
9024
9032
|
}), h.delete(e.id);
|
|
@@ -9041,7 +9049,7 @@ class Yi {
|
|
|
9041
9049
|
return "getStyles" in e.parentGraph, e.parentGraph;
|
|
9042
9050
|
}
|
|
9043
9051
|
}
|
|
9044
|
-
const es = ue.getLogger(["graphty", "node"]),
|
|
9052
|
+
const es = ue.getLogger(["graphty", "node"]), an = "graphty-selection-halo", on = "graphty-context-point", nn = "#8A8A8A", cn = 0.3, hn = 0.18, ts = 0.2;
|
|
9045
9053
|
class Ot {
|
|
9046
9054
|
/**
|
|
9047
9055
|
* Creates a new Node instance with mesh, label, and behaviors.
|
|
@@ -9057,9 +9065,9 @@ class Ot {
|
|
|
9057
9065
|
* @param opts - Optional configuration options for the node
|
|
9058
9066
|
*/
|
|
9059
9067
|
constructor(e, t, i, s, r = {}) {
|
|
9060
|
-
this.index =
|
|
9068
|
+
this.index = K, this.drawnStyle = null, this.drawnColor = null, this.dragging = !1, this.renderState = "visible", this.selected = !1, this.sessionPaint = null, this.halo = null, this.contextPoint = null, this.disposed = !1, this.parentGraph = e, this.id = t, this.opts = r, this.data = s, this.meshKey = i.meshKey;
|
|
9061
9069
|
const a = i.style;
|
|
9062
|
-
this.size = a.shape?.size ?? 0, this.shapeType = a.shape?.type, this.mesh = At.create(
|
|
9070
|
+
this.drawnStyle = a, this.drawnColor = i.color, this.size = a.shape?.size ?? 0, this.shapeType = a.shape?.type, this.mesh = At.create(
|
|
9063
9071
|
this.context.getMeshCache(),
|
|
9064
9072
|
{ styleId: i.meshKey, is2D: this.context.is2D(), size: this.size },
|
|
9065
9073
|
{ shape: a.shape, texture: a.texture, effect: a.effect },
|
|
@@ -9118,7 +9126,7 @@ class Ot {
|
|
|
9118
9126
|
*/
|
|
9119
9127
|
currentPaint() {
|
|
9120
9128
|
const e = this.context.getStylePainter?.();
|
|
9121
|
-
return (e?.owns === !0 ? this.sessionPaint ?? e.nodePaint(this.index) : null) ??
|
|
9129
|
+
return (e?.owns === !0 ? this.sessionPaint ?? e.nodePaint(this.index) : null) ?? Ls();
|
|
9122
9130
|
}
|
|
9123
9131
|
/**
|
|
9124
9132
|
* Draw this node as the session's style stack resolved it.
|
|
@@ -9185,37 +9193,39 @@ class Ot {
|
|
|
9185
9193
|
* @param color - The per-instance colour, or null when the style carries it itself.
|
|
9186
9194
|
*/
|
|
9187
9195
|
paintFrom(e, t, i) {
|
|
9188
|
-
if (this.context.getStatsManager().startMeasurement("Node.updateMesh"), e === this.meshKey && !this.mesh.isDisposed()) {
|
|
9189
|
-
this.
|
|
9196
|
+
if (this.context.getStatsManager().startMeasurement("Node.updateMesh"), (e === this.meshKey || ie.isEqual(t, this.drawnStyle) && ie.isEqual(i, this.drawnColor)) && !this.mesh.isDisposed()) {
|
|
9197
|
+
this.meshKey = e, this.drawnStyle = t, this.drawnColor = i;
|
|
9198
|
+
const d = this.mesh.metadata;
|
|
9199
|
+
d !== void 0 && (d.styleId = e), this.applyInstancePaint(t, i), this.syncLabel(t, !1), this.syncTooltip(t), this.context.getStatsManager().endMeasurement("Node.updateMesh");
|
|
9190
9200
|
return;
|
|
9191
9201
|
}
|
|
9192
|
-
this.meshKey = e;
|
|
9193
|
-
const
|
|
9202
|
+
this.meshKey = e, this.drawnStyle = t, this.drawnColor = i;
|
|
9203
|
+
const r = {
|
|
9194
9204
|
x: this.mesh.position.x,
|
|
9195
9205
|
y: this.mesh.position.y,
|
|
9196
9206
|
z: this.mesh.position.z
|
|
9197
9207
|
};
|
|
9198
9208
|
this.mesh.isDisposed() || this.mesh.dispose();
|
|
9199
|
-
const
|
|
9200
|
-
if (this.size = t.shape?.size ?? 0, this.shapeType = t.shape?.type, this.size !==
|
|
9201
|
-
const
|
|
9202
|
-
for (const
|
|
9203
|
-
(
|
|
9209
|
+
const a = this.size, o = this.shapeType;
|
|
9210
|
+
if (this.size = t.shape?.size ?? 0, this.shapeType = t.shape?.type, this.size !== a || this.shapeType !== o) {
|
|
9211
|
+
const d = this.context.getDataManager();
|
|
9212
|
+
for (const u of d.edges.values())
|
|
9213
|
+
(u.srcNode === this || u.dstNode === this) && u.invalidatePositionCache();
|
|
9204
9214
|
}
|
|
9205
9215
|
this.mesh = At.create(
|
|
9206
9216
|
this.context.getMeshCache(),
|
|
9207
9217
|
{ styleId: e, is2D: this.context.is2D(), size: this.size },
|
|
9208
9218
|
{ shape: t.shape, texture: t.texture, effect: t.effect },
|
|
9209
9219
|
this.context.getScene()
|
|
9210
|
-
), this.mesh.position.x =
|
|
9211
|
-
const
|
|
9212
|
-
|
|
9220
|
+
), this.mesh.position.x = r.x, this.mesh.position.y = r.y, this.mesh.position.z = r.z;
|
|
9221
|
+
const n = this.context.getScene().getTransformNodeByName("graph-root");
|
|
9222
|
+
n && (this.mesh.parent = n), this.mesh.metadata = {
|
|
9213
9223
|
graphNode: this,
|
|
9214
9224
|
styleId: e,
|
|
9215
9225
|
nodeId: this.id
|
|
9216
9226
|
};
|
|
9217
|
-
const
|
|
9218
|
-
|
|
9227
|
+
const h = this.context.getLayoutManager().layoutEngine?.getNodePosition(this);
|
|
9228
|
+
h && (this.mesh.position.x = h.x, this.mesh.position.y = h.y, this.mesh.position.z = h.z ?? 0), this.syncLabel(t, !0), this.syncTooltip(t), this.dragHandler && this.dragHandler.dispose(), Yi.addDefaultBehaviors(this, this.opts), this.applyRenderState(), this.applyInstancePaint(t, i), this.context.getStatsManager().endMeasurement("Node.updateMesh");
|
|
9219
9229
|
}
|
|
9220
9230
|
/**
|
|
9221
9231
|
* Tears down every Babylon resource this node owns.
|
|
@@ -9325,7 +9335,7 @@ class Ot {
|
|
|
9325
9335
|
* @returns The configured colour, scale and opacity.
|
|
9326
9336
|
*/
|
|
9327
9337
|
selectionStyle() {
|
|
9328
|
-
return this.context.getStyles().config.graph.selection ??
|
|
9338
|
+
return this.context.getStyles().config.graph.selection ?? Ms;
|
|
9329
9339
|
}
|
|
9330
9340
|
/**
|
|
9331
9341
|
* Redraw this node's selection halo from the configuration as it now stands.
|
|
@@ -9349,7 +9359,7 @@ class Ot {
|
|
|
9349
9359
|
}
|
|
9350
9360
|
const s = this.selectionStyle(), r = i && !i.isDisposed() ? i : this.createOverlay(e);
|
|
9351
9361
|
e === "halo" ? (this.halo = r, Ot.paintHalo(r, s)) : this.contextPoint = r;
|
|
9352
|
-
const a = e === "halo" ? this.haloScale(s.scale) : Math.max(this.size, ts) *
|
|
9362
|
+
const a = e === "halo" ? this.haloScale(s.scale) : Math.max(this.size, ts) * cn;
|
|
9353
9363
|
r.scaling.setAll(a), r.position.copyFrom(this.mesh.position), r.setEnabled(!0);
|
|
9354
9364
|
}
|
|
9355
9365
|
/**
|
|
@@ -9383,7 +9393,7 @@ class Ot {
|
|
|
9383
9393
|
* @returns The instance, parented and ready to be positioned.
|
|
9384
9394
|
*/
|
|
9385
9395
|
createOverlay(e) {
|
|
9386
|
-
const t = this.context.getScene(), i = this.selectionStyle(), s = e === "halo" ?
|
|
9396
|
+
const t = this.context.getScene(), i = this.selectionStyle(), s = e === "halo" ? an : on, r = e === "halo" ? i.color : nn, a = e === "halo" ? i.opacity : hn, o = this.context.getMeshCache().get(s, () => Ot.createOverlaySource(s, r, a, t));
|
|
9387
9397
|
o.isPickable = !1;
|
|
9388
9398
|
const n = t.getTransformNodeByName("graph-root");
|
|
9389
9399
|
return n && (o.parent = n), o;
|
|
@@ -9504,7 +9514,7 @@ class Ot {
|
|
|
9504
9514
|
*/
|
|
9505
9515
|
syncLabel(e, t) {
|
|
9506
9516
|
const i = e.label?.enabled === !0 ? e.label : void 0, s = i === void 0 ? void 0 : this.extractLabelText(i);
|
|
9507
|
-
!t && s === this.drawnLabelText &&
|
|
9517
|
+
!t && s === this.drawnLabelText && ie.isEqual(i, this.drawnLabelStyle) || (this.label?.dispose(), this.label = i === void 0 ? void 0 : this.createLabel(e), this.drawnLabelText = s, this.drawnLabelStyle = i === void 0 ? void 0 : ie.cloneDeep(i));
|
|
9508
9518
|
}
|
|
9509
9519
|
/**
|
|
9510
9520
|
* Remember what this node's tooltip should say, and redraw it if one is on screen.
|
|
@@ -9521,7 +9531,7 @@ class Ot {
|
|
|
9521
9531
|
*/
|
|
9522
9532
|
syncTooltip(e) {
|
|
9523
9533
|
const t = e.tooltip?.enabled === !0 ? e.tooltip : void 0;
|
|
9524
|
-
|
|
9534
|
+
ie.isEqual(t, this.wantedTooltip) || (this.wantedTooltip = t === void 0 ? void 0 : ie.cloneDeep(t), this.tooltip && (this.hideTooltip(), this.showTooltip()));
|
|
9525
9535
|
}
|
|
9526
9536
|
/**
|
|
9527
9537
|
* Draw this node's tooltip, if a layer gave it one.
|
|
@@ -9534,7 +9544,7 @@ class Ot {
|
|
|
9534
9544
|
if (this.disposed || this.tooltip || this.wantedTooltip === void 0 || this.mesh.isDisposed())
|
|
9535
9545
|
return;
|
|
9536
9546
|
const e = this.extractLabelText(this.wantedTooltip);
|
|
9537
|
-
this.tooltip = new
|
|
9547
|
+
this.tooltip = new ct(this.mesh.getScene(), {
|
|
9538
9548
|
...this.createLabelOptions(e, this.wantedTooltip),
|
|
9539
9549
|
onTop: !0
|
|
9540
9550
|
});
|
|
@@ -9558,7 +9568,7 @@ class Ot {
|
|
|
9558
9568
|
}
|
|
9559
9569
|
createLabel(e) {
|
|
9560
9570
|
const t = this.extractLabelText(e.label), i = this.createLabelOptions(t, e.label), s = this.mesh.getScene();
|
|
9561
|
-
return Pt.track(s, this.context, this), new
|
|
9571
|
+
return Pt.track(s, this.context, this), new ct(s, i);
|
|
9562
9572
|
}
|
|
9563
9573
|
extractLabelText(e) {
|
|
9564
9574
|
if (!e)
|
|
@@ -9673,11 +9683,11 @@ class Ot {
|
|
|
9673
9683
|
return this.positionsLane?.isPinned(this.index) ?? !1;
|
|
9674
9684
|
}
|
|
9675
9685
|
}
|
|
9676
|
-
const
|
|
9686
|
+
const ln = /^-?\d+$/;
|
|
9677
9687
|
function is(l) {
|
|
9678
9688
|
return typeof l == "string" || typeof l == "number" && Number.isFinite(l);
|
|
9679
9689
|
}
|
|
9680
|
-
function
|
|
9690
|
+
function dn(l, e, t) {
|
|
9681
9691
|
switch (l) {
|
|
9682
9692
|
case "sum":
|
|
9683
9693
|
return e + t;
|
|
@@ -9689,14 +9699,14 @@ function hn(l, e, t) {
|
|
|
9689
9699
|
return t;
|
|
9690
9700
|
}
|
|
9691
9701
|
}
|
|
9692
|
-
class
|
|
9702
|
+
class un {
|
|
9693
9703
|
/**
|
|
9694
9704
|
* Creates an instance of DataManager
|
|
9695
9705
|
* @param eventManager - Event manager for emitting data events
|
|
9696
9706
|
* @param styles - Styles instance for applying styles to data
|
|
9697
9707
|
*/
|
|
9698
9708
|
constructor(e, t) {
|
|
9699
|
-
this.eventManager = e, this.styles = t, this.nodes = /* @__PURE__ */ new Map(), this.edges = /* @__PURE__ */ new Map(), this.edgeVersion = 0, this.nodeCache = /* @__PURE__ */ new Map(), this.edgeCache = new
|
|
9709
|
+
this.eventManager = e, this.styles = t, this.nodes = /* @__PURE__ */ new Map(), this.edges = /* @__PURE__ */ new Map(), this.edgeVersion = 0, this.nodeCache = /* @__PURE__ */ new Map(), this.edgeCache = new Oo(), this.edgesByIndex = [], this.logger = ue.getLogger(["graphty", "data"]), this.graphContext = null, this.shouldStartLayout = !1, this.shouldZoomToFit = !1, this.pendingEdges = [], this.pendingByPair = /* @__PURE__ */ new Map(), this.edgesByRecordId = /* @__PURE__ */ new Map(), this.importReport = null, this.loadEndpoints = null, this.loadTally = null, this.meshCache = new Vo(), this.store = this.createStore();
|
|
9700
9710
|
}
|
|
9701
9711
|
/**
|
|
9702
9712
|
* The current graph snapshot, freezing first when records have arrived since the last one.
|
|
@@ -9770,7 +9780,7 @@ class ln {
|
|
|
9770
9780
|
*/
|
|
9771
9781
|
createStore() {
|
|
9772
9782
|
const { data: e } = this.styles.config;
|
|
9773
|
-
return new
|
|
9783
|
+
return new Ws({
|
|
9774
9784
|
directed: e.directed,
|
|
9775
9785
|
positionScale: () => this.styles.config.data.knownFields.positionScale,
|
|
9776
9786
|
onNodeRemap: (t) => {
|
|
@@ -9799,7 +9809,7 @@ class ln {
|
|
|
9799
9809
|
*/
|
|
9800
9810
|
walkNodeRemap(e) {
|
|
9801
9811
|
for (const t of this.nodes.values())
|
|
9802
|
-
t.index = e[t.index] ??
|
|
9812
|
+
t.index = e[t.index] ?? K;
|
|
9803
9813
|
}
|
|
9804
9814
|
/**
|
|
9805
9815
|
* Re-key {@link edgesByIndex} and every `Edge.index` after a compacting freeze, and drop any
|
|
@@ -9809,13 +9819,13 @@ class ln {
|
|
|
9809
9819
|
walkEdgeRemap(e) {
|
|
9810
9820
|
this.edgesByIndex.length = 0;
|
|
9811
9821
|
for (const i of this.edges.values()) {
|
|
9812
|
-
const s = e[i.index] ??
|
|
9813
|
-
i.index = s, s !==
|
|
9822
|
+
const s = e[i.index] ?? K;
|
|
9823
|
+
i.index = s, s !== K && (this.edgesByIndex[s] = i);
|
|
9814
9824
|
}
|
|
9815
9825
|
const t = [];
|
|
9816
9826
|
for (const i of this.pendingEdges) {
|
|
9817
|
-
const s = e[i.edgeIndex] ??
|
|
9818
|
-
if (s ===
|
|
9827
|
+
const s = e[i.edgeIndex] ?? K;
|
|
9828
|
+
if (s === K) {
|
|
9819
9829
|
this.forgetPending(i);
|
|
9820
9830
|
continue;
|
|
9821
9831
|
}
|
|
@@ -9955,10 +9965,10 @@ class ln {
|
|
|
9955
9965
|
continue;
|
|
9956
9966
|
if (!this.graphContext)
|
|
9957
9967
|
throw new Error("GraphContext not set. Call setGraphContext before adding nodes.");
|
|
9958
|
-
const a = new Ot(this.graphContext, r,
|
|
9968
|
+
const a = new Ot(this.graphContext, r, Ls(), s, {
|
|
9959
9969
|
pinOnDrag: this.graphContext.getConfig().pinOnDrag
|
|
9960
9970
|
});
|
|
9961
|
-
a.index =
|
|
9971
|
+
a.index = Bo(this.store, r, s).index, this.nodeCache.set(r, a), this.nodes.set(r, a), this.layoutEngine && this.layoutEngine.addNode(a), this.eventManager.emitNodeEvent("node-add-before", {
|
|
9962
9972
|
nodeId: r,
|
|
9963
9973
|
metadata: s
|
|
9964
9974
|
});
|
|
@@ -10031,7 +10041,7 @@ class ln {
|
|
|
10031
10041
|
*/
|
|
10032
10042
|
getNode(e) {
|
|
10033
10043
|
const t = this.nodes.get(e);
|
|
10034
|
-
return t !== void 0 ? t : typeof e == "string" ?
|
|
10044
|
+
return t !== void 0 ? t : typeof e == "string" ? ln.test(e) ? this.nodes.get(Number.parseInt(e, 10)) : void 0 : Number.isInteger(e) ? this.nodes.get(String(e)) : void 0;
|
|
10035
10045
|
}
|
|
10036
10046
|
/**
|
|
10037
10047
|
* Remove a node AND every edge attached to it.
|
|
@@ -10062,10 +10072,10 @@ class ln {
|
|
|
10062
10072
|
* @returns the ids of the edges that went with it
|
|
10063
10073
|
*/
|
|
10064
10074
|
detachNodeFromStore(e) {
|
|
10065
|
-
if (e.index ===
|
|
10075
|
+
if (e.index === K)
|
|
10066
10076
|
return [];
|
|
10067
10077
|
const t = this.store.builder.removeNodeByIndex(e.index);
|
|
10068
|
-
if (this.store.touch(), e.index =
|
|
10078
|
+
if (this.store.touch(), e.index = K, t.length === 0)
|
|
10069
10079
|
return [];
|
|
10070
10080
|
const i = new Set(t), s = [], r = /* @__PURE__ */ new Set();
|
|
10071
10081
|
for (const o of i) {
|
|
@@ -10093,7 +10103,7 @@ class ln {
|
|
|
10093
10103
|
* @param edgeIndex - the row it occupied, which the caller has in hand
|
|
10094
10104
|
*/
|
|
10095
10105
|
teardownEdge(e, t) {
|
|
10096
|
-
this.edges.delete(e.id), this.edgeVersion++, this.edgeCache.delete(e.srcId, e.dstId, e), this.edgesByIndex[t] = void 0, e.index =
|
|
10106
|
+
this.edges.delete(e.id), this.edgeVersion++, this.edgeCache.delete(e.srcId, e.dstId, e), this.edgesByIndex[t] = void 0, e.index = K, this.layoutEngine?.removeEdge(e), e.dispose();
|
|
10097
10107
|
}
|
|
10098
10108
|
// Edge operations
|
|
10099
10109
|
/**
|
|
@@ -10132,13 +10142,13 @@ class ln {
|
|
|
10132
10142
|
let c = 0;
|
|
10133
10143
|
for (const h of e) {
|
|
10134
10144
|
n.edgeRecords++;
|
|
10135
|
-
const d = Pe(h, s.source), u = Pe(h, s.target), p =
|
|
10145
|
+
const d = Pe(h, s.source), u = Pe(h, s.target), p = Uo(h, o);
|
|
10136
10146
|
p.source === "legacy" && c++, p.source !== "default" && (n.weightsResolvedFrom = p.source, n.weightsAttribute = p.source === "legacy" ? "value" : o);
|
|
10137
10147
|
const m = a === null ? void 0 : Pe(h, a), y = this.knownEdgeFor(d, u, m);
|
|
10138
10148
|
if (y !== null && (n.repeatedSeen++, this.mergeRepeat(y, h, p.weight, r, d, u, n)))
|
|
10139
10149
|
continue;
|
|
10140
|
-
const { index: w, edgeId: S } =
|
|
10141
|
-
if (w ===
|
|
10150
|
+
const { index: w, edgeId: S } = Go(this.store, d, u, p.weight);
|
|
10151
|
+
if (w === K) {
|
|
10142
10152
|
n.rejected++;
|
|
10143
10153
|
continue;
|
|
10144
10154
|
}
|
|
@@ -10195,7 +10205,7 @@ class ln {
|
|
|
10195
10205
|
return { source: t.source, target: t.target, resolvedFrom: "declared" };
|
|
10196
10206
|
if (this.loadEndpoints !== null)
|
|
10197
10207
|
return this.loadEndpoints;
|
|
10198
|
-
const { knownFields: i } = this.styles.config.data, s =
|
|
10208
|
+
const { knownFields: i } = this.styles.config.data, s = Ns(e, {
|
|
10199
10209
|
source: t?.source ?? i.edgeSrcIdPath,
|
|
10200
10210
|
target: t?.target ?? i.edgeDstIdPath
|
|
10201
10211
|
});
|
|
@@ -10243,7 +10253,7 @@ class ln {
|
|
|
10243
10253
|
if (s === "keep")
|
|
10244
10254
|
return o.repeatedKept++, !1;
|
|
10245
10255
|
if (s === "error")
|
|
10246
|
-
throw new
|
|
10256
|
+
throw new oe({
|
|
10247
10257
|
code: "E_DUPLICATE_EDGE",
|
|
10248
10258
|
source: "data",
|
|
10249
10259
|
message: `Two edges run from ${JSON.stringify(r)} to ${JSON.stringify(a)}, and data.knownFields.repeatedEdges is "error". Set it to "keep" to hold both, or to "first", "last", "sum", "min" or "max" to fold them into one.`,
|
|
@@ -10251,7 +10261,7 @@ class ln {
|
|
|
10251
10261
|
});
|
|
10252
10262
|
if (s === "first")
|
|
10253
10263
|
return o.repeatedDropped++, !0;
|
|
10254
|
-
const n = this.store.builder.edgeWeight(e.edgeIndex), c =
|
|
10264
|
+
const n = this.store.builder.edgeWeight(e.edgeIndex), c = dn(s, n, i);
|
|
10255
10265
|
return this.store.builder.setEdgeWeight(e.edgeIndex, c), this.store.touch(), s === "last" && (e.edge ? e.edge.data = t : e.pending && (e.pending.record = t)), o.repeatedMerged++, !0;
|
|
10256
10266
|
}
|
|
10257
10267
|
/**
|
|
@@ -10284,7 +10294,7 @@ class ln {
|
|
|
10284
10294
|
if (!t)
|
|
10285
10295
|
return !1;
|
|
10286
10296
|
const { index: i } = t;
|
|
10287
|
-
return i !==
|
|
10297
|
+
return i !== K && (this.store.builder.removeEdge(i), this.store.touch()), this.teardownEdge(t, i), !0;
|
|
10288
10298
|
}
|
|
10289
10299
|
// Data source operations
|
|
10290
10300
|
/**
|
|
@@ -10302,7 +10312,7 @@ class ln {
|
|
|
10302
10312
|
applyDeclaredDirection(e, t) {
|
|
10303
10313
|
if (t === null)
|
|
10304
10314
|
return !1;
|
|
10305
|
-
const i =
|
|
10315
|
+
const i = $o(this.store, t.directed, t.statedBy);
|
|
10306
10316
|
return i === "config-wins" ? this.logger.info("File declares a direction the configuration has already settled", {
|
|
10307
10317
|
type: e,
|
|
10308
10318
|
fileDeclares: t.directed,
|
|
@@ -10338,7 +10348,7 @@ class ln {
|
|
|
10338
10348
|
try {
|
|
10339
10349
|
const h = Z.get(e, t);
|
|
10340
10350
|
if (!h)
|
|
10341
|
-
throw
|
|
10351
|
+
throw la(e);
|
|
10342
10352
|
const d = t.size;
|
|
10343
10353
|
try {
|
|
10344
10354
|
let u = !1;
|
|
@@ -10407,12 +10417,12 @@ class ln {
|
|
|
10407
10417
|
u instanceof Error ? u : new Error(String(u)),
|
|
10408
10418
|
"data-loading",
|
|
10409
10419
|
{ chunksLoaded: a, dataSourceType: e }
|
|
10410
|
-
)),
|
|
10420
|
+
)), Yt(u) ? u : new Error(
|
|
10411
10421
|
`Failed to load data from source '${e}' after ${a} chunks: ${u instanceof Error ? u.message : String(u)}`
|
|
10412
10422
|
);
|
|
10413
10423
|
}
|
|
10414
10424
|
} catch (h) {
|
|
10415
|
-
throw
|
|
10425
|
+
throw Yt(h) || h instanceof Error && h.message.includes("Failed to load data") ? h : new Error(
|
|
10416
10426
|
`Error initializing data source '${e}': ${h instanceof Error ? h.message : String(h)}`
|
|
10417
10427
|
);
|
|
10418
10428
|
} finally {
|
|
@@ -10481,7 +10491,7 @@ class ln {
|
|
|
10481
10491
|
};
|
|
10482
10492
|
}
|
|
10483
10493
|
}
|
|
10484
|
-
class
|
|
10494
|
+
class gn {
|
|
10485
10495
|
constructor() {
|
|
10486
10496
|
this.graphObservable = new Nt(), this.nodeObservable = new Nt(), this.edgeObservable = new Nt(), this.observers = /* @__PURE__ */ new Map(), this.errorRetryCount = 3, this.errorRetryDelay = 1e3;
|
|
10487
10497
|
}
|
|
@@ -10944,7 +10954,7 @@ class dn {
|
|
|
10944
10954
|
throw r ?? new Error("Operation failed with no recorded error");
|
|
10945
10955
|
}
|
|
10946
10956
|
}
|
|
10947
|
-
class
|
|
10957
|
+
class pn {
|
|
10948
10958
|
/**
|
|
10949
10959
|
* Creates an instance of DefaultGraphContext
|
|
10950
10960
|
* @param styles - Reads the element's configuration document. A function rather than the
|
|
@@ -11062,14 +11072,14 @@ class un {
|
|
|
11062
11072
|
this.layoutManager.running = e;
|
|
11063
11073
|
}
|
|
11064
11074
|
}
|
|
11065
|
-
var
|
|
11066
|
-
class
|
|
11075
|
+
var ze = /* @__PURE__ */ ((l) => (l[l.Mouse = 0] = "Mouse", l[l.Touch = 1] = "Touch", l))(ze || {}), Ae = /* @__PURE__ */ ((l) => (l[l.Left = 0] = "Left", l[l.Middle = 1] = "Middle", l[l.Right = 2] = "Right", l))(Ae || {});
|
|
11076
|
+
class Zt {
|
|
11067
11077
|
/**
|
|
11068
11078
|
* Creates a new BabylonInputSystem instance
|
|
11069
11079
|
* @param scene - The Babylon.js scene to attach to
|
|
11070
11080
|
*/
|
|
11071
11081
|
constructor(e) {
|
|
11072
|
-
this.onPointerMove = new W(), this.onPointerDown = new W(), this.onPointerUp = new W(), this.onWheel = new W(), this.onTouchStart = new W(), this.onTouchMove = new W(), this.onTouchEnd = new W(), this.onKeyDown = new W(), this.onKeyUp = new W(), this.element = null, this.pointerPosition = new
|
|
11082
|
+
this.onPointerMove = new W(), this.onPointerDown = new W(), this.onPointerUp = new W(), this.onWheel = new W(), this.onTouchStart = new W(), this.onTouchMove = new W(), this.onTouchEnd = new W(), this.onKeyDown = new W(), this.onKeyUp = new W(), this.element = null, this.pointerPosition = new xs(0, 0), this.pointerStates = /* @__PURE__ */ new Map(), this.activeTouches = /* @__PURE__ */ new Map(), this.handleTouchStart = (t) => {
|
|
11073
11083
|
const i = this.extractTouches(t.touches);
|
|
11074
11084
|
i.forEach((s) => this.activeTouches.set(s.id, s)), this.onTouchStart.notifyObservers(i);
|
|
11075
11085
|
}, this.handleTouchMove = (t) => {
|
|
@@ -11107,10 +11117,10 @@ class Kt {
|
|
|
11107
11117
|
}), this.scene.onKeyboardObservable.add((e) => {
|
|
11108
11118
|
const t = this.convertKeyboardInfo(e);
|
|
11109
11119
|
switch (e.type) {
|
|
11110
|
-
case
|
|
11120
|
+
case Fi.KEYDOWN:
|
|
11111
11121
|
this.onKeyDown.notifyObservers(t);
|
|
11112
11122
|
break;
|
|
11113
|
-
case
|
|
11123
|
+
case Fi.KEYUP:
|
|
11114
11124
|
this.onKeyUp.notifyObservers(t);
|
|
11115
11125
|
break;
|
|
11116
11126
|
}
|
|
@@ -11118,8 +11128,8 @@ class Kt {
|
|
|
11118
11128
|
}
|
|
11119
11129
|
convertPointerInfo(e) {
|
|
11120
11130
|
const t = e.event;
|
|
11121
|
-
let i =
|
|
11122
|
-
t.pointerType === "touch" && (i =
|
|
11131
|
+
let i = ze.Mouse;
|
|
11132
|
+
t.pointerType === "touch" && (i = ze.Touch);
|
|
11123
11133
|
let s = Ae.Left;
|
|
11124
11134
|
return t.button === 1 ? s = Ae.Middle : t.button === 2 && (s = Ae.Right), {
|
|
11125
11135
|
x: t.clientX,
|
|
@@ -11201,7 +11211,7 @@ class Kt {
|
|
|
11201
11211
|
}
|
|
11202
11212
|
class St {
|
|
11203
11213
|
constructor() {
|
|
11204
|
-
this.onPointerMove = new W(), this.onPointerDown = new W(), this.onPointerUp = new W(), this.onWheel = new W(), this.onTouchStart = new W(), this.onTouchMove = new W(), this.onTouchEnd = new W(), this.onKeyDown = new W(), this.onKeyUp = new W(), this.pointerPosition = new
|
|
11214
|
+
this.onPointerMove = new W(), this.onPointerDown = new W(), this.onPointerUp = new W(), this.onWheel = new W(), this.onTouchStart = new W(), this.onTouchMove = new W(), this.onTouchEnd = new W(), this.onKeyDown = new W(), this.onKeyUp = new W(), this.pointerPosition = new xs(0, 0), this.pointerStates = /* @__PURE__ */ new Map(), this.activeTouches = /* @__PURE__ */ new Map(), this.activeKeys = /* @__PURE__ */ new Set(), this._nextPointerId = 1, this.attached = !1;
|
|
11205
11215
|
}
|
|
11206
11216
|
// Device simulation
|
|
11207
11217
|
/**
|
|
@@ -11218,7 +11228,7 @@ class St {
|
|
|
11218
11228
|
y: t,
|
|
11219
11229
|
button: Ae.Left,
|
|
11220
11230
|
// Default for move
|
|
11221
|
-
deviceType:
|
|
11231
|
+
deviceType: ze.Mouse,
|
|
11222
11232
|
pointerId: 1,
|
|
11223
11233
|
isPrimary: !0,
|
|
11224
11234
|
pressure: 0.5
|
|
@@ -11239,7 +11249,7 @@ class St {
|
|
|
11239
11249
|
x: this.pointerPosition.x,
|
|
11240
11250
|
y: this.pointerPosition.y,
|
|
11241
11251
|
button: e,
|
|
11242
|
-
deviceType:
|
|
11252
|
+
deviceType: ze.Mouse,
|
|
11243
11253
|
pointerId: 1,
|
|
11244
11254
|
isPrimary: !0,
|
|
11245
11255
|
pressure: 1
|
|
@@ -11260,7 +11270,7 @@ class St {
|
|
|
11260
11270
|
x: this.pointerPosition.x,
|
|
11261
11271
|
y: this.pointerPosition.y,
|
|
11262
11272
|
button: e,
|
|
11263
|
-
deviceType:
|
|
11273
|
+
deviceType: ze.Mouse,
|
|
11264
11274
|
pointerId: 1,
|
|
11265
11275
|
isPrimary: !0,
|
|
11266
11276
|
pressure: 0
|
|
@@ -11453,14 +11463,14 @@ class St {
|
|
|
11453
11463
|
this.pointerPosition.set(0, 0), this.pointerStates.clear(), this.activeTouches.clear(), this.activeKeys.clear();
|
|
11454
11464
|
}
|
|
11455
11465
|
}
|
|
11456
|
-
class
|
|
11466
|
+
class mn {
|
|
11457
11467
|
/**
|
|
11458
11468
|
* Creates an instance of InputManager
|
|
11459
11469
|
* @param context - Manager context providing access to scene, canvas, and event manager
|
|
11460
11470
|
* @param config - Input manager configuration options
|
|
11461
11471
|
*/
|
|
11462
11472
|
constructor(e, t = {}) {
|
|
11463
|
-
this.context = e, this.config = t, this.enabled = !0, this.recordedEvents = [], this.playbackIndex = 0, this.playbackStartTime = 0, this.inputSystem = this.config.useMockInput ? new St() : new
|
|
11473
|
+
this.context = e, this.config = t, this.enabled = !0, this.recordedEvents = [], this.playbackIndex = 0, this.playbackStartTime = 0, this.inputSystem = this.config.useMockInput ? new St() : new Zt(this.context.scene), this.onPointerMove = this.inputSystem.onPointerMove, this.onPointerDown = this.inputSystem.onPointerDown, this.onPointerUp = this.inputSystem.onPointerUp, this.onWheel = this.inputSystem.onWheel, this.onTouchStart = this.inputSystem.onTouchStart, this.onTouchMove = this.inputSystem.onTouchMove, this.onTouchEnd = this.inputSystem.onTouchEnd, this.onKeyDown = this.inputSystem.onKeyDown, this.onKeyUp = this.inputSystem.onKeyUp;
|
|
11464
11474
|
}
|
|
11465
11475
|
/**
|
|
11466
11476
|
* Initializes the input manager and sets up event bridges
|
|
@@ -11487,7 +11497,7 @@ class gn {
|
|
|
11487
11497
|
* @param enabled - Whether input should be enabled
|
|
11488
11498
|
*/
|
|
11489
11499
|
setEnabled(e) {
|
|
11490
|
-
this.enabled = e, !e && this.inputSystem instanceof
|
|
11500
|
+
this.enabled = e, !e && this.inputSystem instanceof Zt ? this.inputSystem.detach() : e && this.inputSystem instanceof Zt && this.inputSystem.attach(this.context.canvas), this.context.eventManager.emitGraphEvent("input-enabled-changed", { enabled: e });
|
|
11491
11501
|
}
|
|
11492
11502
|
/**
|
|
11493
11503
|
* Get the current pointer position
|
|
@@ -11685,13 +11695,13 @@ class gn {
|
|
|
11685
11695
|
}));
|
|
11686
11696
|
}
|
|
11687
11697
|
}
|
|
11688
|
-
const
|
|
11698
|
+
const fn = 256, yn = {
|
|
11689
11699
|
forceatlas2: ms.zodOptionsSchema,
|
|
11690
|
-
fruchtermanReingold:
|
|
11691
|
-
spring:
|
|
11700
|
+
fruchtermanReingold: Qt.zodOptionsSchema,
|
|
11701
|
+
spring: Qt.zodOptionsSchema,
|
|
11692
11702
|
"spring-electrical": ps.zodOptionsSchema
|
|
11693
|
-
},
|
|
11694
|
-
function
|
|
11703
|
+
}, wn = 100;
|
|
11704
|
+
function vn(l, e) {
|
|
11695
11705
|
const t = { dim: e.dim, seed: e.seed };
|
|
11696
11706
|
switch (l) {
|
|
11697
11707
|
case "forceatlas2":
|
|
@@ -11734,14 +11744,14 @@ function yn(l, e) {
|
|
|
11734
11744
|
}
|
|
11735
11745
|
}
|
|
11736
11746
|
}
|
|
11737
|
-
function
|
|
11738
|
-
return (l.scalingFactor ??
|
|
11747
|
+
function bn(l) {
|
|
11748
|
+
return (l.scalingFactor ?? wn) * (l.scale ?? 1);
|
|
11739
11749
|
}
|
|
11740
|
-
function
|
|
11741
|
-
const i =
|
|
11750
|
+
function Sn(l, e, t) {
|
|
11751
|
+
const i = Lr(yn[l]).parse(e), s = typeof e.iterationsPerStep == "number" ? e.iterationsPerStep : void 0, r = typeof e.maxInFlight == "number" ? e.maxInFlight : void 0;
|
|
11742
11752
|
return {
|
|
11743
|
-
model:
|
|
11744
|
-
scalingFactor:
|
|
11753
|
+
model: vn(l, i),
|
|
11754
|
+
scalingFactor: bn(i),
|
|
11745
11755
|
iterationsPerStep: s ?? t.iterationsPerStep ?? null,
|
|
11746
11756
|
maxInFlight: r ?? t.maxInFlight,
|
|
11747
11757
|
settleThreshold: typeof e.settleThreshold == "number" ? e.settleThreshold : void 0,
|
|
@@ -11749,18 +11759,18 @@ function vn(l, e, t) {
|
|
|
11749
11759
|
stepMultiplier: t.stepMultiplier
|
|
11750
11760
|
};
|
|
11751
11761
|
}
|
|
11752
|
-
function
|
|
11753
|
-
return e === void 0 ? { ...t } :
|
|
11762
|
+
function En(l, e, t) {
|
|
11763
|
+
return e === void 0 ? { ...t } : Ss(e.options, t, { kind: "layout", id: l });
|
|
11754
11764
|
}
|
|
11755
11765
|
function ss(l) {
|
|
11756
|
-
return new
|
|
11766
|
+
return new oe({
|
|
11757
11767
|
code: "E_UNKNOWN_LAYOUT",
|
|
11758
11768
|
message: `no layout named "${l}" is registered`,
|
|
11759
11769
|
source: "layout",
|
|
11760
11770
|
details: { layout: l, available: V.getRegisteredTypes() }
|
|
11761
11771
|
});
|
|
11762
11772
|
}
|
|
11763
|
-
class
|
|
11773
|
+
class Cn {
|
|
11764
11774
|
/**
|
|
11765
11775
|
* Creates an instance of LayoutManager
|
|
11766
11776
|
* @param eventManager - Event manager for emitting layout events
|
|
@@ -11846,7 +11856,7 @@ class Sn {
|
|
|
11846
11856
|
* @param error - Whatever was thrown.
|
|
11847
11857
|
*/
|
|
11848
11858
|
reportSimulationFailure(e) {
|
|
11849
|
-
const t =
|
|
11859
|
+
const t = oe.wrap(e, { code: "E_INTERNAL", source: "layout" });
|
|
11850
11860
|
this.logger.error("The running layout could not be rebuilt", t, {
|
|
11851
11861
|
layoutType: this.layoutType
|
|
11852
11862
|
}), this.eventManager.emitGraphError(this.graphContext, t, "layout", { layoutType: this.layoutType });
|
|
@@ -11882,7 +11892,7 @@ class Sn {
|
|
|
11882
11892
|
const i = V.getClass(e);
|
|
11883
11893
|
if (!i)
|
|
11884
11894
|
throw ss(e);
|
|
11885
|
-
const s =
|
|
11895
|
+
const s = En(e, i.descriptor, t), r = { ...s }, o = this.styles.config.graph.viewMode === "2d" || this.styles.config.graph.twoD ? 2 : 3, n = V.getOptionsForDimensionByType(e, o);
|
|
11886
11896
|
if (n)
|
|
11887
11897
|
for (const [m, y] of Object.entries(n))
|
|
11888
11898
|
m in r || (r[m] = y);
|
|
@@ -11893,7 +11903,7 @@ class Sn {
|
|
|
11893
11903
|
h = V.get(e, r);
|
|
11894
11904
|
else {
|
|
11895
11905
|
if (this.acceleration === null)
|
|
11896
|
-
throw new
|
|
11906
|
+
throw new oe({
|
|
11897
11907
|
code: "E_INTERNAL",
|
|
11898
11908
|
message: `the layout "${e}" runs on the graph's acceleration controller, and this layout manager has no graph context to read one from`,
|
|
11899
11909
|
source: "layout",
|
|
@@ -11903,7 +11913,7 @@ class Sn {
|
|
|
11903
11913
|
const m = {
|
|
11904
11914
|
type: c,
|
|
11905
11915
|
layoutType: e,
|
|
11906
|
-
options:
|
|
11916
|
+
options: Sn(
|
|
11907
11917
|
c,
|
|
11908
11918
|
r,
|
|
11909
11919
|
this.styles.config.behavior.layout
|
|
@@ -11980,7 +11990,7 @@ class Sn {
|
|
|
11980
11990
|
*/
|
|
11981
11991
|
reportLayoutFailure(e, t, i) {
|
|
11982
11992
|
const s = t instanceof Error ? t : new Error(String(t));
|
|
11983
|
-
return this.logger.error(`Layout could not be ${i}`, s, { layoutType: e }), this.graphContext && this.eventManager.emitGraphError(this.graphContext, s, "layout", { layoutType: e, phase: i }),
|
|
11993
|
+
return this.logger.error(`Layout could not be ${i}`, s, { layoutType: e }), this.graphContext && this.eventManager.emitGraphError(this.graphContext, s, "layout", { layoutType: e, phase: i }), Yt(s) ? s : new oe({
|
|
11984
11994
|
code: "E_INTERNAL",
|
|
11985
11995
|
message: `the layout "${e}" could not be ${i}: ${s.message}`,
|
|
11986
11996
|
source: "layout",
|
|
@@ -12022,7 +12032,7 @@ class Sn {
|
|
|
12022
12032
|
const { preSteps: t } = this.styles.config.behavior.layout;
|
|
12023
12033
|
if (this.preStepsOwed = !1, e instanceof ge)
|
|
12024
12034
|
for (let i = t; i > 0 && !e.isSettled; ) {
|
|
12025
|
-
const s = Math.min(i,
|
|
12035
|
+
const s = Math.min(i, fn);
|
|
12026
12036
|
await e.stepAsync(s), i -= s;
|
|
12027
12037
|
}
|
|
12028
12038
|
else
|
|
@@ -12192,10 +12202,10 @@ class Sn {
|
|
|
12192
12202
|
}), Promise.resolve()));
|
|
12193
12203
|
}
|
|
12194
12204
|
}
|
|
12195
|
-
function
|
|
12205
|
+
function Mn(l) {
|
|
12196
12206
|
return "startRenderLoop" in l;
|
|
12197
12207
|
}
|
|
12198
|
-
class
|
|
12208
|
+
class xn {
|
|
12199
12209
|
/**
|
|
12200
12210
|
* Creates a new lifecycle manager for coordinating manager initialization and disposal
|
|
12201
12211
|
* @param managers - Map of manager names to manager instances
|
|
@@ -12267,7 +12277,7 @@ class Cn {
|
|
|
12267
12277
|
throw new Error("Cannot start graph before initialization");
|
|
12268
12278
|
try {
|
|
12269
12279
|
const t = this.managers.get("render");
|
|
12270
|
-
t &&
|
|
12280
|
+
t && Mn(t) && t.startRenderLoop(e), this.eventManager.emitGraphEvent("graph-started", {
|
|
12271
12281
|
timestamp: Date.now()
|
|
12272
12282
|
});
|
|
12273
12283
|
} catch (t) {
|
|
@@ -12361,7 +12371,7 @@ class Cn {
|
|
|
12361
12371
|
return this.managers.get(e);
|
|
12362
12372
|
}
|
|
12363
12373
|
}
|
|
12364
|
-
const
|
|
12374
|
+
const Tn = {
|
|
12365
12375
|
// Data operations obsolete dependent calculations.
|
|
12366
12376
|
//
|
|
12367
12377
|
// WHAT `algorithm-run` MEANS HERE, because the rule below is only correct for one reading of
|
|
@@ -12436,7 +12446,7 @@ const Mn = {
|
|
|
12436
12446
|
respectProgress: !1
|
|
12437
12447
|
// The latest view the consumer asked for is the one to draw
|
|
12438
12448
|
}
|
|
12439
|
-
},
|
|
12449
|
+
}, Pn = 90, An = 1e3, On = 10, Ne = class Ne {
|
|
12440
12450
|
/**
|
|
12441
12451
|
* Creates a new operation queue manager
|
|
12442
12452
|
* @param eventManager - Event manager for emitting operation events
|
|
@@ -12453,7 +12463,7 @@ const Mn = {
|
|
|
12453
12463
|
// Sequential by default
|
|
12454
12464
|
autoStart: t.autoStart ?? !0
|
|
12455
12465
|
};
|
|
12456
|
-
t.intervalCap !== void 0 && (i.intervalCap = t.intervalCap), t.interval !== void 0 && (i.interval = t.interval), this.queue = new
|
|
12466
|
+
t.intervalCap !== void 0 && (i.intervalCap = t.intervalCap), t.interval !== void 0 && (i.interval = t.interval), this.queue = new wa(i), this.queue.on("active", () => {
|
|
12457
12467
|
this.eventManager.emitGraphEvent("operation-queue-active", {
|
|
12458
12468
|
size: this.queue.size,
|
|
12459
12469
|
pending: this.queue.pending
|
|
@@ -12520,7 +12530,7 @@ const Mn = {
|
|
|
12520
12530
|
* @param newOperation - The new operation to check for obsolescence rules
|
|
12521
12531
|
*/
|
|
12522
12532
|
applyObsolescenceRules(e) {
|
|
12523
|
-
const { metadata: t } = e, i =
|
|
12533
|
+
const { metadata: t } = e, i = Tn[e.category];
|
|
12524
12534
|
if (!t?.obsoletes && !t?.shouldObsolete && !t?.respectProgress && !t?.skipRunning && !i?.obsoletes)
|
|
12525
12535
|
return;
|
|
12526
12536
|
const s = t?.obsoletes ?? [], r = i?.obsoletes ?? [], a = [.../* @__PURE__ */ new Set([...s, ...r])], o = t?.shouldObsolete, n = t?.skipRunning ?? i?.skipRunning ?? !1, c = t?.respectProgress ?? i?.respectProgress ?? !0, h = [
|
|
@@ -12539,7 +12549,7 @@ const Mn = {
|
|
|
12539
12549
|
})), u) {
|
|
12540
12550
|
if (c && this.runningOperations.has(d.id)) {
|
|
12541
12551
|
const m = this.operationProgress.get(d.id);
|
|
12542
|
-
if (m && m.percent >=
|
|
12552
|
+
if (m && m.percent >= Pn)
|
|
12543
12553
|
continue;
|
|
12544
12554
|
}
|
|
12545
12555
|
const p = this.activeControllers.get(d.id);
|
|
@@ -12581,7 +12591,7 @@ const Mn = {
|
|
|
12581
12591
|
} finally {
|
|
12582
12592
|
setTimeout(() => {
|
|
12583
12593
|
this.operationProgress.delete(s.id), this.activeControllers.delete(s.id);
|
|
12584
|
-
},
|
|
12594
|
+
}, An);
|
|
12585
12595
|
}
|
|
12586
12596
|
},
|
|
12587
12597
|
{
|
|
@@ -12620,7 +12630,7 @@ const Mn = {
|
|
|
12620
12630
|
});
|
|
12621
12631
|
let r;
|
|
12622
12632
|
try {
|
|
12623
|
-
r =
|
|
12633
|
+
r = va.array(i, s);
|
|
12624
12634
|
} catch (o) {
|
|
12625
12635
|
this.eventManager.emitGraphError(
|
|
12626
12636
|
null,
|
|
@@ -12884,7 +12894,7 @@ const Mn = {
|
|
|
12884
12894
|
*/
|
|
12885
12895
|
async _waitForOperation(e) {
|
|
12886
12896
|
for (; this.pendingOperations.has(e) || this.queuedOperations.has(e) || this.runningOperations.has(e); )
|
|
12887
|
-
await new Promise((t) => setTimeout(t,
|
|
12897
|
+
await new Promise((t) => setTimeout(t, On));
|
|
12888
12898
|
}
|
|
12889
12899
|
/**
|
|
12890
12900
|
* Get the AbortController for a specific operation
|
|
@@ -13051,8 +13061,8 @@ Ne.CATEGORY_DEPENDENCIES = [
|
|
|
13051
13061
|
"data-update": ["layout-update"],
|
|
13052
13062
|
"algorithm-run": ["style-apply"]
|
|
13053
13063
|
};
|
|
13054
|
-
let
|
|
13055
|
-
class
|
|
13064
|
+
let ui = Ne;
|
|
13065
|
+
class Rn {
|
|
13056
13066
|
/**
|
|
13057
13067
|
* Creates a new CameraManager instance.
|
|
13058
13068
|
* @param scene - The Babylon.js scene to manage cameras for
|
|
@@ -13132,13 +13142,13 @@ class An {
|
|
|
13132
13142
|
}
|
|
13133
13143
|
}
|
|
13134
13144
|
const Ie = ue.getLogger(["graphty", "camera", "pivot"]);
|
|
13135
|
-
class
|
|
13145
|
+
class In {
|
|
13136
13146
|
/**
|
|
13137
13147
|
* Creates a new PivotController instance.
|
|
13138
13148
|
* @param scene - The Babylon.js scene to create the pivot in
|
|
13139
13149
|
*/
|
|
13140
13150
|
constructor(e) {
|
|
13141
|
-
this.accumulatedYaw = 0, this.accumulatedPitch = 0, this.frameCount = 0, this.pivot = new
|
|
13151
|
+
this.accumulatedYaw = 0, this.accumulatedPitch = 0, this.frameCount = 0, this.pivot = new yi("xrPivot", e), this.pivot.position = v.Zero(), this.pivot.rotationQuaternion = ae.Identity(), Ie.debug("Created pivot node");
|
|
13142
13152
|
}
|
|
13143
13153
|
/**
|
|
13144
13154
|
* Rotate the pivot by yaw (Y-axis) and pitch (X-axis) deltas.
|
|
@@ -13165,7 +13175,7 @@ class On {
|
|
|
13165
13175
|
rotateAroundAxis(e, t) {
|
|
13166
13176
|
if (Math.abs(t) < 1e-4 || e.length() < 1e-4)
|
|
13167
13177
|
return;
|
|
13168
|
-
const i = e.normalize(), s = this.pivot.rotationQuaternion ??
|
|
13178
|
+
const i = e.normalize(), s = this.pivot.rotationQuaternion ?? ae.Identity(), r = ae.RotationAxis(i, t);
|
|
13169
13179
|
this.pivot.rotationQuaternion = r.multiply(s), this.frameCount % 30 === 0 && Ie.trace("RotateAroundAxis", {
|
|
13170
13180
|
axis: { x: i.x, y: i.y, z: i.z },
|
|
13171
13181
|
angle: t * 180 / Math.PI
|
|
@@ -13224,11 +13234,11 @@ class On {
|
|
|
13224
13234
|
* - Unit scale
|
|
13225
13235
|
*/
|
|
13226
13236
|
reset() {
|
|
13227
|
-
this.pivot.position = v.Zero(), this.pivot.rotationQuaternion =
|
|
13237
|
+
this.pivot.position = v.Zero(), this.pivot.rotationQuaternion = ae.Identity(), this.pivot.scaling.setAll(1), this.accumulatedYaw = 0, this.accumulatedPitch = 0, Ie.debug("Reset to initial state");
|
|
13228
13238
|
}
|
|
13229
13239
|
}
|
|
13230
|
-
const
|
|
13231
|
-
class
|
|
13240
|
+
const Dn = 1e4;
|
|
13241
|
+
class Ln {
|
|
13232
13242
|
/** Half the diagonal of the last bounding box fitted by zoomToBoundingBox. */
|
|
13233
13243
|
#e = 0;
|
|
13234
13244
|
/**
|
|
@@ -13246,7 +13256,7 @@ class In {
|
|
|
13246
13256
|
* @param config - Configuration options for the orbit camera
|
|
13247
13257
|
*/
|
|
13248
13258
|
constructor(e, t, i) {
|
|
13249
|
-
this.config = i, this.scene = t, this.scene.clearColor = new Ee(0, 0, 0, 1), this.pivotController = new
|
|
13259
|
+
this.config = i, this.scene = t, this.scene.clearColor = new Ee(0, 0, 0, 1), this.pivotController = new In(t), this.cameraDistance = 10, this.camera = new Yr("camera", new v(0, 0, -this.cameraDistance), this.scene), this.camera.inputs.clear(), this.scene.activeCamera = this.camera, this.camera.attachControl(e, !0), this.updateCameraPosition();
|
|
13250
13260
|
}
|
|
13251
13261
|
/**
|
|
13252
13262
|
* Rotate the scene by dx (yaw) and dy (pitch) amounts.
|
|
@@ -13273,14 +13283,14 @@ class In {
|
|
|
13273
13283
|
*/
|
|
13274
13284
|
zoom(e) {
|
|
13275
13285
|
const t = Math.max(this.config.maxZoomDistance, this.cameraDistance + this.#e * 2);
|
|
13276
|
-
this.cameraDistance =
|
|
13286
|
+
this.cameraDistance = ea.Clamp(this.cameraDistance + e, this.config.minZoomDistance, t);
|
|
13277
13287
|
}
|
|
13278
13288
|
/**
|
|
13279
13289
|
* Update camera position relative to the pivot.
|
|
13280
13290
|
* Parents camera to pivot and positions at negative Z distance.
|
|
13281
13291
|
*/
|
|
13282
13292
|
updateCameraPosition() {
|
|
13283
|
-
this.camera.parent = this.pivot, this.camera.position.set(0, 0, -this.cameraDistance), this.camera.rotation.set(0, 0, 0), this.camera.maxZ = Math.max(
|
|
13293
|
+
this.camera.parent = this.pivot, this.camera.position.set(0, 0, -this.cameraDistance), this.camera.rotation.set(0, 0, 0), this.camera.maxZ = Math.max(Dn, this.cameraDistance + this.#e * 2);
|
|
13284
13294
|
}
|
|
13285
13295
|
/**
|
|
13286
13296
|
* Zoom the camera to fit a bounding box in view.
|
|
@@ -13308,7 +13318,7 @@ class In {
|
|
|
13308
13318
|
this.cameraDistance = Math.max(S, this.config.minZoomDistance), this.updateCameraPosition();
|
|
13309
13319
|
}
|
|
13310
13320
|
}
|
|
13311
|
-
class
|
|
13321
|
+
class Fn {
|
|
13312
13322
|
/**
|
|
13313
13323
|
* Creates a new OrbitInputController instance.
|
|
13314
13324
|
* @param canvas - The HTML canvas element to attach input listeners to
|
|
@@ -13369,7 +13379,7 @@ class Dn {
|
|
|
13369
13379
|
e.arrowleft && (this.rotationVelocityY += this.config.keyboardRotationSpeed), e.arrowright && (this.rotationVelocityY -= this.config.keyboardRotationSpeed), e.arrowup && (this.rotationVelocityX += this.config.keyboardRotationSpeed), e.arrowdown && (this.rotationVelocityX -= this.config.keyboardRotationSpeed), e.w && t.zoom(-this.config.keyboardZoomSpeed), e.s && t.zoom(this.config.keyboardZoomSpeed), e.a && t.spin(this.config.keyboardYawSpeed), e.d && t.spin(-this.config.keyboardYawSpeed), Math.abs(this.rotationVelocityX) > 1e-5 && (t.rotate(0, -this.rotationVelocityX / this.config.trackballRotationSpeed), this.rotationVelocityX *= this.config.inertiaDamping), Math.abs(this.rotationVelocityY) > 1e-5 && (t.rotate(-this.rotationVelocityY / this.config.trackballRotationSpeed, 0), this.rotationVelocityY *= this.config.inertiaDamping), t.updateCameraPosition();
|
|
13370
13380
|
}
|
|
13371
13381
|
}
|
|
13372
|
-
class
|
|
13382
|
+
class Nn {
|
|
13373
13383
|
/**
|
|
13374
13384
|
* Creates a new TwoDCameraController instance.
|
|
13375
13385
|
* @param scene - The Babylon.js scene
|
|
@@ -13378,7 +13388,7 @@ class Ln {
|
|
|
13378
13388
|
* @param config - Configuration options for 2D camera controls
|
|
13379
13389
|
*/
|
|
13380
13390
|
constructor(e, t, i, s) {
|
|
13381
|
-
this.scene = e, this.engine = t, this.canvas = i, this.config = s, this.velocity = { x: 0, y: 0, zoom: 0, rotate: 0 }, this.camera = new
|
|
13391
|
+
this.scene = e, this.engine = t, this.canvas = i, this.config = s, this.velocity = { x: 0, y: 0, zoom: 0, rotate: 0 }, this.camera = new ta("orthoCamera", new v(0, 0, -10), e), this.camera.mode = pt.ORTHOGRAPHIC_CAMERA, this.camera.inertia = 0, this.camera.inputs.clear(), this.parent = new yi("parent", e), this.updateOrtho(s.initialOrthoSize), this.camera.setTarget(v.Zero());
|
|
13382
13392
|
}
|
|
13383
13393
|
/**
|
|
13384
13394
|
* Updates the orthographic camera bounds based on size.
|
|
@@ -13452,7 +13462,7 @@ class Ln {
|
|
|
13452
13462
|
this.camera.position.z = e.z - Math.max(10, h), this.camera.maxZ = Math.max(1e4, h + Math.abs(this.camera.position.z) * 2), this.updateOrtho(c * 1.1);
|
|
13453
13463
|
}
|
|
13454
13464
|
}
|
|
13455
|
-
class
|
|
13465
|
+
class kn {
|
|
13456
13466
|
/**
|
|
13457
13467
|
* Creates a new InputController instance.
|
|
13458
13468
|
* @param cam - The 2D camera controller to manipulate
|
|
@@ -13558,8 +13568,8 @@ class Fn {
|
|
|
13558
13568
|
this.applyKeyboardInertia(), this.cam.applyInertia();
|
|
13559
13569
|
}
|
|
13560
13570
|
}
|
|
13561
|
-
const
|
|
13562
|
-
class
|
|
13571
|
+
const zn = "graph-root";
|
|
13572
|
+
class _n {
|
|
13563
13573
|
/**
|
|
13564
13574
|
* Creates a new render manager for Babylon.js scene and rendering
|
|
13565
13575
|
* @param canvas - HTML canvas element for rendering
|
|
@@ -13569,13 +13579,13 @@ class kn {
|
|
|
13569
13579
|
constructor(e, t, i = {}) {
|
|
13570
13580
|
this.canvas = e, this.eventManager = t, this.config = i, this.renderLoopActive = !1, this.focusOnPointer = (a) => {
|
|
13571
13581
|
a.preventDefault(), this.canvas.focus({ preventScroll: !0 });
|
|
13572
|
-
},
|
|
13582
|
+
}, Ni.LogLevels = Ni.ErrorLogLevel, this.config.useWebGPU ? this.engine = new ki(this.canvas) : this.engine = new Ct(this.canvas, !0, {
|
|
13573
13583
|
preserveDrawingBuffer: !0
|
|
13574
13584
|
// Required for screenshots
|
|
13575
|
-
}), this.scene = new
|
|
13585
|
+
}), this.scene = new ia(this.engine), this.scene.preventDefaultOnPointerDown = !1, this.scene.preventDefaultOnPointerUp = !1, this.canvas.addEventListener("pointerdown", this.focusOnPointer), this.canvas.addEventListener("pointerup", this.focusOnPointer), this.graphRoot = new yi(zn, this.scene), this.graphRoot.position = v.Zero(), this.graphRoot.rotationQuaternion = ae.Identity(), this.resizeHandler = () => {
|
|
13576
13586
|
this.engine.resize();
|
|
13577
|
-
}, this.camera = new
|
|
13578
|
-
const s = new
|
|
13587
|
+
}, this.camera = new Rn(this.scene), this.scene.metadata = this.scene.metadata ?? {}, this.scene.metadata.cameraManager = this.camera, this.setupCameras();
|
|
13588
|
+
const s = new sa("light", new v(1, 1, 0), this.scene);
|
|
13579
13589
|
s.groundColor = new F(0.35, 0.35, 0.35);
|
|
13580
13590
|
const r = this.config.backgroundColor ?? "#F5F5F5";
|
|
13581
13591
|
this.scene.clearColor = Ee.FromHexString(r);
|
|
@@ -13585,7 +13595,7 @@ class kn {
|
|
|
13585
13595
|
*/
|
|
13586
13596
|
async init() {
|
|
13587
13597
|
try {
|
|
13588
|
-
this.engine instanceof
|
|
13598
|
+
this.engine instanceof ki && await this.engine.initAsync(), await this.scene.whenReadyAsync(), window.addEventListener("resize", this.resizeHandler), this.eventManager.emitGraphEvent("render-initialized", {
|
|
13589
13599
|
engine: this.engine,
|
|
13590
13600
|
scene: this.scene
|
|
13591
13601
|
});
|
|
@@ -13653,7 +13663,7 @@ class kn {
|
|
|
13653
13663
|
* Setup camera configurations
|
|
13654
13664
|
*/
|
|
13655
13665
|
setupCameras() {
|
|
13656
|
-
const e = new
|
|
13666
|
+
const e = new Ln(this.canvas, this.scene, {
|
|
13657
13667
|
trackballRotationSpeed: 5e-3,
|
|
13658
13668
|
keyboardRotationSpeed: 0.03,
|
|
13659
13669
|
keyboardZoomSpeed: 0.2,
|
|
@@ -13664,9 +13674,9 @@ class kn {
|
|
|
13664
13674
|
maxZoomDistance: 2e3,
|
|
13665
13675
|
// The zoom-out ceiling for a small graph; a fit of a larger one raises it
|
|
13666
13676
|
inertiaDamping: 0.9
|
|
13667
|
-
}), t = new
|
|
13677
|
+
}), t = new Fn(this.canvas, e);
|
|
13668
13678
|
this.camera.registerCamera("orbit", e, t);
|
|
13669
|
-
const i = new
|
|
13679
|
+
const i = new Nn(this.scene, this.engine, this.canvas, {
|
|
13670
13680
|
panAcceleration: 0.02,
|
|
13671
13681
|
panDamping: 0.85,
|
|
13672
13682
|
zoomFactorPerFrame: 0.02,
|
|
@@ -13685,7 +13695,7 @@ class kn {
|
|
|
13685
13695
|
initialOrthoSize: 5,
|
|
13686
13696
|
rotationEnabled: !0,
|
|
13687
13697
|
inertiaEnabled: !0
|
|
13688
|
-
}), s = new
|
|
13698
|
+
}), s = new kn(i, this.canvas, {
|
|
13689
13699
|
panAcceleration: 0.02,
|
|
13690
13700
|
panDamping: 0.85,
|
|
13691
13701
|
zoomFactorPerFrame: 0.02,
|
|
@@ -13708,7 +13718,7 @@ class kn {
|
|
|
13708
13718
|
this.camera.registerCamera("2d", i, s), this.camera.activateCamera("orbit");
|
|
13709
13719
|
}
|
|
13710
13720
|
}
|
|
13711
|
-
class
|
|
13721
|
+
class Bn {
|
|
13712
13722
|
/**
|
|
13713
13723
|
* Creates a new selection manager
|
|
13714
13724
|
* @param eventManager - Event manager for emitting selection events
|
|
@@ -13854,7 +13864,7 @@ const rs = ue.getLogger(["graphty", "stats"]), ut = class ut {
|
|
|
13854
13864
|
* @param eventManager - Event manager for emitting stats events
|
|
13855
13865
|
*/
|
|
13856
13866
|
constructor(e) {
|
|
13857
|
-
this.eventManager = e, this.sceneInstrumentation = null, this.babylonInstrumentation = null, this.graphStep = new
|
|
13867
|
+
this.eventManager = e, this.sceneInstrumentation = null, this.babylonInstrumentation = null, this.graphStep = new se(), this.nodeUpdate = new se(), this.edgeUpdate = new se(), this.arrowCapUpdate = new se(), this.intersectCalc = new se(), this.loadTime = new se(), this.totalUpdates = 0, this.meshCacheHits = 0, this.meshCacheMisses = 0, this.nodeCount = 0, this.edgeCount = 0, this.enabled = !1, this.measurements = /* @__PURE__ */ new Map(), this.activeStack = [], this.counters = /* @__PURE__ */ new Map(), this.layoutSessionStartTime = null, this.layoutSessionEndTime = null, this.frameProfilingEnabled = !1, this.frameProfiles = [], this.currentFrameOperations = [], this.currentFrameNumber = 0, this.longTaskObserver = null;
|
|
13858
13868
|
}
|
|
13859
13869
|
/**
|
|
13860
13870
|
* Initialize the stats manager
|
|
@@ -13876,7 +13886,7 @@ const rs = ue.getLogger(["graphty", "stats"]), ut = class ut {
|
|
|
13876
13886
|
* @param engine - The Babylon.js engine (Engine or WebGPUEngine)
|
|
13877
13887
|
*/
|
|
13878
13888
|
initializeBabylonInstrumentation(e, t) {
|
|
13879
|
-
this.sceneInstrumentation = new
|
|
13889
|
+
this.sceneInstrumentation = new ra(e), this.sceneInstrumentation.captureFrameTime = !0, this.sceneInstrumentation.captureRenderTime = !0, this.sceneInstrumentation.captureInterFrameTime = !0, this.sceneInstrumentation.captureCameraRenderTime = !0, this.sceneInstrumentation.captureActiveMeshesEvaluationTime = !0, this.sceneInstrumentation.captureRenderTargetsRenderTime = !0, this.babylonInstrumentation = new aa(t), this.babylonInstrumentation.captureGPUFrameTime = !0, this.babylonInstrumentation.captureShaderCompilationTime = !0;
|
|
13880
13890
|
}
|
|
13881
13891
|
/**
|
|
13882
13892
|
* Inject mocked instrumentation for testing
|
|
@@ -13922,7 +13932,7 @@ const rs = ue.getLogger(["graphty", "stats"]), ut = class ut {
|
|
|
13922
13932
|
* Reset performance counters
|
|
13923
13933
|
*/
|
|
13924
13934
|
resetCounters() {
|
|
13925
|
-
this.graphStep = new
|
|
13935
|
+
this.graphStep = new se(), this.nodeUpdate = new se(), this.edgeUpdate = new se(), this.arrowCapUpdate = new se(), this.intersectCalc = new se(), this.loadTime = new se(), this.totalUpdates = 0;
|
|
13926
13936
|
}
|
|
13927
13937
|
/**
|
|
13928
13938
|
* Get current statistics
|
|
@@ -14456,9 +14466,9 @@ ${r}
|
|
|
14456
14466
|
}
|
|
14457
14467
|
};
|
|
14458
14468
|
ut.RING_BUFFER_SIZE = 1e3;
|
|
14459
|
-
let
|
|
14460
|
-
const
|
|
14461
|
-
class
|
|
14469
|
+
let gi = ut;
|
|
14470
|
+
const re = -1, Un = Object.freeze({});
|
|
14471
|
+
class bi {
|
|
14462
14472
|
/**
|
|
14463
14473
|
* Creates a new update manager
|
|
14464
14474
|
* @param eventManager - Event manager for emitting update events
|
|
@@ -14470,7 +14480,7 @@ class vi {
|
|
|
14470
14480
|
* @param config - Optional configuration
|
|
14471
14481
|
*/
|
|
14472
14482
|
constructor(e, t, i, s, r, a, o = {}) {
|
|
14473
|
-
this.eventManager = e, this.statsManager = t, this.layoutManager = i, this.dataManager = s, this.camera = r, this.graphContext = a, this.needsZoomToFit = !1, this.hasZoomedToFit = !1, this.forceZoomToFit = !1, this.layoutStepCount = 0, this.minLayoutStepsBeforeZoom = 10, this.lastZoomStep = 0, this.wasSettled = !1, this.viewMasks = null, this.appliedNodeSelection =
|
|
14483
|
+
this.eventManager = e, this.statsManager = t, this.layoutManager = i, this.dataManager = s, this.camera = r, this.graphContext = a, this.needsZoomToFit = !1, this.hasZoomedToFit = !1, this.forceZoomToFit = !1, this.layoutStepCount = 0, this.minLayoutStepsBeforeZoom = 10, this.lastZoomStep = 0, this.wasSettled = !1, this.viewMasks = null, this.appliedNodeSelection = re, this.appliedEdgeSelection = re, this.appliedNodeVisibility = re, this.appliedEdgeVisibility = re, this.appliedShowContext = !1, this.appliedAnything = !1, this.stateIsFinished = !1, this.drawnFrameIsFinished = !1, this.framingHasNothingToFrame = !1, this.frameCount = 0, this.config = {
|
|
14474
14484
|
layoutStepMultiplier: o.layoutStepMultiplier ?? 1,
|
|
14475
14485
|
autoZoomToFit: o.autoZoomToFit ?? !0,
|
|
14476
14486
|
minBoundingBoxSize: o.minBoundingBoxSize ?? 0.1
|
|
@@ -14510,7 +14520,7 @@ class vi {
|
|
|
14510
14520
|
* are not the elements those versions were measured against.
|
|
14511
14521
|
*/
|
|
14512
14522
|
invalidateViewMasks() {
|
|
14513
|
-
this.appliedNodeSelection =
|
|
14523
|
+
this.appliedNodeSelection = re, this.appliedEdgeSelection = re, this.appliedNodeVisibility = re, this.appliedEdgeVisibility = re, this.appliedAnything = !1;
|
|
14514
14524
|
}
|
|
14515
14525
|
/**
|
|
14516
14526
|
* Bring the meshes into line with the two masks.
|
|
@@ -14539,18 +14549,18 @@ class vi {
|
|
|
14539
14549
|
* not moved, so the cost lands only while records are actually arriving.
|
|
14540
14550
|
*/
|
|
14541
14551
|
syncViewMasks() {
|
|
14542
|
-
const e = this.viewMasks ??
|
|
14552
|
+
const e = this.viewMasks ?? Un, t = e.selection?.nodes() ?? null, i = e.selection?.edges() ?? null, s = e.visibility?.nodes() ?? null, r = e.visibility?.edges() ?? null, a = e.showContext?.() ?? !1, o = t?.version ?? re, n = i?.version ?? re, c = s?.version ?? re, h = r?.version ?? re, d = !this.appliedAnything || o !== this.appliedNodeSelection || c !== this.appliedNodeVisibility || a !== this.appliedShowContext, u = !this.appliedAnything || n !== this.appliedEdgeSelection || h !== this.appliedEdgeVisibility;
|
|
14543
14553
|
if (!(!d && !u)) {
|
|
14544
14554
|
if (d) {
|
|
14545
14555
|
const p = a ? "context" : "hidden";
|
|
14546
14556
|
for (const m of this.dataManager.nodes.values()) {
|
|
14547
|
-
const { index: y } = m, w = y !==
|
|
14557
|
+
const { index: y } = m, w = y !== K, S = s === null || !w || s.has(y);
|
|
14548
14558
|
m.setRenderState(S ? "visible" : p), m.setSelected(t !== null && w && t.has(y));
|
|
14549
14559
|
}
|
|
14550
14560
|
}
|
|
14551
14561
|
if (u)
|
|
14552
14562
|
for (const p of this.dataManager.edges.values()) {
|
|
14553
|
-
const { index: m } = p, y = m !==
|
|
14563
|
+
const { index: m } = p, y = m !== K;
|
|
14554
14564
|
p.setRenderVisible(r === null || !y || r.has(m)), p.setSelected(i !== null && y && i.has(m));
|
|
14555
14565
|
}
|
|
14556
14566
|
this.appliedNodeSelection = o, this.appliedEdgeSelection = n, this.appliedNodeVisibility = c, this.appliedEdgeVisibility = h, this.appliedShowContext = a, this.appliedAnything = !0;
|
|
@@ -14719,7 +14729,7 @@ class vi {
|
|
|
14719
14729
|
if (!i.isReady(!0, s))
|
|
14720
14730
|
return !1;
|
|
14721
14731
|
for (const r of t)
|
|
14722
|
-
if (r.hasMesh(i) && !
|
|
14732
|
+
if (r.hasMesh(i) && !bi.layerIsReadyFor(r, i, s))
|
|
14723
14733
|
return !1;
|
|
14724
14734
|
}
|
|
14725
14735
|
}
|
|
@@ -14958,7 +14968,7 @@ class O extends Error {
|
|
|
14958
14968
|
super(e), this.code = t, this.details = i, this.name = "ScreenshotError", Object.setPrototypeOf(this, O.prototype);
|
|
14959
14969
|
}
|
|
14960
14970
|
}
|
|
14961
|
-
async function
|
|
14971
|
+
async function Gn(l) {
|
|
14962
14972
|
if (!window.isSecureContext)
|
|
14963
14973
|
return {
|
|
14964
14974
|
status: "not-secure-context",
|
|
@@ -15020,7 +15030,7 @@ async function Bn(l) {
|
|
|
15020
15030
|
};
|
|
15021
15031
|
}
|
|
15022
15032
|
}
|
|
15023
|
-
const
|
|
15033
|
+
const Xt = {
|
|
15024
15034
|
/**
|
|
15025
15035
|
* Maximum time to wait for layout to settle before screenshot capture (ms).
|
|
15026
15036
|
* If the layout doesn't settle within this time, a timeout error is thrown.
|
|
@@ -15052,7 +15062,7 @@ const Zt = {
|
|
|
15052
15062
|
WARN_PIXELS: 8294400
|
|
15053
15063
|
// 4K
|
|
15054
15064
|
};
|
|
15055
|
-
function
|
|
15065
|
+
function $n(l, e) {
|
|
15056
15066
|
const t = l.width, i = l.height, s = t / i;
|
|
15057
15067
|
if (e.width !== void 0 || e.height !== void 0) {
|
|
15058
15068
|
let n, c;
|
|
@@ -15121,7 +15131,7 @@ function os(l, e) {
|
|
|
15121
15131
|
`Large screenshot ${l}x${e} (${(t / 1e6).toFixed(1)}MP) may fail on devices with limited memory`
|
|
15122
15132
|
);
|
|
15123
15133
|
}
|
|
15124
|
-
const
|
|
15134
|
+
const Vn = {
|
|
15125
15135
|
print: {
|
|
15126
15136
|
format: "png",
|
|
15127
15137
|
multiplier: 4,
|
|
@@ -15146,8 +15156,8 @@ const Gn = {
|
|
|
15146
15156
|
destination: { download: !0 }
|
|
15147
15157
|
}
|
|
15148
15158
|
};
|
|
15149
|
-
function
|
|
15150
|
-
const t =
|
|
15159
|
+
function Hn(l, e) {
|
|
15160
|
+
const t = Vn[l];
|
|
15151
15161
|
if (!t)
|
|
15152
15162
|
throw new O(`Unknown screenshot preset: ${l}`, R.PRESET_NOT_FOUND);
|
|
15153
15163
|
return {
|
|
@@ -15160,7 +15170,7 @@ function $n(l, e) {
|
|
|
15160
15170
|
} : void 0
|
|
15161
15171
|
};
|
|
15162
15172
|
}
|
|
15163
|
-
function
|
|
15173
|
+
function Wn(l, e) {
|
|
15164
15174
|
const t = {
|
|
15165
15175
|
clearColor: l.clearColor.clone(),
|
|
15166
15176
|
skyboxEnabled: e?.isEnabled() ?? !1,
|
|
@@ -15169,10 +15179,10 @@ function Vn(l, e) {
|
|
|
15169
15179
|
};
|
|
15170
15180
|
return l.clearColor = new Ee(0, 0, 0, 0), e && e.setEnabled(!1), l.environmentTexture = null, l.imageProcessingConfiguration.vignetteEnabled = !1, t;
|
|
15171
15181
|
}
|
|
15172
|
-
function
|
|
15182
|
+
function jn(l, e, t) {
|
|
15173
15183
|
l.clearColor = t.clearColor, e && e.setEnabled(t.skyboxEnabled), l.environmentTexture = t.environmentTexture, l.imageProcessingConfiguration.isEnabled = t.imageProcessingEnabled;
|
|
15174
15184
|
}
|
|
15175
|
-
class
|
|
15185
|
+
class qn {
|
|
15176
15186
|
/**
|
|
15177
15187
|
* Creates a new ScreenshotCapture instance
|
|
15178
15188
|
* @param engine - The Babylon.js rendering engine
|
|
@@ -15249,8 +15259,8 @@ class Wn {
|
|
|
15249
15259
|
}
|
|
15250
15260
|
try {
|
|
15251
15261
|
let o = e;
|
|
15252
|
-
e.preset && (o =
|
|
15253
|
-
const n =
|
|
15262
|
+
e.preset && (o = Hn(e.preset, e));
|
|
15263
|
+
const n = $n(this.canvas, o), c = o.format ?? "png", h = o.quality ?? (c === "jpeg" ? Xt.DEFAULT_JPEG_QUALITY : Xt.DEFAULT_PNG_QUALITY);
|
|
15254
15264
|
if (o.transparentBackground && c !== "png" && c !== "webp")
|
|
15255
15265
|
throw new O(
|
|
15256
15266
|
"Transparent background requires PNG or WebP format",
|
|
@@ -15259,7 +15269,7 @@ class Wn {
|
|
|
15259
15269
|
let d;
|
|
15260
15270
|
if (o.transparentBackground) {
|
|
15261
15271
|
const m = this.findSkyboxMesh();
|
|
15262
|
-
d =
|
|
15272
|
+
d = Wn(this.scene, m);
|
|
15263
15273
|
}
|
|
15264
15274
|
let u = null, p;
|
|
15265
15275
|
if (o.enhanceQuality) {
|
|
@@ -15280,7 +15290,7 @@ class Wn {
|
|
|
15280
15290
|
n.height
|
|
15281
15291
|
);
|
|
15282
15292
|
let k;
|
|
15283
|
-
m.clipboard && (k =
|
|
15293
|
+
m.clipboard && (k = Gn(C));
|
|
15284
15294
|
const U = await C;
|
|
15285
15295
|
let $ = !1;
|
|
15286
15296
|
if (m.download)
|
|
@@ -15311,7 +15321,7 @@ class Wn {
|
|
|
15311
15321
|
} finally {
|
|
15312
15322
|
if (d) {
|
|
15313
15323
|
const m = this.findSkyboxMesh();
|
|
15314
|
-
|
|
15324
|
+
jn(this.scene, m, d);
|
|
15315
15325
|
}
|
|
15316
15326
|
u && this.disableQualityEnhancement(u);
|
|
15317
15327
|
}
|
|
@@ -15350,7 +15360,7 @@ class Wn {
|
|
|
15350
15360
|
R.LAYOUT_SETTLE_TIMEOUT
|
|
15351
15361
|
)
|
|
15352
15362
|
));
|
|
15353
|
-
},
|
|
15363
|
+
}, Xt.LAYOUT_SETTLE_TIMEOUT_MS), n = () => {
|
|
15354
15364
|
!s && e.isSettled && (s = !0, a(), t());
|
|
15355
15365
|
};
|
|
15356
15366
|
r = this.graph.eventManager.addListener("graph-settled", n), !s && e.isSettled && (s = !0, a(), t());
|
|
@@ -15386,7 +15396,7 @@ class Wn {
|
|
|
15386
15396
|
let n;
|
|
15387
15397
|
if (e === "png" ? n = "image/png" : e === "jpeg" ? n = "image/jpeg" : n = "image/webp", !this.scene.activeCamera)
|
|
15388
15398
|
throw new O("No active camera in scene", R.SCREENSHOT_CAPTURE_FAILED);
|
|
15389
|
-
const c = await
|
|
15399
|
+
const c = await oa(this.engine, this.scene.activeCamera, {
|
|
15390
15400
|
width: i,
|
|
15391
15401
|
height: s,
|
|
15392
15402
|
precision: t
|
|
@@ -15532,7 +15542,7 @@ class Wn {
|
|
|
15532
15542
|
supersampledHeight: t.height * s
|
|
15533
15543
|
};
|
|
15534
15544
|
if (r > 1) {
|
|
15535
|
-
const n = new
|
|
15545
|
+
const n = new na(
|
|
15536
15546
|
"screenshotPipeline",
|
|
15537
15547
|
!1,
|
|
15538
15548
|
// hdr - not needed for screenshots
|
|
@@ -15541,7 +15551,7 @@ class Wn {
|
|
|
15541
15551
|
);
|
|
15542
15552
|
n.samples = r, n.fxaaEnabled = a, o.pipeline = n;
|
|
15543
15553
|
} else if (a) {
|
|
15544
|
-
const n = new
|
|
15554
|
+
const n = new ca("screenshotFxaa", 1, i);
|
|
15545
15555
|
o.fxaaPostProcess = n;
|
|
15546
15556
|
}
|
|
15547
15557
|
return o;
|
|
@@ -15577,7 +15587,7 @@ class lt {
|
|
|
15577
15587
|
* @returns New Styles instance
|
|
15578
15588
|
*/
|
|
15579
15589
|
static fromObject(e) {
|
|
15580
|
-
return new lt(
|
|
15590
|
+
return new lt(Ra.parse(e));
|
|
15581
15591
|
}
|
|
15582
15592
|
/**
|
|
15583
15593
|
* Fetches and creates a Styles instance from a URL.
|
|
@@ -15602,7 +15612,7 @@ class lt {
|
|
|
15602
15612
|
});
|
|
15603
15613
|
}
|
|
15604
15614
|
}
|
|
15605
|
-
class
|
|
15615
|
+
class Kn {
|
|
15606
15616
|
/**
|
|
15607
15617
|
* Creates a new XRUIManager instance and initializes UI buttons
|
|
15608
15618
|
* @param container - The HTML element to contain the XR UI
|
|
@@ -15725,7 +15735,7 @@ class jn {
|
|
|
15725
15735
|
}
|
|
15726
15736
|
}
|
|
15727
15737
|
const Q = ue.getLogger(["graphty", "xr", "session"]);
|
|
15728
|
-
class
|
|
15738
|
+
class Zn {
|
|
15729
15739
|
/**
|
|
15730
15740
|
* Creates a new XRSessionManager instance
|
|
15731
15741
|
* @param scene - The Babylon.js scene for XR rendering
|
|
@@ -15893,18 +15903,18 @@ class qn {
|
|
|
15893
15903
|
this.xrHelper && (this.xrHelper.dispose(), this.xrHelper = null), this.activeMode = null;
|
|
15894
15904
|
}
|
|
15895
15905
|
}
|
|
15896
|
-
const ns = ue.getLogger(["graphty", "graph"]), cs = "#F5F5F5",
|
|
15897
|
-
function
|
|
15906
|
+
const ns = ue.getLogger(["graphty", "graph"]), cs = "#F5F5F5", Xn = 3e4, hs = "graphty";
|
|
15907
|
+
function Qn(l, e) {
|
|
15898
15908
|
const t = l.edgesByIndex[e]?.data;
|
|
15899
15909
|
if (t === void 0)
|
|
15900
15910
|
return;
|
|
15901
15911
|
const i = l.lastImport?.endpoints;
|
|
15902
15912
|
if (i === void 0)
|
|
15903
15913
|
return t;
|
|
15904
|
-
const s = new Set([i.source, i.target].filter((r) =>
|
|
15914
|
+
const s = new Set([i.source, i.target].filter((r) => Jn.test(r)));
|
|
15905
15915
|
return s.size === 0 ? t : Object.fromEntries(Object.entries(t).filter(([r]) => !s.has(r)));
|
|
15906
15916
|
}
|
|
15907
|
-
const
|
|
15917
|
+
const Jn = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
15908
15918
|
class ls {
|
|
15909
15919
|
/**
|
|
15910
15920
|
* Creates a new Graph instance and initializes the rendering engine and managers.
|
|
@@ -15914,11 +15924,11 @@ class ls {
|
|
|
15914
15924
|
constructor(e, t = !1) {
|
|
15915
15925
|
if (this.initialCameraStateCaptured = !1, this.userCameraPresets = /* @__PURE__ */ new Map(), this.xrHelper = null, this.needRays = !0, this.initialized = !1, this.runAlgorithmsOnLoad = !1, this.wasSettled = !1, this.resizeHandler = () => {
|
|
15916
15926
|
this.engine.resize();
|
|
15917
|
-
}, this.#e = null, this.xrSessionManager = null, this.xrUIManager = null, this.activeCapture = null, this.savedZPositions = /* @__PURE__ */ new Map(), this.aiManager = null, this.voiceAdapter = null, this.eventManager = new
|
|
15927
|
+
}, this.#e = null, this.xrSessionManager = null, this.xrUIManager = null, this.activeCapture = null, this.savedZPositions = /* @__PURE__ */ new Map(), this.aiManager = null, this.voiceAdapter = null, this.eventManager = new gn(), this.operationQueue = new ui(this.eventManager, {
|
|
15918
15928
|
concurrency: 1,
|
|
15919
15929
|
// Sequential execution
|
|
15920
15930
|
autoStart: !0
|
|
15921
|
-
}), this.styles = lt.default(), this.stylePainter = new
|
|
15931
|
+
}), this.styles = lt.default(), this.stylePainter = new vo(), typeof e == "string") {
|
|
15922
15932
|
const o = document.getElementById(e);
|
|
15923
15933
|
if (!o)
|
|
15924
15934
|
throw new Error(`getElementById() could not find element '${e}'`);
|
|
@@ -15929,10 +15939,10 @@ class ls {
|
|
|
15929
15939
|
throw new TypeError(
|
|
15930
15940
|
"Graph constructor requires 'element' argument that is either a string specifying the ID of the HTML element or an Element"
|
|
15931
15941
|
);
|
|
15932
|
-
this.element.innerHTML = "", this.canvas = document.createElement("canvas"), this.canvas.setAttribute("id", `graphty-canvas-${Date.now()}`), this.canvas.setAttribute("touch-action", "none"), this.canvas.setAttribute("autofocus", "true"), this.canvas.setAttribute("tabindex", "0"), this.canvas.style.width = "100%", this.canvas.style.height = "100%", this.canvas.style.touchAction = "none", this.element.appendChild(this.canvas), this.renderManager = new
|
|
15933
|
-
policy:
|
|
15934
|
-
minNodes:
|
|
15935
|
-
}), this.session =
|
|
15942
|
+
this.element.innerHTML = "", this.canvas = document.createElement("canvas"), this.canvas.setAttribute("id", `graphty-canvas-${Date.now()}`), this.canvas.setAttribute("touch-action", "none"), this.canvas.setAttribute("autofocus", "true"), this.canvas.setAttribute("tabindex", "0"), this.canvas.style.width = "100%", this.canvas.style.height = "100%", this.canvas.style.touchAction = "none", this.element.appendChild(this.canvas), this.renderManager = new _n(this.canvas, this.eventManager), this.engine = this.renderManager.engine, this.scene = this.renderManager.scene, this.camera = this.renderManager.camera, this.statsManager = new gi(this.eventManager), this.statsManager.initializeBabylonInstrumentation(this.scene, this.engine), this.dataManager = new un(this.eventManager, this.styles), this.acceleration = new js({
|
|
15943
|
+
policy: Ur,
|
|
15944
|
+
minNodes: Br
|
|
15945
|
+
}), this.session = qs({
|
|
15936
15946
|
acceleration: this.acceleration,
|
|
15937
15947
|
store: this.dataManager,
|
|
15938
15948
|
records: {
|
|
@@ -15942,7 +15952,7 @@ class ls {
|
|
|
15942
15952
|
// and that is its contract for anyone reaching through `element.graph`. Without
|
|
15943
15953
|
// this a record pushed in spelled `src`/`dst` would show up in the data table as a
|
|
15944
15954
|
// `src` column beside the canonical `source` one, saying the same thing twice.
|
|
15945
|
-
edgeAttributes: (o) =>
|
|
15955
|
+
edgeAttributes: (o) => Qn(this.dataManager, o)
|
|
15946
15956
|
},
|
|
15947
15957
|
// Read, not captured: the configuration document is written in place by the
|
|
15948
15958
|
// element's own property setters, so a captured copy would be the one that was in
|
|
@@ -15955,7 +15965,7 @@ class ls {
|
|
|
15955
15965
|
// Late-bound on purpose: the algorithm manager is built after the session, and an
|
|
15956
15966
|
// algorithm needs this Graph to read the data manager through. The session only
|
|
15957
15967
|
// ever calls this once a run reaches the front of the queue.
|
|
15958
|
-
execute: (o) => this.algorithmManager.execute(o,
|
|
15968
|
+
execute: (o) => this.algorithmManager.execute(o, Fr(o.algorithm))
|
|
15959
15969
|
}
|
|
15960
15970
|
}), this.stylePainter.bind(this.session.paint), this.session.on("style:changed", (o) => {
|
|
15961
15971
|
this.eventManager.emitGraphEvent("style-changed", {
|
|
@@ -15964,7 +15974,7 @@ class ls {
|
|
|
15964
15974
|
painted: o.painted,
|
|
15965
15975
|
unresolvedPaths: [...o.unresolvedPaths]
|
|
15966
15976
|
});
|
|
15967
|
-
}), this.layoutManager = new
|
|
15977
|
+
}), this.layoutManager = new Cn(this.eventManager, this.dataManager, this.styles), this.eventManager.onGraphEvent.add((o) => {
|
|
15968
15978
|
if (o.type === "snapshot-replaced") {
|
|
15969
15979
|
this.#e = o.next, this.releaseSnapshot(o.previous);
|
|
15970
15980
|
return;
|
|
@@ -15992,7 +16002,7 @@ class ls {
|
|
|
15992
16002
|
o.length > 0 && this.layoutManager.layoutEngine && await this.layoutManager.updatePositions(o);
|
|
15993
16003
|
},
|
|
15994
16004
|
description: "Update layout positions after data add"
|
|
15995
|
-
})), this.updateManager = new
|
|
16005
|
+
})), this.updateManager = new bi(
|
|
15996
16006
|
this.eventManager,
|
|
15997
16007
|
this.statsManager,
|
|
15998
16008
|
this.layoutManager,
|
|
@@ -16004,7 +16014,7 @@ class ls {
|
|
|
16004
16014
|
layoutStepMultiplier: this.styles.config.behavior.layout.stepMultiplier,
|
|
16005
16015
|
autoZoomToFit: !0
|
|
16006
16016
|
}
|
|
16007
|
-
), this.algorithmManager = new
|
|
16017
|
+
), this.algorithmManager = new Lo(this.eventManager, this), this.selectionManager = new Bn(this.eventManager), this.selectionManager.setDataManager(this.dataManager), this.selectionManager.bindSelection(this.session.selection);
|
|
16008
16018
|
const i = {
|
|
16009
16019
|
selection: {
|
|
16010
16020
|
edges: () => this.session.selection.edgeMembers(),
|
|
@@ -16021,7 +16031,7 @@ class ls {
|
|
|
16021
16031
|
pointerLockEnabled: !1,
|
|
16022
16032
|
recordInput: !1
|
|
16023
16033
|
};
|
|
16024
|
-
this.inputManager = new
|
|
16034
|
+
this.inputManager = new mn(
|
|
16025
16035
|
{
|
|
16026
16036
|
scene: this.scene,
|
|
16027
16037
|
engine: this.engine,
|
|
@@ -16033,9 +16043,9 @@ class ls {
|
|
|
16033
16043
|
const r = {
|
|
16034
16044
|
pinOnDrag: this.pinOnDrag,
|
|
16035
16045
|
enableDetailedProfiling: this.enableDetailedProfiling,
|
|
16036
|
-
xr:
|
|
16046
|
+
xr: Ia
|
|
16037
16047
|
};
|
|
16038
|
-
this.graphContext = new
|
|
16048
|
+
this.graphContext = new pn(
|
|
16039
16049
|
() => this.styles,
|
|
16040
16050
|
this.dataManager,
|
|
16041
16051
|
this.layoutManager,
|
|
@@ -16057,7 +16067,7 @@ class ls {
|
|
|
16057
16067
|
["input", this.inputManager],
|
|
16058
16068
|
["selection", this.selectionManager]
|
|
16059
16069
|
]);
|
|
16060
|
-
this.lifecycleManager = new
|
|
16070
|
+
this.lifecycleManager = new xn(a, this.eventManager, [
|
|
16061
16071
|
"event",
|
|
16062
16072
|
"queue",
|
|
16063
16073
|
"stats",
|
|
@@ -16253,10 +16263,10 @@ class ls {
|
|
|
16253
16263
|
* (`{backgroundType: "skybox", data}`), where `data` is an image URL or a base64 PNG.
|
|
16254
16264
|
*/
|
|
16255
16265
|
setBackground(e) {
|
|
16256
|
-
const t =
|
|
16266
|
+
const t = ma.parse(e);
|
|
16257
16267
|
if (this.styles.config.graph.background = t, t.backgroundType === "skybox") {
|
|
16258
16268
|
const i = t.data;
|
|
16259
|
-
new
|
|
16269
|
+
new ha("testdome", i, { resolution: 32, size: 500 }, this.scene).texture.onLoadObservable.addOnce(() => {
|
|
16260
16270
|
this.eventManager.emitGraphEvent("skybox-loaded", {
|
|
16261
16271
|
graph: this,
|
|
16262
16272
|
url: i
|
|
@@ -16283,8 +16293,8 @@ class ls {
|
|
|
16283
16293
|
* positive, an opacity outside `[0, 1]`, a colour the element cannot read.
|
|
16284
16294
|
*/
|
|
16285
16295
|
setSelectionStyle(e) {
|
|
16286
|
-
const t = this.styles.config.graph.selection ??
|
|
16287
|
-
this.styles.config.graph.selection =
|
|
16296
|
+
const t = this.styles.config.graph.selection ?? Ms;
|
|
16297
|
+
this.styles.config.graph.selection = fa.parse({ ...t, ...e });
|
|
16288
16298
|
for (const i of this.dataManager.nodes.values())
|
|
16289
16299
|
i.refreshSelectionOverlay();
|
|
16290
16300
|
}
|
|
@@ -16301,7 +16311,7 @@ class ls {
|
|
|
16301
16311
|
* @param behavior - The fields to change. Anything omitted keeps its current value.
|
|
16302
16312
|
*/
|
|
16303
16313
|
setLayoutBehavior(e) {
|
|
16304
|
-
const t = this.styles.config.behavior, i =
|
|
16314
|
+
const t = this.styles.config.behavior, i = Ts.parse({
|
|
16305
16315
|
...t,
|
|
16306
16316
|
...e,
|
|
16307
16317
|
layout: { ...t.layout, ...e.layout ?? {} },
|
|
@@ -16364,7 +16374,7 @@ class ls {
|
|
|
16364
16374
|
if (!s) {
|
|
16365
16375
|
const a = await e.slice(0, 2048).text(), o = i(e.name, a);
|
|
16366
16376
|
if (!o)
|
|
16367
|
-
throw
|
|
16377
|
+
throw zi(e.name, 'loadFromFile(file, { format: "graphml" })');
|
|
16368
16378
|
s = o;
|
|
16369
16379
|
}
|
|
16370
16380
|
const r = await e.text();
|
|
@@ -16415,7 +16425,7 @@ class ls {
|
|
|
16415
16425
|
r = await d.text();
|
|
16416
16426
|
const u = r.slice(0, 2048), p = i(e, u);
|
|
16417
16427
|
if (!p)
|
|
16418
|
-
throw
|
|
16428
|
+
throw zi(e, 'loadFromUrl(url, { format: "graphml" })');
|
|
16419
16429
|
s = p;
|
|
16420
16430
|
}
|
|
16421
16431
|
}
|
|
@@ -16713,12 +16723,12 @@ class ls {
|
|
|
16713
16723
|
* descriptor has no run to give them to.
|
|
16714
16724
|
*/
|
|
16715
16725
|
async runLegacyAddress(e, t, i, s) {
|
|
16716
|
-
const r = e === hs ?
|
|
16726
|
+
const r = e === hs ? Ii(t) : void 0;
|
|
16717
16727
|
if (r !== void 0) {
|
|
16718
16728
|
await this.runLegacyAsRun(r, e, t, i, s);
|
|
16719
16729
|
return;
|
|
16720
16730
|
}
|
|
16721
|
-
const a =
|
|
16731
|
+
const a = Jt(`${e}:${t}`) ?? Jt(t);
|
|
16722
16732
|
if (a !== void 0) {
|
|
16723
16733
|
await this.runLegacyAsRun(
|
|
16724
16734
|
{ descriptor: a.descriptor, params: {} },
|
|
@@ -16902,7 +16912,7 @@ class ls {
|
|
|
16902
16912
|
* @returns The runs of that algorithm that succeeded, oldest first.
|
|
16903
16913
|
*/
|
|
16904
16914
|
#i(e) {
|
|
16905
|
-
const [t, i] = e.includes(":") ? e.split(":") : ["", e], r = (t === hs ?
|
|
16915
|
+
const [t, i] = e.includes(":") ? e.split(":") : ["", e], r = (t === hs ? Ii(i) : void 0)?.descriptor.key ?? (t === "" ? e : i);
|
|
16906
16916
|
return this.session.runs.list().filter((a) => a.algorithm === r && a.status === "succeeded");
|
|
16907
16917
|
}
|
|
16908
16918
|
/**
|
|
@@ -17442,7 +17452,7 @@ class ls {
|
|
|
17442
17452
|
* the session begins when a consumer calls `setViewMode` from a click.
|
|
17443
17453
|
*/
|
|
17444
17454
|
applyOpeningViewMode() {
|
|
17445
|
-
const e = this.styles.config.graph, i = e.viewMode ===
|
|
17455
|
+
const e = this.styles.config.graph, i = e.viewMode === ya && e.twoD ? "2d" : e.viewMode, s = i === "2d";
|
|
17446
17456
|
e.viewMode = i, e.twoD = s, this.scene.metadata = this.scene.metadata ?? {}, this.scene.metadata.twoD = s, this.scene.metadata.viewMode = i, this.camera.activateCamera(s ? "2d" : "orbit");
|
|
17447
17457
|
}
|
|
17448
17458
|
/**
|
|
@@ -17606,7 +17616,7 @@ class ls {
|
|
|
17606
17616
|
* @param config - Partial XR configuration to apply
|
|
17607
17617
|
*/
|
|
17608
17618
|
setXRConfig(e) {
|
|
17609
|
-
const t =
|
|
17619
|
+
const t = co.parse(e);
|
|
17610
17620
|
this.graphContext.updateConfig({ xr: t });
|
|
17611
17621
|
}
|
|
17612
17622
|
/**
|
|
@@ -17808,7 +17818,7 @@ class ls {
|
|
|
17808
17818
|
* ```
|
|
17809
17819
|
*/
|
|
17810
17820
|
async waitForStableFrame(e = {}) {
|
|
17811
|
-
const t = e.timeoutMs ??
|
|
17821
|
+
const t = e.timeoutMs ?? Xn;
|
|
17812
17822
|
let i, s;
|
|
17813
17823
|
try {
|
|
17814
17824
|
await Promise.race([
|
|
@@ -17873,7 +17883,7 @@ class ls {
|
|
|
17873
17883
|
* ```
|
|
17874
17884
|
*/
|
|
17875
17885
|
async captureScreenshot(e) {
|
|
17876
|
-
return new
|
|
17886
|
+
return new qn(this.engine, this.scene, this.canvas, this).captureScreenshot(e);
|
|
17877
17887
|
}
|
|
17878
17888
|
/**
|
|
17879
17889
|
* Check if screenshot can be captured with given options.
|
|
@@ -17898,7 +17908,7 @@ class ls {
|
|
|
17898
17908
|
* ```
|
|
17899
17909
|
*/
|
|
17900
17910
|
async canCaptureScreenshot(e) {
|
|
17901
|
-
const { canCaptureScreenshot: t } = await import("./capability-check-
|
|
17911
|
+
const { canCaptureScreenshot: t } = await import("./capability-check-BC3Qn6fS.js");
|
|
17902
17912
|
return t(this.canvas, e ?? {});
|
|
17903
17913
|
}
|
|
17904
17914
|
/**
|
|
@@ -17939,7 +17949,7 @@ class ls {
|
|
|
17939
17949
|
* ```
|
|
17940
17950
|
*/
|
|
17941
17951
|
async captureAnimation(e) {
|
|
17942
|
-
const { MediaRecorderCapture: t } = await Promise.resolve().then(() =>
|
|
17952
|
+
const { MediaRecorderCapture: t } = await Promise.resolve().then(() => ac), i = new t();
|
|
17943
17953
|
this.activeCapture = i;
|
|
17944
17954
|
const s = (r) => {
|
|
17945
17955
|
this.eventManager.emitGraphEvent("animation-progress", { progress: r });
|
|
@@ -18151,7 +18161,7 @@ class ls {
|
|
|
18151
18161
|
if (i && "pivot" in i && "cameraDistance" in i) {
|
|
18152
18162
|
const s = i;
|
|
18153
18163
|
if (e.target && s.pivot.position.set(e.target.x, e.target.y, e.target.z), e.pivotRotation) {
|
|
18154
|
-
const r =
|
|
18164
|
+
const r = ae.RotationYawPitchRoll(
|
|
18155
18165
|
e.pivotRotation.y,
|
|
18156
18166
|
// yaw
|
|
18157
18167
|
e.pivotRotation.x,
|
|
@@ -18165,7 +18175,7 @@ class ls {
|
|
|
18165
18175
|
e.position.x - e.target.x,
|
|
18166
18176
|
e.position.y - e.target.y,
|
|
18167
18177
|
e.position.z - e.target.z
|
|
18168
|
-
), a = r.length(), o = Math.atan2(r.x, r.z) + Math.PI, n = Math.asin(r.y / a), c =
|
|
18178
|
+
), a = r.length(), o = Math.atan2(r.x, r.z) + Math.PI, n = Math.asin(r.y / a), c = ae.RotationYawPitchRoll(o, n, 0);
|
|
18169
18179
|
s.pivot.rotationQuaternion = c;
|
|
18170
18180
|
}
|
|
18171
18181
|
if (e.cameraDistance !== void 0)
|
|
@@ -18567,7 +18577,7 @@ class ls {
|
|
|
18567
18577
|
*/
|
|
18568
18578
|
boundsToFrame(e) {
|
|
18569
18579
|
const t = e === void 0 ? this.getNodes() : [...e].map((i) => this.getNode(i)).filter((i) => i !== void 0);
|
|
18570
|
-
return
|
|
18580
|
+
return Ka(t.map((i) => i.getPosition()));
|
|
18571
18581
|
}
|
|
18572
18582
|
/**
|
|
18573
18583
|
* Everything a camera view is told: the box, the drawing mode, the viewport and where the
|
|
@@ -18614,7 +18624,7 @@ class ls {
|
|
|
18614
18624
|
return s;
|
|
18615
18625
|
}
|
|
18616
18626
|
const i = this.cameraViewContext(this.boundsToFrame(t?.nodes), t?.params);
|
|
18617
|
-
return
|
|
18627
|
+
return no(e, i);
|
|
18618
18628
|
}
|
|
18619
18629
|
/**
|
|
18620
18630
|
* Put the viewer where a named camera view says they should stand.
|
|
@@ -18649,11 +18659,11 @@ class ls {
|
|
|
18649
18659
|
*/
|
|
18650
18660
|
saveCameraPreset(e) {
|
|
18651
18661
|
if (Vt(e))
|
|
18652
|
-
throw new
|
|
18662
|
+
throw new oe({
|
|
18653
18663
|
code: "E_PROTECTED",
|
|
18654
18664
|
message: `"${e}" is a camera view, and a view recomputes itself for whatever is on screen. Saving a fixed position under the same name would silently replace a rule with a snapshot.`,
|
|
18655
18665
|
source: "view",
|
|
18656
|
-
details: { name: e, available:
|
|
18666
|
+
details: { name: e, available: ni() }
|
|
18657
18667
|
});
|
|
18658
18668
|
const t = this.getCameraState();
|
|
18659
18669
|
this.userCameraPresets.set(e, t);
|
|
@@ -18680,7 +18690,7 @@ class ls {
|
|
|
18680
18690
|
*/
|
|
18681
18691
|
getCameraPresets() {
|
|
18682
18692
|
const e = {};
|
|
18683
|
-
for (const t of
|
|
18693
|
+
for (const t of ni())
|
|
18684
18694
|
e[t] = { builtin: !0 };
|
|
18685
18695
|
for (const [t, i] of this.userCameraPresets.entries())
|
|
18686
18696
|
e[t] = i;
|
|
@@ -18954,7 +18964,7 @@ class ls {
|
|
|
18954
18964
|
* ```
|
|
18955
18965
|
*/
|
|
18956
18966
|
getVoiceAdapter() {
|
|
18957
|
-
return this.voiceAdapter ??= new
|
|
18967
|
+
return this.voiceAdapter ??= new Vs(), this.voiceAdapter;
|
|
18958
18968
|
}
|
|
18959
18969
|
/**
|
|
18960
18970
|
* Start voice input and execute commands.
|
|
@@ -19015,13 +19025,13 @@ class ls {
|
|
|
19015
19025
|
const e = this.graphContext.getConfig().xr;
|
|
19016
19026
|
if (!e?.enabled)
|
|
19017
19027
|
return;
|
|
19018
|
-
this.xrSessionManager = new
|
|
19028
|
+
this.xrSessionManager = new Zn(this.scene, {
|
|
19019
19029
|
vr: e.vr,
|
|
19020
19030
|
ar: e.ar,
|
|
19021
19031
|
handTracking: e.input.handTracking
|
|
19022
19032
|
});
|
|
19023
19033
|
const t = e.vr.enabled && await this.xrSessionManager.isVRSupported(), i = e.ar.enabled && await this.xrSessionManager.isARSupported();
|
|
19024
|
-
this.xrUIManager = new
|
|
19034
|
+
this.xrUIManager = new Kn(this.element, t, i, e.ui), this.xrUIManager.onEnterXR = (s) => {
|
|
19025
19035
|
(async () => {
|
|
19026
19036
|
try {
|
|
19027
19037
|
await this.enterXR(s);
|
|
@@ -19054,7 +19064,7 @@ Check console for details.`), this.eventManager.emitGraphError(
|
|
|
19054
19064
|
if (!i)
|
|
19055
19065
|
throw new Error("XR helper not available after session creation");
|
|
19056
19066
|
this.scene.metadata = this.scene.metadata ?? {}, this.scene.metadata.xrHelper = i;
|
|
19057
|
-
const { XRPivotCameraController: s } = await import("./XRPivotCameraController-
|
|
19067
|
+
const { XRPivotCameraController: s } = await import("./XRPivotCameraController-DENGN2uV.js"), r = new s(this.scene, i), a = this.scene.onBeforeRenderObservable.add(() => {
|
|
19058
19068
|
r.update();
|
|
19059
19069
|
});
|
|
19060
19070
|
this.scene.metadata.xrCameraController = r, this.scene.metadata.xrUpdateObserver = a;
|
|
@@ -19072,12 +19082,12 @@ Check console for details.`), this.eventManager.emitGraphError(
|
|
|
19072
19082
|
this.voiceAdapter?.dispose(), this.voiceAdapter = null, this.disableAiControl(), this.xrUIManager?.dispose(), this.xrSessionManager?.dispose(), this.shutdown();
|
|
19073
19083
|
}
|
|
19074
19084
|
}
|
|
19075
|
-
var
|
|
19076
|
-
for (var s =
|
|
19085
|
+
var Yn = Object.defineProperty, ec = Object.getOwnPropertyDescriptor, L = (l, e, t, i) => {
|
|
19086
|
+
for (var s = ec(e, t), r = l.length - 1, a; r >= 0; r--)
|
|
19077
19087
|
(a = l[r]) && (s = a(e, t, s) || s);
|
|
19078
|
-
return s &&
|
|
19088
|
+
return s && Yn(e, t, s), s;
|
|
19079
19089
|
};
|
|
19080
|
-
const
|
|
19090
|
+
const tc = 100, ic = [
|
|
19081
19091
|
"nodeData",
|
|
19082
19092
|
"edgeData",
|
|
19083
19093
|
"dataSourceConfig",
|
|
@@ -19088,8 +19098,8 @@ const Yn = 100, ec = [
|
|
|
19088
19098
|
"background",
|
|
19089
19099
|
"xr"
|
|
19090
19100
|
];
|
|
19091
|
-
var f, ye, we, yt,
|
|
19092
|
-
const
|
|
19101
|
+
var f, ye, we, yt, _e, Be, Ue, Ge, wt, j, ks, zs, _s, Bs, $e, Ve, le, de, He, We, je, qe, Ke, Ze, Xe, Qe, Je, ve, Te, be, Ye, et, tt, it, st, rt, at, pi, ot, mi, nt, Us;
|
|
19102
|
+
const Ai = class Ai extends Gs {
|
|
19093
19103
|
/**
|
|
19094
19104
|
* Creates a new Graphty element instance.
|
|
19095
19105
|
*/
|
|
@@ -19100,17 +19110,16 @@ const Pi = class Pi extends Bs {
|
|
|
19100
19110
|
T(this, ye);
|
|
19101
19111
|
T(this, we, null);
|
|
19102
19112
|
T(this, yt, !1);
|
|
19103
|
-
T(this, ze, null);
|
|
19104
19113
|
T(this, _e, null);
|
|
19105
19114
|
T(this, Be, null);
|
|
19106
|
-
T(this, Ue,
|
|
19115
|
+
T(this, Ue, null);
|
|
19116
|
+
T(this, Ge, /* @__PURE__ */ new Map());
|
|
19107
19117
|
T(this, wt, !1);
|
|
19108
19118
|
// Private backing fields for reactive properties
|
|
19109
|
-
T(this, Ge);
|
|
19110
19119
|
T(this, $e);
|
|
19111
|
-
T(this, he);
|
|
19112
|
-
T(this, le);
|
|
19113
19120
|
T(this, Ve);
|
|
19121
|
+
T(this, le);
|
|
19122
|
+
T(this, de);
|
|
19114
19123
|
T(this, He);
|
|
19115
19124
|
T(this, We);
|
|
19116
19125
|
T(this, je);
|
|
@@ -19119,21 +19128,22 @@ const Pi = class Pi extends Bs {
|
|
|
19119
19128
|
T(this, Ze);
|
|
19120
19129
|
T(this, Xe);
|
|
19121
19130
|
T(this, Qe);
|
|
19131
|
+
T(this, Je);
|
|
19122
19132
|
T(this, ve);
|
|
19123
19133
|
T(this, Te);
|
|
19124
19134
|
T(this, be);
|
|
19125
|
-
T(this, Je);
|
|
19126
19135
|
T(this, Ye);
|
|
19127
19136
|
T(this, et);
|
|
19128
19137
|
T(this, tt);
|
|
19129
19138
|
T(this, it);
|
|
19130
19139
|
T(this, st);
|
|
19131
19140
|
T(this, rt);
|
|
19141
|
+
T(this, at);
|
|
19132
19142
|
/**
|
|
19133
19143
|
* Helper method to initialize data source only when both properties are set
|
|
19134
19144
|
*/
|
|
19135
|
-
T(this,
|
|
19136
|
-
T(this,
|
|
19145
|
+
T(this, ot, !1);
|
|
19146
|
+
T(this, nt);
|
|
19137
19147
|
M(this, ye, document.createElement("div")), g(this, ye).setAttribute("style", "position: absolute; inset: 0; display: block;"), M(this, f, new ls(g(this, ye)));
|
|
19138
19148
|
}
|
|
19139
19149
|
/**
|
|
@@ -19217,18 +19227,18 @@ const Pi = class Pi extends Bs {
|
|
|
19217
19227
|
* Called when the element is added to the DOM. Sets up the graph container and resize observer.
|
|
19218
19228
|
*/
|
|
19219
19229
|
connectedCallback() {
|
|
19220
|
-
super.connectedCallback(), this.renderRoot.appendChild(g(this, ye)),
|
|
19230
|
+
super.connectedCallback(), this.renderRoot.appendChild(g(this, ye)), ne(this, j, Bs).call(this), M(this, we, new ResizeObserver(() => {
|
|
19221
19231
|
g(this, f).engine.resize(), g(this, f).camera.onResize();
|
|
19222
19232
|
})), g(this, we).observe(this);
|
|
19223
|
-
const t =
|
|
19233
|
+
const t = ne(this, j, Us).call(this);
|
|
19224
19234
|
t.disposed || t.start();
|
|
19225
19235
|
const i = g(this, f).getSession();
|
|
19226
|
-
g(this,
|
|
19227
|
-
|
|
19228
|
-
})), g(this,
|
|
19229
|
-
|
|
19230
|
-
})), g(this,
|
|
19231
|
-
|
|
19236
|
+
g(this, _e) ?? M(this, _e, i.on("run:changed", (s) => {
|
|
19237
|
+
ne(this, j, ks).call(this, s);
|
|
19238
|
+
})), g(this, Be) ?? M(this, Be, i.on("selection:changed", (s) => {
|
|
19239
|
+
ne(this, j, zs).call(this, s);
|
|
19240
|
+
})), g(this, Ue) ?? M(this, Ue, i.on("visibility:changed", (s) => {
|
|
19241
|
+
ne(this, j, _s).call(this, s);
|
|
19232
19242
|
}));
|
|
19233
19243
|
}
|
|
19234
19244
|
/**
|
|
@@ -19245,7 +19255,7 @@ const Pi = class Pi extends Bs {
|
|
|
19245
19255
|
*/
|
|
19246
19256
|
async asyncFirstUpdated() {
|
|
19247
19257
|
g(this, f).eventManager.onGraphEvent.add((t) => {
|
|
19248
|
-
|
|
19258
|
+
La(t) && this.dispatchEvent(
|
|
19249
19259
|
new CustomEvent(t.type, {
|
|
19250
19260
|
detail: t,
|
|
19251
19261
|
bubbles: !0,
|
|
@@ -19253,7 +19263,7 @@ const Pi = class Pi extends Bs {
|
|
|
19253
19263
|
})
|
|
19254
19264
|
);
|
|
19255
19265
|
}), g(this, f).eventManager.onNodeEvent.add((t) => {
|
|
19256
|
-
const i =
|
|
19266
|
+
const i = Fa[t.type], s = Na(t);
|
|
19257
19267
|
i === void 0 || s === null || this.dispatchEvent(
|
|
19258
19268
|
new CustomEvent(i, {
|
|
19259
19269
|
detail: s,
|
|
@@ -19279,51 +19289,51 @@ const Pi = class Pi extends Bs {
|
|
|
19279
19289
|
*/
|
|
19280
19290
|
disconnectedCallback() {
|
|
19281
19291
|
var t, i, s;
|
|
19282
|
-
g(this, we) && (g(this, we).disconnect(), M(this, we, null)), (t = g(this,
|
|
19292
|
+
g(this, we) && (g(this, we).disconnect(), M(this, we, null)), (t = g(this, _e)) == null || t.call(this), M(this, _e, null), (i = g(this, Be)) == null || i.call(this), M(this, Be, null), (s = g(this, Ue)) == null || s.call(this), M(this, Ue, null), g(this, f).shutdown(), super.disconnectedCallback();
|
|
19283
19293
|
}
|
|
19284
19294
|
get nodeData() {
|
|
19285
|
-
return g(this,
|
|
19295
|
+
return g(this, $e);
|
|
19286
19296
|
}
|
|
19287
19297
|
/**
|
|
19288
19298
|
* Sets the node data array. Triggers addition of nodes to the graph.
|
|
19289
19299
|
*/
|
|
19290
19300
|
set nodeData(t) {
|
|
19291
|
-
const i = g(this,
|
|
19292
|
-
M(this,
|
|
19293
|
-
|
|
19301
|
+
const i = g(this, $e);
|
|
19302
|
+
M(this, $e, t), t && Array.isArray(t) && g(this, f).addNodes(t).catch((s) => {
|
|
19303
|
+
ne(this, j, pi).call(this, s);
|
|
19294
19304
|
}), this.requestUpdate("nodeData", i);
|
|
19295
19305
|
}
|
|
19296
19306
|
get edgeData() {
|
|
19297
|
-
return g(this,
|
|
19307
|
+
return g(this, Ve);
|
|
19298
19308
|
}
|
|
19299
19309
|
/**
|
|
19300
19310
|
* Sets the edge data array. Triggers addition of edges to the graph.
|
|
19301
19311
|
*/
|
|
19302
19312
|
set edgeData(t) {
|
|
19303
|
-
const i = g(this,
|
|
19304
|
-
M(this,
|
|
19305
|
-
|
|
19313
|
+
const i = g(this, Ve);
|
|
19314
|
+
M(this, Ve, t), t && Array.isArray(t) && g(this, f).setEdges(t).catch((s) => {
|
|
19315
|
+
ne(this, j, pi).call(this, s);
|
|
19306
19316
|
}), this.requestUpdate("edgeData", i);
|
|
19307
19317
|
}
|
|
19308
19318
|
get dataSource() {
|
|
19309
|
-
return g(this,
|
|
19319
|
+
return g(this, le);
|
|
19310
19320
|
}
|
|
19311
19321
|
/**
|
|
19312
19322
|
* Sets the data source type. Initializes data loading when combined with dataSourceConfig.
|
|
19313
19323
|
*/
|
|
19314
19324
|
set dataSource(t) {
|
|
19315
|
-
const i = g(this,
|
|
19316
|
-
M(this,
|
|
19325
|
+
const i = g(this, le);
|
|
19326
|
+
M(this, le, t), ne(this, j, mi).call(this), this.requestUpdate("dataSource", i);
|
|
19317
19327
|
}
|
|
19318
19328
|
get dataSourceConfig() {
|
|
19319
|
-
return g(this,
|
|
19329
|
+
return g(this, de);
|
|
19320
19330
|
}
|
|
19321
19331
|
/**
|
|
19322
19332
|
* Sets the data source configuration. Initializes data loading when combined with dataSource.
|
|
19323
19333
|
*/
|
|
19324
19334
|
set dataSourceConfig(t) {
|
|
19325
|
-
const i = g(this,
|
|
19326
|
-
M(this,
|
|
19335
|
+
const i = g(this, de);
|
|
19336
|
+
M(this, de, t), ne(this, j, mi).call(this), this.requestUpdate("dataSourceConfig", i);
|
|
19327
19337
|
}
|
|
19328
19338
|
/**
|
|
19329
19339
|
* Removes every node and edge, and lets a later data source load.
|
|
@@ -19341,116 +19351,116 @@ const Pi = class Pi extends Bs {
|
|
|
19341
19351
|
* source against the OLD config.
|
|
19342
19352
|
*/
|
|
19343
19353
|
clearData() {
|
|
19344
|
-
const t = g(this,
|
|
19345
|
-
g(this, f).getDataManager().clear(), M(this,
|
|
19354
|
+
const t = g(this, le), i = g(this, de);
|
|
19355
|
+
g(this, f).getDataManager().clear(), M(this, ot, !1), M(this, le, void 0), M(this, de, void 0), this.requestUpdate("dataSource", t), this.requestUpdate("dataSourceConfig", i);
|
|
19346
19356
|
}
|
|
19347
19357
|
get nodeIdPath() {
|
|
19348
|
-
return g(this,
|
|
19358
|
+
return g(this, He);
|
|
19349
19359
|
}
|
|
19350
19360
|
/**
|
|
19351
19361
|
* Sets the JMESPath for node ID extraction. Updates graph configuration.
|
|
19352
19362
|
*/
|
|
19353
19363
|
set nodeIdPath(t) {
|
|
19354
|
-
const i = g(this,
|
|
19355
|
-
M(this,
|
|
19364
|
+
const i = g(this, He);
|
|
19365
|
+
M(this, He, t), t && q.set(g(this, f).styles.config, "data.knownFields.nodeIdPath", t), this.requestUpdate("nodeIdPath", i);
|
|
19356
19366
|
}
|
|
19357
19367
|
get edgeSrcIdPath() {
|
|
19358
|
-
return g(this,
|
|
19368
|
+
return g(this, We);
|
|
19359
19369
|
}
|
|
19360
19370
|
/**
|
|
19361
19371
|
* Sets the JMESPath for edge source ID extraction. Updates graph configuration.
|
|
19362
19372
|
*/
|
|
19363
19373
|
set edgeSrcIdPath(t) {
|
|
19364
|
-
const i = g(this,
|
|
19365
|
-
M(this,
|
|
19374
|
+
const i = g(this, We);
|
|
19375
|
+
M(this, We, t), t && q.set(g(this, f).styles.config, "data.knownFields.edgeSrcIdPath", t), this.requestUpdate("edgeSrcIdPath", i);
|
|
19366
19376
|
}
|
|
19367
19377
|
get edgeDstIdPath() {
|
|
19368
|
-
return g(this,
|
|
19378
|
+
return g(this, je);
|
|
19369
19379
|
}
|
|
19370
19380
|
/**
|
|
19371
19381
|
* Sets the JMESPath for edge destination ID extraction. Updates graph configuration.
|
|
19372
19382
|
*/
|
|
19373
19383
|
set edgeDstIdPath(t) {
|
|
19374
|
-
const i = g(this,
|
|
19375
|
-
M(this,
|
|
19384
|
+
const i = g(this, je);
|
|
19385
|
+
M(this, je, t), t && q.set(g(this, f).styles.config, "data.knownFields.edgeDstIdPath", t), this.requestUpdate("edgeDstIdPath", i);
|
|
19376
19386
|
}
|
|
19377
19387
|
get edgeIdPath() {
|
|
19378
|
-
return g(this,
|
|
19388
|
+
return g(this, qe);
|
|
19379
19389
|
}
|
|
19380
19390
|
/**
|
|
19381
19391
|
* Sets the JMESPath for edge identity. Updates graph configuration.
|
|
19382
19392
|
*/
|
|
19383
19393
|
set edgeIdPath(t) {
|
|
19384
|
-
const i = g(this,
|
|
19385
|
-
M(this,
|
|
19394
|
+
const i = g(this, qe);
|
|
19395
|
+
M(this, qe, t), t && q.set(g(this, f).styles.config, "data.knownFields.edgeIdPath", t), this.requestUpdate("edgeIdPath", i);
|
|
19386
19396
|
}
|
|
19387
19397
|
get repeatedEdges() {
|
|
19388
|
-
return g(this,
|
|
19398
|
+
return g(this, Ke);
|
|
19389
19399
|
}
|
|
19390
19400
|
/**
|
|
19391
19401
|
* Sets the repeat policy. Updates graph configuration.
|
|
19392
19402
|
*/
|
|
19393
19403
|
set repeatedEdges(t) {
|
|
19394
|
-
const i = g(this,
|
|
19395
|
-
if (t !== void 0 && !
|
|
19404
|
+
const i = g(this, Ke);
|
|
19405
|
+
if (t !== void 0 && !Ri.includes(t)) {
|
|
19396
19406
|
console.error(
|
|
19397
|
-
`<graphty-element>: repeated-edges must be one of ${
|
|
19407
|
+
`<graphty-element>: repeated-edges must be one of ${Ri.join(", ")}, not "${t}". Keeping "${i ?? "keep"}". See https://graphty.app/docs/graphty-element/attributes#repeated-edges`
|
|
19398
19408
|
);
|
|
19399
19409
|
return;
|
|
19400
19410
|
}
|
|
19401
|
-
M(this,
|
|
19411
|
+
M(this, Ke, t), t && q.set(g(this, f).styles.config, "data.knownFields.repeatedEdges", t), this.requestUpdate("repeatedEdges", i);
|
|
19402
19412
|
}
|
|
19403
19413
|
get nodeLabelPath() {
|
|
19404
|
-
return g(this,
|
|
19414
|
+
return g(this, Ze);
|
|
19405
19415
|
}
|
|
19406
19416
|
/**
|
|
19407
19417
|
* Sets the JMESPath for a node's display name. Updates graph configuration.
|
|
19408
19418
|
*/
|
|
19409
19419
|
set nodeLabelPath(t) {
|
|
19410
|
-
const i = g(this,
|
|
19411
|
-
M(this,
|
|
19420
|
+
const i = g(this, Ze);
|
|
19421
|
+
M(this, Ze, t), t && q.set(g(this, f).styles.config, "data.knownFields.nodeLabelPath", t), this.requestUpdate("nodeLabelPath", i);
|
|
19412
19422
|
}
|
|
19413
19423
|
get edgeWeightPath() {
|
|
19414
|
-
return g(this,
|
|
19424
|
+
return g(this, Xe);
|
|
19415
19425
|
}
|
|
19416
19426
|
/**
|
|
19417
19427
|
* Sets the JMESPath for an edge's weight. Updates graph configuration.
|
|
19418
19428
|
*/
|
|
19419
19429
|
set edgeWeightPath(t) {
|
|
19420
|
-
const i = g(this,
|
|
19421
|
-
M(this,
|
|
19430
|
+
const i = g(this, Xe);
|
|
19431
|
+
M(this, Xe, t), t && q.set(g(this, f).styles.config, "data.knownFields.edgeWeightPath", t), this.requestUpdate("edgeWeightPath", i);
|
|
19422
19432
|
}
|
|
19423
19433
|
get positionScale() {
|
|
19424
|
-
return g(this,
|
|
19434
|
+
return g(this, Qe);
|
|
19425
19435
|
}
|
|
19426
19436
|
/**
|
|
19427
19437
|
* Sets the record-units-to-scene-units multiplier. Updates graph configuration.
|
|
19428
19438
|
*/
|
|
19429
19439
|
set positionScale(t) {
|
|
19430
|
-
const i = g(this,
|
|
19440
|
+
const i = g(this, Qe);
|
|
19431
19441
|
if (t !== void 0 && !(Number.isFinite(t) && t > 0)) {
|
|
19432
19442
|
console.error(
|
|
19433
19443
|
`<graphty-element>: position-scale must be a number greater than zero, not "${String(t)}". Keeping ${String(i ?? 1)}. See https://graphty.app/docs/graphty-element/attributes#position-scale`
|
|
19434
19444
|
);
|
|
19435
19445
|
return;
|
|
19436
19446
|
}
|
|
19437
|
-
M(this,
|
|
19447
|
+
M(this, Qe, t), t !== void 0 && q.set(g(this, f).styles.config, "data.knownFields.positionScale", t), this.requestUpdate("positionScale", i);
|
|
19438
19448
|
}
|
|
19439
19449
|
get directed() {
|
|
19440
|
-
return g(this,
|
|
19450
|
+
return g(this, Je);
|
|
19441
19451
|
}
|
|
19442
19452
|
/**
|
|
19443
19453
|
* Sets whether the graph is read as directed. Updates graph configuration.
|
|
19444
19454
|
*/
|
|
19445
19455
|
set directed(t) {
|
|
19446
|
-
const i = g(this,
|
|
19456
|
+
const i = g(this, Je);
|
|
19447
19457
|
if (t !== void 0 && t !== "auto" && typeof t != "boolean") {
|
|
19448
19458
|
console.error(
|
|
19449
19459
|
`<graphty-element>: directed must be true, false or "auto", not "${String(t)}". Keeping "${String(i ?? "auto")}". See https://graphty.app/docs/graphty-element/attributes#directed`
|
|
19450
19460
|
);
|
|
19451
19461
|
return;
|
|
19452
19462
|
}
|
|
19453
|
-
M(this,
|
|
19463
|
+
M(this, Je, t), t !== void 0 && q.set(g(this, f).styles.config, "data.directed", t), this.requestUpdate("directed", i);
|
|
19454
19464
|
}
|
|
19455
19465
|
get layout() {
|
|
19456
19466
|
return g(this, ve);
|
|
@@ -19481,7 +19491,7 @@ const Pi = class Pi extends Bs {
|
|
|
19481
19491
|
this.requestUpdate("layoutConfig", i);
|
|
19482
19492
|
}
|
|
19483
19493
|
get layoutBehavior() {
|
|
19484
|
-
return g(this,
|
|
19494
|
+
return g(this, tt);
|
|
19485
19495
|
}
|
|
19486
19496
|
/**
|
|
19487
19497
|
* Sets how the element drives the layout.
|
|
@@ -19490,7 +19500,7 @@ const Pi = class Pi extends Bs {
|
|
|
19490
19500
|
* as `background` and `acceleration`.
|
|
19491
19501
|
*/
|
|
19492
19502
|
set layoutBehavior(t) {
|
|
19493
|
-
const i = g(this,
|
|
19503
|
+
const i = g(this, tt);
|
|
19494
19504
|
if (t !== void 0)
|
|
19495
19505
|
try {
|
|
19496
19506
|
g(this, f).setLayoutBehavior(t);
|
|
@@ -19501,16 +19511,16 @@ const Pi = class Pi extends Bs {
|
|
|
19501
19511
|
);
|
|
19502
19512
|
return;
|
|
19503
19513
|
}
|
|
19504
|
-
M(this,
|
|
19514
|
+
M(this, tt, t), this.requestUpdate("layoutBehavior", i);
|
|
19505
19515
|
}
|
|
19506
19516
|
get selectionStyle() {
|
|
19507
|
-
return g(this,
|
|
19517
|
+
return g(this, it);
|
|
19508
19518
|
}
|
|
19509
19519
|
/**
|
|
19510
19520
|
* Sets what a selected node looks like.
|
|
19511
19521
|
*/
|
|
19512
19522
|
set selectionStyle(t) {
|
|
19513
|
-
const i = g(this,
|
|
19523
|
+
const i = g(this, it);
|
|
19514
19524
|
if (t !== void 0)
|
|
19515
19525
|
try {
|
|
19516
19526
|
g(this, f).setSelectionStyle(t);
|
|
@@ -19521,18 +19531,18 @@ const Pi = class Pi extends Bs {
|
|
|
19521
19531
|
);
|
|
19522
19532
|
return;
|
|
19523
19533
|
}
|
|
19524
|
-
M(this,
|
|
19534
|
+
M(this, it, t), this.requestUpdate("selectionStyle", i);
|
|
19525
19535
|
}
|
|
19526
19536
|
get algorithmsOnLoad() {
|
|
19527
|
-
return g(this,
|
|
19537
|
+
return g(this, st);
|
|
19528
19538
|
}
|
|
19529
19539
|
/**
|
|
19530
19540
|
* Sets which algorithms run once data has finished loading.
|
|
19531
19541
|
* @throws A `GraphtyError` coded `E_BAD_COMMAND` naming the first malformed entry.
|
|
19532
19542
|
*/
|
|
19533
19543
|
set algorithmsOnLoad(t) {
|
|
19534
|
-
const i = t === void 0 ? void 0 :
|
|
19535
|
-
M(this,
|
|
19544
|
+
const i = t === void 0 ? void 0 : Ks(t), s = g(this, st);
|
|
19545
|
+
M(this, st, t), g(this, f).styles.config.data.algorithms = i, this.requestUpdate("algorithmsOnLoad", s);
|
|
19536
19546
|
}
|
|
19537
19547
|
get viewMode() {
|
|
19538
19548
|
return g(this, be);
|
|
@@ -19559,7 +19569,7 @@ const Pi = class Pi extends Bs {
|
|
|
19559
19569
|
), t !== void 0 && (this.viewMode = t ? "2d" : "3d");
|
|
19560
19570
|
}
|
|
19561
19571
|
get background() {
|
|
19562
|
-
return g(this,
|
|
19572
|
+
return g(this, Ye);
|
|
19563
19573
|
}
|
|
19564
19574
|
/**
|
|
19565
19575
|
* Sets the graph background. Applies it to the scene immediately.
|
|
@@ -19570,7 +19580,7 @@ const Pi = class Pi extends Bs {
|
|
|
19570
19580
|
* element that never rendered. A wrong colour in markup must not take the graph down.
|
|
19571
19581
|
*/
|
|
19572
19582
|
set background(t) {
|
|
19573
|
-
const i = g(this,
|
|
19583
|
+
const i = g(this, Ye);
|
|
19574
19584
|
if (t !== void 0)
|
|
19575
19585
|
try {
|
|
19576
19586
|
g(this, f).setBackground(t);
|
|
@@ -19581,47 +19591,47 @@ const Pi = class Pi extends Bs {
|
|
|
19581
19591
|
);
|
|
19582
19592
|
return;
|
|
19583
19593
|
}
|
|
19584
|
-
M(this,
|
|
19594
|
+
M(this, Ye, t), this.requestUpdate("background", i);
|
|
19585
19595
|
}
|
|
19586
19596
|
get startingCameraDistance() {
|
|
19587
|
-
return g(this,
|
|
19597
|
+
return g(this, et);
|
|
19588
19598
|
}
|
|
19589
19599
|
/**
|
|
19590
19600
|
* Sets the starting camera distance.
|
|
19591
19601
|
*/
|
|
19592
19602
|
set startingCameraDistance(t) {
|
|
19593
|
-
const i = g(this,
|
|
19594
|
-
M(this,
|
|
19603
|
+
const i = g(this, et);
|
|
19604
|
+
M(this, et, t), t !== void 0 && q.set(g(this, f).styles.config, "graph.startingCameraDistance", t), this.requestUpdate("startingCameraDistance", i);
|
|
19595
19605
|
}
|
|
19596
19606
|
get runAlgorithmsOnLoad() {
|
|
19597
|
-
return g(this,
|
|
19607
|
+
return g(this, rt);
|
|
19598
19608
|
}
|
|
19599
19609
|
/**
|
|
19600
19610
|
* Sets whether to run algorithms when a style template loads. Updates graph configuration.
|
|
19601
19611
|
*/
|
|
19602
19612
|
set runAlgorithmsOnLoad(t) {
|
|
19603
|
-
const i = g(this,
|
|
19604
|
-
M(this,
|
|
19613
|
+
const i = g(this, rt);
|
|
19614
|
+
M(this, rt, t), t !== void 0 && (g(this, f).runAlgorithmsOnLoad = t), this.requestUpdate("runAlgorithmsOnLoad", i);
|
|
19605
19615
|
}
|
|
19606
19616
|
get enableDetailedProfiling() {
|
|
19607
|
-
return g(this,
|
|
19617
|
+
return g(this, nt);
|
|
19608
19618
|
}
|
|
19609
19619
|
/**
|
|
19610
19620
|
* Sets detailed profiling mode. Enables hierarchical timing and advanced stats collection.
|
|
19611
19621
|
*/
|
|
19612
19622
|
set enableDetailedProfiling(t) {
|
|
19613
|
-
const i = g(this,
|
|
19614
|
-
M(this,
|
|
19623
|
+
const i = g(this, nt);
|
|
19624
|
+
M(this, nt, t), t !== void 0 && (g(this, f).enableDetailedProfiling = t), this.requestUpdate("enableDetailedProfiling", i);
|
|
19615
19625
|
}
|
|
19616
19626
|
get xr() {
|
|
19617
|
-
return g(this,
|
|
19627
|
+
return g(this, at);
|
|
19618
19628
|
}
|
|
19619
19629
|
/**
|
|
19620
19630
|
* Sets XR configuration. Updates VR/AR settings and UI options.
|
|
19621
19631
|
*/
|
|
19622
19632
|
set xr(t) {
|
|
19623
|
-
const i = g(this,
|
|
19624
|
-
M(this,
|
|
19633
|
+
const i = g(this, at);
|
|
19634
|
+
M(this, at, t), t !== void 0 && g(this, f).setXRConfig(t), this.requestUpdate("xr", i);
|
|
19625
19635
|
}
|
|
19626
19636
|
/**
|
|
19627
19637
|
* Capture a screenshot of the current graph visualization.
|
|
@@ -21054,7 +21064,7 @@ const Pi = class Pi extends Bs {
|
|
|
21054
21064
|
*/
|
|
21055
21065
|
set acceleration(t) {
|
|
21056
21066
|
const i = g(this, f).acceleration.policy;
|
|
21057
|
-
if (!
|
|
21067
|
+
if (!Gr(t)) {
|
|
21058
21068
|
console.error(
|
|
21059
21069
|
`<graphty-element>: acceleration must be "auto", "off" or "required", not "${String(t)}". Keeping "${i}". See https://graphty.app/docs/graphty-element/guide/acceleration`
|
|
21060
21070
|
);
|
|
@@ -21088,7 +21098,7 @@ const Pi = class Pi extends Bs {
|
|
|
21088
21098
|
this.requestUpdate("accelerationMinNodes", i);
|
|
21089
21099
|
}
|
|
21090
21100
|
};
|
|
21091
|
-
f = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), yt = new WeakMap(),
|
|
21101
|
+
f = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), yt = new WeakMap(), _e = new WeakMap(), Be = new WeakMap(), Ue = new WeakMap(), Ge = new WeakMap(), wt = new WeakMap(), j = new WeakSet(), /**
|
|
21092
21102
|
* Mirror one run notification onto the DOM, so a consumer holding only the tag can follow it.
|
|
21093
21103
|
*
|
|
21094
21104
|
* The detail carries the run's RECORD rather than the run: a `CustomEvent` detail crosses to
|
|
@@ -21096,14 +21106,14 @@ f = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), yt = new WeakMap(), z
|
|
|
21096
21106
|
* there. A consumer that wants to cancel looks the run up by `detail.run.id`.
|
|
21097
21107
|
* @param change - The run's record, and which moment it reached.
|
|
21098
21108
|
*/
|
|
21099
|
-
|
|
21109
|
+
ks = function(t) {
|
|
21100
21110
|
if (t.phase === "progress") {
|
|
21101
|
-
const i = Date.now(), s = g(this,
|
|
21102
|
-
if (i - s <
|
|
21111
|
+
const i = Date.now(), s = g(this, Ge).get(t.run.id) ?? 0;
|
|
21112
|
+
if (i - s < tc)
|
|
21103
21113
|
return;
|
|
21104
|
-
g(this,
|
|
21114
|
+
g(this, Ge).set(t.run.id, i);
|
|
21105
21115
|
}
|
|
21106
|
-
t.phase === "end" && g(this,
|
|
21116
|
+
t.phase === "end" && g(this, Ge).delete(t.run.id), this.dispatchEvent(
|
|
21107
21117
|
new CustomEvent("graphty-run-change", {
|
|
21108
21118
|
detail: { run: t.run, phase: t.phase },
|
|
21109
21119
|
bubbles: !0,
|
|
@@ -21120,7 +21130,7 @@ Fs = function(t) {
|
|
|
21120
21130
|
* that wants the record looks the id up.
|
|
21121
21131
|
* @param delta - What joined, what left, and what the selection holds now.
|
|
21122
21132
|
*/
|
|
21123
|
-
|
|
21133
|
+
zs = function(t) {
|
|
21124
21134
|
this.dispatchEvent(
|
|
21125
21135
|
new CustomEvent("graphty-selection-change", {
|
|
21126
21136
|
detail: t,
|
|
@@ -21137,7 +21147,7 @@ Ns = function(t) {
|
|
|
21137
21147
|
* all three and must not learn about them in three different ways.
|
|
21138
21148
|
* @param change - The counts, the unresolved paths and what produced them.
|
|
21139
21149
|
*/
|
|
21140
|
-
|
|
21150
|
+
_s = function(t) {
|
|
21141
21151
|
this.dispatchEvent(
|
|
21142
21152
|
new CustomEvent("graphty-visibility-change", {
|
|
21143
21153
|
detail: t,
|
|
@@ -21153,15 +21163,15 @@ ks = function(t) {
|
|
|
21153
21163
|
* loaded lazily, `nodeData={[...]}` arrives as `nodedata="[object Object]"` and the graph comes
|
|
21154
21164
|
* up empty. The value is gone, so the element cannot recover it, but it can say why.
|
|
21155
21165
|
*/
|
|
21156
|
-
|
|
21166
|
+
Bs = function() {
|
|
21157
21167
|
if (!g(this, wt)) {
|
|
21158
21168
|
M(this, wt, !0);
|
|
21159
|
-
for (const t of
|
|
21169
|
+
for (const t of ic)
|
|
21160
21170
|
this.getAttribute(t) === "[object Object]" && console.error(
|
|
21161
21171
|
`<graphty-element> received ${t} as the attribute ${t.toLowerCase()}="[object Object]", so the value was lost. This happens when a framework renders the tag before @graphty/graphty-element is loaded. Import the element before rendering, or await customElements.whenDefined("graphty-element"). See https://graphty.app/docs/graphty-element/guide/installation#loading-the-element-lazily`
|
|
21162
21172
|
);
|
|
21163
21173
|
}
|
|
21164
|
-
},
|
|
21174
|
+
}, $e = new WeakMap(), Ve = new WeakMap(), le = new WeakMap(), de = new WeakMap(), He = new WeakMap(), We = new WeakMap(), je = new WeakMap(), qe = new WeakMap(), Ke = new WeakMap(), Ze = new WeakMap(), Xe = new WeakMap(), Qe = new WeakMap(), Je = new WeakMap(), ve = new WeakMap(), Te = new WeakMap(), be = new WeakMap(), Ye = new WeakMap(), et = new WeakMap(), tt = new WeakMap(), it = new WeakMap(), st = new WeakMap(), rt = new WeakMap(), at = new WeakMap(), /**
|
|
21165
21175
|
* Publish a failure from work that a property or an attribute assignment started.
|
|
21166
21176
|
*
|
|
21167
21177
|
* Assigning `node-data`, `edge-data` or the data-source pair hands the caller no promise, so a
|
|
@@ -21176,17 +21186,17 @@ zs = function() {
|
|
|
21176
21186
|
* throw calls the method -- `addNodes`, `setEdges`, `addDataFromSource` -- and awaits it.
|
|
21177
21187
|
* @param error - whatever the load rejected with
|
|
21178
21188
|
*/
|
|
21179
|
-
|
|
21189
|
+
pi = function(t) {
|
|
21180
21190
|
g(this, f).eventManager.emitDataLoadingError(
|
|
21181
21191
|
t instanceof Error ? t : new Error(String(t)),
|
|
21182
21192
|
"validation",
|
|
21183
21193
|
"records",
|
|
21184
21194
|
{ canContinue: !1 }
|
|
21185
21195
|
);
|
|
21186
|
-
},
|
|
21187
|
-
!g(this,
|
|
21196
|
+
}, ot = new WeakMap(), mi = function() {
|
|
21197
|
+
!g(this, ot) && g(this, le) && g(this, de) && (M(this, ot, !0), g(this, f).addDataFromSource(g(this, le), g(this, de)).catch(() => {
|
|
21188
21198
|
}));
|
|
21189
|
-
},
|
|
21199
|
+
}, nt = new WeakMap(), /**
|
|
21190
21200
|
* The acceleration controller, which is the Graph's -- the element does not build one.
|
|
21191
21201
|
*
|
|
21192
21202
|
* Every transition it publishes is mirrored as a `graphty-capabilities-change` DOM event,
|
|
@@ -21196,7 +21206,7 @@ gi = function(t) {
|
|
|
21196
21206
|
* same object `element.session.capabilities` returns, so the two channels cannot disagree.
|
|
21197
21207
|
* @returns The controller.
|
|
21198
21208
|
*/
|
|
21199
|
-
|
|
21209
|
+
Us = function() {
|
|
21200
21210
|
const t = g(this, f).acceleration;
|
|
21201
21211
|
return g(this, yt) || (t.onChange(() => {
|
|
21202
21212
|
this.dispatchEvent(
|
|
@@ -21207,7 +21217,7 @@ _s = function() {
|
|
|
21207
21217
|
})
|
|
21208
21218
|
);
|
|
21209
21219
|
}), M(this, yt, !0)), t;
|
|
21210
|
-
},
|
|
21220
|
+
}, Ai.styles = $s`
|
|
21211
21221
|
:host {
|
|
21212
21222
|
display: block;
|
|
21213
21223
|
position: relative;
|
|
@@ -21216,7 +21226,7 @@ _s = function() {
|
|
|
21216
21226
|
aspect-ratio: 2 / 1;
|
|
21217
21227
|
}
|
|
21218
21228
|
`;
|
|
21219
|
-
let P =
|
|
21229
|
+
let P = Ai;
|
|
21220
21230
|
L([
|
|
21221
21231
|
D({
|
|
21222
21232
|
/*
|
|
@@ -21411,8 +21421,8 @@ const ds = customElements.get("graphty-element");
|
|
|
21411
21421
|
ds === void 0 ? customElements.define("graphty-element", P) : ds !== P && console.warn(
|
|
21412
21422
|
"<graphty-element> is already defined by another class, so this copy of @graphty/graphty-element was not registered. Two copies of the package are loaded; make every import resolve to one."
|
|
21413
21423
|
);
|
|
21414
|
-
const
|
|
21415
|
-
class
|
|
21424
|
+
const sc = ue.getLogger(["graphty", "video", "recorder"]);
|
|
21425
|
+
class fi extends Error {
|
|
21416
21426
|
/**
|
|
21417
21427
|
* Creates a new AnimationCancelledError
|
|
21418
21428
|
*/
|
|
@@ -21420,7 +21430,7 @@ class mi extends Error {
|
|
|
21420
21430
|
super("Animation capture cancelled"), this.name = "AnimationCancelledError";
|
|
21421
21431
|
}
|
|
21422
21432
|
}
|
|
21423
|
-
class
|
|
21433
|
+
class rc {
|
|
21424
21434
|
/**
|
|
21425
21435
|
* Creates a new MediaRecorderCapture instance
|
|
21426
21436
|
* @param config - Configuration options for the recorder
|
|
@@ -21433,7 +21443,7 @@ class ic {
|
|
|
21433
21443
|
* @param message - The message to log
|
|
21434
21444
|
*/
|
|
21435
21445
|
log(e) {
|
|
21436
|
-
this.debug &&
|
|
21446
|
+
this.debug && sc.debug(e);
|
|
21437
21447
|
}
|
|
21438
21448
|
/**
|
|
21439
21449
|
* Detects browser and returns best supported codec
|
|
@@ -21494,7 +21504,7 @@ class ic {
|
|
|
21494
21504
|
const d = [];
|
|
21495
21505
|
return new Promise((u, p) => {
|
|
21496
21506
|
if (this.cancelReject = p, this.isCancelled) {
|
|
21497
|
-
this.activeRecorder = null, this.cancelReject = null, p(new
|
|
21507
|
+
this.activeRecorder = null, this.cancelReject = null, p(new fi());
|
|
21498
21508
|
return;
|
|
21499
21509
|
}
|
|
21500
21510
|
h.ondataavailable = (w) => {
|
|
@@ -21551,7 +21561,7 @@ class ic {
|
|
|
21551
21561
|
* @returns true if a capture was cancelled, false if no capture was in progress
|
|
21552
21562
|
*/
|
|
21553
21563
|
cancel() {
|
|
21554
|
-
return this.activeRecorder ? (this.isCancelled = !0, this.activeRecorder.state !== "inactive" && this.activeRecorder.stop(), this.cancelReject && (this.cancelReject(new
|
|
21564
|
+
return this.activeRecorder ? (this.isCancelled = !0, this.activeRecorder.state !== "inactive" && this.activeRecorder.stop(), this.cancelReject && (this.cancelReject(new fi()), this.cancelReject = null), this.activeRecorder = null, !0) : !1;
|
|
21555
21565
|
}
|
|
21556
21566
|
/**
|
|
21557
21567
|
* Check if a capture is currently in progress
|
|
@@ -21569,32 +21579,32 @@ class ic {
|
|
|
21569
21579
|
return this.getSupportedCodec(e);
|
|
21570
21580
|
}
|
|
21571
21581
|
}
|
|
21572
|
-
const
|
|
21582
|
+
const ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
21573
21583
|
__proto__: null,
|
|
21574
|
-
AnimationCancelledError:
|
|
21575
|
-
MediaRecorderCapture:
|
|
21576
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
21584
|
+
AnimationCancelledError: fi,
|
|
21585
|
+
MediaRecorderCapture: rc
|
|
21586
|
+
}, Symbol.toStringTag, { value: "Module" })), Uc = ba;
|
|
21577
21587
|
export {
|
|
21578
|
-
|
|
21588
|
+
Lo as A,
|
|
21579
21589
|
me as B,
|
|
21580
|
-
|
|
21590
|
+
un as D,
|
|
21581
21591
|
Tt as E,
|
|
21582
21592
|
ls as G,
|
|
21583
|
-
|
|
21584
|
-
|
|
21593
|
+
mn as I,
|
|
21594
|
+
Cn as L,
|
|
21585
21595
|
Ot as N,
|
|
21586
|
-
|
|
21587
|
-
|
|
21588
|
-
|
|
21596
|
+
ui as O,
|
|
21597
|
+
In as P,
|
|
21598
|
+
_n as R,
|
|
21589
21599
|
O as S,
|
|
21590
|
-
|
|
21591
|
-
|
|
21592
|
-
|
|
21593
|
-
|
|
21594
|
-
|
|
21600
|
+
bi as U,
|
|
21601
|
+
fi as a,
|
|
21602
|
+
Uc as b,
|
|
21603
|
+
$n as c,
|
|
21604
|
+
gn as d,
|
|
21595
21605
|
P as e,
|
|
21596
21606
|
R as f,
|
|
21597
|
-
|
|
21598
|
-
|
|
21599
|
-
|
|
21607
|
+
Bn as g,
|
|
21608
|
+
gi as h,
|
|
21609
|
+
Ia as i
|
|
21600
21610
|
};
|