Questions tagged [ipywidgets]

IPython widgets for the Jupyter Notebook

Read the docs

ipywidgets on github

973 questions
14
votes
1 answer

using ipywidgets in jupyter notebook: how to set focus?

Is it possible to give a jupyter notebook widget the focus? I can't see documentation or hints in the code about this?
Tim Richardson
  • 6,608
  • 6
  • 44
  • 71
12
votes
1 answer

Make Matplotlib widget background color match dark theme in Visual Studio Code

If I use a dark theme in Visual Studio Code and in Matplotlib, the figure can be configured to have dark background, but the background of the widget / cell is still white. %matplotlib widget import matplotlib.pyplot as plt import numpy as…
12
votes
3 answers

how to fix - error: bad escape \u at position 0

Hello I'm trying to export a gmap html using ipywidgets in jupyter notebook but am encountering the following error: - error: bad escape \u at position 0. I'm new to programing and could use help fixing whatever is causing this error to occur. If…
Rusty Leonard
  • 131
  • 1
  • 1
  • 5
12
votes
3 answers

ipywidgets, how to change slider's value display precision

In jupyter,I have the following code to create a slider control for my variable r using ipywidgets. from ipywidgets import interact, interactive, fixed, interact_manual import ipywidgets as widgets r = 0.9992 def sl(r=0.9992): global ar ar…
J_yang
  • 2,672
  • 8
  • 32
  • 61
12
votes
4 answers

How to make an ipywidgets Image clickable?

I would like to make an Image instance in a jupyter notebook to respond to click events - how can we do this? I also want to be able to identify the image that was clicked. It is simple to do so with buttons but not with images.
Dror Hilman
  • 6,837
  • 9
  • 39
  • 56
11
votes
2 answers

How to increase slider length in ipywidgets

Suppose, I have the following code: from ipywidgets import interact, interactive import ipywidgets as widgets def f(x): return x interact(f, x=(0,10,1)); The resulting interactive slider is nice but pretty small in terms of horizontal length.…
Bahauddin Omar
  • 155
  • 1
  • 8
11
votes
3 answers

How to download a file using ipywidget button?

I build a ipywidget button. I hope that when the button is clicked, the program do the computing, and get a result string, then user can download the string as a file. THe codes are like this: import ipywidgets as widgets download_button =…
loopy
  • 441
  • 3
  • 8
11
votes
4 answers

Clear widget area of a cell in a Jupyter notebook from within notebook

I'm wondering if it's possible to clear the widget area of a cell in a Jupyter notebook from the notebook side (ie within Python). IPython.display.clear_output() only clears the cell's output area not the widget area. Update: this still seems to be…
nedned
  • 3,552
  • 8
  • 38
  • 41
11
votes
2 answers

graceful interrupt of while loop in ipython notebook

I'm running some data analysis in ipython notebook. A separate machine collects some data and saves them to a server folder, and my notebook scans this server periodically for new files, and analyzes them. I do this in a while loop that checks every…
wenhoo
  • 352
  • 1
  • 4
  • 14
10
votes
1 answer

How to display a pandas dataframe within a VBOX using ipywidgets

i would like to display a pandas dataframe in a interactive way using ipywidgets. So far the code gets some selections and then does some calculation. For this exmaple case, its not really using the input labels. However, my problem is when I would…
math
  • 1,868
  • 4
  • 26
  • 60
10
votes
1 answer

Output widget appears outside tab widget when using nbconvert on jupyter notebook with ipywidgets

I created a notebook which should display plots in a tab widget. As far as I understand, to include something like plots in the tab widget, I need to wrap it in the output widget. In the notebook itself it works but when I convert it to html via…
Benedikt
  • 105
  • 8
10
votes
4 answers

ipywidgets: Update one widget based on results from another

I am using widgets in IPython that allows the user to repeatedly search for a phrase and see the results (different titles) in another widget (a selection widget) and then select one of the results. In short: search_text = widgets.Text(description =…
hmelberg
  • 307
  • 1
  • 3
  • 8
9
votes
0 answers

Ipywidgets are not displayed with JavaScript error

We are currently using JupyterHub for our team. When I try to use ipywidgets in JupyterLab I get this JavaScript error (https adress is cutted out) The Code import ipywidgets as widgets slider = widgets.FloatSlider(description='$x$') text =…
Jonas
  • 187
  • 6
9
votes
2 answers

Visual Studio Code does not render ipywidgets correctly

I am having issue using Visual Studio Code. the code seem to have issue with ipywidgets. the code is below (very simple interactive chart) from ipywidgets import interact import ipywidgets as widgets import numpy as np import plotly.graph_objects…
cocojim
  • 223
  • 1
  • 2
  • 10
9
votes
2 answers

How to get mouse selected text from Jupyter text widget?

I want to capture the mouse selected text from a jupyter text widget . import ipywidgets as widgets text = widgets.Textarea( value='Hello World', description='String:', disabled=False ) display(text) In the following example when World…
Shakti
  • 2,013
  • 8
  • 27
  • 40
1
2
3
64 65