LeonceNsh commited on
Commit
ed81008
·
verified ·
1 Parent(s): 4a8a53c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -204,7 +204,6 @@ def generate_graph(selected_investors, filtered_data):
204
  def app(selected_country, selected_industry):
205
  investor_list, filtered_data = filter_investors_by_country_and_industry(selected_country, selected_industry)
206
  logger.info("Updating CheckboxGroup and filtered data holder.")
207
-
208
  return gr.update(
209
  choices=investor_list,
210
  value=investor_list,
@@ -228,7 +227,7 @@ def main():
228
  industry_filter = gr.Dropdown(choices=industry_list, label="Filter by Industry", value=default_industry)
229
 
230
  filtered_investor_list = gr.CheckboxGroup(choices=[], label="Select Investors", visible=False)
231
- graph_output = gr.Plot(label="Venture Network Graph")
232
  valuation_display = gr.Markdown(value="Click on a company node to see its valuation.", label="Company Valuation")
233
 
234
  filtered_data_holder = gr.State()
@@ -259,7 +258,7 @@ def main():
259
  return f"**Valuation:** {point['customdata']}"
260
  return "Click on a company node to see its valuation."
261
 
262
- graph_output.select(
263
  fn=display_valuation,
264
  inputs=graph_output,
265
  outputs=valuation_display
@@ -269,3 +268,4 @@ def main():
269
 
270
  if __name__ == "__main__":
271
  main()
 
 
204
  def app(selected_country, selected_industry):
205
  investor_list, filtered_data = filter_investors_by_country_and_industry(selected_country, selected_industry)
206
  logger.info("Updating CheckboxGroup and filtered data holder.")
 
207
  return gr.update(
208
  choices=investor_list,
209
  value=investor_list,
 
227
  industry_filter = gr.Dropdown(choices=industry_list, label="Filter by Industry", value=default_industry)
228
 
229
  filtered_investor_list = gr.CheckboxGroup(choices=[], label="Select Investors", visible=False)
230
+ graph_output = gr.Plotly(type="plotly", label="Venture Network Graph") # Use Plotly for interactive graph
231
  valuation_display = gr.Markdown(value="Click on a company node to see its valuation.", label="Company Valuation")
232
 
233
  filtered_data_holder = gr.State()
 
258
  return f"**Valuation:** {point['customdata']}"
259
  return "Click on a company node to see its valuation."
260
 
261
+ graph_output.interactive(
262
  fn=display_valuation,
263
  inputs=graph_output,
264
  outputs=valuation_display
 
268
 
269
  if __name__ == "__main__":
270
  main()
271
+