Skip to content

fazetu/lightbox2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lightbox2

Use the lightbox2 javascript library to render image files in an htmlwidget.

Installation

devtools::install_github("fazetu/lightbox2")

Examples

library(lightbox2)

Get file paths to some image files.

images <- example_images()

Note there is also example_lightbox2().

These examples are not interactive, but demonstrate the different styling options available.

This R code chunk in R Markdown does not have results='asis'.

lightbox2(images)

4-1

Change thumbnail size.

lightbox2(images, thumbnailHeight = "50px", thumbnailWidth = "auto")

5-1

Change thumbnail alignment.

lightbox2(images, thumbnailHeight = "50px", thumbnailWidth = "auto", thumbnailAlign = "left")

6-1

Make it so we get a scroll bar by adjusting thumbnail height and max height of the widget.

lightbox2(images, thumbnailHeight = "200px", thumbnailWidth = "auto", maxHeight = "200px")

7-1

Adjust the size of the overall widget.

lightbox2(images, width = "50%")

8-1

Don’t center within the page.

lightbox2(images, width = "50%", margin = "none")

9-1