【发布时间】:2016-02-26 18:12:34
【问题描述】:
假设我有一个简单的闪亮应用程序,我想更改侧边栏面板背景。我已经尝试过使用 css,但我只设法改变了整个背景。你能帮帮我吗?
我的 ui.R:
library(shiny)
shinyUI(fluidPage(
includeCSS("www/moj_styl.css"),
titlePanel("Hello Shiny!"),
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
mainPanel(
plotOutput("distPlot")
)
)
))
和我的服务器。R:
library(shiny)
shinyServer(function(input, output) {
output$distPlot <- renderPlot({
x <- faithful[, 2] # Old Faithful Geyser data
bins <- seq(min(x), max(x), length.out = input$bins + 1)
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
})
和 moj_styl.css:
body {
background-color: #dec4de;
}
body, label, input, button, select {
font-family: 'Arial';
}
【问题讨论】:
标签: css r user-interface server shiny