gruff 0.9.0-java → 0.12.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +21 -4
  3. data/.rubocop_todo.yml +103 -49
  4. data/.travis.yml +3 -6
  5. data/CHANGELOG.md +30 -0
  6. data/README.md +4 -0
  7. data/gruff.gemspec +8 -3
  8. data/lib/gruff.rb +9 -3
  9. data/lib/gruff/accumulator_bar.rb +13 -5
  10. data/lib/gruff/area.rb +22 -5
  11. data/lib/gruff/bar.rb +38 -10
  12. data/lib/gruff/base.rb +325 -236
  13. data/lib/gruff/bezier.rb +18 -4
  14. data/lib/gruff/bullet.rb +22 -14
  15. data/lib/gruff/dot.rb +20 -33
  16. data/lib/gruff/helper/bar_conversion.rb +7 -7
  17. data/lib/gruff/helper/bar_value_label_mixin.rb +3 -0
  18. data/lib/gruff/helper/stacked_mixin.rb +1 -1
  19. data/lib/gruff/histogram.rb +59 -0
  20. data/lib/gruff/line.rb +33 -28
  21. data/lib/gruff/mini/bar.rb +10 -2
  22. data/lib/gruff/mini/legend.rb +9 -4
  23. data/lib/gruff/mini/pie.rb +9 -3
  24. data/lib/gruff/mini/side_bar.rb +18 -4
  25. data/lib/gruff/net.rb +41 -21
  26. data/lib/gruff/patch/rmagick.rb +22 -24
  27. data/lib/gruff/patch/string.rb +9 -4
  28. data/lib/gruff/photo_bar.rb +12 -16
  29. data/lib/gruff/pie.rb +24 -34
  30. data/lib/gruff/renderer/bezier.rb +4 -3
  31. data/lib/gruff/renderer/circle.rb +4 -3
  32. data/lib/gruff/renderer/dash_line.rb +4 -3
  33. data/lib/gruff/renderer/dot.rb +4 -3
  34. data/lib/gruff/renderer/ellipse.rb +4 -3
  35. data/lib/gruff/renderer/line.rb +14 -5
  36. data/lib/gruff/renderer/polygon.rb +5 -4
  37. data/lib/gruff/renderer/polyline.rb +4 -3
  38. data/lib/gruff/renderer/rectangle.rb +3 -2
  39. data/lib/gruff/renderer/renderer.rb +31 -38
  40. data/lib/gruff/renderer/text.rb +29 -7
  41. data/lib/gruff/scatter.rb +26 -24
  42. data/lib/gruff/scene.rb +0 -1
  43. data/lib/gruff/side_bar.rb +51 -20
  44. data/lib/gruff/side_stacked_bar.rb +42 -15
  45. data/lib/gruff/spider.rb +29 -17
  46. data/lib/gruff/stacked_area.rb +19 -8
  47. data/lib/gruff/stacked_bar.rb +34 -13
  48. data/lib/gruff/store/{base_data.rb → basic_data.rb} +9 -7
  49. data/lib/gruff/store/custom_data.rb +8 -6
  50. data/lib/gruff/store/store.rb +7 -6
  51. data/lib/gruff/store/xy_data.rb +10 -7
  52. data/lib/gruff/version.rb +1 -1
  53. metadata +33 -8
  54. data/Rakefile +0 -23
  55. data/docker/Dockerfile +0 -14
  56. data/docker/build.sh +0 -4
  57. data/docker/launch.sh +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4391afb55e326b855c066f1f7e3479fec91aa004366d44d5b5d987eceb1ad797
4
- data.tar.gz: b3ff057010d8a3b335072597655b07806fd999f25a6fef4a549a82afaabffea1
3
+ metadata.gz: 48aea7b38e287c7020e9c5accef465de355ea7604e88234cc3eeacb97a76247d
4
+ data.tar.gz: 52f15904875b6ebfa35b98da41a919ad400fdb7faf50ea6c61f1b43dc3011380
5
5
  SHA512:
6
- metadata.gz: 4aecf3c51d0e1043ead7952711839053a7455a62d87f74f536dede1bdf40d30f16136d41286b27754eab14a7d3284c992d42339eec31ac39fd607b0e0cc9cf6c
7
- data.tar.gz: 0a2e2e8db08f48ae2da36432894e96b95cd736be2b7f6a398009fb0e6b7f77de4466b64e0aac105cd5ce7557cb672a483b84b82b18bc8875c50a6f13e5dbf693
6
+ metadata.gz: 76395c1016e0af0df78eb4960381c955be484b3448f19d46f08aa12613a3e0a6b2ef8b3449e4a881cded7600fb3178ecd6e23eb89fc016a83fae36912361963b
7
+ data.tar.gz: f5c52f1b2270cbe9907d4ef0eea38582f5babcf9b81dcac4548ce6a17f6fc79d0067a9f11aadcb1c9c6deca4b9e9edf161b9d439db9af3e6c01d1422e229f978
data/.rubocop.yml CHANGED
@@ -1,7 +1,9 @@
1
1
  inherit_from: .rubocop_todo.yml
2
+ require: rubocop-performance
2
3
 
3
4
  AllCops:
4
5
  EnabledByDefault: true
6
+ TargetRubyVersion: 2.4
5
7
  Exclude:
6
8
  - 'vendor/bundle/**/*'
7
9
  - 'rails_generators/gruff/**/*'
@@ -10,7 +12,7 @@ Gemspec/OrderedDependencies:
10
12
  Enabled: false
11
13
 
12
14
  Gemspec/RequiredRubyVersion:
13
- Enabled: false
15
+ Enabled: true
14
16
 
15
17
  Layout/AccessModifierIndentation:
16
18
  EnforcedStyle: outdent
@@ -18,15 +20,15 @@ Layout/AccessModifierIndentation:
18
20
  Layout/ClassStructure:
19
21
  Enabled: false
20
22
 
21
- Layout/CommentIndentation:
22
- Enabled: false
23
-
24
23
  Layout/FirstMethodArgumentLineBreak:
25
24
  Enabled: false
26
25
 
27
26
  Layout/LeadingCommentSpace:
28
27
  Enabled: false
29
28
 
29
+ Layout/LineLength:
30
+ Max: 150
31
+
30
32
  Layout/MultilineMethodArgumentLineBreaks:
31
33
  Enabled: false
32
34
 
@@ -36,9 +38,18 @@ Layout/MultilineAssignmentLayout:
36
38
  Lint/AssignmentInCondition:
37
39
  Enabled: false
38
40
 
41
+ Lint/ConstantResolution:
42
+ Enabled: false
43
+
39
44
  Lint/NumberConversion:
40
45
  Enabled: false
41
46
 
47
+ Style/AccessorGrouping:
48
+ Enabled: false
49
+
50
+ Style/ClassAndModuleChildren:
51
+ Enabled: false
52
+
42
53
  Style/ConditionalAssignment:
43
54
  Enabled: false
44
55
 
@@ -48,6 +59,9 @@ Style/ConstantVisibility:
48
59
  Style/Copyright:
49
60
  Enabled: false
50
61
 
62
+ Style/Documentation:
63
+ Enabled: true
64
+
51
65
  Style/Encoding:
52
66
  Enabled: false
53
67
 
@@ -107,3 +121,6 @@ Style/SymbolArray:
107
121
 
108
122
  Style/TernaryParentheses:
109
123
  Enabled: false
124
+
125
+ Performance/ChainArrayAllocation:
126
+ Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -1,16 +1,38 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-05-24 08:35:04 +0000 using RuboCop version 0.81.0.
3
+ # on 2021-03-07 06:12:58 UTC using RuboCop version 1.11.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/DateAssignment:
14
+ Exclude:
15
+ - 'gruff.gemspec'
16
+
17
+ # Offense count: 1
18
+ # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
19
+ Lint/DuplicateBranch:
20
+ Exclude:
21
+ - 'test/gruff_test_case.rb'
22
+
9
23
  # Offense count: 1
10
24
  Lint/DuplicateMethods:
11
25
  Exclude:
12
26
  - 'lib/gruff/photo_bar.rb'
13
27
 
28
+ # Offense count: 13
29
+ Lint/FloatComparison:
30
+ Exclude:
31
+ - 'Rakefile'
32
+ - 'lib/gruff/base.rb'
33
+ - 'lib/gruff/renderer/renderer.rb'
34
+ - 'lib/gruff/scatter.rb'
35
+
14
36
  # Offense count: 1
15
37
  Lint/UnreachableCode:
16
38
  Exclude:
@@ -27,47 +49,41 @@ Lint/Void:
27
49
  Exclude:
28
50
  - 'lib/gruff/patch/rmagick.rb'
29
51
 
30
- # Offense count: 49
31
- # Configuration parameters: IgnoredMethods.
52
+ # Offense count: 54
53
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
32
54
  Metrics/AbcSize:
33
- Max: 78
55
+ Max: 82
34
56
 
35
57
  # Offense count: 1
36
- # Configuration parameters: CountComments, ExcludedMethods.
37
- # ExcludedMethods: refine
58
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
59
+ # IgnoredMethods: refine
38
60
  Metrics/BlockLength:
39
61
  Max: 29
40
62
 
41
- # Offense count: 12
42
- # Configuration parameters: CountComments.
63
+ # Offense count: 13
64
+ # Configuration parameters: CountComments, CountAsOne.
43
65
  Metrics/ClassLength:
44
- Max: 634
66
+ Max: 637
45
67
 
46
- # Offense count: 12
68
+ # Offense count: 9
47
69
  # Configuration parameters: IgnoredMethods.
48
70
  Metrics/CyclomaticComplexity:
49
- Max: 17
71
+ Max: 21
50
72
 
51
- # Offense count: 126
52
- # Configuration parameters: CountComments, ExcludedMethods.
73
+ # Offense count: 121
74
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
53
75
  Metrics/MethodLength:
54
76
  Max: 81
55
77
 
56
- # Offense count: 2
57
- # Configuration parameters: CountKeywordArgs.
78
+ # Offense count: 3
79
+ # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
58
80
  Metrics/ParameterLists:
59
81
  Max: 7
60
82
 
61
- # Offense count: 9
83
+ # Offense count: 8
62
84
  # Configuration parameters: IgnoredMethods.
63
85
  Metrics/PerceivedComplexity:
64
- Max: 20
65
-
66
- # Offense count: 2
67
- Naming/AccessorMethodName:
68
- Exclude:
69
- - 'lib/gruff/helper/stacked_mixin.rb'
70
- - 'lib/gruff/store/store.rb'
86
+ Max: 22
71
87
 
72
88
  # Offense count: 1
73
89
  # Configuration parameters: EnforcedStyleForLeadingUnderscores.
@@ -76,9 +92,9 @@ Naming/MemoizedInstanceVariableName:
76
92
  Exclude:
77
93
  - 'lib/gruff/scene.rb'
78
94
 
79
- # Offense count: 7
95
+ # Offense count: 9
80
96
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
81
- # AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
97
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
82
98
  Naming/MethodParameterName:
83
99
  Exclude:
84
100
  - 'lib/gruff/base.rb'
@@ -86,39 +102,62 @@ Naming/MethodParameterName:
86
102
  - 'lib/gruff/pie.rb'
87
103
  - 'lib/gruff/renderer/text.rb'
88
104
 
89
- # Offense count: 2
90
- Security/Eval:
105
+ # Offense count: 6
106
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
107
+ # SupportedStyles: snake_case, normalcase, non_integer
108
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
109
+ Naming/VariableNumber:
91
110
  Exclude:
92
- - 'test/gruff_test_case.rb'
111
+ - 'test/test_bar.rb'
112
+ - 'test/test_bezier.rb'
113
+ - 'test/test_line.rb'
114
+
115
+ # Offense count: 1
116
+ # Configuration parameters: MinSize.
117
+ Performance/CollectionLiteralInLoop:
118
+ Exclude:
119
+ - 'test/test_legend.rb'
93
120
 
94
121
  # Offense count: 1
95
122
  # Cop supports --auto-correct.
96
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
97
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
98
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
99
- # FunctionalMethods: let, let!, subject, watch
100
- # IgnoredMethods: lambda, proc, it
101
- Style/BlockDelimiters:
123
+ Performance/RedundantMatch:
102
124
  Exclude:
103
- - 'test/test_accumulator_bar.rb'
125
+ - 'lib/gruff/photo_bar.rb'
104
126
 
105
- # Offense count: 33
127
+ # Offense count: 1
106
128
  # Cop supports --auto-correct.
107
- # Configuration parameters: AutoCorrect, EnforcedStyle.
108
- # SupportedStyles: nested, compact
109
- Style/ClassAndModuleChildren:
110
- Enabled: false
129
+ Performance/RegexpMatch:
130
+ Exclude:
131
+ - 'lib/gruff/photo_bar.rb'
111
132
 
112
- # Offense count: 39
113
- Style/Documentation:
114
- Enabled: false
133
+ # Offense count: 2
134
+ # Cop supports --auto-correct.
135
+ Performance/StringReplacement:
136
+ Exclude:
137
+ - 'lib/gruff/scene.rb'
138
+
139
+ # Offense count: 2
140
+ Security/Eval:
141
+ Exclude:
142
+ - 'test/gruff_test_case.rb'
143
+
144
+ # Offense count: 1
145
+ Style/CombinableLoops:
146
+ Exclude:
147
+ - 'test/test_line.rb'
148
+
149
+ # Offense count: 3
150
+ Style/DocumentDynamicEvalDefinition:
151
+ Exclude:
152
+ - 'test/gruff_test_case.rb'
115
153
 
116
- # Offense count: 134
154
+ # Offense count: 132
117
155
  # Configuration parameters: RequireForNonPublicMethods.
118
156
  Style/DocumentationMethod:
119
157
  Enabled: false
120
158
 
121
159
  # Offense count: 3
160
+ # Cop supports --auto-correct.
122
161
  Style/EvalWithLocation:
123
162
  Exclude:
124
163
  - 'test/gruff_test_case.rb'
@@ -128,9 +167,24 @@ Style/MissingRespondToMissing:
128
167
  Exclude:
129
168
  - 'lib/gruff/scene.rb'
130
169
 
131
- # Offense count: 406
170
+ # Offense count: 1
171
+ # Configuration parameters: AllowedMethods.
172
+ # AllowedMethods: respond_to_missing?
173
+ Style/OptionalBooleanParameter:
174
+ Exclude:
175
+ - 'lib/gruff/base.rb'
176
+
177
+ # Offense count: 3
132
178
  # Cop supports --auto-correct.
133
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
134
- # URISchemes: http, https
135
- Layout/LineLength:
136
- Max: 164
179
+ Style/StringConcatenation:
180
+ Exclude:
181
+ - 'lib/gruff/photo_bar.rb'
182
+ - 'test/gruff_test_case.rb'
183
+
184
+ # Offense count: 2
185
+ # Configuration parameters: EnforcedStyle.
186
+ # SupportedStyles: forbid_mixed_logical_operators, forbid_logical_operators
187
+ Style/UnlessLogicalOperators:
188
+ Exclude:
189
+ - 'lib/gruff/bar.rb'
190
+ - 'lib/gruff/scatter.rb'
data/.travis.yml CHANGED
@@ -3,20 +3,17 @@ dist: bionic
3
3
  cache: bundler
4
4
 
5
5
  rvm:
6
- - 2.3
7
6
  - 2.4
8
7
  - 2.5
9
8
  - 2.6
10
9
  - 2.7
11
- - jruby-1.7.27
12
- - jruby-9.0.5.0
13
- - jruby-9.1.17.0
14
- - jruby-9.2.11.1
10
+ - 3.0
11
+ - jruby-9.2.14.0
15
12
 
16
13
  jobs:
17
14
  include:
18
15
  - name: 'Lint'
19
- rvm: 2.3
16
+ rvm: 2.4
20
17
  script: bundle exec rubocop
21
18
 
22
19
  addons:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.12.2
4
+ - Avoid SEGV caused with '%S' in Draw#get_type_metrics by old ImageMagick (6.9.9 or below) (#490)
5
+
6
+ ## 0.12.0
7
+ - Mark Gruff::Base#to_blob as deprecated (#473)
8
+ - Add Gruff::Base#to_image method (#472)
9
+ - Drop support of Ruby v2.3.x or below (#453, #448)
10
+ - add hide_labels to stacked side bar graphs (#452)
11
+ - add hide_labels to side bar graphs (#451)
12
+ - add hide_labels to stacked bar graphs (#450)
13
+ - support hide_labels separate from hide_line_markers for bar graphs only (#446)
14
+
15
+ ## 0.11.0
16
+ - Fix regression in empty data handling (#445)
17
+ - Rendering text in front most (#439)
18
+ - Allow to change settings even after entered the data in Gruff::Histogram (#437)
19
+ - Adjust label position in Gruff::Net (#436)
20
+ - Adjust LABEL_MARGIN value (#435)
21
+ - Add shadow line in marker line into Gruff::{Dot, SideBar, Scatter} (#430)
22
+ - Move no data message to the vertical center (#428)
23
+ - Remove the getter method in attributes for configuration (#424)
24
+ - Fix title margin in Gruff::Bullet if empty title was given (#422)
25
+
26
+ ## 0.10.0
27
+
28
+ * Add Histogram chart (#419)
29
+ * Fix that Y axis label is not displayed on JRuby platform (#415)
30
+ * Add fill_opacity and stroke_width in Gruff::Area in order to specify the filling opacity (#413)
31
+ * Fix "`get_type_metrics': no text to measure" exception (#410, #409)
32
+
3
33
  ## 0.9.0
4
34
 
5
35
  * Fix that sidebar label is not displayed on JRuby platform (#402)
data/README.md CHANGED
@@ -119,6 +119,10 @@ In progress!
119
119
 
120
120
  ![Stacked bar chart](https://raw.github.com/topfunky/gruff/master/test/expected/stacked_bar_keynote.png)
121
121
 
122
+ ### Histogram chart
123
+
124
+ ![Histogram chart](https://raw.github.com/topfunky/gruff/master/test/expected/histogram.png)
125
+
122
126
 
123
127
  ## Documentation
124
128
 
data/gruff.gemspec CHANGED
@@ -13,7 +13,9 @@ Gem::Specification.new do |s|
13
13
  s.date = Date.today.to_s
14
14
  s.description = 'Beautiful graphs for one or multiple datasets. Can be used on websites or in documents.'
15
15
  s.email = 'boss@topfunky.com'
16
- s.files = `git ls-files`.split($/).reject { |f| f =~ /^test/ }
16
+ s.files = `git ls-files`.split.reject do |f|
17
+ f =~ /^test|^docker|^Rakefile/
18
+ end
17
19
  s.homepage = 'https://github.com/topfunky/gruff'
18
20
  s.require_paths = %w[lib]
19
21
  s.summary = 'Beautiful graphs for one or multiple datasets.'
@@ -27,11 +29,14 @@ Gem::Specification.new do |s|
27
29
  s.add_dependency 'rmagick4j'
28
30
  else
29
31
  s.add_dependency 'rmagick'
30
- s.add_development_dependency 'rubocop', '~> 0.81.0'
32
+ s.add_development_dependency 'rubocop', '~> 1.11.0'
33
+ s.add_development_dependency 'rubocop-performance', '~> 1.10.1'
31
34
  end
32
- s.required_ruby_version = '>= 1.9.3'
35
+ s.add_dependency 'histogram'
36
+ s.required_ruby_version = '>= 2.4.0'
33
37
 
34
38
  s.add_development_dependency 'rake'
39
+ s.add_development_dependency 'parallel'
35
40
  s.add_development_dependency 'minitest-reporters'
36
41
  s.add_development_dependency 'yard', '~> 0.9.25'
37
42
  end
data/lib/gruff.rb CHANGED
@@ -9,22 +9,28 @@ require 'gruff/version'
9
9
  patch/rmagick
10
10
  patch/string
11
11
 
12
- themes
13
12
  base
13
+
14
+ helper/bar_conversion.rb
15
+ helper/stacked_mixin
16
+ helper/bar_value_label_mixin
17
+
18
+ themes
14
19
  area
15
20
  bar
16
21
  bezier
17
22
  bullet
18
23
  dot
24
+ histogram
19
25
  line
20
26
  net
21
27
  pie
22
28
  scatter
23
29
  spider
30
+ side_bar
24
31
  stacked_area
25
32
  stacked_bar
26
33
  side_stacked_bar
27
- side_bar
28
34
  accumulator_bar
29
35
 
30
36
  scene
@@ -42,7 +48,7 @@ require 'gruff/version'
42
48
  renderer/text
43
49
 
44
50
  store/store
45
- store/base_data
51
+ store/basic_data
46
52
  store/custom_data
47
53
  store/xy_data
48
54