r - R Shiny中2个小部件之间的空间
问题描述
有人可以解释一下在关注之间有大空格的原因吗?
server = function(input, output){
# server code
}
ui = fluidPage(
fluidRow(
column(8, offset = 0, style='padding:0px;', # Sidebar panel
sidebarPanel(useShinyjs(),
dateRangeInput('dateRange',
label = 'Filter crimes by date',
start = as.Date('2019-01-01') , end = as.Date('2021-06-01')),
selectInput("var", label = "1. Select the quantitative Variable",
choices = c("place_of_death"=3,"Month Name"=11, "cause_of_death"=8), selected = 8),
radioButtons( "dist", "Enable or disable Grouping:",
c("Enable" = "enable",
"Disable" = "disable" ), inline=T),
selectInput("var2", label = "1. Select the quantitative Variable",
choices = c("cause_of_death"=8, "year"=7), selected = 7),
radioButtons( "CauseOfDeathRad", "Enable or disable Grouping:",
c("Covid" = "covid",
"Non-Covid" = "nonCovid" ,
"Both" = "both"), inline=T),
radioButtons( "DeathonYearRad", "Enable or disable Grouping:",
c(
"2020" = "2020" ,
"2021" = "2021",
"All" = "All"), inline=T)
)),
column(2, offset = 0, style='padding:0px;', wellPanel(p("Column width 2"))),
column(2, offset = 0, style='padding:0px;', wellPanel(p("Column width 2")))
)
)
shinyApp(ui = ui, server = server)
我需要我的仪表板在不同的地块之间平均分配。但这似乎真的很难做到。感谢有人可以提供帮助
当 column(8,...) 设置为 column(3...)
解决方案
我的建议是使用fluidRow()
andcolumn()
来mainPanel()
显示绘图。用于输入的小部件可以保存在sidebarPanel()
. 尝试这个
server = function(input, output){
# server code
}
ui = fluidPage(
useShinyjs(),
sidebarLayout(
sidebarPanel(
dateRangeInput('dateRange',
label = 'Filter crimes by date',
start = as.Date('2019-01-01') , end = as.Date('2021-06-01')),
selectInput("var", label = "1. Select the quantitative Variable",
choices = c("place_of_death"=3,"Month Name"=11, "cause_of_death"=8), selected = 8),
radioButtons( "dist", "Enable or disable Grouping:",
c("Enable" = "enable",
"Disable" = "disable" ), inline=T),
selectInput("var2", label = "1. Select the quantitative Variable",
choices = c("cause_of_death"=8, "year"=7), selected = 7),
radioButtons( "CauseOfDeathRad", "Enable or disable Grouping:",
c("Covid" = "covid",
"Non-Covid" = "nonCovid" ,
"Both" = "both"), inline=T),
radioButtons( "DeathonYearRad", "Enable or disable Grouping:",
c(
"2020" = "2020" ,
"2021" = "2021",
"All" = "All"), inline=T)
),
mainPanel(
fluidRow(
column(5, offset = 0, style='padding:0px;', wellPanel(p("Column width 5"))),
column(5, offset = 0, style='padding:0px;', wellPanel(p("Column width 5")))
)
)
)
)
shinyApp(ui = ui, server = server)
推荐阅读
- sql-server - 您可以混合使用 SQL 和 MDX 语言来生成 SSRS 报告吗?
- python - Locust:如何以编程方式使用分布式模式
- ios - CollectionView 不显示任何 CollectionViewCell
- python - 如何在 3D 图形上找到连接点?
- amazon-web-services - cloudformation websockets,将请求模型添加到路由时重新部署失败
- amazon-quicksight - 有什么方法可以在 Amazon Quicksight 中同时应用 TOPN 和底部 N 过滤器
- oracle - Oracle 查询:如何返回具有 [MAX(variable) - 1] 列值的条目
- python - Geforce Nvidia MX130 上的 GPU 运行时错误
- reactjs - 将项目添加到另一个列表并使用 React 从那里删除
- python - filebot 将重复项发送到新文件夹并且不覆盖