Skip to content

Commit e2960df

Browse files
text
1 parent cd9730a commit e2960df

File tree

6 files changed

+12
-46
lines changed

6 files changed

+12
-46
lines changed

.DS_Store

0 Bytes
Binary file not shown.

pyforest-dashboard/global.R

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,12 @@ library(rsconnect)
4242
library(fresh)
4343
library(DT)
4444
library(shinythemes)
45-
# library(shiny.slider) #Didn't load (?)
46-
4745

4846
# READ IN DATA ----
4947

50-
#make sure you cd into pyforest-dashboard
51-
52-
## ------------------------------------------land use assessment data ------------------------------------------
53-
#tsosie
54-
# Unauthorized deforestation
55-
# combined_illegal_df_by_dist <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_illegal_df_by_dist.rds")
56-
# combined_illegal_df_by_dist$normalized_value <- combined_illegal_df_by_dist$sum_df_ha / combined_illegal_df_by_dist$total_area_ha
57-
# combined_illegal_df_by_dpto <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_illegal_df_by_dpto.rds")
58-
# combined_illegal_df_by_dpto$normalized_value <- combined_illegal_df_by_dpto$sum_df_ha / combined_illegal_df_by_dpto$total_area_ha
59-
60-
## Authorized deforestation
61-
# combined_auth_df_by_dist <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_auth_df_by_dist.rds")
62-
# combined_auth_df_by_dist$normalized_value <- combined_auth_df_by_dist$sum_df_ha / combined_auth_df_by_dist$total_area_ha
63-
# combined_auth_df_by_dpto <- read_rds("~/../../capstone/pyforest/lup_assessment_data/compliance_results/combined_auth_df_by_dpto.rds")
64-
# combined_auth_df_by_dpto$normalized_value <- combined_auth_df_by_dpto$sum_df_ha / combined_auth_df_by_dpto$total_area_ha
48+
#make sure you change directory to pyforest-dashboard
6549

66-
67-
#local data
50+
## ------------------------------------------land use plan assessment data ------------------------------------------
6851
# Unauthorized deforestation
6952
combined_illegal_df_by_dist <- st_read("data/combined_illegal_df_by_dist.gpkg")
7053
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")
7558
combined_illegal_df_by_dpto$normalized_value <- combined_illegal_df_by_dpto$sum_df_ha / combined_illegal_df_by_dpto$total_area_ha
7659
combined_illegal_df_by_dpto$year_range <- gsub("_", "-", combined_illegal_df_by_dpto$year_range)
7760

78-
7961
# Authorized deforestation
8062
combined_auth_df_by_dist <- st_read("data/combined_auth_df_by_dist.gpkg")
8163
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
8668
combined_auth_df_by_dpto$year_range <- gsub("_", "-", combined_auth_df_by_dpto$year_range)
8769

8870
## ------------------------------------------ land use assessment sub tab ------------------------------------------
89-
# #tsosie
90-
# compliance <- st_read("~/../../capstone/pyforest/shinydata/lup_assessment/compliance_updated.gpkg")
91-
# compliance <- st_transform(compliance, 4326)
92-
93-
#local data
9471
compliance <- st_read("data/compliance_updated.gpkg")
9572
compliance <- st_transform(compliance, 4326)
9673

9774
## ------------------------------------------ deforestation and forest cover statistics data ------------------------------------------
98-
# #tsosie
99-
# datadir <- path.expand("~/../../capstone/pyforest")
100-
# py_fl_dept <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/department_forest_loss.gpkg"))
101-
# py_fl_dist <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/district_forest_loss.gpkg"))
102-
# chaco_fl <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/chaco_forest_loss.gpkg"))
103-
# chaco_fc <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/chaco_forest_cover.gpkg"))
104-
105-
#local data
10675
py_fl_dept <- read_sf("data/department_forest_loss.gpkg")
10776
py_fl_dist <- read_sf("data/district_forest_loss.gpkg")
10877
chaco_fl <- read_sf("data/chaco_forest_loss.gpkg")
10978
chaco_fc <- read_sf("data/chaco_forest_cover.gpkg")
11079

11180

112-
#tsosie
113-
# # Source in normalized deforestation data values
114-
# source(here::here("pyforest-dashboard/R/forest_loss_standardizing_for_visuals.R"))
115-
# py_fc_dept <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/department_forest_cover.gpkg"))
116-
# py_fc_dist <- read_sf(file.path(datadir, "lup_assessment_data/fc_fl_analysis_results/district_forest_cover.gpkg"))
117-
118-
#local data
11981
source("R/forest_loss_standardizing_for_visuals.R")
12082
py_fc_dept <- read_sf("data/department_forest_cover.gpkg")
12183
py_fc_dist <- read_sf("data/district_forest_cover.gpkg")

pyforest-dashboard/rsconnect/shinyapps.io/hendatasrl/pyforest-dashboard.dcf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ account: hendatasrl
55
server: shinyapps.io
66
hostUrl: https://api.shinyapps.io/v1
77
appId: 9275632
8-
bundleId: 7326646
8+
bundleId: 7367125
99
url: https://hendatasrl.shinyapps.io/pyforest-dashboard/
10-
when: 1686349009.60165
11-
lastSyncTime: 1686349009.60168
10+
when: 1687272194.96148
11+
lastSyncTime: 1687272194.96149
12+
asMultiple: FALSE
13+
asStatic: FALSE

pyforest-dashboard/server.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,12 +595,13 @@ server <- function(input, output, session) {
595595
content = function(file) {
596596
tempReport <- file.path(tempdir(), "report.Rmd")
597597
file.copy("report.Rmd", tempReport, overwrite = TRUE)
598-
598+
599599
rmarkdown::render(tempReport, output_file = file,
600600
params = list(data = compliance_filter(),
601601
map = compliance_map(),
602602
table = compliance_table()))
603603
}
604+
604605
) # END PUT ID
605606

606607

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
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/).
1+
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/).
22

pyforest-dashboard/ui.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,8 @@ tabItem(tabName = "put_id",
672672
style = "max-height: 100%; max-width: 100%; display: flex; align-items: center; justify-content: center;",
673673
uiOutput("maps_predictions_by_scenario")
674674
)
675-
)
675+
),
676+
downloadButton("downloadBtn", "Download Image") # Add download button
676677
)
677678
),
678679
column(width = 8,

0 commit comments

Comments
 (0)