SelectPluginComponent

class jdaviz.core.template_mixin.SelectPluginComponent(**kwargs: Any)[source] [edit on github]

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.

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] [edit on github]
select_all()[source] [edit on github]

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

select_default()[source] [edit on github]

Apply and return the default selection.

select_next()[source] [edit on github]

Select next entry in the choices, wrapping when reaching the end. Raises an error if is_multiselect()

select_none()[source] [edit on github]

Select (and return) and empty list. Raises an error if not is_multiselect()