mirror of
https://gitee.com/antv/g6.git
synced 2024-12-14 17:40:49 +08:00
feat: layout export group.Closes #355
This commit is contained in:
parent
41b6a1c723
commit
865851df72
@ -71,7 +71,14 @@ class Controller extends Base {
|
||||
.map(edge => {
|
||||
return edge.getModel();
|
||||
});
|
||||
graph._executeLayout(processer, nodes, edges);
|
||||
const groups = graph.getGroups()
|
||||
.filter(group => {
|
||||
return group.isVisible();
|
||||
})
|
||||
.map(group => {
|
||||
return group.getModel();
|
||||
});
|
||||
graph._executeLayout(processer, nodes, edges, groups);
|
||||
graph.updateNodePosition();
|
||||
graph.emit('afterlayout');
|
||||
}
|
||||
|
@ -138,12 +138,13 @@ class Graph extends Base {
|
||||
initEvent() {
|
||||
|
||||
}
|
||||
_executeLayout(processer, nodes, edges) {
|
||||
_executeLayout(processer, nodes, edges, groups) {
|
||||
if (Util.isFunction(processer)) {
|
||||
processer(nodes, edges, this);
|
||||
} else if (Util.isObject(processer)) {
|
||||
processer.nodes = nodes;
|
||||
processer.edges = edges;
|
||||
processer.groups = groups;
|
||||
processer.graph = this;
|
||||
processer.execute();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user