Skip to contents

This function configures the tooltip for a gene chart.

Usage

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

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.

Value

Returns the gene chart object with the tooltip configured.

Examples

# 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 = " <b>Start:</b> {start}<br><b>end:</b> {end}")