@graphty/graphty-element 2.5.0 → 2.5.1

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 (40) hide show
  1. package/dist/ai.js +3 -3
  2. package/dist/catalog.js +6 -6
  3. package/dist/chunks/{AiManager-DNJCoeTO.js → AiManager-CrbvKdEK.js} +5 -5
  4. package/dist/chunks/{DataSource-xL3Yn0Pa.js → DataSource-qU-nLhXN.js} +3 -3
  5. package/dist/chunks/{GraphSession-PFm2tJ_j.js → GraphSession-DuAhRgCd.js} +863 -856
  6. package/dist/chunks/{GraphtyLogger-kbOx2zq3.js → GraphtyLogger-DOTwCiMR.js} +1 -1
  7. package/dist/chunks/{VoiceInputAdapter-CDNKQgUK.js → VoiceInputAdapter-D4NrRL_1.js} +1 -1
  8. package/dist/chunks/{XRPivotCameraController-JdlLBcD7.js → XRPivotCameraController-Uqa47vmo.js} +2 -2
  9. package/dist/chunks/{algorithms-B87OPYw4.js → algorithms-D-ab-Auu.js} +2 -2
  10. package/dist/chunks/{capability-check-B2oYf_30.js → capability-check-Vw3IcqiE.js} +1 -1
  11. package/dist/chunks/detect-B4Qrw976.js +88 -0
  12. package/dist/chunks/{format-detection-BG6CMwPO.js → format-detection-r2IfNFXO.js} +1 -1
  13. package/dist/chunks/{index-6GDfNfwJ.js → index-J9MgLio9.js} +104 -83
  14. package/dist/chunks/{optionsFromZod-DHLLiX_8.js → optionsFromZod-B9RncoTX.js} +183 -178
  15. package/dist/chunks/{paletteRegistry-jg9uS7wo.js → paletteRegistry-Kt-6CeoN.js} +19 -13
  16. package/dist/chunks/{pluginRegistry-MaTIDh6l.js → pluginRegistry-Bs8bEkz9.js} +3 -2
  17. package/dist/chunks/{registry-DQeq4B2K.js → registry-BdGvyZou.js} +1 -1
  18. package/dist/chunks/{scales-BXHmwPXC.js → scales-CJCRwi2J.js} +4 -4
  19. package/dist/custom-elements.json +1 -1
  20. package/dist/extend.js +7 -7
  21. package/dist/graphty-catalog.json +4 -3
  22. package/dist/graphty.bundle.js +15837 -15793
  23. package/dist/graphty.js +6 -6
  24. package/dist/index.d.ts +1 -1
  25. package/dist/logging.js +2 -2
  26. package/dist/session.js +5 -5
  27. package/dist/src/Graph.d.ts +3 -3
  28. package/dist/src/catalog/formats.d.ts +5 -1
  29. package/dist/src/catalog/types.d.ts +13 -2
  30. package/dist/src/errors/codes.d.ts +7 -0
  31. package/dist/src/events.d.ts +35 -2
  32. package/dist/src/managers/EventManager.d.ts +4 -0
  33. package/dist/src/managers/LayoutManager.d.ts +7 -0
  34. package/dist/src/session/results/types.d.ts +26 -0
  35. package/dist/src/session/styles/StylesApi.d.ts +6 -5
  36. package/dist/src/session/styles/explain.d.ts +3 -3
  37. package/dist/src/session/types.d.ts +12 -1
  38. package/dist/webgpu.js +2 -2
  39. package/package.json +6 -6
  40. package/dist/chunks/detect-tuYQLJbT.js +0 -88
@@ -1,6 +1,6 @@
1
- import { c as he, G as y, S as Ie } from "./pluginRegistry-MaTIDh6l.js";
1
+ import { c as he, G as y, S as Ie } from "./pluginRegistry-Bs8bEkz9.js";
2
2
  import { K as Te, f as Me } from "./types-C_c53VgR.js";
3
- import { b as _e } from "./GraphtyLogger-kbOx2zq3.js";
3
+ import { b as _e } from "./GraphtyLogger-DOTwCiMR.js";
4
4
  import { Graph as ze, accelerated as X } from "@graphty/algorithms";
5
5
  import { INVALID_INDEX as L } from "@graphty/graph-format";
6
6
  import { z as me } from "zod/v4";
@@ -11,7 +11,7 @@ const _ = he({
11
11
  implementationOf: (e) => e.compute,
12
12
  builtInIds: () => Te
13
13
  });
14
- function bn(e, t) {
14
+ function wn(e, t) {
15
15
  const n = e.descriptor;
16
16
  if (n === void 0 || typeof n != "object")
17
17
  throw new y({
@@ -43,13 +43,13 @@ function bn(e, t) {
43
43
  });
44
44
  _.register(e, t);
45
45
  }
46
- function wn() {
46
+ function vn() {
47
47
  return _.descriptors();
48
48
  }
49
- function vn(e) {
49
+ function On(e) {
50
50
  return _.byId(e);
51
51
  }
52
- function On() {
52
+ function kn() {
53
53
  _.clearForTesting();
54
54
  }
55
55
  const Ce = ["forceAtlas2", "fruchtermanReingold", "springElectrical", "release"], xe = [
@@ -60,7 +60,7 @@ const Ce = ["forceAtlas2", "fruchtermanReingold", "springElectrical", "release"]
60
60
  "weaklyConnectedComponents",
61
61
  "minimumSpanningTree"
62
62
  ];
63
- function kn(e) {
63
+ function Nn(e) {
64
64
  const t = {
65
65
  kind: e.backend
66
66
  };
@@ -80,11 +80,11 @@ function je(e) {
80
80
  }
81
81
  return t;
82
82
  }
83
- const Pe = ["auto", "off", "required"], Nn = "auto";
84
- function Sn(e) {
83
+ const Pe = ["auto", "off", "required"], Sn = "auto";
84
+ function An(e) {
85
85
  return typeof e == "string" && Pe.includes(e);
86
86
  }
87
- const Le = "f64", An = "f32", $n = "acceleration.minNodes", Rn = 0, En = "RTX 4070 SUPER, headless Chromium, 2026-09-25", Fn = Object.freeze({
87
+ const Le = "f64", $n = "f32", Rn = "acceleration.minNodes", En = 0, Fn = "RTX 4070 SUPER, headless Chromium, 2026-09-25", In = Object.freeze({
88
88
  breadthFirstSearch: 3e5,
89
89
  sssp: 3e5,
90
90
  pageRank: 5e3,
@@ -112,13 +112,13 @@ function De(e, t) {
112
112
  });
113
113
  z.register(e, t);
114
114
  }
115
- function In() {
115
+ function Tn() {
116
116
  return z.descriptors();
117
117
  }
118
- function Tn(e) {
118
+ function Mn(e) {
119
119
  return z.byId(e);
120
120
  }
121
- function Mn() {
121
+ function _n() {
122
122
  z.clearForTesting();
123
123
  }
124
124
  class b extends Error {
@@ -193,14 +193,14 @@ function He(e, t) {
193
193
  }
194
194
  return n;
195
195
  }
196
- function _n(e) {
196
+ function zn(e) {
197
197
  return e;
198
198
  }
199
199
  function Be(e, t) {
200
200
  const n = e.getSnapshot(), r = t === "directed" ? n : e.undirected(n).snapshot, i = r.flags.multigraph ? r.simplified({ weights: "sum" }).snapshot : r;
201
201
  return Ve(i, t);
202
202
  }
203
- function zn(e) {
203
+ function Cn(e) {
204
204
  const t = e.getSnapshot();
205
205
  return t.flags.multigraph ? t.edgeCount - t.simplified({ weights: "sum" }).snapshot.edgeCount : 0;
206
206
  }
@@ -564,7 +564,7 @@ function nt(e, t) {
564
564
  return te(n, t);
565
565
  }
566
566
  }
567
- function Cn(e, t) {
567
+ function xn(e, t) {
568
568
  const n = t === "node", r = n ? e.nodeValue : e.edgeValue, i = n ? e.nodeHas : e.edgeHas, s = n ? e.nodeIdOf : e.edgeIdOf;
569
569
  return {
570
570
  value: r,
@@ -941,11 +941,11 @@ function bt(e) {
941
941
  return !1;
942
942
  return !0;
943
943
  }
944
- function xn(e, t) {
944
+ function jn(e, t) {
945
945
  const { has: n } = e;
946
946
  return (r) => n(r, t);
947
947
  }
948
- function jn(e, t) {
948
+ function Pn(e, t) {
949
949
  const { idOf: n } = e;
950
950
  if (n === null)
951
951
  throw new y({
@@ -956,7 +956,7 @@ function jn(e, t) {
956
956
  });
957
957
  return (r) => t.has(n(r));
958
958
  }
959
- function Pn(e, t, n) {
959
+ function Ln(e, t, n) {
960
960
  const { value: r } = e;
961
961
  return (i) => {
962
962
  const s = n();
@@ -966,7 +966,7 @@ function Pn(e, t, n) {
966
966
  return typeof o == "number" && Number.isFinite(o) && o >= s;
967
967
  };
968
968
  }
969
- function Ln(e, t) {
969
+ function Dn(e, t) {
970
970
  const n = ht(e), r = [];
971
971
  if ($(n, r), r.length === 0) {
972
972
  let i = n;
@@ -986,7 +986,14 @@ const H = "results", wt = "$";
986
986
  function T(e, t) {
987
987
  return t === void 0 ? `${H}.${e}` : `${H}.${e}.${t}`;
988
988
  }
989
- const be = {
989
+ function vt(e) {
990
+ return `Group ${String(e)}`;
991
+ }
992
+ function be(e, t) {
993
+ const n = Number(e), r = Number(t);
994
+ return Number.isFinite(n) && Number.isFinite(r) && String(n) === String(e) && String(r) === String(t) ? n - r : String(e).localeCompare(String(t));
995
+ }
996
+ const we = {
990
997
  // -- per element ---------------------------------------------------------------------
991
998
  value: {
992
999
  meaning: "The number this metric measured for this element.",
@@ -1154,7 +1161,7 @@ const be = {
1154
1161
  scope: "graph",
1155
1162
  types: ["number"]
1156
1163
  }
1157
- }, Dn = Object.keys(be), J = {
1164
+ }, Gn = Object.keys(we), J = {
1158
1165
  "node-metric": {
1159
1166
  shape: "node-metric",
1160
1167
  primaryField: "value",
@@ -1274,10 +1281,10 @@ const be = {
1274
1281
  function B(e) {
1275
1282
  return J[e];
1276
1283
  }
1277
- function Gn(e) {
1284
+ function Un(e) {
1278
1285
  return J[e].layer === "highlight";
1279
1286
  }
1280
- function Un(e, t) {
1287
+ function Hn(e, t) {
1281
1288
  const n = J[e], r = [], i = [
1282
1289
  { names: n.nodeFields, kind: "node" },
1283
1290
  { names: n.edgeFields, kind: "edge" },
@@ -1294,25 +1301,25 @@ function Un(e, t) {
1294
1301
  });
1295
1302
  continue;
1296
1303
  }
1297
- const c = be[a].types;
1304
+ const c = we[a].types;
1298
1305
  c.includes(u.type) || r.push({
1299
1306
  field: a,
1300
1307
  kind: o,
1301
1308
  reason: `${o} field "${a}" is typed "${u.type}", not ${c.map((h) => `"${h}"`).join(" or ")}`
1302
1309
  });
1303
1310
  }
1304
- return n.headlineScalar && !vt(n, t) && r.push({
1311
+ return n.headlineScalar && !Ot(n, t) && r.push({
1305
1312
  field: null,
1306
1313
  kind: "graph",
1307
1314
  reason: `shape "${e}" requires one graph-level scalar of its own beside "count"`
1308
1315
  }), r;
1309
1316
  }
1310
- function vt(e, t) {
1317
+ function Ot(e, t) {
1311
1318
  const n = [...e.graphFields, ...e.optionalGraphFields];
1312
1319
  return t.some((r) => r.kind === "graph" && !n.includes(r.name));
1313
1320
  }
1314
- const Ot = 3;
1315
- function kt(e, t) {
1321
+ const kt = 3;
1322
+ function Nt(e, t) {
1316
1323
  if (e === t)
1317
1324
  return 0;
1318
1325
  const n = new Uint32Array(t.length + 1), r = new Uint32Array(t.length + 1);
@@ -1328,23 +1335,23 @@ function kt(e, t) {
1328
1335
  }
1329
1336
  return n[t.length];
1330
1337
  }
1331
- function Nt(e, t, n = Ot) {
1338
+ function St(e, t, n = kt) {
1332
1339
  const r = e.toLowerCase(), i = t.map((s) => ({
1333
1340
  candidate: s,
1334
- distance: kt(r, s.toLowerCase())
1341
+ distance: Nt(r, s.toLowerCase())
1335
1342
  }));
1336
1343
  return i.sort((s, o) => s.distance - o.distance || s.candidate.localeCompare(o.candidate)), Object.freeze(i.slice(0, Math.max(n, 0)).map((s) => s.candidate));
1337
1344
  }
1338
1345
  function se(e) {
1339
1346
  return typeof e == "string" ? e : "runId" in e ? e.runId : e.id;
1340
1347
  }
1341
- function St(e) {
1348
+ function At(e) {
1342
1349
  return typeof e == "string" ? void 0 : e.shape;
1343
1350
  }
1344
- function At(e, t) {
1351
+ function $t(e, t) {
1345
1352
  return e.fields.some((n) => n.name === t) || t in e.graph;
1346
1353
  }
1347
- class $t {
1354
+ class Rt {
1348
1355
  #e;
1349
1356
  /**
1350
1357
  * Build the API over a registry.
@@ -1368,7 +1375,7 @@ class $t {
1368
1375
  const r = se(t);
1369
1376
  if (n !== void 0)
1370
1377
  return T(r, n);
1371
- const i = St(t) ?? this.#e.entry(r)?.shape, s = i === void 0 ? null : B(i).primaryField;
1378
+ const i = At(t) ?? this.#e.entry(r)?.shape, s = i === void 0 ? null : B(i).primaryField;
1372
1379
  return s === null ? T(r) : T(r, s);
1373
1380
  }
1374
1381
  /**
@@ -1406,7 +1413,7 @@ class $t {
1406
1413
  */
1407
1414
  has(t, n) {
1408
1415
  const r = this.get(t);
1409
- return r === void 0 ? !1 : n === void 0 || At(r, n);
1416
+ return r === void 0 ? !1 : n === void 0 || $t(r, n);
1410
1417
  }
1411
1418
  /**
1412
1419
  * Every run that has published a result, as an expression editor reads them.
@@ -1419,20 +1426,20 @@ class $t {
1419
1426
  return Object.freeze(t);
1420
1427
  }
1421
1428
  }
1422
- function Hn(e) {
1423
- return new $t(e);
1429
+ function Bn(e) {
1430
+ return new Rt(e);
1424
1431
  }
1425
- const Rt = 20, j = 100, Et = 100, Ft = Object.freeze([]), It = Object.freeze(["max", "min-max", "none"]);
1426
- function we(e) {
1427
- return typeof e == "string" && It.includes(e);
1432
+ const Et = 20, j = 100, Ft = 100, It = Object.freeze([]), Tt = Object.freeze(["max", "min-max", "none"]);
1433
+ function ve(e) {
1434
+ return typeof e == "string" && Tt.includes(e);
1428
1435
  }
1429
- function Bn(e) {
1436
+ function Vn(e) {
1430
1437
  return {
1431
1438
  length: e.length,
1432
1439
  get: (t) => e[t]
1433
1440
  };
1434
1441
  }
1435
- const Tt = Object.freeze({
1442
+ const Mt = Object.freeze({
1436
1443
  measured: 0,
1437
1444
  min: Number.NaN,
1438
1445
  max: Number.NaN,
@@ -1441,7 +1448,7 @@ const Tt = Object.freeze({
1441
1448
  tiedAtMin: 0,
1442
1449
  smallestPositive: null
1443
1450
  });
1444
- function ve(e) {
1451
+ function Oe(e) {
1445
1452
  const { length: t } = e, n = new Float64Array(t);
1446
1453
  let r = 0;
1447
1454
  for (let l = 0; l < t; l++) {
@@ -1449,7 +1456,7 @@ function ve(e) {
1449
1456
  Number.isFinite(d) && (n[r] = d, r++);
1450
1457
  }
1451
1458
  if (r === 0)
1452
- return { length: t, ...Tt };
1459
+ return { length: t, ...Mt };
1453
1460
  let i = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY, o = Number.POSITIVE_INFINITY, a = 0, u = 0;
1454
1461
  for (let l = 0; l < r; l++) {
1455
1462
  const d = n[l];
@@ -1472,8 +1479,8 @@ function ve(e) {
1472
1479
  smallestPositive: Number.isFinite(o) ? o : null
1473
1480
  };
1474
1481
  }
1475
- function Oe(e) {
1476
- const t = ve(e);
1482
+ function ke(e) {
1483
+ const t = Oe(e);
1477
1484
  return { view: Object.freeze({
1478
1485
  length: e.length,
1479
1486
  get: (r) => e.get(r),
@@ -1501,7 +1508,7 @@ function q(e) {
1501
1508
  }
1502
1509
  return Object.freeze(r);
1503
1510
  }
1504
- function Mt(e, t) {
1511
+ function _t(e, t) {
1505
1512
  let n = Math.min(t, e.length);
1506
1513
  for (; n > 0 && n < e.length && e[n].rank === e[n - 1].rank; )
1507
1514
  n--;
@@ -1518,17 +1525,17 @@ function Mt(e, t) {
1518
1525
  reason: o
1519
1526
  });
1520
1527
  }
1521
- function _t(e) {
1528
+ function zt(e) {
1522
1529
  const { smallestPositive: t } = e;
1523
1530
  if (e.measured === 0 || !(e.max > 0) || t === null)
1524
1531
  return !1;
1525
1532
  const n = e.min > 0 ? e.min : t;
1526
1533
  return Math.log10(e.max) > Math.log10(n);
1527
1534
  }
1528
- function zt(e) {
1529
- return e.measured === 0 || !(e.median > 0) || e.max / e.median <= Et ? "linear" : _t(e) ? "log" : "linear";
1535
+ function Ct(e) {
1536
+ return e.measured === 0 || !(e.median > 0) || e.max / e.median <= Ft ? "linear" : zt(e) ? "log" : "linear";
1530
1537
  }
1531
- function Ct(e, t, n, r) {
1538
+ function xt(e, t, n, r) {
1532
1539
  if (!(t > e))
1533
1540
  return { binCount: 1, indexOf: () => 0, rangeOf: () => [e, t] };
1534
1541
  if (r) {
@@ -1552,7 +1559,7 @@ function Ct(e, t, n, r) {
1552
1559
  ]
1553
1560
  };
1554
1561
  }
1555
- function xt(e, t, n, r, i) {
1562
+ function jt(e, t, n, r, i) {
1556
1563
  const s = e > 0 ? 0 : 1, o = s === 0 ? e : n;
1557
1564
  if (!(t > 0) || o === null || !(o > 0))
1558
1565
  return null;
@@ -1582,9 +1589,9 @@ function xt(e, t, n, r, i) {
1582
1589
  }
1583
1590
  };
1584
1591
  }
1585
- function jt(e) {
1592
+ function Pt(e) {
1586
1593
  if (e === void 0)
1587
- return Rt;
1594
+ return Et;
1588
1595
  if (!Number.isInteger(e) || e < 1 || e > j)
1589
1596
  throw new y({
1590
1597
  code: "E_OPTION_RANGE",
@@ -1594,7 +1601,7 @@ function jt(e) {
1594
1601
  });
1595
1602
  return e;
1596
1603
  }
1597
- function Pt(e, t) {
1604
+ function Lt(e, t) {
1598
1605
  const n = /* @__PURE__ */ new Map();
1599
1606
  for (let r = 0; r < e.length; r++) {
1600
1607
  const i = e.get(r);
@@ -1611,12 +1618,12 @@ function Pt(e, t) {
1611
1618
  }
1612
1619
  return n;
1613
1620
  }
1614
- function Lt(e, t) {
1615
- const n = jt(t?.bins), r = t?.integerValued ?? !1, i = ve(e), s = zt(i), o = Pt(e, n);
1621
+ function Dt(e, t) {
1622
+ const n = Pt(t?.bins), r = t?.integerValued ?? !1, i = Oe(e), s = Ct(i), o = Lt(e, n);
1616
1623
  if (o !== null) {
1617
1624
  if (o.size === 0)
1618
1625
  return Object.freeze({
1619
- bins: Ft,
1626
+ bins: It,
1620
1627
  // Nothing was measured, so nothing is on any axis. Reported as linear rather
1621
1628
  // than as the request, because "log scale" over an empty chart is the same false
1622
1629
  // caption this whole return type exists to prevent.
@@ -1635,7 +1642,7 @@ function Lt(e, t) {
1635
1642
  binning: "per-value"
1636
1643
  });
1637
1644
  }
1638
- const u = t?.scale === "log" || t?.scale === "auto" && s === "log" ? xt(i.min, i.max, i.smallestPositive, n, r) : null, c = u ?? Ct(i.min, i.max, n, r), h = new Array(c.binCount).fill(0);
1645
+ const u = t?.scale === "log" || t?.scale === "auto" && s === "log" ? jt(i.min, i.max, i.smallestPositive, n, r) : null, c = u ?? xt(i.min, i.max, n, r), h = new Array(c.binCount).fill(0);
1639
1646
  for (let p = 0; p < e.length; p++) {
1640
1647
  const l = e.get(p);
1641
1648
  Number.isFinite(l) && (h[c.indexOf(l)] += 1);
@@ -1654,7 +1661,7 @@ function Lt(e, t) {
1654
1661
  binning: "banded"
1655
1662
  });
1656
1663
  }
1657
- const Dt = 10, Gt = 10;
1664
+ const Gt = 10, Ut = 10;
1658
1665
  function oe(e) {
1659
1666
  const t = { ids: [], records: [], index: /* @__PURE__ */ new Map() };
1660
1667
  if (e === void 0)
@@ -1673,13 +1680,13 @@ function V(e, t) {
1673
1680
  const { records: n } = e;
1674
1681
  return {
1675
1682
  length: n.length,
1676
- get: (r) => ke(n[r][t])
1683
+ get: (r) => Ne(n[r][t])
1677
1684
  };
1678
1685
  }
1679
1686
  function Y(e, t) {
1680
- return e.ids.map((n, r) => ({ id: n, value: ke(e.records[r][t]) }));
1687
+ return e.ids.map((n, r) => ({ id: n, value: Ne(e.records[r][t]) }));
1681
1688
  }
1682
- function ke(e) {
1689
+ function Ne(e) {
1683
1690
  return typeof e == "number" ? e : Number.NaN;
1684
1691
  }
1685
1692
  function W(e) {
@@ -1694,7 +1701,7 @@ function g(e, t, n) {
1694
1701
  function M(e, t, n) {
1695
1702
  e[t] === void 0 && (e[t] = n);
1696
1703
  }
1697
- function Ne(e, t) {
1704
+ function Se(e, t) {
1698
1705
  const n = /* @__PURE__ */ new Map();
1699
1706
  for (const r of e.records) {
1700
1707
  const i = r[t];
@@ -1702,20 +1709,16 @@ function Ne(e, t) {
1702
1709
  }
1703
1710
  return n;
1704
1711
  }
1705
- function Se(e, t) {
1706
- const n = String(e), r = String(t);
1707
- return n === r ? 0 : n < r ? -1 : 1;
1708
- }
1709
- function Ut(e) {
1712
+ function Ht(e) {
1710
1713
  const t = [...e.entries()].map(([n, r]) => ({ group: n, size: r }));
1711
- return t.sort((n, r) => r.size - n.size || Se(n.group, r.group)), Object.freeze(t.map((n) => Object.freeze(n)));
1714
+ return t.sort((n, r) => r.size - n.size || be(n.group, r.group)), Object.freeze(t.map((n) => Object.freeze(n)));
1712
1715
  }
1713
1716
  function Ae(e, t) {
1714
1717
  const n = e.find((r) => r.name === t)?.normalization;
1715
- return we(n) ? n : "none";
1718
+ return ve(n) ? n : "none";
1716
1719
  }
1717
1720
  function ae(e, t, n) {
1718
- const { statistics: r } = Oe(V(e, "value"));
1721
+ const { statistics: r } = ke(V(e, "value"));
1719
1722
  for (const i of q(Y(e, "value"))) {
1720
1723
  const s = e.index.get(i.id);
1721
1724
  s !== void 0 && (M(e.records[s], "rank", i.rank), M(e.records[s], "percentile", i.percentile));
@@ -1723,23 +1726,23 @@ function ae(e, t, n) {
1723
1726
  r.measured > 0 && (g(t, "min", r.min), g(t, "max", r.max), g(t, "median", r.median), g(t, "mean", r.mean)), g(t, "measured", r.measured), g(t, "tiedAtMin", r.tiedAtMin), g(t, "normalization", Ae(n, "value"));
1724
1727
  }
1725
1728
  function ce(e, t, n, r, i) {
1726
- const s = Ne(e, n);
1729
+ const s = Se(e, n);
1727
1730
  for (const o of e.records) {
1728
1731
  const a = o[n];
1729
1732
  W(a) && M(o, r, s.get(a));
1730
1733
  }
1731
- g(t, i, s.size), g(t, "sizes", Ut(s));
1734
+ g(t, i, s.size), g(t, "sizes", Ht(s));
1732
1735
  }
1733
- function Ht(e, t) {
1736
+ function Bt(e, t) {
1734
1737
  for (const r of q(Y(e, "score"))) {
1735
1738
  const i = e.index.get(r.id);
1736
1739
  i !== void 0 && M(e.records[i], "rank", r.rank);
1737
1740
  }
1738
- const n = [...Ne(e, "category").entries()].map(([r, i]) => ({
1741
+ const n = [...Se(e, "category").entries()].map(([r, i]) => ({
1739
1742
  category: String(r),
1740
1743
  count: i
1741
1744
  }));
1742
- n.sort((r, i) => i.count - r.count || Se(r.category, i.category)), g(t, "categories", Object.freeze(n.map((r) => Object.freeze(r))));
1745
+ n.sort((r, i) => i.count - r.count || be(r.category, i.category)), g(t, "categories", Object.freeze(n.map((r) => Object.freeze(r))));
1743
1746
  }
1744
1747
  function F(e, t) {
1745
1748
  let n = 0;
@@ -1753,7 +1756,7 @@ function ue(e, t) {
1753
1756
  r[t] !== void 0 && n++;
1754
1757
  return n;
1755
1758
  }
1756
- function Bt(e, t, n, r, i) {
1759
+ function Vt(e, t, n, r, i) {
1757
1760
  switch (e) {
1758
1761
  case "node-metric":
1759
1762
  ae(t, r, i);
@@ -1768,7 +1771,7 @@ function Bt(e, t, n, r, i) {
1768
1771
  ce(t, r, "level", "levelSize", "levelCount");
1769
1772
  break;
1770
1773
  case "category-table":
1771
- Ht(t, r);
1774
+ Bt(t, r);
1772
1775
  break;
1773
1776
  case "path":
1774
1777
  g(r, "length", F(t, "onPath")), g(r, "hops", F(n, "onPath"));
@@ -1781,7 +1784,7 @@ function Bt(e, t, n, r, i) {
1781
1784
  break;
1782
1785
  }
1783
1786
  }
1784
- function Vt(e) {
1787
+ function Jt(e) {
1785
1788
  switch (e) {
1786
1789
  case "node-metric":
1787
1790
  case "edge-metric":
@@ -1794,20 +1797,20 @@ function Vt(e) {
1794
1797
  return null;
1795
1798
  }
1796
1799
  }
1797
- function Jt(e, t) {
1800
+ function qt(e, t, n) {
1798
1801
  if (!Array.isArray(e))
1799
1802
  return;
1800
- const n = [];
1801
- for (const r of e) {
1802
- if (typeof r != "object" || r === null)
1803
+ const r = [];
1804
+ for (const i of e) {
1805
+ if (typeof i != "object" || i === null)
1803
1806
  continue;
1804
- const i = r, s = i.group ?? i.category, o = i.size ?? i.count;
1805
- if (W(s) && typeof o == "number" && n.push(Object.freeze({ group: s, size: o })), n.length === t)
1807
+ const s = i, o = s.group ?? s.category, a = s.size ?? s.count;
1808
+ if (W(o) && typeof a == "number" && r.push(Object.freeze(n ? { group: o, size: a, name: vt(r.length + 1) } : { group: o, size: a })), r.length === t)
1806
1809
  break;
1807
1810
  }
1808
- return Object.freeze(n);
1811
+ return Object.freeze(r);
1809
1812
  }
1810
- class qt {
1813
+ class Yt {
1811
1814
  #e;
1812
1815
  #t;
1813
1816
  #n;
@@ -1893,7 +1896,7 @@ class qt {
1893
1896
  const r = `${String(n)}:${t}`, i = this.#c.get(r);
1894
1897
  if (i !== void 0)
1895
1898
  return i;
1896
- const s = Mt(this.ranking(t), this.#l(n, "n"));
1899
+ const s = _t(this.ranking(t), this.#l(n, "n"));
1897
1900
  return this.#c.set(r, s), s;
1898
1901
  }
1899
1902
  /**
@@ -1928,7 +1931,7 @@ class qt {
1928
1931
  */
1929
1932
  histogram(t, n) {
1930
1933
  const r = this.#d(t), i = r.kind === "edge" ? this.#t : this.#e;
1931
- return Lt(V(i, t), {
1934
+ return Dt(V(i, t), {
1932
1935
  ...n,
1933
1936
  integerValued: r.type === "integer"
1934
1937
  });
@@ -1984,7 +1987,7 @@ class qt {
1984
1987
  code: "E_UNKNOWN_ATTRIBUTE",
1985
1988
  source: "run",
1986
1989
  message: `Run "${this.runId}" published no field named "${t}".`,
1987
- details: { field: t, available: i, candidates: Nt(t, i) },
1990
+ details: { field: t, available: i, candidates: St(t, i) },
1988
1991
  target: { kind: "run", id: this.runId }
1989
1992
  });
1990
1993
  if (!P(r))
@@ -2016,7 +2019,7 @@ class qt {
2016
2019
  const n = this.#o.get(t);
2017
2020
  if (n !== void 0)
2018
2021
  return n;
2019
- const r = Oe(V(this.#p(t), t));
2022
+ const r = ke(V(this.#p(t), t));
2020
2023
  return this.#o.set(t, r), r;
2021
2024
  }
2022
2025
  /**
@@ -2034,7 +2037,7 @@ class qt {
2034
2037
  * @returns The summary.
2035
2038
  */
2036
2039
  #g() {
2037
- const t = Vt(this.shape), n = t === null || this.#m(t) === null ? null : t, r = n === null ? null : this.#h(n).statistics, i = r !== null && r.measured > 0 ? r : null, s = n === null ? [] : this.ranking(n, Dt).map(
2040
+ const t = Jt(this.shape), n = t === null || this.#m(t) === null ? null : t, r = n === null ? null : this.#h(n).statistics, i = r !== null && r.measured > 0 ? r : null, s = n === null ? [] : this.ranking(n, Gt).map(
2038
2041
  (c) => Object.freeze({
2039
2042
  id: c.id,
2040
2043
  label: this.#i(c.id) ?? String(c.id),
@@ -2054,7 +2057,7 @@ class qt {
2054
2057
  top: Object.freeze(s),
2055
2058
  caveats: this.#n,
2056
2059
  durationMs: this.#r
2057
- }, a = this.graph.sizes ?? this.graph.categories, u = Jt(a, Gt);
2060
+ }, a = this.graph.sizes ?? this.graph.categories, u = qt(a, Ut, this.shape === "community");
2058
2061
  return Object.freeze(u === void 0 ? o : { ...o, groups: u });
2059
2062
  }
2060
2063
  /**
@@ -2088,19 +2091,19 @@ class qt {
2088
2091
  */
2089
2092
  #w(t) {
2090
2093
  const n = this.graph.normalization;
2091
- return we(n) ? n : t === null ? "none" : Ae(this.fields, t);
2094
+ return ve(n) ? n : t === null ? "none" : Ae(this.fields, t);
2092
2095
  }
2093
2096
  }
2094
- function Yt(e) {
2097
+ function Wt(e) {
2095
2098
  const t = oe(e.nodes), n = oe(e.edges), r = { ...e.graph };
2096
- Bt(e.shape, t, n, r, e.fields);
2099
+ Vt(e.shape, t, n, r, e.fields);
2097
2100
  for (const i of t.records)
2098
2101
  Object.freeze(i);
2099
2102
  for (const i of n.records)
2100
2103
  Object.freeze(i);
2101
- return new qt(e, t, n, Object.freeze(r));
2104
+ return new Yt(e, t, n, Object.freeze(r));
2102
2105
  }
2103
- function Wt(e) {
2106
+ function Kt(e) {
2104
2107
  const t = e.styles?.config.data.knownFields.nodeLabelPath ?? null;
2105
2108
  if (t === null)
2106
2109
  return;
@@ -2110,11 +2113,11 @@ function Wt(e) {
2110
2113
  return typeof i == "string" || typeof i == "number" ? String(i) : void 0;
2111
2114
  };
2112
2115
  }
2113
- function Vn(e) {
2116
+ function Jn(e) {
2114
2117
  return { exact: !0, precision: "f64", notes: [], ...e };
2115
2118
  }
2116
- const Kt = 1024, Zt = 16;
2117
- function Xt() {
2119
+ const Zt = 1024, Xt = 16;
2120
+ function Qt() {
2118
2121
  return {
2119
2122
  signal: new AbortController().signal,
2120
2123
  report: () => {
@@ -2124,15 +2127,15 @@ function Xt() {
2124
2127
  })
2125
2128
  };
2126
2129
  }
2127
- async function Jn(e, t, n, r) {
2130
+ async function qn(e, t, n, r) {
2128
2131
  const i = n.length;
2129
2132
  e.report({ phase: t, completed: 0, total: i });
2130
2133
  let s = performance.now();
2131
2134
  for (let o = 0; o < i; o++)
2132
- o > 0 && o % Kt === 0 && (e.signal.throwIfAborted(), e.report({ phase: t, completed: o, total: i }), performance.now() - s >= Zt && (await e.yieldNow(), s = performance.now())), r(n[o], o);
2135
+ o > 0 && o % Zt === 0 && (e.signal.throwIfAborted(), e.report({ phase: t, completed: o, total: i }), performance.now() - s >= Xt && (await e.yieldNow(), s = performance.now())), r(n[o], o);
2133
2136
  e.signal.throwIfAborted(), e.report({ phase: t, completed: i, total: i });
2134
2137
  }
2135
- function Qt(e, t, n) {
2138
+ function en(e, t, n) {
2136
2139
  const r = n?.find((s) => s.name === e.name && s.kind === e.kind), i = {
2137
2140
  name: e.name,
2138
2141
  plainName: r?.plainName ?? e.name,
@@ -2144,7 +2147,7 @@ function Qt(e, t, n) {
2144
2147
  };
2145
2148
  return e.normalization === void 0 ? i : { ...i, normalization: e.normalization };
2146
2149
  }
2147
- class qn extends D {
2150
+ class Yn extends D {
2148
2151
  /** What the last run published, kept so a caller holding the algorithm can read the result. */
2149
2152
  #e;
2150
2153
  /**
@@ -2195,7 +2198,7 @@ class qn extends D {
2195
2198
  * @returns A promise that settles when the result has been published.
2196
2199
  */
2197
2200
  async run() {
2198
- await this.computeRun(Xt(), this.type);
2201
+ await this.computeRun(Qt(), this.type);
2199
2202
  }
2200
2203
  /**
2201
2204
  * Compute on behalf of a run, and hand the result back.
@@ -2230,11 +2233,11 @@ class qn extends D {
2230
2233
  const i = Date.now(), s = await this.compute(t);
2231
2234
  if (s === null)
2232
2235
  return;
2233
- const o = this.graph.getDataManager(), a = Wt(this.graph), u = Yt({
2236
+ const o = this.graph.getDataManager(), a = Kt(this.graph), u = Wt({
2234
2237
  ...a === void 0 ? {} : { labelOf: a },
2235
2238
  runId: n,
2236
2239
  shape: s.shape,
2237
- fields: s.fields.map((c) => Qt(c, n, r)),
2240
+ fields: s.fields.map((c) => en(c, n, r)),
2238
2241
  measured: { nodes: o.nodes.size, edges: o.edges.size },
2239
2242
  graph: s.graph,
2240
2243
  nodes: s.nodes,
@@ -2245,7 +2248,7 @@ class qn extends D {
2245
2248
  return this.#e = u, u;
2246
2249
  }
2247
2250
  }
2248
- function Yn(e, t = "number") {
2251
+ function Wn(e, t = "number") {
2249
2252
  return [
2250
2253
  { name: "value", kind: e, type: t },
2251
2254
  { name: "rank", kind: e, type: "integer" },
@@ -2265,15 +2268,15 @@ const le = [
2265
2268
  { name: "groupCount", kind: "graph", type: "integer" },
2266
2269
  { name: "sizes", kind: "graph", type: "table" }
2267
2270
  ];
2268
- function Wn(e) {
2271
+ function Kn(e) {
2269
2272
  return e ? [...le, { name: "modularity", kind: "graph", type: "number" }] : le;
2270
2273
  }
2271
- const Kn = [
2274
+ const Zn = [
2272
2275
  { name: "level", kind: "node", type: "integer" },
2273
2276
  { name: "levelSize", kind: "node", type: "integer" },
2274
2277
  { name: "levelCount", kind: "graph", type: "integer" },
2275
2278
  { name: "sizes", kind: "graph", type: "table" }
2276
- ], Zn = [
2279
+ ], Xn = [
2277
2280
  { name: "onPath", kind: "node", type: "boolean" },
2278
2281
  { name: "order", kind: "node", type: "integer" },
2279
2282
  { name: "onPath", kind: "edge", type: "boolean" },
@@ -2281,18 +2284,18 @@ const Kn = [
2281
2284
  { name: "cost", kind: "graph", type: "number" },
2282
2285
  { name: "hops", kind: "graph", type: "integer" }
2283
2286
  ];
2284
- function Xn(e, t) {
2287
+ function Qn(e, t) {
2285
2288
  return [
2286
2289
  { name: "in", kind: e, type: "boolean" },
2287
2290
  { name: "count", kind: "graph", type: "integer" },
2288
2291
  { ...t, kind: "graph" }
2289
2292
  ];
2290
2293
  }
2291
- const en = `${H}.${wt}`;
2294
+ const tn = `${H}.${wt}`;
2292
2295
  function O(e) {
2293
- return { ...e, path: `${en}.${e.name}` };
2296
+ return { ...e, path: `${tn}.${e.name}` };
2294
2297
  }
2295
- function Qn(e) {
2298
+ function er(e) {
2296
2299
  return [
2297
2300
  O({
2298
2301
  name: "value",
@@ -2337,28 +2340,28 @@ function Qn(e) {
2337
2340
  })
2338
2341
  ];
2339
2342
  }
2340
- const tn = 12;
2341
- function er(e, t = {}) {
2342
- return (nn(e) ? rn(e) : sn(e)).map((r) => {
2343
- const i = { ...r.meta, ...t.meta?.[r.name] }, s = r.node === null ? cn(r.name, i, r.failure ?? "the schema could not be converted") : an(r.name, r.node, i), o = t.overrides?.[r.name];
2343
+ const nn = 12;
2344
+ function tr(e, t = {}) {
2345
+ return (rn(e) ? sn(e) : on(e)).map((r) => {
2346
+ const i = { ...r.meta, ...t.meta?.[r.name] }, s = r.node === null ? un(r.name, i, r.failure ?? "the schema could not be converted") : cn(r.name, r.node, i), o = t.overrides?.[r.name];
2344
2347
  return o === void 0 ? s : { ...s, ...o };
2345
2348
  });
2346
2349
  }
2347
- function nn(e) {
2350
+ function rn(e) {
2348
2351
  return typeof e != "object" || e === null ? !1 : "_zod" in e || "_def" in e;
2349
2352
  }
2350
- function rn(e) {
2353
+ function sn(e) {
2351
2354
  const t = $e(e);
2352
2355
  if (t === null)
2353
2356
  return [];
2354
2357
  const { properties: n } = t;
2355
2358
  return n === void 0 ? [] : Object.entries(n).map(([r, i]) => ({ name: r, node: Re(i, t) }));
2356
2359
  }
2357
- function sn(e) {
2360
+ function on(e) {
2358
2361
  const t = Object.entries(e), n = {};
2359
2362
  for (const [s, o] of t)
2360
2363
  n[s] = o.schema;
2361
- const r = on(n), i = r?.properties;
2364
+ const r = an(n), i = r?.properties;
2362
2365
  return t.map(([s, o]) => {
2363
2366
  const a = i?.[s];
2364
2367
  return r === null || a === void 0 ? {
@@ -2376,7 +2379,7 @@ function $e(e) {
2376
2379
  return null;
2377
2380
  }
2378
2381
  }
2379
- function on(e) {
2382
+ function an(e) {
2380
2383
  try {
2381
2384
  return $e(me.object(e));
2382
2385
  } catch {
@@ -2391,8 +2394,8 @@ function Re(e, t) {
2391
2394
  const r = n.slice(de.length).replaceAll("~1", "/").replaceAll("~0", "~");
2392
2395
  return t.$defs?.[r] ?? e;
2393
2396
  }
2394
- function an(e, t, n) {
2395
- const r = Ee(t, 0), i = un(r), s = {
2397
+ function cn(e, t, n) {
2398
+ const r = Ee(t, 0), i = ln(r), s = {
2396
2399
  name: e,
2397
2400
  plainName: n.label ?? K(e),
2398
2401
  technicalName: e,
@@ -2407,7 +2410,7 @@ function an(e, t, n) {
2407
2410
  const u = n.step ?? a?.multipleOf;
2408
2411
  return u !== void 0 && (s.step = u), i.values !== void 0 && (s.values = i.values), n.group !== void 0 && (s.group = n.group), n.advanced !== void 0 && (s.advanced = n.advanced), i.unsupportedReason !== void 0 && (s.unsupportedReason = i.unsupportedReason), s;
2409
2412
  }
2410
- function cn(e, t, n) {
2413
+ function un(e, t, n) {
2411
2414
  const r = {
2412
2415
  name: e,
2413
2416
  plainName: t.label ?? K(e),
@@ -2418,7 +2421,7 @@ function cn(e, t, n) {
2418
2421
  return t.description !== void 0 && (r.description = t.description), t.step !== void 0 && (r.step = t.step), t.group !== void 0 && (r.group = t.group), t.advanced !== void 0 && (r.advanced = t.advanced), r;
2419
2422
  }
2420
2423
  function Ee(e, t) {
2421
- if (t >= tn)
2424
+ if (t >= nn)
2422
2425
  return { arms: [], nullable: !1, unresolvedRef: !0 };
2423
2426
  if (e.$ref !== void 0)
2424
2427
  return { arms: [], nullable: !1, unresolvedRef: !0 };
@@ -2432,7 +2435,7 @@ function Ee(e, t) {
2432
2435
  }
2433
2436
  return r;
2434
2437
  }
2435
- function un(e) {
2438
+ function ln(e) {
2436
2439
  if (e.arms.length === 0)
2437
2440
  return e.unresolvedRef ? {
2438
2441
  type: "unknown",
@@ -2441,18 +2444,18 @@ function un(e) {
2441
2444
  type: "unknown",
2442
2445
  unsupportedReason: e.nullable ? "the only value the schema accepts is null" : "the schema declares no value type"
2443
2446
  };
2444
- const t = dn(e.arms);
2447
+ const t = pn(e.arms);
2445
2448
  if (t !== void 0)
2446
2449
  return { type: "enum", node: e.arms[0], values: t };
2447
2450
  if (e.arms.length === 1)
2448
- return ln(e.arms[0]);
2451
+ return dn(e.arms[0]);
2449
2452
  const n = e.arms.map((r) => Fe(r));
2450
2453
  return n.length === 2 && n.includes("string") && n.includes("number") ? { type: "node-id" } : {
2451
2454
  type: "unknown",
2452
2455
  unsupportedReason: `the schema is a union of ${n.join(" and ")}, which has no single control`
2453
2456
  };
2454
2457
  }
2455
- function ln(e) {
2458
+ function dn(e) {
2456
2459
  switch (Fe(e)) {
2457
2460
  case "integer":
2458
2461
  return { type: "integer", node: e };
@@ -2482,7 +2485,7 @@ function ln(e) {
2482
2485
  };
2483
2486
  }
2484
2487
  }
2485
- function dn(e) {
2488
+ function pn(e) {
2486
2489
  const t = [];
2487
2490
  for (const r of e)
2488
2491
  if (r.enum !== void 0)
@@ -2515,59 +2518,61 @@ function K(e) {
2515
2518
  return t === "" ? e : t.split(/\s+/u).map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ");
2516
2519
  }
2517
2520
  export {
2518
- Hn as $,
2521
+ vt as $,
2519
2522
  D as A,
2520
- Tn as B,
2523
+ Mn as B,
2521
2524
  Le as C,
2522
- An as D,
2523
- kn as E,
2524
- vn as F,
2525
- Wt as G,
2526
- Yt as H,
2527
- Rn as I,
2528
- $n as J,
2529
- Fn as K,
2530
- Kn as L,
2531
- En as M,
2532
- ve as N,
2525
+ $n as D,
2526
+ Nn as E,
2527
+ On as F,
2528
+ Kt as G,
2529
+ Wt as H,
2530
+ En as I,
2531
+ Rn as J,
2532
+ In as K,
2533
+ Zn as L,
2534
+ Fn as M,
2535
+ Oe as N,
2533
2536
  b as O,
2534
- Zn as P,
2535
- Bn as Q,
2536
- Dn as R,
2537
- Ln as S,
2538
- Cn as T,
2537
+ Xn as P,
2538
+ Vn as Q,
2539
+ Gn as R,
2540
+ Dn as S,
2541
+ xn as T,
2539
2542
  B as U,
2540
- Nt as V,
2541
- Pn as W,
2542
- jn as X,
2543
- Zt as Y,
2544
- xn as Z,
2545
- Gn as _,
2546
- qn as a,
2547
- zn as a0,
2548
- Mn as b,
2549
- Un as c,
2550
- On as d,
2551
- Wn as e,
2552
- Vn as f,
2553
- _n as g,
2554
- Jn as h,
2555
- Yn as i,
2556
- In as j,
2557
- wn as k,
2543
+ be as V,
2544
+ St as W,
2545
+ Ln as X,
2546
+ Xt as Y,
2547
+ Pn as Z,
2548
+ jn as _,
2549
+ Yn as a,
2550
+ Un as a0,
2551
+ Bn as a1,
2552
+ Cn as a2,
2553
+ _n as b,
2554
+ Hn as c,
2555
+ kn as d,
2556
+ Kn as e,
2557
+ Jn as f,
2558
+ zn as g,
2559
+ qn as h,
2560
+ Wn as i,
2561
+ Tn as j,
2562
+ vn as k,
2558
2563
  He as l,
2559
2564
  O as m,
2560
- Qn as n,
2561
- er as o,
2565
+ er as n,
2566
+ tr as o,
2562
2567
  Pe as p,
2563
- Nn as q,
2564
- bn as r,
2565
- Xn as s,
2568
+ Sn as q,
2569
+ wn as r,
2570
+ Qn as s,
2566
2571
  H as t,
2567
2572
  J as u,
2568
2573
  Ge as v,
2569
2574
  nt as w,
2570
- Sn as x,
2575
+ An as x,
2571
2576
  yt as y,
2572
2577
  T as z
2573
2578
  };