Description Usage Arguments Value Note Author(s) See Also Examples
This function and methods add tooltips to SVG elements of a plot that appear when the viewer places the mouse over the element and leaves it there for a second or two. These tooltips can provide more information about the element such as the observation number of a point, its values for other variables, a description of the units of a variable for the axis label, or an overview of a plot from its title element.
1 2 3 4 5 6 7 |
file |
the name of the SVG file, the parsed XML document or an XML node or list of nodes |
text |
the text of the tooltip |
which |
the indices of the elements within |
doc |
the parsed XML document. |
save |
a logical value or a file name that indicates whether the resulting
document is to be written to a file. If this is TRUE, the name of the file is taken
from the XML document ( |
paths |
these are the nodes of the elements in the SVG document which are to be given the tooltips. |
elName |
either "title" or "desc" for the short or longer tooltip. |
addArea |
either a logical value or integer value of 0, 1, or 2. This indicates whether the function should attempt to make the entire area covered by each of the SVG elements active for the tooltip. If this is If this is If this is |
style |
a character string giving the name of the CSS class to
use for any new SVG element that might be added to represent the
event area, i.e. if a rectangle is added to "enclose" text or a
phrase.
This can be be either a class name or an inline CSS specification
of the form "name: value; name: value; ...".
To remove any ambiguity about whether it is a class name or inine
specfication of CSS values, one can use |
addTitleAttribute |
a logical value indicating whether to add a
|
addCSS |
a logical value indicating whether to add the default
CSS file for controlling the appearance of tooltip rectangles. If
this is |
silent |
a logical controlling whether |
... |
additional parameters for methods |
If save
is FALSE, the updated XML document is returned.
If save
is TRUE or a string, the name of the file to which the document was written is
returned.
The interface to this function and its methods is likely to change and become simpler.
Duncan Temple Lang
addAxesLinks
1 2 3 4 5 6 7 8 9 10 11 12 | doc = svgPlot(plot(mpg ~ wt, mtcars))
addToolTips(getAxesLabelNodes(doc), c("Weight", "Miles per US Gallon"),
addArea = TRUE)
addToolTips(doc, rownames(mtcars), addArea = TRUE,
style = "fill: white; stroke: red;")
doc = svgPlot(plot(mpg ~ wt, mtcars))
tips = apply(mtcars, 1,
function(x)
paste(names(mtcars), x, sep = " = ", collapse = ", "))
addToolTips(doc, tips)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.