gruff 0.27.1 → 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/CHANGELOG.md +4 -0
- data/lib/gruff/line.rb +10 -13
- data/lib/gruff/version.rb +1 -1
- 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/CHANGELOG.md
CHANGED
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/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.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: []
|