A dynamic, interactive "Wheel of Fortune" application built with R Shiny. Originally conceived as a team-building ice-breaker, this project demonstrates how to create game-like experiences by bridging R's data visualization with web-native interactivity.
- Event-Driven Plot Interaction: Instead of a standard button, the "Spin" trigger is a centered label within the plot itself, utilizing
plot_clickcoordinates to trigger reactive events. - State-Based Highlighting: To overcome static plot limitations, the app uses a
ggplot2donut chart that programmatically highlights the "winning" slice to simulate a selection. - JS Interop: Leverages the
shinyjspackage to bridge R and JavaScript, triggeringconfetti.jsanimations and custom audio (applause) upon a successful spin. - Persistent Session History: Tracks results and total spin counts across a single session using
reactiveValues.
- R Framework:
shiny,shinyjs - Data Vis:
ggplot2 - Assets: Custom JavaScript (
confetti.js), CSS, and HTML5 audio tags.
To run this application locally, ensure you have R installed and run the following in your console:
# Install dependencies
install.packages(c("shiny", "ggplot2", "shinyjs"))
# Run the app directly from GitHub
shiny::runGitHub("shiny_spinner", "CodingTigerTang")