R 闪亮-调整侧栏面板()相对于主面板()的宽度
我有以下代码段作为我闪亮的UI的一部分:R 闪亮-调整侧栏面板()相对于主面板()的宽度,r,shiny,R,Shiny,我有以下代码段作为我闪亮的UI的一部分: fluidPage( titlePanel("Complaints this month"), tabsetPanel( tabPanel( "Opened", sidebarLayout( sidebarPanel( sliderInput('sampleSize', 'Sample Size', min = 1, max
fluidPage(
titlePanel("Complaints this month"),
tabsetPanel(
tabPanel(
"Opened",
sidebarLayout(
sidebarPanel(
sliderInput('sampleSize', 'Sample Size', min = 1, max = nrow(ThisMonthCreated),
value = 1000, step = 500, round = 0),
selectInput('Openedx', 'X', choices = nms1, selected = "ActualDateCreated"),
selectInput('Openedy', 'Y', choices = nms1, selected = "TimeToAcknowledge"),
selectInput('Openedcolor', 'Color', choices = nms1, selected = "SimpleBusinessArea"),
selectInput('Openedfacet_row', 'Facet Row', c(None = '.', nms1), selected = "none"),
selectInput('Openedfacet_col', 'Facet Column', c(None = '.', nms1)),
sliderInput('OpenedHeight', 'Height of plot (in pixels)',
min = 100, max = 2000, value = 680)
),
mainPanel(
plotlyOutput("Open", height = "600px")
)
)
)
)
)
)
我试图通过调整侧边栏面板中的东西的宽度来调整侧边栏面板,但这当然不会影响侧边栏面板的实际宽度。它只会影响内部特定事物的大小,因此不会提供期望的结果:
sidebarLayout(
sidebarPanel(
sliderInput('sampleSize', 'Sample Size', min = 1, max = nrow(ThisMonthCreated),
value = 1000, step = 500, round = 0, width = "50%"),
selectInput('Openedx', 'X', choices = nms1, selected = "ActualDateCreated", width = "50%"),
selectInput('Openedy', 'Y', choices = nms1, selected = "TimeToAcknowledge", width = "50%"),
selectInput('Openedcolor', 'Color', choices = nms1, selected = "SimpleBusinessArea", width = "50%"),
selectInput('Openedfacet_row', 'Facet Row', c(None = '.', nms1), selected = "none", width = "50%"),
selectInput('Openedfacet_col', 'Facet Column', c(None = '.', nms1), width = "50%"),
sliderInput('OpenedHeight', 'Height of plot (in pixels)',
min = 100, max = 2000, value = 680, width = "50%")
),
mainPanel(
plotlyOutput("Open", height = "600px")
)
)
我希望它使侧边栏面板是主面板的1/3(我可能不想根据它的外观进行调整)。这是可行的,还是我必须为每个选项卡中的两个面板提供特定的宽度参数(例如1000px)
提前感谢简单的侧边栏面板(…,宽度=2)对我有效,如图R所示。我想你不能。我记得我在某个地方读到过,它与引导设置(Shinny使用)有关,其中侧边栏的宽度为4个单位,主面板的宽度为8个单位。恐怕您需要切换到
fluidRow
+列
并进行一些手工设计。我明白了-在这种情况下,我将以手动方式进行此操作,并将其编辑到问题中,作为我尝试的另一种方式供将来参考您考虑过使用flexdashboard吗?-这允许控制边栏宽度是的,它看起来非常好!我从未接触过flexdashboard(这是我有史以来第一个闪亮的项目),所以如果我能得到我想要的东西,我必须先学习它,然后才能更新-谢谢你指出这一点