How to update limits for DynamicMap overlays?

When we wrap an overlay around an object, the framewise/axiswise no longer works.

import holoviews as hv
import panel as pn

def plot(value):
    return hv.Overlay([hv.Curve(([0, 1, 2], [value] * 3))])
select = pn.widgets.Select(options=[0, 5, 10])
dmap = hv.DynamicMap(pn.bind(plot, select.param.value)).opts('Curve', framewise=True, axiswise=True).opts('Overlay', framewise=True, axiswise=True)
pn.Row(select, dmap)

However, if it’s no longer an overlay, it works

import holoviews as hv
import panel as pn

def plot(value):
    return hv.Curve(([0, 1, 2], [value] * 3))
select = pn.widgets.Select(options=[0, 5, 10])
dmap = hv.DynamicMap(pn.bind(plot, select.param.value)).opts('Curve', framewise=True, axiswise=True)
pn.Row(select, dmap)

Manually setting ylim works along with framewise=True

def plot(value):
    return hv.NdOverlay({'a': hv.Curve(([0, 1, 2], [value] * 3))}).opts(ylim=(0, value))
select = pn.widgets.Select(options=[0, 5, 10])
dmap = hv.DynamicMap(pn.bind(plot, select.param.value)).opts('Curve', framewise=True, axiswise=True)
pn.Row(select, dmap)
2 Likes