Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
|
4 |
import numpy as np
|
5 |
-
import gradio
|
6 |
import os
|
7 |
import pandas as pd
|
8 |
from datasets import load_dataset
|
@@ -30,10 +30,22 @@ def plot_timeline(yaxis, citi = ['المدينه', 'بغداد', 'كوفة', 'ب
|
|
30 |
fig.update_layout(title_font_color = 'red', title_x = .5)
|
31 |
return fig
|
32 |
|
33 |
-
app = gradio.Interface(plot_timeline,
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
|
4 |
import numpy as np
|
5 |
+
import gradio as gr
|
6 |
import os
|
7 |
import pandas as pd
|
8 |
from datasets import load_dataset
|
|
|
30 |
fig.update_layout(title_font_color = 'red', title_x = .5)
|
31 |
return fig
|
32 |
|
33 |
+
# app = gradio.Interface(plot_timeline,
|
34 |
+
# [gradio.Dropdown(choices = ['Taraf', 'Hadith', 'Isnad', 'Ranking'], value = 'Taraf', label = 'Y Axis'), gradio.Dropdown(choices = cities, value = ['المدينه', 'بغداد', 'كوفة', 'بصرة'], multiselect=True),
|
35 |
+
# gradio.Slider(min_year, max_year, value = 0, label = 'Begining', info = 'Choose the first year to display Tarafs'),
|
36 |
+
# gradio.Slider(min_year, max_year, value = 400, label = 'End', info = 'Choose the last year to display Tarafs')
|
37 |
+
|
38 |
+
# ],
|
39 |
+
# gradio.Plot()).launch()
|
40 |
+
|
41 |
+
|
42 |
+
demo = gr.Blocks()
|
43 |
+
with demo:
|
44 |
+
with gr.Row():
|
45 |
+
y_value = gradio.Dropdown(choices = ['Taraf', 'Hadith', 'Isnad', 'Ranking'], value = 'Taraf', label = 'Y Axis')
|
46 |
+
city = gradio.Dropdown(choices = cities, value = ['المدينه', 'بغداد', 'كوفة', 'بصرة'], multiselect=True)
|
47 |
+
begining = gradio.Slider(min_year, max_year, value = 0, label = 'Begining', info = 'Choose the first year to display Tarafs')
|
48 |
+
end = gradio.Slider(min_year, max_year, value = 400, label = 'End', info = 'Choose the last year to display Tarafs')
|
49 |
+
btn = gr.Button("Plot")
|
50 |
+
btn.click(plot_timeline, [y_value,city, begining, end], gr.Plot())
|
51 |
+
demo.launch()
|