Skip to content

Commit

Permalink
fix demo app to include images in screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
daattali committed Oct 27, 2024
1 parent 01819f5 commit 592cec7
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinyscreenshot
Title: Capture Screenshots of Entire Pages or Parts of Pages in 'Shiny'
Version: 0.2.1
Version: 0.2.1.9000
Authors@R: c(
person("Dean", "Attali",
email = "[email protected]",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

- Fix the demo app so that the images get included in the screenshot

# shinyscreenshot 0.2.1 (2023-08-19)

- Add example to README to show how to use save to server feature
Expand Down
24 changes: 12 additions & 12 deletions inst/examples/demo/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ ui <- fluidPage(
server <- function(input, output, session) {
output$timeline <- timevis::renderTimevis({

countryToCode <- list(
"Argentina" = "ar",
"Belgium" = "be",
"Brazil" = "br",
"Colombia" = "co",
"Costa Rica" = "cr",
"France" = "fr",
"Germany" = "de",
"Netherlands" = "nl"
countryToBase64Img <- list(
"Argentina" = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAUBAMAAAAevyJ8AAAAJ1BMVEWiyOp0rN/////58+3fsGny38fnowzz5Nfr0Krr07ndqUvs1LXSnlC6gwhIAAAANklEQVQY02MQRAMMNBHAAEoQYBoMZUAFlFs8jFAE1N1yilAEVJelBKFq2eKJqgXJUAxAF98CAFcNHShSkYrsAAAAAElFTkSuQmCC",
"Belgium" = "iVBORw0KGgoAAAANSUhEUgAAABcAAAAUBAMAAACUkLs9AAAAElBMVEUAAABVSgzvM0D0ajf1ajf92iXQKeqYAAAAHUlEQVQY02NgYGBgDA0NDVFSUlJggHKCRwwH7G0AncUk97jJjWYAAAAASUVORK5CYII=",
"Brazil" = "iVBORw0KGgoAAAANSUhEUgAAAB0AAAAUCAMAAABGQsb1AAAAe1BMVEUAmzoEKnj52wIKL3lBrSsHnDjb1Qj+3wAAJ3akxxRetCQToDUopjBDWGHEzw3r2gQhRoYfPWcYoTSHvxv63gGyzcyGiDcqS4uMkTo2WJETN32+tTq2qyF+p67eyA82TV1baUzItxns0Qh+vB1+mLZqmKKeu8OSr71VcKRxCrRcAAAArElEQVQoz62Rxw6DMBBEsY2zQ7fpvaX+/xfmgFCAgFCkzPVJq7czhvGvSFseQ/NCF/OAORYREVnOHrSDsddM92NgfzHXp0EDAPRAvru2iWLiXpEJAOg48atc2RBVzb15JM8XUBN97MLJJs0AQN2SIl3azRSCQQBZkk80XF6uFQNjAlDV8vJs1TGFkrHC4xRHcvtRKwCIsmy3H01t8NwTXs532jhr8mSFswV/zBsgcAoSjHCdRAAAAABJRU5ErkJggg==",
"Colombia" = "iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUAgMAAADnxWVXAAAACVBMVEUAMIfIEC7/zQBWZSB5AAAAF0lEQVQI12NYBQELGKjOIAmEQkAAMQwA+9NB7HYGMdMAAAAASUVORK5CYII=",
"Costa Rica" = "iVBORw0KGgoAAAANSUhEUgAAACEAAAAUCAMAAAA0jaRDAAAAP1BMVEX////y28NtdFSWxM8AFIntmI/laWD2ycbaKRy/xOHp3d3t7ubYx6GrwaTdPDDofHV3eIPaKh0mdlbErIY3fWbk5bcpAAAAUklEQVQoz2NgIQQYqKGCkxBgoAZgJwQYOKCAlYuLnwMbgKlg4+bl5ebDp4KVh5mZkQ2vCiYRISa8KtiEBQR48NoiyMrIiMOlhH1LDUA45uiSggASiQ2ajzJk0wAAAABJRU5ErkJggg==",
"France" = "iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUAgMAAADnxWVXAAAACVBMVEUAI5XtKTn///+i/AH+AAAAFElEQVQI12NgYOBatSo0NIBh6DAATSAu4Xxi9HsAAAAASUVORK5CYII=",
"Germany" = "iVBORw0KGgoAAAANSUhEUgAAACEAAAAUBAMAAADxfUlCAAAAD1BMVEUAAABKAADdAAD0igD/zgDupiNjAAAAIUlEQVQY02NgoCMQRAMCDEpoQIGGIsZowIDBBQ040E4EAM/nLQEUDzk4AAAAAElFTkSuQmCC",
"Netherlands" = "iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUBAMAAABohZD3AAAAD1BMVEUhRotrhLKuHCjIZm7///9fvUPgAAAAHElEQVQY02NUYkABTAzU5bMI4udT2z5GNPNpDQBo2wB0uX4S5QAAAABJRU5ErkJggg=="
)

templateWC <- function(stage, team1, team2, score1, score2) {
Expand All @@ -100,12 +100,12 @@ server <- function(input, output, session) {
<td>%s</td>
</tr>
<tr>
<td><img src="https://flagpedia.net/data/flags/mini/%s.png" width="31" height="20" alt="%s"></td>
<td><img src="data:image/png;base64,%s" width="31" height="20" alt="%s"></td>
<th></th>
<td><img src="https://flagpedia.net/data/flags/mini/%s.png" width="31" height="20" alt="%s"></td>
<td><img src="data:image/png;base64,%s" width="31" height="20" alt="%s"></td>
</tr>
</tbody></table>',
stage, team1, score1, score2, team2, countryToCode[[team1]], team1, countryToCode[[team2]], team2
stage, team1, score1, score2, team2, countryToBase64Img[[team1]], team1, countryToBase64Img[[team2]], team2
)
}

Expand Down
Binary file removed inst/examples/demo/www/flags/argentina.png
Binary file not shown.
Binary file removed inst/examples/demo/www/flags/belgium.png
Binary file not shown.
Binary file removed inst/examples/demo/www/flags/brazil.png
Binary file not shown.
Binary file removed inst/examples/demo/www/flags/colombia.png
Binary file not shown.
Binary file removed inst/examples/demo/www/flags/costarica.png
Binary file not shown.
Binary file removed inst/examples/demo/www/flags/france.png
Binary file not shown.
Binary file removed inst/examples/demo/www/flags/germany.png
Binary file not shown.
Binary file removed inst/examples/demo/www/flags/netherlands.png
Binary file not shown.

0 comments on commit 592cec7

Please sign in to comment.