imednet_streamlit.components package¶
Specialized UI components for the iMednet dashboard.
- imednet_streamlit.components.bar_chart(df, x, y, color=None, title='', x_title=None, y_title=None)[source]¶
Build a horizontal Altair bar chart.
- Parameters:
df (
DataFrame) – Source DataFrame for the chart.x (
str) – Quantitative column for the x-axis.y (
str) – Categorical column for the y-axis.color (
Optional[str]) – Optional categorical column for grouped colors.title (
str) – Optional chart title.x_title (
Optional[str]) – Optional x-axis label override.y_title (
Optional[str]) – Optional y-axis label override.
- Return type:
Chart- Returns:
Configured Altair chart object.
- imednet_streamlit.components.csv_download_button(df, filename, label='⬇ Download CSV')[source]¶
Render a CSV download button for a DataFrame.
- Parameters:
df (
DataFrame) – DataFrame to serialize.filename (
str) – Output filename displayed in the browser download prompt.label (
str) – Button label text.
- Return type:
None
- imednet_streamlit.components.excel_download_button(df, filename, label='⬇ Download Excel')[source]¶
Render an Excel download button for a DataFrame.
- Parameters:
df (
DataFrame) – DataFrame to serialize.filename (
str) – Output filename displayed in the browser download prompt.label (
str) – Button label text.
- Return type:
None
- imednet_streamlit.components.filterable_dataframe(df, key, height=400)[source]¶
Render a searchable and paginated dataframe.
- Parameters:
df (
DataFrame) – Source DataFrame to display.key (
str) – Unique key namespace used for filter and pagination widgets.height (
int) – Height in pixels passed tost.dataframe.
- Return type:
None
- imednet_streamlit.components.kpi_card(label, value, delta=None, help=None)[source]¶
Render a single KPI metric card.
- Parameters:
label (
str) – Metric label displayed above the value.value (
int|float|str) – Metric value displayed in the card.delta (
Optional[str]) – Optional delta text (for trend direction).help (
Optional[str]) – Optional tooltip/help text.
- Return type:
None
- imednet_streamlit.components.kpi_row(metrics)[source]¶
Render a horizontal row of KPI metric cards.
- Parameters:
metrics (
list[MetricConfig]) – Sequence of metric dictionaries withlabelandvaluekeys. Optional keys aredeltaandhelp.- Return type:
None
- imednet_streamlit.components.line_chart(df, x, y, color=None, title='')[source]¶
Build an Altair temporal line chart.
- Parameters:
df (
DataFrame) – Source DataFrame for the chart.x (
str) – Temporal column for the x-axis.y (
str) – Quantitative column for the y-axis.color (
Optional[str]) – Optional categorical column for grouped lines.title (
str) – Optional chart title.
- Return type:
Chart- Returns:
Configured Altair chart object.
- imednet_streamlit.components.paginated_slice(df, *, key, page_size_options=(50, 100, 200), default_page_size=100)[source]¶
Render pager controls and return the current page slice.
- Return type:
DataFrame- Parameters:
df (DataFrame) –
key (str) –
page_size_options (tuple[int, ...]) –
default_page_size (int) –
- imednet_streamlit.components.pie_chart(df, theta, color, title='')[source]¶
Build an Altair pie chart.
- Parameters:
df (
DataFrame) – Source DataFrame for the chart.theta (
str) – Quantitative column used for slice size.color (
str) – Categorical column used for slice color.title (
str) – Optional chart title.
- Return type:
Chart- Returns:
Configured Altair chart object.
- imednet_streamlit.components.render_accessible_chart(chart, use_container_width=True, theme='streamlit', **kwargs)[source]¶
Render an Altair chart with an accessible tabular data view.
- Return type:
None- Parameters:
chart (altair.Chart) –
use_container_width (bool) –
theme (Literal['streamlit'] | None) –
kwargs (Any) –
- imednet_streamlit.components.render_lineage_panes(*, raw_record, mapping_rules, canonical_payload)[source]¶
Render side-by-side lineage panes for raw, mapping, and canonical views.
- Return type:
None- Parameters:
raw_record (dict[str, Any] | None) –
mapping_rules (list[dict[str, Any]]) –
canonical_payload (dict[str, Any]) –
- imednet_streamlit.components.render_triage_drawer(*, store, item, assignee_options, current_user)[source]¶
Render triage detail and actions for a selected item.
- Return type:
None- Parameters:
store (TriageStore) –
item (TriageItem) –
assignee_options (Sequence[str]) –
current_user (str) –
- imednet_streamlit.components.top_n_with_other(df, *, label_column, value_column, top_n=10, other_label='Other')[source]¶
Return top-N rows plus an aggregated ‘Other’ row.
- Return type:
DataFrame- Parameters:
df (DataFrame) –
label_column (str) –
value_column (str) –
top_n (int) –
other_label (str) –
Submodules¶
imednet_streamlit.components.charts module¶
Standard Altair chart wrappers for iMednet.
Provides accessible, brand-compliant bar, line, and pie charts with automatic tabular data fallback for accessibility.
- imednet_streamlit.components.charts.bar_chart(df, x, y, color=None, title='', x_title=None, y_title=None)[source]¶
Build a horizontal Altair bar chart.
- Parameters:
df (
DataFrame) – Source DataFrame for the chart.x (
str) – Quantitative column for the x-axis.y (
str) – Categorical column for the y-axis.color (
Optional[str]) – Optional categorical column for grouped colors.title (
str) – Optional chart title.x_title (
Optional[str]) – Optional x-axis label override.y_title (
Optional[str]) – Optional y-axis label override.
- Return type:
Chart- Returns:
Configured Altair chart object.
- imednet_streamlit.components.charts.line_chart(df, x, y, color=None, title='')[source]¶
Build an Altair temporal line chart.
- Parameters:
df (
DataFrame) – Source DataFrame for the chart.x (
str) – Temporal column for the x-axis.y (
str) – Quantitative column for the y-axis.color (
Optional[str]) – Optional categorical column for grouped lines.title (
str) – Optional chart title.
- Return type:
Chart- Returns:
Configured Altair chart object.
- imednet_streamlit.components.charts.pie_chart(df, theta, color, title='')[source]¶
Build an Altair pie chart.
- Parameters:
df (
DataFrame) – Source DataFrame for the chart.theta (
str) – Quantitative column used for slice size.color (
str) – Categorical column used for slice color.title (
str) – Optional chart title.
- Return type:
Chart- Returns:
Configured Altair chart object.
- imednet_streamlit.components.charts.render_accessible_chart(chart, use_container_width=True, theme='streamlit', **kwargs)[source]¶
Render an Altair chart with an accessible tabular data view.
- Return type:
None- Parameters:
chart (altair.Chart) –
use_container_width (bool) –
theme (Literal['streamlit'] | None) –
kwargs (Any) –
imednet_streamlit.components.data_lineage module¶
Data Lineage components.
Provides utilities for redacting sensitive fields and rendering multi-pane views that trace the transformation of raw EDC records into canonical models.
- imednet_streamlit.components.data_lineage.render_lineage_panes(*, raw_record, mapping_rules, canonical_payload)[source]¶
Render side-by-side lineage panes for raw, mapping, and canonical views.
- Return type:
None- Parameters:
raw_record (dict[str, Any] | None) –
mapping_rules (list[dict[str, Any]]) –
canonical_payload (dict[str, Any]) –
imednet_streamlit.components.export module¶
Data export components for Streamlit.
Provides standardized buttons for downloading DataFrames as CSV or Excel files.
- imednet_streamlit.components.export.csv_download_button(df, filename, label='⬇ Download CSV')[source]¶
Render a CSV download button for a DataFrame.
- Parameters:
df (
DataFrame) – DataFrame to serialize.filename (
str) – Output filename displayed in the browser download prompt.label (
str) – Button label text.
- Return type:
None
- imednet_streamlit.components.export.excel_download_button(df, filename, label='⬇ Download Excel')[source]¶
Render an Excel download button for a DataFrame.
- Parameters:
df (
DataFrame) – DataFrame to serialize.filename (
str) – Output filename displayed in the browser download prompt.label (
str) – Button label text.
- Return type:
None
imednet_streamlit.components.metrics module¶
KPI and metric display components for Streamlit.
Provides card-based layouts for displaying key performance indicators and high-level study statistics.
- class imednet_streamlit.components.metrics.MetricConfig[source]¶
Bases:
TypedDictConfiguration definition for a single metric tile.
- imednet_streamlit.components.metrics.kpi_card(label, value, delta=None, help=None)[source]¶
Render a single KPI metric card.
- Parameters:
label (
str) – Metric label displayed above the value.value (
int|float|str) – Metric value displayed in the card.delta (
Optional[str]) – Optional delta text (for trend direction).help (
Optional[str]) – Optional tooltip/help text.
- Return type:
None
- imednet_streamlit.components.metrics.kpi_row(metrics)[source]¶
Render a horizontal row of KPI metric cards.
- Parameters:
metrics (
list[MetricConfig]) – Sequence of metric dictionaries withlabelandvaluekeys. Optional keys aredeltaandhelp.- Return type:
None
imednet_streamlit.components.paginated_grid module¶
Pagination and data manipulation components for Streamlit.
Provides tools for slicing large DataFrames into pages and aggregating low-frequency categories into an ‘Other’ bucket for visualization.
- imednet_streamlit.components.paginated_grid.paginated_slice(df, *, key, page_size_options=(50, 100, 200), default_page_size=100)[source]¶
Render pager controls and return the current page slice.
- Return type:
DataFrame- Parameters:
df (DataFrame) –
key (str) –
page_size_options (tuple[int, ...]) –
default_page_size (int) –
- imednet_streamlit.components.paginated_grid.top_n_with_other(df, *, label_column, value_column, top_n=10, other_label='Other')[source]¶
Return top-N rows plus an aggregated ‘Other’ row.
- Return type:
DataFrame- Parameters:
df (DataFrame) –
label_column (str) –
value_column (str) –
top_n (int) –
other_label (str) –
imednet_streamlit.components.tables module¶
Standard data table component for iMednet.
- imednet_streamlit.components.tables.filterable_dataframe(df, key, height=400)[source]¶
Render a searchable and paginated dataframe.
- Parameters:
df (
DataFrame) – Source DataFrame to display.key (
str) – Unique key namespace used for filter and pagination widgets.height (
int) – Height in pixels passed tost.dataframe.
- Return type:
None
imednet_streamlit.components.triage_drawer module¶
Interactive triage review component.
Provides a detail view for clinical triage items, including a temporal history of actions and a side panel for status updates, assignments, and annotations.
- imednet_streamlit.components.triage_drawer.render_triage_drawer(*, store, item, assignee_options, current_user)[source]¶
Render triage detail and actions for a selected item.
- Return type:
None- Parameters:
store (TriageStore) –
item (TriageItem) –
assignee_options (Sequence[str]) –
current_user (str) –