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 to items)

  • references (list of references corresponding to items)

  • labels (list of references falling back on ids corresponding to items. These

    are 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 in items)

  • selected_id (string corresponding to the id of selected_item)

  • selected_obj (viewer item corresponding to selected)

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

ids

references

selected_id

selected_obj

selected_reference

Attributes Documentation

ids
references
selected_id
selected_obj
selected_reference