Skip to content

Commit

Permalink
🐛 remove forceSimulation before layout change
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Dec 27, 2019
1 parent 4310001 commit 466e67f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/graphin/src/controller/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ const layoutController = (
// 数据的校验
const data = dataChecking(PropsData);

// 重置forceSimulation

if (forceSimulation) {
forceSimulation.stop();
}

// 注册 Layout
const { extend = {} } = props;
const extendLayout = extend.layout || noopLayout;
Expand Down Expand Up @@ -69,11 +75,6 @@ const layoutController = (
layout = { name: 'concentric' };
}

// 重置forceSimulation
if (forceSimulation) {
forceSimulation.stop();
}

// 设置布局的 options参数
const { name } = layout;
const options = {
Expand Down

0 comments on commit 466e67f

Please sign in to comment.