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

R语言 geneplotter包 imageMap-methods()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 18:55:43 | 显示全部楼层 |阅读模式
imageMap-methods(geneplotter)
imageMap-methods()所属R语言包:geneplotter

                                        Write an HTML IMG tag together with a MAP image map.
                                         写一个HTML IMG标记连同图图像图。

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

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

Write an HTML IMG tag together with a MAP image map.
写一个HTML IMG标记连同图图像图。


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


  ## S4 method for signature 'matrix,connection,list,character'
imageMap(object, con, tags, imgname)



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

参数:object
Matrix with 4 columns, specifying the coordinates of the mouse-sensitive region . Each row specifies the corners of a  rectangle within the image, in the following order: (left x, lower y, right x, upper y). Note that the point (x=0, y=0) is  at the left upper side of the image.
矩阵的4列,指定鼠标敏感区域的坐标。每一行指定一个图像内的矩形的边角,顺序如下:(左X,Y,合适的x,的Y)。注意点(X = 0,Y = 0),在左边上侧的图像。


参数:con
Connection to which the image map is written.
写入连接,影像图。


参数:tags
Named list whose elements are named character vectors. Names must correspond to node names in object. See details.
名为List的元素被命名为特征向量。名object节点名称必须符合。查看详情。


参数:imgname
Character. Name of the image file (for example PNG file) that contains the plot.
字符。包含图的图像文件(例如PNG文件)的名称。


Details

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

The most important tags are TITLE, HREF, and TARGET. If the list tags contains an element with name TITLE, then this must be a named character vector containing the tooltips that are to be displayed when the mouse moves over a node. The names of the nodes are specified in the names attribute  of the character vector and must match those of object.
最重要的标签是TITLEHREF,TARGET。如果列表tags包含一个名字TITLE,那么这必须是一个命名的特征向量,包含工具提示,当鼠标移动节点要显示的元素。节点的名称被指定在names属性的特征向量,必须符合那些object。

Similarly, HREF may be used to specify hyperlinks that the browser can follow when the mouse clicks on a node, and TARGET to specify the target browser window.
同样,HREF可以用来指定超链接,浏览器可以按照当一个节点上点击鼠标,TARGET指定目标浏览器窗口。

Currently, only rectangular regions are implemented; the actual shape of the nodes as specified in object is ignored. Also, tags for edges of the graph are currently not supported.
目前,只有矩形区域实施的作为object指定节点的实际形状被忽略。此外,目前不支持图形边缘的标签。

This function is typically used with the following sequence of steps:
此功能通常用于下列顺序与步骤:

generate your graphic and save it as a bitmap file, e.g. using the jpeg, png, or bitmap device. At this stage, you also need to figure out the pixel coordinates of the interesting regions within your graphic. Since the mapping between device coordinates and pixel coordinates is not obvious, this may be a little tricky. See the examples below, and for a more complex example, see the source code of the function plotPlate.
生成图形并保存为位图文件,例如:使用jpeg,png或bitmap设备。在这个阶段,你还需要找出有趣的区域内的图形的像素坐标。由于设备坐标和像素坐标之间的映射关系并不明显,这可能是有点棘手。看到下面的例子,和一个更为复杂的例子,看到源代码的功能plotPlate。

open an HTML page for writing and write HTML header, e.g. using the openHtmlPage function.
打开一个写作的HTML页面和写HTML标题,例如:使用openHtmlPage功能。

Call the imageMap function.
呼叫imageMap功能。

Optionally, write further text into the HTML connection.
另外,写的HTML连接到进一步的文本。

Close HTML file, e.g. using the closeHtmlPage function.
关闭HTML文件,例如:使用closeHtmlPage功能。


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

The function is called for its side effect, which is writing text into
其副作用,这是写文本的功能被称为


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


Wolfgang Huber <a href="http://www.dkfz.de/abt0840/whuber">http://www.dkfz.de/abt0840/whuber</a>



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

plotPlate,
plotPlate


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


f1  = paste(tempfile(), ".html", sep="")
f2  = paste(tempfile(), ".html", sep="")
fpng = tempfile()

if(capabilities()["png"]) {
  ## create the image[#创建的图像。]
  colors = c("#E41A1C","#377EB8","#4DAF4A","#984EA3","#FF7F00","#FFFF33","#A65628","#F781BF","#999999")[E41A1C“,”#377EB8“,”#4DAF4A“,”#984EA3“,”#FF7F00“,”#FFFF33“,”#A65628“,”#F781BF“,”#999999“)]
  width  = 512
  height = 256
  png(fpng, width=width, height=height)
  par(mai=rep(0,4))
  plot(0,xlim=c(0,width-1),ylim=c(0,height-1),xaxs="i",yaxs="i",type="n",bty="n")
  cx=floor(runif(100)*(width-11))
  cy=floor(runif(100)*(height-11))
  coord=cbind(cx, cy, cx+10, cy+10)
  rect(coord[,1], height-coord[,2], coord[,3], height-coord[,4],
       col=sample(colors, 100, replace=TRUE))
  text(width/2, height-3, "Klick me!", adj=c(0.5, 1), font=2)
  dev.off()

  ## create the frame set[#创建框架集]
  cat("<html><head><title>Hello world</title></head>\n",
      "<frameset rows=\"280,*\" border=\"0\">\n",
      "<frame name=\"banner\" src=\"file://", f2, "\">\n",
      "<frame name=\"main\" scrolling=\"auto\">",
      "</frameset>", sep="",file=f1)

  ## create the image map[#创建图像图]
  href  =sample(c("www.bioconductor.org", "www.r-project.org"),nrow(coord),replace=TRUE)
  title =sample(as.character(packageDescription("geneplotter")),nrow(coord),replace=TRUE)
  con = file(f2, open="w")
  imageMap(coord, con,
    list(HREF=paste("http://", href, sep=""),
         TITLE=title, TARGET=rep("main", nrow(coord))), fpng)
  close(con)

  cat("Now have a look at file ", f1, " with your browser.\n", sep="")
}

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-8 00:11 , Processed in 0.036996 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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