Apologies if there is already a way to do this, but I ran into a stumbling block when attempting to add a RadioBoxGroup widget as a Param input for an interactive plot.
Below is a toy example just to reflect my imagined RadioBoxGroup syntax
class Example(param.Parameterized):
radio_group = param.RadioBoxGroup(default='Biology', objects=['Biology', 'Chemistry', 'Physics'], inline=False)
@param.depends("radio_group")
def view(self):
return self.radio_group
example = Example()
pn.Column(example.param, example.view)
You can do this now:
class Example(param.Parameterized):
radio_group = param.ObjectSelector(default='Biology', objects=['Biology', 'Chemistry', 'Physics'])
@param.depends("radio_group")
def view(self):
return self.radio_group
example = Example()
pn.Row(pn.panel(example.param, widgets={'radio_group': pn.widgets.RadioBoxGroup}), example.view)
Let me know if you have a suggestion for making this clearer in the docs.
Oh awesome, yep that did the trick. Thanks!
At the risk of cluttering the page I'd suggest adding this (or similar) example to the Parameters user guide
Ah, I actually thought that page already an example of this pattern, it should definitely be documented there.
Cool, thanks for your quick reply!
Most helpful comment
You can do this now:
Let me know if you have a suggestion for making this clearer in the docs.