getTooltips | R Documentation |
Returns a list of tooltips for a ggplot, grouped by plot geometries and layers. Each element of the list is a data frame with HTML-formatted tooltip contents (column 'tooltip') and coordinates relative to the size of the image ('coordX' and 'coordY').
getTooltips(plot, varDict, plotScales, g, callback, addAttributes = FALSE)
plot |
A ggplot object. |
varDict |
Variable dictionary in the following format:
|
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). |
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. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.