Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

brushOpts

Create an object representing brushing options


Description

This generates an object representing brushing options, to be passed as the brush argument of imageOutput() or plotOutput().

Usage

brushOpts(
  id,
  fill = "#9cf",
  stroke = "#036",
  opacity = 0.25,
  delay = 300,
  delayType = c("debounce", "throttle"),
  clip = TRUE,
  direction = c("xy", "x", "y"),
  resetOnNew = FALSE
)

Arguments

id

Input value name. For example, if the value is "plot_brush", then the coordinates will be available as input$plot_brush. Multiple imageOutput/plotOutput calls may share the same id value; brushing one image or plot will cause any other brushes with the same id to disappear.

fill

Fill color of the brush. If 'auto', it derives from the link color of the plot's HTML container (if thematic is enabled, and accent is a non-'auto' value, that color is used instead).

stroke

Outline color of the brush. If 'auto', it derives from the foreground color of the plot's HTML container (if thematic is enabled, and fg is a non-'auto' value, that color is used instead).

opacity

Opacity of the brush

delay

How long to delay (in milliseconds) when debouncing or throttling, before sending the brush data to the server.

delayType

The type of algorithm for limiting the number of brush events. Use "throttle" to limit the number of brush events to one every delay milliseconds. Use "debounce" to suspend events while the cursor is moving, and wait until the cursor has been at rest for delay milliseconds before sending an event.

clip

Should the brush area be clipped to the plotting area? If FALSE, then the user will be able to brush outside the plotting area, as long as it is still inside the image.

direction

The direction for brushing. If "xy", the brush can be drawn and moved in both x and y directions. If "x", or "y", the brush wil work horizontally or vertically.

resetOnNew

When a new image is sent to the browser (via renderImage()), should the brush be reset? The default, FALSE, is useful if you want to update the plot while keeping the brush. Using TRUE is useful if you want to clear the brush whenever the plot is updated.

See Also

clickOpts() for clicking events.


shiny

Web Application Framework for R

v1.6.0
GPL-3 | file LICENSE
Authors
Winston Chang [aut, cre], Joe Cheng [aut], JJ Allaire [aut], Carson Sievert [aut], Barret Schloerke [aut], Yihui Xie [aut], Jeff Allen [aut], Jonathan McPherson [aut], Alan Dipert [aut], Barbara Borges [aut], RStudio [cph], jQuery Foundation [cph] (jQuery library and jQuery UI library), jQuery contributors [ctb, cph] (jQuery library; authors listed in inst/www/shared/jquery-AUTHORS.txt), jQuery UI contributors [ctb, cph] (jQuery UI library; authors listed in inst/www/shared/jqueryui/AUTHORS.txt), Mark Otto [ctb] (Bootstrap library), Jacob Thornton [ctb] (Bootstrap library), Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), Prem Nawaz Khan [ctb] (Bootstrap accessibility plugin), Victor Tsaran [ctb] (Bootstrap accessibility plugin), Dennis Lembree [ctb] (Bootstrap accessibility plugin), Srinivasu Chakravarthula [ctb] (Bootstrap accessibility plugin), Cathy O'Connor [ctb] (Bootstrap accessibility plugin), PayPal, Inc [cph] (Bootstrap accessibility plugin), Stefan Petre [ctb, cph] (Bootstrap-datepicker library), Andrew Rowls [ctb, cph] (Bootstrap-datepicker library), Dave Gandy [ctb, cph] (Font-Awesome font), Brian Reavis [ctb, cph] (selectize.js library), Salmen Bejaoui [ctb, cph] (selectize-plugin-a11y library), Denis Ineshin [ctb, cph] (ion.rangeSlider library), Sami Samhuri [ctb, cph] (Javascript strftime library), SpryMedia Limited [ctb, cph] (DataTables library), John Fraser [ctb, cph] (showdown.js library), John Gruber [ctb, cph] (showdown.js library), Ivan Sagalaev [ctb, cph] (highlight.js library), R Core Team [ctb, cph] (tar implementation from R)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.