【发布时间】:2019-07-06 15:42:51
【问题描述】:
如何在 Shiny 应用程序的范围滑块的每一侧显示不同的颜色?当您在任一侧滑动时,颜色也应自动填充
[2
库(shinyWidgets) 图书馆(闪亮)
shinyUI(fluidPage(
# 应用程序标题 titlePanel("老忠实间歇泉数据"),
# 带有滑动条输入箱数的侧边栏 侧边栏布局( 侧边栏面板(
#tags$style(HTML(".js-irs-0 .irs-single, .js-irs-0 .irs-bar-edge, .js-irs-0 .irs-bar {background: purple}")),
tags$head( tags$style( type = "text/css", '
.irs-line-mid{
background: yellow ;
border: 1px black ;
}
.irs-line-left{
background: red ;width: 100%;
# border-top: 1px red ; #solid #CCC ;
# border-left: 1px blue ;
# border-bottom: 1px blue ;# solid #CCC ;
}
.irs-line-right{
background: green ;width: 100%;
}
.irs-bar {
background: linear-gradient(to right, green, green);
border-top: 1px red ; #solid #CCC ;
border-left: 1px blue ;
border-bottom: 1px blue ;# solid #CCC ;
}
.irs-bar-edge {
background: green ; #inherit ;
border: blue ; #inherit ;
}
')),
#chooseSliderSkin("Modern",color = "blue"),
#setSliderColor(c("red" ),1),#", "#FF4500", "", "Teal"), c(1, 2, 4)),
sliderInput("range",
"RangeNumber of bins:",
min = 1,
max = 50,
value = c(30,40),step =0.1)),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
) ))
【问题讨论】:
标签: r shiny shinydashboard