Selector¶
Defines generator and dash callbacks for the data selector component.
- qimchi.components.selector.data_selector() Div [source]¶
Generator for the data selector component.
- Returns:
The data selector component
- Return type:
dash.html.Div
- qimchi.components.selector.update_options(sess_id: str, sel_contents: None | Div, dataset_type: str, dataset_path: str, _) Div [source]¶
Updates the options for the data selector.
- Parameters:
sess_id (str) – Session ID to load the state for
sel_contents (None | html.Div) – The current contents of the data selector
dataset_type (str) – The type of the dataset
dataset_path (str) – The path to the dataset
- Returns:
The updated data selector component
- Return type:
dash.html.Div
- qimchi.components.selector.refresh(n_clicks: int, dataset_path: str, dataset_type: str, is_ds_set: bool, sess_id: str, _) int [source]¶
Conditionally refreshes the submit button, auto-submitting the data path and options to refresh the data selector dropdowns.
- Parameters:
n_clicks (int) – The current number of clicks
dataset_path (str) – The path to the dataset
dataset_type (str) – The type of the dataset
is_ds_set (bool) – Whether the data selector is set
sess_id (str) – Session ID to load the state for
- Returns:
The number of clicks
- Return type:
int
- Raises:
PreventUpdate – If dataset_path or dataset_type is not set, or if is_ds_set is True
- qimchi.components.selector.update_dependents(sess_id: str, sig: int | None) list [source]¶
Updates the dependent dropdown options.
- Parameters:
sess_id (str) – Session ID to load the state for
sig (int | None) – Signal to indicate that data has been updated
- Returns:
The dependent dropdown options generated from the data
- Return type:
list
- Raises:
PreventUpdate – If sig is None or 0
- qimchi.components.selector.update_independents(sess_id: str, sig: int | None, dependents: list)[source]¶
Updates the independent dropdown options.
- Parameters:
sess_id (str) – Session ID to load the state for
sig (int) – Signal to indicate that data has been updated
dependents (list) – List of dependent variables
- Returns:
The independent dropdown options generated from the data
- Return type:
list
- Raises:
PreventUpdate – If sig is None or 0, or dependents is None