gruff 0.27.1-java → 0.28.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 947e715e89fb6d5d8ee995e8f2133657f6d5c2fbdb0b5434c86e3164de35c7b5
4
- data.tar.gz: 076ee5f2e4c8cb488e14e5f9f7a160a7e42c40e42e8f805459388844f779d257
3
+ metadata.gz: 2795647ebb4bd2498927c29c25be0bcc9046a31d008db4c4d6bb216287c54ea0
4
+ data.tar.gz: c831bcdfedf005fb6e54286d52834319a34a22c8fd3fd97be99b7e0809c9ea71
5
5
  SHA512:
6
- metadata.gz: d1da4d58abaa0e4fa52fcb3c8dd8942566133456ad40cfc8c9533781358805d2add65d180347d6f2ba89ef7efe0378e1785a58c15be759849eeed731decb0bf4
7
- data.tar.gz: aa0b76f3ad4ea8c67796037aaf2774f6fdadfc03b0fb7fa4a1ec5039b19a02381191ce3efa0465c2716380fde8913d614c819e839789a74d8afabd0db8aa985e
6
+ metadata.gz: 6f7897128a908ea4983a6312cc7f727ad1c3c36a933fc5e7fc8eda90e857c95d3b9f68d11d40cc19c286f5c1baf82292d2955708fed9bd720f9ccd0170d0e8d0
7
+ data.tar.gz: 64f442e6b392b07943352e385b7e8f4b991e07c5a639576ff4a86d769cde0430d46b8e919575ccb259777526cd9b0ca37716433aeacf480eab3efc5580eda0ac
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.28.0
4
+
5
+ - Fix Gruff::Line to prevent unknown lines drawing (#664)
6
+
3
7
  ## 0.27.1
4
8
 
5
9
  - RBS: Fix wrong type declarations (#662)
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
- poly_points_group << []
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
- end
265
-
266
- unless @hide_lines
267
- poly_points_group.each do |poly_points|
268
- Gruff::Renderer::Polyline.new(renderer, color: data_row.color, width: stroke_width).render(poly_points) unless poly_points.empty?
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/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # rbs_inline: enabled
4
4
 
5
5
  module Gruff
6
- VERSION = '0.27.1'
6
+ VERSION = '0.28.0'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.1
4
+ version: 0.28.0
5
5
  platform: java
6
6
  authors:
7
7
  - Geoffrey Grosenbach
8
8
  - Uwe Kubosch
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-15 00:00:00.000000000 Z
11
+ date: 2025-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick4j