fix: 拓扑变换布局
This commit is contained in:
@@ -1700,9 +1700,8 @@ export function randerGroph(graphG6Dom: HTMLElement | undefined, data: any) {
|
||||
edges: processedEdges,
|
||||
});
|
||||
layout.instance.execute();
|
||||
// console.log(processedEdges)
|
||||
|
||||
bindListener(graph);
|
||||
// graph.data({ nodes: aggregatedData.nodes, edges: processedEdges });
|
||||
graph.data({ nodes: aggregatedData.nodes, edges: processedEdges });
|
||||
graph.render();
|
||||
|
||||
@@ -1740,3 +1739,17 @@ export function randerGroph(graphG6Dom: HTMLElement | undefined, data: any) {
|
||||
|
||||
return graph;
|
||||
}
|
||||
|
||||
let gridLayout = false;
|
||||
export function switchLayout() {
|
||||
gridLayout = !gridLayout;
|
||||
if (gridLayout) {
|
||||
stopLayout();
|
||||
graph.updateLayout({
|
||||
type: 'grid',
|
||||
begin: [20, 20],
|
||||
});
|
||||
} else {
|
||||
layout.instance.execute();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user