TennisVisuals / updating-radar-chart

Updating Radar Chart Visualization with extensive configuration options
MIT License
13 stars 7 forks source link

events with more than one on a page #3

Closed timelyportfolio closed 8 years ago

timelyportfolio commented 8 years ago

Sorry to be a pest, but in lines results in problems when more than one exists on a page. In some cases this might be a "feature", but I think in general users might think of it as a bug. Of course, you provide the ability to override this, so maybe you can leave as is.

Perhaps could you limit this to the containing element?

d3.selectAll("." + options.class + "RadarArea")

Probably should have used an animated GIF, but in the screenshot, you can see how hovering in the top chart (green in this case) causes the bottom chart areas to go transparent.

image

TennisVisuals commented 8 years ago

not at all! Can you describe the problem a bit more? You're suggesting limiting the options.class option to the containing element?

timelyportfolio commented 8 years ago

I was just adding a screenshot when I saw your reply. Hope it helps illustrate the issue.

TennisVisuals commented 8 years ago

I thought the selectAll statements were scoped to the enclosing element... checking now

timelyportfolio commented 8 years ago

Since you do d3.selectAll, it will select everything in document. To work as I am suggesting (again maybe not a good idea), you could do something like:

chart_node.selectAll(...)
TennisVisuals commented 8 years ago

ah, it's in the areaMouseover and areaMouseout where I do the d3.selectAll Will fix that!

timelyportfolio commented 8 years ago

Let me know if uploading a bl.ock will help. Thanks.

TennisVisuals commented 8 years ago

no, I've got it.

timelyportfolio commented 8 years ago

I think it is also in the legendMouseover.

TennisVisuals commented 8 years ago

yes

TennisVisuals commented 8 years ago

I think that's fixed it.
I also played a bit with another niggly bit... have you noticed that you can toggle areas on and off by clicking on the Legend? Was hoping that I could .attr('display','none') the toggled areas so that hover events would work for lower areas, but alas.

TennisVisuals commented 8 years ago

let me know if the fix is really a fix and I will close this issue. thanks.

timelyportfolio commented 8 years ago

That does fix. Yes, I noticed the legend, but that will raise another issue.