feat: layout for combo. feat: nonoverlap for combo layout in first stage.

This commit is contained in:
Yanyan-Wang 2020-04-07 20:21:07 +08:00 committed by Yanyan Wang
parent e06278f7c6
commit a079ebaad3

View File

@ -989,29 +989,6 @@ export default class Graph extends EventEmitter implements IGraph {
self.addCombos(combos);
}
if (!this.get('groupByTypes')) {
if (combos) {
this.sortCombos(data);
} else {
// 为提升性能,选择数量少的进行操作
if (data.nodes && data.edges && data.nodes.length < data.edges.length) {
const nodesArr = this.getNodes();
// 遍历节点实例,将所有节点提前。
nodesArr.forEach(node => {
node.toFront();
});
} else {
const edgesArr = this.getEdges();
// 遍历节点实例,将所有节点提前。
edgesArr.forEach(edge => {
edge.toBack();
});
}
}
}
// layout
const layoutController = self.get('layoutController');
if (!layoutController.layout(success)) {