Skip to content

基于@antv/hierarchy去计算脑图节点,如果脑图节点数量过多按招下面去循环更新节点位置,会导致更新时间太长,是否有批量更新节点位置信息的接口或者其他方案 #4923

@zepingFISH

Description

@zepingFISH

问题描述

基于@antv/hierarchy去计算脑图节点,如果脑图节点数量过多按招下面去循环更新节点位置,会导致更新时间太长,是否有批量更新节点位置信息的接口或者其他方案
const node = graph.getCellById(data.id);
node.setProp({
data: {
...node.getData(), // 保留旧数据
width: data.width,
height: data.height,
children: data.children,
},
size: { width: data.width, height: data.height },
position: { x: hierarchyItem.x, y: hierarchyItem.y },
});

重现链接

没有

重现步骤

基于@antv/hierarchy去计算脑图节点,如果脑图节点数量过多按招下面去循环更新节点位置,会导致更新时间太长,是否有批量更新节点位置信息的接口或者其他方案
const node = graph.getCellById(data.id);
node.setProp({
data: {
...node.getData(), // 保留旧数据
width: data.width,
height: data.height,
children: data.children,
},
size: { width: data.width, height: data.height },
position: { x: hierarchyItem.x, y: hierarchyItem.y },
});

预期行为

有批量更新节点位置信息的接口或者其他解决方案

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox ...]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for maintainerTriage or intervention needed from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions