html - 无法获取褪色的浮动ui对话框;不显示在闪亮
问题描述
我正在尝试在我的 R Shiny 地图上修复我的宽度。另外,我没有成功让面板褪色。我要复制的宽度和褪色面板位于此链接:
https://shiny.rstudio.com/gallery/superzip-example.html
我正在使用他们的样式 css 文件,此链接: https ://github.com/rstudio/shiny-examples/blob/master/063-superzip-example/styles.css
我已经写了我的代码:
library(shiny)
library(tidyverse)
library(leaflet.extras)
library(leaflet)
library(RColorBrewer)
library(scales)
library(lattice)
library(dplyr)
fake_data <- read.csv("https://raw.githubusercontent.com/gabrielburcea/stackoverflow_fake_data/master/gather_divided.csv")
# Define UI for application that draws a histogram
ui <- fluidPage(
navbarPage("Covid-19 Symptom Tracker", id = "nav",
tabPanel("Interactive map",
div(class = "outer",
tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "style.css")
),
leafletOutput("map", width = "100%", height = "96vh"), #height = "99vh"
#Floating panel
absolutePanel(id = "controls", class = "panel panel-default", fixed = TRUE,
draggable = TRUE, top = 60, left = "auto", right = 20, bottom = "auto",
width = 330, height = "auto",
h4("SARS-Covid-19 symptoms"),
selectInput("symptom", "Select symptom", c("Chills",
"Cough", "Diarrhoea",
"Fatigue",
"Headache",
"Loss of smell and taste",
"Muscle ache",
"Nasal congestion",
"Nausea and vomiting",
"Shortness of breath",
"Sore throat",
"Sputum",
"Temperature")
),
tags$div(id="cite",
'Data provided by Your.md'
)
)))
)
)
server <- function(input, output) {
filtered_data <- reactive({
fake_data %>%
dplyr::filter(Symptom %in% input$symptom)
})
output$map <- renderLeaflet({
leaflet() %>%
addTiles(urlTemplate = "//{s}.tiles.mapbox.com/v3/jcheng.map-5ebohr46/{z}/{x}/{y}.png",
attribution = 'Maps by <a href="http://www.mapbox.com/">Mapbox</a>') %>%
addMarkers(data = filtered_data(), clusterOptions = markerClusterOptions())
})
}
# Run the application
shinyApp(ui = ui, server = server)
我使用的 css 样式(和他们的一样)在这里: https ://github.com/gabrielburcea/stackoverflow_fake_data/blob/master/style.css
我拥有的面板是这个,它与我提供的链接中的面板明显不同:
解决方案
推荐阅读
- c# - c# Windows 窗体 - 使用分层窗口样式 WS_EX_LAYERED 参考 32bpp BGRA BackgroundImage 以获得 alpha 透明度支持?
- c++ - curl_slist->next 永远不会为空,因此 while 循环会卡住
- r - 将熔化功能应用于多个 .txt 文件
- pyqt5 - 双击日历日期单元格 PyQt5
- c# - 如何将数据库信息传输到 asp.net mvc 中的另一个控制器
- mysql - 匹配两个表中的记录
- bash - 一次读取一行文件,然后比较 grepped 日期(在 bash 中)
- node.js - 邮递员“错误:ValidationError:用户名:路径‘用户名’是必需的。”
- python - sympy:显示表达式中已替换的所有符号变量
- c++ - 将 cmake 链接到 Visual Studio 的 cmake 工具