Fix duplicate edges/lag bug

node.py
This commit is contained in:
jerlendds
2023-12-09 10:31:14 -07:00
parent 645c20cdc1
commit 03c57ee56b

View File

@@ -188,14 +188,14 @@ async def read_graph(action_type, send_json, project_uuid):
'elements': blueprint.pop('elements'),
}
nodes.append(blueprint)
if len(edges[0]) >= 1:
[edges_data.append({
'id': f"{i}",
'source': f"{e[2]['from'].id}",
'target': f"{e[3]['to'].id}",
'label': e[1][T.label],
'type': 'float'
}) for i, e in enumerate(chunks(edges[0], 4))]
if len(edges[0]) >= 1:
[edges_data.append({
'id': f"{i}",
'source': f"{e[2]['from'].id}",
'target': f"{e[3]['to'].id}",
'label': e[1][T.label],
'type': 'float'
}) for i, e in enumerate(chunks(edges[0], 4))]
await send_json({
'action': 'addInitialLoad',
'nodes': nodes,