react-d3-radar icon indicating copy to clipboard operation
react-d3-radar copied to clipboard

onHover not working

Open mturnwall opened this issue 5 years ago • 2 comments

Hi, I'm trying to use this for an interactive radar chart. It has all functionality I need. Unfortunately the onHover method isn't working for me. I tried using your exact code from your example in the README.

Here is an example of what I'm doing, https://codesandbox.io/s/r0j22wl76p

mturnwall avatar Oct 03 '18 23:10 mturnwall

Hi @mturnwall ! I have forked your sandbox and made two changes that sort things out:

Firstly I downgraded to the non-RC version of the repo. It's still WIP and has some issues around internal SVG transforms and mapping to hovered points.

I also changed how you've used the highlighted prop. It's a controlled component, so you have to tell it what point to highlight. So the flow is: user moves over a point > onHover prop called > you do something with that -- typically setting state like I've done in the sandbox > you update other props, like highlighted.

I hope that helps!

Do you mind me asking what you're working on?

shauns avatar Oct 05 '18 08:10 shauns

The link would be useful too :D https://codesandbox.io/s/94zyqrly8p

shauns avatar Oct 05 '18 08:10 shauns