【发布时间】:2018-07-24 07:10:14
【问题描述】:
我正在制作一个带有多个面板和选项卡的 Shiny 应用程序。这是我的 UI 的迷你版:
shinyUI(pageWithSidebar(
headerPanel("TrackAware Data Summary"),
sidebarPanel(
fileInput('file1', 'Choose CSV File',
accept=c('text/csv', 'text/comma-separated-values,text/plain', '.csv')),
tags$hr(),
checkboxInput('header', 'Header', TRUE),
width = 2,
selectInput("graph", "Choose a graph to view:",
choices = c("Best Times to Depart",
"Fastest Hour vs. Slowest Hour",
"Average Delivery Times per Driver",
"Fastest Driver vs. Slowest Driver",
"Deliveries per Driver",
"Deliveries per Day",
"Drivers per Day",
"Daily Average Delivery Times",
"Driver Consistency"
)),
submitButton("Update View")
),#end of sidebar panel
mainPanel(
width = 10,
tabsetPanel(
tabPanel("Dashboard", textOutput("text1"), textOutput("text2")),
tabPanel("Graph Switcher", plotOutput("selected_graph"))
)
))
)
在服务器端,我有创建文本输出 text1 和 text2 的代码:
output$text1 <- renderText({
"this is text1"
})
output$text2 <- renderText({
"this is text2"
})
是否可以在字体样式、字体大小、颜色、下划线方面更改 text1 和 text2 的外观?我尝试在 "width = 10" 行和 "textOutput("text2")" 行之后插入 css,但它没有改变任何东西。
tags$head(tags$style("#text1{color: red;
font-size: 20px;
font-style: italic;
}"
)
)
),
感谢任何帮助。
【问题讨论】: