Shinyjs

We've already seen that as long as you know JavaScript, using JavaScript is pretty easy in Shiny. The shinyjs package, available on CRAN, actually makes it easy to use extra bits of JavaScript in your application by writing pure R code. Install it with install.packages("shinyjs") and let's take a look.

Shinyjs gives you access to quite a few nice little JavaScript tricks, so see the documentation for more, but we're going to have a look at a few with the help of the Gapminder application. The first is the ability to disable and enable controls. This can be useful to help your users understand how an application works. For example, in the gapminder application, the year control does not do anything when the map tab is selected, since ...

Get Web Application Development with R Using Shiny - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.