I’d like to serve panel objects, including holoviews graphs, with Voila, following instructions in the deployment guide. However, HoloMap/DynamicMap widgets seem to lose their interactivity when I do so.
To front load the MRE, this works fine in JupyterLab (I get an interactive dmap with widgets):
import panel as pn import numpy as np import pandas as pd import holoviews as hv import hvplot.pandas df = pd.DataFrame(np.random.rand(300).reshape((100,3)), columns=['a','b','c']) df['c'] = df['c'] > 0.5 pn.ipywidget(df.hvplot.line(groupby='c'))
The JupyterLab Voila preview as well as the Voila command also display this fine, but the widgets no longer update the plot. I’m not seeing any errors Python-side that would indicate problems. Same deal if I try
My env was pretty clean - a fresh Python 3.7 conda env on Ubuntu in which I installed jupyterlab, hvplot, voila, and jupyter_bokeh from conda-forge. According to
jupyter labextension list this gave me:
JupyterLab v3.0.16 /home/jokasinski/miniconda3/envs/voila/share/jupyter/labextensions @bokeh/jupyter_bokeh v3.0.0 enabled OK (python, jupyter_bokeh) @voila-dashboards/jupyterlab-preview v2.0.2 enabled OK (python, voila) @pyviz/jupyterlab_pyviz v2.0.1 enabled OK (python, pyviz_comms) @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)
Which should be okay, if I understand the docs.
I tried installing jupyter_bokeh from bokeh instead of conda-forge, but then that example stopped working in the notebook. I tried to install everything (including nodejs) from bokeh instead, and then run the
labextension commands in the panel documentation, but it fails to build jupyter_bokeh - looks like it can’t find a
There are other permutations I could try, but unless I misunderstand I think this contradicts the Panel documentation and is a bug. However, there are a lot of moving parts I haven’t chased down yet, so the real problem could be elsewhere.
Am I not installing these packages properly/have bad version combinations? Is this functionality intended to be supported? Let me know if there’s any other info I can provide - any help would be greatly appreciated. Thanks!