react-kggraph 0.0.11 → 0.0.13

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.es8.js CHANGED
@@ -1,324 +1,423 @@
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
- }
1
+ const I = (e, n, r, o = 20) => {
2
+ const u = e.nodes(), i = u.filter((t) => t.data("name") === n), a = u.filter((t) => t.data("name") === r);
3
+ if (console.log(111, !i.data() || !a.data(), i.data(), a.data()), !i.data() || !a.data()) {
4
+ console.warn("fixNodesToEdges: 未找到左右节点", n, r);
5
+ const t = e.layout(c());
6
+ return t.run(), t.on("layoutstop", () => {
7
+ e.fit(void 0, 50);
8
+ }), !1;
9
+ }
10
+ const l = e.width();
11
+ if (l === 0)
12
+ return !1;
13
+ const g = i.width() || 60, d = e.height() / 2, f = g / 2 + o, m = l - g / 2 - o;
14
+ i.position({ x: f, y: d }), a.position({ x: m, y: d }), i.lock(), a.lock();
15
+ const s = e.nodes().difference(i).difference(a);
16
+ if (s.length > 0) {
17
+ s.forEach((v) => {
18
+ const p = v.position().x, h = Math.min(f, p), b = Math.max(m, p);
19
+ v.position({
20
+ x: h + (b - h) * 0.5,
21
+ y: d
22
+ });
65
23
  });
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 } });
24
+ const t = e.layout({
25
+ // name: 'cose-bilkent',
26
+ ...c(),
27
+ nodes: s
28
+ // 只布局中间节点
29
+ // animate: true,
30
+ // animationDuration: 500,
31
+ // randomize: false,
32
+ // fit: false, // 不自动适应视图
33
+ // nodeRepulsion: 1500000,
34
+ // idealEdgeLength: 120,
35
+ // gravity: 0.3,
36
+ // padding: 50,
71
37
  });
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
- };
38
+ t.run(), t.on("layoutstop", () => {
39
+ e.fit(void 0, 50), i.unlock(), a.unlock(), console.log("布局完成");
40
+ });
41
+ } else
42
+ e.fit(void 0, 50);
43
+ return console.log("fixNodesToEdges: 完成"), !0;
44
+ }, c = () => ({
45
+ name: "cose-bilkent",
46
+ // 核心优化
47
+ nodeRepulsion: 1005e3,
48
+ // 大幅增加斥力,让节点分散
49
+ idealEdgeLength: 100,
50
+ // 拉长边长,避免拥挤
51
+ edgeElasticity: 0.3,
52
+ // 适度弹性,保持边距
53
+ numIter: 2500,
54
+ // 保持迭代次数
55
+ // 布局对齐
56
+ fit: !0,
57
+ padding: 50,
58
+ // 增加内边距
59
+ randomize: !1,
60
+ animate: "end",
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();
92
86
  break;
93
- case "left":
94
- e = {
95
- ...e,
96
- "text-halign": "left",
97
- "text-valign": "center",
98
- "text-margin-x": "-5px"
99
- };
87
+ case "concentric":
88
+ console.log("执行圆形布局"), o = L();
100
89
  break;
101
- case "right":
102
- e = {
103
- ...e,
104
- "text-halign": "right",
105
- "text-valign": "center",
106
- "text-margin-x": "5px"
107
- };
90
+ case "grid":
91
+ console.log("执行网格布局"), o = D();
108
92
  break;
109
- case "top":
110
- e = {
111
- ...e,
112
- "text-halign": "center",
113
- "text-valign": "top",
114
- "text-margin-y": "-5px"
115
- };
93
+ case "breadthfirst":
94
+ console.log("执行树型布局"), o = F();
95
+ break;
96
+ case "random":
97
+ console.log("执行随机布局"), o = y();
98
+ break;
99
+ case "cose":
100
+ console.log("执行 cose 布局"), o = k();
101
+ break;
102
+ case "cose-bilkent":
103
+ console.log("执行 cose-bilkent 布局"), o = c();
116
104
  break;
117
- case "bottom":
118
- e = {
119
- ...e,
120
- "text-halign": "center",
121
- "text-valign": "bottom",
122
- "text-margin-y": "5px"
105
+ case "fcose":
106
+ console.log("执行 fcose 布局"), o = x();
107
+ break;
108
+ case "cise":
109
+ console.log("执行 cise 布局"), o = {
110
+ name: "cise",
111
+ // 聚类分组(必须定义才能生效)
112
+ clusters: [],
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
123
127
  };
124
128
  break;
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}`);
129
+ default:
130
+ console.warn("未知布局类型:", n);
146
131
  return;
147
- }
148
132
  }
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("计算路径时出错,请重试!");
133
+ r.layout(o).run();
134
+ }, y = () => ({
135
+ name: "random",
136
+ fit: !0,
137
+ // whether to fit to viewport
138
+ padding: 30,
139
+ // fit padding
140
+ boundingBox: void 0,
141
+ // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
142
+ animate: !0,
143
+ // whether to transition the node positions
144
+ animationDuration: 500,
145
+ // duration of animation in ms if enabled
146
+ animationEasing: void 0,
147
+ // easing of animation if enabled
148
+ animateFilter: function(e, n) {
149
+ return !0;
150
+ },
151
+ // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts
152
+ ready: void 0,
153
+ // callback on layoutready
154
+ stop: void 0,
155
+ // callback on layoutstop
156
+ transform: function(e, n) {
157
+ return n;
185
158
  }
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"
159
+ // transform a given node position. Useful for changing flow direction in discrete layouts
160
+ }), k = () => ({
161
+ name: "cose",
162
+ ready: function() {
211
163
  },
212
- {
213
- label: "弹性布局",
214
- key: "fcose"
164
+ stop: function() {
215
165
  },
216
- {
217
- label: "网格布局",
218
- key: "grid"
166
+ animate: !0,
167
+ animationEasing: void 0,
168
+ animationDuration: void 0,
169
+ animateFilter: function(e, n) {
170
+ return !0;
219
171
  },
220
- {
221
- label: "球面布局",
222
- key: "circle"
172
+ animationThreshold: 250,
173
+ refresh: 20,
174
+ fit: !0,
175
+ padding: 30,
176
+ boundingBox: void 0,
177
+ nodeDimensionsIncludeLabels: !1,
178
+ randomize: !1,
179
+ componentSpacing: 40,
180
+ nodeRepulsion: function(e) {
181
+ return 2048;
223
182
  },
224
- {
225
- label: "层级布局",
226
- key: "breadthfirst"
183
+ nodeOverlap: 4,
184
+ idealEdgeLength: function(e) {
185
+ return 32;
227
186
  },
228
- {
229
- label: "同心圆布局",
230
- key: "concentric"
231
- }
232
- ], le = [
233
- {
234
- label: "查询节点",
235
- key: "query",
236
- func: "queryNode"
187
+ edgeElasticity: function(e) {
188
+ return 32;
237
189
  },
238
- {
239
- label: "连接分析",
240
- key: "link",
241
- func: "onLevelClick"
190
+ nestingFactor: 1.2,
191
+ gravity: 1,
192
+ numIter: 8e3,
193
+ initialTemp: 1e3,
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;
242
228
  },
243
- {
244
- label: "路径分析",
245
- key: "path",
246
- func: "pathAnalysis"
229
+ // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts
230
+ ready: void 0,
231
+ // callback on layoutready
232
+ stop: void 0,
233
+ // callback on layoutstop
234
+ transform: function(e, n) {
235
+ return n;
247
236
  }
248
- ], re = [
249
- {
250
- label: "全选",
251
- key: "all"
237
+ // transform a given node position. Useful for changing flow direction in discrete layouts
238
+ }), L = () => ({
239
+ name: "concentric",
240
+ fit: !0,
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();
252
268
  },
253
- {
254
- label: "反选",
255
- key: "reverse"
269
+ levelWidth: function(e) {
270
+ return e.maxDegree() / 4;
256
271
  },
257
- {
258
- label: "点选模式",
259
- key: "click"
272
+ animate: !0,
273
+ // whether to transition the node positions
274
+ animationDuration: 500,
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;
260
280
  },
261
- {
262
- label: "框选模式",
263
- key: "box"
281
+ // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts
282
+ ready: void 0,
283
+ // callback on layoutready
284
+ stop: void 0,
285
+ // callback on layoutstop
286
+ transform: function(e, n) {
287
+ return n;
264
288
  }
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"
289
+ // transform a given node position. Useful for changing flow direction in discrete layouts
290
+ }), x = () => ({
291
+ name: "fcose",
292
+ // 节点布局 - 防止重叠
293
+ idealEdgeLength: 50,
294
+ // 较小的边长
295
+ edgeElasticity: 80,
296
+ // 边的弹性
297
+ nodeRepulsion: 12e3,
298
+ // 增强斥力,防止重叠
299
+ nodeOverlap: 0,
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) {
277
345
  },
278
- // {
279
- // label: '预览数据列表',
280
- // key: 'previewDataList'
281
- // },
282
- {
283
- label: "下载JPG",
284
- key: "downloadJpg"
346
+ // returns { row, col } for element
347
+ sort: void 0,
348
+ // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }
349
+ animate: !0,
350
+ // whether to transition the node positions
351
+ animationDuration: 500,
352
+ // duration of animation in ms if enabled
353
+ animationEasing: void 0,
354
+ // easing of animation if enabled
355
+ animateFilter: function(e, n) {
356
+ return !0;
285
357
  },
286
- {
287
- label: "下载PNG",
288
- key: "downloadPng"
358
+ // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts
359
+ ready: void 0,
360
+ // callback on layoutready
361
+ stop: void 0,
362
+ // callback on layoutstop
363
+ transform: function(e, n) {
364
+ return n;
289
365
  }
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"
366
+ // transform a given node position. Useful for changing flow direction in discrete layouts
367
+ }), F = () => ({
368
+ name: "breadthfirst",
369
+ fit: !0,
370
+ // whether to fit the viewport to the graph
371
+ directed: !1,
372
+ // whether the tree is directed downwards (or edges can point in any direction if false)
373
+ direction: "downward",
374
+ // determines the direction in which the tree structure is drawn. The possible values are 'downward', 'upward', 'rightward', or 'leftward'.
375
+ padding: 30,
376
+ // padding on fit
377
+ circle: !1,
378
+ // put depths in concentric circles if true, put depths top down if false
379
+ grid: !1,
380
+ // whether to create an even grid into which the DAG is placed (circle:false only)
381
+ spacingFactor: 1,
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;
306
401
  },
307
- {
308
- label: "右侧",
309
- key: "right"
402
+ // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts
403
+ ready: void 0,
404
+ // callback on layoutready
405
+ stop: void 0,
406
+ // callback on layoutstop
407
+ transform: function(e, n) {
408
+ return n;
310
409
  }
311
- ];
410
+ // transform a given node position. Useful for changing flow direction in discrete layouts
411
+ });
312
412
  export {
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
413
+ F as breadthfirstLayout,
414
+ E as circle,
415
+ L as concentricLayout,
416
+ c as coseBilkentLayout,
417
+ k as coseLayout,
418
+ x as fcoseLayout,
419
+ I as fixNodesToEdges,
420
+ D as gridLayout,
421
+ w as layout,
422
+ y as randomLayout
324
423
  };