addAxesLinks: Add hyperlinks on some of the axes labels and/or plot title

Description Usage Arguments Value Author(s) See Also Examples

Description

This function allows one to associate target URLs with axes labels and plot titles so that the viewer can click on the text and jump to the corresponding URL.

If successful, this also adds the specified CSS content, but won't re-add it if it is already in the document.

Usage

1
2
addAxesLinks(doc, links, nodes = getAxesLabelNodes(doc), 
              css = getDefaultSVGCSS(), style = "link")

Arguments

doc

the parsed XML document containing the SVG graphic

links

a character vector giving the links. At present, this is handled very simply with the elements corresponding to the order of the title and x and y axes assuming they are present. If there is no title, the first element goes with the X axes label...

nodes

the nodes

css

a character vector giving the name of a CSS file which is added to the file. By default, this is added by reference. If you want to insert its contents, call addCSS explicitly. If this is given as the empty character vector or NA, no CSS is added.

style

a CSS style specification. This can be an inlined CSS specfication of the form "name: value; name: value; ..." such as "fill: red; stroke: blue;". Alternatively, this can be a class name which refers to a class defined in (any of) the CSS content associated with this document. The function should be able to tell the difference between an inlined specification and a class name. However, we can explicitly indicate that it is an inline style by identifying it as of class AsIs using the I function, e.g. style = I("fill: red; stroke: blue;"). If we want to suppress any style/class information, we can specify this as NA.

Value

The modified SVG document.

Author(s)

Duncan Temple Lang

See Also

addToolTips

Examples

1
2
3
4
5
  doc = svgPlot(plot(1:10))

  addAxesLinks(doc, c("http://www.omegahat.org",
                      "http://www.r-project.org"),
                style = "fill: transparent; stroke: red;")

duncantl/SVGAnnotation documentation built on May 15, 2019, 5:57 p.m.