G6 icon indicating copy to clipboard operation
G6 copied to clipboard

自定义布局之后,如何主动触发一次自定义behavior的执行

Open dingyang9642 opened this issue 1 year ago • 2 comments

问题描述

需求:鼠标move到节点,高亮显示与子节点连线,其他的连线置灰;当单击其他节点后会自动执行一次布局,但鼠标样式&连线的state并没有发生改变; 说明:连线状态的改变是通过自定义behavior添加时间node:mouseenter & node:mouseleave来实现; 效果:如果所示

重现链接

下面视频

重现步骤

预期行为

平台

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

屏幕截图或视频(可选)

https://user-images.githubusercontent.com/16871766/182598910-da124ef9-1ef9-4365-bd0f-ffb1a4020c0f.mp4

补充说明(可选)

No response

dingyang9642 avatar Aug 03 '22 11:08 dingyang9642

Hi @dingyang9642 - Would you be able to share a codesandbox link reproducing the issue with mock data? That would help the G6 team a lot in helping share a solution You can use mock / dummy data

Also, what layout are you using? The design of your graph looks really nice!

cliffordfajardo avatar Aug 06 '22 12:08 cliffordfajardo

你是希望点击发生重新布局的时候,原先高亮的状态消失?那就在相应地方 graph.setItemState(item, 'xxx', false) 就好

Yanyan-Wang avatar Aug 19 '22 08:08 Yanyan-Wang

尊敬的用户,您好。我们很重视您的 issue,但由于长时间没有答复,我们暂时认为这个问题已经解决。如果还有任何问题,请随时根据 issue 模版再开启新的 issue。

Yanyan-Wang avatar Nov 29 '22 09:11 Yanyan-Wang