ipywidgets
ipywidgets copied to clipboard
Feature suggestion: full-screen mode for widgets
As suggested here: https://github.com/jupyter-widgets/ipywidgets/issues/1063#issuecomment-422946416
In the web browser environment it's possible to expand particular content to "full screen" mode https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API
An example would be YouTube video player.
I'm thinking for complicated plots etc it can be nice to 'go fullscreen'.
This could also be useful for code cells which generate a whole UI, you might want to tweak some settings from the regular notebook view, then 'launch' it and interact with the result.
Something similar to what is presented in this talk? (in terms of behavior)
https://youtu.be/1XTMkcrVyQg?t=4m38s
yes, exactly that!
This is a fantastic idea and I found myself wishing it already existed today. If I knew more I'd try to help with it.
We can hack. Here is an example of fullscreen mode in nglview
.

code
import nglview as nv
from ipywidgets import *
v = nv.demo()
b = v.player._display()
b.layout.width = '400px'
b.layout.align_self = 'flex-start'
bb = HBox([v, b])
_ = bb.add_class('nglview-f')
def on_display(self):
v._execute_js_code("""
var ele = document.getElementsByClassName("nglview-f")[0];
console.log(ele);
this.stage.viewer.container.style.height = window.screen.height + 'px'
console.log(window.innerHeight)
this.stage.toggleFullscreen(ele);
""")
bb.on_displayed(on_display)
bb
... but official support would be super awesome.
hi all, just for fun: I've made a super tiny package fullscreen
to make an ipywidgets's widget fullscreen (while waiting for something similar in ipywidgets)
git: https://github.com/hainm/fullscreen
notebook: https://nbviewer.jupyter.org/github/hainm/fullscreen/blob/v0.0.1/notebooks/many_packages.ipynb
gif:
@hainm Do you think we could easily push this in ipywidgets core?
This feature would be super nice in most custom interactive widgets libraries (ipywebrtc, ipyleaflet, nglview, itkwidgets, ipyvolume .....)
Or maybe this could more generally be a Jupyter Notebook/JupyterLab feature (a small button next to the cell output just like in the video @jtpio posted)
Or maybe this could more generally be a Jupyter Notebook/JupyterLab feature (a small button next to the cell output just like in the video @jtpio posted)
A JLab extension that would add a fullscreen button to an output cell would be interesting to see as a third-party extension. This would also have the benefit to work with output cells in general, not just widgets.
hi @martinRenou I think it would be great in both cases (a button and an API). I suggest to add an API for fullscreen too because many widgets do not automatically resize in fullscreen mode, so we need to pass a "signal" to them.
We already have phosphor resize signals being sent to widgets when they should resize themselves. Are phosphor resize signals sent when things are fullscreened? If not, we may need to manually send them.
Was anyone able to figure out how the functionality seen in the link to the video shared by @jtpio can be achieved?
Hi there, has there been any feature added in ipywidgets in order to achieve the full screen mode? My aim would be to open an Output widget instance a new browser window and set it to full screen mode.