react-kggraph 0.0.28 → 0.0.30
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.es11.js +1 -1
- package/lib/index.es14.js +60 -48
- package/lib/index.es16.js +24 -22
- package/lib/index.es23.js +33 -30
- package/lib/index.es24.js +32 -29
- package/lib/index.es25.js +271 -2
- package/lib/index.es26.js +1 -1
- package/lib/index.es27.js +2 -2
- package/lib/index.es28.js +1 -1
- package/lib/index.es29.js +1 -1
- package/lib/index.es3.js +176 -182
- 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 +1 -1
- package/lib/index.es34.js +1 -1
- package/lib/index.es35.js +1 -1
- package/lib/index.es36.js +2 -2
- package/lib/index.es37.js +4 -0
- package/lib/index.es39.js +62 -1045
- package/lib/index.es4.js +7 -6
- package/lib/index.es40.js +21 -0
- package/lib/index.es41.js +43 -0
- package/lib/index.es42.js +42 -0
- package/lib/index.es43.js +88 -18
- package/lib/index.es44.js +54 -39
- package/lib/index.es45.js +30 -39
- package/lib/index.es47.js +66 -52
- package/lib/index.es7.js +176 -169
- package/lib/index.es8.js +108 -108
- package/lib/index.es9.js +9 -14
- package/lib/src/components/Graph/components/GraphListData/index.d.ts +3 -0
- package/lib/src/components/Graph/components/NodeInfoDrawer/index.d.ts +4 -1
- package/lib/src/components/Graph/utils/layouts.d.ts +1 -1
- package/lib/src/components/Graph/utils/tools.d.ts +3 -3
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/lib/index.es38.js +0 -66
- package/lib/index.es46.js +0 -91
- package/lib/index.es48.js +0 -33
- package/lib/index.es50.js +0 -72
package/lib/index.es11.js
CHANGED
package/lib/index.es14.js
CHANGED
|
@@ -1,63 +1,75 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Select as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as W, useState as k, useImperativeHandle as u } from "react";
|
|
3
|
+
import { Select as n, Form as r, Drawer as O, Input as d, Button as j, message as w } from "antd";
|
|
4
|
+
import { textPositionConfig as N } from "./index.es8.js";
|
|
5
|
+
const { Option: D } = n, q = W((B, F) => {
|
|
6
|
+
const { cyRef: c } = B, [S, s] = k(!1), [z, V] = k({ style: {}, data: {} }), [a] = r.useForm();
|
|
7
|
+
u(F, () => ({
|
|
8
|
+
open: (e) => {
|
|
9
|
+
var i, l, o, p, b, m, g, C, x, I;
|
|
10
|
+
s(!0), V(e), a.setFieldsValue({
|
|
11
|
+
name: (i = e.data) == null ? void 0 : i.name,
|
|
12
|
+
type: e.type || "圆形",
|
|
13
|
+
color: (l = e.style) == null ? void 0 : l.color,
|
|
14
|
+
size: parseInt((o = e.style) == null ? void 0 : o.height) || 30,
|
|
15
|
+
borderWidth: parseInt((p = e.style) == null ? void 0 : p.borderWidth) || 2,
|
|
16
|
+
borderDash: ((b = e.style) == null ? void 0 : b.borderDash) === [5, 5] ? "是" : "否",
|
|
17
|
+
borderColor: (m = e.style) == null ? void 0 : m.borderColor,
|
|
18
|
+
textValign: ((g = e.style) == null ? void 0 : g.textValign) || "center",
|
|
19
|
+
fontStyle: ((C = e.style) == null ? void 0 : C.fontStyle) || "normal",
|
|
20
|
+
fontColor: ((x = e.style) == null ? void 0 : x.color) || "#000000",
|
|
21
|
+
textBackgroundColor: ((I = e.style) == null ? void 0 : I.textBackgroundColor) || "transparent"
|
|
21
22
|
});
|
|
22
23
|
},
|
|
23
24
|
close: () => s(!1)
|
|
24
|
-
}))
|
|
25
|
-
|
|
25
|
+
}));
|
|
26
|
+
const f = () => {
|
|
27
|
+
s(!1), a.resetFields();
|
|
28
|
+
}, y = (e) => {
|
|
29
|
+
const i = c == null ? void 0 : c.current;
|
|
30
|
+
if (!i) return;
|
|
31
|
+
const l = i.getElementById(z.id);
|
|
32
|
+
if (!l.length) {
|
|
33
|
+
w.error("未找到目标节点");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const o = {};
|
|
37
|
+
e.size !== void 0 && e.size !== "" && (o.width = e.size, o.height = e.size), e.borderWidth !== void 0 && e.borderWidth !== "" && (o["border-width"] = e.borderWidth), e.borderColor && (o["border-color"] = e.borderColor), e.borderDash !== void 0 && (o["border-dash"] = e.borderDash === "是" ? [5, 5] : [0, 0]), e.textValign && (o["text-valign"] = e.textValign), e.fontStyle && (o["font-style"] = e.fontStyle), e.fontColor && (o.color = e.fontColor), e.textBackgroundColor && (o["text-background-color"] = e.textBackgroundColor), e.type && (e.type === "圆形" ? o.shape = "ellipse" : e.type === "矩形" && (o.shape = "rectangle")), l.style(o), e.name !== void 0 && l.data("name", e.name), w.success("节点样式已更新"), f();
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ t(
|
|
40
|
+
O,
|
|
26
41
|
{
|
|
27
|
-
title: "
|
|
42
|
+
title: "节点样式",
|
|
28
43
|
closable: { "aria-label": "Close Button" },
|
|
29
|
-
onClose:
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
open: v,
|
|
44
|
+
onClose: f,
|
|
45
|
+
open: S,
|
|
33
46
|
getContainer: !1,
|
|
34
47
|
width: 360,
|
|
35
|
-
|
|
48
|
+
mask: !1,
|
|
49
|
+
footer: /* @__PURE__ */ t(j, { type: "primary", block: !0, onClick: () => {
|
|
50
|
+
a.validateFields().then((e) => y(e));
|
|
51
|
+
}, children: "保存节点配置" }),
|
|
52
|
+
children: /* @__PURE__ */ h(
|
|
36
53
|
r,
|
|
37
54
|
{
|
|
38
|
-
form:
|
|
55
|
+
form: a,
|
|
39
56
|
layout: "vertical",
|
|
40
|
-
|
|
57
|
+
onFinish: y,
|
|
41
58
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
] }) }),
|
|
47
|
-
/* @__PURE__ */ e(r.Item, { label: "大小", name: "size", children: /* @__PURE__ */ e(o, { type: "number" }) }),
|
|
48
|
-
/* @__PURE__ */ e(r.Item, { label: "边框宽度", name: "borderWidth", children: /* @__PURE__ */ e(o, { type: "number" }) }),
|
|
49
|
-
/* @__PURE__ */ e(r.Item, { label: "边框虚线", name: "borderDash", children: /* @__PURE__ */ n(a, { children: [
|
|
50
|
-
/* @__PURE__ */ e(t, { value: "否", children: "否" }),
|
|
51
|
-
/* @__PURE__ */ e(t, { value: "是", children: "是" })
|
|
59
|
+
/* @__PURE__ */ t(r.Item, { label: "名称", name: "name", children: /* @__PURE__ */ t(d, {}) }),
|
|
60
|
+
/* @__PURE__ */ t(r.Item, { label: "类型", name: "type", children: /* @__PURE__ */ h(n, { children: [
|
|
61
|
+
/* @__PURE__ */ t(D, { value: "圆形", children: "圆形" }),
|
|
62
|
+
/* @__PURE__ */ t(D, { value: "矩形", children: "矩形" })
|
|
52
63
|
] }) }),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
/* @__PURE__ */ t(r.Item, { label: "大小", name: "size", children: /* @__PURE__ */ t(d, { type: "number" }) }),
|
|
65
|
+
/* @__PURE__ */ t(r.Item, { label: "边框宽度", name: "borderWidth", children: /* @__PURE__ */ t(d, { type: "number" }) }),
|
|
66
|
+
/* @__PURE__ */ t(r.Item, { label: "边框颜色", name: "borderColor", children: /* @__PURE__ */ t(d, { type: "color", style: { width: "100%", height: 32 } }) }),
|
|
67
|
+
/* @__PURE__ */ t(r.Item, { label: "字体位置", name: "textValign", children: /* @__PURE__ */ t(n, { children: N.map((e) => /* @__PURE__ */ t(n.Option, { value: e.key, children: e.label }, e.key)) }) }),
|
|
68
|
+
/* @__PURE__ */ t(r.Item, { label: "字体样式", name: "fontStyle", children: /* @__PURE__ */ h(n, { children: [
|
|
69
|
+
/* @__PURE__ */ t(n.Option, { value: "normal", children: "默认" }),
|
|
70
|
+
/* @__PURE__ */ t(n.Option, { value: "italic", children: "斜体" })
|
|
58
71
|
] }) }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */ e(r.Item, { label: "字体颜色", name: "fontColor", children: /* @__PURE__ */ e(o, { type: "color", style: { width: "100%", height: 32 } }) })
|
|
72
|
+
/* @__PURE__ */ t(r.Item, { label: "字体颜色", name: "fontColor", children: /* @__PURE__ */ t(d, { type: "color", style: { width: "100%", height: 32 } }) })
|
|
61
73
|
]
|
|
62
74
|
}
|
|
63
75
|
)
|
|
@@ -65,5 +77,5 @@ const { Option: t } = a, z = D((S, g) => {
|
|
|
65
77
|
);
|
|
66
78
|
});
|
|
67
79
|
export {
|
|
68
|
-
|
|
80
|
+
q as default
|
|
69
81
|
};
|
package/lib/index.es16.js
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Drawer as
|
|
4
|
-
import { GraphContext as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
o(!0), p(n), m();
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as w, useContext as C, useState as t, useRef as h, useEffect as I, useImperativeHandle as k } from "react";
|
|
3
|
+
import { Drawer as x } from "antd";
|
|
4
|
+
import { GraphContext as y } from "./index.es15.js";
|
|
5
|
+
import D from "./index.es39.js";
|
|
6
|
+
const G = w((v, d) => {
|
|
7
|
+
const { graphInfo: n, knowledgeCardApi: f } = C(y), [o, a] = t(!1), [c, l] = t(!1), [i, p] = t(!1), [R, u] = t({ style: {}, data: {} }), r = h(null);
|
|
8
|
+
I(() => {
|
|
9
|
+
o && r.current && (r.current.scrollTop = 0);
|
|
10
|
+
}, [o]), k(d, () => ({
|
|
11
|
+
open: (e) => {
|
|
12
|
+
a(!0), u(e), m(e);
|
|
14
13
|
},
|
|
15
|
-
close: () =>
|
|
14
|
+
close: () => a(!1)
|
|
16
15
|
}));
|
|
17
|
-
const m = async (
|
|
18
|
-
|
|
16
|
+
const m = async (e) => {
|
|
17
|
+
l(!0);
|
|
18
|
+
const g = await f({ kgId: n.kgId, uri: e.id });
|
|
19
|
+
p(g.data), l(!1);
|
|
19
20
|
};
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
21
|
+
return /* @__PURE__ */ s(
|
|
22
|
+
x,
|
|
22
23
|
{
|
|
23
24
|
title: "知识卡片",
|
|
24
25
|
onClose: () => {
|
|
25
|
-
|
|
26
|
+
a(!1);
|
|
26
27
|
},
|
|
27
|
-
open:
|
|
28
|
+
open: o,
|
|
29
|
+
mask: !1,
|
|
28
30
|
getContainer: !1,
|
|
29
31
|
className: "knowledge-card-drawer",
|
|
30
32
|
styles: { body: { padding: "0 20px", overflow: "auto" } },
|
|
31
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ s("div", { ref: r, style: { height: "100%" }, children: /* @__PURE__ */ s(D, { detailData: i, drawerInfo: n, loading: c }) })
|
|
32
34
|
}
|
|
33
35
|
);
|
|
34
36
|
});
|
|
35
37
|
export {
|
|
36
|
-
|
|
38
|
+
G as default
|
|
37
39
|
};
|
package/lib/index.es23.js
CHANGED
|
@@ -1,62 +1,65 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, Fragment as N, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as g } from "react";
|
|
3
|
-
import { Select as v, Space as b, Button as
|
|
3
|
+
import { Select as v, Space as b, Button as h } from "antd";
|
|
4
4
|
import { CloseOutlined as w } from "@ant-design/icons";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { GraphContext as k } from "./index.es15.js";
|
|
7
|
-
const
|
|
8
|
-
const { pathNodes:
|
|
9
|
-
|
|
7
|
+
const P = ({ searchChange: x, isVisible: p, closePath: i, analysis: d }) => {
|
|
8
|
+
const { pathNodes: o, setPathNodes: r, graphData: m } = g(k), f = () => {
|
|
9
|
+
i && i(!1);
|
|
10
10
|
}, u = () => {
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
d && d(o);
|
|
12
|
+
}, l = [];
|
|
13
|
+
return m.forEach((a) => {
|
|
14
|
+
const t = l.findIndex((e) => e.name === a.data.name);
|
|
15
|
+
a.group === "nodes" && t === -1 && l.push(a.data);
|
|
16
|
+
}), /* @__PURE__ */ n(N, { children: p && /* @__PURE__ */ s("div", { className: "path-node", children: [
|
|
17
|
+
/* @__PURE__ */ s("div", { className: "title", children: [
|
|
18
|
+
/* @__PURE__ */ n("span", { children: "路径分析" }),
|
|
19
|
+
/* @__PURE__ */ n(w, { onClick: () => f() })
|
|
17
20
|
] }),
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */
|
|
21
|
+
o.map((a, t) => /* @__PURE__ */ s("div", { className: "node-input-row", children: [
|
|
22
|
+
/* @__PURE__ */ s("span", { children: [
|
|
20
23
|
"节点 ",
|
|
21
|
-
|
|
24
|
+
t + 1,
|
|
22
25
|
":"
|
|
23
26
|
] }),
|
|
24
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ n(
|
|
25
28
|
v,
|
|
26
29
|
{
|
|
27
30
|
showSearch: !0,
|
|
28
31
|
style: { width: "60%" },
|
|
29
|
-
options:
|
|
30
|
-
value:
|
|
31
|
-
label:
|
|
32
|
+
options: l.map((e) => ({
|
|
33
|
+
value: e.name,
|
|
34
|
+
label: e.name
|
|
32
35
|
})),
|
|
33
36
|
placeholder: "请选择节点",
|
|
34
37
|
className: "select-node",
|
|
35
|
-
value:
|
|
36
|
-
onChange: (
|
|
37
|
-
const
|
|
38
|
-
|
|
38
|
+
value: a,
|
|
39
|
+
onChange: (e) => {
|
|
40
|
+
const c = [...o];
|
|
41
|
+
c[t] = e, r(c);
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
),
|
|
42
|
-
|
|
45
|
+
o.length > 2 && /* @__PURE__ */ n(
|
|
43
46
|
"button",
|
|
44
47
|
{
|
|
45
48
|
className: "btn remove-node-btn",
|
|
46
49
|
onClick: () => {
|
|
47
|
-
const
|
|
48
|
-
r(
|
|
50
|
+
const e = o.filter((c, C) => C !== t);
|
|
51
|
+
r(e);
|
|
49
52
|
},
|
|
50
53
|
children: "删除"
|
|
51
54
|
}
|
|
52
55
|
)
|
|
53
|
-
] },
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
] }, t)),
|
|
57
|
+
/* @__PURE__ */ n("div", { className: "btn-group", children: /* @__PURE__ */ s(b, { children: [
|
|
58
|
+
/* @__PURE__ */ n(h, { onClick: () => r([...o, ""]), children: "添加节点" }),
|
|
59
|
+
/* @__PURE__ */ n(h, { type: "primary", onClick: () => u(), children: "计算路径" })
|
|
57
60
|
] }) })
|
|
58
61
|
] }) });
|
|
59
62
|
};
|
|
60
63
|
export {
|
|
61
|
-
|
|
64
|
+
P as default
|
|
62
65
|
};
|
package/lib/index.es24.js
CHANGED
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
import { jsx as l, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Form as
|
|
1
|
+
import { jsx as l, Fragment as x, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y, useState as r, useContext as C, useImperativeHandle as b } from "react";
|
|
3
|
+
import { Form as v, Select as w, Input as F, Button as I } from "antd";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
import { CloseOutlined as
|
|
7
|
-
import { GraphContext as
|
|
8
|
-
const
|
|
9
|
-
const [
|
|
10
|
-
|
|
5
|
+
import o from "antd/es/form/FormItem";
|
|
6
|
+
import { CloseOutlined as g } from "@ant-design/icons";
|
|
7
|
+
import { GraphContext as D } from "./index.es15.js";
|
|
8
|
+
const B = y(({ onLevelClick: s }, i) => {
|
|
9
|
+
const [p, n] = r(!1), { graphData: m } = C(D), [d, N] = r({ level: 1 });
|
|
10
|
+
b(i, () => ({
|
|
11
11
|
open: (e) => {
|
|
12
|
-
|
|
12
|
+
n(!0);
|
|
13
13
|
},
|
|
14
|
-
close: () =>
|
|
14
|
+
close: () => n(!1)
|
|
15
15
|
}));
|
|
16
16
|
const c = () => {
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
return
|
|
22
|
-
|
|
17
|
+
n(!1);
|
|
18
|
+
}, h = (e) => {
|
|
19
|
+
s(e.name, e.level);
|
|
20
|
+
}, t = [];
|
|
21
|
+
return m.forEach((e) => {
|
|
22
|
+
const u = t.findIndex((f) => f.name === e.data.name);
|
|
23
|
+
e.group === "nodes" && u === -1 && t.push(e.data);
|
|
24
|
+
}), /* @__PURE__ */ l(x, { children: p && /* @__PURE__ */ a("div", { className: "query-node z-10", children: [
|
|
25
|
+
/* @__PURE__ */ a("div", { className: "title", children: [
|
|
23
26
|
/* @__PURE__ */ l("span", { children: "分析N层关系" }),
|
|
24
|
-
/* @__PURE__ */ l(
|
|
27
|
+
/* @__PURE__ */ l(g, { onClick: () => c() })
|
|
25
28
|
] }),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
29
|
+
/* @__PURE__ */ a(
|
|
30
|
+
v,
|
|
28
31
|
{
|
|
29
|
-
onFinish:
|
|
30
|
-
initialValues:
|
|
32
|
+
onFinish: h,
|
|
33
|
+
initialValues: d,
|
|
31
34
|
children: [
|
|
32
35
|
/* @__PURE__ */ l(
|
|
33
|
-
|
|
36
|
+
o,
|
|
34
37
|
{
|
|
35
38
|
label: "节点名称",
|
|
36
39
|
labelCol: { span: 6 },
|
|
37
40
|
name: "name",
|
|
38
41
|
wrapperCol: { span: 14 },
|
|
39
42
|
children: /* @__PURE__ */ l(
|
|
40
|
-
|
|
43
|
+
w,
|
|
41
44
|
{
|
|
42
45
|
showSearch: !0,
|
|
43
46
|
style: { width: "200px" },
|
|
44
|
-
options:
|
|
47
|
+
options: t.map((e) => ({
|
|
45
48
|
value: e.name,
|
|
46
49
|
label: e.name
|
|
47
50
|
}))
|
|
@@ -50,22 +53,22 @@ const q = f(({ onLevelClick: r }, s) => {
|
|
|
50
53
|
}
|
|
51
54
|
),
|
|
52
55
|
/* @__PURE__ */ l(
|
|
53
|
-
|
|
56
|
+
o,
|
|
54
57
|
{
|
|
55
58
|
id: "level",
|
|
56
59
|
label: "层级",
|
|
57
60
|
labelCol: { span: 6 },
|
|
58
61
|
name: "level",
|
|
59
62
|
wrapperCol: { span: 14 },
|
|
60
|
-
children: /* @__PURE__ */ l(
|
|
63
|
+
children: /* @__PURE__ */ l(F, { placeholder: "请输入", style: { width: 200 }, type: "number", min: 1 })
|
|
61
64
|
}
|
|
62
65
|
),
|
|
63
|
-
/* @__PURE__ */ l(
|
|
66
|
+
/* @__PURE__ */ l(o, { label: null, style: { textAlign: "center" }, children: /* @__PURE__ */ l(I, { type: "primary", htmlType: "submit", children: "查询" }) })
|
|
64
67
|
]
|
|
65
68
|
}
|
|
66
69
|
)
|
|
67
70
|
] }) });
|
|
68
71
|
});
|
|
69
72
|
export {
|
|
70
|
-
|
|
73
|
+
B as default
|
|
71
74
|
};
|