powered by
Enables annotation mode where clicking a data point opens a label input. Annotations are stored as data and can be exported or accessed as a Shiny reactive input.
setAnnotation(myIO, labels = NULL, colors = NULL, mode = "click")
A modified myIO htmlwidget object with annotation enabled.
myIO
an htmlwidget object created by the myIO() function
myIO()
character vector of preset label options (optional). If provided, shows a dropdown instead of free-text input.
named character vector of category colors (optional). Names are category labels, values are CSS colors.
"click" (default) to annotate individual points.
"click"
myIO(data = mtcars) |> addIoLayer( type = "point", label = "pts", mapping = list(x_var = "wt", y_var = "mpg") ) |> setAnnotation(labels = c("outlier", "normal"))
Run the code above in your browser using DataLab