canvasBtn: Screenshot a plot or UI to SPS Canvas or download as an image

View source: R/canvas.R

canvasBtnR Documentation

Screenshot a plot or UI to SPS Canvas or download as an image

Description

A upper level function of drawer::toCanvasBtn. You should only use it under SPS projects. For you own apps, still use the drawer::toCanvasBtn.

Usage

canvasBtn(dom, id = "", isID = TRUE, class = "text-center", placement = "top")

Arguments

dom

a HTML DOM selector, mostly common is to select the element by ID:

e.g. a plot with ID "plot1", to select, use dom = "plot1" to select the plot if isID = TRUE. If isID = FALSE, use dom = "#plot1"

Other complex selector is supported. First turn isID = FALSE, then try things like dom = ".btn i" selects an icon inside an element with "btn" class. If more than one element is matched, only the first one will be screenshoted.

id

ID of this button, optional.

isID

bool, if the dom argument is selected by ID or other selector

class

string, length 1, other html class add to the button wrapper

placement

where should the tiptool place, top, bottom, left, right.

Value

a button group with several options

Examples

canvasBtn("#mydiv")

systemPipeR/systemPipeShiny documentation built on Oct. 17, 2023, 3:40 a.m.