Contents

Wheel of fortune in shiny

Contents

Having thought about creating a wheel of fortune type of shinyapp for some time and finally got enough motivation to give it a try. Below is what I got. You can put the choices on the wheel and give it a spin here and the code here

Motivation

A few weeks back, my wife’s cousin visited us, and we talked about different team-building activities. One idea jumped out to me that it prepared general ice-breaker questions for whoever got picked from a wheel of fortune app. A light bulb was lit in my head. I was convinced the whole interface is possible in Shiny and voila, we now have this app.

Key features

This app includes several features and we will go over them one by one below.

How do we spin?

To be honest, this app does not spin the options. I could not figure out how to showcase the spinning effect with what I know in shiny and therefore turned to an alternative of highlighting the slice of a donut/pie chart. In this case, instead of using an action button, I have added a label to the plot and centered it to serve as the action button.

Celebration with gif/confetti/applause

  1. The pop-up gif

I will skip the gif portion as the congratulation pop-up has been used in number_guessing_game.

  1. The confetti

I am very excited about the confetti effect and I am seriously thinking about adding it to the number_guessing_game. The setup was not that complicated. The key is to let shiny recognize the confetti.js and I used the shinyjs package to allow the functions in the js file to be used in the app.

  1. The applause

This is also made possible by using the shinyjs package. I have found an applause audio that was available for personal/commercial use and used the method to implement it described in this RStudio Community post.

Spinning history

After the main key features have been in place, it also occurred to me that it would be nice to have an overview per session so that we know who is the luckiest one. When you click on the history icon, you will see all the results as well as the total number of spins this app has done across all sessions.

Lastly

There are so many online applications that offer this for free and they have more functionalities. This shiny app is just another fun exercise that proves a point that has been proven so many times - you can use shiny to develop so many app ideas and this is one of them.