Drilling down to the individual options of a composed hvplot

I want to control the alpha and visibitlity of an NDOverlay composed of n rasterized quadmeshes, i.e. :

class Example(param.Parametrized):
    ...
    @pn.depends('alpha_slider_1.value', watch=True)
    def update_quadmesh_1():
        self.hvplot_out.Image.I.opts(alpha=self.alpha_slider_1.value)
    
    @pn.depends('alpha_slider_1.value', watch=True)
    def view():
        self.hvplot_out = self.quadmesh_1 * self.quadmesh_2 ....

My problem is that even though some of the documentation mentions how to drill down in an explicit Holoviews object it seems when I create rasterized composed hvplot object I lose access to the accessors. How would I drill down to a specific “layer” of the composed hvplot quadmesh to modify their specific options?

When debugging, I recommend trying to come up with a minimal reproducible example. It’s much faster to iterate on and others can just copy/paste to reproduce the issue (if any)!

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

alpha_slider = pn.widgets.FloatSlider(name='Alpha', start=0, end=1, value=0.5)
ds = xr.tutorial.open_dataset("air_temperature").isel(time=0)
plot = ds.hvplot("lon", "lat", alpha=alpha_slider.param.value)

pn.Column(
    plot,
    alpha_slider
)

Also check out
Core Concepts — Panel v1.0.3 (holoviz.org) for an explanation of param.value vs value

2 Likes