react-kggraph 0.0.28 → 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.
Files changed (41) hide show
  1. package/lib/index.es11.js +1 -1
  2. package/lib/index.es14.js +60 -48
  3. package/lib/index.es16.js +24 -22
  4. package/lib/index.es23.js +33 -30
  5. package/lib/index.es24.js +32 -29
  6. package/lib/index.es25.js +271 -2
  7. package/lib/index.es26.js +1 -1
  8. package/lib/index.es27.js +2 -2
  9. package/lib/index.es28.js +1 -1
  10. package/lib/index.es29.js +1 -1
  11. package/lib/index.es3.js +176 -182
  12. package/lib/index.es30.js +1 -1
  13. package/lib/index.es31.js +1 -1
  14. package/lib/index.es32.js +1 -1
  15. package/lib/index.es33.js +1 -1
  16. package/lib/index.es34.js +1 -1
  17. package/lib/index.es35.js +1 -1
  18. package/lib/index.es36.js +2 -2
  19. package/lib/index.es37.js +4 -0
  20. package/lib/index.es39.js +62 -1045
  21. package/lib/index.es4.js +7 -6
  22. package/lib/index.es40.js +21 -0
  23. package/lib/index.es41.js +43 -0
  24. package/lib/index.es42.js +42 -0
  25. package/lib/index.es43.js +88 -18
  26. package/lib/index.es44.js +54 -39
  27. package/lib/index.es45.js +30 -39
  28. package/lib/index.es47.js +66 -52
  29. package/lib/index.es7.js +176 -169
  30. package/lib/index.es8.js +108 -108
  31. package/lib/index.es9.js +9 -14
  32. package/lib/src/components/Graph/components/GraphListData/index.d.ts +3 -0
  33. package/lib/src/components/Graph/components/NodeInfoDrawer/index.d.ts +4 -1
  34. package/lib/src/components/Graph/utils/layouts.d.ts +1 -1
  35. package/lib/src/components/Graph/utils/tools.d.ts +3 -3
  36. package/lib/style.css +1 -1
  37. package/package.json +1 -1
  38. package/lib/index.es38.js +0 -66
  39. package/lib/index.es46.js +0 -91
  40. package/lib/index.es48.js +0 -33
  41. package/lib/index.es50.js +0 -72
package/lib/index.es3.js CHANGED
@@ -1,79 +1,79 @@
1
- import { jsx as h, jsxs as ne } from "react/jsx-runtime";
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 E from "cytoscape";
4
- import Ee from "cytoscape-cose-bilkent";
3
+ import N from "cytoscape";
4
+ import Ne from "cytoscape-cose-bilkent";
5
5
  import ze from "cytoscape-cise";
6
- import we from "cytoscape-fcose";
6
+ import Ee from "cytoscape-fcose";
7
7
  import je from "storm-layout";
8
- import Le from "./index.es7.js";
8
+ import we from "./index.es7.js";
9
9
  /* empty css */
10
- import { handleCalcPath as Oe, resDetailData as F } from "./index.es8.js";
11
- import { fixNodesToEdges as Pe, coseBilkentLayout as se } from "./index.es9.js";
12
- import { edgeNodeStyles as Re, defaultColors as de, nodeSize as Te } from "./index.es10.js";
13
- import $e from "cytoscape-layout-utilities";
14
- import { message as C } from "antd";
15
- import { menuItemsConfig as De } from "./index.es11.js";
16
- import { jsonStringify as L } from "./index.es12.js";
17
- import Se from "./index.es13.js";
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
- E.use($e);
23
- E.use(ze);
24
- E.use(we);
25
- E.use(je);
26
- E.use(Ee);
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: S,
30
- highPathAnalysis: K = [],
29
+ getAllGraphData: T,
30
+ highPathAnalysis: q = [],
31
31
  graphInfo: u,
32
- stepNextApi: re,
33
- knowledgeCardApi: ae,
34
- colors: w,
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: He = "暂无数据"
39
+ noDataDesc: Me = "暂无数据"
40
40
  }) => {
41
- var G, ee, te;
42
- const O = k(null), [p, I] = v([]), g = k(null), X = k(null), Z = 1, [Me, _] = v(!1), [x, B] = v({}), [P, A] = v({}), [ge, ue] = v("cose-bilkent"), J = k(null), Q = k(null), [ye, V] = v(["", ""]), W = k(w);
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
- W.current = w;
45
- }, [w]);
46
- const [y, j] = v({
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
- }), [R, Y] = v({
52
+ }), [L, G] = v({
53
53
  visible: !1,
54
54
  x: 0,
55
55
  y: 0,
56
56
  content: ""
57
- }), fe = De({ cyRef: g, setContextMenu: j, onPathAnalysis: (G = X.current) == null ? void 0 : G.onPathAnalysis, setPathNodes: V, actionCircle: le });
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 { pathNodes: n, pathLinks: s } = K || {};
60
- ((n == null ? void 0 : n.length) > 0 || (s == null ? void 0 : s.length) > 0) && Oe(g, { pathNodes: n, pathLinks: s, isGrayed: !1 });
61
- }, [L(K), L(p)]), D(() => {
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
- p.forEach((l) => {
63
+ g.forEach((l) => {
64
64
  l.group === "nodes" ? n.push(l.data) : l.group === "edges" && s.push(l.data);
65
- }), S == null || S({ graphData: p, nodeStatic: x, relationStatic: P, data: { nodes: n, links: s }, paths: z.paths, data2: z.data2, logId: z.logId, costtime: z.costtime });
66
- }, [L(p), L(x), L(P)]), D(() => {
67
- var a;
68
- if (!O.current || g.current) return;
69
- const { elements: n, typeListObj: s, relationListObj: l } = F(z, { typeObj: x, graphInfo: u });
70
- B(s), I(n), A(l), document.addEventListener("contextmenu", function(t) {
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 = E({
73
+ const e = N({
74
74
  container: O.current,
75
75
  elements: n,
76
- style: Re({ elements: n, colors: w }),
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 (g.current = e, ((a = u == null ? void 0 : u.searchNodes) == null ? void 0 : a.length) === 2)
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(se());
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 d;
98
+ var r;
99
99
  const o = t.target;
100
100
  if (!o.hasClass("path-edge")) {
101
- const r = ((d = W.current) == null ? void 0 : d.edgeHoverColor) ?? de.edgeHoverColor;
101
+ const a = ((r = B.current) == null ? void 0 : r.edgeHoverColor) ?? re.edgeHoverColor;
102
102
  o.style({
103
- "line-color": r,
104
- "target-arrow-color": r,
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 d;
109
+ var r;
110
110
  const o = t.target;
111
111
  if (!o.hasClass("path-edge")) {
112
- const r = ((d = W.current) == null ? void 0 : d.edgeDefaultColor) ?? de.edgeDefaultColor;
112
+ const a = ((r = B.current) == null ? void 0 : r.edgeDefaultColor) ?? re.edgeDefaultColor;
113
113
  o.style({
114
- "line-color": r,
115
- "target-arrow-color": r,
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, d = o.renderedPosition(), r = o.data("name") || "";
124
- o.addClass("hover"), Y({
123
+ const o = t.target, r = o.renderedPosition(), a = o.data("name") || "";
124
+ o.addClass("hover"), G({
125
125
  visible: !0,
126
- x: d.x,
127
- y: d.y - 60,
128
- content: r
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"), Y((d) => ({ ...d, visible: !1 }));
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, d = o.renderedPosition();
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: d.x - 90,
138
- y: d.y - 90,
137
+ x: r.x - 90,
138
+ y: r.y - 90,
139
139
  targetNode: o,
140
140
  bgColor: o.style("background-color")
141
141
  });
142
- }), g.current = e, e.on("click", "node", (t) => {
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 r = o.neighborhood().nodes().add(o), N = r.edgesWith(r);
146
- 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");
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
- g.current && (g.current.destroy(), g.current = null);
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 = g.current;
154
+ const { id: s, kgId: l } = n, e = p.current;
155
155
  if (!e) return;
156
- const a = e.$(`#${s}`);
157
- if (!a || a.length === 0) {
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((d) => d.data("parentId") ? (d.data("parentId") === s || d.data("idLabel") === `${s}-${d.data("name")}`) && d.data("zktype") === n.zktype : !1);
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 d = t.map((c) => c.id()), r = t.connectedEdges(), N = e.edges().filter(
164
- (c) => c.data("source") === s && d.includes(c.data("target"))
165
- ), T = e.edges().filter((c) => c.data("appendedBy") === s), H = r.merge(N).merge(T).filter((c) => c.data().zktype === n.zktype);
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(H), I((c) => {
172
- const $ = c.filter((m) => {
173
- var b, oe;
174
- const i = m.data.zktype;
175
- if (m.group === "nodes" && d.includes((b = m.data) == null ? void 0 : b.id) && i && i === n.zktype)
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 (m.group === "edges" && i && i === n.zktype) {
178
- const xe = Array.from(T).map((Ce) => {
179
- const q = Ce.data();
180
- return `${q.source}-${q.target}-${q.label}`;
181
- }), U = m.data, Ne = xe.includes(`${U.source}-${U.target}-${U.label}`), ke = ((oe = m.data) == null ? void 0 : oe.appendedBy) === s;
182
- return !Ne && !ke;
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: f, relationListObj: M } = F({}, { graphData: $, typeObj: {} });
186
- return B(f), A(M), $;
187
- }), a.data("appendedNodes", []), a.data("isExpanded", !1);
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
- a.removed() || (a.style("border-width", ""), a.style("border-color", ""));
190
+ d.removed() || (d.style("border-width", ""), d.style("border-color", ""));
191
191
  }, 300);
192
192
  } else {
193
193
  try {
194
- _(!0), C.open({
194
+ _(!0), b.open({
195
195
  type: "loading",
196
196
  content: "正在展开...",
197
197
  duration: 0
198
198
  });
199
- const d = await re({ uri: s, queryType: 1, kgId: l, zktype: n.zktype }), { elements: r, typeListObj: N, relationListObj: T } = F(d.data, { graphData: p, typeObj: x, relationObj: P, zktype: n.zktype });
200
- if (B(N), A(T), !((r == null ? void 0 : r.length) > 0)) {
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
- C.destroy(), C.warning("暂无数据");
202
+ b.destroy(), b.warning("暂无数据");
203
203
  }, 2e3);
204
204
  return;
205
205
  }
206
- if ((r == null ? void 0 : r.length) > 0) {
207
- const H = e.layoutUtilities({
208
- ...se(),
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 b = Te * Z;
210
+ const h = Se * Y;
216
211
  return {
217
212
  ...i,
218
- style: {
219
- opacity: 0,
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
- baseWidth: b,
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
- }), $ = e.add(c);
247
- I([...p, ...c]);
248
- const f = $.filter(":node"), M = f.map((i) => i.id());
249
- a.data("appendedNodes", M), a.data("isExpanded", !0);
250
- const m = e.nodes().difference(f);
251
- m.forEach((i) => i.lock()), H.placeNewNodes(f), e.layout({
252
- name: "cose-bilkent",
253
- randomize: !1,
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
- fit: !1,
258
- // 不要自动缩放,保持在当前视图
259
- // 其他参数保持你原来的配置
260
- nodeRepulsion: 1005e3,
261
- idealEdgeLength: 100,
262
- edgeElasticity: 0.3,
263
- numIter: 800,
264
- // 可以适当减少,因为只需要微调
265
- gravity: 0.6
266
- }).run(), setTimeout(() => {
267
- m.forEach((i) => i.unlock());
268
- }, 2e3), f.animate({
269
- style: {
270
- opacity: 1,
271
- width: 20,
272
- height: 30
273
- }
274
- }, {
275
- duration: 400,
276
- easing: "ease-out",
277
- complete: () => {
278
- f.style("opacity", ""), f.style("width", ""), f.style("height", "");
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
- }), setTimeout(() => {
281
- a.removed() || (a.style("border-width", ""), a.style("border-color", ""), e.center(a), e.zoom(e.zoom()));
282
- }, 600);
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
- C.destroy();
286
- } catch (d) {
287
- C.destroy(), C.error("请求接口失败"), console.error("22请求接口失败:", d);
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 || y.targetNode;
292
+ const l = s || f.targetNode;
299
293
  if (l) {
300
- const a = n.ids, t = l.data();
301
- if (["expanded", "contract"].includes(a))
302
- me({ kgId: u.kgId, ...t, zktype: he[a] });
303
- else if (a === "nodeInfo") {
304
- const o = l, d = {
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(d);
315
- } else a === "knowledgeCard" && Q.current.open(l.data());
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, !(((ee = p == null ? void 0 : p.nodes) == null ? void 0 : ee.length) > 0), p);
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__ */ h(Be, { value: { pathNodes: ye, setPathNodes: V, graphInfo: u, graphData: p, layoutType: ge, setLayoutType: ue, knowledgeCardApi: ae, queryStatisticsConfig: ce, actionBar: ie }, children: /* @__PURE__ */ ne("div", { className: We("cytoscape-container relative", pe), children: [
327
- /* @__PURE__ */ h("div", { className: "btn-group" }),
328
- /* @__PURE__ */ h(
329
- Le,
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: X,
332
- cyRef: g,
325
+ ref: U,
326
+ cyRef: p,
333
327
  graphInfo: u,
334
- initNodeScale: Z,
328
+ initNodeScale: Y,
335
329
  cyContainerRef: O,
336
330
  typeObj: be(),
337
331
  relationObj: P,
338
- colors: w
332
+ colors: E
339
333
  }
340
334
  ),
341
- /* @__PURE__ */ ne("div", { className: "relative h-100", children: [
342
- /* @__PURE__ */ h("div", { ref: O, className: "cy-container" }),
343
- y.visible && y.targetNode && /* @__PURE__ */ h(
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: `${y.x}px`,
349
- top: `${y.y}px`,
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__ */ h(Se, { items: fe, centerImage: (te = y == null ? void 0 : y.targetNode) == null ? void 0 : te.data().image, targetNode: y.targetNode, onClick: (n, s) => ve(n, s) })
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
- R.visible && /* @__PURE__ */ h(
360
+ L.visible && /* @__PURE__ */ m(
367
361
  "div",
368
362
  {
369
363
  style: {
370
364
  position: "absolute",
371
- left: `${R.x}px`,
372
- top: `${R.y}px`,
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: R.content
380
+ children: L.content
387
381
  }
388
382
  )
389
383
  ] }),
390
- /* @__PURE__ */ h(Ie, { ref: J }),
391
- /* @__PURE__ */ h(Ae, { ref: Q })
384
+ /* @__PURE__ */ m(Ie, { ref: J, cyRef: p }),
385
+ /* @__PURE__ */ m(Ae, { ref: Q })
392
386
  ] }) });
393
387
  };
394
388
  export {