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

feat: Add interactive sunburst charts for PapersWithCode tasks

Browse files
Files changed (1) hide show
  1. app.py +16 -17
app.py CHANGED
@@ -111,23 +111,22 @@ with gr.Blocks() as demo:
111
  setup_repository_representations_tab(repos, representation_types)
112
  with gr.Tab("Explore PapersWithCode Tasks"):
113
  gr.Markdown("## PapersWithCode Tasks Visualization")
114
-
115
- def update_plots(min_count):
116
- all_plot, selected_plot = task_visualizations.display_tasks_sunburst_charts(min_count)
117
- return [all_plot, selected_plot]
118
-
119
- interface = gr.Interface(
120
- fn=update_plots,
121
- inputs=[
122
- gr.Slider(minimum=1, maximum=100, value=10, step=1, label="Minimum Task Count")
123
- ],
124
- outputs=[
125
- gr.Plot(label="All Repositories"),
126
- gr.Plot(label="Selected Repositories")
127
- ],
128
- live=True,
129
- title="PapersWithCode Tasks Visualization",
130
- description="Adjust the minimum task count to update the sunburst charts."
131
  )
132
 
133
  demo.launch()
 
111
  setup_repository_representations_tab(repos, representation_types)
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],
 
130
  )
131
 
132
  demo.launch()