15Shiny Dashboards
15.1 General Organization
A Shiny dashboard has generally a schema composed of three fundamental elements: the graphical user interface definition (User Interface), the definition of actions, either reactive or nonreactive, to execute on data and variables (Server Logic), and the execution of the application (Run App). In our examples, we will follow this schema, incrementally adding elements to the dashboard, with the user interface and the server logic always kept clearly distinct. From the following schema, some key Shiny functions are shown for the user interface: fluidPage() for the definition of the dynamic layout, composed of rows (function fluidRow()), each one possibly separated in columns (function column()).
##### USER INTERFACE #####ui <- fluidPage(titlePanel( ),fluidRow(column( )),…)##### SERVER LOGIC #####server <- function(input, output, session) {…}##### RUN APP #####shinyApp(ui, server)
The definition of the user interface is tightly related to characteristics and limitations of a web application and to the current HTML standard. From this comes the fact of considering the web page as a virtual grid composed by rows and columns to be used for placing graphical elements of the dashboard. The maximum number of virtual columns is 12, of same size, while rows are unlimited in number and have variable height. This difference between rows and columns is largely motivated by an intrinsic difference between horizontal and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access