Sha256: 18b5581f7ebcb6bd9a1131d4edccb23a0405c35aa8eef43b51cbe51a4a009ddb

Contents?: true

Size: 680 Bytes

Versions: 8

Compression:

Stored size: 680 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__), *%w[../../lib])

require 'erlectricity'
require 'rubygems'
require 'gruff'

receive do |f|
  f.when([:plot, String, Symbol, String]) do |name, style, font|
    graph = Gruff.const_get(style).new
    graph.title = name
    graph.font = font
    graph.legend_font_size = 10

    f.receive do |g|
      g.when([:data, Symbol, Array]) do |name, points|
        graph.data name, points
        g.receive_loop
      end

      g.when([:labels, Erl.hash]) do |label_data|
        graph.labels = label_data
        g.receive_loop
      end

      g.when(:end) { :ok }
    end

    f.send!([:result, graph.to_blob])
    f.receive_loop
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
mojombo-erlectricity-1.0.0 examples/gruff/gruff_provider.rb
mojombo-erlectricity-1.0.1 examples/gruff/gruff_provider.rb
mojombo-erlectricity-1.0.2 examples/gruff/gruff_provider.rb
erlectricity-funbox-1.1.2 examples/gruff/gruff_provider.rb
erlectricity-1.1.1 examples/gruff/gruff_provider.rb
erlectricity-1.1.0 examples/gruff/gruff_provider.rb
erlectricity-1.0.0 examples/gruff/gruff_provider.rb
erlectricity-1.0.1 examples/gruff/gruff_provider.rb