diff --git a/epdb/legacy_api.py b/epdb/legacy_api.py index 2f984548..1bdd49ff 100644 --- a/epdb/legacy_api.py +++ b/epdb/legacy_api.py @@ -2159,6 +2159,7 @@ class CreateEdge(Schema): products: str | None = None # Node URIs comma sep multistep: str | None = None edgeReason: str | None = None + probability: float | None = None @router.post( @@ -2226,6 +2227,10 @@ def add_pathway_edge(request, package_uuid, pathway_uuid, e: Form[CreateEdge]): multi_step=multi_step, ) + if e.probability: + new_e.kv["probability"] = e.probability + new_e.save() + # Update depths as sideeffect of above operation pw.update_depths() diff --git a/templates/objects/pathway.html b/templates/objects/pathway.html index 20102597..199c84a4 100644 --- a/templates/objects/pathway.html +++ b/templates/objects/pathway.html @@ -227,6 +227,29 @@ Reaction Names +
  • + + + + + + Merged View + +
  • {% if pathway.setting.model.app_domain %}
  • @@ -560,6 +583,8 @@ var timeseriesViewEnabled = false; // Predicted Property View var predictedPropertyViewEnabled = false; + // Merged View + var mergedViewEnabled = new URLSearchParams(window.location.search).get("merged") !== null; function goFullscreen(id) { var element = document.getElementById(id); @@ -705,6 +730,23 @@ }); } + const mergedViewBtn = document.getElementById( + "merged-toggle-button", + ); + if (mergedViewBtn) { + const icon = document.getElementById("merged-icon"); + if (mergedViewEnabled) { + // Change to eye-off icon + icon.innerHTML = + ''; + } else { + // Change back to eye icon + icon.innerHTML = + ''; + } + }; + + // Timeseries toggle const timeseriesBtn = document.getElementById("timeseries-toggle-button"); if (timeseriesBtn) { diff --git a/utilities/misc.py b/utilities/misc.py index 36b1ce7d..f429a9fd 100644 --- a/utilities/misc.py +++ b/utilities/misc.py @@ -214,6 +214,7 @@ class EdgeExportSchema(RefEdgeExportSchema): start_nodes: List[RefNodeExportSchema] end_nodes: List[RefNodeExportSchema] scenarios: List[RefScenarioExportSchema] + kv: Optional[dict] class PathwayExportSchema(RefPathwayExportSchema): @@ -623,6 +624,7 @@ class PackageImporter: new_e.description = e.description new_e.aliases = e.aliases new_e.edge_label = self._cache[e.edge_label.uuid] + new_e.kv = e.kv new_e.save() for sn in e.start_nodes: