From 7eb8c7879e59191ab33258a7947127f0f9a7a992 Mon Sep 17 00:00:00 2001 From: Rob Wiederstein Date: Mon, 9 Mar 2026 14:53:10 -0400 Subject: [PATCH] Add mailing label download buttons to Owners tab --- app.R | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app.R b/app.R index 37f05c0..4058ad9 100644 --- a/app.R +++ b/app.R @@ -233,6 +233,15 @@ ui <- f7Page( title = "Table:", divider = TRUE, DTOutput("table") + ), + f7Card( + title = "Download:", + divider = TRUE, + f7List( + inset = TRUE, + downloadButton("download_filtered", "Download Filtered"), + downloadButton("download_all", "Download All (388)") + ) ) ), #### services ---- @@ -411,6 +420,26 @@ server <- function(input, output) { ) ) }) + output$download_filtered <- downloadHandler( + filename = "st_andrews_owners_filtered.csv", + content = function(file) { + filteredOwners() |> + sf::st_drop_geometry() |> + dplyr::select(owner_1, owner_2, label) |> + write.csv(file, row.names = FALSE) + } + ) + + output$download_all <- downloadHandler( + filename = "st_andrews_owners_all.csv", + content = function(file) { + owners |> + sf::st_drop_geometry() |> + dplyr::select(owner_1, owner_2, label) |> + write.csv(file, row.names = FALSE) + } + ) + # venice map ---- output$venice_map <- renderLeaflet({ leaflet() %>%