holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.42k stars 484 forks source link

HTML pane linked to ColorPicker widget does not respond live #1462

Closed mycarta closed 1 year ago

mycarta commented 4 years ago

ALL software version info

Machine: Mac OS 10.14.6 Browser: behaviour experienced with Jupyter Notebook using both Firefox and Chrome

These are the relevant packages in my current holoviz-tutorial environment:

Name Version Build Channel

bokeh 2.0.2 py37_0 ipykernel 5.1.4 py37h39e3cac_0 jupyter_client 6.1.3 py_0 jupyter_core 4.6.3 py37_0 panel 0.9.5 py_0 pyviz python 3.7.7 hf48f09d_4

The full environment is posted here.

Description of expected behavior and the observed behavior

As per Holoviz Discourse post:

I am comparing the behaviour in my notebook against @jbednar 's video tutorials from Scipy 2019, where the HTML pane linked to ColorPicker widget is demonstrated in here. Since the current 03_Interlinked_Panels tutorial has a RangeSlider example instead of the ColorPicker, I’ve just typed-up the example from the video in my notebook. It is copied below.

However, while in his demonstration the HTML pane updates on the fly as he moves around the picker, in my case it does not: it is only updated when I close the picker, see animated GIF below.

Complete, minimal, self-contained example code that reproduces the issue


    import panel as pn
    pn.extension()

    color_picker = pn.widgets.ColorPicker(value=’#ff0000’)
    color_picker

    html = pn.pane.HTML(’’, width=200, height=200, background=color_picker.value)
    color_picker.link(html, value=‘background’)
    html

Stack traceback and/or browser JavaScript console output

I am not sure if it is related but I get this warning in the terminal: IPKernelApp] WARNING | No such comm: hv-extension-comm

Screenshots or screencasts of the bug in action

ColorPicker

xavArtley commented 4 years ago

The actual behavior seems the one intended. The previous behavior for me was a bug of the webbrowser the event connected is change: https://github.com/bokeh/bokeh/blob/a68a6f8a3891fd669db7b954c3a5313d6b571012/bokehjs/src/lib/models/widgets/color_picker.ts#L28 From https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/color :

The change event is fired when the user dismisses the color picker

philippjfr commented 3 years ago

Thanks @xavArtley, I think we should replace the example in the user guide in that case.

philippjfr commented 1 year ago

The tutorial has been overhauled since and the behavior is indeed intended. If we want to argue to change the behavior that should be done in bokeh.