Accessing throttled value in a Parameterized class


I’m wondering how to use the throttled value of a widget with a parameterized class,
or specify the throttling period when DateRange is created declaratively.

class DateRange(param.Parameterized):
     date_range = param.DateRange(...)

here, date_range does not accept a callback_throttle keyword like the DateRange widget does.

Furthermore, how should I use @pn.depends(...) decorator for a function that should respond to the throttled value?


There’s currently not a great approach here but there’s already an issue about this you could track (or contribute to):

Thanks @philippjfr, and sorry for the delayed reply. I think I’ll just use explicit
widget instances for now.

I’m having the exact same issue…
@JoyMonteiro Would you mind sharing your workaround for this?
@philippjfr In the Issue you mention, it seems to me that a solution for panel.depends is suggested, but will that also help for the param.depends decorator?

@marfel sorry for the delayed reply.

I essentially created a class attribute initialized to None. In the object init, I assign an
explicit widget

class WordCloud(param.Parameterized):
    the word cloud app

    wordcloud_date_range = None

    def __init__(self):

        self.wordcloud_date_range = pnw.DateRangeSlider(
            name='Choose time period',
            value_throttled=(DATA_STORE.start_time, DATA_STORE.end_time),


and then use this in the decorator

    def create_wordcloud(self):

Ahh, I see. So despite this being a parameterized class, you’re not using the param magic but panel's dependency handling. And why not? Thank you!