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