Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -85,14 +85,14 @@ def network_visualizer(yaxis, city, fstyear,lastyr, num_nodes):
|
|
85 |
for node in G.nodes:
|
86 |
node_info,student_narrations,student_gen, student_rank, node_name = get_node_info(node)
|
87 |
if node == 99999:
|
88 |
-
net.add_node(node, font = {'size':50, 'color': 'black'}, color = '#000000', label = f'{node_name} \n ID: {node} - Gen {student_gen}', size= 70)
|
89 |
else:
|
90 |
-
net.add_node(node, font = {'size':30, 'color': 'red'}, color = value_to_hex(student_narrations), label = f'{node_name} \n {student_rank} \n ID: {node} - Gen {student_gen}', size= 50)
|
91 |
for edge in G.edges:
|
92 |
row = edges[(edges['Teacher_ID'] == edge[0]) & (edges['Student_ID'] == edge[1])].iloc[0]
|
93 |
source = row['Teacher_ID']
|
94 |
target = row['Student_ID']
|
95 |
-
net.add_edge(source, target, color = value_to_hex(int(row[yaxis])), label = f"{row[yaxis]}")
|
96 |
|
97 |
# for _, row in edge_15.iterrows():
|
98 |
# source = row['Teacher']
|
|
|
85 |
for node in G.nodes:
|
86 |
node_info,student_narrations,student_gen, student_rank, node_name = get_node_info(node)
|
87 |
if node == 99999:
|
88 |
+
net.add_node(int(node), font = {'size':50, 'color': 'black'}, color = '#000000', label = f'{node_name} \n ID: {node} - Gen {student_gen}', size= 70)
|
89 |
else:
|
90 |
+
net.add_node(int(node), font = {'size':30, 'color': 'red'}, color = value_to_hex(student_narrations), label = f'{node_name} \n {student_rank} \n ID: {node} - Gen {student_gen}', size= 50)
|
91 |
for edge in G.edges:
|
92 |
row = edges[(edges['Teacher_ID'] == edge[0]) & (edges['Student_ID'] == edge[1])].iloc[0]
|
93 |
source = row['Teacher_ID']
|
94 |
target = row['Student_ID']
|
95 |
+
net.add_edge(int(source), int(target), color = value_to_hex(int(row[yaxis])), label = f"{row[yaxis]}")
|
96 |
|
97 |
# for _, row in edge_15.iterrows():
|
98 |
# source = row['Teacher']
|