FileImportSelectPluginComponent#
- class jdaviz.core.template_mixin.FileImportSelectPluginComponent(**kwargs: Any)[source]#
Bases:
SelectPluginComponent
IMPORTANT: Always accompany with HasFileImportSelect IMPORTANT: currently assumed only one instance per-plugin
Example template (label and hint are optional):
<plugin-file-import title="Import File" hint="Select a file to import" :show="method_selected === 'From File...' && from_file.length === 0" :from_file="from_file" :from_file_message.sync="from_file_message" @click-cancel="method_selected=method_items[0].label" @click-import="file_import_accept()"> <g-file-import id="file-uploader"></g-file-import> </plugin-file-import>
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 aselected
string traitlet. The subclasses should also overrideselected_obj
and may choose to override_selected_changed
(likely with a super call to keep the base logic).Attributes Summary
Methods Summary
import_file
(path)Select 'From File...' and set the path.
import_obj
(obj)Import a supported object directly from the API.
Attributes Documentation
- selected_obj#
Methods Documentation