SelectPluginComponent#

class jdaviz.core.template_mixin.SelectPluginComponent(**kwargs: Any)[source]#

Bases: BasePluginComponent, HasTraits

Plugin select, with support for single or multi-selection.

Useful API methods/attributes:

This extends BasePluginComponent for common functionality for a select/dropdown component. The subclasses MUST have an items traitlet as a list of dictionaries, with ‘label’ as the selection entry (and any other optional entries for styling, etc) and a selected string traitlet. The subclasses should also override selected_obj and may choose to override _selected_changed (likely with a super call to keep the base logic).

Attributes Summary

cached_properties

choices

default_mode

default_text

filters

An instance of a Python list.

is_multiselect

labels

manual_options

selected_item

selected_obj

viewer_dicts

viewer_ids

viewer_refs

viewers

Methods Summary

add_filter(*filters)

select_all()

Select (and return) all available options.

select_default()

Apply and return the default selection.

select_next()

Select next entry in the choices, wrapping when reaching the end.

select_none()

Select (and return) and empty list.

select_previous()

Apply and return the previous selection (or default option if no previous selection)

Attributes Documentation

cached_properties#
choices#
default_mode#
default_text#
filters#

An instance of a Python list.

is_multiselect#
labels#
manual_options#
selected_item#
selected_obj#
viewer_dicts#
viewer_ids#
viewer_refs#
viewers#

Methods Documentation

add_filter(*filters)[source]#
select_all()[source]#

Select (and return) all available options. Raises an error if not is_multiselect()

select_default()[source]#

Apply and return the default selection.

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()

select_previous()[source]#

Apply and return the previous selection (or default option if no previous selection)