Get a different (non default) widget when using param in parameterized class (holoviz param panel)

前端 未结 1 1861
梦如初夏
梦如初夏 2021-01-23 22:07

I use a parameterized class to build my Panel dashboard.

I would like to use a CrossSelector but this selector does not seem to be available when looking at the opt

相关标签:
1条回答
  • 2021-01-23 22:29

    Param has a default widget for every Selector, but you can change this.

    You can override this default widget as follows to get the CrossSelector in your example by using pn.Param():

    pn.Row(pn.Param(
        valve_explorer.param['selected_features'], 
        widgets={'selected_features': pn.widgets.CrossSelector}
    ))
    


    A similar solution found on SO is using pn.panel():

    pn.Row(pn.panel(
        valve_explorer.param['selected_features'], 
        widgets={'selected_features': pn.widgets.CrossSelector}
    ))
    


    See more documentation on using Param with Panel here:
    https://panel.pyviz.org/user_guide/Param.html

    0 讨论(0)
提交回复
热议问题