@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 +570 -530
- package/dist/qeviz.es.js.map +1 -1
- package/dist/qeviz.umd.js +4 -4
- package/dist/qeviz.umd.js.map +1 -1
- package/package.json +1 -1
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
|
|
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),
|
|
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
|
-
|
|
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(),
|
|
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 || {}),
|
|
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,
|
|
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 (
|
|
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 ?
|
|
64
|
+
i && i.length > 0 ? H(this, Ut, i) : H(this, Ut, void 0);
|
|
65
65
|
}
|
|
66
66
|
get name() {
|
|
67
|
-
return k(this,
|
|
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
|
-
|
|
84
|
+
ue = new WeakMap(), yt = new WeakMap(), Ut = new WeakMap(), Nt = new WeakMap(), _(ss, "DataFrameColumn");
|
|
85
85
|
let ye = ss;
|
|
86
|
-
var Et, ct,
|
|
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,
|
|
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
|
-
}),
|
|
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 &&
|
|
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 &&
|
|
109
|
+
n && n.length > 0 && H(this, _e, n);
|
|
110
110
|
}
|
|
111
111
|
get classes() {
|
|
112
|
-
return k(this,
|
|
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(),
|
|
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
|
-
|
|
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
|
-
|
|
294
|
+
_(Ys, "dbg");
|
|
295
295
|
const Pi = {
|
|
296
|
-
get: /* @__PURE__ */
|
|
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
|
|
353
|
-
const
|
|
354
|
-
if (!((
|
|
355
|
-
const g =
|
|
356
|
-
let
|
|
357
|
-
l === "networks" ?
|
|
358
|
-
const
|
|
359
|
-
this._model.setByKey(l, new Yt(
|
|
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 ((
|
|
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 ((
|
|
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 && ((
|
|
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,
|
|
377
|
-
if (
|
|
378
|
-
this._model.dimensions = [
|
|
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((
|
|
381
|
-
if (
|
|
382
|
-
const m = s.col(
|
|
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 = [
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
602
|
+
_(i, "translate"), s.translate = i;
|
|
603
603
|
function n(r, a, h) {
|
|
604
604
|
const o = e.toRad(a);
|
|
605
|
-
function l(
|
|
605
|
+
function l(u, g) {
|
|
606
606
|
return [
|
|
607
|
-
|
|
608
|
-
|
|
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 (
|
|
611
|
+
if (_(l, "rotatePoint"), !h || h[0] === 0 && h[1] === 0)
|
|
612
612
|
return l(r, o);
|
|
613
613
|
{
|
|
614
|
-
const
|
|
615
|
-
return l(
|
|
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
|
-
|
|
618
|
+
_(n, "rotate"), s.rotate = n;
|
|
619
619
|
})(t.Point || (t.Point = {})), ((s) => {
|
|
620
|
-
function i(m,
|
|
621
|
-
return (
|
|
620
|
+
function i(m, A) {
|
|
621
|
+
return (A[1] - m[1]) / (A[0] - m[0]);
|
|
622
622
|
}
|
|
623
|
-
|
|
624
|
-
function n(m,
|
|
625
|
-
const
|
|
626
|
-
return m[1] -
|
|
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
|
-
|
|
629
|
-
function r(m,
|
|
628
|
+
_(n, "intercept"), s.intercept = n;
|
|
629
|
+
function r(m, A) {
|
|
630
630
|
return {
|
|
631
|
-
slope: i(m,
|
|
632
|
-
intercept: n(m,
|
|
631
|
+
slope: i(m, A),
|
|
632
|
+
intercept: n(m, A)
|
|
633
633
|
};
|
|
634
634
|
}
|
|
635
|
-
|
|
636
|
-
function a(m,
|
|
637
|
-
const
|
|
638
|
-
return [
|
|
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
|
-
|
|
641
|
-
function h(m,
|
|
642
|
-
return Array.isArray(m[0]) && (
|
|
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
|
-
|
|
645
|
-
function o(m,
|
|
646
|
-
return Array.isArray(m[0]) && (
|
|
647
|
-
[0, 1].map((
|
|
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
|
-
|
|
651
|
-
function l(m,
|
|
652
|
-
const
|
|
653
|
-
m[1][0] -
|
|
654
|
-
m[1][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
|
-
|
|
666
|
-
|
|
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 [
|
|
668
|
+
return [E, j];
|
|
669
669
|
}
|
|
670
|
-
|
|
671
|
-
function
|
|
672
|
-
const
|
|
673
|
-
m = [
|
|
674
|
-
const nt = [m[0][0], m[1][0]], ot = [m[0][1], m[1][1]], it =
|
|
675
|
-
(ge,
|
|
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,
|
|
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
|
|
685
|
-
function g(m,
|
|
686
|
-
const [[
|
|
687
|
-
return [K /
|
|
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
|
-
|
|
690
|
-
function c(m,
|
|
691
|
-
let { slope:
|
|
692
|
-
if (Math.sqrt(Math.pow(
|
|
693
|
-
let it = (-
|
|
694
|
-
ot = [[it, K], [
|
|
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
|
-
|
|
700
|
-
function
|
|
701
|
-
return (
|
|
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
|
-
|
|
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
|
-
|
|
710
|
+
_(i, "toRad"), s.toRad = i;
|
|
711
711
|
function n(a) {
|
|
712
712
|
return a * 180 / Math.PI;
|
|
713
713
|
}
|
|
714
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
748
|
+
_(e, "sum"), t.sum = e;
|
|
749
749
|
function s(n) {
|
|
750
750
|
return e(n) / n.length;
|
|
751
751
|
}
|
|
752
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
774
|
+
_(e, "parts"), t.parts = e;
|
|
775
775
|
function s(i) {
|
|
776
776
|
return e().flat().findIndex((n) => n === i) >= 0;
|
|
777
777
|
}
|
|
778
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
815
|
+
const u = h[l];
|
|
816
816
|
if (o && typeof o == "object")
|
|
817
|
-
Object.prototype.hasOwnProperty.call(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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
963
|
+
}), H(s, Mt, e.names), s;
|
|
964
964
|
}
|
|
965
965
|
flip() {
|
|
966
|
-
|
|
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(),
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1148
|
-
let
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
1227
|
+
labels: U.DISPLAY_TYPES.ON
|
|
1228
1228
|
},
|
|
1229
|
-
labels:
|
|
1230
|
-
labelposition:
|
|
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:
|
|
1238
|
-
labelposition:
|
|
1237
|
+
labels: U.DISPLAY_TYPES.AUTO,
|
|
1238
|
+
labelposition: U.POSITION.OBJECT
|
|
1239
1239
|
},
|
|
1240
1240
|
MEAN: {
|
|
1241
1241
|
shape: J.SHAPES.SQUARE,
|
|
1242
|
-
labels:
|
|
1242
|
+
labels: U.DISPLAY_TYPES.AUTO
|
|
1243
1243
|
},
|
|
1244
1244
|
LABEL: {
|
|
1245
|
-
highlight:
|
|
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
|
|
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
|
-
|
|
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
|
|
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,
|
|
1402
|
-
this.extremes = new Rt(
|
|
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
|
-
|
|
1419
|
-
let Ke =
|
|
1420
|
-
const
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1511
|
-
function
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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[
|
|
1530
|
-
l += (c / 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
|
-
|
|
1535
|
-
function
|
|
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
|
|
1542
|
-
|
|
1541
|
+
const u = ci(n, r, a, l);
|
|
1542
|
+
u < o && (o = u, h = l);
|
|
1543
1543
|
}
|
|
1544
1544
|
return h;
|
|
1545
1545
|
}
|
|
1546
|
-
|
|
1547
|
-
function
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
1557
|
-
function
|
|
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
|
-
|
|
1566
|
-
const Hs = 100,
|
|
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
|
|
1594
|
+
return Gs(
|
|
1595
1595
|
{ degree: this.polyCoeffsX.length - 1, coeffsX: this.polyCoeffsX, coeffsY: this.polyCoeffsY },
|
|
1596
1596
|
Hs
|
|
1597
1597
|
);
|
|
1598
|
-
const e =
|
|
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,
|
|
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
|
-
|
|
1613
|
-
let Ee =
|
|
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
|
-
|
|
1644
|
+
_(ds, "Edge");
|
|
1645
1645
|
let Me = ds;
|
|
1646
|
-
var
|
|
1646
|
+
var Bt;
|
|
1647
1647
|
const gs = class gs extends kt {
|
|
1648
1648
|
constructor(e) {
|
|
1649
1649
|
super(e.dimensions || [], e);
|
|
1650
|
-
et(this,
|
|
1651
|
-
|
|
1650
|
+
et(this, Bt);
|
|
1651
|
+
H(this, Bt, e);
|
|
1652
1652
|
}
|
|
1653
1653
|
get edge() {
|
|
1654
|
-
return k(this,
|
|
1654
|
+
return k(this, Bt);
|
|
1655
1655
|
}
|
|
1656
1656
|
get path() {
|
|
1657
|
-
const e = k(this,
|
|
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]),
|
|
1660
|
-
return `M${c(
|
|
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
|
-
|
|
1663
|
+
Bt = new WeakMap(), _(gs, "EdgeArrow");
|
|
1664
1664
|
let Ie = gs;
|
|
1665
|
-
var
|
|
1666
|
-
const
|
|
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,
|
|
1669
|
+
et(this, Gt);
|
|
1670
1670
|
et(this, de);
|
|
1671
|
-
this._path = "",
|
|
1671
|
+
this._path = "", H(this, Gt, !1), this._directions = [
|
|
1672
1672
|
"from",
|
|
1673
1673
|
"to"
|
|
1674
1674
|
/* TO */
|
|
1675
|
-
], this.towards = "to", k(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((
|
|
1682
|
-
if (
|
|
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 /
|
|
1684
|
+
const c = -l / u, v = o / u, m = g / 2;
|
|
1685
1685
|
return [
|
|
1686
|
-
[a + c * m, h +
|
|
1687
|
-
[a - c * m, h -
|
|
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
|
|
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,
|
|
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
|
-
|
|
1704
|
-
let Wt =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1763
|
+
_(a, "animate"), requestAnimationFrame(a);
|
|
1764
1764
|
}
|
|
1765
1765
|
};
|
|
1766
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1781
|
+
_(wi, "widthPerWeight");
|
|
1782
1782
|
function Ai(d, t) {
|
|
1783
1783
|
return d * t / (2 * ei);
|
|
1784
1784
|
}
|
|
1785
|
-
|
|
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__ */
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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",
|
|
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",
|
|
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(
|
|
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,
|
|
1840
|
-
this.svg_element.setAttribute("x1", g.toString()), this.svg_element.setAttribute("y1", c.toString()), this.svg_element.setAttribute("x2",
|
|
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
|
-
|
|
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
|
-
|
|
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],
|
|
1981
|
-
m.setAttribute("d", `M${l.x},${l.y} L${
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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__ */
|
|
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
|
|
2064
|
-
|
|
2065
|
-
const m = new
|
|
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
|
-
|
|
2106
|
+
_(jt, "QELayer"), jt.tagName = "g";
|
|
2107
2107
|
let ts = jt;
|
|
2108
2108
|
const xs = class xs {
|
|
2109
|
-
constructor(t, e, s, i, n =
|
|
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 ===
|
|
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__ */
|
|
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__ */
|
|
2130
|
-
const
|
|
2131
|
-
this._offsetX = r + (
|
|
2132
|
-
}, "onMove"), o = /* @__PURE__ */
|
|
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
|
|
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
|
|
2159
|
-
const { cx: o, cy: l } = this.graph.__data__.extremes,
|
|
2160
|
-
n = o +
|
|
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
|
|
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
|
|
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
|
-
|
|
2234
|
+
_(xs, "QELabel");
|
|
2195
2235
|
let Jt = xs;
|
|
2196
2236
|
const je = class je extends HTMLElement {
|
|
2197
2237
|
};
|
|
2198
|
-
|
|
2238
|
+
_(je, "QENodesElement"), je.tagName = "qe-nodes";
|
|
2199
2239
|
let ke = je;
|
|
2200
2240
|
const Ye = class Ye extends HTMLElement {
|
|
2201
2241
|
};
|
|
2202
|
-
|
|
2242
|
+
_(Ye, "QEMeansElement"), Ye.tagName = "qe-means";
|
|
2203
2243
|
let Ce = Ye;
|
|
2204
2244
|
const qe = class qe extends HTMLElement {
|
|
2205
2245
|
};
|
|
2206
|
-
|
|
2246
|
+
_(qe, "QEPointsElement"), qe.tagName = "qe-points";
|
|
2207
2247
|
let Oe = qe;
|
|
2208
2248
|
const Ue = class Ue extends HTMLElement {
|
|
2209
2249
|
};
|
|
2210
|
-
|
|
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
|
-
|
|
2219
|
-
let
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2298
|
+
_(pe, "capMeanToInterval");
|
|
2259
2299
|
function be(d, t, e, s = "") {
|
|
2260
|
-
const i = /* @__PURE__ */
|
|
2261
|
-
const l = d.names.indexOf(o),
|
|
2262
|
-
if (
|
|
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
|
-
|
|
2308
|
+
_(be, "readIntervalBounds");
|
|
2269
2309
|
function ki(d) {
|
|
2270
2310
|
var i, n;
|
|
2271
|
-
const t = /* @__PURE__ */
|
|
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
|
-
|
|
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__ */
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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 = {},
|
|
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((
|
|
2326
|
-
l[
|
|
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]),
|
|
2331
|
-
y && String(y) !== "NA" ? l[I] = String(y) : l[I] || (l[I] =
|
|
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),
|
|
2376
|
+
) : new Set(g), v = o.scalePoints, m = /* @__PURE__ */ _((C) => {
|
|
2337
2377
|
let I = 0;
|
|
2338
|
-
return C.forEach((
|
|
2339
|
-
const y =
|
|
2340
|
-
y >= 0 && (I = Math.max(I, Math.abs(Number(
|
|
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"),
|
|
2343
|
-
this._rangeExtent = o.range === "network" ?
|
|
2344
|
-
const
|
|
2345
|
-
const b = C.names.indexOf(I),
|
|
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
|
-
|
|
2349
|
-
|
|
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
|
|
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__ */
|
|
2358
|
-
const b =
|
|
2359
|
-
return b >= 0 ?
|
|
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((
|
|
2401
|
+
o.pointSets.forEach((P, y) => {
|
|
2362
2402
|
Ot.rows().forEach((b) => {
|
|
2363
|
-
if (String(I(b, "set")) !==
|
|
2364
|
-
const
|
|
2365
|
-
w.ID = `${
|
|
2366
|
-
const
|
|
2367
|
-
|
|
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) :
|
|
2373
|
-
group:
|
|
2374
|
-
unit:
|
|
2375
|
-
set:
|
|
2376
|
-
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,
|
|
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 =
|
|
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:
|
|
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 (
|
|
2438
|
+
if (S) {
|
|
2399
2439
|
const p = y.names.indexOf(n[0]), w = n.length > 1 ? y.names.indexOf(n[1]) : -1;
|
|
2400
|
-
K[
|
|
2401
|
-
const
|
|
2402
|
-
K[
|
|
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),
|
|
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 :
|
|
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
|
|
2452
|
+
const $ = new Set(P.map((p) => p.rowName ?? String(p[0])));
|
|
2413
2453
|
this._ciRects.forEach((p, w) => {
|
|
2414
|
-
|
|
2454
|
+
$.has(w) || (p.remove(), this._ciRects.delete(w));
|
|
2415
2455
|
}), this._outlierRects.forEach((p, w) => {
|
|
2416
|
-
|
|
2456
|
+
$.has(w) || (p.remove(), this._outlierRects.delete(w));
|
|
2417
2457
|
}), this._ciCross.forEach((p, w) => {
|
|
2418
|
-
|
|
2419
|
-
}),
|
|
2420
|
-
var N, z,
|
|
2421
|
-
const w = p.rowName ?? String(p[0]),
|
|
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(
|
|
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
|
|
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 =
|
|
2433
|
-
if (!
|
|
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", (
|
|
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
|
-
(
|
|
2442
|
-
const M = f.x_low *
|
|
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
|
|
2445
|
-
|
|
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 *
|
|
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
|
|
2450
|
-
|
|
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:
|
|
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 *
|
|
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"),
|
|
2468
|
-
if (!
|
|
2469
|
-
const q = l[
|
|
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 *
|
|
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-${
|
|
2513
|
+
this.__data__.points.get(`mean-${R}`),
|
|
2474
2514
|
Z / 2,
|
|
2475
2515
|
at / 2
|
|
2476
2516
|
);
|
|
2477
|
-
let L = this._ciRects.get(
|
|
2478
|
-
L || (L = document.createElementNS("http://www.w3.org/2000/svg", "rect"), L.setAttribute("data-ci-group",
|
|
2479
|
-
}) : Object.entries(K).forEach(([p, { x: w, y:
|
|
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 =
|
|
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
|
|
2488
|
-
|
|
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"),
|
|
2493
|
-
if (!
|
|
2494
|
-
const q = l[
|
|
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 *
|
|
2497
|
-
let L = this._outlierRects.get(
|
|
2498
|
-
L || (L = document.createElementNS("http://www.w3.org/2000/svg", "rect"), L.setAttribute("data-outlier-group",
|
|
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),
|
|
2507
|
-
if (!
|
|
2508
|
-
const
|
|
2509
|
-
if (
|
|
2510
|
-
const p =
|
|
2511
|
-
let w = this._pointLabels.get(
|
|
2512
|
-
w ? ot ===
|
|
2513
|
-
}), nt !== 0 && (I ?
|
|
2514
|
-
const
|
|
2515
|
-
if (
|
|
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 ===
|
|
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
|
|
2522
|
-
if (o.showTrajectories &&
|
|
2523
|
-
|
|
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 = {},
|
|
2566
|
+
const I = {}, P = o.trajectoryUnits ? o.trajectoryUnits.split(",").map((b) => b.trim()) : null;
|
|
2527
2567
|
C.rows().forEach((b) => {
|
|
2528
|
-
const
|
|
2529
|
-
if (
|
|
2530
|
-
const p = b.names.indexOf(n[0]), w = n.length > 1 ? b.names.indexOf(n[1]) : -1,
|
|
2531
|
-
p >= 0 && w >= 0 && (I[
|
|
2532
|
-
x: Number(b[p]) *
|
|
2533
|
-
y: -Number(b[w]) *
|
|
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,
|
|
2537
|
-
const
|
|
2538
|
-
if (
|
|
2539
|
-
const p =
|
|
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:
|
|
2593
|
+
points: $.map((R) => ({ x: R.x, y: R.y, time: R.time }))
|
|
2554
2594
|
});
|
|
2555
|
-
this.__data__.trajectories.set(b, w),
|
|
2595
|
+
this.__data__.trajectories.set(b, w), Tt.__data__.objects.set(w.ID, w);
|
|
2556
2596
|
});
|
|
2557
2597
|
}
|
|
2558
|
-
|
|
2598
|
+
Tt.__data__.__state__.setVariable("layer_updated", Tt.__data__);
|
|
2559
2599
|
}
|
|
2560
|
-
const
|
|
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
|
|
2564
|
-
|
|
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
|
-
|
|
2567
|
-
|
|
2606
|
+
P.meta = {
|
|
2607
|
+
...P.meta ?? {},
|
|
2568
2608
|
kind: "node",
|
|
2569
|
-
name: b != null && String(b) !== "NA" && String(b) !== "" ? String(b) :
|
|
2570
|
-
}, ft.__data__.objects.set(
|
|
2571
|
-
}), si && Kt && ((
|
|
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 && ((
|
|
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
|
|
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__ */
|
|
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:
|
|
2590
|
-
const M = N.names.indexOf(
|
|
2591
|
-
M >= 0 && (x[
|
|
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"),
|
|
2634
|
+
}, "getUnitEdges"), S = /* @__PURE__ */ _((f) => {
|
|
2595
2635
|
const x = {};
|
|
2596
2636
|
let N = 0;
|
|
2597
|
-
if (s.edges.rows().forEach((
|
|
2598
|
-
const M =
|
|
2599
|
-
(G >= 0 ? String(
|
|
2600
|
-
const pt =
|
|
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(
|
|
2603
|
-
isNaN(V) || (x[
|
|
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:
|
|
2609
|
-
z[
|
|
2648
|
+
return y.forEach(({ col: T }) => {
|
|
2649
|
+
z[T] = (x[T] ?? 0) / N;
|
|
2610
2650
|
}), z;
|
|
2611
|
-
}, "getGroupEdges"),
|
|
2651
|
+
}, "getGroupEdges"), $ = /* @__PURE__ */ _((f) => {
|
|
2612
2652
|
if (l[f])
|
|
2613
|
-
return { weights:
|
|
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__ */
|
|
2617
|
-
var
|
|
2618
|
-
const x = s.networks, N = (
|
|
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"),
|
|
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__ */
|
|
2635
|
-
Q =
|
|
2636
|
-
}, "push"), z = /* @__PURE__ */
|
|
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(
|
|
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
|
|
2648
|
-
if (!
|
|
2649
|
-
const M =
|
|
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 ?
|
|
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,
|
|
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,
|
|
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__ */
|
|
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__ */
|
|
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
|
|
2669
|
-
if (
|
|
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__ */
|
|
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
|
|
2674
|
-
return { saturation:
|
|
2713
|
+
const T = Math.min(1, Math.abs(f));
|
|
2714
|
+
return { saturation: T, opacity: T };
|
|
2675
2715
|
}
|
|
2676
|
-
const [N, z] = x ? xt :
|
|
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__ */
|
|
2682
|
-
vt[
|
|
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
|
|
2695
|
-
z.size = M ? o.hideUnconnectedNodes ? 0 : xi : Ai(
|
|
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 = {},
|
|
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
|
|
2703
|
-
$t[
|
|
2704
|
-
}), p.forEach(({ col: f, pair: x, weight: N, color: z, layer:
|
|
2705
|
-
const rt = ft.__data__.objects.get(x[0]),
|
|
2706
|
-
if (!rt || !
|
|
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: [
|
|
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[
|
|
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 &&
|
|
2742
|
-
ft.__data__.objects.get(
|
|
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,
|
|
2745
|
-
const
|
|
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
|
|
2754
|
-
let
|
|
2755
|
-
|
|
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__ */
|
|
2806
|
-
var
|
|
2807
|
-
return ((
|
|
2808
|
-
}, "firstAttr"), h = r.find((c) => c.hasAttribute("magnify")), o = this.querySelector("qe-trajectories"), l = this.querySelector("qe-axes"),
|
|
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
|
-
|
|
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
|
|
2821
|
-
return c != null && Number.isFinite(
|
|
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
|
-
|
|
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
|
-
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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((
|
|
3099
|
+
e.forEach((u, g) => {
|
|
3060
3100
|
const c = t.get(g);
|
|
3061
|
-
if (!(!c || c.t !==
|
|
3062
|
-
if (
|
|
3063
|
-
g.setAttribute("cx", String(r(c.cx,
|
|
3064
|
-
else if (
|
|
3065
|
-
g.setAttribute("x", String(r(c.x,
|
|
3066
|
-
else if (
|
|
3067
|
-
g.setAttribute("x1", String(r(c.x1,
|
|
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 !==
|
|
3070
|
-
let
|
|
3071
|
-
const m =
|
|
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[
|
|
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
|
|
3097
|
-
|
|
3098
|
-
const g =
|
|
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(
|
|
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__ */
|
|
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="${(
|
|
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__ */
|
|
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__ */
|
|
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,
|
|
3223
|
-
n = { dx: l / 100, dy:
|
|
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
|
|
3231
|
-
|
|
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__ */
|
|
3273
|
+
const a = /* @__PURE__ */ _((o) => {
|
|
3234
3274
|
var l;
|
|
3235
3275
|
for (; o && o !== this.svg_element; ) {
|
|
3236
|
-
const
|
|
3237
|
-
if (
|
|
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__ */
|
|
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
|
|
3246
|
-
(
|
|
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
|
|
3251
|
-
if (a(
|
|
3290
|
+
const u = o.relatedTarget;
|
|
3291
|
+
if (a(u) === l) return;
|
|
3252
3292
|
const c = h(l);
|
|
3253
|
-
(c == null ? void 0 : c.displayMode) ===
|
|
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__ */
|
|
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__ */
|
|
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",
|
|
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
|
|
3391
|
-
|
|
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
|
-
|
|
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__ */
|
|
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
|
-
|
|
3517
|
+
_i as fitTrajectory,
|
|
3478
3518
|
Ri as getGraph,
|
|
3479
3519
|
Li as getGraphs,
|
|
3480
3520
|
Us as nearOriginFilter,
|
|
3481
|
-
|
|
3482
|
-
|
|
3521
|
+
Gs as sampleCurve,
|
|
3522
|
+
ui as selectDegree,
|
|
3483
3523
|
Pi as vizENA
|
|
3484
3524
|
};
|
|
3485
3525
|
//# sourceMappingURL=qeviz.es.js.map
|