Class: GV::BaseGraph
Overview
Common super-class for graphs and sub-graphs
Instance Attribute Summary
Attributes inherited from Component
Instance Method Summary collapse
-
#directed? ⇒ Boolean
Whether this graph is directed.
-
#edge(name, tail, head, attrs = {}) ⇒ Edge
Creates a new edge to associate with this edge.
-
#node(name, attrs = {}) ⇒ Node
Creates a new node to associate with this node.
-
#strict? ⇒ Boolean
Whether this graph is strict.
-
#sub_graph(name, attrs = {}) {|graph| ... } ⇒ SubGraph
Creates a new sub-graph to associate with this sub-graph.
Methods inherited from Component
#==, #[], #[]=, #hash, #html, #name
Instance Method Details
#directed? ⇒ Boolean
Returns whether this graph is directed.
190 191 192 |
# File 'lib/gv.rb', line 190 def directed? Libcgraph.agisdirected(ptr) == 1 end |
#edge(name, tail, head, attrs = {}) ⇒ Edge
Creates a new edge to associate with this edge
172 173 174 |
# File 'lib/gv.rb', line 172 def edge(name, tail, head, attrs = {}) component Edge, [name, tail, head], attrs end |
#node(name, attrs = {}) ⇒ Node
Creates a new node to associate with this node
160 161 162 |
# File 'lib/gv.rb', line 160 def node(name, attrs = {}) component Node, [name], attrs end |
#strict? ⇒ Boolean
Returns whether this graph is strict.
195 196 197 |
# File 'lib/gv.rb', line 195 def strict? Libcgraph.agisstrict(ptr) == 1 end |