Почему моя карта листовок не реагирует на раскрывающиеся окна и ползунки пользовательского интерфейса?Я могу загрузить карту и боковые панели + ползунки, но они не являются интерактивными -_- Я не уверен, правильно ли я указал реактивность на сервере?
xxxxxxxxxxlalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
GLOBAL
library(shiny)
library(shinythemes)
library(leaflet)
library(RColorBrewer)
library(formattable)
library(dplyr)
набор данных нагрузки
murals <- read.csv("https://data.cityofchicago.org/api/views/we8h-apcf/rows.csv?accessType=DOWNLOAD",
stringsAsFactors = F)
circle.scaler <- function(x){((x-min(x))/(max(x)-min(x)))*500}
UI
ui <- bootstrapPage(
tags$style(type = "text/css", "html, body {width:100%;height:100%}"),
leafletOutput("mymap", width = "100%", height = "100%"),
absolutePanel(top = 10, right = 10,
theme = shinytheme("lumen"),
titlePanel("Chicago Neighborhood Murals"),
selectInput("Artist.Credit",
label = "Artist",
choices = c("All",
unique(as.character(murals$Artist.Credit))),
selected = "Renee Robins"),
selectInput("Artwork.Title",
label = "Title",
choices = c("All",
unique(as.character(murals$Artwork.Title))),
selected = "Kaleidoscope of Hidden Worlds"),
sliderInput("Year.Installed", "Year Installed", min(murals$Year.Installed),
max(murals$Year.Installed), value = range(murals$Year.Installed),sep =""),
uiOutput("YearSlider")))
SERVER
server <- function(input, output, session) {
filteredData <- reactive({
req(input$Year.Installed)
req(input$Artist.Credit)
req(input$Artwork.Title)
murals[murals$Year.Installed <= input$yearslideroutput[1]
& murals$Year.Installed >= input$yearslideroutput[2]
& murals$Artist.Credit == input$Artist.Credit
& murals$Artwork.Title == input$Artwork.Title,]
})
output$mymap <- renderLeaflet({
leaflet(murals) %>%
addTiles() %>%
addCircleMarkers(lng = ~Longitude,
lat = ~Latitude,
popup = paste("Artist:", input$Artist.Credit, "<br>",
"Medium:", murals$Media, "<br>",
"Location Description:", murals$Location.Description, "<br>",
"Ward:", murals$Wards, "<br>",
"Year:", murals$Year.Installed, "<br>",
"Year Restored:", murals$Year.Restored))
}) }