Questions tagged [ipywidgets]

IPython widgets for the Jupyter Notebook

Read the docs

ipywidgets on github

973 questions
4
votes
0 answers

Adding datetime to ipywidgets in jupyter notebook

I know that ipywidgets have a datepicker widget and its pretty cool. However, I'm hoping I can also pick the time for that date. I haven't been able to see in the ipywidgets documentation an option to do that. I found a library called ipydatetime,…
4
votes
2 answers

How to prevent infinite loop with two widgets that update each other?

I'm experimenting with Jupyter Widgets to see if I can make a better version of this, but apparently the observe handler triggers even when the change is not from the user, so it creates an infinite loop of one widget changing the other. Minimal…
endolith
  • 25,479
  • 34
  • 128
  • 192
4
votes
2 answers

Stop button for breaking while loop within Ipywidgets ecosystem

Let's assume the following problem: we have an Ipywidget button and a progress bar. On clicking the button, a function work() is executed, which merely fills the progress bar until completing it, then reverses the process and empties it out. As it…
AZarketa
  • 709
  • 5
  • 8
4
votes
3 answers

Implement a "reset" button when using @interact decorator in Jupyter

I'm trying to do a simple button to "reset" widgets to certain default values. I'm using the @interact decorator in Jupyter Lab environment. The problem is that the widgets identifiers have their values copied to the same identifiers used as float…
iperetta
  • 607
  • 10
  • 19
4
votes
2 answers

How to get ipywidgets interact to work in HTML?

I have a Jupyter notebook with the following cell: from ipywidgets import widgets, interact slider = widgets.IntSlider() def print_val(v): print(v) interact(print_val,v=slider) This works fine in the notebook - when I change the slider the…
soungalo
  • 1,106
  • 2
  • 19
  • 34
4
votes
1 answer

Image upload in Jupyter Notebook using ipywidgets.FileUpload()

I have been struggling to upload images into my Jupyter notebook using ipywidgets.FileUpload(), it works ok with text files but with binary files the content is always corrupted. Particularly with images, those are always stored as "data" so…
4
votes
3 answers

Display radio button horizontally using ipywidgets

I would like to display radio buttons horizontally using ipywidgets. radio_input1 = widgets.RadioButtons(options=['Option 1', 'Option 2']) But it shows the radio button vertically : One hack i was trying to put radio buttons with only one option…
SML
  • 2,172
  • 4
  • 30
  • 46
4
votes
2 answers

What is the 'icon' argument for ipywidgets.Button?

I am trying to understand how to display buttons in an jupyter notebook, but the documentation is a bis sparse on this item. It is mentioned there is an argument 'icon'. But what does it mean? What values can be used? Is there some documentation…
Alex
  • 41,580
  • 88
  • 260
  • 469
4
votes
1 answer

How to display text output from function in Panel Pyviz widgets?

This seems like a basic question but I've tried for a while and not found a solution with Pyviz Panel: I'm trying to trigger functions with a click of a button, catch the outputs of functions and print them on the screen at desired locations. The…
4
votes
1 answer

Insert checkbox in panda dataframe

I want to display a pandas dataframe in which at the begining of each row there is a Checkbox (ipywidget) to know which row the user is selecting. I have made a frist trial with a Button using the following code import pandas as pd from…
GCGM
  • 901
  • 1
  • 17
  • 38
4
votes
1 answer

Creating an interactive plot with pandas and ipywidgets, using values from dataframe column as inputs

I have a Pandas dataframe which lists a number of companies, the number of consumer complaints which they have received within the month, and the month when they were received: I am trying to create an interactive plot where all of the values under…
njrob
  • 115
  • 9
4
votes
1 answer

Exiting ipywidgets interact / interactive to produce a final output in jupyter notebook

I'd like to have an analogy to the %matplotlib notebook magic for matplotlib plots. It features a "power button" at the top right - and after clicking it, the UI disappears, and the output becomes a PNG of the final view. Suppose I have a function…
Tomasz Gandor
  • 8,235
  • 2
  • 60
  • 55
4
votes
0 answers

Is it possible to update interactive_output manually?

I want to ask is it possible to update the output manually while using interactive_output? the function I'm currently using is pretty complicated, so the output kind of lags a bit when the slider widget is used. much thanks!
Johanna
  • 41
  • 1
4
votes
2 answers

Change the alignment of the content of a Label in Ipywidget

I am using a ipywidgets.Label to display a text in a notebook. Basic question, how do I change the text alignment within the Label? It seems to be left aligned and I want it to be right aligned. I really looked for it in the docs but I cannot find…
dj K
  • 180
  • 2
  • 11
4
votes
1 answer

Pyqt5/Pyside application with Ipywidgets and Interactive figures

I’m building a GUI (pyqt or pyside) to easily create complex figures (e.g. with plotly) for users. So far so good, I run the data processing and produce plotly figures that are exported as html and read by QwebEngineView. I even created a qt widget…
Luiz Tauffer
  • 463
  • 6
  • 17