Include 'Lottie' Functionality within 'shiny'
include_lottie.Rd
Responsible for retrieving the 'Lottie' library and initialising the necessary 'JavaScript' library.
As such, this function must be included within the UI object of a shinyApp
in order to enable 'shinyLottie' functionality.
Arguments
- version
A character string specifying the version of the 'Lottie' library to source via CDN.
Note
Calling this function initialises a global object "window.lottieInstances
" once the DOM content is fully loaded.
This is used to store the 'Lottie' animations that are created using lottie_animation
.
Examples
if (FALSE) { # interactive()
library(shiny)
library(shinyLottie)
ui <- fluidPage(
include_lottie(),
lottie_animation(
path = "shinyLottie/example.json",
name = "my_animation"
)
)
server <- function(input, output, session) {}
shinyApp(ui, server)
}