antvis/G6

graph.updateLayout 之后 自定义的 G6.registerEdge( 'line-dash', ....) 失效了 #5160

RainyNight9 posted onGitHub

问题描述

在用 graph.updateLayout 切换布局之后 默认自定义的 G6.registerEdge( 'line-dash', ....) 失效了 表现为:在边上自定义了 run 动画,以及箭头,但是在切换布局之后,动画没了,箭头留在的初始位置。

重现链接

https://g6.antv.antgroup.com/manual/middle/animation#%E8%99%9A%E7%BA%BF%E8%BF%90%E5%8A%A8%E7%9A%84%E6%95%88%E6%9E%9C

重现步骤

layoutConfig = { type: 'circular', radius: 300, workerEnabled: true } graph.updateLayout(layoutConfig); graph.layout(true)

image

image

预期行为

希望 默认的 自定义边不失效。

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


hi @RainyNight9, welcome!

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

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

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

请问后来怎么解决的?

posted by Ourydy over 1 year ago

兄弟解决了吗后来

posted by WangHanZ 11 months ago

可以监听布局切换,在beforelayout的时候加一个这个 this.graph.edge((edge) => { return { edge } })

posted by WangHanZ 11 months ago

兄弟解决了吗后来

绕道似的解决,其实也叫做没解决。就是切换模式重新去渲染。相当于初始渲染。想听听官方人员针对此问题,有什么好的解决办法吗?感觉这个应该算是 bug

posted by RainyNight9 11 months ago

兄弟切换模式是咋搞得 能说说不

posted by WangHanZ 10 months ago

兄弟切换模式是咋搞得 能说说不

就是切换模式后,重新去渲染,重新初始化.....,最 low 的办法,但是也是能正常加载的办法。。。无奈之举。

posted by RainyNight9 10 months ago

后面通过new一个layout实例,调用它的init和execute方法可以解决

posted by WangHanZ 10 months 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