react-kggraph 0.0.23 → 0.0.25
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.es16.js +20 -21
- package/lib/index.es17.js +42 -0
- package/lib/index.es18.js +3 -15466
- package/lib/index.es19.js +2 -54
- package/lib/index.es21.js +15461 -63
- package/lib/index.es22.js +53 -39
- package/lib/index.es23.js +60 -2
- package/lib/index.es24.js +69 -2
- package/lib/index.es25.js +2 -2
- package/lib/index.es26.js +2 -2
- package/lib/index.es27.js +1 -1
- package/lib/index.es28.js +1 -1
- package/lib/index.es29.js +1 -1
- package/lib/index.es3.js +44 -42
- package/lib/index.es30.js +1 -1
- package/lib/index.es31.js +1 -1
- package/lib/index.es32.js +1 -1
- package/lib/index.es33.js +2 -2
- package/lib/index.es34.js +4 -0
- package/lib/index.es35.js +2 -64
- package/lib/index.es37.js +64 -2
- package/lib/index.es38.js +1049 -0
- package/lib/index.es4.js +12 -8
- package/lib/index.es42.js +18 -40
- package/lib/index.es43.js +41 -40
- package/lib/index.es44.js +38 -87
- package/lib/index.es45.js +86 -53
- package/lib/index.es46.js +53 -28
- package/lib/index.es47.js +33 -0
- package/lib/index.es7.js +391 -382
- package/lib/index.es8.js +11 -11
- package/lib/src/components/Graph/components/ActionBar/actionList.d.ts +4 -0
- package/lib/src/components/Graph/components/ActionBar/index.d.ts +2 -0
- package/lib/src/components/Graph/types.d.ts +10 -2
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/lib/index.es20.js +0 -62
- package/lib/index.es36.js +0 -6
- package/lib/index.es41.js +0 -21
- /package/lib/{index.es48.js → index.es49.js} +0 -0
package/lib/index.es7.js
CHANGED
|
@@ -1,158 +1,150 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as u, Fragment as Z, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import K, { forwardRef as Re, useContext as et, useState as C, useRef as tt, useImperativeHandle as ot, useEffect as nt } from "react";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { Dropdown as
|
|
5
|
-
import { utils as
|
|
6
|
-
import { textPositionConfig as
|
|
7
|
-
import { GraphContext as
|
|
8
|
-
import { layout as
|
|
9
|
-
import { defaultColors as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { downloadFile as
|
|
15
|
-
import { actionList as
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
import { Dropdown as lt, Flex as N, Modal as st, Drawer as at, Tabs as ce, Form as f, Input as O, Select as p, ColorPicker as _, Button as ge, Row as it, message as F } from "antd";
|
|
5
|
+
import { utils as P, writeFile as rt } 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 ut, getCyData as de, donwnGraphData as pt } from "./index.es8.js";
|
|
7
|
+
import { GraphContext as ft } from "./index.es15.js";
|
|
8
|
+
import { layout as bt, fixNodesToEdges as wt } from "./index.es9.js";
|
|
9
|
+
import { defaultColors as H, nodeSize as q } from "./index.es10.js";
|
|
10
|
+
import yt from "./index.es22.js";
|
|
11
|
+
import Ct from "./index.es23.js";
|
|
12
|
+
import vt from "./index.es24.js";
|
|
13
|
+
import I from "./index.es17.js";
|
|
14
|
+
import { downloadFile as he } from "./index.es12.js";
|
|
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
|
+
const M = (b, c) => (k) => {
|
|
18
|
+
k.stopPropagation(), b == null || b(c || "");
|
|
19
|
+
}, Dt = (b) => {
|
|
19
20
|
if (typeof b == "string")
|
|
20
21
|
switch (b) {
|
|
21
22
|
case "top":
|
|
22
|
-
return { top: 20, left:
|
|
23
|
+
return { top: 20, left: 20 };
|
|
23
24
|
case "bottom":
|
|
24
|
-
return { bottom: 20, left:
|
|
25
|
+
return { bottom: 20, left: 20 };
|
|
25
26
|
case "left":
|
|
26
|
-
return {
|
|
27
|
+
return { bottom: "10%", left: 20 };
|
|
27
28
|
case "right":
|
|
28
|
-
return {
|
|
29
|
-
case "top-left":
|
|
30
|
-
return { top: 20, left: 20 };
|
|
31
|
-
case "top-right":
|
|
32
|
-
return { top: 20, right: 20 };
|
|
33
|
-
case "bottom-left":
|
|
34
|
-
return { bottom: 20, left: 20 };
|
|
35
|
-
case "bottom-right":
|
|
29
|
+
return { bottom: "10%", right: 20 };
|
|
36
30
|
default:
|
|
37
31
|
return { bottom: 20, right: 20 };
|
|
38
32
|
}
|
|
39
33
|
return b;
|
|
40
|
-
},
|
|
34
|
+
}, Qt = Re(({
|
|
41
35
|
graphInfo: b,
|
|
42
|
-
cyRef:
|
|
43
|
-
initNodeScale:
|
|
44
|
-
typeObj:
|
|
45
|
-
relationObj:
|
|
46
|
-
colors:
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
const F = (L == null ? void 0 : L.position) || "top-left", M = (L == null ? void 0 : L.actionList) ?? bt, H = { ...T, ...me }, { layoutType: pe, setLayoutType: fe } = Xe(ht), [k, be] = y(""), [we, Q] = y(!1), [G, ye] = y(S), [Ce, V] = y(!1), [ve, P] = y(!1), [U, xe] = y(null), [Se, X] = y(!1), [Y, B] = y(!1), [Ne, Le] = y("node"), O = Ye(null), [R, ke] = y(!0), [ee, De] = y(/* @__PURE__ */ new Set()), [te, Ee] = y(/* @__PURE__ */ new Set());
|
|
51
|
-
Be(ue, () => ({
|
|
36
|
+
cyRef: c,
|
|
37
|
+
initNodeScale: k,
|
|
38
|
+
typeObj: S,
|
|
39
|
+
relationObj: V,
|
|
40
|
+
colors: ue
|
|
41
|
+
}, pe) => {
|
|
42
|
+
const W = { ...H, ...ue }, { layoutType: fe, setLayoutType: be, queryStatisticsConfig: L, actionBar: v } = et(ft), Q = typeof v == "boolean" ? v : !0, J = (v == null ? void 0 : v.position) || "top-left", U = (v == null ? void 0 : v.actionList) ?? xt, [A, we] = C((v == null ? void 0 : v.isExpand) ?? !1), [D, ye] = C(""), [Ce, G] = C(!1), [X, ve] = C(k), [xe, z] = C(!1), [Se, T] = C(!1), [Y, Ne] = C(null), [Le, R] = C(!1), [ee, te] = C(!1), [ke, Ee] = C("node"), j = tt(null), De = Array.isArray(L) ? L.length > 0 : L, [oe, Ie] = C(De), [ne, Ve] = C(/* @__PURE__ */ new Set()), [le, Pe] = C(/* @__PURE__ */ new Set());
|
|
43
|
+
ot(pe, () => ({
|
|
52
44
|
onPathAnalysis: () => {
|
|
53
|
-
|
|
45
|
+
ae();
|
|
54
46
|
}
|
|
55
|
-
})),
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
const t =
|
|
60
|
-
if (!t || !
|
|
47
|
+
})), nt(() => {
|
|
48
|
+
se();
|
|
49
|
+
}, [D]);
|
|
50
|
+
const se = async (e) => {
|
|
51
|
+
const t = c.current;
|
|
52
|
+
if (!t || !D) {
|
|
61
53
|
t == null || t.nodes().removeClass("highlight"), t == null || t.fit();
|
|
62
54
|
return;
|
|
63
55
|
}
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
return
|
|
56
|
+
const n = t.nodes().filter((l) => {
|
|
57
|
+
const r = (l.data("name") || "").toLowerCase(), s = (l.data("role") || "").toLowerCase(), h = (l.data("dept") || "").toLowerCase(), m = String(l.data("id") || "").toLowerCase();
|
|
58
|
+
return r.includes(D.toLowerCase()) || s.includes(D.toLowerCase()) || h.includes(D.toLowerCase()) || m.includes(D.toLowerCase());
|
|
67
59
|
});
|
|
68
|
-
t.nodes().removeClass("highlight"),
|
|
60
|
+
t.nodes().removeClass("highlight"), n.addClass("highlight"), n.length === 1 ? (console.log("matchedNodes:::", n), t.animate({
|
|
69
61
|
center: {
|
|
70
|
-
eles:
|
|
62
|
+
eles: n
|
|
71
63
|
},
|
|
72
64
|
duration: 500
|
|
73
65
|
})) : alert("未找到对应节点");
|
|
74
|
-
},
|
|
75
|
-
const t =
|
|
66
|
+
}, Oe = (e) => {
|
|
67
|
+
const t = c.current;
|
|
76
68
|
if (!t) return;
|
|
77
|
-
const
|
|
78
|
-
console.log(999,
|
|
79
|
-
let
|
|
69
|
+
const n = t.zoom();
|
|
70
|
+
console.log(999, n);
|
|
71
|
+
let l = 0;
|
|
80
72
|
switch (e) {
|
|
81
73
|
case "out":
|
|
82
|
-
|
|
74
|
+
l = Math.max(n * 0.8, 0.1);
|
|
83
75
|
break;
|
|
84
76
|
case "in":
|
|
85
|
-
|
|
77
|
+
l = Math.min(n * 1.2, 3);
|
|
86
78
|
break;
|
|
87
79
|
}
|
|
88
|
-
t.zoom(
|
|
89
|
-
},
|
|
90
|
-
console.log("查询节点"),
|
|
91
|
-
},
|
|
92
|
-
console.log("路径分析"),
|
|
93
|
-
},
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
const t =
|
|
97
|
-
t && (t.nodes().unlock(),
|
|
80
|
+
t.zoom(l), t.center();
|
|
81
|
+
}, Ae = () => {
|
|
82
|
+
console.log("查询节点"), z(!0), T(!1), j.current.close();
|
|
83
|
+
}, ae = () => {
|
|
84
|
+
console.log("路径分析"), z(!1), T(!0), j.current.close();
|
|
85
|
+
}, ze = (e) => {
|
|
86
|
+
var n;
|
|
87
|
+
be(e);
|
|
88
|
+
const t = c.current;
|
|
89
|
+
t && (t.nodes().unlock(), bt(c, e), e === "cose-bilkent" && ((n = b == null ? void 0 : b.searchNodes) == null ? void 0 : n.length) === 2 && wt(
|
|
98
90
|
t,
|
|
99
91
|
b.searchNodes[0],
|
|
100
92
|
b.searchNodes[1]
|
|
101
93
|
));
|
|
102
|
-
},
|
|
103
|
-
const e =
|
|
104
|
-
e &&
|
|
105
|
-
},
|
|
106
|
-
const e =
|
|
94
|
+
}, Te = () => {
|
|
95
|
+
const e = c.current;
|
|
96
|
+
e && pt(e);
|
|
97
|
+
}, je = () => {
|
|
98
|
+
const e = c.current;
|
|
107
99
|
if (!e) return;
|
|
108
|
-
const t =
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
const
|
|
112
|
-
if (!
|
|
113
|
-
const
|
|
100
|
+
const t = de(e);
|
|
101
|
+
Ne(t), R(!0);
|
|
102
|
+
}, ie = (e, t) => {
|
|
103
|
+
const n = e.current;
|
|
104
|
+
if (!n) return;
|
|
105
|
+
const l = 2;
|
|
114
106
|
if (t === "downloadPng") {
|
|
115
|
-
const
|
|
116
|
-
|
|
107
|
+
const r = n.png({ scale: l, bg: "transparent", full: !0, quality: 1 });
|
|
108
|
+
he(r, `graph_${Date.now()}.png`);
|
|
117
109
|
} else if (t === "downloadJpg") {
|
|
118
|
-
const
|
|
119
|
-
|
|
110
|
+
const r = n.jpg({ scale: l, bg: "#ffffff", full: !0, quality: 1 });
|
|
111
|
+
he(r, `graph_${Date.now()}.jpg`);
|
|
120
112
|
}
|
|
121
|
-
},
|
|
122
|
-
const e =
|
|
113
|
+
}, Fe = () => {
|
|
114
|
+
const e = c.current;
|
|
123
115
|
if (!e) return;
|
|
124
|
-
const t =
|
|
125
|
-
var
|
|
126
|
-
const
|
|
116
|
+
const t = de(e), { nodes: n = [], edges: l = [] } = t, r = n.map((m) => {
|
|
117
|
+
var g, i;
|
|
118
|
+
const d = m.data || {}, x = d.properties || {};
|
|
127
119
|
return {
|
|
128
|
-
节点名称:
|
|
129
|
-
节点ID:
|
|
130
|
-
节点类型:
|
|
131
|
-
URI:
|
|
132
|
-
X坐标: ((
|
|
133
|
-
Y坐标: ((
|
|
134
|
-
层级:
|
|
135
|
-
宽度:
|
|
136
|
-
高度:
|
|
137
|
-
图片:
|
|
138
|
-
属性ID:
|
|
139
|
-
属性值:
|
|
120
|
+
节点名称: d.name || d.label || "",
|
|
121
|
+
节点ID: d.id || "",
|
|
122
|
+
节点类型: d.types || "",
|
|
123
|
+
URI: d.label || "",
|
|
124
|
+
X坐标: ((g = m.position) == null ? void 0 : g.x) || "",
|
|
125
|
+
Y坐标: ((i = m.position) == null ? void 0 : i.y) || "",
|
|
126
|
+
层级: d.level || "",
|
|
127
|
+
宽度: d.baseWidth || "",
|
|
128
|
+
高度: d.baseHeight || "",
|
|
129
|
+
图片: d.image || "",
|
|
130
|
+
属性ID: x.id || "",
|
|
131
|
+
属性值: x.value || ""
|
|
140
132
|
};
|
|
141
|
-
}),
|
|
142
|
-
var
|
|
143
|
-
const
|
|
133
|
+
}), s = l.map((m) => {
|
|
134
|
+
var i, a, w, E;
|
|
135
|
+
const d = m.data || {}, x = ((a = (i = d.source) == null ? void 0 : i.split("/#")[0]) == null ? void 0 : a.split("/").pop()) || d.source, g = ((E = (w = d.target) == null ? void 0 : w.split("/#")[0]) == null ? void 0 : E.split("/").pop()) || d.target;
|
|
144
136
|
return {
|
|
145
|
-
源节点:
|
|
146
|
-
目标节点:
|
|
147
|
-
源URI:
|
|
148
|
-
目标URI:
|
|
149
|
-
关系名称:
|
|
150
|
-
关系ID:
|
|
137
|
+
源节点: x,
|
|
138
|
+
目标节点: g,
|
|
139
|
+
源URI: d.source || "",
|
|
140
|
+
目标URI: d.target || "",
|
|
141
|
+
关系名称: d.name || d.label || "",
|
|
142
|
+
关系ID: d.id || ""
|
|
151
143
|
};
|
|
152
|
-
}),
|
|
153
|
-
if (
|
|
154
|
-
const
|
|
155
|
-
|
|
144
|
+
}), h = P.book_new();
|
|
145
|
+
if (r.length > 0) {
|
|
146
|
+
const m = P.json_to_sheet(r);
|
|
147
|
+
m["!cols"] = [
|
|
156
148
|
{ wch: 30 },
|
|
157
149
|
// 节点名称
|
|
158
150
|
{ wch: 60 },
|
|
@@ -177,11 +169,11 @@ const q = (b, r) => (S) => {
|
|
|
177
169
|
// 属性ID
|
|
178
170
|
{ wch: 40 }
|
|
179
171
|
// 属性值
|
|
180
|
-
],
|
|
172
|
+
], P.book_append_sheet(h, m, "节点");
|
|
181
173
|
}
|
|
182
|
-
if (
|
|
183
|
-
const
|
|
184
|
-
|
|
174
|
+
if (s.length > 0) {
|
|
175
|
+
const m = P.json_to_sheet(s);
|
|
176
|
+
m["!cols"] = [
|
|
185
177
|
{ wch: 30 },
|
|
186
178
|
// 源节点
|
|
187
179
|
{ wch: 30 },
|
|
@@ -194,262 +186,279 @@ const q = (b, r) => (S) => {
|
|
|
194
186
|
// 关系名称
|
|
195
187
|
{ wch: 40 }
|
|
196
188
|
// 关系ID
|
|
197
|
-
],
|
|
189
|
+
], P.book_append_sheet(h, m, "关系");
|
|
198
190
|
}
|
|
199
|
-
|
|
200
|
-
},
|
|
191
|
+
rt(h, `graph_${Date.now()}.xlsx`);
|
|
192
|
+
}, He = (e, t) => {
|
|
201
193
|
switch (e.stopPropagation(), t) {
|
|
202
194
|
case "downloadJson":
|
|
203
|
-
|
|
195
|
+
Te();
|
|
204
196
|
break;
|
|
205
197
|
case "previewJsonList":
|
|
206
|
-
|
|
198
|
+
je();
|
|
207
199
|
break;
|
|
208
200
|
case "downloadExcel":
|
|
209
|
-
|
|
201
|
+
Fe();
|
|
210
202
|
break;
|
|
211
203
|
case "previewDataList":
|
|
212
204
|
break;
|
|
213
205
|
case "downloadJpg":
|
|
214
|
-
|
|
206
|
+
ie(c, t);
|
|
215
207
|
break;
|
|
216
208
|
case "downloadPng":
|
|
217
|
-
|
|
209
|
+
ie(c, t);
|
|
218
210
|
break;
|
|
219
211
|
}
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
},
|
|
223
|
-
const t =
|
|
212
|
+
}, _e = () => {
|
|
213
|
+
z(!1), T(!1), j.current.open();
|
|
214
|
+
}, We = (e) => {
|
|
215
|
+
const t = c.current;
|
|
224
216
|
if (t)
|
|
225
217
|
if (t.panningEnabled(!0), e === "all")
|
|
226
218
|
t.nodes().addClass("selected"), t.nodes().select(), t.elements().select();
|
|
227
219
|
else if (e === "reverse") {
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
} else e === "click" ? (t.off("click", "node"), t.on("click", "node", (
|
|
231
|
-
const
|
|
232
|
-
t.nodes().removeClass("selected grayed highlighted"), t.edges().removeClass("selected grayed highlighted"),
|
|
233
|
-
const
|
|
234
|
-
console.log("cy.nodes().not(relatedNodes):::",
|
|
220
|
+
const n = t.elements().filter(":selected"), l = t.elements().not(":selected");
|
|
221
|
+
n.length > 0 ? (n.unselect(), l.select(), n.removeClass("selected"), l.addClass("selected")) : (t.elements().select(), t.elements().addClass("selected"));
|
|
222
|
+
} else e === "click" ? (t.off("click", "node"), t.on("click", "node", (n) => {
|
|
223
|
+
const l = n.target;
|
|
224
|
+
t.nodes().removeClass("selected grayed highlighted"), t.edges().removeClass("selected grayed highlighted"), l.addClass("selected");
|
|
225
|
+
const s = l.neighborhood().nodes().add(l), h = s.edgesWith(s);
|
|
226
|
+
console.log("cy.nodes().not(relatedNodes):::", s), t.nodes().not(s).addClass("grayed"), t.edges().not(h).addClass("grayed"), s.addClass("highlighted"), h.addClass("highlighted");
|
|
235
227
|
})) : e === "box" && (console.log("进入框选模式"), t.nodes().removeClass("selected"), t.nodes().unselect(), t.elements().unselect(), t.boxSelectionEnabled(!0), t.panningEnabled(!1), t.on("boxselectstart", () => {
|
|
236
228
|
console.log("开始框选...");
|
|
237
|
-
}), t.on("boxselect", (
|
|
238
|
-
const
|
|
239
|
-
console.log("框选完成,选中元素数:",
|
|
229
|
+
}), t.on("boxselect", (n) => {
|
|
230
|
+
const l = t.elements(":selected");
|
|
231
|
+
console.log("框选完成,选中元素数:", l.length), t.elements().removeClass("selected"), l.addClass("selected");
|
|
240
232
|
}), t.on("boxselectend", () => {
|
|
241
233
|
console.log("框选结束"), t.zoomingEnabled(!0), t.panningEnabled(!0);
|
|
242
234
|
}));
|
|
243
|
-
},
|
|
244
|
-
const e =
|
|
245
|
-
if (console.log("isShow::::"),
|
|
246
|
-
|
|
235
|
+
}, Je = () => {
|
|
236
|
+
const e = c.current;
|
|
237
|
+
if (console.log("isShow::::"), Ce)
|
|
238
|
+
G(!1), e.nodes('[types="typed-literal" ]').style("visibility", "visible"), e.edges().style("visibility", "visible");
|
|
247
239
|
else {
|
|
248
|
-
|
|
240
|
+
G(!0);
|
|
249
241
|
const t = e.nodes('[types="typed-literal" ]');
|
|
250
242
|
t.style("visibility", "hidden"), t.connectedEdges().style("visibility", "hidden");
|
|
251
243
|
}
|
|
252
|
-
},
|
|
253
|
-
const t =
|
|
244
|
+
}, $e = (e) => {
|
|
245
|
+
const t = c.current;
|
|
254
246
|
if (!t) return;
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
},
|
|
262
|
-
const
|
|
263
|
-
if (!
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
if (
|
|
267
|
-
|
|
247
|
+
const n = e === "out" ? Math.max(X * 0.8, 0.1) : Math.min(X * 1.2, 5);
|
|
248
|
+
ve(n);
|
|
249
|
+
const l = t.nodes();
|
|
250
|
+
l.style("width", (r) => (r.data("baseWidth") || q) * n), l.style("height", (r) => (r.data("baseHeight") || q) * n);
|
|
251
|
+
}, Be = (e) => {
|
|
252
|
+
ye(e.content), se(e.content);
|
|
253
|
+
}, Ze = (e = "刘强东", t = "1") => {
|
|
254
|
+
const n = c.current;
|
|
255
|
+
if (!n) return;
|
|
256
|
+
n.elements().removeClass("level-highlight level-selected level-grayed level-highlightedge");
|
|
257
|
+
const l = n.nodes().filter((g) => (g.data("name") || g.data("id") || "").toString().includes(e));
|
|
258
|
+
if (l.length === 0) {
|
|
259
|
+
F.warning(`未找到节点: ${e}`);
|
|
268
260
|
return;
|
|
269
261
|
}
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
let
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}),
|
|
278
|
-
for (let w = 2; w <=
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
262
|
+
const r = parseInt(t) || 1, s = n.collection(), h = [];
|
|
263
|
+
l.forEach((g) => {
|
|
264
|
+
g.addClass("level-selected"), s.merge(g);
|
|
265
|
+
let i = n.collection();
|
|
266
|
+
const a = /* @__PURE__ */ new Set();
|
|
267
|
+
a.add(g.id()), r >= 1 && (i = g.neighborhood().nodes(), i.forEach((w) => {
|
|
268
|
+
a.add(w.id()), s.merge(w);
|
|
269
|
+
}), h.push(i));
|
|
270
|
+
for (let w = 2; w <= r; w++) {
|
|
271
|
+
const E = n.collection();
|
|
272
|
+
i.forEach(($) => {
|
|
273
|
+
$.neighborhood().nodes().forEach((B) => {
|
|
274
|
+
a.has(B.id()) || (a.add(B.id()), E.merge(B));
|
|
283
275
|
});
|
|
284
|
-
}),
|
|
276
|
+
}), E.forEach(($) => s.merge($)), h.push(E), i = E;
|
|
285
277
|
}
|
|
286
|
-
}),
|
|
287
|
-
|
|
288
|
-
}),
|
|
289
|
-
const
|
|
290
|
-
return
|
|
278
|
+
}), h.forEach((g) => {
|
|
279
|
+
g.addClass("level-highlight");
|
|
280
|
+
}), n.edges().filter((g) => {
|
|
281
|
+
const i = g.source(), a = g.target();
|
|
282
|
+
return s.contains(i) && s.contains(a);
|
|
291
283
|
}).addClass("level-highlightedge");
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
},
|
|
295
|
-
const t =
|
|
284
|
+
const d = n.elements().filter(".level-selected, .level-highlight, .level-highlightedge");
|
|
285
|
+
n.elements().not(d).addClass("level-grayed"), F.success(`已高亮 "${e}" 及其 ${r} 度关联节点和连线`);
|
|
286
|
+
}, Ke = (e) => {
|
|
287
|
+
const t = c.current;
|
|
296
288
|
if (!t) return;
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
},
|
|
300
|
-
const t =
|
|
289
|
+
const n = new Set(ne);
|
|
290
|
+
n.has(e) ? (n.delete(e), t.nodes().filter((l) => l.data("type") === e).show()) : (n.add(e), t.nodes().filter((l) => l.data("type") === e).hide()), Ve(n);
|
|
291
|
+
}, Me = (e) => {
|
|
292
|
+
const t = c.current;
|
|
301
293
|
if (!t) return;
|
|
302
|
-
const
|
|
303
|
-
|
|
294
|
+
const n = new Set(le);
|
|
295
|
+
n.has(e) ? (n.delete(e), t.edges().filter((l) => l.data("name") === e).show()) : (n.add(e), t.edges().filter((l) => l.data("name") === e).hide()), Pe(n);
|
|
304
296
|
}, qe = () => {
|
|
305
|
-
const e =
|
|
297
|
+
const e = c.current;
|
|
306
298
|
e.remove(e.elements());
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
},
|
|
310
|
-
var
|
|
311
|
-
const t =
|
|
299
|
+
}, Qe = () => {
|
|
300
|
+
te(!ee);
|
|
301
|
+
}, Ue = (e) => {
|
|
302
|
+
var r, s;
|
|
303
|
+
const t = c.current;
|
|
312
304
|
if (!t) return;
|
|
313
305
|
console.log("saveNodeConfig values:", e), console.log("showLabel value:", e.showLabel);
|
|
314
|
-
const
|
|
315
|
-
console.log("showLabelValue:",
|
|
316
|
-
const
|
|
317
|
-
console.log("Setting node label:",
|
|
306
|
+
const n = typeof e.fontColor == "object" && ((s = (r = e.fontColor) == null ? void 0 : r.toHexString) == null ? void 0 : s.call(r)) || e.fontColor, l = e.showLabel === "show";
|
|
307
|
+
console.log("showLabelValue:", l), t.nodes().forEach((h) => {
|
|
308
|
+
const m = l && (h.data("name") || h.data("label")) || "";
|
|
309
|
+
console.log("Setting node label:", m), h.style({
|
|
318
310
|
width: e.nodeSize,
|
|
319
311
|
height: e.nodeSize,
|
|
320
312
|
"font-size": e.fontSize,
|
|
321
|
-
color:
|
|
313
|
+
color: n || W.nodeLabelColor,
|
|
322
314
|
"font-weight": e.fontWeight,
|
|
323
315
|
"font-style": e.fontStyle,
|
|
324
316
|
"text-valign": e.textPosition,
|
|
325
317
|
"text-halign": "center",
|
|
326
318
|
"text-margin-y": e.textOffset,
|
|
327
|
-
label:
|
|
328
|
-
"text-opacity":
|
|
319
|
+
label: m,
|
|
320
|
+
"text-opacity": m ? 1 : 0
|
|
329
321
|
});
|
|
330
|
-
}),
|
|
331
|
-
},
|
|
332
|
-
var
|
|
333
|
-
const t =
|
|
322
|
+
}), F.success("节点配置保存成功");
|
|
323
|
+
}, Ge = (e) => {
|
|
324
|
+
var h, m, d, x, g, i;
|
|
325
|
+
const t = c.current;
|
|
334
326
|
if (!t) return;
|
|
335
327
|
console.log("saveEdgeConfig values:", e), console.log("edge showLabel value:", e.showLabel);
|
|
336
|
-
const
|
|
337
|
-
t.edges().forEach((
|
|
338
|
-
const w =
|
|
339
|
-
console.log("Setting edge label:", w),
|
|
328
|
+
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" && ((x = (d = e.fontColor) == null ? void 0 : d.toHexString) == null ? void 0 : x.call(d)) || e.fontColor, r = typeof e.labelBgColor == "object" && ((i = (g = e.labelBgColor) == null ? void 0 : g.toHexString) == null ? void 0 : i.call(g)) || e.labelBgColor, s = e.showLabel === "show";
|
|
329
|
+
t.edges().forEach((a) => {
|
|
330
|
+
const w = s && (a.data("label") || a.data("name")) || "";
|
|
331
|
+
console.log("Setting edge label:", w), a.style({
|
|
340
332
|
width: e.edgeWidth,
|
|
341
|
-
"line-color":
|
|
342
|
-
"target-arrow-color":
|
|
333
|
+
"line-color": n || H.edgeDefaultColor,
|
|
334
|
+
"target-arrow-color": n || H.edgeDefaultColor,
|
|
343
335
|
"target-arrow-shape": e.showArrow === "show" ? "triangle" : "none",
|
|
344
336
|
"font-size": e.fontSize,
|
|
345
|
-
color:
|
|
337
|
+
color: l || H.edgeLabelColor,
|
|
346
338
|
"font-weight": e.fontWeight,
|
|
347
339
|
"font-style": e.fontStyle,
|
|
348
340
|
label: w,
|
|
349
341
|
"text-opacity": w ? 1 : 0,
|
|
350
|
-
"text-background-color":
|
|
351
|
-
"text-background-opacity":
|
|
342
|
+
"text-background-color": r || "transparent",
|
|
343
|
+
"text-background-opacity": r ? 1 : 0,
|
|
352
344
|
"text-background-padding": "2px"
|
|
353
345
|
});
|
|
354
|
-
}),
|
|
355
|
-
},
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
346
|
+
}), F.success("连线配置保存成功");
|
|
347
|
+
}, Xe = Dt(J), y = J === "left" || J === "right";
|
|
348
|
+
if (console.log(1e3, Q, U), !Q) return null;
|
|
349
|
+
const Ye = Array.isArray(L) && (L == null ? void 0 : L.length) > 0 ? L : St, re = () => /* @__PURE__ */ u(it, { justify: "center", align: "middle", className: I("cursor", {
|
|
350
|
+
"oprate-btn-vertical": y,
|
|
351
|
+
"oprate-btn": !y
|
|
352
|
+
}), onClick: () => we(!A), children: [
|
|
353
|
+
"操作 ",
|
|
354
|
+
A ? y ? /* @__PURE__ */ o(Nt, {}) : /* @__PURE__ */ o(Lt, {}) : y ? /* @__PURE__ */ o(kt, {}) : /* @__PURE__ */ o(Et, {})
|
|
355
|
+
] });
|
|
356
|
+
return /* @__PURE__ */ u(Z, { children: [
|
|
357
|
+
/* @__PURE__ */ o("div", { className: I("graph-bar", { "graph-bar-vertical": y }), style: Xe, children: /* @__PURE__ */ u("div", { className: I("graph-bar-min", {
|
|
358
|
+
"graph-bar-min-vertical": y
|
|
359
|
+
}), children: [
|
|
360
|
+
!y && re(),
|
|
361
|
+
/* @__PURE__ */ o("div", { className: I({
|
|
362
|
+
"graph-bar-expand-wrapper-vertical": y,
|
|
363
|
+
"graph-bar-expand-wrapper": !y,
|
|
364
|
+
"collapsed-vertical": !A && y,
|
|
365
|
+
collapsed: !A && !y
|
|
366
|
+
}), children: U.map(({ key: e, title: t, icon: n, onClick: l }) => {
|
|
367
|
+
var m, d, x, g;
|
|
368
|
+
const r = () => n && n.length > 0 ? n.length > 1 ? /* @__PURE__ */ o(N, { gap: "5px", children: n.map((i, a) => e === "nodeZoom" ? K.cloneElement(i, {
|
|
369
|
+
onClick: () => $e(a === 0 ? "in" : "out"),
|
|
370
|
+
key: a
|
|
371
|
+
}) : e === "canvasZoom" ? K.cloneElement(i, {
|
|
372
|
+
onClick: () => Oe(a === 0 ? "in" : "out"),
|
|
373
|
+
key: a
|
|
374
|
+
}) : K.cloneElement(i, { key: a })) }) : /* @__PURE__ */ o(N, { gap: "5px", children: n }) : null, s = (i) => {
|
|
375
|
+
switch (console.log(444, e, i), e) {
|
|
376
|
+
case "queryStatistics":
|
|
377
|
+
Ie(!oe);
|
|
378
|
+
break;
|
|
379
|
+
case "graphDisplaySettings":
|
|
380
|
+
Qe();
|
|
381
|
+
break;
|
|
382
|
+
case "hideAttributes":
|
|
383
|
+
Je();
|
|
384
|
+
break;
|
|
385
|
+
case "clearCanvas":
|
|
386
|
+
qe();
|
|
387
|
+
break;
|
|
388
|
+
default:
|
|
389
|
+
i == null || i(c);
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
if (["layout", "analysis", "select", "downloadData", "textPosition"].includes(e)) {
|
|
393
|
+
let i = [];
|
|
394
|
+
switch (e) {
|
|
395
|
+
case "layout":
|
|
396
|
+
i = (m = mt) == null ? void 0 : m.map((a) => ({
|
|
397
|
+
...a,
|
|
398
|
+
label: /* @__PURE__ */ o("div", { className: I({ "text-[#145afd]": fe === a.key }), onClick: M(ze, a.key), children: a.label })
|
|
399
|
+
}));
|
|
400
|
+
break;
|
|
401
|
+
case "analysis":
|
|
402
|
+
i = gt.map((a) => ({
|
|
403
|
+
...a,
|
|
404
|
+
label: /* @__PURE__ */ o("div", { onClick: (w) => {
|
|
405
|
+
switch (w.stopPropagation(), a.key) {
|
|
406
|
+
case "query":
|
|
407
|
+
Ae();
|
|
408
|
+
break;
|
|
409
|
+
case "link":
|
|
410
|
+
_e();
|
|
411
|
+
break;
|
|
412
|
+
case "path":
|
|
413
|
+
ae();
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
}, children: a.label })
|
|
417
|
+
}));
|
|
418
|
+
break;
|
|
419
|
+
case "select":
|
|
420
|
+
i = (d = ht) == null ? void 0 : d.map((a) => ({ ...a, label: /* @__PURE__ */ o("div", { onClick: M(We, a.key), children: a.label }) }));
|
|
421
|
+
break;
|
|
422
|
+
case "downloadData":
|
|
423
|
+
i = (x = dt) == null ? void 0 : x.map((a) => ({ ...a, label: /* @__PURE__ */ o("div", { onClick: (w) => He(w, a.key), children: a.label }) }));
|
|
424
|
+
break;
|
|
425
|
+
case "textPosition":
|
|
426
|
+
i = (g = me) == null ? void 0 : g.map((a) => ({ ...a, label: /* @__PURE__ */ o("div", { onClick: M(() => ct(c, a.key), a.key), children: a.label }) }));
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
return /* @__PURE__ */ o(lt, { trigger: ["hover"], placement: y ? "bottomRight" : "bottom", menu: { items: i }, children: /* @__PURE__ */ u(N, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor bar-item", children: [
|
|
430
|
+
r(),
|
|
431
|
+
/* @__PURE__ */ o(N, { className: "w-100", justify: "center", children: t })
|
|
432
|
+
] }) }, e);
|
|
421
433
|
}
|
|
422
|
-
return /* @__PURE__ */
|
|
423
|
-
|
|
424
|
-
/* @__PURE__ */ o(
|
|
425
|
-
] }
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
/* @__PURE__ */ o(ut, { isVisible: Ce, searchChange: (e) => We(e), closeQuery: () => V(!1) }),
|
|
433
|
-
/* @__PURE__ */ o(pt, { isVisible: ve, analysis: (e) => ct(r, { pathNodes: e }), closePath: () => P(!1) }),
|
|
434
|
-
/* @__PURE__ */ o(ft, { ref: O, onLevelClick: Je }),
|
|
434
|
+
return /* @__PURE__ */ u(N, { wrap: !0, align: "center", justify: "center", className: "hove-active cursor bar-item", onClick: () => s(l), children: [
|
|
435
|
+
r(),
|
|
436
|
+
/* @__PURE__ */ o(N, { className: "w-100", justify: "center", children: t })
|
|
437
|
+
] }, e);
|
|
438
|
+
}) }),
|
|
439
|
+
y && re()
|
|
440
|
+
] }) }),
|
|
441
|
+
/* @__PURE__ */ o(yt, { isVisible: xe, searchChange: (e) => Be(e), closeQuery: () => z(!1) }),
|
|
442
|
+
/* @__PURE__ */ o(Ct, { isVisible: Se, analysis: (e) => ut(c, { pathNodes: e }), closePath: () => T(!1) }),
|
|
443
|
+
/* @__PURE__ */ o(vt, { ref: j, onLevelClick: Ze }),
|
|
435
444
|
/* @__PURE__ */ o(
|
|
436
|
-
|
|
445
|
+
st,
|
|
437
446
|
{
|
|
438
447
|
title: "JSON预览",
|
|
439
|
-
open:
|
|
440
|
-
onCancel: () =>
|
|
448
|
+
open: Le,
|
|
449
|
+
onCancel: () => R(!1),
|
|
441
450
|
footer: null,
|
|
442
451
|
width: 800,
|
|
443
|
-
children: /* @__PURE__ */ o("pre", { style: { maxHeight: "60vh", overflow: "auto", background: "#f5f5f5", padding: "16px", borderRadius: "4px" }, children:
|
|
452
|
+
children: /* @__PURE__ */ o("pre", { style: { maxHeight: "60vh", overflow: "auto", background: "#f5f5f5", padding: "16px", borderRadius: "4px" }, children: Y ? JSON.stringify(Y, null, 2) : "暂无数据" })
|
|
444
453
|
}
|
|
445
454
|
),
|
|
446
455
|
/* @__PURE__ */ o(
|
|
447
|
-
|
|
456
|
+
at,
|
|
448
457
|
{
|
|
449
458
|
title: "图显示设置",
|
|
450
459
|
placement: "right",
|
|
451
|
-
open:
|
|
452
|
-
onClose: () =>
|
|
460
|
+
open: ee,
|
|
461
|
+
onClose: () => te(!1),
|
|
453
462
|
mask: !1,
|
|
454
463
|
size: 300,
|
|
455
464
|
styles: {
|
|
@@ -459,132 +468,132 @@ const q = (b, r) => (S) => {
|
|
|
459
468
|
},
|
|
460
469
|
getContainer: !1,
|
|
461
470
|
children: /* @__PURE__ */ o(
|
|
462
|
-
|
|
471
|
+
ce,
|
|
463
472
|
{
|
|
464
|
-
activeKey:
|
|
465
|
-
onChange:
|
|
473
|
+
activeKey: ke,
|
|
474
|
+
onChange: Ee,
|
|
466
475
|
style: { flex: 1, overflow: "auto" },
|
|
467
476
|
tabBarStyle: { padding: "0 16px", margin: 0, background: "#fff", position: "sticky", top: 0, zIndex: 10 },
|
|
468
477
|
items: [
|
|
469
478
|
{
|
|
470
479
|
label: "节点设置",
|
|
471
480
|
key: "node",
|
|
472
|
-
children: /* @__PURE__ */ o(
|
|
481
|
+
children: /* @__PURE__ */ o(It, { onSave: Ue, colors: W })
|
|
473
482
|
},
|
|
474
483
|
{
|
|
475
484
|
label: "连线设置",
|
|
476
485
|
key: "edge",
|
|
477
|
-
children: /* @__PURE__ */ o(
|
|
486
|
+
children: /* @__PURE__ */ o(Vt, { onSave: Ge, colors: W })
|
|
478
487
|
}
|
|
479
488
|
]
|
|
480
489
|
}
|
|
481
490
|
)
|
|
482
491
|
}
|
|
483
492
|
),
|
|
484
|
-
/* @__PURE__ */ o("div", { className:
|
|
485
|
-
hidden: !
|
|
493
|
+
/* @__PURE__ */ o("div", { className: I("gtaph-statics absolute", {
|
|
494
|
+
hidden: !oe
|
|
486
495
|
}), children: /* @__PURE__ */ o(
|
|
487
|
-
|
|
496
|
+
ce,
|
|
488
497
|
{
|
|
489
|
-
items:
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
498
|
+
items: Ye.map(({ key: e, label: t }) => {
|
|
499
|
+
var n, l, r;
|
|
500
|
+
return e === "entity" ? {
|
|
501
|
+
label: t,
|
|
502
|
+
key: e,
|
|
503
|
+
children: /* @__PURE__ */ o(Z, { children: Object.keys(S).length > 0 ? /* @__PURE__ */ u("div", { children: [
|
|
504
|
+
/* @__PURE__ */ u("p", { children: [
|
|
495
505
|
"实体数量:",
|
|
496
|
-
Object.values(
|
|
506
|
+
Object.values(S).reduce((s, h) => s + h.count, 0)
|
|
497
507
|
] }),
|
|
498
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ u("p", { className: "my-4px", children: [
|
|
499
509
|
"实体类型:",
|
|
500
|
-
Object.keys(
|
|
510
|
+
Object.keys(S).length
|
|
501
511
|
] }),
|
|
502
|
-
/* @__PURE__ */ o(
|
|
503
|
-
/* @__PURE__ */ o("img", { className: "w-20px rounded-50", src:
|
|
504
|
-
|
|
512
|
+
/* @__PURE__ */ o(N, { gap: "5px", justify: "start", className: "w-100", wrap: !0, children: Object.keys(S).map((s) => /* @__PURE__ */ u(N, { gap: "4px", justify: "start", className: `w-100 cursor ${ne.has(s) ? "opacity-30" : ""}`, onClick: () => Ke(s), children: [
|
|
513
|
+
/* @__PURE__ */ o("img", { className: "w-20px rounded-50", src: S[s].img, alt: "" }),
|
|
514
|
+
s,
|
|
505
515
|
":",
|
|
506
|
-
|
|
507
|
-
] },
|
|
516
|
+
S[s].count
|
|
517
|
+
] }, s)) })
|
|
508
518
|
] }) : /* @__PURE__ */ o("span", { className: "text-[#666]", children: "暂无实体统计!" }) })
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
/* @__PURE__ */ f("div", { children: [
|
|
519
|
+
} : e === "relation" ? {
|
|
520
|
+
label: t,
|
|
521
|
+
key: e,
|
|
522
|
+
children: /* @__PURE__ */ o(Z, { children: ((n = Object.keys(V)) == null ? void 0 : n.length) > 0 ? /* @__PURE__ */ u("div", { children: [
|
|
523
|
+
/* @__PURE__ */ u("div", { children: [
|
|
515
524
|
"关系数量:",
|
|
516
|
-
(
|
|
525
|
+
(l = Object.keys(V)) == null ? void 0 : l.length
|
|
517
526
|
] }),
|
|
518
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ u("div", { className: "my-4px", children: [
|
|
519
528
|
"关系类型:",
|
|
520
|
-
(
|
|
529
|
+
(r = Object.values(V)) == null ? void 0 : r.reduce((s, h) => s + h, 0)
|
|
521
530
|
] }),
|
|
522
|
-
/* @__PURE__ */ o(
|
|
523
|
-
|
|
531
|
+
/* @__PURE__ */ o(N, { gap: "5px", justify: "start", className: "w-100", wrap: !0, children: Object.keys(V).map((s) => /* @__PURE__ */ u(N, { gap: "4px", className: `w-100 cursor ${le.has(s) ? "opacity-30" : ""}`, onClick: () => Me(s), children: [
|
|
532
|
+
s,
|
|
524
533
|
":",
|
|
525
|
-
|
|
526
|
-
] },
|
|
534
|
+
V[s]
|
|
535
|
+
] }, s)) })
|
|
527
536
|
] }) : /* @__PURE__ */ o("span", { className: "text-[#666]", children: "暂无关系统计!" }) })
|
|
528
|
-
}
|
|
529
|
-
|
|
537
|
+
} : null;
|
|
538
|
+
})
|
|
530
539
|
}
|
|
531
540
|
) })
|
|
532
541
|
] });
|
|
533
|
-
}),
|
|
534
|
-
const [
|
|
535
|
-
return /* @__PURE__ */ f
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
-
/* @__PURE__ */ o(
|
|
538
|
-
/* @__PURE__ */ o(
|
|
539
|
-
/* @__PURE__ */ o(
|
|
540
|
-
/* @__PURE__ */ o(
|
|
542
|
+
}), It = ({ onSave: b, colors: c }) => {
|
|
543
|
+
const [k] = f.useForm();
|
|
544
|
+
return /* @__PURE__ */ u(f, { form: k, layout: "vertical", onFinish: b, className: "setting-form", children: [
|
|
545
|
+
/* @__PURE__ */ u("div", { className: "setting-form-content", children: [
|
|
546
|
+
/* @__PURE__ */ o(f.Item, { label: "节点大小", name: "nodeSize", initialValue: q, children: /* @__PURE__ */ o(O, { type: "number", placeholder: "请输入节点大小" }) }),
|
|
547
|
+
/* @__PURE__ */ o(f.Item, { label: "显示标签", name: "showLabel", initialValue: "show", children: /* @__PURE__ */ u(p, { children: [
|
|
548
|
+
/* @__PURE__ */ o(p.Option, { value: "show", children: "显示" }),
|
|
549
|
+
/* @__PURE__ */ o(p.Option, { value: "hide", children: "隐藏" })
|
|
541
550
|
] }) }),
|
|
542
|
-
/* @__PURE__ */ o(
|
|
543
|
-
/* @__PURE__ */ o(
|
|
544
|
-
/* @__PURE__ */ o(
|
|
545
|
-
/* @__PURE__ */ o(
|
|
546
|
-
/* @__PURE__ */ o(
|
|
547
|
-
/* @__PURE__ */ o(
|
|
548
|
-
/* @__PURE__ */ o(
|
|
549
|
-
/* @__PURE__ */ o(
|
|
551
|
+
/* @__PURE__ */ o(f.Item, { label: "字体位置", name: "textPosition", initialValue: "bottom", children: /* @__PURE__ */ o(p, { children: me.map((S) => /* @__PURE__ */ o(p.Option, { value: S.key, children: S.label }, S.key)) }) }),
|
|
552
|
+
/* @__PURE__ */ o(f.Item, { label: "字体偏移", name: "textOffset", initialValue: 5, children: /* @__PURE__ */ o(O, { type: "number", placeholder: "请输入字体偏移量" }) }),
|
|
553
|
+
/* @__PURE__ */ o(f.Item, { label: "字体颜色", name: "fontColor", initialValue: c.nodeLabelColor, children: /* @__PURE__ */ o(_, { showText: !0 }) }),
|
|
554
|
+
/* @__PURE__ */ o(f.Item, { label: "字体大小", name: "fontSize", initialValue: c.nodeLabelFontSize, children: /* @__PURE__ */ o(O, { type: "number", placeholder: "请输入字体大小" }) }),
|
|
555
|
+
/* @__PURE__ */ o(f.Item, { label: "字体粗细", name: "fontWeight", initialValue: "normal", children: /* @__PURE__ */ u(p, { children: [
|
|
556
|
+
/* @__PURE__ */ o(p.Option, { value: "normal", children: "常规" }),
|
|
557
|
+
/* @__PURE__ */ o(p.Option, { value: "bold", children: "粗体" }),
|
|
558
|
+
/* @__PURE__ */ o(p.Option, { value: "lighter", children: "细体" })
|
|
550
559
|
] }) }),
|
|
551
|
-
/* @__PURE__ */ o(
|
|
552
|
-
/* @__PURE__ */ o(
|
|
553
|
-
/* @__PURE__ */ o(
|
|
560
|
+
/* @__PURE__ */ o(f.Item, { label: "字体样式", name: "fontStyle", initialValue: "normal", children: /* @__PURE__ */ u(p, { children: [
|
|
561
|
+
/* @__PURE__ */ o(p.Option, { value: "normal", children: "默认" }),
|
|
562
|
+
/* @__PURE__ */ o(p.Option, { value: "italic", children: "斜体" })
|
|
554
563
|
] }) })
|
|
555
564
|
] }),
|
|
556
|
-
/* @__PURE__ */ o("div", { className: "setting-form-footer", children: /* @__PURE__ */ o(
|
|
565
|
+
/* @__PURE__ */ o("div", { className: "setting-form-footer", children: /* @__PURE__ */ o(f.Item, { children: /* @__PURE__ */ o(ge, { type: "primary", htmlType: "submit", block: !0, children: "保存节点配置" }) }) })
|
|
557
566
|
] });
|
|
558
|
-
},
|
|
559
|
-
const [
|
|
560
|
-
return /* @__PURE__ */ f
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */ o(
|
|
563
|
-
/* @__PURE__ */ o(
|
|
564
|
-
/* @__PURE__ */ o(
|
|
565
|
-
/* @__PURE__ */ o(
|
|
567
|
+
}, Vt = ({ onSave: b, colors: c }) => {
|
|
568
|
+
const [k] = f.useForm();
|
|
569
|
+
return /* @__PURE__ */ u(f, { form: k, layout: "vertical", onFinish: b, className: "setting-form", children: [
|
|
570
|
+
/* @__PURE__ */ u("div", { className: "setting-form-content", children: [
|
|
571
|
+
/* @__PURE__ */ o(f.Item, { label: "连线宽度", name: "edgeWidth", initialValue: 2, children: /* @__PURE__ */ o(O, { type: "number", placeholder: "请输入连线宽度" }) }),
|
|
572
|
+
/* @__PURE__ */ o(f.Item, { label: "连线箭头", name: "showArrow", initialValue: "show", children: /* @__PURE__ */ u(p, { children: [
|
|
573
|
+
/* @__PURE__ */ o(p.Option, { value: "show", children: "显示" }),
|
|
574
|
+
/* @__PURE__ */ o(p.Option, { value: "hide", children: "隐藏" })
|
|
566
575
|
] }) }),
|
|
567
|
-
/* @__PURE__ */ o(
|
|
568
|
-
/* @__PURE__ */ o(
|
|
569
|
-
/* @__PURE__ */ o(
|
|
570
|
-
/* @__PURE__ */ o(
|
|
576
|
+
/* @__PURE__ */ o(f.Item, { label: "连线颜色", name: "edgeColor", initialValue: c.edgeDefaultColor, children: /* @__PURE__ */ o(_, { showText: !0 }) }),
|
|
577
|
+
/* @__PURE__ */ o(f.Item, { label: "显示标签", name: "showLabel", initialValue: "show", children: /* @__PURE__ */ u(p, { children: [
|
|
578
|
+
/* @__PURE__ */ o(p.Option, { value: "show", children: "显示" }),
|
|
579
|
+
/* @__PURE__ */ o(p.Option, { value: "hide", children: "隐藏" })
|
|
571
580
|
] }) }),
|
|
572
|
-
/* @__PURE__ */ o(
|
|
573
|
-
/* @__PURE__ */ o(
|
|
574
|
-
/* @__PURE__ */ o(
|
|
575
|
-
/* @__PURE__ */ o(
|
|
576
|
-
/* @__PURE__ */ o(
|
|
581
|
+
/* @__PURE__ */ o(f.Item, { label: "字体大小", name: "fontSize", initialValue: c.edgeLabelFontSize, children: /* @__PURE__ */ o(O, { type: "number", placeholder: "请输入字体大小" }) }),
|
|
582
|
+
/* @__PURE__ */ o(f.Item, { label: "字体颜色", name: "fontColor", initialValue: c.edgeLabelColor, children: /* @__PURE__ */ o(_, { showText: !0 }) }),
|
|
583
|
+
/* @__PURE__ */ o(f.Item, { label: "字体粗细", name: "fontWeight", initialValue: "normal", children: /* @__PURE__ */ u(p, { children: [
|
|
584
|
+
/* @__PURE__ */ o(p.Option, { value: "normal", children: "常规" }),
|
|
585
|
+
/* @__PURE__ */ o(p.Option, { value: "bold", children: "粗体" })
|
|
577
586
|
] }) }),
|
|
578
|
-
/* @__PURE__ */ o(
|
|
579
|
-
/* @__PURE__ */ o(
|
|
580
|
-
/* @__PURE__ */ o(
|
|
587
|
+
/* @__PURE__ */ o(f.Item, { label: "字体样式", name: "fontStyle", initialValue: "normal", children: /* @__PURE__ */ u(p, { children: [
|
|
588
|
+
/* @__PURE__ */ o(p.Option, { value: "normal", children: "默认" }),
|
|
589
|
+
/* @__PURE__ */ o(p.Option, { value: "italic", children: "斜体" })
|
|
581
590
|
] }) }),
|
|
582
|
-
/* @__PURE__ */ o(
|
|
591
|
+
/* @__PURE__ */ o(f.Item, { label: "标签背景色", name: "labelBgColor", initialValue: "#ffffff", children: /* @__PURE__ */ o(_, { showText: !0 }) })
|
|
583
592
|
] }),
|
|
584
|
-
/* @__PURE__ */ o("div", { className: "setting-form-footer", children: /* @__PURE__ */ o(
|
|
593
|
+
/* @__PURE__ */ o("div", { className: "setting-form-footer", children: /* @__PURE__ */ o(f.Item, { children: /* @__PURE__ */ o(ge, { type: "primary", htmlType: "submit", block: !0, children: "保存连线配置" }) }) })
|
|
585
594
|
] });
|
|
586
595
|
};
|
|
587
596
|
export {
|
|
588
|
-
|
|
589
|
-
|
|
597
|
+
xt as actionList,
|
|
598
|
+
Qt as default
|
|
590
599
|
};
|