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

Notification based on a condition next to .datamaps-bubbles element #343

Open 0xnandhi opened 8 years ago

0xnandhi commented 8 years ago

Hi,

I want to make a notification right above the point where the bubbles occur. For example, if the bubble data matches certain criteria, i want to notify a message to users.

I use notify.js for printing results. I tried few things. But none worked. I used ".datamaps-bubble" element as the element and tried to print a message using notify.js.

Is there a tweak to achieve this ?

0xnandhi commented 8 years ago

I made changes to "handleBubbles()" function, i added an .attr like this ,

.attr('alert', function(datanum){
                $.notify("triggered");

                return datanum.alert;
            })

I am able to get the notification. i can add logic inside this attr. But how do i notify at the exact [lat, long] ?

please need help on this .

Thanks,