react-kggraph 0.0.17 → 0.0.18
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/README.md +46 -0
- package/lib/index.es.js +8 -6
- package/lib/index.es10.js +186 -69
- package/lib/index.es11.js +71 -28
- package/lib/index.es12.js +29 -69
- package/lib/index.es13.js +70 -224
- package/lib/index.es14.js +224 -4
- package/lib/index.es15.js +4 -35
- package/lib/index.es16.js +37 -0
- package/lib/index.es18.js +15462 -49
- package/lib/index.es19.js +50 -56
- package/lib/index.es20.js +57 -66
- package/lib/index.es21.js +68 -39
- package/lib/index.es22.js +40 -2
- package/lib/index.es23.js +1 -1
- package/lib/index.es24.js +2 -2
- package/lib/index.es25.js +1 -1
- package/lib/index.es26.js +1 -1
- 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 +173 -155
- package/lib/index.es30.js +1 -1
- package/lib/index.es31.js +1 -1
- package/lib/index.es32.js +2 -2
- package/lib/index.es33.js +4 -0
- package/lib/index.es35.js +4 -2
- package/lib/index.es36.js +4 -0
- package/lib/index.es4.js +17 -6
- package/lib/index.es5.js +6 -2
- package/lib/index.es6.js +2 -599
- package/lib/index.es7.js +580 -312
- package/lib/index.es8.js +294 -393
- package/lib/index.es9.js +408 -173
- package/lib/src/components/Graph/components/ActionBar/actionList.d.ts +10 -0
- package/lib/src/components/Graph/components/ActionBar/index.d.ts +15 -0
- package/lib/src/components/Graph/types.d.ts +51 -0
- package/lib/src/components/Graph/utils/edge_node_styles.d.ts +5 -2
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/lib/index.es17.js +0 -15469
- package/lib/index.es34.js +0 -6
package/lib/index.es8.js
CHANGED
|
@@ -1,423 +1,324 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
import { message as C } from "antd";
|
|
2
|
+
import j from "./index.es23.js";
|
|
3
|
+
import I from "./index.es24.js";
|
|
4
|
+
import P from "./index.es25.js";
|
|
5
|
+
import $ from "./index.es26.js";
|
|
6
|
+
import D from "./index.es27.js";
|
|
7
|
+
import J from "./index.es28.js";
|
|
8
|
+
import N from "./index.es29.js";
|
|
9
|
+
import R from "./index.es30.js";
|
|
10
|
+
import q from "./index.es31.js";
|
|
11
|
+
import A from "./index.es32.js";
|
|
12
|
+
import B from "./index.es33.js";
|
|
13
|
+
import { jsonStringifyParse as U } from "./index.es12.js";
|
|
14
|
+
const L = [j, I, P, $, D, J, N, R, q, A], G = (c) => {
|
|
15
|
+
let o = {};
|
|
16
|
+
const s = {}, e = [];
|
|
17
|
+
return c.forEach((n) => {
|
|
18
|
+
var a;
|
|
19
|
+
const { group: d } = n;
|
|
20
|
+
if (d === "nodes") {
|
|
21
|
+
const r = n.data, l = (a = r.properties) == null ? void 0 : a.type, i = r.type;
|
|
22
|
+
!i && l === "uri" || (!e.includes(i) && l === "uri" ? (e.push(i), o = { ...o, [i]: { ...o[i], count: 1, img: r.image } }) : l === "uri" && i && (o = { ...o, [i]: { ...o[i], img: r.image, count: o[i].count + 1 } }));
|
|
23
|
+
} else if (d === "edges") {
|
|
24
|
+
const r = n.data, { label: l } = r;
|
|
25
|
+
s[l] ? s[l] = s[l] + 1 : s[l] = 1;
|
|
26
|
+
} else
|
|
27
|
+
console.log("nonono");
|
|
28
|
+
}), {
|
|
29
|
+
typeListArr: e,
|
|
30
|
+
typeListObj: o,
|
|
31
|
+
relationListObj: s
|
|
32
|
+
};
|
|
33
|
+
}, te = (c, { graphData: o = [], typeObj: s, zktype: e, graphInfo: n = {} }) => {
|
|
34
|
+
let d = U(s);
|
|
35
|
+
const a = Object.keys(s), r = n.searchNodes || [], l = new Set(
|
|
36
|
+
(o == null ? void 0 : o.map((g) => {
|
|
37
|
+
var t, m, h;
|
|
38
|
+
return g.group === "nodes" ? (t = g.data) == null ? void 0 : t.id : ((m = g.data) == null ? void 0 : m.source) + "-" + ((h = g.data) == null ? void 0 : h.target);
|
|
39
|
+
}).filter(Boolean)) || []
|
|
40
|
+
), { nodes: i = [], links: p = [] } = c || {}, y = [], k = (g) => {
|
|
41
|
+
g.forEach((t) => {
|
|
42
|
+
var m, h;
|
|
43
|
+
if (!l.has(t.id)) {
|
|
44
|
+
const v = (m = t.properties) == null ? void 0 : m.type, f = t.type, E = t.label.split("#").pop();
|
|
45
|
+
let w = -1;
|
|
46
|
+
if (!f && v === "uri")
|
|
47
|
+
w = t.image || L[0];
|
|
48
|
+
else if (!a.includes(f) && v === "uri") {
|
|
49
|
+
a.push(f);
|
|
50
|
+
const O = a.indexOf(f);
|
|
51
|
+
w = t.image || L[O] || L[0], d = { ...d, [f]: { ...d[f], img: w } };
|
|
52
|
+
} else v === "uri" && f && (w = (h = d[f]) == null ? void 0 : h.img);
|
|
53
|
+
const S = {
|
|
54
|
+
...t,
|
|
55
|
+
name: E,
|
|
56
|
+
"properties-type": v,
|
|
57
|
+
image: r.includes(E) ? B : w,
|
|
58
|
+
baseWidth: 80,
|
|
59
|
+
// 保存基础宽度
|
|
60
|
+
baseHeight: 80
|
|
61
|
+
// 保存基础高度
|
|
62
|
+
};
|
|
63
|
+
y.push({ group: "nodes", data: S });
|
|
64
|
+
}
|
|
37
65
|
});
|
|
38
|
-
|
|
39
|
-
|
|
66
|
+
};
|
|
67
|
+
((g) => {
|
|
68
|
+
g.forEach((t) => {
|
|
69
|
+
const { label: m } = t, h = `${t.source}-${t.target}`;
|
|
70
|
+
l.has(h) || y.push({ group: "edges", data: { ...t, name: m, zktype: e } });
|
|
40
71
|
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
//fit、none
|
|
62
|
-
animationDuration: 1e3,
|
|
63
|
-
// 辅助优化
|
|
64
|
-
nodeDimensionsIncludeLabels: !0,
|
|
65
|
-
// 让节点自动适应标签长度
|
|
66
|
-
tile: !0,
|
|
67
|
-
tilingPaddingVertical: 15,
|
|
68
|
-
tilingPaddingHorizontal: 15,
|
|
69
|
-
gravity: 0.6,
|
|
70
|
-
// 稍强的向心力,避免过于分散
|
|
71
|
-
// 其他保持默认
|
|
72
|
-
nestingFactor: 0.1,
|
|
73
|
-
gravityRange: 3,
|
|
74
|
-
gravityRangeCompound: 1.5,
|
|
75
|
-
gravityCompound: 1,
|
|
76
|
-
initialEnergyOnIncremental: 0.5,
|
|
77
|
-
refresh: 30
|
|
78
|
-
}), w = (e, n) => {
|
|
79
|
-
console.log(111, n);
|
|
80
|
-
const r = e.current;
|
|
81
|
-
if (!r) return;
|
|
82
|
-
let o = {};
|
|
83
|
-
switch (n) {
|
|
84
|
-
case "circle":
|
|
85
|
-
o = E();
|
|
86
|
-
break;
|
|
87
|
-
case "concentric":
|
|
88
|
-
console.log("执行圆形布局"), o = L();
|
|
89
|
-
break;
|
|
90
|
-
case "grid":
|
|
91
|
-
console.log("执行网格布局"), o = D();
|
|
92
|
-
break;
|
|
93
|
-
case "breadthfirst":
|
|
94
|
-
console.log("执行树型布局"), o = F();
|
|
95
|
-
break;
|
|
96
|
-
case "random":
|
|
97
|
-
console.log("执行随机布局"), o = y();
|
|
72
|
+
})(p), k(i);
|
|
73
|
+
const { typeListObj: u, relationListObj: x } = G([...y, ...o]);
|
|
74
|
+
return {
|
|
75
|
+
elements: y,
|
|
76
|
+
typeListObj: u,
|
|
77
|
+
relationListObj: x
|
|
78
|
+
};
|
|
79
|
+
}, oe = (c, o) => {
|
|
80
|
+
const s = c.current;
|
|
81
|
+
if (!s) return;
|
|
82
|
+
let e = {
|
|
83
|
+
color: "#000"
|
|
84
|
+
};
|
|
85
|
+
switch (o) {
|
|
86
|
+
case "center":
|
|
87
|
+
e = {
|
|
88
|
+
"text-halign": "center",
|
|
89
|
+
"text-valign": "center"
|
|
90
|
+
// 'color': '#fff',
|
|
91
|
+
};
|
|
98
92
|
break;
|
|
99
|
-
case "
|
|
100
|
-
|
|
93
|
+
case "left":
|
|
94
|
+
e = {
|
|
95
|
+
...e,
|
|
96
|
+
"text-halign": "left",
|
|
97
|
+
"text-valign": "center",
|
|
98
|
+
"text-margin-x": "-5px"
|
|
99
|
+
};
|
|
101
100
|
break;
|
|
102
|
-
case "
|
|
103
|
-
|
|
101
|
+
case "right":
|
|
102
|
+
e = {
|
|
103
|
+
...e,
|
|
104
|
+
"text-halign": "right",
|
|
105
|
+
"text-valign": "center",
|
|
106
|
+
"text-margin-x": "5px"
|
|
107
|
+
};
|
|
104
108
|
break;
|
|
105
|
-
case "
|
|
106
|
-
|
|
109
|
+
case "top":
|
|
110
|
+
e = {
|
|
111
|
+
...e,
|
|
112
|
+
"text-halign": "center",
|
|
113
|
+
"text-valign": "top",
|
|
114
|
+
"text-margin-y": "-5px"
|
|
115
|
+
};
|
|
107
116
|
break;
|
|
108
|
-
case "
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
animate: !1,
|
|
115
|
-
// 布局完成后适应画布
|
|
116
|
-
fit: !0,
|
|
117
|
-
// 内边距
|
|
118
|
-
padding: 30,
|
|
119
|
-
// 节点间距
|
|
120
|
-
nodeSeparation: 80,
|
|
121
|
-
// 理想边长
|
|
122
|
-
idealEdgeLength: 80,
|
|
123
|
-
// 聚类间边长度系数
|
|
124
|
-
idealInterClusterEdgeLengthCoefficient: 1.5,
|
|
125
|
-
// 最大迭代次数
|
|
126
|
-
maxIteration: 500
|
|
117
|
+
case "bottom":
|
|
118
|
+
e = {
|
|
119
|
+
...e,
|
|
120
|
+
"text-halign": "center",
|
|
121
|
+
"text-valign": "bottom",
|
|
122
|
+
"text-margin-y": "5px"
|
|
127
123
|
};
|
|
128
124
|
break;
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
}
|
|
126
|
+
s.nodes().style(e), s.style().update();
|
|
127
|
+
}, ne = async (c, { pathNodes: o, isGrayed: s = !0 }) => {
|
|
128
|
+
const e = c.current;
|
|
129
|
+
if (!e)
|
|
130
|
+
return;
|
|
131
|
+
if ((o == null ? void 0 : o.length) < 2) {
|
|
132
|
+
C.warning("请至少设置 2 个路径节点!");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if ([...new Set(o)].length !== o.length) {
|
|
136
|
+
C.warning("路径中存在重复节点,请检查!");
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const d = [];
|
|
140
|
+
for (const a of o) {
|
|
141
|
+
const r = e.nodes().filter((l) => l.data("name") === a);
|
|
142
|
+
if (r.length > 0)
|
|
143
|
+
d.push(r.id());
|
|
144
|
+
else {
|
|
145
|
+
e.nodes().removeClass("path-node"), e.edges().removeClass("path-edge"), C.warning(`找不到节点:${a}`);
|
|
131
146
|
return;
|
|
147
|
+
}
|
|
132
148
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
149
|
+
try {
|
|
150
|
+
e.nodes().removeClass("path-node").removeClass("grayed"), e.edges().removeClass("path-edge").removeClass("grayed");
|
|
151
|
+
let a = e.collection(), r = 0, l = !0;
|
|
152
|
+
const i = [];
|
|
153
|
+
for (let p = 0; p < d.length - 1; p++) {
|
|
154
|
+
const y = d[p], k = d[p + 1], b = e.getElementById(y), u = e.getElementById(k), x = b.edgesWith(u).filter(function(t) {
|
|
155
|
+
return t.data("source") === y && t.data("target") === k;
|
|
156
|
+
}), g = u.edgesWith(b).filter(function(t) {
|
|
157
|
+
return t.data("source") === k && t.data("target") === y;
|
|
158
|
+
});
|
|
159
|
+
if (x.length > 0 || g.length > 0) {
|
|
160
|
+
const t = x.add(g);
|
|
161
|
+
a = a.union(t).union(b).union(u), r += t.length, b.addClass("path-node"), u.addClass("path-node"), t.addClass("path-edge"), i.push(b.data("name"), u.data("name")), console.log(`找到直接连接的边:正向${x.length}条,反向${g.length}条`);
|
|
162
|
+
} else {
|
|
163
|
+
const t = e.elements().aStar({
|
|
164
|
+
root: b,
|
|
165
|
+
goal: u,
|
|
166
|
+
directed: !1
|
|
167
|
+
});
|
|
168
|
+
if (t.found && t.path) {
|
|
169
|
+
a = a.union(t.path), r += t.distance, t.path.nodes().addClass("path-node"), t.path.edges().addClass("path-edge");
|
|
170
|
+
const m = t.path.nodes().map((h) => h.data("name"));
|
|
171
|
+
i.push(...m);
|
|
172
|
+
} else {
|
|
173
|
+
l = !1, console.log(`节点 ${o[p]} 和 ${o[p + 1]} 之间没有路径`);
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (l && a.length > 0) {
|
|
179
|
+
const p = a.nodes(), y = a.edges();
|
|
180
|
+
p.addClass("path-node"), y.addClass("path-edge"), s && (e.nodes().not(p).addClass("grayed"), e.edges().not(y).addClass("grayed"));
|
|
181
|
+
} else
|
|
182
|
+
C.warning("无法找到完整的路径!");
|
|
183
|
+
} catch (a) {
|
|
184
|
+
console.error(2e3, "计算路径时出错:", a), C.warning("计算路径时出错,请重试!");
|
|
158
185
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
186
|
+
}, T = (c) => {
|
|
187
|
+
const o = c.nodes().map((n) => ({
|
|
188
|
+
data: n.data(),
|
|
189
|
+
position: n.position(),
|
|
190
|
+
style: {
|
|
191
|
+
width: n.style("width"),
|
|
192
|
+
height: n.style("height"),
|
|
193
|
+
backgroundColor: n.style("background-color")
|
|
194
|
+
}
|
|
195
|
+
})), s = c.edges().map((n) => ({
|
|
196
|
+
data: n.data(),
|
|
197
|
+
style: {
|
|
198
|
+
width: n.style("width"),
|
|
199
|
+
"line-color": n.style("line-color"),
|
|
200
|
+
"target-arrow-color": n.style("target-arrow-color")
|
|
201
|
+
}
|
|
202
|
+
}));
|
|
203
|
+
return { nodes: o, edges: s };
|
|
204
|
+
}, ae = (c) => {
|
|
205
|
+
const o = T(c), s = new Blob([JSON.stringify(o, null, 2)], { type: "application/json" }), e = URL.createObjectURL(s), n = document.createElement("a");
|
|
206
|
+
n.href = e, n.download = `graph-data-${Date.now()}.json`, n.click(), URL.revokeObjectURL(e);
|
|
207
|
+
}, se = [
|
|
208
|
+
{
|
|
209
|
+
label: "网络布局",
|
|
210
|
+
key: "cose-bilkent"
|
|
163
211
|
},
|
|
164
|
-
|
|
212
|
+
{
|
|
213
|
+
label: "弹性布局",
|
|
214
|
+
key: "fcose"
|
|
165
215
|
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
animateFilter: function(e, n) {
|
|
170
|
-
return !0;
|
|
216
|
+
{
|
|
217
|
+
label: "网格布局",
|
|
218
|
+
key: "grid"
|
|
171
219
|
},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
padding: 30,
|
|
176
|
-
boundingBox: void 0,
|
|
177
|
-
nodeDimensionsIncludeLabels: !1,
|
|
178
|
-
randomize: !1,
|
|
179
|
-
componentSpacing: 40,
|
|
180
|
-
nodeRepulsion: function(e) {
|
|
181
|
-
return 2048;
|
|
220
|
+
{
|
|
221
|
+
label: "球面布局",
|
|
222
|
+
key: "circle"
|
|
182
223
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
224
|
+
{
|
|
225
|
+
label: "层级布局",
|
|
226
|
+
key: "breadthfirst"
|
|
186
227
|
},
|
|
187
|
-
|
|
188
|
-
|
|
228
|
+
{
|
|
229
|
+
label: "同心圆布局",
|
|
230
|
+
key: "concentric"
|
|
231
|
+
}
|
|
232
|
+
], le = [
|
|
233
|
+
{
|
|
234
|
+
label: "查询节点",
|
|
235
|
+
key: "query",
|
|
236
|
+
func: "queryNode"
|
|
189
237
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
coolingFactor: 0.99,
|
|
195
|
-
minTemp: 1
|
|
196
|
-
}), E = () => ({
|
|
197
|
-
name: "circle",
|
|
198
|
-
fit: !0,
|
|
199
|
-
// whether to fit the viewport to the graph
|
|
200
|
-
padding: 30,
|
|
201
|
-
// the padding on fit
|
|
202
|
-
boundingBox: void 0,
|
|
203
|
-
// constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
|
|
204
|
-
avoidOverlap: !0,
|
|
205
|
-
// prevents node overlap, may overflow boundingBox and radius if not enough space
|
|
206
|
-
nodeDimensionsIncludeLabels: !1,
|
|
207
|
-
// Excludes the label when calculating node bounding boxes for the layout algorithm
|
|
208
|
-
spacingFactor: 1.2,
|
|
209
|
-
// 节点间距系数,值越大连线越长
|
|
210
|
-
radius: void 0,
|
|
211
|
-
// the radius of the circle
|
|
212
|
-
startAngle: 1.5 * Math.PI,
|
|
213
|
-
// where nodes start in radians
|
|
214
|
-
sweep: void 0,
|
|
215
|
-
// how many radians should be between the first and last node (defaults to full circle)
|
|
216
|
-
clockwise: !0,
|
|
217
|
-
// whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)
|
|
218
|
-
sort: void 0,
|
|
219
|
-
// a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }
|
|
220
|
-
animate: !0,
|
|
221
|
-
// whether to transition the node positions
|
|
222
|
-
animationDuration: 500,
|
|
223
|
-
// duration of animation in ms if enabled
|
|
224
|
-
animationEasing: void 0,
|
|
225
|
-
// easing of animation if enabled
|
|
226
|
-
animateFilter: function(e, n) {
|
|
227
|
-
return !0;
|
|
238
|
+
{
|
|
239
|
+
label: "连接分析",
|
|
240
|
+
key: "link",
|
|
241
|
+
func: "onLevelClick"
|
|
228
242
|
},
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
// callback on layoutstop
|
|
234
|
-
transform: function(e, n) {
|
|
235
|
-
return n;
|
|
243
|
+
{
|
|
244
|
+
label: "路径分析",
|
|
245
|
+
key: "path",
|
|
246
|
+
func: "pathAnalysis"
|
|
236
247
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
// whether to fit the viewport to the graph
|
|
242
|
-
padding: 30,
|
|
243
|
-
// the padding on fit
|
|
244
|
-
startAngle: 1.5 * Math.PI,
|
|
245
|
-
// where nodes start in radians
|
|
246
|
-
sweep: void 0,
|
|
247
|
-
// how many radians should be between the first and last node (defaults to full circle)
|
|
248
|
-
clockwise: !0,
|
|
249
|
-
// whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)
|
|
250
|
-
equidistant: !1,
|
|
251
|
-
// whether levels have an equal radial distance betwen them, may cause bounding box overflow
|
|
252
|
-
minNodeSpacing: 10,
|
|
253
|
-
// min spacing between outside of nodes (used for radius adjustment)
|
|
254
|
-
boundingBox: void 0,
|
|
255
|
-
// constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
|
|
256
|
-
avoidOverlap: !0,
|
|
257
|
-
// prevents node overlap, may overflow boundingBox if not enough space
|
|
258
|
-
nodeDimensionsIncludeLabels: !1,
|
|
259
|
-
// Excludes the label when calculating node bounding boxes for the layout algorithm
|
|
260
|
-
height: void 0,
|
|
261
|
-
// height of layout area (overrides container height)
|
|
262
|
-
width: void 0,
|
|
263
|
-
// width of layout area (overrides container width)
|
|
264
|
-
spacingFactor: 3,
|
|
265
|
-
// Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
|
|
266
|
-
concentric: function(e) {
|
|
267
|
-
return e.degree();
|
|
248
|
+
], re = [
|
|
249
|
+
{
|
|
250
|
+
label: "全选",
|
|
251
|
+
key: "all"
|
|
268
252
|
},
|
|
269
|
-
|
|
270
|
-
|
|
253
|
+
{
|
|
254
|
+
label: "反选",
|
|
255
|
+
key: "reverse"
|
|
271
256
|
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
// duration of animation in ms if enabled
|
|
276
|
-
animationEasing: void 0,
|
|
277
|
-
// easing of animation if enabled
|
|
278
|
-
animateFilter: function(e, n) {
|
|
279
|
-
return !0;
|
|
257
|
+
{
|
|
258
|
+
label: "点选模式",
|
|
259
|
+
key: "click"
|
|
280
260
|
},
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
stop: void 0,
|
|
285
|
-
// callback on layoutstop
|
|
286
|
-
transform: function(e, n) {
|
|
287
|
-
return n;
|
|
261
|
+
{
|
|
262
|
+
label: "框选模式",
|
|
263
|
+
key: "box"
|
|
288
264
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
spacingFactor: 2,
|
|
302
|
-
// 间距
|
|
303
|
-
nestingFactor: 5,
|
|
304
|
-
// 嵌套因子
|
|
305
|
-
gravity: 0,
|
|
306
|
-
// 无中心引力
|
|
307
|
-
numIter: 3e3,
|
|
308
|
-
// 增加迭代次数
|
|
309
|
-
tile: !0,
|
|
310
|
-
// 平铺布局
|
|
311
|
-
animate: "end",
|
|
312
|
-
// 动画时机
|
|
313
|
-
animationDuration: 1e3,
|
|
314
|
-
// 动画时长
|
|
315
|
-
randomize: !0,
|
|
316
|
-
// 随机初始位置
|
|
317
|
-
fit: !0,
|
|
318
|
-
// 是否适应画布
|
|
319
|
-
padding: 50,
|
|
320
|
-
// 内边距
|
|
321
|
-
nodeDimensionsIncludeLabels: !0
|
|
322
|
-
}), D = () => ({
|
|
323
|
-
name: "grid",
|
|
324
|
-
fit: !0,
|
|
325
|
-
// whether to fit the viewport to the graph
|
|
326
|
-
padding: 30,
|
|
327
|
-
// padding used on fit
|
|
328
|
-
boundingBox: void 0,
|
|
329
|
-
// constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
|
|
330
|
-
avoidOverlap: !0,
|
|
331
|
-
// prevents node overlap, may overflow boundingBox if not enough space
|
|
332
|
-
avoidOverlapPadding: 10,
|
|
333
|
-
// extra spacing around nodes when avoidOverlap: true
|
|
334
|
-
nodeDimensionsIncludeLabels: !1,
|
|
335
|
-
// Excludes the label when calculating node bounding boxes for the layout algorithm
|
|
336
|
-
spacingFactor: void 0,
|
|
337
|
-
// Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
|
|
338
|
-
condense: !1,
|
|
339
|
-
// uses all available space on false, uses minimal space on true
|
|
340
|
-
rows: void 0,
|
|
341
|
-
// force num of rows in the grid
|
|
342
|
-
cols: void 0,
|
|
343
|
-
// force num of columns in the grid
|
|
344
|
-
position: function(e) {
|
|
265
|
+
], ie = [
|
|
266
|
+
{
|
|
267
|
+
label: "下载JSON",
|
|
268
|
+
key: "downloadJson"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
label: "预览JSON列表",
|
|
272
|
+
key: "previewJsonList"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
label: "下载EXCEL",
|
|
276
|
+
key: "downloadExcel"
|
|
345
277
|
},
|
|
346
|
-
//
|
|
347
|
-
|
|
348
|
-
//
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
animationEasing: void 0,
|
|
354
|
-
// easing of animation if enabled
|
|
355
|
-
animateFilter: function(e, n) {
|
|
356
|
-
return !0;
|
|
278
|
+
// {
|
|
279
|
+
// label: '预览数据列表',
|
|
280
|
+
// key: 'previewDataList'
|
|
281
|
+
// },
|
|
282
|
+
{
|
|
283
|
+
label: "下载JPG",
|
|
284
|
+
key: "downloadJpg"
|
|
357
285
|
},
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
stop: void 0,
|
|
362
|
-
// callback on layoutstop
|
|
363
|
-
transform: function(e, n) {
|
|
364
|
-
return n;
|
|
286
|
+
{
|
|
287
|
+
label: "下载PNG",
|
|
288
|
+
key: "downloadPng"
|
|
365
289
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
// 值越小连线越短
|
|
383
|
-
boundingBox: void 0,
|
|
384
|
-
// constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
|
|
385
|
-
avoidOverlap: !0,
|
|
386
|
-
// prevents node overlap, may overflow boundingBox if not enough space
|
|
387
|
-
nodeDimensionsIncludeLabels: !1,
|
|
388
|
-
// Excludes the label when calculating node bounding boxes for the layout algorithm
|
|
389
|
-
roots: void 0,
|
|
390
|
-
// the roots of the trees
|
|
391
|
-
depthSort: void 0,
|
|
392
|
-
// a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') }
|
|
393
|
-
animate: !0,
|
|
394
|
-
// whether to transition the node positions
|
|
395
|
-
animationDuration: 500,
|
|
396
|
-
// duration of animation in ms if enabled
|
|
397
|
-
animationEasing: void 0,
|
|
398
|
-
// easing of animation if enabled,
|
|
399
|
-
animateFilter: function(e, n) {
|
|
400
|
-
return !0;
|
|
290
|
+
], ce = [
|
|
291
|
+
{
|
|
292
|
+
label: "居中",
|
|
293
|
+
key: "center"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
label: "顶部",
|
|
297
|
+
key: "top"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
label: "底部",
|
|
301
|
+
key: "bottom"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
label: "左侧",
|
|
305
|
+
key: "left"
|
|
401
306
|
},
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
stop: void 0,
|
|
406
|
-
// callback on layoutstop
|
|
407
|
-
transform: function(e, n) {
|
|
408
|
-
return n;
|
|
307
|
+
{
|
|
308
|
+
label: "右侧",
|
|
309
|
+
key: "right"
|
|
409
310
|
}
|
|
410
|
-
|
|
411
|
-
});
|
|
311
|
+
];
|
|
412
312
|
export {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
313
|
+
re as choiceConfig,
|
|
314
|
+
ae as donwnGraphData,
|
|
315
|
+
ie as downloadData,
|
|
316
|
+
T as getCyData,
|
|
317
|
+
ne as handleCalcPath,
|
|
318
|
+
L as imageMap,
|
|
319
|
+
se as layoutCongig,
|
|
320
|
+
le as linkAnalysis,
|
|
321
|
+
te as resDetailData,
|
|
322
|
+
oe as textLayout,
|
|
323
|
+
ce as textPositionConfig
|
|
423
324
|
};
|