forked from enviPath/enviPy
Import Export cycle of probs
This commit is contained in:
@@ -2159,6 +2159,7 @@ class CreateEdge(Schema):
|
|||||||
products: str | None = None # Node URIs comma sep
|
products: str | None = None # Node URIs comma sep
|
||||||
multistep: str | None = None
|
multistep: str | None = None
|
||||||
edgeReason: str | None = None
|
edgeReason: str | None = None
|
||||||
|
probability: float | None = None
|
||||||
|
|
||||||
|
|
||||||
@router.post(
|
@router.post(
|
||||||
@@ -2226,6 +2227,10 @@ def add_pathway_edge(request, package_uuid, pathway_uuid, e: Form[CreateEdge]):
|
|||||||
multi_step=multi_step,
|
multi_step=multi_step,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if e.probability:
|
||||||
|
new_e.kv["probability"] = e.probability
|
||||||
|
new_e.save()
|
||||||
|
|
||||||
# Update depths as sideeffect of above operation
|
# Update depths as sideeffect of above operation
|
||||||
pw.update_depths()
|
pw.update_depths()
|
||||||
|
|
||||||
|
|||||||
@@ -227,6 +227,29 @@
|
|||||||
Reaction Names
|
Reaction Names
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{% if merged %}{{ current_object.url }}{% else %}{{ current_object.url }}?merged=true{% endif %}" id="merged-toggle-button" class="cursor-pointer">
|
||||||
|
<svg
|
||||||
|
id="merged-icon"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="16"
|
||||||
|
height="16"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="lucide lucide-eye"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"
|
||||||
|
/>
|
||||||
|
<circle cx="12" cy="12" r="3" />
|
||||||
|
</svg>
|
||||||
|
Merged View
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
{% if pathway.setting.model.app_domain %}
|
{% if pathway.setting.model.app_domain %}
|
||||||
<li>
|
<li>
|
||||||
<a id="app-domain-toggle-button" class="cursor-pointer">
|
<a id="app-domain-toggle-button" class="cursor-pointer">
|
||||||
@@ -560,6 +583,8 @@
|
|||||||
var timeseriesViewEnabled = false;
|
var timeseriesViewEnabled = false;
|
||||||
// Predicted Property View
|
// Predicted Property View
|
||||||
var predictedPropertyViewEnabled = false;
|
var predictedPropertyViewEnabled = false;
|
||||||
|
// Merged View
|
||||||
|
var mergedViewEnabled = new URLSearchParams(window.location.search).get("merged") !== null;
|
||||||
|
|
||||||
function goFullscreen(id) {
|
function goFullscreen(id) {
|
||||||
var element = document.getElementById(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 =
|
||||||
|
'<path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"/><line x1="2" x2="22" y1="2" y2="22"/>';
|
||||||
|
} else {
|
||||||
|
// Change back to eye icon
|
||||||
|
icon.innerHTML =
|
||||||
|
'<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Timeseries toggle
|
// Timeseries toggle
|
||||||
const timeseriesBtn = document.getElementById("timeseries-toggle-button");
|
const timeseriesBtn = document.getElementById("timeseries-toggle-button");
|
||||||
if (timeseriesBtn) {
|
if (timeseriesBtn) {
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ class EdgeExportSchema(RefEdgeExportSchema):
|
|||||||
start_nodes: List[RefNodeExportSchema]
|
start_nodes: List[RefNodeExportSchema]
|
||||||
end_nodes: List[RefNodeExportSchema]
|
end_nodes: List[RefNodeExportSchema]
|
||||||
scenarios: List[RefScenarioExportSchema]
|
scenarios: List[RefScenarioExportSchema]
|
||||||
|
kv: Optional[dict]
|
||||||
|
|
||||||
|
|
||||||
class PathwayExportSchema(RefPathwayExportSchema):
|
class PathwayExportSchema(RefPathwayExportSchema):
|
||||||
@@ -623,6 +624,7 @@ class PackageImporter:
|
|||||||
new_e.description = e.description
|
new_e.description = e.description
|
||||||
new_e.aliases = e.aliases
|
new_e.aliases = e.aliases
|
||||||
new_e.edge_label = self._cache[e.edge_label.uuid]
|
new_e.edge_label = self._cache[e.edge_label.uuid]
|
||||||
|
new_e.kv = e.kv
|
||||||
new_e.save()
|
new_e.save()
|
||||||
|
|
||||||
for sn in e.start_nodes:
|
for sn in e.start_nodes:
|
||||||
|
|||||||
Reference in New Issue
Block a user