Learn R Programming

myIO (version 1.2.0)

setBrush: Enable Brush Selection

Description

Enables rectangle brush selection on the chart. When a user drags to select a region, the selected data points are available as a reactive input in Shiny or exportable in static HTML.

Usage

setBrush(myIO, direction = "xy", on_select = "highlight")

Value

A modified myIO htmlwidget object with brush interaction enabled.

Arguments

myIO

an htmlwidget object created by the myIO() function

direction

brush direction: "xy" (default), "x", or "y"

on_select

behavior in static mode: "highlight" (default) or "export" (scopes CSV download to selected points)

Examples

Run this code
myIO(data = mtcars) |>
  addIoLayer(
    type = "point", label = "pts",
    mapping = list(x_var = "wt", y_var = "mpg")
  ) |>
  setBrush()

Run the code above in your browser using DataLab