I am getting this problem (see the plots at the bottom) when I run the script below
holoviews version 1.19.1
panel version 1.5.2
# %%
import numpy as np
import pandas as pd
import hvplot.pandas
import holoviews as hv
from holoviews import opts, dim, streams
hv.extension("bokeh")
# %%
# create a time series of a sinusoidal wave
n = 100
step = 0.1
time = pd.date_range("2020-01-01", periods=n / step, freq="h")
amplitude = np.sin(np.arange(0, n, 0.1))
dfsine = pd.DataFrame({"time": time, "amplitude": amplitude})
amplitude = np.cos(np.arange(0, n, 0.1))
dfcosine = pd.DataFrame({"time": time, "amplitude": amplitude})
# %%
tsplot = dfcosine.hvplot(x="time") * dfsine.hvplot(x="time")
tsplot = tsplot.opts(opts.Curve(height=300, width=500))
# %%
kdeplot = dfcosine.hvplot.kde(y="amplitude") * dfsine.hvplot.kde(y="amplitude")
kdeplot = kdeplot.opts(shared_axes=False).opts(opts.Distribution(height=200, width=300))
kkplot = kdeplot + kdeplot
# %%
import panel as pn
pn.extension()
# %%
pn.Row(pn.Column(pn.Row(tsplot), pn.Row(kkplot)))
# %%
pn.Row(pn.Row(pn.Column(pn.Row(tsplot), pn.Row(kkplot))))
# %%
The output from the last two cells is
and
Any idea whats going on here?
I tried .redim.label
and setting linked_axes=False
to no avail.
However, I noticed if you removed Panel completely, it works!
So I slowly started removing panel calls, and found out nested Row calls caused the issue:
# %%
import numpy as np
import pandas as pd
import hvplot.pandas
import holoviews as hv
from holoviews import opts, dim, streams
hv.extension("bokeh")
# %%
# create a time series of a sinusoidal wave
n = 100
step = 0.1
time = pd.date_range("2020-01-01", periods=n / step, freq="h")
amplitude = np.sin(np.arange(0, n, 0.1))
dfsine = pd.DataFrame({"time": time, "amplitude": amplitude})
amplitude = np.cos(np.arange(0, n, 0.1))
dfcosine = pd.DataFrame({"time": time, "amplitude": amplitude})
# %%
tsplot = dfcosine.hvplot(x="time") * dfsine.hvplot(x="time")
tsplot = tsplot.opts(opts.Curve(height=300, width=500))
# %%
kdeplot = dfcosine.hvplot.kde(y="amplitude") * dfsine.hvplot.kde(y="amplitude")
kdeplot = kdeplot.opts(shared_axes=False).opts(opts.Distribution(height=200, width=300))
kkplot = kdeplot + kdeplot
# %%
import panel as pn
pn.Row(pn.Column(pn.Row(tsplot), pn.Row(kkplot))).show()
# %%
If you drop one layer of Row
it should show as expected; not sure why.
@ahuang11 Thanks for the investigation. However I can’t be sure that the user will not embed inside another UI pane. That’s where it’s causing this issue
Also doesn’t happens if I have only a holoviews overlay but only if I have a holoviews overlay and holoviews layout together within the same layout !!
Would like to know if I should open this as a panel bug or holoviews bug ?
Looks like it is the same issue here
opened 10:25AM - 18 Aug 23 UTC
type: bug
I wasn't quite sure how to title this bug report or if it is a Panel or Holoview… s bug. Just let me know if I should move this somewhere else.
#### ALL software version info
holoviews = 1.17.1
panel = 1.2.1
python = 3.11.4
bokeh = 3.2.2
OS = macOS Ventura 13.5
browser = Firefox latest, but also confirmed in JupyterLab app
#### Description of expected behavior and the observed behavior
With the Bokeh backend, I expect to see a holoviews layout correctly rendered in a column with other plots. Instead, the plots inside the holoviews layout have zero size.
#### Complete, minimal, self-contained example code that reproduces the issue
``` python
import holoviews as hv
import panel as pn
pn.extension()
def fun(factor):
return pn.Column(
hv.Curve([1,2]) + hv.Curve([1,2]),
hv.Curve([1*factor,2*factor])
)
slider = pn.widgets.FloatSlider(name="factor", range=(1.0, 1.5))
interactive = pn.bind(fun, slider)
pn.Column( interactive, slider ).servable()
```
#### Stack traceback and/or browser JavaScript console output
None
#### Screenshots or screencasts of the bug in action
<img width="610" alt="Screenshot 2023-08-18 at 20 21 35" src="https://github.com/holoviz/holoviews/assets/782987/17d918e5-d49b-4bd0-9dbe-c8648da4cddd">
Infact if in the github issue if the holoviews layout is replaced with a holoviews plot it is fine. Continuing discussion there