guessSVGShape: Determine the shape for an SVG element

Description Usage Arguments Value Author(s) See Also Examples

Description

This function and its methods attempt to determine the shape corresponding to an SVG element.

Usage

1
guessSVGShape(doc, addShapes = TRUE, recursive = FALSE, ...)

Arguments

doc

the SVG element or the document or list of nodes

addShapes

a logical value that determines whether we add a shape attribute to the node with the determined value. This is useful for post-processing the SVG document

recursive

a logical value. Currently ignored. In the future it will control whether child nodes are also processed.

...

additional parameters for the methods

Value

A character vector giving the names of the determined shapes. If addShapes is TRUE, the XML node(s) is modified too as a side effect.

Author(s)

Duncan Temple Lang

See Also

getPlotRegionNodes getPlotPoints getAxesLabelNodes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  dd = svgPlot(plot(1:10, type = "l"))
  rr = getPlotRegionNodes(dd)
  xmlSApply(rr[[1]], guessSVGShape)

  dd = svgPlot(plot(1:10, type = "b"))
  rr = getPlotRegionNodes(dd)
  xmlSize(rr[[1]])
  xmlSApply(rr[[1]], guessSVGShape)


  dd = svgPlot(plot(0:25, pch = 0:25))
  rr = getPlotRegionNodes(dd)
  xmlSApply(rr[[1]], guessSVGShape)

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