Shiny Dashboard Cheat Sheet



Shiny’s expanding capabilities are rapidly transforming how it is used in an enterprise. This talk details the creation of a large-scale application, supporting hundreds of concurrent users, making use of the future and promises packages. The 100,000 genomes project is an ambitious exercise that follows on from the Human Genome Project - aiming to put the UK at the forefront of genomic medicine, with the NHS as the first health service in the world to offer precision medicine to patients with rare diseases and cancer. Data is at the heart of this project; not only the outputs of the genomic sequencing, but vast amounts of metadata used to track progress against the 100,000 genome target and the status and path of each case through the sample tracking pipeline. In order to make this data readily available to stakeholders, Shiny was used to create an application containing multiple interactive dashboards. A scaled-up version of the app is being rolled out in early 2019 to a much larger audience to support the National Genomics Informatics Service, with the challenge of creating a complex app capable of supporting so many users without grinding to a halt. In this talk, I will explain why Shiny was the obvious technology choice for this task, and discuss the design decisions which enabled this project's success.

  1. Shiny Dashboard Icons
  2. Shiny Dashboard Layout
  3. Shiny Dashboard Tabs
View Materials

Shiny Cheat Sheet learn more at shiny.rstudio.com Shiny 0.10.0 Updated: 6/14 1. Structure Each app is a directory that contains a server.R file and usually a ui.R file (plus optional extra files) app-name!!!!!r.r ' server.R ui.R DESCRIPTION README www (optional) used in showcase mode (optional) data, scripts, etc. In this guide you’ll find both original content and curated resources to: + Build R shiny apps from scratch + Select the optimal dashboard framework for your R shiny app dashboard + R packages to build interactive, professional quality data visualization + Improve the user experience and dashboard speed tricks + All the ways you can deploy and share R shiny app dashboards + Lessons from a. The UI for a Shiny app is built out of these pieces of HTML. The shinydashboard package provides a set of functions designed to create HTML that will generate a dashboard. If you copy the UI code for a dashboard page (above) and paste into the R console, it will print out HTML for the dashboard. Update Shiny is a great tool for fast prototyping. When a data science team creates a Shiny app, sometimes it becomes very popular. From that point this app becomes a tool used on production by many people, that should be reliable and work fast for many concurrent users. The Shiny Cheat Sheet 20m. The Shiny Gallery 20m. Deploying Apps to shinyapps.io 10m. Shiny and plotly in Dashboards 3m. Intro to flexdashboard 15m.

Basics

A dashboard has three parts: a header, a sidebar, and a body. Here’s the most minimal possible UI for a dashboard page.

You can quickly view it at the R console by using the shinyApp() function. (You can also use this code as a single-file app).

Obviously, this dashboard isn’t very useful. We’ll need to add components that actually do something. In the body we can add boxes that have content.

Basic dashboard

Next, we can add content to the sidebar. For this example we’ll add menu items that behave like tabs. These function similarly to Shiny’s tabPanels: when you click on one menu item, it shows a different set of content in the main body.

There are two parts that need to be done. First, you need to add menuItems to the sidebar, with appropriate tabNames.

Shiny

Shiny Dashboard Icons

In the body, add tabItems with corrsponding values for tabName:

The default display, also shown when the “Dashboard” menu item is clicked:

And the display when “Widgets” is clicked:

SheetDashboard

Basic dashboard with tabs 2

That covers the very basics of using shinydashboard.

Dashboard

Shiny Dashboard Layout

R shiny dashboard cheat sheet

Shiny Dashboard Tabs

Next: learn about the structure of a dashboard.