SelectPluginComponent#
- class jdaviz.core.template_mixin.SelectPluginComponent(**kwargs: Any)[source]#
Bases:
BasePluginComponent,HasTraitsPlugin select, with support for single or multi-selection.
Useful API methods/attributes:
selectedselect_all()(only ifis_multiselect)select_none()(only ifis_multiselect)
This extends BasePluginComponent for common functionality for a select/dropdown component. The subclasses MUST have an
itemstraitlet as a list of dictionaries, with ‘label’ as the selection entry (and any other optional entries for styling, etc) and aselectedstring traitlet. The subclasses should also overrideselected_objand may choose to override_selected_changed(likely with a super call to keep the base logic).Attributes Summary
An instance of a Python list.
Methods Summary
add_filter(*filters)map_value(attr, value)Map the value being set to the traitlet.
remove_filter(*filters)Select (and return) all available options.
Apply and return the default selection.
Select next entry in the choices, wrapping when reaching the end.
Select (and return) and empty list.
Apply and return the previous selection (or default option if no previous selection)
Attributes Documentation
- allow_multiselect#
- cached_properties#
- choices#
- default_mode#
- default_text#
- filters#
An instance of a Python list.
- is_multiselect#
- labels#
- manual_options#
- selected_item#
- selected_item_list#
- selected_obj#
- viewer_dicts#
- viewer_ids#
- viewer_refs#
- viewers#
Methods Documentation
- map_value(attr, value)[source]#
Map the value being set to the traitlet. This is used to handle wildcard matching for the ‘selected’ traitlet when in multiselect mode. This method overrides the
BasePluginComponent.map_valuemethod.- Parameters:
- attrstr
The name of the traitlet being set.
- valueany
The value being set to the traitlet.
- Returns:
- valueany
The (possibly modified) value to be set to the traitlet.
- select_all()[source]#
Select (and return) all available options. Raises an error if not
is_multiselect()
- select_next()[source]#
Select next entry in the choices, wrapping when reaching the end. Raises an error if
is_multiselect()
- select_none()[source]#
Select (and return) and empty list. Raises an error if not
is_multiselect()