hustcc / hustcc/echarts-for-react

树形图处理大量数据时(叶子节点数约为2600),如果对展开层级做动态设置,页面报错

Open
#577 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5k
Forks
650
PR merge metrics
No merged PRs in 30d

Description

![img_v3_02g7_d06017e6-ee62-47b5-a174-0ad355ff0d2g](https://github.com/user-attachments/assets/519355db-71ec-40a3-96dd-74e292baa30e)

option的配置如下

`
return {
tooltip: {
trigger: 'item',
triggerOn: 'mousemove',
},
series: [
{
type: 'tree',
data: [data],
top: '1%',
left: '7%',
bottom: '1%',
right: '20%',
symbolSize: 7,
label: {
position: 'left',
verticalAlign: 'middle',
align: 'right',
fontSize: 9,
},
leaves: {
label: {
position: 'right',
verticalAlign: 'middle',
align: 'left',
},
},
emphasis: {
focus: 'descendant',
},
// initialTreeDepth: 1,
initialTreeDepth: data?.nodeCount < 50 ? -1 : 1, // -1 表示展开所有节点
animationDuration: 550,
animationDurationUpdate: 750,
},
],
};
`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.