Manasa1 commited on
Commit
815da2f
·
verified ·
1 Parent(s): 1a28136

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
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
- # 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
 
 
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