This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
neighbourhood_map_module.R
81 lines (72 loc) · 2.02 KB
/
neighbourhood_map_module.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
neighbourhoodMapUI <- function(id){
ns <- NS(id)
fluidPage(
tagList(
fluidRow(
style = "max-width: 1200px;margin-top:-20px;",
column(
width = 2,
shinyWidgets::pickerInput(
inputId = ns("select_map"),
inline = TRUE,
label = "",
choices = c("Count",
"Sentiment"),
selected = "Count"
)
),
column(
width = 5,
br(),
tabsetPanel(
id = ns("map_descriptions"),
type = "hidden",
tabPanelBody(ns("map"), shiny::uiOutput(ns("description_ui")))
)
),
column(
width = 1,
br(),
tabsetPanel(
id = ns("map_exclude"),
type = "hidden",
tabPanelBody(ns("map"), shiny::uiOutput(ns("exclude_ui")))
)
)
),
br(), br(),
tabsetPanel(
id = ns("map_tabs"),
type = "hidden",
tabPanelBody(ns("map"), shiny::uiOutput(ns("tabs_ui")))
)
)
)
}
neighbourhoodMap <- function(input, output, session,
query_info) {
observeEvent(input$select_map, {
updateTabsetPanel(session, "map_tabs", selected = input$select_map)
})
observeEvent(input$select_map, {
updateTabsetPanel(session, "map_descriptions", selected = input$select_map)
})
observeEvent(input$select_map, {
shiny::callModule(module = mapPlot,
id = "map_plot",
query_info = query_info,
selected = input$select_map)
})
output$description_ui = renderUI({
req(input$select_map)
mapPlotUI(session$ns("map_plot"), input$select_map)[["description"]]
})
output$exclude_ui = renderUI({
req(input$select_map)
mapPlotUI(session$ns("map_plot"), input$select_map)[["exclude"]]
})
output$tabs_ui = renderUI({
req(input$select_map)
mapPlotUI(session$ns("map_plot"), input$select_map)[["plot"]]
})
}