dmachat / angular-datamaps

Angular directive for d3 Datamaps
MIT License
60 stars 30 forks source link

How to add click handler to bubble? #30

Closed pietrofxq closed 6 years ago

pietrofxq commented 6 years ago

I know this is possible by having the map object returned by the DataMap constructor and adding the click handler with d3, how is that possible with this wrapper if there's no access to the map object?

pietrofxq commented 6 years ago

Found a way:

let bubbles = d3.selectAll(".datamaps-bubble")
bubbles.on("click", bubble => {
  console.log("Bubble click:", bubble);
})
7obias commented 5 years ago

@pietrofxq Similar issue here I cannot sort this out neither. I want to drop in a custom popupTemplate on bubbles in the none angularjs version this is part of the second parameter to the datamap.bubbles(data, { ... }) method call. Any chance you sorted out how to do this?