antvis/G6

G6在setItemState触发node和edge的setState时,设置的animate函数修改duration等参数无效 #5073

mark19880202 posted onGitHub

问题描述

参考官方的例子https://antv-g6.gitee.io/zh/examples/scatter/stateChange#hover,修改duration等参数,没有得到动画效果的改变

重现链接

https://antv-g6.gitee.io/zh/examples/scatter/stateChange#hover

重现步骤

访问https://antv-g6.gitee.io/zh/examples/scatter/stateChange#hover 随便修改duration值为30000 动画效果没有生效

预期行为

duration的单次时长为30妙

平台

  • 操作系统: [macOS]
  • 网页浏览器: [Google Chrome]
  • G6 版本: [4.8.21 ]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


Hi @mark19880202, Please star this repo if you find it useful! Thanks :star:! 你好 @mark19880202。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

posted by github-actions[bot] over 1 year ago

hi @mark19880202, welcome!

posted by github-actions[bot] over 1 year ago

因为这里的写法来看,每一帧更新一次虚线的 offset,不论 duration 是多少,每帧之间的间隔是不会发生改变的,所以看起来速度是一样的:

<img width="590" alt="image" src="https://github.com/antvis/G6/assets/29593318/e6fed3b0-fcbf-45ca-8ede-32954ed9cc54">

如果你想加速或减速,我理解写法应该不同,比如让 lineDashOffset 每次变化更小:lineDashOffset: -index / 2,

posted by Yanyan-Wang over 1 year ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests