antvis/G6

设置了edgeStateStyles时,自定义边的options.stateStyles不生效 #5006

CheyenneRowe posted onGitHub

问题描述

设置了edgeStateStyles时,自定义边的options.stateStyles不生效:

<img width="478" alt="image" src="https://github.com/antvis/G6/assets/18679459/b00939d0-643d-4ca9-bea2-d6cbe2177362"> <img width="576" alt="image" src="https://github.com/antvis/G6/assets/18679459/972ae7dc-8ff5-4037-9b59-a3d0ef07bc43">

PS:自定义边继承了‘line’类型: <img width="519" alt="image" src="https://github.com/antvis/G6/assets/18679459/0e403084-37b6-4708-adc6-e164572e0858">

重现链接

https://codesandbox.io/s/condescending-mccarthy-4kwnp8

重现步骤

如上

预期行为

预期style的优先级应该是自定义节点的stateStyles=》全局的edgeStateStyles,也就是hover上去,线变成蓝色,实际上线变成了红色,用了全局的边配置 <img width="457" alt="image" src="https://github.com/antvis/G6/assets/18679459/f68eafc1-35b5-409b-917e-cf93a5b26628">

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


层级要对应,是 keyShape 的样式就写在 active 第一层就好

posted by Yanyan-Wang over 1 year ago

<img width="755" alt="image" src="https://github.com/antvis/G6/assets/18679459/d8e697aa-b135-4c4d-b19c-fb7fd4806f36">

是这样吗?还是不行呢 https://codesandbox.io/s/condescending-mccarthy-4kwnp8?file=/index.js

层级要对应,是 keyShape 的样式就写在 active 第一层就好

posted by CheyenneRowe over 1 year ago

奇怪中午试的时候好像可以。可能确实有这个问题,我晚点排查一下。不过数据里面的优先级是最高的可以先用一下

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