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 Trigger PopUp #329

Open FreelanceWebNinja opened 8 years ago

FreelanceWebNinja commented 8 years ago

Is there a way to trigger the PopUp?

For instance, an external button triggers the popup?

mikecabana commented 6 years ago

@markmarkoh This is exact functionality I am looking for.

@FreelanceWebNinja Did you end up figuring this out?

FreelanceWebNinja commented 6 years ago

@mikecabana i created a custom function that essentially toggles the pop up and manually positions the element.

mikecabana commented 6 years ago

@FreelanceWebNinja Would you be able to provide a little more detail? Did you use your own tooltips or the ones generated by datamaps.

If you generated your own, did you use the x y values of the arcs for positioning?

FreelanceWebNinja commented 6 years ago

NP @mikecabana , I've actually done both. With the generated tooltips, I targeted the arc/bubble and used getboundingclientrect() to get the coords.