IPython widgets for the Jupyter Notebook
Questions tagged [ipywidgets]
973 questions
9
votes
2 answers
Why is my ipywidget observe being call multiple times on a single state change?
I have some code in a cell in Jupyter notebook using both a radio button and a slider. I have a method which I want called only when the selection is changed (in the case of the radio button); and only when the slider is released (in the case of the…

laurie
- 965
- 1
- 11
- 21
9
votes
3 answers
Arranging widgets in ipywidgets interactive
I have this interactive graph code using ipywidgets; but not sure how to arragne the each variable inside the interactive function in widgets. the default layout is vertical. But I want to arrange them in horizontal way.
import matplotlib.pyplot as…

Bernad Peter
- 504
- 5
- 12
9
votes
0 answers
Change date format of ipywidgets.DatePicker
How to change format of dates for DatePicker from ipywidgets? Default format is 'mm/dd/yyyy' and I want to set it to 'yyyy-mm-dd'?

Slavka
- 1,070
- 4
- 13
- 28
9
votes
1 answer
Setting background color of a box in ipywidgets
While creating a layout with ipywidgets I would like to have a HBox with a border and filled with a selected colour. The former is easy to set while the latter is a bit troublesome. I couldn't find a control option for the background fill in the…

qoqosz
- 193
- 1
- 7
9
votes
1 answer
Exporting ipywidgets to a website
I have a Python program in Jupyter Notebook that uses interact from the module ipywidgets.
interact(my_func, filter_by=filter_by_list, format_type=format_dict.keys())
I want someone to be able to open the notebook on a website somewhere and use the…

Imran
- 608
- 10
- 17
9
votes
5 answers
Uploading files using Browse Button in Jupyter and Using/Saving them
I came across this snippet for uploading files in Jupyter however I don't know how to save this file on the machine that executes the code or how to show the first 5 lines of the uploaded file. Basically I am looking for proper commands for…

Mona Jalal
- 34,860
- 64
- 239
- 408
9
votes
4 answers
How to use interactive with a Box containing widgets?
Using interactive is fairly simple with multiple widgets, for example:
interactive(foo, w1=widget1, w2=widget2, ...)
However I would like to layout these widgets in a specific manner, using combinations of VBox and HBox. Question is, how can I use…

Eric Thibodeau Laufer
- 147
- 2
- 7
9
votes
1 answer
HTML ipywidgets state is not saved with the notebook
I use ipywidgets to display asynchronous results from processes.
import ipywidgets as widgets
results = widgets.HTML()
display(results)
It works well, results appear correctly, but when the notebook is saved, the widgets are not there anymore. Is…

jamborta
- 5,130
- 6
- 35
- 55
8
votes
2 answers
Embed widgets with jupyter-cadquery (threejs): wrong position on load
I am using jupyter-cadquery to visualize some 3D models made with CadQuery.
When visualizing the models on a Jupyter notebook, everything works as expected.
But when trying to embed the widget in an HTML document, it seems the camera, on load, is…

Peque
- 13,638
- 11
- 69
- 105
8
votes
0 answers
How can Jupyter notebook widgets be made to persist when the notebook browser window is refreshed?
Jupyter widgets, like a HTML progress bar, vanish when a notebook browser window is refreshed (or when one reconnects to a notebook remotely). I'm trying to see how they might be made to persist and re-render when the window is refreshed.
Let's say…

BlandCorporation
- 1,324
- 1
- 15
- 33
8
votes
2 answers
How can I use Asynchronous Widgets on jupyter lab?
How can I use Asynchronous Widgets on jupyter lab?
I'm trying to reproduce the official Asynchronous Widgets-Example on jupyter lab, but the await never continues.
Setup / reproduction
docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes…

wotanii
- 2,470
- 20
- 38
8
votes
2 answers
Controlling figure height when using interactive plots in jupyter lab
I'm trying to use a combination of JupyterLab and the latest ipywidgets to have a basic graphic interface to explore some data. However, I cannot find a way to set up the figure height for the interactive plot
The notebook loads some file, then the…

Alessio Arena
- 390
- 2
- 8
8
votes
3 answers
Pause Jupyter Notebook widgets, waiting for user input
I have the same issue as TheInterestedOne asked here.
I need to create two buttons for the user, and suggest that the user clicks one of the two buttons in the loop; so that the next iteration of the loop occurs only after the user's choice.
I…

Любовь Пономарева
- 314
- 1
- 2
- 9
8
votes
1 answer
How to pause Jupyter Notebook widgets, waiting for user input
In my notebook I've a loop in which I want to ask the user to binary "Yes" or "No". On this choice the algorithm is suppposed to continue.
for i in range(n_total):
display.clear_output(wait=True)
waiting_for_scoring = True
print("True or…

TheInterestedOne
- 748
- 3
- 12
- 33
8
votes
3 answers
Is it actually possible to pass data (callback) from mpld3 to ipython?
There is a lot of amazing possibilities to create animated pictures using mpld3. However, it seems that all the "moving parts" are responsibility of JavaScript. Moreover, there are lots of requests on the internet and Stack Overflow where people…

Sergey Dovgal
- 614
- 6
- 21