+ - 0:00:00
Notes for current slide
Notes for next slide

including via trick here https://stackoverflow.com/questions/20409172/how-to-display-verbatim-inline-r-code-with-backticks-using-rmarkdown

doesn't work with table with r commands. "doesn't work" = --- doesn't start a new slide.

anicon R package

Animated icons for R markdown and Shiny

Emi Tanaka

2018/07/24

1 / 14

Getting Started

anicon::faa("leaf")

Let's try bouncing

anicon::faa("leaf", animate="bounce")

Or embedding the icon inline

can be embedded by enclosing r anicon::faa("leaf", animate="burst") by back ticks.

2 / 14

including via trick here https://stackoverflow.com/questions/20409172/how-to-display-verbatim-inline-r-code-with-backticks-using-rmarkdown

doesn't work with table with r commands. "doesn't work" = --- doesn't start a new slide.

Here's the list of all available animation

anicon animate anicon animate
burst pulse
bounce ring
falling shake
flash spin
float spin-reverse
horizontal tada
passing vertical
passing-reverse wrench
3 / 14

Here's a more colourful list of all available animation

anicon animate anicon animate
burst pulse
bounce ring
falling shake
flash spin
float spin-reverse
horizontal tada
passing vertical
passing-reverse wrench
4 / 14

Let's change the speed of the animation

anicon::faa("leaf", animate="bounce")

Go faster

anicon::faa("leaf", animate="bounce", speed="fast")

Go slower

anicon::faa("leaf", animate="bounce", speed="slow")

5 / 14

Let's grow it..

anicon::faa("leaf", size=2, bgcolour="MistyRose", colour="green")

    the container grows with it

anicon::faa("leaf", grow=20, bgcolour="MistyRose", colour="green")

      the container doesn't change

anicon::faa("leaf", grow=-2, bgcolour="MistyRose", colour="green")

      negative values will shrink it

6 / 14

Changing position of the icon

anicon::faa("magic", size=4, bgcolour="red", colour="pink",
position=c(3, 0, 3, 0))

anicon::faa("magic", size=4, bgcolour="red", colour="pink",
position=c(0, 3, 3, 0))




Position is given as vector of length 4 specifying up, down, left and right, respectively.

7 / 14

Hovering to trigger animation

Try hovering over the icon

anicon::faa("pagelines", size=3, colour="purple",
animate="wrench", anitype="hover", rtext="Hi there!")

Hi there!

Now try hovering over the text this time

anicon::faa("pagelines", size=3, colour="purple",
animate="wrench", anitype="parent-hover",
rtext="Hi there!")

Hi there!

8 / 14

You can embed these into Shiny

It works in shiny by using say tags$p(anicon::faa("child")).

Below is a working example,

ui <- fluidPage(
titlePanel(tags$p(anicon::faa("child"),
"Old Faithful Geyser Data")),
sidebarLayout(
sidebarPanel(
sliderInput("bins", "Number of bins:",
min = 1, max = 50,value = 30)
),
mainPanel( plotOutput("distPlot"))
)
)
server <- function(input, output) {
output$distPlot <- renderPlot({
ggplot(faithful, aes(waiting)) +
geom_histogram(bins=input$bins) + theme_bw()
})
}
9 / 14

Other features

anicon::faa("magic", size=2, colour="blue",
rotate=45, rtext=" rotate")

rotate

anicon::faa("magic", size=2, colour="blue",
flip="vertical", rtext=" flip it vertically")

flip it vertically

anicon::faa("magic", size=2, colour="blue",
border=T, rtext=" put a border around it")

put a border around it

10 / 14

anicon also has animated text!

anicon::nia("Yes that's right!")

Yes that's right!

anicon anicon
burst pulse
bounce ring
fallling shake
flash spin
float spin-reverse
horizontal tada
passing vertical
passing-reverse wrench
11 / 14

Animate your own images!

Behaves like faa!

anicon::cia("logo.png", rotate=90, size=3, border=T)

anicon::cia("logo.png", animate="wrench", ltext="Hello!",
grow=20, flip="horizontal", border=T, bgcolor="#9BB1FF")

Hello!

anicon::cia("logo.png", animate="wrench", anitype="parent-hover", ltext="Hello!", size=3)

Hello!

12 / 14

Works with gif as well!

anicon::cia("party_parrot.gif", size=3, border=T)

You can disable animation in cia by animate=F

anicon::cia("party_parrot.gif", animate=F, rotate=90, size=3)

Find more fun gifs at slackmojis!

13 / 14

Icon layering and more to come!



@statsgen

https://github.com/emitanaka/anicon

14 / 14

Getting Started

anicon::faa("leaf")

Let's try bouncing

anicon::faa("leaf", animate="bounce")

Or embedding the icon inline

can be embedded by enclosing r anicon::faa("leaf", animate="burst") by back ticks.

2 / 14

including via trick here https://stackoverflow.com/questions/20409172/how-to-display-verbatim-inline-r-code-with-backticks-using-rmarkdown

doesn't work with table with r commands. "doesn't work" = --- doesn't start a new slide.

Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow