hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

xarray interactive widgets don't update text when displayed with panel

Open nitrocalcite opened this issue 4 years ago • 5 comments

If I open up a dataset

import xarray as xr
import hvplot.xarray
import panel as pn
import panel.widgets as pnw

ds = xr.tutorial.open_dataset('air_temperature').load()

and try out interactive selection

ds.interactive.sel(lat=pnw.DiscreteSlider, lon=pnw.DiscreteSlider)

everything works great! But if I try to display the same object with Panel:

pn.Row(ds.interactive.sel(lat=pnw.DiscreteSlider, lon=pnw.DiscreteSlider))

Although the view of the dataset is updated, the text above the slider never updates.

ALL software version info

hvplot 0.7.1 holoviews 1.14.3 panel 0.11.3 bokeh 2.3.2

Description of expected behavior and the observed behavior

I expect the interactive slider text to update regardless of whether it's displayed with panel

nitrocalcite avatar May 12 '21 22:05 nitrocalcite

I have the same expectation! Instead, it looks like you have to call the interactive object's layout method to get something to use with Panel:

pn.Row(ds.interactive.sel(lat=pnw.DiscreteSlider, lon=pnw.DiscreteSlider).layout())

That works, but I opened https://github.com/holoviz/panel/issues/1824 to request that Panel just figure it out. The issue was closed in https://github.com/holoviz/panel/pull/1900, but it seems like it should be reopened?

jbednar avatar May 12 '21 22:05 jbednar

I can't reproduce any issue with this.

philippjfr avatar May 21 '21 20:05 philippjfr

Nevermind, I can reproduce your issue, @jbednar is just confusing this issue with the issue he filed a while back that was fixed.

philippjfr avatar May 21 '21 20:05 philippjfr

Also probably a Panel issue.

philippjfr avatar May 22 '21 02:05 philippjfr

@philippjfr Should this issue be moved to the panel repo then?

jlstevens avatar Mar 07 '22 17:03 jlstevens