ViewerSelect
- class jdaviz.core.template_mixin.ViewerSelect(**kwargs: Any)[source] [edit on github]
Bases:
BaseSelectPluginComponent
Traitlets (in the object, custom traitlets in the plugin):
items
(list of dicts with keys: id, reference, label)selected
(string)
Properties (in the object only):
ids
(list of ids corresponding toitems
)references
(list of references corresponding toitems
)labels
(list of references falling back on ids corresponding toitems
. Theseare the values seen in the dropdown, although setting either id or reference to the traitlet will still process correctly)
selected_item
(dict of the currently selected entry initems
)selected_id
(string corresponding to the id ofselected_item
)selected_obj
(viewer item corresponding toselected
)
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-viewer-select :items="viewer_items" :selected.sync="viewer_selected" label="Viewer" hint="Select viewer." />
Attributes Summary
Attributes Documentation
- ids
- references
- selected_id
- selected_obj
- selected_reference