AddResults#

class jdaviz.core.template_mixin.AddResults(plugin, label, label_default, label_auto, label_invalid_msg, label_overwrite, add_to_viewer_items, add_to_viewer_selected, auto_update_result=None, label_whitelist_overwrite=[])[source]#

Bases: BasePluginComponent

Plugin component for providing a data-label and selecting a viewer to add the results from the plugin.

Useful API methods/attributes:

  • label (AutoTextField):

    the label component. Setting will redirect to setting label.value.

  • auto

    shortcut to label.auto. Setting will redirect to setting label.auto.

  • viewer (ViewerSelect):

    the viewer to add the results, or None to add the results to the data-collection but not load into a viewer.

Traitlets (in the object, custom traitlets in the plugin):

  • label (string: user-provided label for the results data-entry. If label_auto, changes

    to label_default will update label. Otherwise, changes to label will set label_auto to False.)

  • label_default (string: plugin-determined default label that will be synced to label

    if/when label_auto is set to True)

  • label_auto (bool: whether to sync label_default to label)

  • label_invalid_msg (string: validation string for the current value of label. If

    not an empty string, calls to add_results_from_plugin will raise an error.)

  • label_overwrite (bool: whether the value of label already exists for a data-entry

    from the same plugin)

  • add_to_viewer_items (list of dicts: see ViewerSelect)

  • add_to_viewer_selected (string: name of the viewer to add the results,

    see ViewerSelect)

  • auto_update_result (bool: whether the resulting data-product should be regenerated when

    any input arguments are changed)

Methods:

  • add_results_from_plugin

Example template:

<plugin-add-results
  :label.sync="results_label"
  :label_default="results_label_default"
  :label_auto.sync="results_label_auto"
  :label_invalid_msg="results_label_invalid_msg"
  :label_overwrite="results_label_overwrite"
  label_hint="Label for the smoothed data"
  :add_to_viewer_items="add_to_viewer_items"
  :add_to_viewer_selected.sync="add_to_viewer_selected"
  :auto_update_result.sync="auto_update_result"
  action_label="Apply"
  action_tooltip="Apply the action to the data"
  @click:action="apply"
></plugin-add-results>

Attributes Summary

auto

Access the auto property of the AutoTextField object.

label

Access the value of the AutoTextField object.

user_api

Methods Summary

add_results_from_plugin(data_item[, ...])

Add data_item to the app's data_collection according to the default or user-provided label and adds to any requested viewers.

Attributes Documentation

auto#

Access the auto property of the AutoTextField object. If enabling, the label will automatically be changed and kept in sync with the default label.

label#

Access the value of the AutoTextField object. Changing the value manually will also disable the auto option.

user_api#

Methods Documentation

add_results_from_plugin(data_item, replace=None, label=None)[source]#

Add data_item to the app’s data_collection according to the default or user-provided label and adds to any requested viewers.