jatamura commited on
Commit
14d6e80
·
verified ·
1 Parent(s): 728abb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -49,14 +49,14 @@ app_ui = ui.page_fluid(
49
  )
50
 
51
  @module.ui
52
- def plot_ui(*args):
53
  return ui.column(4, ui.output_plot("plot_prediction"))
54
 
55
  @module.server
56
  def plot_server(input, output, session, r, opacity):
57
  @output
58
  @render.ui
59
- def plot_prediction(*args):
60
  fig, ax = plt.subplots()
61
 
62
  ax = plt.Axes(fig, [0., 0., 1., 1.])
@@ -126,7 +126,7 @@ def server(input, output, session: Session):
126
 
127
  # Update reactive value
128
  analysis_results.set(results)
129
- plot_server(f"plot_{idx}",r=r, opacity=input[id]())
130
 
131
  @output
132
  @render.ui
@@ -146,7 +146,7 @@ def server(input, output, session: Session):
146
  ui.div(
147
  ui.row(
148
  ui.column(4, ui.img(src=f"data:image/png;base64,{r['image_base64']}")),
149
- plot_ui(f"plot_{i}", r, opacity),
150
  ),
151
  opacity,
152
  ui.h5(r['filename'], style="margin-top: 15px;"),
 
49
  )
50
 
51
  @module.ui
52
+ def plot_ui():
53
  return ui.column(4, ui.output_plot("plot_prediction"))
54
 
55
  @module.server
56
  def plot_server(input, output, session, r, opacity):
57
  @output
58
  @render.ui
59
+ def plot_prediction():
60
  fig, ax = plt.subplots()
61
 
62
  ax = plt.Axes(fig, [0., 0., 1., 1.])
 
126
 
127
  # Update reactive value
128
  analysis_results.set(results)
129
+ [plot_server(f"plot_{idx}",r=r, opacity=0.5) for r in results]
130
 
131
  @output
132
  @render.ui
 
146
  ui.div(
147
  ui.row(
148
  ui.column(4, ui.img(src=f"data:image/png;base64,{r['image_base64']}")),
149
+ plot_ui(f"plot_{i}"),
150
  ),
151
  opacity,
152
  ui.h5(r['filename'], style="margin-top: 15px;"),