done
bubbles
has not been added yet, since bubbles
is a plugin.
new Datamap
returns an object with choice d3 in svg
:
var map = new Datamap({...}); //add bubbles map.bubbles(bubbleData); //handle bubble clicks map.svg.selectAll('.bubbles').on('click', function() {...});
This should work for the first batch of bubbles.
If you dynamically add bubbles and don't want to listen to reset listeners, you can use jQuery event delegation to handle dynamic bubbles:
$(map.svg[0][0]).on('click', '.bubbles', function(e) { //handle click here as well });
source share