diff --git a/.DS_Store b/.DS_Store index 5b47a7c..9efe973 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/pyforest-dashboard/global.R b/pyforest-dashboard/global.R index 2a6cbee..92e8911 100644 --- a/pyforest-dashboard/global.R +++ b/pyforest-dashboard/global.R @@ -42,29 +42,12 @@ library(rsconnect) library(fresh) library(DT) library(shinythemes) -# library(shiny.slider) #Didn't load (?) - # READ IN DATA ---- -#make sure you cd into pyforest-dashboard - -## ------------------------------------------land use assessment data ------------------------------------------ -#tsosie -# Unauthorized deforestation -# combined_illegal_df_by_dist <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_illegal_df_by_dist.rds") -# combined_illegal_df_by_dist$normalized_value <- combined_illegal_df_by_dist$sum_df_ha / combined_illegal_df_by_dist$total_area_ha -# combined_illegal_df_by_dpto <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_illegal_df_by_dpto.rds") -# combined_illegal_df_by_dpto$normalized_value <- combined_illegal_df_by_dpto$sum_df_ha / combined_illegal_df_by_dpto$total_area_ha - -## Authorized deforestation -# combined_auth_df_by_dist <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_auth_df_by_dist.rds") -# combined_auth_df_by_dist$normalized_value <- combined_auth_df_by_dist$sum_df_ha / combined_auth_df_by_dist$total_area_ha -# combined_auth_df_by_dpto <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_auth_df_by_dpto.rds") -# combined_auth_df_by_dpto$normalized_value <- combined_auth_df_by_dpto$sum_df_ha / combined_auth_df_by_dpto$total_area_ha +#make sure you change directory to pyforest-dashboard - -#local data +## ------------------------------------------land use plan assessment data ------------------------------------------ # Unauthorized deforestation combined_illegal_df_by_dist <- st_read("data/combined_illegal_df_by_dist.gpkg") combined_illegal_df_by_dist$normalized_value <- combined_illegal_df_by_dist$sum_df_ha / combined_illegal_df_by_dist$total_area_ha @@ -75,7 +58,6 @@ combined_illegal_df_by_dpto <- st_read("data/combined_illegal_df_by_dpto.gpkg") combined_illegal_df_by_dpto$normalized_value <- combined_illegal_df_by_dpto$sum_df_ha / combined_illegal_df_by_dpto$total_area_ha combined_illegal_df_by_dpto$year_range <- gsub("_", "-", combined_illegal_df_by_dpto$year_range) - # Authorized deforestation combined_auth_df_by_dist <- st_read("data/combined_auth_df_by_dist.gpkg") combined_auth_df_by_dist$normalized_value <- combined_auth_df_by_dist$sum_df_ha / combined_auth_df_by_dist$total_area_ha @@ -86,36 +68,16 @@ combined_auth_df_by_dpto$normalized_value <- combined_auth_df_by_dpto$sum_df_ha combined_auth_df_by_dpto$year_range <- gsub("_", "-", combined_auth_df_by_dpto$year_range) ## ------------------------------------------ land use assessment sub tab ------------------------------------------ -# #tsosie -# compliance <- st_read("~/../../capstone/pyforest/shinydata/lup_assessment/compliance_updated.gpkg") -# compliance <- st_transform(compliance, 4326) - -#local data compliance <- st_read("data/compliance_updated.gpkg") compliance <- st_transform(compliance, 4326) ## ------------------------------------------ deforestation and forest cover statistics data ------------------------------------------ -# #tsosie -# datadir <- path.expand("~/../../capstone/pyforest") -# py_fl_dept <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/department_forest_loss.gpkg")) -# py_fl_dist <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/district_forest_loss.gpkg")) -# chaco_fl <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/chaco_forest_loss.gpkg")) -# chaco_fc <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/chaco_forest_cover.gpkg")) - -#local data py_fl_dept <- read_sf("data/department_forest_loss.gpkg") py_fl_dist <- read_sf("data/district_forest_loss.gpkg") chaco_fl <- read_sf("data/chaco_forest_loss.gpkg") chaco_fc <- read_sf("data/chaco_forest_cover.gpkg") -#tsosie -# # Source in normalized deforestation data values -# source(here::here("pyforest-dashboard/R/forest_loss_standardizing_for_visuals.R")) -# py_fc_dept <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/department_forest_cover.gpkg")) -# py_fc_dist <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/district_forest_cover.gpkg")) - -#local data source("R/forest_loss_standardizing_for_visuals.R") py_fc_dept <- read_sf("data/department_forest_cover.gpkg") py_fc_dist <- read_sf("data/district_forest_cover.gpkg") diff --git a/pyforest-dashboard/rsconnect/shinyapps.io/hendatasrl/pyforest-dashboard.dcf b/pyforest-dashboard/rsconnect/shinyapps.io/hendatasrl/pyforest-dashboard.dcf index e9db38e..ad0b107 100644 --- a/pyforest-dashboard/rsconnect/shinyapps.io/hendatasrl/pyforest-dashboard.dcf +++ b/pyforest-dashboard/rsconnect/shinyapps.io/hendatasrl/pyforest-dashboard.dcf @@ -5,7 +5,9 @@ account: hendatasrl server: shinyapps.io hostUrl: https://api.shinyapps.io/v1 appId: 9275632 -bundleId: 7326646 +bundleId: 7367125 url: https://hendatasrl.shinyapps.io/pyforest-dashboard/ -when: 1686349009.60165 -lastSyncTime: 1686349009.60168 +when: 1687272194.96148 +lastSyncTime: 1687272194.96149 +asMultiple: FALSE +asStatic: FALSE diff --git a/pyforest-dashboard/server.R b/pyforest-dashboard/server.R index f2f06b7..863b189 100644 --- a/pyforest-dashboard/server.R +++ b/pyforest-dashboard/server.R @@ -595,12 +595,13 @@ server <- function(input, output, session) { content = function(file) { tempReport <- file.path(tempdir(), "report.Rmd") file.copy("report.Rmd", tempReport, overwrite = TRUE) - + rmarkdown::render(tempReport, output_file = file, params = list(data = compliance_filter(), map = compliance_map(), table = compliance_table())) } + ) # END PUT ID diff --git a/pyforest-dashboard/text/data_source.md b/pyforest-dashboard/text/data_source.md index 8393367..f643b71 100644 --- a/pyforest-dashboard/text/data_source.md +++ b/pyforest-dashboard/text/data_source.md @@ -1,2 +1,2 @@ -The data used in this app is sourced from the National Forestry Institute of Paraguay (INFONA). INFONA provides land use plan shapefiles and deforestation raster files, which serve as the foundation for our analysis. For the most up-to-date data, we recommend visiting [INFONA's official website](https://www.infona.gov.py/) and submitting a request for the desired information. To access our results data, please visit our [Zenodo repository](https://zenodo.org/communities/pyforest/). +The data used in this app is sourced from the National Forestry Institute of Paraguay (INFONA). INFONA provided land use plan shapefiles and deforestation raster files, which serve as the foundation for our analysis. For the most up-to-date data, we recommend visiting [INFONA's official website](https://www.infona.gov.py/) and submitting a request for the desired information. To access our results data, please visit our [Zenodo repository](https://zenodo.org/communities/pyforest/). diff --git a/pyforest-dashboard/ui.R b/pyforest-dashboard/ui.R index 9e1d296..ceb2ba3 100644 --- a/pyforest-dashboard/ui.R +++ b/pyforest-dashboard/ui.R @@ -672,7 +672,8 @@ tabItem(tabName = "put_id", style = "max-height: 100%; max-width: 100%; display: flex; align-items: center; justify-content: center;", uiOutput("maps_predictions_by_scenario") ) - ) + ), + downloadButton("downloadBtn", "Download Image") # Add download button ) ), column(width = 8,