shauns / react-d3-radar

React-based Radar chart for D3
MIT License
53 stars 32 forks source link

RadarAxis calls onAxisLabelClick on mouseover #13

Open matthewcocco opened 5 years ago

matthewcocco commented 5 years ago

In the v-next branch, the RadarAxis component calls the onClick method on mouseover.

I believe the cause is here: https://github.com/shauns/react-d3-radar/blob/v-next/src/RadarAxis.js#L71-L72

This causes (what I think is) unexpected behavior for an onAxisLabelClick prop passed from the top level Radar is triggered every time an axis label is moused over, in addition to when it is clicked.

The relevant changes to add an onAxisLabelMouseover prop and pass that value instead to the onMouseover of the RadarAxis component are in:

I have some changes at https://github.com/matthewcocco/react-d3-radar/commit/8431850cac9dbbfdf40784274b28aac84cb6b0c3 that pass the test:all suite, and can open a PR if you'd like, @shauns -- would you be open to accepting it?