Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -101,11 +101,14 @@ def visualize_isnad(taraf_num, yaxis):
|
|
| 101 |
isnad = isnad_info[(isnad_info['Source'] == row['Source']) & (isnad_info['Destination'] == row['Destination'])]
|
| 102 |
teacher_narrations = teacher_info['Number of Narrations'].to_list()[0]
|
| 103 |
student_narrations = student_info['Number of Narrations'].to_list()[0]
|
|
|
|
|
|
|
|
|
|
| 104 |
if row['Source'] == '99999':
|
| 105 |
net.add_node(source, font = {'size':50, 'color': 'Black'}, color = '#000000')
|
| 106 |
else:
|
| 107 |
-
net.add_node(source, font = {'size':30, 'color': 'red'}, color = value_to_hex(teacher_narrations), label = f'{source} \n {teacher_info["Narrator Rank"].to_list()[0]} \n ID: {row["Source"]}')
|
| 108 |
-
net.add_node(target, font = {'size': 30, 'color': 'red'}, color = value_to_hex(student_narrations), label = f'{target} \n{student_info["Narrator Rank"].to_list()[0]} \n ID: {row["Destination"]}')
|
| 109 |
net.add_edge(source, target, color = value_to_hex(int(isnad[f'{yaxis} Count'].to_list()[0])), label = f"{isnad[f'{yaxis} Count'].to_list()[0]}")
|
| 110 |
net.barnes_hut(gravity=-5000, central_gravity=0.3, spring_length=200)
|
| 111 |
html = net.generate_html()
|
|
@@ -141,11 +144,14 @@ def visualize_subTaraf(df, yaxis):
|
|
| 141 |
isnad = isnad_info[(isnad_info['Source'] == row['Source']) & (isnad_info['Destination'] == row['Destination'])]
|
| 142 |
teacher_narrations = teacher_info['Number of Narrations'].to_list()[0]
|
| 143 |
student_narrations = student_info['Number of Narrations'].to_list()[0]
|
|
|
|
|
|
|
|
|
|
| 144 |
if row['Source'] == '99999':
|
| 145 |
net.add_node(source, font = {'size':50, 'color': 'Black'}, color = '#000000')
|
| 146 |
else:
|
| 147 |
-
net.add_node(source, font = {'size':30, 'color': 'red'}, color = value_to_hex(teacher_narrations), label = f'{source} \n {teacher_info["Narrator Rank"].to_list()[0]} \n ID: {row["Source"]}')
|
| 148 |
-
net.add_node(target, font = {'size': 30, 'color': 'red'}, color = value_to_hex(student_narrations), label = f'{target} \n{student_info["Narrator Rank"].to_list()[0]} \n ID: {row["Destination"]}')
|
| 149 |
net.add_edge(source, target, color = value_to_hex(int(isnad[f'{yaxis} Count'].to_list()[0])), label = f"{isnad[f'{yaxis} Count'].to_list()[0]}")
|
| 150 |
net.barnes_hut(gravity=-5000, central_gravity=0.3, spring_length=200)
|
| 151 |
html = net.generate_html()
|
|
|
|
| 101 |
isnad = isnad_info[(isnad_info['Source'] == row['Source']) & (isnad_info['Destination'] == row['Destination'])]
|
| 102 |
teacher_narrations = teacher_info['Number of Narrations'].to_list()[0]
|
| 103 |
student_narrations = student_info['Number of Narrations'].to_list()[0]
|
| 104 |
+
|
| 105 |
+
teacher_gen = teacher_info['Generation'].to_list()[0]
|
| 106 |
+
student_gen = student_info['Generation'].to_list()[0]
|
| 107 |
if row['Source'] == '99999':
|
| 108 |
net.add_node(source, font = {'size':50, 'color': 'Black'}, color = '#000000')
|
| 109 |
else:
|
| 110 |
+
net.add_node(source, font = {'size':30, 'color': 'red'}, color = value_to_hex(teacher_narrations), label = f'{source} \n {teacher_info["Narrator Rank"].to_list()[0]} \n ID: {row["Source"]} - Gen {teacher_gen}')
|
| 111 |
+
net.add_node(target, font = {'size': 30, 'color': 'red'}, color = value_to_hex(student_narrations), label = f'{target} \n{student_info["Narrator Rank"].to_list()[0]} \n ID: {row["Destination"]} - Gen {student_gen}')
|
| 112 |
net.add_edge(source, target, color = value_to_hex(int(isnad[f'{yaxis} Count'].to_list()[0])), label = f"{isnad[f'{yaxis} Count'].to_list()[0]}")
|
| 113 |
net.barnes_hut(gravity=-5000, central_gravity=0.3, spring_length=200)
|
| 114 |
html = net.generate_html()
|
|
|
|
| 144 |
isnad = isnad_info[(isnad_info['Source'] == row['Source']) & (isnad_info['Destination'] == row['Destination'])]
|
| 145 |
teacher_narrations = teacher_info['Number of Narrations'].to_list()[0]
|
| 146 |
student_narrations = student_info['Number of Narrations'].to_list()[0]
|
| 147 |
+
teacher_gen = teacher_info['Generation'].to_list()[0]
|
| 148 |
+
student_gen = student_info['Generation'].to_list()[0]
|
| 149 |
+
|
| 150 |
if row['Source'] == '99999':
|
| 151 |
net.add_node(source, font = {'size':50, 'color': 'Black'}, color = '#000000')
|
| 152 |
else:
|
| 153 |
+
net.add_node(source, font = {'size':30, 'color': 'red'}, color = value_to_hex(teacher_narrations), label = f'{source} \n {teacher_info["Narrator Rank"].to_list()[0]} \n ID: {row["Source"]} - Gen {teacher_gen}')
|
| 154 |
+
net.add_node(target, font = {'size': 30, 'color': 'red'}, color = value_to_hex(student_narrations), label = f'{target} \n{student_info["Narrator Rank"].to_list()[0]} \n ID: {row["Destination"]} - Gen {student_gen}')
|
| 155 |
net.add_edge(source, target, color = value_to_hex(int(isnad[f'{yaxis} Count'].to_list()[0])), label = f"{isnad[f'{yaxis} Count'].to_list()[0]}")
|
| 156 |
net.barnes_hut(gravity=-5000, central_gravity=0.3, spring_length=200)
|
| 157 |
html = net.generate_html()
|