Title: | A Wrapper of the JavaScript Library 'Freewall' |
---|---|
Description: | Creates dynamic grid layouts of images that can be included in 'Shiny' applications and R markdown documents. |
Authors: | Stéphane Laurent [aut, cre], Minh Nguyen [cph] (author of the JavaScript library 'Freewall') |
Maintainer: | Stéphane Laurent <[email protected]> |
License: | GPL-3 |
Version: | 1.0.0 |
Built: | 2024-10-28 03:19:00 UTC |
Source: | https://github.com/stla/freewall |
Twenty-four urls pointing to an image.
alphabet()
alphabet()
A character vector of 24 urls pointing to an image.
freewall(alphabet(), widths = 200, cellW = 200, cellH = "auto")
freewall(alphabet(), widths = 200, cellW = 200, cellH = "auto")
Creates a grid of images.
freewall( images, backgroundImages = FALSE, widths = 100, heights = NULL, width = "100%", draggable = FALSE, animate = TRUE, cellW = 100, cellH = 100, delay = 0, fixSize = NULL, gutterX = 10, gutterY = 10, keepOrder = TRUE, rightToLeft = FALSE, bottomToTop = FALSE, elementId = NULL )
freewall( images, backgroundImages = FALSE, widths = 100, heights = NULL, width = "100%", draggable = FALSE, animate = TRUE, cellW = 100, cellH = 100, delay = 0, fixSize = NULL, gutterX = 10, gutterY = 10, keepOrder = TRUE, rightToLeft = FALSE, bottomToTop = FALSE, elementId = NULL )
images |
character vector of paths or urls to some images; for a Shiny app, the image files must be located in the www subfolder |
backgroundImages |
Boolean, whether to render the images with the
CSS property |
widths |
the widths of the images in pixels; if a single value is given, it will be used for all images |
heights |
the heights of the images in pixels; if a single value is given,
it will be used for all images; setting the heights is necessary if
|
width |
the width of the container |
draggable |
Boolean, whether to enable draggability |
animate |
Boolean, whether to animate |
cellW |
width of unit, a number of pixels or |
cellH |
height of unit, a number of pixels or |
delay |
time delay for showing an item |
fixSize |
see freewall options |
gutterX |
space between columns, a number of pixels or |
gutterY |
space between rows, a number of pixels or |
keepOrder |
Boolean, whether to keep the order of the images |
rightToLeft |
Boolean, whether to let the layout start render from right to left |
bottomToTop |
Boolean, whether to let the layout start render from bottom to top |
elementId |
a HTML id for the container (usually useless) |
A htmlwidget
object.
freewall( nature(), widths = 200, cellW = 200, cellH = 200, draggable = TRUE )
freewall( nature(), widths = 200, cellW = 200, cellH = 200, draggable = TRUE )
Output and render functions for using freewall
within
Shiny applications and interactive Rmd documents.
freewallOutput(outputId, width = "100%", height = "auto") renderFreewall(expr, env = parent.frame(), quoted = FALSE)
freewallOutput(outputId, width = "100%", height = "auto") renderFreewall(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width , height
|
a valid CSS dimension (like |
expr |
an expression that generates a |
env |
the environment in which to evaluate |
quoted |
logical, whether |
freewallOutput
returns an output element that can be included
in a Shiny UI definition, and renderFreewall
returns a
shiny.render.function
object that can be included in a Shiny server
definition.
if(require(shiny) && interactive()) { library(shiny) library(freewall) ui <- fluidPage( freewallOutput("fw") ) server <- function(input, output, session) { output$fw <- renderFreewall({ freewall(alphabet(), widths = 200, cellW = 200, cellH = "auto") }) } shinyApp(ui, server) }
if(require(shiny) && interactive()) { library(shiny) library(freewall) ui <- fluidPage( freewallOutput("fw") ) server <- function(input, output, session) { output$fw <- renderFreewall({ freewall(alphabet(), widths = 200, cellW = 200, cellH = "auto") }) } shinyApp(ui, server) }
Nine urls pointing to an image.
nature()
nature()
A character vector of nine urls pointing to an image.
freewall( nature(), widths = 200, cellW = 200, cellH = "200", draggable = TRUE )
freewall( nature(), widths = 200, cellW = 200, cellH = "200", draggable = TRUE )