A upper level function of drawer::toCanvasBtn. You should only use it under SPS projects. For you own apps, still use the drawer::toCanvasBtn.
canvasBtn(dom, id = "", isID = TRUE, class = "text-center", placement = "top")
dom | a HTML DOM selector, mostly common is to select the element by ID: e.g. a plot with ID "plot1", to select, use Other complex selector is supported. First turn |
---|---|
id | ID of this button, optional. |
isID | bool, if the |
class | string, length 1, other html class add to the button wrapper |
placement | where should the tiptool place, top, bottom, left, right. |
a button group with several options
canvasBtn("#mydiv")#> <div class="text-center" data-popoverid="bspopover64535844"> #> <div class="btn-group to-canvas" id=""> #> <button type="button" class="btn btn-primary" onclick="toCanvas("##mydiv", "core_canvas")">To Canvas</button> #> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> #> <span class="caret"></span> #> <span class="sr-only">Toggle Dropdown</span> #> </button> #> <ul class="dropdown-menu"> #> <li> #> <a href="#" onclick="toPng("##mydiv")">Save as png</a> #> </li> #> <li> #> <a href="#" onclick="toJpg("##mydiv")">Save as jpg</a> #> </li> #> </ul> #> </div> #> <script> #> bsPopover( #> "bspopover64535844", "top", "Send to Canvas", "Take a screenshot of current plot and send to SPS Canvas tab, #> or save as an image", "#ebebeb", "black", #> "black", "14px", "12px", "hover focus", "600", #> "400", "1", false #> ) #> </script> #> </div>