gruff 0.27.0 → 0.28.0
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 +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +1 -0
- data/lib/gruff/base.rb +1 -1
- data/lib/gruff/helper/bar_value_label.rb +2 -2
- data/lib/gruff/line.rb +10 -13
- data/lib/gruff/pie.rb +1 -1
- data/lib/gruff/version.rb +1 -1
- data/sig/generated/gruff/base.rbs +2 -2
- data/sig/generated/gruff/helper/bar_value_label.rbs +4 -4
- data/sig/generated/gruff/pie.rbs +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26b395dec8d012e9a7cee4013081d689b7decd86aeda0dc1ffd8fc66c6e71db6
|
4
|
+
data.tar.gz: 6cc57c03116dff4ba0a0c6e8adb0f36d247431bba05e292bb6d422a8b9d1b1c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b155ccb54f177475c81c1176401fd95147152300e48da0c96951d8767bf8b861cbc7a4f2e27da32e727cb64e1f9fe31b5fa7a8bee49d2747e0a3e883a72a636
|
7
|
+
data.tar.gz: c2ec8dd6104836dfa234a8300c0e1ba40e212b2faac3c77ec504fd9db7d01408a75bbe486a487a3744965c54487c114961f5c58f79ca66c8e974b3dd4b135d05
|
data/.github/workflows/ci.yml
CHANGED
@@ -15,7 +15,7 @@ jobs:
|
|
15
15
|
timeout-minutes: 20
|
16
16
|
strategy:
|
17
17
|
matrix:
|
18
|
-
ruby-version: ['3.
|
18
|
+
ruby-version: ['3.4']
|
19
19
|
imagemagick-version:
|
20
20
|
- { full: 7.1.1-33, major-minor: '7.1' }
|
21
21
|
name: Lint (Ruby ${{ matrix.ruby-version }}, ImageMagick ${{ matrix.imagemagick-version.major-minor }})
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/gruff/base.rb
CHANGED
@@ -44,7 +44,7 @@ module Gruff::BarValueLabel
|
|
44
44
|
class Bar < Base
|
45
45
|
# @rbs format: nil | String | Proc
|
46
46
|
# @rbs proc_text_metrics: Proc
|
47
|
-
# @rbs
|
47
|
+
# @rbs yields: (Float | Integer, Float | Integer, String, Float, Float) -> void
|
48
48
|
def prepare_rendering(format, proc_text_metrics)
|
49
49
|
left_x, left_y, _right_x, _right_y = @coordinate
|
50
50
|
val, metrics = Gruff::BarValueLabel.metrics(@value, format, proc_text_metrics)
|
@@ -58,7 +58,7 @@ module Gruff::BarValueLabel
|
|
58
58
|
class SideBar < Base
|
59
59
|
# @rbs format: nil | String | Proc
|
60
60
|
# @rbs proc_text_metrics: Proc
|
61
|
-
# @rbs
|
61
|
+
# @rbs yields: (Float | Integer, Float | Integer, String, Float, Float) -> void
|
62
62
|
def prepare_rendering(format, proc_text_metrics)
|
63
63
|
left_x, left_y, right_x, _right_y = @coordinate
|
64
64
|
val, metrics = Gruff::BarValueLabel.metrics(@value, format, proc_text_metrics)
|
data/lib/gruff/line.rb
CHANGED
@@ -229,13 +229,10 @@ private
|
|
229
229
|
|
230
230
|
stroke_width = @line_width || clip_value_if_greater_than(@columns / (store.norm_data.first.y_points.size * 4.0), 5.0)
|
231
231
|
circle_radius = @dot_radius || clip_value_if_greater_than(@columns / (store.norm_data.first.y_points.size * 2.5), 5.0)
|
232
|
+
prev_x = prev_y = nil
|
232
233
|
|
233
234
|
store.norm_data.each do |data_row|
|
234
|
-
poly_points_group = [[]]
|
235
|
-
|
236
235
|
data_row.coordinates.each_with_index do |(x_data, y_data), index|
|
237
|
-
poly_points = poly_points_group.last
|
238
|
-
|
239
236
|
new_x = begin
|
240
237
|
if x_data.nil?
|
241
238
|
# use the old method: equally spaced points along the x-axis
|
@@ -249,24 +246,24 @@ private
|
|
249
246
|
unless y_data
|
250
247
|
# we can't draw a line for a null data point, we can still label the axis though.
|
251
248
|
# Split the polygonal line into separate groups of points for polyline.
|
252
|
-
|
249
|
+
prev_x = prev_y = nil
|
253
250
|
next
|
254
251
|
end
|
255
252
|
|
256
253
|
new_y = @graph_top + (@graph_height - (y_data * @graph_height))
|
257
254
|
|
258
|
-
poly_points << new_x
|
259
|
-
poly_points << new_y
|
260
|
-
|
261
255
|
if contains_one_point_only?(data_row) || !@hide_dots
|
262
256
|
Gruff::Renderer::Dot.new(renderer, @dot_style, color: data_row.color, width: stroke_width).render(new_x, new_y, circle_radius)
|
263
257
|
end
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
Gruff::Renderer::
|
258
|
+
if !@hide_lines && prev_x && prev_y
|
259
|
+
# Renderer::Polyline may cause unknown lines to be drawn with complex graphs.
|
260
|
+
# Probably it is related to ImageMagick behavior.
|
261
|
+
# To avoid this problem, we use the Renderer::Line instead.
|
262
|
+
Gruff::Renderer::Line.new(renderer, color: data_row.color, width: stroke_width)
|
263
|
+
.render(prev_x, prev_y, new_x, new_y)
|
269
264
|
end
|
265
|
+
prev_x = new_x
|
266
|
+
prev_y = new_y
|
270
267
|
end
|
271
268
|
end
|
272
269
|
end
|
data/lib/gruff/pie.rb
CHANGED
data/lib/gruff/version.rb
CHANGED
@@ -492,8 +492,8 @@ module Gruff
|
|
492
492
|
def draw_label: (Float | Integer x, Integer index, ?untyped gravity) { () -> void } -> untyped
|
493
493
|
|
494
494
|
# @rbs index: Integer
|
495
|
-
# @rbs
|
496
|
-
def draw_unique_label: (Integer index)
|
495
|
+
# @rbs yields: () -> void
|
496
|
+
def draw_unique_label: (Integer index) -> untyped
|
497
497
|
|
498
498
|
# @rbs width: Float | Integer
|
499
499
|
# @rbs height: Float | Integer
|
@@ -27,15 +27,15 @@ module Gruff::BarValueLabel
|
|
27
27
|
class Bar < Base
|
28
28
|
# @rbs format: nil | String | Proc
|
29
29
|
# @rbs proc_text_metrics: Proc
|
30
|
-
# @rbs
|
31
|
-
def prepare_rendering: (nil | String | Proc format, Proc proc_text_metrics)
|
30
|
+
# @rbs yields: (Float | Integer, Float | Integer, String, Float, Float) -> void
|
31
|
+
def prepare_rendering: (nil | String | Proc format, Proc proc_text_metrics) -> untyped
|
32
32
|
end
|
33
33
|
|
34
34
|
# @private
|
35
35
|
class SideBar < Base
|
36
36
|
# @rbs format: nil | String | Proc
|
37
37
|
# @rbs proc_text_metrics: Proc
|
38
|
-
# @rbs
|
39
|
-
def prepare_rendering: (nil | String | Proc format, Proc proc_text_metrics)
|
38
|
+
# @rbs yields: (Float | Integer, Float | Integer, String, Float, Float) -> void
|
39
|
+
def prepare_rendering: (nil | String | Proc format, Proc proc_text_metrics) -> untyped
|
40
40
|
end
|
41
41
|
end
|
data/sig/generated/gruff/pie.rbs
CHANGED
@@ -50,8 +50,8 @@ class Gruff::Pie < Gruff::Base
|
|
50
50
|
|
51
51
|
def slices: () -> untyped
|
52
52
|
|
53
|
-
# @rbs
|
54
|
-
def update_chart_degrees_with: (
|
53
|
+
# @rbs degrees: Float | Integer
|
54
|
+
def update_chart_degrees_with: (Float | Integer degrees) -> untyped
|
55
55
|
|
56
56
|
# @rbs return: Float | Integer
|
57
57
|
def chart_degrees: () -> (Float | Integer)
|
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.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoffrey Grosenbach
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
|
-
rubygems_version: 3.
|
194
|
+
rubygems_version: 3.7.0
|
195
195
|
specification_version: 4
|
196
196
|
summary: Beautiful graphs for one or multiple datasets.
|
197
197
|
test_files: []
|