Spaces:
Running
Running
Commit
·
0e3d8df
1
Parent(s):
49443a1
Update app.py
Browse files
app.py
CHANGED
@@ -203,11 +203,11 @@ def dist_colors(output_file, input_checks):
|
|
203 |
plot = (points + lines).properties(width=600, height=350).interactive()
|
204 |
|
205 |
if "peaks" in input_checks:
|
206 |
-
return
|
207 |
elif "topics" in input_checks:
|
208 |
-
return gr.update(value=plot, visible=True), gr.update(visible=False), gr.update(visible=True) # next_button_topics becomes available
|
209 |
else:
|
210 |
-
return gr.update(value=plot, visible=True), gr.update(visible=False), gr.update(visible=False) # no next_button becomes available
|
211 |
|
212 |
|
213 |
def peaks(output_file, input_checks):
|
@@ -255,7 +255,7 @@ with gr.Blocks() as demo:
|
|
255 |
output_plot = gr.Plot(label="Emotion frequencies", visible=False).style(container=True)
|
256 |
next_button_dist = gr.Button("Show emotion distribution over time", visible=False)
|
257 |
|
258 |
-
output_dist = gr.Plot(label="Emotion distribution over time", visible=False)
|
259 |
next_button_peaks = gr.Button("Show peaks", visible=False)
|
260 |
|
261 |
output_peaks = gr.Textbox(label="Peaks", visible=False)
|
@@ -265,7 +265,7 @@ with gr.Blocks() as demo:
|
|
265 |
|
266 |
send_btn.click(fn=file, inputs=[input_file,input_checks], outputs=[output_file,next_button_freq,next_button_dist,next_button_peaks,next_button_topics])
|
267 |
next_button_freq.click(fn=freq, inputs=[output_file,input_checks], outputs=[output_plot,next_button_dist,next_button_peaks,next_button_topics])
|
268 |
-
next_button_dist.click(fn=
|
269 |
next_button_peaks.click(fn=peaks, inputs=[output_file,input_checks], outputs=[output_peaks,next_button_topics])
|
270 |
next_button_topics.click(fn=topics, inputs=[output_file,input_checks], outputs=output_topics)
|
271 |
|
|
|
203 |
plot = (points + lines).properties(width=600, height=350).interactive()
|
204 |
|
205 |
if "peaks" in input_checks:
|
206 |
+
return ggr.Plot.update(value=plot, visible=True), gr.update(visible=True), gr.update(visible=False) # next_button_peaks becomes available
|
207 |
elif "topics" in input_checks:
|
208 |
+
return gr.Plot.update(value=plot, visible=True), gr.update(visible=False), gr.update(visible=True) # next_button_topics becomes available
|
209 |
else:
|
210 |
+
return gr.Plot.update(value=plot, visible=True), gr.update(visible=False), gr.update(visible=False) # no next_button becomes available
|
211 |
|
212 |
|
213 |
def peaks(output_file, input_checks):
|
|
|
255 |
output_plot = gr.Plot(label="Emotion frequencies", visible=False).style(container=True)
|
256 |
next_button_dist = gr.Button("Show emotion distribution over time", visible=False)
|
257 |
|
258 |
+
output_dist = gr.Plot(label="Emotion distribution over time", visible=False)
|
259 |
next_button_peaks = gr.Button("Show peaks", visible=False)
|
260 |
|
261 |
output_peaks = gr.Textbox(label="Peaks", visible=False)
|
|
|
265 |
|
266 |
send_btn.click(fn=file, inputs=[input_file,input_checks], outputs=[output_file,next_button_freq,next_button_dist,next_button_peaks,next_button_topics])
|
267 |
next_button_freq.click(fn=freq, inputs=[output_file,input_checks], outputs=[output_plot,next_button_dist,next_button_peaks,next_button_topics])
|
268 |
+
next_button_dist.click(fn=dist_colors, inputs=[output_file,input_checks], outputs=[output_dist,next_button_peaks,next_button_topics])
|
269 |
next_button_peaks.click(fn=peaks, inputs=[output_file,input_checks], outputs=[output_peaks,next_button_topics])
|
270 |
next_button_topics.click(fn=topics, inputs=[output_file,input_checks], outputs=output_topics)
|
271 |
|