isAnnotationGroup(SVGAnnotation)
isAnnotationGroup()所属R语言包:SVGAnnotation
Determine if an SVG element is made up of sub-elements positioned
确定,如果一个SVG元素的子元素的位置
译者:生物统计家园网 机器人LoveR
描述----------Description----------
When we decorate an R plot with calls to functions such as lines, abline, text, symbols and so on, these appear in the resulting SVG in a separate group (<g>) element. This function allows us to determine if such a group is made up of SVG child elements that are physically/geographically located within another region's area, i.e. located within the bounding box of the parent node. If they are, this is likely to be a collection of decorations.
当我们装饰ŕ图与调用功能,如lines,abline,text,symbols等等,这些在SVG的出现在一个单独的组( <g>)元素。此功能可以让我们确定,如果是这样一组孩子的身体/地理位于其他区域的区域内位于parent节点的边界框,即SVG的元素。如果是这样,这很可能是一个收集的装饰品。
用法----------Usage----------
isAnnotationGroup(g, parent, bbox = getBoundingBox(parent), scalar = TRUE)
参数----------Arguments----------
参数:g
an SVG element whose children are tested to determine which objects
SVG元素的儿童进行测试,以确定哪些对象
参数:parent
the parent SVG element of whom we are querying whether the elements in g are inside this element's bounding box
其中我们查询g元素是否是此元素的边界框里面的父SVG元素
参数:bbox
the bounding box object of the parent which can be specified without a parent if it has already been computed
母公司的边界框对象,如果它已经计算可以指定没有父
参数:scalar
a logical value indicating whether we want a single predicate value indicating whether all of the elements are inside the bounding box, or alternatively a vector with a logical value for each of the child nodes of g indicating which are and which aren't contained in parent's bounding box.
一个逻辑值,指明是否要一个单一的谓词值,该值指示是否所有的元素是内部边界框,或者与一个每个g指示哪些子节点的逻辑值的向量和AREN“ ţ包含在parent的边框。
值----------Value----------
A logical value.
一个逻辑值。
作者(S)----------Author(s)----------
Duncan Temple Lang
参见----------See Also----------
isInside getBoundingBox
isInsidegetBoundingBox
举例----------Examples----------
doc = svgPlot({
plot(1:10, pch = '+', bg = c("red"), fg = "blue")
abline(v = c(3, 7), col = 'blue', lty = 3)
abline(h = c(3, 7, 9), col = 'lightgray', lty = 2)
})
r = getPlotRegionNodes(doc)
length(r) # 1 and they are just the lines.[1,他们只是行。]
SVGAnnotation:::isAnnotationGroup(r[[2]], r[[1]])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|