15

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?

Jason Sundram
  • 11,598
  • 19
  • 69
  • 86
Ned Yoxall
  • 611
  • 1
  • 4
  • 16
  • 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 Feb 24 '16 at 09: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](http://stackoverflow.com/questions/40554839/pop-out-expand-jupyter-cell-to-new-browser-window/40855214#40855214), but I am not sure about plotted maps... – Martin Nov 30 '16 at 01:17

3 Answers3

12

Try this:

    from IPython.core.display import display, HTML
    display(HTML("<style>.container { width:100% !important; }</style>"))
6

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.

scottlittle
  • 15,865
  • 5
  • 45
  • 66
0

Click F11, to view the Jupyter Notebook in Full Screen Mode. Click F11 once more, to come out of Full Screen Mode.

Suraj Rao
  • 28,850
  • 10
  • 94
  • 99
Aman Burnwal
  • 11
  • 1
  • 2