Skip to content

Commit c3c10dd

Browse files
authored
Merge pull request #737 from GraphScope/fix-home-center
Fix the issue of the homepage legend not being centered
2 parents af05001 + d7a190e commit c3c10dd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/studio-importor/src/app/graph-canvas/useInteractive.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,11 @@ const useInteractive: any = () => {
171171

172172
const onReactFlowInit = reactFlowInstance => {
173173
if (reactFlowInstance) {
174-
const allNodes = reactFlowInstance.toObject().nodes;
175-
const bbox = getNodesBounds(allNodes);
176-
fitBounds(bbox, { duration: 600 });
174+
setTimeout(()=>{
175+
const allNodes = reactFlowInstance.toObject().nodes;
176+
const bbox = getNodesBounds(allNodes);
177+
fitBounds(bbox, { duration: 600 });
178+
},300)
177179
}
178180
};
179181

0 commit comments

Comments
 (0)