gruff 0.4.0-java → 0.5.0-java
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.
- checksums.yaml +7 -0
- data/Gemfile +1 -1
- data/History.txt +21 -0
- data/README.md +0 -6
- data/RELEASE.md +12 -63
- data/gruff.gemspec +1 -4
- data/lib/gruff/base.rb +2 -2
- data/lib/gruff/line.rb +83 -21
- data/lib/gruff/version.rb +1 -1
- data/test/gruff_test_case.rb +0 -1
- data/test/output/bezier_2.png +0 -0
- data/test/output/bezier_3.png +0 -0
- data/test/output/line_no_title.png +0 -0
- data/test/output/line_reference_lines.png +0 -0
- data/test/output/line_webp.webp +0 -0
- data/test/output/line_xy_pairs.png +0 -0
- data/test/output/net_no_title.png +0 -0
- data/test/output/scatter_no_title.png +0 -0
- data/test/output_java/bezier_2.png +0 -0
- data/test/output_java/bezier_3.png +0 -0
- data/test/output_java/line_no_title.png +0 -0
- data/test/output_java/line_reference_lines.png +0 -0
- data/test/output_java/line_webp.webp +0 -0
- data/test/output_java/line_xy_pairs.png +0 -0
- data/test/output_java/net_no_title.png +0 -0
- data/test/output_java/scatter_no_title.png +0 -0
- data/test/test_line.rb +32 -1
- metadata +14 -13
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 8c80858a818c840453510ea70bd3405710d16aec
|
|
4
|
+
data.tar.gz: d0921cd540b6a03df9b05b1bfa727a3b6186eab4
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ab34862e8bc47a0733ce92885fbe3cdbe7e9a988ad7c1b8bc40a550736a60d5e41df9555a893f8c88a9f5a905a57aa14acf443576cde77ff8ef46a7ed1c5ddff
|
|
7
|
+
data.tar.gz: 92f5d19cc9616a40935980c5c10170552ac4cd5dd3749ba56aff7c8ce07420fbb4733d16e1ddaace03e778aa343e6f86822a2cdfe04fcb37be0a53ad460bfe9c
|
data/Gemfile
CHANGED
data/History.txt
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
== 0.5.0
|
|
2
|
+
|
|
3
|
+
We have added a couple of cosmetic changes: Multiple marker lines both
|
|
4
|
+
vertically and horizontally, and multi-line titles, or no title at all if
|
|
5
|
+
you want more space for the chart.
|
|
6
|
+
|
|
7
|
+
Features:
|
|
8
|
+
|
|
9
|
+
* Issue #86 Added support for multiple references lines along both axes to
|
|
10
|
+
Line Graph
|
|
11
|
+
* Issue #89 Allow multiline and empty titles
|
|
12
|
+
|
|
13
|
+
Documentation:
|
|
14
|
+
|
|
15
|
+
* Issue #61 Remove the "BETA Software" warning in the README.
|
|
16
|
+
|
|
17
|
+
Pull requests:
|
|
18
|
+
|
|
19
|
+
* Issue #90 Added missing parenthesis in base.rb
|
|
20
|
+
|
|
21
|
+
|
|
1
22
|
== 0.4.0
|
|
2
23
|
|
|
3
24
|
All old branches and pull requests have been merged or deleted. Over 40
|
data/README.md
CHANGED
|
@@ -5,12 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
A library for making beautiful graphs.
|
|
7
7
|
|
|
8
|
-
## WARNING
|
|
9
|
-
|
|
10
|
-
This is beta-quality software. It works well according to our tests,
|
|
11
|
-
but the API may change and other features will be added.
|
|
12
|
-
We are working to make Gruff production quality software.
|
|
13
|
-
|
|
14
8
|
## Installation
|
|
15
9
|
|
|
16
10
|
Add this line to your application's Gemfile:
|
data/RELEASE.md
CHANGED
|
@@ -1,81 +1,30 @@
|
|
|
1
|
-
Subject: [ANN] Gruff 0.
|
|
1
|
+
Subject: [ANN] Gruff 0.5.0 released!
|
|
2
2
|
|
|
3
|
-
The Gruff team is pleased to announce the release of Gruff 0.
|
|
3
|
+
The Gruff team is pleased to announce the release of Gruff 0.5.0.
|
|
4
4
|
|
|
5
|
-
New in version 0.
|
|
5
|
+
New in version 0.5.0:
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
We have added a couple of cosmetic changes: Multiple marker lines both
|
|
8
|
+
vertically and horizontally, and multi-line titles, or no title at all if
|
|
9
|
+
you want more space for the chart.
|
|
10
10
|
|
|
11
11
|
Features:
|
|
12
12
|
|
|
13
|
-
* Issue #
|
|
14
|
-
|
|
15
|
-
* Issue #
|
|
16
|
-
* Issue #41 Add rotation to spider chart
|
|
17
|
-
* Issue #65 Add RMagick and RMagick4J respectively as dependencies to the
|
|
18
|
-
Gruff gem
|
|
19
|
-
* Issue #81 Ensure Ruby 2.0 compatibility
|
|
20
|
-
|
|
21
|
-
Bugfixes:
|
|
22
|
-
|
|
23
|
-
* Issue #17 Baseline drawn at incorrect position
|
|
24
|
-
* Issue #21 Division By Zero Error on Documented Example
|
|
25
|
-
* Issue #36 When writing the same chart multiple times, it should not be
|
|
26
|
-
rendered again.
|
|
27
|
-
* Issue #44 XY Datasets are inconvenient to use. (documentation and/or
|
|
28
|
-
code is wrong)
|
|
29
|
-
* Issue #46 issue with markers that are floats
|
|
30
|
-
* Issue #51 line with nil in dataset
|
|
31
|
-
* Issue #52 Wrong direction in y_axis_label
|
|
32
|
-
* Issue #54 Explicitly specify overlapping for lines (Gruff::Line)
|
|
33
|
-
* Issue #58 Clean up data sorting
|
|
34
|
-
* Issue #59 Escape '%' in labels
|
|
35
|
-
* Issue #60 Correct DOT graph drawing
|
|
36
|
-
* Issue #63 Some charts are drawn with transparent text when running with
|
|
37
|
-
JRuby/RMagick4J
|
|
38
|
-
* Issue #66 Marker line for 54.0 is missing on bar_set_marker.png example
|
|
39
|
-
* Issue #68 Y-axis label for bar_x_y_labels.png should be rotated when
|
|
40
|
-
drawn with JRuby
|
|
41
|
-
|
|
42
|
-
Support:
|
|
43
|
-
|
|
44
|
-
* Issue #4 Scaling a graph leads to fuzzy pictures
|
|
45
|
-
* Issue #8 zero-width bar entries drawn
|
|
46
|
-
* Issue #11 Feature: Data value markers
|
|
47
|
-
* Issue #18 Set encoding to uft-8
|
|
48
|
-
* Issue #24 Gruff::SideStackedBar
|
|
49
|
-
* Issue #35 Add option for line height in legend.
|
|
50
|
-
* Issue #49 font directive is not setting font in charts
|
|
51
|
-
* Issue #53 Is this project still alive?
|
|
13
|
+
* Issue #86 Added support for multiple references lines along both axes to
|
|
14
|
+
Line Graph
|
|
15
|
+
* Issue #89 Allow multiline and empty titles
|
|
52
16
|
|
|
53
17
|
Documentation:
|
|
54
18
|
|
|
55
|
-
* Issue #
|
|
19
|
+
* Issue #61 Remove the "BETA Software" warning in the README.
|
|
56
20
|
|
|
57
21
|
Pull requests:
|
|
58
22
|
|
|
59
|
-
* Issue #
|
|
60
|
-
* Issue #12 Bar updates
|
|
61
|
-
* Issue #14 Make use of the TEXT_OFFSET_PERCENTAGE const variable
|
|
62
|
-
* Issue #16 Fix exception when y_axis_increment is used in line bars
|
|
63
|
-
* Issue #26 Fix bug with additional point included on area charts
|
|
64
|
-
* Issue #27 Added marker_shadow_color to allow to draw shadows below
|
|
65
|
-
marker lines
|
|
66
|
-
* Issue #37 Update lib/gruff/base.rb: set legend under the graph
|
|
67
|
-
* Issue #42 Update lib/gruff/base.rb: set legend under the graph
|
|
68
|
-
* Issue #43 Fixed issue #25
|
|
69
|
-
* Issue #48 add license information to the gemspec
|
|
70
|
-
* Issue #56 Fixed gem file generation problem
|
|
71
|
-
|
|
72
|
-
Internal:
|
|
73
|
-
|
|
74
|
-
* Issue #80 Remove the .rmvrc file from the project
|
|
23
|
+
* Issue #90 Added missing parenthesis in base.rb
|
|
75
24
|
|
|
76
25
|
You can find a complete list of issues here:
|
|
77
26
|
|
|
78
|
-
* https://github.com/topfunky/gruff/issues?state=closed&milestone=
|
|
27
|
+
* https://github.com/topfunky/gruff/issues?state=closed&milestone=4
|
|
79
28
|
|
|
80
29
|
|
|
81
30
|
Installation:
|
data/gruff.gemspec
CHANGED
|
@@ -7,7 +7,6 @@ require 'gruff/version'
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = %q{gruff}
|
|
9
9
|
s.version = Gruff::VERSION
|
|
10
|
-
# s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
10
|
s.authors = ['Geoffrey Grosenbach', 'Uwe Kubosch']
|
|
12
11
|
s.date = Date.today.to_s
|
|
13
12
|
s.description = %q{Beautiful graphs for one or multiple datasets. Can be used on websites or in documents.}
|
|
@@ -15,13 +14,11 @@ Gem::Specification.new do |s|
|
|
|
15
14
|
# s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
|
|
16
15
|
s.files = `git ls-files`.split($/)
|
|
17
16
|
# s.has_rdoc = true
|
|
18
|
-
s.homepage = %q{
|
|
17
|
+
s.homepage = %q{https://github.com/topfunky/gruff}
|
|
19
18
|
# s.rdoc_options = ["--main", "README.txt"]
|
|
20
19
|
s.require_paths = %w(lib)
|
|
21
20
|
# s.rubyforge_project = %q{gruff}
|
|
22
|
-
# s.rubygems_version = %q{1.3.1}
|
|
23
21
|
s.summary = %q{Beautiful graphs for one or multiple datasets.}
|
|
24
|
-
# s.test_files = ["test/test_accumulator_bar.rb", "test/test_area.rb", "test/test_bar.rb", "test/test_base.rb", "test/test_bullet.rb", "test/test_dot.rb", "test/test_legend.rb", "test/test_line.rb", "test/test_mini_bar.rb", "test/test_mini_pie.rb", "test/test_mini_side_bar.rb", "test/test_net.rb", "test/test_photo.rb", "test/test_pie.rb", "test/test_scene.rb", "test/test_side_bar.rb", "test/test_sidestacked_bar.rb", "test/test_spider.rb", "test/test_stacked_area.rb", "test/test_stacked_bar.rb"]
|
|
25
22
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
|
26
23
|
s.executables = s.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
|
27
24
|
s.specification_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
data/lib/gruff/base.rb
CHANGED
|
@@ -521,8 +521,8 @@ module Gruff
|
|
|
521
521
|
def setup_graph_measurements
|
|
522
522
|
@marker_caps_height = @hide_line_markers ? 0 :
|
|
523
523
|
calculate_caps_height(@marker_font_size)
|
|
524
|
-
@title_caps_height = @hide_title ? 0 :
|
|
525
|
-
calculate_caps_height(@title_font_size)
|
|
524
|
+
@title_caps_height = (@hide_title || @title.nil?) ? 0 :
|
|
525
|
+
calculate_caps_height(@title_font_size) * @title.lines.to_a.size
|
|
526
526
|
@legend_caps_height = @hide_legend ? 0 :
|
|
527
527
|
calculate_caps_height(@legend_font_size)
|
|
528
528
|
|
data/lib/gruff/line.rb
CHANGED
|
@@ -13,11 +13,10 @@ require File.dirname(__FILE__) + '/base'
|
|
|
13
13
|
|
|
14
14
|
class Gruff::Line < Gruff::Base
|
|
15
15
|
|
|
16
|
-
#
|
|
17
|
-
attr_accessor :
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
attr_accessor :baseline_color
|
|
16
|
+
# Allow for reference lines ( which are like baseline ... just allowing for more & on both axes )
|
|
17
|
+
attr_accessor :reference_lines
|
|
18
|
+
attr_accessor :reference_line_default_color
|
|
19
|
+
attr_accessor :reference_line_default_width
|
|
21
20
|
|
|
22
21
|
# Dimensions of lines and dots; calculated based on dataset size if left unspecified
|
|
23
22
|
attr_accessor :line_width
|
|
@@ -30,6 +29,34 @@ class Gruff::Line < Gruff::Base
|
|
|
30
29
|
attr_accessor :minimum_x_value
|
|
31
30
|
attr_accessor :maximum_x_value
|
|
32
31
|
|
|
32
|
+
# Get the value if somebody has defined it.
|
|
33
|
+
def baseline_value
|
|
34
|
+
if (@reference_lines.key?(:baseline))
|
|
35
|
+
@reference_lines[:baseline][:value]
|
|
36
|
+
else
|
|
37
|
+
nil
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Set a value for a baseline reference line..
|
|
42
|
+
def baseline_value=(new_value)
|
|
43
|
+
@reference_lines[:baseline] ||= Hash.new
|
|
44
|
+
@reference_lines[:baseline][:value] = new_value
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def baseline_color
|
|
48
|
+
if (@reference_lines.key?(:baseline))
|
|
49
|
+
@reference_lines[:baseline][:color]
|
|
50
|
+
else
|
|
51
|
+
nil
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def baseline_color=(new_value)
|
|
56
|
+
@reference_lines[:baseline] ||= Hash.new
|
|
57
|
+
@reference_lines[:baseline][:color] = new_value
|
|
58
|
+
end
|
|
59
|
+
|
|
33
60
|
# Call with target pixel width of graph (800, 400, 300), and/or 'false' to omit lines (points only).
|
|
34
61
|
#
|
|
35
62
|
# g = Gruff::Line.new(400) # 400px wide with lines
|
|
@@ -47,9 +74,11 @@ class Gruff::Line < Gruff::Base
|
|
|
47
74
|
super args.shift
|
|
48
75
|
end
|
|
49
76
|
|
|
77
|
+
@reference_lines = Hash.new
|
|
78
|
+
@reference_line_default_color = 'red'
|
|
79
|
+
@reference_line_default_width = 5
|
|
80
|
+
|
|
50
81
|
@hide_dots = @hide_lines = false
|
|
51
|
-
@baseline_color = 'red'
|
|
52
|
-
@baseline_value = nil
|
|
53
82
|
@maximum_x_value = nil
|
|
54
83
|
@minimum_x_value = nil
|
|
55
84
|
end
|
|
@@ -81,7 +110,7 @@ class Gruff::Line < Gruff::Base
|
|
|
81
110
|
# g.title = "X/Y Dataset"
|
|
82
111
|
# g.dataxy("Apples", [1,3,4,5,6,10], [1, 2, 3, 4, 4, 3])
|
|
83
112
|
# g.dataxy("Bapples", [1,3,4,5,7,9], [1, 1, 2, 2, 3, 3])
|
|
84
|
-
# g.dataxy("Capples", [[1,1],[2,3],[3,4],[4,5],[5,7],[6,9])
|
|
113
|
+
# g.dataxy("Capples", [[1,1],[2,3],[3,4],[4,5],[5,7],[6,9]])
|
|
85
114
|
# #you can still use the old data method too if you want:
|
|
86
115
|
# g.data("Capples", [1, 1, 2, 2, 3, 3])
|
|
87
116
|
# #labels will be drawn at the x locations of the keys passed in.
|
|
@@ -121,6 +150,26 @@ class Gruff::Line < Gruff::Base
|
|
|
121
150
|
|
|
122
151
|
end
|
|
123
152
|
|
|
153
|
+
def draw_reference_line(reference_line, left, right, top, bottom)
|
|
154
|
+
@d = @d.push
|
|
155
|
+
@d.stroke_color(reference_line[:color] || @reference_line_default_color)
|
|
156
|
+
@d.fill_opacity 0.0
|
|
157
|
+
@d.stroke_dasharray(10, 20)
|
|
158
|
+
@d.stroke_width(reference_line[:width] || @reference_line_default_width)
|
|
159
|
+
@d.line(left, top, right, bottom)
|
|
160
|
+
@d = @d.pop
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def draw_horizontal_reference_line(reference_line)
|
|
164
|
+
level = @graph_top + (@graph_height - reference_line[:norm_value] * @graph_height)
|
|
165
|
+
draw_reference_line(reference_line, @graph_left, @graph_left + @graph_width, level, level)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def draw_vertical_reference_line(reference_line)
|
|
169
|
+
index = @graph_left + (@x_increment * reference_line[:index])
|
|
170
|
+
draw_reference_line(reference_line, index, index, @graph_top, @graph_top + graph_height)
|
|
171
|
+
end
|
|
172
|
+
|
|
124
173
|
def draw
|
|
125
174
|
super
|
|
126
175
|
|
|
@@ -129,15 +178,9 @@ class Gruff::Line < Gruff::Base
|
|
|
129
178
|
# Check to see if more than one datapoint was given. NaN can result otherwise.
|
|
130
179
|
@x_increment = (@column_count > 1) ? (@graph_width / (@column_count - 1).to_f) : @graph_width
|
|
131
180
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
@d.stroke_color @baseline_color
|
|
136
|
-
@d.fill_opacity 0.0
|
|
137
|
-
@d.stroke_dasharray(10, 20)
|
|
138
|
-
@d.stroke_width 5
|
|
139
|
-
@d.line(@graph_left, level, @graph_left + @graph_width, level)
|
|
140
|
-
@d = @d.pop
|
|
181
|
+
@reference_lines.each_value do |curr_reference_line|
|
|
182
|
+
draw_horizontal_reference_line(curr_reference_line) if curr_reference_line.key?(:norm_value)
|
|
183
|
+
draw_vertical_reference_line(curr_reference_line) if curr_reference_line.key?(:index)
|
|
141
184
|
end
|
|
142
185
|
|
|
143
186
|
@norm_data.each do |data_row|
|
|
@@ -190,16 +233,35 @@ class Gruff::Line < Gruff::Base
|
|
|
190
233
|
end
|
|
191
234
|
|
|
192
235
|
def setup_data
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
236
|
+
|
|
237
|
+
# Deal with horizontal reference line values that exceed the existing minimum & maximum values.
|
|
238
|
+
possible_maximums = [@maximum_value.to_f]
|
|
239
|
+
possible_minimums = [@minimum_value.to_f]
|
|
240
|
+
|
|
241
|
+
@reference_lines.each_value do |curr_reference_line|
|
|
242
|
+
if (curr_reference_line.key?(:value))
|
|
243
|
+
possible_maximums << curr_reference_line[:value].to_f
|
|
244
|
+
possible_minimums << curr_reference_line[:value].to_f
|
|
245
|
+
end
|
|
196
246
|
end
|
|
247
|
+
|
|
248
|
+
@maximum_value = possible_maximums.max
|
|
249
|
+
@minimum_value = possible_minimums.min
|
|
250
|
+
|
|
197
251
|
super
|
|
198
252
|
end
|
|
199
253
|
|
|
200
254
|
def normalize(force=false)
|
|
201
255
|
super(force)
|
|
202
|
-
|
|
256
|
+
|
|
257
|
+
@reference_lines.each_value do |curr_reference_line|
|
|
258
|
+
|
|
259
|
+
# We only care about horizontal markers ... for normalization.
|
|
260
|
+
# Vertical markers won't have a :value, they will have an :index
|
|
261
|
+
|
|
262
|
+
curr_reference_line[:norm_value] = ((curr_reference_line[:value].to_f - @minimum_value) / @spread.to_f) if (curr_reference_line.key?(:value))
|
|
263
|
+
|
|
264
|
+
end
|
|
203
265
|
|
|
204
266
|
#normalize the x data if it is specified
|
|
205
267
|
@data.each_with_index do |data_row, index|
|
data/lib/gruff/version.rb
CHANGED
data/test/gruff_test_case.rb
CHANGED
data/test/output/bezier_2.png
CHANGED
|
Binary file
|
data/test/output/bezier_3.png
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/test/test_line.rb
CHANGED
|
@@ -484,7 +484,7 @@ class TestGruffLine < GruffTestCase
|
|
|
484
484
|
g.dataxy('Apples', [[1, 1], [3, 2], [4, 3], [5, 4], [6, 4], [10, 3]])
|
|
485
485
|
g.dataxy('Bapples', [[1, 1], [3, 1], [4, 2], [5, 2], [7, 3], [9, 3]])
|
|
486
486
|
g.data('Capples', [1, 1, 2, 2, 3, 3])
|
|
487
|
-
g.dataxy('Dapples', [[1, 1], [2,
|
|
487
|
+
g.dataxy('Dapples', [[1, 1], [2, 2], [5, 6], [13, 13], [15, nil], [2, 17], [3, nil], [3, 17], [13, nil], [3, 18], [5, nil], [2, 18]])
|
|
488
488
|
g.dataxy('Eapples', [[1, 1], [2, 3], [5, 8], [13, 21], [13, 8], [5, 3], [2, 1], [1, 1]])
|
|
489
489
|
g.labels = {0 => '2003', 2 => '2004', 4 => '2005', 6 => '2006', 8 => '2007', 10 => '2008', 12 => '2009'}
|
|
490
490
|
g.write('test/output/line_xy_pairs.png')
|
|
@@ -534,6 +534,29 @@ class TestGruffLine < GruffTestCase
|
|
|
534
534
|
g.write('test/output/line_y_axis_increment.png')
|
|
535
535
|
end
|
|
536
536
|
|
|
537
|
+
def test_multiple_reference_lines
|
|
538
|
+
|
|
539
|
+
g = Gruff::Line.new
|
|
540
|
+
g.title = 'Line Chart with Multiple Reference Lines'
|
|
541
|
+
|
|
542
|
+
g.data('Apples', [3, 2, 3, 4, 4, 3])
|
|
543
|
+
g.data('Oranges', [4, 8, 7, 9, 8, 9])
|
|
544
|
+
g.data('Watermelon', [2, 3, 4, 5, 6, 8])
|
|
545
|
+
g.data('Peaches', [9, 9, 10, 8, 7, 9])
|
|
546
|
+
|
|
547
|
+
g.labels = {0 => '2003', 2 => '2004', 4 => '2005'}
|
|
548
|
+
|
|
549
|
+
g.reference_line_default_width = 1
|
|
550
|
+
|
|
551
|
+
g.reference_lines[:baseline] = { :value => 5 }
|
|
552
|
+
g.reference_lines[:lots] = { :value => 9 }
|
|
553
|
+
g.reference_lines[:little] = { :value => 3 }
|
|
554
|
+
g.reference_lines[:horiz_one] = { :index => 1, :color => 'green' }
|
|
555
|
+
g.reference_lines[:horiz_two] = { :index => 3, :color => 'green' }
|
|
556
|
+
|
|
557
|
+
g.write('line_reference_lines.png')
|
|
558
|
+
end
|
|
559
|
+
|
|
537
560
|
def test_baseline
|
|
538
561
|
g = Gruff::Line.new
|
|
539
562
|
g.title = 'Line Chart with Baseline = 5'
|
|
@@ -549,6 +572,14 @@ class TestGruffLine < GruffTestCase
|
|
|
549
572
|
g.write('line_baseline.png')
|
|
550
573
|
end
|
|
551
574
|
|
|
575
|
+
def test_webp
|
|
576
|
+
g = setup_basic_graph('800x400')
|
|
577
|
+
g.title = 'Line Chart WEBP'
|
|
578
|
+
g.write('line_webp.webp')
|
|
579
|
+
rescue Magick::ImageMagickError
|
|
580
|
+
assert_match /no encode delegate for this image format .*\.webp/, $!.message
|
|
581
|
+
end
|
|
582
|
+
|
|
552
583
|
private
|
|
553
584
|
|
|
554
585
|
# TODO Reset data after each theme
|
metadata
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gruff
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 0.5.0
|
|
6
5
|
platform: java
|
|
7
6
|
authors:
|
|
8
7
|
- Geoffrey Grosenbach
|
|
@@ -10,7 +9,7 @@ authors:
|
|
|
10
9
|
autorequire:
|
|
11
10
|
bindir: bin
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date: 2013-
|
|
12
|
+
date: 2013-10-22 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: rmagick4j
|
|
@@ -19,13 +18,11 @@ dependencies:
|
|
|
19
18
|
- - '>='
|
|
20
19
|
- !ruby/object:Gem::Version
|
|
21
20
|
version: '0'
|
|
22
|
-
none: false
|
|
23
21
|
requirement: !ruby/object:Gem::Requirement
|
|
24
22
|
requirements:
|
|
25
23
|
- - '>='
|
|
26
24
|
- !ruby/object:Gem::Version
|
|
27
25
|
version: '0'
|
|
28
|
-
none: false
|
|
29
26
|
prerelease: false
|
|
30
27
|
type: :runtime
|
|
31
28
|
- !ruby/object:Gem::Dependency
|
|
@@ -35,13 +32,11 @@ dependencies:
|
|
|
35
32
|
- - '>='
|
|
36
33
|
- !ruby/object:Gem::Version
|
|
37
34
|
version: '0'
|
|
38
|
-
none: false
|
|
39
35
|
requirement: !ruby/object:Gem::Requirement
|
|
40
36
|
requirements:
|
|
41
37
|
- - '>='
|
|
42
38
|
- !ruby/object:Gem::Version
|
|
43
39
|
version: '0'
|
|
44
|
-
none: false
|
|
45
40
|
prerelease: false
|
|
46
41
|
type: :development
|
|
47
42
|
description: Beautiful graphs for one or multiple datasets. Can be used on websites or in documents.
|
|
@@ -246,6 +241,7 @@ files:
|
|
|
246
241
|
- test/output/line_one_value_array.png
|
|
247
242
|
- test/output/line_pos_neg.png
|
|
248
243
|
- test/output/line_pos_neg_400.png
|
|
244
|
+
- test/output/line_reference_lines.png
|
|
249
245
|
- test/output/line_similar_high_end_values.png
|
|
250
246
|
- test/output/line_similar_high_end_values_with_floor.png
|
|
251
247
|
- test/output/line_small_small_zero.png
|
|
@@ -264,6 +260,7 @@ files:
|
|
|
264
260
|
- test/output/line_tiny.png
|
|
265
261
|
- test/output/line_transparent.png
|
|
266
262
|
- test/output/line_very_small.png
|
|
263
|
+
- test/output/line_webp.webp
|
|
267
264
|
- test/output/line_wide_graph.png
|
|
268
265
|
- test/output/line_wide_graph_small.png
|
|
269
266
|
- test/output/line_xy.png
|
|
@@ -491,6 +488,7 @@ files:
|
|
|
491
488
|
- test/output_java/line_one_value_array.png
|
|
492
489
|
- test/output_java/line_pos_neg.png
|
|
493
490
|
- test/output_java/line_pos_neg_400.png
|
|
491
|
+
- test/output_java/line_reference_lines.png
|
|
494
492
|
- test/output_java/line_similar_high_end_values.png
|
|
495
493
|
- test/output_java/line_similar_high_end_values_with_floor.png
|
|
496
494
|
- test/output_java/line_small_small_zero.png
|
|
@@ -509,6 +507,7 @@ files:
|
|
|
509
507
|
- test/output_java/line_tiny.png
|
|
510
508
|
- test/output_java/line_transparent.png
|
|
511
509
|
- test/output_java/line_very_small.png
|
|
510
|
+
- test/output_java/line_webp.webp
|
|
512
511
|
- test/output_java/line_wide_graph.png
|
|
513
512
|
- test/output_java/line_wide_graph_small.png
|
|
514
513
|
- test/output_java/line_xy.png
|
|
@@ -633,9 +632,10 @@ files:
|
|
|
633
632
|
- test/test_spider.rb
|
|
634
633
|
- test/test_stacked_area.rb
|
|
635
634
|
- test/test_stacked_bar.rb
|
|
636
|
-
homepage:
|
|
635
|
+
homepage: https://github.com/topfunky/gruff
|
|
637
636
|
licenses:
|
|
638
637
|
- MIT
|
|
638
|
+
metadata: {}
|
|
639
639
|
post_install_message:
|
|
640
640
|
rdoc_options: []
|
|
641
641
|
require_paths:
|
|
@@ -645,18 +645,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
645
645
|
- - '>='
|
|
646
646
|
- !ruby/object:Gem::Version
|
|
647
647
|
version: '0'
|
|
648
|
-
none: false
|
|
649
648
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
650
649
|
requirements:
|
|
651
650
|
- - '>='
|
|
652
651
|
- !ruby/object:Gem::Version
|
|
653
652
|
version: '0'
|
|
654
|
-
none: false
|
|
655
653
|
requirements: []
|
|
656
654
|
rubyforge_project:
|
|
657
|
-
rubygems_version: 1.
|
|
655
|
+
rubygems_version: 2.1.5
|
|
658
656
|
signing_key:
|
|
659
|
-
specification_version:
|
|
657
|
+
specification_version: 4
|
|
660
658
|
summary: Beautiful graphs for one or multiple datasets.
|
|
661
659
|
test_files:
|
|
662
660
|
- test/gruff_test_case.rb
|
|
@@ -786,6 +784,7 @@ test_files:
|
|
|
786
784
|
- test/output/line_one_value_array.png
|
|
787
785
|
- test/output/line_pos_neg.png
|
|
788
786
|
- test/output/line_pos_neg_400.png
|
|
787
|
+
- test/output/line_reference_lines.png
|
|
789
788
|
- test/output/line_similar_high_end_values.png
|
|
790
789
|
- test/output/line_similar_high_end_values_with_floor.png
|
|
791
790
|
- test/output/line_small_small_zero.png
|
|
@@ -804,6 +803,7 @@ test_files:
|
|
|
804
803
|
- test/output/line_tiny.png
|
|
805
804
|
- test/output/line_transparent.png
|
|
806
805
|
- test/output/line_very_small.png
|
|
806
|
+
- test/output/line_webp.webp
|
|
807
807
|
- test/output/line_wide_graph.png
|
|
808
808
|
- test/output/line_wide_graph_small.png
|
|
809
809
|
- test/output/line_xy.png
|
|
@@ -1031,6 +1031,7 @@ test_files:
|
|
|
1031
1031
|
- test/output_java/line_one_value_array.png
|
|
1032
1032
|
- test/output_java/line_pos_neg.png
|
|
1033
1033
|
- test/output_java/line_pos_neg_400.png
|
|
1034
|
+
- test/output_java/line_reference_lines.png
|
|
1034
1035
|
- test/output_java/line_similar_high_end_values.png
|
|
1035
1036
|
- test/output_java/line_similar_high_end_values_with_floor.png
|
|
1036
1037
|
- test/output_java/line_small_small_zero.png
|
|
@@ -1049,6 +1050,7 @@ test_files:
|
|
|
1049
1050
|
- test/output_java/line_tiny.png
|
|
1050
1051
|
- test/output_java/line_transparent.png
|
|
1051
1052
|
- test/output_java/line_very_small.png
|
|
1053
|
+
- test/output_java/line_webp.webp
|
|
1052
1054
|
- test/output_java/line_wide_graph.png
|
|
1053
1055
|
- test/output_java/line_wide_graph_small.png
|
|
1054
1056
|
- test/output_java/line_xy.png
|
|
@@ -1173,4 +1175,3 @@ test_files:
|
|
|
1173
1175
|
- test/test_spider.rb
|
|
1174
1176
|
- test/test_stacked_area.rb
|
|
1175
1177
|
- test/test_stacked_bar.rb
|
|
1176
|
-
has_rdoc:
|