Book Image

Hands-On Dashboard Development with Shiny

By : Chris Beeley
Book Image

Hands-On Dashboard Development with Shiny

By: Chris Beeley

Overview of this book

Although vanilla Shiny applications look attractive with some layout flexibility, you may still want to have more control over how the interface is laid out to produce a dashboard. Hands-On Dashboard Development with Shiny helps you incorporate this in your applications. The book starts by guiding you in producing an application based on the diamonds dataset included in the ggplot2 package. You’ll create a single application, but the interface will be reskinned and rebuilt throughout using different methods to illustrate their uses and functions using HTML, CSS, and JavaScript. You will also learn to develop an application that creates documents and reports using R Markdown. Furthermore, the book demonstrates the use of HTML templates and the Bootstrap framework. Moving along, you will learn how to produce dashboards using the Shiny command and dashboard package. Finally, you will learn how to lay out applications using a wide range of built-in functions. By the end of the book, you will have an understanding of the principles that underpin layout in Shiny applications, including sections of HTML added to a vanilla Shiny application, HTML interfaces written from scratch, dashboards, navigation bars, and interfaces.
Table of Contents (5 chapters)

Conditional UI

Shiny provides a lots of ways to make the user experience as simple and easy as possible. By controlling what the user sees, taking control of the user's inputs, and giving the user feedback about what the application is doing and why, it is possible to make the experience easy to follow for everyone.

So, in this section, we will look at the following topics:

  • Using the conditional UI function
  • Controlling the user interface with observe()
  • Using modals to give messages to the user

The first thing to note here is that the movie selector does not show on the graph screen, as shown in the following screenshot:

Conditional UI function under Movie picker tab

It is often useful in a large application to show the user only those controls that can currently be used. This prevents your UI from being cluttered and helps show how the application works.

As you can see...