markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

How to show arcs associated to a bubble on hover? #393

Closed juliohm closed 7 years ago

juliohm commented 7 years ago

I have a map with bubbles and an array of arcs as specified in the docs. My problem is that there are too many arcs in my dataset and showing all of them at once makes the visualization very slow and busy.

Assuming that I am following the docs strictly, how could I only show the arcs leaving a bubble upon hovering with the mouse? If I try to modify the mouseover event manually, I loose the automatic popup from datamaps that is already working very nicely.

juliohm commented 7 years ago

Asking it differently: Where I can find the default callback for the mouse hover event? I want to reproduce the existing code and do something extra afterwards like showing the reduced set of arcs leaving the current bubble.

juliohm commented 7 years ago

I appreciate any help on this, I just need to know what is the function that is being called by default to present a div element, I am done with my visualization otherwise. Planning to publish it soon I get this working.

juliohm commented 7 years ago

If anyone needs to hack this behavior in the future, you just need to lookup the function Datamap.prototype.updatePopup(element, d, options) in the source here.

Problem solved, closing the issue.