The canvas uses local array pixel coordinates (top-left origin, x right,
y down). Drawing emits Shiny inputs suffixed _created, _edited, and
_erased. Use sg_canvas_correct() to stage changes to a mask.
Usage
sg_canvas(
image,
mask = NULL,
channel = 1L,
tool = "pan",
width = NULL,
height = 600,
elementId = NULL
)Examples
img <- new_sg_image(matrix(seq_len(72), 8, 9), id = "slide")
msk <- new_sg_mask(matrix(0L, 8, 9), image_id = "slide")
widget <- sg_canvas(img, msk, tool = "polygon")
class(widget)
#> [1] "sgcanvas" "htmlwidget"
if (interactive()) widget