G6 icon indicating copy to clipboard operation
G6 copied to clipboard

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

Open mark19880202 opened this issue 1 year ago • 3 comments

问题描述

参考官方的例子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

mark19880202 avatar Oct 19 '23 08:10 mark19880202

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

github-actions[bot] avatar Oct 19 '23 08:10 github-actions[bot]

hi @mark19880202, welcome!

github-actions[bot] avatar Oct 19 '23 08:10 github-actions[bot]

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

image

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

Yanyan-Wang avatar Nov 02 '23 10:11 Yanyan-Wang

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。

github-actions[bot] avatar Jul 05 '24 05:07 github-actions[bot]