Create a react app for paper JS in R
paper.Rd
Provided a list of images, this function is used to open an interactive app
built with react and paper JS. The application is mean to be used in a shiny
application and is used for the RunAlignment
function provided
in semla
.
Arguments
- data
A list of images prepared with
prep_image
- width
Width of component
- height
height of component
- elementId
Component element ID
Examples
library(semla)
library(magick)
im_mbrain <- system.file("extdata/mousebrain/spatial",
"tissue_lowres_image.jpg",
package = "semla")
img1 <- prep_image(im_mbrain |>
image_read(),
height = 256)
img2 <- prep_image(im_mbrain |>
image_read() |>
image_flip(),
height = 256)
if (FALSE) { # \dontrun{
if (interactive()) {
# Run widget
paper(data = list(img1, img2), width = 600, height = 600)
}
} # }