Description Usage Arguments Value Author(s) See Also Examples
This function analyzes a given SVG node and attempts to determine the shape of the element. It then returns an object of the corresponding shape class (e.g. Circle, Line, VerticalLine, ...) containing the relevant information about that shape for this element, e.g. the x, y coordinates and the radius for a circle.
1 | getShape(node, d = xmlGetAttr(node, "d"))
|
node |
the SVG node |
d |
the path of the node that draws the shape. |
An object of one of the classes derived from the class Shape
.
These are Circle, Polygon, Polyline, Line, RectangularBoundingBox,
VerticalLine and HorizontalLine.
Duncan Temple Lang
guessSVGShape
. This is probably the more appropriate
function to use.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | dd = list(a = c(rnorm(100), rnorm(10, 3)), b = rnorm(400))
doc1 = svgPlot(boxplot(dd$a))
pts = getPlotPoints(doc1)
shapes = sapply(pts, SVGAnnotation:::getShape)
sapply(shapes, class)
doc2 = svgPlot(boxplot(dd))
pts2 = getPlotPoints(doc2)
shapes = sapply(pts2, SVGAnnotation:::getShape)
sapply(shapes, class)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.