I'm doing a bit of choropleth map plotting in a Jupyter notebook (with Folium), and I was just wondering if there's any way of making an output cell fullscreen? It would just make the map a bit easier to view. If not, is there an easy way of modifying the maximum height of an output cell?
-
I think you best bet would be to use a custom jinja2 template and a function that will create the map and a link in the notebook to an html document created with the custom jinja2 template. The jinja2 template could have a 100% width and height map.kikocorreoso– kikocorreoso2016-02-24 09:48:02 +00:00Commented Feb 24, 2016 at 9:48
-
You could try to capture the output (plots, maps, table, number, ...) in python, convert it to HTML code, and write it to a new window using javascript. This strategy works like a charm for Pandas dataframe tables, but I am not sure about plotted maps...Martin– Martin2016-11-30 01:17:36 +00:00Commented Nov 30, 2016 at 1:17
5 Answers
Try this:
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
1 Comment
from IPython.display import display, HTML.I wrote a Jupyter extension that let's a cell go fullscreen here. Installation instructions are on this Github page.
The heart of the extension is just making a selected element (a Jupyter cell) go fullscreen with this code:
function toggleFullscreen(elem) { //function to make element (cell) fullscreen on most browsers
elem = elem || document.documentElement;
if (!document.fullscreenElement && !document.mozFullScreenElement &&
!document.webkitFullscreenElement && !document.msFullscreenElement) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
}
Please see the Github page for the entirety of the code.
Comments
I'm currently using Chrome, I figured out that just click
F12 -> F11 -> F12
and then you get full screen mode. Click F11 if you want to get out of the full screen mode. I believe this method works because when you press F12, you access DevTool mode, where the F11 key is operational.
While this approach doesn't inherently extend the width of the cell, it does facilitate activating Chrome's full-screen mode. By adjusting the zoom level and selecting a suitable font size, you can create the illusion that the cell occupies the entire screen, enhancing its visual integration.
Comments
IPython.core.display is deprecated since IPython 7.14
from IPython.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))