@linkurious/ogma-linkurious-parser 4.1.8 → 4.1.9
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +92 -75
- package/dist/index.mjs.map +1 -1
- package/dist/styles/styleRules.d.ts +8 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrencyFormat as B, PropertyTypeName as pr, AutoRangeScale as Ut, OgmaEdgeShape as br, SelectorType as S, ForceLayoutMode as yr, EntityType as
|
|
1
|
+
import { CurrencyFormat as B, PropertyTypeName as pr, AutoRangeScale as Ut, OgmaEdgeShape as br, SelectorType as S, ForceLayoutMode as yr, EntityType as I } from "@linkurious/rest-client";
|
|
2
2
|
import vr from "@linkurious/ogma";
|
|
3
3
|
import { BehaviorSubject as mr } from "rxjs";
|
|
4
4
|
var X = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -33,15 +33,15 @@ function Dr(r) {
|
|
|
33
33
|
return t < 0 ? void 0 : e[t][1];
|
|
34
34
|
}
|
|
35
35
|
var Or = Dr, Lr = se;
|
|
36
|
-
function
|
|
36
|
+
function Ir(r) {
|
|
37
37
|
return Lr(this.__data__, r) > -1;
|
|
38
38
|
}
|
|
39
|
-
var
|
|
39
|
+
var Pr = Ir, Mr = se;
|
|
40
40
|
function Rr(r, e) {
|
|
41
41
|
var t = this.__data__, i = Mr(t, r);
|
|
42
42
|
return i < 0 ? (++this.size, t.push([r, e])) : t[i][1] = e, this;
|
|
43
43
|
}
|
|
44
|
-
var Br = Rr, zr = Cr, Gr = wr, Ur = Or, jr =
|
|
44
|
+
var Br = Rr, zr = Cr, Gr = wr, Ur = Or, jr = Pr, kr = Br;
|
|
45
45
|
function j(r) {
|
|
46
46
|
var e = -1, t = r == null ? 0 : r.length;
|
|
47
47
|
for (this.clear(); ++e < t; ) {
|
|
@@ -123,13 +123,13 @@ function Li(r) {
|
|
|
123
123
|
}
|
|
124
124
|
return "";
|
|
125
125
|
}
|
|
126
|
-
var Vt = Li,
|
|
126
|
+
var Vt = Li, Ii = Ht, Pi = Ni, Mi = oe, Ri = Vt, Bi = /[\\^$.*+?()[\]{}|]/g, zi = /^\[object .+?Constructor\]$/, Gi = Function.prototype, Ui = Object.prototype, ji = Gi.toString, ki = Ui.hasOwnProperty, Hi = RegExp(
|
|
127
127
|
"^" + ji.call(ki).replace(Bi, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
128
128
|
);
|
|
129
129
|
function Vi(r) {
|
|
130
|
-
if (!Mi(r) ||
|
|
130
|
+
if (!Mi(r) || Pi(r))
|
|
131
131
|
return !1;
|
|
132
|
-
var e =
|
|
132
|
+
var e = Ii(r) ? Hi : zi;
|
|
133
133
|
return e.test(Ri(r));
|
|
134
134
|
}
|
|
135
135
|
var Ki = Vi;
|
|
@@ -141,7 +141,7 @@ function Zi(r, e) {
|
|
|
141
141
|
var t = Ji(r, e);
|
|
142
142
|
return Yi(t) ? t : void 0;
|
|
143
143
|
}
|
|
144
|
-
var M = Zi, Xi = M, Qi = N, en = Xi(Qi, "Map"),
|
|
144
|
+
var M = Zi, Xi = M, Qi = N, en = Xi(Qi, "Map"), Ie = en, tn = M, rn = tn(Object, "create"), ue = rn, Xe = ue;
|
|
145
145
|
function nn() {
|
|
146
146
|
this.__data__ = Xe ? Xe(null) : {}, this.size = 0;
|
|
147
147
|
}
|
|
@@ -182,7 +182,7 @@ k.prototype.delete = xn;
|
|
|
182
182
|
k.prototype.get = $n;
|
|
183
183
|
k.prototype.has = En;
|
|
184
184
|
k.prototype.set = Fn;
|
|
185
|
-
var Tn = k, Qe = Tn, wn = ae, Nn =
|
|
185
|
+
var Tn = k, Qe = Tn, wn = ae, Nn = Ie;
|
|
186
186
|
function Dn() {
|
|
187
187
|
this.size = 0, this.__data__ = {
|
|
188
188
|
hash: new Qe(),
|
|
@@ -195,10 +195,10 @@ function Ln(r) {
|
|
|
195
195
|
var e = typeof r;
|
|
196
196
|
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? r !== "__proto__" : r === null;
|
|
197
197
|
}
|
|
198
|
-
var
|
|
198
|
+
var In = Ln, Pn = In;
|
|
199
199
|
function Mn(r, e) {
|
|
200
200
|
var t = r.__data__;
|
|
201
|
-
return
|
|
201
|
+
return Pn(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
|
|
202
202
|
}
|
|
203
203
|
var le = Mn, Rn = le;
|
|
204
204
|
function Bn(r) {
|
|
@@ -231,7 +231,7 @@ H.prototype.delete = Jn;
|
|
|
231
231
|
H.prototype.get = Zn;
|
|
232
232
|
H.prototype.has = Xn;
|
|
233
233
|
H.prototype.set = Qn;
|
|
234
|
-
var
|
|
234
|
+
var Pe = H, es = ae, ts = Ie, rs = Pe, is = 200;
|
|
235
235
|
function ns(r, e) {
|
|
236
236
|
var t = this.__data__;
|
|
237
237
|
if (t instanceof es) {
|
|
@@ -260,7 +260,7 @@ var fs = hs;
|
|
|
260
260
|
function ps(r) {
|
|
261
261
|
return this.__data__.has(r);
|
|
262
262
|
}
|
|
263
|
-
var bs = ps, ys =
|
|
263
|
+
var bs = ps, ys = Pe, vs = fs, ms = bs;
|
|
264
264
|
function te(r) {
|
|
265
265
|
var e = -1, t = r == null ? 0 : r.length;
|
|
266
266
|
for (this.__data__ = new ys(); ++e < t; )
|
|
@@ -314,20 +314,20 @@ function Ns(r, e, t, i, n, s) {
|
|
|
314
314
|
return s.delete(r), s.delete(e), h;
|
|
315
315
|
}
|
|
316
316
|
var qt = Ns, Ds = N, Os = Ds.Uint8Array, Ls = Os;
|
|
317
|
-
function
|
|
317
|
+
function Is(r) {
|
|
318
318
|
var e = -1, t = Array(r.size);
|
|
319
319
|
return r.forEach(function(i, n) {
|
|
320
320
|
t[++e] = [n, i];
|
|
321
321
|
}), t;
|
|
322
322
|
}
|
|
323
|
-
var
|
|
323
|
+
var Ps = Is;
|
|
324
324
|
function Ms(r) {
|
|
325
325
|
var e = -1, t = Array(r.size);
|
|
326
326
|
return r.forEach(function(i) {
|
|
327
327
|
t[++e] = i;
|
|
328
328
|
}), t;
|
|
329
329
|
}
|
|
330
|
-
var Rs = Ms, et = Y, tt = Ls, Bs = Le, zs = qt, Gs =
|
|
330
|
+
var Rs = Ms, et = Y, tt = Ls, Bs = Le, zs = qt, Gs = Ps, Us = Rs, js = 1, ks = 2, Hs = "[object Boolean]", Vs = "[object Date]", Ks = "[object Error]", qs = "[object Map]", Ws = "[object Number]", Ys = "[object RegExp]", Js = "[object Set]", Zs = "[object String]", Xs = "[object Symbol]", Qs = "[object ArrayBuffer]", ea = "[object DataView]", rt = et ? et.prototype : void 0, pe = rt ? rt.valueOf : void 0;
|
|
331
331
|
function ta(r, e, t, i, n, s, a) {
|
|
332
332
|
switch (t) {
|
|
333
333
|
case ea:
|
|
@@ -418,12 +418,12 @@ re.exports;
|
|
|
418
418
|
var t = N, i = Oa, n = e && !e.nodeType && e, s = n && !0 && r && !r.nodeType && r, a = s && s.exports === n, o = a ? t.Buffer : void 0, l = o ? o.isBuffer : void 0, c = l || i;
|
|
419
419
|
r.exports = c;
|
|
420
420
|
})(re, re.exports);
|
|
421
|
-
var Jt = re.exports, La = 9007199254740991,
|
|
422
|
-
function
|
|
421
|
+
var Jt = re.exports, La = 9007199254740991, Ia = /^(?:0|[1-9]\d*)$/;
|
|
422
|
+
function Pa(r, e) {
|
|
423
423
|
var t = typeof r;
|
|
424
|
-
return e = e ?? La, !!e && (t == "number" || t != "symbol" &&
|
|
424
|
+
return e = e ?? La, !!e && (t == "number" || t != "symbol" && Ia.test(r)) && r > -1 && r % 1 == 0 && r < e;
|
|
425
425
|
}
|
|
426
|
-
var Re =
|
|
426
|
+
var Re = Pa, Ma = 9007199254740991;
|
|
427
427
|
function Ra(r) {
|
|
428
428
|
return typeof r == "number" && r > -1 && r % 1 == 0 && r <= Ma;
|
|
429
429
|
}
|
|
@@ -473,7 +473,7 @@ function Oo(r, e) {
|
|
|
473
473
|
return r(e(t));
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
|
-
var Lo = Oo,
|
|
476
|
+
var Lo = Oo, Io = Lo, Po = Io(Object.keys, Object), Mo = Po, Ro = Do, Bo = Mo, zo = Object.prototype, Go = zo.hasOwnProperty;
|
|
477
477
|
function Uo(r) {
|
|
478
478
|
if (!Ro(r))
|
|
479
479
|
return Bo(r);
|
|
@@ -526,7 +526,7 @@ function nu(r, e, t, i, n, s) {
|
|
|
526
526
|
}
|
|
527
527
|
return s.delete(r), s.delete(e), f;
|
|
528
528
|
}
|
|
529
|
-
var su = nu, au = M, ou = N, uu = au(ou, "DataView"), lu = uu, cu = M, du = N, gu = cu(du, "Promise"), hu = gu, fu = M, pu = N, bu = fu(pu, "Set"), yu = bu, vu = M, mu = N, _u = vu(mu, "WeakMap"), Cu = _u, Se = lu, Ae =
|
|
529
|
+
var su = nu, au = M, ou = N, uu = au(ou, "DataView"), lu = uu, cu = M, du = N, gu = cu(du, "Promise"), hu = gu, fu = M, pu = N, bu = fu(pu, "Set"), yu = bu, vu = M, mu = N, _u = vu(mu, "WeakMap"), Cu = _u, Se = lu, Ae = Ie, xe = hu, $e = yu, Ee = Cu, Qt = J, K = Vt, ut = "[object Map]", Su = "[object Object]", lt = "[object Promise]", ct = "[object Set]", dt = "[object WeakMap]", gt = "[object DataView]", Au = K(Se), xu = K(Ae), $u = K(xe), Eu = K($e), Fu = K(Ee), L = Qt;
|
|
530
530
|
(Se && L(new Se(new ArrayBuffer(1))) != gt || Ae && L(new Ae()) != ut || xe && L(xe.resolve()) != lt || $e && L(new $e()) != ct || Ee && L(new Ee()) != dt) && (L = function(r) {
|
|
531
531
|
var e = Qt(r), t = e == Su ? r.constructor : void 0, i = t ? K(t) : "";
|
|
532
532
|
if (i)
|
|
@@ -544,8 +544,8 @@ var su = nu, au = M, ou = N, uu = au(ou, "DataView"), lu = uu, cu = M, du = N, g
|
|
|
544
544
|
}
|
|
545
545
|
return e;
|
|
546
546
|
});
|
|
547
|
-
var Tu = L, be = Kt, wu = qt, Nu = ra, Du = su, ht = Tu, ft = T, pt = Jt, Ou = Xt, Lu = 1, bt = "[object Arguments]", yt = "[object Array]", Q = "[object Object]",
|
|
548
|
-
function
|
|
547
|
+
var Tu = L, be = Kt, wu = qt, Nu = ra, Du = su, ht = Tu, ft = T, pt = Jt, Ou = Xt, Lu = 1, bt = "[object Arguments]", yt = "[object Array]", Q = "[object Object]", Iu = Object.prototype, vt = Iu.hasOwnProperty;
|
|
548
|
+
function Pu(r, e, t, i, n, s) {
|
|
549
549
|
var a = ft(r), o = ft(e), l = a ? yt : ht(r), c = o ? yt : ht(e);
|
|
550
550
|
l = l == bt ? Q : l, c = c == bt ? Q : c;
|
|
551
551
|
var d = l == Q, g = c == Q, h = l == c;
|
|
@@ -565,7 +565,7 @@ function Iu(r, e, t, i, n, s) {
|
|
|
565
565
|
}
|
|
566
566
|
return h ? (s || (s = new be()), Du(r, e, t, i, n, s)) : !1;
|
|
567
567
|
}
|
|
568
|
-
var Mu =
|
|
568
|
+
var Mu = Pu, Ru = Mu, mt = Z;
|
|
569
569
|
function er(r, e, t, i, n) {
|
|
570
570
|
return r === e ? !0 : r == null || e == null || !mt(r) && !mt(e) ? r !== r && e !== e : Ru(r, e, t, i, er, n);
|
|
571
571
|
}
|
|
@@ -605,7 +605,7 @@ function nl(r, e) {
|
|
|
605
605
|
var t = typeof r;
|
|
606
606
|
return t == "number" || t == "symbol" || t == "boolean" || r == null || tl(r) ? !0 : il.test(r) || !rl.test(r) || e != null && r in Object(e);
|
|
607
607
|
}
|
|
608
|
-
var Ue = nl, ir =
|
|
608
|
+
var Ue = nl, ir = Pe, sl = "Expected a function";
|
|
609
609
|
function je(r, e) {
|
|
610
610
|
if (typeof r != "function" || e != null && typeof e != "function")
|
|
611
611
|
throw new TypeError(sl);
|
|
@@ -658,13 +658,13 @@ function Dl(r) {
|
|
|
658
658
|
return e == "0" && 1 / r == -Nl ? "-0" : e;
|
|
659
659
|
}
|
|
660
660
|
var ge = Dl, Ol = sr, Ll = ge;
|
|
661
|
-
function
|
|
661
|
+
function Il(r, e) {
|
|
662
662
|
e = Ol(e, r);
|
|
663
663
|
for (var t = 0, i = e.length; r != null && t < i; )
|
|
664
664
|
r = r[Ll(e[t++])];
|
|
665
665
|
return t && t == i ? r : void 0;
|
|
666
666
|
}
|
|
667
|
-
var ke =
|
|
667
|
+
var ke = Il, Pl = Kt, Ml = Ge, Rl = 1, Bl = 2;
|
|
668
668
|
function zl(r, e, t, i) {
|
|
669
669
|
var n = t.length, s = n, a = !i;
|
|
670
670
|
if (r == null)
|
|
@@ -681,7 +681,7 @@ function zl(r, e, t, i) {
|
|
|
681
681
|
if (c === void 0 && !(l in r))
|
|
682
682
|
return !1;
|
|
683
683
|
} else {
|
|
684
|
-
var g = new
|
|
684
|
+
var g = new Pl();
|
|
685
685
|
if (i)
|
|
686
686
|
var h = i(c, d, l, r, e, g);
|
|
687
687
|
if (!(h === void 0 ? Ml(d, c, Rl | Bl, i, g) : h))
|
|
@@ -762,9 +762,9 @@ function Dc(r) {
|
|
|
762
762
|
return Nc(e, r);
|
|
763
763
|
};
|
|
764
764
|
}
|
|
765
|
-
var Oc = Dc, Lc = wc,
|
|
765
|
+
var Oc = Dc, Lc = wc, Ic = Oc, Pc = Ue, Mc = ge;
|
|
766
766
|
function Rc(r) {
|
|
767
|
-
return
|
|
767
|
+
return Pc(r) ? Lc(Mc(r)) : Ic(r);
|
|
768
768
|
}
|
|
769
769
|
var Bc = Rc, zc = Xl, Gc = Ec, Uc = he, jc = T, kc = Bc;
|
|
770
770
|
function Hc(r) {
|
|
@@ -880,18 +880,18 @@ function Od(r, e, t) {
|
|
|
880
880
|
};
|
|
881
881
|
}
|
|
882
882
|
var Ld = Od;
|
|
883
|
-
function
|
|
883
|
+
function Id(r) {
|
|
884
884
|
return function() {
|
|
885
885
|
return r;
|
|
886
886
|
};
|
|
887
887
|
}
|
|
888
|
-
var
|
|
888
|
+
var Pd = Id, Md = M, Rd = function() {
|
|
889
889
|
try {
|
|
890
890
|
var r = Md(Object, "defineProperty");
|
|
891
891
|
return r({}, "", {}), r;
|
|
892
892
|
} catch {
|
|
893
893
|
}
|
|
894
|
-
}(), Bd = Rd, zd =
|
|
894
|
+
}(), Bd = Rd, zd = Pd, Ft = Bd, Gd = he, Ud = Ft ? function(r, e) {
|
|
895
895
|
return Ft(r, "toString", {
|
|
896
896
|
configurable: !0,
|
|
897
897
|
enumerable: !1,
|
|
@@ -1411,7 +1411,7 @@ var bg = lr.exports, Fe = {
|
|
|
1411
1411
|
n._blocksize = 16, n._digestsize = 20, ur.exports = n;
|
|
1412
1412
|
})();
|
|
1413
1413
|
var yg = ur.exports;
|
|
1414
|
-
const He = /* @__PURE__ */ Oe(yg),
|
|
1414
|
+
const He = /* @__PURE__ */ Oe(yg), E = "#7f7f7f", Nt = [
|
|
1415
1415
|
"#9467bd",
|
|
1416
1416
|
"#e377c2",
|
|
1417
1417
|
"#1f77b4",
|
|
@@ -1431,7 +1431,7 @@ const He = /* @__PURE__ */ Oe(yg), F = "#7f7f7f", Nt = [
|
|
|
1431
1431
|
"#ffbb78",
|
|
1432
1432
|
"#c49c94"
|
|
1433
1433
|
];
|
|
1434
|
-
class
|
|
1434
|
+
class F {
|
|
1435
1435
|
constructor(e) {
|
|
1436
1436
|
this.colorsCache = /* @__PURE__ */ new Map(), this._rulesMap = {}, this.refresh(e);
|
|
1437
1437
|
}
|
|
@@ -1452,7 +1452,7 @@ class E {
|
|
|
1452
1452
|
* Return the color for a node when style color is auto
|
|
1453
1453
|
*/
|
|
1454
1454
|
static autoColor(e, t) {
|
|
1455
|
-
return u.isDefined(e) ? Nt[
|
|
1455
|
+
return u.isDefined(e) ? Nt[F.getRandomUniqueColorPaletteIndex(e, Nt.length, t)] : E;
|
|
1456
1456
|
}
|
|
1457
1457
|
/**
|
|
1458
1458
|
* Return a number from 0 to number of occurrence in a palette based on a property
|
|
@@ -1464,7 +1464,7 @@ class E {
|
|
|
1464
1464
|
* Get color of a type
|
|
1465
1465
|
*/
|
|
1466
1466
|
static getTypeColor(e, t) {
|
|
1467
|
-
return typeof e.style.color == "object" && e.style.color.input[0] !== "properties" ?
|
|
1467
|
+
return typeof e.style.color == "object" && e.style.color.input[0] !== "properties" ? F.autoColor(t, e.style.color.ignoreCase) : !u.isDefined(e.input) && typeof e.style.color != "object" ? e.style.color : null;
|
|
1468
1468
|
}
|
|
1469
1469
|
/**
|
|
1470
1470
|
* return the corresponding size to the value with a linear function
|
|
@@ -1501,7 +1501,7 @@ class E {
|
|
|
1501
1501
|
return typeof e == "object" && (e == null ? void 0 : e.type) === "autoRange";
|
|
1502
1502
|
}
|
|
1503
1503
|
}
|
|
1504
|
-
class W extends
|
|
1504
|
+
class W extends F {
|
|
1505
1505
|
constructor(e) {
|
|
1506
1506
|
super(e);
|
|
1507
1507
|
}
|
|
@@ -1520,7 +1520,7 @@ class W extends E {
|
|
|
1520
1520
|
*/
|
|
1521
1521
|
color(e) {
|
|
1522
1522
|
if (!u.isDefined(e))
|
|
1523
|
-
return
|
|
1523
|
+
return E;
|
|
1524
1524
|
let t;
|
|
1525
1525
|
for (let i = 0; i < this._rulesMap.color.length; ++i) {
|
|
1526
1526
|
const n = this._rulesMap.color[i];
|
|
@@ -1529,12 +1529,12 @@ class W extends E {
|
|
|
1529
1529
|
t = n.style.color;
|
|
1530
1530
|
else if (typeof n.style.color == "object") {
|
|
1531
1531
|
const s = u.getIn(e, n.style.color.input);
|
|
1532
|
-
t =
|
|
1532
|
+
t = F.autoColor(`${s}`, n.style.color.ignoreCase);
|
|
1533
1533
|
}
|
|
1534
1534
|
break;
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
|
-
return u.isDefined(t) ? t :
|
|
1537
|
+
return u.isDefined(t) ? t : E;
|
|
1538
1538
|
}
|
|
1539
1539
|
/**
|
|
1540
1540
|
* Generate shape for a given node
|
|
@@ -1592,13 +1592,13 @@ class W extends E {
|
|
|
1592
1592
|
shape: this.shape(e),
|
|
1593
1593
|
width: this.width(e)
|
|
1594
1594
|
} : {
|
|
1595
|
-
color:
|
|
1595
|
+
color: E,
|
|
1596
1596
|
shape: br.ARROW,
|
|
1597
1597
|
width: "100%"
|
|
1598
1598
|
};
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
|
1601
|
-
class U extends
|
|
1601
|
+
class U extends F {
|
|
1602
1602
|
constructor(e) {
|
|
1603
1603
|
super(e);
|
|
1604
1604
|
}
|
|
@@ -1619,7 +1619,7 @@ class U extends E {
|
|
|
1619
1619
|
*/
|
|
1620
1620
|
color(e) {
|
|
1621
1621
|
if (!u.isDefined(e))
|
|
1622
|
-
return [
|
|
1622
|
+
return [E];
|
|
1623
1623
|
const t = He(JSON.stringify(e)), i = this.colorsCache.get(t);
|
|
1624
1624
|
if (i !== void 0)
|
|
1625
1625
|
return i;
|
|
@@ -1631,7 +1631,7 @@ class U extends E {
|
|
|
1631
1631
|
if (!(c.itemType !== void 0 && c.itemType !== null && c.itemType !== e.categories[a]) && c.canApplyTo(e)) {
|
|
1632
1632
|
if (typeof c.style.color == "object") {
|
|
1633
1633
|
const d = u.getIn(e, c.style.color.input);
|
|
1634
|
-
Array.isArray(d) ? o =
|
|
1634
|
+
Array.isArray(d) ? o = F.autoColor(e.categories[a], c.style.color.ignoreCase) : o = F.autoColor(`${d}`, c.style.color.ignoreCase);
|
|
1635
1635
|
} else
|
|
1636
1636
|
o = c.style.color;
|
|
1637
1637
|
break;
|
|
@@ -1639,7 +1639,7 @@ class U extends E {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
n.push(o);
|
|
1641
1641
|
}
|
|
1642
|
-
n = n.filter((a) => u.isDefined(a)), n.length === 0 && (n = [
|
|
1642
|
+
n = n.filter((a) => u.isDefined(a)), n.length === 0 && (n = [E]);
|
|
1643
1643
|
const s = n.length === 1 ? n[0] : n;
|
|
1644
1644
|
return this.colorsCache.set(t, s), s;
|
|
1645
1645
|
}
|
|
@@ -1744,7 +1744,7 @@ class U extends E {
|
|
|
1744
1744
|
all(e) {
|
|
1745
1745
|
if (!u.isDefined(e))
|
|
1746
1746
|
return {
|
|
1747
|
-
color:
|
|
1747
|
+
color: E
|
|
1748
1748
|
};
|
|
1749
1749
|
const t = this.icon(e);
|
|
1750
1750
|
return {
|
|
@@ -1902,7 +1902,7 @@ class C {
|
|
|
1902
1902
|
*/
|
|
1903
1903
|
getTypeColor(e) {
|
|
1904
1904
|
let t;
|
|
1905
|
-
return C.checkItemType([e], this.itemType) && this.type === S.ANY && !u.isDefined(this.input) && (t =
|
|
1905
|
+
return C.checkItemType([e], this.itemType) && this.type === S.ANY && !u.isDefined(this.input) && (t = F.getTypeColor(this, e)), t;
|
|
1906
1906
|
}
|
|
1907
1907
|
}
|
|
1908
1908
|
var D = /* @__PURE__ */ ((r) => (r.COLOR = "color", r.ICON = "icon", r.SIZE = "size", r.IMAGE = "image", r.SHAPE = "shape", r.WIDTH = "width", r))(D || {});
|
|
@@ -2059,11 +2059,11 @@ class p {
|
|
|
2059
2059
|
const o = u.getIn(a, n.input);
|
|
2060
2060
|
if (Array.isArray(o))
|
|
2061
2061
|
o.forEach((l) => {
|
|
2062
|
-
const c = n.input.includes("properties") ? `${p.getTypeLabel(t.itemType)}.${s} = ${l}` : `${p.getTypeLabel(l)}`, d =
|
|
2062
|
+
const c = n.input.includes("properties") ? `${p.getTypeLabel(t.itemType)}.${s} = ${l}` : `${p.getTypeLabel(l)}`, d = F.autoColor(l, n.ignoreCase);
|
|
2063
2063
|
p.updateLegend(i, { label: c, value: d });
|
|
2064
2064
|
});
|
|
2065
2065
|
else {
|
|
2066
|
-
const l = n.input.includes("properties") ? `${p.getTypeLabel(t.itemType)}.${s} = ${o}` : `${p.getTypeLabel(o)}`, c =
|
|
2066
|
+
const l = n.input.includes("properties") ? `${p.getTypeLabel(t.itemType)}.${s} = ${o}` : `${p.getTypeLabel(o)}`, c = F.autoColor(o, n.ignoreCase);
|
|
2067
2067
|
p.updateLegend(i, { label: l, value: c });
|
|
2068
2068
|
}
|
|
2069
2069
|
});
|
|
@@ -2074,6 +2074,23 @@ class p {
|
|
|
2074
2074
|
static getTypeLabel(e) {
|
|
2075
2075
|
return e === void 0 ? "All" : e === null ? "Others" : e;
|
|
2076
2076
|
}
|
|
2077
|
+
/**
|
|
2078
|
+
* Return the color of item type from the list of styles
|
|
2079
|
+
*/
|
|
2080
|
+
getColorForType(e) {
|
|
2081
|
+
const t = this.color.map((i) => i.getTypeColor(e)).filter((i) => u.isDefined(i));
|
|
2082
|
+
return t.length > 0 ? t[t.length - 1] : E;
|
|
2083
|
+
}
|
|
2084
|
+
/**
|
|
2085
|
+
* Return the icon of item type from the list of styles
|
|
2086
|
+
*/
|
|
2087
|
+
getIconForType(e) {
|
|
2088
|
+
const t = this.icon.filter((i) => !u.isDefined(i.input) && i.itemType === e).map((i) => {
|
|
2089
|
+
var n;
|
|
2090
|
+
return (n = i.style.icon) == null ? void 0 : n.content;
|
|
2091
|
+
}).filter((i) => u.isDefined(i));
|
|
2092
|
+
return t.length > 0 ? t[t.length - 1] : void 0;
|
|
2093
|
+
}
|
|
2077
2094
|
/**
|
|
2078
2095
|
* Check if a legend item already exists and overwrite it / push it
|
|
2079
2096
|
*/
|
|
@@ -2143,7 +2160,7 @@ const Dt = {
|
|
|
2143
2160
|
color: "#FFF",
|
|
2144
2161
|
scalingMethod: "scaled",
|
|
2145
2162
|
width: 4
|
|
2146
|
-
}, Cg = "'roboto', sans-serif", Lt = "#000", ve = "#FFF",
|
|
2163
|
+
}, Cg = "'roboto', sans-serif", Lt = "#000", ve = "#FFF", It = "#7f7f7f", Pt = 0.2;
|
|
2147
2164
|
class Sg {
|
|
2148
2165
|
constructor(e, t) {
|
|
2149
2166
|
this._nodeAttributes = new U({}), this._edgeAttributes = new W({}), this._ogma = e, this._defaultConfiguration = t, this._nodeAttributes.setBaseUrl(t.baseUrl);
|
|
@@ -2169,7 +2186,7 @@ class Sg {
|
|
|
2169
2186
|
icon: {
|
|
2170
2187
|
minVisibleSize: 15
|
|
2171
2188
|
},
|
|
2172
|
-
color:
|
|
2189
|
+
color: It,
|
|
2173
2190
|
shape: this._defaultConfiguration.node.shape !== void 0 ? this._defaultConfiguration.node.shape : "circle",
|
|
2174
2191
|
innerStroke: {
|
|
2175
2192
|
width: 3
|
|
@@ -2195,7 +2212,7 @@ class Sg {
|
|
|
2195
2212
|
},
|
|
2196
2213
|
width: this.defaultEdgeWidth(this._defaultConfiguration.edge),
|
|
2197
2214
|
shape: this._defaultConfiguration.edge.shape !== void 0 ? this._defaultConfiguration.edge.shape : "arrow",
|
|
2198
|
-
color:
|
|
2215
|
+
color: It
|
|
2199
2216
|
}
|
|
2200
2217
|
});
|
|
2201
2218
|
}
|
|
@@ -2279,7 +2296,7 @@ class Sg {
|
|
|
2279
2296
|
this._ogma.styles.createClass({
|
|
2280
2297
|
name: "filtered",
|
|
2281
2298
|
nodeAttributes: {
|
|
2282
|
-
opacity:
|
|
2299
|
+
opacity: Pt,
|
|
2283
2300
|
layer: (e) => e.getMetaNode() !== null ? 1 : -1,
|
|
2284
2301
|
detectable: !1,
|
|
2285
2302
|
badges: {
|
|
@@ -2294,7 +2311,7 @@ class Sg {
|
|
|
2294
2311
|
color: "rgb(240, 240, 240)",
|
|
2295
2312
|
innerStroke: {
|
|
2296
2313
|
width: 1,
|
|
2297
|
-
color:
|
|
2314
|
+
color: E,
|
|
2298
2315
|
minVisibleSize: 1
|
|
2299
2316
|
},
|
|
2300
2317
|
shape: "circle",
|
|
@@ -2303,14 +2320,14 @@ class Sg {
|
|
|
2303
2320
|
radius: "50%"
|
|
2304
2321
|
},
|
|
2305
2322
|
edgeAttributes: {
|
|
2306
|
-
opacity:
|
|
2323
|
+
opacity: Pt,
|
|
2307
2324
|
layer: (e) => {
|
|
2308
2325
|
const t = e.getExtremities().getMetaNode().some((i) => i !== null);
|
|
2309
2326
|
return !e.isVirtual() && t ? 1 : -1;
|
|
2310
2327
|
},
|
|
2311
2328
|
detectable: !1,
|
|
2312
2329
|
text: null,
|
|
2313
|
-
color:
|
|
2330
|
+
color: E,
|
|
2314
2331
|
shape: "line",
|
|
2315
2332
|
width: 0.2
|
|
2316
2333
|
}
|
|
@@ -2631,7 +2648,7 @@ class Sg {
|
|
|
2631
2648
|
* Find the color of the pin badge background
|
|
2632
2649
|
*/
|
|
2633
2650
|
_findPinBadgeBackgroundColor(e) {
|
|
2634
|
-
return e.isVirtual() ?
|
|
2651
|
+
return e.isVirtual() ? E : "inherit";
|
|
2635
2652
|
}
|
|
2636
2653
|
}
|
|
2637
2654
|
class Ag {
|
|
@@ -2708,11 +2725,11 @@ class Ag {
|
|
|
2708
2725
|
return this.edgesCaptionsRule.refresh();
|
|
2709
2726
|
}
|
|
2710
2727
|
}
|
|
2711
|
-
function
|
|
2728
|
+
function P(r) {
|
|
2712
2729
|
return typeof r == "function";
|
|
2713
2730
|
}
|
|
2714
2731
|
function xg(r) {
|
|
2715
|
-
return
|
|
2732
|
+
return P(r == null ? void 0 : r.lift);
|
|
2716
2733
|
}
|
|
2717
2734
|
function cr(r) {
|
|
2718
2735
|
return function(e) {
|
|
@@ -2824,7 +2841,7 @@ var Ke = function() {
|
|
|
2824
2841
|
else
|
|
2825
2842
|
a.remove(this);
|
|
2826
2843
|
var d = this.initialTeardown;
|
|
2827
|
-
if (
|
|
2844
|
+
if (P(d))
|
|
2828
2845
|
try {
|
|
2829
2846
|
d();
|
|
2830
2847
|
} catch (f) {
|
|
@@ -2887,10 +2904,10 @@ var Ke = function() {
|
|
|
2887
2904
|
}();
|
|
2888
2905
|
Ke.EMPTY;
|
|
2889
2906
|
function Eg(r) {
|
|
2890
|
-
return r instanceof Ke || r && "closed" in r &&
|
|
2907
|
+
return r instanceof Ke || r && "closed" in r && P(r.remove) && P(r.add) && P(r.unsubscribe);
|
|
2891
2908
|
}
|
|
2892
2909
|
function Bt(r) {
|
|
2893
|
-
|
|
2910
|
+
P(r) ? r() : r.unsubscribe();
|
|
2894
2911
|
}
|
|
2895
2912
|
var Fg = {
|
|
2896
2913
|
useDeprecatedNextContext: !1
|
|
@@ -2916,7 +2933,7 @@ var dr = function(r) {
|
|
|
2916
2933
|
Ve(e, r);
|
|
2917
2934
|
function e(t) {
|
|
2918
2935
|
var i = r.call(this) || this;
|
|
2919
|
-
return i.isStopped = !1, t ? (i.destination = t, Eg(t) && t.add(i)) : i.destination =
|
|
2936
|
+
return i.isStopped = !1, t ? (i.destination = t, Eg(t) && t.add(i)) : i.destination = Ig, i;
|
|
2920
2937
|
}
|
|
2921
2938
|
return e.create = function(t, i, n) {
|
|
2922
2939
|
return new Og(t, i, n);
|
|
@@ -2982,7 +2999,7 @@ var Dg = function() {
|
|
|
2982
2999
|
Ve(e, r);
|
|
2983
3000
|
function e(t, i, n) {
|
|
2984
3001
|
var s = r.call(this) || this, a;
|
|
2985
|
-
if (
|
|
3002
|
+
if (P(t) || !t)
|
|
2986
3003
|
a = {
|
|
2987
3004
|
next: t ?? void 0,
|
|
2988
3005
|
error: i ?? void 0,
|
|
@@ -3008,13 +3025,13 @@ function ee(r) {
|
|
|
3008
3025
|
function Lg(r) {
|
|
3009
3026
|
throw r;
|
|
3010
3027
|
}
|
|
3011
|
-
var
|
|
3028
|
+
var Ig = {
|
|
3012
3029
|
closed: !0,
|
|
3013
3030
|
next: zt,
|
|
3014
3031
|
error: Lg,
|
|
3015
3032
|
complete: zt
|
|
3016
3033
|
};
|
|
3017
|
-
function
|
|
3034
|
+
function Pg(r) {
|
|
3018
3035
|
return r;
|
|
3019
3036
|
}
|
|
3020
3037
|
function gr(r, e, t, i, n) {
|
|
@@ -3065,7 +3082,7 @@ function Rg(r, e) {
|
|
|
3065
3082
|
});
|
|
3066
3083
|
}
|
|
3067
3084
|
function Bg(r, e) {
|
|
3068
|
-
return e === void 0 && (e =
|
|
3085
|
+
return e === void 0 && (e = Pg), r = r ?? zg, cr(function(t, i) {
|
|
3069
3086
|
var n, s = !0;
|
|
3070
3087
|
t.subscribe(gr(i, function(a) {
|
|
3071
3088
|
var o = e(a);
|
|
@@ -3315,11 +3332,11 @@ class Xg extends vr {
|
|
|
3315
3332
|
async init(e) {
|
|
3316
3333
|
this.clearGraph();
|
|
3317
3334
|
let t, i = [];
|
|
3318
|
-
const n = e.nodes.map((a) => (a.attributes.selected && (t =
|
|
3335
|
+
const n = e.nodes.map((a) => (a.attributes.selected && (t = I.NODE, i.push(a.id)), delete a.attributes.selected, a)), s = e.edges.map((a) => (a.attributes !== void 0 && (a.attributes.selected && ((t === void 0 || t === I.NODE) && (t = I.EDGE, i = []), i.push(a.id)), delete a.attributes.selected), a));
|
|
3319
3336
|
await this.addGraphAfterValidation({
|
|
3320
3337
|
nodes: n,
|
|
3321
3338
|
edges: s
|
|
3322
|
-
}), t ===
|
|
3339
|
+
}), t === I.NODE ? this.getNodes(i).setSelected(!0) : t === I.EDGE && this.getEdges(i).setSelected(!0);
|
|
3323
3340
|
}
|
|
3324
3341
|
async initVisualization(e) {
|
|
3325
3342
|
await this.init(e);
|
|
@@ -4027,7 +4044,7 @@ const Qg = (r) => r.selection.size, eh = (r) => {
|
|
|
4027
4044
|
}
|
|
4028
4045
|
}, th = (r) => {
|
|
4029
4046
|
if (r.selection.size !== 0)
|
|
4030
|
-
return r.selection.isNode ?
|
|
4047
|
+
return r.selection.isNode ? I.NODE : I.EDGE;
|
|
4031
4048
|
}, qe = (r) => r.selection.size === 1 ? r.selection.get(0) : void 0, rh = (r) => {
|
|
4032
4049
|
const e = qe(r);
|
|
4033
4050
|
if (e !== void 0)
|
|
@@ -4049,14 +4066,14 @@ const Qg = (r) => r.selection.size, eh = (r) => {
|
|
|
4049
4066
|
}, nh = (r) => Wg(r).length > 0;
|
|
4050
4067
|
export {
|
|
4051
4068
|
jg as ANIMATION_DURATION,
|
|
4052
|
-
|
|
4069
|
+
E as BASE_GREY,
|
|
4053
4070
|
w as Captions,
|
|
4054
4071
|
Ag as CaptionsViz,
|
|
4055
4072
|
W as EdgeAttributes,
|
|
4056
|
-
|
|
4073
|
+
Pt as FILTER_OPACITY,
|
|
4057
4074
|
Gt as Filters,
|
|
4058
4075
|
Ce as HTML_COLORS,
|
|
4059
|
-
|
|
4076
|
+
F as ItemAttributes,
|
|
4060
4077
|
De as LKE_NODE_GROUPING_EDGE,
|
|
4061
4078
|
Xg as LKOgma,
|
|
4062
4079
|
U as NodeAttributes,
|