lambdaofgod commited on
Commit
f6555fb
·
1 Parent(s): 5627e88

feat: add update button to min_task_counts_slider

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -112,18 +112,21 @@ with gr.Blocks() as demo:
112
  with gr.Tab("Explore PapersWithCode Tasks"):
113
  gr.Markdown("## PapersWithCode Tasks Visualization")
114
 
115
- min_task_counts_slider = gr.Slider(
116
- minimum=10,
117
- maximum=1000,
118
- value=10,
119
- step=10,
120
- label="Minimum Task Count",
121
- )
 
 
 
122
  with gr.Column("Task Counts"):
123
  all_repos_tasks_plot = gr.Plot(label="All Repositories")
124
- selected_repos_tasks_plot = gr.Plot(label="All Repositories")
125
 
126
- min_task_counts_slider.change(
127
  fn=task_visualizations.get_tasks_sunbursts,
128
  inputs=[min_task_counts_slider],
129
  outputs=[all_repos_tasks_plot, selected_repos_tasks_plot],
 
112
  with gr.Tab("Explore PapersWithCode Tasks"):
113
  gr.Markdown("## PapersWithCode Tasks Visualization")
114
 
115
+ with gr.Row():
116
+ min_task_counts_slider = gr.Slider(
117
+ minimum=10,
118
+ maximum=1000,
119
+ value=10,
120
+ step=10,
121
+ label="Minimum Task Count",
122
+ )
123
+ update_button = gr.Button("Update Plots")
124
+
125
  with gr.Column("Task Counts"):
126
  all_repos_tasks_plot = gr.Plot(label="All Repositories")
127
+ selected_repos_tasks_plot = gr.Plot(label="Selected Repositories")
128
 
129
+ update_button.click(
130
  fn=task_visualizations.get_tasks_sunbursts,
131
  inputs=[min_task_counts_slider],
132
  outputs=[all_repos_tasks_plot, selected_repos_tasks_plot],