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.
Files changed (44) hide show
  1. package/README.md +197 -9
  2. package/lib/index.es.js +8 -6
  3. package/lib/index.es10.js +186 -69
  4. package/lib/index.es11.js +69 -28
  5. package/lib/index.es12.js +29 -69
  6. package/lib/index.es13.js +64 -224
  7. package/lib/index.es14.js +69 -4
  8. package/lib/index.es15.js +4 -35
  9. package/lib/index.es16.js +37 -0
  10. package/lib/index.es18.js +15462 -49
  11. package/lib/index.es19.js +50 -56
  12. package/lib/index.es20.js +57 -66
  13. package/lib/index.es21.js +68 -39
  14. package/lib/index.es22.js +40 -2
  15. package/lib/index.es23.js +1 -1
  16. package/lib/index.es24.js +2 -2
  17. package/lib/index.es25.js +1 -1
  18. package/lib/index.es26.js +1 -1
  19. package/lib/index.es27.js +1 -1
  20. package/lib/index.es28.js +1 -1
  21. package/lib/index.es29.js +1 -1
  22. package/lib/index.es3.js +201 -182
  23. package/lib/index.es30.js +1 -1
  24. package/lib/index.es31.js +1 -1
  25. package/lib/index.es32.js +2 -2
  26. package/lib/index.es33.js +4 -0
  27. package/lib/index.es35.js +4 -2
  28. package/lib/index.es36.js +4 -0
  29. package/lib/index.es4.js +17 -6
  30. package/lib/index.es5.js +6 -2
  31. package/lib/index.es6.js +2 -599
  32. package/lib/index.es7.js +578 -312
  33. package/lib/index.es8.js +294 -393
  34. package/lib/index.es9.js +408 -173
  35. package/lib/src/components/Graph/components/ActionBar/actionList.d.ts +10 -0
  36. package/lib/src/components/Graph/components/ActionBar/index.d.ts +15 -0
  37. package/lib/src/components/Graph/components/SettingCircle/index.d.ts +4 -2
  38. package/lib/src/components/Graph/types.d.ts +62 -1
  39. package/lib/src/components/Graph/utils/edge_node_styles.d.ts +5 -2
  40. package/lib/src/components/Graph/utils/menuItems.d.ts +12 -1
  41. package/lib/style.css +1 -1
  42. package/package.json +1 -1
  43. package/lib/index.es17.js +0 -15469
  44. package/lib/index.es34.js +0 -6
package/lib/index.es3.js CHANGED
@@ -1,64 +1,71 @@
1
- import { jsx as y, jsxs as G } from "react/jsx-runtime";
2
- import { useRef as E, useState as m, useEffect as q } from "react";
3
- import x from "cytoscape";
4
- import fe from "cytoscape-cose-bilkent";
5
- import me from "cytoscape-cise";
6
- import he from "cytoscape-fcose";
7
- import ve from "storm-layout";
8
- import be from "./index.es6.js";
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 xe, resDetailData as A } from "./index.es7.js";
11
- import { fixNodesToEdges as Ne, coseBilkentLayout as ee } from "./index.es8.js";
12
- import { edgeNodeStyles as ke } from "./index.es9.js";
13
- import Ce from "cytoscape-layout-utilities";
14
- import { message as O } from "antd";
15
- import { menuItemsConfig as ze } from "./index.es10.js";
16
- import { jsonStringify as w } from "./index.es11.js";
17
- import Ee from "./index.es12.js";
18
- import we from "./index.es13.js";
19
- import { GraphProvider as Le } from "./index.es14.js";
20
- import je from "./index.es15.js";
21
- x.use(Ce);
22
- x.use(me);
23
- x.use(he);
24
- x.use(ve);
25
- x.use(fe);
26
- const Ye = ({
27
- data: te,
28
- getAllGraphData: S,
29
- highPathAnalysis: N = [],
30
- graphInfo: f,
31
- stepNextApi: oe,
32
- knowledgeCardApi: ne
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 Y, Z;
35
- const L = E(null), [v, D] = m([]), p = E(null), F = E(null), H = 1, [Re, K] = m(!1), [k, I] = m({}), [j, P] = m({}), [se, de] = m("cose-bilkent"), X = E(null), J = E(null), [ae, Q] = m(["", ""]), [c, C] = m({
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
- }), [R, V] = m({
48
+ }), [$, Z] = h({
42
49
  visible: !1,
43
50
  x: 0,
44
51
  y: 0,
45
52
  content: ""
46
- }), re = ze({ cyRef: p, setContextMenu: C, onPathAnalysis: (Y = F.current) == null ? void 0 : Y.onPathAnalysis, setPathNodes: Q });
47
- q(() => {
48
- (N == null ? void 0 : N.length) > 1 && xe(p, { pathNodes: N, isGrayed: !1 });
49
- }, [w(N), w(v)]), q(() => {
50
- S == null || S({ graphData: v, nodeStatic: k, relationStatic: j });
51
- }, [w(v), w(k), w(j)]), q(() => {
52
- var a;
53
- if (!L.current || p.current) return;
54
- const { elements: o, typeListObj: d, relationListObj: z } = A(te, { typeObj: k, graphInfo: f });
55
- I(d), D(o), P(z), document.addEventListener("contextmenu", function(t) {
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 = x({
59
- container: L.current,
60
- elements: o,
61
- style: ke({ elements: o }),
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 (p.current = e, ((a = f == null ? void 0 : f.searchNodes) == null ? void 0 : a.length) === 2)
70
- Ne(
76
+ if (c.current = e, ((r = m == null ? void 0 : m.searchNodes) == null ? void 0 : r.length) === 2)
77
+ we(
71
78
  e,
72
- f.searchNodes[0],
73
- f.searchNodes[1]
79
+ m.searchNodes[0],
80
+ m.searchNodes[1]
74
81
  );
75
82
  else {
76
- const t = e.layout(ee());
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
- t.target.hasClass("path-edge") || t.target.style({
83
- "line-color": "#1890ff",
84
- "target-arrow-color": "#1890ff",
85
- opacity: 0.8
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
- t.target.hasClass("path-edge") || t.target.style({
89
- "line-color": "#ccc",
90
- "target-arrow-color": "#ccc",
91
- opacity: 1
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 s = t.target;
95
- s.hasClass("selected") || s.addClass("hover");
111
+ const o = t.target;
112
+ o.hasClass("selected") || o.addClass("hover");
96
113
  }), e.on("mouseover", "node", (t) => {
97
- const s = t.target, n = s.renderedPosition(), r = s.data("name") || "";
98
- s.addClass("hover"), V({
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: r
119
+ content: d
103
120
  });
104
121
  }), e.on("mouseout", "node", (t) => {
105
- t.target.removeClass("hover"), V((n) => ({ ...n, visible: !1 }));
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 s = t.target, n = s.renderedPosition();
109
- console.log("renderedPos:::", s.data(), s.style("background-color")), C({
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: s,
114
- bgColor: s.style("background-color")
130
+ targetNode: o,
131
+ bgColor: o.style("background-color")
115
132
  });
116
- }), p.current = e, e.on("click", "node", (t) => {
117
- const s = t.target;
118
- e.nodes().removeClass("selected grayed highlighted"), e.edges().removeClass("selected grayed highlighted"), s.addClass("selected");
119
- const r = s.neighborhood().nodes().add(s), b = r.edgesWith(r);
120
- console.log("cy.nodes().not(relatedNodes):::", r), e.nodes().not(r).addClass("grayed"), e.edges().not(b).addClass("grayed"), r.addClass("highlighted"), b.addClass("highlighted");
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 && (C((s) => ({ ...s, 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"));
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
- p.current && (p.current.destroy(), p.current = null);
141
+ c.current && (c.current.destroy(), c.current = null);
125
142
  };
126
143
  }, []);
127
- const ie = async (o) => {
128
- const { id: d, kgId: z } = o, e = p.current;
144
+ const ge = async (s) => {
145
+ const { id: a, kgId: u } = s, e = c.current;
129
146
  if (!e) return;
130
- const a = e.$(`#${d}`);
131
- if (!a || a.length === 0) {
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") === d || n.data("idLabel") === `${d}-${n.data("name")}`) && n.data("zktype") === o.zktype : !1);
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()), r = t.connectedEdges(), b = e.edges().filter(
138
- (l) => l.data("source") === d && n.includes(l.data("target"))
139
- ), T = e.edges().filter((l) => l.data("appendedBy") === d), B = r.merge(b).merge(T).filter((l) => l.data().zktype === o.zktype);
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(B), D((l) => {
146
- const $ = l.filter((u) => {
147
- var h, _;
148
- const i = u.data.zktype;
149
- if (u.group === "nodes" && n.includes((h = u.data) == null ? void 0 : h.id) && i && i === o.zktype)
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 (u.group === "edges" && i && i === o.zktype) {
152
- const pe = Array.from(T).map((ye) => {
153
- const U = ye.data();
154
- return `${U.source}-${U.target}-${U.label}`;
155
- }), M = u.data, ge = pe.includes(`${M.source}-${M.target}-${M.label}`), ue = ((_ = u.data) == null ? void 0 : _.appendedBy) === d;
156
- return !ge && !ue;
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: W } = A({}, { graphData: $, typeObj: {} });
160
- return I(g), P(W), $;
161
- }), a.data("appendedNodes", []), a.data("isExpanded", !1);
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
- a.removed() || (a.style("border-width", ""), a.style("border-color", ""));
181
+ r.removed() || (r.style("border-width", ""), r.style("border-color", ""));
165
182
  }, 300);
166
183
  } else {
167
184
  try {
168
- K(!0), O.open({
185
+ J(!0), C.open({
169
186
  type: "loading",
170
187
  content: "正在展开...",
171
188
  duration: 0
172
189
  });
173
- const n = await oe({ uri: d, queryType: 1, kgId: z, zktype: o.zktype }), { elements: r, typeListObj: b, relationListObj: T } = A(n.data, { graphData: v, typeObj: k, relationObj: j, zktype: o.zktype });
174
- if (I(b), P(T), console.log(555e3, r), !((r == null ? void 0 : r.length) > 0)) {
175
- O.warning("暂无数据"), setTimeout(() => {
176
- O.destroy();
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 ((r == null ? void 0 : r.length) > 0) {
181
- const B = e.layoutUtilities({
182
- ...ee(),
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 = r.map((i) => {
204
+ }), l = d.map((i) => {
188
205
  if (i.group === "nodes") {
189
- const h = 80 * H;
206
+ const v = 80 * X;
190
207
  return {
191
208
  ...i,
192
209
  style: {
193
210
  opacity: 0,
194
- width: h,
195
- height: h
211
+ width: v,
212
+ height: v
196
213
  },
197
214
  data: {
198
215
  ...i.data,
199
- parentId: d,
216
+ parentId: a,
200
217
  // 标记父节点
201
- appendedBy: d,
218
+ appendedBy: a,
202
219
  // 标记由谁追加
203
- idLabel: d + "-" + i.data.label,
204
- zktype: o.zktype,
220
+ idLabel: a + "-" + i.data.label,
221
+ zktype: s.zktype,
205
222
  isAppended: !0,
206
223
  // 标记是追加节点
207
- baseWidth: h,
208
- baseHeight: h
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: d,
217
- zktype: o.zktype
233
+ appendedBy: a,
234
+ zktype: s.zktype
218
235
  }
219
236
  };
220
- }), $ = e.add(l);
221
- D([...v, ...l]);
222
- const g = $.filter(":node"), W = g.map((i) => i.id());
223
- a.data("appendedNodes", W), a.data("isExpanded", !0);
224
- const u = e.nodes().difference(g);
225
- u.forEach((i) => i.lock()), B.placeNewNodes(g), e.layout({
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
- u.forEach((i) => i.unlock());
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
- a.removed() || (a.style("border-width", ""), a.style("border-color", ""), e.center(a), e.zoom(e.zoom()));
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
- K(!1), O.destroy();
280
+ J(!1);
263
281
  }
264
- C({ visible: !1 });
265
- }, le = {
282
+ L({ visible: !1 });
283
+ }, ye = {
266
284
  expanded: "typed-literal",
267
285
  contract: "uri"
268
- }, ce = (o) => {
269
- if (console.log("handleMenuAction:::", o), c.targetNode) {
270
- const d = o.ids, z = c.targetNode.data();
271
- if (["expanded", "contract"].includes(d))
272
- ie({ kgId: 3, ...z, zktype: le[d] });
273
- else if (d === "nodeInfo") {
274
- const e = c.targetNode, a = {
275
- id: e.id(),
276
- data: e.data(),
277
- position: e.position(),
278
- degree: e.degree(),
279
- inDegree: e.degree(!0),
280
- outDegree: e.degree(!1),
281
- classes: e.classes(),
282
- // 样式信息
283
- style: e.style()
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
- X.current.open(a);
286
- } else if (d === "knowledgeCard") {
287
- const e = c.targetNode;
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__ */ y(Le, { value: { pathNodes: ae, setPathNodes: Q, graphInfo: f, graphData: v, layoutType: se, setLayoutType: de, knowledgeCardApi: ne }, children: /* @__PURE__ */ G("div", { className: "cytoscape-container", style: { position: "relative" }, children: [
294
- /* @__PURE__ */ y("div", { className: "btn-group" }),
295
- /* @__PURE__ */ y(
296
- be,
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: F,
299
- cyRef: p,
300
- graphInfo: f,
301
- initNodeScale: H,
302
- cyContainerRef: L,
303
- typeObj: k,
304
- relationObj: j
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__ */ G("div", { style: { position: "relative" }, children: [
308
- /* @__PURE__ */ y("div", { ref: L, className: "cy-container" }),
309
- c.visible && c.targetNode && /* @__PURE__ */ y(
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: `${c.x}px`,
315
- top: `${c.y}px`,
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: (o) => o.stopPropagation(),
329
- children: /* @__PURE__ */ y(Ee, { items: re, centerImage: (Z = c == null ? void 0 : c.targetNode) == null ? void 0 : Z.data().image, onClick: (o) => ce(o) })
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
- R.visible && /* @__PURE__ */ y(
351
+ $.visible && /* @__PURE__ */ f(
333
352
  "div",
334
353
  {
335
354
  style: {
336
355
  position: "absolute",
337
- left: `${R.x}px`,
338
- top: `${R.y}px`,
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: R.content
371
+ children: $.content
353
372
  }
354
373
  )
355
374
  ] }),
356
- /* @__PURE__ */ y(we, { ref: X }),
357
- /* @__PURE__ */ y(je, { ref: J })
375
+ /* @__PURE__ */ f($e, { ref: Q }),
376
+ /* @__PURE__ */ f(Oe, { ref: V })
358
377
  ] }) });
359
378
  };
360
379
  export {
361
- Ye as default
380
+ tt as default
362
381
  };