antvis / Graphin

A React toolkit for graph visualization based on G6
https://graphin.antv.antgroup.com
MIT License
980 stars 262 forks source link

Graphin.Legend should hide node halo as well #488

Open romulorod opened 11 months ago

romulorod commented 11 months ago

Describe the bug

If the node has a halo, when we click on the legend to "hide" that node, the halo is still fully visible but it should take the node visibility into account to make it also invisible, or less visible.

Your Example Website or App

https://codesandbox.io/s/suspicious-heisenberg-rhzvzc?file=/App.tsx

Steps to Reproduce the Bug or Issue

Add a legend to a chart, display nodes with halos and click the legend to toggle node visibility.

Expected behavior

The halo should also go invisible alongside the node.

Screenshots or Videos

No response

Platform

Additional context

No response

pomelo-nwu commented 11 months ago

@romulorod If you set the style configuration for Graphin, you also need to manually specify its status configuration via props.nodeStateStyles,You can check out the link below: https://codesandbox.io/s/recursing-shockley-nqcx3g?file=/App.tsx

image

romulorod commented 11 months ago

@pomelo-nwu this was exactly what I needed, I wasn't aware of that props, nodeStateStyles, thank you!! <3