folium icon indicating copy to clipboard operation
folium copied to clipboard

TimeSliderChoropleth hides the attribution

Open jjbenes opened this issue 5 years ago • 6 comments

Problem description

See the last cell at https://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/TimeSliderChoropleth.ipynb. The attribution is supposed to be at the lower-right corner but it's hidden. (It is in HTML but the attribute layer doesn't show.)

Expected Output

Other plugins don't hide the attribution: https://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/Plugins.ipynb

Output of folium.__version__

0.10.1

jjbenes avatar Apr 19 '20 22:04 jjbenes

I do see an attribution on that timeslider choropleth notebook, but only for Leaflet:

image

Do you see the same thing? Do you mean the issue is we're not seeing tilelayer attribution?

Conengmo avatar Apr 20 '20 07:04 Conengmo

I don't see the attribution in the last cell here using a Chrome browser: Screen Shot 2020-04-20 at 12 48 50 AM As you can see, the lower-right corner is all dark.

I was expecting to see an attribution like this: Screen Shot 2020-04-20 at 12 57 05 AM Not sure whether that's what you mean by a tile-layer attribution.

Once I call up a time slider choropleth, I don't see this attribution anymore. It's in the HTML but not visible. I wonder whether the time slider pushes the whole tile down and the browser clips the bottom of the map, including the attribution.

jjbenes avatar Apr 20 '20 08:04 jjbenes

I was able to replicate what you saw but I'm not sure how. For some reason, the time slider disappears on nbviewer and now I can see the attribution that you saw. Your screenshot shows only the attribution but did you also see the time slider on top? Here's a screenshot of what I saw. Seems that we can either see the attribution or the time slider but never both at the same time, consistent with the hypothesis that the time slider somehow pushes the attribution out of view. Screen Shot 2020-04-20 at 12 35 48 PM

jjbenes avatar Apr 20 '20 19:04 jjbenes

Spoke too soon about not knowing how to replicate what you saw. Turns out searching for "attribute" in the console forces the attribute to show up at the bottom-right corner, which in turn pushes the time slider above out of view.

jjbenes avatar Apr 20 '20 19:04 jjbenes

My best guess is that it's because we set the map to fill 100% of the height of it's parent div. Then we also add in the timeslider, causing the whole thing to stretch out further.

On the example notebook I get a vertical scrollbar in the last output with the map. If I change the css on the map element (#map_dkjflsdk etc) from height: 100% to height: 80% the whole output does fit.

To fix this, I think we should look into the extra title and slider we add in TimeSliderChoropleth, not how Map behaves, because changing Map is more risky.

But maybe there's no way around that, and we have to change the way we set the height of Map to something like a flexbox approach.

Alternatively, maybe the timeslider could be a Leaflet control on top of the map.

Help is welcome with this!

Conengmo avatar Apr 21 '20 05:04 Conengmo

Hi,

Is this one fixed? Because I have just run the TimeSliderChropleth example notebook (after downloading it, running locally) using Chrome and the master branch of folium and I do see the full attribution at the bottom of the map, though it is the case that the slider control plus map takes up more space than is allocated to them, so you can't see the attribution unless you scroll down, but then you can't see the time slider.

image

Mark.

markhudson42 avatar Aug 23 '20 14:08 markhudson42