DatasetSelect#
- class jdaviz.core.template_mixin.DatasetSelect(**kwargs: Any)[source]#
Bases:
SelectPluginComponent
Plugin select for data entries, with support for single or multi-selection.
Useful API methods/attributes:
selected
select_all()
(only ifis_multiselect
)select_none()
(only ifis_multiselect
)
Traitlets (in the object, custom traitlets in the plugin):
items
(list of dicts with keys: label)selected
(string)
Properties (in the object only):
selected_obj
selected_dc_item
Methods (in the object only):
get_object
add_filter
(more useful for the mixin, when creating a custom component, passfilters
)
To use in a plugin:
create traitlets with default values
register with all the automatic logic in the plugin’s init by passing the string names of the respective traitlets
use component in plugin template (see below)
refer to properties above based on the interally stored reference to the instantiated object of this component
Example template (label and hint are optional):
<plugin-dataset-select :items="dataset_items" :selected.sync="dataset_selected" label="Data" hint="Select data." />
- Parameters:
- plugin
the parent plugin object
- itemsstr
the name of the items traitlet defined in
plugin
- selectedstr
the name of the selected traitlet defined in
plugin
- multiselectstr
the name of the traitlet defining whether the dropdown should accept multiple selections
- filterslist
list of strings (for built-in filters) or callables to filter to only valid options.
- default_textstr or None
the text to show for no selection. If not provided or None, no entry will be provided in the dropdown for no selection.
- manual_options: list
list of options to provide that are not automatically populated by datasets. If
default
text is provided but not inmanual_options
it will still be included as the first item in the list.
Attributes Summary
Methods Summary
get_object
(*args, **kwargs)get_selected_spectrum
([use_display_units])Attributes Documentation
- default_data_cls#
- selected_dc_item#
- selected_obj#
- selected_spectrum#
Methods Documentation