react-kggraph 0.0.22 → 0.0.23

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 (29) hide show
  1. package/lib/index.es10.js +20 -19
  2. package/lib/index.es14.js +39 -41
  3. package/lib/index.es16.js +19 -18
  4. package/lib/index.es22.js +2 -2
  5. package/lib/index.es3.js +80 -79
  6. package/lib/index.es35.js +64 -4
  7. package/lib/index.es36.js +4 -2
  8. package/lib/index.es37.js +4 -0
  9. package/lib/index.es4.js +1 -1
  10. package/lib/index.es41.js +21 -0
  11. package/lib/index.es42.js +43 -0
  12. package/lib/index.es43.js +42 -0
  13. package/lib/index.es44.js +91 -0
  14. package/lib/index.es45.js +58 -0
  15. package/lib/index.es46.js +33 -0
  16. package/lib/index.es48.js +72 -0
  17. package/lib/index.es7.js +125 -125
  18. package/lib/src/components/Graph/components/KnowledgeCard/components/AudioSection.d.ts +12 -0
  19. package/lib/src/components/Graph/components/KnowledgeCard/components/DocumentSection.d.ts +12 -0
  20. package/lib/src/components/Graph/components/KnowledgeCard/components/ImageSection.d.ts +12 -0
  21. package/lib/src/components/Graph/components/KnowledgeCard/components/ListCard.d.ts +14 -0
  22. package/lib/src/components/Graph/components/KnowledgeCard/components/PropertySection.d.ts +11 -0
  23. package/lib/src/components/Graph/components/KnowledgeCard/components/RelationSection.d.ts +13 -0
  24. package/lib/src/components/Graph/components/KnowledgeCard/components/SourceCard.d.ts +6 -0
  25. package/lib/src/components/Graph/components/KnowledgeCard/components/VideoSection.d.ts +12 -0
  26. package/lib/src/components/Graph/components/KnowledgeCard/data.d.ts +84 -0
  27. package/lib/src/components/Graph/utils/edge_node_styles.d.ts +1 -0
  28. package/lib/style.css +1 -1
  29. package/package.json +1 -1
package/lib/index.es10.js CHANGED
@@ -1,8 +1,8 @@
1
- const g = {
1
+ const g = 60, s = {
2
2
  nodeLabelColor: "#000",
3
- nodeLabelFontSize: 18,
3
+ nodeLabelFontSize: 16,
4
4
  edgeLabelColor: "#666",
5
- edgeLabelFontSize: 18,
5
+ edgeLabelFontSize: 16,
6
6
  uriNodeColor: "#f7de63",
7
7
  // 节点类型为uri的节点颜色,默认节点颜色
8
8
  normalNodeColor: "#1890FF",
@@ -16,21 +16,21 @@ const g = {
16
16
  //路径高亮颜色
17
17
  pathNodeColor: "#145AFD"
18
18
  //路径节点颜色-不生效
19
- }, h = ({ elements: c, colors: n = {} }) => {
20
- const e = { ...g, ...n }, l = [], t = 80;
21
- c.map((o) => {
22
- var a, d, i;
23
- !l.includes((a = o == null ? void 0 : o.data) == null ? void 0 : a.type) && ((d = o == null ? void 0 : o.data) != null && d.type) && l.push((i = o.data) == null ? void 0 : i.type);
19
+ }, h = ({ elements: i, colors: c = {} }) => {
20
+ const e = { ...s, ...c }, r = [];
21
+ i.map((o) => {
22
+ var l, a, d;
23
+ !r.includes((l = o == null ? void 0 : o.data) == null ? void 0 : l.type) && ((a = o == null ? void 0 : o.data) != null && a.type) && r.push((d = o.data) == null ? void 0 : d.type);
24
24
  });
25
- const r = [];
26
- r.push({
25
+ const t = [];
26
+ t.push({
27
27
  selector: '[properties-type="uri"]',
28
28
  style: {
29
29
  "background-color": e.uriNodeColor,
30
30
  "background-image": "data(image)",
31
31
  "background-fit": "cover",
32
- width: t,
33
- height: t,
32
+ width: 60,
33
+ height: 60,
34
34
  label: "data(name)",
35
35
  color: e.nodeLabelColor,
36
36
  "text-valign": "bottom",
@@ -39,14 +39,14 @@ const g = {
39
39
  "text-wrap": "ellipsis",
40
40
  "text-overflow-wrap": "anywhere"
41
41
  }
42
- }), r.push({
42
+ }), t.push({
43
43
  selector: '[properties-type!="uri"]',
44
44
  style: {
45
45
  "background-color": e.normalNodeColor,
46
46
  "background-image": "data(image)",
47
47
  "background-fit": "cover",
48
- width: t,
49
- height: t,
48
+ width: 60,
49
+ height: 60,
50
50
  label: "data(name)",
51
51
  color: e.nodeLabelColor,
52
52
  "text-valign": "bottom",
@@ -56,7 +56,7 @@ const g = {
56
56
  "text-overflow-wrap": "anywhere"
57
57
  }
58
58
  });
59
- const s = [
59
+ const n = [
60
60
  {
61
61
  selector: "node",
62
62
  style: {
@@ -184,9 +184,10 @@ const g = {
184
184
  }
185
185
  }
186
186
  ];
187
- return r.concat(s);
187
+ return t.concat(n);
188
188
  };
189
189
  export {
190
- g as defaultColors,
191
- h as edgeNodeStyles
190
+ s as defaultColors,
191
+ h as edgeNodeStyles,
192
+ g as nodeSize
192
193
  };
package/lib/index.es14.js CHANGED
@@ -1,65 +1,63 @@
1
1
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { forwardRef as w, useState as C, useImperativeHandle as D } from "react";
3
- import { Select as a, Form as l, Drawer as F, Input as r } from "antd";
4
- const { Option: o } = a, z = w((S, g) => {
5
- const [v, d] = C(!1), [B, x] = C({ style: {}, data: {} }), [s] = l.useForm();
6
- return D(g, () => ({
7
- open: (t) => {
8
- var c, h, i, m, b, y, p, u, f, I;
9
- d(!0), x(t), s.setFieldsValue({
10
- name: (c = t.data) == null ? void 0 : c.name,
11
- type: t.type || "圆形",
12
- color: (h = t.style) == null ? void 0 : h.color,
13
- size: parseInt((i = t.style) == null ? void 0 : i.height) || 30,
14
- borderWidth: parseInt((m = t.style) == null ? void 0 : m.borderWidth) || 2,
15
- borderDash: ((b = t.style) == null ? void 0 : b.borderDash) === [5, 5] ? "是" : "否",
16
- borderColor: (y = t.style) == null ? void 0 : y.borderColor,
17
- textValign: ((p = t.style) == null ? void 0 : p.textValign) || "center",
18
- fontStyle: ((u = t.style) == null ? void 0 : u.fontStyle) || "normal",
19
- fontColor: ((f = t.style) == null ? void 0 : f["font-color"]) || "#000000",
20
- textBackgroundColor: ((I = t.style) == null ? void 0 : I.textBackgroundColor) || "transparent"
2
+ import { forwardRef as D, useState as C, useImperativeHandle as w } from "react";
3
+ import { Select as a, Form as r, Drawer as F, Input as o } from "antd";
4
+ const { Option: t } = a, z = D((S, g) => {
5
+ const [v, s] = C(!1), [V, x] = C({ style: {}, data: {} }), [d] = r.useForm();
6
+ return w(g, () => ({
7
+ open: (l) => {
8
+ var c, h, i, m, b, p, y, u, f, I;
9
+ s(!0), x(l), d.setFieldsValue({
10
+ name: (c = l.data) == null ? void 0 : c.name,
11
+ type: l.type || "圆形",
12
+ color: (h = l.style) == null ? void 0 : h.color,
13
+ size: parseInt((i = l.style) == null ? void 0 : i.height) || 30,
14
+ borderWidth: parseInt((m = l.style) == null ? void 0 : m.borderWidth) || 2,
15
+ borderDash: ((b = l.style) == null ? void 0 : b.borderDash) === [5, 5] ? "是" : "否",
16
+ borderColor: (p = l.style) == null ? void 0 : p.borderColor,
17
+ textValign: ((y = l.style) == null ? void 0 : y.textValign) || "center",
18
+ fontStyle: ((u = l.style) == null ? void 0 : u.fontStyle) || "normal",
19
+ fontColor: ((f = l.style) == null ? void 0 : f["font-color"]) || "#000000",
20
+ textBackgroundColor: ((I = l.style) == null ? void 0 : I.textBackgroundColor) || "transparent"
21
21
  });
22
22
  },
23
- close: () => d(!1)
23
+ close: () => s(!1)
24
24
  })), /* @__PURE__ */ e(
25
25
  F,
26
26
  {
27
27
  title: "节点配置",
28
28
  closable: { "aria-label": "Close Button" },
29
29
  onClose: () => {
30
- d(!1), s.resetFields();
30
+ s(!1), d.resetFields();
31
31
  },
32
32
  open: v,
33
33
  getContainer: !1,
34
34
  width: 360,
35
35
  children: /* @__PURE__ */ n(
36
- l,
36
+ r,
37
37
  {
38
- form: s,
38
+ form: d,
39
39
  layout: "vertical",
40
40
  disabled: !0,
41
41
  children: [
42
- /* @__PURE__ */ e(l.Item, { label: "名称", name: "name", children: /* @__PURE__ */ e(r, {}) }),
43
- /* @__PURE__ */ e(l.Item, { label: "类型", name: "type", children: /* @__PURE__ */ n(a, { children: [
44
- /* @__PURE__ */ e(o, { value: "圆形", children: "圆形" }),
45
- /* @__PURE__ */ e(o, { value: "矩形", children: "矩形" })
42
+ /* @__PURE__ */ e(r.Item, { label: "名称", name: "name", children: /* @__PURE__ */ e(o, {}) }),
43
+ /* @__PURE__ */ e(r.Item, { label: "类型", name: "type", children: /* @__PURE__ */ n(a, { children: [
44
+ /* @__PURE__ */ e(t, { value: "圆形", children: "圆形" }),
45
+ /* @__PURE__ */ e(t, { value: "矩形", children: "矩形" })
46
46
  ] }) }),
47
- /* @__PURE__ */ e(l.Item, { label: "颜色", name: "color", children: /* @__PURE__ */ e(r, { type: "color", style: { width: "100%", height: 32 } }) }),
48
- /* @__PURE__ */ e(l.Item, { label: "大小", name: "size", children: /* @__PURE__ */ e(r, { type: "number" }) }),
49
- /* @__PURE__ */ e(l.Item, { label: "边框宽度", name: "borderWidth", children: /* @__PURE__ */ e(r, { type: "number" }) }),
50
- /* @__PURE__ */ e(l.Item, { label: "边框虚线", name: "borderDash", children: /* @__PURE__ */ n(a, { children: [
51
- /* @__PURE__ */ e(o, { value: "", children: "" }),
52
- /* @__PURE__ */ e(o, { value: "是", children: "是" })
47
+ /* @__PURE__ */ e(r.Item, { label: "大小", name: "size", children: /* @__PURE__ */ e(o, { type: "number" }) }),
48
+ /* @__PURE__ */ e(r.Item, { label: "边框宽度", name: "borderWidth", children: /* @__PURE__ */ e(o, { type: "number" }) }),
49
+ /* @__PURE__ */ e(r.Item, { label: "边框虚线", name: "borderDash", children: /* @__PURE__ */ n(a, { children: [
50
+ /* @__PURE__ */ e(t, { value: "", children: "" }),
51
+ /* @__PURE__ */ e(t, { value: "", children: "" })
53
52
  ] }) }),
54
- /* @__PURE__ */ e(l.Item, { label: "边框颜色", name: "borderColor", children: /* @__PURE__ */ e(r, { type: "color", style: { width: "100%", height: 32 } }) }),
55
- /* @__PURE__ */ e(l.Item, { label: "字体位置", name: "textValign", children: /* @__PURE__ */ n(a, { children: [
56
- /* @__PURE__ */ e(o, { value: "center", children: "居中" }),
57
- /* @__PURE__ */ e(o, { value: "bottom", children: "底部" }),
58
- /* @__PURE__ */ e(o, { value: "top", children: "顶部" })
53
+ /* @__PURE__ */ e(r.Item, { label: "边框颜色", name: "borderColor", children: /* @__PURE__ */ e(o, { type: "color", style: { width: "100%", height: 32 } }) }),
54
+ /* @__PURE__ */ e(r.Item, { label: "字体位置", name: "textValign", children: /* @__PURE__ */ n(a, { children: [
55
+ /* @__PURE__ */ e(t, { value: "center", children: "居中" }),
56
+ /* @__PURE__ */ e(t, { value: "bottom", children: "底部" }),
57
+ /* @__PURE__ */ e(t, { value: "top", children: "顶部" })
59
58
  ] }) }),
60
- /* @__PURE__ */ e(l.Item, { label: "字体样式", name: "fontStyle", children: /* @__PURE__ */ e(r, {}) }),
61
- /* @__PURE__ */ e(l.Item, { label: "字体颜色", name: "fontColor", children: /* @__PURE__ */ e(r, { type: "color", style: { width: "100%", height: 32 } }) }),
62
- /* @__PURE__ */ e(l.Item, { label: "字体背色", name: "textBackgroundColor", children: /* @__PURE__ */ e(r, {}) })
59
+ /* @__PURE__ */ e(r.Item, { label: "字体样式", name: "fontStyle", children: /* @__PURE__ */ e(o, {}) }),
60
+ /* @__PURE__ */ e(r.Item, { label: "字体颜色", name: "fontColor", children: /* @__PURE__ */ e(o, { type: "color", style: { width: "100%", height: 32 } }) })
63
61
  ]
64
62
  }
65
63
  )
package/lib/index.es16.js CHANGED
@@ -1,24 +1,25 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as g, useContext as m, useState as o, useRef as w, useEffect as C, useImperativeHandle as h } from "react";
3
- import { Drawer as x } from "antd";
4
- import { GraphContext as y } from "./index.es15.js";
5
- const F = g((I, l) => {
6
- const { graphInfo: d, knowledgeCardApi: f } = m(y), [t, a] = o(!1), [k, r] = o(!1), [D, c] = o(!1), [v, p] = o({ style: {}, data: {} }), s = w(null);
7
- C(() => {
8
- t && s.current && (s.current.scrollTop = 0);
9
- }, [t]), h(l, () => ({
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as w, useContext as C, useState as o, useRef as h, useEffect as I, useImperativeHandle as x } from "react";
3
+ import { Drawer as y } from "antd";
4
+ import { GraphContext as D } from "./index.es15.js";
5
+ import k from "./index.es35.js";
6
+ const G = w((v, d) => {
7
+ const { graphInfo: n, knowledgeCardApi: f } = C(D), [t, a] = o(!1), [c, l] = o(!1), [i, p] = o(!1), [R, u] = o({ style: {}, data: {} }), r = h(null);
8
+ I(() => {
9
+ t && r.current && (r.current.scrollTop = 0);
10
+ }, [t]), x(d, () => ({
10
11
  open: (e) => {
11
- a(!0), p(e), i(e);
12
+ a(!0), u(e), g(e);
12
13
  },
13
14
  close: () => a(!1)
14
15
  }));
15
- const i = async (e) => {
16
- r(!0);
17
- const u = await f({ kgId: d.kgId, uri: e.id });
18
- console.log(44, e), c(u.data), r(!1);
16
+ const g = async (e) => {
17
+ l(!0);
18
+ const m = await f({ kgId: n.kgId, uri: e.id });
19
+ console.log(44, e), p(m.data), l(!1);
19
20
  };
20
- return /* @__PURE__ */ n(
21
- x,
21
+ return /* @__PURE__ */ s(
22
+ y,
22
23
  {
23
24
  title: "知识卡片",
24
25
  onClose: () => {
@@ -28,10 +29,10 @@ const F = g((I, l) => {
28
29
  getContainer: !1,
29
30
  className: "knowledge-card-drawer",
30
31
  styles: { body: { padding: "0 20px", overflow: "auto" } },
31
- children: /* @__PURE__ */ n("div", { ref: s, style: { height: "100%" } })
32
+ children: /* @__PURE__ */ s("div", { ref: r, style: { height: "100%" }, children: /* @__PURE__ */ s(k, { detailData: i, drawerInfo: n, loading: c }) })
32
33
  }
33
34
  );
34
35
  });
35
36
  export {
36
- F as default
37
+ G as default
37
38
  };
package/lib/index.es22.js CHANGED
@@ -1,5 +1,5 @@
1
- import { getDefaultExportFromCjs as u } from "./index.es35.js";
2
- import { __module as i } from "./index.es36.js";
1
+ import { getDefaultExportFromCjs as u } from "./index.es36.js";
2
+ import { __module as i } from "./index.es37.js";
3
3
  /*!
4
4
  Copyright (c) 2018 Jed Watson.
5
5
  Licensed under the MIT License (MIT), see
package/lib/index.es3.js CHANGED
@@ -1,84 +1,85 @@
1
- import { jsx as m, jsxs as oe } from "react/jsx-runtime";
2
- import { useRef as N, useState as v, useEffect as S } from "react";
3
- import k from "cytoscape";
1
+ import { jsx as h, jsxs as oe } from "react/jsx-runtime";
2
+ import { useRef as N, useState as v, useEffect as O } from "react";
3
+ import C from "cytoscape";
4
4
  import Ne from "cytoscape-cose-bilkent";
5
- import Ce from "cytoscape-cise";
6
- import ke from "cytoscape-fcose";
5
+ import ke from "cytoscape-cise";
6
+ import Ce from "cytoscape-fcose";
7
7
  import ze from "storm-layout";
8
8
  import Ee from "./index.es7.js";
9
9
  /* empty css */
10
10
  import { handleCalcPath as we, resDetailData as F } from "./index.es8.js";
11
11
  import { fixNodesToEdges as Le, coseBilkentLayout as ne } from "./index.es9.js";
12
- import { edgeNodeStyles as Re, defaultColors as se } from "./index.es10.js";
13
- import je from "cytoscape-layout-utilities";
14
- import { message as C } from "antd";
15
- import { menuItemsConfig as Te } from "./index.es11.js";
12
+ import { edgeNodeStyles as Re, defaultColors as se, nodeSize as je } from "./index.es10.js";
13
+ import Te from "cytoscape-layout-utilities";
14
+ import { message as k } from "antd";
15
+ import { menuItemsConfig as $e } from "./index.es11.js";
16
16
  import { jsonStringify as R } from "./index.es12.js";
17
- import $e from "./index.es13.js";
18
- import De from "./index.es14.js";
17
+ import De from "./index.es13.js";
18
+ import Se from "./index.es14.js";
19
19
  import { GraphProvider as Oe } from "./index.es15.js";
20
- import Se from "./index.es16.js";
21
- k.use(je);
22
- k.use(Ce);
23
- k.use(ke);
24
- k.use(ze);
25
- k.use(Ne);
26
- const nt = ({
20
+ import Ie from "./index.es16.js";
21
+ C.use(Te);
22
+ C.use(ke);
23
+ C.use(Ce);
24
+ C.use(ze);
25
+ C.use(Ne);
26
+ const st = ({
27
27
  data: de,
28
28
  getAllGraphData: I,
29
29
  highPathAnalysis: z = [],
30
- graphInfo: h,
30
+ graphInfo: u,
31
31
  stepNextApi: re,
32
32
  knowledgeCardApi: ae,
33
33
  colors: E,
34
34
  actionBar: ie,
35
35
  actionCircle: le,
36
- noDataDesc: Ie = "暂无数据"
36
+ noDataDesc: Pe = "暂无数据"
37
37
  }) => {
38
38
  var _, G, ee;
39
- const j = N(null), [c, P] = v([]), p = N(null), K = N(null), X = 1, [Pe, J] = v(!1), [w, B] = v({}), [T, W] = v({}), [ce, pe] = v("cose-bilkent"), Q = N(null), V = N(null), [ue, Y] = v(["", ""]), H = N(E);
40
- S(() => {
39
+ const j = N(null), [c, P] = v([]), p = N(null), K = N(null), X = 1, [Be, Z] = v(!1), [w, B] = v({}), [T, W] = v({}), [ce, pe] = v("cose-bilkent"), J = N(null), Q = N(null), [ue, V] = v(["", ""]), H = N(E);
40
+ O(() => {
41
41
  H.current = E;
42
42
  }, [E]);
43
- const [u, L] = v({
43
+ const [g, L] = v({
44
44
  visible: !1,
45
45
  x: 0,
46
46
  y: 0,
47
47
  targetNode: null,
48
48
  bgColor: ""
49
- }), [$, Z] = v({
49
+ }), [$, Y] = v({
50
50
  visible: !1,
51
51
  x: 0,
52
52
  y: 0,
53
53
  content: ""
54
- }), ge = Te({ cyRef: p, setContextMenu: L, onPathAnalysis: (_ = K.current) == null ? void 0 : _.onPathAnalysis, setPathNodes: Y, actionCircle: le });
55
- S(() => {
54
+ }), ge = $e({ cyRef: p, setContextMenu: L, onPathAnalysis: (_ = K.current) == null ? void 0 : _.onPathAnalysis, setPathNodes: V, actionCircle: le });
55
+ O(() => {
56
56
  (z == null ? void 0 : z.length) > 1 && we(p, { pathNodes: z, isGrayed: !1 });
57
- }, [R(z), R(c)]), S(() => {
57
+ }, [R(z), R(c)]), O(() => {
58
58
  I == null || I({ graphData: c, nodeStatic: w, relationStatic: T });
59
- }, [R(c), R(w), R(T)]), S(() => {
59
+ }, [R(c), R(w), R(T)]), O(() => {
60
60
  var r;
61
61
  if (!j.current || p.current) return;
62
- const { elements: s, typeListObj: a, relationListObj: g } = F(de, { typeObj: w, graphInfo: h });
63
- B(a), P(s), W(g), document.addEventListener("contextmenu", function(t) {
62
+ const { elements: s, typeListObj: a, relationListObj: y } = F(de, { typeObj: w, graphInfo: u });
63
+ B(a), P(s), W(y), document.addEventListener("contextmenu", function(t) {
64
64
  t.preventDefault();
65
65
  });
66
- const e = k({
66
+ const e = C({
67
67
  container: j.current,
68
68
  elements: s,
69
69
  style: Re({ elements: s, colors: E }),
70
70
  autounselectify: !1,
71
71
  autolock: !1,
72
+ maxZoom: 1,
72
73
  layout: {
73
74
  name: "preset"
74
75
  // 使用预设布局,完全依赖 position
75
76
  }
76
77
  });
77
- if (p.current = e, ((r = h == null ? void 0 : h.searchNodes) == null ? void 0 : r.length) === 2)
78
+ if (p.current = e, ((r = u == null ? void 0 : u.searchNodes) == null ? void 0 : r.length) === 2)
78
79
  Le(
79
80
  e,
80
- h.searchNodes[0],
81
- h.searchNodes[1]
81
+ u.searchNodes[0],
82
+ u.searchNodes[1]
82
83
  );
83
84
  else {
84
85
  const t = e.layout(ne());
@@ -113,14 +114,14 @@ const nt = ({
113
114
  o.hasClass("selected") || o.addClass("hover");
114
115
  }), e.on("mouseover", "node", (t) => {
115
116
  const o = t.target, n = o.renderedPosition(), d = o.data("name") || "";
116
- o.addClass("hover"), Z({
117
+ o.addClass("hover"), Y({
117
118
  visible: !0,
118
119
  x: n.x,
119
120
  y: n.y - 60,
120
121
  content: d
121
122
  });
122
123
  }), e.on("mouseout", "node", (t) => {
123
- t.target.removeClass("hover"), Z((n) => ({ ...n, visible: !1 }));
124
+ t.target.removeClass("hover"), Y((n) => ({ ...n, visible: !1 }));
124
125
  }), e.on("cxttap", "node", (t) => {
125
126
  t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation(), t.originalEvent && (t.originalEvent.preventDefault(), t.originalEvent.stopPropagation(), t.originalEvent.stopImmediatePropagation());
126
127
  const o = t.target, n = o.renderedPosition();
@@ -143,7 +144,7 @@ const nt = ({
143
144
  };
144
145
  }, []);
145
146
  const ye = async (s) => {
146
- const { id: a, kgId: g } = s, e = p.current;
147
+ const { id: a, kgId: y } = s, e = p.current;
147
148
  if (!e) return;
148
149
  const r = e.$(`#${a}`);
149
150
  if (!r || r.length === 0) {
@@ -161,21 +162,21 @@ const nt = ({
161
162
  duration: 200,
162
163
  complete: () => {
163
164
  e.remove(t), e.remove(M), P((l) => {
164
- const O = l.filter((f) => {
165
+ const S = l.filter((m) => {
165
166
  var b, te;
166
- const i = f.data.zktype;
167
- if (f.group === "nodes" && n.includes((b = f.data) == null ? void 0 : b.id) && i && i === s.zktype)
167
+ const i = m.data.zktype;
168
+ if (m.group === "nodes" && n.includes((b = m.data) == null ? void 0 : b.id) && i && i === s.zktype)
168
169
  return !1;
169
- if (f.group === "edges" && i && i === s.zktype) {
170
+ if (m.group === "edges" && i && i === s.zktype) {
170
171
  const he = Array.from(D).map((xe) => {
171
172
  const A = xe.data();
172
173
  return `${A.source}-${A.target}-${A.label}`;
173
- }), q = f.data, ve = he.includes(`${q.source}-${q.target}-${q.label}`), be = ((te = f.data) == null ? void 0 : te.appendedBy) === a;
174
+ }), q = m.data, ve = he.includes(`${q.source}-${q.target}-${q.label}`), be = ((te = m.data) == null ? void 0 : te.appendedBy) === a;
174
175
  return !ve && !be;
175
176
  }
176
177
  return !0;
177
- }), { typeListObj: y, relationListObj: U } = F({}, { graphData: O, typeObj: {} });
178
- return B(y), W(U), O;
178
+ }), { typeListObj: f, relationListObj: U } = F({}, { graphData: S, typeObj: {} });
179
+ return B(f), W(U), S;
179
180
  }), r.data("appendedNodes", []), r.data("isExpanded", !1);
180
181
  }
181
182
  }), setTimeout(() => {
@@ -183,15 +184,15 @@ const nt = ({
183
184
  }, 300);
184
185
  } else {
185
186
  try {
186
- J(!0), C.open({
187
+ Z(!0), k.open({
187
188
  type: "loading",
188
189
  content: "正在展开...",
189
190
  duration: 0
190
191
  });
191
- const n = await re({ uri: a, queryType: 1, kgId: g, zktype: s.zktype }), { elements: d, typeListObj: x, relationListObj: D } = F(n.data, { graphData: c, typeObj: w, relationObj: T, zktype: s.zktype });
192
+ const n = await re({ uri: a, queryType: 1, kgId: y, zktype: s.zktype }), { elements: d, typeListObj: x, relationListObj: D } = F(n.data, { graphData: c, typeObj: w, relationObj: T, zktype: s.zktype });
192
193
  if (B(x), W(D), !((d == null ? void 0 : d.length) > 0)) {
193
194
  setTimeout(() => {
194
- C.destroy(), C.warning("暂无数据");
195
+ k.destroy(), k.warning("暂无数据");
195
196
  }, 2e3);
196
197
  return;
197
198
  }
@@ -204,7 +205,7 @@ const nt = ({
204
205
  // 随机偏移,避免完全重叠
205
206
  }), l = d.map((i) => {
206
207
  if (i.group === "nodes") {
207
- const b = 80 * X;
208
+ const b = je * X;
208
209
  return {
209
210
  ...i,
210
211
  style: {
@@ -235,12 +236,12 @@ const nt = ({
235
236
  zktype: s.zktype
236
237
  }
237
238
  };
238
- }), O = e.add(l);
239
+ }), S = e.add(l);
239
240
  P([...c, ...l]);
240
- const y = O.filter(":node"), U = y.map((i) => i.id());
241
+ const f = S.filter(":node"), U = f.map((i) => i.id());
241
242
  r.data("appendedNodes", U), r.data("isExpanded", !0);
242
- const f = e.nodes().difference(y);
243
- f.forEach((i) => i.lock()), M.placeNewNodes(y), e.layout({
243
+ const m = e.nodes().difference(f);
244
+ m.forEach((i) => i.lock()), M.placeNewNodes(f), e.layout({
244
245
  name: "cose-bilkent",
245
246
  randomize: !1,
246
247
  // ⚠️ 这是关键!保持已有节点位置不变
@@ -256,8 +257,8 @@ const nt = ({
256
257
  // 可以适当减少,因为只需要微调
257
258
  gravity: 0.6
258
259
  }).run(), setTimeout(() => {
259
- f.forEach((i) => i.unlock());
260
- }, 2e3), y.animate({
260
+ m.forEach((i) => i.unlock());
261
+ }, 2e3), f.animate({
261
262
  style: {
262
263
  opacity: 1,
263
264
  width: 20,
@@ -267,18 +268,18 @@ const nt = ({
267
268
  duration: 400,
268
269
  easing: "ease-out",
269
270
  complete: () => {
270
- y.style("opacity", ""), y.style("width", ""), y.style("height", "");
271
+ f.style("opacity", ""), f.style("width", ""), f.style("height", "");
271
272
  }
272
273
  }), setTimeout(() => {
273
274
  r.removed() || (r.style("border-width", ""), r.style("border-color", ""), e.center(r), e.zoom(e.zoom()));
274
275
  }, 600);
275
276
  } else
276
277
  console.log("没有找到相关节点数据");
277
- C.destroy();
278
+ k.destroy();
278
279
  } catch (n) {
279
- C.destroy(), C.error("请求接口失败"), console.error("22请求接口失败:", n);
280
+ k.destroy(), k.error("请求接口失败"), console.error("22请求接口失败:", n);
280
281
  }
281
- J(!1);
282
+ Z(!1);
282
283
  }
283
284
  L({ visible: !1 });
284
285
  }, fe = {
@@ -287,13 +288,13 @@ const nt = ({
287
288
  }, me = (s, a) => {
288
289
  var e;
289
290
  console.log("handleMenuAction:::", s, a);
290
- const g = a || u.targetNode;
291
- if (g) {
292
- const r = s.ids, t = g.data();
291
+ const y = a || g.targetNode;
292
+ if (y) {
293
+ const r = s.ids, t = y.data();
293
294
  if (["expanded", "contract"].includes(r))
294
- ye({ kgId: 3, ...t, zktype: fe[r] });
295
+ ye({ kgId: u.kgId, ...t, zktype: fe[r] });
295
296
  else if (r === "nodeInfo") {
296
- const o = g, n = {
297
+ const o = y, n = {
297
298
  id: o.id(),
298
299
  data: o.data(),
299
300
  position: o.position(),
@@ -303,19 +304,19 @@ const nt = ({
303
304
  classes: o.classes(),
304
305
  style: o.style()
305
306
  };
306
- Q.current.open(n);
307
- } else r === "knowledgeCard" && V.current.open(g.data());
308
- (e = s.onClick) == null || e.call(s, g), L({ visible: !1, x: 0, y: 0, targetNode: null });
307
+ J.current.open(n);
308
+ } else r === "knowledgeCard" && Q.current.open(y.data());
309
+ (e = s.onClick) == null || e.call(s, y), L({ visible: !1, x: 0, y: 0, targetNode: null });
309
310
  }
310
311
  };
311
- return console.log(111, !(((G = c == null ? void 0 : c.nodes) == null ? void 0 : G.length) > 0), c), /* @__PURE__ */ m(Oe, { value: { pathNodes: ue, setPathNodes: Y, graphInfo: h, graphData: c, layoutType: ce, setLayoutType: pe, knowledgeCardApi: ae }, children: /* @__PURE__ */ oe("div", { className: "cytoscape-container relative", children: [
312
- /* @__PURE__ */ m("div", { className: "btn-group" }),
313
- /* @__PURE__ */ m(
312
+ return console.log(111, !(((G = c == null ? void 0 : c.nodes) == null ? void 0 : G.length) > 0), c), /* @__PURE__ */ h(Oe, { value: { pathNodes: ue, setPathNodes: V, graphInfo: u, graphData: c, layoutType: ce, setLayoutType: pe, knowledgeCardApi: ae }, children: /* @__PURE__ */ oe("div", { className: "cytoscape-container relative", children: [
313
+ /* @__PURE__ */ h("div", { className: "btn-group" }),
314
+ /* @__PURE__ */ h(
314
315
  Ee,
315
316
  {
316
317
  ref: K,
317
318
  cyRef: p,
318
- graphInfo: h,
319
+ graphInfo: u,
319
320
  initNodeScale: X,
320
321
  cyContainerRef: j,
321
322
  typeObj: w,
@@ -325,14 +326,14 @@ const nt = ({
325
326
  }
326
327
  ),
327
328
  /* @__PURE__ */ oe("div", { className: "relative h-100", children: [
328
- /* @__PURE__ */ m("div", { ref: j, className: "cy-container" }),
329
- u.visible && u.targetNode && /* @__PURE__ */ m(
329
+ /* @__PURE__ */ h("div", { ref: j, className: "cy-container" }),
330
+ g.visible && g.targetNode && /* @__PURE__ */ h(
330
331
  "div",
331
332
  {
332
333
  style: {
333
334
  position: "absolute",
334
- left: `${u.x}px`,
335
- top: `${u.y}px`,
335
+ left: `${g.x}px`,
336
+ top: `${g.y}px`,
336
337
  // backgroundColor: 'white',
337
338
  // border: '1px solid #ccc',
338
339
  // borderRadius: '50%',
@@ -346,10 +347,10 @@ const nt = ({
346
347
  overflow: "hidden"
347
348
  },
348
349
  onClick: (s) => s.stopPropagation(),
349
- children: /* @__PURE__ */ m($e, { items: ge, centerImage: (ee = u == null ? void 0 : u.targetNode) == null ? void 0 : ee.data().image, targetNode: u.targetNode, onClick: (s, a) => me(s, a) })
350
+ children: /* @__PURE__ */ h(De, { items: ge, centerImage: (ee = g == null ? void 0 : g.targetNode) == null ? void 0 : ee.data().image, targetNode: g.targetNode, onClick: (s, a) => me(s, a) })
350
351
  }
351
352
  ),
352
- $.visible && /* @__PURE__ */ m(
353
+ $.visible && /* @__PURE__ */ h(
353
354
  "div",
354
355
  {
355
356
  style: {
@@ -373,10 +374,10 @@ const nt = ({
373
374
  }
374
375
  )
375
376
  ] }),
376
- /* @__PURE__ */ m(De, { ref: Q }),
377
- /* @__PURE__ */ m(Se, { ref: V })
377
+ /* @__PURE__ */ h(Se, { ref: J }),
378
+ /* @__PURE__ */ h(Ie, { ref: Q })
378
379
  ] }) });
379
380
  };
380
381
  export {
381
- nt as default
382
+ st as default
382
383
  };