aagoluoglu commited on
Commit
d8a4f0d
·
verified ·
1 Parent(s): b58ea84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -42,7 +42,7 @@ app_ui = ui.page_fillable(
42
  ui.input_switch("by_species", "Show species", value=True),
43
  ui.input_switch("show_margins", "Show marginal plots", value=True),
44
  ),
45
- ui.output_ui("uploaded_image"), # display the uploaded TIFF sidewalk tile image
46
  ui.output_ui("value_boxes"),
47
  ui.output_plot("scatter", fill=True),
48
  ui.help_text(
@@ -63,15 +63,21 @@ def server(input: Inputs, output: Outputs, session: Session):
63
  else:
64
  return "" # No image uploaded
65
 
66
- @output
67
- @render.ui
 
 
 
 
 
 
 
 
 
68
  def uploaded_image():
69
- """Displays the uploaded image"""
70
  img_src = uploaded_image_path()
71
- if img_src:
72
- return ui.tags.img(src=str(img_src), style={"max-width": "100%"})
73
- else:
74
- return "" # Return an empty string if no image is uploaded
75
 
76
  @reactive.Calc
77
  def filtered_df() -> pd.DataFrame:
 
42
  ui.input_switch("by_species", "Show species", value=True),
43
  ui.input_switch("show_margins", "Show marginal plots", value=True),
44
  ),
45
+ ui.output_image("uploaded_image"), # display the uploaded TIFF sidewalk tile image
46
  ui.output_ui("value_boxes"),
47
  ui.output_plot("scatter", fill=True),
48
  ui.help_text(
 
63
  else:
64
  return "" # No image uploaded
65
 
66
+ # @output
67
+ # @render.ui
68
+ # def uploaded_image():
69
+ # """Displays the uploaded image"""
70
+ # img_src = uploaded_image_path()
71
+ # if img_src:
72
+ # return ui.tags.img(src=str(img_src), style={"max-width": "100%"})
73
+ # else:
74
+ # return "" # Return an empty string if no image is uploaded
75
+
76
+ @render.image
77
  def uploaded_image():
 
78
  img_src = uploaded_image_path()
79
+ img: ImgData = {"src": str(img_src), "width": "100px"}
80
+ return img
 
 
81
 
82
  @reactive.Calc
83
  def filtered_df() -> pd.DataFrame: