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

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

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

                                         A function to compute layouts of  graph objects
                                         一个函数来计算图形对象的布局

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

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

This is a wrapper to layout graph objects using arbitrary layout engines. The default engine (and so far the only implemented engine) is ATT's Graphviz.
这是一个使用任意的布局引擎的布局图形对象的包装。 ATT的Graphviz的默认引擎(迄今唯一实现发动机)。


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



layoutGraph(x, layoutFun = layoutGraphviz, ...)




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

参数:x
A graph object  
一个图形对象


参数:layoutFun
A function that performs the graph layout and returns a graph object with all necessary rendering information  
执行图形布局和函数返回一个图形对象,所有必要的渲染信息


参数:...
Further arguments that are passed to layoutFun  
进一步的参数传递给layoutFun


Details

详情----------Details----------

Layout of a graph and its rendering are two separate processes. layoutGraph provides an API to use an arbitrary algorithm for the layout. This is archived by abstraction of the layout process into a separate function (layoutFun) with well-defined inputs and outputs. The only requirements on the layoutFun are to accept a graph object as input and to return a valid graph object with all the necessary rendering information stored in its renderInfo slot. This information comprises
图形的布局和它的渲染是两个独立的进程。 layoutGraph使用任意算法的布局提供了一个API。这是存档的布局过程抽象成一个单独的函数(layoutFun)具有明确的输入和输出。 layoutFun唯一的要求是接受一个图形对象作为输入,并返回一个与所有必要的渲染在其renderInfo插槽存储的信息的有效的图形对象。此信息包括

<STRONG>for nodes:</STRONG>
节点<STRONG>:</ STRONG>




nodeX, nodeY the locations of the nodes, in the coordinate
nodeX,nodeY节点的位置,在坐标




lWidth, rWidth the width components of the nodes,
lWidth,rWidth节点的宽度组件,




height the heights of the nodes.
高度节点的高度。




labelX, labelY node label locations.
labelX,labelY节点的标签位置。




labelJust the justification of the node labels.
labelJust的节点标签的理由。




label node label text.
标签节点标签文本。




shape the node shape. Valid values are box, rectangle, ellipse, plaintext, circle
塑造节点的形状。有效的值是box,rectangle,ellipse,plaintext,circle

<STRONG>for edges:</STRONG>
的边缘<STRONG>:</ STRONG>




splines representation of the edge splines as a list of
作为一个列表的边花键的花键表示




labelX, labelY edge label locations.
labelX,labelY边缘标签的位置。




label edge label text.
标签边缘的标签文本。




arrowhead, arrowtail some of Graphviz's arrow shapes are supported. Currently they are: open, normal, dot, odot, box, obox, tee, diamond, odiamond and none. In addition, a user-defined function can be passed which needs to be able to deal with 4 arguments: A list of xy coordinates for the center of the arrowhead, and the graphical parameters col, lwd and
慈菇,arrowtail Graphviz的箭头形状的一些支持。目前,他们有:open,normal,dot,odot,box,obox,tee,diamond。 ,odiamond和none。此外,用户定义函数可以通过它需要能够处理4个参数:列表中的XY坐标为中心的箭头,图形参数col,lwd“




direction The edge direction. The special value both is
方向的边缘方向。特殊值both

To indicate that this information has been added to the graph, the graph plotting function should also set the laidout flag in the graphData slot to TRUE and add the bounding box information (i.e., the coordinate system in which the graph is laid out) in the format of a two-by-two matrix as item bbox in the graphData slot.
,表明此信息已被添加到图,图的绘图功能也应该设置在graphData插槽laidout标志TRUE和添加边界框信息(即坐标系统图了)在两两矩阵格式项目bboxgraphData插槽。

AT&amp;T's Graphviz is the default layout algorithm to use when layoutGraph is called without a specific layoutFun function. See agopen for details about how to tweak Graphviz and the valid arguments that can be passed on through .... The most common ones to set in this context might be layoutType, which controls the type of layout to compute and the nodeAttrs and edgeAttrs arguments, which control the fine-tuning of nodes and edges.
AT&T的Graphviz是默认的布局算法,使用时layoutGraph没有一个特定的layoutFun功能称为。 agopen如何调整的详细信息,请参阅Graphviz“可以通过通过有效的参数....在这方面设置的最常见的可能是layoutType,控制布局类型计算nodeAttrs和edgeAttrs参数,从而控制节点和边的微调, 。


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

An object inheriting from class graph
对象继承类graph


注意----------Note----------

Please note that the layout needs to be recomputed whenever attributes are changed which are bound to affect the position of nodes or edges. This is for instance the case for the arrowhead and arrowtail parameters.
请注意布局的属性被更改时,这势必会影响到节点或边缘的位置,需要重新计算。举例来说,这是arrowhead和arrowtail参数的情况下。


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


Florian Hahne, Deepayan Sarkar



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

renderGraph, graph.par, nodeRenderInfo, edgeRenderInfo, agopen,
renderGraph,graph.par,nodeRenderInfo,edgeRenderInfo,agopen


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


library(graph)
set.seed(123)
V <- letters[1:5]
M <- 1:2
g1 <- randomGraph(V, M, 0.5)
edgemode(g1) <- "directed"
x <- layoutGraph(g1)
renderGraph(x)

## one of Graphviz's additional layout algorithms[Graphviz的额外的布局算法]
x <- layoutGraph(g1, layoutType="neato")
renderGraph(x)

## some tweaks to Graphviz's node and edge attributes,[#Graphviz的节点和边的属性的一些调整,]
## including a user-defined arrowhead and node shape functions.[#包括一个用户定义的箭头和节点形函数。]
myArrows <- function(x, ...)
{
for(i in 1:4)
points(x,cex=i)
}

myNode <- function(x, col, fill, ...)
symbols(x=mean(x[,1]), y=mean(x[,2]), thermometers=cbind(.5, 1,
runif(1)), inches=0.5,
fg=col, bg=fill, add=TRUE)

eAtt <- list(arrowhead=c("a~b"=myArrows, "b~d"="odiamond", "d~e"="tee"))
nAtt <- list(shape=c(d="box", c="ellipse", a=myNode))
edgemode(g1) <- "directed"
x <- layoutGraph(g1, edgeAttrs=eAtt, nodeAttrs=nAtt, layoutType="neato")
renderGraph(x)


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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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