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

No means to make bubbles clickable? #388

Open chandi1703 opened 7 years ago

chandi1703 commented 7 years ago

Hi! I really love datamaps. Thanks! I somehow did not find any means to make bubbles clickable. Is there a way to do it? Maybe as a clickTemplate similar to popupTemplate?

ckhickey commented 7 years ago

Wondering about this as well.

Aeolun commented 7 years ago

Modifying the code is relatively simple, I added my own click event handler after the other event handlers, of course, that precludes updates, so maybe I should submit that as a merge request:

.on('click', function (datum) {
  var $this = d3.select(this);

  if (options.click) {
    options.click($this, datum);
  }
})