subtle-graph 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/subtle/dominikh/graph/chart.rb +4 -4
- metadata +30 -15
- data/test/setup.rb +0 -2
@@ -5,7 +5,7 @@ module Dominikh
|
|
5
5
|
attr_reader :values
|
6
6
|
|
7
7
|
# @param [Fixnum] width The width of the chart. This corresponds
|
8
|
-
# with the number of values.
|
8
|
+
# with the number of values-1.
|
9
9
|
# @param [Fixnum] height The height of the chart.
|
10
10
|
# @param [Boolean] autoscale If false, values are expected to be
|
11
11
|
# percentage values. If true, values will be dynamically scaled
|
@@ -30,7 +30,7 @@ module Dominikh
|
|
30
30
|
# @param [Array<Numeric>] arr An array of numbers
|
31
31
|
# @return [Array] The array of values, possibly truncated
|
32
32
|
def values=(arr)
|
33
|
-
@values = arr[0..@icon.width]
|
33
|
+
@values = arr[0..@icon.width-1]
|
34
34
|
max = @values.max
|
35
35
|
@biggest_value = max if max > @biggest_value
|
36
36
|
render
|
@@ -62,7 +62,7 @@ module Dominikh
|
|
62
62
|
end
|
63
63
|
|
64
64
|
@values.each_with_index do |value, index|
|
65
|
-
x = width - index
|
65
|
+
x = width - 1 - index
|
66
66
|
if !@autoscale
|
67
67
|
y = ((height / 100.0) * value).round
|
68
68
|
else
|
@@ -70,7 +70,7 @@ module Dominikh
|
|
70
70
|
end
|
71
71
|
|
72
72
|
# draw the bar
|
73
|
-
height.downto(height - y) do |one_y|
|
73
|
+
height.downto(height - 1 - y) do |one_y|
|
74
74
|
draw(x, one_y)
|
75
75
|
end
|
76
76
|
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subtle-graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Dominik Honnef
|
@@ -9,10 +14,21 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-16 00:00:00 +02:00
|
13
18
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: subtle-dynamic_icon
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
16
32
|
description:
|
17
33
|
email: dominikho@gmx.net
|
18
34
|
executables: []
|
@@ -22,21 +38,16 @@ extensions: []
|
|
22
38
|
extra_rdoc_files: []
|
23
39
|
|
24
40
|
files:
|
25
|
-
- lib/subtle
|
26
|
-
- lib/subtle/dominikh
|
27
41
|
- lib/subtle/dominikh/graph.rb
|
28
|
-
- lib/subtle/dominikh/graph
|
29
42
|
- lib/subtle/dominikh/graph/bar.rb
|
30
43
|
- lib/subtle/dominikh/graph/chart.rb
|
31
44
|
- lib/subtle/dominikh/graph/colored_graph.rb
|
32
|
-
- test/suite
|
33
|
-
- test/suite/lib
|
34
|
-
- test/fixtures
|
35
|
-
- test/setup.rb
|
36
45
|
- README
|
37
46
|
- LICENSE
|
38
47
|
has_rdoc: yard
|
39
48
|
homepage: ""
|
49
|
+
licenses: []
|
50
|
+
|
40
51
|
post_install_message:
|
41
52
|
rdoc_options: []
|
42
53
|
|
@@ -46,20 +57,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
57
|
requirements:
|
47
58
|
- - ">="
|
48
59
|
- !ruby/object:Gem::Version
|
60
|
+
segments:
|
61
|
+
- 1
|
62
|
+
- 9
|
63
|
+
- 1
|
49
64
|
version: 1.9.1
|
50
|
-
version:
|
51
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
66
|
requirements:
|
53
67
|
- - ">="
|
54
68
|
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 0
|
55
71
|
version: "0"
|
56
|
-
version:
|
57
72
|
requirements: []
|
58
73
|
|
59
74
|
rubyforge_project:
|
60
|
-
rubygems_version: 1.3.
|
75
|
+
rubygems_version: 1.3.6
|
61
76
|
signing_key:
|
62
|
-
specification_version:
|
77
|
+
specification_version: 3
|
63
78
|
summary: Dynamic icons which represent different kinds of graphs.
|
64
79
|
test_files: []
|
65
80
|
|
data/test/setup.rb
DELETED