holoviews icon indicating copy to clipboard operation
holoviews copied to clipboard

Friction between panels `sizing_mode` and `hv.DynamicMap`

Open hoxbro opened this issue 2 years ago • 0 comments

ALL software version info

panel        0.13.1a2.post18+gc9ff0ddb
holoviews    1.14.4.post125+g9a249c598

Description of expected behavior and the observed behavior

I saw the following friction between panels sizing_mode and hv.DynamicMap. If I remove sizing_mode or DynamicMap everything works it is the combination of both which bugs out.

To get this to work I needed to add the option responsive=True to the NdOverlay, but for new users, this will properly be hard to know. Somewhat related to https://github.com/holoviz/panel/issues/2774.

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

import panel as pn
import holoviews as hv

pn.extension(sizing_mode="stretch_both")
hv.extension("bokeh")

widget = pn.widgets.MultiSelect(value=[0], options=list(range(10)), width=500)

def plots(xs):
    return hv.NdOverlay({x: hv.HLine(x) for x in sorted(xs)}).opts(ylim=(-1, 10))

iplot = hv.DynamicMap(pn.bind(plots, widget.param.value))

pn.Row(widget, iplot)

Screenshots or screencasts of the bug in action

https://user-images.githubusercontent.com/19758978/166141409-ea959b90-57f9-4d82-aee2-ec634da03a6b.mp4

hoxbro avatar May 01 '22 10:05 hoxbro