Track Mouse Movement in a GC_chart
This function enables or disables mouse tracking on specified clusters within a GC chart. When enabled, the x and y coordinates of the mouse are displayed which can be used to place annotations.
Usage
r
GC_trackMouse(GC_chart, show = TRUE, cluster = NULL, ...)Arguments
| Argument | Description |
|---|---|
GC_chart | A GC chart object to which the annotations will be added. |
show | Logical, specifies whether to track the mouse or not. |
cluster | Numeric or character vector specifying the clusters to which annotations should be added. |
... | CSS styles of the coordinate tooltip, such as backgroundColor, fontSize or color, and cursor for the cursor over the cluster (default "crosshair"). |
Value
Updated GC chart object with mouse tracking settings.
See also
Examples
r
genes_data <- data.frame(
start = c(10, 50, 90, 130, 170, 210),
end = c(40, 80, 120, 160, 200, 240),
name = c('Gene 1', 'Gene 2', 'Gene 3', 'Gene 4', 'Gene 5', 'Gene 6'),
group = c('A', 'A', 'B', 'B', 'A', 'C'),
cluster = c(1, 1, 1, 2, 2, 2)
)
# Enable mouse tracking
GC_chart(genes_data, cluster = "cluster", group = "group", height = "220px") %>%
GC_trackMouse()