Update app.py
Browse files
app.py
CHANGED
@@ -32,8 +32,8 @@ def splitIsnad(dataframe):
|
|
32 |
return dataframe
|
33 |
|
34 |
|
35 |
-
def network_visualizer(city, year):
|
36 |
-
edge_15 = splitIsnad(subsetEdges(city, year)).sample(
|
37 |
net = Network()
|
38 |
for _, row in edge_15.iterrows():
|
39 |
source = row['Teacher']
|
@@ -61,6 +61,8 @@ def network_visualizer(city, year):
|
|
61 |
with gr.Blocks() as demo:
|
62 |
Places = gr.Dropdown(choices = cities, value = 'المدينه', label = 'Location')
|
63 |
Last_Year = gr.Slider(min_year, max_year, value = 9, label = 'End', info = 'Choose the year to display Narrators')
|
|
|
|
|
64 |
btn = gr.Button('Submit')
|
65 |
-
btn.click(fn = network_visualizer, inputs = [Places, Last_Year], outputs = gr.HTML())
|
66 |
demo.launch()
|
|
|
32 |
return dataframe
|
33 |
|
34 |
|
35 |
+
def network_visualizer(city, year, num_nodes):
|
36 |
+
edge_15 = splitIsnad(subsetEdges(city, year)).sample(num_nodes)
|
37 |
net = Network()
|
38 |
for _, row in edge_15.iterrows():
|
39 |
source = row['Teacher']
|
|
|
61 |
with gr.Blocks() as demo:
|
62 |
Places = gr.Dropdown(choices = cities, value = 'المدينه', label = 'Location')
|
63 |
Last_Year = gr.Slider(min_year, max_year, value = 9, label = 'End', info = 'Choose the year to display Narrators')
|
64 |
+
num_narrators = gr.Slider(0, 400, value = 200, label = 'Narrators', info = 'Choose the number of Narrators to display')
|
65 |
+
|
66 |
btn = gr.Button('Submit')
|
67 |
+
btn.click(fn = network_visualizer, inputs = [Places, Last_Year, num_narrators], outputs = gr.HTML())
|
68 |
demo.launch()
|