Class: ConceptQL::GraphNodifier::BinaryOperatorNode

Inherits:
DotNode show all
Defined in:
lib/conceptql/graph_nodifier.rb

Constant Summary

Constants inherited from DotNode

DotNode::TYPES

Constants included from Behaviors::Dottable

Behaviors::Dottable::TYPE_COLORS

Constants inherited from Nodes::Node

Nodes::Node::KNOWN_TYPES

Instance Attribute Summary

Attributes inherited from DotNode

#values

Attributes inherited from Nodes::Node

#values

Instance Method Summary collapse

Methods inherited from DotNode

#initialize

Methods included from Behaviors::Dottable

#graph_node, #link_to, #node_name, #type_color

Methods inherited from Nodes::Node

#children, #columns, #date_columns, #evaluate, #initialize, #select_it, #stream

Constructor Details

This class inherits a constructor from ConceptQL::GraphNodifier::DotNode

Instance Method Details

#argumentsObject



118
119
120
# File 'lib/conceptql/graph_nodifier.rb', line 118

def arguments
  options.values
end

#display_nameObject



82
83
84
85
86
# File 'lib/conceptql/graph_nodifier.rb', line 82

def display_name
  output = name
  output += "\n#{displayable_options.map{|k,v| "#{k}: #{v}"}.join("\n")}"
  output
end

#displayable_optionsObject



88
89
90
# File 'lib/conceptql/graph_nodifier.rb', line 88

def displayable_options
  options.select{ |k,v| ![:left, :right].include?(k) } || {}
end

#graph_it(g, db) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/conceptql/graph_nodifier.rb', line 100

def graph_it(g, db)
  left.graph_it(g, db)
  right.graph_it(g, db)
  cluster_name = "cluster_#{node_name}"
  me = g.send(cluster_name) do |sub|
    sub[rank: 'same', label: display_name, color: 'black']
    sub.send("#{cluster_name}_left").send('[]', shape: 'point', color: type_color(types))
    sub.send("#{cluster_name}_right").send('[]', shape: 'point')
  end
  left.link_to(g, me.send("#{cluster_name}_left"))
  right.link_to(g, me.send("#{cluster_name}_right"))
  @__graph_node = me.send("#{cluster_name}_left")
end

#leftObject



92
93
94
# File 'lib/conceptql/graph_nodifier.rb', line 92

def left
  options[:left]
end

#rightObject



96
97
98
# File 'lib/conceptql/graph_nodifier.rb', line 96

def right
  options[:right]
end

#typesObject



114
115
116
# File 'lib/conceptql/graph_nodifier.rb', line 114

def types
  left.types
end