antvis / G2Plot

:dango: An interactive and responsive charting library based on G2.
https://g2plot.antv.antgroup.com
MIT License
2.56k stars 607 forks source link

🤔 [QUESTION] 水波图调用changeData时,水波图动画有概率会停止 #3820

Open xiaopujun opened 1 month ago

xiaopujun commented 1 month ago

问题现象:

image

渲染回波图后调用changeData方法更新水波图数据,会导致水波图的波浪动画停止。官方示例可复现.

经过多次测试发现,当changeData执行的比较频繁时容易出现该问题,但不是每次都能复现


import { Liquid } from '@antv/g2plot';

const liquidPlot = new Liquid('container', {
  percent: 0.25,
  outline: {
    border: 4,
    distance: 8,
  },
  wave: {
    length: 128,
  },
  animation: {
      appear: {
          animation: 'wave-in',
          duration: 3000
      },
  }
});
liquidPlot.render();
setInterval(()=>{
    liquidPlot.changeData(Math.random())
},4000)

版本:2.4.25 平台:windows chrome

示例连接:https://g2plot.antv.antgroup.com/examples/progress-plots/liquid/#basic

复制上方代码粘贴即可复现

xiaopujun commented 1 month ago

渲染后短时间内尽快调用changeData很容易复现该现象