Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Folium map fail to render in notebook on github

I try to upload my work to github with a folium map in python, but it fails to render the map as it should be on my PC.

Here is folium map shows on my PC:

enter image description here

Here is what I have on github, same notebook file:

enter image description here

Thanks

like image 342
user135633 Avatar asked Oct 12 '25 04:10

user135633


1 Answers

Quoting from github help:

When you add Jupyter Notebook or IPython Notebook files with a .ipynb extension on GitHub, they will render as static HTML files in your repository. The interactive features of the notebook, such as custom JavaScript plots, will not work in your repository on GitHub.

So, in short, interactive features of Jupyter notebooks like the folium maps won't be rendered when you add them in a github repository.

As a workaround, you can use nbviewer as mentioned here. You just need to put the github link of your notebook in nbviewer and all your maps will be rendered there as they would normally be in a jupyter notebook.

like image 54
Imtiaj Sreejon Avatar answered Oct 14 '25 16:10

Imtiaj Sreejon