@graphty/graphty-element 2.2.4 → 2.3.0

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.
Files changed (29) hide show
  1. package/dist/ai.js +3 -3
  2. package/dist/catalog.js +5 -5
  3. package/dist/chunks/{AiManager-DC3JWPeM.js → AiManager-Bd_r1Hei.js} +7 -2
  4. package/dist/chunks/{DataSource-DEg3igzS.js → DataSource-bt0DhBjG.js} +3 -3
  5. package/dist/chunks/{GraphSession-DDrQWABb.js → GraphSession-iNyKm7Ds.js} +3308 -3284
  6. package/dist/chunks/{VoiceInputAdapter-BueUG885.js → VoiceInputAdapter-DszYl6Ha.js} +442 -424
  7. package/dist/chunks/{XRPivotCameraController-DENGN2uV.js → XRPivotCameraController-XtxbbZ-D.js} +1 -1
  8. package/dist/chunks/{capability-check-BC3Qn6fS.js → capability-check-BqIEXcun.js} +1 -1
  9. package/dist/chunks/{detect-CqN0mC6u.js → detect-DM29BEaB.js} +1 -1
  10. package/dist/chunks/{format-detection-C8vbCSlS.js → format-detection-BEdmtvsy.js} +1 -1
  11. package/dist/chunks/{index-COss7yTG.js → index-CD0_RJv-.js} +1001 -848
  12. package/dist/chunks/{paletteRegistry-NrWOKT-A.js → paletteRegistry-DnWHQsAD.js} +162 -160
  13. package/dist/chunks/{scales-DKsbJE2L.js → scales-DyuwlJKI.js} +237 -236
  14. package/dist/extend.js +3 -3
  15. package/dist/graphty-catalog.json +1 -1
  16. package/dist/graphty.bundle.js +22378 -22178
  17. package/dist/graphty.js +3 -3
  18. package/dist/session.js +37 -52
  19. package/dist/src/Graph.d.ts +3 -0
  20. package/dist/src/acceleration/AccelerationController.d.ts +11 -0
  21. package/dist/src/ai/input/VoiceInputAdapter.d.ts +18 -0
  22. package/dist/src/algorithms/metrics/context.d.ts +7 -5
  23. package/dist/src/algorithms/results/types.d.ts +17 -1
  24. package/dist/src/data/ingest.d.ts +13 -0
  25. package/dist/src/managers/DataManager.d.ts +51 -0
  26. package/dist/src/managers/RenderManager.d.ts +21 -0
  27. package/dist/src/managers/UpdateManager.d.ts +38 -23
  28. package/dist/src/session/limits.d.ts +24 -5
  29. package/package.json +4 -4
@@ -2,13 +2,13 @@ import { z as j } from "zod/v4";
2
2
  import { b as Le, q as Z, G as De } from "./GraphtyLogger-5KEttFUo.js";
3
3
  import { A as Ce } from "./Algorithm-RQ629NLb.js";
4
4
  import { G as w } from "./GraphtyError-BwcnblTH.js";
5
- import { a as Ge, b as He, d as Ue } from "./types-B7bX5c0K.js";
5
+ import { a as Ge, b as Ue, d as He } from "./types-B7bX5c0K.js";
6
6
  import { remapArray as se, INVALID_INDEX as W } from "@graphty/graph-format";
7
7
  import { c as Be } from "./common-DWNKjpH_.js";
8
8
  const We = 12;
9
- function $n(t, e = {}) {
9
+ function Rn(t, e = {}) {
10
10
  return (Je(t) ? Ve(t) : qe(t)).map((r) => {
11
- const i = { ...r.meta, ...e.meta?.[r.name] }, s = r.node === null ? Ke(r.name, i, r.failure ?? "the schema could not be converted") : Ye(r.name, r.node, i), o = e.overrides?.[r.name];
11
+ const i = { ...r.meta, ...e.meta?.[r.name] }, s = r.node === null ? Ke(r.name, i, r.failure ?? "the schema could not be converted") : Xe(r.name, r.node, i), o = e.overrides?.[r.name];
12
12
  return o === void 0 ? s : { ...s, ...o };
13
13
  });
14
14
  }
@@ -26,7 +26,7 @@ function qe(t) {
26
26
  const e = Object.entries(t), n = {};
27
27
  for (const [s, o] of e)
28
28
  n[s] = o.schema;
29
- const r = Xe(n), i = r?.properties;
29
+ const r = Ye(n), i = r?.properties;
30
30
  return e.map(([s, o]) => {
31
31
  const a = i?.[s];
32
32
  return r === null || a === void 0 ? {
@@ -44,7 +44,7 @@ function Oe(t) {
44
44
  return null;
45
45
  }
46
46
  }
47
- function Xe(t) {
47
+ function Ye(t) {
48
48
  try {
49
49
  return Oe(j.object(t));
50
50
  } catch {
@@ -59,7 +59,7 @@ function ke(t, e) {
59
59
  const r = n.slice(oe.length).replaceAll("~1", "/").replaceAll("~0", "~");
60
60
  return e.$defs?.[r] ?? t;
61
61
  }
62
- function Ye(t, e, n) {
62
+ function Xe(t, e, n) {
63
63
  const r = Se(e, 0), i = Ze(r), s = {
64
64
  name: t,
65
65
  plainName: n.label ?? Q(t),
@@ -270,7 +270,7 @@ function ut(t, e) {
270
270
  return le(n, e);
271
271
  }
272
272
  }
273
- function Rn(t, e) {
273
+ function _n(t, e) {
274
274
  const n = e === "node", r = n ? t.nodeValue : t.edgeValue, i = n ? t.nodeHas : t.edgeHas, s = n ? t.nodeIdOf : t.edgeIdOf;
275
275
  return {
276
276
  value: r,
@@ -281,7 +281,7 @@ function Rn(t, e) {
281
281
  function dt(t) {
282
282
  return t != null;
283
283
  }
284
- function P(t) {
284
+ function M(t) {
285
285
  return t == null || t === !1 || t === "" ? !1 : Array.isArray(t) ? t.length > 0 : typeof t == "object" ? Object.keys(t).length > 0 : !0;
286
286
  }
287
287
  function J(t, e) {
@@ -322,7 +322,7 @@ function Fe(t) {
322
322
  function Ee(t) {
323
323
  return /[A-Za-z0-9_]/.test(t);
324
324
  }
325
- function H(t, e, n) {
325
+ function U(t, e, n) {
326
326
  for (let r = e + 1; r < t.length; r++) {
327
327
  if (t[r] === "\\") {
328
328
  r++;
@@ -395,17 +395,17 @@ function yt(t) {
395
395
  continue;
396
396
  }
397
397
  if (r === "`") {
398
- const o = H(t, n, "`");
398
+ const o = U(t, n, "`");
399
399
  e.push({ kind: "literal", text: "", value: mt(t, n, t.slice(n + 1, o)), at: n }), n = o + 1;
400
400
  continue;
401
401
  }
402
402
  if (r === "'") {
403
- const o = H(t, n, "'");
403
+ const o = U(t, n, "'");
404
404
  e.push({ kind: "literal", text: "", value: ft(t.slice(n + 1, o)), at: n }), n = o + 1;
405
405
  continue;
406
406
  }
407
407
  if (r === '"') {
408
- const o = H(t, n, '"');
408
+ const o = U(t, n, '"');
409
409
  e.push({ kind: "identifier", text: gt(t, n, t.slice(n, o + 1)), at: n }), n = o + 1;
410
410
  continue;
411
411
  }
@@ -564,20 +564,20 @@ function b(t, e) {
564
564
  return b(t.inner, e);
565
565
  case "not": {
566
566
  const n = b(t.operand, e);
567
- return (r) => !P(n(r));
567
+ return (r) => !M(n(r));
568
568
  }
569
569
  case "and": {
570
570
  const n = b(t.left, e), r = b(t.right, e);
571
571
  return (i) => {
572
572
  const s = n(i);
573
- return P(s) ? r(i) : s;
573
+ return M(s) ? r(i) : s;
574
574
  };
575
575
  }
576
576
  case "or": {
577
577
  const n = b(t.left, e), r = b(t.right, e);
578
578
  return (i) => {
579
579
  const s = n(i);
580
- return P(s) ? s : r(i);
580
+ return M(s) ? s : r(i);
581
581
  };
582
582
  }
583
583
  default:
@@ -632,7 +632,7 @@ function x(t, e) {
632
632
  }
633
633
  default: {
634
634
  const n = b(t, e);
635
- return (r) => P(n(r));
635
+ return (r) => M(n(r));
636
636
  }
637
637
  }
638
638
  }
@@ -647,11 +647,11 @@ function Ft(t) {
647
647
  return !1;
648
648
  return !0;
649
649
  }
650
- function _n(t, e) {
650
+ function zn(t, e) {
651
651
  const { has: n } = t;
652
652
  return (r) => n(r, e);
653
653
  }
654
- function zn(t, e) {
654
+ function Mn(t, e) {
655
655
  const { idOf: n } = t;
656
656
  if (n === null)
657
657
  throw new w({
@@ -679,7 +679,7 @@ function Pn(t, e) {
679
679
  return { paths: Object.freeze(r), test: x(n, e) };
680
680
  }
681
681
  const q = "results", Et = "$";
682
- function M(t, e) {
682
+ function P(t, e) {
683
683
  return e === void 0 ? `${q}.${t}` : `${q}.${t}.${e}`;
684
684
  }
685
685
  const xe = {
@@ -850,7 +850,7 @@ const xe = {
850
850
  scope: "graph",
851
851
  types: ["number"]
852
852
  }
853
- }, Mn = Object.keys(xe), ee = {
853
+ }, jn = Object.keys(xe), ee = {
854
854
  "node-metric": {
855
855
  shape: "node-metric",
856
856
  primaryField: "value",
@@ -967,13 +967,13 @@ const xe = {
967
967
  layer: "none"
968
968
  }
969
969
  };
970
- function X(t) {
970
+ function Y(t) {
971
971
  return ee[t];
972
972
  }
973
- function jn(t) {
973
+ function Ln(t) {
974
974
  return ee[t].layer === "highlight";
975
975
  }
976
- function Ln(t, e) {
976
+ function Dn(t, e) {
977
977
  const n = ee[t], r = [], i = [
978
978
  { names: n.nodeFields, kind: "node" },
979
979
  { names: n.edgeFields, kind: "edge" },
@@ -1063,9 +1063,9 @@ class zt {
1063
1063
  path(e, n) {
1064
1064
  const r = pe(e);
1065
1065
  if (n !== void 0)
1066
- return M(r, n);
1067
- const i = Rt(e) ?? this.#e.entry(r)?.shape, s = i === void 0 ? null : X(i).primaryField;
1068
- return s === null ? M(r) : M(r, s);
1066
+ return P(r, n);
1067
+ const i = Rt(e) ?? this.#e.entry(r)?.shape, s = i === void 0 ? null : Y(i).primaryField;
1068
+ return s === null ? P(r) : P(r, s);
1069
1069
  }
1070
1070
  /**
1071
1071
  * The same field, written so a selector expression can read it.
@@ -1115,14 +1115,14 @@ class zt {
1115
1115
  return Object.freeze(e);
1116
1116
  }
1117
1117
  }
1118
- function Dn(t) {
1118
+ function Cn(t) {
1119
1119
  return new zt(t);
1120
1120
  }
1121
- const Pt = 20, U = 100, Mt = 100, jt = Object.freeze([]), Lt = Object.freeze(["max", "min-max", "none"]);
1121
+ const Mt = 20, H = 100, Pt = 100, jt = Object.freeze([]), Lt = Object.freeze(["max", "min-max", "none"]);
1122
1122
  function Te(t) {
1123
1123
  return typeof t == "string" && Lt.includes(t);
1124
1124
  }
1125
- function Cn(t) {
1125
+ function Gn(t) {
1126
1126
  return {
1127
1127
  length: t.length,
1128
1128
  get: (e) => t[e]
@@ -1205,9 +1205,9 @@ function Ct(t) {
1205
1205
  return Math.log10(t.max) > Math.log10(n);
1206
1206
  }
1207
1207
  function Gt(t) {
1208
- return t.measured === 0 || !(t.median > 0) || t.max / t.median <= Mt ? "linear" : Ct(t) ? "log" : "linear";
1208
+ return t.measured === 0 || !(t.median > 0) || t.max / t.median <= Pt ? "linear" : Ct(t) ? "log" : "linear";
1209
1209
  }
1210
- function Ht(t, e, n, r) {
1210
+ function Ut(t, e, n, r) {
1211
1211
  if (!(e > t))
1212
1212
  return { binCount: 1, indexOf: () => 0, rangeOf: () => [t, e] };
1213
1213
  if (r) {
@@ -1231,7 +1231,7 @@ function Ht(t, e, n, r) {
1231
1231
  ]
1232
1232
  };
1233
1233
  }
1234
- function Ut(t, e, n, r, i) {
1234
+ function Ht(t, e, n, r, i) {
1235
1235
  const s = t > 0 ? 0 : 1, o = s === 0 ? t : n;
1236
1236
  if (!(e > 0) || o === null || !(o > 0))
1237
1237
  return null;
@@ -1263,13 +1263,13 @@ function Ut(t, e, n, r, i) {
1263
1263
  }
1264
1264
  function Bt(t) {
1265
1265
  if (t === void 0)
1266
- return Pt;
1267
- if (!Number.isInteger(t) || t < 1 || t > U)
1266
+ return Mt;
1267
+ if (!Number.isInteger(t) || t < 1 || t > H)
1268
1268
  throw new w({
1269
1269
  code: "E_OPTION_RANGE",
1270
1270
  source: "run",
1271
- message: `A histogram takes between 1 and ${U} bins; ${String(t)} was asked for.`,
1272
- details: { option: "bins", value: t, min: 1, max: U }
1271
+ message: `A histogram takes between 1 and ${H} bins; ${String(t)} was asked for.`,
1272
+ details: { option: "bins", value: t, min: 1, max: H }
1273
1273
  });
1274
1274
  return t;
1275
1275
  }
@@ -1314,7 +1314,7 @@ function Jt(t, e) {
1314
1314
  binning: "per-value"
1315
1315
  });
1316
1316
  }
1317
- const l = e?.scale === "log" || e?.scale === "auto" && s === "log" ? Ut(i.min, i.max, i.smallestPositive, n, r) : null, c = l ?? Ht(i.min, i.max, n, r), p = new Array(c.binCount).fill(0);
1317
+ const l = e?.scale === "log" || e?.scale === "auto" && s === "log" ? Ht(i.min, i.max, i.smallestPositive, n, r) : null, c = l ?? Ut(i.min, i.max, n, r), p = new Array(c.binCount).fill(0);
1318
1318
  for (let h = 0; h < t.length; h++) {
1319
1319
  const u = t.get(h);
1320
1320
  Number.isFinite(u) && (p[c.indexOf(u)] += 1);
@@ -1348,7 +1348,7 @@ function fe(t) {
1348
1348
  }
1349
1349
  return e;
1350
1350
  }
1351
- function Y(t, e) {
1351
+ function X(t, e) {
1352
1352
  const { records: n } = t;
1353
1353
  return {
1354
1354
  length: n.length,
@@ -1381,25 +1381,25 @@ function ze(t, e) {
1381
1381
  }
1382
1382
  return n;
1383
1383
  }
1384
- function Pe(t, e) {
1384
+ function Me(t, e) {
1385
1385
  const n = String(t), r = String(e);
1386
1386
  return n === r ? 0 : n < r ? -1 : 1;
1387
1387
  }
1388
- function Xt(t) {
1388
+ function Yt(t) {
1389
1389
  const e = [...t.entries()].map(([n, r]) => ({ group: n, size: r }));
1390
- return e.sort((n, r) => r.size - n.size || Pe(n.group, r.group)), Object.freeze(e.map((n) => Object.freeze(n)));
1390
+ return e.sort((n, r) => r.size - n.size || Me(n.group, r.group)), Object.freeze(e.map((n) => Object.freeze(n)));
1391
1391
  }
1392
- function Me(t, e) {
1392
+ function Pe(t, e) {
1393
1393
  const n = t.find((r) => r.name === e)?.normalization;
1394
1394
  return Te(n) ? n : "none";
1395
1395
  }
1396
1396
  function me(t, e, n) {
1397
- const { statistics: r } = Re(Y(t, "value"));
1397
+ const { statistics: r } = Re(X(t, "value"));
1398
1398
  for (const i of te(ne(t, "value"))) {
1399
1399
  const s = t.index.get(i.id);
1400
1400
  s !== void 0 && (L(t.records[s], "rank", i.rank), L(t.records[s], "percentile", i.percentile));
1401
1401
  }
1402
- r.measured > 0 && (y(e, "min", r.min), y(e, "max", r.max), y(e, "median", r.median), y(e, "mean", r.mean)), y(e, "measured", r.measured), y(e, "tiedAtMin", r.tiedAtMin), y(e, "normalization", Me(n, "value"));
1402
+ r.measured > 0 && (y(e, "min", r.min), y(e, "max", r.max), y(e, "median", r.median), y(e, "mean", r.mean)), y(e, "measured", r.measured), y(e, "tiedAtMin", r.tiedAtMin), y(e, "normalization", Pe(n, "value"));
1403
1403
  }
1404
1404
  function ge(t, e, n, r, i) {
1405
1405
  const s = ze(t, n);
@@ -1407,9 +1407,9 @@ function ge(t, e, n, r, i) {
1407
1407
  const a = o[n];
1408
1408
  re(a) && L(o, r, s.get(a));
1409
1409
  }
1410
- y(e, i, s.size), y(e, "sizes", Xt(s));
1410
+ y(e, i, s.size), y(e, "sizes", Yt(s));
1411
1411
  }
1412
- function Yt(t, e) {
1412
+ function Xt(t, e) {
1413
1413
  for (const r of te(ne(t, "score"))) {
1414
1414
  const i = t.index.get(r.id);
1415
1415
  i !== void 0 && L(t.records[i], "rank", r.rank);
@@ -1418,7 +1418,7 @@ function Yt(t, e) {
1418
1418
  category: String(r),
1419
1419
  count: i
1420
1420
  }));
1421
- n.sort((r, i) => i.count - r.count || Pe(r.category, i.category)), y(e, "categories", Object.freeze(n.map((r) => Object.freeze(r))));
1421
+ n.sort((r, i) => i.count - r.count || Me(r.category, i.category)), y(e, "categories", Object.freeze(n.map((r) => Object.freeze(r))));
1422
1422
  }
1423
1423
  function z(t, e) {
1424
1424
  let n = 0;
@@ -1447,7 +1447,7 @@ function Kt(t, e, n, r, i) {
1447
1447
  ge(e, r, "level", "levelSize", "levelCount");
1448
1448
  break;
1449
1449
  case "category-table":
1450
- Yt(e, r);
1450
+ Xt(e, r);
1451
1451
  break;
1452
1452
  case "path":
1453
1453
  y(r, "length", z(e, "onPath")), y(r, "hops", z(n, "onPath"));
@@ -1577,7 +1577,7 @@ class en {
1577
1577
  */
1578
1578
  histogram(e, n) {
1579
1579
  const r = this.#l(e), i = r.kind === "edge" ? this.#t : this.#e;
1580
- return Jt(Y(i, e), {
1580
+ return Jt(X(i, e), {
1581
1581
  ...n,
1582
1582
  integerValued: r.type === "integer"
1583
1583
  });
@@ -1665,7 +1665,7 @@ class en {
1665
1665
  const n = this.#o.get(e);
1666
1666
  if (n !== void 0)
1667
1667
  return n;
1668
- const r = Re(Y(this.#u(e), e));
1668
+ const r = Re(X(this.#u(e), e));
1669
1669
  return this.#o.set(e, r), r;
1670
1670
  }
1671
1671
  /**
@@ -1715,7 +1715,7 @@ class en {
1715
1715
  * @returns The count.
1716
1716
  */
1717
1717
  #m() {
1718
- const e = X(this.shape), n = e.nodeFields.length > 0 ? this.measured.nodes : 0, r = e.edgeFields.length > 0 ? this.measured.edges : 0;
1718
+ const e = Y(this.shape), n = e.nodeFields.length > 0 ? this.measured.nodes : 0, r = e.edgeFields.length > 0 ? this.measured.edges : 0;
1719
1719
  return n + r;
1720
1720
  }
1721
1721
  /**
@@ -1723,7 +1723,7 @@ class en {
1723
1723
  * @returns The count.
1724
1724
  */
1725
1725
  #g() {
1726
- const e = X(this.shape), { primaryField: n } = e;
1726
+ const e = Y(this.shape), { primaryField: n } = e;
1727
1727
  if (n === null)
1728
1728
  return 0;
1729
1729
  const r = e.nodeFields.includes(n) ? ye(this.#e, n) : 0, i = e.edgeFields.includes(n) ? ye(this.#t, n) : 0;
@@ -1737,7 +1737,7 @@ class en {
1737
1737
  */
1738
1738
  #y(e) {
1739
1739
  const n = this.graph.normalization;
1740
- return Te(n) ? n : e === null ? "none" : Me(this.fields, e);
1740
+ return Te(n) ? n : e === null ? "none" : Pe(this.fields, e);
1741
1741
  }
1742
1742
  }
1743
1743
  function tn(t) {
@@ -1759,11 +1759,11 @@ function nn(t) {
1759
1759
  return typeof i == "string" || typeof i == "number" ? String(i) : void 0;
1760
1760
  };
1761
1761
  }
1762
- function Gn(t) {
1762
+ function Un(t) {
1763
1763
  return { exact: !0, precision: "f64", notes: [], ...t };
1764
1764
  }
1765
- const rn = 1024;
1766
- function sn() {
1765
+ const rn = 1024, sn = 16;
1766
+ function on() {
1767
1767
  return {
1768
1768
  signal: new AbortController().signal,
1769
1769
  report: () => {
@@ -1776,23 +1776,24 @@ function sn() {
1776
1776
  async function Hn(t, e, n, r) {
1777
1777
  const i = n.length;
1778
1778
  t.report({ phase: e, completed: 0, total: i });
1779
- for (let s = 0; s < i; s++)
1780
- s > 0 && s % rn === 0 && (t.signal.throwIfAborted(), t.report({ phase: e, completed: s, total: i }), await t.yieldNow()), r(n[s], s);
1779
+ let s = performance.now();
1780
+ for (let o = 0; o < i; o++)
1781
+ o > 0 && o % rn === 0 && (t.signal.throwIfAborted(), t.report({ phase: e, completed: o, total: i }), performance.now() - s >= sn && (await t.yieldNow(), s = performance.now())), r(n[o], o);
1781
1782
  t.signal.throwIfAborted(), t.report({ phase: e, completed: i, total: i });
1782
1783
  }
1783
- function on(t, e, n) {
1784
+ function an(t, e, n) {
1784
1785
  const r = n?.find((s) => s.name === t.name && s.kind === t.kind), i = {
1785
1786
  name: t.name,
1786
1787
  plainName: r?.plainName ?? t.name,
1787
1788
  technicalName: r?.technicalName ?? t.name,
1788
1789
  kind: t.kind,
1789
1790
  type: t.type,
1790
- path: M(e, t.name),
1791
+ path: P(e, t.name),
1791
1792
  ...r?.unit === void 0 ? {} : { unit: r.unit }
1792
1793
  };
1793
1794
  return t.normalization === void 0 ? i : { ...i, normalization: t.normalization };
1794
1795
  }
1795
- class Un extends Ce {
1796
+ class Bn extends Ce {
1796
1797
  /** What the last run published, kept so a caller holding the algorithm can read the result. */
1797
1798
  #e;
1798
1799
  /**
@@ -1843,7 +1844,7 @@ class Un extends Ce {
1843
1844
  * @returns A promise that settles when the result has been published.
1844
1845
  */
1845
1846
  async run() {
1846
- await this.computeRun(sn(), this.type);
1847
+ await this.computeRun(on(), this.type);
1847
1848
  }
1848
1849
  /**
1849
1850
  * Compute on behalf of a run, and hand the result back.
@@ -1882,7 +1883,7 @@ class Un extends Ce {
1882
1883
  ...a === void 0 ? {} : { labelOf: a },
1883
1884
  runId: n,
1884
1885
  shape: s.shape,
1885
- fields: s.fields.map((c) => on(c, n, r)),
1886
+ fields: s.fields.map((c) => an(c, n, r)),
1886
1887
  measured: { nodes: o.nodes.size, edges: o.edges.size },
1887
1888
  graph: s.graph,
1888
1889
  nodes: s.nodes,
@@ -1893,7 +1894,7 @@ class Un extends Ce {
1893
1894
  return this.#e = l, l;
1894
1895
  }
1895
1896
  }
1896
- function Bn(t, e = "number") {
1897
+ function Wn(t, e = "number") {
1897
1898
  return [
1898
1899
  { name: "value", kind: t, type: e },
1899
1900
  { name: "rank", kind: t, type: "integer" },
@@ -1913,15 +1914,15 @@ const be = [
1913
1914
  { name: "groupCount", kind: "graph", type: "integer" },
1914
1915
  { name: "sizes", kind: "graph", type: "table" }
1915
1916
  ];
1916
- function Wn(t) {
1917
+ function Jn(t) {
1917
1918
  return t ? [...be, { name: "modularity", kind: "graph", type: "number" }] : be;
1918
1919
  }
1919
- const Jn = [
1920
+ const Vn = [
1920
1921
  { name: "level", kind: "node", type: "integer" },
1921
1922
  { name: "levelSize", kind: "node", type: "integer" },
1922
1923
  { name: "levelCount", kind: "graph", type: "integer" },
1923
1924
  { name: "sizes", kind: "graph", type: "table" }
1924
- ], Vn = [
1925
+ ], qn = [
1925
1926
  { name: "onPath", kind: "node", type: "boolean" },
1926
1927
  { name: "order", kind: "node", type: "integer" },
1927
1928
  { name: "onPath", kind: "edge", type: "boolean" },
@@ -1929,16 +1930,16 @@ const Jn = [
1929
1930
  { name: "cost", kind: "graph", type: "number" },
1930
1931
  { name: "hops", kind: "graph", type: "integer" }
1931
1932
  ];
1932
- function qn(t, e) {
1933
+ function Yn(t, e) {
1933
1934
  return [
1934
1935
  { name: "in", kind: t, type: "boolean" },
1935
1936
  { name: "count", kind: "graph", type: "integer" },
1936
1937
  { ...e, kind: "graph" }
1937
1938
  ];
1938
1939
  }
1939
- const an = `${q}.${Et}`;
1940
+ const cn = `${q}.${Et}`;
1940
1941
  function N(t) {
1941
- return { ...t, path: `${an}.${t.name}` };
1942
+ return { ...t, path: `${cn}.${t.name}` };
1942
1943
  }
1943
1944
  function Xn(t) {
1944
1945
  return [
@@ -1992,22 +1993,22 @@ const _ = Z({
1992
1993
  implementationOf: (t) => t.descriptor,
1993
1994
  builtInIds: () => Ge
1994
1995
  });
1995
- function Yn(t, e) {
1996
+ function Kn(t, e) {
1996
1997
  _.register(t, e);
1997
1998
  }
1998
- function Kn() {
1999
+ function Zn() {
1999
2000
  return _.entries();
2000
2001
  }
2001
- function cn() {
2002
+ function ln() {
2002
2003
  return _.descriptors();
2003
2004
  }
2004
- function ln(t) {
2005
+ function un(t) {
2005
2006
  return _.byId(t);
2006
2007
  }
2007
- function Zn() {
2008
+ function Qn() {
2008
2009
  _.clearForTesting();
2009
2010
  }
2010
- const un = {
2011
+ const dn = {
2011
2012
  "edge-list": "Edge List",
2012
2013
  "node-list": "Node List",
2013
2014
  "adjacency-list": "Adjacency List",
@@ -2015,7 +2016,7 @@ const un = {
2015
2016
  gephi: "Gephi Export",
2016
2017
  cytoscape: "Cytoscape Export",
2017
2018
  generic: "Generic"
2018
- }, dn = [
2019
+ }, hn = [
2019
2020
  {
2020
2021
  name: "delimiter",
2021
2022
  plainName: "Column Separator",
@@ -2028,7 +2029,7 @@ const un = {
2028
2029
  plainName: "File Shape",
2029
2030
  technicalName: "variant",
2030
2031
  type: "enum",
2031
- values: Object.entries(un).map(([t, e]) => ({ value: t, label: e })),
2032
+ values: Object.entries(dn).map(([t, e]) => ({ value: t, label: e })),
2032
2033
  description: "Which CSV shape to read. Worked out from the header row when it is not set."
2033
2034
  },
2034
2035
  {
@@ -2053,7 +2054,7 @@ const un = {
2053
2054
  type: "string",
2054
2055
  description: "Where to find the node an edge ends at. Left unset, the element looks for target, then dst, then to."
2055
2056
  }
2056
- ], hn = [
2057
+ ], pn = [
2057
2058
  {
2058
2059
  name: "nodeIdPath",
2059
2060
  plainName: "Node Id Field",
@@ -2069,7 +2070,7 @@ const un = {
2069
2070
  mimeTypes: ["application/json"],
2070
2071
  canImport: !0,
2071
2072
  canExport: !1,
2072
- options: [...hn, ...S]
2073
+ options: [...pn, ...S]
2073
2074
  },
2074
2075
  {
2075
2076
  id: "csv",
@@ -2078,7 +2079,7 @@ const un = {
2078
2079
  mimeTypes: ["text/csv", "text/tab-separated-values", "text/plain"],
2079
2080
  canImport: !0,
2080
2081
  canExport: !1,
2081
- options: [...dn, ...S]
2082
+ options: [...hn, ...S]
2082
2083
  },
2083
2084
  {
2084
2085
  id: "graphml",
@@ -2130,16 +2131,16 @@ const un = {
2130
2131
  canExport: !1,
2131
2132
  options: S
2132
2133
  }
2133
- ], Qn = [
2134
+ ], er = [
2134
2135
  { id: "sif", reason: "No data source reads the Cytoscape simple interaction format." },
2135
2136
  { id: "cx2", reason: "No data source reads the Cytoscape Exchange format." }
2136
2137
  ];
2137
- function er(t) {
2138
- return je.find((e) => e.id === t) ?? ln(t)?.descriptor;
2139
- }
2140
2138
  function tr(t) {
2139
+ return je.find((e) => e.id === t) ?? un(t)?.descriptor;
2140
+ }
2141
+ function nr(t) {
2141
2142
  const e = t.toLowerCase();
2142
- return [...je, ...cn()].filter(
2143
+ return [...je, ...ln()].filter(
2143
2144
  (n) => n.extensions.includes(e)
2144
2145
  );
2145
2146
  }
@@ -2148,21 +2149,21 @@ const D = Z({
2148
2149
  idOf: (t) => t.descriptor.id,
2149
2150
  descriptorOf: (t) => t.descriptor,
2150
2151
  implementationOf: (t) => t.descriptor,
2151
- builtInIds: () => He
2152
+ builtInIds: () => Ue
2152
2153
  });
2153
- function pn(t, e) {
2154
+ function fn(t, e) {
2154
2155
  D.register(t, e);
2155
2156
  }
2156
- function nr() {
2157
+ function rr() {
2157
2158
  return D.descriptors();
2158
2159
  }
2159
- function rr(t) {
2160
+ function ir(t) {
2160
2161
  return D.byId(t);
2161
2162
  }
2162
- function ir() {
2163
+ function sr() {
2163
2164
  D.clearForTesting();
2164
2165
  }
2165
- const g = 3, fn = 1024;
2166
+ const g = 3, mn = 1024;
2166
2167
  function T(t, e) {
2167
2168
  if (!Number.isInteger(t) || t < 0)
2168
2169
  throw new RangeError(`ElementPositions: ${e} must be a non-negative integer, found ${String(t)}`);
@@ -2176,7 +2177,7 @@ class we {
2176
2177
  * Allocate the backing array, every row unplaced and unpinned.
2177
2178
  * @param capacity - rows to reserve before the first growth; a non-negative integer
2178
2179
  */
2179
- constructor(e = fn) {
2180
+ constructor(e = mn) {
2180
2181
  this.components = g, this.rows = 0, T(e, "capacity");
2181
2182
  const n = Math.max(1, e);
2182
2183
  this.array = new Float32Array(g * n), this.array.fill(Number.NaN), this.pins = new Uint8Array(n);
@@ -2426,7 +2427,7 @@ class we {
2426
2427
  return g * e;
2427
2428
  }
2428
2429
  }
2429
- const k = /* @__PURE__ */ new Map(), mn = Object.freeze([
2430
+ const k = /* @__PURE__ */ new Map(), gn = Object.freeze([
2430
2431
  "arf",
2431
2432
  "bfs",
2432
2433
  "bipartite",
@@ -2444,11 +2445,11 @@ const k = /* @__PURE__ */ new Map(), mn = Object.freeze([
2444
2445
  "spiral",
2445
2446
  "spring",
2446
2447
  "spring-electrical"
2447
- ]), gn = De.getLogger(["graphty", "layout"]), ve = 1e-6;
2448
- function yn(t, e) {
2448
+ ]), yn = De.getLogger(["graphty", "layout"]), ve = 1e-6;
2449
+ function bn(t, e) {
2449
2450
  return JSON.stringify([t, e]);
2450
2451
  }
2451
- const bn = 10;
2452
+ const wn = 10;
2452
2453
  function Ne(t) {
2453
2454
  return new w({
2454
2455
  code: "E_DUPLICATE_PLUGIN",
@@ -2507,7 +2508,7 @@ const ie = class ie {
2507
2508
  * @param _nodes - the nodes that have just arrived
2508
2509
  */
2509
2510
  updatePositions(e) {
2510
- for (let n = 0; n < bn; n++) {
2511
+ for (let n = 0; n < wn; n++) {
2511
2512
  if (this.isSettled)
2512
2513
  return;
2513
2514
  this.step();
@@ -2663,7 +2664,7 @@ const ie = class ie {
2663
2664
  for (const o of e) {
2664
2665
  const a = o.index >= 0 && o.index < r.length ? r[o.index] : 1;
2665
2666
  a !== 1 && (s = !0);
2666
- const l = yn(o.srcId, o.dstId);
2667
+ const l = bn(o.srcId, o.dstId);
2667
2668
  i.set(l, (i.get(l) ?? 0) + a);
2668
2669
  }
2669
2670
  return s ? i : null;
@@ -2684,7 +2685,7 @@ const ie = class ie {
2684
2685
  let r = 0;
2685
2686
  for (const i of n.values())
2686
2687
  i < ve && r++;
2687
- r > 0 && gn.warn("Edge weights at or below zero were clamped before the layout read them", {
2688
+ r > 0 && yn.warn("Edge weights at or below zero were clamped before the layout read them", {
2688
2689
  layout: e,
2689
2690
  clamped: r,
2690
2691
  epsilon: ve
@@ -2745,7 +2746,7 @@ const ie = class ie {
2745
2746
  });
2746
2747
  if (k.get(r) === e)
2747
2748
  return e;
2748
- const s = mn.includes(r);
2749
+ const s = gn.includes(r);
2749
2750
  if (i === void 0) {
2750
2751
  if (!s)
2751
2752
  throw new w({
@@ -2767,7 +2768,7 @@ const ie = class ie {
2767
2768
  source: "registry",
2768
2769
  details: { kind: "layout", name: r, field: "descriptor.id", id: i.id }
2769
2770
  });
2770
- return pn({
2771
+ return fn({
2771
2772
  descriptor: { ...i, honoursWeights: n.honoursWeights ?? !1 },
2772
2773
  type: r
2773
2774
  }), k.set(r, e), e;
@@ -2832,17 +2833,17 @@ const ie = class ie {
2832
2833
  };
2833
2834
  ie.honoursWeights = !1;
2834
2835
  let K = ie;
2835
- const wn = j.looseObject({
2836
+ const vn = j.looseObject({
2836
2837
  scalingFactor: j.number().default(100)
2837
2838
  });
2838
- class sr extends K {
2839
+ class or extends K {
2839
2840
  /**
2840
2841
  * Create a simple layout engine
2841
2842
  * @param opts - Configuration options including scalingFactor
2842
2843
  */
2843
2844
  constructor(e = {}) {
2844
2845
  super(), this._nodes = [], this._edges = [], this.stale = !0, this.positions = {}, this.scalingFactor = 100, this.isSettled = !0;
2845
- const n = wn.parse(e);
2846
+ const n = vn.parse(e);
2846
2847
  this.scalingFactor = n.scalingFactor;
2847
2848
  }
2848
2849
  /**
@@ -3031,17 +3032,17 @@ class sr extends K {
3031
3032
  */
3032
3033
  publishedOr(e, n) {
3033
3034
  const r = { x: 0, y: 0, z: 0 };
3034
- return e !== void 0 && this.readNodePosition(e, r) ? r : vn(this.positions[n], this.scalingFactor);
3035
+ return e !== void 0 && this.readNodePosition(e, r) ? r : Nn(this.positions[n], this.scalingFactor);
3035
3036
  }
3036
3037
  }
3037
- function vn(t, e) {
3038
+ function Nn(t, e) {
3038
3039
  if (!t || t.length === 0)
3039
3040
  return { x: 0, y: 0, z: 0 };
3040
3041
  const n = t[0] * e, r = t[1] * e, i = (t[2] ?? 0) * e;
3041
3042
  return { x: n, y: r, z: i };
3042
3043
  }
3043
- const Nn = /^#[0-9a-f]{6}$/i;
3044
- function On(t) {
3044
+ const On = /^#[0-9a-f]{6}$/i;
3045
+ function kn(t) {
3045
3046
  if (typeof t != "string" || t.trim() === "")
3046
3047
  return null;
3047
3048
  try {
@@ -3049,20 +3050,20 @@ function On(t) {
3049
3050
  if (e === void 0)
3050
3051
  return null;
3051
3052
  const n = e.length === 9 ? e.slice(0, 7) : e;
3052
- return Nn.test(n) ? n.toUpperCase() : null;
3053
+ return On.test(n) ? n.toUpperCase() : null;
3053
3054
  } catch {
3054
3055
  return null;
3055
3056
  }
3056
3057
  }
3057
- function kn(t) {
3058
+ function Sn(t) {
3058
3059
  return JSON.stringify([t.id, t.kind, t.colors, t.capacity, t.colorblindSafe]);
3059
3060
  }
3060
3061
  const C = Z({
3061
3062
  kind: "palette",
3062
3063
  idOf: (t) => t.id,
3063
3064
  descriptorOf: (t) => t,
3064
- implementationOf: kn,
3065
- builtInIds: () => Ue
3065
+ implementationOf: Sn,
3066
+ builtInIds: () => He
3066
3067
  });
3067
3068
  function I(t, e, n) {
3068
3069
  throw new w({
@@ -3072,7 +3073,7 @@ function I(t, e, n) {
3072
3073
  details: { kind: "palette", name: typeof t == "string" ? t : "", field: e }
3073
3074
  });
3074
3075
  }
3075
- function or(t, e) {
3076
+ function ar(t, e) {
3076
3077
  typeof t != "object" && I("", "descriptor", "registerPalette takes a palette descriptor"), (t.plainName === void 0 || t.plainName === "") && I(t.id, "plainName", `the palette "${String(t.id)}" was registered without a plain name`), t.kind !== "sequential" && t.kind !== "diverging" && t.kind !== "categorical" && I(
3077
3078
  t.id,
3078
3079
  "kind",
@@ -3080,7 +3081,7 @@ function or(t, e) {
3080
3081
  ), (!Array.isArray(t.colors) || t.colors.length === 0) && I(t.id, "colors", `the palette "${String(t.id)}" was registered with no colours`);
3081
3082
  const n = [];
3082
3083
  for (const i of t.colors) {
3083
- const s = On(i);
3084
+ const s = kn(i);
3084
3085
  s === null && I(t.id, "colors", `"${String(i)}" in the palette "${String(t.id)}" is not a colour`), n.push(s);
3085
3086
  }
3086
3087
  const r = t.kind === "categorical" ? n.length : null;
@@ -3098,67 +3099,68 @@ function or(t, e) {
3098
3099
  e
3099
3100
  );
3100
3101
  }
3101
- function ar() {
3102
+ function cr() {
3102
3103
  return C.descriptors();
3103
3104
  }
3104
- function cr(t) {
3105
+ function lr(t) {
3105
3106
  return C.byId(t);
3106
3107
  }
3107
- function lr() {
3108
+ function ur() {
3108
3109
  C.clearForTesting();
3109
3110
  }
3110
3111
  export {
3111
- M as A,
3112
+ lr as $,
3113
+ Kn as A,
3112
3114
  g as B,
3113
3115
  A as C,
3114
- Un as D,
3116
+ Bn as D,
3115
3117
  we as E,
3116
3118
  je as F,
3117
- Pn as G,
3118
- Rn as H,
3119
- X as I,
3120
- $e as J,
3121
- Cn as K,
3122
- Jn as L,
3119
+ $e as G,
3120
+ Gn as H,
3121
+ Pn as I,
3122
+ _n as J,
3123
+ Y as K,
3124
+ Vn as L,
3123
3125
  $t as M,
3124
- zn as N,
3125
- _n as O,
3126
- Vn as P,
3127
- jn as Q,
3128
- Mn as R,
3129
- wn as S,
3130
- Dn as T,
3131
- Qn as U,
3126
+ Mn as N,
3127
+ zn as O,
3128
+ qn as P,
3129
+ Ln as Q,
3130
+ jn as R,
3131
+ vn as S,
3132
+ Cn as T,
3133
+ er as U,
3132
3134
  nn as V,
3133
3135
  tn as W,
3134
- yn as X,
3135
- ve as Y,
3136
- rr as Z,
3137
- cr as _,
3136
+ bn as X,
3137
+ sn as Y,
3138
+ ve as Z,
3139
+ ir as _,
3138
3140
  K as a,
3139
- sr as b,
3140
- Ln as c,
3141
- Zn as d,
3142
- ir as e,
3143
- lr as f,
3144
- Wn as g,
3145
- Gn as h,
3141
+ or as b,
3142
+ Dn as c,
3143
+ Qn as d,
3144
+ sr as e,
3145
+ ur as f,
3146
+ Jn as g,
3147
+ Un as h,
3146
3148
  Hn as i,
3147
- Bn as j,
3148
- cn as k,
3149
- nr as l,
3149
+ Wn as j,
3150
+ ln as k,
3151
+ rr as l,
3150
3152
  N as m,
3151
3153
  Xn as n,
3152
- $n as o,
3153
- ar as p,
3154
- Kn as q,
3155
- or as r,
3156
- qn as s,
3157
- er as t,
3158
- tr as u,
3159
- Yn as v,
3160
- q as w,
3161
- ee as x,
3162
- ut as y,
3163
- At as z
3154
+ Rn as o,
3155
+ cr as p,
3156
+ Zn as q,
3157
+ ar as r,
3158
+ Yn as s,
3159
+ q as t,
3160
+ ee as u,
3161
+ ut as v,
3162
+ At as w,
3163
+ P as x,
3164
+ tr as y,
3165
+ nr as z
3164
3166
  };