Module: BloomGraph

Includes:
BudGraph
Included in:
MetaMods
Defined in:
lib/bud/labeling/bloomgraph.rb

Instance Method Summary collapse

Instance Method Details

#finish(ignore, name, fmt = :pdf) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/bud/labeling/bloomgraph.rb', line 26

def finish(ignore, name, fmt=:pdf)
  it = ignore.to_set
  tick
  nodes.to_a.each do |n|
    unless it.include? n.name.to_sym
      @graph.add_nodes(n.name, n.meta)
    end
  end

  edges.to_a.each do |e|
    unless it.include? e.from.to_sym or it.include? e.to.to_sym
      @graph.add_edges(e.from, e.to, e.meta)
    end
  end
  @graph.output(fmt => name)
end

#initialize(opts = {:type => :digraph}) ⇒ Object



43
44
45
46
# File 'lib/bud/labeling/bloomgraph.rb', line 43

def initialize(opts={:type => :digraph})
  @graph = GraphViz.new(:G, opts)
  super
end