Update app.py
Browse files
app.py
CHANGED
@@ -101,10 +101,20 @@ with gr.Blocks() as demo:
|
|
101 |
with gr.Column(min_width=320):
|
102 |
search_bar_graph = gr.Textbox(placeholder="🔍 Search for an author or authors separated by comma", show_label=False)
|
103 |
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
search_bar.submit(fn=search, inputs=search_bar, outputs=gr_followers)
|
107 |
-
search_bar_graph.submit(fn=
|
108 |
|
109 |
threading.Thread(target=restart_space).start()
|
110 |
demo.launch()
|
|
|
101 |
with gr.Column(min_width=320):
|
102 |
search_bar_graph = gr.Textbox(placeholder="🔍 Search for an author or authors separated by comma", show_label=False)
|
103 |
|
104 |
+
output_plot = gr.LinePlot(
|
105 |
+
x="x",
|
106 |
+
y="y",
|
107 |
+
color="author", # Differentiates lines by author
|
108 |
+
tooltip=["x", "y", "author"],
|
109 |
+
title="Follower Growth Over Time",
|
110 |
+
x_title="Date",
|
111 |
+
y_title="Number of Followers",
|
112 |
+
width=700,
|
113 |
+
height=500
|
114 |
+
)
|
115 |
|
116 |
search_bar.submit(fn=search, inputs=search_bar, outputs=gr_followers)
|
117 |
+
search_bar_graph.submit(fn=lambda names: gr_plot_follower_comparison(names.split(",")), inputs=search_bar_graph, outputs=output_plot)
|
118 |
|
119 |
threading.Thread(target=restart_space).start()
|
120 |
demo.launch()
|