Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,6 +21,7 @@ app_ui = ui.page_fillable(
|
|
| 21 |
shinyswatch.theme.minty(),
|
| 22 |
ui.layout_sidebar(
|
| 23 |
ui.sidebar(
|
|
|
|
| 24 |
# Artwork by @allison_horst
|
| 25 |
ui.input_selectize(
|
| 26 |
"xvar",
|
|
@@ -53,6 +54,20 @@ app_ui = ui.page_fillable(
|
|
| 53 |
|
| 54 |
|
| 55 |
def server(input: Inputs, output: Outputs, session: Session):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
@reactive.Calc
|
| 57 |
def filtered_df() -> pd.DataFrame:
|
| 58 |
"""Returns a Pandas data frame that includes only the desired rows"""
|
|
|
|
| 21 |
shinyswatch.theme.minty(),
|
| 22 |
ui.layout_sidebar(
|
| 23 |
ui.sidebar(
|
| 24 |
+
ui.input_file("tile_image", "Choose TIFF File", accept=[".tif"], multiple=False),
|
| 25 |
# Artwork by @allison_horst
|
| 26 |
ui.input_selectize(
|
| 27 |
"xvar",
|
|
|
|
| 54 |
|
| 55 |
|
| 56 |
def server(input: Inputs, output: Outputs, session: Session):
|
| 57 |
+
@reactive.Calc
|
| 58 |
+
def uploaded_image_path() -> str:
|
| 59 |
+
"""Returns the path to the uploaded image"""
|
| 60 |
+
if input.tile_image() is not None:
|
| 61 |
+
return input.tile_image()[0] # Assuming multiple=False
|
| 62 |
+
else:
|
| 63 |
+
return "" # No image uploaded
|
| 64 |
+
|
| 65 |
+
@output
|
| 66 |
+
@render.ui
|
| 67 |
+
def uploaded_image():
|
| 68 |
+
"""Displays the uploaded image"""
|
| 69 |
+
return ui.tags.img(src=uploaded_image_path(), style={"max-width": "100%"})
|
| 70 |
+
|
| 71 |
@reactive.Calc
|
| 72 |
def filtered_df() -> pd.DataFrame:
|
| 73 |
"""Returns a Pandas data frame that includes only the desired rows"""
|