ipywidgets

How can I use Asynchronous Widgets on jupyter lab?

冷暖自知 提交于 2021-02-07 13:12:47
问题 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 jupyter/datascience-notebook start-notebook.sh --NotebookApp.token='' firefox 0.0.0.0:8888 create a new python3 notebook create a cell and enter the code below run cell move slider code for the cell %gui asyncio import asyncio def wait_for_change(widget,

How can I use Asynchronous Widgets on jupyter lab?

百般思念 提交于 2021-02-07 13:10:37
问题 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 jupyter/datascience-notebook start-notebook.sh --NotebookApp.token='' firefox 0.0.0.0:8888 create a new python3 notebook create a cell and enter the code below run cell move slider code for the cell %gui asyncio import asyncio def wait_for_change(widget,

horizontal alignment of options in ipywidgets

自古美人都是妖i 提交于 2021-01-29 21:37:22
问题 How to align items horizontally in multi-select menu? Currently this gives me a vertical alignment of options: widgets.SelectMultiple(options=['option-1','option-2', 'option-3', 'option-4', 'option-5'], rows=5, layout=widgets.Layout(width='440px')) I am looking for a way to align all the options in a single row. 来源: https://stackoverflow.com/questions/58235440/horizontal-alignment-of-options-in-ipywidgets

How to tell `ipywidgets.interactive`, that it should consider only specific parameters as widgets?

99封情书 提交于 2021-01-28 09:19:03
问题 It seems like ipywidgets.interactive tries to make every imput after the function to be a widget. In the following example, I get two widgets, one for age and one for name : import ipywidgets def greetings(age, name='John'): print(f'{name} is {age} years old') ipywidgets.interactive(greetings, age = widgets.IntSlider(), name = "Bob") My expectation was, that I only get one widget for age , since it is of type ipywidgets.widgets.widget_int.IntSlider whereas "Bob" is of type str (where I don't

Slow matplotlib and ipywidgets image refresh

若如初见. 提交于 2021-01-07 01:30:14
问题 I'm trying to scroll through some magnetic resonance slices using plt.show() and ipywidgets interact() function. I've found no problem by slowly moving the slider, but an important delay is found when sliding through the slices a little bit faster. Here below is the code I'm using. def dicom_animation(x, volume): fig = plt.figure(figsize=(8,8)) plt.imshow(volume['slices'][x]['pixel_array'], cmap=plt.cm.gray) interact(dicom_animation, volume = fixed(a), x=IntSlider(round(len(a['slices'])/2,0),

Slow matplotlib and ipywidgets image refresh

我只是一个虾纸丫 提交于 2021-01-07 01:29:04
问题 I'm trying to scroll through some magnetic resonance slices using plt.show() and ipywidgets interact() function. I've found no problem by slowly moving the slider, but an important delay is found when sliding through the slices a little bit faster. Here below is the code I'm using. def dicom_animation(x, volume): fig = plt.figure(figsize=(8,8)) plt.imshow(volume['slices'][x]['pixel_array'], cmap=plt.cm.gray) interact(dicom_animation, volume = fixed(a), x=IntSlider(round(len(a['slices'])/2,0),

Monospace in ipywidgets.Textarea?

不想你离开。 提交于 2020-12-15 06:23:09
问题 how could I get my widgets to use monospace fonts? from ipywidgets import Textarea Textarea('The world is bigger than you.') I want to show some table style data. 回答1: This may be a brittle solution, but it seems to work. Add a html magic section giving the css styling: %%html <style> textarea, input { font-family: monospace; } </style> 回答2: This also works: from IPython.display import display from IPython.core.display import HTML display(HTML("<style>textarea, input { font-family: monospace;

Problem displaying widgets / ipywidgets install unsuccessful

落爺英雄遲暮 提交于 2020-07-20 03:48:24
问题 I'm implementing widgets in my jupyter notebook (via anaconda). I tried first by using an old code from a professor of mine, but it's not displaying widgets. I tried installing: jupyter labextension install @jupyter-widgets/jupyterlab-manager But it was unsuccessful This was presented when I attempted installation of the package via windows command prompt: C:\Users\davio>jupyter labextension install @jupyter-widgets/jupyterlab-manager Traceback (most recent call last): File "C:\Users\davio

Problem displaying widgets / ipywidgets install unsuccessful

安稳与你 提交于 2020-07-20 03:48:04
问题 I'm implementing widgets in my jupyter notebook (via anaconda). I tried first by using an old code from a professor of mine, but it's not displaying widgets. I tried installing: jupyter labextension install @jupyter-widgets/jupyterlab-manager But it was unsuccessful This was presented when I attempted installation of the package via windows command prompt: C:\Users\davio>jupyter labextension install @jupyter-widgets/jupyterlab-manager Traceback (most recent call last): File "C:\Users\davio