Class: ScbiGo::DescendantsGraph

Inherits:
BaseGraph show all
Defined in:
lib/scbi_go/descendants_graph.rb

Instance Method Summary collapse

Methods inherited from BaseGraph

#initialize

Constructor Details

This class inherits a constructor from ScbiGo::BaseGraph

Instance Method Details

#build_dot_lines(nodes) ⇒ Object

override the way that nodes are painted in dot



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/scbi_go/descendants_graph.rb', line 5

def build_dot_lines(nodes)
  res = []
    res << "digraph #{@graph_name} {"

  nodes.each do |node|
    res << "#{node.id.gsub(':','_')}[label=\"#{node.id}\n#{node.name}\"];"
  end
  nodes.each do |node| 
    node.children.each do |child|
      res << "#{node.id.gsub(':','_')} -> #{child.id.gsub(':','_')} ;"
    end
  end
  
  res << "}"

  return res
end