@ucap-llm/ai-ui 1.1.13 → 1.1.15
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/_basePickBy-DMehTBs0-8955b30b.mjs +151 -0
- package/_basePickBy-e7598e72.mjs +153 -0
- package/{_baseUniq-2bcae05e.mjs → _baseUniq-8cd7fbc4.mjs} +150 -150
- package/_baseUniq-DPnX6tpB-5eb6efbd.mjs +615 -0
- package/ai-ui.es.js +9 -8
- package/ai-ui.umd.js +3425 -923
- package/arc-8909f880.mjs +85 -0
- package/arc-qimaJRLH-591a6072.mjs +85 -0
- package/architecture-4AB2E3PP-DFmEpUnA-62fe65dd.mjs +10 -0
- package/architecture-4AB2E3PP-b04ae9dd.mjs +10 -0
- package/{architectureDiagram-IEHRJDOE-e4684ef3.mjs → architectureDiagram-IEHRJDOE-1ccc2c64.mjs} +123 -123
- package/architectureDiagram-IEHRJDOE-BRVAVUEE-c068faae.mjs +4641 -0
- package/{blockDiagram-JOT3LUYC-504ee31e.mjs → blockDiagram-JOT3LUYC-63569de5.mjs} +5 -5
- package/blockDiagram-JOT3LUYC-Cs4tSRey-54d8e29b.mjs +2251 -0
- package/{c4Diagram-VJAJSXHY-c5ba6af4.mjs → c4Diagram-VJAJSXHY-355a4170.mjs} +23 -23
- package/c4Diagram-VJAJSXHY-C3F9fO0L-0df97cd8.mjs +1583 -0
- package/channel-CuHzivgY-bb3d765a.mjs +5 -0
- package/channel-a1f4f18c.mjs +5 -0
- package/{chunk-4BMEZGHF-8d9a2e4f.mjs → chunk-4BMEZGHF-705995af.mjs} +1 -1
- package/chunk-4BMEZGHF-btTOjzEX-c9c5432c.mjs +9 -0
- package/{chunk-A2AXSNBT-41ae29f2.mjs → chunk-A2AXSNBT-3a857566.mjs} +10 -10
- package/chunk-A2AXSNBT-CPBZRsS7-a80df701.mjs +1373 -0
- package/{chunk-AEK57VVT-69e121d6.mjs → chunk-AEK57VVT-6c60e1ee.mjs} +45 -45
- package/chunk-AEK57VVT-D62Iwyam-238a3d85.mjs +1361 -0
- package/{chunk-D6G4REZN-472adc5b.mjs → chunk-D6G4REZN-11c52918.mjs} +5 -5
- package/chunk-D6G4REZN-HlFmQTJy-20704636.mjs +64 -0
- package/chunk-RZ5BOZE2-DIFgOqDt-495bec03.mjs +24 -0
- package/{chunk-RZ5BOZE2-b7d5d4f5.mjs → chunk-RZ5BOZE2-d6db8103.mjs} +9 -9
- package/chunk-XZIHB7SX-CCrbsG0u-f30e4124.mjs +15 -0
- package/{chunk-XZIHB7SX-56c08d07.mjs → chunk-XZIHB7SX-fafd3ca2.mjs} +1 -1
- package/classDiagram-GIVACNV2-Bv5U0XPL-622b22ed.mjs +18 -0
- package/{classDiagram-v2-COTLJTTW-1deea5cc.mjs → classDiagram-GIVACNV2-eca9aeb6.mjs} +5 -5
- package/classDiagram-v2-COTLJTTW-Bv5U0XPL-622b22ed.mjs +18 -0
- package/{classDiagram-GIVACNV2-1deea5cc.mjs → classDiagram-v2-COTLJTTW-eca9aeb6.mjs} +5 -5
- package/{clone-1f18a17f.mjs → clone-327a1426.mjs} +1 -1
- package/clone-Csc9uFbU-6c4f28bd.mjs +8 -0
- package/cytoscape.esm-Swd9B-1A-3101f241.mjs +18730 -0
- package/{dagre-OKDRZEBW-74e73dcf.mjs → dagre-OKDRZEBW-9059bb36.mjs} +81 -81
- package/dagre-OKDRZEBW-CoMQYlxF-96274fb0.mjs +448 -0
- package/{diagram-SSKATNLV-1a562cb0.mjs → diagram-SSKATNLV-70f68e72.mjs} +34 -34
- package/diagram-SSKATNLV-CPuZUaGP-50edcaa0.mjs +225 -0
- package/{diagram-VNBRO52H-b765e46f.mjs → diagram-VNBRO52H-39273710.mjs} +35 -35
- package/diagram-VNBRO52H-DIIZ-Sll-969266e6.mjs +130 -0
- package/{erDiagram-Q7BY3M3F-022c4343.mjs → erDiagram-Q7BY3M3F-96ba3906.mjs} +3 -3
- package/erDiagram-Q7BY3M3F-ZKWAM_uE-41c0350d.mjs +843 -0
- package/{flowDiagram-4HSFHLVR-6036e284.mjs → flowDiagram-4HSFHLVR-795e3830.mjs} +29 -29
- package/flowDiagram-4HSFHLVR-CUJXGEG3-801dde13.mjs +1624 -0
- package/{ganttDiagram-APWFNJXF-be871387.mjs → ganttDiagram-APWFNJXF-736e67b6.mjs} +398 -398
- package/ganttDiagram-APWFNJXF-C1pgubbs-20beffc3.mjs +2527 -0
- package/gitGraph-O2Q2CXLX-00465db9.mjs +10 -0
- package/gitGraph-O2Q2CXLX-BYavwGzs-e5f1990e.mjs +10 -0
- package/{gitGraphDiagram-7IBYFJ6S-da63c888.mjs → gitGraphDiagram-7IBYFJ6S-115329ab.mjs} +88 -88
- package/gitGraphDiagram-7IBYFJ6S-CndxirR4-b39d4089.mjs +716 -0
- package/{graph-e71f0e3e.mjs → graph-9e073c5f.mjs} +8 -8
- package/graph-DOmtxVvg-727f4e14.mjs +247 -0
- package/index-433e2395.mjs +168385 -0
- package/info-4N47QTOZ-688db415.mjs +10 -0
- package/info-4N47QTOZ-DPyDFN1Z-821cf2f7.mjs +10 -0
- package/{infoDiagram-PH2N3AL5-3e1c1c1f.mjs → infoDiagram-PH2N3AL5-29e9585a.mjs} +9 -9
- package/infoDiagram-PH2N3AL5-BkSS3vpU-ef4bf66d.mjs +26 -0
- package/init-DjUOC4st-87c930f1.mjs +16 -0
- package/{journeyDiagram-U35MCT3I-6d29748d.mjs → journeyDiagram-U35MCT3I-7c5644d1.mjs} +41 -41
- package/journeyDiagram-U35MCT3I-BN-kCDeJ-ac350902.mjs +811 -0
- package/{kanban-definition-NDS4AKOZ-c231ae4c.mjs → kanban-definition-NDS4AKOZ-eff441f9.mjs} +47 -47
- package/kanban-definition-NDS4AKOZ-gaDUOiKt-efdba942.mjs +720 -0
- package/{layout-b9b9e407.mjs → layout-501d22f0.mjs} +19 -19
- package/layout-8X5HiOVA-b6e13cf9.mjs +1323 -0
- package/linear-BgV5F0PU-8137edad.mjs +447 -0
- package/{linear-99040ddc.mjs → linear-fd3cd932.mjs} +56 -56
- package/{mermaid-parser.core-55f134dc.mjs → mermaid-parser.core-6eb44241.mjs} +160 -160
- package/mermaid-parser.core-BTS3sfcL-8c80284a.mjs +12810 -0
- package/{mindmap-definition-ALO5MXBD-938e2e65.mjs → mindmap-definition-ALO5MXBD-2fe3c748.mjs} +1 -1
- package/mindmap-definition-ALO5MXBD-B8q_1sIj-c3599d3c.mjs +3225 -0
- package/ordinal-DfAQgscy-1c8e46a9.mjs +65 -0
- package/package.json +2 -2
- package/packet-KVYON367-DcfdOX-U-afac932a.mjs +10 -0
- package/packet-KVYON367-c82af3fe.mjs +10 -0
- package/pie-R6RNRRYF-DKruFncB-d07f60c2.mjs +10 -0
- package/pie-R6RNRRYF-eb27797b.mjs +10 -0
- package/pieDiagram-IB7DONF6-Bijui6_Q-db9fdf3a.mjs +166 -0
- package/{pieDiagram-IB7DONF6-6a11673b.mjs → pieDiagram-IB7DONF6-e6863984.mjs} +36 -36
- package/{quadrantDiagram-7GDLP6J5-a4a4d9ac.mjs → quadrantDiagram-7GDLP6J5-88df12c2.mjs} +15 -15
- package/quadrantDiagram-7GDLP6J5-DzIzViUj-b13add98.mjs +1027 -0
- package/radar-MK3ICKWK-723229d0.mjs +10 -0
- package/radar-MK3ICKWK-D8wbkmr5-3165faf6.mjs +10 -0
- package/{requirementDiagram-KVF5MWMF-a7093c74.mjs → requirementDiagram-KVF5MWMF-7228051c.mjs} +50 -50
- package/requirementDiagram-KVF5MWMF-Hqsbdpfq-23374f24.mjs +853 -0
- package/{sankeyDiagram-QLVOVGJD-f4bcbb2d.mjs → sankeyDiagram-QLVOVGJD-00a31a99.mjs} +87 -87
- package/sankeyDiagram-QLVOVGJD-DGCeusqJ-8ca7e64d.mjs +826 -0
- package/{sequenceDiagram-X6HHIX6F-9071cfff.mjs → sequenceDiagram-X6HHIX6F-de203309.mjs} +3 -3
- package/sequenceDiagram-X6HHIX6F-kuEE9wSd-5f0ec5cd.mjs +2283 -0
- package/{stateDiagram-DGXRK772-fb22a7a5.mjs → stateDiagram-DGXRK772-2341237a.mjs} +48 -48
- package/stateDiagram-DGXRK772-Cq-Ce3WP-266efa7f.mjs +274 -0
- package/{stateDiagram-v2-YXO3MK2T-67326b76.mjs → stateDiagram-v2-YXO3MK2T-8c81deed.mjs} +5 -5
- package/stateDiagram-v2-YXO3MK2T-CplwFWn1-c0024e4e.mjs +18 -0
- package/style.css +10 -1
- package/timeline-definition-BDJGKUSR-USv5sZzx-22548912.mjs +806 -0
- package/{timeline-definition-BDJGKUSR-44f50d45.mjs → timeline-definition-BDJGKUSR-e615901b.mjs} +79 -79
- package/{xychartDiagram-VJFVF3MP-2df503f6.mjs → xychartDiagram-VJFVF3MP-9ad66a6b.mjs} +28 -28
- package/xychartDiagram-VJFVF3MP-CXCfFZBM-e5ca151e.mjs +1306 -0
- package/_basePickBy-12958109.mjs +0 -153
- package/arc-14f9a207.mjs +0 -85
- package/architecture-4AB2E3PP-bb512ddb.mjs +0 -10
- package/channel-7bd711b4.mjs +0 -5
- package/gitGraph-O2Q2CXLX-83cfcbef.mjs +0 -10
- package/index-f83d4b07.mjs +0 -97448
- package/info-4N47QTOZ-20cf90f5.mjs +0 -10
- package/katex-2e45926a.mjs +0 -11700
- package/packet-KVYON367-453a49e8.mjs +0 -10
- package/pie-R6RNRRYF-4d95c8dc.mjs +0 -10
- package/radar-MK3ICKWK-100e8fa4.mjs +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as v, c as P, f as g, d, i as l, v as p, r as D } from "./_baseUniq-
|
|
1
|
+
import { cP as N, cQ as j, cR as f, cS as b, cT as _, cU as E } from "./index-433e2395.mjs";
|
|
2
|
+
import { a as v, c as P, f as g, d, i as l, v as p, r as D } from "./_baseUniq-8cd7fbc4.mjs";
|
|
3
3
|
var w = N(function(o) {
|
|
4
4
|
return v(P(o, 1, j, !0));
|
|
5
5
|
});
|
|
@@ -177,8 +177,8 @@ class L {
|
|
|
177
177
|
if (!l(s) && !this._isMultigraph)
|
|
178
178
|
throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
179
179
|
this.setNode(e), this.setNode(t), this._edgeLabels[h] = r ? i : this._defaultEdgeLabelFn(e, t, s);
|
|
180
|
-
var u =
|
|
181
|
-
return e = u.v, t = u.w, Object.freeze(u), this._edgeObjs[h] = u,
|
|
180
|
+
var u = G(this._isDirected, e, t, s);
|
|
181
|
+
return e = u.v, t = u.w, Object.freeze(u), this._edgeObjs[h] = u, y(this._preds[t], e), y(this._sucs[e], t), this._in[t][h] = u, this._out[e][h] = u, this._edgeCount++, this;
|
|
182
182
|
}
|
|
183
183
|
edge(e, t, s) {
|
|
184
184
|
var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s);
|
|
@@ -190,7 +190,7 @@ class L {
|
|
|
190
190
|
}
|
|
191
191
|
removeEdge(e, t, s) {
|
|
192
192
|
var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s), r = this._edgeObjs[i];
|
|
193
|
-
return r && (e = r.v, t = r.w, delete this._edgeLabels[i], delete this._edgeObjs[i],
|
|
193
|
+
return r && (e = r.v, t = r.w, delete this._edgeLabels[i], delete this._edgeObjs[i], C(this._preds[t], e), C(this._sucs[e], t), delete this._in[t][i], delete this._out[e][i], this._edgeCount--), this;
|
|
194
194
|
}
|
|
195
195
|
inEdges(e, t) {
|
|
196
196
|
var s = this._in[e];
|
|
@@ -218,10 +218,10 @@ class L {
|
|
|
218
218
|
}
|
|
219
219
|
L.prototype._nodeCount = 0;
|
|
220
220
|
L.prototype._edgeCount = 0;
|
|
221
|
-
function
|
|
221
|
+
function y(o, e) {
|
|
222
222
|
o[e] ? o[e]++ : o[e] = 1;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function C(o, e) {
|
|
225
225
|
--o[e] || delete o[e];
|
|
226
226
|
}
|
|
227
227
|
function c(o, e, t, s) {
|
|
@@ -232,7 +232,7 @@ function c(o, e, t, s) {
|
|
|
232
232
|
}
|
|
233
233
|
return i + O + r + O + (l(s) ? M : s);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function G(o, e, t, s) {
|
|
236
236
|
var i = "" + e, r = "" + t;
|
|
237
237
|
if (!o && i > r) {
|
|
238
238
|
var n = i;
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { an as y, az as g, b0 as v, b1 as N, b2 as b } from "./index-433e2395.mjs";
|
|
2
|
+
import { I as L, O as j, d as _, _ as p, $ as d, E as l, S as f, P } from "./_baseUniq-DPnX6tpB-5eb6efbd.mjs";
|
|
3
|
+
var D = y(function(o) {
|
|
4
|
+
return L(j(o, 1, N, !0));
|
|
5
|
+
}), F = "\0", a = "\0", C = "";
|
|
6
|
+
class E {
|
|
7
|
+
constructor(t = {}) {
|
|
8
|
+
this._isDirected = Object.prototype.hasOwnProperty.call(t, "directed") ? t.directed : !0, this._isMultigraph = Object.prototype.hasOwnProperty.call(t, "multigraph") ? t.multigraph : !1, this._isCompound = Object.prototype.hasOwnProperty.call(t, "compound") ? t.compound : !1, this._label = void 0, this._defaultNodeLabelFn = g(void 0), this._defaultEdgeLabelFn = g(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[a] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
|
|
9
|
+
}
|
|
10
|
+
/* === Graph functions ========= */
|
|
11
|
+
isDirected() {
|
|
12
|
+
return this._isDirected;
|
|
13
|
+
}
|
|
14
|
+
isMultigraph() {
|
|
15
|
+
return this._isMultigraph;
|
|
16
|
+
}
|
|
17
|
+
isCompound() {
|
|
18
|
+
return this._isCompound;
|
|
19
|
+
}
|
|
20
|
+
setGraph(t) {
|
|
21
|
+
return this._label = t, this;
|
|
22
|
+
}
|
|
23
|
+
graph() {
|
|
24
|
+
return this._label;
|
|
25
|
+
}
|
|
26
|
+
/* === Node functions ========== */
|
|
27
|
+
setDefaultNodeLabel(t) {
|
|
28
|
+
return v(t) || (t = g(t)), this._defaultNodeLabelFn = t, this;
|
|
29
|
+
}
|
|
30
|
+
nodeCount() {
|
|
31
|
+
return this._nodeCount;
|
|
32
|
+
}
|
|
33
|
+
nodes() {
|
|
34
|
+
return _(this._nodes);
|
|
35
|
+
}
|
|
36
|
+
sources() {
|
|
37
|
+
var t = this;
|
|
38
|
+
return p(this.nodes(), function(e) {
|
|
39
|
+
return b(t._in[e]);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
sinks() {
|
|
43
|
+
var t = this;
|
|
44
|
+
return p(this.nodes(), function(e) {
|
|
45
|
+
return b(t._out[e]);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
setNodes(t, e) {
|
|
49
|
+
var s = arguments, i = this;
|
|
50
|
+
return d(t, function(r) {
|
|
51
|
+
s.length > 1 ? i.setNode(r, e) : i.setNode(r);
|
|
52
|
+
}), this;
|
|
53
|
+
}
|
|
54
|
+
setNode(t, e) {
|
|
55
|
+
return Object.prototype.hasOwnProperty.call(this._nodes, t) ? (arguments.length > 1 && (this._nodes[t] = e), this) : (this._nodes[t] = arguments.length > 1 ? e : this._defaultNodeLabelFn(t), this._isCompound && (this._parent[t] = a, this._children[t] = {}, this._children[a][t] = !0), this._in[t] = {}, this._preds[t] = {}, this._out[t] = {}, this._sucs[t] = {}, ++this._nodeCount, this);
|
|
56
|
+
}
|
|
57
|
+
node(t) {
|
|
58
|
+
return this._nodes[t];
|
|
59
|
+
}
|
|
60
|
+
hasNode(t) {
|
|
61
|
+
return Object.prototype.hasOwnProperty.call(this._nodes, t);
|
|
62
|
+
}
|
|
63
|
+
removeNode(t) {
|
|
64
|
+
if (Object.prototype.hasOwnProperty.call(this._nodes, t)) {
|
|
65
|
+
var e = (s) => this.removeEdge(this._edgeObjs[s]);
|
|
66
|
+
delete this._nodes[t], this._isCompound && (this._removeFromParentsChildList(t), delete this._parent[t], d(this.children(t), (s) => {
|
|
67
|
+
this.setParent(s);
|
|
68
|
+
}), delete this._children[t]), d(_(this._in[t]), e), delete this._in[t], delete this._preds[t], d(_(this._out[t]), e), delete this._out[t], delete this._sucs[t], --this._nodeCount;
|
|
69
|
+
}
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
setParent(t, e) {
|
|
73
|
+
if (!this._isCompound)
|
|
74
|
+
throw new Error("Cannot set parent in a non-compound graph");
|
|
75
|
+
if (l(e))
|
|
76
|
+
e = a;
|
|
77
|
+
else {
|
|
78
|
+
e += "";
|
|
79
|
+
for (var s = e; !l(s); s = this.parent(s))
|
|
80
|
+
if (s === t)
|
|
81
|
+
throw new Error("Setting " + e + " as parent of " + t + " would create a cycle");
|
|
82
|
+
this.setNode(e);
|
|
83
|
+
}
|
|
84
|
+
return this.setNode(t), this._removeFromParentsChildList(t), this._parent[t] = e, this._children[e][t] = !0, this;
|
|
85
|
+
}
|
|
86
|
+
_removeFromParentsChildList(t) {
|
|
87
|
+
delete this._children[this._parent[t]][t];
|
|
88
|
+
}
|
|
89
|
+
parent(t) {
|
|
90
|
+
if (this._isCompound) {
|
|
91
|
+
var e = this._parent[t];
|
|
92
|
+
if (e !== a)
|
|
93
|
+
return e;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
children(t) {
|
|
97
|
+
if (l(t) && (t = a), this._isCompound) {
|
|
98
|
+
var e = this._children[t];
|
|
99
|
+
if (e)
|
|
100
|
+
return _(e);
|
|
101
|
+
} else {
|
|
102
|
+
if (t === a)
|
|
103
|
+
return this.nodes();
|
|
104
|
+
if (this.hasNode(t))
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
predecessors(t) {
|
|
109
|
+
var e = this._preds[t];
|
|
110
|
+
if (e)
|
|
111
|
+
return _(e);
|
|
112
|
+
}
|
|
113
|
+
successors(t) {
|
|
114
|
+
var e = this._sucs[t];
|
|
115
|
+
if (e)
|
|
116
|
+
return _(e);
|
|
117
|
+
}
|
|
118
|
+
neighbors(t) {
|
|
119
|
+
var e = this.predecessors(t);
|
|
120
|
+
if (e)
|
|
121
|
+
return D(e, this.successors(t));
|
|
122
|
+
}
|
|
123
|
+
isLeaf(t) {
|
|
124
|
+
var e;
|
|
125
|
+
return this.isDirected() ? e = this.successors(t) : e = this.neighbors(t), e.length === 0;
|
|
126
|
+
}
|
|
127
|
+
filterNodes(t) {
|
|
128
|
+
var e = new this.constructor({
|
|
129
|
+
directed: this._isDirected,
|
|
130
|
+
multigraph: this._isMultigraph,
|
|
131
|
+
compound: this._isCompound
|
|
132
|
+
});
|
|
133
|
+
e.setGraph(this.graph());
|
|
134
|
+
var s = this;
|
|
135
|
+
d(this._nodes, function(n, h) {
|
|
136
|
+
t(h) && e.setNode(h, n);
|
|
137
|
+
}), d(this._edgeObjs, function(n) {
|
|
138
|
+
e.hasNode(n.v) && e.hasNode(n.w) && e.setEdge(n, s.edge(n));
|
|
139
|
+
});
|
|
140
|
+
var i = {};
|
|
141
|
+
function r(n) {
|
|
142
|
+
var h = s.parent(n);
|
|
143
|
+
return h === void 0 || e.hasNode(h) ? (i[n] = h, h) : h in i ? i[h] : r(h);
|
|
144
|
+
}
|
|
145
|
+
return this._isCompound && d(e.nodes(), function(n) {
|
|
146
|
+
e.setParent(n, r(n));
|
|
147
|
+
}), e;
|
|
148
|
+
}
|
|
149
|
+
/* === Edge functions ========== */
|
|
150
|
+
setDefaultEdgeLabel(t) {
|
|
151
|
+
return v(t) || (t = g(t)), this._defaultEdgeLabelFn = t, this;
|
|
152
|
+
}
|
|
153
|
+
edgeCount() {
|
|
154
|
+
return this._edgeCount;
|
|
155
|
+
}
|
|
156
|
+
edges() {
|
|
157
|
+
return f(this._edgeObjs);
|
|
158
|
+
}
|
|
159
|
+
setPath(t, e) {
|
|
160
|
+
var s = this, i = arguments;
|
|
161
|
+
return P(t, function(r, n) {
|
|
162
|
+
return i.length > 1 ? s.setEdge(r, n, e) : s.setEdge(r, n), n;
|
|
163
|
+
}), this;
|
|
164
|
+
}
|
|
165
|
+
/*
|
|
166
|
+
* setEdge(v, w, [value, [name]])
|
|
167
|
+
* setEdge({ v, w, [name] }, [value])
|
|
168
|
+
*/
|
|
169
|
+
setEdge() {
|
|
170
|
+
var t, e, s, i, r = !1, n = arguments[0];
|
|
171
|
+
typeof n == "object" && n !== null && "v" in n ? (t = n.v, e = n.w, s = n.name, arguments.length === 2 && (i = arguments[1], r = !0)) : (t = n, e = arguments[1], s = arguments[3], arguments.length > 2 && (i = arguments[2], r = !0)), t = "" + t, e = "" + e, l(s) || (s = "" + s);
|
|
172
|
+
var h = c(this._isDirected, t, e, s);
|
|
173
|
+
if (Object.prototype.hasOwnProperty.call(this._edgeLabels, h))
|
|
174
|
+
return r && (this._edgeLabels[h] = i), this;
|
|
175
|
+
if (!l(s) && !this._isMultigraph)
|
|
176
|
+
throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
177
|
+
this.setNode(t), this.setNode(e), this._edgeLabels[h] = r ? i : this._defaultEdgeLabelFn(t, e, s);
|
|
178
|
+
var u = M(this._isDirected, t, e, s);
|
|
179
|
+
return t = u.v, e = u.w, Object.freeze(u), this._edgeObjs[h] = u, O(this._preds[e], t), O(this._sucs[t], e), this._in[e][h] = u, this._out[t][h] = u, this._edgeCount++, this;
|
|
180
|
+
}
|
|
181
|
+
edge(t, e, s) {
|
|
182
|
+
var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, t, e, s);
|
|
183
|
+
return this._edgeLabels[i];
|
|
184
|
+
}
|
|
185
|
+
hasEdge(t, e, s) {
|
|
186
|
+
var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, t, e, s);
|
|
187
|
+
return Object.prototype.hasOwnProperty.call(this._edgeLabels, i);
|
|
188
|
+
}
|
|
189
|
+
removeEdge(t, e, s) {
|
|
190
|
+
var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, t, e, s), r = this._edgeObjs[i];
|
|
191
|
+
return r && (t = r.v, e = r.w, delete this._edgeLabels[i], delete this._edgeObjs[i], w(this._preds[e], t), w(this._sucs[t], e), delete this._in[e][i], delete this._out[t][i], this._edgeCount--), this;
|
|
192
|
+
}
|
|
193
|
+
inEdges(t, e) {
|
|
194
|
+
var s = this._in[t];
|
|
195
|
+
if (s) {
|
|
196
|
+
var i = f(s);
|
|
197
|
+
return e ? p(i, function(r) {
|
|
198
|
+
return r.v === e;
|
|
199
|
+
}) : i;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
outEdges(t, e) {
|
|
203
|
+
var s = this._out[t];
|
|
204
|
+
if (s) {
|
|
205
|
+
var i = f(s);
|
|
206
|
+
return e ? p(i, function(r) {
|
|
207
|
+
return r.w === e;
|
|
208
|
+
}) : i;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
nodeEdges(t, e) {
|
|
212
|
+
var s = this.inEdges(t, e);
|
|
213
|
+
if (s)
|
|
214
|
+
return s.concat(this.outEdges(t, e));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
E.prototype._nodeCount = 0;
|
|
218
|
+
E.prototype._edgeCount = 0;
|
|
219
|
+
function O(o, t) {
|
|
220
|
+
o[t] ? o[t]++ : o[t] = 1;
|
|
221
|
+
}
|
|
222
|
+
function w(o, t) {
|
|
223
|
+
--o[t] || delete o[t];
|
|
224
|
+
}
|
|
225
|
+
function c(o, t, e, s) {
|
|
226
|
+
var i = "" + t, r = "" + e;
|
|
227
|
+
if (!o && i > r) {
|
|
228
|
+
var n = i;
|
|
229
|
+
i = r, r = n;
|
|
230
|
+
}
|
|
231
|
+
return i + C + r + C + (l(s) ? F : s);
|
|
232
|
+
}
|
|
233
|
+
function M(o, t, e, s) {
|
|
234
|
+
var i = "" + t, r = "" + e;
|
|
235
|
+
if (!o && i > r) {
|
|
236
|
+
var n = i;
|
|
237
|
+
i = r, r = n;
|
|
238
|
+
}
|
|
239
|
+
var h = { v: i, w: r };
|
|
240
|
+
return s && (h.name = s), h;
|
|
241
|
+
}
|
|
242
|
+
function m(o, t) {
|
|
243
|
+
return c(o, t.v, t.w, t.name);
|
|
244
|
+
}
|
|
245
|
+
export {
|
|
246
|
+
E as L
|
|
247
|
+
};
|