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