Skip to content

Commit 9e5c532

Browse files
committed
fix plot
1 parent 71c6c39 commit 9e5c532

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

python_workflow_definition/src/python_workflow_definition/plot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def plot(file_name: str):
3939
k + "=result[" + v[SOURCE_PORT_LABEL] + "]"
4040
)
4141
for k, v in edge_label_dict.items():
42-
graph.add_edge(str(k), str(target_node), label=", ".join(v))
42+
if len(v) == 1 and v[0] is not None:
43+
graph.add_edge(str(k), str(target_node), label=", ".join(v))
44+
else:
45+
graph.add_edge(str(k), str(target_node))
4346

4447
svg = nx.nx_agraph.to_agraph(graph).draw(prog="dot", format="svg")
4548
display(SVG(svg))

python_workflow_definition/src/python_workflow_definition/shared.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ def get_source_handles(edges_lst: list) -> dict:
4242

4343
def convert_nodes_list_to_dict(nodes_list: list) -> dict:
4444
return {
45-
str(el["id"]): el["value"] for el in sorted(nodes_list, key=lambda d: d["id"])
45+
str(el["id"]): el["value"] if "value" in el else el["name"]
46+
for el in sorted(nodes_list, key=lambda d: d["id"])
4647
}
4748

4849

0 commit comments

Comments
 (0)