refactor: modularize app into config, UI, and server components
Co-authored-by: aider (deepseek/deepseek-chat) <aider@aider.chat>
This commit is contained in:
38
R/config.R
Normal file
38
R/config.R
Normal file
@@ -0,0 +1,38 @@
|
||||
# Configuration file for St. Andrews Shiny App
|
||||
|
||||
app_config <- list(
|
||||
data_paths = list(
|
||||
owners = "./data/owners.rds",
|
||||
plats = "./data/plats/plats.shp",
|
||||
beaches = "./data/beaches.rds",
|
||||
listings = "./data/listings.rds",
|
||||
sales = "./data/sales.rds"
|
||||
),
|
||||
update_config = list(
|
||||
subdivisions = c("8120", "8113", "8171", "8195", "8221", "8163",
|
||||
"8240", "8159", "8149", "8110", "8254", "8215", "8143"),
|
||||
timeout_seconds = 300
|
||||
),
|
||||
map_config = list(
|
||||
default_lng = -82.362253,
|
||||
default_lat = 27.076199,
|
||||
default_zoom = 16,
|
||||
beach_lng = -82.4603,
|
||||
beach_lat = 27.0999,
|
||||
beach_zoom = 12
|
||||
),
|
||||
app_config = list(
|
||||
title = "St. Andrews Park",
|
||||
theme = "ios",
|
||||
dark = TRUE
|
||||
)
|
||||
)
|
||||
|
||||
# Helper function to get data path
|
||||
get_data_path <- function(data_type) {
|
||||
if (data_type %in% names(app_config$data_paths)) {
|
||||
return(app_config$data_paths[[data_type]])
|
||||
} else {
|
||||
stop(paste("Unknown data type:", data_type))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user