Image credit: Like a Local

Give life to Shiny apps

It’s the little touches that bring life to an app

Image credit: Like a Local

Give life to Shiny apps

It’s the little touches that bring life to an app

It’s the little things that make the difference.

The amazing Shiny enables R users to build web applications. Something I find noticeably interesting is the look and feel of the applications produced by R users. Bringing such a framework to the R community means enabling mathematicians, statisticians, and academics to produce web applications, which results in web products looking much different to what, say, full stack or front-end engineers produce in nodejs or Django.

For instance, I’ve often argued that though one can produce better looking visualisation with ggplot2 than with most htmlwidgets, one should rather user the latter in Shiny applications. Static plots look and feel out of place in Shiny applications.

We often also see text-heavy Shiny applications, which is quiet unlike most dashboards you see in the wild. It’s not only because those putting these applications together differ from the traditional software engineers who makes dashboards, it’s also because of the nature of what is displayed; Shiny apps often have to explain complex analysis and models.

However, I personally like to have my Shiny apps look more like the “real thing”. I have developped a few small packages (htmlwidgets) that allow Shiny applications look more like genuine web apps; application that display more interactivity, and provide feedback. It’s not just for the heck of it. Feedback is useful to the user. When animations are triggered upon changing an input the user instantly understands what said input affects and how it changes.

Typed

typed is a small htmlwidget that simply makes it look like text is being typed.

# remotes::install_github("JohnCoene/typed")
library(typed)

typed(c("This is typed.", "This is an htmlwidget."), loop = TRUE, typeSpeed = 100)

Baffle

baffle is another way to animate text.

# remotes::install_github("JohnCoene/baffle")
library(baffle)

b_affle("Baffle") %>% 
  b_start(1000) %>% 
  b_reveal(20000)

Countup

countup is a neat way to bring numbers to life.

# remotes::install_github("JohnCoene/countup")
library(countup)

countup(
  123456789,
  duration = 30,
  options = list(
    useEasing = TRUE
  )
)

Tippy

tippy lets one easily add tooltips, subsequently removing plain text from the app and giving it the look and feel of a dashboard.

# remotes::install_github("JohnCoene/tippy")
library(tippy)

tippy("Hover me!", tooltip = "Hi, I'm the tooltip!")

Related