# Class: GraphViz::Node
[ "README", "AUTHORS", "COPYING", "ChangeLog", "lib/graphviz.rb", "lib/graphviz/node.rb", "lib/graphviz/edge.rb", "lib/graphviz/constants.rb", "lib/graphviz/xml.rb", nil].each do
GraphViz.view_html
GraphViz::Edge.view_html
GraphViz::XML.view_html
GraphViz::Node.view_html
Constants.view_html
end

Class GraphViz::Node < Object

(in files lib/graphviz/node.rb )

Includes

Methods

Public Class method: new( xNodeName, oGParrent = nil )

Create a new node

In:

  xNodeName : Name of the node
  oGParrent : Graph
    # File lib/graphviz/node.rb, line 34
34:     def initialize( xNodeName, oGParrent = nil )
35:       @xNodeName = xNodeName
36:       @oGParrent = oGParrent
37:       @oAttrNode = GraphViz::Attrs::new( nil, "node", NODESATTRS )
38:     end

Public Instance method: <<( oNode )

Create an edge between the current node and the node oNode

    # File lib/graphviz/node.rb, line 64
64:     def <<( oNode )
65:       if( oNode.class == Array ) 
66:         oNode.each do |no|
67:           self << no
68:         end
69:       else
70:         return GraphViz::commonGraph( oNode, self ).add_edge( self, oNode )
71:       end
72:     end

Public Instance method: []( xAttrName )

Get the value of the node attribut xAttrName

    # File lib/graphviz/node.rb, line 57
57:     def []( xAttrName )
58:       @oAttrNode[xAttrName.to_s].clone
59:     end

Public Instance method: []=( xAttrName, xAttrValue )

Set value xAttrValue to the node attribut xAttrName

    # File lib/graphviz/node.rb, line 50
50:     def []=( xAttrName, xAttrValue )
51:       @oAttrNode[xAttrName.to_s] = xAttrValue
52:     end

Public Instance method: name()

Get the node name

    # File lib/graphviz/node.rb, line 43
43:     def name
44:             @xNodeName.clone
45:           end

Public Instance method: set( ) {|self| ...}

Set node attributs

Example :

  n = graph.add_node( ... )
  ...
  n.set { |_n|
    _n.color = "blue"
    _n.fontcolor = "red"
  }
    # File lib/graphviz/node.rb, line 85
85:     def set( &b )
86:       yield( self )
87:     end