FDSRashid commited on
Commit
f6ffdd2
·
1 Parent(s): eff9aa5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -54,12 +54,12 @@ def network_visualizer(city, year, num_nodes):
54
  if source not in node_roles or node_roles[source] == "target":
55
  node_roles[source] = "source"
56
  node_colors[source] = value_to_hex(hadith_count)
57
- net.add_node(source, color=value_to_hex(hadith_count), font={'size': 30, 'color': 'orange'})
58
 
59
  if target not in node_roles or node_roles[target] == "target":
60
  node_roles[target] = "target"
61
  node_colors[target] = value_to_hex(attribute_value)
62
- net.add_node(target, color=value_to_hex(attribute_value), font={'size': 20, 'color': 'red'})
63
  edge_color = value_to_hex(attribute_value)
64
  net.add_edge(source, target, color=edge_color, value=attribute_value)
65
  #net.add_node(source, color=value_to_hex(hadith_count), font = {'size':30, 'color': 'orange'})
 
54
  if source not in node_roles or node_roles[source] == "target":
55
  node_roles[source] = "source"
56
  node_colors[source] = value_to_hex(hadith_count)
57
+ net.add_node(source, color=value_to_hex(hadith_count), font={'size': 30, 'color': 'orange'}, label=f"{source}\nHadiths: {hadith_count}")
58
 
59
  if target not in node_roles or node_roles[target] == "target":
60
  node_roles[target] = "target"
61
  node_colors[target] = value_to_hex(attribute_value)
62
+ net.add_node(target, color=value_to_hex(attribute_value), font={'size': 20, 'color': 'red'}, label=f"{target}\nHadiths: {hadith_count}")
63
  edge_color = value_to_hex(attribute_value)
64
  net.add_edge(source, target, color=edge_color, value=attribute_value)
65
  #net.add_node(source, color=value_to_hex(hadith_count), font = {'size':30, 'color': 'orange'})