Rshiny:当许多输入变量和/或添加徽标时,屏幕底部的黑色水平线(好像shinydashboard“泄漏”)
我开始开发一个预测应用程序,有人可以输入一些变量值并得到一个预测(在我的例子中是生存)。我有7或8个输入变量,在左上角添加了一个徽标,并手动调整徽标、主边栏和主标题的高度。这将导致底部出现黑色水平线。如果我添加更多变量,或者如果我增加徽标/主边栏/主标题的高度,行大小会变得更糟。下面是一个可复制的示例(服务器部分为空,因为问题显然来自UI):Rshiny:当许多输入变量和/或添加徽标时,屏幕底部的黑色水平线(好像shinydashboard“泄漏”),r,shiny,shinydashboard,R,Shiny,Shinydashboard,我开始开发一个预测应用程序,有人可以输入一些变量值并得到一个预测(在我的例子中是生存)。我有7或8个输入变量,在左上角添加了一个徽标,并手动调整徽标、主边栏和主标题的高度。这将导致底部出现黑色水平线。如果我添加更多变量,或者如果我增加徽标/主边栏/主标题的高度,行大小会变得更糟。下面是一个可复制的示例(服务器部分为空,因为问题显然来自UI): 标题 title <- span(img(src = "LOGO.svg", height = '120'), style =
标题
title <- span(img(src = "LOGO.svg", height = '120'), style = "text-align: center;")
width_dash <- 300
# Define UI for application
ui <- dashboardPage(
title = "Prediction app",
# Application title
dashboardHeader(
tags$li(
class = "dropdown",
tags$style(".main-header {max-height: 120px}"),
tags$style(".main-header .logo {height: 120px;}")
),
title = title,
titleWidth = width_dash
),
# Sidebar with a slider input for number of bins
dashboardSidebar(
tags$style(".left-side, .main-sidebar {padding-top: 120px}"),
width = width_dash,
sliderInput(
"Age",
"Age (years):",
min = 15,
max = 70,
value = 30,
width = width_dash
),
numericInput(
'VAR1',
'First variable:',
0,
min = 0,
max = 100000000000,
width = width_dash
),
numericInput(
'VAR2',
'Second variable:',
0,
min = 0,
max = 100000000000,
width = width_dash
),
numericInput(
'VAR3',
'Third variable:',
0,
min = 0,
max = 100000000000,
width = width_dash
),
numericInput(
'VAR4',
'Variable 4:',
1,
min = 0,
max = 100000000000,
width = width_dash
),
numericInput(
'VAR5',
'Variable 5',
0,
min = 0,
max = 100000000000,
width = width_dash
),
numericInput(
'VAR6',
'Variable 6',
0,
min = 0,
max = 100000000000,
width = width_dash
),
numericInput(
'VAR7',
'Variable 7',
0,
min = 0,
max = 100000000000,
width = width_dash
),
br(),
actionButton('Button', 'Run app')
),
dashboardBody(tags$head(tags$style(
HTML(
'
/* logo */
.skin-blue .main-header .logo {
background-color: #ffffff;
}
/* logo when hovered */
.skin-blue .main-header .logo:hover {
background-color: #ffffff;
}
'
)
)))
)
server <- function(input, output, session) {
}
# Run the application
shinyApp(ui = ui, server = server)