gruff 0.24.0-java → 0.25.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +5 -5
- data/.rubocop.yml +7 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +12 -0
- data/gruff.gemspec +5 -11
- data/lib/gruff/line.rb +2 -2
- data/lib/gruff/renderer/dot.rb +4 -2
- data/lib/gruff/renderer/rectangle.rb +1 -1
- data/lib/gruff/renderer/renderer.rb +13 -13
- data/lib/gruff/store/store.rb +4 -4
- data/lib/gruff/version.rb +1 -1
- metadata +12 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25e07b14aea532cd3028f414074893612a930266e45f8f9d92e89d5c8e385f8f
|
4
|
+
data.tar.gz: 82b241d691cd579fd654fef22d1571dbcb64168cc6b0243ff99048af7babdcf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f498d0d6c7703ae51b85335c77ce8f17f9e4e4cccfe86b7bab167612fd7c59a5c1fa3f06c24d366f93ca39a9d6393f12ec7aa430b5e249eadd6e0c4ce0b7f588
|
7
|
+
data.tar.gz: 23ee70685ba4c293104bd4f3c1a6a6e960e1fc6fa9200476d69dcc27f253c71b7d20d4acd859bfe8a5fb93db1aeb940eab006470bed3b955d184bdb47e1db53b
|
data/.github/workflows/ci.yml
CHANGED
@@ -18,10 +18,10 @@ jobs:
|
|
18
18
|
- uses: actions/checkout@v4
|
19
19
|
with:
|
20
20
|
ref: ${{ github.event.pull_request.head.sha }}
|
21
|
-
- name: Set up Ruby
|
21
|
+
- name: Set up Ruby 3.0
|
22
22
|
uses: ruby/setup-ruby@master
|
23
23
|
with:
|
24
|
-
ruby-version: '
|
24
|
+
ruby-version: '3.0'
|
25
25
|
bundler-cache: true
|
26
26
|
- name: Install dependencies
|
27
27
|
run: bundle install --path=vendor/bundle --jobs 4 --retry 3
|
@@ -35,9 +35,9 @@ jobs:
|
|
35
35
|
timeout-minutes: 20
|
36
36
|
strategy:
|
37
37
|
matrix:
|
38
|
-
ruby-version: ['
|
38
|
+
ruby-version: ['3.0', '3.1', '3.2', '3.3']
|
39
39
|
imagemagick-version:
|
40
|
-
- { full: 7.1.1-
|
40
|
+
- { full: 7.1.1-29, major-minor: '7.1' }
|
41
41
|
name: Ruby ${{ matrix.ruby-version }}
|
42
42
|
steps:
|
43
43
|
- uses: actions/checkout@v4
|
@@ -67,7 +67,7 @@ jobs:
|
|
67
67
|
timeout-minutes: 20
|
68
68
|
strategy:
|
69
69
|
matrix:
|
70
|
-
ruby-version: ['9.
|
70
|
+
ruby-version: ['9.4.6.0']
|
71
71
|
name: JRuby ${{ matrix.ruby-version }}
|
72
72
|
steps:
|
73
73
|
- uses: actions/checkout@v4
|
data/.rubocop.yml
CHANGED
@@ -5,7 +5,7 @@ require:
|
|
5
5
|
|
6
6
|
AllCops:
|
7
7
|
EnabledByDefault: true
|
8
|
-
TargetRubyVersion:
|
8
|
+
TargetRubyVersion: 3.0
|
9
9
|
Exclude:
|
10
10
|
- 'vendor/bundle/**/*'
|
11
11
|
- 'rails_generators/gruff/**/*'
|
@@ -13,13 +13,13 @@ AllCops:
|
|
13
13
|
Metrics:
|
14
14
|
Enabled: false
|
15
15
|
|
16
|
-
|
16
|
+
Bundler/GemComment:
|
17
17
|
Enabled: false
|
18
18
|
|
19
|
-
|
19
|
+
Bundler/GemVersion:
|
20
20
|
Enabled: false
|
21
21
|
|
22
|
-
Gemspec/
|
22
|
+
Gemspec/DependencyVersion:
|
23
23
|
Enabled: false
|
24
24
|
|
25
25
|
Gemspec/RequiredRubyVersion:
|
@@ -67,6 +67,9 @@ Naming/VariableNumber:
|
|
67
67
|
Style/AccessorGrouping:
|
68
68
|
Enabled: false
|
69
69
|
|
70
|
+
Style/ArrayFirstLast:
|
71
|
+
Enabled: false
|
72
|
+
|
70
73
|
Style/ClassAndModuleChildren:
|
71
74
|
Enabled: false
|
72
75
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.25.0
|
4
|
+
- Add bigdecimal gem as dependency for Ruby 3.4
|
5
|
+
- Update dependent RMagick version to 5.5.0 or later
|
6
|
+
- Drop Ruby 2.6 and 2.7 support (#632)
|
7
|
+
|
3
8
|
## 0.24.0
|
4
9
|
- Add the way to make background transparent (#631)
|
5
10
|
- Adjust line number position on side graph (#624)
|
data/Gemfile
CHANGED
@@ -4,3 +4,15 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in gruff.gemspec
|
6
6
|
gemspec
|
7
|
+
|
8
|
+
unless defined? JRUBY_VERSION
|
9
|
+
gem 'rubocop', '~> 1.63.4'
|
10
|
+
gem 'rubocop-minitest', '~> 0.35.0'
|
11
|
+
gem 'rubocop-performance', '~> 1.21'
|
12
|
+
gem 'rubocop-rake', '~> 0.6.0'
|
13
|
+
end
|
14
|
+
|
15
|
+
gem 'minitest-reporters'
|
16
|
+
gem 'rake'
|
17
|
+
gem 'simplecov'
|
18
|
+
gem 'yard', '~> 0.9.28'
|
data/gruff.gemspec
CHANGED
@@ -22,19 +22,13 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.platform = 'java'
|
23
23
|
s.add_dependency 'rmagick4j'
|
24
24
|
else
|
25
|
-
s.add_dependency 'rmagick', '>= 5.
|
26
|
-
s.add_development_dependency 'rubocop', '~> 1.50.2'
|
27
|
-
s.add_development_dependency 'rubocop-minitest', '~> 0.30.0'
|
28
|
-
s.add_development_dependency 'rubocop-performance', '~> 1.17.1'
|
29
|
-
s.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
25
|
+
s.add_dependency 'rmagick', '>= 5.5'
|
30
26
|
end
|
27
|
+
s.add_dependency 'bigdecimal', '>= 3.0'
|
31
28
|
s.add_dependency 'histogram'
|
32
|
-
s.required_ruby_version = '>=
|
33
|
-
|
34
|
-
s.add_development_dependency 'rake'
|
35
|
-
s.add_development_dependency 'minitest-reporters'
|
36
|
-
s.add_development_dependency 'simplecov'
|
37
|
-
s.add_development_dependency 'yard', '~> 0.9.28'
|
29
|
+
s.required_ruby_version = '>= 3.0.0'
|
38
30
|
|
31
|
+
s.metadata['bug_tracker_uri'] = 'https://github.com/topfunky/gruff/issues'
|
32
|
+
s.metadata['changelog_uri'] = 'https://github.com/topfunky/gruff/blob/master/CHANGELOG.md'
|
39
33
|
s.metadata['rubygems_mfa_required'] = 'true'
|
40
34
|
end
|
data/lib/gruff/line.rb
CHANGED
@@ -53,7 +53,7 @@ class Gruff::Line < Gruff::Base
|
|
53
53
|
if args.empty? || (!args.first.is_a?(Numeric) && !args.first.is_a?(String))
|
54
54
|
super()
|
55
55
|
else
|
56
|
-
super
|
56
|
+
super(args.shift)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
@@ -308,7 +308,7 @@ private
|
|
308
308
|
if x_data.nil?
|
309
309
|
draw_label(new_x, index)
|
310
310
|
else
|
311
|
-
@labels.
|
311
|
+
@labels.each_key do |label_pos|
|
312
312
|
draw_label(@graph_left + (((label_pos - @minimum_x_value) * @graph_width) / (@maximum_x_value - @minimum_x_value)), label_pos)
|
313
313
|
end
|
314
314
|
end
|
data/lib/gruff/renderer/dot.rb
CHANGED
@@ -5,7 +5,7 @@ module Gruff
|
|
5
5
|
class Renderer::Dot
|
6
6
|
def initialize(renderer, style, color:, width: 1.0, opacity: 1.0)
|
7
7
|
@renderer = renderer
|
8
|
-
@style = style
|
8
|
+
@style = style.to_sym
|
9
9
|
@color = color
|
10
10
|
@width = width
|
11
11
|
@opacity = opacity
|
@@ -17,7 +17,7 @@ module Gruff
|
|
17
17
|
@renderer.draw.stroke(@color)
|
18
18
|
@renderer.draw.fill_opacity(@opacity)
|
19
19
|
@renderer.draw.fill(@color)
|
20
|
-
case @style
|
20
|
+
case @style
|
21
21
|
when :square
|
22
22
|
square(new_x, new_y, radius)
|
23
23
|
when :diamond
|
@@ -28,6 +28,8 @@ module Gruff
|
|
28
28
|
@renderer.draw.pop
|
29
29
|
end
|
30
30
|
|
31
|
+
private
|
32
|
+
|
31
33
|
def circle(new_x, new_y, radius)
|
32
34
|
@renderer.draw.circle(new_x, new_y, new_x - radius, new_y)
|
33
35
|
end
|
@@ -13,7 +13,7 @@ module Gruff
|
|
13
13
|
def render(upper_left_x, upper_left_y, lower_right_x, lower_right_y)
|
14
14
|
@renderer.draw.push
|
15
15
|
@renderer.draw.stroke_width(@width)
|
16
|
-
@renderer.draw.stroke(@color) if @width > 1.0
|
16
|
+
@renderer.draw.stroke(@color) if @color && @width > 1.0
|
17
17
|
@renderer.draw.fill_opacity(@opacity)
|
18
18
|
@renderer.draw.fill(@color) if @color
|
19
19
|
@renderer.draw.rectangle(upper_left_x, upper_left_y, lower_right_x, lower_right_y)
|
@@ -23,6 +23,12 @@ module Gruff
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
def transparent_background(columns, rows)
|
27
|
+
@image = render_transparent_background(columns, rows)
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
26
32
|
def background(columns, rows, scale, theme_options)
|
27
33
|
return image_background(scale, *theme_options[:background_image]) if theme_options[:background_image]
|
28
34
|
|
@@ -36,8 +42,13 @@ module Gruff
|
|
36
42
|
end
|
37
43
|
end
|
38
44
|
|
39
|
-
|
40
|
-
|
45
|
+
# Use with a theme to use an image (800x600 original) background.
|
46
|
+
def image_background(scale, image_path)
|
47
|
+
image = Magick::Image.read(image_path)
|
48
|
+
if scale != 1.0
|
49
|
+
image[0].resize!(scale) # TODO: Resize with new scale (crop if necessary for wide graph)
|
50
|
+
end
|
51
|
+
image[0]
|
41
52
|
end
|
42
53
|
|
43
54
|
# Make a new image at the current size with a solid +color+.
|
@@ -82,17 +93,6 @@ module Gruff
|
|
82
93
|
end
|
83
94
|
end
|
84
95
|
|
85
|
-
private
|
86
|
-
|
87
|
-
# Use with a theme to use an image (800x600 original) background.
|
88
|
-
def image_background(scale, image_path)
|
89
|
-
image = Magick::Image.read(image_path)
|
90
|
-
if scale != 1.0
|
91
|
-
image[0].resize!(scale) # TODO: Resize with new scale (crop if necessary for wide graph)
|
92
|
-
end
|
93
|
-
image[0]
|
94
|
-
end
|
95
|
-
|
96
96
|
# Use with a theme to make a transparent background
|
97
97
|
def render_transparent_background(columns, rows)
|
98
98
|
Magick::Image.new(columns, rows) do |img|
|
data/lib/gruff/store/store.rb
CHANGED
@@ -35,21 +35,21 @@ module Gruff
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def min
|
38
|
-
@min ||= @data.
|
38
|
+
@min ||= @data.filter_map(&:min).min
|
39
39
|
end
|
40
40
|
alias min_y min
|
41
41
|
|
42
42
|
def max
|
43
|
-
@max ||= @data.
|
43
|
+
@max ||= @data.filter_map(&:max).max
|
44
44
|
end
|
45
45
|
alias max_y max
|
46
46
|
|
47
47
|
def min_x
|
48
|
-
@min_x ||= @data.
|
48
|
+
@min_x ||= @data.filter_map(&:min_x).min
|
49
49
|
end
|
50
50
|
|
51
51
|
def max_x
|
52
|
-
@max_x ||= @data.
|
52
|
+
@max_x ||= @data.filter_map(&:max_x).max
|
53
53
|
end
|
54
54
|
|
55
55
|
def sort_data!
|
data/lib/gruff/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gruff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.25.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Geoffrey Grosenbach
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -18,22 +18,8 @@ dependencies:
|
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
name: rmagick4j
|
21
|
-
prerelease: false
|
22
21
|
type: :runtime
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
name: histogram
|
35
22
|
prerelease: false
|
36
|
-
type: :runtime
|
37
23
|
version_requirements: !ruby/object:Gem::Requirement
|
38
24
|
requirements:
|
39
25
|
- - ">="
|
@@ -44,57 +30,29 @@ dependencies:
|
|
44
30
|
requirements:
|
45
31
|
- - ">="
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
name:
|
49
|
-
|
50
|
-
type: :development
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
name: minitest-reporters
|
33
|
+
version: '3.0'
|
34
|
+
name: bigdecimal
|
35
|
+
type: :runtime
|
63
36
|
prerelease: false
|
64
|
-
type: :development
|
65
37
|
version_requirements: !ruby/object:Gem::Requirement
|
66
38
|
requirements:
|
67
39
|
- - ">="
|
68
40
|
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
41
|
+
version: '3.0'
|
70
42
|
- !ruby/object:Gem::Dependency
|
71
43
|
requirement: !ruby/object:Gem::Requirement
|
72
44
|
requirements:
|
73
45
|
- - ">="
|
74
46
|
- !ruby/object:Gem::Version
|
75
47
|
version: '0'
|
76
|
-
name:
|
48
|
+
name: histogram
|
49
|
+
type: :runtime
|
77
50
|
prerelease: false
|
78
|
-
type: :development
|
79
51
|
version_requirements: !ruby/object:Gem::Requirement
|
80
52
|
requirements:
|
81
53
|
- - ">="
|
82
54
|
- !ruby/object:Gem::Version
|
83
55
|
version: '0'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.9.28
|
90
|
-
name: yard
|
91
|
-
prerelease: false
|
92
|
-
type: :development
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - "~>"
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: 0.9.28
|
98
56
|
description: Beautiful graphs for one or multiple datasets. Can be used on websites
|
99
57
|
or in documents.
|
100
58
|
email: boss@topfunky.com
|
@@ -174,6 +132,8 @@ homepage: https://github.com/topfunky/gruff
|
|
174
132
|
licenses:
|
175
133
|
- MIT
|
176
134
|
metadata:
|
135
|
+
bug_tracker_uri: https://github.com/topfunky/gruff/issues
|
136
|
+
changelog_uri: https://github.com/topfunky/gruff/blob/master/CHANGELOG.md
|
177
137
|
rubygems_mfa_required: 'true'
|
178
138
|
post_install_message:
|
179
139
|
rdoc_options: []
|
@@ -183,14 +143,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
183
143
|
requirements:
|
184
144
|
- - ">="
|
185
145
|
- !ruby/object:Gem::Version
|
186
|
-
version:
|
146
|
+
version: 3.0.0
|
187
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
148
|
requirements:
|
189
149
|
- - ">="
|
190
150
|
- !ruby/object:Gem::Version
|
191
151
|
version: '0'
|
192
152
|
requirements: []
|
193
|
-
rubygems_version: 3.
|
153
|
+
rubygems_version: 3.3.26
|
194
154
|
signing_key:
|
195
155
|
specification_version: 4
|
196
156
|
summary: Beautiful graphs for one or multiple datasets.
|