webinterface.pages.base_pages.utils.resulttable module#
- webinterface.pages.base_pages.utils.resulttable.add_open_source_column(df: DataFrame) DataFrame[source]#
Add an ‘open_source’ column indicating whether the software is open source.
- Parameters:
df (pd.DataFrame) – DataFrame containing a ‘software_name’ column.
- Returns:
Copy of the DataFrame with an ‘open_source’ column inserted after ‘software_name’. Open source tools are marked with ‘✅’, others with an empty string.
- Return type:
pd.DataFrame
- webinterface.pages.base_pages.utils.resulttable.configure_aggrid(df: DataFrame, enable_selection: bool = False)[source]#
Configures the styling and options for AgGrid based on column category.
- webinterface.pages.base_pages.utils.resulttable.prepare_display_dataframe(df: DataFrame, highlight_id: str | None) DataFrame[source]#
Prepares the DataFrame for display, including column filtering, ordering, row highlighting, and numeric formatting.
- Parameters:
df (pd.DataFrame) – The filtered dataset for display.
highlight_id (str or None) – The ProteoBench ID to highlight (adds a marker in the ‘selected’ column).
- Returns:
A formatted and sorted DataFrame ready for rendering.
- Return type:
pd.DataFrame
- webinterface.pages.base_pages.utils.resulttable.render_aggrid(df: DataFrame, grid_options, key, enable_selection: bool = False)[source]#
Renders a DataFrame using AgGrid with specified grid options and a unique key.
- Parameters:
df (pd.DataFrame) – The DataFrame to display in the grid.
grid_options (dict) – Configuration options for AgGrid.
key (Any) – Unique identifier for the grid instance (AgGrid does not work with UUID keys).
enable_selection (bool, optional) – If True, configure the grid for single-row selection and return the grid response so callers can inspect selected rows.
- Returns:
The AgGrid return object; callers can read .selected_rows when selection is enabled.
- Return type:
AgGridReturn