feat: drug switching network graph tab (Task C.4)

This commit is contained in:
Andrew Charlwood
2026-02-07 03:32:14 +00:00
parent ac688c9ac0
commit 1405476818
6 changed files with 224 additions and 8 deletions
+11
View File
@@ -27,6 +27,7 @@ from data_processing.pathway_queries import (
get_retention_funnel as _get_retention_funnel,
get_pathway_depth_distribution as _get_pathway_depth_distribution,
get_duration_cost_scatter as _get_duration_cost_scatter,
get_drug_network as _get_drug_network,
)
DB_PATH = Path(__file__).resolve().parents[2] / "data" / "pathways.db"
@@ -216,3 +217,13 @@ def get_duration_cost_scatter(
) -> list[dict]:
"""Drug-level avg_days and cost_pp_pa for scatter plot."""
return _get_duration_cost_scatter(DB_PATH, date_filter_id, chart_type, directory, trust)
def get_drug_network(
date_filter_id: str = "all_6mo",
chart_type: str = "directory",
directory: Optional[str] = None,
trust: Optional[str] = None,
) -> dict:
"""Undirected drug co-occurrence network for network graph."""
return _get_drug_network(DB_PATH, date_filter_id, chart_type, directory, trust)