![]() |
# 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 |

Create a new node
In:
xNodeName : Name of the node oGParrent : Graph
[ show source ]
# 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

Create an edge between the current node and the node oNode
[ show source ]
# 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
![Permalink to Public Instance method: []](../../permalink.gif)
Get the value of the node attribut xAttrName
[ show source ]
# File lib/graphviz/node.rb, line 57
57: def []( xAttrName )
58: @oAttrNode[xAttrName.to_s].clone
59: end
![Permalink to Public Instance method: []=](../../permalink.gif)
Set value xAttrValue to the node attribut xAttrName
[ show source ]
# File lib/graphviz/node.rb, line 50
50: def []=( xAttrName, xAttrValue )
51: @oAttrNode[xAttrName.to_s] = xAttrValue
52: end

Get the node name
[ show source ]
# File lib/graphviz/node.rb, line 43
43: def name
44: @xNodeName.clone
45: end

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