Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,24 +49,24 @@ def app_interface():
|
|
49 |
#Dropdown to select company name
|
50 |
company = gr.Dropdown(label="Select Company", choices=list(company_dict.keys()), value="Apple")
|
51 |
|
52 |
-
|
53 |
-
|
54 |
|
55 |
-
|
56 |
-
|
57 |
|
58 |
-
|
59 |
|
60 |
-
|
61 |
-
|
62 |
|
63 |
-
|
64 |
-
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
|
71 |
return app
|
72 |
|
|
|
49 |
#Dropdown to select company name
|
50 |
company = gr.Dropdown(label="Select Company", choices=list(company_dict.keys()), value="Apple")
|
51 |
|
52 |
+
#Button to fetch and plot ESG data
|
53 |
+
plot_button = gr.Button("Generate ESG Plot")
|
54 |
|
55 |
+
# LinePlot component for displaying the ESG data
|
56 |
+
line_plot = gr.LinePlot(label="ESG Scores Plot", x="ESG Category", y="Score", overlay_point=True)
|
57 |
|
58 |
+
scatter_plot = gr.ScatterPlot(label="ESG Scores Scatter Plot", x="ESG Category", y="Score", overlay_point=True)
|
59 |
|
60 |
+
# Textbox to display messages
|
61 |
+
message = gr.Textbox(label="Message", interactive=False)
|
62 |
|
63 |
+
# File output for CSV download
|
64 |
+
csv_output = gr.File(label="Download CSV")
|
65 |
|
66 |
+
# Define the action when the "Generate ESG Plot" button is clicked
|
67 |
+
plot_button.click(fn=fetch_esg_data,
|
68 |
+
inputs=company,
|
69 |
+
outputs=[csv_output, line_plot, scatter_plot])
|
70 |
|
71 |
return app
|
72 |
|