From 678ace6109bc96b4dd33265b0a7833342eb508b6 Mon Sep 17 00:00:00 2001 From: Junhan Chang Date: Tue, 17 Jun 2025 13:53:38 +0800 Subject: [PATCH] Fix edge id --- .../comprehensive_station.json | 22 +++++++++---------- unilabos/resources/graphio.py | 3 +-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/test/experiments/comprehensive_protocol/comprehensive_station.json b/test/experiments/comprehensive_protocol/comprehensive_station.json index 19d0852..2b75c13 100644 --- a/test/experiments/comprehensive_protocol/comprehensive_station.json +++ b/test/experiments/comprehensive_protocol/comprehensive_station.json @@ -153,7 +153,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 200, "y": 150, @@ -174,7 +174,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 250, "y": 150, @@ -195,7 +195,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 300, "y": 150, @@ -216,7 +216,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 900, "y": 150, @@ -237,7 +237,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 950, "y": 150, @@ -302,7 +302,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 400, "y": 450, @@ -387,7 +387,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 500, "y": 400, @@ -406,7 +406,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 1100, "y": 500, @@ -570,7 +570,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 900, "y": 500, @@ -589,7 +589,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 950, "y": 500, @@ -608,7 +608,7 @@ "children": [], "parent": "ComprehensiveProtocolStation", "type": "container", - "class": null, + "class": "container", "position": { "x": 1050, "y": 500, diff --git a/unilabos/resources/graphio.py b/unilabos/resources/graphio.py index 17b0f27..3ed2e36 100644 --- a/unilabos/resources/graphio.py +++ b/unilabos/resources/graphio.py @@ -175,8 +175,7 @@ def modify_to_backend_format(data: list[dict[str, Any]]) -> list[dict[str, Any]] edge["targetHandle"] = port[target] elif "target_port" in edge: edge["targetHandle"] = edge.pop("target_port") - if "id" not in edge: - edge["id"] = f"reactflow__edge-{edge['sourceHandle']}-{edge['targetHandle']}" + edge["id"] = f"reactflow__edge-{source}-{edge['sourceHandle']}-{target}-{edge['targetHandle']}" for key in ["source_port", "target_port"]: if key in edge: edge.pop(key)