R/Shiny/bs4Dashの基礎④
sidebarとbody紐付け
こんな感じで実装(やってる感のあるダッシュボードにはまだまだ)。
library(shiny)
library(bs4Dash)
ui <- bs4DashPage(
navbar = bs4DashNavbar(),
sidebar = bs4DashSidebar(
bs4SidebarMenu(
bs4SidebarHeader(title = "x"),
bs4SidebarMenuItem(text = "x1", tabName = "x1", icon = "bar-chart"),
bs4SidebarMenuItem(text = "x2", tabName = "x2", icon = "thermometer-quarter"),
bs4SidebarMenuItem(text = "x3", tabName = "x3", icon = "snowflake-o"),
bs4SidebarHeader(title = "y"),
bs4SidebarMenuItem(text = "y1", tabName = "y1", icon = "ravelry"),
bs4SidebarMenuItem(text = "y2", tabName = "y2", icon = "user-circle-o "),
bs4SidebarMenuItem(text = "y3", tabName = "y3", icon = "car"),
bs4SidebarHeader(title = "z"),
bs4SidebarMenuItem(
text = "z1",
bs4SidebarMenuSubItem(text = "z11", tabName = "z11", icon = "area-chart"),
bs4SidebarMenuSubItem(text = "z12", tabName = "z12", icon = "battery-full"),
bs4SidebarMenuSubItem(text = "z13", tabName = "z13", icon = "bell-slash"),
icon ="bolt"
)
),
title = "yono2844",
skin = "light",
url = "https://qiita.com/yono2844",
src = "https://secure.gravatar.com/avatar/4f1b709d53f6d347a9b93e922b883ff3"
),
body = bs4DashBody(
bs4TabItems(
bs4TabItem(tabName = "x1", "x1"),
bs4TabItem(tabName = "x2", "x2"),
bs4TabItem(tabName = "x3", "x3"),
bs4TabItem(tabName = "y1", "y1"),
bs4TabItem(tabName = "y2", "y2"),
bs4TabItem(tabName = "y3", "y3"),
bs4TabItem(tabName = "z11", "z11"),
bs4TabItem(tabName = "z12", "z12"),
bs4TabItem(tabName = "z13", "z13")
)
),
controlbar = bs4DashControlbar(),
footer = bs4DashFooter(),
title = "bs4Dash"
)
server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server)
Author And Source
この問題について(R/Shiny/bs4Dashの基礎④), 我々は、より多くの情報をここで見つけました https://qiita.com/yono2844/items/0b56bca98c5f85a3c207著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .