Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

The popup in Choropleth doesn't work #22

Closed
ackuser opened this issue Jul 4, 2016 · 10 comments
Closed

The popup in Choropleth doesn't work #22

ackuser opened this issue Jul 4, 2016 · 10 comments

Comments

@ackuser
Copy link

ackuser commented Jul 4, 2016

In dc.leaflet version 0.2.3 for the Choropleth Chart the popup doesn't work or it doesn't get rendered. Am I wrong or it happens to anybody else? I will be happy to fix that but I would need some help.

      .renderPopup(true)
      .popup(function(d,feature) {
        return feature.properties.name+" : "+d.value;
      });

Anyway, any help would be really appreciated

@msimonin
Copy link

msimonin commented May 6, 2020

Hi @ackuser,

The same here !

@gordonwoodhull
Copy link

Doesn't appear to work for the marker chart either. It looks like it's set up correctly but I don't know, maybe the clicks are getting through or something.

@msimonin
Copy link

msimonin commented May 7, 2020

image
Popups seem ok with ClusterMarkers

@msimonin
Copy link

msimonin commented May 7, 2020

Ok I made a quick test: setting brushOn(false) on the chart makes the popup appears.
Setting both onClick event and the bindPopup on the layers seems to an issue (leaflet issue ?)

@gordonwoodhull
Copy link

Thanks for testing. I dug into it a little more, and it looks like the event handling is fine, but the issue is that brushOn will cause filtering, which causes a redraw of the map. Redrawing erases the popup.

On the demo page, it looks like there is a similar issue with the cluster marker: clicking a cluster causes zooming, which erases the popup. The popup works on a non-cluster (fully expanded) marker.

Do you want to filter and show the popup at the same time?

@gordonwoodhull
Copy link

I haven't looked into how to implement this, but I suppose one or the other action could be triggered only when a modifier key is pressed.

@msimonin
Copy link

Hi @gordonwoodhull ,
That would be great to trigger one or another action with a modifier key :)
In the time being wouldn't it be possible to bind a key event on the markers to show the popup and keep the click event for the filtering as it is ?

@gordonwoodhull
Copy link

I don’t understand the distinction. Either way you are enabling or disabling one of the actions based on what keys are pressed, right?

@gordonwoodhull
Copy link

Okay, I implemented .popupMod() and .filterMod() for the marker chart and choropleth in version 0.5.1.

@msimonin, please check if the documentation on LeafletBase is sufficient, and leave a comment here if it needs more explanation or doesn't work.

I changed the demo to display popups only when the control key (command key on Macs) is pressed.

@msimonin
Copy link

I just tested and it's perfect !
Thanks a lot @gordonwoodhull :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants