@qe-libs/qeviz 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/qeviz.es.js CHANGED
@@ -2,9 +2,9 @@ var ri = Object.defineProperty;
2
2
  var Fs = (d) => {
3
3
  throw TypeError(d);
4
4
  };
5
- var u = (d, t) => ri(d, "name", { value: t, configurable: !0 });
5
+ var _ = (d, t) => ri(d, "name", { value: t, configurable: !0 });
6
6
  var js = (d, t, e) => t.has(d) || Fs("Cannot " + e);
7
- var k = (d, t, e) => (js(d, t, "read from private field"), e ? e.call(d) : t.get(d)), et = (d, t, e) => t.has(d) ? Fs("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(d) : t.set(d, e), B = (d, t, e, s) => (js(d, t, "write to private field"), s ? s.call(d, e) : t.set(d, e), e);
7
+ var k = (d, t, e) => (js(d, t, "read from private field"), e ? e.call(d) : t.get(d)), et = (d, t, e) => t.has(d) ? Fs("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(d) : t.set(d, e), H = (d, t, e, s) => (js(d, t, "write to private field"), s ? s.call(d, e) : t.set(d, e), e);
8
8
  var ae, he, le, bt, ce;
9
9
  const es = class es extends Array {
10
10
  constructor(e, s, i, n, r) {
@@ -14,7 +14,7 @@ const es = class es extends Array {
14
14
  et(this, le);
15
15
  et(this, bt);
16
16
  et(this, ce);
17
- B(this, le, e), B(this, he, i), B(this, bt, n), B(this, ce, n == null ? void 0 : n.classes), B(this, ae, r);
17
+ H(this, le, e), H(this, he, i), H(this, bt, n), H(this, ce, n == null ? void 0 : n.classes), H(this, ae, r);
18
18
  }
19
19
  get parent() {
20
20
  return k(this, bt);
@@ -47,24 +47,24 @@ const es = class es extends Array {
47
47
  console.error("DataFrameRow does not currently support filtering.");
48
48
  }
49
49
  };
50
- ae = new WeakMap(), he = new WeakMap(), le = new WeakMap(), bt = new WeakMap(), ce = new WeakMap(), u(es, "DataFrameRow");
50
+ ae = new WeakMap(), he = new WeakMap(), le = new WeakMap(), bt = new WeakMap(), ce = new WeakMap(), _(es, "DataFrameRow");
51
51
  let Ht = es;
52
- var oi = /* @__PURE__ */ ((d) => (d.Character = "character", d.Double = "double", d.Logical = "logical", d.Integer = "integer", d))(oi || {}), _e, yt, Ut, Nt;
52
+ var oi = /* @__PURE__ */ ((d) => (d.Character = "character", d.Double = "double", d.Logical = "logical", d.Integer = "integer", d))(oi || {}), ue, yt, Ut, Nt;
53
53
  const ss = class ss extends Array {
54
54
  constructor(e, s, i, n) {
55
55
  super(s.length);
56
- et(this, _e);
56
+ et(this, ue);
57
57
  et(this, yt);
58
58
  et(this, Ut);
59
59
  et(this, Nt);
60
60
  for (let r = 0; r < s.length; r++)
61
61
  this[r] = s[r];
62
- if (B(this, _e, e), s.type !== void 0 ? B(this, yt, s.type) : s.every((r) => typeof r == "string" || r === null || r === void 0) ? B(this, yt, "character") : s.every((r) => Number.isInteger(r) || r === null || r === void 0) ? s.every((r) => r === 0 || r === 1 || r === null || r === void 0) ? B(this, yt, "logical") : B(this, yt, "integer") : s.every((r) => typeof r == "number" || r === null || r === void 0) ? B(this, yt, "double") : s.every((r) => typeof r == "boolean" || r === null || r === void 0) ? B(this, yt, "logical") : B(this, yt, "character"), B(this, Nt, n), i && i.length !== this.length)
62
+ if (H(this, ue, e), s.type !== void 0 ? H(this, yt, s.type) : s.every((r) => typeof r == "string" || r === null || r === void 0) ? H(this, yt, "character") : s.every((r) => Number.isInteger(r) || r === null || r === void 0) ? s.every((r) => r === 0 || r === 1 || r === null || r === void 0) ? H(this, yt, "logical") : H(this, yt, "integer") : s.every((r) => typeof r == "number" || r === null || r === void 0) ? H(this, yt, "double") : s.every((r) => typeof r == "boolean" || r === null || r === void 0) ? H(this, yt, "logical") : H(this, yt, "character"), H(this, Nt, n), i && i.length !== this.length)
63
63
  throw new Error("Row names length must match the number of rows in the DataFrameColumn.");
64
- i && i.length > 0 ? B(this, Ut, i) : B(this, Ut, void 0);
64
+ i && i.length > 0 ? H(this, Ut, i) : H(this, Ut, void 0);
65
65
  }
66
66
  get name() {
67
- return k(this, _e);
67
+ return k(this, ue);
68
68
  }
69
69
  get type() {
70
70
  return k(this, yt);
@@ -81,9 +81,9 @@ const ss = class ss extends Array {
81
81
  return k(this, Nt).rows(...e);
82
82
  }
83
83
  };
84
- _e = new WeakMap(), yt = new WeakMap(), Ut = new WeakMap(), Nt = new WeakMap(), u(ss, "DataFrameColumn");
84
+ ue = new WeakMap(), yt = new WeakMap(), Ut = new WeakMap(), Nt = new WeakMap(), _(ss, "DataFrameColumn");
85
85
  let ye = ss;
86
- var Et, ct, ue;
86
+ var Et, ct, _e;
87
87
  const Zt = class Zt extends Array {
88
88
  constructor(e, s, i, n) {
89
89
  if ((!e || !s) && (s = [], e = []), s.map((r) => r.length).every((r) => r === e.length)) {
@@ -99,17 +99,17 @@ const Zt = class Zt extends Array {
99
99
  super(s.length);
100
100
  et(this, Et);
101
101
  et(this, ct);
102
- et(this, ue);
102
+ et(this, _e);
103
103
  if (s.forEach((r, a) => {
104
104
  r instanceof ye ? this[a] = r : this[a] = new ye(e[a], r, i, this);
105
- }), B(this, Et, e), i && this[0] && i.length !== this[0].length)
105
+ }), H(this, Et, e), i && this[0] && i.length !== this[0].length)
106
106
  throw new Error("Row names length must match the number of rows in the DataFrame.");
107
- if (i && i.length > 0 && B(this, ct, i), n && n.length !== this.length)
107
+ if (i && i.length > 0 && H(this, ct, i), n && n.length !== this.length)
108
108
  throw new Error("Classes length must match the number of columns in the DataFrame.");
109
- n && n.length > 0 && B(this, ue, n);
109
+ n && n.length > 0 && H(this, _e, n);
110
110
  }
111
111
  get classes() {
112
- return k(this, ue);
112
+ return k(this, _e);
113
113
  }
114
114
  getColumnByName(e) {
115
115
  const s = k(this, Et).indexOf(e);
@@ -196,7 +196,7 @@ const Zt = class Zt extends Array {
196
196
  return this.length;
197
197
  }
198
198
  };
199
- Et = new WeakMap(), ct = new WeakMap(), ue = new WeakMap(), u(Zt, "DataFrame");
199
+ Et = new WeakMap(), ct = new WeakMap(), _e = new WeakMap(), _(Zt, "DataFrame");
200
200
  let Yt = Zt;
201
201
  const is = class is {
202
202
  constructor(t = {}) {
@@ -285,15 +285,15 @@ const is = class is {
285
285
  this[t] = e;
286
286
  }
287
287
  };
288
- u(is, "Model");
288
+ _(is, "Model");
289
289
  let Xe = is;
290
290
  const ai = globalThis.__QEVIZ_DEBUG__ === !0;
291
291
  function Ys(...d) {
292
292
  ai && console.log(...d);
293
293
  }
294
- u(Ys, "dbg");
294
+ _(Ys, "dbg");
295
295
  const Pi = {
296
- get: /* @__PURE__ */ u((d) => {
296
+ get: /* @__PURE__ */ _((d) => {
297
297
  const t = [...document.querySelectorAll("qe-graph")];
298
298
  return typeof d == "number" && d >= 0 ? t[d] : t;
299
299
  }, "get")
@@ -349,40 +349,40 @@ const Pi = {
349
349
  setModelData(t) {
350
350
  var r, a, h, o;
351
351
  ["nodes", "edges", "points", "groups", "confidence", "outlier", "trajectories", "networks", "pointsets"].forEach((l) => {
352
- var v;
353
- const _ = t[l];
354
- if (!((v = _ == null ? void 0 : _.data) != null && v.length)) return;
355
- const g = _.data, c = _.types || {}, E = Object.keys(g[0]), m = g.map((F) => Object.values(F)), S = E.map((F) => c[F] ?? "character");
356
- let R;
357
- l === "networks" ? R = "name" : l === "pointsets" ? R = "id" : l === "nodes" ? R = t.node_id_col ?? E.find((F) => (c[F] ?? "character") === "character") : l === "edges" || l === "points" || l === "trajectories" ? R = t.id_col ?? E.find((F) => (c[F] ?? "character") === "character") : R = t.group_col ?? E.find((F) => (c[F] ?? "character") === "character");
358
- const j = R ? E.indexOf(R) : 0, Y = m.map((F) => String(F[j]));
359
- this._model.setByKey(l, new Yt(E, m, Y, S));
352
+ var E;
353
+ const u = t[l];
354
+ if (!((E = u == null ? void 0 : u.data) != null && E.length)) return;
355
+ const g = u.data, c = u.types || {}, v = Object.keys(g[0]), m = g.map((j) => Object.values(j)), A = v.map((j) => c[j] ?? "character");
356
+ let O;
357
+ l === "networks" ? O = "name" : l === "pointsets" ? O = "id" : l === "nodes" ? O = t.node_id_col ?? v.find((j) => (c[j] ?? "character") === "character") : l === "edges" || l === "points" || l === "trajectories" ? O = t.id_col ?? v.find((j) => (c[j] ?? "character") === "character") : O = t.group_col ?? v.find((j) => (c[j] ?? "character") === "character");
358
+ const F = O ? v.indexOf(O) : 0, Y = m.map((j) => String(j[F]));
359
+ this._model.setByKey(l, new Yt(v, m, Y, A));
360
360
  }), t.updated !== void 0 && this._model.setByKey("updated", t.updated), t.directed !== void 0 && (this._model.directed = t.directed), Array.isArray(t.palette) && (this._model.palette = t.palette.map(String));
361
361
  const s = this._model.nodes;
362
362
  this._model.node_id_col = t.node_id_col ?? ((r = s == null ? void 0 : s.names) == null ? void 0 : r.find((l) => {
363
- var _;
364
- return ((_ = s.col(l)) == null ? void 0 : _.type) === "character";
363
+ var u;
364
+ return ((u = s.col(l)) == null ? void 0 : u.type) === "character";
365
365
  })) ?? "id";
366
366
  const i = this._model.points;
367
367
  this._model.unit_id_col = t.id_col ?? ((a = i == null ? void 0 : i.names) == null ? void 0 : a.find((l) => {
368
- var _;
369
- return ((_ = i.col(l)) == null ? void 0 : _.type) === "character";
368
+ var u;
369
+ return ((u = i.col(l)) == null ? void 0 : u.type) === "character";
370
370
  })) ?? "id";
371
371
  const n = this._model.unit_id_col;
372
372
  if (this._model.group_col = t.group_col ?? ((h = i == null ? void 0 : i.names) == null ? void 0 : h.find((l) => {
373
- var _;
374
- return l !== n && ((_ = i.col(l)) == null ? void 0 : _.type) === "character";
373
+ var u;
374
+ return l !== n && ((u = i.col(l)) == null ? void 0 : u.type) === "character";
375
375
  })) ?? null, (o = s == null ? void 0 : s.names) != null && o.length) {
376
- const l = this._model.node_id_col, _ = t.x_col, g = t.y_col;
377
- if (_ && g)
378
- this._model.dimensions = [_, g];
376
+ const l = this._model.node_id_col, u = t.x_col, g = t.y_col;
377
+ if (u && g)
378
+ this._model.dimensions = [u, g];
379
379
  else {
380
- const c = s.names.filter((E) => {
381
- if (E === l) return !1;
382
- const m = s.col(E);
380
+ const c = s.names.filter((v) => {
381
+ if (v === l) return !1;
382
+ const m = s.col(v);
383
383
  return m && m.type !== "character" && m.type !== "logical";
384
384
  });
385
- c.length >= 2 && (this._model.dimensions = [_ ?? c[0], g ?? c[1]]);
385
+ c.length >= 2 && (this._model.dimensions = [u ?? c[0], g ?? c[1]]);
386
386
  }
387
387
  }
388
388
  this.updated = this._model.updated !== void 0 ? String(this._model.updated) : String(Date.now()), Ys("Model updated via setModelData:", this.updated), this.render();
@@ -398,7 +398,7 @@ const Pi = {
398
398
  this._isVisible ? this.classList.remove("hidden") : this.classList.add("hidden"), ((t = this._model) == null ? void 0 : t.updated) !== void 0 && this._model.updated !== null ? this._outputElement.innerHTML = `${this.output}<slot></slot>` : this._outputElement.innerHTML = "Define the model on the left.";
399
399
  }
400
400
  };
401
- u(zt, "QEVisualElement"), zt.tagName = "qe-visual", zt.styles = `
401
+ _(zt, "QEVisualElement"), zt.tagName = "qe-visual", zt.styles = `
402
402
  :host { display: block; width: 100%; }
403
403
  :host(.hidden) { display: none !important; }
404
404
  /* The output wrapper and the slotted graph fill the host so the plot
@@ -461,7 +461,7 @@ const dt = class dt {
461
461
  return `rgb(${t}, ${e}, ${s})`;
462
462
  }
463
463
  };
464
- u(dt, "Color"), dt._cssCache = /* @__PURE__ */ new Map();
464
+ _(dt, "Color"), dt._cssCache = /* @__PURE__ */ new Map();
465
465
  let st = dt;
466
466
  const Qt = class Qt extends st {
467
467
  constructor(t, e, s) {
@@ -469,7 +469,7 @@ const Qt = class Qt extends st {
469
469
  }
470
470
  // Parse hex → HSV (h in [0, 360), s/v in [0, 1]).
471
471
  static toHSV(t) {
472
- const { r: e, g: s, b: i } = st.parseColor(t), n = e / 255, r = s / 255, a = i / 255, h = Math.max(n, r, a), o = Math.min(n, r, a), l = h - o, _ = h, g = h === 0 ? 0 : l / h;
472
+ const { r: e, g: s, b: i } = st.parseColor(t), n = e / 255, r = s / 255, a = i / 255, h = Math.max(n, r, a), o = Math.min(n, r, a), l = h - o, u = h, g = h === 0 ? 0 : l / h;
473
473
  let c = 0;
474
474
  if (l > 0)
475
475
  switch (h) {
@@ -482,7 +482,7 @@ const Qt = class Qt extends st {
482
482
  default:
483
483
  c = ((n - r) / l + 4) / 6;
484
484
  }
485
- return { h: c * 360, s: g, v: _ };
485
+ return { h: c * 360, s: g, v: u };
486
486
  }
487
487
  // Convert HSV + alpha → rgba() CSS string.
488
488
  static hsvToRgba(t, e, s, i) {
@@ -505,7 +505,7 @@ const Qt = class Qt extends st {
505
505
  return Qt.hsvToRgba(t, s, e, i);
506
506
  }
507
507
  };
508
- u(Qt, "WeightedColor");
508
+ _(Qt, "WeightedColor");
509
509
  let we = Qt;
510
510
  const ns = class ns {
511
511
  constructor(t = null) {
@@ -584,7 +584,7 @@ const ns = class ns {
584
584
  return this.get("f");
585
585
  }
586
586
  };
587
- u(ns, "Transform");
587
+ _(ns, "Transform");
588
588
  let se = ns;
589
589
  var ie;
590
590
  ((d) => {
@@ -592,126 +592,126 @@ var ie;
592
592
  function e(s) {
593
593
  return `matrix(${["a", "b", "c", "d", "e", "f"].map((n) => s[n]).join(" ")})`;
594
594
  }
595
- u(e, "matrixString"), t.matrixString = e;
595
+ _(e, "matrixString"), t.matrixString = e;
596
596
  })(d.Matrix || (d.Matrix = {})), ((t) => {
597
597
  ((s) => {
598
598
  function i(r, a, h) {
599
599
  const o = e.toRad(a);
600
600
  return [r[0] + h * Math.cos(o), r[1] + h * Math.sin(o)];
601
601
  }
602
- u(i, "translate"), s.translate = i;
602
+ _(i, "translate"), s.translate = i;
603
603
  function n(r, a, h) {
604
604
  const o = e.toRad(a);
605
- function l(_, g) {
605
+ function l(u, g) {
606
606
  return [
607
- _[0] * Math.cos(g) - _[1] * Math.sin(g),
608
- _[0] * Math.sin(g) + _[1] * Math.cos(g)
607
+ u[0] * Math.cos(g) - u[1] * Math.sin(g),
608
+ u[0] * Math.sin(g) + u[1] * Math.cos(g)
609
609
  ];
610
610
  }
611
- if (u(l, "rotatePoint"), !h || h[0] === 0 && h[1] === 0)
611
+ if (_(l, "rotatePoint"), !h || h[0] === 0 && h[1] === 0)
612
612
  return l(r, o);
613
613
  {
614
- const _ = r.map((c, E) => c - h[E]);
615
- return l(_, o).map((c, E) => c + h[E]);
614
+ const u = r.map((c, v) => c - h[v]);
615
+ return l(u, o).map((c, v) => c + h[v]);
616
616
  }
617
617
  }
618
- u(n, "rotate"), s.rotate = n;
618
+ _(n, "rotate"), s.rotate = n;
619
619
  })(t.Point || (t.Point = {})), ((s) => {
620
- function i(m, S) {
621
- return (S[1] - m[1]) / (S[0] - m[0]);
620
+ function i(m, A) {
621
+ return (A[1] - m[1]) / (A[0] - m[0]);
622
622
  }
623
- u(i, "slope"), s.slope = i;
624
- function n(m, S) {
625
- const R = i(m, S);
626
- return m[1] - R * m[0];
623
+ _(i, "slope"), s.slope = i;
624
+ function n(m, A) {
625
+ const O = i(m, A);
626
+ return m[1] - O * m[0];
627
627
  }
628
- u(n, "intercept"), s.intercept = n;
629
- function r(m, S) {
628
+ _(n, "intercept"), s.intercept = n;
629
+ function r(m, A) {
630
630
  return {
631
- slope: i(m, S),
632
- intercept: n(m, S)
631
+ slope: i(m, A),
632
+ intercept: n(m, A)
633
633
  };
634
634
  }
635
- u(r, "slopeIntercept"), s.slopeIntercept = r;
636
- function a(m, S = 0) {
637
- const R = S, j = (1 - R) * m[0][0] + R * m[1][0], Y = (1 - R) * m[0][1] + R * m[1][1];
638
- return [j, Y];
635
+ _(r, "slopeIntercept"), s.slopeIntercept = r;
636
+ function a(m, A = 0) {
637
+ const O = A, F = (1 - O) * m[0][0] + O * m[1][0], Y = (1 - O) * m[0][1] + O * m[1][1];
638
+ return [F, Y];
639
639
  }
640
- u(a, "point_along"), s.point_along = a;
641
- function h(m, S, R = 0.5) {
642
- return Array.isArray(m[0]) && (S = m[1], m = m[0]), [0, 1].map((j) => (parseFloat(m[j]) + parseFloat(S[j])) * R);
640
+ _(a, "point_along"), s.point_along = a;
641
+ function h(m, A, O = 0.5) {
642
+ return Array.isArray(m[0]) && (A = m[1], m = m[0]), [0, 1].map((F) => (parseFloat(m[F]) + parseFloat(A[F])) * O);
643
643
  }
644
- u(h, "midpoint"), s.midpoint = h;
645
- function o(m, S) {
646
- return Array.isArray(m[0]) && (S = m[1], m = m[0]), Math.sqrt(
647
- [0, 1].map((R) => Math.pow(S[R] - m[R], 2)).reduce((R, j) => R + j, 0)
644
+ _(h, "midpoint"), s.midpoint = h;
645
+ function o(m, A) {
646
+ return Array.isArray(m[0]) && (A = m[1], m = m[0]), Math.sqrt(
647
+ [0, 1].map((O) => Math.pow(A[O] - m[O], 2)).reduce((O, F) => O + F, 0)
648
648
  );
649
649
  }
650
- u(o, "length"), s.length = o;
651
- function l(m, S = [0, 0]) {
652
- const R = [
653
- m[1][0] - S[0],
654
- m[1][1] - S[1]
655
- ], j = [
656
- -R[1],
657
- R[0]
658
- ], Y = [
659
- -j[0],
660
- -j[1]
661
- ], v = [
662
- j[0] + S[0],
663
- j[1] + S[1]
650
+ _(o, "length"), s.length = o;
651
+ function l(m, A = [0, 0]) {
652
+ const O = [
653
+ m[1][0] - A[0],
654
+ m[1][1] - A[1]
664
655
  ], F = [
665
- Y[0] + S[0],
666
- Y[1] + S[1]
656
+ -O[1],
657
+ O[0]
658
+ ], Y = [
659
+ -F[0],
660
+ -F[1]
661
+ ], E = [
662
+ F[0] + A[0],
663
+ F[1] + A[1]
664
+ ], j = [
665
+ Y[0] + A[0],
666
+ Y[1] + A[1]
667
667
  ];
668
- return [v, F];
668
+ return [E, j];
669
669
  }
670
- u(l, "rotate"), s.rotate = l;
671
- function _(m, S, R = 90) {
672
- const j = d.Geometry.Line.slope(m[0], m[1]), Y = d.Geometry.Line.intercept(m[0], m[1]), v = [0, Y], F = [1, j + Y];
673
- m = [v, F];
674
- const nt = [m[0][0], m[1][0]], ot = [m[0][1], m[1][1]], it = S[0], _t = S[1], K = -2 * Math.PI * R / 360, It = nt.map(
675
- (ge, ut) => (ge - it) * Math.cos(K) - (ot[ut] - _t) * Math.sin(K) + it
670
+ _(l, "rotate"), s.rotate = l;
671
+ function u(m, A, O = 90) {
672
+ const F = d.Geometry.Line.slope(m[0], m[1]), Y = d.Geometry.Line.intercept(m[0], m[1]), E = [0, Y], j = [1, F + Y];
673
+ m = [E, j];
674
+ const nt = [m[0][0], m[1][0]], ot = [m[0][1], m[1][1]], it = A[0], ut = A[1], K = -2 * Math.PI * O / 360, It = nt.map(
675
+ (ge, _t) => (ge - it) * Math.cos(K) - (ot[_t] - ut) * Math.sin(K) + it
676
676
  ), Ot = ot.map(
677
- (ge, ut) => (nt[ut] - it) * Math.sin(K) - (ge - _t) * Math.cos(K) + _t
677
+ (ge, _t) => (nt[_t] - it) * Math.sin(K) - (ge - ut) * Math.cos(K) + ut
678
678
  );
679
679
  return [
680
680
  [It[0], Ot[0]],
681
681
  [It[1], Ot[1]]
682
682
  ];
683
683
  }
684
- u(_, "rotate2"), s.rotate2 = _;
685
- function g(m, S) {
686
- const [[R, j], [Y, v]] = m, [[F, nt], [ot, it]] = S, _t = (R - Y) * (nt - it) - (j - v) * (F - ot), K = (R * v - j * Y) * (F - ot) - (R - Y) * (F * it - nt * ot), It = (R * v - j * Y) * (nt - it) - (j - v) * (F * it - nt * ot);
687
- return [K / _t, It / _t];
684
+ _(u, "rotate2"), s.rotate2 = u;
685
+ function g(m, A) {
686
+ const [[O, F], [Y, E]] = m, [[j, nt], [ot, it]] = A, ut = (O - Y) * (nt - it) - (F - E) * (j - ot), K = (O * E - F * Y) * (j - ot) - (O - Y) * (j * it - nt * ot), It = (O * E - F * Y) * (nt - it) - (F - E) * (j * it - nt * ot);
687
+ return [K / ut, It / ut];
688
688
  }
689
- u(g, "intersection"), s.intersection = g;
690
- function c(m, S, R) {
691
- let { slope: j, intercept: Y } = d.Geometry.Line.slopeIntercept(m[0], m[1]), v = 1 + Math.pow(j, 2), F = 2 * j * Y - 2 * S[1] * j - 2 * S[0], nt = Math.pow(S[0], 2) + Math.pow(Y, 2) + Math.pow(S[1], 2) - 2 * S[1] * Y - Math.pow(R, 2), ot = [[1 / 0, 1 / 0], [1 / 0, 1 / 0]];
692
- if (Math.sqrt(Math.pow(F, 2) - 4 * v * nt) >= 0) {
693
- let it = (-F + Math.sqrt(Math.pow(F, 2) - 4 * v * nt)) / (2 * v), _t = (-F - Math.sqrt(Math.pow(F, 2) - 4 * v * nt)) / (2 * v), K = j * it + Y, It = j * _t + Y;
694
- ot = [[it, K], [_t, It]];
689
+ _(g, "intersection"), s.intersection = g;
690
+ function c(m, A, O) {
691
+ let { slope: F, intercept: Y } = d.Geometry.Line.slopeIntercept(m[0], m[1]), E = 1 + Math.pow(F, 2), j = 2 * F * Y - 2 * A[1] * F - 2 * A[0], nt = Math.pow(A[0], 2) + Math.pow(Y, 2) + Math.pow(A[1], 2) - 2 * A[1] * Y - Math.pow(O, 2), ot = [[1 / 0, 1 / 0], [1 / 0, 1 / 0]];
692
+ if (Math.sqrt(Math.pow(j, 2) - 4 * E * nt) >= 0) {
693
+ let it = (-j + Math.sqrt(Math.pow(j, 2) - 4 * E * nt)) / (2 * E), ut = (-j - Math.sqrt(Math.pow(j, 2) - 4 * E * nt)) / (2 * E), K = F * it + Y, It = F * ut + Y;
694
+ ot = [[it, K], [ut, It]];
695
695
  } else
696
696
  console.error("The line and the circumference do not intersect");
697
697
  return ot;
698
698
  }
699
- u(c, "intersect_circle"), s.intersect_circle = c;
700
- function E(m) {
701
- return (S) => S === 0 ? m[0] : S === 1 ? m[1] : d.Geometry.Point.translate(m[0], d.Geometry.Angle.line(m), d.Geometry.Line.length(m) * S);
699
+ _(c, "intersect_circle"), s.intersect_circle = c;
700
+ function v(m) {
701
+ return (A) => A === 0 ? m[0] : A === 1 ? m[1] : d.Geometry.Point.translate(m[0], d.Geometry.Angle.line(m), d.Geometry.Line.length(m) * A);
702
702
  }
703
- u(E, "interpolate"), s.interpolate = E;
703
+ _(v, "interpolate"), s.interpolate = v;
704
704
  })(t.Line || (t.Line = {}));
705
705
  let e;
706
706
  ((s) => {
707
707
  function i(a) {
708
708
  return a / 180 * Math.PI;
709
709
  }
710
- u(i, "toRad"), s.toRad = i;
710
+ _(i, "toRad"), s.toRad = i;
711
711
  function n(a) {
712
712
  return a * 180 / Math.PI;
713
713
  }
714
- u(n, "toDeg"), s.toDeg = n;
714
+ _(n, "toDeg"), s.toDeg = n;
715
715
  function r(a) {
716
716
  if (a.length !== 2 || !Array.isArray(a[0]) || !Array.isArray(a[1]) || a[0].length !== 2 || a[1].length !== 2)
717
717
  throw new Error("Invalid line format. Expected [[x1, y1], [x2, y2]].");
@@ -719,13 +719,13 @@ var ie;
719
719
  Math.atan2(a[1][1] - a[0][1], a[1][0] - a[0][0])
720
720
  );
721
721
  }
722
- u(r, "line"), s.line = r;
722
+ _(r, "line"), s.line = r;
723
723
  })(e = t.Angle || (t.Angle = {}));
724
724
  })(d.Geometry || (d.Geometry = {})), ((t) => {
725
725
  function e(n) {
726
726
  return [...new Set(n)];
727
727
  }
728
- u(e, "unique"), t.unique = e;
728
+ _(e, "unique"), t.unique = e;
729
729
  function s(n, r) {
730
730
  if (Array.isArray(n)) {
731
731
  if (Array.isArray(r)) {
@@ -736,25 +736,25 @@ var ie;
736
736
  }
737
737
  return n / r;
738
738
  }
739
- u(s, "divide"), t.divide = s;
739
+ _(s, "divide"), t.divide = s;
740
740
  function i(n) {
741
741
  return typeof Array.isArray == "function" ? Array.isArray(n) : n && typeof n == "object" && n.constructor.name === "Array";
742
742
  }
743
- u(i, "isArray"), t.isArray = i;
743
+ _(i, "isArray"), t.isArray = i;
744
744
  })(d.ArrayTools || (d.ArrayTools = {})), ((t) => {
745
745
  function e(n) {
746
746
  return n.reduce((r, a) => r + a, 0);
747
747
  }
748
- u(e, "sum"), t.sum = e;
748
+ _(e, "sum"), t.sum = e;
749
749
  function s(n) {
750
750
  return e(n) / n.length;
751
751
  }
752
- u(s, "mean"), t.mean = s;
752
+ _(s, "mean"), t.mean = s;
753
753
  function i(n, r) {
754
754
  const a = Math.pow(10, r);
755
755
  return Math.round(n * a) / a;
756
756
  }
757
- u(i, "round"), t.round = i;
757
+ _(i, "round"), t.round = i;
758
758
  })(d.Mathematics || (d.Mathematics = {})), ((t) => {
759
759
  function e(s, i, n) {
760
760
  return new CustomEvent(s, {
@@ -766,16 +766,16 @@ var ie;
766
766
  }
767
767
  });
768
768
  }
769
- u(e, "createEvent"), t.createEvent = e;
769
+ _(e, "createEvent"), t.createEvent = e;
770
770
  })(d.Events || (d.Events = {})), ((t) => {
771
771
  function e() {
772
772
  return location.hash.replace(/#/, "").split(/\//).filter((i) => i).map((i) => i.split(/:/));
773
773
  }
774
- u(e, "parts"), t.parts = e;
774
+ _(e, "parts"), t.parts = e;
775
775
  function s(i) {
776
776
  return e().flat().findIndex((n) => n === i) >= 0;
777
777
  }
778
- u(s, "exists"), t.exists = s;
778
+ _(s, "exists"), t.exists = s;
779
779
  })(d.Hash || (d.Hash = {})), ((t) => {
780
780
  function e(n, r, a = !1) {
781
781
  if (a) {
@@ -787,7 +787,7 @@ var ie;
787
787
  } else
788
788
  return new Proxy(n, r);
789
789
  }
790
- u(e, "proxy"), t.proxy = e, t.handler = {
790
+ _(e, "proxy"), t.proxy = e, t.handler = {
791
791
  set(n, r, a) {
792
792
  return n[r] = a, window.dispatchEvent(
793
793
  d.Events.createEvent("settingUpdate", window, { target: n, property: r, value: a })
@@ -807,39 +807,39 @@ var ie;
807
807
  return;
808
808
  return h;
809
809
  }
810
- u(s, "get"), t.get = s;
810
+ _(s, "get"), t.get = s;
811
811
  function i(n, r, a) {
812
812
  const h = r.split(".");
813
813
  let o = n, l;
814
814
  for (l = 0; l < h.length - 1; l++) {
815
- const _ = h[l];
815
+ const u = h[l];
816
816
  if (o && typeof o == "object")
817
- Object.prototype.hasOwnProperty.call(o, _) || (o[_] = {}), o = o[_];
817
+ Object.prototype.hasOwnProperty.call(o, u) || (o[u] = {}), o = o[u];
818
818
  else
819
819
  return !1;
820
820
  }
821
821
  return o && typeof o == "object" ? (o[h[l]] = a, !0) : !1;
822
822
  }
823
- u(i, "set"), t.set = i;
823
+ _(i, "set"), t.set = i;
824
824
  })(d.Objects || (d.Objects = {})), ((t) => {
825
825
  function e(s = window.location) {
826
826
  return Object.fromEntries(new URLSearchParams(s.search));
827
827
  }
828
- u(e, "parse"), t.parse = e, ((s) => {
828
+ _(e, "parse"), t.parse = e, ((s) => {
829
829
  function i(a = window.location.search) {
830
830
  return Object.fromEntries(
831
831
  a.replace(/^\?/, "").split(/&/).map((h) => h.split(/=/))
832
832
  );
833
833
  }
834
- u(i, "parse2"), s.parse = i;
834
+ _(i, "parse2"), s.parse = i;
835
835
  function n(a = window.location.search) {
836
836
  return a.replace(/^\?/, "").split(/&/).map((h) => h.split(/=/)[0]);
837
837
  }
838
- u(n, "keys"), s.keys = n;
838
+ _(n, "keys"), s.keys = n;
839
839
  function r(a, h = window.location.search) {
840
840
  return n(h).findIndex((o) => o === a) >= 0;
841
841
  }
842
- u(r, "has"), s.has = r;
842
+ _(r, "has"), s.has = r;
843
843
  })(t.Query || (t.Query = {}));
844
844
  })(d.URL || (d.URL = {}));
845
845
  })(ie || (ie = {}));
@@ -882,7 +882,7 @@ const rs = class rs {
882
882
  });
883
883
  }
884
884
  };
885
- u(rs, "EventBus");
885
+ _(rs, "EventBus");
886
886
  let Ae = rs;
887
887
  const { ArrayTools: qs } = ie, te = class te extends Array {
888
888
  constructor(...t) {
@@ -893,7 +893,7 @@ const { ArrayTools: qs } = ie, te = class te extends Array {
893
893
  function i(r) {
894
894
  return r.name === e ? r : void 0;
895
895
  }
896
- u(i, "fn");
896
+ _(i, "fn");
897
897
  function n(r, a, h = null) {
898
898
  if (qs.isArray(r)) {
899
899
  for (const [o, l] of r.entries())
@@ -910,7 +910,7 @@ const { ArrayTools: qs } = ie, te = class te extends Array {
910
910
  }
911
911
  return s;
912
912
  }
913
- return u(n, "recurse"), n(this);
913
+ return _(n, "recurse"), n(this);
914
914
  }
915
915
  flatten() {
916
916
  return this.reduce((t, e) => (t.push(e), e.layers && Array.isArray(e.layers) && t.push(...e.layers), t), []);
@@ -928,7 +928,7 @@ const { ArrayTools: qs } = ie, te = class te extends Array {
928
928
  return console.log("Recurse results: ", n), n;
929
929
  }
930
930
  };
931
- u(te, "LayerArray");
931
+ _(te, "LayerArray");
932
932
  let qt = te;
933
933
  const os = class os {
934
934
  constructor(t, e, s) {
@@ -944,7 +944,7 @@ const os = class os {
944
944
  this._transform = t;
945
945
  }
946
946
  };
947
- u(os, "Layer");
947
+ _(os, "Layer");
948
948
  let We = os;
949
949
  var Lt, Mt;
950
950
  const Le = class Le extends Array {
@@ -954,16 +954,16 @@ const Le = class Le extends Array {
954
954
  et(this, Mt);
955
955
  for (let s = 0; s < e.length; s++)
956
956
  this[s] = e[s];
957
- B(this, Lt, !1);
957
+ H(this, Lt, !1);
958
958
  }
959
959
  static fromArray(e) {
960
960
  const s = new Le();
961
961
  return e.forEach((i, n) => {
962
962
  s.push(i);
963
- }), B(s, Mt, e.names), s;
963
+ }), H(s, Mt, e.names), s;
964
964
  }
965
965
  flip() {
966
- B(this, Lt, !k(this, Lt));
966
+ H(this, Lt, !k(this, Lt));
967
967
  for (let e = 0; e < this.length; e++)
968
968
  this[e] = -this[e];
969
969
  return this;
@@ -978,7 +978,7 @@ const Le = class Le extends Array {
978
978
  return k(this, Mt) ? k(this, Mt) : this.map((e, s) => `V${s + 1}`);
979
979
  }
980
980
  };
981
- Lt = new WeakMap(), Mt = new WeakMap(), u(Le, "DimensionVector");
981
+ Lt = new WeakMap(), Mt = new WeakMap(), _(Le, "DimensionVector");
982
982
  let Pt = Le;
983
983
  const as = class as {
984
984
  constructor(t, e) {
@@ -1036,7 +1036,7 @@ const as = class as {
1036
1036
  this._transform = t;
1037
1037
  }
1038
1038
  };
1039
- u(as, "PlottedObject");
1039
+ _(as, "PlottedObject");
1040
1040
  let kt = as;
1041
1041
  const hs = class hs extends kt {
1042
1042
  // constructor(x: LineOptions) {
@@ -1080,7 +1080,7 @@ const hs = class hs extends kt {
1080
1080
  this._color = t;
1081
1081
  }
1082
1082
  };
1083
- u(hs, "Line");
1083
+ _(hs, "Line");
1084
1084
  let Xt = hs;
1085
1085
  const ee = class ee extends kt {
1086
1086
  // constructor(dimensions: DimensionType, o: PointOptions) { //, graph?: any) {
@@ -1119,7 +1119,7 @@ const ee = class ee extends kt {
1119
1119
  this._y = parseFloat(t);
1120
1120
  }
1121
1121
  };
1122
- u(ee, "Point"), ee.SHAPES = { CIRCLE: "circle", SQUARE: "rect" };
1122
+ _(ee, "Point"), ee.SHAPES = { CIRCLE: "circle", SQUARE: "rect" };
1123
1123
  let J = ee;
1124
1124
  const Ft = class Ft extends kt {
1125
1125
  constructor(t, e) {
@@ -1144,8 +1144,8 @@ const Ft = class Ft extends kt {
1144
1144
  this._transform = t;
1145
1145
  }
1146
1146
  };
1147
- u(Ft, "Label"), Ft.DISPLAY_TYPES = { OFF: 0, AUTO: 1, CLICK: 2, ON: 3 }, Ft.HIGHLIGHT = { OFF: 0, ON: 2 }, Ft.POSITION = { OBJECT: 1, STATIC: 2, CONTAINER: 3, CUSTOM: 4 };
1148
- let H = Ft;
1147
+ _(Ft, "Label"), Ft.DISPLAY_TYPES = { OFF: 0, AUTO: 1, CLICK: 2, ON: 3 }, Ft.HIGHLIGHT = { OFF: 0, ON: 2 }, Ft.POSITION = { OBJECT: 1, STATIC: 2, CONTAINER: 3, CUSTOM: 4 };
1148
+ let U = Ft;
1149
1149
  const ls = class ls {
1150
1150
  constructor(t, e, s = 0, i = 0) {
1151
1151
  this.x_max = t, this.y_max = e, this.cx = s, this.cy = i;
@@ -1179,7 +1179,7 @@ const ls = class ls {
1179
1179
  return this.x_max;
1180
1180
  }
1181
1181
  };
1182
- u(ls, "Extremes");
1182
+ _(ls, "Extremes");
1183
1183
  let Rt = ls;
1184
1184
  const cs = class cs extends kt {
1185
1185
  constructor(t, e) {
@@ -1207,7 +1207,7 @@ const cs = class cs extends kt {
1207
1207
  return this._transform;
1208
1208
  }
1209
1209
  };
1210
- u(cs, "AxisPoint");
1210
+ _(cs, "AxisPoint");
1211
1211
  let Ve = cs, Ks = {
1212
1212
  GRAPH: {
1213
1213
  ratio: 1,
@@ -1224,25 +1224,25 @@ let Ve = cs, Ks = {
1224
1224
  size: 1,
1225
1225
  highlight: {
1226
1226
  color: "yellow",
1227
- labels: H.DISPLAY_TYPES.ON
1227
+ labels: U.DISPLAY_TYPES.ON
1228
1228
  },
1229
- labels: H.DISPLAY_TYPES.ON,
1230
- labelposition: H.POSITION.OBJECT
1229
+ labels: U.DISPLAY_TYPES.ON,
1230
+ labelposition: U.POSITION.OBJECT
1231
1231
  },
1232
1232
  POINT: {
1233
1233
  active: 2,
1234
1234
  size: 0.05,
1235
1235
  color: "#000",
1236
1236
  shape: J.SHAPES.CIRCLE,
1237
- labels: H.DISPLAY_TYPES.AUTO,
1238
- labelposition: H.POSITION.OBJECT
1237
+ labels: U.DISPLAY_TYPES.AUTO,
1238
+ labelposition: U.POSITION.OBJECT
1239
1239
  },
1240
1240
  MEAN: {
1241
1241
  shape: J.SHAPES.SQUARE,
1242
- labels: H.DISPLAY_TYPES.AUTO
1242
+ labels: U.DISPLAY_TYPES.AUTO
1243
1243
  },
1244
1244
  LABEL: {
1245
- highlight: H.HIGHLIGHT.OFF,
1245
+ highlight: U.HIGHLIGHT.OFF,
1246
1246
  position: ["top", "left"],
1247
1247
  container: "#label-container"
1248
1248
  },
@@ -1250,7 +1250,7 @@ let Ve = cs, Ks = {
1250
1250
  multiplier: 1
1251
1251
  }
1252
1252
  };
1253
- const _s = class _s {
1253
+ const us = class us {
1254
1254
  constructor(t = { ...Ks }) {
1255
1255
  this.__state__ = new Ae(), this.name = "unnamed-graph", this.origin = void 0, this.points = /* @__PURE__ */ new Map(), this.nodes = /* @__PURE__ */ new Map(), this.edges = /* @__PURE__ */ new Map(), this.trajectories = /* @__PURE__ */ new Map(), this.labels = /* @__PURE__ */ new Map(), this.transform = new se(), this.scale_x = 1, this.scale_y = 1, this.SIZE_EFFECT = 1, this._mirror_y = !0, this._mirror_x = !1, this._layers = new qt(
1256
1256
  { name: "graph", tabindex: 0, layers: [
@@ -1310,7 +1310,7 @@ const _s = class _s {
1310
1310
  const o = new We(`${e}`, r, h);
1311
1311
  return e += 1, o.parent = a || void 0, r.layers && Array.isArray(r.layers) && (o.layers = new qt(...r.layers.map((l) => s(l, o, h)))), o;
1312
1312
  }
1313
- u(s, "buildLayerTree"), this.layers = new qt(...this._layers.map((r) => s(r, null, this)));
1313
+ _(s, "buildLayerTree"), this.layers = new qt(...this._layers.map((r) => s(r, null, this)));
1314
1314
  let i = this.layers.search("layers", "axis_points");
1315
1315
  i && i.objects.set(this.origin.ID, this.origin);
1316
1316
  let n = this.layers.search("layers", "axis_lines");
@@ -1367,7 +1367,7 @@ const _s = class _s {
1367
1367
  add_nodes(t) {
1368
1368
  let e = this;
1369
1369
  t.forEach((s) => {
1370
- s.label = new H(s.ID, s), e.labels.set(s.label.ID, s.label), e.nodes.set(s.ID, s);
1370
+ s.label = new U(s.ID, s), e.labels.set(s.label.ID, s.label), e.nodes.set(s.ID, s);
1371
1371
  const i = e.layers.search("layers", "nodes");
1372
1372
  i && i.objects.push(s);
1373
1373
  }), e.update_extremes();
@@ -1398,8 +1398,8 @@ const _s = class _s {
1398
1398
  e.forEach((g) => g.objects.forEach((c) => {
1399
1399
  Number.isFinite(c.x) && (s = Math.min(s, c.x), i = Math.max(i, c.x)), Number.isFinite(c.y) && (n = Math.min(n, c.y), r = Math.max(r, c.y));
1400
1400
  }));
1401
- const a = Number.isFinite(s) && Number.isFinite(n), h = t && a ? (s + i) / 2 : 0, o = t && a ? (n + r) / 2 : 0, l = a ? Math.max(Math.abs(s - h), Math.abs(i - h), Math.abs(n - o), Math.abs(r - o)) : 0, _ = (l > 0 ? l : 1) * 1.3;
1402
- this.extremes = new Rt(_, _, h, o);
1401
+ const a = Number.isFinite(s) && Number.isFinite(n), h = t && a ? (s + i) / 2 : 0, o = t && a ? (n + r) / 2 : 0, l = a ? Math.max(Math.abs(s - h), Math.abs(i - h), Math.abs(n - o), Math.abs(r - o)) : 0, u = (l > 0 ? l : 1) * 1.3;
1402
+ this.extremes = new Rt(u, u, h, o);
1403
1403
  }
1404
1404
  }
1405
1405
  /** Farthest node from (cx, cy), on either axis */
@@ -1415,9 +1415,9 @@ const _s = class _s {
1415
1415
  return Math.min(1, e / (Math.sqrt(s) * t));
1416
1416
  }
1417
1417
  };
1418
- u(_s, "Graph");
1419
- let Ke = _s;
1420
- const De = class De extends HTMLElement {
1418
+ _(us, "Graph");
1419
+ let Ke = us;
1420
+ const Te = class Te extends HTMLElement {
1421
1421
  constructor() {
1422
1422
  super(), this.element = null, this.object = null;
1423
1423
  const t = this, e = t.attachShadow({ mode: "open" }), s = document.createElement("style"), i = document.createElement("div");
@@ -1428,7 +1428,7 @@ const De = class De extends HTMLElement {
1428
1428
  return e == null ? void 0 : e.querySelector(".wrapper");
1429
1429
  }
1430
1430
  };
1431
- u(De, "DrawableElement"), De.style = `
1431
+ _(Te, "DrawableElement"), Te.style = `
1432
1432
  :host {
1433
1433
  max-width: 100%;
1434
1434
  display: block;
@@ -1439,12 +1439,12 @@ u(De, "DrawableElement"), De.style = `
1439
1439
  justify-content: center;
1440
1440
  }
1441
1441
  `;
1442
- let ve = De;
1442
+ let ve = Te;
1443
1443
  const hi = 1e-8;
1444
1444
  function Us(d, t = hi) {
1445
1445
  return d.filter((e) => Math.abs(e.x) > t || Math.abs(e.y) > t);
1446
1446
  }
1447
- u(Us, "nearOriginFilter");
1447
+ _(Us, "nearOriginFilter");
1448
1448
  function Js(d) {
1449
1449
  if (d <= 0) return [];
1450
1450
  if (d === 1) return [0];
@@ -1452,7 +1452,7 @@ function Js(d) {
1452
1452
  for (let e = 0; e < d; e++) t[e] = e / (d - 1);
1453
1453
  return t;
1454
1454
  }
1455
- u(Js, "normalizedT");
1455
+ _(Js, "normalizedT");
1456
1456
  function Zs(d, t) {
1457
1457
  return d.map((e) => {
1458
1458
  const s = new Array(t + 1);
@@ -1462,7 +1462,7 @@ function Zs(d, t) {
1462
1462
  return s;
1463
1463
  });
1464
1464
  }
1465
- u(Zs, "design");
1465
+ _(Zs, "design");
1466
1466
  function Qs(d) {
1467
1467
  const t = d.length, e = d[0].length, s = d.map((n) => n.slice()), i = Array.from({ length: e }, () => new Array(e).fill(0));
1468
1468
  for (let n = 0; n < e; n++) {
@@ -1479,7 +1479,7 @@ function Qs(d) {
1479
1479
  }
1480
1480
  return { Q: s, R: i };
1481
1481
  }
1482
- u(Qs, "qr");
1482
+ _(Qs, "qr");
1483
1483
  function Je(d, t) {
1484
1484
  const e = d.length, s = d[0].length, i = new Array(s).fill(0);
1485
1485
  for (let n = 0; n < s; n++) {
@@ -1489,7 +1489,7 @@ function Je(d, t) {
1489
1489
  }
1490
1490
  return i;
1491
1491
  }
1492
- u(Je, "qtY");
1492
+ _(Je, "qtY");
1493
1493
  function Ze(d, t) {
1494
1494
  const e = t.length, s = new Array(e).fill(0);
1495
1495
  for (let i = e - 1; i >= 0; i--) {
@@ -1499,7 +1499,7 @@ function Ze(d, t) {
1499
1499
  }
1500
1500
  return s;
1501
1501
  }
1502
- u(Ze, "backSolve");
1502
+ _(Ze, "backSolve");
1503
1503
  function li(d) {
1504
1504
  return d.map((t) => {
1505
1505
  let e = 0;
@@ -1507,54 +1507,54 @@ function li(d) {
1507
1507
  return e;
1508
1508
  });
1509
1509
  }
1510
- u(li, "leverages");
1511
- function Gs(d, t, e) {
1510
+ _(li, "leverages");
1511
+ function Bs(d, t, e) {
1512
1512
  const s = Zs(d, e), { Q: i, R: n } = Qs(s);
1513
1513
  return Ze(n, Je(i, t));
1514
1514
  }
1515
- u(Gs, "fitCoeffs");
1515
+ _(Bs, "fitCoeffs");
1516
1516
  function Se(d, t) {
1517
1517
  let e = 0, s = 1;
1518
1518
  for (let i = 0; i < d.length; i++)
1519
1519
  e += d[i] * s, s *= t;
1520
1520
  return e;
1521
1521
  }
1522
- u(Se, "evalPoly");
1522
+ _(Se, "evalPoly");
1523
1523
  function ci(d, t, e, s) {
1524
1524
  const i = Zs(d, s), { Q: n, R: r } = Qs(i), a = li(n), h = Ze(r, Je(n, t)), o = Ze(r, Je(n, e));
1525
1525
  let l = 0;
1526
- for (let _ = 0; _ < d.length; _++) {
1527
- const g = 1 - a[_];
1526
+ for (let u = 0; u < d.length; u++) {
1527
+ const g = 1 - a[u];
1528
1528
  if (g <= 0) return 1 / 0;
1529
- const c = t[_] - Se(h, d[_]), E = e[_] - Se(o, d[_]);
1530
- l += (c / g) ** 2 + (E / g) ** 2;
1529
+ const c = t[u] - Se(h, d[u]), v = e[u] - Se(o, d[u]);
1530
+ l += (c / g) ** 2 + (v / g) ** 2;
1531
1531
  }
1532
1532
  return l;
1533
1533
  }
1534
- u(ci, "loocv2d");
1535
- function _i(d, t, e) {
1534
+ _(ci, "loocv2d");
1535
+ function ui(d, t, e) {
1536
1536
  const s = d.length, i = Math.min(Math.max(1, Math.floor(t)), Math.max(1, s - 1));
1537
1537
  if (e === "fixed" || s < 3) return i;
1538
1538
  const n = Js(s), r = d.map((l) => l.x), a = d.map((l) => l.y);
1539
1539
  let h = 1, o = 1 / 0;
1540
1540
  for (let l = 1; l <= i; l++) {
1541
- const _ = ci(n, r, a, l);
1542
- _ < o && (o = _, h = l);
1541
+ const u = ci(n, r, a, l);
1542
+ u < o && (o = u, h = l);
1543
1543
  }
1544
1544
  return h;
1545
1545
  }
1546
- u(_i, "selectDegree");
1547
- function ui(d, t) {
1546
+ _(ui, "selectDegree");
1547
+ function _i(d, t) {
1548
1548
  const e = Us(d);
1549
1549
  if (e.length < 3) return null;
1550
1550
  const s = t.selectionSet ? Us(t.selectionSet) : e, i = s.length >= 3 ? s : e;
1551
- let n = _i(i, t.maxDegree, t.degreeSelection);
1551
+ let n = ui(i, t.maxDegree, t.degreeSelection);
1552
1552
  n = Math.min(n, Math.max(1, e.length - 1));
1553
- const r = Js(e.length), a = Gs(r, e.map((o) => o.x), n), h = Gs(r, e.map((o) => o.y), n);
1553
+ const r = Js(e.length), a = Bs(r, e.map((o) => o.x), n), h = Bs(r, e.map((o) => o.y), n);
1554
1554
  return { degree: n, coeffsX: a, coeffsY: h };
1555
1555
  }
1556
- u(ui, "fitTrajectory");
1557
- function Bs(d, t = 100) {
1556
+ _(_i, "fitTrajectory");
1557
+ function Gs(d, t = 100) {
1558
1558
  const e = [];
1559
1559
  for (let s = 0; s <= t; s++) {
1560
1560
  const i = s / t;
@@ -1562,8 +1562,8 @@ function Bs(d, t = 100) {
1562
1562
  }
1563
1563
  return e;
1564
1564
  }
1565
- u(Bs, "sampleCurve");
1566
- const Hs = 100, us = class us extends kt {
1565
+ _(Gs, "sampleCurve");
1566
+ const Hs = 100, _s = class _s extends kt {
1567
1567
  constructor(t = {}) {
1568
1568
  const e = t.color instanceof st ? t.color : new st(typeof t.color == "string" ? t.color : "#000000");
1569
1569
  super([], {
@@ -1591,11 +1591,11 @@ const Hs = 100, us = class us extends kt {
1591
1591
  if (t.length < 2) return [];
1592
1592
  if (this.smooth === "poly") {
1593
1593
  if (this.polyCoeffsX.length > 0 && this.polyCoeffsY.length > 0)
1594
- return Bs(
1594
+ return Gs(
1595
1595
  { degree: this.polyCoeffsX.length - 1, coeffsX: this.polyCoeffsX, coeffsY: this.polyCoeffsY },
1596
1596
  Hs
1597
1597
  );
1598
- const e = ui(
1598
+ const e = _i(
1599
1599
  t.map((s) => ({ x: s.x, y: s.y })),
1600
1600
  {
1601
1601
  maxDegree: this.maxDegree,
@@ -1604,13 +1604,13 @@ const Hs = 100, us = class us extends kt {
1604
1604
  }
1605
1605
  );
1606
1606
  if (e)
1607
- return this.selectedDegree = e.degree, Bs(e, Hs);
1607
+ return this.selectedDegree = e.degree, Gs(e, Hs);
1608
1608
  }
1609
1609
  return t.map((e) => ({ x: e.x, y: e.y }));
1610
1610
  }
1611
1611
  };
1612
- u(us, "Trajectory");
1613
- let Ee = us;
1612
+ _(_s, "Trajectory");
1613
+ let Ee = _s;
1614
1614
  const ti = 1, ds = class ds extends Xt {
1615
1615
  constructor(t, e, s, i = 0) {
1616
1616
  super(t, e, s), this._totalweight = 0, this._weight = i;
@@ -1641,67 +1641,67 @@ const ti = 1, ds = class ds extends Xt {
1641
1641
  this._totalweight = t;
1642
1642
  }
1643
1643
  };
1644
- u(ds, "Edge");
1644
+ _(ds, "Edge");
1645
1645
  let Me = ds;
1646
- var Gt;
1646
+ var Bt;
1647
1647
  const gs = class gs extends kt {
1648
1648
  constructor(e) {
1649
1649
  super(e.dimensions || [], e);
1650
- et(this, Gt);
1651
- B(this, Gt, e);
1650
+ et(this, Bt);
1651
+ H(this, Bt, e);
1652
1652
  }
1653
1653
  get edge() {
1654
- return k(this, Gt);
1654
+ return k(this, Bt);
1655
1655
  }
1656
1656
  get path() {
1657
- const e = k(this, Gt), s = [e.to.x, e.to.y], i = e.from_point, [n, r] = e.base_pts, a = Math.hypot(i[0] - s[0], i[1] - s[1]), h = Math.hypot(n[0] - r[0], n[1] - r[1]);
1657
+ const e = k(this, Bt), s = [e.to.x, e.to.y], i = e.from_point, [n, r] = e.base_pts, a = Math.hypot(i[0] - s[0], i[1] - s[1]), h = Math.hypot(n[0] - r[0], n[1] - r[1]);
1658
1658
  if (!(a > 0) || !(h > 0)) return "";
1659
- const o = [(i[0] - s[0]) / a, (i[1] - s[1]) / a], l = Math.hypot(n[0] - s[0], n[1] - s[1]), _ = [(n[0] - s[0]) / l, (n[1] - s[1]) / l], g = /* @__PURE__ */ u((Y) => h / 2 * Math.max(0, 1 - Y / a), "halfW"), c = /* @__PURE__ */ u((Y, v) => `${s[0] + o[0] * Y + _[0] * v} ${s[1] + o[1] * Y + _[1] * v}`, "at"), E = 0.2 * a, m = Math.min(0.15 * a, 0.8 * 2 * g(E)), S = E + m / 2, R = E + m;
1660
- return `M${c(E, 0)} L${c(S, g(S))} L${c(R, g(R))} L${c(S, 0)} L${c(R, -g(R))} L${c(S, -g(S))}z`;
1659
+ const o = [(i[0] - s[0]) / a, (i[1] - s[1]) / a], l = Math.hypot(n[0] - s[0], n[1] - s[1]), u = [(n[0] - s[0]) / l, (n[1] - s[1]) / l], g = /* @__PURE__ */ _((Y) => h / 2 * Math.max(0, 1 - Y / a), "halfW"), c = /* @__PURE__ */ _((Y, E) => `${s[0] + o[0] * Y + u[0] * E} ${s[1] + o[1] * Y + u[1] * E}`, "at"), v = 0.2 * a, m = Math.min(0.15 * a, 0.8 * 2 * g(v)), A = v + m / 2, O = v + m;
1660
+ return `M${c(v, 0)} L${c(A, g(A))} L${c(O, g(O))} L${c(A, 0)} L${c(O, -g(O))} L${c(A, -g(A))}z`;
1661
1661
  }
1662
1662
  };
1663
- Gt = new WeakMap(), u(gs, "EdgeArrow");
1663
+ Bt = new WeakMap(), _(gs, "EdgeArrow");
1664
1664
  let Ie = gs;
1665
- var Bt, de;
1666
- const Te = class Te extends Me {
1665
+ var Gt, de;
1666
+ const De = class De extends Me {
1667
1667
  constructor(e, s, i) {
1668
1668
  super(e, s, i);
1669
- et(this, Bt);
1669
+ et(this, Gt);
1670
1670
  et(this, de);
1671
- this._path = "", B(this, Bt, !1), this._directions = [
1671
+ this._path = "", H(this, Gt, !1), this._directions = [
1672
1672
  "from",
1673
1673
  "to"
1674
1674
  /* TO */
1675
- ], this.towards = "to", k(this, Bt) === !0 && B(this, de, new Ie(this));
1675
+ ], this.towards = "to", k(this, Gt) === !0 && H(this, de, new Ie(this));
1676
1676
  }
1677
1677
  get path() {
1678
1678
  return `M${this.from.x} ${this.from.y} L${this.base_pts[0].join(" ")} L${this.base_pts[1].join(" ")}z`;
1679
1679
  }
1680
1680
  static calculate_base_points(e) {
1681
- const s = e.towards, i = e._directions.find((S) => S !== e.towards), n = e[i].x, r = e[i].y, a = e[s].x, h = e[s].y, o = a - n, l = h - r, _ = Math.hypot(o, l), g = (e.weight ?? 0) * ti;
1682
- if (_ === 0 || !isFinite(g) || g === 0)
1681
+ const s = e.towards, i = e._directions.find((A) => A !== e.towards), n = e[i].x, r = e[i].y, a = e[s].x, h = e[s].y, o = a - n, l = h - r, u = Math.hypot(o, l), g = (e.weight ?? 0) * ti;
1682
+ if (u === 0 || !isFinite(g) || g === 0)
1683
1683
  return [[a, h], [a, h]];
1684
- const c = -l / _, E = o / _, m = g / 2;
1684
+ const c = -l / u, v = o / u, m = g / 2;
1685
1685
  return [
1686
- [a + c * m, h + E * m],
1687
- [a - c * m, h - E * m]
1686
+ [a + c * m, h + v * m],
1687
+ [a - c * m, h - v * m]
1688
1688
  ];
1689
1689
  }
1690
1690
  get base_pts() {
1691
- return Te.calculate_base_points(this);
1691
+ return De.calculate_base_points(this);
1692
1692
  }
1693
1693
  get arrow() {
1694
1694
  return k(this, de);
1695
1695
  }
1696
1696
  get with_arrow() {
1697
- return k(this, Bt);
1697
+ return k(this, Gt);
1698
1698
  }
1699
1699
  get from_point() {
1700
1700
  return [this.from.x, this.from.y];
1701
1701
  }
1702
1702
  };
1703
- Bt = new WeakMap(), de = new WeakMap(), u(Te, "TaperedEdge");
1704
- let Wt = Te;
1703
+ Gt = new WeakMap(), de = new WeakMap(), _(De, "TaperedEdge");
1704
+ let Wt = De;
1705
1705
  const ze = class ze extends Wt {
1706
1706
  constructor(t, e, s) {
1707
1707
  super(t, e, s), this._dataWeight = 0, this._totalweight = t.totalweight ?? 0, this._dataWeight = t.weight ?? this._weight;
@@ -1722,7 +1722,7 @@ const ze = class ze extends Wt {
1722
1722
  return this.weighted_midpoint;
1723
1723
  }
1724
1724
  };
1725
- u(ze, "TaperedWeightedMidpointEdge");
1725
+ _(ze, "TaperedWeightedMidpointEdge");
1726
1726
  let Qe = ze;
1727
1727
  const Fe = class Fe extends Me {
1728
1728
  constructor(t, e, s) {
@@ -1737,7 +1737,7 @@ const Fe = class Fe extends Me {
1737
1737
  return Fe.build_path(t, this.to);
1738
1738
  }
1739
1739
  };
1740
- u(Fe, "NodeEdge");
1740
+ _(Fe, "NodeEdge");
1741
1741
  let ne = Fe;
1742
1742
  const fs = class fs {
1743
1743
  constructor(t, e, s, i = new Ct()) {
@@ -1760,10 +1760,10 @@ const fs = class fs {
1760
1760
  const o = Math.min(1, (h - r) / n), l = i + (s - i) * o;
1761
1761
  t.setAttribute(e, l.toString()), o < 1 ? requestAnimationFrame(a) : t.setAttribute(e, s.toString());
1762
1762
  }
1763
- u(a, "animate"), requestAnimationFrame(a);
1763
+ _(a, "animate"), requestAnimationFrame(a);
1764
1764
  }
1765
1765
  };
1766
- u(fs, "Drawable");
1766
+ _(fs, "Drawable");
1767
1767
  let re = fs;
1768
1768
  const di = 0.04, gi = [0.25, 1], fi = [0.3, 1];
1769
1769
  function Xs(d, t, e, s) {
@@ -1773,30 +1773,30 @@ function Xs(d, t, e, s) {
1773
1773
  const n = Math.min(1, Math.max(0, (i - t) / (e - t)));
1774
1774
  return s[0] + n * (s[1] - s[0]);
1775
1775
  }
1776
- u(Xs, "rampFor");
1776
+ _(Xs, "rampFor");
1777
1777
  const mi = 0.011, pi = 0.75, bi = 0.8, yi = 0.75, ei = 6e-3, xi = 0.6;
1778
1778
  function wi(d) {
1779
1779
  return 2 * d;
1780
1780
  }
1781
- u(wi, "widthPerWeight");
1781
+ _(wi, "widthPerWeight");
1782
1782
  function Ai(d, t) {
1783
1783
  return d * t / (2 * ei);
1784
1784
  }
1785
- u(Ai, "nodeSizeForEdges");
1785
+ _(Ai, "nodeSizeForEdges");
1786
1786
  function vi(d) {
1787
1787
  const t = /rgba?\(([^)]+)\)/.exec(d);
1788
1788
  if (!t) return d;
1789
- const [e, s, i, n = 1] = t[1].split(",").map(Number), r = /* @__PURE__ */ u((a) => Math.round(255 + (a - 255) * n), "f");
1789
+ const [e, s, i, n = 1] = t[1].split(",").map(Number), r = /* @__PURE__ */ _((a) => Math.round(255 + (a - 255) * n), "f");
1790
1790
  return `rgb(${r(e)},${r(s)},${r(i)})`;
1791
1791
  }
1792
- u(vi, "flattenOnWhite");
1792
+ _(vi, "flattenOnWhite");
1793
1793
  function Si(d, t) {
1794
1794
  const e = /rgba?\(([^)]+)\)/.exec(d);
1795
1795
  if (!e) return d;
1796
1796
  const [s, i, n, r = 1] = e[1].split(",").map(Number);
1797
1797
  return `rgba(${Math.round(s * t)},${Math.round(i * t)},${Math.round(n * t)},${r})`;
1798
1798
  }
1799
- u(Si, "darkenRgba");
1799
+ _(Si, "darkenRgba");
1800
1800
  const ms = class ms extends re {
1801
1801
  constructor(t, e, s, i = new Ct()) {
1802
1802
  super(t, e, s, i), this.__data__ = t, this.parent = e, this.graph = s, this.__children__ = i, this.__name__ = "unnamed-line", this._arrow_el = null, this._hit_el = null, this.svg_element = this.create();
@@ -1825,19 +1825,19 @@ const ms = class ms extends re {
1825
1825
  const t = ((s = this.graph.__data__.extremes) == null ? void 0 : s.x_max) ?? 1, e = this.__data__.meta ?? {};
1826
1826
  if (e.isMeanEdge) {
1827
1827
  this._stampEdge(this.svg_element);
1828
- const i = typeof e.weight == "number" ? e.weight : 0, n = typeof e.maxWeight == "number" ? e.maxWeight : 1, r = typeof e.opacity == "number" ? e.opacity : Math.min(1, i / (n || 1)), a = t > 0 ? t : 1, h = typeof e.widthFrac == "number" ? a * e.widthFrac * i : a * mi * (i / (n || 1)), o = this.__data__._color || new st("#000000"), l = typeof e.saturation == "number" ? e.saturation : r, _ = new we(o, l, r).toString();
1828
+ const i = typeof e.weight == "number" ? e.weight : 0, n = typeof e.maxWeight == "number" ? e.maxWeight : 1, r = typeof e.opacity == "number" ? e.opacity : Math.min(1, i / (n || 1)), a = t > 0 ? t : 1, h = typeof e.widthFrac == "number" ? a * e.widthFrac * i : a * mi * (i / (n || 1)), o = this.__data__._color || new st("#000000"), l = typeof e.saturation == "number" ? e.saturation : r, u = new we(o, l, r).toString();
1829
1829
  if (this.__data__ instanceof ne)
1830
- this.__data__.weight = h, this.svg_element.setAttribute("d", this.__data__.path), this.svg_element.setAttribute("fill", _), this.svg_element.setAttribute("stroke", "none");
1830
+ this.__data__.weight = h, this.svg_element.setAttribute("d", this.__data__.path), this.svg_element.setAttribute("fill", u), this.svg_element.setAttribute("stroke", "none");
1831
1831
  else if (this.__data__ instanceof Wt) {
1832
- if (this.__data__.weight = h, this.svg_element.setAttribute("d", this.__data__.path), this.svg_element.setAttribute("fill", _), this.svg_element.setAttribute("stroke", _), this.svg_element.setAttribute("stroke-width", String(pi)), this.svg_element.setAttribute("vector-effect", "non-scaling-stroke"), this.svg_element.setAttribute("stroke-linejoin", "round"), e.isDirected)
1832
+ if (this.__data__.weight = h, this.svg_element.setAttribute("d", this.__data__.path), this.svg_element.setAttribute("fill", u), this.svg_element.setAttribute("stroke", u), this.svg_element.setAttribute("stroke-width", String(pi)), this.svg_element.setAttribute("vector-effect", "non-scaling-stroke"), this.svg_element.setAttribute("stroke-linejoin", "round"), e.isDirected)
1833
1833
  try {
1834
1834
  const c = new Ie(this.__data__).path;
1835
- c && !c.includes("NaN") && !c.includes("Infinity") && (this._arrow_el || (this._arrow_el = document.createElementNS("http://www.w3.org/2000/svg", "path"), this._arrow_el.setAttribute("stroke", "none")), this._arrow_el.parentElement || this.parent.appendChild(this._arrow_el), this._arrow_el.setAttribute("d", c), this._arrow_el.setAttribute("fill", Si(vi(_), bi)), this._arrow_el.setAttribute("stroke", "#ffffff"), this._arrow_el.setAttribute("stroke-width", String(yi)), this._arrow_el.setAttribute("vector-effect", "non-scaling-stroke"), this._arrow_el.setAttribute("stroke-linejoin", "round"));
1835
+ c && !c.includes("NaN") && !c.includes("Infinity") && (this._arrow_el || (this._arrow_el = document.createElementNS("http://www.w3.org/2000/svg", "path"), this._arrow_el.setAttribute("stroke", "none")), this._arrow_el.parentElement || this.parent.appendChild(this._arrow_el), this._arrow_el.setAttribute("d", c), this._arrow_el.setAttribute("fill", Si(vi(u), bi)), this._arrow_el.setAttribute("stroke", "#ffffff"), this._arrow_el.setAttribute("stroke-width", String(yi)), this._arrow_el.setAttribute("vector-effect", "non-scaling-stroke"), this._arrow_el.setAttribute("stroke-linejoin", "round"));
1836
1836
  } catch {
1837
1837
  }
1838
1838
  } else {
1839
- const g = this.__data__.from.x, c = this.__data__.from.y, E = this.__data__.to.x, m = this.__data__.to.y;
1840
- this.svg_element.setAttribute("x1", g.toString()), this.svg_element.setAttribute("y1", c.toString()), this.svg_element.setAttribute("x2", E.toString()), this.svg_element.setAttribute("y2", m.toString()), this.svg_element.setAttribute("stroke-width", h.toString()), this.svg_element.setAttribute("stroke", _), this.svg_element.setAttribute("pointer-events", "stroke"), this.svg_element.removeAttribute("marker-end"), this._hit_el || (this._hit_el = document.createElementNS("http://www.w3.org/2000/svg", "line"), this._hit_el.setAttribute("stroke", "transparent"), this._hit_el.setAttribute("stroke-linecap", "round"), this._hit_el.setAttribute("pointer-events", "stroke")), this._hit_el.parentElement || this.parent.appendChild(this._hit_el), this._hit_el.setAttribute("x1", g.toString()), this._hit_el.setAttribute("y1", c.toString()), this._hit_el.setAttribute("x2", E.toString()), this._hit_el.setAttribute("y2", m.toString()), this._hit_el.setAttribute("stroke-width", Math.max(h, t * 0.03).toString()), this._stampEdge(this._hit_el);
1839
+ const g = this.__data__.from.x, c = this.__data__.from.y, v = this.__data__.to.x, m = this.__data__.to.y;
1840
+ this.svg_element.setAttribute("x1", g.toString()), this.svg_element.setAttribute("y1", c.toString()), this.svg_element.setAttribute("x2", v.toString()), this.svg_element.setAttribute("y2", m.toString()), this.svg_element.setAttribute("stroke-width", h.toString()), this.svg_element.setAttribute("stroke", u), this.svg_element.setAttribute("pointer-events", "stroke"), this.svg_element.removeAttribute("marker-end"), this._hit_el || (this._hit_el = document.createElementNS("http://www.w3.org/2000/svg", "line"), this._hit_el.setAttribute("stroke", "transparent"), this._hit_el.setAttribute("stroke-linecap", "round"), this._hit_el.setAttribute("pointer-events", "stroke")), this._hit_el.parentElement || this.parent.appendChild(this._hit_el), this._hit_el.setAttribute("x1", g.toString()), this._hit_el.setAttribute("y1", c.toString()), this._hit_el.setAttribute("x2", v.toString()), this._hit_el.setAttribute("y2", m.toString()), this._hit_el.setAttribute("stroke-width", Math.max(h, t * 0.03).toString()), this._stampEdge(this._hit_el);
1841
1841
  }
1842
1842
  } else {
1843
1843
  this.svg_element.setAttribute("x1", this.__data__.from.x.toString()), this.svg_element.setAttribute("y1", this.__data__.from.y.toString()), this.svg_element.setAttribute("x2", this.__data__.to.x.toString()), this.svg_element.setAttribute("y2", this.__data__.to.y.toString());
@@ -1850,7 +1850,7 @@ const ms = class ms extends re {
1850
1850
  this._hit_el && ((t = this.parent) == null || t.appendChild(this._hit_el)), (e = this.parent) == null || e.appendChild(this.svg_element), this._arrow_el && ((s = this.parent) == null || s.appendChild(this._arrow_el));
1851
1851
  }
1852
1852
  };
1853
- u(ms, "QELine");
1853
+ _(ms, "QELine");
1854
1854
  let St = ms;
1855
1855
  const ps = class ps extends re {
1856
1856
  constructor(t, e, s, i = new Ct()) {
@@ -1943,7 +1943,7 @@ const ps = class ps extends re {
1943
1943
  (t = this.parent) == null || t.appendChild(this.svg_element);
1944
1944
  }
1945
1945
  };
1946
- u(ps, "QEPoint");
1946
+ _(ps, "QEPoint");
1947
1947
  let oe = ps;
1948
1948
  const bs = class bs extends re {
1949
1949
  constructor(t, e, s, i = new Ct()) {
@@ -1977,8 +1977,8 @@ const bs = class bs extends re {
1977
1977
  if (this._segments_group.innerHTML = "", this.__data__.lineStyle === "tapered") {
1978
1978
  const s = this.__data__.pathPoints, i = s.length - 1, [n, r] = this.__data__.strokeWidthRange, [a, h] = this.__data__.opacityRange;
1979
1979
  for (let o = 0; o < i; o++) {
1980
- const l = s[o], _ = s[o + 1], g = i <= 1 ? 1 : o / (i - 1), c = n + (r - n) * g, E = a + (h - a) * g, m = document.createElementNS("http://www.w3.org/2000/svg", "path");
1981
- m.setAttribute("d", `M${l.x},${l.y} L${_.x},${_.y}`), m.setAttribute("fill", "none"), m.setAttribute("stroke", this.__data__.color.toString()), m.setAttribute("stroke-linecap", "round"), m.setAttribute("stroke-linejoin", "round"), m.setAttribute("stroke-width", this.graphUnitsForPixels(c).toString()), m.setAttribute("opacity", E.toString()), this._segments_group.appendChild(m);
1980
+ const l = s[o], u = s[o + 1], g = i <= 1 ? 1 : o / (i - 1), c = n + (r - n) * g, v = a + (h - a) * g, m = document.createElementNS("http://www.w3.org/2000/svg", "path");
1981
+ m.setAttribute("d", `M${l.x},${l.y} L${u.x},${u.y}`), m.setAttribute("fill", "none"), m.setAttribute("stroke", this.__data__.color.toString()), m.setAttribute("stroke-linecap", "round"), m.setAttribute("stroke-linejoin", "round"), m.setAttribute("stroke-width", this.graphUnitsForPixels(c).toString()), m.setAttribute("opacity", v.toString()), this._segments_group.appendChild(m);
1982
1982
  }
1983
1983
  this._segments_group.style.display = "block";
1984
1984
  } else
@@ -1999,7 +1999,7 @@ const bs = class bs extends re {
1999
1999
  this.svg_element && !this.svg_element.parentElement && this.parent.appendChild(this.svg_element), this.update();
2000
2000
  }
2001
2001
  };
2002
- u(bs, "QETrajectory");
2002
+ _(bs, "QETrajectory");
2003
2003
  let Ne = bs;
2004
2004
  const { ArrayTools: Ws } = ie, ys = class ys extends Array {
2005
2005
  constructor(...t) {
@@ -2010,7 +2010,7 @@ const { ArrayTools: Ws } = ie, ys = class ys extends Array {
2010
2010
  function i(r) {
2011
2011
  return r.name === e ? r : void 0;
2012
2012
  }
2013
- u(i, "fn");
2013
+ _(i, "fn");
2014
2014
  function n(r, a, h = null) {
2015
2015
  if (Ws.isArray(r)) {
2016
2016
  for (const [o, l] of r.entries())
@@ -2027,13 +2027,13 @@ const { ArrayTools: Ws } = ie, ys = class ys extends Array {
2027
2027
  }
2028
2028
  return s;
2029
2029
  }
2030
- return u(n, "recurse"), n(this);
2030
+ return _(n, "recurse"), n(this);
2031
2031
  }
2032
2032
  flatten() {
2033
2033
  return this.reduce((t, e) => (t.push(e), e.layers && Array.isArray(e.layers) && t.push(...e.layers), t), []);
2034
2034
  }
2035
2035
  };
2036
- u(ys, "QEArray");
2036
+ _(ys, "QEArray");
2037
2037
  let Ct = ys;
2038
2038
  const Ei = {
2039
2039
  AxisPoint: oe,
@@ -2048,7 +2048,7 @@ const Ei = {
2048
2048
  }, jt = class jt {
2049
2049
  constructor(t, e, s, i = new Ct()) {
2050
2050
  this.__data__ = t, this.parent = e, this.graph = s, this.__children__ = i, this.__name__ = t.name || "unnamed-layer", t.__state__.addListener("layer_updated", "live", ({ key: n, newValue: r, oldValue: a }) => {
2051
- const h = /* @__PURE__ */ u((g) => {
2051
+ const h = /* @__PURE__ */ _((g) => {
2052
2052
  var c;
2053
2053
  return (c = g.__data__) == null ? void 0 : c.ID;
2054
2054
  }, "childId"), o = this.__children__.filter(
@@ -2060,9 +2060,9 @@ const Ei = {
2060
2060
  (g) => !this.__children__.some((c) => h(c) === g.ID)
2061
2061
  ).forEach((g) => {
2062
2062
  const c = g._typeName || g.constructor.name;
2063
- let E = Ei[c];
2064
- E || (g instanceof Ee ? E = Ne : g instanceof J ? E = oe : E = St);
2065
- const m = new E(g, this.svg_element, this.graph);
2063
+ let v = Ei[c];
2064
+ v || (g instanceof Ee ? v = Ne : g instanceof J ? v = oe : v = St);
2065
+ const m = new v(g, this.svg_element, this.graph);
2066
2066
  this.__children__.push(m);
2067
2067
  }), l.forEach((g) => {
2068
2068
  const c = r.objects.get(h(g));
@@ -2103,11 +2103,11 @@ const Ei = {
2103
2103
  this.__children__.push(t);
2104
2104
  }
2105
2105
  };
2106
- u(jt, "QELayer"), jt.tagName = "g";
2106
+ _(jt, "QELayer"), jt.tagName = "g";
2107
2107
  let ts = jt;
2108
2108
  const xs = class xs {
2109
- constructor(t, e, s, i, n = H.DISPLAY_TYPES.ON, r = H.POSITION.OBJECT, a, h) {
2110
- this.text = t, this.point = e, this.parent = s, this.graph = i, this.displayMode = n, this.position = r, this.customX = a, this.customY = h, this._visible = !1, this._offsetX = 0, this._offsetY = 0, this.pinned = !1, this.svg_element = this._create(), n === H.DISPLAY_TYPES.ON ? (this._visible = !0, this.svg_element.setAttribute("display", "block")) : (this._visible = !1, this.svg_element.setAttribute("display", "none"));
2109
+ constructor(t, e, s, i, n = U.DISPLAY_TYPES.ON, r = U.POSITION.OBJECT, a, h) {
2110
+ this.text = t, this.point = e, this.parent = s, this.graph = i, this.displayMode = n, this.position = r, this.customX = a, this.customY = h, this._visible = !1, this._offsetX = 0, this._offsetY = 0, this.pinned = !1, this.svg_element = this._create(), n === U.DISPLAY_TYPES.ON ? (this._visible = !0, this.svg_element.setAttribute("display", "block")) : (this._visible = !1, this.svg_element.setAttribute("display", "none"));
2111
2111
  }
2112
2112
  _create() {
2113
2113
  const t = document.createElementNS("http://www.w3.org/2000/svg", "text");
@@ -2119,17 +2119,17 @@ const xs = class xs {
2119
2119
  e.preventDefault(), e.stopPropagation();
2120
2120
  const s = t.ownerSVGElement;
2121
2121
  if (!s) return;
2122
- const i = /* @__PURE__ */ u((l, _) => {
2122
+ const i = /* @__PURE__ */ _((l, u) => {
2123
2123
  const g = s.createSVGPoint();
2124
- g.x = l, g.y = _;
2124
+ g.x = l, g.y = u;
2125
2125
  const c = s.getScreenCTM();
2126
2126
  return c ? g.matrixTransform(c.inverse()) : { x: 0, y: 0 };
2127
2127
  }, "toUser"), n = i(e.clientX, e.clientY), r = this._offsetX, a = this._offsetY;
2128
2128
  t.style.cursor = "grabbing";
2129
- const h = /* @__PURE__ */ u((l) => {
2130
- const _ = i(l.clientX, l.clientY);
2131
- this._offsetX = r + (_.x - n.x), this._offsetY = a + (_.y - n.y), this.pinned = !0, this._visible = !0, this.svg_element.setAttribute("display", "block"), this.update();
2132
- }, "onMove"), o = /* @__PURE__ */ u(() => {
2129
+ const h = /* @__PURE__ */ _((l) => {
2130
+ const u = i(l.clientX, l.clientY);
2131
+ this._offsetX = r + (u.x - n.x), this._offsetY = a + (u.y - n.y), this.pinned = !0, this._visible = !0, this.svg_element.setAttribute("display", "block"), this.update();
2132
+ }, "onMove"), o = /* @__PURE__ */ _(() => {
2133
2133
  document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", o), t.style.cursor = "grab", this.graph.dispatchEvent(new CustomEvent("qe-label-move", {
2134
2134
  detail: { id: this.point.ID, transform: { x: this._offsetX, y: this._offsetY } },
2135
2135
  bubbles: !0,
@@ -2151,28 +2151,68 @@ const xs = class xs {
2151
2151
  const e = this.graph._labelFont ?? {}, s = e.size ? e.size * this.graph.unitsPerPixel() : t * 0.06, i = s * 1.2;
2152
2152
  let n, r, a;
2153
2153
  switch (this.position) {
2154
- case H.POSITION.STATIC: {
2154
+ case U.POSITION.STATIC: {
2155
2155
  n = this.point.x, r = this.point.y - i * 0.3, a = "middle";
2156
2156
  break;
2157
2157
  }
2158
- case H.POSITION.CONTAINER: {
2159
- const { cx: o, cy: l } = this.graph.__data__.extremes, _ = this.point.x - o, g = this.point.y - l, c = Math.sqrt(_ * _ + g * g) || 1, E = t * 0.93 / c;
2160
- n = o + _ * E, r = l + g * E - i * 0.3, a = _ >= 0 ? "start" : "end";
2158
+ case U.POSITION.CONTAINER: {
2159
+ const { cx: o, cy: l } = this.graph.__data__.extremes, u = this.point.x - o, g = this.point.y - l, c = Math.sqrt(u * u + g * g) || 1, v = t * 0.93 / c;
2160
+ n = o + u * v, r = l + g * v - i * 0.3, a = u >= 0 ? "start" : "end";
2161
2161
  break;
2162
2162
  }
2163
- case H.POSITION.CUSTOM:
2163
+ case U.POSITION.CUSTOM:
2164
2164
  if (this.customX != null && this.customY != null) {
2165
2165
  n = this.customX, r = this.customY, a = "start";
2166
2166
  break;
2167
2167
  }
2168
2168
  default:
2169
- case H.POSITION.OBJECT: {
2169
+ case U.POSITION.OBJECT: {
2170
2170
  const o = this.point.x >= 0 ? i : -i;
2171
2171
  a = this.point.x >= 0 ? "start" : "end", n = this.point.x + o, r = this.point.y - i * 0.4;
2172
2172
  break;
2173
2173
  }
2174
2174
  }
2175
- this.svg_element.setAttribute("x", n.toString()), this.svg_element.setAttribute("y", r.toString()), (this._offsetX || this._offsetY) && this.svg_element.setAttribute("transform", `translate(${this._offsetX}, ${this._offsetY})`), this.svg_element.setAttribute("font-size", s.toString()), this.svg_element.setAttribute("font-family", e.family ?? "system-ui, sans-serif"), this.svg_element.setAttribute("font-weight", "500"), this.svg_element.setAttribute("text-anchor", a), this.svg_element.setAttribute("fill", e.color ?? ((h = this.point.color) == null ? void 0 : h.toString()) ?? "#333333");
2175
+ this.svg_element.setAttribute("x", n.toString()), this.svg_element.setAttribute("y", r.toString()), (this._offsetX || this._offsetY) && this.svg_element.setAttribute("transform", `translate(${this._offsetX}, ${this._offsetY})`), this.svg_element.setAttribute("font-size", s.toString()), this.svg_element.setAttribute("font-family", e.family ?? "system-ui, sans-serif"), this.svg_element.setAttribute("font-weight", "500"), this.svg_element.setAttribute("text-anchor", a), this.svg_element.setAttribute("fill", e.color ?? ((h = this.point.color) == null ? void 0 : h.toString()) ?? "#333333"), !this._offsetX && !this._offsetY && this.position !== U.POSITION.CUSTOM && this.fitInside(n, r, a, i, s * 0.3);
2176
+ }
2177
+ /** The visible plot area in this label's coordinates (so zoom, pan and the
2178
+ * viewBox's letterboxing are accounted for), or null if not laid out. */
2179
+ visibleBounds() {
2180
+ var h;
2181
+ const t = this.svg_element, e = t.ownerSVGElement, s = (h = t.getScreenCTM) == null ? void 0 : h.call(t);
2182
+ if (!e || !s) return null;
2183
+ const i = e.getBoundingClientRect();
2184
+ if (!(i.width > 0 && i.height > 0)) return null;
2185
+ const n = s.inverse(), r = new DOMPoint(i.left, i.top).matrixTransform(n), a = new DOMPoint(i.right, i.bottom).matrixTransform(n);
2186
+ return {
2187
+ left: Math.min(r.x, a.x),
2188
+ right: Math.max(r.x, a.x),
2189
+ top: Math.min(r.y, a.y),
2190
+ bottom: Math.max(r.y, a.y)
2191
+ };
2192
+ }
2193
+ bbox() {
2194
+ try {
2195
+ const t = this.svg_element.getBBox();
2196
+ return t.width > 0 ? t : null;
2197
+ } catch {
2198
+ return null;
2199
+ }
2200
+ }
2201
+ /** If the label runs past an edge: put an outward label on the other side
2202
+ * of its point, and if it still doesn't fit, slide it back inside. */
2203
+ fitInside(t, e, s, i, n) {
2204
+ const r = this.visibleBounds();
2205
+ let a = this.bbox();
2206
+ if (!r || !a) return;
2207
+ const h = r.left + n, o = r.right - n, l = r.top + n, u = r.bottom - n, g = /* @__PURE__ */ _((A) => Math.max(0, h - A.x) + Math.max(0, A.x + A.width - o), "over"), c = this.svg_element;
2208
+ if (g(a) > 0 && this.position === U.POSITION.OBJECT && s !== "middle") {
2209
+ const A = s === "end" ? "start" : "end", O = s === "end" ? this.point.x + i : this.point.x - i;
2210
+ c.setAttribute("text-anchor", A), c.setAttribute("x", O.toString());
2211
+ const F = this.bbox();
2212
+ F && g(F) < g(a) ? (a = F, t = O) : (c.setAttribute("text-anchor", s), c.setAttribute("x", t.toString()));
2213
+ }
2214
+ let v = 0, m = 0;
2215
+ a.x < h ? v = h - a.x : a.x + a.width > o && (v = Math.max(o - (a.x + a.width), h - a.x)), a.y < l ? m = l - a.y : a.y + a.height > u && (m = Math.max(u - (a.y + a.height), l - a.y)), v && c.setAttribute("x", (t + v).toString()), m && c.setAttribute("y", (e + m).toString());
2176
2216
  }
2177
2217
  /** Make the label visible and position it immediately. */
2178
2218
  show() {
@@ -2191,32 +2231,32 @@ const xs = class xs {
2191
2231
  this.svg_element.remove();
2192
2232
  }
2193
2233
  };
2194
- u(xs, "QELabel");
2234
+ _(xs, "QELabel");
2195
2235
  let Jt = xs;
2196
2236
  const je = class je extends HTMLElement {
2197
2237
  };
2198
- u(je, "QENodesElement"), je.tagName = "qe-nodes";
2238
+ _(je, "QENodesElement"), je.tagName = "qe-nodes";
2199
2239
  let ke = je;
2200
2240
  const Ye = class Ye extends HTMLElement {
2201
2241
  };
2202
- u(Ye, "QEMeansElement"), Ye.tagName = "qe-means";
2242
+ _(Ye, "QEMeansElement"), Ye.tagName = "qe-means";
2203
2243
  let Ce = Ye;
2204
2244
  const qe = class qe extends HTMLElement {
2205
2245
  };
2206
- u(qe, "QEPointsElement"), qe.tagName = "qe-points";
2246
+ _(qe, "QEPointsElement"), qe.tagName = "qe-points";
2207
2247
  let Oe = qe;
2208
2248
  const Ue = class Ue extends HTMLElement {
2209
2249
  };
2210
- u(Ue, "QEEdgesElement"), Ue.tagName = "qe-edges";
2250
+ _(Ue, "QEEdgesElement"), Ue.tagName = "qe-edges";
2211
2251
  let $e = Ue;
2212
- const Ge = class Ge extends HTMLElement {
2213
- };
2214
- u(Ge, "QETrajectoriesElement"), Ge.tagName = "qe-trajectories";
2215
- let Pe = Ge;
2216
2252
  const Be = class Be extends HTMLElement {
2217
2253
  };
2218
- u(Be, "QEAxesElement"), Be.tagName = "qe-axes";
2219
- let Re = Be;
2254
+ _(Be, "QETrajectoriesElement"), Be.tagName = "qe-trajectories";
2255
+ let Pe = Be;
2256
+ const Ge = class Ge extends HTMLElement {
2257
+ };
2258
+ _(Ge, "QEAxesElement"), Ge.tagName = "qe-axes";
2259
+ let Re = Ge;
2220
2260
  customElements.define(ke.tagName, ke);
2221
2261
  customElements.define(Ce.tagName, Ce);
2222
2262
  customElements.define(Oe.tagName, Oe);
@@ -2243,32 +2283,32 @@ function Mi(d, t) {
2243
2283
  }
2244
2284
  return null;
2245
2285
  }
2246
- u(Mi, "parseEdgePair");
2286
+ _(Mi, "parseEdgePair");
2247
2287
  function Ii(d, t, e, s) {
2248
2288
  const i = Math.max(1, e - 1), n = i >= 120 ? 1.96 : i >= 60 ? 2 : i >= 30 ? 2.042 : i >= 20 ? 2.086 : i >= 10 ? 2.228 : i >= 5 ? 2.571 : 4.303, r = Math.sqrt(Math.max(0, d) / e) * s, a = Math.sqrt(Math.max(0, t) / e) * s;
2249
2289
  return { halfW: n * r, halfH: n * a };
2250
2290
  }
2251
- u(Ii, "computeCIRect");
2291
+ _(Ii, "computeCIRect");
2252
2292
  const Ni = 0.5;
2253
2293
  function pe(d, t, e) {
2254
2294
  if (!d) return;
2255
2295
  const s = Math.min(Math.abs(t), Math.abs(e));
2256
2296
  s > 0 && (d.meta = { ...d.meta ?? {}, maxRadius: s * Ni });
2257
2297
  }
2258
- u(pe, "capMeanToInterval");
2298
+ _(pe, "capMeanToInterval");
2259
2299
  function be(d, t, e, s = "") {
2260
- const i = /* @__PURE__ */ u((o) => {
2261
- const l = d.names.indexOf(o), _ = l >= 0 ? d[l] : null;
2262
- if (_ == null || _ === "") return;
2263
- const g = Number(_);
2300
+ const i = /* @__PURE__ */ _((o) => {
2301
+ const l = d.names.indexOf(o), u = l >= 0 ? d[l] : null;
2302
+ if (u == null || u === "") return;
2303
+ const g = Number(u);
2264
2304
  return Number.isFinite(g) ? g : void 0;
2265
2305
  }, "get"), n = i(`${t}.${s}low`) ?? i(`${t}_${s}low`), r = i(`${t}.${s}high`) ?? i(`${t}_${s}high`), a = i(`${e}.${s}low`) ?? i(`${e}_${s}low`), h = i(`${e}.${s}high`) ?? i(`${e}_${s}high`);
2266
2306
  return n == null || r == null || a == null || h == null ? null : { x_low: n, x_high: r, y_low: a, y_high: h };
2267
2307
  }
2268
- u(be, "readIntervalBounds");
2308
+ _(be, "readIntervalBounds");
2269
2309
  function ki(d) {
2270
2310
  var i, n;
2271
- const t = /* @__PURE__ */ u((r) => d.getAttribute(r), "a"), e = ((i = t("colors")) == null ? void 0 : i.split(",").map((r) => r.trim()).filter(Boolean)) ?? [], s = ((n = t("threshold")) == null ? void 0 : n.split(",").map(Number).filter(Number.isFinite)) ?? [];
2311
+ const t = /* @__PURE__ */ _((r) => d.getAttribute(r), "a"), e = ((i = t("colors")) == null ? void 0 : i.split(",").map((r) => r.trim()).filter(Boolean)) ?? [], s = ((n = t("threshold")) == null ? void 0 : n.split(",").map(Number).filter(Number.isFinite)) ?? [];
2272
2312
  return {
2273
2313
  group: t("group"),
2274
2314
  unit: t("unit"),
@@ -2280,17 +2320,17 @@ function ki(d) {
2280
2320
  name: t("name")
2281
2321
  };
2282
2322
  }
2283
- u(ki, "parseEdgeLayer");
2323
+ _(ki, "parseEdgeLayer");
2284
2324
  function Ci(d) {
2285
- const { r: t, g: e, b: s } = st.parseColor(d), i = Math.max(t, e, s), n = Math.min(t, e, s), r = /* @__PURE__ */ u((a) => (i + n - a).toString(16).padStart(2, "0"), "f");
2325
+ const { r: t, g: e, b: s } = st.parseColor(d), i = Math.max(t, e, s), n = Math.min(t, e, s), r = /* @__PURE__ */ _((a) => (i + n - a).toString(16).padStart(2, "0"), "f");
2286
2326
  return `#${r(t)}${r(e)}${r(s)}`;
2287
2327
  }
2288
- u(Ci, "complementColor");
2328
+ _(Ci, "complementColor");
2289
2329
  function Oi(d) {
2290
2330
  const t = d == null ? void 0 : d.trim().toLowerCase();
2291
2331
  return t === "plot" || t === "absolute" ? t : "model";
2292
2332
  }
2293
- u(Oi, "parseColorScale");
2333
+ _(Oi, "parseColorScale");
2294
2334
  function He(d, t) {
2295
2335
  switch (d == null ? void 0 : d.toLowerCase()) {
2296
2336
  case "on":
@@ -2305,11 +2345,11 @@ function He(d, t) {
2305
2345
  return t;
2306
2346
  }
2307
2347
  }
2308
- u(He, "parseLabelMode");
2348
+ _(He, "parseLabelMode");
2309
2349
  const gt = class gt extends ve {
2310
2350
  constructor() {
2311
2351
  super(), this.zoom_level = 1, this.__children__ = new Ct(), this._hasModel = !1, this._renderPending = !1, this._childObserver = null, this._ciRects = /* @__PURE__ */ new Map(), this._outlierRects = /* @__PURE__ */ new Map(), this._ciCross = /* @__PURE__ */ new Map(), this._labelsGroup = null, this._nodeLabels = /* @__PURE__ */ new Map(), this._meanLabels = /* @__PURE__ */ new Map(), this._pointLabels = /* @__PURE__ */ new Map(), this._showAxes = !1, this._axisXText = null, this._axisYText = null, this._axisLabelEls = /* @__PURE__ */ new Map(), this._magnifyText = null, this._magnifyEl = null, this._rangeExtent = null, this._rangeMode = null, this._centerContent = !1, this._plotTitle = null, this._titleEl = null, this._resizeObs = null, this._labelFont = { size: null, family: null, color: null }, this._animateMs = 0, this._tweenRaf = null, this._highlight = { edges: /* @__PURE__ */ new Set(), nodes: /* @__PURE__ */ new Set() }, this._highlightGroup = null, this._tooltipEl = null, this.graph = this, this.parent = null, this.__data__ = new Ke(Ks), this.__name__ = this.__data__.name || "unnamed-graph", this.svg_element = this.create(), console.log("Created ena-graph svg element: ", this.svg_element), document.addEventListener("model-updated", (t) => {
2312
- var vs, Ss, Es, Ms, Is, Ns, ks, Cs, Os, $s, Ps, Rs, Ls, Ds, Ts;
2352
+ var vs, Ss, Es, Ms, Is, Ns, ks, Cs, Os, $s, Ps, Rs, Ls, Ts, Ds;
2313
2353
  const e = ((vs = t.composedPath) == null ? void 0 : vs.call(t)[0]) ?? t.target;
2314
2354
  if (this._vizena && e !== this._vizena) return;
2315
2355
  const s = t.detail;
@@ -2319,61 +2359,61 @@ const gt = class gt extends ve {
2319
2359
  this._hasModel = !0;
2320
2360
  const n = s.dimensions, r = s.unit_id_col, a = s.node_id_col, h = s.group_col, o = this._readLayerConfig();
2321
2361
  this._showAxes = o.showAxes, this._axisXText = o.axisXLabel === null ? null : o.axisXLabel || String((n == null ? void 0 : n[0]) ?? "x"), this._magnifyText = o.edgeMagnify == null ? null : `(scaled ${o.edgeMagnify.toFixed(1)}x)`, this._axisYText = o.axisYLabel === null ? null : o.axisYLabel || String((n == null ? void 0 : n[1]) ?? "y");
2322
- const l = {}, _ = (Ss = s.palette) != null && Ss.length ? s.palette : Vs;
2362
+ const l = {}, u = (Ss = s.palette) != null && Ss.length ? s.palette : Vs;
2323
2363
  if (h && ((Es = s.points) != null && Es.names)) {
2324
2364
  const C = s.points.col(h);
2325
- C && [...new Set([...C].map(String))].forEach(($, y) => {
2326
- l[$] = _[y % _.length];
2365
+ C && [...new Set([...C].map(String))].forEach((P, y) => {
2366
+ l[P] = u[y % u.length];
2327
2367
  });
2328
2368
  }
2329
2369
  (Ms = s.groups) != null && Ms.rows && s.groups.rows().length > 0 && s.groups.rows().forEach((C) => {
2330
- const I = C.rowName ?? String(C[0]), $ = C.names.indexOf("color"), y = $ >= 0 ? C[$] : null;
2331
- y && String(y) !== "NA" ? l[I] = String(y) : l[I] || (l[I] = _[Object.keys(l).length % _.length]);
2370
+ const I = C.rowName ?? String(C[0]), P = C.names.indexOf("color"), y = P >= 0 ? C[P] : null;
2371
+ y && String(y) !== "NA" ? l[I] = String(y) : l[I] || (l[I] = u[Object.keys(l).length % u.length]);
2332
2372
  });
2333
2373
  const g = Object.keys(l), c = o.activeMeanGroups && o.activeMeanGroups.trim() ? new Set(
2334
2374
  o.activeMeanGroups.split(",").map((C) => C.trim()).filter((C) => l[C])
2335
2375
  // silently drop names not in model
2336
- ) : new Set(g), E = o.scalePoints, m = /* @__PURE__ */ u((C) => {
2376
+ ) : new Set(g), v = o.scalePoints, m = /* @__PURE__ */ _((C) => {
2337
2377
  let I = 0;
2338
- return C.forEach(($) => {
2339
- const y = $.names.indexOf(n[0]), b = n.length > 1 ? $.names.indexOf(n[1]) : -1;
2340
- y >= 0 && (I = Math.max(I, Math.abs(Number($[y])))), b >= 0 && (I = Math.max(I, Math.abs(Number($[b]))));
2378
+ return C.forEach((P) => {
2379
+ const y = P.names.indexOf(n[0]), b = n.length > 1 ? P.names.indexOf(n[1]) : -1;
2380
+ y >= 0 && (I = Math.max(I, Math.abs(Number(P[y])))), b >= 0 && (I = Math.max(I, Math.abs(Number(P[b]))));
2341
2381
  }), I;
2342
- }, "getExtent"), S = (Is = s.nodes) != null && Is.rows ? m(s.nodes.rows()) : 0, R = (Ns = s.points) != null && Ns.rows ? m(s.points.rows()) : 0, j = (ks = s.trajectories) != null && ks.rows ? m(s.trajectories.rows()) : 0, Y = R > 0 ? R : j, v = o.pointScale !== null ? o.pointScale : E && Y > 0 && S > 0 ? S / Y : 1;
2343
- this._rangeExtent = o.range === "network" ? S * 1.2 : o.range === "points" ? Y * v * 1.2 : typeof o.range == "number" ? o.range : null, this._rangeMode = o.range === "network" || o.range === "points" ? o.range : typeof o.range == "number" ? "number" : null, this._centerContent = o.centerContent, this._plotTitle = o.plotTitle, this._labelFont = o.labelFont;
2344
- const F = o.labelNodes, nt = o.labelMeans, ot = o.labelPoints, it = this._labelsGroup, _t = /* @__PURE__ */ u((C, I, $, y = 1) => {
2345
- const b = C.names.indexOf(I), A = C.names.indexOf(n[0]), O = n.length > 1 ? C.names.indexOf(n[1]) : -1, p = new J({
2382
+ }, "getExtent"), A = (Is = s.nodes) != null && Is.rows ? m(s.nodes.rows()) : 0, O = (Ns = s.points) != null && Ns.rows ? m(s.points.rows()) : 0, F = (ks = s.trajectories) != null && ks.rows ? m(s.trajectories.rows()) : 0, Y = O > 0 ? O : F, E = o.pointScale !== null ? o.pointScale : v && Y > 0 && A > 0 ? A / Y : 1;
2383
+ this._rangeExtent = o.range === "network" ? A * 1.2 : o.range === "points" ? Y * E * 1.2 : typeof o.range == "number" ? o.range : null, this._rangeMode = o.range === "network" || o.range === "points" ? o.range : typeof o.range == "number" ? "number" : null, this._centerContent = o.centerContent, this._plotTitle = o.plotTitle, this._labelFont = o.labelFont;
2384
+ const j = o.labelNodes, nt = o.labelMeans, ot = o.labelPoints, it = this._labelsGroup, ut = /* @__PURE__ */ _((C, I, P, y = 1) => {
2385
+ const b = C.names.indexOf(I), S = C.names.indexOf(n[0]), $ = n.length > 1 ? C.names.indexOf(n[1]) : -1, p = new J({
2346
2386
  ID: b >= 0 ? String(C[b]) : C.rowName || `pt-${Math.random().toString(36).slice(2)}`,
2347
2387
  dimensions: [
2348
- A >= 0 ? Number(C[A]) * y : 0,
2349
- O >= 0 ? -Number(C[O]) * y : 0
2388
+ S >= 0 ? Number(C[S]) * y : 0,
2389
+ $ >= 0 ? -Number(C[$]) * y : 0
2350
2390
  // negate Y: SVG y-down vs ENA y-up
2351
2391
  ],
2352
2392
  meta: {}
2353
2393
  });
2354
- return $ && (p.color = new st($)), p;
2394
+ return P && (p.color = new st(P)), p;
2355
2395
  }, "rowToPoint"), K = {}, It = o.showPoints, Ot = s.pointsets;
2356
2396
  if (o.pointSets.length && (Ot != null && Ot.rows)) {
2357
- const C = this.__children__.search("__children__", "points"), I = /* @__PURE__ */ u(($, y) => {
2358
- const b = $.names.indexOf(y);
2359
- return b >= 0 ? $[b] : null;
2397
+ const C = this.__children__.search("__children__", "points"), I = /* @__PURE__ */ _((P, y) => {
2398
+ const b = P.names.indexOf(y);
2399
+ return b >= 0 ? P[b] : null;
2360
2400
  }, "col");
2361
- o.pointSets.forEach(($, y) => {
2401
+ o.pointSets.forEach((P, y) => {
2362
2402
  Ot.rows().forEach((b) => {
2363
- if (String(I(b, "set")) !== $.set) return;
2364
- const A = String(I(b, "id")), O = I(b, "group") != null && String(I(b, "group")) !== "NA" ? String(I(b, "group")) : null, p = I(b, "color") && String(I(b, "color")) !== "NA" ? String(I(b, "color")) : O && l[O] ? l[O] : _[y % _.length], w = _t(b, "id", p, v);
2365
- w.ID = `${$.set}::${A}`, w.size = $.size ?? o.pointSize ?? 2.5;
2366
- const P = I(b, "shape");
2367
- P && String(P) !== "NA" && (w.shape = String(P));
2403
+ if (String(I(b, "set")) !== P.set) return;
2404
+ const S = String(I(b, "id")), $ = I(b, "group") != null && String(I(b, "group")) !== "NA" ? String(I(b, "group")) : null, p = I(b, "color") && String(I(b, "color")) !== "NA" ? String(I(b, "color")) : $ && l[$] ? l[$] : u[y % u.length], w = ut(b, "id", p, E);
2405
+ w.ID = `${P.set}::${S}`, w.size = P.size ?? o.pointSize ?? 2.5;
2406
+ const R = I(b, "shape");
2407
+ R && String(R) !== "NA" && (w.shape = String(R));
2368
2408
  const q = I(b, "label");
2369
2409
  w.meta = {
2370
2410
  stroke: "#ffffff",
2371
2411
  kind: "point",
2372
- name: q != null && String(q) !== "NA" ? String(q) : A,
2373
- group: O ?? void 0,
2374
- unit: A,
2375
- set: $.set,
2376
- fixedSize: $.fixedSize
2412
+ name: q != null && String(q) !== "NA" ? String(q) : S,
2413
+ group: $ ?? void 0,
2414
+ unit: S,
2415
+ set: P.set,
2416
+ fixedSize: P.fixedSize
2377
2417
  }, this.__data__.points.set(w.ID, w), C == null || C.__data__.objects.set(w.ID, w);
2378
2418
  });
2379
2419
  });
@@ -2382,120 +2422,120 @@ const gt = class gt extends ve {
2382
2422
  const C = this.__children__.search("__children__", "points");
2383
2423
  if (C) {
2384
2424
  s.points.rows().forEach((y) => {
2385
- const b = h ? y.names.indexOf(h) : -1, A = b >= 0 ? String(y[b]) : null, O = A ? l[A] ?? "#888888" : "#888888";
2425
+ const b = h ? y.names.indexOf(h) : -1, S = b >= 0 ? String(y[b]) : null, $ = S ? l[S] ?? "#888888" : "#888888";
2386
2426
  if (It) {
2387
- const p = _t(y, r, O, v);
2427
+ const p = ut(y, r, $, E);
2388
2428
  p.size = o.pointSize ?? 2.5, p.meta = {
2389
2429
  ...p.meta ?? {},
2390
2430
  stroke: "#ffffff",
2391
2431
  kind: "point",
2392
2432
  name: p.ID,
2393
- group: A ?? void 0,
2433
+ group: S ?? void 0,
2394
2434
  unit: p.ID,
2395
2435
  fixedSize: o.pointFixedSize
2396
2436
  }, this.__data__.points.set(p.ID, p), C.__data__.objects.set(p.ID, p);
2397
2437
  }
2398
- if (A) {
2438
+ if (S) {
2399
2439
  const p = y.names.indexOf(n[0]), w = n.length > 1 ? y.names.indexOf(n[1]) : -1;
2400
- K[A] || (K[A] = { x: 0, y: 0, x2: 0, y2: 0, xy: 0, n: 0, color: O });
2401
- const P = p >= 0 ? Number(y[p]) : 0, q = w >= 0 ? Number(y[w]) : 0;
2402
- K[A].x += P, K[A].y += q, K[A].x2 += P * P, K[A].y2 += q * q, K[A].xy += P * q, K[A].n += 1;
2440
+ K[S] || (K[S] = { x: 0, y: 0, x2: 0, y2: 0, xy: 0, n: 0, color: $ });
2441
+ const R = p >= 0 ? Number(y[p]) : 0, q = w >= 0 ? Number(y[w]) : 0;
2442
+ K[S].x += R, K[S].y += q, K[S].x2 += R * R, K[S].y2 += q * q, K[S].xy += R * q, K[S].n += 1;
2403
2443
  }
2404
2444
  });
2405
- const I = !!((Os = s.groups) != null && Os.rows && s.groups.rows().length > 0), $ = o.showMeans && I ? s.groups.rows().filter((y) => {
2445
+ const I = !!((Os = s.groups) != null && Os.rows && s.groups.rows().length > 0), P = o.showMeans && I ? s.groups.rows().filter((y) => {
2406
2446
  const b = y.rowName ?? String(y[0]);
2407
2447
  return c.size === 0 || c.has(b);
2408
2448
  }) : [];
2409
2449
  if (o.showMeans) {
2410
- const y = C.svg_element, b = this._rangeExtent ? this._rangeExtent / 1.2 : S, A = (b > 0 ? b : 1) * 8e-3;
2450
+ const y = C.svg_element, b = this._rangeExtent ? this._rangeExtent / 1.2 : A, S = (b > 0 ? b : 1) * 8e-3;
2411
2451
  if (I) {
2412
- const O = new Set($.map((p) => p.rowName ?? String(p[0])));
2452
+ const $ = new Set(P.map((p) => p.rowName ?? String(p[0])));
2413
2453
  this._ciRects.forEach((p, w) => {
2414
- O.has(w) || (p.remove(), this._ciRects.delete(w));
2454
+ $.has(w) || (p.remove(), this._ciRects.delete(w));
2415
2455
  }), this._outlierRects.forEach((p, w) => {
2416
- O.has(w) || (p.remove(), this._outlierRects.delete(w));
2456
+ $.has(w) || (p.remove(), this._outlierRects.delete(w));
2417
2457
  }), this._ciCross.forEach((p, w) => {
2418
- O.has(w.slice(2)) || (p.remove(), this._ciCross.delete(w));
2419
- }), $.forEach((p) => {
2420
- var N, z, D;
2421
- const w = p.rowName ?? String(p[0]), P = l[w] ?? "#888888", q = p.names.indexOf(n[0]), X = n.length > 1 ? p.names.indexOf(n[1]) : -1, W = q >= 0 ? Number(p[q]) * v : 0, mt = X >= 0 ? -Number(p[X]) * v : 0, Z = new J({
2458
+ $.has(w.slice(2)) || (p.remove(), this._ciCross.delete(w));
2459
+ }), P.forEach((p) => {
2460
+ var N, z, T;
2461
+ const w = p.rowName ?? String(p[0]), R = l[w] ?? "#888888", q = p.names.indexOf(n[0]), X = n.length > 1 ? p.names.indexOf(n[1]) : -1, W = q >= 0 ? Number(p[q]) * E : 0, mt = X >= 0 ? -Number(p[X]) * E : 0, Z = new J({
2422
2462
  ID: `mean-${w}`,
2423
2463
  dimensions: [W, mt],
2424
2464
  meta: { kind: "mean", name: w, group: w, fixedSize: o.meanFixedSize }
2425
2465
  });
2426
- Z.color = new st(P), Z.size = 4;
2466
+ Z.color = new st(R), Z.size = 4;
2427
2467
  const at = p.names.indexOf("shape"), L = at >= 0 ? p[at] : null;
2428
2468
  Z.shape = L && String(L) !== "NA" ? String(L) : "rect", this.__data__.points.set(Z.ID, Z), C.__data__.objects.set(Z.ID, Z);
2429
- const Tt = /* @__PURE__ */ u((M) => {
2469
+ const Dt = /* @__PURE__ */ _((M) => {
2430
2470
  const tt = p.names.indexOf(M), G = tt >= 0 ? p[tt] : null;
2431
2471
  return G == null || String(G) === "NA" || String(G) === "" ? null : G;
2432
- }, "cell"), xt = Tt("intervals"), At = xt === "box" || xt === "crosshairs" || xt === "none" ? xt : o.intervals, vt = Tt("outlier"), U = (vt == null ? o.showOutlier : vt === !0 || String(vt) === "true") ? be(p, n[0], n[1], "o") : null;
2433
- if (!U)
2472
+ }, "cell"), xt = Dt("intervals"), At = xt === "box" || xt === "crosshairs" || xt === "none" ? xt : o.intervals, vt = Dt("outlier"), B = (vt == null ? o.showOutlier : vt === !0 || String(vt) === "true") ? be(p, n[0], n[1], "o") : null;
2473
+ if (!B)
2434
2474
  (N = this._outlierRects.get(w)) == null || N.remove(), this._outlierRects.delete(w);
2435
2475
  else {
2436
2476
  let M = this._outlierRects.get(w);
2437
- M || (M = document.createElementNS("http://www.w3.org/2000/svg", "rect"), M.setAttribute("data-outlier-group", w), this._outlierRects.set(w, M)), M.setAttribute("x", (U.x_low * v).toString()), M.setAttribute("y", (-U.y_high * v).toString()), M.setAttribute("width", ((U.x_high - U.x_low) * v).toString()), M.setAttribute("height", ((U.y_high - U.y_low) * v).toString()), M.setAttribute("fill", "none"), M.setAttribute("stroke", P), M.setAttribute("stroke-width", A.toString()), M.setAttribute("stroke-opacity", "0.5"), M.setAttribute("stroke-dasharray", `${A * 2} ${A * 2}`), y && !M.parentElement && y.insertBefore(M, y.firstChild);
2477
+ M || (M = document.createElementNS("http://www.w3.org/2000/svg", "rect"), M.setAttribute("data-outlier-group", w), this._outlierRects.set(w, M)), M.setAttribute("x", (B.x_low * E).toString()), M.setAttribute("y", (-B.y_high * E).toString()), M.setAttribute("width", ((B.x_high - B.x_low) * E).toString()), M.setAttribute("height", ((B.y_high - B.y_low) * E).toString()), M.setAttribute("fill", "none"), M.setAttribute("stroke", R), M.setAttribute("stroke-width", S.toString()), M.setAttribute("stroke-opacity", "0.5"), M.setAttribute("stroke-dasharray", `${S * 2} ${S * 2}`), y && !M.parentElement && y.insertBefore(M, y.firstChild);
2438
2478
  }
2439
2479
  const f = At !== "none" ? be(p, n[0], n[1]) : null, x = `x:${w}`;
2440
2480
  if ((!f || At !== "crosshairs") && ((z = this._ciCross.get(x)) == null || z.remove(), this._ciCross.delete(x)), f && At === "crosshairs") {
2441
- (D = this._ciRects.get(w)) == null || D.remove(), this._ciRects.delete(w);
2442
- const M = f.x_low * v, tt = f.x_high * v, G = -f.y_high * v, rt = -f.y_low * v;
2481
+ (T = this._ciRects.get(w)) == null || T.remove(), this._ciRects.delete(w);
2482
+ const M = f.x_low * E, tt = f.x_high * E, G = -f.y_high * E, rt = -f.y_low * E;
2443
2483
  pe(Z, (tt - M) / 2, (rt - G) / 2);
2444
- let T = this._ciCross.get(x);
2445
- T || (T = document.createElementNS("http://www.w3.org/2000/svg", "path"), T.setAttribute("data-ci-group", w), T.setAttribute("data-ci-kind", "crosshairs"), this._ciCross.set(x, T)), T.setAttribute("d", `M${M} ${mt} L${tt} ${mt} M${W} ${G} L${W} ${rt}`), T.setAttribute("fill", "none"), T.setAttribute("stroke", P), T.setAttribute("stroke-width", (A * 1.25).toString()), T.setAttribute("stroke-opacity", "0.8"), y && !T.parentElement && y.insertBefore(T, y.firstChild);
2484
+ let D = this._ciCross.get(x);
2485
+ D || (D = document.createElementNS("http://www.w3.org/2000/svg", "path"), D.setAttribute("data-ci-group", w), D.setAttribute("data-ci-kind", "crosshairs"), this._ciCross.set(x, D)), D.setAttribute("d", `M${M} ${mt} L${tt} ${mt} M${W} ${G} L${W} ${rt}`), D.setAttribute("fill", "none"), D.setAttribute("stroke", R), D.setAttribute("stroke-width", (S * 1.25).toString()), D.setAttribute("stroke-opacity", "0.8"), y && !D.parentElement && y.insertBefore(D, y.firstChild);
2446
2486
  } else if (f) {
2447
- const M = f.x_low * v, tt = -f.y_high * v, G = (f.x_high - f.x_low) * v, rt = (f.y_high - f.y_low) * v;
2487
+ const M = f.x_low * E, tt = -f.y_high * E, G = (f.x_high - f.x_low) * E, rt = (f.y_high - f.y_low) * E;
2448
2488
  pe(Z, G / 2, rt / 2);
2449
- let T = this._ciRects.get(w);
2450
- T || (T = document.createElementNS("http://www.w3.org/2000/svg", "rect"), T.setAttribute("data-ci-group", w), this._ciRects.set(w, T)), T.setAttribute("x", M.toString()), T.setAttribute("y", tt.toString()), T.setAttribute("width", G.toString()), T.setAttribute("height", rt.toString()), T.setAttribute("fill", "none"), T.setAttribute("stroke", P), T.setAttribute("stroke-width", A.toString()), T.setAttribute("stroke-opacity", "0.8"), T.setAttribute("stroke-dasharray", `${A * 4} ${A * 3}`), y && !T.parentElement && y.insertBefore(T, y.firstChild);
2489
+ let D = this._ciRects.get(w);
2490
+ D || (D = document.createElementNS("http://www.w3.org/2000/svg", "rect"), D.setAttribute("data-ci-group", w), this._ciRects.set(w, D)), D.setAttribute("x", M.toString()), D.setAttribute("y", tt.toString()), D.setAttribute("width", G.toString()), D.setAttribute("height", rt.toString()), D.setAttribute("fill", "none"), D.setAttribute("stroke", R), D.setAttribute("stroke-width", S.toString()), D.setAttribute("stroke-opacity", "0.8"), D.setAttribute("stroke-dasharray", `${S * 4} ${S * 3}`), y && !D.parentElement && y.insertBefore(D, y.firstChild);
2451
2491
  } else {
2452
2492
  const M = this._ciRects.get(w);
2453
2493
  M && (M.remove(), this._ciRects.delete(w));
2454
2494
  }
2455
2495
  });
2456
2496
  } else
2457
- Object.entries(K).forEach(([p, { x: w, y: P, n: q, color: X }]) => {
2497
+ Object.entries(K).forEach(([p, { x: w, y: R, n: q, color: X }]) => {
2458
2498
  const W = new J({
2459
2499
  ID: `mean-${p}`,
2460
- dimensions: [w / q * v, -(P / q) * v],
2500
+ dimensions: [w / q * E, -(R / q) * E],
2461
2501
  meta: { kind: "mean", name: p, group: p, fixedSize: o.meanFixedSize }
2462
2502
  });
2463
2503
  W.color = new st(X), W.size = 4, W.shape = "rect", this.__data__.points.set(W.ID, W), C.__data__.objects.set(W.ID, W);
2464
2504
  }), o.showCI && (this._ciRects.forEach((p, w) => {
2465
2505
  K[w] || (p.remove(), this._ciRects.delete(w));
2466
2506
  }), ($s = s.confidence) != null && $s.rows ? s.confidence.rows().forEach((p) => {
2467
- const w = p.names.indexOf(h ?? "group"), P = w >= 0 ? String(p[w]) : p.rowName ?? null;
2468
- if (!P) return;
2469
- const q = l[P] ?? "#888888", X = be(p, n[0], n[1]);
2507
+ const w = p.names.indexOf(h ?? "group"), R = w >= 0 ? String(p[w]) : p.rowName ?? null;
2508
+ if (!R) return;
2509
+ const q = l[R] ?? "#888888", X = be(p, n[0], n[1]);
2470
2510
  if (!X) return;
2471
- const W = X.x_low * v, mt = -X.y_high * v, Z = (X.x_high - X.x_low) * v, at = (X.y_high - X.y_low) * v;
2511
+ const W = X.x_low * E, mt = -X.y_high * E, Z = (X.x_high - X.x_low) * E, at = (X.y_high - X.y_low) * E;
2472
2512
  pe(
2473
- this.__data__.points.get(`mean-${P}`),
2513
+ this.__data__.points.get(`mean-${R}`),
2474
2514
  Z / 2,
2475
2515
  at / 2
2476
2516
  );
2477
- let L = this._ciRects.get(P);
2478
- L || (L = document.createElementNS("http://www.w3.org/2000/svg", "rect"), L.setAttribute("data-ci-group", P), this._ciRects.set(P, L)), L.setAttribute("x", W.toString()), L.setAttribute("y", mt.toString()), L.setAttribute("width", Z.toString()), L.setAttribute("height", at.toString()), L.setAttribute("fill", "none"), L.setAttribute("stroke", q), L.setAttribute("stroke-width", A.toString()), L.setAttribute("stroke-opacity", "0.8"), L.setAttribute("stroke-dasharray", `${A * 4} ${A * 3}`), y && !L.parentElement && y.insertBefore(L, y.firstChild);
2479
- }) : Object.entries(K).forEach(([p, { x: w, y: P, x2: q, y2: X, n: W, color: mt }]) => {
2517
+ let L = this._ciRects.get(R);
2518
+ L || (L = document.createElementNS("http://www.w3.org/2000/svg", "rect"), L.setAttribute("data-ci-group", R), this._ciRects.set(R, L)), L.setAttribute("x", W.toString()), L.setAttribute("y", mt.toString()), L.setAttribute("width", Z.toString()), L.setAttribute("height", at.toString()), L.setAttribute("fill", "none"), L.setAttribute("stroke", q), L.setAttribute("stroke-width", S.toString()), L.setAttribute("stroke-opacity", "0.8"), L.setAttribute("stroke-dasharray", `${S * 4} ${S * 3}`), y && !L.parentElement && y.insertBefore(L, y.firstChild);
2519
+ }) : Object.entries(K).forEach(([p, { x: w, y: R, x2: q, y2: X, n: W, color: mt }]) => {
2480
2520
  if (W < 2) return;
2481
- const Z = w / W, at = P / W, L = q / W - Z * Z, Tt = X / W - at * at, { halfW: xt, halfH: At } = Ii(L, Tt, W, v), vt = Z * v, $t = -at * v;
2521
+ const Z = w / W, at = R / W, L = q / W - Z * Z, Dt = X / W - at * at, { halfW: xt, halfH: At } = Ii(L, Dt, W, E), vt = Z * E, $t = -at * E;
2482
2522
  pe(
2483
2523
  this.__data__.points.get(`mean-${p}`),
2484
2524
  xt,
2485
2525
  At
2486
2526
  );
2487
- let U = this._ciRects.get(p);
2488
- U || (U = document.createElementNS("http://www.w3.org/2000/svg", "rect"), U.setAttribute("data-ci-group", p), this._ciRects.set(p, U)), U.setAttribute("x", (vt - xt).toString()), U.setAttribute("y", ($t - At).toString()), U.setAttribute("width", (xt * 2).toString()), U.setAttribute("height", (At * 2).toString()), U.setAttribute("fill", "none"), U.setAttribute("stroke", mt), U.setAttribute("stroke-width", A.toString()), U.setAttribute("stroke-opacity", "0.8"), U.setAttribute("stroke-dasharray", `${A * 4} ${A * 3}`), y && !U.parentElement && y.insertBefore(U, y.firstChild);
2527
+ let B = this._ciRects.get(p);
2528
+ B || (B = document.createElementNS("http://www.w3.org/2000/svg", "rect"), B.setAttribute("data-ci-group", p), this._ciRects.set(p, B)), B.setAttribute("x", (vt - xt).toString()), B.setAttribute("y", ($t - At).toString()), B.setAttribute("width", (xt * 2).toString()), B.setAttribute("height", (At * 2).toString()), B.setAttribute("fill", "none"), B.setAttribute("stroke", mt), B.setAttribute("stroke-width", S.toString()), B.setAttribute("stroke-opacity", "0.8"), B.setAttribute("stroke-dasharray", `${S * 4} ${S * 3}`), y && !B.parentElement && y.insertBefore(B, y.firstChild);
2489
2529
  })), (Ps = s.outlier) != null && Ps.rows && (this._outlierRects.forEach((p, w) => {
2490
2530
  l[w] || (p.remove(), this._outlierRects.delete(w));
2491
2531
  }), s.outlier.rows().forEach((p) => {
2492
- const w = p.names.indexOf(h ?? "group"), P = w >= 0 ? String(p[w]) : p.rowName ?? null;
2493
- if (!P) return;
2494
- const q = l[P] ?? "#888888", X = be(p, n[0], n[1]);
2532
+ const w = p.names.indexOf(h ?? "group"), R = w >= 0 ? String(p[w]) : p.rowName ?? null;
2533
+ if (!R) return;
2534
+ const q = l[R] ?? "#888888", X = be(p, n[0], n[1]);
2495
2535
  if (!X) return;
2496
- const W = X.x_low * v, mt = -X.y_high * v, Z = (X.x_high - X.x_low) * v, at = (X.y_high - X.y_low) * v;
2497
- let L = this._outlierRects.get(P);
2498
- L || (L = document.createElementNS("http://www.w3.org/2000/svg", "rect"), L.setAttribute("data-outlier-group", P), this._outlierRects.set(P, L)), L.setAttribute("x", W.toString()), L.setAttribute("y", mt.toString()), L.setAttribute("width", Z.toString()), L.setAttribute("height", at.toString()), L.setAttribute("fill", "none"), L.setAttribute("stroke", q), L.setAttribute("stroke-width", A.toString()), L.setAttribute("stroke-opacity", "0.5"), L.setAttribute("stroke-dasharray", `${A * 2} ${A * 2}`), y && !L.parentElement && y.insertBefore(L, y.firstChild);
2536
+ const W = X.x_low * E, mt = -X.y_high * E, Z = (X.x_high - X.x_low) * E, at = (X.y_high - X.y_low) * E;
2537
+ let L = this._outlierRects.get(R);
2538
+ L || (L = document.createElementNS("http://www.w3.org/2000/svg", "rect"), L.setAttribute("data-outlier-group", R), this._outlierRects.set(R, L)), L.setAttribute("x", W.toString()), L.setAttribute("y", mt.toString()), L.setAttribute("width", Z.toString()), L.setAttribute("height", at.toString()), L.setAttribute("fill", "none"), L.setAttribute("stroke", q), L.setAttribute("stroke-width", S.toString()), L.setAttribute("stroke-opacity", "0.5"), L.setAttribute("stroke-dasharray", `${S * 2} ${S * 2}`), y && !L.parentElement && y.insertBefore(L, y.firstChild);
2499
2539
  }));
2500
2540
  }
2501
2541
  it && (this._pointLabels.forEach((y, b) => {
@@ -2503,40 +2543,40 @@ const gt = class gt extends ve {
2503
2543
  }), this._meanLabels.forEach((y, b) => {
2504
2544
  C.__data__.objects.get(`mean-${b}`) || (y.remove(), this._meanLabels.delete(b));
2505
2545
  }), ot !== 0 && s.points.rows().forEach((y) => {
2506
- const b = y.names.indexOf(r), A = b >= 0 ? String(y[b]) : null;
2507
- if (!A) return;
2508
- const O = C.__data__.objects.get(A);
2509
- if (!O) return;
2510
- const p = A;
2511
- let w = this._pointLabels.get(A);
2512
- w ? ot === H.DISPLAY_TYPES.ON ? w.show() : w.hide() : (w = new Jt(p, O, it, this, ot), this._pointLabels.set(A, w));
2513
- }), nt !== 0 && (I ? $.map((b) => b.rowName ?? String(b[0])) : Object.keys(K)).forEach((b) => {
2514
- const A = `mean-${b}`, O = C.__data__.objects.get(A);
2515
- if (!O) return;
2546
+ const b = y.names.indexOf(r), S = b >= 0 ? String(y[b]) : null;
2547
+ if (!S) return;
2548
+ const $ = C.__data__.objects.get(S);
2549
+ if (!$) return;
2550
+ const p = S;
2551
+ let w = this._pointLabels.get(S);
2552
+ w ? ot === U.DISPLAY_TYPES.ON ? w.show() : w.hide() : (w = new Jt(p, $, it, this, ot), this._pointLabels.set(S, w));
2553
+ }), nt !== 0 && (I ? P.map((b) => b.rowName ?? String(b[0])) : Object.keys(K)).forEach((b) => {
2554
+ const S = `mean-${b}`, $ = C.__data__.objects.get(S);
2555
+ if (!$) return;
2516
2556
  let p = this._meanLabels.get(b);
2517
- p ? nt === H.DISPLAY_TYPES.ON ? p.show() : p.hide() : (p = new Jt(b, O, it, this, nt), this._meanLabels.set(b, p));
2557
+ p ? nt === U.DISPLAY_TYPES.ON ? p.show() : p.hide() : (p = new Jt(b, $, it, this, nt), this._meanLabels.set(b, p));
2518
2558
  })), C.__data__.__state__.setVariable("layer_updated", C.__data__);
2519
2559
  }
2520
2560
  }
2521
- const Dt = this.__children__.search("__children__", "trajectories");
2522
- if (o.showTrajectories && Dt) {
2523
- Dt.__data__.objects.clear(), this.__data__.trajectories.clear();
2561
+ const Tt = this.__children__.search("__children__", "trajectories");
2562
+ if (o.showTrajectories && Tt) {
2563
+ Tt.__data__.objects.clear(), this.__data__.trajectories.clear();
2524
2564
  const C = (Rs = s.trajectories) != null && Rs.rows ? s.trajectories : s.points;
2525
2565
  if (C != null && C.rows) {
2526
- const I = {}, $ = o.trajectoryUnits ? o.trajectoryUnits.split(",").map((b) => b.trim()) : null;
2566
+ const I = {}, P = o.trajectoryUnits ? o.trajectoryUnits.split(",").map((b) => b.trim()) : null;
2527
2567
  C.rows().forEach((b) => {
2528
- const A = b.names.indexOf(r) >= 0 ? b.names.indexOf(r) : b.names.indexOf("unit") >= 0 ? b.names.indexOf("unit") : b.names.indexOf("ENA_UNIT") >= 0 ? b.names.indexOf("ENA_UNIT") : -1, O = A >= 0 ? String(b[A]) : b.rowName || "unit-1";
2529
- if ($ && !$.includes(O)) return;
2530
- const p = b.names.indexOf(n[0]), w = n.length > 1 ? b.names.indexOf(n[1]) : -1, P = b.names.indexOf("time") >= 0 ? b.names.indexOf("time") : b.names.indexOf("ActivityNumber") >= 0 ? b.names.indexOf("ActivityNumber") : b.names.indexOf("RowID") >= 0 ? b.names.indexOf("RowID") : -1, q = P >= 0 ? Number(b[P]) : I[O] ? I[O].length + 1 : 1;
2531
- p >= 0 && w >= 0 && (I[O] || (I[O] = []), I[O].push({
2532
- x: Number(b[p]) * v,
2533
- y: -Number(b[w]) * v,
2568
+ const S = b.names.indexOf(r) >= 0 ? b.names.indexOf(r) : b.names.indexOf("unit") >= 0 ? b.names.indexOf("unit") : b.names.indexOf("ENA_UNIT") >= 0 ? b.names.indexOf("ENA_UNIT") : -1, $ = S >= 0 ? String(b[S]) : b.rowName || "unit-1";
2569
+ if (P && !P.includes($)) return;
2570
+ const p = b.names.indexOf(n[0]), w = n.length > 1 ? b.names.indexOf(n[1]) : -1, R = b.names.indexOf("time") >= 0 ? b.names.indexOf("time") : b.names.indexOf("ActivityNumber") >= 0 ? b.names.indexOf("ActivityNumber") : b.names.indexOf("RowID") >= 0 ? b.names.indexOf("RowID") : -1, q = R >= 0 ? Number(b[R]) : I[$] ? I[$].length + 1 : 1;
2571
+ p >= 0 && w >= 0 && (I[$] || (I[$] = []), I[$].push({
2572
+ x: Number(b[p]) * E,
2573
+ y: -Number(b[w]) * E,
2534
2574
  time: q
2535
2575
  }));
2536
- }), Object.keys(I).forEach((b, A) => {
2537
- const O = I[b];
2538
- if (O.length === 0) return;
2539
- const p = _[A % _.length], w = new Ee({
2576
+ }), Object.keys(I).forEach((b, S) => {
2577
+ const $ = I[b];
2578
+ if ($.length === 0) return;
2579
+ const p = u[S % u.length], w = new Ee({
2540
2580
  ID: `traj-${b}`,
2541
2581
  unitId: b,
2542
2582
  color: new st(p),
@@ -2550,72 +2590,72 @@ const gt = class gt extends ve {
2550
2590
  currentTime: o.trajectoryPlayhead ?? 1 / 0,
2551
2591
  showPoints: o.trajectoryShowPoints,
2552
2592
  showTips: o.trajectoryShowTips,
2553
- points: O.map((P) => ({ x: P.x, y: P.y, time: P.time }))
2593
+ points: $.map((R) => ({ x: R.x, y: R.y, time: R.time }))
2554
2594
  });
2555
- this.__data__.trajectories.set(b, w), Dt.__data__.objects.set(w.ID, w);
2595
+ this.__data__.trajectories.set(b, w), Tt.__data__.objects.set(w.ID, w);
2556
2596
  });
2557
2597
  }
2558
- Dt.__data__.__state__.setVariable("layer_updated", Dt.__data__);
2598
+ Tt.__data__.__state__.setVariable("layer_updated", Tt.__data__);
2559
2599
  }
2560
- const ut = this.__children__.search("__children__", "network"), Kt = ut == null ? void 0 : ut.__children__.search("__children__", "edges"), ft = ut == null ? void 0 : ut.__children__.search("__children__", "nodes"), fe = ut == null ? void 0 : ut.__children__.search("__children__", "edgenodes"), si = o.showEdges;
2600
+ const _t = this.__children__.search("__children__", "network"), Kt = _t == null ? void 0 : _t.__children__.search("__children__", "edges"), ft = _t == null ? void 0 : _t.__children__.search("__children__", "nodes"), fe = _t == null ? void 0 : _t.__children__.search("__children__", "edgenodes"), si = o.showEdges;
2561
2601
  if ((Ls = s.nodes) != null && Ls.rows && ft) {
2562
2602
  if (s.nodes.rows().forEach((I) => {
2563
- const $ = _t(I, a, "#444444");
2564
- $.size = 2;
2603
+ const P = ut(I, a, "#444444");
2604
+ P.size = 2;
2565
2605
  const y = I.names.indexOf("label"), b = y >= 0 ? I[y] : null;
2566
- $.meta = {
2567
- ...$.meta ?? {},
2606
+ P.meta = {
2607
+ ...P.meta ?? {},
2568
2608
  kind: "node",
2569
- name: b != null && String(b) !== "NA" && String(b) !== "" ? String(b) : $.ID
2570
- }, ft.__data__.objects.set($.ID, $);
2571
- }), si && Kt && ((Ds = s.edges) != null && Ds.rows)) {
2609
+ name: b != null && String(b) !== "NA" && String(b) !== "" ? String(b) : P.ID
2610
+ }, ft.__data__.objects.set(P.ID, P);
2611
+ }), si && Kt && ((Ts = s.edges) != null && Ts.rows)) {
2572
2612
  const I = {};
2573
- h && ((Ts = s.points) != null && Ts.rows) && s.points.rows().forEach((f) => {
2613
+ h && ((Ds = s.points) != null && Ds.rows) && s.points.rows().forEach((f) => {
2574
2614
  const x = f.names.indexOf(r), N = f.names.indexOf(h);
2575
2615
  x >= 0 && N >= 0 && (I[String(f[x])] = String(f[N]));
2576
2616
  });
2577
- const $ = s.nodes.rows().map((f) => {
2617
+ const P = s.nodes.rows().map((f) => {
2578
2618
  const x = f.names.indexOf(a);
2579
2619
  return x >= 0 ? String(f[x]) : "";
2580
2620
  }).filter(Boolean), y = [];
2581
2621
  (s.edges.names ?? []).forEach((f) => {
2582
- const x = Mi(f, $);
2622
+ const x = Mi(f, P);
2583
2623
  x && y.push({ col: f, pair: x });
2584
2624
  });
2585
- const b = /* @__PURE__ */ u((f) => {
2625
+ const b = /* @__PURE__ */ _((f) => {
2586
2626
  const x = {};
2587
2627
  return s.edges.rows().forEach((N) => {
2588
2628
  const z = N.names.indexOf(r);
2589
- z < 0 || String(N[z]) !== f || y.forEach(({ col: D }) => {
2590
- const M = N.names.indexOf(D);
2591
- M >= 0 && (x[D] = Number(N[M]) || 0);
2629
+ z < 0 || String(N[z]) !== f || y.forEach(({ col: T }) => {
2630
+ const M = N.names.indexOf(T);
2631
+ M >= 0 && (x[T] = Number(N[M]) || 0);
2592
2632
  });
2593
2633
  }), x;
2594
- }, "getUnitEdges"), A = /* @__PURE__ */ u((f) => {
2634
+ }, "getUnitEdges"), S = /* @__PURE__ */ _((f) => {
2595
2635
  const x = {};
2596
2636
  let N = 0;
2597
- if (s.edges.rows().forEach((D) => {
2598
- const M = D.names.indexOf(r), tt = M >= 0 ? String(D[M]) : null, G = h ? D.names.indexOf(h) : -1;
2599
- (G >= 0 ? String(D[G]) : tt ? I[tt] : null) === f && (N++, y.forEach(({ col: T }) => {
2600
- const pt = D.names.indexOf(T);
2637
+ if (s.edges.rows().forEach((T) => {
2638
+ const M = T.names.indexOf(r), tt = M >= 0 ? String(T[M]) : null, G = h ? T.names.indexOf(h) : -1;
2639
+ (G >= 0 ? String(T[G]) : tt ? I[tt] : null) === f && (N++, y.forEach(({ col: D }) => {
2640
+ const pt = T.names.indexOf(D);
2601
2641
  if (pt >= 0) {
2602
- const V = Number(D[pt]);
2603
- isNaN(V) || (x[T] = (x[T] ?? 0) + V);
2642
+ const V = Number(T[pt]);
2643
+ isNaN(V) || (x[D] = (x[D] ?? 0) + V);
2604
2644
  }
2605
2645
  }));
2606
2646
  }), N === 0) return {};
2607
2647
  const z = {};
2608
- return y.forEach(({ col: D }) => {
2609
- z[D] = (x[D] ?? 0) / N;
2648
+ return y.forEach(({ col: T }) => {
2649
+ z[T] = (x[T] ?? 0) / N;
2610
2650
  }), z;
2611
- }, "getGroupEdges"), O = /* @__PURE__ */ u((f) => {
2651
+ }, "getGroupEdges"), $ = /* @__PURE__ */ _((f) => {
2612
2652
  if (l[f])
2613
- return { weights: A(f), color: l[f], label: f };
2653
+ return { weights: S(f), color: l[f], label: f };
2614
2654
  const x = I[f] ?? null, N = x ? l[x] ?? "#888888" : "#888888";
2615
2655
  return { weights: b(f), color: N, label: f };
2616
- }, "resolve"), p = [], w = /* @__PURE__ */ u((f) => {
2617
- var D;
2618
- const x = s.networks, N = (D = x == null ? void 0 : x.rows) == null ? void 0 : D.call(x).find((M) => M.rowName === f);
2656
+ }, "resolve"), p = [], w = /* @__PURE__ */ _((f) => {
2657
+ var T;
2658
+ const x = s.networks, N = (T = x == null ? void 0 : x.rows) == null ? void 0 : T.call(x).find((M) => M.rowName === f);
2619
2659
  if (!N) return null;
2620
2660
  const z = {};
2621
2661
  return y.forEach(({ col: M }) => {
@@ -2625,61 +2665,61 @@ const gt = class gt extends ve {
2625
2665
  Number.isFinite(G) && (z[M] = G);
2626
2666
  }
2627
2667
  }), z;
2628
- }, "networkRow"), P = /* @__PURE__ */ u((f, x) => {
2668
+ }, "networkRow"), R = /* @__PURE__ */ _((f, x) => {
2629
2669
  if (!x) return f;
2630
2670
  const N = Math.abs(f);
2631
2671
  return N < x[0] ? 0 : N > x[1] ? Math.sign(f) * x[1] : f;
2632
2672
  }, "thresholded");
2633
2673
  o.edgeLayers.forEach((f, x) => {
2634
- const N = /* @__PURE__ */ u((V, ht, Q, wt, lt) => {
2635
- Q = P(Q, f.threshold), !(Math.abs(Q) < 1e-6) && p.push({ col: `${x}:${V}`, pair: ht, weight: Math.abs(Q), color: wt, layer: x, ...lt });
2636
- }, "push"), z = /* @__PURE__ */ u((V, ht) => f.colors ? [f.colors[0], f.colors[1] ?? Ci(f.colors[0])] : [V, ht], "signColors");
2674
+ const N = /* @__PURE__ */ _((V, ht, Q, wt, lt) => {
2675
+ Q = R(Q, f.threshold), !(Math.abs(Q) < 1e-6) && p.push({ col: `${x}:${V}`, pair: ht, weight: Math.abs(Q), color: wt, layer: x, ...lt });
2676
+ }, "push"), z = /* @__PURE__ */ _((V, ht) => f.colors ? [f.colors[0], f.colors[1] ?? Ci(f.colors[0])] : [V, ht], "signColors");
2637
2677
  if (f.network) {
2638
2678
  const V = w(f.network);
2639
2679
  if (!V) return;
2640
- const [ht, Q] = z(_[0], _[1]), wt = { name: f.name ?? f.network };
2680
+ const [ht, Q] = z(u[0], u[1]), wt = { name: f.name ?? f.network };
2641
2681
  y.forEach(({ col: lt, pair: zs }) => {
2642
2682
  const me = V[lt] ?? 0;
2643
2683
  N(lt, zs, me, me >= 0 ? ht : Q, wt);
2644
2684
  });
2645
2685
  return;
2646
2686
  }
2647
- const D = f.unit ?? f.group ?? null;
2648
- if (!D) return;
2649
- const M = O(D), tt = f.compare ?? f.also ?? null, G = tt ? O(tt) : null, rt = { name: f.name ?? D, group: f.group ?? void 0, unit: f.unit ?? void 0 }, [T, pt] = z(M.color, (G == null ? void 0 : G.color) ?? M.color);
2687
+ const T = f.unit ?? f.group ?? null;
2688
+ if (!T) return;
2689
+ const M = $(T), tt = f.compare ?? f.also ?? null, G = tt ? $(tt) : null, rt = { name: f.name ?? T, group: f.group ?? void 0, unit: f.unit ?? void 0 }, [D, pt] = z(M.color, (G == null ? void 0 : G.color) ?? M.color);
2650
2690
  G && f.compare ? y.forEach(({ col: V, pair: ht }) => {
2651
2691
  const Q = (M.weights[V] ?? 0) - (G.weights[V] ?? 0);
2652
- N(V, ht, Q, Q > 0 ? T : pt, rt);
2692
+ N(V, ht, Q, Q > 0 ? D : pt, rt);
2653
2693
  }) : G && f.also ? y.forEach(({ col: V, pair: ht }) => {
2654
2694
  const Q = M.weights[V] ?? 0, wt = G.weights[V] ?? 0;
2655
- Q > 0 && N(V + "-a", ht, Q, T, rt), wt > 0 && N(V + "-b", ht, wt, pt, { ...rt, name: f.also ?? void 0, group: f.also ?? void 0 });
2695
+ Q > 0 && N(V + "-a", ht, Q, D, rt), wt > 0 && N(V + "-b", ht, wt, pt, { ...rt, name: f.also ?? void 0, group: f.also ?? void 0 });
2656
2696
  }) : y.forEach(({ col: V, pair: ht }) => {
2657
2697
  const Q = M.weights[V] ?? 0;
2658
- Q > 0 && N(V, ht, Q, T, rt);
2698
+ Q > 0 && N(V, ht, Q, D, rt);
2659
2699
  });
2660
2700
  }), p.sort((f, x) => x.weight - f.weight);
2661
- const q = !!s.directed, X = wi(o.edgeWidth) * (o.edgeMagnify ?? 1), W = /* @__PURE__ */ u((f) => {
2701
+ const q = !!s.directed, X = wi(o.edgeWidth) * (o.edgeMagnify ?? 1), W = /* @__PURE__ */ _((f) => {
2662
2702
  const x = f.map(Math.abs).filter((N) => N > 0);
2663
2703
  return x.length ? [Math.min(...x), Math.max(...x)] : [0, 0];
2664
- }, "rangeOf"), mt = /* @__PURE__ */ u((f) => {
2704
+ }, "rangeOf"), mt = /* @__PURE__ */ _((f) => {
2665
2705
  const x = [];
2666
2706
  return y.forEach(({ col: N, pair: z }) => {
2667
2707
  if (z[0] === z[1] !== f) return;
2668
- const D = s.edges.col(N);
2669
- if (D) for (const M of D) x.push(Number(M));
2708
+ const T = s.edges.col(N);
2709
+ if (T) for (const M of T) x.push(Number(M));
2670
2710
  }), W(x);
2671
- }, "modelRange"), Z = /* @__PURE__ */ u((f) => W(p.filter((x) => x.pair[0] === x.pair[1] === f).map((x) => x.weight)), "plotRange"), at = o.edgeColorScale, L = /* @__PURE__ */ u((f) => at === "plot" ? Z(f) : mt(f), "colourRange"), Tt = L(!1), xt = L(!0), At = /* @__PURE__ */ u((f, x) => {
2711
+ }, "modelRange"), Z = /* @__PURE__ */ _((f) => W(p.filter((x) => x.pair[0] === x.pair[1] === f).map((x) => x.weight)), "plotRange"), at = o.edgeColorScale, L = /* @__PURE__ */ _((f) => at === "plot" ? Z(f) : mt(f), "colourRange"), Dt = L(!1), xt = L(!0), At = /* @__PURE__ */ _((f, x) => {
2672
2712
  if (at === "absolute") {
2673
- const D = Math.min(1, Math.abs(f));
2674
- return { saturation: D, opacity: D };
2713
+ const T = Math.min(1, Math.abs(f));
2714
+ return { saturation: T, opacity: T };
2675
2715
  }
2676
- const [N, z] = x ? xt : Tt;
2716
+ const [N, z] = x ? xt : Dt;
2677
2717
  return { saturation: Xs(f, N, z, gi), opacity: Xs(f, N, z, fi) };
2678
2718
  }, "colourOf"), vt = {};
2679
2719
  p.forEach(({ pair: f, weight: x }) => {
2680
2720
  if (f[0] === f[1] && !q) return;
2681
- const z = /* @__PURE__ */ u((D) => {
2682
- vt[D] = (vt[D] ?? 0) + Math.abs(x);
2721
+ const z = /* @__PURE__ */ _((T) => {
2722
+ vt[T] = (vt[T] ?? 0) + Math.abs(x);
2683
2723
  }, "add");
2684
2724
  if (q) {
2685
2725
  z(f[1]);
@@ -2691,27 +2731,27 @@ const gt = class gt extends ve {
2691
2731
  if (!N) return;
2692
2732
  const z = ft.__data__.objects.get(N);
2693
2733
  if (!z) return;
2694
- const D = vt[N] ?? 0, M = !(D > 0);
2695
- z.size = M ? o.hideUnconnectedNodes ? 0 : xi : Ai(D, X), z.meta = {
2734
+ const T = vt[N] ?? 0, M = !(T > 0);
2735
+ z.size = M ? o.hideUnconnectedNodes ? 0 : xi : Ai(T, X), z.meta = {
2696
2736
  ...z.meta ?? {},
2697
2737
  hidden: M && o.hideUnconnectedNodes
2698
2738
  };
2699
2739
  });
2700
- const $t = {}, U = /* @__PURE__ */ u((f, x, N, z) => `${f}:${x ?? ""}:${N}.${z}`, "pairKey");
2740
+ const $t = {}, B = /* @__PURE__ */ _((f, x, N, z) => `${f}:${x ?? ""}:${N}.${z}`, "pairKey");
2701
2741
  q && p.forEach(({ pair: f, weight: x, layer: N, name: z }) => {
2702
- const D = U(N, z, f[0], f[1]);
2703
- $t[D] = ($t[D] ?? 0) + x;
2704
- }), p.forEach(({ col: f, pair: x, weight: N, color: z, layer: D, name: M, group: tt, unit: G }) => {
2705
- const rt = ft.__data__.objects.get(x[0]), T = ft.__data__.objects.get(x[1]);
2706
- if (!rt || !T) return;
2742
+ const T = B(N, z, f[0], f[1]);
2743
+ $t[T] = ($t[T] ?? 0) + x;
2744
+ }), p.forEach(({ col: f, pair: x, weight: N, color: z, layer: T, name: M, group: tt, unit: G }) => {
2745
+ const rt = ft.__data__.objects.get(x[0]), D = ft.__data__.objects.get(x[1]);
2746
+ if (!rt || !D) return;
2707
2747
  const pt = x[0] === x[1];
2708
2748
  if (pt && !q) return;
2709
- const { saturation: V, opacity: ht } = At(N, pt), Q = new J({ ID: `${x[0]}-src`, dimensions: [rt.x, rt.y], meta: {} }), wt = new J({ ID: `${x[1]}-dst`, dimensions: [T.x, T.y], meta: {} });
2749
+ const { saturation: V, opacity: ht } = At(N, pt), Q = new J({ ID: `${x[0]}-src`, dimensions: [rt.x, rt.y], meta: {} }), wt = new J({ ID: `${x[1]}-dst`, dimensions: [D.x, D.y], meta: {} });
2710
2750
  let lt;
2711
2751
  if (pt)
2712
2752
  lt = new ne({}, Q, wt), lt.weight = 0;
2713
2753
  else if (q) {
2714
- const me = $t[U(D, M, x[0], x[1])] ?? N, ii = $t[U(D, M, x[1], x[0])] ?? 0, ni = me + ii;
2754
+ const me = $t[B(T, M, x[0], x[1])] ?? N, ii = $t[B(T, M, x[1], x[0])] ?? 0, ni = me + ii;
2715
2755
  lt = new Qe(
2716
2756
  { weight: N, totalweight: ni },
2717
2757
  Q,
@@ -2738,11 +2778,11 @@ const gt = class gt extends ve {
2738
2778
  }), Kt.__data__.__state__.setVariable("layer_updated", Kt.__data__), fe && fe.__data__.__state__.setVariable("layer_updated", fe.__data__);
2739
2779
  }
2740
2780
  const C = o.showNodes;
2741
- ft.svg_element && (ft.svg_element.style.display = C ? "" : "none"), C || (this._nodeLabels.forEach((I) => I.remove()), this._nodeLabels.clear()), it && F !== 0 && C && (this._nodeLabels.forEach((I, $) => {
2742
- ft.__data__.objects.get($) || (I.remove(), this._nodeLabels.delete($));
2781
+ ft.svg_element && (ft.svg_element.style.display = C ? "" : "none"), C || (this._nodeLabels.forEach((I) => I.remove()), this._nodeLabels.clear()), it && j !== 0 && C && (this._nodeLabels.forEach((I, P) => {
2782
+ ft.__data__.objects.get(P) || (I.remove(), this._nodeLabels.delete(P));
2743
2783
  }), s.nodes.rows().forEach((I) => {
2744
- var p, w, P;
2745
- const $ = I.names.indexOf(a), y = $ >= 0 ? String(I[$]) : "";
2784
+ var p, w, R;
2785
+ const P = I.names.indexOf(a), y = P >= 0 ? String(I[P]) : "";
2746
2786
  if (!y) return;
2747
2787
  const b = ft.__data__.objects.get(y);
2748
2788
  if (!b) return;
@@ -2750,9 +2790,9 @@ const gt = class gt extends ve {
2750
2790
  (w = this._nodeLabels.get(y)) == null || w.remove(), this._nodeLabels.delete(y);
2751
2791
  return;
2752
2792
  }
2753
- const A = String(((P = b.meta) == null ? void 0 : P.name) ?? y);
2754
- let O = this._nodeLabels.get(y);
2755
- O && O.text !== A && (O.remove(), this._nodeLabels.delete(y), O = void 0), O ? F === H.DISPLAY_TYPES.ON ? O.show() : O.hide() : (O = new Jt(A, b, it, this, F), this._nodeLabels.set(y, O));
2793
+ const S = String(((R = b.meta) == null ? void 0 : R.name) ?? y);
2794
+ let $ = this._nodeLabels.get(y);
2795
+ $ && $.text !== S && ($.remove(), this._nodeLabels.delete(y), $ = void 0), $ ? j === U.DISPLAY_TYPES.ON ? $.show() : $.hide() : ($ = new Jt(S, b, it, this, j), this._nodeLabels.set(y, $));
2756
2796
  })), ft.__data__.__state__.setVariable("layer_updated", ft.__data__);
2757
2797
  }
2758
2798
  const ws = this.__children__.search("__children__", "axis_points"), As = this.__children__.search("__children__", "axis_lines");
@@ -2802,23 +2842,23 @@ const gt = class gt extends ve {
2802
2842
  // all rendering decisions are derived from a single snapshot.
2803
2843
  _readLayerConfig() {
2804
2844
  var g;
2805
- const t = this.querySelector("qe-nodes"), e = this.querySelector("qe-means"), s = [...this.querySelectorAll("qe-points")], i = s.find((c) => !c.hasAttribute("set")) ?? null, n = s.filter((c) => c.hasAttribute("set")), r = [...this.querySelectorAll("qe-edges")], a = /* @__PURE__ */ u((c) => {
2806
- var E;
2807
- return ((E = r.find((m) => m.hasAttribute(c))) == null ? void 0 : E.getAttribute(c)) ?? null;
2808
- }, "firstAttr"), h = r.find((c) => c.hasAttribute("magnify")), o = this.querySelector("qe-trajectories"), l = this.querySelector("qe-axes"), _ = this.getAttribute("labels");
2845
+ const t = this.querySelector("qe-nodes"), e = this.querySelector("qe-means"), s = [...this.querySelectorAll("qe-points")], i = s.find((c) => !c.hasAttribute("set")) ?? null, n = s.filter((c) => c.hasAttribute("set")), r = [...this.querySelectorAll("qe-edges")], a = /* @__PURE__ */ _((c) => {
2846
+ var v;
2847
+ return ((v = r.find((m) => m.hasAttribute(c))) == null ? void 0 : v.getAttribute(c)) ?? null;
2848
+ }, "firstAttr"), h = r.find((c) => c.hasAttribute("magnify")), o = this.querySelector("qe-trajectories"), l = this.querySelector("qe-axes"), u = this.getAttribute("labels");
2809
2849
  return {
2810
2850
  // Nodes — always placed from the model (they anchor the coordinate
2811
2851
  // space); <qe-nodes> presence draws them, like every other layer.
2812
2852
  labelNodes: He(
2813
- (t == null ? void 0 : t.getAttribute("label")) ?? this.getAttribute("label-nodes") ?? _,
2814
- H.DISPLAY_TYPES.ON
2853
+ (t == null ? void 0 : t.getAttribute("label")) ?? this.getAttribute("label-nodes") ?? u,
2854
+ U.DISPLAY_TYPES.ON
2815
2855
  ),
2816
2856
  showNodes: !!t,
2817
2857
  range: (() => {
2818
2858
  const c = this.getAttribute("range");
2819
2859
  if (c === "network" || c === "points") return c;
2820
- const E = Number(c);
2821
- return c != null && Number.isFinite(E) && E > 0 ? E : null;
2860
+ const v = Number(c);
2861
+ return c != null && Number.isFinite(v) && v > 0 ? v : null;
2822
2862
  })(),
2823
2863
  plotTitle: this.getAttribute("plot-title") || null,
2824
2864
  labelFont: {
@@ -2851,8 +2891,8 @@ const gt = class gt extends ve {
2851
2891
  })(),
2852
2892
  showOutlier: !!e && e.hasAttribute("outlier"),
2853
2893
  labelMeans: He(
2854
- (e == null ? void 0 : e.getAttribute("label")) ?? this.getAttribute("label-means") ?? _,
2855
- H.DISPLAY_TYPES.ON
2894
+ (e == null ? void 0 : e.getAttribute("label")) ?? this.getAttribute("label-means") ?? u,
2895
+ U.DISPLAY_TYPES.ON
2856
2896
  ),
2857
2897
  // fixed-size keeps mean markers a constant on-screen px size (webENA parity).
2858
2898
  meanFixedSize: !!e && e.hasAttribute("fixed-size"),
@@ -2864,8 +2904,8 @@ const gt = class gt extends ve {
2864
2904
  fixedSize: c.hasAttribute("fixed-size")
2865
2905
  })),
2866
2906
  labelPoints: He(
2867
- (i == null ? void 0 : i.getAttribute("label")) ?? this.getAttribute("label-points") ?? _,
2868
- H.DISPLAY_TYPES.OFF
2907
+ (i == null ? void 0 : i.getAttribute("label")) ?? this.getAttribute("label-points") ?? u,
2908
+ U.DISPLAY_TYPES.OFF
2869
2909
  ),
2870
2910
  pointSize: i != null && i.getAttribute("size") ? parseFloat(i.getAttribute("size")) : null,
2871
2911
  // fixed-size keeps unit dots a constant on-screen px size (webENA parity).
@@ -3003,7 +3043,7 @@ const gt = class gt extends ve {
3003
3043
  }
3004
3044
  /** Resolved edges of the current network with weights and direction. */
3005
3045
  getEdges() {
3006
- const t = /* @__PURE__ */ u((e) => {
3046
+ const t = /* @__PURE__ */ _((e) => {
3007
3047
  const s = this.__children__.search("__children__", e);
3008
3048
  return s ? [...s.__data__.objects.values()] : [];
3009
3049
  }, "collect");
@@ -3026,7 +3066,7 @@ const gt = class gt extends ve {
3026
3066
  )];
3027
3067
  }
3028
3068
  _readCoords(t) {
3029
- const e = t.tagName.toLowerCase(), s = /* @__PURE__ */ u((i) => parseFloat(t.getAttribute(i) || "0"), "n");
3069
+ const e = t.tagName.toLowerCase(), s = /* @__PURE__ */ _((i) => parseFloat(t.getAttribute(i) || "0"), "n");
3030
3070
  if (e === "circle") return { t: "c", cx: s("cx"), cy: s("cy") };
3031
3071
  if (e === "rect") return { t: "r", x: s("x"), y: s("y") };
3032
3072
  if (e === "line") return { t: "l", x1: s("x1"), y1: s("y1"), x2: s("x2"), y2: s("y2") };
@@ -3054,23 +3094,23 @@ const gt = class gt extends ve {
3054
3094
  o && e.set(h, o);
3055
3095
  }
3056
3096
  }), !e.size) return;
3057
- const s = this._animateMs, i = performance.now(), n = /* @__PURE__ */ u((h) => h < 0.5 ? 2 * h * h : 1 - Math.pow(-2 * h + 2, 2) / 2, "ease"), r = /* @__PURE__ */ u((h, o, l) => h + (o - h) * l, "lerp"), a = /* @__PURE__ */ u((h) => {
3097
+ const s = this._animateMs, i = performance.now(), n = /* @__PURE__ */ _((h) => h < 0.5 ? 2 * h * h : 1 - Math.pow(-2 * h + 2, 2) / 2, "ease"), r = /* @__PURE__ */ _((h, o, l) => h + (o - h) * l, "lerp"), a = /* @__PURE__ */ _((h) => {
3058
3098
  const o = Math.min(1, (h - i) / s), l = n(o);
3059
- e.forEach((_, g) => {
3099
+ e.forEach((u, g) => {
3060
3100
  const c = t.get(g);
3061
- if (!(!c || c.t !== _.t))
3062
- if (_.t === "c")
3063
- g.setAttribute("cx", String(r(c.cx, _.cx, l))), g.setAttribute("cy", String(r(c.cy, _.cy, l)));
3064
- else if (_.t === "r")
3065
- g.setAttribute("x", String(r(c.x, _.x, l))), g.setAttribute("y", String(r(c.y, _.y, l)));
3066
- else if (_.t === "l")
3067
- g.setAttribute("x1", String(r(c.x1, _.x1, l))), g.setAttribute("y1", String(r(c.y1, _.y1, l))), g.setAttribute("x2", String(r(c.x2, _.x2, l))), g.setAttribute("y2", String(r(c.y2, _.y2, l)));
3101
+ if (!(!c || c.t !== u.t))
3102
+ if (u.t === "c")
3103
+ g.setAttribute("cx", String(r(c.cx, u.cx, l))), g.setAttribute("cy", String(r(c.cy, u.cy, l)));
3104
+ else if (u.t === "r")
3105
+ g.setAttribute("x", String(r(c.x, u.x, l))), g.setAttribute("y", String(r(c.y, u.y, l)));
3106
+ else if (u.t === "l")
3107
+ g.setAttribute("x1", String(r(c.x1, u.x1, l))), g.setAttribute("y1", String(r(c.y1, u.y1, l))), g.setAttribute("x2", String(r(c.x2, u.x2, l))), g.setAttribute("y2", String(r(c.y2, u.y2, l)));
3068
3108
  else {
3069
- if (!c.nums || c.nums.length !== _.nums.length) return;
3070
- let E = 0;
3071
- const m = _.d.replace(
3109
+ if (!c.nums || c.nums.length !== u.nums.length) return;
3110
+ let v = 0;
3111
+ const m = u.d.replace(
3072
3112
  gt._PATH_NUM_RE,
3073
- () => String(r(c.nums[E], _.nums[E++], l))
3113
+ () => String(r(c.nums[v], u.nums[v++], l))
3074
3114
  );
3075
3115
  g.setAttribute("d", m);
3076
3116
  }
@@ -3093,19 +3133,19 @@ const gt = class gt extends ve {
3093
3133
  const h = new Blob([e], { type: "image/svg+xml;charset=utf-8" }), o = URL.createObjectURL(h), l = new Image();
3094
3134
  l.onload = () => {
3095
3135
  try {
3096
- const _ = document.createElement("canvas");
3097
- _.width = i * t, _.height = n * t;
3098
- const g = _.getContext("2d");
3136
+ const u = document.createElement("canvas");
3137
+ u.width = i * t, u.height = n * t;
3138
+ const g = u.getContext("2d");
3099
3139
  if (!g) {
3100
3140
  URL.revokeObjectURL(o), a(new Error("no 2d context"));
3101
3141
  return;
3102
3142
  }
3103
- g.scale(t, t), g.drawImage(l, 0, 0, i, n), URL.revokeObjectURL(o), r(_.toDataURL("image/png"));
3104
- } catch (_) {
3105
- URL.revokeObjectURL(o), a(_);
3143
+ g.scale(t, t), g.drawImage(l, 0, 0, i, n), URL.revokeObjectURL(o), r(u.toDataURL("image/png"));
3144
+ } catch (u) {
3145
+ URL.revokeObjectURL(o), a(u);
3106
3146
  }
3107
- }, l.onerror = (_) => {
3108
- URL.revokeObjectURL(o), a(_);
3147
+ }, l.onerror = (u) => {
3148
+ URL.revokeObjectURL(o), a(u);
3109
3149
  }, l.src = o;
3110
3150
  });
3111
3151
  }
@@ -3147,7 +3187,7 @@ const gt = class gt extends ve {
3147
3187
  this._highlightGroup || (this._highlightGroup = document.createElementNS("http://www.w3.org/2000/svg", "g"), this._highlightGroup.setAttribute("data-layer-name", "highlight"), this._highlightGroup.setAttribute("pointer-events", "none")), this.svg_element.appendChild(this._highlightGroup);
3148
3188
  const t = this._highlightGroup;
3149
3189
  t.textContent = "";
3150
- const e = this.__data__.extremes.x_max || 1, s = "#f5a623", i = /* @__PURE__ */ u((n, r) => {
3190
+ const e = this.__data__.extremes.x_max || 1, s = "#f5a623", i = /* @__PURE__ */ _((n, r) => {
3151
3191
  const a = document.createElementNS("http://www.w3.org/2000/svg", n);
3152
3192
  for (const h in r) a.setAttribute(h, String(r[h]));
3153
3193
  return a;
@@ -3171,8 +3211,8 @@ const gt = class gt extends ve {
3171
3211
  });
3172
3212
  }
3173
3213
  this._highlight.nodes.forEach((n) => {
3174
- var _;
3175
- const r = this.svg_element.querySelector(`[data-point-id="${(_ = window.CSS) != null && _.escape ? CSS.escape(n) : n}"]`);
3214
+ var u;
3215
+ const r = this.svg_element.querySelector(`[data-point-id="${(u = window.CSS) != null && u.escape ? CSS.escape(n) : n}"]`);
3176
3216
  if (!r) return;
3177
3217
  const a = r.tagName.toLowerCase();
3178
3218
  let h, o, l;
@@ -3194,7 +3234,7 @@ const gt = class gt extends ve {
3194
3234
  create() {
3195
3235
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3196
3236
  t.classList.add("graph"), t.style.display = "block", t.style.width = "100%", t.style.height = "100%", t.setAttribute("preserveAspectRatio", "xMidYMid meet"), t.setAttribute("viewBox", this.__data__.extremes.as_viewBox()), t.setAttribute("transform", this.__data__.transform.toString()), t.setAttribute("role", "figure"), t.setAttribute("data-graph-size", `${Math.min(this.__data__.extremes.width, this.__data__.extremes.height)}`), this.svg_element = t;
3197
- const e = document.createElementNS("http://www.w3.org/2000/svg", "defs"), s = 0.22, i = 0.15, n = /* @__PURE__ */ u((r, a) => {
3237
+ const e = document.createElementNS("http://www.w3.org/2000/svg", "defs"), s = 0.22, i = 0.15, n = /* @__PURE__ */ _((r, a) => {
3198
3238
  const h = document.createElementNS("http://www.w3.org/2000/svg", "marker");
3199
3239
  h.setAttribute("id", r), h.setAttribute("markerWidth", String(s)), h.setAttribute("markerHeight", String(i)), h.setAttribute("refX", String(s)), h.setAttribute("refY", String(i / 2)), h.setAttribute("orient", "auto"), h.setAttribute("markerUnits", "userSpaceOnUse");
3200
3240
  const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
@@ -3214,43 +3254,43 @@ const gt = class gt extends ve {
3214
3254
  t = !0, e = o.clientX, s = o.clientY;
3215
3255
  });
3216
3256
  let i = null, n = null;
3217
- const r = /* @__PURE__ */ u(() => {
3257
+ const r = /* @__PURE__ */ _(() => {
3218
3258
  n && (this.__data__.transform.pan(n.dx, n.dy), this.__children__[0].svg_element.setAttribute("transform", this.__data__.transform.toString()), n = null), i = null;
3219
3259
  }, "panUpdate");
3220
3260
  this.svg_element.addEventListener("mousemove", (o) => {
3221
3261
  if (!t) return;
3222
- const l = o.clientX - e, _ = o.clientY - s;
3223
- n = { dx: l / 100, dy: _ / 100 }, e = o.clientX, s = o.clientY, i === null && (i = requestAnimationFrame(r));
3262
+ const l = o.clientX - e, u = o.clientY - s;
3263
+ n = { dx: l / 100, dy: u / 100 }, e = o.clientX, s = o.clientY, i === null && (i = requestAnimationFrame(r));
3224
3264
  }), this.svg_element.addEventListener("mouseup", (o) => {
3225
3265
  t = !1;
3226
3266
  }), this.svg_element.addEventListener("point-clicked", ((o) => {
3227
3267
  var g, c;
3228
3268
  const l = (c = (g = o.detail) == null ? void 0 : g.pointData) == null ? void 0 : c.ID;
3229
3269
  if (!l) return;
3230
- const _ = this._pointLabels.get(l) ?? this._meanLabels.get(l.replace("mean-", "")) ?? this._nodeLabels.get(l);
3231
- _ && _.displayMode === H.DISPLAY_TYPES.CLICK && _.toggle();
3270
+ const u = this._pointLabels.get(l) ?? this._meanLabels.get(l.replace("mean-", "")) ?? this._nodeLabels.get(l);
3271
+ u && u.displayMode === U.DISPLAY_TYPES.CLICK && u.toggle();
3232
3272
  }));
3233
- const a = /* @__PURE__ */ u((o) => {
3273
+ const a = /* @__PURE__ */ _((o) => {
3234
3274
  var l;
3235
3275
  for (; o && o !== this.svg_element; ) {
3236
- const _ = (l = o.getAttribute) == null ? void 0 : l.call(o, "data-point-id");
3237
- if (_) return _;
3276
+ const u = (l = o.getAttribute) == null ? void 0 : l.call(o, "data-point-id");
3277
+ if (u) return u;
3238
3278
  o = o.parentElement;
3239
3279
  }
3240
3280
  return null;
3241
- }, "findPointId"), h = /* @__PURE__ */ u((o) => this._pointLabels.get(o) ?? this._meanLabels.get(o.replace(/^mean-/, "")) ?? this._nodeLabels.get(o), "getAutoLabel");
3281
+ }, "findPointId"), h = /* @__PURE__ */ _((o) => this._pointLabels.get(o) ?? this._meanLabels.get(o.replace(/^mean-/, "")) ?? this._nodeLabels.get(o), "getAutoLabel");
3242
3282
  this.svg_element.addEventListener("mouseover", (o) => {
3243
3283
  const l = a(o.target);
3244
3284
  if (!l) return;
3245
- const _ = h(l);
3246
- (_ == null ? void 0 : _.displayMode) === H.DISPLAY_TYPES.AUTO && _.show();
3285
+ const u = h(l);
3286
+ (u == null ? void 0 : u.displayMode) === U.DISPLAY_TYPES.AUTO && u.show();
3247
3287
  }), this.svg_element.addEventListener("mouseout", (o) => {
3248
3288
  const l = a(o.target);
3249
3289
  if (!l) return;
3250
- const _ = o.relatedTarget;
3251
- if (a(_) === l) return;
3290
+ const u = o.relatedTarget;
3291
+ if (a(u) === l) return;
3252
3292
  const c = h(l);
3253
- (c == null ? void 0 : c.displayMode) === H.DISPLAY_TYPES.AUTO && c.hide();
3293
+ (c == null ? void 0 : c.displayMode) === U.DISPLAY_TYPES.AUTO && c.hide();
3254
3294
  }), this._attachInteractionEvents();
3255
3295
  }
3256
3296
  /** Emit a namespaced CustomEvent on the public element (bubbles + composed). */
@@ -3307,7 +3347,7 @@ const gt = class gt extends ve {
3307
3347
  a && this._emit("qe-node-click", { ...a, originalEvent: i });
3308
3348
  });
3309
3349
  let e = null;
3310
- const s = /* @__PURE__ */ u((i, n) => i === "edge" ? `${n.source}\0${n.target}` : String(n.id), "keyOf");
3350
+ const s = /* @__PURE__ */ _((i, n) => i === "edge" ? `${n.source}\0${n.target}` : String(n.id), "keyOf");
3311
3351
  t.addEventListener("mousemove", (i) => {
3312
3352
  const n = i.target, r = this._edgeDetail(n), a = r ? null : this._nodeDetail(n), h = r ? { type: "edge", detail: r } : a ? { type: "node", detail: a } : null, o = h ? s(h.type, h.detail) : null;
3313
3353
  e && (!h || e.key !== o) && (this._emit(e.type === "edge" ? "qe-edge-unhover" : "qe-node-unhover", { key: e.key }), e = null), h && (!e || e.key !== o) && (this._emit(h.type === "edge" ? "qe-edge-hover" : "qe-node-hover", { ...h.detail, originalEvent: i }), e = { type: h.type, key: o }), this.hasAttribute("tooltip") && h ? this._showTooltip(this._tooltipText(h.type, h.detail), i.clientX, i.clientY) : this._hideTooltip();
@@ -3375,20 +3415,20 @@ const gt = class gt extends ve {
3375
3415
  t != null && t.svg_element && (t.svg_element.style.display = this._showAxes ? "" : "none");
3376
3416
  const e = this._labelsGroup, s = this.__data__.extremes.x_max, { cx: i, cy: n } = this.__data__.extremes;
3377
3417
  if (!e || s <= 0) return;
3378
- const r = s * 0.06, a = r * 0.6, h = /* @__PURE__ */ u((_, g) => {
3379
- let c = this._axisLabelEls.get(_);
3418
+ const r = s * 0.06, a = r * 0.6, h = /* @__PURE__ */ _((u, g) => {
3419
+ let c = this._axisLabelEls.get(u);
3380
3420
  if (!this._showAxes || g == null) {
3381
- c && (c.remove(), this._axisLabelEls.delete(_));
3421
+ c && (c.remove(), this._axisLabelEls.delete(u));
3382
3422
  return;
3383
3423
  }
3384
- c || (c = document.createElementNS("http://www.w3.org/2000/svg", "text"), c.setAttribute("data-axis-label", _), c.setAttribute("pointer-events", "none"), e.appendChild(c), this._axisLabelEls.set(_, c)), c.textContent = g, c.setAttribute("font-size", r.toString()), c.setAttribute("font-family", "system-ui, sans-serif"), c.setAttribute("font-weight", "600"), c.setAttribute("fill", "#556"), _ === "x" ? (c.setAttribute("x", (i + s - a).toString()), c.setAttribute("y", (-a).toString()), c.setAttribute("text-anchor", "end")) : (c.setAttribute("x", a.toString()), c.setAttribute("y", (n - s + r + a).toString()), c.setAttribute("text-anchor", "start"));
3424
+ c || (c = document.createElementNS("http://www.w3.org/2000/svg", "text"), c.setAttribute("data-axis-label", u), c.setAttribute("pointer-events", "none"), e.appendChild(c), this._axisLabelEls.set(u, c)), c.textContent = g, c.setAttribute("font-size", r.toString()), c.setAttribute("font-family", "system-ui, sans-serif"), c.setAttribute("font-weight", "600"), c.setAttribute("fill", "#556"), u === "x" ? (c.setAttribute("x", (i + s - a).toString()), c.setAttribute("y", (-a).toString()), c.setAttribute("text-anchor", "end")) : (c.setAttribute("x", a.toString()), c.setAttribute("y", (n - s + r + a).toString()), c.setAttribute("text-anchor", "start"));
3385
3425
  }, "place");
3386
3426
  if (h("x", this._axisXText), h("y", this._axisYText), this._magnifyText == null)
3387
3427
  (o = this._magnifyEl) == null || o.remove(), this._magnifyEl = null;
3388
3428
  else {
3389
3429
  this._magnifyEl || (this._magnifyEl = document.createElementNS("http://www.w3.org/2000/svg", "text"), this._magnifyEl.setAttribute("data-magnify-label", ""), this._magnifyEl.setAttribute("pointer-events", "none")), this._magnifyEl.parentElement || e.appendChild(this._magnifyEl);
3390
- const _ = this._magnifyEl;
3391
- _.textContent = this._magnifyText, _.setAttribute("font-size", (r * 0.85).toString()), _.setAttribute("font-family", "system-ui, sans-serif"), _.setAttribute("font-style", "italic"), _.setAttribute("fill", "#556"), _.setAttribute("x", (i - s + a).toString()), _.setAttribute("y", (n - s + r + a).toString()), _.setAttribute("text-anchor", "start");
3430
+ const u = this._magnifyEl;
3431
+ u.textContent = this._magnifyText, u.setAttribute("font-size", (r * 0.85).toString()), u.setAttribute("font-family", "system-ui, sans-serif"), u.setAttribute("font-style", "italic"), u.setAttribute("fill", "#556"), u.setAttribute("x", (i - s + a).toString()), u.setAttribute("y", (n - s + r + a).toString()), u.setAttribute("text-anchor", "start");
3392
3432
  }
3393
3433
  if (!this._plotTitle)
3394
3434
  (l = this._titleEl) == null || l.remove(), this._titleEl = null;
@@ -3429,7 +3469,7 @@ const gt = class gt extends ve {
3429
3469
  });
3430
3470
  }
3431
3471
  };
3432
- u(gt, "QEGraphElement"), gt.tagName = "qe-graph", gt.style = `
3472
+ _(gt, "QEGraphElement"), gt.tagName = "qe-graph", gt.style = `
3433
3473
  ${ve.style}
3434
3474
 
3435
3475
  :host {
@@ -3450,7 +3490,7 @@ u(gt, "QEGraphElement"), gt.tagName = "qe-graph", gt.style = `
3450
3490
  `, gt._instances = /* @__PURE__ */ new Set(), gt._PATH_NUM_RE = /-?\d*\.?\d+(?:e[-+]?\d+)?/gi;
3451
3491
  let Vt = gt;
3452
3492
  customElements.define(Vt.tagName, Vt);
3453
- const Ri = /* @__PURE__ */ u((d) => Vt.getGraph(d), "getGraph"), Li = /* @__PURE__ */ u(() => Vt.instances(), "getGraphs");
3493
+ const Ri = /* @__PURE__ */ _((d) => Vt.getGraph(d), "getGraph"), Li = /* @__PURE__ */ _(() => Vt.instances(), "getGraphs");
3454
3494
  export {
3455
3495
  st as Color,
3456
3496
  Yt as DataFrame,
@@ -3474,12 +3514,12 @@ export {
3474
3514
  hi as TRAJECTORY_ZERO_EPS,
3475
3515
  Ee as Trajectory,
3476
3516
  we as WeightedColor,
3477
- ui as fitTrajectory,
3517
+ _i as fitTrajectory,
3478
3518
  Ri as getGraph,
3479
3519
  Li as getGraphs,
3480
3520
  Us as nearOriginFilter,
3481
- Bs as sampleCurve,
3482
- _i as selectDegree,
3521
+ Gs as sampleCurve,
3522
+ ui as selectDegree,
3483
3523
  Pi as vizENA
3484
3524
  };
3485
3525
  //# sourceMappingURL=qeviz.es.js.map