Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何修复semantic.dashboard中的布局?_R_Shiny_Rstudio_Semantic Ui_Dashboard - Fatal编程技术网

如何修复semantic.dashboard中的布局?

如何修复semantic.dashboard中的布局?,r,shiny,rstudio,semantic-ui,dashboard,R,Shiny,Rstudio,Semantic Ui,Dashboard,我正在尝试使用R中的semantic.dashboard包创建仪表板。仪表板的布局有问题。当我向仪表板添加组件时,组件不会延伸到页面的宽度 我从semantic.dashboard github repo中的示例中获取了以下代码。当我运行它时,它工作得非常好。我看到侧边栏菜单和主体中的框之间有一个空格。我希望组件在没有侧栏菜单空间的情况下对齐。我有没有办法做到这一点 library(shiny) library(shiny.semantic) library(semantic.dashboard

我正在尝试使用R中的semantic.dashboard包创建仪表板。仪表板的布局有问题。当我向仪表板添加组件时,组件不会延伸到页面的宽度

我从semantic.dashboard github repo中的示例中获取了以下代码。当我运行它时,它工作得非常好。我看到侧边栏菜单和主体中的框之间有一个空格。我希望组件在没有侧栏菜单空间的情况下对齐。我有没有办法做到这一点

library(shiny)
library(shiny.semantic)
library(semantic.dashboard)
library(plotly)
library(DT)

ui <- dashboardPage(
dashboardHeader(dropdownMenuOutput("dropdown"),
              dropdownMenu(type = "notifications",
                           taskItem("Project progress...", 50.777, 
color = "red")),
              dropdownMenu(icon = uiicon("red warning sign"),
                           notificationItem("This is an important 
notification!", color = "red"))),
dashboardSidebar(side = "left",
               sidebarMenu(
                 menuItem(tabName = "plot_tab", text = "My plot", 
                          icon = icon("home")),
                 menuItem(tabName = "table_tab", text = "My table", 
                          icon = icon("smile")))),
dashboardBody(
       tabItems(
          tabItem(tabName = "plot_tab",
          fluidRow(
            valueBox("Unread Mail", 44, icon("mail"), color = 
                     "blue", width = 5)),
          fluidRow(
            box(title = "Sample box", color = "blue", width = 11,
                selectInput(inputId = "variable1", choices = 
                            names(mtcars),
                            label = "Select first variable", 
                            selected = "mpg"),
                selectInput(inputId =  "variable2", choices = 
                            names(mtcars),
                            label = "Select second variable", 
                            selected = "cyl"),
                plotlyOutput("mtcars_plot")),

            tabBox(title = "Sample box", color = "blue", width = 5,
                   collapsible = FALSE,
                   tabs = list(
                     list(menu = "First Tab", content = "Some 
                          text..."),
                     list(menu = "Second Tab", content = 
                          plotlyOutput("mtcars_plot2"))
                         )))),
            tabItem(tabName = "table_tab",
                     fluidRow(
                              valueBox("Unread Mail", 144, 
                                       icon("mail"),
                                       color = "blue", width = 6, 
                                       size = "small"),
            valueBox("Spam", 20, icon("mail"), color = "red", width 
                     = 5, size = "small"),
            valueBox("Readed Mail", 666, icon("mail"), color = 
                     "green", width = 5, size = "small")
                     ),
            fluidRow(
            box(title = "Classic box", color = "blue", ribbon = 
                FALSE, title_side = "top left", width = 14,
                tags$div(
                  dataTableOutput("mtcars_table")
                  , style = paste0("color:", 
                    semantic_palette[["blue"]], ";"))
                ))))
         ), theme = "darkly"
     )

server <- function(input, output) {

output$mtcars_plot <- renderPlotly(
                      plot_ly(mtcars, x = ~ mtcars[ , 
                               input$variable1],
                               y = ~ mtcars[ ,input$variable2],
                                type = "scatter", mode ="markers")
  )
output$mtcars_plot2 <- renderPlotly(
                       plot_ly(mtcars, x = ~ mtcars[ , 
                               input$variable1],
                               y = ~ mtcars[ ,input$variable2],
                               type = "scatter", mode ="markers"))

output$mtcars_table <- renderDataTable(mtcars, options = 
                                      list(dom ='t'))

output$dropdown <- renderDropdownMenu({
dropdownMenu(messageItem("User", "Test message", color = "teal", 
style = "min-width: 200px"),
             messageItem("Users", "Test message", color = "teal", 
icon = "users"),
             messageItem("See this", "Another test", icon = 
"warning", color = "red"))
})
}

shinyApp(ui, server)
库(闪亮)
库(shinny.semantic)
库(semantic.dashboard)
图书馆(绘本)
图书馆(DT)

你能解决这个问题吗?我遇到了一个类似的问题,当我运行“完整代码”段时,它对我来说看起来不一样。增加的填充和颜色不匹配。