Learn R Programming

myIO (version 1.2.0)

setLinkedCursor: Toggle Linked Cursor Sync on a myIO Widget

Description

Enables or disables synchronized hover crosshair across linked charts. Composable with linkCharts and setLinked via the pipe: call after linking to opt into cursor sync without re-linking. Preserves any existing interactions$linked configuration.

Usage

setLinkedCursor(myIO, enabled = TRUE, axis = "x")

Value

A modified myIO htmlwidget.

Arguments

myIO

A myIO htmlwidget.

enabled

Logical. TRUE to turn cursor sync on, FALSE to turn it off. Default TRUE.

axis

Character. Which axis to sync: "x" (default), "y", or "xy". Only "x" is active in v1.2; other values are accepted and persisted but not yet rendered.

Examples

Run this code
# \donttest{
w1 <- myIO() |>
  addIoLayer(type = "point", label = "a",
    data = mtcars, mapping = list(x_var = "wt", y_var = "mpg"))
w2 <- myIO() |>
  addIoLayer(type = "point", label = "b",
    data = mtcars, mapping = list(x_var = "hp", y_var = "mpg"))
linked <- linkCharts(w1, w2, on = "cyl")
linked[[1]] <- setLinkedCursor(linked[[1]])
linked[[2]] <- setLinkedCursor(linked[[2]])
# }

Run the code above in your browser using DataLab