Learn R Programming

geneviewer (version 0.1.10)

GC_tooltip: Set Tooltip for a Gene Chart

Description

This function configures the tooltip for a gene chart.

Usage

GC_tooltip(
  GC_chart,
  formatter = "Start: {start}
End: {end}", show = TRUE, cluster = NULL, ... )

Value

Returns the gene chart object with the tooltip configured.

Arguments

GC_chart

The gene chart object to be modified.

formatter

A character string defining the HTML content of the tooltip. It can include placeholders like {start} and {end} which will be replaced by actual data values. The default value shows start and end data.

show

Logical, whether to display the tooltip or not.

cluster

Optional; used to specify which clusters in the chart should have tooltips.

...

Additional arguments that can be used to further customize the tooltip.

Examples

Run this code
# Set tooltip
genes_data <- data.frame(
  start = c(10, 90, 130, 170, 210),
  end = c(40, 120, 160, 200, 240),
  name = c('Gene 1', 'Gene 2', 'Gene 3', 'Gene 4', 'Gene 5'),
  group = c('A', 'B', 'B', 'A', 'C')
)

# Add tooltips to the gene chart
GC_chart(genes_data, group = "group", height = "200px") %>%
GC_tooltip(formatter = " Start: {start}end: {end}")

Run the code above in your browser using DataLab