react-kggraph 0.0.17 → 0.0.19
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/README.md +197 -9
- package/lib/index.es.js +8 -6
- package/lib/index.es10.js +186 -69
- package/lib/index.es11.js +69 -28
- package/lib/index.es12.js +29 -69
- package/lib/index.es13.js +64 -224
- package/lib/index.es14.js +69 -4
- package/lib/index.es15.js +4 -35
- package/lib/index.es16.js +37 -0
- package/lib/index.es18.js +15462 -49
- package/lib/index.es19.js +50 -56
- package/lib/index.es20.js +57 -66
- package/lib/index.es21.js +68 -39
- package/lib/index.es22.js +40 -2
- package/lib/index.es23.js +1 -1
- package/lib/index.es24.js +2 -2
- package/lib/index.es25.js +1 -1
- package/lib/index.es26.js +1 -1
- package/lib/index.es27.js +1 -1
- package/lib/index.es28.js +1 -1
- package/lib/index.es29.js +1 -1
- package/lib/index.es3.js +201 -182
- package/lib/index.es30.js +1 -1
- package/lib/index.es31.js +1 -1
- package/lib/index.es32.js +2 -2
- package/lib/index.es33.js +4 -0
- package/lib/index.es35.js +4 -2
- package/lib/index.es36.js +4 -0
- package/lib/index.es4.js +17 -6
- package/lib/index.es5.js +6 -2
- package/lib/index.es6.js +2 -599
- package/lib/index.es7.js +578 -312
- package/lib/index.es8.js +294 -393
- package/lib/index.es9.js +408 -173
- package/lib/src/components/Graph/components/ActionBar/actionList.d.ts +10 -0
- package/lib/src/components/Graph/components/ActionBar/index.d.ts +15 -0
- package/lib/src/components/Graph/components/SettingCircle/index.d.ts +4 -2
- package/lib/src/components/Graph/types.d.ts +62 -1
- package/lib/src/components/Graph/utils/edge_node_styles.d.ts +5 -2
- package/lib/src/components/Graph/utils/menuItems.d.ts +12 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/lib/index.es17.js +0 -15469
- package/lib/index.es34.js +0 -6
package/lib/index.es3.js
CHANGED
|
@@ -1,64 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { jsx as f, jsxs as te } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as N, useState as h, useEffect as S } from "react";
|
|
3
|
+
import k from "cytoscape";
|
|
4
|
+
import xe from "cytoscape-cose-bilkent";
|
|
5
|
+
import Ne from "cytoscape-cise";
|
|
6
|
+
import Ce from "cytoscape-fcose";
|
|
7
|
+
import ke from "storm-layout";
|
|
8
|
+
import ze from "./index.es7.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import { handleCalcPath as
|
|
11
|
-
import { fixNodesToEdges as
|
|
12
|
-
import { edgeNodeStyles as
|
|
13
|
-
import
|
|
14
|
-
import { message as
|
|
15
|
-
import { menuItemsConfig as
|
|
16
|
-
import { jsonStringify as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { GraphProvider as
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
data:
|
|
28
|
-
getAllGraphData:
|
|
29
|
-
highPathAnalysis:
|
|
30
|
-
graphInfo:
|
|
31
|
-
stepNextApi:
|
|
32
|
-
knowledgeCardApi:
|
|
10
|
+
import { handleCalcPath as Ee, resDetailData as F } from "./index.es8.js";
|
|
11
|
+
import { fixNodesToEdges as we, coseBilkentLayout as oe } from "./index.es9.js";
|
|
12
|
+
import { edgeNodeStyles as Le, defaultColors as ne } from "./index.es10.js";
|
|
13
|
+
import Re from "cytoscape-layout-utilities";
|
|
14
|
+
import { message as C } from "antd";
|
|
15
|
+
import { menuItemsConfig as je } from "./index.es11.js";
|
|
16
|
+
import { jsonStringify as R } from "./index.es12.js";
|
|
17
|
+
import Te from "./index.es13.js";
|
|
18
|
+
import $e from "./index.es14.js";
|
|
19
|
+
import { GraphProvider as De } from "./index.es15.js";
|
|
20
|
+
import Oe from "./index.es16.js";
|
|
21
|
+
k.use(Re);
|
|
22
|
+
k.use(Ne);
|
|
23
|
+
k.use(Ce);
|
|
24
|
+
k.use(ke);
|
|
25
|
+
k.use(xe);
|
|
26
|
+
const tt = ({
|
|
27
|
+
data: se,
|
|
28
|
+
getAllGraphData: I,
|
|
29
|
+
highPathAnalysis: z = [],
|
|
30
|
+
graphInfo: m,
|
|
31
|
+
stepNextApi: de,
|
|
32
|
+
knowledgeCardApi: re,
|
|
33
|
+
colors: E,
|
|
34
|
+
actionBar: ae,
|
|
35
|
+
actionCircle: ie
|
|
33
36
|
}) => {
|
|
34
|
-
var
|
|
35
|
-
const
|
|
37
|
+
var _, G;
|
|
38
|
+
const j = N(null), [b, P] = h([]), c = N(null), K = N(null), X = 1, [Se, J] = h(!1), [w, B] = h({}), [T, W] = h({}), [le, ce] = h("cose-bilkent"), Q = N(null), V = N(null), [pe, Y] = h(["", ""]), H = N(E);
|
|
39
|
+
S(() => {
|
|
40
|
+
H.current = E;
|
|
41
|
+
}, [E]);
|
|
42
|
+
const [p, L] = h({
|
|
36
43
|
visible: !1,
|
|
37
44
|
x: 0,
|
|
38
45
|
y: 0,
|
|
39
46
|
targetNode: null,
|
|
40
47
|
bgColor: ""
|
|
41
|
-
}), [
|
|
48
|
+
}), [$, Z] = h({
|
|
42
49
|
visible: !1,
|
|
43
50
|
x: 0,
|
|
44
51
|
y: 0,
|
|
45
52
|
content: ""
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
(
|
|
49
|
-
}, [
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
var
|
|
53
|
-
if (!
|
|
54
|
-
const { elements:
|
|
55
|
-
|
|
53
|
+
}), ue = je({ cyRef: c, setContextMenu: L, onPathAnalysis: (_ = K.current) == null ? void 0 : _.onPathAnalysis, setPathNodes: Y, actionCircle: ie });
|
|
54
|
+
S(() => {
|
|
55
|
+
(z == null ? void 0 : z.length) > 1 && Ee(c, { pathNodes: z, isGrayed: !1 });
|
|
56
|
+
}, [R(z), R(b)]), S(() => {
|
|
57
|
+
I == null || I({ graphData: b, nodeStatic: w, relationStatic: T });
|
|
58
|
+
}, [R(b), R(w), R(T)]), S(() => {
|
|
59
|
+
var r;
|
|
60
|
+
if (!j.current || c.current) return;
|
|
61
|
+
const { elements: s, typeListObj: a, relationListObj: u } = F(se, { typeObj: w, graphInfo: m });
|
|
62
|
+
B(a), P(s), W(u), document.addEventListener("contextmenu", function(t) {
|
|
56
63
|
t.preventDefault();
|
|
57
64
|
});
|
|
58
|
-
const e =
|
|
59
|
-
container:
|
|
60
|
-
elements:
|
|
61
|
-
style:
|
|
65
|
+
const e = k({
|
|
66
|
+
container: j.current,
|
|
67
|
+
elements: s,
|
|
68
|
+
style: Le({ elements: s, colors: E }),
|
|
62
69
|
autounselectify: !1,
|
|
63
70
|
autolock: !1,
|
|
64
71
|
layout: {
|
|
@@ -66,146 +73,156 @@ const Ye = ({
|
|
|
66
73
|
// 使用预设布局,完全依赖 position
|
|
67
74
|
}
|
|
68
75
|
});
|
|
69
|
-
if (
|
|
70
|
-
|
|
76
|
+
if (c.current = e, ((r = m == null ? void 0 : m.searchNodes) == null ? void 0 : r.length) === 2)
|
|
77
|
+
we(
|
|
71
78
|
e,
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
m.searchNodes[0],
|
|
80
|
+
m.searchNodes[1]
|
|
74
81
|
);
|
|
75
82
|
else {
|
|
76
|
-
const t = e.layout(
|
|
83
|
+
const t = e.layout(oe());
|
|
77
84
|
t.run(), t.on("layoutstop", () => {
|
|
78
85
|
e.fit(void 0, 50), e.center();
|
|
79
86
|
});
|
|
80
87
|
}
|
|
81
88
|
return e.on("mouseover", "edge", (t) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
var n;
|
|
90
|
+
const o = t.target;
|
|
91
|
+
if (!o.hasClass("path-edge")) {
|
|
92
|
+
const d = ((n = H.current) == null ? void 0 : n.edgeHoverColor) ?? ne.edgeHoverColor;
|
|
93
|
+
o.style({
|
|
94
|
+
"line-color": d,
|
|
95
|
+
"target-arrow-color": d,
|
|
96
|
+
opacity: 0.8
|
|
97
|
+
});
|
|
98
|
+
}
|
|
87
99
|
}), e.on("mouseout", "edge", (t) => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
100
|
+
var n;
|
|
101
|
+
const o = t.target;
|
|
102
|
+
if (!o.hasClass("path-edge")) {
|
|
103
|
+
const d = ((n = H.current) == null ? void 0 : n.edgeDefaultColor) ?? ne.edgeDefaultColor;
|
|
104
|
+
o.style({
|
|
105
|
+
"line-color": d,
|
|
106
|
+
"target-arrow-color": d,
|
|
107
|
+
opacity: 1
|
|
108
|
+
});
|
|
109
|
+
}
|
|
93
110
|
}), e.on("mouseover", "node", (t) => {
|
|
94
|
-
const
|
|
95
|
-
|
|
111
|
+
const o = t.target;
|
|
112
|
+
o.hasClass("selected") || o.addClass("hover");
|
|
96
113
|
}), e.on("mouseover", "node", (t) => {
|
|
97
|
-
const
|
|
98
|
-
|
|
114
|
+
const o = t.target, n = o.renderedPosition(), d = o.data("name") || "";
|
|
115
|
+
o.addClass("hover"), Z({
|
|
99
116
|
visible: !0,
|
|
100
117
|
x: n.x,
|
|
101
118
|
y: n.y - 60,
|
|
102
|
-
content:
|
|
119
|
+
content: d
|
|
103
120
|
});
|
|
104
121
|
}), e.on("mouseout", "node", (t) => {
|
|
105
|
-
t.target.removeClass("hover"),
|
|
122
|
+
t.target.removeClass("hover"), Z((n) => ({ ...n, visible: !1 }));
|
|
106
123
|
}), e.on("cxttap", "node", (t) => {
|
|
107
124
|
t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation(), t.originalEvent && (t.originalEvent.preventDefault(), t.originalEvent.stopPropagation(), t.originalEvent.stopImmediatePropagation());
|
|
108
|
-
const
|
|
109
|
-
console.log("renderedPos:::",
|
|
125
|
+
const o = t.target, n = o.renderedPosition();
|
|
126
|
+
console.log("renderedPos:::", o.data(), o.style("background-color")), L({
|
|
110
127
|
visible: !0,
|
|
111
128
|
x: n.x - 90,
|
|
112
129
|
y: n.y - 90,
|
|
113
|
-
targetNode:
|
|
114
|
-
bgColor:
|
|
130
|
+
targetNode: o,
|
|
131
|
+
bgColor: o.style("background-color")
|
|
115
132
|
});
|
|
116
|
-
}),
|
|
117
|
-
const
|
|
118
|
-
e.nodes().removeClass("selected grayed highlighted"), e.edges().removeClass("selected grayed highlighted"),
|
|
119
|
-
const
|
|
120
|
-
console.log("cy.nodes().not(relatedNodes):::",
|
|
133
|
+
}), c.current = e, e.on("click", "node", (t) => {
|
|
134
|
+
const o = t.target;
|
|
135
|
+
e.nodes().removeClass("selected grayed highlighted"), e.edges().removeClass("selected grayed highlighted"), o.addClass("selected");
|
|
136
|
+
const d = o.neighborhood().nodes().add(o), x = d.edgesWith(d);
|
|
137
|
+
console.log("cy.nodes().not(relatedNodes):::", d), e.nodes().not(d).addClass("grayed"), e.edges().not(x).addClass("grayed"), d.addClass("highlighted"), x.addClass("highlighted");
|
|
121
138
|
}), e.on("tap", (t) => {
|
|
122
|
-
t.target === e && (
|
|
139
|
+
t.target === e && (L((o) => ({ ...o, visible: !1 })), e.nodes().removeClass("grayed highlighted highlight selected correlationStyle path-node level-highlight level-selected level-grayed"), e.edges().removeClass("grayed highlighted highlight selected correlationStyle path-edge level-highlightedge level-grayed"));
|
|
123
140
|
}), () => {
|
|
124
|
-
|
|
141
|
+
c.current && (c.current.destroy(), c.current = null);
|
|
125
142
|
};
|
|
126
143
|
}, []);
|
|
127
|
-
const
|
|
128
|
-
const { id:
|
|
144
|
+
const ge = async (s) => {
|
|
145
|
+
const { id: a, kgId: u } = s, e = c.current;
|
|
129
146
|
if (!e) return;
|
|
130
|
-
const
|
|
131
|
-
if (!
|
|
147
|
+
const r = e.$(`#${a}`);
|
|
148
|
+
if (!r || r.length === 0) {
|
|
132
149
|
console.error("当前节点不存在");
|
|
133
150
|
return;
|
|
134
151
|
}
|
|
135
|
-
const t = e.nodes().filter((n) => n.data("parentId") ? (n.data("parentId") ===
|
|
152
|
+
const t = e.nodes().filter((n) => n.data("parentId") ? (n.data("parentId") === a || n.data("idLabel") === `${a}-${n.data("name")}`) && n.data("zktype") === s.zktype : !1);
|
|
136
153
|
if (t.length > 0) {
|
|
137
|
-
const n = t.map((l) => l.id()),
|
|
138
|
-
(l) => l.data("source") ===
|
|
139
|
-
),
|
|
154
|
+
const n = t.map((l) => l.id()), d = t.connectedEdges(), x = e.edges().filter(
|
|
155
|
+
(l) => l.data("source") === a && n.includes(l.data("target"))
|
|
156
|
+
), D = e.edges().filter((l) => l.data("appendedBy") === a), M = d.merge(x).merge(D).filter((l) => l.data().zktype === s.zktype);
|
|
140
157
|
t.animate({
|
|
141
158
|
style: { opacity: 0 }
|
|
142
159
|
}, {
|
|
143
160
|
duration: 200,
|
|
144
161
|
complete: () => {
|
|
145
|
-
e.remove(t), e.remove(
|
|
146
|
-
const
|
|
147
|
-
var
|
|
148
|
-
const i =
|
|
149
|
-
if (
|
|
162
|
+
e.remove(t), e.remove(M), P((l) => {
|
|
163
|
+
const O = l.filter((y) => {
|
|
164
|
+
var v, ee;
|
|
165
|
+
const i = y.data.zktype;
|
|
166
|
+
if (y.group === "nodes" && n.includes((v = y.data) == null ? void 0 : v.id) && i && i === s.zktype)
|
|
150
167
|
return !1;
|
|
151
|
-
if (
|
|
152
|
-
const
|
|
153
|
-
const
|
|
154
|
-
return `${
|
|
155
|
-
}),
|
|
156
|
-
return !
|
|
168
|
+
if (y.group === "edges" && i && i === s.zktype) {
|
|
169
|
+
const me = Array.from(D).map((be) => {
|
|
170
|
+
const A = be.data();
|
|
171
|
+
return `${A.source}-${A.target}-${A.label}`;
|
|
172
|
+
}), q = y.data, he = me.includes(`${q.source}-${q.target}-${q.label}`), ve = ((ee = y.data) == null ? void 0 : ee.appendedBy) === a;
|
|
173
|
+
return !he && !ve;
|
|
157
174
|
}
|
|
158
175
|
return !0;
|
|
159
|
-
}), { typeListObj: g, relationListObj:
|
|
160
|
-
return
|
|
161
|
-
}),
|
|
176
|
+
}), { typeListObj: g, relationListObj: U } = F({}, { graphData: O, typeObj: {} });
|
|
177
|
+
return B(g), W(U), O;
|
|
178
|
+
}), r.data("appendedNodes", []), r.data("isExpanded", !1);
|
|
162
179
|
}
|
|
163
180
|
}), setTimeout(() => {
|
|
164
|
-
|
|
181
|
+
r.removed() || (r.style("border-width", ""), r.style("border-color", ""));
|
|
165
182
|
}, 300);
|
|
166
183
|
} else {
|
|
167
184
|
try {
|
|
168
|
-
|
|
185
|
+
J(!0), C.open({
|
|
169
186
|
type: "loading",
|
|
170
187
|
content: "正在展开...",
|
|
171
188
|
duration: 0
|
|
172
189
|
});
|
|
173
|
-
const n = await
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
|
|
190
|
+
const n = await de({ uri: a, queryType: 1, kgId: u, zktype: s.zktype }), { elements: d, typeListObj: x, relationListObj: D } = F(n.data, { graphData: b, typeObj: w, relationObj: T, zktype: s.zktype });
|
|
191
|
+
if (B(x), W(D), !((d == null ? void 0 : d.length) > 0)) {
|
|
192
|
+
setTimeout(() => {
|
|
193
|
+
C.destroy(), C.warning("暂无数据");
|
|
177
194
|
}, 2e3);
|
|
178
195
|
return;
|
|
179
196
|
}
|
|
180
|
-
if ((
|
|
181
|
-
const
|
|
182
|
-
...
|
|
197
|
+
if ((d == null ? void 0 : d.length) > 0) {
|
|
198
|
+
const M = e.layoutUtilities({
|
|
199
|
+
...oe(),
|
|
183
200
|
idealEdgeLength: 80,
|
|
184
201
|
// 与你的期望边长匹配
|
|
185
202
|
offset: 30
|
|
186
203
|
// 随机偏移,避免完全重叠
|
|
187
|
-
}), l =
|
|
204
|
+
}), l = d.map((i) => {
|
|
188
205
|
if (i.group === "nodes") {
|
|
189
|
-
const
|
|
206
|
+
const v = 80 * X;
|
|
190
207
|
return {
|
|
191
208
|
...i,
|
|
192
209
|
style: {
|
|
193
210
|
opacity: 0,
|
|
194
|
-
width:
|
|
195
|
-
height:
|
|
211
|
+
width: v,
|
|
212
|
+
height: v
|
|
196
213
|
},
|
|
197
214
|
data: {
|
|
198
215
|
...i.data,
|
|
199
|
-
parentId:
|
|
216
|
+
parentId: a,
|
|
200
217
|
// 标记父节点
|
|
201
|
-
appendedBy:
|
|
218
|
+
appendedBy: a,
|
|
202
219
|
// 标记由谁追加
|
|
203
|
-
idLabel:
|
|
204
|
-
zktype:
|
|
220
|
+
idLabel: a + "-" + i.data.label,
|
|
221
|
+
zktype: s.zktype,
|
|
205
222
|
isAppended: !0,
|
|
206
223
|
// 标记是追加节点
|
|
207
|
-
baseWidth:
|
|
208
|
-
baseHeight:
|
|
224
|
+
baseWidth: v,
|
|
225
|
+
baseHeight: v
|
|
209
226
|
}
|
|
210
227
|
};
|
|
211
228
|
}
|
|
@@ -213,16 +230,16 @@ const Ye = ({
|
|
|
213
230
|
...i,
|
|
214
231
|
data: {
|
|
215
232
|
...i.data,
|
|
216
|
-
appendedBy:
|
|
217
|
-
zktype:
|
|
233
|
+
appendedBy: a,
|
|
234
|
+
zktype: s.zktype
|
|
218
235
|
}
|
|
219
236
|
};
|
|
220
|
-
}),
|
|
221
|
-
|
|
222
|
-
const g =
|
|
223
|
-
|
|
224
|
-
const
|
|
225
|
-
|
|
237
|
+
}), O = e.add(l);
|
|
238
|
+
P([...b, ...l]);
|
|
239
|
+
const g = O.filter(":node"), U = g.map((i) => i.id());
|
|
240
|
+
r.data("appendedNodes", U), r.data("isExpanded", !0);
|
|
241
|
+
const y = e.nodes().difference(g);
|
|
242
|
+
y.forEach((i) => i.lock()), M.placeNewNodes(g), e.layout({
|
|
226
243
|
name: "cose-bilkent",
|
|
227
244
|
randomize: !1,
|
|
228
245
|
// ⚠️ 这是关键!保持已有节点位置不变
|
|
@@ -238,7 +255,7 @@ const Ye = ({
|
|
|
238
255
|
// 可以适当减少,因为只需要微调
|
|
239
256
|
gravity: 0.6
|
|
240
257
|
}).run(), setTimeout(() => {
|
|
241
|
-
|
|
258
|
+
y.forEach((i) => i.unlock());
|
|
242
259
|
}, 2e3), g.animate({
|
|
243
260
|
style: {
|
|
244
261
|
opacity: 1,
|
|
@@ -252,67 +269,69 @@ const Ye = ({
|
|
|
252
269
|
g.style("opacity", ""), g.style("width", ""), g.style("height", "");
|
|
253
270
|
}
|
|
254
271
|
}), setTimeout(() => {
|
|
255
|
-
|
|
272
|
+
r.removed() || (r.style("border-width", ""), r.style("border-color", ""), e.center(r), e.zoom(e.zoom()));
|
|
256
273
|
}, 600);
|
|
257
274
|
} else
|
|
258
275
|
console.log("没有找到相关节点数据");
|
|
276
|
+
C.destroy();
|
|
259
277
|
} catch (n) {
|
|
260
|
-
console.error("请求接口失败:", n);
|
|
278
|
+
C.destroy(), C.error("请求接口失败"), console.error("22请求接口失败:", n);
|
|
261
279
|
}
|
|
262
|
-
|
|
280
|
+
J(!1);
|
|
263
281
|
}
|
|
264
|
-
|
|
265
|
-
},
|
|
282
|
+
L({ visible: !1 });
|
|
283
|
+
}, ye = {
|
|
266
284
|
expanded: "typed-literal",
|
|
267
285
|
contract: "uri"
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
286
|
+
}, fe = (s, a) => {
|
|
287
|
+
var e;
|
|
288
|
+
console.log("handleMenuAction:::", s, a);
|
|
289
|
+
const u = a || p.targetNode;
|
|
290
|
+
if (u) {
|
|
291
|
+
const r = s.ids, t = u.data();
|
|
292
|
+
if (["expanded", "contract"].includes(r))
|
|
293
|
+
ge({ kgId: 3, ...t, zktype: ye[r] });
|
|
294
|
+
else if (r === "nodeInfo") {
|
|
295
|
+
const o = u, n = {
|
|
296
|
+
id: o.id(),
|
|
297
|
+
data: o.data(),
|
|
298
|
+
position: o.position(),
|
|
299
|
+
degree: o.degree(),
|
|
300
|
+
inDegree: o.degree(!0),
|
|
301
|
+
outDegree: o.degree(!1),
|
|
302
|
+
classes: o.classes(),
|
|
303
|
+
style: o.style()
|
|
284
304
|
};
|
|
285
|
-
|
|
286
|
-
} else
|
|
287
|
-
|
|
288
|
-
J.current.open(e.data());
|
|
289
|
-
}
|
|
290
|
-
o.action(c.targetNode), C({ visible: !1, x: 0, y: 0, targetNode: null });
|
|
305
|
+
Q.current.open(n);
|
|
306
|
+
} else r === "knowledgeCard" && V.current.open(u.data());
|
|
307
|
+
(e = s.onClick) == null || e.call(s, u), L({ visible: !1, x: 0, y: 0, targetNode: null });
|
|
291
308
|
}
|
|
292
309
|
};
|
|
293
|
-
return /* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
|
|
310
|
+
return /* @__PURE__ */ f(De, { value: { pathNodes: pe, setPathNodes: Y, graphInfo: m, graphData: b, layoutType: le, setLayoutType: ce, knowledgeCardApi: re }, children: /* @__PURE__ */ te("div", { className: "cytoscape-container", style: { position: "relative" }, children: [
|
|
311
|
+
/* @__PURE__ */ f("div", { className: "btn-group" }),
|
|
312
|
+
/* @__PURE__ */ f(
|
|
313
|
+
ze,
|
|
297
314
|
{
|
|
298
|
-
ref:
|
|
299
|
-
cyRef:
|
|
300
|
-
graphInfo:
|
|
301
|
-
initNodeScale:
|
|
302
|
-
cyContainerRef:
|
|
303
|
-
typeObj:
|
|
304
|
-
relationObj:
|
|
315
|
+
ref: K,
|
|
316
|
+
cyRef: c,
|
|
317
|
+
graphInfo: m,
|
|
318
|
+
initNodeScale: X,
|
|
319
|
+
cyContainerRef: j,
|
|
320
|
+
typeObj: w,
|
|
321
|
+
relationObj: T,
|
|
322
|
+
colors: E,
|
|
323
|
+
actionBar: ae
|
|
305
324
|
}
|
|
306
325
|
),
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
|
|
326
|
+
/* @__PURE__ */ te("div", { style: { position: "relative" }, children: [
|
|
327
|
+
/* @__PURE__ */ f("div", { ref: j, className: "cy-container" }),
|
|
328
|
+
p.visible && p.targetNode && /* @__PURE__ */ f(
|
|
310
329
|
"div",
|
|
311
330
|
{
|
|
312
331
|
style: {
|
|
313
332
|
position: "absolute",
|
|
314
|
-
left: `${
|
|
315
|
-
top: `${
|
|
333
|
+
left: `${p.x}px`,
|
|
334
|
+
top: `${p.y}px`,
|
|
316
335
|
// backgroundColor: 'white',
|
|
317
336
|
// border: '1px solid #ccc',
|
|
318
337
|
// borderRadius: '50%',
|
|
@@ -325,17 +344,17 @@ const Ye = ({
|
|
|
325
344
|
height: "200px",
|
|
326
345
|
overflow: "hidden"
|
|
327
346
|
},
|
|
328
|
-
onClick: (
|
|
329
|
-
children: /* @__PURE__ */
|
|
347
|
+
onClick: (s) => s.stopPropagation(),
|
|
348
|
+
children: /* @__PURE__ */ f(Te, { items: ue, centerImage: (G = p == null ? void 0 : p.targetNode) == null ? void 0 : G.data().image, targetNode: p.targetNode, onClick: (s, a) => fe(s, a) })
|
|
330
349
|
}
|
|
331
350
|
),
|
|
332
|
-
|
|
351
|
+
$.visible && /* @__PURE__ */ f(
|
|
333
352
|
"div",
|
|
334
353
|
{
|
|
335
354
|
style: {
|
|
336
355
|
position: "absolute",
|
|
337
|
-
left: `${
|
|
338
|
-
top: `${
|
|
356
|
+
left: `${$.x}px`,
|
|
357
|
+
top: `${$.y}px`,
|
|
339
358
|
transform: "translateX(-50%)",
|
|
340
359
|
backgroundColor: "rgba(0, 0, 0, 0.85)",
|
|
341
360
|
color: "#fff",
|
|
@@ -349,14 +368,14 @@ const Ye = ({
|
|
|
349
368
|
overflow: "hidden",
|
|
350
369
|
textOverflow: "ellipsis"
|
|
351
370
|
},
|
|
352
|
-
children:
|
|
371
|
+
children: $.content
|
|
353
372
|
}
|
|
354
373
|
)
|
|
355
374
|
] }),
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ f($e, { ref: Q }),
|
|
376
|
+
/* @__PURE__ */ f(Oe, { ref: V })
|
|
358
377
|
] }) });
|
|
359
378
|
};
|
|
360
379
|
export {
|
|
361
|
-
|
|
380
|
+
tt as default
|
|
362
381
|
};
|