Update app.py
Browse files
app.py
CHANGED
|
@@ -441,7 +441,7 @@ def download_excel():
|
|
| 441 |
|
| 442 |
output.seek(0)
|
| 443 |
|
| 444 |
-
return
|
| 445 |
|
| 446 |
def download_images():
|
| 447 |
global plot_images
|
|
@@ -459,7 +459,7 @@ def download_images():
|
|
| 459 |
zipf.writestr(f"plot_{i}.png", img_bytes)
|
| 460 |
|
| 461 |
zip_buffer.seek(0)
|
| 462 |
-
return
|
| 463 |
|
| 464 |
def next_plot():
|
| 465 |
global current_plot_index
|
|
@@ -536,8 +536,7 @@ with gr.Blocks() as demo:
|
|
| 536 |
prev_plot_button = gr.Button("<")
|
| 537 |
next_plot_button = gr.Button(">")
|
| 538 |
rsm_plot_output = gr.Plot()
|
| 539 |
-
plot_image_output = gr.File(label="Descargar Gr谩fico Actual"
|
| 540 |
-
|
| 541 |
|
| 542 |
load_button.click(
|
| 543 |
load_data,
|
|
@@ -549,9 +548,9 @@ with gr.Blocks() as demo:
|
|
| 549 |
|
| 550 |
plot_button.click(generate_rsm_plot, inputs=[fixed_variable_input, fixed_level_input], outputs=[rsm_plot_output, equation_output, plot_image_output])
|
| 551 |
|
| 552 |
-
download_excel_button.click(download_excel, outputs=download_excel_button,
|
| 553 |
|
| 554 |
-
download_images_button.click(download_images, outputs=download_images_button,
|
| 555 |
|
| 556 |
prev_plot_button.click(prev_plot, outputs=prev_plot_button).then(generate_rsm_plot, inputs=[fixed_variable_input, fixed_level_input], outputs=[rsm_plot_output, equation_output, plot_image_output])
|
| 557 |
|
|
|
|
| 441 |
|
| 442 |
output.seek(0)
|
| 443 |
|
| 444 |
+
return output, "Descargar Excel" # Return BytesIO and label
|
| 445 |
|
| 446 |
def download_images():
|
| 447 |
global plot_images
|
|
|
|
| 459 |
zipf.writestr(f"plot_{i}.png", img_bytes)
|
| 460 |
|
| 461 |
zip_buffer.seek(0)
|
| 462 |
+
return zip_buffer, "Descargar ZIP" # Return BytesIO and label
|
| 463 |
|
| 464 |
def next_plot():
|
| 465 |
global current_plot_index
|
|
|
|
| 536 |
prev_plot_button = gr.Button("<")
|
| 537 |
next_plot_button = gr.Button(">")
|
| 538 |
rsm_plot_output = gr.Plot()
|
| 539 |
+
plot_image_output = gr.File(label="Descargar Gr谩fico Actual")
|
|
|
|
| 540 |
|
| 541 |
load_button.click(
|
| 542 |
load_data,
|
|
|
|
| 548 |
|
| 549 |
plot_button.click(generate_rsm_plot, inputs=[fixed_variable_input, fixed_level_input], outputs=[rsm_plot_output, equation_output, plot_image_output])
|
| 550 |
|
| 551 |
+
download_excel_button.click(download_excel, outputs=[download_excel_button, download_excel_button])
|
| 552 |
|
| 553 |
+
download_images_button.click(download_images, outputs=[download_images_button, download_images_button])
|
| 554 |
|
| 555 |
prev_plot_button.click(prev_plot, outputs=prev_plot_button).then(generate_rsm_plot, inputs=[fixed_variable_input, fixed_level_input], outputs=[rsm_plot_output, equation_output, plot_image_output])
|
| 556 |
|