guozhaolong / wfd

flowable workflow designer base on @antv/g6
https://guozhaolong.github.io/wfd/
MIT License
927 stars 248 forks source link

请问节点节点active时候的运动动画是怎么做的,我尝试在自己的项目中用g6-editor,好像不生效 #1

Closed zhanghui-space closed 5 years ago

zhanghui-space commented 5 years ago

看完你的代码后,又去官方文档上看了一遍,还是不能实现

 afterDraw(item) {
    const shape = item.getGraphicGroup().get('children')[0];
    const length = 9;
    let totalArray = [];
    for (let i = 0; i < length; i += interval) {
      totalArray = totalArray.concat(lineDash);
    }
    let index = 0;
    shape.animate({
      onFrame(ratio) {
        const cfg = {
          lineDash: dashArray[index].concat(totalArray)
        };
        index = (index + 1) % interval;
        return cfg;
      },
      fill: 'red',
      repeat: true
    }, 5000, 'easeLinear',  ()=> {
      console.log(11)
    });
  },
......
guozhaolong commented 5 years ago

你的代码看上去没啥问题啊,会不会是shape取的不对啊

zhanghui-space commented 5 years ago

查到了 是g6-editor里面g6版本有点老 并不支持onFrame,哎,心累

guozhaolong commented 5 years ago

哈哈,g6更新到3.0以后一堆问题,我也解决了一天