Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,14 +64,14 @@ def network_visualizer(yaxis, city, fstyear,lastyr, num_nodes):
|
|
| 64 |
source = row['Teacher']
|
| 65 |
target = row['Student']
|
| 66 |
attribute_value = row[yaxis]
|
| 67 |
-
edge_color = value_to_hex(
|
| 68 |
teacher_info = narrator_bios[narrator_bios['Rawi ID'] == row['Teacher_ID']]
|
| 69 |
student_info = narrator_bios[narrator_bios['Rawi ID'] == row['Student_ID']]
|
| 70 |
teacher_narrations = teacher_info['Number of Narrations'].to_list()[0]
|
| 71 |
student_narrations = student_info['Number of Narrations'].to_list()[0]
|
| 72 |
|
| 73 |
-
net.add_node(source, color=value_to_hex(
|
| 74 |
-
net.add_node(target, color=value_to_hex(
|
| 75 |
net.add_edge(source, target, color=edge_color, value=attribute_value, label = f"{source} to {target}\n{yaxis}: {attribute_value}")
|
| 76 |
|
| 77 |
|
|
|
|
| 64 |
source = row['Teacher']
|
| 65 |
target = row['Student']
|
| 66 |
attribute_value = row[yaxis]
|
| 67 |
+
edge_color = value_to_hex(attribute_value)
|
| 68 |
teacher_info = narrator_bios[narrator_bios['Rawi ID'] == row['Teacher_ID']]
|
| 69 |
student_info = narrator_bios[narrator_bios['Rawi ID'] == row['Student_ID']]
|
| 70 |
teacher_narrations = teacher_info['Number of Narrations'].to_list()[0]
|
| 71 |
student_narrations = student_info['Number of Narrations'].to_list()[0]
|
| 72 |
|
| 73 |
+
net.add_node(source, color=value_to_hex(teacher_narrations), font = {'size':30, 'color': 'orange'})#, label = f"{source}\n{yaxis}: {hadith_count}")
|
| 74 |
+
net.add_node(target, color=value_to_hex(student_narrations), font = {'size': 20, 'color': 'red'})#, label = f"{target}\n{yaxis}: {student_count}")
|
| 75 |
net.add_edge(source, target, color=edge_color, value=attribute_value, label = f"{source} to {target}\n{yaxis}: {attribute_value}")
|
| 76 |
|
| 77 |
|