Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a popup widget in IPython

I'm trying to create a Popup widget in Jupyter as described in this vid:

from IPython.html import widgets

which gives the following warning:

ShimWarning: The IPython.html package has been deprecated. You should import from notebook instead. IPython.html.widgets has moved to ipywidgets. "IPython.html.widgets has moved to ipywidgets."

However, ipywidgets doesn't have a popup widget and there is nothing in its docs. (By the way, IPython.html.widgets doesn't have a popup widget either)

How can I create a popup widget in jupyter?


Versions:
Jupyter 1.0.0
IPython 5.1.0

like image 856
user Avatar asked Sep 24 '16 13:09

user


People also ask

What are IPython widgets?

Communication. ipywidgets, also known as jupyter-widgets or simply widgets, are interactive HTML widgets for Jupyter notebooks and the IPython kernel. Notebooks come alive when interactive widgets are used. Users gain control of their data and can visualize changes in the data.

Is Bqplot interactive?

bqplot allows anyone to build fully interactive web applications in Python, using surprisingly few lines of code.


1 Answers

Searching in IPython's repository I found that.. :

PopupWidget was removed from IPython. If you use the PopupWidget, try using a Box widget instead. If your notebook can't live without the popup functionality, subclass the Box widget (both in Python and JS) and use JQuery UI's draggable() and resizable() methods to mimic the behavior.

(emphasis mine)


Why it was removed and future plans

@jdfreder's comment in related discussion:

The popup widget is an oddball in the built-in widget collection. After talking to the others during the last dev meeting (or meeting before last, I forget which), we came to the conclusion that it is best to remove the popup widget altogether. However, the underlying API that allows one to implement the popup widget will not be removed, see PR #7341 . If we do include something like the popup widget again, it will be implemented from scratch, probably as a phosphor component (or something similar).

@Sylvain Corlay in github chat:

We are moving away from bootstrapjs widgets. For the good cause bootstrap is a bad citizen of the browser. creates global variable etc.. With jupyterlab richer layouts should be enabled.

enter image description here

like image 200
user Avatar answered Oct 03 '22 07:10

user