antvis/G6

Do you want to work on this issue?

You can request for a bounty in order to promote it!

如何在hover edge时,保持edge的颜色? #5616

neolee6053 posted onGitHub

问题描述

我的edges 有各种不同的颜色,如何在hover edge时,保持edge的颜色? 我不要固定一个颜色 edgeStateStyles: { active: { stroke: "#F6BD16", (should be removed) haloShape: { opacity: 0.3 } } }

重现链接

https://codesandbox.io/p/sandbox/thirsty-visvesvaraya-5rj85c?file=%2Findex.js%3A85%2C14

重现步骤

如上

预期行为

如上

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


我推测的做法:

  1. 首先定义一个业务状态 normalEdge,指南为 https://g6.antv.vision/manual/middle/states/state
  2. 设置 graph 交互事件,当hover 事件发生时,setItem(curEdge, 'normalEdge') 来设置edge 为业务状态而不是hover 交互状态
posted by GoodEnoughL 12 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests