Skip to content

Commit 2fa90b4

Browse files
authored
Merge pull request #7 from chnyangjie/master
get rid of duplicate node
2 parents 3d502b3 + 5ed68a0 commit 2fa90b4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

neographviz/vis.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ def _get_nodes(sg: py2neo.Subgraph) -> List[dict]:
4646
List -- List of dictionaries with keys: id, group, label, title
4747
"""
4848
nodes = []
49+
node_id_set = set()
4950
if sg:
5051
for n in sg.nodes:
52+
if n.identity in node_id_set:
53+
continue
54+
node_id_set.add(n.identity)
5155
nodes.append(
5256
{
5357
"id": n.identity,

0 commit comments

Comments
 (0)