module MyChart::Dsl::Material

Public Instance Methods

get_x(id) click to toggle source
# File lib/my_chart/dsl/material.rb, line 25
def get_x id
  raw_data[id || ALL_DATA]
end
material(dat=nil, name: ALL_DATA, &blk) click to toggle source
# File lib/my_chart/dsl/material.rb, line 7
def material dat=nil, name: ALL_DATA, &blk
  data = (dat ? dat : blk.call)
  raw_data[name] = MyChart::X.new data
end
raw_data() click to toggle source
# File lib/my_chart/dsl/material.rb, line 21
def raw_data
  @raw_data ||= {}
end
select(name, opt={}) click to toggle source
# File lib/my_chart/dsl/material.rb, line 12
def select name, opt={}, &blk
  from = opt[:from] || ALL_DATA
  x = raw_data[from]
  raise Exception, '#{from} is not defined' unless x
  result = x.select &blk
  name = opt[:from] ? "#{name}__from__#{opt[:from]}".to_sym : name
  raw_data[name] = result
end