VChart icon indicating copy to clipboard operation
VChart copied to clipboard

当词图渲染大量数据,如果父元素尺寸发生变化会使图表重新布局,有明显的卡顿,有什么好的办法吗?

Open yibird opened this issue 1 year ago • 1 comments

Version

1.12.12

Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/ycyr6r

Steps to Reproduce

点击按钮修改尺寸

Current Behavior

当词图渲染大量数据,如果父元素尺寸发生变化会使图表重新布局,有明显的卡顿,有什么好的办法吗?

Expected Behavior

即使父元素尺寸发生变化,仍能支持海量数据流畅渲染

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

yibird avatar Nov 18 '24 16:11 yibird

@yibird 这个问题要整体看

  • 首先,先要排查一下尺寸发生变化的时候,触发更新的次数是否有问题,要看resize 有没有做截流
  • 如果数据量真的很大,可以考虑渐进渲染
  • 如果还是不能满足要求,可以考虑固定宽高,避免不必要的resize 带来的更新

xile611 avatar Nov 20 '24 02:11 xile611