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:
- How To: LEGO mosaics from photos using R & the Tidyverse
- LEGO mosaics: Two weeks later
- LEGO mosaics: Part 3(D)
You can install the development version of shinylego
from
GitHub with:
# 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:
shinylego::run_app()
shinylego
is also available on the Shinyapps.io hosting service at
rpodcast.shinyapps.io/shinylego.
Note for developer: The deployment should not include files
associated with renv
, since the
shinyapps.io service will handle package versions during the
deployment process. Add the files/directories required for deployment in
the dev/app_manifest.txt
file, and execute deployment with the
following:
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 shiny
ecosystem
such as the following:
shinyjs
: Easily improve the user experience of your Shiny apps in seconds by Dean Attalibs4Dash
: 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 TanakaDT
: R Interface to the jQuery Plug-in DataTables by Yihui Xiegolem
: 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.