python-visualization / branca

This library is a spinoff from folium, that would host the non-map-specific features.
https://python-visualization.github.io/branca/
MIT License
111 stars 63 forks source link

Add message to trust notebook #75

Closed Conengmo closed 4 years ago

Conengmo commented 4 years ago

Close https://github.com/python-visualization/folium/issues/1277

For Jupyter Notebooks we no longer store the data in the src attribute, but load it with Javascript on page load (see #66). This works fine, but requires Javascript to be enabled. Jupyter doesn't run Javascript on notebooks the user didn't run themselves or didn't trust explicitly. This means maps won't show if you open a notebook you got from the internet.

If a user executes a cell the map will show. A user can also trust the notebook, which will load the map.

This PR adds a message underneath the map that prompts the user to trust the notebook. If the map loads it will be placed on top of the message.

Notebook is not trusted, map doesn't load, message shows: image

Notebook is trusted, map loads: image

Conengmo commented 4 years ago

Thanks for the review! Travis failing is just because a line is too long, I'll fix that.

MSeal commented 4 years ago

:smile: