saveAndGetTooltips: Save ggplot and get tooltips

saveAndGetTooltipsR Documentation

Save ggplot and get tooltips

Description

Wrapper for ggsave; after saving a plot, returns an HTML-formatted list of tooltip data (see getTooltips).

Usage

saveAndGetTooltips(
  filename,
  plot = last_plot(),
  device = NULL,
  path = NULL,
  scale = 1,
  width = NA,
  height = NA,
  units = c("in", "cm", "mm", "px"),
  dpi = 300,
  limitsize = TRUE,
  bg = NULL,
  ...,
  varDict,
  plotScales,
  g,
  ggPlotObj = NULL,
  callback = NULL,
  addAttributes = FALSE
)

Arguments

plot

ggplot object or customGrob, see "getSvgAndTooltipdata" for more details.

varDict

Variable dictionary in the following format: list(<variable> = <label>, ...), where <variable> is a valid name of a variable mapped with aes, and <label> is a character string. It defines the composition of information displayed in tooltips.

plotScales

A list with two fields: x and y. Defines axis scales (transformations) for the purpose of displaying original values in tooltips. If NULL (default), values are displayed "as is".

g

A gtable object compiled from the plot (see arrangeGrob).

ggPlotObj

optional, used if plot is a customGrob.

callback

Callback function for adding custom content to the tooltips (see the example app).

addAttributes

Logical parameter determinig whether extra geom attributes should be add to tooltip object.

Value

A list.


Roche/ggtips documentation built on May 14, 2022, 12:44 p.m.