gerbilcharts 0.2.13 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/History.txt +35 -0
  2. data/Manifest.txt +8 -0
  3. data/README.txt +8 -8
  4. data/lib/gerbilcharts/charts.rb +3 -0
  5. data/lib/gerbilcharts/charts/bubble_chart.rb +30 -0
  6. data/lib/gerbilcharts/charts/conversation_ring.rb +31 -0
  7. data/lib/gerbilcharts/charts/line_chart.rb +1 -0
  8. data/lib/gerbilcharts/charts/matrix_chart.rb +32 -0
  9. data/lib/gerbilcharts/charts/square_line_chart.rb +7 -0
  10. data/lib/gerbilcharts/models.rb +1 -0
  11. data/lib/gerbilcharts/models/bucketized_timeseries_graph_model.rb +1 -1
  12. data/lib/gerbilcharts/models/graph_model_group.rb +19 -2
  13. data/lib/gerbilcharts/models/matrix_model.rb +85 -0
  14. data/lib/gerbilcharts/models/monotonous_graph_model.rb +5 -1
  15. data/lib/gerbilcharts/models/presets.rb +18 -11
  16. data/lib/gerbilcharts/models/raw_range.rb +1 -1
  17. data/lib/gerbilcharts/models/round_range.rb +3 -1
  18. data/lib/gerbilcharts/models/round_time_range.rb +19 -29
  19. data/lib/gerbilcharts/models/sampled_timeseries_graph_model.rb +1 -1
  20. data/lib/gerbilcharts/public/brushmetal.css +123 -74
  21. data/lib/gerbilcharts/public/gerbil.js +104 -64
  22. data/lib/gerbilcharts/surfaces.rb +3 -0
  23. data/lib/gerbilcharts/surfaces/bubble_surface.rb +105 -0
  24. data/lib/gerbilcharts/surfaces/chart.rb +4 -2
  25. data/lib/gerbilcharts/surfaces/conversation_ring.rb +64 -0
  26. data/lib/gerbilcharts/surfaces/detailed_legend.rb +35 -13
  27. data/lib/gerbilcharts/surfaces/graph_element.rb +8 -1
  28. data/lib/gerbilcharts/surfaces/grid.rb +8 -2
  29. data/lib/gerbilcharts/surfaces/horizontal_axis.rb +12 -3
  30. data/lib/gerbilcharts/surfaces/horizontal_time_axis.rb +5 -4
  31. data/lib/gerbilcharts/surfaces/impulse_surface.rb +1 -1
  32. data/lib/gerbilcharts/surfaces/legend.rb +43 -6
  33. data/lib/gerbilcharts/surfaces/mark_band.rb +17 -1
  34. data/lib/gerbilcharts/surfaces/matrix_surface.rb +87 -0
  35. data/lib/gerbilcharts/surfaces/pie_surface.rb +109 -96
  36. data/lib/gerbilcharts/surfaces/rect.rb +18 -0
  37. data/lib/gerbilcharts/surfaces/stacked_area_surface.rb +42 -2
  38. data/lib/gerbilcharts/surfaces/stacked_grid.rb +1 -3
  39. data/lib/gerbilcharts/surfaces/title_panel.rb +7 -2
  40. data/lib/gerbilcharts/surfaces/tracker.rb +4 -1
  41. data/lib/gerbilcharts/surfaces/vertical_axis.rb +2 -2
  42. data/lib/gerbilcharts/svgdc.rb +1 -0
  43. data/lib/gerbilcharts/svgdc/css_inliner.rb +2 -2
  44. data/lib/gerbilcharts/svgdc/svg_ellipse.rb +21 -0
  45. data/lib/gerbilcharts/svgdc/svg_polygon.rb +19 -0
  46. data/lib/gerbilcharts/svgdc/svgdc.rb +4 -1
  47. data/lib/gerbilcharts/version.rb +2 -3
  48. data/test/test_bar.rb +1 -1
  49. data/test/test_bubble.rb +52 -0
  50. data/test/test_conversation.rb +34 -0
  51. data/test/test_lines.rb +3 -3
  52. data/test/test_matrix.rb +34 -0
  53. data/test/test_noob.rb +9 -6
  54. data/test/test_pie.rb +2 -2
  55. data/test/test_ranges.rb +15 -2
  56. data/test/test_sa.rb +88 -0
  57. metadata +14 -2
data/test/test_pie.rb CHANGED
@@ -14,8 +14,8 @@ class TestPie < Test::Unit::TestCase
14
14
  modelgroup = GerbilCharts::Models::SimpleTimeSeriesModelGroup.new(
15
15
  :title => "Sales figures",
16
16
  :timeseries => (1..6).collect { |month| Time.local(2008,month) },
17
- :models => [ ["Bruce", 1, 10, 18, 28, 80, 1340.7890],
18
- ["Rex" , 112,22, 45, 70, 218, 3098.98]
17
+ :models => [ ["Bruce", 1, 10, 18, 28, 80, 1340.7890]
18
+ #["Rex" , 112,22, 45, 70, 218, 3098.98]
19
19
  # ["Sharmila", 112,22, 45, 70, 218, 245]
20
20
  #["Wasim", 112,22, 45, 70, 218, 145],
21
21
  # ["Buzo" , 0, 23, 25, 40, 18, 59],
data/test/test_ranges.rb CHANGED
@@ -134,8 +134,6 @@ class TestRanges < Test::Unit::TestCase
134
134
 
135
135
  def test_negative_range
136
136
 
137
- debugger
138
-
139
137
  r = GerbilCharts::Models::RawRange.new
140
138
  [-11000,19920,20001].each do |v|
141
139
  r.update v
@@ -152,5 +150,20 @@ class TestRanges < Test::Unit::TestCase
152
150
 
153
151
  end
154
152
 
153
+ def test_long_time_range
154
+
155
+ r = GerbilCharts::Models::RawRange.new
156
+ tbase = Time.local(1973,"Apr",2,8,30,0)
157
+ r.update tbase
158
+ r.update(tbase+100000)
159
+
160
+ rr = GerbilCharts::Models::RoundTimeRange.new(r)
161
+
162
+ rr.each_label do |v,s|
163
+ p "v = #{v} s=#{s}"
164
+ end
165
+
166
+ end
167
+
155
168
 
156
169
  end
data/test/test_sa.rb ADDED
@@ -0,0 +1,88 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ require './trafgen'
4
+
5
+ # tests some easy to use mods
6
+ # newbies enter here
7
+ class TestChartsNoob < Test::Unit::TestCase
8
+
9
+ def setup
10
+
11
+ @test_vectors = {
12
+ "eth0"=> [100, 200, 4000,4001, 2001, 2999,8000, 19000,38000,3173000, 78000,1200,1000010] ,
13
+ "wlan0"=> [600,1200,84000,14001,22001,2209,48000,1900, 3800, 873000,478000,1121200,4000010] ,
14
+ }
15
+
16
+ @tbegin = Time.local( 1978, "jun", 5, 9, 10, 0, 0)
17
+ @tend = @tbegin + 10000 # for more than 1 hour
18
+ #@tend = @tbegin + 4000 # for more than 1 hour
19
+ #@tend = @tbegin + 22*86400 # for more than 1 hour
20
+ end
21
+
22
+ def mk_models1
23
+ modelarr = []
24
+ @test_vectors.each_pair do |k,v|
25
+ tb = @tbegin.clone
26
+ mod = GerbilCharts::Models::BucketizedTimeSeriesGraphModel.new( k, 300 )
27
+ v.each do | val |
28
+ mod.add(tb,val)
29
+ tb = tb + 300
30
+ end
31
+ modelarr << mod
32
+ end
33
+ modelarr
34
+ end
35
+
36
+ def mk_models2
37
+
38
+ # between 200K and 6M
39
+ %w(eth0 eth1 eth2 wlan0 wlan1 br0:1 bridge0:2).collect do |n|
40
+ mk_mod(n,200000,6000000)
41
+ end
42
+
43
+ end
44
+
45
+ def mk_mod(name,min,max)
46
+ model1 = GerbilCharts::Models::BucketizedTimeSeriesGraphModel.new(name, 300 )
47
+ TimeSeriesDataGenerator.new(@tbegin,@tend,300,min, max).each_tuple do |t,v|
48
+ model1.add(t,v)
49
+ end
50
+ return model1
51
+ end
52
+
53
+
54
+
55
+ # test daily traffic
56
+ def test_daily_traf_1
57
+
58
+
59
+ modelarr = []
60
+ #modelarr = mk_models2
61
+ modelarr << mk_mod("fixed-11",11000000,11000000)
62
+ modelarr << mk_mod("fixed-3", 3000000, 3000000)
63
+
64
+ refmod = mk_mod("ref", 60000000, 75000000)
65
+
66
+ # modelgroup
67
+ modelgroup = GerbilCharts::Models::GraphModelGroup.new( "External Traffic")
68
+ modelarr.each { |m| modelgroup.add(m) }
69
+ #modelgroup.ref_model=refmod
70
+
71
+ # stacked area
72
+ mysachart = GerbilCharts::Charts::StackedAreaChart.new( :width => 750, :height => 400,
73
+ :style => 'inline:brushmetal.css',
74
+ :javascripts => ['/tmp/gerbil.js' , '/tmp/prototype.js' ],
75
+ :toolhrefs => [ ["View Trends", "/trends"],
76
+ ["Retro analysis", "/retro"],
77
+ ] )
78
+ mysachart.modelgroup=modelgroup
79
+ mysachart.render('/tmp/n_daily_traffic_sa.svg')
80
+
81
+
82
+ end
83
+
84
+
85
+
86
+ end
87
+
88
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gerbilcharts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vivek Rajagopalan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-01 00:00:00 +05:30
12
+ date: 2011-01-14 00:00:00 +05:30
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -68,6 +68,7 @@ files:
68
68
  - lib/gerbilcharts/models/sampled_timeseries_graph_model.rb
69
69
  - lib/gerbilcharts/models/time_series_graph_model.rb
70
70
  - lib/gerbilcharts/models/simple_timeseries_model_group.rb
71
+ - lib/gerbilcharts/models/matrix_model.rb
71
72
  - lib/gerbilcharts/surfaces/area_surface.rb
72
73
  - lib/gerbilcharts/surfaces/axis.rb
73
74
  - lib/gerbilcharts/surfaces/bar_surface.rb
@@ -91,9 +92,12 @@ files:
91
92
  - lib/gerbilcharts/surfaces/surface_background.rb
92
93
  - lib/gerbilcharts/surfaces/surface.rb
93
94
  - lib/gerbilcharts/surfaces/title_panel.rb
95
+ - lib/gerbilcharts/surfaces/bubble_surface.rb
94
96
  - lib/gerbilcharts/surfaces/tracker.rb
95
97
  - lib/gerbilcharts/surfaces/vertical_axis.rb
96
98
  - lib/gerbilcharts/surfaces/square_line_surface.rb
99
+ - lib/gerbilcharts/surfaces/matrix_surface.rb
100
+ - lib/gerbilcharts/surfaces/conversation_ring.rb
97
101
  - lib/gerbilcharts/charts/area_chart.rb
98
102
  - lib/gerbilcharts/charts/bar_chart_compact.rb
99
103
  - lib/gerbilcharts/charts/bar_chart.rb
@@ -103,6 +107,9 @@ files:
103
107
  - lib/gerbilcharts/charts/stacked_area_chart.rb
104
108
  - lib/gerbilcharts/charts/pie_chart.rb
105
109
  - lib/gerbilcharts/charts/square_line_chart.rb
110
+ - lib/gerbilcharts/charts/matrix_chart.rb
111
+ - lib/gerbilcharts/charts/conversation_ring.rb
112
+ - lib/gerbilcharts/charts/bubble_chart.rb
106
113
  - lib/gerbilcharts/svgdc/svgdc.rb
107
114
  - lib/gerbilcharts/svgdc/svg_element.rb
108
115
  - lib/gerbilcharts/svgdc/filters.rb
@@ -112,6 +119,7 @@ files:
112
119
  - lib/gerbilcharts/svgdc/svg_custom_win.rb
113
120
  - lib/gerbilcharts/svgdc/svg_shape.rb
114
121
  - lib/gerbilcharts/svgdc/svg_circle.rb
122
+ - lib/gerbilcharts/svgdc/svg_ellipse.rb
115
123
  - lib/gerbilcharts/svgdc/svg_line.rb
116
124
  - lib/gerbilcharts/svgdc/svg_polygon.rb
117
125
  - lib/gerbilcharts/svgdc/svg_polyline.rb
@@ -151,10 +159,14 @@ signing_key:
151
159
  specification_version: 3
152
160
  summary: SVG based charting library for timeseries data
153
161
  test_files:
162
+ - test/test_conversation.rb
163
+ - test/test_bubble.rb
154
164
  - test/test_embed_styles.rb
155
165
  - test/test_gerbilcharts.rb
156
166
  - test/test_ranges.rb
167
+ - test/test_sa.rb
157
168
  - test/test_helper.rb
169
+ - test/test_matrix.rb
158
170
  - test/test_svgdc.rb
159
171
  - test/test_noob.rb
160
172
  - test/test_lines.rb