Eachan Johnson commited on
Commit
33690c0
·
1 Parent(s): 8a46ea2

Fix dropdown updating

Browse files
Files changed (1) hide show
  1. app.py +16 -14
app.py CHANGED
@@ -816,22 +816,24 @@ if __name__ == "__main__":
816
  js=True,
817
  )
818
 
819
- # file_examples.load_input_event.then(
820
- # lambda: gr.Button(visible=True),
821
- # outputs=[plot_button],
822
- # js=True,
823
- # )
824
-
825
- for dropdown in itertools.chain(
826
  left_plot_inputs.values(),
827
  right_plot_inputs.values(),
828
- ):
829
- # for e in (file_examples.load_input_event, go2_click_event):
830
- df_change.then(
831
- partial(get_dropdown_options, _type="number"),
832
- inputs=[input_dataframe],
833
- outputs=[dropdown],
834
- )
 
 
835
 
836
  plot_button.click(
837
  plot_pred_vs_observed,
 
816
  js=True,
817
  )
818
 
819
+ file_examples.load_input_event.then(
820
+ lambda: gr.Button(visible=True),
821
+ outputs=[plot_button],
822
+ js=True,
823
+ )
824
+
825
+ plot_dropdowns = list(itertools.chain(
826
  left_plot_inputs.values(),
827
  right_plot_inputs.values(),
828
+ ))
829
+
830
+ for dropdown in plot_dropdowns:
831
+ for e in (file_examples.load_input_event, go2_click_event):
832
+ df_change.then(
833
+ partial(get_dropdown_options, _type="number"),
834
+ inputs=[input_dataframe],
835
+ outputs=[dropdown],
836
+ )
837
 
838
  plot_button.click(
839
  plot_pred_vs_observed,