graphite_graph 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/graphite_graph.rb +9 -3
- data/lib/graphite_graph/version.rb +1 -1
- metadata +4 -4
data/lib/graphite_graph.rb
CHANGED
@@ -33,7 +33,9 @@ class GraphiteGraph
|
|
33
33
|
:hide_legend => nil,
|
34
34
|
:hide_grid => nil,
|
35
35
|
:ymin => nil,
|
36
|
+
:yminright => nil,
|
36
37
|
:ymax => nil,
|
38
|
+
:ymaxright => nil,
|
37
39
|
:yunit_system => nil,
|
38
40
|
:linewidth => nil,
|
39
41
|
:linemode => nil,
|
@@ -49,7 +51,8 @@ class GraphiteGraph
|
|
49
51
|
:minor_grid_line_color => nil,
|
50
52
|
:area => :none,
|
51
53
|
:logbase => nil,
|
52
|
-
:placeholders => nil
|
54
|
+
:placeholders => nil,
|
55
|
+
:area_alpha => nil}.merge(@overrides)
|
53
56
|
end
|
54
57
|
|
55
58
|
def [](key)
|
@@ -261,7 +264,6 @@ class GraphiteGraph
|
|
261
264
|
return nil if properties[:surpress]
|
262
265
|
|
263
266
|
url_parts = []
|
264
|
-
colors = []
|
265
267
|
|
266
268
|
[:title, :vtitle, :from, :width, :height, :until].each do |item|
|
267
269
|
url_parts << "#{item}=#{properties[item]}" if properties[item]
|
@@ -271,7 +273,9 @@ class GraphiteGraph
|
|
271
273
|
url_parts << "hideLegend=#{properties[:hide_legend]}" unless properties[:hide_legend].nil?
|
272
274
|
url_parts << "hideGrid=#{properties[:hide_grid]}" if properties[:hide_grid]
|
273
275
|
url_parts << "yMin=#{properties[:ymin]}" if properties[:ymin]
|
276
|
+
url_parts << "yMinRight=#{properties[:yminright]}" if properties[:yminright]
|
274
277
|
url_parts << "yMax=#{properties[:ymax]}" if properties[:ymax]
|
278
|
+
url_parts << "yMaxRight=#{properties[:ymaxright]}" if properties[:ymaxright]
|
275
279
|
url_parts << "yUnitSystem=#{properties[:yunit_system]}" if properties[:yunit_system]
|
276
280
|
url_parts << "lineWidth=#{properties[:linewidth]}" if properties[:linewidth]
|
277
281
|
url_parts << "lineMode=#{properties[:linemode]}" if properties[:linemode]
|
@@ -287,6 +291,7 @@ class GraphiteGraph
|
|
287
291
|
url_parts << "fgcolor=#{properties[:foreground_color]}" if properties[:foreground_color]
|
288
292
|
url_parts << "vtitleRight=#{properties[:vtitle_right]}" if properties[:vtitle_right]
|
289
293
|
url_parts << "logBase=#{properties[:logbase]}" if properties[:logbase]
|
294
|
+
url_parts << "areaAlpha=#{properties[:area_alpha]}" if properties[:area_alpha]
|
290
295
|
|
291
296
|
target_order.each do |name|
|
292
297
|
target = targets[name]
|
@@ -298,6 +303,7 @@ class GraphiteGraph
|
|
298
303
|
|
299
304
|
graphite_target = target[:data]
|
300
305
|
|
306
|
+
graphite_target = "lineWidth(#{graphite_target},#{target[:field_linewidth]})" if target[:field_linewidth]
|
301
307
|
graphite_target = "keepLastValue(#{graphite_target})" if target[:keep_last_value]
|
302
308
|
graphite_target = "sum(#{graphite_target})" if target[:sum]
|
303
309
|
if target[:derivative]
|
@@ -350,8 +356,8 @@ class GraphiteGraph
|
|
350
356
|
url_parts << "format=#{format}" if format
|
351
357
|
|
352
358
|
if url
|
359
|
+
properties[:placeholders].each { |k,v| url_parts.each {|part| part.gsub!("%{#{k}}", v.to_s) } } if properties[:placeholders].is_a?(Hash)
|
353
360
|
url_str = url_parts.map { |pair| k,v = pair.split('='); "#{k}=#{CGI.escape(v)}" }.join("&")
|
354
|
-
properties[:placeholders].each { |k,v| url_str.gsub!("%{#{k}}", v.to_s) } if properties[:placeholders].is_a?(Hash)
|
355
361
|
|
356
362
|
url_str
|
357
363
|
else
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphite_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- R.I.Pienaar
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date:
|
19
|
+
date: 2013-01-18 00:00:00 +00:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|