webinterface.pages.base_pages.base module#

class webinterface.pages.base_pages.base.BaseUIModule(variables, ionmodule, parsesettingsbuilder, page_name: str = '/')[source]#

Bases: ABC

Base class for all UI modules with common patterns.

abstractmethod display_all_data_results_main() None[source]#

Tab 1 - Display results for all data (overview).

abstractmethod display_all_data_results_submitted() None[source]#

Tab 4 - Display the results for all data (overview) + submission

abstractmethod display_indepth_plots() None[source]#

Tab 3 - Display the dataset eselection dropdown and plot selected datasets.

abstractmethod display_public_submission_ui() None[source]#

Tab 5 - Display the public submission section of the page

abstractmethod display_submission_form() None[source]#

Tab 2 - Create the main submission form for the Streamlit UI

render_plot_options_expander(filter_callbacks: List[Callable[[], Any]], selector_callbacks: List[Callable[[], Any]], filter_cols_spec: int | List[int] = 2, selector_cols_spec: int | List[int] = None) List[Any][source]#

Render a standardized plot options expander with customizable content.

This method creates a consistent layout for plot options across different modules, reducing code duplication while maintaining flexibility.

Parameters:
  • filter_callbacks (List[Callable[[], Any]]) – List of functions to call for each filter column. Each function should render its UI elements and optionally return a value.

  • selector_callbacks (List[Callable[[], Any]]) – List of functions to call for each selector column. Each function should render its UI elements and optionally return a value.

  • filter_cols_spec (Union[int, List[int]], optional) – Number of columns or list of column weights for filter row. Default is 2.

  • selector_cols_spec (Union[int, List[int]], optional) – Number of columns or list of column weights for selector row. If None, uses [1] * len(selector_callbacks).

Returns:

List of return values from all callbacks (filter + selector callbacks).

Return type:

List[Any]

Examples

>>> def render_slider():
...     return st.slider("Value", 0, 100)
>>> def render_selectbox():
...     return st.selectbox("Option", ["A", "B"])
>>> results = self.render_plot_options_expander(
...     filter_callbacks=[render_slider, render_selectbox],
...     selector_callbacks=[],
...     filter_cols_spec=2
... )