AgNode-class {Rgraphviz} | R Documentation

## 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

`Ragraph`

### 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)

[Package Rgraphviz version 2.28.0 Index]