analytica 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/lib/analytica.rb CHANGED
@@ -4,7 +4,7 @@ require File.join(File.dirname(__FILE__), 'computation')
4
4
  require File.join(File.dirname(__FILE__), 'visualization')
5
5
 
6
6
  module Analytica
7
- VERSION = '0.0.10'
7
+ VERSION = '0.0.11'
8
8
 
9
9
  include Strict
10
10
 
data/lib/computation.rb CHANGED
@@ -169,9 +169,9 @@ module Analytica
169
169
  def exponential_moving_average(params)
170
170
  enforce_map!({
171
171
  :samples => :integer,
172
- :alpha=> :float}, params)
172
+ :alpha => :float}, params)
173
173
 
174
- moving_average(:decay => :exponential, :samples => params[:samples], :alpha => params[:alpha])
174
+ moving_average(:decay => :exponential, :samples => self.size, :alpha => params[:alpha])
175
175
  end
176
176
 
177
177
  alias_method :ema, :exponential_moving_average
data/lib/visualization.rb CHANGED
@@ -218,13 +218,14 @@ module Analytica
218
218
 
219
219
  options.merge!(color)
220
220
 
221
- label = {
222
- :legend => ['x', 'y'], # TODO number of datasets
223
- :axis_with_labels => ['x','r'], #TODO number of datasets
224
- :axis_labels => [[],[]] # TODO
225
- }
226
-
227
- options.merge!(label)
221
+ if @labels_set
222
+ label = {
223
+ :axis_with_labels => ['x', 'y' ,'r'],
224
+ :axis_labels => @labels
225
+ }
226
+
227
+ options.merge!(label)
228
+ end
228
229
 
229
230
  Gchart.line(options)
230
231
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: analytica
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
9
+ - 11
10
+ version: 0.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Raeez Lorgat