LoslegenKostenlos loslegen

The body, and completing the UI

You have set up the header and sidebar Now, you can set up the body.

This is a crucial part of the wireframing process, since it will help you decide where to position your outputs and inputs in their desired positions within the main body of the dashboard.

In this exercise, you will place several outputs and inputs in the dashboard. In doing so, you will obtain all three components of the user interface, which will be put together in dashboardPage().

Diese Übung ist Teil des Kurses

Building Dashboards with shinydashboard

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

header <- dashboardHeader(title = "Soccer tournament")

sidebar <- dashboardSidebar(
  sidebarMenu(
    menuItem("Matches", tabName = "matchtab", icon = icon("futbol")), 
    menuItem("General statistics", tabName = "statstab", icon = icon("chart-line")) 
  )
)

body <- dashboardBody(tabItems(
  tabItem(tabName = "matchtab", 
  fluidRow(selectInput("match", "Match number", choices = 1:nrow(soccer))) 
         ),
  # See that the second tab should contain three sub-tabs
  ___(tabName = ___, 
          ___(tabPanel("Goals"), 
                 ___("Yellow cards"),
                 ___(___))
         )
))
Code bearbeiten und ausführen