Skip to content
Permalink
Browse files
Removed self-loops in sankey results.
  • Loading branch information
michellebeard committed Aug 7, 2017
1 parent d4f5f00 commit c82fe230caccba22fc89414a6721781c4d6910b0
Showing 1 changed file with 12 additions and 11 deletions.
@@ -264,17 +264,18 @@ def generate_graph(app,
seqID = '%s->%s' % (nodename1, nodename2)

# @todo Ensure src and target are not the same (self-loop)
link = {
'sequenceID': seqID,
'sourceName': nodename1,
'targetName': nodename2,
'type': node1['type'],
# 'duration': node1['duration'],
'pathLength': len(node1['path']),
'targetChange': node1['targetChange'],
'typeChange': node1['typeChange']
}
visitedLinks.append(link)
if nodename1 != nodename2:
link = {
'sequenceID': seqID,
'sourceName': nodename1,
'targetName': nodename2,
'type': node1['type'],
# 'duration': node1['duration'],
'pathLength': len(node1['path']),
'targetChange': node1['targetChange'],
'typeChange': node1['typeChange']
}
visitedLinks.append(link)

# How many users visited a sequence at this step
counts = collections.Counter(k['sequenceID'] for k in visitedLinks if k.get('sequenceID'))

0 comments on commit c82fe23

Please sign in to comment.