Interactively set max_samples when decimating in holoviews

I’m trying to build an interactive in-browser visualization for a dataset (time series shown as hv.Points) where the user would be able to use a slider to select the maximum number of samples shown when using holoviews.operation.decimate.

holoviews.operation.decimate returns a DynamicMap, which I wasn’t able to nest into another DynamicMap or HoloMap (I tried setting kdims=['max_samples'] in the parent container, but to no avail - I get an exception which seems to be caused by the fact that element_type is set to None for DynamicMap objects). I also tried setting the kdims through opts and setting the attribute directly after creation, but it didn’t work either.

I asked the same question on stackoverflow, but didn’t get any answer there either