找回密码
 注册
查看: 1606|回复: 0

R语言 SVGAnnotation包 getNodeElements()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-22 21:11:04 | 显示全部楼层 |阅读模式
getNodeElements(SVGAnnotation)
getNodeElements()所属R语言包:SVGAnnotation

                                        Functions for working with Rgraphviz plots in SVG
                                         在SVG工作Rgraphviz图的功能

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

These functions provide some support  for working with  graphs in SVG generated via Rgraphviz.
这些功能提供一些通过Rgraphviz产生SVG的图形工作的支持。

addGraphIds takes the graph layout (Ragraph-class) object and determines the SVG elements corresponding to the nodes and edges and places id and class attributes on each. This allows us to easily identify the elements in subsequent computations, both in R and JavaScript.
addGraphIds需要图形布局(Ragraph-class)对象,并确定相应的节点和边的和地方的ID和每个类属性的SVG元素。这使我们能够很容易地确定在随后的计算中的元素,都在研发和JavaScript。

A single node in the graph typically has two SVG elements associated with it: the circle and the text/label. We treat the circle as the node. The ids for the node circles are taken as the names from the graph layout object. The ids for the node labels are the same names but with "-label" appended.
图中的一个单一的节点通常有两个与它相关的SVG元素:圆和文本/标签。我们把节点的圆圈。从图中布局对象名称节点各界的ID。节点标签的ID是相同的名称,但与“标签”追加。

The id for an edge is slightly more complex. The general format is  "edge:tail-head", where tail and head are the names of the relevant nodes.  For undirected edges, the order is important. The head is the earlier node in the list of node names. (We haven't dealt with directed edges yet.)
边缘的ID是稍微复杂一些。一般格式是“边缘:尾头”,其中尾部和头部有关节点的名称。无向边,顺序是很重要的。头,是国内较早的节点名称列表中的节点。 (我们不向边处理。)

The edges have class "edge" and the nodes  "node" and the text of the node "nodeLabel"
边缘有“边缘”类和节点的“节点”和“节点”nodeLabel“文本

getNodeElements and getEdgeElements can be used to get the SVG elements in the document that correspond to the nodes and edges using the class attribute added by addGraphIds. These functions will not work correctly before addGraphIds has been called.
getNodeElements和getEdgeElements可以用来得到文档中使用类的属性addGraphIds添加节点和边对应的SVG元素。这些功能将无法正常工作,前addGraphIds被称为“。

getEdgeInfo is used by addGraphIds and by users annotating SVG documents in R to get the edge identifiers (i.e. the id attributes) in the correct form. Unlike the other functions, this does not work with the SVG document, but with the graph object directly. There are methods for a graphNEL object and a laid-out Ragraph
getEdgeInfo用addGraphIds“用户注释在R SVG文档,以正确的形式(即id属性)的边缘标识符。与其他功能不同的是,这并不工作与SVG文件,但直接与图形对象。有graphNEL对象的方法和下岗了Ragraph

These functions are not necessarily complete (!)  and will not necessarily work for different types of graph layouts.  The basic ideas however should extend readily to these other types but have not been implemented yet.  Currently, the functions will typically only work correctly when each edge corresponds to just one SVG element. This is the case for the twopi layout.
这些功能不一定是完整的(!),不一定会为不同类型的图形布局。但是,其基本思路应该延长随手把这些其他类型,但尚未实现。目前,该功能通常只有正常工作时,每边只相当于一个SVG元素。这是为twopi布局的情况下。


用法----------Usage----------


addGraphIds(doc, graph,
            main = getNodeSet(doc,
                              "//s:svg/s:g/s:g",
                              c("s"= "http://www.w3.org/2000/svg"))[[1]])
getNodeElements(doc)
getEdgeElements(doc)
getEdgeInfo(graph, ...)



参数----------Arguments----------

参数:doc
the parsed XML/SVG document
解析XML / SVG文档


参数:graph
the graph object. For addGraphIds, this should be an object of class Ragraph returned by a call to agopen.  This is the already laid-out graph. For getEdgeInfo, this can also be a graph description, e.g graphNEL object.  
图形对象。 addGraphIds,这应该是一个类的对象Ragraph调用agopen由选举产生。这是已经下岗了图。 对于getEdgeInfo,这也可以是一个图的描述,例如graphNEL对象。


参数:main
the XML element in the SVG document which contains (as children) the elements for the nodes and edges in our graph
在我们图中的节点和边缘的元素(如儿童),其中包含的SVG文档的XML元素


参数:...
extra parameters for methods to specialize
额外的参数的方法,专门


值----------Value----------

getNodeElements returns a list of XMLInternalNode objects corresponding to the nodes of the graph in the SVG display. Similarly, getEdgeElements returns a list of XMLInternalNode objects corresponding to the edges in the graph.
getNodeElementsXMLInternalNode对象相应的SVG显示的图形的节点返回一个列表。同样,getEdgeElements返回一个列表XMLInternalNode对象,对应图中的边缘。

addGraphIds returns a list with three elements
addGraphIds返回列表与三个要素

edgeIdsa character vector giving the values of the id attributes for the SVG elements corresponding to the graph's edges.
edgeIdsa特征向量给SVG元素相应的图形的边缘id属性的值。

edgeLabelsa character vector giving the text labels for the edges.
edgeLabelsa字符向量边缘的文本标签。

nodeIdsa character vector giving the values of the id attributes for the SVG elements corresponding to the graph's nodes.   
给nodeIdsa特征向量图的节点相应的SVG元素id属性的值。

getEdgeInfo returns a list with as manay elements as there are edges. Each element is a character vector giving the "edge:src-dest" label identifying the connections..
getEdgeInfo返回manay元素的一个列表,有边缘。每个元素都是一个特征向量,使“边缘:SRC-DEST”的标签标识连接......


作者(S)----------Author(s)----------


Duncan Temple Lang



参考文献----------References----------

BioConductor book "Bioinformatics and Computational Biology Solutions Using R and BioConductor". Gentleman, Carey, Huber, Irizarry and Dudoit (Editors). 2005.

参见----------See Also----------

svgPlot
svgPlot


举例----------Examples----------


  # See the example in the tests/ directory of the package.[封装/测试目录中看到的例子。]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-22 15:52 , Processed in 0.024181 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表