Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

AgNode-class

Class "AgNode": A class to describe a node for a Ragraph object


Description

This class is used to represent nodes for the Ragraph class. One can retrieve various pieces of information as well as draw them.

Objects from the Class

Objects can be created by calls of the form new("AgNode", ...).

Slots

center:

Object of class "xyPoint": The center point of the node

name:

Object of class "character": The name of the node, used to reference it

txtLabel:

Object of class "AgTextLabel": Label for this edge

height:

Object of class "integer": Height of the node in points

rWidth:

Object of class "integer": The right half of the node in points.

lWidth:

Object of class "integer": The left half of the node in points.

color:

Object of class "character": The drawing color of the node.

fillcolor:

Object of class "character": The color to fill in the node with.

shape:

Object of class "character": The shape of the node.

style:

Object of class "character": The style of the node.

Methods

color

signature(object = "AgNode"): Retrieves the drawing color for the node.

fillcolor

signature(object = "AgNode"): Retrieves the color to fill in the node image with.

getNodeCenter

signature(object = "AgNode"): Returns the center point of the node.

getNodeXY

signature(object = "AgNode"): Returns the center as a two element list, with the first element containing the 'x' value and the second element containing the 'y' value.

getNodeHeight

signature(object = "AgNode"): Returns the height of the node.

getNodeLW

signature(object = "AgNode"): Returns the left width of the node.

getNodeRW

signature(object = "AgNode"): Returns the right width of the node.

name

signature(object = "AgNode"): Retrieves the name of the node.

shape

signature(object = "AgNode"): Returns the shape of the node.

style

signature(object = "AgNode"): Returns the style of the node.

txtLabel

signature(object = "AgNode"): Retrieves the node label.

Author(s)

Jeff Gentry

See Also

Examples

V <- letters[1:10]
M <- 1:4
g1 <- randomGraph(V, M, .2)
z <- agopen(g1,name="foo")
x <- AgNode(z) ## list of AgNode objects
vv <- x[[1]]

## The methods in use
color(vv)
fillcolor(vv)
getNodeCenter(vv)
getNodeXY(vv)
getNodeHeight(vv)
getNodeLW(vv)
getNodeRW(vv)
name(vv)
shape(vv)
style(vv)
txtLabel(vv)

Rgraphviz

Provides plotting capabilities for R graph objects

v2.34.0
EPL
Authors
Kasper Daniel Hansen [cre, aut], Jeff Gentry [aut], Li Long [aut], Robert Gentleman [aut], Seth Falcon [aut], Florian Hahne [aut], Deepayan Sarkar [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.