Skip to content

Commit

Permalink
perf: performance of update position
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanyan-Wang committed Nov 8, 2023
1 parent 9b20b27 commit fde08a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
28 changes: 11 additions & 17 deletions packages/g6/src/runtime/controller/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,23 +655,17 @@ export class ItemController {
onlyMove,
animate,
// call after updating finished
throttle(
(_, canceled) => {
item.onframe?.(true);
item.onframe = undefined;
if (statesCache) {
statesCache.forEach((state) =>
this.graph.setItemState(id, state, true),
);
}
callback(innerModel, canceled);
},
500,
{
leading: true,
trailing: true,
},
),
(_, canceled) => {
// @ts-ignore
debounceUpdateRelates(nodeRelatedIdsToUpdate);
item.onframe = undefined;
if (statesCache) {
statesCache.forEach((state) =>
this.graph.setItemState(id, state, true),
);
}
callback(innerModel, canceled);
},
);

const parentItem = this.itemMap.get(current.parentId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: CircularLayoutOptions
---

| Name | Type | Default | Description |
| :------- | :------- | :----------------------------- | :------------- |
| `radius` | `number` | 画布宽度与高度较小者的二分之一 | 圆形布局的半径 |

> 📋 中文文档还在翻译中... 欢迎 PR
[Overview - v5.0.0-beta.21](../../README.zh.md) / [Modules](../../modules.zh.md) / [layout](../../modules/layout.zh.md) / CircularLayoutOptions
Expand Down

0 comments on commit fde08a4

Please sign in to comment.