react-kggraph 0.0.28 → 0.0.29

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.es3.js CHANGED
@@ -56,8 +56,8 @@ const lt = ({
56
56
  content: ""
57
57
  }), fe = De({ cyRef: g, setContextMenu: j, onPathAnalysis: (G = X.current) == null ? void 0 : G.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 });
59
+ const { nodes: n, links: s } = K || {};
60
+ ((n == null ? void 0 : n.length) > 0 || (s == null ? void 0 : s.length) > 0) && Oe(g, { nodes: n, links: s, isGrayed: !1 });
61
61
  }, [L(K), L(p)]), D(() => {
62
62
  const n = [], s = [];
63
63
  p.forEach((l) => {
package/lib/index.es7.js CHANGED
@@ -3,7 +3,7 @@ import K, { forwardRef as Re, useContext as et, useState as v, useRef as tt, use
3
3
  /* empty css */
4
4
  import { Dropdown as lt, Flex as y, Modal as st, Drawer as at, Tabs as ce, Form as f, Input as O, Select as u, ColorPicker as _, Button as ge, Row as rt, message as F } from "antd";
5
5
  import { utils as P, writeFile as it } from "./index.es21.js";
6
- import { textPositionConfig as me, textLayout as ct, downloadData as dt, choiceConfig as ht, linkAnalysis as gt, layoutCongig as mt, handleCalcPath as pt, getCyData as de, donwnGraphData as ut } from "./index.es8.js";
6
+ import { textPositionConfig as pe, textLayout as ct, downloadData as dt, choiceConfig as ht, linkAnalysis as gt, layoutCongig as pt, handleCalcPath as mt, getCyData as de, donwnGraphData as ut } from "./index.es8.js";
7
7
  import { GraphContext as ft } from "./index.es15.js";
8
8
  import { layout as bt, fixNodesToEdges as wt } from "./index.es9.js";
9
9
  import { defaultColors as H, nodeSize as q } from "./index.es10.js";
@@ -12,8 +12,8 @@ import Ct from "./index.es23.js";
12
12
  import vt from "./index.es24.js";
13
13
  import I from "./index.es17.js";
14
14
  import { downloadFile as he } from "./index.es12.js";
15
- import { actionList as xt, entityRelationList as Nt } from "./index.es4.js";
16
- import { DownOutlined as St, RightOutlined as Lt, UpOutlined as kt, LeftOutlined as Et } from "@ant-design/icons";
15
+ import { actionList as xt, entityRelationList as St } from "./index.es4.js";
16
+ import { DownOutlined as Nt, RightOutlined as Lt, UpOutlined as kt, LeftOutlined as Et } from "@ant-design/icons";
17
17
  const M = (b, c) => (k) => {
18
18
  k.stopPropagation(), b == null || b(c || "");
19
19
  }, Dt = (b) => {
@@ -35,11 +35,11 @@ const M = (b, c) => (k) => {
35
35
  graphInfo: b,
36
36
  cyRef: c,
37
37
  initNodeScale: k,
38
- typeObj: S,
38
+ typeObj: N,
39
39
  relationObj: V,
40
- colors: pe
40
+ colors: me
41
41
  }, ue) => {
42
- const W = { ...H, ...pe }, { layoutType: fe, setLayoutType: be, queryStatisticsConfig: L, actionBar: x } = et(ft), Q = typeof x == "boolean" ? x : !0, J = (x == null ? void 0 : x.position) || "top-left", U = (x == null ? void 0 : x.actionList) ?? xt, [j, we] = v((x == null ? void 0 : x.isExpand) ?? !1), [D, ye] = v(""), [Ce, G] = v(!1), [X, ve] = v(k), [xe, A] = v(!1), [Ne, z] = v(!1), [Y, Se] = v(null), [Le, R] = v(!1), [ee, te] = v(!1), [ke, Ee] = v("node"), T = tt(null), De = Array.isArray(L) ? L.length > 0 : L, [oe, Ie] = v(De), [ne, Ve] = v(/* @__PURE__ */ new Set()), [le, Pe] = v(/* @__PURE__ */ new Set());
42
+ const W = { ...H, ...me }, { layoutType: fe, setLayoutType: be, queryStatisticsConfig: L, actionBar: x } = et(ft), Q = typeof x == "boolean" ? x : !0, J = (x == null ? void 0 : x.position) || "top-left", U = (x == null ? void 0 : x.actionList) ?? xt, [j, we] = v((x == null ? void 0 : x.isExpand) ?? !1), [D, ye] = v(""), [Ce, G] = v(!1), [X, ve] = v(k), [xe, A] = v(!1), [Se, z] = v(!1), [Y, Ne] = v(null), [Le, R] = v(!1), [ee, te] = v(!1), [ke, Ee] = v("node"), T = tt(null), De = Array.isArray(L) ? L.length > 0 : L, [oe, Ie] = v(De), [ne, Ve] = v(/* @__PURE__ */ new Set()), [le, Pe] = v(/* @__PURE__ */ new Set());
43
43
  ot(ue, () => ({
44
44
  onPathAnalysis: () => {
45
45
  ae();
@@ -55,8 +55,8 @@ const M = (b, c) => (k) => {
55
55
  }
56
56
  o == null || o.nodes().removeClass("highlight selected grayed highlighted path-node"), o.elements().removeClass("level-highlight level-selected grayed path-edge");
57
57
  const n = o.nodes().filter((l) => {
58
- const i = (l.data("name") || "").toLowerCase(), s = (l.data("role") || "").toLowerCase(), h = (l.data("dept") || "").toLowerCase(), p = String(l.data("id") || "").toLowerCase();
59
- return i.includes(D.toLowerCase()) || s.includes(D.toLowerCase()) || h.includes(D.toLowerCase()) || p.includes(D.toLowerCase());
58
+ const i = (l.data("name") || "").toLowerCase(), s = (l.data("role") || "").toLowerCase(), h = (l.data("dept") || "").toLowerCase(), m = String(l.data("id") || "").toLowerCase();
59
+ return i.includes(D.toLowerCase()) || s.includes(D.toLowerCase()) || h.includes(D.toLowerCase()) || m.includes(D.toLowerCase());
60
60
  });
61
61
  o.nodes().removeClass("highlight"), n.addClass("highlight"), n.length === 1 ? (console.log("matchedNodes:::", n), o.animate({
62
62
  center: {
@@ -99,7 +99,7 @@ const M = (b, c) => (k) => {
99
99
  const e = c.current;
100
100
  if (!e) return;
101
101
  const o = de(e);
102
- Se(o), R(!0);
102
+ Ne(o), R(!0);
103
103
  }, re = (e, o) => {
104
104
  const n = e.current;
105
105
  if (!n) return;
@@ -114,29 +114,29 @@ const M = (b, c) => (k) => {
114
114
  }, Fe = () => {
115
115
  const e = c.current;
116
116
  if (!e) return;
117
- const o = de(e), { nodes: n = [], edges: l = [] } = o, i = n.map((p) => {
118
- var m, r;
119
- const d = p.data || {}, N = d.properties || {};
117
+ const o = de(e), { nodes: n = [], edges: l = [] } = o, i = n.map((m) => {
118
+ var p, r;
119
+ const d = m.data || {}, S = d.properties || {};
120
120
  return {
121
121
  节点名称: d.name || d.label || "",
122
122
  节点ID: d.id || "",
123
123
  节点类型: d.types || "",
124
124
  URI: d.label || "",
125
- X坐标: ((m = p.position) == null ? void 0 : m.x) || "",
126
- Y坐标: ((r = p.position) == null ? void 0 : r.y) || "",
125
+ X坐标: ((p = m.position) == null ? void 0 : p.x) || "",
126
+ Y坐标: ((r = m.position) == null ? void 0 : r.y) || "",
127
127
  层级: d.level || "",
128
128
  宽度: d.baseWidth || "",
129
129
  高度: d.baseHeight || "",
130
130
  图片: d.image || "",
131
- 属性ID: N.id || "",
132
- 属性值: N.value || ""
131
+ 属性ID: S.id || "",
132
+ 属性值: S.value || ""
133
133
  };
134
- }), s = l.map((p) => {
134
+ }), s = l.map((m) => {
135
135
  var r, a, w, E;
136
- const d = p.data || {}, N = ((a = (r = d.source) == null ? void 0 : r.split("/#")[0]) == null ? void 0 : a.split("/").pop()) || d.source, m = ((E = (w = d.target) == null ? void 0 : w.split("/#")[0]) == null ? void 0 : E.split("/").pop()) || d.target;
136
+ const d = m.data || {}, S = ((a = (r = d.source) == null ? void 0 : r.split("/#")[0]) == null ? void 0 : a.split("/").pop()) || d.source, p = ((E = (w = d.target) == null ? void 0 : w.split("/#")[0]) == null ? void 0 : E.split("/").pop()) || d.target;
137
137
  return {
138
- 源节点: N,
139
- 目标节点: m,
138
+ 源节点: S,
139
+ 目标节点: p,
140
140
  源URI: d.source || "",
141
141
  目标URI: d.target || "",
142
142
  关系名称: d.name || d.label || "",
@@ -144,8 +144,8 @@ const M = (b, c) => (k) => {
144
144
  };
145
145
  }), h = P.book_new();
146
146
  if (i.length > 0) {
147
- const p = P.json_to_sheet(i);
148
- p["!cols"] = [
147
+ const m = P.json_to_sheet(i);
148
+ m["!cols"] = [
149
149
  { wch: 30 },
150
150
  // 节点名称
151
151
  { wch: 60 },
@@ -170,11 +170,11 @@ const M = (b, c) => (k) => {
170
170
  // 属性ID
171
171
  { wch: 40 }
172
172
  // 属性值
173
- ], P.book_append_sheet(h, p, "节点");
173
+ ], P.book_append_sheet(h, m, "节点");
174
174
  }
175
175
  if (s.length > 0) {
176
- const p = P.json_to_sheet(s);
177
- p["!cols"] = [
176
+ const m = P.json_to_sheet(s);
177
+ m["!cols"] = [
178
178
  { wch: 30 },
179
179
  // 源节点
180
180
  { wch: 30 },
@@ -187,7 +187,7 @@ const M = (b, c) => (k) => {
187
187
  // 关系名称
188
188
  { wch: 40 }
189
189
  // 关系ID
190
- ], P.book_append_sheet(h, p, "关系");
190
+ ], P.book_append_sheet(h, m, "关系");
191
191
  }
192
192
  it(h, `graph_${Date.now()}.xlsx`);
193
193
  }, He = (e, o) => {
@@ -255,17 +255,17 @@ const M = (b, c) => (k) => {
255
255
  const n = c.current;
256
256
  if (!n) return;
257
257
  n.elements().removeClass("level-highlight level-selected grayed path-edge");
258
- const l = n.nodes().filter((m) => (m.data("name") || m.data("id") || "").toString().includes(e));
258
+ const l = n.nodes().filter((p) => (p.data("name") || p.data("id") || "").toString().includes(e));
259
259
  if (l.length === 0) {
260
260
  F.warning(`未找到节点: ${e}`);
261
261
  return;
262
262
  }
263
263
  const i = parseInt(o) || 1, s = n.collection(), h = [];
264
- l.forEach((m) => {
265
- m.addClass("level-selected"), s.merge(m);
264
+ l.forEach((p) => {
265
+ p.addClass("level-selected"), s.merge(p);
266
266
  let r = n.collection();
267
267
  const a = /* @__PURE__ */ new Set();
268
- a.add(m.id()), i >= 1 && (r = m.neighborhood().nodes(), r.forEach((w) => {
268
+ a.add(p.id()), i >= 1 && (r = p.neighborhood().nodes(), r.forEach((w) => {
269
269
  a.add(w.id()), s.merge(w);
270
270
  }), h.push(r));
271
271
  for (let w = 2; w <= i; w++) {
@@ -276,10 +276,10 @@ const M = (b, c) => (k) => {
276
276
  });
277
277
  }), E.forEach(($) => s.merge($)), h.push(E), r = E;
278
278
  }
279
- }), h.forEach((m) => {
280
- m.addClass("level-highlight");
281
- }), n.edges().filter((m) => {
282
- const r = m.source(), a = m.target();
279
+ }), h.forEach((p) => {
280
+ p.addClass("level-highlight");
281
+ }), n.edges().filter((p) => {
282
+ const r = p.source(), a = p.target();
283
283
  return s.contains(r) && s.contains(a);
284
284
  }).addClass("path-edge");
285
285
  const d = n.elements().filter(".level-selected, .level-highlight, .path-edge");
@@ -306,8 +306,8 @@ const M = (b, c) => (k) => {
306
306
  console.log("saveNodeConfig values:", e), console.log("showLabel value:", e.showLabel);
307
307
  const n = typeof e.fontColor == "object" && ((s = (i = e.fontColor) == null ? void 0 : i.toHexString) == null ? void 0 : s.call(i)) || e.fontColor, l = e.showLabel === "show";
308
308
  console.log("showLabelValue:", l), o.nodes().forEach((h) => {
309
- const p = l && (h.data("name") || h.data("label")) || "";
310
- console.log("Setting node label:", p), h.style({
309
+ const m = l && (h.data("name") || h.data("label")) || "";
310
+ console.log("Setting node label:", m), h.style({
311
311
  width: e.nodeSize,
312
312
  height: e.nodeSize,
313
313
  "font-size": e.fontSize,
@@ -317,16 +317,16 @@ const M = (b, c) => (k) => {
317
317
  "text-valign": e.textPosition,
318
318
  "text-halign": "center",
319
319
  "text-margin-y": e.textOffset,
320
- label: p,
321
- "text-opacity": p ? 1 : 0
320
+ label: m,
321
+ "text-opacity": m ? 1 : 0
322
322
  });
323
323
  }), F.success("节点配置保存成功");
324
324
  }, Ge = (e) => {
325
- var h, p, d, N, m, r;
325
+ var h, m, d, S, p, r;
326
326
  const o = c.current;
327
327
  if (!o) return;
328
328
  console.log("saveEdgeConfig values:", e), console.log("edge showLabel value:", e.showLabel);
329
- const n = typeof e.edgeColor == "object" && ((p = (h = e.edgeColor) == null ? void 0 : h.toHexString) == null ? void 0 : p.call(h)) || e.edgeColor, l = typeof e.fontColor == "object" && ((N = (d = e.fontColor) == null ? void 0 : d.toHexString) == null ? void 0 : N.call(d)) || e.fontColor, i = typeof e.labelBgColor == "object" && ((r = (m = e.labelBgColor) == null ? void 0 : m.toHexString) == null ? void 0 : r.call(m)) || e.labelBgColor, s = e.showLabel === "show";
329
+ const n = typeof e.edgeColor == "object" && ((m = (h = e.edgeColor) == null ? void 0 : h.toHexString) == null ? void 0 : m.call(h)) || e.edgeColor, l = typeof e.fontColor == "object" && ((S = (d = e.fontColor) == null ? void 0 : d.toHexString) == null ? void 0 : S.call(d)) || e.fontColor, i = typeof e.labelBgColor == "object" && ((r = (p = e.labelBgColor) == null ? void 0 : p.toHexString) == null ? void 0 : r.call(p)) || e.labelBgColor, s = e.showLabel === "show";
330
330
  o.edges().forEach((a) => {
331
331
  const w = s && (a.data("label") || a.data("name")) || "";
332
332
  console.log("Setting edge label:", w), a.style({
@@ -347,12 +347,12 @@ const M = (b, c) => (k) => {
347
347
  }), F.success("连线配置保存成功");
348
348
  }, Xe = Dt(J), C = J === "left" || J === "right";
349
349
  if (console.log(1e3, Q, U), !Q) return null;
350
- const Ye = Array.isArray(L) && (L == null ? void 0 : L.length) > 0 ? L : Nt, ie = () => /* @__PURE__ */ g(rt, { justify: "center", align: "middle", className: I("cursor", {
350
+ const Ye = Array.isArray(L) && (L == null ? void 0 : L.length) > 0 ? L : St, ie = () => /* @__PURE__ */ g(rt, { justify: "center", align: "middle", className: I("cursor", {
351
351
  "oprate-btn-vertical": C,
352
352
  "oprate-btn": !C
353
353
  }), onClick: () => we(!j), children: [
354
354
  "操作 ",
355
- j ? C ? /* @__PURE__ */ t(St, {}) : /* @__PURE__ */ t(Lt, {}) : C ? /* @__PURE__ */ t(kt, {}) : /* @__PURE__ */ t(Et, {})
355
+ j ? C ? /* @__PURE__ */ t(Nt, {}) : /* @__PURE__ */ t(Lt, {}) : C ? /* @__PURE__ */ t(kt, {}) : /* @__PURE__ */ t(Et, {})
356
356
  ] });
357
357
  return /* @__PURE__ */ g(Z, { children: [
358
358
  /* @__PURE__ */ t("div", { className: I("graph-bar", { "graph-bar-vertical": C }), style: Xe, children: /* @__PURE__ */ g("div", { className: I("graph-bar-min", {
@@ -365,7 +365,7 @@ const M = (b, c) => (k) => {
365
365
  "collapsed-vertical": !j && C,
366
366
  collapsed: !j && !C
367
367
  }), children: U.map(({ key: e, title: o, icon: n, onClick: l }) => {
368
- var p, d, N, m;
368
+ var m, d, S, p;
369
369
  const i = () => n && n.length > 0 ? n.length > 1 ? /* @__PURE__ */ t(y, { gap: "5px", children: n.map((r, a) => e === "nodeZoom" ? K.cloneElement(r, {
370
370
  onClick: () => $e(a === 0 ? "in" : "out"),
371
371
  key: a
@@ -394,7 +394,7 @@ const M = (b, c) => (k) => {
394
394
  let r = [];
395
395
  switch (e) {
396
396
  case "layout":
397
- r = (p = mt) == null ? void 0 : p.map((a) => ({
397
+ r = (m = pt) == null ? void 0 : m.map((a) => ({
398
398
  ...a,
399
399
  label: /* @__PURE__ */ t("div", { className: I({ "text-[#145afd]": fe === a.key }), onClick: M(Ae, a.key), children: a.label })
400
400
  }));
@@ -421,10 +421,10 @@ const M = (b, c) => (k) => {
421
421
  r = (d = ht) == null ? void 0 : d.map((a) => ({ ...a, label: /* @__PURE__ */ t("div", { onClick: M(We, a.key), children: a.label }) }));
422
422
  break;
423
423
  case "downloadData":
424
- r = (N = dt) == null ? void 0 : N.map((a) => ({ ...a, label: /* @__PURE__ */ t("div", { onClick: (w) => He(w, a.key), children: a.label }) }));
424
+ r = (S = dt) == null ? void 0 : S.map((a) => ({ ...a, label: /* @__PURE__ */ t("div", { onClick: (w) => He(w, a.key), children: a.label }) }));
425
425
  break;
426
426
  case "textPosition":
427
- r = (m = me) == null ? void 0 : m.map((a) => ({ ...a, label: /* @__PURE__ */ t("div", { onClick: M(() => ct(c, a.key), a.key), children: a.label }) }));
427
+ r = (p = pe) == null ? void 0 : p.map((a) => ({ ...a, label: /* @__PURE__ */ t("div", { onClick: M(() => ct(c, a.key), a.key), children: a.label }) }));
428
428
  break;
429
429
  }
430
430
  return /* @__PURE__ */ t(lt, { trigger: ["hover"], placement: C ? "bottomRight" : "bottom", menu: { items: r }, children: /* @__PURE__ */ g(y, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor bar-item", children: [
@@ -440,7 +440,7 @@ const M = (b, c) => (k) => {
440
440
  C && ie()
441
441
  ] }) }),
442
442
  /* @__PURE__ */ t(yt, { isVisible: xe, searchChange: (e) => Be(e), closeQuery: () => A(!1) }),
443
- /* @__PURE__ */ t(Ct, { isVisible: Ne, analysis: (e) => pt(c, { pathNodes: e.map((o) => ({ id: o })) }), closePath: () => z(!1) }),
443
+ /* @__PURE__ */ t(Ct, { isVisible: Se, analysis: (e) => mt(c, { nodes: e.map((o) => ({ id: o })) }), closePath: () => z(!1) }),
444
444
  /* @__PURE__ */ t(vt, { ref: T, onLevelClick: Ze }),
445
445
  /* @__PURE__ */ t(
446
446
  st,
@@ -501,37 +501,37 @@ const M = (b, c) => (k) => {
501
501
  return e === "entity" ? {
502
502
  label: o,
503
503
  key: e,
504
- children: /* @__PURE__ */ t(Z, { children: Object.keys(S).length > 0 ? /* @__PURE__ */ g("div", { className: "static-wraper", children: [
505
- /* @__PURE__ */ g(y, { justify: "space-between", children: [
504
+ children: /* @__PURE__ */ t(Z, { children: Object.keys(N).length > 0 ? /* @__PURE__ */ g("div", { children: [
505
+ /* @__PURE__ */ g(y, { justify: "space-between", className: "font-12", children: [
506
506
  /* @__PURE__ */ t("span", { children: "实体数量:" }),
507
- /* @__PURE__ */ t("span", { className: "color-333", children: Object.values(S).reduce((s, h) => s + h.count, 0) })
507
+ /* @__PURE__ */ t("span", { children: Object.values(N).reduce((s, h) => s + h.count, 0) })
508
508
  ] }),
509
- /* @__PURE__ */ g(y, { className: "my-4px", justify: "space-between", children: [
509
+ /* @__PURE__ */ g(y, { className: "my-4px font-12", justify: "space-between", children: [
510
510
  /* @__PURE__ */ t("span", { children: "实体类型:" }),
511
- /* @__PURE__ */ t("span", { className: "color-333", children: Object.keys(S).length })
511
+ /* @__PURE__ */ t("span", { children: Object.keys(N).length })
512
512
  ] }),
513
- /* @__PURE__ */ t(y, { gap: "5px", justify: "start", className: "w-100", wrap: !0, children: Object.keys(S).map((s) => /* @__PURE__ */ g(y, { gap: "4px", justify: "space-between", className: `w-100 cursor ${ne.has(s) ? "opacity-30" : ""}`, onClick: () => Ke(s), children: [
513
+ /* @__PURE__ */ t(y, { gap: "5px", justify: "start", className: "w-100 static-wraper", wrap: !0, children: Object.keys(N).map((s) => /* @__PURE__ */ g(y, { gap: "4px", justify: "space-between", className: `w-100 cursor ${ne.has(s) ? "opacity-30" : ""}`, onClick: () => Ke(s), children: [
514
514
  /* @__PURE__ */ g(y, { align: "center", gap: "2px", children: [
515
- /* @__PURE__ */ t("img", { className: "w-20px rounded-50", src: S[s].img, alt: "" }),
515
+ /* @__PURE__ */ t("img", { className: "w-20px rounded-50", src: N[s].img, alt: "" }),
516
516
  s,
517
517
  ":"
518
518
  ] }),
519
- /* @__PURE__ */ t("span", { className: "color-333", children: S[s].count })
519
+ /* @__PURE__ */ t("span", { className: "color-333", children: N[s].count })
520
520
  ] }, s)) })
521
521
  ] }) : /* @__PURE__ */ t("span", { className: "text-666", children: "暂无实体统计!" }) })
522
522
  } : e === "relation" ? {
523
523
  label: o,
524
524
  key: e,
525
- children: /* @__PURE__ */ t(Z, { children: ((n = Object.keys(V)) == null ? void 0 : n.length) > 0 ? /* @__PURE__ */ g("div", { className: "static-wraper", children: [
526
- /* @__PURE__ */ g(y, { justify: "space-between", children: [
525
+ children: /* @__PURE__ */ t(Z, { children: ((n = Object.keys(V)) == null ? void 0 : n.length) > 0 ? /* @__PURE__ */ g("div", { children: [
526
+ /* @__PURE__ */ g(y, { justify: "space-between", className: "font-12", children: [
527
527
  /* @__PURE__ */ t("span", { children: "关系数量:" }),
528
- /* @__PURE__ */ t("span", { className: "color-333", children: (l = Object.keys(V)) == null ? void 0 : l.length })
528
+ /* @__PURE__ */ t("span", { children: (l = Object.keys(V)) == null ? void 0 : l.length })
529
529
  ] }),
530
- /* @__PURE__ */ g(y, { className: "my-4px", justify: "space-between", children: [
530
+ /* @__PURE__ */ g(y, { className: "my-4px font-12", justify: "space-between", children: [
531
531
  /* @__PURE__ */ t("span", { children: "关系类型:" }),
532
- /* @__PURE__ */ t("span", { className: "color-333", children: (i = Object.values(V)) == null ? void 0 : i.reduce((s, h) => s + h, 0) })
532
+ /* @__PURE__ */ t("span", { children: (i = Object.values(V)) == null ? void 0 : i.reduce((s, h) => s + h, 0) })
533
533
  ] }),
534
- /* @__PURE__ */ t(y, { gap: "5px", justify: "start", className: "w-100", wrap: !0, children: Object.keys(V).map((s) => /* @__PURE__ */ g(y, { gap: "4px", justify: "space-between", className: `w-100 cursor ${le.has(s) ? "opacity-30" : ""}`, onClick: () => Me(s), children: [
534
+ /* @__PURE__ */ t(y, { gap: "5px", justify: "start", className: "w-100 static-wraper", wrap: !0, children: Object.keys(V).map((s) => /* @__PURE__ */ g(y, { gap: "4px", justify: "space-between", className: `w-100 cursor ${le.has(s) ? "opacity-30" : ""}`, onClick: () => Me(s), children: [
535
535
  /* @__PURE__ */ g("span", { children: [
536
536
  s,
537
537
  ":"
@@ -553,7 +553,7 @@ const M = (b, c) => (k) => {
553
553
  /* @__PURE__ */ t(u.Option, { value: "show", children: "显示" }),
554
554
  /* @__PURE__ */ t(u.Option, { value: "hide", children: "隐藏" })
555
555
  ] }) }),
556
- /* @__PURE__ */ t(f.Item, { label: "字体位置", name: "textPosition", initialValue: "bottom", children: /* @__PURE__ */ t(u, { children: me.map((S) => /* @__PURE__ */ t(u.Option, { value: S.key, children: S.label }, S.key)) }) }),
556
+ /* @__PURE__ */ t(f.Item, { label: "字体位置", name: "textPosition", initialValue: "bottom", children: /* @__PURE__ */ t(u, { children: pe.map((N) => /* @__PURE__ */ t(u.Option, { value: N.key, children: N.label }, N.key)) }) }),
557
557
  /* @__PURE__ */ t(f.Item, { label: "字体偏移", name: "textOffset", initialValue: 5, children: /* @__PURE__ */ t(O, { type: "number", placeholder: "请输入字体偏移量" }) }),
558
558
  /* @__PURE__ */ t(f.Item, { label: "字体颜色", name: "fontColor", initialValue: c.nodeLabelColor, children: /* @__PURE__ */ t(_, { showText: !0 }) }),
559
559
  /* @__PURE__ */ t(f.Item, { label: "字体大小", name: "fontSize", initialValue: c.nodeLabelFontSize, children: /* @__PURE__ */ t(O, { type: "number", placeholder: "请输入字体大小" }) }),
package/lib/index.es8.js CHANGED
@@ -1,86 +1,86 @@
1
1
  import { message as v } from "antd";
2
- import j from "./index.es25.js";
3
- import I from "./index.es26.js";
4
- import P from "./index.es27.js";
5
- import D from "./index.es28.js";
6
- import $ from "./index.es29.js";
7
- import J from "./index.es30.js";
8
- import R from "./index.es31.js";
9
- import A from "./index.es32.js";
10
- import G from "./index.es33.js";
2
+ import O from "./index.es25.js";
3
+ import j from "./index.es26.js";
4
+ import I from "./index.es27.js";
5
+ import P from "./index.es28.js";
6
+ import D from "./index.es29.js";
7
+ import $ from "./index.es30.js";
8
+ import J from "./index.es31.js";
9
+ import R from "./index.es32.js";
10
+ import A from "./index.es33.js";
11
11
  import q from "./index.es34.js";
12
12
  import B from "./index.es35.js";
13
- import L from "./index.es36.js";
14
- import { jsonStringifyParse as T } from "./index.es12.js";
15
- const E = [j, I, P, D, $, J, R, A, G, q], U = (r) => {
13
+ import T from "./index.es36.js";
14
+ import { jsonStringifyParse as U } from "./index.es12.js";
15
+ const N = [O, j, I, P, D, $, J, R, A, q], W = (s) => {
16
16
  let o = { _: { count: 0 } };
17
- const l = {}, t = [];
18
- return r.forEach((e) => {
19
- var m;
17
+ const r = {}, t = [];
18
+ return s.forEach((e) => {
19
+ var y;
20
20
  const { group: c } = e;
21
21
  if (c === "nodes") {
22
- const d = e.data, n = (m = d.properties) == null ? void 0 : m.type, a = d.type;
23
- !a && n === "uri" ? o = { ...o, _: { ...o[a], count: o._.count + 1 } } : !t.includes(a) && n === "uri" ? (t.push(a), o = { ...o, [a]: { ...o[a], count: 1, img: d.image } }) : n === "uri" && a && (o = { ...o, [a]: { ...o[a], img: d.image, count: o[a].count + 1 } });
22
+ const d = e.data, a = (y = d.properties) == null ? void 0 : y.type, l = d.type;
23
+ !l && a === "uri" ? o = { ...o, _: { ...o[l], count: o._.count + 1 } } : !t.includes(l) && a === "uri" ? (t.push(l), o = { ...o, [l]: { ...o[l], count: 1, img: d.image } }) : a === "uri" && l && (o = { ...o, [l]: { ...o[l], img: d.image, count: o[l].count + 1 } });
24
24
  } else if (c === "edges") {
25
- const d = e.data, { label: n } = d;
26
- l[n] ? l[n] = l[n] + 1 : l[n] = 1;
25
+ const d = e.data, { label: a } = d;
26
+ r[a] ? r[a] = r[a] + 1 : r[a] = 1;
27
27
  } else
28
28
  console.log("nonono");
29
29
  }), {
30
30
  typeListArr: t,
31
31
  typeListObj: o,
32
- relationListObj: l
32
+ relationListObj: r
33
33
  };
34
- }, ae = (r, { graphData: o = [], typeObj: l, zktype: t, graphInfo: e = {} }) => {
35
- console.log(888, r);
36
- let c = T(l);
37
- const m = Object.keys(l), d = e.searchNodes || [], n = new Set(
38
- (o == null ? void 0 : o.map((p) => {
39
- var i, h, s;
40
- return p.group === "nodes" ? (i = p.data) == null ? void 0 : i.id : ((h = p.data) == null ? void 0 : h.source) + "-" + ((s = p.data) == null ? void 0 : s.target);
34
+ }, ne = (s, { graphData: o = [], typeObj: r, zktype: t, graphInfo: e = {} }) => {
35
+ console.log(888, s);
36
+ let c = U(r);
37
+ const y = Object.keys(r), d = e.searchNodes || [], a = new Set(
38
+ (o == null ? void 0 : o.map((g) => {
39
+ var i, f, n;
40
+ return g.group === "nodes" ? (i = g.data) == null ? void 0 : i.id : ((f = g.data) == null ? void 0 : f.source) + "-" + ((n = g.data) == null ? void 0 : n.target);
41
41
  }).filter(Boolean)) || []
42
- ), { nodes: a = [], links: u = [] } = r || {}, y = [], g = (p) => {
43
- p.forEach((i) => {
44
- var h, s;
45
- if (!n.has(i.id)) {
46
- const x = (h = i.properties) == null ? void 0 : h.type, f = i.type, N = i.label.split("#").pop();
42
+ ), { nodes: l = [], links: p = [] } = s || {}, m = [], h = (g) => {
43
+ g.forEach((i) => {
44
+ var f, n;
45
+ if (!a.has(i.id)) {
46
+ const x = (f = i.properties) == null ? void 0 : f.type, C = i.type, E = i.label.split("#").pop();
47
47
  let w = -1;
48
- if (!f && x === "uri")
49
- w = i.image || E[0];
50
- else if (!m.includes(f) && x === "uri") {
51
- m.push(f);
52
- const O = m.indexOf(f);
53
- w = i.image || E[O] || E[0], c = { ...c, [f]: { ...c[f], img: w } };
54
- } else x === "uri" && f ? w = (s = c[f]) == null ? void 0 : s.img : x === "typed-literal" && (w = B);
55
- const S = {
48
+ if (!C && x === "uri")
49
+ w = i.image || N[0];
50
+ else if (!y.includes(C) && x === "uri") {
51
+ y.push(C);
52
+ const S = y.indexOf(C);
53
+ w = i.image || N[S] || N[0], c = { ...c, [C]: { ...c[C], img: w } };
54
+ } else x === "uri" && C ? w = (n = c[C]) == null ? void 0 : n.img : x === "typed-literal" && (w = B);
55
+ const L = {
56
56
  ...i,
57
- name: N,
57
+ name: E,
58
58
  "properties-type": x,
59
- image: d.includes(N) ? L : w,
59
+ image: d.includes(E) ? T : w,
60
60
  baseWidth: 80,
61
61
  // 保存基础宽度
62
62
  baseHeight: 80
63
63
  // 保存基础高度
64
64
  };
65
- y.push({ group: "nodes", data: S });
65
+ m.push({ group: "nodes", data: L });
66
66
  }
67
67
  });
68
68
  };
69
- ((p) => {
70
- p.forEach((i) => {
71
- const { label: h } = i, s = `${i.source}-${i.target}`;
72
- n.has(s) || y.push({ group: "edges", data: { ...i, name: h, zktype: t } });
69
+ ((g) => {
70
+ g.forEach((i) => {
71
+ const { label: f } = i, n = `${i.source}-${i.target}`;
72
+ a.has(n) || m.push({ group: "edges", data: { ...i, name: f, zktype: t } });
73
73
  });
74
- })(u), g(a);
75
- const { typeListObj: k, relationListObj: C } = U([...y, ...o]);
74
+ })(p), h(l);
75
+ const { typeListObj: k, relationListObj: b } = W([...m, ...o]);
76
76
  return {
77
- elements: y,
77
+ elements: m,
78
78
  typeListObj: k,
79
- relationListObj: C
79
+ relationListObj: b
80
80
  };
81
- }, se = (r, o) => {
82
- const l = r.current;
83
- if (!l) return;
81
+ }, se = (s, o) => {
82
+ const r = s.current;
83
+ if (!r) return;
84
84
  let t = {
85
85
  color: "#000"
86
86
  };
@@ -125,87 +125,87 @@ const E = [j, I, P, D, $, J, R, A, G, q], U = (r) => {
125
125
  };
126
126
  break;
127
127
  }
128
- l.nodes().style(t), l.style().update();
129
- }, W = (r, o) => {
130
- let l = r.collection(), t = r.collection();
131
- o.forEach(({ source: e, target: c, label: m }) => {
132
- const d = e ? r.nodes().filter((a) => a.data("id") === e) : r.collection(), n = c ? r.nodes().filter((a) => a.data("id") === c) : r.collection();
133
- d.length > 0 && n.length > 0 && d.forEach((a) => {
134
- n.forEach((u) => {
135
- let y = a.edgesWith(u).filter((g) => {
136
- const b = g.data("source") === a.id() && g.data("target") === u.id(), k = m ? g.data("label") === m : !0;
137
- return b && k;
128
+ r.nodes().style(t), r.style().update();
129
+ }, G = (s, o, r = !0) => {
130
+ let t = s.collection(), e = s.collection();
131
+ o.forEach(({ source: c, target: y, label: d }) => {
132
+ const a = c ? s.nodes().filter((p) => p.data("id") === c) : s.collection(), l = y ? s.nodes().filter((p) => p.data("id") === y) : s.collection();
133
+ a.length > 0 && l.length > 0 && a.forEach((p) => {
134
+ l.forEach((m) => {
135
+ let h = p.edgesWith(m).filter((u) => {
136
+ const k = u.data("source") === p.id() && u.data("target") === m.id(), b = d ? u.data("label") === d : !0;
137
+ return k && b;
138
138
  });
139
- t = t.union(y), l = l.union(a).union(u);
139
+ e = e.union(h), t = t.union(p).union(m);
140
140
  });
141
141
  });
142
- }), console.log(777, t.length), t.length > 0 ? (l.addClass("path-node"), t.addClass("path-edge"), isGrayed && (r.nodes().not(l).addClass("grayed"), r.edges().not(t).addClass("grayed"))) : v.warning("未找到匹配的路径边!");
143
- }, le = async (r, { pathNodes: o, isGrayed: l = !0, pathLinks: t }) => {
144
- const e = r.current;
142
+ }), console.log(777, e.length), e.length > 0 ? (t.addClass("path-node"), e.addClass("path-edge"), r && (s.nodes().not(t).addClass("grayed"), s.edges().not(e).addClass("grayed"))) : v.warning("未找到匹配的路径边!");
143
+ }, le = async (s, { nodes: o, isGrayed: r = !0, links: t }) => {
144
+ const e = s.current;
145
145
  let c = [];
146
146
  if (!e)
147
147
  return;
148
148
  if (e.nodes().removeClass("path-node").removeClass("grayed"), e.edges().removeClass("path-edge").removeClass("grayed"), (t == null ? void 0 : t.length) > 0) {
149
- W(e, t);
149
+ G(e, t);
150
150
  return;
151
151
  }
152
152
  if (!((o == null ? void 0 : o.length) > 1)) {
153
153
  v.warning("请至少设置 2 个路径节点!");
154
154
  return;
155
155
  }
156
- if ((t == null ? void 0 : t.length) > 0 || (c = o.map((n) => n.id)), console.log(856666, t, c), [...new Set(c)].length !== c.length) {
156
+ if ((t == null ? void 0 : t.length) > 0 || (c = o.map((a) => a.id)), [...new Set(c)].length !== c.length) {
157
157
  v.warning("路径中存在重复节点,请检查!");
158
158
  return;
159
159
  }
160
160
  const d = [];
161
- for (const n of c) {
162
- const a = e.nodes().filter((u) => u.data("name") === n);
163
- if (a.length > 0)
164
- d.push(a.id());
161
+ for (const a of c) {
162
+ const l = e.nodes().filter((p) => p.data("name") === a);
163
+ if (l.length > 0)
164
+ d.push(l.id());
165
165
  else {
166
- e.nodes().removeClass("path-node"), e.edges().removeClass("path-edge"), v.warning(`找不到节点:${n}`);
166
+ e.nodes().removeClass("path-node"), e.edges().removeClass("path-edge"), v.warning(`找不到节点:${a}`);
167
167
  return;
168
168
  }
169
169
  }
170
170
  try {
171
171
  e.nodes().removeClass("path-node").removeClass("grayed"), e.edges().removeClass("path-edge").removeClass("grayed");
172
- let n = e.collection(), a = 0, u = !0;
173
- const y = [];
174
- for (let g = 0; g < d.length - 1; g++) {
175
- const b = d[g], k = d[g + 1], C = e.getElementById(b), p = e.getElementById(k), i = C.edgesWith(p).filter(function(s) {
176
- return s.data("source") === b && s.data("target") === k;
177
- }), h = p.edgesWith(C).filter(function(s) {
178
- return s.data("source") === k && s.data("target") === b;
172
+ let a = e.collection(), l = 0, p = !0;
173
+ const m = [];
174
+ for (let h = 0; h < d.length - 1; h++) {
175
+ const u = d[h], k = d[h + 1], b = e.getElementById(u), g = e.getElementById(k), i = b.edgesWith(g).filter(function(n) {
176
+ return n.data("source") === u && n.data("target") === k;
177
+ }), f = g.edgesWith(b).filter(function(n) {
178
+ return n.data("source") === k && n.data("target") === u;
179
179
  });
180
- if (i.length > 0 || h.length > 0) {
181
- const s = i.add(h);
182
- n = n.union(s).union(C).union(p), a += s.length, C.addClass("path-node"), p.addClass("path-node"), s.addClass("path-edge"), y.push(C.data("name"), p.data("name")), console.log(`找到直接连接的边:正向${i.length}条,反向${h.length}条`);
180
+ if (i.length > 0 || f.length > 0) {
181
+ const n = i.add(f);
182
+ a = a.union(n).union(b).union(g), l += n.length, b.addClass("path-node"), g.addClass("path-node"), n.addClass("path-edge"), m.push(b.data("name"), g.data("name")), console.log(`找到直接连接的边:正向${i.length}条,反向${f.length}条`);
183
183
  } else {
184
- const s = e.elements().aStar({
185
- root: C,
186
- goal: p,
184
+ const n = e.elements().aStar({
185
+ root: b,
186
+ goal: g,
187
187
  directed: !1
188
188
  });
189
- if (s.found && s.path) {
190
- n = n.union(s.path), a += s.distance, s.path.nodes().addClass("path-node"), s.path.edges().addClass("path-edge");
191
- const x = s.path.nodes().map((f) => f.data("name"));
192
- y.push(...x);
189
+ if (n.found && n.path) {
190
+ a = a.union(n.path), l += n.distance, n.path.nodes().addClass("path-node"), n.path.edges().addClass("path-edge");
191
+ const x = n.path.nodes().map((C) => C.data("name"));
192
+ m.push(...x);
193
193
  } else {
194
- u = !1, console.log(`节点 ${c[g]} 和 ${c[g + 1]} 之间没有路径`);
194
+ p = !1, console.log(`节点 ${c[h]} 和 ${c[h + 1]} 之间没有路径`);
195
195
  break;
196
196
  }
197
197
  }
198
198
  }
199
- if (u && n.length > 0) {
200
- const g = n.nodes(), b = n.edges();
201
- g.addClass("path-node"), b.addClass("path-edge"), l && (e.nodes().not(g).addClass("grayed"), e.edges().not(b).addClass("grayed"));
199
+ if (p && a.length > 0) {
200
+ const h = a.nodes(), u = a.edges();
201
+ h.addClass("path-node"), u.addClass("path-edge"), r && (e.nodes().not(h).addClass("grayed"), e.edges().not(u).addClass("grayed"));
202
202
  } else
203
203
  v.warning("无法找到完整的路径!");
204
- } catch (n) {
205
- console.error(2e3, "计算路径时出错:", n), v.warning("计算路径时出错,请重试!");
204
+ } catch (a) {
205
+ console.error(2e3, "计算路径时出错:", a), v.warning("计算路径时出错,请重试!");
206
206
  }
207
- }, M = (r) => {
208
- const o = r.nodes().map((e) => ({
207
+ }, M = (s) => {
208
+ const o = s.nodes().map((e) => ({
209
209
  data: e.data(),
210
210
  position: e.position(),
211
211
  style: {
@@ -213,7 +213,7 @@ const E = [j, I, P, D, $, J, R, A, G, q], U = (r) => {
213
213
  height: e.style("height"),
214
214
  backgroundColor: e.style("background-color")
215
215
  }
216
- })), l = r.edges().map((e) => ({
216
+ })), r = s.edges().map((e) => ({
217
217
  data: e.data(),
218
218
  style: {
219
219
  width: e.style("width"),
@@ -221,9 +221,9 @@ const E = [j, I, P, D, $, J, R, A, G, q], U = (r) => {
221
221
  "target-arrow-color": e.style("target-arrow-color")
222
222
  }
223
223
  }));
224
- return { nodes: o, edges: l };
225
- }, re = (r) => {
226
- const o = M(r), l = new Blob([JSON.stringify(o, null, 2)], { type: "application/json" }), t = URL.createObjectURL(l), e = document.createElement("a");
224
+ return { nodes: o, edges: r };
225
+ }, re = (s) => {
226
+ const o = M(s), r = new Blob([JSON.stringify(o, null, 2)], { type: "application/json" }), t = URL.createObjectURL(r), e = document.createElement("a");
227
227
  e.href = t, e.download = `graph-data-${Date.now()}.json`, e.click(), URL.revokeObjectURL(t);
228
228
  }, ie = [
229
229
  {
@@ -336,10 +336,10 @@ export {
336
336
  ge as downloadData,
337
337
  M as getCyData,
338
338
  le as handleCalcPath,
339
- E as imageMap,
339
+ N as imageMap,
340
340
  ie as layoutCongig,
341
341
  ce as linkAnalysis,
342
- ae as resDetailData,
342
+ ne as resDetailData,
343
343
  se as textLayout,
344
344
  pe as textPositionConfig
345
345
  };
@@ -5,10 +5,10 @@ export declare const resDetailData: (data: any, { graphData: graphData, typeObj,
5
5
  relationListObj: any;
6
6
  };
7
7
  export declare const textLayout: (cyRef: any, type: string) => any;
8
- export declare const handleCalcPath: (cyRef: any, { pathNodes, isGrayed, pathLinks }: {
9
- pathNodes: any;
8
+ export declare const handleCalcPath: (cyRef: any, { nodes, isGrayed, links }: {
9
+ nodes: any;
10
10
  isGrayed?: boolean | undefined;
11
- pathLinks: any;
11
+ links: any;
12
12
  }) => Promise<void>;
13
13
  export declare const typeListFunc: (data?: never[]) => any[];
14
14
  export declare const getCyData: (cy: any) => {
package/lib/style.css CHANGED
@@ -1 +1 @@
1
- .cytoscape-container{width:100%;height:100%;margin:20px auto}.search-input{padding:8px 12px;width:300px;margin-bottom:10px;border:1px solid #ddd;border-radius:4px}.btn-group{margin-bottom:10px}.btn{padding:8px 16px;margin:0 5px;border:none;border-radius:4px;background:#4285f4;color:#fff;cursor:pointer}.btn:hover{background:#3367d6}.result-text{margin-bottom:10px;color:#333;font-size:14px}.cy-container{width:100%;height:100%}.cy-container :global(.grayed){opacity:.3!important;background-color:#bdbdbd!important;color:#757575!important}.cy-container :global(.highlighted){background-color:#ffeb3b!important;border-color:#fbc02d!important;color:#333!important}.cy-container :global(.selected){border-color:#4caf50!important;background-color:#a5d6a7!important;color:#1b5e20!important}.cy-container .cy-edge:selected{line-color:#ea4335;line-width:3px;line-style:solid}.cy-container .cy-node:hover:not(:selected){background-color:#3367d6}.cy-container .cy-edge:hover:not(:selected){line-color:#757575}.path-nodes-container{margin-bottom:15px}.path-nodes-container h3{margin:10px 0;font-size:16px;color:#333}.node-input-row{display:flex;align-items:center;margin-bottom:8px}.node-input-row span{margin-right:10px;min-width:60px}.node-input-row input{flex:1;margin-right:10px}.remove-node-btn{background:#f44336;padding:6px 12px;font-size:12px}.add-node-btn{background:#4caf50;padding:8px 16px;margin-top:10px}.menuBtn:nth-child(1){transform:rotate(0) skew(31deg)}.menuBtn:nth-child(2){transform:rotate(51deg) skew(31deg)}.menuBtn:nth-child(3){transform:rotate(102deg) skew(31deg)}.menuBtn:nth-child(4){transform:rotate(153deg) skew(31deg)}.menuBtn:nth-child(5){transform:rotate(204deg) skew(31deg)}.menuBtn:nth-child(6){transform:rotate(255deg) skew(31deg)}.menuBtn:nth-child(7){transform:rotate(306deg) skew(35deg)}.menuBtn .menu-item{color:#fff;display:block;width:50px;height:20px;position:absolute;text-align:center;font-size:12px}.menuBtn .menu-item:hover{background:transparent!important}.menuBtn .menu-item{bottom:5px;right:19px;transform:skew(-30deg) translate(-9%) rotate(2deg) translateY(0)}.menuCertent{width:60px;height:60px;display:flex;align-items:center;justify-content:center;position:absolute;top:50%;left:50%;margin-top:-15%;margin-left:-15%;z-index:999;border-radius:50%;color:#fff;text-align:center;font-size:16px;cursor:pointer;border:2px solid #c9cec9}.opacity-30{opacity:.3}.cursor{cursor:pointer}.my-4px{margin:4px 0}.z-10{z-index:10}.hidden{display:none}.w-20px{width:20px}.h-100{height:100%}.rounded-50{border-radius:10%}.relative{position:relative}.absolute{position:absolute}.w-100{width:100%}.graph-bar{position:absolute;display:flex;align-items:center;z-index:10}.graph-bar .graph-bar-min-vertical{padding:0!important}.graph-bar .graph-bar-min{display:flex;background:#fff;padding:4px;box-shadow:0 4px 20px #100dae33;border-radius:6px;flex-wrap:nowrap;gap:10px;width:auto;white-space:nowrap}.graph-bar .graph-bar-menu{position:relative;cursor:pointer;margin:0 10px;white-space:nowrap;display:flex;align-items:center}.graph-bar .graph-bar-menu:hover .grap-menu-dropdown-item{color:#145afd}.graph-bar .grap-menu-dropdown{background:#fff;box-shadow:0 4px 20px #0000003b;border-radius:6px;position:absolute;padding:5px 0;z-index:99;top:60px}.graph-bar .grap-menu-dropdown p{white-space:nowrap;padding:5px 15px}.graph-bar .grap-menu-dropdown p:hover{background:#f5f5f5;color:#145afd}.graph-bar .grap-menu-dropdown-item{display:flex;cursor:pointer;flex-direction:column;align-items:center}.graph-bar .hide{display:none}.graph-bar .show{display:block}.graph-bar .graph-bar-expand-wrapper-vertical{overflow:hidden;max-height:1000px;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;opacity:1}.graph-bar .graph-bar-expand-wrapper{overflow:hidden;max-width:1000px;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;opacity:1}.graph-bar .graph-bar-expand-wrapper.collapsed{max-width:0;opacity:0;margin:0!important}.graph-bar .graph-bar-expand-wrapper-vertical.collapsed-vertical{max-height:0;opacity:0;margin:0!important}.graph-bar .graph-bar-min:not(.graph-bar-min-vertical) .graph-bar-expand-wrapper{display:flex;align-items:center;gap:10px;margin-left:10px;margin-right:10px}.graph-bar.graph-bar-vertical{flex-direction:column}.graph-bar.graph-bar-vertical .graph-bar-min{flex-direction:column;align-items:flex-start;position:relative;padding-bottom:0!important}.graph-bar.graph-bar-vertical .graph-bar-expand-wrapper{flex-direction:column;width:100%}.graph-bar.graph-bar-vertical .cursor{align-self:flex-end;flex-shrink:0;position:relative}.graph-bar.graph-bar-vertical .cursor:before{content:"";position:absolute;top:-10px;left:0;right:0;height:10px}.graph-bar.graph-bar-vertical .grap-menu-dropdown{top:auto;left:60px;right:auto}.graph-bar .bar-item{color:#999;font-size:12px;margin:8px 0}.graph-bar .oprate-btn{width:76px;color:#145afd;border-right:1px solid #f0f0f0}.graph-bar .oprate-btn-vertical{width:76px;padding:10px 0;color:#145afd;border-top:1px solid #f0f0f0}.gtaph-statics{right:0;z-index:1;background:#fff;padding:10px 20px 20px;box-sizing:border-box;border-radius:10px;width:200px;box-shadow:0 4px 20px #0000003b}.hove-active{cursor:pointer;font-size:14px}.hove-active:hover{color:#145afd}.setting-form{display:flex;flex-direction:column;height:100%}.setting-form .setting-form-content{flex:1;overflow-y:auto;padding:16px}.setting-form .setting-form-footer{position:sticky;bottom:0;background:#fff;padding:16px;border-top:1px solid #f0f0f0;margin-top:auto}.setting-form .setting-form-footer .ant-form-item{margin-bottom:0}.static-wraper{font-size:12px;color:#666}.color-333{color:#333}.rounded-50{border-radius:50%!important}.text-666{color:#666;font-size:12px}.query-node{width:300px;position:absolute;background-color:#fff;right:0;top:20px;padding:10px 20px;border-radius:10px}.path-node{width:380px;position:absolute;background-color:#fff;right:0;padding:10px 20px;border-radius:10px;box-shadow:0 4px 20px #0000003b;z-index:10}.path-node .title{display:flex;justify-content:space-between;height:35px;align-items:center;margin-bottom:10px;font-weight:700;font-size:14px}.path-node .search-input{margin-bottom:0;padding-bottom:5px}.path-node .btn-group{display:flex;justify-content:flex-end;margin-top:20px}.path-node .ant-select-suffix{width:10px}.query-node{width:300px;position:absolute;background-color:#fff;right:0;padding:10px 20px;border-radius:10px;box-shadow:0 4px 20px #0000003b}.query-node .title{display:flex;justify-content:space-between;height:35px;align-items:center;margin-bottom:10px;font-weight:700;font-size:14px}.radial-menu{position:relative;display:inline-flex;align-items:center;justify-content:center}.radial-svg{position:absolute;top:0;left:0}.sector-group{cursor:pointer;transition:all .2s ease}.sector-group .sector-path{transition:all .2s ease}.sector-group:hover .sector-path{filter:brightness(1.15) drop-shadow(0 2px 4px rgba(0,0,0,.3))}.sector-label{pointer-events:none;text-shadow:0 1px 3px rgba(0,0,0,.4);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.center-avatar{position:absolute;z-index:10;background:linear-gradient(135deg,#667eea,#764ba2);border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 15px #0000004d;transition:all .3s ease;overflow:hidden;color:#fff;font-weight:500}.center-avatar img{width:100%;height:100%;object-fit:cover}.center-avatar .center-text{font-size:14px;text-align:center}.center-avatar:hover{transform:scale(1.08);box-shadow:0 6px 20px #0006}.center-avatar:active{transform:scale(.95)}.drawer-wraper,.knowledge-card-drawer{padding-bottom:20px}.drawer-wraper .title,.knowledge-card-drawer .title{font-weight:700;font-size:14px;color:#3d3d3d;position:relative;padding-left:8px}.drawer-wraper .title:before,.knowledge-card-drawer .title:before{position:absolute;left:0;transform:translateY(-50%);top:50%;content:"";width:3px;height:17px;background:#145afd}.drawer-wraper .graph-item,.knowledge-card-drawer .graph-item{height:26px;border-bottom:1px solid #E5E5E5;background:#edf3fe}.drawer-wraper .graph-item:hover,.knowledge-card-drawer .graph-item:hover{background:#edf3fe}.drawer-wraper .noraml-type,.knowledge-card-drawer .noraml-type{font-size:14px;color:#145afd;line-height:26px;text-align:center;border-right:1px solid #E5E5E5}.drawer-wraper .noraml-text,.knowledge-card-drawer .noraml-text{font-size:14px;color:#333;line-height:26px}.drawer-wraper .selected-item,.knowledge-card-drawer .selected-item{background:#edf3fe;color:#1890ff}.drawer-wraper .selected-item .noraml-type,.knowledge-card-drawer .selected-item .noraml-type{background:#347bfc;color:#fff}.drawer-wraper .drawer-card-title,.knowledge-card-drawer .drawer-card-title{font-weight:600;font-size:14px;color:#333;position:relative;padding-bottom:10px;margin:15px 0 10px;cursor:pointer}.drawer-wraper .drawer-card-title:hover,.knowledge-card-drawer .drawer-card-title:hover{color:#145afd}.drawer-wraper .drawer-card-title:after,.knowledge-card-drawer .drawer-card-title:after{content:"";position:absolute;border-bottom:1px solid #DFDFDF;width:100%;left:0;bottom:0}.drawer-wraper .drawer-card-title:before,.knowledge-card-drawer .drawer-card-title:before{content:"";position:absolute;border-bottom:1px solid #145AFD;width:64px;left:0;bottom:0;z-index:1}.collapse-wrap{border-color:#dfdfdf;border-radius:0;height:calc(100vh - 480px);overflow-y:auto}.collapse-wrap .ant-collapse-header{padding:9px 10px!important;background:#fff}.collapse-wrap .ant-collapse-item{border-color:#dfdfdf}.collapse-wrap .ant-collapse-title{font-size:14px;font-weight:700;color:#3d3d3d}.collapse-wrap .ant-collapse-body{max-height:calc(100vh - 550px);overflow-y:auto;width:298px;padding:0 16px 16px!important}.collapse-wrap .ant-collapse-body .ant-card-body{padding:0!important}.collapse-wrap .ant-collapse-body .ant-card{border:none}.property-section-wraper .section-item{display:flex;margin-top:4px}.property-section-wraper .detail-label{color:#333;font-size:14px;white-space:nowrap;flex-shrink:0}.property-section-wraper .detail-value{color:#383838;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.video-wraper .video-item{height:185px;position:relative;background:#333;border-radius:6px}.video-wraper .video-item-video{width:100%;height:100%;border-radius:6px;object-fit:cover}.relation-section-wraper{display:flex;flex-wrap:wrap;gap:10px}.relation-section-wraper .group{width:100%}.relation-section-wraper .section-card{width:100%;height:100%;border:1px solid #DFDFDF}.relation-section-wraper .section-title{margin-bottom:7px}.relation-section-wraper .entity-name-list{font-size:16px;font-weight:700}.relation-section-wraper .view-details-btn{color:#145afd}.relation-section-wraper .detail-item-tag{background-color:#e6f2ff;font-size:14px;border:1px solid #bdf;border-top-left-radius:10px;border-bottom-right-radius:10px;padding:0 13px;color:#1082fe;margin-right:3px}.relation-section-wraper .detail-item-tag1{background-color:#fff5df;font-size:14px;border:1px solid #FFE0B8;border-top-left-radius:10px;border-bottom-right-radius:10px;padding:0 13px;color:#ff9418}.relation-section-wraper .detail-item-list{margin-bottom:3px}.relation-section-wraper .detail-label{color:#676a6c;font-size:14px;white-space:nowrap;flex-shrink:0}.relation-section-wraper .detail-value{color:#383838;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.relation-section-wraper .mb-18px{margin-bottom:18px}.knowledge-card-click{height:100%;overflow:hidden}.knowledge-card-click .drawer-card-title2{font-weight:700;flex-wrap:nowrap;padding-bottom:10px;border-bottom:1px solid #e4e7ed;cursor:pointer;color:#333;margin:14px 0}.knowledge-card-click .drawer-card-title2:hover,.knowledge-card-click .drawer-card-title2.active{color:#145afd}.knowledge-card-click .card-item-click{flex-shrink:0;margin-right:10px;border-right:1px solid #e4e7ed;padding-right:10px;height:100%;background:#fff}.knowledge-card-click .knowledge-card-content{height:100%;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.knowledge-card-click .knowledge-card-content::-webkit-scrollbar{display:none}
1
+ .cytoscape-container{width:100%;height:100%;margin:20px auto}.search-input{padding:8px 12px;width:300px;margin-bottom:10px;border:1px solid #ddd;border-radius:4px}.btn-group{margin-bottom:10px}.btn{padding:8px 16px;margin:0 5px;border:none;border-radius:4px;background:#4285f4;color:#fff;cursor:pointer}.btn:hover{background:#3367d6}.result-text{margin-bottom:10px;color:#333;font-size:14px}.cy-container{width:100%;height:100%}.cy-container :global(.grayed){opacity:.3!important;background-color:#bdbdbd!important;color:#757575!important}.cy-container :global(.highlighted){background-color:#ffeb3b!important;border-color:#fbc02d!important;color:#333!important}.cy-container :global(.selected){border-color:#4caf50!important;background-color:#a5d6a7!important;color:#1b5e20!important}.cy-container .cy-edge:selected{line-color:#ea4335;line-width:3px;line-style:solid}.cy-container .cy-node:hover:not(:selected){background-color:#3367d6}.cy-container .cy-edge:hover:not(:selected){line-color:#757575}.path-nodes-container{margin-bottom:15px}.path-nodes-container h3{margin:10px 0;font-size:16px;color:#333}.node-input-row{display:flex;align-items:center;margin-bottom:8px}.node-input-row span{margin-right:10px;min-width:60px}.node-input-row input{flex:1;margin-right:10px}.remove-node-btn{background:#f44336;padding:6px 12px;font-size:12px}.add-node-btn{background:#4caf50;padding:8px 16px;margin-top:10px}.menuBtn:nth-child(1){transform:rotate(0) skew(31deg)}.menuBtn:nth-child(2){transform:rotate(51deg) skew(31deg)}.menuBtn:nth-child(3){transform:rotate(102deg) skew(31deg)}.menuBtn:nth-child(4){transform:rotate(153deg) skew(31deg)}.menuBtn:nth-child(5){transform:rotate(204deg) skew(31deg)}.menuBtn:nth-child(6){transform:rotate(255deg) skew(31deg)}.menuBtn:nth-child(7){transform:rotate(306deg) skew(35deg)}.menuBtn .menu-item{color:#fff;display:block;width:50px;height:20px;position:absolute;text-align:center;font-size:12px}.menuBtn .menu-item:hover{background:transparent!important}.menuBtn .menu-item{bottom:5px;right:19px;transform:skew(-30deg) translate(-9%) rotate(2deg) translateY(0)}.menuCertent{width:60px;height:60px;display:flex;align-items:center;justify-content:center;position:absolute;top:50%;left:50%;margin-top:-15%;margin-left:-15%;z-index:999;border-radius:50%;color:#fff;text-align:center;font-size:16px;cursor:pointer;border:2px solid #c9cec9}.opacity-30{opacity:.3}.cursor{cursor:pointer}.my-4px{margin:4px 0}.z-10{z-index:10}.hidden{display:none}.w-20px{width:20px}.h-100{height:100%}.rounded-50{border-radius:10%}.relative{position:relative}.absolute{position:absolute}.w-100{width:100%}.graph-bar{position:absolute;display:flex;align-items:center;z-index:10}.graph-bar .graph-bar-min-vertical{padding:0!important}.graph-bar .graph-bar-min{display:flex;background:#fff;padding:4px;box-shadow:0 4px 20px #100dae33;border-radius:6px;flex-wrap:nowrap;gap:10px;width:auto;white-space:nowrap}.graph-bar .graph-bar-menu{position:relative;cursor:pointer;margin:0 10px;white-space:nowrap;display:flex;align-items:center}.graph-bar .graph-bar-menu:hover .grap-menu-dropdown-item{color:#145afd}.graph-bar .grap-menu-dropdown{background:#fff;box-shadow:0 4px 20px #0000003b;border-radius:6px;position:absolute;padding:5px 0;z-index:99;top:60px}.graph-bar .grap-menu-dropdown p{white-space:nowrap;padding:5px 15px}.graph-bar .grap-menu-dropdown p:hover{background:#f5f5f5;color:#145afd}.graph-bar .grap-menu-dropdown-item{display:flex;cursor:pointer;flex-direction:column;align-items:center}.graph-bar .hide{display:none}.graph-bar .show{display:block}.graph-bar .graph-bar-expand-wrapper-vertical{overflow:hidden;max-height:1000px;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;opacity:1}.graph-bar .graph-bar-expand-wrapper{overflow:hidden;max-width:1000px;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;opacity:1}.graph-bar .graph-bar-expand-wrapper.collapsed{max-width:0;opacity:0;margin:0!important}.graph-bar .graph-bar-expand-wrapper-vertical.collapsed-vertical{max-height:0;opacity:0;margin:0!important}.graph-bar .graph-bar-min:not(.graph-bar-min-vertical) .graph-bar-expand-wrapper{display:flex;align-items:center;gap:10px;margin-left:10px;margin-right:10px}.graph-bar.graph-bar-vertical{flex-direction:column}.graph-bar.graph-bar-vertical .graph-bar-min{flex-direction:column;align-items:flex-start;position:relative;padding-bottom:0!important}.graph-bar.graph-bar-vertical .graph-bar-expand-wrapper{flex-direction:column;width:100%}.graph-bar.graph-bar-vertical .cursor{align-self:flex-end;flex-shrink:0;position:relative}.graph-bar.graph-bar-vertical .cursor:before{content:"";position:absolute;top:-10px;left:0;right:0;height:10px}.graph-bar.graph-bar-vertical .grap-menu-dropdown{top:auto;left:60px;right:auto}.graph-bar .bar-item{color:#999;font-size:12px;margin:8px 0}.graph-bar .oprate-btn{width:76px;color:#145afd;border-right:1px solid #f0f0f0}.graph-bar .oprate-btn-vertical{width:76px;padding:10px 0;color:#145afd;border-top:1px solid #f0f0f0}.gtaph-statics{right:0;z-index:1;background:#fff;padding:10px 20px 20px;box-sizing:border-box;border-radius:10px;width:200px;box-shadow:0 4px 20px #0000003b}.hove-active{cursor:pointer;font-size:14px}.hove-active:hover{color:#145afd}.font-12{font-size:12px}.setting-form{display:flex;flex-direction:column;height:100%}.setting-form .setting-form-content{flex:1;overflow-y:auto;padding:16px}.setting-form .setting-form-footer{position:sticky;bottom:0;background:#fff;padding:16px;border-top:1px solid #f0f0f0;margin-top:auto}.setting-form .setting-form-footer .ant-form-item{margin-bottom:0}.static-wraper{font-size:12px;color:#666}.color-333{color:#333}.rounded-50{border-radius:50%!important}.text-666{color:#666;font-size:12px}.query-node{width:300px;position:absolute;background-color:#fff;right:0;top:20px;padding:10px 20px;border-radius:10px}.path-node{width:380px;position:absolute;background-color:#fff;right:0;padding:10px 20px;border-radius:10px;box-shadow:0 4px 20px #0000003b;z-index:10}.path-node .title{display:flex;justify-content:space-between;height:35px;align-items:center;margin-bottom:10px;font-weight:700;font-size:14px}.path-node .search-input{margin-bottom:0;padding-bottom:5px}.path-node .btn-group{display:flex;justify-content:flex-end;margin-top:20px}.path-node .ant-select-suffix{width:10px}.query-node{width:300px;position:absolute;background-color:#fff;right:0;padding:10px 20px;border-radius:10px;box-shadow:0 4px 20px #0000003b}.query-node .title{display:flex;justify-content:space-between;height:35px;align-items:center;margin-bottom:10px;font-weight:700;font-size:14px}.radial-menu{position:relative;display:inline-flex;align-items:center;justify-content:center}.radial-svg{position:absolute;top:0;left:0}.sector-group{cursor:pointer;transition:all .2s ease}.sector-group .sector-path{transition:all .2s ease}.sector-group:hover .sector-path{filter:brightness(1.15) drop-shadow(0 2px 4px rgba(0,0,0,.3))}.sector-label{pointer-events:none;text-shadow:0 1px 3px rgba(0,0,0,.4);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.center-avatar{position:absolute;z-index:10;background:linear-gradient(135deg,#667eea,#764ba2);border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 15px #0000004d;transition:all .3s ease;overflow:hidden;color:#fff;font-weight:500}.center-avatar img{width:100%;height:100%;object-fit:cover}.center-avatar .center-text{font-size:14px;text-align:center}.center-avatar:hover{transform:scale(1.08);box-shadow:0 6px 20px #0006}.center-avatar:active{transform:scale(.95)}.drawer-wraper,.knowledge-card-drawer{padding-bottom:20px}.drawer-wraper .title,.knowledge-card-drawer .title{font-weight:700;font-size:14px;color:#3d3d3d;position:relative;padding-left:8px}.drawer-wraper .title:before,.knowledge-card-drawer .title:before{position:absolute;left:0;transform:translateY(-50%);top:50%;content:"";width:3px;height:17px;background:#145afd}.drawer-wraper .graph-item,.knowledge-card-drawer .graph-item{height:26px;border-bottom:1px solid #E5E5E5;background:#edf3fe}.drawer-wraper .graph-item:hover,.knowledge-card-drawer .graph-item:hover{background:#edf3fe}.drawer-wraper .noraml-type,.knowledge-card-drawer .noraml-type{font-size:14px;color:#145afd;line-height:26px;text-align:center;border-right:1px solid #E5E5E5}.drawer-wraper .noraml-text,.knowledge-card-drawer .noraml-text{font-size:14px;color:#333;line-height:26px}.drawer-wraper .selected-item,.knowledge-card-drawer .selected-item{background:#edf3fe;color:#1890ff}.drawer-wraper .selected-item .noraml-type,.knowledge-card-drawer .selected-item .noraml-type{background:#347bfc;color:#fff}.drawer-wraper .drawer-card-title,.knowledge-card-drawer .drawer-card-title{font-weight:600;font-size:14px;color:#333;position:relative;padding-bottom:10px;margin:15px 0 10px;cursor:pointer}.drawer-wraper .drawer-card-title:hover,.knowledge-card-drawer .drawer-card-title:hover{color:#145afd}.drawer-wraper .drawer-card-title:after,.knowledge-card-drawer .drawer-card-title:after{content:"";position:absolute;border-bottom:1px solid #DFDFDF;width:100%;left:0;bottom:0}.drawer-wraper .drawer-card-title:before,.knowledge-card-drawer .drawer-card-title:before{content:"";position:absolute;border-bottom:1px solid #145AFD;width:64px;left:0;bottom:0;z-index:1}.collapse-wrap{border-color:#dfdfdf;border-radius:0;height:calc(100vh - 480px);overflow-y:auto}.collapse-wrap .ant-collapse-header{padding:9px 10px!important;background:#fff}.collapse-wrap .ant-collapse-item{border-color:#dfdfdf}.collapse-wrap .ant-collapse-title{font-size:14px;font-weight:700;color:#3d3d3d}.collapse-wrap .ant-collapse-body{max-height:calc(100vh - 550px);overflow-y:auto;width:298px;padding:0 16px 16px!important}.collapse-wrap .ant-collapse-body .ant-card-body{padding:0!important}.collapse-wrap .ant-collapse-body .ant-card{border:none}.property-section-wraper .section-item{display:flex;margin-top:4px}.property-section-wraper .detail-label{color:#333;font-size:14px;white-space:nowrap;flex-shrink:0}.property-section-wraper .detail-value{color:#383838;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.video-wraper .video-item{height:185px;position:relative;background:#333;border-radius:6px}.video-wraper .video-item-video{width:100%;height:100%;border-radius:6px;object-fit:cover}.relation-section-wraper{display:flex;flex-wrap:wrap;gap:10px}.relation-section-wraper .group{width:100%}.relation-section-wraper .section-card{width:100%;height:100%;border:1px solid #DFDFDF}.relation-section-wraper .section-title{margin-bottom:7px}.relation-section-wraper .entity-name-list{font-size:16px;font-weight:700}.relation-section-wraper .view-details-btn{color:#145afd}.relation-section-wraper .detail-item-tag{background-color:#e6f2ff;font-size:14px;border:1px solid #bdf;border-top-left-radius:10px;border-bottom-right-radius:10px;padding:0 13px;color:#1082fe;margin-right:3px}.relation-section-wraper .detail-item-tag1{background-color:#fff5df;font-size:14px;border:1px solid #FFE0B8;border-top-left-radius:10px;border-bottom-right-radius:10px;padding:0 13px;color:#ff9418}.relation-section-wraper .detail-item-list{margin-bottom:3px}.relation-section-wraper .detail-label{color:#676a6c;font-size:14px;white-space:nowrap;flex-shrink:0}.relation-section-wraper .detail-value{color:#383838;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.relation-section-wraper .mb-18px{margin-bottom:18px}.knowledge-card-click{height:100%;overflow:hidden}.knowledge-card-click .drawer-card-title2{font-weight:700;flex-wrap:nowrap;padding-bottom:10px;border-bottom:1px solid #e4e7ed;cursor:pointer;color:#333;margin:14px 0}.knowledge-card-click .drawer-card-title2:hover,.knowledge-card-click .drawer-card-title2.active{color:#145afd}.knowledge-card-click .card-item-click{flex-shrink:0;margin-right:10px;border-right:1px solid #e4e7ed;padding-right:10px;height:100%;background:#fff}.knowledge-card-click .knowledge-card-content{height:100%;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.knowledge-card-click .knowledge-card-content::-webkit-scrollbar{display:none}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-kggraph",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "A knowledge graph visualization component based on Cytoscape",
5
5
  "type": "module",
6
6
  "main": "./lib/index.es.js",