sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 217 forks source link

jupyter ipywidgets - standard widgets that don't work right #3789

Closed williamstein closed 4 months ago

williamstein commented 5 years ago

image

(there is no output -- using the datepicker isn't resulting in it properly propagating state to the backend.)

versus

image

DrXyzzy commented 5 years ago
cocalc-button

versus

classic-button

This is due to a deprecation and is evidently "intended behavior", matching JupyterLab: https://github.com/jupyter-widgets/ipywidgets/issues/2380

DrXyzzy commented 5 years ago

CoCalc with Chrome (native color picker pops up when you click the color swatch):

chrome-color-picker

CoCalc with Safari:

cocalc-color-picker

Classical Jupyter with Safari:

classic-color-picker

[ws] For what it is worth, DatePicker does work with mobile safari.

DrXyzzy commented 5 years ago
DrXyzzy commented 5 years ago

CoCalc:

cocalc-box

Classical:

classic-box

haraldschilly commented 5 years ago

I found a fun one, that's the example in the event chapter, about linking widgets and setting continuous update. This breaks with two open notebooks, and is clearly a sign of the sync mechanism fighting back whatever delay mechanism is happening (I think the second slider is debounced in some way). The way to trigger it is to move the second slider. The gif below looks less dramatic than in reality due to dropped frames. The jitter is maybe 5 to 10 movements per second...

import ipywidgets as widgets

a = widgets.IntSlider(description="Delayed", continuous_update=False)
b = widgets.IntText(description="Delayed", continuous_update=False)
c = widgets.IntSlider(description="Continuous", continuous_update=True)
d = widgets.IntText(description="Continuous", continuous_update=True)

widgets.link((a, 'value'), (b, 'value'))
widgets.link((a, 'value'), (c, 'value'))
widgets.link((a, 'value'), (d, 'value'))
widgets.VBox([a,b,c,d])

cocalc-ipywidgets-continuous-upgrade-issue

ruhanprasad commented 5 years ago

Layout of Box widgets cannot be changed. Box widgets with default parameters work, but changing their Layout (i.e. height, width, etc.) is not interpreted in Cocalc. This issue is not present with most other widgets such as Buttons, sliders, and text boxes. I have attached screenshots showing how the ipywidgets should work in classic JupyterLab and how they appear in Cocalc. The kernel that was used in Cocalc was Python 3 (Anaconda5).

Working widgets in JupyterLab:

Screen Shot 2019-08-01 at 10 15 24 PM

Widgets in Cocalc:

Screen Shot 2019-08-01 at 10 14 54 PM

As you can see, the resizing and border of the Box widgets are not rendered in Cocalc. However, it works normally with the Button, IntSlider, and Textarea.

williamstein commented 4 months ago

I found a fun one, that's the example in the event chapter, about linking widgets and setting continuous update.

This one works fine now.

Also we now literally use exactly the latest upstream Lumino/ipywidgets renders for rendering absolutely everything, instead of custom ones I wrote. This fixes all these bugs, except possibly anything caused by some weird CSS issues (I'm not aware of anything left that I didn't already fix). Closing this.