Mark center of analysis and include topLists in analysis

This commit is contained in:
Dominik Moritz Roth 2021-06-22 15:41:24 +02:00
parent 07205f37c0
commit a8d9f96e70

View File

@ -554,10 +554,11 @@ def analyze(G, type_name, name, dist=2.7):
scaleBooksByRating(G)
scaleOpinionsByRating(G)
match['value'] = 100
#match['value'] = 100
if not 'shape' in match:
match['shape'] = 'star'
addScoreToLabels(G)
match['label'] = "*"+match['label']+"*"
def pruneDist(G, node, n, dist, menge, firstEdge=False):
if dist <= 0:
@ -565,6 +566,10 @@ def pruneDist(G, node, n, dist, menge, firstEdge=False):
dist -= 1
if menge==set():
firstEdge=True
if node['t'] in ['topList']:
if firstEdge:
menge.add(n)
return
menge.add(n)
if node['t'] in ['tag']:
if firstEdge:
@ -575,7 +580,7 @@ def pruneDist(G, node, n, dist, menge, firstEdge=False):
keeplist = []
for m in list(G.adj[n]):
book = G.nodes[m]
if book['t'] not in ['topList']:
if book['t'] not in ['NOTHING']:
if 'score' in book and book['score'] != None:
bestlist.append(book)
elif 'rating' in book and book['rating'] != None: