@graphty/graphty-element 2.3.1 → 2.4.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 (86) hide show
  1. package/AGENTS.md +4 -3
  2. package/dist/ai.js +3 -3
  3. package/dist/catalog.js +28 -27
  4. package/dist/chunks/{AiManager-BBmGJbH4.js → AiManager-DNJCoeTO.js} +5 -5
  5. package/dist/chunks/{DataSource-OeN3NeyD.js → DataSource-xL3Yn0Pa.js} +72 -61
  6. package/dist/chunks/{GraphSession-Bef1AYw9.js → GraphSession-PFm2tJ_j.js} +2942 -2822
  7. package/dist/chunks/{GraphtyLogger-5KEttFUo.js → GraphtyLogger-kbOx2zq3.js} +170 -222
  8. package/dist/chunks/{NodeStyle-DKj7HjMJ.js → NodeStyle-CtmA7dXi.js} +16 -14
  9. package/dist/chunks/{VoiceInputAdapter-Dr9Gcmds.js → VoiceInputAdapter-CDNKQgUK.js} +1 -1
  10. package/dist/chunks/{XRPivotCameraController-BbfgZWpS.js → XRPivotCameraController-JdlLBcD7.js} +146 -134
  11. package/dist/chunks/{algorithms-CpX56sUB.js → algorithms-B87OPYw4.js} +780 -635
  12. package/dist/chunks/{capability-check-Blhb2aBB.js → capability-check-B2oYf_30.js} +1 -1
  13. package/dist/chunks/{detect-Cqwshr9a.js → detect-tuYQLJbT.js} +2 -2
  14. package/dist/chunks/{format-detection-BXGO1lSn.js → format-detection-BG6CMwPO.js} +1 -1
  15. package/dist/chunks/{index-C0mIoumR.js → index-6GDfNfwJ.js} +3185 -2731
  16. package/dist/chunks/{optionsFromZod-17lkrAJs.js → optionsFromZod-DHLLiX_8.js} +275 -267
  17. package/dist/chunks/{paletteRegistry-x7WOEKZY.js → paletteRegistry-jg9uS7wo.js} +72 -70
  18. package/dist/chunks/pluginRegistry-MaTIDh6l.js +238 -0
  19. package/dist/chunks/{registry-CSba5QGJ.js → registry-DQeq4B2K.js} +8 -8
  20. package/dist/chunks/{scales-BRwl51k8.js → scales-BXHmwPXC.js} +572 -399
  21. package/dist/chunks/{types-B7bX5c0K.js → types-C_c53VgR.js} +31 -26
  22. package/dist/commands.d.ts +4 -0
  23. package/dist/custom-elements.json +1 -1
  24. package/dist/extend.js +8 -8
  25. package/dist/graphty-catalog.json +245 -12
  26. package/dist/graphty.bundle.js +37843 -36551
  27. package/dist/graphty.js +69 -65
  28. package/dist/index.d.ts +3 -0
  29. package/dist/logging.js +2 -2
  30. package/dist/schema.d.ts +1 -1
  31. package/dist/schema.js +42 -40
  32. package/dist/session.js +6 -6
  33. package/dist/src/Edge.d.ts +4 -4
  34. package/dist/src/Graph.d.ts +79 -7
  35. package/dist/src/acceleration/AccelerationController.d.ts +20 -3
  36. package/dist/src/acceleration/registry.d.ts +3 -0
  37. package/dist/src/acceleration/types.d.ts +85 -0
  38. package/dist/src/algorithms/Algorithm.d.ts +13 -0
  39. package/dist/src/algorithms/KCoreAlgorithm.d.ts +26 -0
  40. package/dist/src/algorithms/LinkPredictionAlgorithm.d.ts +41 -0
  41. package/dist/src/cameras/InputUtils.d.ts +67 -0
  42. package/dist/src/cameras/XRInputHandler.d.ts +0 -8
  43. package/dist/src/catalog/algorithms.d.ts +5 -5
  44. package/dist/src/catalog/index.d.ts +2 -2
  45. package/dist/src/catalog/layouts.d.ts +7 -6
  46. package/dist/src/catalog/pluginRegistry.d.ts +62 -0
  47. package/dist/src/catalog/registry.d.ts +7 -0
  48. package/dist/src/catalog/types.d.ts +77 -6
  49. package/dist/src/config/EdgeStyle.d.ts +35 -0
  50. package/dist/src/config/index.d.ts +1 -1
  51. package/dist/src/data/DataSource.d.ts +1 -1
  52. package/dist/src/data/GEXFDataSource.d.ts +23 -0
  53. package/dist/src/errors/codes.d.ts +16 -1
  54. package/dist/src/events.d.ts +30 -0
  55. package/dist/src/graphty-element.d.ts +66 -26
  56. package/dist/src/layout/GridLayoutEngine.d.ts +37 -0
  57. package/dist/src/layout/LayoutEngine.d.ts +7 -7
  58. package/dist/src/layout/NGraphLayoutEngine.d.ts +2 -0
  59. package/dist/src/layout/RadialLayoutEngine.d.ts +37 -0
  60. package/dist/src/layout/SimulationLayoutEngine.d.ts +12 -0
  61. package/dist/src/managers/DataManager.d.ts +69 -2
  62. package/dist/src/managers/EventManager.d.ts +10 -4
  63. package/dist/src/managers/GraphContext.d.ts +2 -1
  64. package/dist/src/managers/LayoutManager.d.ts +30 -3
  65. package/dist/src/meshes/CustomLineRenderer.d.ts +11 -9
  66. package/dist/src/meshes/EdgeMesh.d.ts +18 -9
  67. package/dist/src/meshes/FilledArrowRenderer.d.ts +61 -23
  68. package/dist/src/meshes/MeshCache.d.ts +18 -0
  69. package/dist/src/meshes/NodeEffects.d.ts +16 -11
  70. package/dist/src/meshes/NodeMesh.d.ts +2 -2
  71. package/dist/src/meshes/PatternedLineRenderer.d.ts +5 -37
  72. package/dist/src/meshes/PerSceneMaterials.d.ts +49 -0
  73. package/dist/src/meshes/RichTextParser.d.ts +26 -0
  74. package/dist/src/meshes/RichTextRenderer.d.ts +0 -1
  75. package/dist/src/session/cost/estimate.d.ts +1 -1
  76. package/dist/src/session/layout.d.ts +3 -3
  77. package/dist/src/session/runs/RunsApi.d.ts +1 -1
  78. package/dist/src/session/styles/StylesApi.d.ts +6 -0
  79. package/dist/src/session/styles/intern.d.ts +26 -5
  80. package/dist/src/session/styles/repaint.d.ts +2 -1
  81. package/dist/src/session/types.d.ts +6 -6
  82. package/dist/src/xr/XRSessionManager.d.ts +1 -1
  83. package/dist/webgpu.d.ts +8 -0
  84. package/dist/webgpu.js +2 -2
  85. package/package.json +6 -6
  86. package/dist/chunks/GraphtyError-BwcnblTH.js +0 -132
@@ -1,15 +1,15 @@
1
- import { arfLayout as Re, bfsLayout as ke, bipartiteLayout as ze, circularLayout as Fe, createSimulation as Le, seedPositions as Pe, resolveNodeVector as Te, kamadaKawaiLayout as We, multipartiteLayout as _e, planarLayout as Ae, randomLayout as Be, shellLayout as qe, spectralLayout as Ge, spiralLayout as je } from "@graphty/layout";
1
+ import { arfLayout as Le, bfsLayout as Te, bipartiteLayout as We, circularLayout as Ae, createSimulation as _e, seedPositions as Be, resolveNodeVector as Ge, gridLayout as qe, kamadaKawaiLayout as je, multipartiteLayout as Ue, planarLayout as He, radialLayout as Ke, randomLayout as Ve, shellLayout as Ye, spectralLayout as $e, spiralLayout as Je } from "@graphty/layout";
2
2
  import { z as i } from "zod/v4";
3
- import { a as y, S as v, L as ue, k as Ue, W as He, l as Ee, m as Ke, g as Ce } from "./paletteRegistry-x7WOEKZY.js";
4
- import { k as u, j as Ve } from "./algorithms-CpX56sUB.js";
5
- import { forceLink as Ye, forceSimulation as $e, forceManyBody as Je, forceCenter as Ze } from "d3-force-3d";
6
- import { makeMask as fe, maskSet as le } from "@graphty/graph-format";
7
- import { C as ce, E as Qe, o as Xe } from "./optionsFromZod-17lkrAJs.js";
8
- import { G as de } from "./GraphtyError-BwcnblTH.js";
9
- import et from "ngraph.forcelayout";
10
- import tt from "ngraph.graph";
11
- import { V as it, Y as st, g as nt, I as at, B as ot, G as rt, d as lt, O as be, i as ye, T as ve, P as xe, C as Se, h as ct, b as dt, R as ht, a as Ne, c as we, e as De } from "./sequential-Zym81qm7.js";
12
- const ut = u({
3
+ import { a as y, S as v, L as fe, k as Ze, W as Qe, l as ke, m as Xe, g as ze } from "./paletteRegistry-jg9uS7wo.js";
4
+ import { k as u, j as et } from "./algorithms-B87OPYw4.js";
5
+ import { forceLink as tt, forceSimulation as it, forceManyBody as st, forceCenter as nt } from "d3-force-3d";
6
+ import { makeMask as xe, maskSet as ue } from "@graphty/graph-format";
7
+ import { C as me, E as at, o as ot } from "./optionsFromZod-DHLLiX_8.js";
8
+ import { G as pe } from "./pluginRegistry-MaTIDh6l.js";
9
+ import rt from "ngraph.forcelayout";
10
+ import lt from "ngraph.graph";
11
+ import { V as ct, Y as dt, g as ht, I as ut, B as mt, G as pt, d as gt, O as Se, i as Ne, T as De, P as we, C as Oe, h as ft, b as bt, R as yt, a as Me, c as Ee, e as Ie } from "./sequential-Zym81qm7.js";
12
+ const vt = u({
13
13
  scalingFactor: {
14
14
  schema: i.number().min(1).max(1e3).default(100),
15
15
  meta: {
@@ -49,7 +49,7 @@ const ut = u({
49
49
  advanced: !0
50
50
  }
51
51
  }
52
- }), mt = i.strictObject({
52
+ }), xt = i.strictObject({
53
53
  ...v.shape,
54
54
  pos: i.record(i.number(), i.array(i.number())).or(i.null()).default(null),
55
55
  scaling: i.number().positive().default(1),
@@ -62,7 +62,7 @@ const ut = u({
62
62
  * @param opts - Configuration options for the ARF algorithm
63
63
  */
64
64
  constructor(e) {
65
- super(e), this.scalingFactor = 100, this.config = mt.parse(e);
65
+ super(e), this.scalingFactor = 100, this.config = xt.parse(e);
66
66
  }
67
67
  /**
68
68
  * Get dimension-specific options for ARF layout
@@ -78,7 +78,7 @@ const ut = u({
78
78
  doLayout() {
79
79
  this.stale = !1;
80
80
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
81
- this.positions = Re(
81
+ this.positions = Le(
82
82
  { nodes: e, edges: t },
83
83
  this.config.pos,
84
84
  this.config.scaling,
@@ -88,9 +88,9 @@ const ut = u({
88
88
  );
89
89
  }
90
90
  };
91
- k.type = "arf", k.maxDimensions = 2, k.zodOptionsSchema = ut;
92
- let U = k;
93
- const pt = u({
91
+ k.type = "arf", k.maxDimensions = 2, k.zodOptionsSchema = vt;
92
+ let K = k;
93
+ const St = u({
94
94
  scalingFactor: {
95
95
  schema: i.number().min(1).max(1e3).default(20),
96
96
  meta: {
@@ -120,7 +120,7 @@ const pt = u({
120
120
  step: 0.1
121
121
  }
122
122
  }
123
- }), gt = i.strictObject({
123
+ }), Nt = i.strictObject({
124
124
  ...v.shape,
125
125
  start: i.number().or(i.string()),
126
126
  align: i.enum(["vertical", "horizontal"]).default("vertical"),
@@ -132,7 +132,7 @@ const pt = u({
132
132
  * @param opts - Configuration options including start node and alignment
133
133
  */
134
134
  constructor(e) {
135
- super(e), this.scalingFactor = 20, this.config = gt.parse(e);
135
+ super(e), this.scalingFactor = 20, this.config = Nt.parse(e);
136
136
  }
137
137
  /**
138
138
  * Get dimension-specific options for BFS layout
@@ -148,7 +148,7 @@ const pt = u({
148
148
  doLayout() {
149
149
  this.stale = !1;
150
150
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
151
- this.positions = ke(
151
+ this.positions = Te(
152
152
  { nodes: e, edges: t },
153
153
  this.config.start,
154
154
  this.config.align,
@@ -157,9 +157,9 @@ const pt = u({
157
157
  );
158
158
  }
159
159
  };
160
- z.type = "bfs", z.maxDimensions = 2, z.zodOptionsSchema = pt;
161
- let H = z;
162
- const ft = u({
160
+ z.type = "bfs", z.maxDimensions = 2, z.zodOptionsSchema = St;
161
+ let V = z;
162
+ const Dt = u({
163
163
  scalingFactor: {
164
164
  schema: i.number().min(1).max(1e3).default(40),
165
165
  meta: {
@@ -190,7 +190,7 @@ const ft = u({
190
190
  step: 0.1
191
191
  }
192
192
  }
193
- }), bt = i.strictObject({
193
+ }), wt = i.strictObject({
194
194
  ...v.shape,
195
195
  nodes: i.array(i.number().or(i.string())),
196
196
  align: i.enum(["vertical", "horizontal"]).default("vertical"),
@@ -203,7 +203,7 @@ const ft = u({
203
203
  * @param opts - Configuration options including node partitions and alignment
204
204
  */
205
205
  constructor(e) {
206
- super(e), this.scalingFactor = 40, this.config = bt.parse(e);
206
+ super(e), this.scalingFactor = 40, this.config = wt.parse(e);
207
207
  }
208
208
  /**
209
209
  * Get dimension-specific options for bipartite layout
@@ -219,7 +219,7 @@ const ft = u({
219
219
  doLayout() {
220
220
  this.stale = !1;
221
221
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
222
- this.positions = ze(
222
+ this.positions = We(
223
223
  { nodes: e, edges: t },
224
224
  this.config.nodes,
225
225
  this.config.align,
@@ -229,9 +229,9 @@ const ft = u({
229
229
  );
230
230
  }
231
231
  };
232
- F.type = "bipartite", F.maxDimensions = 2, F.zodOptionsSchema = ft;
233
- let K = F;
234
- const yt = u({
232
+ F.type = "bipartite", F.maxDimensions = 2, F.zodOptionsSchema = Dt;
233
+ let Y = F;
234
+ const Ot = u({
235
235
  scalingFactor: {
236
236
  schema: i.number().min(1).max(1e3).default(100),
237
237
  meta: {
@@ -254,18 +254,18 @@ const yt = u({
254
254
  description: "Layout dimensionality (2D or 3D)"
255
255
  }
256
256
  }
257
- }), vt = i.strictObject({
257
+ }), Mt = i.strictObject({
258
258
  ...v.shape,
259
259
  scale: i.number().positive().default(1),
260
260
  center: i.array(i.number()).min(2).max(3).or(i.null()).default(null),
261
261
  dim: i.number().default(2)
262
- }), L = class L extends y {
262
+ }), P = class P extends y {
263
263
  /**
264
264
  * Create a circular layout engine
265
265
  * @param opts - Configuration options including scale and dimensions
266
266
  */
267
267
  constructor(e) {
268
- super(e), this.scalingFactor = 80, this.config = vt.parse(e);
268
+ super(e), this.scalingFactor = 80, this.config = Mt.parse(e);
269
269
  }
270
270
  /**
271
271
  * Get dimension-specific options for circular layout
@@ -281,12 +281,12 @@ const yt = u({
281
281
  doLayout() {
282
282
  this.stale = !1;
283
283
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
284
- this.positions = Fe({ nodes: e, edges: t }, this.config.scale, this.config.center, this.config.dim);
284
+ this.positions = Ae({ nodes: e, edges: t }, this.config.scale, this.config.center, this.config.dim);
285
285
  }
286
286
  };
287
- L.type = "circular", L.maxDimensions = 3, L.zodOptionsSchema = yt;
288
- let V = L;
289
- const xt = u({
287
+ P.type = "circular", P.maxDimensions = 3, P.zodOptionsSchema = Ot;
288
+ let $ = P;
289
+ const Et = u({
290
290
  alphaMin: {
291
291
  schema: i.number().positive().default(0.1),
292
292
  meta: {
@@ -323,29 +323,29 @@ const xt = u({
323
323
  }
324
324
  }
325
325
  });
326
- function he(n) {
326
+ function ge(n) {
327
327
  return typeof n == "object" && n !== null && "index" in n && typeof n.index == "number" && "x" in n && typeof n.x == "number" && "y" in n && typeof n.y == "number" && "z" in n && typeof n.z == "number" && "vx" in n && typeof n.vx == "number" && "vy" in n && typeof n.vy == "number" && "vz" in n && typeof n.vz == "number";
328
328
  }
329
- const St = i.strictObject({
329
+ const It = i.strictObject({
330
330
  alphaMin: i.number().positive().default(0.1),
331
331
  alphaTarget: i.number().min(0).default(0),
332
332
  alphaDecay: i.number().positive().default(0.0228),
333
333
  velocityDecay: i.number().positive().default(0.4)
334
334
  });
335
- function Nt(n) {
336
- return !!(typeof n == "object" && n !== null && Object.hasOwn(n, "index") && "index" in n && typeof n.index == "number" && "source" in n && he(n.source) && "target" in n && he(n.target));
335
+ function Ct(n) {
336
+ return !!(typeof n == "object" && n !== null && Object.hasOwn(n, "index") && "index" in n && typeof n.index == "number" && "source" in n && ge(n.source) && "target" in n && ge(n.target));
337
337
  }
338
- const P = class P extends ue {
338
+ const L = class L extends fe {
339
339
  /**
340
340
  * Create a D3 force-directed layout engine
341
341
  * @param anyOpts - Configuration options for the D3 simulation
342
342
  */
343
343
  constructor(e = {}) {
344
344
  super(), this.nodeMapping = /* @__PURE__ */ new Map(), this.edgeMapping = /* @__PURE__ */ new Map(), this.newNodeMap = /* @__PURE__ */ new Map(), this.newEdgeMap = /* @__PURE__ */ new Map(), this.reheat = !1;
345
- const t = St.parse(e);
345
+ const t = It.parse(e);
346
346
  this.d3AlphaMin = t.alphaMin, this.d3AlphaTarget = t.alphaTarget, this.d3AlphaDecay = t.alphaDecay, this.d3VelocityDecay = t.velocityDecay;
347
- const s = Ye();
348
- s.strength(0.9), this.d3ForceLayout = $e().numDimensions(3).alpha(1).force("link", s).force("charge", Je()).force("center", Ze()).force("dagRadial", null).stop(), this.d3ForceLayout.force("link").id((o) => o.id);
347
+ const s = tt();
348
+ s.strength(0.9), this.d3ForceLayout = it().numDimensions(3).alpha(1).force("link", s).force("charge", st()).force("center", nt()).force("dagRadial", null).stop(), this.d3ForceLayout.force("link").id((o) => o.id);
349
349
  }
350
350
  /**
351
351
  * Check if there are pending nodes or edges to be processed
@@ -371,7 +371,7 @@ const P = class P extends ue {
371
371
  e = e.concat([...this.newNodeMap.values()]), this.d3ForceLayout.alpha(1).nodes(e).stop();
372
372
  for (const s of this.newNodeMap.entries()) {
373
373
  const o = s[0], r = s[1];
374
- if (!he(r))
374
+ if (!ge(r))
375
375
  throw new Error("Internal error: Node is not settled as a complete D3 Node");
376
376
  this.nodeMapping.set(o, r);
377
377
  }
@@ -380,7 +380,7 @@ const P = class P extends ue {
380
380
  t = t.concat([...this.newEdgeMap.values()]), this.d3ForceLayout.force("link").links(t);
381
381
  for (const s of this.newEdgeMap.entries()) {
382
382
  const o = s[0], r = s[1];
383
- if (!Nt(r))
383
+ if (!Ct(r))
384
384
  throw new Error("Internal error: Edge is not settled as a complete D3 Edge");
385
385
  this.edgeMapping.set(o, r);
386
386
  }
@@ -560,9 +560,9 @@ const P = class P extends ue {
560
560
  return t;
561
561
  }
562
562
  };
563
- P.type = "d3", P.maxDimensions = 3, P.zodOptionsSchema = xt;
564
- let Y = P;
565
- const wt = u({
563
+ L.type = "d3", L.maxDimensions = 3, L.zodOptionsSchema = Et;
564
+ let J = L;
565
+ const Rt = u({
566
566
  dim: {
567
567
  schema: i.number().int().min(2).max(3).default(3),
568
568
  meta: {
@@ -570,7 +570,7 @@ const wt = u({
570
570
  description: "Layout dimensionality (2D or 3D)"
571
571
  }
572
572
  }
573
- }), Dt = i.strictObject({
573
+ }), kt = i.strictObject({
574
574
  ...v.shape,
575
575
  dim: i.number().default(3)
576
576
  }), T = class T extends y {
@@ -579,7 +579,7 @@ const wt = u({
579
579
  * @param opts - Configuration options including dimensions
580
580
  */
581
581
  constructor(e = {}) {
582
- super(e), this.scalingFactor = 1, this.config = Dt.parse(e);
582
+ super(e), this.scalingFactor = 1, this.config = kt.parse(e);
583
583
  }
584
584
  /**
585
585
  * Add a node and apply its fixed position immediately
@@ -604,20 +604,20 @@ const wt = u({
604
604
  this.positions = e;
605
605
  }
606
606
  };
607
- T.type = "fixed", T.maxDimensions = 3, T.zodOptionsSchema = wt;
608
- let $ = T;
609
- const Ot = 25e4, Mt = 4;
610
- function Et(n, e, t) {
611
- return n !== null ? n : t > Ot ? e * Mt : e;
607
+ T.type = "fixed", T.maxDimensions = 3, T.zodOptionsSchema = Rt;
608
+ let Z = T;
609
+ const zt = 25e4, Ft = 4;
610
+ function Pt(n, e, t) {
611
+ return n !== null ? n : t > zt ? e * Ft : e;
612
612
  }
613
- function Ct(n, e) {
613
+ function Lt(n, e) {
614
614
  if (n == null || typeof n == "string")
615
615
  return null;
616
616
  const t = e.outDegree();
617
- return Te(n, e, (s) => t[s] + 1);
617
+ return Ge(n, e, (s) => t[s] + 1);
618
618
  }
619
- const It = 1e-6;
620
- function Rt(n, e, t, s = null) {
619
+ const Tt = 1e-6;
620
+ function Wt(n, e, t, s = null) {
621
621
  let o = 0, r = 0, c = 0, l = 0;
622
622
  for (let d = 0; d < e; d += 1) {
623
623
  const S = n[3 * d], N = n[3 * d + 1], p = n[3 * d + 2];
@@ -634,40 +634,40 @@ function Rt(n, e, t, s = null) {
634
634
  Number.isFinite(g) && g > a && (a = g);
635
635
  }
636
636
  const h = Math.sqrt(a);
637
- return { scale: h > It ? t / h : 1, centre: [r, c, l], placed: o };
637
+ return { scale: h > Tt ? t / h : 1, centre: [r, c, l], placed: o };
638
638
  }
639
- function kt(n) {
639
+ function At(n) {
640
640
  return n == null ? [0, 0, 0] : [
641
641
  n.length > 0 ? n[0] : 0,
642
642
  n.length > 1 ? n[1] : 0,
643
643
  n.length > 2 ? n[2] : 0
644
644
  ];
645
645
  }
646
- const zt = {
646
+ const _t = {
647
647
  forceatlas2: "forceAtlas2",
648
648
  fruchtermanReingold: "fruchtermanReingold",
649
649
  spring: "fruchtermanReingold",
650
650
  "spring-electrical": "springElectrical"
651
651
  };
652
- function Ft() {
653
- return new de({
652
+ function Bt() {
653
+ return new pe({
654
654
  code: "E_INTERNAL",
655
655
  message: "a simulation layout is constructed by LayoutManager with the graph's acceleration controller, not by LayoutEngine.get: this one was built without one",
656
656
  source: "layout"
657
657
  });
658
658
  }
659
- class me extends ue {
660
- #M;
661
- #S = ce;
659
+ class be extends fe {
660
+ #I;
661
+ #N = me;
662
662
  #t;
663
663
  #h;
664
- #E;
664
+ #C;
665
665
  #n;
666
666
  /**
667
667
  * One reused pair, valid until the next call. `Edge.update()` reads it and drops it, and a
668
668
  * fresh pair per edge per frame is the allocation this avoids.
669
669
  */
670
- #N = { src: { x: 0, y: 0, z: 0 }, dst: { x: 0, y: 0, z: 0 } };
670
+ #D = { src: { x: 0, y: 0, z: 0 }, dst: { x: 0, y: 0, z: 0 } };
671
671
  #e = null;
672
672
  /**
673
673
  * What the controller had ATTACHED when the running simulation was built, which is not the
@@ -678,7 +678,7 @@ class me extends ue {
678
678
  */
679
679
  #w = null;
680
680
  #u = !1;
681
- #a = null;
681
+ #o = null;
682
682
  #p = null;
683
683
  #g = null;
684
684
  /**
@@ -705,7 +705,7 @@ class me extends ue {
705
705
  // after every load, so a freeze or an accelerator swap mid-drag would give the pointer's node
706
706
  // back to the forces; these nodes are OR-ed back in. They are held as nodes, not as indices,
707
707
  // because a freeze renumbers the rows underneath them.
708
- #D = /* @__PURE__ */ new Set();
708
+ #O = /* @__PURE__ */ new Set();
709
709
  /**
710
710
  * The node masses this simulation was built with, when the reader gave them as a record keyed
711
711
  * by node id, and null for every other form. See {@link SimulationLayoutEngine.resolvedNodeMass}.
@@ -719,17 +719,21 @@ class me extends ue {
719
719
  * AFTER newer ones -- so "the same promise as last time" is not enough to keep the rule of one
720
720
  * handler per distinct promise. Weak, so a retired batch is collectable.
721
721
  */
722
- #C = /* @__PURE__ */ new WeakSet();
722
+ #R = /* @__PURE__ */ new WeakSet();
723
723
  #r = !1;
724
724
  /** The simulation whose failure has already been reported; see `#onError`. */
725
- #I = null;
725
+ #k = null;
726
726
  /**
727
727
  * Ends the controller's work span while an accelerated simulation is being stepped, or null
728
728
  * when no span is open. See `#syncWork`.
729
729
  */
730
730
  #b = null;
731
- #m = 1;
731
+ /** Batches submitted and not yet landed or rejected. See `#syncWork`. */
732
732
  #y = 0;
733
+ /** Set by `LayoutManager` while it is not stepping this layout. See {@link paused}. */
734
+ #M = !1;
735
+ #m = 1;
736
+ #v = 0;
733
737
  /**
734
738
  * Builds a bridge. Nothing is planned and no simulation exists until {@link init} loads one.
735
739
  *
@@ -746,8 +750,8 @@ class me extends ue {
746
750
  super();
747
751
  const t = e;
748
752
  if (t.controller === void 0 || t.type === void 0)
749
- throw Ft();
750
- this.simulationType = t.type, this.#M = t.layoutType ?? t.type, this.capability = zt[t.type], this.#t = t.options, this.#h = t.controller, this.#E = t.report, this.#n = t.dataManager, this.#s = kt(this.#t.model.center ?? this.#t.center), this.#i[0] = this.#s[0], this.#i[1] = this.#s[1], this.#i[2] = this.#s[2];
753
+ throw Bt();
754
+ this.simulationType = t.type, this.#I = t.layoutType ?? t.type, this.capability = _t[t.type], this.#t = t.options, this.#h = t.controller, this.#C = t.report, this.#n = t.dataManager, this.#s = At(this.#t.model.center ?? this.#t.center), this.#i[0] = this.#s[0], this.#i[1] = this.#s[1], this.#i[2] = this.#s[2];
751
755
  }
752
756
  /**
753
757
  * The registered layout name, which every other engine reads off its class's `static type`.
@@ -758,7 +762,7 @@ class me extends ue {
758
762
  * @returns The name the consumer set.
759
763
  */
760
764
  get type() {
761
- return this.#M;
765
+ return this.#I;
762
766
  }
763
767
  /**
764
768
  * The running simulation, or null before the first load and while the bridge is stopped.
@@ -782,7 +786,7 @@ class me extends ue {
782
786
  * @returns The precision, which is the CPU's whenever the CPU is running the layout.
783
787
  */
784
788
  get precision() {
785
- return this.#S;
789
+ return this.#N;
786
790
  }
787
791
  /**
788
792
  * How many iterations this bridge has submitted since the simulation was built. Submitted,
@@ -790,7 +794,7 @@ class me extends ue {
790
794
  * @returns The count.
791
795
  */
792
796
  get iterationsDone() {
793
- return this.#y;
797
+ return this.#v;
794
798
  }
795
799
  /**
796
800
  * The node masses the running simulation was handed, when the element resolved them itself.
@@ -810,7 +814,7 @@ class me extends ue {
810
814
  * @returns The mask, or an empty one before the first load.
811
815
  */
812
816
  get pinnedMask() {
813
- return this.#g === null ? fe(0) : this.#g.slice();
817
+ return this.#g === null ? xe(0) : this.#g.slice();
814
818
  }
815
819
  /**
816
820
  * Whether a different accelerator is attached now than when the simulation was built.
@@ -848,7 +852,7 @@ class me extends ue {
848
852
  * attached, or whatever `createSimulation` throws.
849
853
  */
850
854
  load(e, t) {
851
- this.#e?.dispose(), this.#e = null, this.#o(), this.#a = e, this.#p = t, this.#O(e.nodeCount, t), this.#z();
855
+ this.#e?.dispose(), this.#e = null, this.#a(), this.#o = e, this.#p = t, this.#E(e.nodeCount, t), this.#P();
852
856
  }
853
857
  /**
854
858
  * Hands the running simulation a new snapshot, rebuilding it first when the plan flipped.
@@ -861,16 +865,16 @@ class me extends ue {
861
865
  * attached.
862
866
  */
863
867
  reload(e, t) {
864
- if (this.#a === null)
868
+ if (this.#o === null)
865
869
  return;
866
870
  const s = this.#e;
867
- this.#a = e, this.#p = t;
868
- const o = this.#O(e.nodeCount, t), r = this.#h.plan({ capability: this.capability, nodeCount: e.nodeCount }), c = this.#d !== null;
871
+ this.#o = e, this.#p = t;
872
+ const o = this.#E(e.nodeCount, t), r = this.#h.plan({ capability: this.capability, nodeCount: e.nodeCount }), c = this.#d !== null;
869
873
  if (s === null || r.accelerated !== this.#u || c) {
870
874
  this.replaceSimulation();
871
875
  return;
872
876
  }
873
- this.#m = this.#L(e.nodeCount), this.#F(e, o), s.load(this.#n.undirected(e).snapshot, o), this.#k();
877
+ this.#m = this.#T(e.nodeCount), this.#L(e, o), s.load(this.#n.undirected(e).snapshot, o), this.#F();
874
878
  }
875
879
  /**
876
880
  * Rebuilds the simulation on whatever the controller holds now, keeping the arrangement.
@@ -883,12 +887,12 @@ class me extends ue {
883
887
  * the next transition that attaches an accelerator brings it back through this same method.
884
888
  */
885
889
  replaceSimulation() {
886
- if (this.#e?.dispose(), this.#e = null, this.#o(), this.#a === null || this.#p === null) {
890
+ if (this.#e?.dispose(), this.#e = null, this.#a(), this.#o === null || this.#p === null) {
887
891
  this.#r = !1;
888
892
  return;
889
893
  }
890
894
  try {
891
- this.#z();
895
+ this.#P();
892
896
  } catch (e) {
893
897
  throw this.#r = !0, e;
894
898
  }
@@ -908,14 +912,14 @@ class me extends ue {
908
912
  const e = this.#e;
909
913
  if (e === null || this.#r)
910
914
  return;
911
- this.#y += this.#m;
915
+ this.#v += this.#m;
912
916
  const t = e.step(this.#m);
913
- this.#o(), t !== void 0 && !this.#C.has(t) && (this.#C.add(t), t.then(
917
+ this.#a(), t !== void 0 && !this.#R.has(t) && (this.#R.add(t), this.#y += 1, t.then(
914
918
  () => {
915
- this.#o();
919
+ this.#y -= 1, this.#a();
916
920
  },
917
921
  (s) => {
918
- this.#W(s, e);
922
+ this.#y -= 1, this.#_(s, e);
919
923
  }
920
924
  ));
921
925
  }
@@ -926,14 +930,30 @@ class me extends ue {
926
930
  */
927
931
  async stepAsync(e) {
928
932
  if (!(this.#e === null || this.#r)) {
929
- this.#y += e, this.#o();
933
+ this.#v += e, this.#a();
930
934
  try {
931
935
  await this.#e.step(e);
932
936
  } finally {
933
- this.#o();
937
+ this.#a();
934
938
  }
935
939
  }
936
940
  }
941
+ /**
942
+ * Whether the manager has stopped stepping this layout -- a consumer's pause, or any other
943
+ * stop. A paused layout's work span closes once its in-flight batches land, because nothing
944
+ * is being submitted after them.
945
+ * @returns True while the layout is not being stepped.
946
+ */
947
+ get paused() {
948
+ return this.#M;
949
+ }
950
+ /**
951
+ * Tells the bridge whether the manager is stepping it.
952
+ * @param value - True when the manager has stopped stepping this layout.
953
+ */
954
+ set paused(e) {
955
+ this.#M = e, e && this.#a();
956
+ }
937
957
  /**
938
958
  * Starts the settle count again, on a simulation that has one.
939
959
  *
@@ -953,7 +973,7 @@ class me extends ue {
953
973
  * @param n - The node the pointer has taken.
954
974
  */
955
975
  beginDrag(e) {
956
- this.#D.add(e), this.#v(e.index, !0);
976
+ this.#O.add(e), this.#x(e.index, !0);
957
977
  }
958
978
  /**
959
979
  * Gives the node back to the simulation, or leaves it fixed because it is being pinned.
@@ -966,21 +986,21 @@ class me extends ue {
966
986
  * @param pin - True when the drag ends in a pin, so the bit stays set.
967
987
  */
968
988
  endDrag(e, t) {
969
- this.#D.delete(e), this.#v(e.index, t || e.isPinned());
989
+ this.#O.delete(e), this.#x(e.index, t || e.isPinned());
970
990
  }
971
991
  /**
972
992
  * Fixes a pinned node in the simulation. The store already holds the pin.
973
993
  * @param n - The node that was pinned.
974
994
  */
975
995
  pin(e) {
976
- this.#v(e.index, !0);
996
+ this.#x(e.index, !0);
977
997
  }
978
998
  /**
979
999
  * Releases a node the simulation was holding fixed.
980
1000
  * @param n - The node that was unpinned.
981
1001
  */
982
1002
  unpin(e) {
983
- this.#v(e.index, !1);
1003
+ this.#x(e.index, !1);
984
1004
  }
985
1005
  /**
986
1006
  * Places one node now. A drag reaches this per pointer move, and `replayPins` once per pin.
@@ -989,7 +1009,7 @@ class me extends ue {
989
1009
  */
990
1010
  setNodePosition(e, t) {
991
1011
  const s = t.z ?? 0;
992
- if (!this.#x(e.index) || !Number.isFinite(t.x) || !Number.isFinite(t.y) || !Number.isFinite(s))
1012
+ if (!this.#S(e.index) || !Number.isFinite(t.x) || !Number.isFinite(t.y) || !Number.isFinite(s))
993
1013
  return;
994
1014
  this.writeNodePosition(e, t.x, t.y, s, "placement");
995
1015
  const o = this.#f;
@@ -1015,7 +1035,7 @@ class me extends ue {
1015
1035
  * @returns The pair, valid until the next call; the origin for an endpoint nothing has placed.
1016
1036
  */
1017
1037
  getEdgePosition(e) {
1018
- return this.#R(e.srcNode, this.#N.src), this.#R(e.dstNode, this.#N.dst), this.#N;
1038
+ return this.#z(e.srcNode, this.#D.src), this.#z(e.dstNode, this.#D.dst), this.#D;
1019
1039
  }
1020
1040
  /**
1021
1041
  * Reads one endpoint into the reused pair, or zeroes that half of it.
@@ -1030,7 +1050,7 @@ class me extends ue {
1030
1050
  * @param out.y - receives the scene-unit y.
1031
1051
  * @param out.z - receives the scene-unit z.
1032
1052
  */
1033
- #R(e, t) {
1053
+ #z(e, t) {
1034
1054
  this.readNodePosition(e, t) || (t.x = 0, t.y = 0, t.z = 0);
1035
1055
  }
1036
1056
  /**
@@ -1112,15 +1132,15 @@ class me extends ue {
1112
1132
  * free row left keeps the last map rather than falling back to the identity.
1113
1133
  */
1114
1134
  publishPositions() {
1115
- const e = this.#a, t = this.#l;
1135
+ const e = this.#o, t = this.#l;
1116
1136
  if (e === null || t === null)
1117
1137
  return;
1118
- const s = this.#n.positions, o = this.#c.size === 0 ? null : (a) => this.#c.has(a) && s.isPlaced(a), r = Rt(t, e.nodeCount, this.#t.scalingFactor, o);
1138
+ const s = this.#n.positions, o = this.#c.size === 0 ? null : (a) => this.#c.has(a) && s.isPlaced(a), r = Wt(t, e.nodeCount, this.#t.scalingFactor, o);
1119
1139
  r.placed > 0 && (this.#f = r.scale, this.#i[0] = r.centre[0], this.#i[1] = r.centre[1], this.#i[2] = r.centre[2]);
1120
1140
  const c = this.#f, l = this.#i;
1121
1141
  for (const a of this.nodes) {
1122
1142
  const h = a.index;
1123
- if (!this.#x(h))
1143
+ if (!this.#S(h))
1124
1144
  continue;
1125
1145
  const d = s.isPlaced(h);
1126
1146
  d && this.#c.has(h) || this.writeNodePosition(
@@ -1138,7 +1158,7 @@ class me extends ue {
1138
1158
  * freeze and at shutdown.
1139
1159
  */
1140
1160
  dispose() {
1141
- this.#e?.dispose(), this.#e = null, this.#o();
1161
+ this.#e?.dispose(), this.#e = null, this.#a();
1142
1162
  }
1143
1163
  /**
1144
1164
  * Tells the controller whether the accelerator is being stepped right now.
@@ -1152,11 +1172,11 @@ class me extends ue {
1152
1172
  * transition twice a frame, to every `onChange` listener and out to the DOM. It opens when an
1153
1173
  * accelerated batch is submitted and closes when one lands on a settled simulation, when the
1154
1174
  * simulation is replaced or disposed, and when a batch fails. A layout PAUSED mid-settle
1155
- * keeps its span until it resumes and settles: the bridge is not told about a pause, and the
1156
- * batches it had in flight are still landing when one begins.
1175
+ * keeps its span only until the batches it had in flight have landed: after them nothing is
1176
+ * submitted, so the device is idle until the layout resumes.
1157
1177
  */
1158
- #o() {
1159
- const e = this.#u && this.#e !== null && !this.#r && !this.isSettled;
1178
+ #a() {
1179
+ const e = this.#u && this.#e !== null && !this.#r && !this.isSettled && !(this.#M && this.#y === 0);
1160
1180
  if (e !== (this.#b !== null)) {
1161
1181
  if (e) {
1162
1182
  this.#b = this.#h.beginWork();
@@ -1173,30 +1193,30 @@ class me extends ue {
1173
1193
  * nodes a pointer is holding are OR-ed in afterwards: a drag is not a pin and has no row in
1174
1194
  * the lane, but it holds the node just as still.
1175
1195
  */
1176
- #k() {
1177
- const e = this.#a, t = this.#e;
1196
+ #F() {
1197
+ const e = this.#o, t = this.#e;
1178
1198
  if (e === null || t === null)
1179
1199
  return;
1180
- const { nodeCount: s } = e, o = this.#n.positions.pinnedView(s), r = fe(s), c = /* @__PURE__ */ new Set();
1200
+ const { nodeCount: s } = e, o = this.#n.positions.pinnedView(s), r = xe(s), c = /* @__PURE__ */ new Set();
1181
1201
  for (let l = 0; l < s; l += 1)
1182
- o[l] === 1 && (le(r, l, !0), c.add(l));
1183
- for (const l of this.#D)
1184
- this.#x(l.index) && (le(r, l.index, !0), c.add(l.index));
1202
+ o[l] === 1 && (ue(r, l, !0), c.add(l));
1203
+ for (const l of this.#O)
1204
+ this.#S(l.index) && (ue(r, l.index, !0), c.add(l.index));
1185
1205
  this.#g = r, this.#c = c, t.setFixed(r);
1186
1206
  }
1187
1207
  /**
1188
1208
  * Plans, builds and loads a simulation over the snapshot this bridge is holding.
1189
1209
  * @throws Whatever `plan()` or `createSimulation` throws.
1190
1210
  */
1191
- #z() {
1192
- const e = this.#a, t = this.#p;
1211
+ #P() {
1212
+ const e = this.#o, t = this.#p;
1193
1213
  if (e === null || t === null)
1194
1214
  return;
1195
- const s = this.#l, o = s !== null && s.length === 3 * e.nodeCount ? s : this.#O(e.nodeCount, t);
1196
- this.#w = null, this.#u = !1, this.#S = ce;
1215
+ const s = this.#l, o = s !== null && s.length === 3 * e.nodeCount ? s : this.#E(e.nodeCount, t);
1216
+ this.#w = null, this.#u = !1, this.#N = me;
1197
1217
  const r = this.#h.plan({ capability: this.capability, nodeCount: e.nodeCount }), c = r.accelerated ? r.accelerator : null;
1198
1218
  if (!r.accelerated && this.simulationType === "spring-electrical")
1199
- throw new de({
1219
+ throw new pe({
1200
1220
  code: "E_NO_ACCELERATOR",
1201
1221
  message: `the layout "${this.type}" is computed on a hardware accelerator and has no processor implementation: ${r.reason}`,
1202
1222
  source: "layout",
@@ -1206,11 +1226,11 @@ class me extends ue {
1206
1226
  }
1207
1227
  });
1208
1228
  const l = this.#n.undirected(e).snapshot;
1209
- this.#F(e, o), this.#d = this.#P(l), this.#m = this.#L(e.nodeCount), this.#e = Le(
1229
+ this.#L(e, o), this.#d = this.#W(l), this.#m = this.#T(e.nodeCount), this.#e = _e(
1210
1230
  this.simulationType,
1211
- this.#T(),
1212
- c === null ? null : Qe(c)
1213
- ), this.#w = this.#h.accelerator, this.#u = r.accelerated, this.#S = r.accelerated ? r.precision : ce, this.#r = !1, this.#y = 0, this.#e.load(l, o), this.#k();
1231
+ this.#A(),
1232
+ c === null ? null : at(c)
1233
+ ), this.#w = this.#h.accelerator, this.#u = r.accelerated, this.#N = r.accelerated ? r.precision : me, this.#r = !1, this.#v = 0, this.#e.load(l, o), this.#F();
1214
1234
  }
1215
1235
  /**
1216
1236
  * Turns a reader's `nodeMass` record into one value per dense row, and leaves every other form
@@ -1218,8 +1238,8 @@ class me extends ue {
1218
1238
  * @param undirected - The graph the simulation will be loaded with.
1219
1239
  * @returns The masses, or null when the simulation resolves them itself.
1220
1240
  */
1221
- #P(e) {
1222
- return Ct(this.#t.model.nodeMass, e);
1241
+ #W(e) {
1242
+ return Lt(this.#t.model.nodeMass, e);
1223
1243
  }
1224
1244
  /**
1225
1245
  * Gives a coordinate to every row that has none, before the simulation reads them.
@@ -1234,9 +1254,9 @@ class me extends ue {
1234
1254
  * @param snapshot - The graph being loaded.
1235
1255
  * @param positions - The simulation's array, exactly `3 * nodeCount` long.
1236
1256
  */
1237
- #F(e, t) {
1257
+ #L(e, t) {
1238
1258
  const { seed: s, dim: o, scale: r, center: c } = this.#t.model;
1239
- Pe(
1259
+ Be(
1240
1260
  e,
1241
1261
  t,
1242
1262
  s ?? null,
@@ -1258,7 +1278,7 @@ class me extends ue {
1258
1278
  * @param positions - The element's array, exactly `3 * nodeCount` long.
1259
1279
  * @returns The simulation's array, holding the element's arrangement in simulation units.
1260
1280
  */
1261
- #O(e, t) {
1281
+ #E(e, t) {
1262
1282
  const s = 3 * e, o = this.#l !== null && this.#l.length === s ? this.#l : new Float32Array(s), r = this.#f;
1263
1283
  for (let c = 0; c < e; c += 1)
1264
1284
  for (let l = 0; l < 3; l += 1)
@@ -1270,7 +1290,7 @@ class me extends ue {
1270
1290
  * iteration count this load resolved.
1271
1291
  * @returns The options object.
1272
1292
  */
1273
- #T() {
1293
+ #A() {
1274
1294
  const { model: e, iterationsPerStep: t, stepMultiplier: s, ...o } = this.#t, r = this.#d === null ? {} : { nodeMass: this.#d };
1275
1295
  return { ...o, ...e, ...r, iterationsPerStep: this.#m };
1276
1296
  }
@@ -1279,9 +1299,9 @@ class me extends ue {
1279
1299
  * @param nodeCount - The graph this load is over.
1280
1300
  * @returns The iteration count.
1281
1301
  */
1282
- #L(e) {
1302
+ #T(e) {
1283
1303
  const { iterationsPerStep: t, stepMultiplier: s } = this.#t;
1284
- return Et(t, s, e);
1304
+ return Pt(t, s, e);
1285
1305
  }
1286
1306
  /**
1287
1307
  * Sets or clears one bit of the fixed mask and tells the simulation.
@@ -1291,9 +1311,9 @@ class me extends ue {
1291
1311
  * @param index - The node's dense row.
1292
1312
  * @param fixed - Whether the simulation must hold it still.
1293
1313
  */
1294
- #v(e, t) {
1314
+ #x(e, t) {
1295
1315
  const s = this.#g, o = this.#e;
1296
- s === null || o === null || !this.#x(e) || (le(s, e, t), t ? this.#c.add(e) : this.#c.delete(e), o.setFixed(s));
1316
+ s === null || o === null || !this.#S(e) || (ue(s, e, t), t ? this.#c.add(e) : this.#c.delete(e), o.setFixed(s));
1297
1317
  }
1298
1318
  /**
1299
1319
  * Whether the loaded snapshot has a row at this index.
@@ -1304,8 +1324,8 @@ class me extends ue {
1304
1324
  * @param index - The node's dense row, or the sentinel.
1305
1325
  * @returns True when the index addresses a row of the loaded graph.
1306
1326
  */
1307
- #x(e) {
1308
- return Number.isInteger(e) && e >= 0 && e < (this.#a?.nodeCount ?? 0);
1327
+ #S(e) {
1328
+ return Number.isInteger(e) && e >= 0 && e < (this.#o?.nodeCount ?? 0);
1309
1329
  }
1310
1330
  /**
1311
1331
  * Reports a rejected batch and stops stepping the simulation it came from.
@@ -1330,9 +1350,9 @@ class me extends ue {
1330
1350
  * @param error - The rejection.
1331
1351
  * @param from - The simulation the batch was submitted on.
1332
1352
  */
1333
- #W(e, t) {
1334
- this.#I !== t && (this.#I = t, t === this.#e && (this.#r = !0, this.#o()), this.#E(
1335
- de.wrap(e, {
1353
+ #_(e, t) {
1354
+ this.#k !== t && (this.#k = t, t === this.#e && (this.#r = !0, this.#a()), this.#C(
1355
+ pe.wrap(e, {
1336
1356
  code: "E_INTERNAL",
1337
1357
  source: "layout",
1338
1358
  details: { layoutType: this.type, simulation: this.simulationType }
@@ -1340,7 +1360,7 @@ class me extends ue {
1340
1360
  ));
1341
1361
  }
1342
1362
  }
1343
- const Lt = u({
1363
+ const Gt = u({
1344
1364
  scalingFactor: {
1345
1365
  schema: i.number().min(1).max(1e3).default(100),
1346
1366
  meta: {
@@ -1445,7 +1465,7 @@ const Lt = u({
1445
1465
  advanced: !0
1446
1466
  }
1447
1467
  }
1448
- }), w = class w extends me {
1468
+ }), D = class D extends be {
1449
1469
  /**
1450
1470
  * Get dimension-specific options for ForceAtlas2 layout.
1451
1471
  * @param dimension - The desired dimension (2 or 3).
@@ -1455,9 +1475,64 @@ const Lt = u({
1455
1475
  return { dim: e };
1456
1476
  }
1457
1477
  };
1458
- w.type = "forceatlas2", w.simulationType = "forceatlas2", w.maxDimensions = 3, w.honoursWeights = !0, w.zodOptionsSchema = Lt;
1459
- let J = w;
1460
- const Pt = "weight", Tt = u({
1478
+ D.type = "forceatlas2", D.simulationType = "forceatlas2", D.maxDimensions = 3, D.honoursWeights = !0, D.zodOptionsSchema = Gt;
1479
+ let Q = D;
1480
+ const qt = u({
1481
+ scalingFactor: {
1482
+ schema: i.number().min(1).max(1e3).default(100),
1483
+ meta: {
1484
+ label: "Scaling Factor",
1485
+ description: "Multiplier for node positions"
1486
+ }
1487
+ },
1488
+ columns: {
1489
+ schema: i.number().int().positive().nullable().default(null),
1490
+ meta: {
1491
+ label: "Columns",
1492
+ description: "Number of columns; empty makes the grid as close to square as it can"
1493
+ }
1494
+ },
1495
+ scale: {
1496
+ schema: i.number().positive().default(1),
1497
+ meta: {
1498
+ label: "Scale",
1499
+ description: "Half the length of the grid's longer side",
1500
+ step: 0.1
1501
+ }
1502
+ }
1503
+ }), jt = i.strictObject({
1504
+ ...v.shape,
1505
+ columns: i.number().int().positive().nullable().default(null),
1506
+ scale: i.number().positive().default(1),
1507
+ center: i.array(i.number()).length(2).or(i.null()).default(null)
1508
+ }), W = class W extends y {
1509
+ /**
1510
+ * Create a grid layout engine
1511
+ * @param opts - Configuration options including the column count
1512
+ */
1513
+ constructor(e) {
1514
+ super(e), this.scalingFactor = 100, this.config = jt.parse(e);
1515
+ }
1516
+ /**
1517
+ * Get dimension-specific options for grid layout
1518
+ * @param dimension - The desired dimension (2 or 3)
1519
+ * @returns Empty object for 2D, null for 3D (unsupported)
1520
+ */
1521
+ static getOptionsForDimension(e) {
1522
+ return e > this.maxDimensions ? null : {};
1523
+ }
1524
+ /**
1525
+ * Compute node positions on the lattice
1526
+ */
1527
+ doLayout() {
1528
+ this.stale = !1;
1529
+ const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
1530
+ this.positions = qe({ nodes: e, edges: t }, this.config.columns, this.config.scale, this.config.center);
1531
+ }
1532
+ };
1533
+ W.type = "grid", W.maxDimensions = 2, W.zodOptionsSchema = qt;
1534
+ let X = W;
1535
+ const Ut = "weight", Ht = u({
1461
1536
  scalingFactor: {
1462
1537
  schema: i.number().min(1).max(1e3).default(50),
1463
1538
  meta: {
@@ -1487,7 +1562,7 @@ const Pt = "weight", Tt = u({
1487
1562
  description: "Place strongly connected nodes closer together"
1488
1563
  }
1489
1564
  }
1490
- }), Wt = i.strictObject({
1565
+ }), Kt = i.strictObject({
1491
1566
  ...v.shape,
1492
1567
  dist: i.record(i.number(), i.record(i.number(), i.number())).or(i.null()).default(null),
1493
1568
  pos: i.record(i.number(), i.array(i.number()).min(1).max(3)).or(i.null()).default(null),
@@ -1501,7 +1576,7 @@ const Pt = "weight", Tt = u({
1501
1576
  * @param opts - Configuration options including scale and dimensions
1502
1577
  */
1503
1578
  constructor(e) {
1504
- super(e), this.scalingFactor = 50, this.config = Wt.parse(e);
1579
+ super(e), this.scalingFactor = 50, this.config = Kt.parse(e);
1505
1580
  }
1506
1581
  /**
1507
1582
  * Get dimension-specific options for Kamada-Kawai layout
@@ -1526,23 +1601,23 @@ const Pt = "weight", Tt = u({
1526
1601
  this.stale = !1;
1527
1602
  const s = { nodes: () => this._nodes.map((r) => r.id), edges: () => this._edges.map((r) => [r.srcId, r.dstId]) }, o = this.config.weighted ? this.pairWeights(this._edges) : null;
1528
1603
  o !== null && (this.reportClampedWeights("kamada-kawai", o), s.getEdgeData = (r, c) => {
1529
- const l = o.get(Ue(r, c));
1604
+ const l = o.get(Ze(r, c));
1530
1605
  if (l !== void 0)
1531
- return 1 / Math.max(l, He);
1532
- }), this.positions = We(
1606
+ return 1 / Math.max(l, Qe);
1607
+ }), this.positions = je(
1533
1608
  s,
1534
1609
  this.config.dist,
1535
1610
  this.config.pos,
1536
- Pt,
1611
+ Ut,
1537
1612
  this.config.scale,
1538
1613
  this.config.center,
1539
1614
  this.config.dim
1540
1615
  );
1541
1616
  }
1542
1617
  };
1543
- M.type = "kamada-kawai", M.maxDimensions = 3, M.honoursWeights = !0, M.zodOptionsSchema = Tt;
1544
- let Z = M;
1545
- const _t = u({
1618
+ M.type = "kamada-kawai", M.maxDimensions = 3, M.honoursWeights = !0, M.zodOptionsSchema = Ht;
1619
+ let ee = M;
1620
+ const Vt = u({
1546
1621
  scalingFactor: {
1547
1622
  schema: i.number().min(1).max(1e3).default(40),
1548
1623
  meta: {
@@ -1565,20 +1640,20 @@ const _t = u({
1565
1640
  step: 0.1
1566
1641
  }
1567
1642
  }
1568
- }), At = i.strictObject({
1643
+ }), Yt = i.strictObject({
1569
1644
  ...v.shape,
1570
1645
  // subsetKey: z.string().or(z.record(z.number(), z.array(z.string().or(z.number())))),
1571
1646
  subsetKey: i.record(i.string(), i.array(i.string().or(i.number()))),
1572
1647
  align: i.enum(["vertical", "horizontal"]).default("vertical"),
1573
1648
  scale: i.number().positive().default(1),
1574
1649
  center: i.array(i.number()).length(2).or(i.null()).default(null)
1575
- }), W = class W extends y {
1650
+ }), A = class A extends y {
1576
1651
  /**
1577
1652
  * Create a multipartite layout engine
1578
1653
  * @param opts - Configuration options including subset keys and alignment
1579
1654
  */
1580
1655
  constructor(e) {
1581
- super(e), this.scalingFactor = 40, this.config = At.parse(e);
1656
+ super(e), this.scalingFactor = 40, this.config = Yt.parse(e);
1582
1657
  }
1583
1658
  /**
1584
1659
  * Get dimension-specific options for multipartite layout
@@ -1594,7 +1669,7 @@ const _t = u({
1594
1669
  doLayout() {
1595
1670
  this.stale = !1;
1596
1671
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
1597
- this.positions = _e(
1672
+ this.positions = Ue(
1598
1673
  { nodes: e, edges: t },
1599
1674
  this.config.subsetKey,
1600
1675
  this.config.align,
@@ -1603,12 +1678,12 @@ const _t = u({
1603
1678
  );
1604
1679
  }
1605
1680
  };
1606
- W.type = "multipartite", W.maxDimensions = 2, W.zodOptionsSchema = _t;
1607
- let Q = W;
1608
- var I = { exports: {} }, Oe;
1609
- function Bt() {
1610
- if (Oe) return I.exports;
1611
- Oe = 1, I.exports = n, I.exports.random = n, I.exports.randomIterator = l;
1681
+ A.type = "multipartite", A.maxDimensions = 2, A.zodOptionsSchema = Vt;
1682
+ let te = A;
1683
+ var C = { exports: {} }, Ce;
1684
+ function $t() {
1685
+ if (Ce) return C.exports;
1686
+ Ce = 1, C.exports = n, C.exports.random = n, C.exports.randomIterator = l;
1612
1687
  function n(a) {
1613
1688
  var h = typeof a == "number" ? a : +/* @__PURE__ */ new Date();
1614
1689
  return new e(h);
@@ -1664,16 +1739,16 @@ function Bt() {
1664
1739
  return a;
1665
1740
  }
1666
1741
  function N(p) {
1667
- var g, O, re;
1742
+ var g, O, he;
1668
1743
  for (g = a.length - 1; g > 0; --g)
1669
- O = d.next(g + 1), re = a[O], a[O] = a[g], a[g] = re, p(re);
1744
+ O = d.next(g + 1), he = a[O], a[O] = a[g], a[g] = he, p(he);
1670
1745
  a.length && p(a[0]);
1671
1746
  }
1672
1747
  }
1673
- return I.exports;
1748
+ return C.exports;
1674
1749
  }
1675
- var qt = Bt();
1676
- const Gt = /* @__PURE__ */ Ve(qt), jt = u({
1750
+ var Jt = $t();
1751
+ const Zt = /* @__PURE__ */ et(Jt), Qt = u({
1677
1752
  dim: {
1678
1753
  schema: i.number().int().min(2).max(3).default(3),
1679
1754
  meta: {
@@ -1739,17 +1814,17 @@ const Gt = /* @__PURE__ */ Ve(qt), jt = u({
1739
1814
  advanced: !0
1740
1815
  }
1741
1816
  }
1742
- }), _ = class _ extends ue {
1817
+ }), _ = class _ extends fe {
1743
1818
  /**
1744
1819
  * Create an NGraph layout engine
1745
1820
  * @param config - Configuration options for the NGraph simulation
1746
1821
  */
1747
1822
  constructor(e = {}) {
1748
- super(), this.nodeMapping = /* @__PURE__ */ new Map(), this.edgeMapping = /* @__PURE__ */ new Map(), this._settled = !0, this._stepCount = 0, this._lastMoves = [], this.ngraph = tt();
1823
+ super(), this.nodeMapping = /* @__PURE__ */ new Map(), this.edgeMapping = /* @__PURE__ */ new Map(), this._settled = !0, this._stepCount = 0, this._lastMoves = [], this.seededPlacement = null, this.ngraph = lt();
1749
1824
  const t = e, s = {
1750
1825
  dimensions: t.dim !== void 0 ? t.dim : 3
1751
1826
  };
1752
- t.springLength !== void 0 && (s.springLength = t.springLength), t.springCoefficient !== void 0 && (s.springCoefficient = t.springCoefficient), t.gravity !== void 0 && (s.gravity = t.gravity), t.theta !== void 0 && (s.theta = t.theta), t.dragCoefficient !== void 0 && (s.dragCoefficient = t.dragCoefficient), t.timeStep !== void 0 && (s.timeStep = t.timeStep), t.seed !== void 0 && typeof t.seed == "number" && (s.random = Gt(t.seed)), this.ngraphLayout = et(this.ngraph, s);
1827
+ t.springLength !== void 0 && (s.springLength = t.springLength), t.springCoefficient !== void 0 && (s.springCoefficient = t.springCoefficient), t.gravity !== void 0 && (s.gravity = t.gravity), t.theta !== void 0 && (s.theta = t.theta), t.dragCoefficient !== void 0 && (s.dragCoefficient = t.dragCoefficient), t.timeStep !== void 0 && (s.timeStep = t.timeStep), typeof t.seed == "number" && (this.seededPlacement = { rng: Zt(t.seed), dim: s.dimensions }), this.ngraphLayout = rt(this.ngraph, s);
1753
1828
  }
1754
1829
  /**
1755
1830
  * Get dimension-specific options for NGraph layout
@@ -1803,7 +1878,11 @@ const Gt = /* @__PURE__ */ Ve(qt), jt = u({
1803
1878
  */
1804
1879
  addNode(e) {
1805
1880
  const t = this.ngraph.addNode(e.id, { parentNode: e });
1806
- this.nodeMapping.set(e, t), this._settled = !1, this._stepCount = 0, this._lastMoves = [];
1881
+ if (this.nodeMapping.set(e, t), this.seededPlacement) {
1882
+ const { rng: s, dim: o } = this.seededPlacement, { springLength: r } = this.ngraphLayout.simulator.settings, c = () => (s.nextDouble() - 0.5) * r, l = c(), a = c();
1883
+ this.ngraphLayout.setNodePosition(e.id, l, a, o === 3 ? c() : 0);
1884
+ }
1885
+ this._settled = !1, this._stepCount = 0, this._lastMoves = [];
1807
1886
  }
1808
1887
  /**
1809
1888
  * Add an edge to the NGraph simulation
@@ -1918,9 +1997,9 @@ const Gt = /* @__PURE__ */ Ve(qt), jt = u({
1918
1997
  return t;
1919
1998
  }
1920
1999
  };
1921
- _.type = "ngraph", _.maxDimensions = 3, _.zodOptionsSchema = jt;
1922
- let X = _;
1923
- const Ut = u({
2000
+ _.type = "ngraph", _.maxDimensions = 3, _.zodOptionsSchema = Qt;
2001
+ let ie = _;
2002
+ const Xt = u({
1924
2003
  scalingFactor: {
1925
2004
  schema: i.number().min(1).max(1e3).default(70),
1926
2005
  meta: {
@@ -1951,19 +2030,19 @@ const Ut = u({
1951
2030
  advanced: !0
1952
2031
  }
1953
2032
  }
1954
- }), Ht = i.strictObject({
2033
+ }), ei = i.strictObject({
1955
2034
  ...v.shape,
1956
2035
  scale: i.number().positive().default(1),
1957
2036
  center: i.array(i.number()).length(2).or(i.null()).default(null),
1958
2037
  dim: i.number().default(2),
1959
2038
  seed: i.number().or(i.null()).default(null)
1960
- }), A = class A extends y {
2039
+ }), B = class B extends y {
1961
2040
  /**
1962
2041
  * Create a planar layout engine
1963
2042
  * @param opts - Configuration options including scale and seed
1964
2043
  */
1965
2044
  constructor(e) {
1966
- super(e), this.scalingFactor = 70, this.config = Ht.parse(e);
2045
+ super(e), this.scalingFactor = 70, this.config = ei.parse(e);
1967
2046
  }
1968
2047
  /**
1969
2048
  * Get dimension-specific options for planar layout
@@ -1979,7 +2058,7 @@ const Ut = u({
1979
2058
  doLayout() {
1980
2059
  this.stale = !1;
1981
2060
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
1982
- this.positions = Ae(
2061
+ this.positions = He(
1983
2062
  { nodes: e, edges: t },
1984
2063
  this.config.scale,
1985
2064
  this.config.center,
@@ -1988,9 +2067,64 @@ const Ut = u({
1988
2067
  );
1989
2068
  }
1990
2069
  };
1991
- A.type = "planar", A.maxDimensions = 2, A.zodOptionsSchema = Ut;
1992
- let ee = A;
1993
- const Kt = u({
2070
+ B.type = "planar", B.maxDimensions = 2, B.zodOptionsSchema = Xt;
2071
+ let se = B;
2072
+ const ti = u({
2073
+ scalingFactor: {
2074
+ schema: i.number().min(1).max(1e3).default(100),
2075
+ meta: {
2076
+ label: "Scaling Factor",
2077
+ description: "Multiplier for node positions"
2078
+ }
2079
+ },
2080
+ root: {
2081
+ schema: i.union([i.string(), i.number()]).nullable().default(null),
2082
+ meta: {
2083
+ label: "Root Node",
2084
+ description: "The node at the centre; empty picks the node with the most edges"
2085
+ }
2086
+ },
2087
+ scale: {
2088
+ schema: i.number().positive().default(1),
2089
+ meta: {
2090
+ label: "Scale",
2091
+ description: "Radius of the outermost ring",
2092
+ step: 0.1
2093
+ }
2094
+ }
2095
+ }), ii = i.strictObject({
2096
+ ...v.shape,
2097
+ root: i.union([i.string(), i.number()]).nullable().default(null),
2098
+ scale: i.number().positive().default(1),
2099
+ center: i.array(i.number()).length(2).or(i.null()).default(null)
2100
+ }), G = class G extends y {
2101
+ /**
2102
+ * Create a radial layout engine
2103
+ * @param opts - Configuration options including the root node
2104
+ */
2105
+ constructor(e) {
2106
+ super(e), this.scalingFactor = 100, this.config = ii.parse(e);
2107
+ }
2108
+ /**
2109
+ * Get dimension-specific options for radial layout
2110
+ * @param dimension - The desired dimension (2 or 3)
2111
+ * @returns Empty object for 2D, null for 3D (unsupported)
2112
+ */
2113
+ static getOptionsForDimension(e) {
2114
+ return e > this.maxDimensions ? null : {};
2115
+ }
2116
+ /**
2117
+ * Compute node positions on rings around the root
2118
+ */
2119
+ doLayout() {
2120
+ this.stale = !1;
2121
+ const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
2122
+ this.positions = Ke({ nodes: e, edges: t }, this.config.root, this.config.scale, this.config.center);
2123
+ }
2124
+ };
2125
+ G.type = "radial", G.maxDimensions = 2, G.zodOptionsSchema = ti;
2126
+ let ne = G;
2127
+ const Fe = 1, si = u({
1994
2128
  scalingFactor: {
1995
2129
  schema: i.number().min(1).max(1e3).default(100),
1996
2130
  meta: {
@@ -2006,25 +2140,25 @@ const Kt = u({
2006
2140
  }
2007
2141
  },
2008
2142
  seed: {
2009
- schema: i.number().positive().nullable().default(null),
2143
+ schema: i.number().positive().nullable().default(Fe),
2010
2144
  meta: {
2011
2145
  label: "Random Seed",
2012
2146
  description: "Seed for reproducible random positions",
2013
2147
  advanced: !0
2014
2148
  }
2015
2149
  }
2016
- }), Vt = i.strictObject({
2150
+ }), ni = i.strictObject({
2017
2151
  ...v.shape,
2018
2152
  center: i.array(i.number()).min(2).max(3).or(i.null()).default(null),
2019
2153
  dim: i.number().default(2),
2020
- seed: i.number().positive().or(i.null()).default(null)
2021
- }), B = class B extends y {
2154
+ seed: i.number().positive().or(i.null()).default(Fe)
2155
+ }), q = class q extends y {
2022
2156
  /**
2023
2157
  * Create a random layout engine
2024
2158
  * @param opts - Configuration options including dimensions and seed
2025
2159
  */
2026
2160
  constructor(e) {
2027
- super(e), this.scalingFactor = 100, this.config = Vt.parse(e);
2161
+ super(e), this.scalingFactor = 100, this.config = ni.parse(e);
2028
2162
  }
2029
2163
  /**
2030
2164
  * Get dimension-specific options for random layout
@@ -2040,12 +2174,12 @@ const Kt = u({
2040
2174
  doLayout() {
2041
2175
  this.stale = !1;
2042
2176
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
2043
- this.positions = Be({ nodes: e, edges: t }, this.config.center, this.config.dim, this.config.seed);
2177
+ this.positions = Ve({ nodes: e, edges: t }, this.config.center, this.config.dim, this.config.seed);
2044
2178
  }
2045
2179
  };
2046
- B.type = "random", B.maxDimensions = 3, B.zodOptionsSchema = Kt;
2047
- let te = B;
2048
- const Yt = u({
2180
+ q.type = "random", q.maxDimensions = 3, q.zodOptionsSchema = si;
2181
+ let ae = q;
2182
+ const ai = u({
2049
2183
  scalingFactor: {
2050
2184
  schema: i.number().min(1).max(1e3).default(100),
2051
2185
  meta: {
@@ -2068,19 +2202,19 @@ const Yt = u({
2068
2202
  description: "Layout dimensionality (2D only for shell)"
2069
2203
  }
2070
2204
  }
2071
- }), $t = i.strictObject({
2205
+ }), oi = i.strictObject({
2072
2206
  ...v.shape,
2073
2207
  nlist: i.array(i.array(i.number())).or(i.null()).default(null),
2074
2208
  dim: i.number().default(2),
2075
2209
  center: i.array(i.number()).length(2).or(i.null()).default(null),
2076
2210
  scale: i.number().positive().default(1)
2077
- }), q = class q extends y {
2211
+ }), j = class j extends y {
2078
2212
  /**
2079
2213
  * Create a shell layout engine
2080
2214
  * @param opts - Configuration options including node lists for each shell
2081
2215
  */
2082
2216
  constructor(e) {
2083
- super(e), this.scalingFactor = 100, this.config = $t.parse(e);
2217
+ super(e), this.scalingFactor = 100, this.config = oi.parse(e);
2084
2218
  }
2085
2219
  /**
2086
2220
  * Get dimension-specific options for shell layout
@@ -2096,7 +2230,7 @@ const Yt = u({
2096
2230
  doLayout() {
2097
2231
  this.stale = !1;
2098
2232
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
2099
- this.positions = qe(
2233
+ this.positions = Ye(
2100
2234
  { nodes: e, edges: t },
2101
2235
  this.config.nlist,
2102
2236
  this.config.scale,
@@ -2105,9 +2239,9 @@ const Yt = u({
2105
2239
  );
2106
2240
  }
2107
2241
  };
2108
- q.type = "shell", q.maxDimensions = 2, q.zodOptionsSchema = Yt;
2109
- let ie = q;
2110
- const Jt = u({
2242
+ j.type = "shell", j.maxDimensions = 2, j.zodOptionsSchema = ai;
2243
+ let oe = j;
2244
+ const ri = u({
2111
2245
  scalingFactor: {
2112
2246
  schema: i.number().min(1).max(1e3).default(100),
2113
2247
  meta: {
@@ -2130,18 +2264,18 @@ const Jt = u({
2130
2264
  description: "Layout dimensionality (2D only for spectral)"
2131
2265
  }
2132
2266
  }
2133
- }), Zt = i.strictObject({
2267
+ }), li = i.strictObject({
2134
2268
  ...v.shape,
2135
2269
  scale: i.number().positive().default(1),
2136
2270
  center: i.array(i.number()).length(2).or(i.null()).default(null),
2137
2271
  dim: i.number().default(2)
2138
- }), G = class G extends y {
2272
+ }), U = class U extends y {
2139
2273
  /**
2140
2274
  * Create a spectral layout engine
2141
2275
  * @param opts - Configuration options including scale and center
2142
2276
  */
2143
2277
  constructor(e) {
2144
- super(e), this.scalingFactor = 100, this.config = Zt.parse(e);
2278
+ super(e), this.scalingFactor = 100, this.config = li.parse(e);
2145
2279
  }
2146
2280
  /**
2147
2281
  * Get dimension-specific options for spectral layout
@@ -2157,12 +2291,12 @@ const Jt = u({
2157
2291
  doLayout() {
2158
2292
  this.stale = !1;
2159
2293
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
2160
- this.positions = Ge({ nodes: e, edges: t }, this.config.scale, this.config.center, this.config.dim);
2294
+ this.positions = $e({ nodes: e, edges: t }, this.config.scale, this.config.center, this.config.dim);
2161
2295
  }
2162
2296
  };
2163
- G.type = "spectral", G.maxDimensions = 2, G.zodOptionsSchema = Jt;
2164
- let se = G;
2165
- const Qt = u({
2297
+ U.type = "spectral", U.maxDimensions = 2, U.zodOptionsSchema = ri;
2298
+ let re = U;
2299
+ const ci = u({
2166
2300
  scalingFactor: {
2167
2301
  schema: i.number().min(1).max(1e3).default(80),
2168
2302
  meta: {
@@ -2202,20 +2336,20 @@ const Qt = u({
2202
2336
  advanced: !0
2203
2337
  }
2204
2338
  }
2205
- }), Xt = i.strictObject({
2339
+ }), di = i.strictObject({
2206
2340
  ...v.shape,
2207
2341
  scale: i.number().positive().default(1),
2208
2342
  center: i.array(i.number()).length(2).or(i.null()).default(null),
2209
2343
  dim: i.number().default(2),
2210
2344
  resolution: i.number().positive().default(0.35),
2211
2345
  equidistant: i.boolean().default(!1)
2212
- }), j = class j extends y {
2346
+ }), H = class H extends y {
2213
2347
  /**
2214
2348
  * Create a spiral layout engine
2215
2349
  * @param opts - Configuration options including resolution and equidistant spacing
2216
2350
  */
2217
2351
  constructor(e) {
2218
- super(e), this.scalingFactor = 80, this.config = Xt.parse(e);
2352
+ super(e), this.scalingFactor = 80, this.config = di.parse(e);
2219
2353
  }
2220
2354
  /**
2221
2355
  * Get dimension-specific options for spiral layout
@@ -2231,7 +2365,7 @@ const Qt = u({
2231
2365
  doLayout() {
2232
2366
  this.stale = !1;
2233
2367
  const e = () => this._nodes.map((s) => s.id), t = () => this._edges.map((s) => [s.srcId, s.dstId]);
2234
- this.positions = je(
2368
+ this.positions = Je(
2235
2369
  { nodes: e, edges: t },
2236
2370
  this.config.scale,
2237
2371
  this.config.center,
@@ -2241,9 +2375,9 @@ const Qt = u({
2241
2375
  );
2242
2376
  }
2243
2377
  };
2244
- j.type = "spiral", j.maxDimensions = 2, j.zodOptionsSchema = Qt;
2245
- let ne = j;
2246
- const ei = u({
2378
+ H.type = "spiral", H.maxDimensions = 2, H.zodOptionsSchema = ci;
2379
+ let le = H;
2380
+ const hi = u({
2247
2381
  springLength: {
2248
2382
  schema: i.number().positive().default(10),
2249
2383
  meta: {
@@ -2309,7 +2443,7 @@ const ei = u({
2309
2443
  advanced: !0
2310
2444
  }
2311
2445
  }
2312
- }), E = class E extends me {
2446
+ }), E = class E extends be {
2313
2447
  /**
2314
2448
  * Get dimension-specific options for the spring-electrical layout.
2315
2449
  * @param dimension - The desired dimension (2 or 3).
@@ -2319,9 +2453,9 @@ const ei = u({
2319
2453
  return { dim: e };
2320
2454
  }
2321
2455
  };
2322
- E.type = "spring-electrical", E.simulationType = "spring-electrical", E.maxDimensions = 3, E.zodOptionsSchema = ei;
2323
- let ae = E;
2324
- const ti = u({
2456
+ E.type = "spring-electrical", E.simulationType = "spring-electrical", E.maxDimensions = 3, E.zodOptionsSchema = hi;
2457
+ let ce = E;
2458
+ const ui = u({
2325
2459
  scalingFactor: {
2326
2460
  schema: i.number().min(1).max(1e3).default(100),
2327
2461
  meta: {
@@ -2367,7 +2501,7 @@ const ti = u({
2367
2501
  advanced: !0
2368
2502
  }
2369
2503
  }
2370
- }), C = class C extends me {
2504
+ }), I = class I extends be {
2371
2505
  /**
2372
2506
  * Get dimension-specific options for spring layout.
2373
2507
  * @param dimension - The desired dimension (2 or 3).
@@ -2377,15 +2511,15 @@ const ti = u({
2377
2511
  return { dim: e };
2378
2512
  }
2379
2513
  };
2380
- C.type = "spring", C.simulationType = "spring", C.maxDimensions = 3, C.zodOptionsSchema = ti;
2381
- let oe = C;
2382
- const D = {
2514
+ I.type = "spring", I.simulationType = "spring", I.maxDimensions = 3, I.zodOptionsSchema = ui;
2515
+ let de = I;
2516
+ const w = {
2383
2517
  seed: { type: "seed" }
2384
2518
  };
2385
2519
  function m(n, e = {}) {
2386
- return Xe(n, { overrides: e });
2520
+ return ot(n, { overrides: e });
2387
2521
  }
2388
- function b(n, e, t = []) {
2522
+ function f(n, e, t = []) {
2389
2523
  return {
2390
2524
  descriptor: {
2391
2525
  ...n,
@@ -2399,162 +2533,180 @@ function b(n, e, t = []) {
2399
2533
  ]
2400
2534
  };
2401
2535
  }
2402
- const ii = {
2536
+ const mi = {
2403
2537
  engine: "ngraph",
2404
2538
  plainName: "NGraph Force",
2405
2539
  technicalName: "ngraph.forcelayout",
2406
2540
  kind: "live",
2407
2541
  maxDimensions: 3,
2408
2542
  reason: "The default: a Barnes-Hut simulation that runs live, accepts nodes and edges added while it is running, and stays interactive on graphs of a hundred thousand nodes.",
2409
- options: m(X.zodOptionsSchema, D),
2410
- honoursWeights: X.honoursWeights
2411
- }, si = {
2543
+ options: m(ie.zodOptionsSchema, w),
2544
+ honoursWeights: ie.honoursWeights
2545
+ }, pi = {
2412
2546
  engine: "d3",
2413
2547
  plainName: "D3 Force",
2414
2548
  technicalName: "d3-force-3d",
2415
2549
  kind: "live",
2416
2550
  maxDimensions: 3,
2417
2551
  reason: "Choose it for d3's own tuning vocabulary -- alpha, alpha decay, velocity decay -- when the arrangement has to match a d3 drawing elsewhere in the product.",
2418
- options: m(Y.zodOptionsSchema),
2419
- honoursWeights: Y.honoursWeights
2420
- }, ni = {
2552
+ options: m(J.zodOptionsSchema),
2553
+ honoursWeights: J.honoursWeights
2554
+ }, gi = {
2421
2555
  engine: "forceatlas2",
2422
2556
  plainName: "ForceAtlas2",
2423
2557
  technicalName: "ForceAtlas2 (Gephi)",
2424
2558
  kind: "live",
2425
2559
  maxDimensions: 3,
2426
2560
  reason: "Choose it for the Gephi look, and for the arrangement an accelerator reproduces first. It keeps running until the layout settles and reheats on a drag or a pin.",
2427
- options: m(J.zodOptionsSchema, D),
2428
- honoursWeights: J.honoursWeights
2429
- }, ai = {
2561
+ options: m(Q.zodOptionsSchema, w),
2562
+ honoursWeights: Q.honoursWeights
2563
+ }, fi = {
2430
2564
  engine: "spring",
2431
2565
  plainName: "Spring",
2432
2566
  technicalName: "Fruchterman-Reingold",
2433
2567
  kind: "live",
2434
2568
  maxDimensions: 3,
2435
2569
  reason: "Choose it when the arrangement must be reproducible from a seed: the same seed gives the same settled shape.",
2436
- options: m(oe.zodOptionsSchema, D),
2437
- honoursWeights: oe.honoursWeights
2438
- }, oi = {
2570
+ options: m(de.zodOptionsSchema, w),
2571
+ honoursWeights: de.honoursWeights
2572
+ }, bi = {
2439
2573
  engine: "spring-electrical",
2440
2574
  plainName: "Spring Electrical",
2441
2575
  technicalName: "ngraph.forcelayout (spring-electrical)",
2442
2576
  kind: "live",
2443
2577
  maxDimensions: 3,
2444
2578
  reason: "Choose it for ngraph's look at a size ngraph cannot reach; it needs a hardware accelerator and says so when there is none.",
2445
- options: m(ae.zodOptionsSchema, D),
2446
- honoursWeights: ae.honoursWeights,
2579
+ options: m(ce.zodOptionsSchema, w),
2580
+ honoursWeights: ce.honoursWeights,
2447
2581
  requires: { accelerator: !0 }
2448
- }, ri = {
2582
+ }, yi = {
2449
2583
  engine: "kamada-kawai",
2450
2584
  plainName: "Kamada-Kawai",
2451
2585
  technicalName: "Kamada-Kawai stress majorization",
2452
2586
  kind: "batch",
2453
2587
  maxDimensions: 3,
2454
2588
  reason: "Choose it for a small graph whose drawn distances should match its graph distances. It solves over every pair of nodes, so it is slow well before the other force engines are.",
2455
- options: m(Z.zodOptionsSchema),
2456
- honoursWeights: Z.honoursWeights
2457
- }, li = {
2589
+ options: m(ee.zodOptionsSchema),
2590
+ honoursWeights: ee.honoursWeights
2591
+ }, vi = {
2458
2592
  engine: "arf",
2459
2593
  plainName: "ARF",
2460
2594
  technicalName: "Attractive and Repulsive Forces",
2461
2595
  kind: "batch",
2462
2596
  maxDimensions: 2,
2463
2597
  reason: "The only registered force engine that is two-dimensional by nature, so a flat result is what it computes rather than what it is flattened into afterwards.",
2464
- options: m(U.zodOptionsSchema, D),
2465
- honoursWeights: U.honoursWeights
2466
- }, ci = {
2598
+ options: m(K.zodOptionsSchema, w),
2599
+ honoursWeights: K.honoursWeights
2600
+ }, xi = {
2467
2601
  engine: "circular",
2468
2602
  plainName: "Circular",
2469
2603
  technicalName: "Circular layout",
2470
2604
  kind: "batch",
2471
2605
  maxDimensions: 3,
2472
2606
  reason: "The only engine that draws this arrangement.",
2473
- options: m(V.zodOptionsSchema),
2474
- honoursWeights: V.honoursWeights
2475
- }, di = {
2607
+ options: m($.zodOptionsSchema),
2608
+ honoursWeights: $.honoursWeights
2609
+ }, Si = {
2476
2610
  engine: "shell",
2477
2611
  plainName: "Shell",
2478
2612
  technicalName: "Shell layout",
2479
2613
  kind: "batch",
2480
2614
  maxDimensions: 2,
2481
2615
  reason: "The only engine that draws this arrangement.",
2482
- options: m(ie.zodOptionsSchema),
2483
- honoursWeights: ie.honoursWeights
2484
- }, hi = {
2616
+ options: m(oe.zodOptionsSchema),
2617
+ honoursWeights: oe.honoursWeights
2618
+ }, Ni = {
2619
+ engine: "radial",
2620
+ plainName: "Radial",
2621
+ technicalName: "Radial layout",
2622
+ kind: "batch",
2623
+ maxDimensions: 2,
2624
+ reason: "The only engine that draws this arrangement.",
2625
+ options: m(ne.zodOptionsSchema),
2626
+ honoursWeights: ne.honoursWeights
2627
+ }, Di = {
2628
+ engine: "grid",
2629
+ plainName: "Grid",
2630
+ technicalName: "Grid layout",
2631
+ kind: "batch",
2632
+ maxDimensions: 2,
2633
+ reason: "The only engine that draws this arrangement.",
2634
+ options: m(X.zodOptionsSchema),
2635
+ honoursWeights: X.honoursWeights
2636
+ }, wi = {
2485
2637
  engine: "spiral",
2486
2638
  plainName: "Spiral",
2487
2639
  technicalName: "Archimedean spiral layout",
2488
2640
  kind: "batch",
2489
2641
  maxDimensions: 2,
2490
2642
  reason: "The only engine that draws this arrangement.",
2491
- options: m(ne.zodOptionsSchema),
2492
- honoursWeights: ne.honoursWeights
2493
- }, ui = {
2643
+ options: m(le.zodOptionsSchema),
2644
+ honoursWeights: le.honoursWeights
2645
+ }, Oi = {
2494
2646
  engine: "spectral",
2495
2647
  plainName: "Spectral",
2496
2648
  technicalName: "Laplacian eigenvector layout",
2497
2649
  kind: "batch",
2498
2650
  maxDimensions: 2,
2499
2651
  reason: "The only engine that draws this arrangement.",
2500
- options: m(se.zodOptionsSchema),
2501
- honoursWeights: se.honoursWeights
2502
- }, mi = {
2652
+ options: m(re.zodOptionsSchema),
2653
+ honoursWeights: re.honoursWeights
2654
+ }, Mi = {
2503
2655
  engine: "planar",
2504
2656
  plainName: "Planar",
2505
2657
  technicalName: "Planar embedding",
2506
2658
  kind: "batch",
2507
2659
  maxDimensions: 2,
2508
2660
  reason: "The only engine that draws this arrangement.",
2509
- options: m(ee.zodOptionsSchema, D),
2510
- honoursWeights: ee.honoursWeights
2511
- }, pi = {
2661
+ options: m(se.zodOptionsSchema, w),
2662
+ honoursWeights: se.honoursWeights
2663
+ }, Ei = {
2512
2664
  engine: "bfs",
2513
2665
  plainName: "BFS Tree",
2514
2666
  technicalName: "Breadth-first tree layout",
2515
2667
  kind: "batch",
2516
2668
  maxDimensions: 2,
2517
2669
  reason: "The only engine that draws this arrangement. It orders each row by breadth-first arrival and does not reduce edge crossings between rows.",
2518
- options: m(H.zodOptionsSchema),
2519
- honoursWeights: H.honoursWeights
2520
- }, gi = {
2670
+ options: m(V.zodOptionsSchema),
2671
+ honoursWeights: V.honoursWeights
2672
+ }, Ii = {
2521
2673
  engine: "bipartite",
2522
2674
  plainName: "Bipartite",
2523
2675
  technicalName: "Bipartite layout",
2524
2676
  kind: "batch",
2525
2677
  maxDimensions: 2,
2526
2678
  reason: "The only engine that draws this arrangement.",
2527
- options: m(K.zodOptionsSchema),
2528
- honoursWeights: K.honoursWeights
2529
- }, fi = {
2679
+ options: m(Y.zodOptionsSchema),
2680
+ honoursWeights: Y.honoursWeights
2681
+ }, Ci = {
2530
2682
  engine: "multipartite",
2531
2683
  plainName: "Multipartite",
2532
2684
  technicalName: "Multipartite layout",
2533
2685
  kind: "batch",
2534
2686
  maxDimensions: 2,
2535
2687
  reason: "The only engine that draws this arrangement.",
2536
- options: m(Q.zodOptionsSchema),
2537
- honoursWeights: Q.honoursWeights
2538
- }, bi = {
2688
+ options: m(te.zodOptionsSchema),
2689
+ honoursWeights: te.honoursWeights
2690
+ }, Ri = {
2539
2691
  engine: "fixed",
2540
2692
  plainName: "Fixed",
2541
2693
  technicalName: "Fixed layout",
2542
2694
  kind: "batch",
2543
2695
  maxDimensions: 3,
2544
2696
  reason: "The only engine that draws this arrangement.",
2545
- options: m($.zodOptionsSchema),
2546
- honoursWeights: $.honoursWeights
2547
- }, yi = {
2697
+ options: m(Z.zodOptionsSchema),
2698
+ honoursWeights: Z.honoursWeights
2699
+ }, ki = {
2548
2700
  engine: "random",
2549
2701
  plainName: "Random",
2550
2702
  technicalName: "Random layout",
2551
2703
  kind: "batch",
2552
2704
  maxDimensions: 3,
2553
2705
  reason: "The only engine that draws this arrangement.",
2554
- options: m(te.zodOptionsSchema, D),
2555
- honoursWeights: te.honoursWeights
2556
- }, pe = [
2557
- b(
2706
+ options: m(ae.zodOptionsSchema, w),
2707
+ honoursWeights: ae.honoursWeights
2708
+ }, ye = [
2709
+ f(
2558
2710
  {
2559
2711
  id: "force",
2560
2712
  plainName: "Spread Out",
@@ -2566,10 +2718,10 @@ const ii = {
2566
2718
  sizeRating: "any",
2567
2719
  structuralInputs: []
2568
2720
  },
2569
- ii,
2570
- [si, ni, ai, ri, oi]
2721
+ mi,
2722
+ [pi, gi, fi, yi, bi]
2571
2723
  ),
2572
- b(
2724
+ f(
2573
2725
  {
2574
2726
  id: "force-2d",
2575
2727
  plainName: "Spread Out, Flat",
@@ -2581,9 +2733,9 @@ const ii = {
2581
2733
  sizeRating: 2e3,
2582
2734
  structuralInputs: []
2583
2735
  },
2584
- li
2736
+ vi
2585
2737
  ),
2586
- b(
2738
+ f(
2587
2739
  {
2588
2740
  id: "circular",
2589
2741
  plainName: "Ring",
@@ -2595,9 +2747,37 @@ const ii = {
2595
2747
  sizeRating: "any",
2596
2748
  structuralInputs: []
2597
2749
  },
2598
- ci
2750
+ xi
2751
+ ),
2752
+ f(
2753
+ {
2754
+ id: "radial",
2755
+ plainName: "Rings from a Node",
2756
+ technicalName: "Radial layout",
2757
+ description: "Puts one node at the centre and every other node on a ring by how many steps away it is, so the rings read outward as distance from that node.",
2758
+ family: "geometric",
2759
+ kind: "batch",
2760
+ maxDimensions: 2,
2761
+ sizeRating: "any",
2762
+ structuralInputs: []
2763
+ },
2764
+ Ni
2599
2765
  ),
2600
- b(
2766
+ f(
2767
+ {
2768
+ id: "grid",
2769
+ plainName: "Grid",
2770
+ technicalName: "Grid layout",
2771
+ description: "Places nodes in evenly spaced rows and columns, in the order the nodes were loaded.",
2772
+ family: "geometric",
2773
+ kind: "batch",
2774
+ maxDimensions: 2,
2775
+ sizeRating: "any",
2776
+ structuralInputs: []
2777
+ },
2778
+ Di
2779
+ ),
2780
+ f(
2601
2781
  {
2602
2782
  id: "shell",
2603
2783
  plainName: "Concentric Rings",
@@ -2609,9 +2789,9 @@ const ii = {
2609
2789
  sizeRating: "any",
2610
2790
  structuralInputs: ["partition"]
2611
2791
  },
2612
- di
2792
+ Si
2613
2793
  ),
2614
- b(
2794
+ f(
2615
2795
  {
2616
2796
  id: "spiral",
2617
2797
  plainName: "Spiral",
@@ -2623,9 +2803,9 @@ const ii = {
2623
2803
  sizeRating: "any",
2624
2804
  structuralInputs: []
2625
2805
  },
2626
- hi
2806
+ wi
2627
2807
  ),
2628
- b(
2808
+ f(
2629
2809
  {
2630
2810
  id: "spectral",
2631
2811
  plainName: "Natural Grouping",
@@ -2637,9 +2817,9 @@ const ii = {
2637
2817
  sizeRating: 2e3,
2638
2818
  structuralInputs: []
2639
2819
  },
2640
- ui
2820
+ Oi
2641
2821
  ),
2642
- b(
2822
+ f(
2643
2823
  {
2644
2824
  id: "planar",
2645
2825
  plainName: "No Crossings",
@@ -2651,9 +2831,9 @@ const ii = {
2651
2831
  sizeRating: 2e3,
2652
2832
  structuralInputs: []
2653
2833
  },
2654
- mi
2834
+ Mi
2655
2835
  ),
2656
- b(
2836
+ f(
2657
2837
  {
2658
2838
  id: "random",
2659
2839
  plainName: "Scattered",
@@ -2665,9 +2845,9 @@ const ii = {
2665
2845
  sizeRating: "any",
2666
2846
  structuralInputs: []
2667
2847
  },
2668
- yi
2848
+ ki
2669
2849
  ),
2670
- b(
2850
+ f(
2671
2851
  {
2672
2852
  id: "hierarchical",
2673
2853
  plainName: "Tree",
@@ -2679,9 +2859,9 @@ const ii = {
2679
2859
  sizeRating: "any",
2680
2860
  structuralInputs: ["node"]
2681
2861
  },
2682
- pi
2862
+ Ei
2683
2863
  ),
2684
- b(
2864
+ f(
2685
2865
  {
2686
2866
  id: "bipartite",
2687
2867
  plainName: "Two Columns",
@@ -2693,9 +2873,9 @@ const ii = {
2693
2873
  sizeRating: "any",
2694
2874
  structuralInputs: ["partition"]
2695
2875
  },
2696
- gi
2876
+ Ii
2697
2877
  ),
2698
- b(
2878
+ f(
2699
2879
  {
2700
2880
  id: "layers",
2701
2881
  plainName: "Columns by Group",
@@ -2707,9 +2887,9 @@ const ii = {
2707
2887
  sizeRating: "any",
2708
2888
  structuralInputs: ["partition"]
2709
2889
  },
2710
- fi
2890
+ Ci
2711
2891
  ),
2712
- b(
2892
+ f(
2713
2893
  {
2714
2894
  id: "fixed",
2715
2895
  plainName: "Keep Positions",
@@ -2721,38 +2901,29 @@ const ii = {
2721
2901
  sizeRating: "any",
2722
2902
  structuralInputs: []
2723
2903
  },
2724
- bi
2904
+ Ri
2725
2905
  )
2726
- ], vi = pe.map((n) => n.descriptor), ki = [
2727
- {
2728
- id: "radial",
2729
- reason: "No engine arranges a graph in rings by distance from a chosen node. The spiral layout winds outward but orders nodes by position in the list, not by the graph, so it answers a different question and is published under its own name instead."
2730
- },
2731
- {
2732
- id: "grid",
2733
- reason: "No engine places nodes on a regular lattice."
2734
- }
2735
- ];
2736
- function zi(n) {
2737
- return vi.find((e) => e.id === n) ?? Ee(n)?.descriptor;
2906
+ ], zi = ye.map((n) => n.descriptor), Ui = [];
2907
+ function Hi(n) {
2908
+ return zi.find((e) => e.id === n) ?? ke(n)?.descriptor;
2738
2909
  }
2739
- function Fi(n) {
2740
- return pe.find((e) => e.descriptor.id === n);
2910
+ function Ki(n) {
2911
+ return ye.find((e) => e.descriptor.id === n);
2741
2912
  }
2742
- function Li(n) {
2743
- const e = pe.find(
2913
+ function Vi(n) {
2914
+ const e = ye.find(
2744
2915
  (t) => t.implementations.some((s) => s.engine === n)
2745
2916
  );
2746
- return e !== void 0 ? e.descriptor.id : Ee(n)?.descriptor.id;
2917
+ return e !== void 0 ? e.descriptor.id : ke(n)?.descriptor.id;
2747
2918
  }
2748
- const f = ["deuteranopia", "protanopia", "tritanopia"], ge = Object.freeze([
2919
+ const b = ["deuteranopia", "protanopia", "tritanopia"], ve = Object.freeze([
2749
2920
  {
2750
2921
  id: "viridis",
2751
2922
  plainName: "Purple to Yellow",
2752
2923
  kind: "sequential",
2753
- colors: it,
2924
+ colors: ct,
2754
2925
  capacity: null,
2755
- colorblindSafe: f
2926
+ colorblindSafe: b
2756
2927
  },
2757
2928
  // Paul Tol, "Colour Schemes" (2021): YlOrBr, trimmed to the steps that stand off a light
2758
2929
  // background. The default for a measurement.
@@ -2760,39 +2931,39 @@ const f = ["deuteranopia", "protanopia", "tritanopia"], ge = Object.freeze([
2760
2931
  id: "ylorbr",
2761
2932
  plainName: "Orange to Brown",
2762
2933
  kind: "sequential",
2763
- colors: st,
2934
+ colors: dt,
2764
2935
  capacity: null,
2765
- colorblindSafe: f
2936
+ colorblindSafe: b
2766
2937
  },
2767
2938
  {
2768
2939
  id: "plasma",
2769
2940
  plainName: "Blue to Yellow",
2770
2941
  kind: "sequential",
2771
- colors: nt,
2942
+ colors: ht,
2772
2943
  capacity: null,
2773
- colorblindSafe: f
2944
+ colorblindSafe: b
2774
2945
  },
2775
2946
  {
2776
2947
  id: "inferno",
2777
2948
  plainName: "Black to Yellow",
2778
2949
  kind: "sequential",
2779
- colors: at,
2950
+ colors: ut,
2780
2951
  capacity: null,
2781
- colorblindSafe: f
2952
+ colorblindSafe: b
2782
2953
  },
2783
2954
  {
2784
2955
  id: "blues",
2785
2956
  plainName: "Shades of Blue",
2786
2957
  kind: "sequential",
2787
- colors: ot,
2958
+ colors: mt,
2788
2959
  capacity: null,
2789
- colorblindSafe: f
2960
+ colorblindSafe: b
2790
2961
  },
2791
2962
  {
2792
2963
  id: "greens",
2793
2964
  plainName: "Shades of Green",
2794
2965
  kind: "sequential",
2795
- colors: rt,
2966
+ colors: pt,
2796
2967
  capacity: null,
2797
2968
  colorblindSafe: []
2798
2969
  },
@@ -2800,7 +2971,7 @@ const f = ["deuteranopia", "protanopia", "tritanopia"], ge = Object.freeze([
2800
2971
  id: "oranges",
2801
2972
  plainName: "Shades of Orange",
2802
2973
  kind: "sequential",
2803
- colors: lt,
2974
+ colors: gt,
2804
2975
  capacity: null,
2805
2976
  colorblindSafe: []
2806
2977
  },
@@ -2808,63 +2979,63 @@ const f = ["deuteranopia", "protanopia", "tritanopia"], ge = Object.freeze([
2808
2979
  id: "okabe-ito",
2809
2980
  plainName: "Eight Distinct Colours",
2810
2981
  kind: "categorical",
2811
- colors: be,
2812
- capacity: be.length,
2813
- colorblindSafe: f
2982
+ colors: Se,
2983
+ capacity: Se.length,
2984
+ colorblindSafe: b
2814
2985
  },
2815
2986
  {
2816
2987
  id: "tol-vibrant",
2817
2988
  plainName: "Seven Bright Colours",
2818
2989
  kind: "categorical",
2819
- colors: ye,
2820
- capacity: ye.length,
2821
- colorblindSafe: f
2990
+ colors: Ne,
2991
+ capacity: Ne.length,
2992
+ colorblindSafe: b
2822
2993
  },
2823
2994
  {
2824
2995
  id: "tol-muted",
2825
2996
  plainName: "Nine Soft Colours",
2826
2997
  kind: "categorical",
2827
- colors: ve,
2828
- capacity: ve.length,
2829
- colorblindSafe: f
2998
+ colors: De,
2999
+ capacity: De.length,
3000
+ colorblindSafe: b
2830
3001
  },
2831
3002
  {
2832
3003
  id: "pastel",
2833
3004
  plainName: "Eight Pale Colours",
2834
3005
  kind: "categorical",
2835
- colors: xe,
2836
- capacity: xe.length,
2837
- colorblindSafe: f
3006
+ colors: we,
3007
+ capacity: we.length,
3008
+ colorblindSafe: b
2838
3009
  },
2839
3010
  {
2840
3011
  id: "carbon",
2841
3012
  plainName: "Five Enterprise Colours",
2842
3013
  kind: "categorical",
2843
- colors: Se,
2844
- capacity: Se.length,
3014
+ colors: Oe,
3015
+ capacity: Oe.length,
2845
3016
  colorblindSafe: []
2846
3017
  },
2847
3018
  {
2848
3019
  id: "purple-green",
2849
3020
  plainName: "Purple to Green",
2850
3021
  kind: "diverging",
2851
- colors: ct,
3022
+ colors: ft,
2852
3023
  capacity: null,
2853
- colorblindSafe: f
3024
+ colorblindSafe: b
2854
3025
  },
2855
3026
  {
2856
3027
  id: "blue-orange",
2857
3028
  plainName: "Blue to Orange",
2858
3029
  kind: "diverging",
2859
- colors: dt,
3030
+ colors: bt,
2860
3031
  capacity: null,
2861
- colorblindSafe: f
3032
+ colorblindSafe: b
2862
3033
  },
2863
3034
  {
2864
3035
  id: "red-blue",
2865
3036
  plainName: "Red to Blue",
2866
3037
  kind: "diverging",
2867
- colors: ht,
3038
+ colors: yt,
2868
3039
  capacity: null,
2869
3040
  colorblindSafe: []
2870
3041
  },
@@ -2872,36 +3043,36 @@ const f = ["deuteranopia", "protanopia", "tritanopia"], ge = Object.freeze([
2872
3043
  id: "blue-highlight",
2873
3044
  plainName: "Blue Highlight",
2874
3045
  kind: "categorical",
2875
- colors: [Ne.highlighted, Ne.muted],
3046
+ colors: [Me.highlighted, Me.muted],
2876
3047
  capacity: 2,
2877
- colorblindSafe: f
3048
+ colorblindSafe: b
2878
3049
  },
2879
3050
  {
2880
3051
  id: "green-highlight",
2881
3052
  plainName: "Green Highlight",
2882
3053
  kind: "categorical",
2883
- colors: [we.highlighted, we.muted],
3054
+ colors: [Ee.highlighted, Ee.muted],
2884
3055
  capacity: 2,
2885
- colorblindSafe: f
3056
+ colorblindSafe: b
2886
3057
  },
2887
3058
  {
2888
3059
  id: "orange-highlight",
2889
3060
  plainName: "Orange Highlight",
2890
3061
  kind: "categorical",
2891
- colors: [De.highlighted, De.muted],
3062
+ colors: [Ie.highlighted, Ie.muted],
2892
3063
  capacity: 2,
2893
- colorblindSafe: f
3064
+ colorblindSafe: b
2894
3065
  }
2895
3066
  ]);
2896
- function Pi(n) {
2897
- return ge.find((e) => e.id === n) ?? Ke(n);
3067
+ function Yi(n) {
3068
+ return ve.find((e) => e.id === n) ?? Xe(n);
2898
3069
  }
2899
- function Ti(n) {
2900
- const e = ge.filter((s) => s.kind === n), t = Ce().filter((s) => s.kind === n);
3070
+ function $i(n) {
3071
+ const e = ve.filter((s) => s.kind === n), t = ze().filter((s) => s.kind === n);
2901
3072
  return t.length === 0 ? e : [...e, ...t];
2902
3073
  }
2903
- function Wi() {
2904
- return [...ge, ...Ce()].map((n) => String(n.id));
3074
+ function Ji() {
3075
+ return [...ve, ...ze()].map((n) => String(n.id));
2905
3076
  }
2906
3077
  const x = {
2907
3078
  name: "reverse",
@@ -2917,7 +3088,7 @@ const x = {
2917
3088
  type: "number",
2918
3089
  description: "The value that lands on the middle colour of a diverging palette."
2919
3090
  };
2920
- function Me(n, e, t) {
3091
+ function Re(n, e, t) {
2921
3092
  return {
2922
3093
  name: "bins",
2923
3094
  plainName: n,
@@ -2930,7 +3101,7 @@ function Me(n, e, t) {
2930
3101
  description: e
2931
3102
  };
2932
3103
  }
2933
- const Ie = [
3104
+ const Pe = [
2934
3105
  {
2935
3106
  name: "linear",
2936
3107
  plainName: "Even Steps",
@@ -2980,7 +3151,7 @@ const Ie = [
2980
3151
  plainName: "Equal Ranges",
2981
3152
  domainKind: "numeric",
2982
3153
  options: [
2983
- Me("Groups", "How many equally wide ranges to cut the values into.", 5),
3154
+ Re("Groups", "How many equally wide ranges to cut the values into.", 5),
2984
3155
  x
2985
3156
  ]
2986
3157
  },
@@ -2989,7 +3160,7 @@ const Ie = [
2989
3160
  plainName: "Equal Counts",
2990
3161
  domainKind: "numeric",
2991
3162
  options: [
2992
- Me("Groups", "How many groups of equal size to sort the values into.", 4),
3163
+ Re("Groups", "How many groups of equal size to sort the values into.", 4),
2993
3164
  x
2994
3165
  ]
2995
3166
  },
@@ -3006,42 +3177,44 @@ const Ie = [
3006
3177
  options: []
3007
3178
  }
3008
3179
  ];
3009
- function _i(n) {
3010
- return Ie.find((e) => e.name === n);
3180
+ function Zi(n) {
3181
+ return Pe.find((e) => e.name === n);
3011
3182
  }
3012
- function Ai(n) {
3013
- return Ie.filter((e) => e.domainKind === n);
3183
+ function Qi(n) {
3184
+ return Pe.filter((e) => e.domainKind === n);
3014
3185
  }
3015
3186
  export {
3016
- U as A,
3017
- H as B,
3018
- V as C,
3019
- Y as D,
3020
- J as F,
3021
- Z as K,
3022
- vi as L,
3023
- Q as M,
3024
- X as N,
3025
- ge as P,
3026
- te as R,
3027
- Ie as S,
3028
- ki as U,
3029
- pe as a,
3030
- Fi as b,
3031
- Li as c,
3032
- Ti as d,
3033
- Ai as e,
3034
- ne as f,
3035
- ie as g,
3036
- oe as h,
3037
- ae as i,
3038
- ee as j,
3039
- Wi as k,
3040
- zi as l,
3041
- se as m,
3042
- K as n,
3043
- $ as o,
3044
- Pi as p,
3045
- me as q,
3046
- _i as s
3187
+ K as A,
3188
+ V as B,
3189
+ $ as C,
3190
+ J as D,
3191
+ Q as F,
3192
+ X as G,
3193
+ ee as K,
3194
+ zi as L,
3195
+ te as M,
3196
+ ie as N,
3197
+ ve as P,
3198
+ ae as R,
3199
+ Pe as S,
3200
+ Ui as U,
3201
+ ye as a,
3202
+ Ki as b,
3203
+ Vi as c,
3204
+ $i as d,
3205
+ Qi as e,
3206
+ le as f,
3207
+ oe as g,
3208
+ de as h,
3209
+ ce as i,
3210
+ se as j,
3211
+ Ji as k,
3212
+ Hi as l,
3213
+ re as m,
3214
+ Y as n,
3215
+ Z as o,
3216
+ Yi as p,
3217
+ ne as q,
3218
+ be as r,
3219
+ Zi as s
3047
3220
  };