jatamura commited on
Commit
bbfc25f
·
verified ·
1 Parent(s): b712817

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -126,6 +126,7 @@ def server(input, output, session: Session):
126
 
127
  # Update reactive value
128
  analysis_results.set(results)
 
129
 
130
  @output
131
  @render.ui
@@ -136,24 +137,22 @@ def server(input, output, session: Session):
136
  class_="text-muted")
137
 
138
  ui_output = []
139
- for i, r in enumerate(results):
140
 
141
  id = "image_" + str(i)
142
  opacity = ui.input_slider(id, "Opacity", 0, 1.0, 0.5)
143
-
144
- test = plot_server(f"plot_{i}",r=r, opacity=input[id]())
145
 
146
  ui_output.append(
147
  ui.div(
148
  ui.row(
149
  ui.column(4, ui.img(src=f"data:image/png;base64,{r['image_base64']}")),
150
- # plot_ui(f"plot_{i}"),
151
  ),
152
  opacity,
153
  ui.h5(r['filename'], style="margin-top: 15px;"),
154
  ui.div(
155
  ui.span(f"Viable = {r.get('viable', '? ')}", style="margin: 0 15px;"),
156
- ui.span(f"Nonviable = {r.get('non-viable', '? ')}", style="margin: 0 15px;"),
157
  ui.span(f"Empty = {r.get('empty', '? ')}", style="margin: 0 15px;"),
158
  ui.span(f"Total = {r.get('total', '? ')}", style="margin: 0 15px;"),
159
  class_="results-text"
 
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
 
137
  class_="text-muted")
138
 
139
  ui_output = []
140
+ for idx, r in enumerate(results):
141
 
142
  id = "image_" + str(i)
143
  opacity = ui.input_slider(id, "Opacity", 0, 1.0, 0.5)
 
 
144
 
145
  ui_output.append(
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;"),
153
  ui.div(
154
  ui.span(f"Viable = {r.get('viable', '? ')}", style="margin: 0 15px;"),
155
+ ui.span(f"Non-Viable = {r.get('non-viable', '? ')}", style="margin: 0 15px;"),
156
  ui.span(f"Empty = {r.get('empty', '? ')}", style="margin: 0 15px;"),
157
  ui.span(f"Total = {r.get('total', '? ')}", style="margin: 0 15px;"),
158
  class_="results-text"