shinydashboard के साथ डैशबोर्ड बनाना
Png Kee Seng
Researcher
dashboardBody() से परिभाषित होती है और प्रचलन में body के रूप में सहेजी जाती हैbody <- dashboardBody(...)

fluidRow() से rows जोड़ेंbox() से boxes जोड़ें
body <- dashboardBody(fluidRow(box("Row 1, box 1"), box("Row 1, box 2")), fluidRow(box("Row 2, box 1"), box("Row 2, box 2")))

body <- dashboardBody( fluidRow(box("Row 1, box 1",plotOutput('plot')),box("Row 1, box 2")), fluidRow(box("Row 2, box 1"), box("Row 2, box 2",selectInput("select", "Select team number:", choices = c(1,2)))))
width सेट करेंbox() जोड़ना अत्यधिक अनुशंसित है
body <- dashboardBody(
fluidRow(box("Row 1, box 1"),
box("Row 1, box 2"),
box("Row 1, box 3")),
fluidRow(box("Row 2, box 1"),
box("Row 2, box 2"))
)
body <- dashboardBody(
fluidRow(box("Row 1, box 1", width = 3),
box("Row 1, box 2", width = 5),
box("Row 1, box 3", width = 4)),
fluidRow(box("Row 2, box 1"),
box("Row 2, box 2"))
)
valueBox()infoBox()
body <- dashboardBody( fluidRow(valueBox(value = 3, subtitle = "कुल दिए गए रेड कार्ड्स", icon = icon("user"), color = "red"),infoBox(value = 158, title = "कुल किए गए गोल्स", icon = icon("futbol")) ))
valueBox() और infoBox() के रूपांतर:
valueBoxOutput() और infoBoxOutput()renderValueBox() और renderInfoBox() भी होते हैंvalueBox() और infoBox() आवश्यक हैं
body <- dashboardBody(
fluidRow(valueBoxOutput(outputId = "valuebox1"),
infoBoxOutput(outputId = "infobox1")
))
server <- function(input, output){
output$valuebox1 <- renderValueBox(
valueBox(3, "कुल दिए गए रेड कार्ड्स",
icon = icon("user"), color = "red"))
output$infobox1 <- renderInfoBox(
infoBox(158,
title = "कुल किए गए गोल्स",
icon = icon("futbol")))
}
plotOutput():renderPlot():server() में रखा जाता हैggplot() ऑब्जेक्ट होता हैvalueBoxOutput():renderValueBox():server() में रखा जाता हैvalueBox() ऑब्जेक्ट होता हैtabItems() जोड़ेंगेtabItem() से परिभाषित होता हैmenuItem()-tabItem() जोड़ी के लेबल मैच करने चाहिए
sidebar <- dashboardSidebar( sidebarMenu( id = "pages",menuItem("Many charts", tabName = "charts", icon = icon("chart-line"), badgeLabel = "New content!", badgeColor = "green"),menuItem("Statistics", icon = icon("file-excel"), tabName = "statistics", badgeLabel = "urgent", badgeColor = "red") ))body <- dashboardBody( tabItems(tabItem("charts", "Charts go here." ), tabItem("statistics", "Statistics go here." )))
tabsetPanel() से भी बन सकता हैtabPanel() से परिभाषित होता हैtabItems() और tabItem() से न मिलाएँ
body <- dashboardBody(tabsetPanel(tabPanel("Distributions", box(plotOutput("dist"))), tabPanel("Statistics", dateInput("matchdate", "मैच की तारीख दर्ज करें:", value = "2022-11-20"), valueBoxOutput("red"), valueBoxOutput("yellow")), tabPanel("Data", "Data goes here.", tableOutput("data"))))server <- function(input, output){ output$red <- renderValueBox(valueBox(0, "Red cards")) output$yellow <- renderValueBox(valueBox(6, "Yellow cards")) }
shinydashboard के साथ डैशबोर्ड बनाना