antvis/G6

G6-4.8.23 在自定义布局execute()内更改Node节点的Style未立即生效问题 #5294

x-zhao-res posted onGitHub

G6 版本

5.x

问题描述

版本: G6-4.8.23 在自定义布局的execute()内,更改节点Style不生效,是否是因为自定义layout生命周期的问题导致的?

重现链接

https://stackblitz.com/edit/vitejs-vite-kzfulb?file=src%2Fgloballayout.js

重现步骤

操作: 1.设置自定义布局,循环将节点的style.fill设置为red 2.配置节点点击回调,设置点击后将节点激活为click状态,这个应该是默认的 现象: 自定义布局结束后,未看到style改变,但是点击节点激活为click之后可以看到颜色更新,推测应该是layout布局结束后只refresh了x y属性,其他属性需要下次时才能refresh

预期行为

自定义布局内改变节点的style后,布局结束后直接更新节点,而不是需要点击一下

平台

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

屏幕截图或视频(可选)

补充说明(可选)


hi @x-zhao-res, welcome!

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

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

posted by github-actions[bot] 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