perf: performance of update position

This commit is contained in:
Yanyan-Wang 2023-11-08 15:02:08 +08:00
parent 9b20b27d9d
commit fde08a480b
2 changed files with 15 additions and 17 deletions

View File

@ -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);

View File

@ -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