Skip to content

Instantly share code, notes, and snippets.

@szechno
Created February 20, 2026 21:05
Show Gist options
  • Select an option

  • Save szechno/6edb2d62b2e0b075f57ed8a650fecc36 to your computer and use it in GitHub Desktop.

Select an option

Save szechno/6edb2d62b2e0b075f57ed8a650fecc36 to your computer and use it in GitHub Desktop.
ui <-
page_sidebar(
tags$head(
tags$link(
rel="shortcut icon",
href="https://github.com/szechno/wscc_shinyapp/blob/main/favicon.ico?raw=true"
)
),
theme = bs_theme(bootswatch = "simplex",
"bslib_spacer" = "0.1rem",
# fg = "rgb(158, 79, 79)",
# fg = "#555555",
# bg = "white",
primary = "#555566",
base_font = font_google("Inter"),
code_font = font_google("JetBrains Mono")),
# includeCSS("./www/css/main1_v6a1.css"),
# includeScript("www/js/shiny_custom_message.js"),
title = "West Sussex TSS Shiny prototype 2025",
window_title = "West Sussex TSS 2025",
##  main sidebar ----
sidebar = sidebar(
position = "left",
title = "Layers and options",
# bg = "white",
open = TRUE,
# gap = 0,
# padding = 0, # use elsewhere in menu
accordion(
open = FALSE,
accordion_panel(
title = "map options",
radioGroupButtons(
"toggle_roads", "Toggle roads", choices = c("All roads", "TSS potential", "TSS actual"),
size = "sm"
),
# "colours"
sliderInput("map_refresh", "Map refresh rate (ms)", min = 100, max = 3000,
step = 50, value = 100),
### select basemaps ----
selectInput("basemap",
"Change basemap",
choices = c("voyager", "positron", "dark-matter",
"voyager-no-labels", "positron-no-labels",
"dark-matter-no-labels",
"liberty", "osm-bright", "fiord"),
selected = "voyager")
),
accordion_panel(
title = "layers",
radioGroupButtons(
"toggle_layers", "Toggle all layers", c("Default", "On", "Off", "User"),
size = "sm"
),
p(HTML("If road network is not selectable, toggle TSS Checklist OFF and ON."),
style = "font-size:0.7em;"),
## layers accordion ----
layers_accordion_panels,
),
## downloads accordion ----
accordion_panel(
title = "downloads",
"Download TSS Checklist",
actionButton("download_geopackage", "GPKG", disabled = TRUE),
actionButton("download_shapefile", "SHP", disabled = TRUE),
actionButton("download_csv", "CSV", disabled = TRUE),
"Create ASD file",
actionButton("geoplace_csv", "ASD update", disabled = TRUE),
"Create TSS polygon",
downloadButton("geoplace_poly", "Geoplace")
),
## reports accordion ----
accordion_panel(
title = "reports",
"Create TSS report",
downloadButton("report_tss", "TSS"),
"Create LR report",
downloadButton("report_lr", "LR")
)
)
),
#  map card ----
card(
full_screen = TRUE,
card_header("The map"),
layout_sidebar(
fillable = TRUE, # need to include this if dealing with plotly or leaflet
#  map sidebar ----
sidebar = sidebar(
title = "Edit USRN/ESUID",
id = "edit_usrn",
open = FALSE,
p(HTML("Choose between:<br />1. editing this ESUID [ESUID] <b>or</b> <br />2. all ESUIDs ",
"associated with this USRN with the same class [USRN class] <b>or</b> <br />3. all ESUIDs ",
"associated with this USRN regardless of class [USRN all]."),
style = "font-size:0.6em;"),
radioGroupButtons(
"toggle_usrn_esuid", "Toggle ESUID/USRN", choices = c("ESUID", "USRN class", "USRN all"),
size = "sm"
),
"USRN",
verbatimTextOutput("usrn_edit", placeholder = TRUE),
"ESUIDs",
verbatimTextOutput("esuid_edit", placeholder = TRUE),
"Street",
verbatimTextOutput("street_edit", placeholder = TRUE),
"CLASS",
verbatimTextOutput("class_edit", placeholder = TRUE),
selectInput("tss_edit", "TSS", c("D", "I", "C", "H", "")),
p(HTML("Use backspace to remove from TSS."),
style = "font-size:0.7em;"),
"LR", checkboxInput("lr_edit", "", FALSE),
"Traffic_flow", checkboxInput("traffic_flow_edit", "", FALSE),
"HGVs", checkboxInput("hgvs_edit", "", FALSE),
"Buses", checkboxInput("buses_edit", "", FALSE),
"Peds", checkboxInput("peds_edit", "", FALSE),
"Carriageway", checkboxInput("carriageway_edit", "", FALSE),
"CJ", checkboxInput("cj_edit", "", FALSE),
"Medical", checkboxInput("medical_edit", "", FALSE),
"Educational", checkboxInput("educational_edit", "", FALSE),
"Retail", checkboxInput("retail_edit", "", FALSE),
"Commercial", checkboxInput("commercial_edit", "", FALSE),
"Recreational", checkboxInput("recreational_edit", "", FALSE),
"Transport", checkboxInput("transport_edit", "", FALSE),
"Emergency", checkboxInput("emergency_edit", "", FALSE),
"AM_peak", checkboxInput("am_peak_edit", "", FALSE),
"PM_peak", checkboxInput("pm_peak_edit", "", FALSE),
"Inter_peak", checkboxInput("inter_peak_edit", "", FALSE),
"Off_peak", checkboxInput("off_peak_edit", "", FALSE),
"Inc_sats", checkboxInput("inc_sats_edit", "", FALSE),
"Sat_rec", checkboxInput("sat_rec_edit", "", FALSE),
"All_year", checkboxInput("all_year_edit", "", FALSE),
"Term_time", checkboxInput("term_time_edit", "", FALSE),
"Key_shopping", checkboxInput("key_shopping_edit", "", FALSE),
"Notes",
verbatimTextOutput("notes_edit", placeholder = TRUE),
textInput("notes_edit_plus", "Additional Notes"),
actionButton("add_notes", "Add Note", disabled = FALSE),
"Length (m)",
verbatimTextOutput("length_edit", placeholder = TRUE),
# "Save changes to record",
# actionButton("save_changes", "Save"),
# "Discard changes to record",
# actionButton("discard_changes", "Discard"),
"Save changes to file",
actionButton("commit_changes", "Commit", disabled = FALSE)
),
maplibreOutput("map", height = "800px")
)
),
#  info card ----
card(verbatimTextOutput("info")),
#  datatable card ----
card(
card_header("The data table")
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment