ShinyLEGO is a Shiny application that lets you create a simulated mosaic composed of LEGO bricks from any image file. Once your picture is uploaded, you can customize various settings for your mosaic such as dimensions, brightness, and color types. In addition, the application will generate specific instructions so that you can build the mosaic yourself! These instructions contain the brick colors and types required for each step, and a diagram showing how the bricks are to be assembled.
This application would not be possible without the innovative R scripts created by Ryan Timpe! Ryan has written excellent blogposts detailing the workflow this application draws upon, and the code for each post can be found on his LEGOMosaics GitHub repository:
You can install the development version of
# install.packages("remotes") remotes::install_github("rpodcast/shinylego")
Once you have installed the package, you can run the application within your R session using the following command:
Note for developer: The deployment should not include files
renv, since the
shinyapps.io service will handle package versions during the
deployment process. Add the files/directories required for deployment in
dev/app_manifest.txt file, and execute deployment with the
rsconnect::deployApp(appName = "shinylego", appFileManifest = "dev/app_manifest.txt", launch.browser = FALSE)
Contributions are welcome! This application uses the
renv package to manage the versions
of dependencies. After cloning the repository, launch a new session in
the repository root directory and execute
renv::restore() to download
the package library.
In addition to Ryan Timpe’s excellent R programs detailed above, this
application utilizes many powerful packages in the
such as the following:
shinyjs: Easily improve the user experience of your Shiny apps in seconds by Dean Attali
bs4Dash: Bootstrap 4 shinydashboard using AdminLTE3 by David Granjob (part of the RinteRface initiative)
shinyWidgets: Extend widgets available in Shiny by Victor Perrier (part of the dreamRs organization)
shinycustomloader: Add a custom loader for R shiny by Emi Tanaka
DT: R Interface to the jQuery Plug-in DataTables by Yihui Xie
golem: A framework for building robust Shiny Apps by Vincent Guyader and Colin Fay (part of the R Task Force at ThinkR)
Please note that the ‘shinylego’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.