Title: | A Wrapper of the JavaScript Library 'Freewall' |
Version: | 1.0.0 |
Description: | Creates dynamic grid layouts of images that can be included in 'Shiny' applications and R markdown documents. |
License: | GPL-3 |
URL: | https://github.com/stla/freewall |
BugReports: | https://github.com/stla/freewall/issues |
Imports: | htmlwidgets, htmltools, jquerylib |
Suggests: | shiny |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
NeedsCompilation: | no |
Packaged: | 2024-04-28 15:33:08 UTC; SDL96354 |
Author: | Stéphane Laurent [aut, cre], Minh Nguyen [cph] (author of the JavaScript library 'Freewall') |
Maintainer: | Stéphane Laurent <laurent_step@outlook.fr> |
Repository: | CRAN |
Date/Publication: | 2024-04-30 09:00:05 UTC |
Some images
Description
Twenty-four urls pointing to an image.
Usage
alphabet()
Value
A character vector of 24 urls pointing to an image.
Examples
freewall(alphabet(), widths = 200, cellW = 200, cellH = "auto")
The 'freewall' widget
Description
Creates a grid of images.
Usage
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
)
Arguments
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) |
Value
A htmlwidget
object.
Examples
freewall(
nature(), widths = 200, cellW = 200, cellH = 200, draggable = TRUE
)
Shiny bindings for 'freewall'
Description
Output and render functions for using freewall
within
Shiny applications and interactive Rmd documents.
Usage
freewallOutput(outputId, width = "100%", height = "auto")
renderFreewall(expr, env = parent.frame(), quoted = FALSE)
Arguments
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 |
Value
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.
Examples
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)
}
Some images
Description
Nine urls pointing to an image.
Usage
nature()
Value
A character vector of nine urls pointing to an image.
Examples
freewall(
nature(), widths = 200, cellW = 200, cellH = "200", draggable = TRUE
)