Disclaimer: this repository is under review by the erum::Conf 2020 program committee (and will be removed if not accepted)
by the Scientific Computing and Consulting Group, Novartis
๐๏ธ May 30, 2020
โฐ 09:00 - 17:00 (?)
๐จ @ Politecnico
- ๐ Workshop Website - Coming soon
- ๐๏ธ Github
- ๐ฎ RStudio Community thread - Coming soon
In the past two years, there were various Shiny focused workshops introducing basic as well as advanced topics such as modules and Javascript/R interactions. However, handling advanced user interfaces was never an emphasis. Clients often desire custom designs, yet this generally exceeds core features of Shiny. We recognized that R App developers lacking a significant background in web development may have found this requirement to be overwhelming. Consequently, the aim of this workshop is to provide participants the necessary knowledge to extend Shiny's layout, input widgets and include the new components in a novel modular framework. The workshop is organized into four parts. We first dive into the {htmltools} package, providing functions to create and manipulate shiny tags as well as manage dependencies. We then go through the basics of JavaScript, especially jQuery. Part 3 homes in on the development of a new template on top of Shiny by demonstrating examples from the {bs4Dash} and {shinyMobile} packages, part of the RinteRface project. Finally, we integrate these new components into shiny modules, designed with an object-oriented-based package, namely {tidymodules}. This novel approach allows the development of Shiny apps using R6 classes, thereby significantly reducing the burden of modular communication faced by classic shiny modules and their namespace management.
- Manipulate Shiny tags with {htmltools}
- Understand how dependencies are handled
- Discover the steps to create a new template from scratch
- Learn how shiny deals with inputs
- Discover a new framework for robust module development
- Be familiar with Shiny, modules
- Basic knowledge in HTML and JavaScript is a plus
You should take this course if you answer yes to at least 2 of the following questions:
- Do you want to know how to develop outstanding shiny apps?
- Have you ever wondered how to develop new input widgets?
- Are you bothered by the cumbersomeness of module communication in vanilla Shiny?
- How would you manage an app with 150 tightly connected modules?
During this tutorial you will need ... (Work in Progress)
We will also set up a RStudio Cloud dedicated project.
Below is the preliminary program, subject to changes by erum::Conf organisers. The time slots are still undefined since the global program is not available.
Time | Activity | |
---|---|---|
(1h) | ๐ฌ | 1: Introduction to htmltools |
(15 min) | โ | Coffee break |
(1h) | ๐ | 4: Introduction to JavaScript |
(1h) | ๐ฑ | Lunch break |
(1h) | โก | 3: Develop a custom shiny template |
(15 min) | โ | Coffee break |
(2h) | ๐ | 4: tidymodules |
-
Introduction to {htmltools}
- HTML
- Shiny's tags: structure (name, class, attributes, children, ...)
- Manipulate tags: access/modifie/add the class, attributes, children
- Introduction to HTML dependencies
-
Introduction to JavaScript for Shiny (preliminary)
- Types
- Functions
- jQuery
- Events
- ...
-
Develop a custom shiny template (examples taken from RinteRface templates)
- Reminder on {shiny}'s dependencies (Bootstrap 3, 4, jQuery, ...)
- Create new CSS/JS dependencies with {hmtltools}
- Develop the template layout (navbar, sidebar, body, footer, ...)
- Develop custom input widgets (how to input binding work?)
- Basic description of the Shiny input binding utils
- Describe how {shiny} deal with inputs
- Test the newly created components
- Unit tests with testthat
- Testing JavaScript code
- Other tests
-
Introduction to {tidymodules}
- Introduction to R6: object oriented programming key concepts
- Reminders on classic shiny modules: what are the main drawbacks?
- {tidymodules}
- Modules definition
- Inheritance set up
- Initialize input and output ports
- Create ui and server methods
- Other methods
- Nested modules
- Module communication
- Input inheritance (between nested and parent modules)
- Port forwarding
- Tidy operations between modules
- Handle multiple user interfaces
- Manage module: the ModStore
- visNetwork representation
- Modules definition
Mustapha Larbaoui and David Granjon are respectively, associate director and principal scientist and consultant at Novartis where they use and trains others to use R, Shiny...
This work is licensed under a Creative Commons Attribution 4.0 International License.