Eachan Johnson commited on
Commit
bd3f0a5
·
1 Parent(s): 5f87e71

Remove refresh buttons

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -293,8 +293,6 @@ with gr.Blocks() as demo:
293
  # Finding the dynamic parameters
294
 
295
  **Adjust the sliders** to alter the parameters underlying the rate of antibiotic discovery and resistance.
296
-
297
- **Click update plot** to see what the dynamics would look like with your parameters.
298
 
299
  **Click "Fit parameters!"** to automatically find the best fitting parameters.
300
 
@@ -312,7 +310,7 @@ with gr.Blocks() as demo:
312
  gr.Slider(label="Resistance-free half-life", info="Relative to start of clinical use",
313
  value=30., minimum=0., maximum=50., step=.2, scale=10),
314
  ]
315
- refresh_button = gr.Button("Update plot", scale=6)
316
  fit_button = gr.Button("Fit parameters!", scale=6)
317
 
318
 
@@ -322,7 +320,7 @@ with gr.Blocks() as demo:
322
  scale=4,
323
  )
324
  gr.on(
325
- triggers=[s.change for s in param_sliders] + [refresh_button.click],
326
  fn=lambda *x: plot_data_altair(df=data, params=x),
327
  inputs=param_sliders,
328
  outputs=plot,
@@ -335,8 +333,6 @@ with gr.Blocks() as demo:
335
 
336
  **Adjust the sliders** to see how changes in these parameters would change the future.
337
 
338
- **Click update plot** to see what the dynamics would look like with your parameters.
339
-
340
  **Click "Fit parameters!"** on the previous tab to set the parameters to fit historical data,
341
  then come back to this tab to check the forecast.
342
 
@@ -354,7 +350,7 @@ with gr.Blocks() as demo:
354
  gr.Slider(label="🔮", info="In years",
355
  value=100., minimum=0., maximum=200., step=.5, scale=10),
356
  ]
357
- refresh_button_forecast = gr.Button("Update plot", scale=6)
358
 
359
  param_and_forecast_sliders = param_sliders + forecast_sliders
360
  fit_message = gr.Markdown(forecast_msg, inputs=param_and_forecast_sliders)
@@ -363,7 +359,7 @@ with gr.Blocks() as demo:
363
  scale=4,
364
  )
365
  gr.on(
366
- triggers=[s.release for s in param_and_forecast_sliders] + [refresh_button_forecast.click, refresh_button.click],
367
  fn=lambda *x: plot_data_forecast_altair(df=data, params=x),
368
  inputs=param_and_forecast_sliders,
369
  outputs=forecast,
 
293
  # Finding the dynamic parameters
294
 
295
  **Adjust the sliders** to alter the parameters underlying the rate of antibiotic discovery and resistance.
 
 
296
 
297
  **Click "Fit parameters!"** to automatically find the best fitting parameters.
298
 
 
310
  gr.Slider(label="Resistance-free half-life", info="Relative to start of clinical use",
311
  value=30., minimum=0., maximum=50., step=.2, scale=10),
312
  ]
313
+ # refresh_button = gr.Button("Update plot", scale=6)
314
  fit_button = gr.Button("Fit parameters!", scale=6)
315
 
316
 
 
320
  scale=4,
321
  )
322
  gr.on(
323
+ triggers=[s.change for s in param_sliders],# + [refresh_button.click],
324
  fn=lambda *x: plot_data_altair(df=data, params=x),
325
  inputs=param_sliders,
326
  outputs=plot,
 
333
 
334
  **Adjust the sliders** to see how changes in these parameters would change the future.
335
 
 
 
336
  **Click "Fit parameters!"** on the previous tab to set the parameters to fit historical data,
337
  then come back to this tab to check the forecast.
338
 
 
350
  gr.Slider(label="🔮", info="In years",
351
  value=100., minimum=0., maximum=200., step=.5, scale=10),
352
  ]
353
+ # refresh_button_forecast = gr.Button("Update plot", scale=6)
354
 
355
  param_and_forecast_sliders = param_sliders + forecast_sliders
356
  fit_message = gr.Markdown(forecast_msg, inputs=param_and_forecast_sliders)
 
359
  scale=4,
360
  )
361
  gr.on(
362
+ triggers=[s.release for s in param_and_forecast_sliders],# + [refresh_button_forecast.click, refresh_button.click],
363
  fn=lambda *x: plot_data_forecast_altair(df=data, params=x),
364
  inputs=param_and_forecast_sliders,
365
  outputs=forecast,