Style

Published

2024-08-27

Expand the boxes below to review what was covered in previous three chapters:

The Docker chapter covered the following topics:

The applications in Chapter 15 (Docker) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 15 applications:

list_apps(regex = '^15')
## # A tibble: 2 × 2
##   branch             last_updated       
##   <chr>              <dttm>             
## 1 15_debug-util-funs 2024-09-04 10:06:57
## 2 15_docker          2024-08-23 07:15:29

Continuous integration and continuous deployment is demonstrated using GitHub Actions to automate three workflows:

The applications in Chapter 16 (CI/CD) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 16 applications:

list_apps(regex = '^16')
## # A tibble: 3 × 2
##   branch          last_updated       
##   <chr>           <dttm>             
## 1 16.1_gha-style  2024-08-23 07:17:12
## 2 16.2_gha-shiny  2024-08-23 07:13:54
## 3 16.3_gha-docker 2024-08-01 12:49:40

The pkgdown chapter covers build a package website and deploying it with GitHub Actions.

The applications in Chapter 17 (pkgdown) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 17 applications:

list_apps(regex = '^17')
## # A tibble: 1 × 2
##   branch     last_updated       
##   <chr>      <dttm>             
## 1 17_pkgdown 2024-08-23 07:16:31

Shiny simplifies the creation of interactive web applications by allowing you to write R code that is automatically translated into HTML, CSS and JavaScript. However, sometimes it’s necessary to include non-R code files as supplemental resources to improve your application. This section will cover how to include HTML, CSS, and JavaScript files in a Shiny app-package.

Design

Design explores multiple bslib layout options. We’ll also discover how to customize themes, fonts, colors, and interactive choices using the plotly, thematic, and reactable packages.

HTML & CSS

In the HTML & CSS chapter chapter, we’ll explore how to embed HTML within Shiny apps, use tags and functions to enhance UI layouts, and leverage HTML templates for more complex designs.

This section also delves into the art of styling your Shiny applications, ensuring they are both visually appealing and user-friendly. We discuss how to apply custom styles to your app using CSS, enabling you to customize the appearance of your elements beyond Shiny’s default themes. You’ll learn how to include external CSS files, write inline styles, and utilize CSS frameworks like Bootstrap for responsive design. Through practical examples, we demonstrate how to manage CSS specificity, create reusable styles, and enhance the overall user experience by controlling layout, typography, colors, and animations.

JavaScript

In the JavaScript chapter, we cover how to extend the functionality of your Shiny applications with custom JavaScript. JavaScript can be used to handle client-side interactivity, manipulate the DOM, and integrate third-party libraries and APIs. We’ll show you how to include JavaScript files in your Shiny app-package, write custom JavaScript code that interacts with Shiny’s reactive model, and use Shiny’s JavaScript functions to create more dynamic and responsive applications. This chapter equips you with the skills to bridge the gap between Shiny’s R-based framework and the extensive capabilities of JavaScript, enhancing your app’s performance and user interaction.

Style

Style covers formatting the code in your package so it’s easier to debug (and read).