streamlit_dashboard.page_classes namespace¶
Submodules¶
streamlit_dashboard.page_classes.admin_panel_page_class module¶
- class streamlit_dashboard.page_classes.admin_panel_page_class.AdminPanelPage(**kwargs)¶
Bases:
BaseReportPageProvides a centralized administrative interface for configuring dashboard data sources.
Unlike standard report pages, this class does not generate or render data visualizations. Instead, it hooks into the standard BaseReportPage lifecycle to render a configuration form. It manages the retrieval, validation, and updating of Neoserra API export URLs stored within the global DashboardConfig session state.
It employs strict regex validation to ensure data pipeline integrity, while also providing a deliberate bypass mechanism to future-proof against external API changes.
- generate_figures(parameters: Dict[str, Any])¶
Overrides the standard data generation step as a no-op.
Because this page is strictly for configuration management, it circumvents the data processing phase of the BaseReportPage lifecycle.
- Parameters:
parameters (Dict[str, Any]) – The parameter dictionary (empty from render_controls).
- Returns:
An empty dictionary representing no figure data.
- Return type:
Dict[str, Any]
- static get_page_name()¶
Retrieves the human-readable name of the admin panel for UI navigation.
- Returns:
The static display name “Admin Panel”.
- Return type:
str
- get_syncable_figure_keys() List[str]¶
Declares that this page has no visual figures requiring axis synchronization.
- Returns:
An empty list.
- Return type:
List[str]
- is_valid_neoserra_url(url)¶
Validates a given URL against the expected Neoserra export API format.
Used as a gatekeeper during form submission to prevent malformed URLs from breaking the dashboard’s data ingestion pipeline.
- Parameters:
url (str) – The raw URL string to validate.
- Returns:
True if the URL matches the expected Neoserra API pattern, False otherwise.
- Return type:
bool
- render_controls(container: DeltaGenerator) Dict[str, Any]¶
Builds the administrative form and handles the validation/submission pipeline.
This method constructs a unified Streamlit form containing URL grabber widgets for various data modules (Clients, Trainings, NBS, Funding). By wrapping the inputs in a single form, it ensures that configuration updates are processed as a single batch rather than triggering piecemeal app reruns.
During submission, it utilizes an “all-or-nothing” validation strategy. If any link fails regex validation (and the manual bypass is not checked), the entire save operation is aborted to prevent partial configuration states.
- Parameters:
container (DeltaGenerator) – The Streamlit container to draw the administrative form onto.
- Returns:
An empty dictionary, as this page does not pass parameters to generate_figures.
- Return type:
Dict[str, Any]
- render_figures(container: DeltaGenerator, output_data: Dict[str, Any])¶
Overrides the standard figure rendering step as a no-op.
Does nothing, as there are no visual charts or graphs to draw for the Admin Panel.
- Parameters:
container (DeltaGenerator) – The Streamlit container.
output_data (Dict[str, Any]) – The empty output data from generate_figures.
- save_settings()¶
Commits the current configuration state to persistent storage.
Extracts the DashboardConfig object from the Streamlit session state and triggers its internal save mechanism, providing visual feedback to the user upon completion.
streamlit_dashboard.page_classes.authentication_page_wrapper module¶
streamlit_dashboard.page_classes.center_milestones_page_class module¶
streamlit_dashboard.page_classes.funding_milestones_page_class module¶
streamlit_dashboard.page_classes.naics_report_page_class module¶
streamlit_dashboard.page_classes.nbs_milestones_page_class module¶
streamlit_dashboard.page_classes.page_class_constants module¶
streamlit_dashboard.page_classes.report_comparer_page_class module¶
- class streamlit_dashboard.page_classes.report_comparer_page_class.ComparerColumn(report_name_map: dict, report_configs: dict, column_id: str)¶
Bases:
BaseReportPageActs as an interactive proxy wrapper for a single report within a comparison layout.
Handles dynamic instantiation of a user-selected report and forcibly overrides its instance ID. This guarantees that Streamlit widget keys remain completely unique even if the user selects the exact same report class in both comparison columns.
- Parameters:
report_name_map (dict) – Dictionary mapping UI display names to BaseReportPage classes.
report_configs (dict) – Dictionary mapping classes to their config keyword arguments.
column_id (str) – An identifier (e.g., ‘left’, ‘right’) prepended to prevent widget collisions.
- generate_figures(parameters: Dict[str, Any]) Dict[str, Any]¶
Delegates figure generation to the currently instantiated report.
- Parameters:
parameters (Dict[str, Any]) – User inputs specific to the selected report.
- Returns:
The output data payload from the selected report.
- Return type:
Dict[str, Any]
- render_controls(container: DeltaGenerator) Dict[str, Any]¶
Draws a selection menu to instantiate the desired report, then renders its specific controls.
- Parameters:
container (DeltaGenerator) – The Streamlit column container.
- Returns:
The parameters generated by the selected report’s controls.
- Return type:
Dict[str, Any]
- render_figures(container: DeltaGenerator, output_data: Dict[str, Any])¶
Delegates the final drawing phase to the currently instantiated report.
- Parameters:
container (DeltaGenerator) – The Streamlit column container.
output_data (Dict[str, Any]) – The display data, potentially mutated by the parent ComparerPage.
- class streamlit_dashboard.page_classes.report_comparer_page_class.ComparerPage(report_configs)¶
Bases:
BaseReportPageOrchestrates a dual-column layout to allow dynamic side-by-side report comparison.
Leverages the BaseReportPage lifecycle to intercept data generation between two child columns. If identical report types are selected, it extracts their max values and synchronizes their Y-axes globally before allowing the final rendering phase, ensuring an accurate visual comparison.
- Parameters:
report_configs (dict) – Mapping of report page classes to their respective instantiation arguments.
- render(container: DeltaGenerator)¶
Splits the layout and manages the synchronization pipeline for both child reports.
- Parameters:
container (DeltaGenerator) – The main Streamlit container allocated for the comparer.