Skip to content

Add message to trust notebook#75

Merged
Conengmo merged 2 commits intopython-visualization:masterfrom
Conengmo:message-trust-notebook
Apr 27, 2020
Merged

Add message to trust notebook#75
Conengmo merged 2 commits intopython-visualization:masterfrom
Conengmo:message-trust-notebook

Conversation

@Conengmo
Copy link
Member

@Conengmo Conengmo commented Apr 25, 2020

Close python-visualization/folium#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

Copy link
Member

@ocefpaf ocefpaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at the Travis-CI failure later. But that may take a while...

@Conengmo
Copy link
Member Author

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

@Conengmo Conengmo merged commit 6868566 into python-visualization:master Apr 27, 2020
@Conengmo Conengmo deleted the message-trust-notebook branch April 27, 2020 15:15
@MSeal
Copy link

MSeal commented Apr 27, 2020

😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with folium rendering HTML in notebooks using papermill

3 participants