Book Image

Learning Shiny

By : Hernan Resnizky
Book Image

Learning Shiny

By: Hernan Resnizky

Overview of this book

Table of Contents (19 chapters)
Learning Shiny
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introducing R, RStudio, and Shiny
Index

Styling


Once we have a complete working application, it is time for some styling with CSS. In the following example, just some fonts are changed. It is always good, when possible, to control the styles with CSS. There are some widgets, such as plot outputs that are not so easy to handle as the tags assignment is restricted.

In the following CSS, saved as style.css, some of the texts are styled as follows:

.title {
  font-size: 18px;
  font-weight: bold;
}
h1 {
  font-style: italic;
  font-family: impact;
}

As it was explained in Chapter 8, Shiny and HTML/JavaScript, CSS stylesheets can be included with an includeCSS() statement inside UI.R:

# Starting line
shinyUI(fluidPage(
 
 #CSS styling
 includeCSS("PATH_to_CSS_file/style.css"),
 # Application title
 titlePanel("Adult Dataset"),

Discovering insights in the application

With an application ready to use, it is always rewarding to find out that it fulfills its purpose. In this case, it would be to discover insights visually from the data.

The following...