react-kggraph 0.0.3 → 0.0.4
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.es.js +4 -0
- package/lib/{index17.esm.js → index17.es.js} +12 -12
- package/lib/{index2.esm.js → index2.es.js} +2 -5
- package/lib/index21.es.js +70 -0
- package/lib/index23.es.js +68 -0
- package/lib/index25.es.js +72 -0
- package/lib/{index29.esm.js → index26.es.js} +1 -1
- package/lib/{index30.esm.js → index27.es.js} +239 -239
- package/lib/index33.es.js +100 -0
- package/lib/{index37.esm.js → index34.es.js} +93 -93
- package/lib/index35.es.js +47 -0
- package/lib/{index39.esm.js → index36.es.js} +134 -136
- package/lib/index37.es.js +12 -0
- package/package.json +11 -6
- package/lib/components/Graph/components/PathAnalysisLevel/index.css +0 -1
- package/lib/index.cjs.js +0 -1
- package/lib/index.esm.js +0 -3
- package/lib/index10.cjs.js +0 -1
- package/lib/index11.cjs.js +0 -1
- package/lib/index12.cjs.js +0 -1
- package/lib/index13.cjs.js +0 -1
- package/lib/index14.cjs.js +0 -1
- package/lib/index15.cjs.js +0 -1
- package/lib/index16.cjs.js +0 -1
- package/lib/index17.cjs.js +0 -1
- package/lib/index18.cjs.js +0 -1
- package/lib/index19.cjs.js +0 -1
- package/lib/index2.cjs.js +0 -1
- package/lib/index21.cjs.js +0 -1
- package/lib/index21.esm.js +0 -27
- package/lib/index22.cjs.js +0 -16
- package/lib/index22.esm.js +0 -453
- package/lib/index23.cjs.js +0 -1
- package/lib/index23.esm.js +0 -10
- package/lib/index24.cjs.js +0 -1
- package/lib/index24.esm.js +0 -70
- package/lib/index26.cjs.js +0 -1
- package/lib/index26.esm.js +0 -68
- package/lib/index28.cjs.js +0 -1
- package/lib/index28.esm.js +0 -72
- package/lib/index29.cjs.js +0 -1
- package/lib/index30.cjs.js +0 -1
- package/lib/index32.cjs.js +0 -1
- package/lib/index33.cjs.js +0 -1
- package/lib/index34.cjs.js +0 -1
- package/lib/index36.cjs.js +0 -1
- package/lib/index36.esm.js +0 -100
- package/lib/index37.cjs.js +0 -1
- package/lib/index38.cjs.js +0 -1
- package/lib/index38.esm.js +0 -47
- package/lib/index39.cjs.js +0 -1
- package/lib/index4.cjs.js +0 -95
- package/lib/index40.cjs.js +0 -1
- package/lib/index5.cjs.js +0 -1
- package/lib/index6.cjs.js +0 -1
- package/lib/index7.cjs.js +0 -1
- package/lib/index8.cjs.js +0 -1
- package/lib/index9.cjs.js +0 -1
- /package/lib/{index10.esm.js → index10.es.js} +0 -0
- /package/lib/{index11.esm.js → index11.es.js} +0 -0
- /package/lib/{index12.esm.js → index12.es.js} +0 -0
- /package/lib/{index13.esm.js → index13.es.js} +0 -0
- /package/lib/{index14.esm.js → index14.es.js} +0 -0
- /package/lib/{index15.esm.js → index15.es.js} +0 -0
- /package/lib/{index16.esm.js → index16.es.js} +0 -0
- /package/lib/{index18.esm.js → index18.es.js} +0 -0
- /package/lib/{index19.esm.js → index19.es.js} +0 -0
- /package/lib/{index32.esm.js → index29.es.js} +0 -0
- /package/lib/{index33.esm.js → index30.es.js} +0 -0
- /package/lib/{index34.esm.js → index31.es.js} +0 -0
- /package/lib/{index40.esm.js → index38.es.js} +0 -0
- /package/lib/{index4.esm.js → index4.es.js} +0 -0
- /package/lib/{index5.esm.js → index5.es.js} +0 -0
- /package/lib/{index6.esm.js → index6.es.js} +0 -0
- /package/lib/{index7.esm.js → index7.es.js} +0 -0
- /package/lib/{index8.esm.js → index8.es.js} +0 -0
- /package/lib/{index9.esm.js → index9.es.js} +0 -0
|
@@ -1,152 +1,150 @@
|
|
|
1
|
-
import { jsonStringify as e } from "./index16.
|
|
2
|
-
import { handleCalcPath as t, resDetailData as n } from "./index17.
|
|
3
|
-
import { GraphProvider as r } from "./index18.
|
|
4
|
-
import { coseBilkentLayout as i, fixNodesToEdges as a } from "./index19.
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import d from "./
|
|
12
|
-
import f from "./
|
|
13
|
-
import p from "
|
|
14
|
-
import
|
|
15
|
-
import _ from "cytoscape";
|
|
16
|
-
import v from "cytoscape-
|
|
17
|
-
import y from "cytoscape-
|
|
18
|
-
import b from "
|
|
19
|
-
import x from "
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var T = ({ data: o, getAllGraphData: v, searchType: y, highPathAnalysis: b = [], graphInfo: x }) => {
|
|
26
|
-
let C = h(null), [T, E] = g([]), D = h(null), O = h(null), [k, A] = g(!1), [j, M] = g({}), [N, P] = g({}), [F, I] = g("cose-bilkent"), L = h(null), R = h(null), [z, B] = g(["", ""]), [V, H] = g({
|
|
1
|
+
import { jsonStringify as e } from "./index16.es.js";
|
|
2
|
+
import { handleCalcPath as t, resDetailData as n } from "./index17.es.js";
|
|
3
|
+
import { GraphProvider as r } from "./index18.es.js";
|
|
4
|
+
import { coseBilkentLayout as i, fixNodesToEdges as a } from "./index19.es.js";
|
|
5
|
+
import o from "./index27.es.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { stepNext as s } from "./index29.es.js";
|
|
8
|
+
import { edgeNodeStyles as c } from "./index30.es.js";
|
|
9
|
+
import { menuItemsConfig as l } from "./index31.es.js";
|
|
10
|
+
import u from "./index33.es.js";
|
|
11
|
+
import d from "./index34.es.js";
|
|
12
|
+
import f from "./index35.es.js";
|
|
13
|
+
import { useEffect as p, useRef as m, useState as h } from "react";
|
|
14
|
+
import g from "cytoscape";
|
|
15
|
+
import _ from "cytoscape-cose-bilkent";
|
|
16
|
+
import v from "cytoscape-cise";
|
|
17
|
+
import y from "cytoscape-fcose";
|
|
18
|
+
import b from "storm-layout";
|
|
19
|
+
import { message as x } from "antd";
|
|
20
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
21
|
+
import w from "cytoscape-layout-utilities";
|
|
22
|
+
g.use(w), g.use(v), g.use(y), g.use(b), g.use(_);
|
|
23
|
+
var T = ({ data: _, getAllGraphData: v, searchType: y, highPathAnalysis: b = [], graphInfo: w }) => {
|
|
24
|
+
let T = m(null), [E, D] = h([]), O = m(null), k = m(null), [A, j] = h(!1), [M, N] = h({}), [P, F] = h({}), [I, L] = h("cose-bilkent"), R = m(null), z = m(null), [B, V] = h(["", ""]), [H, U] = h({
|
|
27
25
|
visible: !1,
|
|
28
26
|
x: 0,
|
|
29
27
|
y: 0,
|
|
30
28
|
targetNode: null,
|
|
31
29
|
bgColor: ""
|
|
32
|
-
}), [
|
|
30
|
+
}), [W, G] = h({
|
|
33
31
|
visible: !1,
|
|
34
32
|
x: 0,
|
|
35
33
|
y: 0,
|
|
36
34
|
content: ""
|
|
37
|
-
}),
|
|
38
|
-
cyRef:
|
|
39
|
-
setContextMenu:
|
|
40
|
-
onPathAnalysis:
|
|
41
|
-
setPathNodes:
|
|
35
|
+
}), K = l({
|
|
36
|
+
cyRef: O,
|
|
37
|
+
setContextMenu: U,
|
|
38
|
+
onPathAnalysis: k.current?.onPathAnalysis,
|
|
39
|
+
setPathNodes: V
|
|
42
40
|
});
|
|
43
|
-
|
|
44
|
-
b?.length > 1 && t(
|
|
41
|
+
p(() => {
|
|
42
|
+
b?.length > 1 && t(O, {
|
|
45
43
|
pathNodes: b,
|
|
46
44
|
isGrayed: !1
|
|
47
45
|
});
|
|
48
|
-
}, [e(b), e(
|
|
46
|
+
}, [e(b), e(E)]), p(() => {
|
|
49
47
|
v?.({
|
|
50
|
-
graphData:
|
|
51
|
-
nodeStatic:
|
|
52
|
-
relationStatic:
|
|
48
|
+
graphData: E,
|
|
49
|
+
nodeStatic: M,
|
|
50
|
+
relationStatic: P
|
|
53
51
|
});
|
|
54
52
|
}, [
|
|
55
|
-
e(
|
|
56
|
-
e(
|
|
57
|
-
e(
|
|
58
|
-
]),
|
|
59
|
-
if (!
|
|
60
|
-
let { elements: e, typeListObj: t, relationListObj: r } = n(
|
|
61
|
-
typeObj:
|
|
62
|
-
relationObj:
|
|
63
|
-
graphInfo:
|
|
53
|
+
e(E),
|
|
54
|
+
e(M),
|
|
55
|
+
e(P)
|
|
56
|
+
]), p(() => {
|
|
57
|
+
if (!T.current || O.current) return;
|
|
58
|
+
let { elements: e, typeListObj: t, relationListObj: r } = n(_, {
|
|
59
|
+
typeObj: M,
|
|
60
|
+
relationObj: P,
|
|
61
|
+
graphInfo: w
|
|
64
62
|
});
|
|
65
|
-
|
|
63
|
+
N(t), D(e), F(r), document.addEventListener("contextmenu", function(e) {
|
|
66
64
|
e.preventDefault();
|
|
67
65
|
});
|
|
68
|
-
let
|
|
69
|
-
container:
|
|
66
|
+
let o = g({
|
|
67
|
+
container: T.current,
|
|
70
68
|
elements: e,
|
|
71
|
-
style:
|
|
69
|
+
style: c({ elements: e }),
|
|
72
70
|
autounselectify: !1,
|
|
73
71
|
autolock: !1,
|
|
74
72
|
layout: { name: "preset" }
|
|
75
73
|
});
|
|
76
|
-
if (
|
|
74
|
+
if (O.current = o, w?.searchNodes?.length === 2) a(o, w.searchNodes[0], w.searchNodes[1]);
|
|
77
75
|
else {
|
|
78
|
-
let e =
|
|
76
|
+
let e = o.layout(i());
|
|
79
77
|
e.run(), e.on("layoutstop", () => {
|
|
80
|
-
|
|
78
|
+
o.fit(void 0, 50), o.center();
|
|
81
79
|
});
|
|
82
80
|
}
|
|
83
|
-
return
|
|
81
|
+
return o.on("mouseover", "edge", (e) => {
|
|
84
82
|
e.target.hasClass("path-edge") || e.target.style({
|
|
85
83
|
"line-color": "#1890ff",
|
|
86
84
|
"target-arrow-color": "#1890ff",
|
|
87
85
|
opacity: .8
|
|
88
86
|
});
|
|
89
|
-
}),
|
|
87
|
+
}), o.on("mouseout", "edge", (e) => {
|
|
90
88
|
e.target.hasClass("path-edge") || e.target.style({
|
|
91
89
|
"line-color": "#ccc",
|
|
92
90
|
"target-arrow-color": "#ccc",
|
|
93
91
|
opacity: 1
|
|
94
92
|
});
|
|
95
|
-
}),
|
|
93
|
+
}), o.on("mouseover", "node", (e) => {
|
|
96
94
|
let t = e.target;
|
|
97
95
|
t.hasClass("selected") || t.addClass("hover");
|
|
98
|
-
}),
|
|
96
|
+
}), o.on("mouseover", "node", (e) => {
|
|
99
97
|
let t = e.target, n = t.renderedPosition(), r = t.data("name") || "";
|
|
100
|
-
t.addClass("hover"),
|
|
98
|
+
t.addClass("hover"), G({
|
|
101
99
|
visible: !0,
|
|
102
100
|
x: n.x,
|
|
103
101
|
y: n.y - 60,
|
|
104
102
|
content: r
|
|
105
103
|
});
|
|
106
|
-
}),
|
|
107
|
-
e.target.removeClass("hover"),
|
|
104
|
+
}), o.on("mouseout", "node", (e) => {
|
|
105
|
+
e.target.removeClass("hover"), G((e) => ({
|
|
108
106
|
...e,
|
|
109
107
|
visible: !1
|
|
110
108
|
}));
|
|
111
|
-
}),
|
|
109
|
+
}), o.on("cxttap", "node", (e) => {
|
|
112
110
|
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), e.originalEvent && (e.originalEvent.preventDefault(), e.originalEvent.stopPropagation(), e.originalEvent.stopImmediatePropagation());
|
|
113
111
|
let t = e.target, n = t.renderedPosition();
|
|
114
|
-
console.log("renderedPos:::", t.data(), t.style("background-color")),
|
|
112
|
+
console.log("renderedPos:::", t.data(), t.style("background-color")), U({
|
|
115
113
|
visible: !0,
|
|
116
114
|
x: n.x - 90,
|
|
117
115
|
y: n.y - 90,
|
|
118
116
|
targetNode: t,
|
|
119
117
|
bgColor: t.style("background-color")
|
|
120
118
|
});
|
|
121
|
-
}),
|
|
119
|
+
}), O.current = o, o.on("click", "node", (e) => {
|
|
122
120
|
let t = e.target;
|
|
123
|
-
|
|
121
|
+
o.nodes().removeClass("selected grayed highlighted"), o.edges().removeClass("selected grayed highlighted"), t.addClass("selected");
|
|
124
122
|
let n = t.neighborhood().nodes().add(t), r = n.edgesWith(n);
|
|
125
|
-
console.log("cy.nodes().not(relatedNodes):::", n),
|
|
126
|
-
}),
|
|
127
|
-
e.target ===
|
|
123
|
+
console.log("cy.nodes().not(relatedNodes):::", n), o.nodes().not(n).addClass("grayed"), o.edges().not(r).addClass("grayed"), n.addClass("highlighted"), r.addClass("highlighted");
|
|
124
|
+
}), o.on("tap", (e) => {
|
|
125
|
+
e.target === o && (U((e) => ({
|
|
128
126
|
...e,
|
|
129
127
|
visible: !1
|
|
130
|
-
})),
|
|
128
|
+
})), o.nodes().removeClass("grayed highlighted highlight selected correlationStyle path-node level-highlight level-selected level-grayed"), o.edges().removeClass("grayed highlighted highlight selected correlationStyle path-edge level-highlightedge level-grayed"));
|
|
131
129
|
}), () => {
|
|
132
|
-
|
|
130
|
+
O.current &&= (O.current.destroy(), null);
|
|
133
131
|
};
|
|
134
132
|
}, []);
|
|
135
|
-
let
|
|
136
|
-
let { id: t, kgId: r } = e, a =
|
|
133
|
+
let q = async (e) => {
|
|
134
|
+
let { id: t, kgId: r } = e, a = O.current;
|
|
137
135
|
if (!a) return;
|
|
138
136
|
let o = a.$(`#${t}`);
|
|
139
137
|
if (!o || o.length === 0) {
|
|
140
138
|
console.error("当前节点不存在");
|
|
141
139
|
return;
|
|
142
140
|
}
|
|
143
|
-
let
|
|
144
|
-
if (
|
|
145
|
-
let r =
|
|
146
|
-
|
|
141
|
+
let c = a.nodes().filter((n) => n.data("parentId") ? (n.data("parentId") === t || n.data("idLabel") === `${t}-${n.data("name")}`) && n.data("zktype") === e.zktype : !1);
|
|
142
|
+
if (c.length > 0) {
|
|
143
|
+
let r = c.map((e) => e.id()), i = c.connectedEdges(), s = a.edges().filter((e) => e.data("source") === t && r.includes(e.data("target"))), l = a.edges().filter((e) => e.data("appendedBy") === t), u = i.merge(s).merge(l).filter((t) => t.data().zktype === e.zktype);
|
|
144
|
+
c.animate({ style: { opacity: 0 } }, {
|
|
147
145
|
duration: 200,
|
|
148
146
|
complete: () => {
|
|
149
|
-
a.remove(
|
|
147
|
+
a.remove(c), a.remove(u), D((i) => {
|
|
150
148
|
let a = i.filter((n) => {
|
|
151
149
|
let i = n.data.zktype;
|
|
152
150
|
if (n.group === "nodes" && r.includes(n.data?.id) && i && i === e.zktype) return !1;
|
|
@@ -164,7 +162,7 @@ var T = ({ data: o, getAllGraphData: v, searchType: y, highPathAnalysis: b = [],
|
|
|
164
162
|
relationObj: {},
|
|
165
163
|
isOnlyStatic: !0
|
|
166
164
|
});
|
|
167
|
-
return
|
|
165
|
+
return N(o), F(s), a;
|
|
168
166
|
}), o.data("appendedNodes", []), o.data("isExpanded", !1);
|
|
169
167
|
}
|
|
170
168
|
}), setTimeout(() => {
|
|
@@ -172,34 +170,34 @@ var T = ({ data: o, getAllGraphData: v, searchType: y, highPathAnalysis: b = [],
|
|
|
172
170
|
}, 300);
|
|
173
171
|
} else {
|
|
174
172
|
try {
|
|
175
|
-
|
|
173
|
+
j(!0), x.open({
|
|
176
174
|
type: "loading",
|
|
177
175
|
content: "正在展开...",
|
|
178
176
|
duration: 0
|
|
179
177
|
});
|
|
180
|
-
let { elements:
|
|
178
|
+
let { elements: c, typeListObj: l, relationListObj: u } = n((await s({
|
|
181
179
|
uri: t,
|
|
182
180
|
queryType: 1,
|
|
183
181
|
kgId: r,
|
|
184
182
|
zktype: e.zktype
|
|
185
183
|
})).data, {
|
|
186
|
-
graphData:
|
|
187
|
-
typeObj:
|
|
188
|
-
relationObj:
|
|
184
|
+
graphData: E,
|
|
185
|
+
typeObj: M,
|
|
186
|
+
relationObj: P,
|
|
189
187
|
zktype: e.zktype
|
|
190
188
|
});
|
|
191
|
-
if (
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
if (N(l), F(u), console.log(555e3, c), !(c?.length > 0)) {
|
|
190
|
+
x.warning("暂无数据"), setTimeout(() => {
|
|
191
|
+
x.destroy();
|
|
194
192
|
}, 2e3);
|
|
195
193
|
return;
|
|
196
194
|
}
|
|
197
|
-
if (
|
|
195
|
+
if (c?.length > 0) {
|
|
198
196
|
let n = a.layoutUtilities({
|
|
199
197
|
...i(),
|
|
200
198
|
idealEdgeLength: 80,
|
|
201
199
|
offset: 30
|
|
202
|
-
}), r =
|
|
200
|
+
}), r = c.map((n) => n.group === "nodes" ? {
|
|
203
201
|
...n,
|
|
204
202
|
style: {
|
|
205
203
|
opacity: 0,
|
|
@@ -223,9 +221,9 @@ var T = ({ data: o, getAllGraphData: v, searchType: y, highPathAnalysis: b = [],
|
|
|
223
221
|
appendedBy: t,
|
|
224
222
|
zktype: e.zktype
|
|
225
223
|
}
|
|
226
|
-
}),
|
|
227
|
-
|
|
228
|
-
let l =
|
|
224
|
+
}), s = a.add(r);
|
|
225
|
+
D([...E, ...r]);
|
|
226
|
+
let l = s.filter(":node"), u = l.map((e) => e.id());
|
|
229
227
|
o.data("appendedNodes", u), o.data("isExpanded", !0);
|
|
230
228
|
let d = a.nodes().difference(l);
|
|
231
229
|
d.forEach((e) => e.lock()), n.placeNewNodes(l), a.layout({
|
|
@@ -258,22 +256,22 @@ var T = ({ data: o, getAllGraphData: v, searchType: y, highPathAnalysis: b = [],
|
|
|
258
256
|
} catch (e) {
|
|
259
257
|
console.error("请求接口失败:", e);
|
|
260
258
|
}
|
|
261
|
-
|
|
259
|
+
j(!1), x.destroy();
|
|
262
260
|
}
|
|
263
|
-
|
|
264
|
-
},
|
|
261
|
+
U({ visible: !1 });
|
|
262
|
+
}, J = {
|
|
265
263
|
expanded: "typed-literal",
|
|
266
264
|
contract: "uri"
|
|
267
|
-
},
|
|
268
|
-
if (console.log("handleMenuAction:::", e),
|
|
269
|
-
let t = e.ids, n =
|
|
270
|
-
if (["expanded", "contract"].includes(t))
|
|
265
|
+
}, Y = (e) => {
|
|
266
|
+
if (console.log("handleMenuAction:::", e), H.targetNode) {
|
|
267
|
+
let t = e.ids, n = H.targetNode.data();
|
|
268
|
+
if (["expanded", "contract"].includes(t)) q({
|
|
271
269
|
kgId: 3,
|
|
272
270
|
...n,
|
|
273
|
-
zktype:
|
|
271
|
+
zktype: J[t]
|
|
274
272
|
});
|
|
275
273
|
else if (t === "nodeInfo") {
|
|
276
|
-
let e =
|
|
274
|
+
let e = H.targetNode, t = {
|
|
277
275
|
id: e.id(),
|
|
278
276
|
data: e.data(),
|
|
279
277
|
position: e.position(),
|
|
@@ -283,12 +281,12 @@ var T = ({ data: o, getAllGraphData: v, searchType: y, highPathAnalysis: b = [],
|
|
|
283
281
|
classes: e.classes(),
|
|
284
282
|
style: e.style()
|
|
285
283
|
};
|
|
286
|
-
|
|
284
|
+
R.current.open(t);
|
|
287
285
|
} else if (t === "knowledgeCard") {
|
|
288
|
-
let e =
|
|
289
|
-
|
|
286
|
+
let e = H.targetNode;
|
|
287
|
+
z.current.open(e.data());
|
|
290
288
|
}
|
|
291
|
-
e.action(
|
|
289
|
+
e.action(H.targetNode), U({
|
|
292
290
|
visible: !1,
|
|
293
291
|
x: 0,
|
|
294
292
|
y: 0,
|
|
@@ -296,41 +294,41 @@ var T = ({ data: o, getAllGraphData: v, searchType: y, highPathAnalysis: b = [],
|
|
|
296
294
|
});
|
|
297
295
|
}
|
|
298
296
|
};
|
|
299
|
-
return /* @__PURE__ */ (
|
|
297
|
+
return /* @__PURE__ */ S(r, {
|
|
300
298
|
value: {
|
|
301
|
-
pathNodes:
|
|
302
|
-
setPathNodes:
|
|
303
|
-
graphInfo:
|
|
304
|
-
graphData:
|
|
305
|
-
layoutType:
|
|
306
|
-
setLayoutType:
|
|
299
|
+
pathNodes: B,
|
|
300
|
+
setPathNodes: V,
|
|
301
|
+
graphInfo: w,
|
|
302
|
+
graphData: E,
|
|
303
|
+
layoutType: I,
|
|
304
|
+
setLayoutType: L
|
|
307
305
|
},
|
|
308
|
-
children: /* @__PURE__ */ (
|
|
306
|
+
children: /* @__PURE__ */ C("div", {
|
|
309
307
|
className: "cytoscape-container",
|
|
310
308
|
style: { position: "relative" },
|
|
311
309
|
children: [
|
|
312
|
-
/* @__PURE__ */ (
|
|
313
|
-
/* @__PURE__ */ (
|
|
314
|
-
ref:
|
|
315
|
-
cyRef:
|
|
316
|
-
graphInfo:
|
|
310
|
+
/* @__PURE__ */ S("div", { className: "btn-group" }),
|
|
311
|
+
/* @__PURE__ */ S(o, {
|
|
312
|
+
ref: k,
|
|
313
|
+
cyRef: O,
|
|
314
|
+
graphInfo: w,
|
|
317
315
|
initNodeScale: 1,
|
|
318
|
-
cyContainerRef:
|
|
319
|
-
typeObj:
|
|
320
|
-
relationObj:
|
|
316
|
+
cyContainerRef: T,
|
|
317
|
+
typeObj: M,
|
|
318
|
+
relationObj: P
|
|
321
319
|
}),
|
|
322
|
-
/* @__PURE__ */ (
|
|
320
|
+
/* @__PURE__ */ C("div", {
|
|
323
321
|
style: { position: "relative" },
|
|
324
322
|
children: [
|
|
325
|
-
/* @__PURE__ */ (
|
|
326
|
-
ref:
|
|
323
|
+
/* @__PURE__ */ S("div", {
|
|
324
|
+
ref: T,
|
|
327
325
|
className: "cy-container"
|
|
328
326
|
}),
|
|
329
|
-
|
|
327
|
+
H.visible && H.targetNode && /* @__PURE__ */ S("div", {
|
|
330
328
|
style: {
|
|
331
329
|
position: "absolute",
|
|
332
|
-
left: `${
|
|
333
|
-
top: `${
|
|
330
|
+
left: `${H.x}px`,
|
|
331
|
+
top: `${H.y}px`,
|
|
334
332
|
zIndex: 1e4,
|
|
335
333
|
minWidth: "120px",
|
|
336
334
|
padding: "4px 0",
|
|
@@ -340,17 +338,17 @@ var T = ({ data: o, getAllGraphData: v, searchType: y, highPathAnalysis: b = [],
|
|
|
340
338
|
overflow: "hidden"
|
|
341
339
|
},
|
|
342
340
|
onClick: (e) => e.stopPropagation(),
|
|
343
|
-
children: /* @__PURE__ */ (
|
|
344
|
-
items:
|
|
345
|
-
centerImage:
|
|
346
|
-
onClick: (e) =>
|
|
341
|
+
children: /* @__PURE__ */ S(u, {
|
|
342
|
+
items: K,
|
|
343
|
+
centerImage: H?.targetNode?.data().image,
|
|
344
|
+
onClick: (e) => Y(e)
|
|
347
345
|
})
|
|
348
346
|
}),
|
|
349
|
-
|
|
347
|
+
W.visible && /* @__PURE__ */ S("div", {
|
|
350
348
|
style: {
|
|
351
349
|
position: "absolute",
|
|
352
|
-
left: `${
|
|
353
|
-
top: `${
|
|
350
|
+
left: `${W.x}px`,
|
|
351
|
+
top: `${W.y}px`,
|
|
354
352
|
transform: "translateX(-50%)",
|
|
355
353
|
backgroundColor: "rgba(0, 0, 0, 0.85)",
|
|
356
354
|
color: "#fff",
|
|
@@ -364,12 +362,12 @@ var T = ({ data: o, getAllGraphData: v, searchType: y, highPathAnalysis: b = [],
|
|
|
364
362
|
overflow: "hidden",
|
|
365
363
|
textOverflow: "ellipsis"
|
|
366
364
|
},
|
|
367
|
-
children:
|
|
365
|
+
children: W.content
|
|
368
366
|
})
|
|
369
367
|
]
|
|
370
368
|
}),
|
|
371
|
-
/* @__PURE__ */ (
|
|
372
|
-
/* @__PURE__ */ (
|
|
369
|
+
/* @__PURE__ */ S(d, { ref: R }),
|
|
370
|
+
/* @__PURE__ */ S(f, { ref: z })
|
|
373
371
|
]
|
|
374
372
|
})
|
|
375
373
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Button as e } from "antd";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/Demo.tsx
|
|
4
|
+
function n({ children: n, onClick: r }) {
|
|
5
|
+
return /* @__PURE__ */ t(e, {
|
|
6
|
+
onClick: r,
|
|
7
|
+
type: "primary",
|
|
8
|
+
children: n
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as default };
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-kggraph",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "A knowledge graph visualization component based on Cytoscape",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./lib/index.
|
|
7
|
-
"module": "./lib/index.
|
|
6
|
+
"main": "./lib/index.es.js",
|
|
7
|
+
"module": "./lib/index.es.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"import": "./lib/index.
|
|
11
|
-
"require": "./lib/index.cjs.js"
|
|
10
|
+
"import": "./lib/index.es.js"
|
|
12
11
|
}
|
|
13
12
|
},
|
|
14
13
|
"files": [
|
|
@@ -24,8 +23,14 @@
|
|
|
24
23
|
"license": "MIT",
|
|
25
24
|
"peerDependencies": {
|
|
26
25
|
"antd": ">=5.0.0",
|
|
26
|
+
"cytoscape": "^3.33.3",
|
|
27
|
+
"cytoscape-cise": "^2.0.1",
|
|
28
|
+
"cytoscape-cose-bilkent": "^4.1.0",
|
|
29
|
+
"cytoscape-fcose": "^2.2.0",
|
|
30
|
+
"cytoscape-layout-utilities": "^1.1.1",
|
|
27
31
|
"react": ">=16.8.0",
|
|
28
|
-
"react-dom": ">=16.8.0"
|
|
32
|
+
"react-dom": ">=16.8.0",
|
|
33
|
+
"storm-layout": "^1.1.5"
|
|
29
34
|
},
|
|
30
35
|
"scripts": {
|
|
31
36
|
"dev": "vite",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.query-node{background-color:#fff;border-radius:10px;width:300px;padding:10px 20px;position:absolute;top:20px;right:0}.query-node .title{justify-content:space-between;align-items:center;height:35px;margin-bottom:10px;font-size:14px;font-weight:700;display:flex}
|
package/lib/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./index39.cjs.js`),t=require(`./index40.cjs.js`);exports.CytoscapeReact=e,exports.SearchType=t.SearchType,exports.default=e;
|
package/lib/index.esm.js
DELETED