r - Shiny - 相对于 mainPanel() 调整 sidebarPanel() 的宽度

标签 r shiny

我有以下代码段,它作为我 Shiny 的 UI 的一部分工作:

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)?

提前致谢

最佳答案

简单的 sidebarPanel(..., width = 2) 对我有用,如 R document 所示.

关于r - Shiny - 相对于 mainPanel() 调整 sidebarPanel() 的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47835628/

相关文章:

r - 基于 R 中模型平均系数的部分残差图

r - 预测值不对用户输入使用react R Shiny

css - 如何更改 Shiny 的表格输出字体大小

r - 如何在 Shiny 应用程序中下载 PDF 文件

r - 将(read.csv)导入R时,如何省略csv文件中每行结尾的分号?

r - 应用apply.quarterly()后设置每个季度的第一个月为索引

r - 在 R 中的 2 个包之间共享变量

r - 使用配置文件在 RSelenium 中自动化 Headless Firefox

html - 如何使用列名和行名或索引为 R 中数据表(DT 包)中单元格的背景着色?

r - 创建响应式(Reactive) renderUI