Convenient wrapper around observers related to Shiny plot outputs.

ggObserve(session, input, rv, rv_plots, dblclick, brush, dbrush, rvx,
  rvy = NULL, rvbrush = brush, zoomable = TRUE)

Arguments

session

Shiny session object.

input

Shiny input object.

rv

reactive values object passthrough.

rv_plots

reactive values object passthrough.

dblclick

character, double click input id specified in `plotOutput`.

brush

character, brush input id specified in `plotOutput`.

dbrush

reactive object containing data frame whose rows are based on the brushed region of the plot. See details.

rvx

character, name of x coordinates object stored in a reactive values object. See details.

rvy

character, name of y coordinates object stored in a reactive values object. See details.

rvbrush

character, double click input id specified in `plotOutput`.

zoomable

logical, whether the plot is intended to be zoomable on double click. Defaults to TRUE.

Value

this function is called for its observer side effects.

Details

These observers require the app plots to be ggplot2 plots. Note that `resetOnNew` in `plotOutput` should be set to FALSE. These observers require a context where it can also be assumed that plot outputs are properly isolated and responsive to updates initiated by the observers. The plot functions themselves also take two data arguments, a brushed data frame that is a subset of rows from a master data frame, and the master. Internally, these plots functions make their own determination of how to plot brushed vs. unbrushed data.

The reactive object passed via dbrush must be wrapped in isolate. The reactive values object containing rvx and rvy must be named rv_plots, i.e., rv_plots <- reactiveValues(x=NULL, y=NULL). The reactive values object containing rvbrush must be named rv, i.e., rv <- reactiveValues(brush=NULL). zoomable is best set to FALSE for discrete x-axis plots like geom_boxplot because zooming in on the discrete axis is problematic for the current brushed data observation implementation.

Examples

#not run