Skip to content

Commit c0f21df

Browse files
committed
move picker input in server
1 parent 23afb9b commit c0f21df

5 files changed

Lines changed: 16 additions & 6 deletions

File tree

.DS_Store

6 KB
Binary file not shown.

R/.DS_Store

6 KB
Binary file not shown.

emissions-dashboard.Rproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: c9648533-bc2b-4ac7-96f9-d30de76b5963
23

34
RestoreWorkspace: Default
45
SaveWorkspace: Default

server.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,19 @@ server <- function(input, output, session) {
315315
}
316316
})
317317

318+
# ---- Prep country select input ----
319+
output$country_picker_ui <- renderUI({
320+
req(broadcasting_emissions)
321+
322+
pickerInput(
323+
inputId = "country_select_input",
324+
label = NULL,
325+
choices = c("All Countries", sort(unique(broadcasting_emissions$country_name[broadcasting_emissions$country_name != "All Countries"]))),
326+
selected = "All Countries",
327+
options = list(`live-search` = TRUE, `noneSelectedText` = "All Countries")
328+
)
329+
})
330+
318331

319332
# ---- Initialize emissions map ----
320333
output$emissions_map <- renderMapdeck({

ui.R

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,8 @@ navbarPage(
335335
), # END infoPopup
336336

337337
# Country select dropdown
338-
pickerInput(inputId = "country_select_input",
339-
label = NULL,
340-
choices = c("All Countries", sort(unique(broadcasting_emissions$country_name[broadcasting_emissions$country_name != "All Countries"]))),
341-
selected = "All Countries",
342-
options = list(`live-search` = TRUE,
343-
`noneSelectedText` = "All Countries")), # END pickerInput (country select)
338+
uiOutput("country_picker_ui"),
339+
344340

345341
# Add no data warning (when a country for a selected year has no emissions)
346342
tags$div(

0 commit comments

Comments
 (0)