Skip to contents

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")

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)

Value

A modified myIO htmlwidget object with brush interaction enabled.

Examples

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