gruff 0.28.0-java → 0.30.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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/workflows/ci.yml +19 -26
  4. data/.rubocop.yml +15 -0
  5. data/.rubocop_todo.yml +11 -0
  6. data/CHANGELOG.md +9 -0
  7. data/Gemfile +2 -0
  8. data/gruff.gemspec +1 -0
  9. data/init.rb +1 -0
  10. data/lib/gruff/accumulator_bar.rb +1 -0
  11. data/lib/gruff/area.rb +2 -0
  12. data/lib/gruff/bar.rb +5 -0
  13. data/lib/gruff/base.rb +59 -2
  14. data/lib/gruff/bezier.rb +1 -0
  15. data/lib/gruff/box.rb +8 -0
  16. data/lib/gruff/bubble.rb +4 -0
  17. data/lib/gruff/bullet.rb +4 -0
  18. data/lib/gruff/candlestick.rb +20 -8
  19. data/lib/gruff/dot.rb +4 -0
  20. data/lib/gruff/font.rb +2 -0
  21. data/lib/gruff/helper/bar_value_label.rb +2 -0
  22. data/lib/gruff/helper/stacked_mixin.rb +1 -0
  23. data/lib/gruff/histogram.rb +3 -0
  24. data/lib/gruff/line.rb +29 -1
  25. data/lib/gruff/mini/bar.rb +4 -0
  26. data/lib/gruff/mini/legend.rb +15 -3
  27. data/lib/gruff/mini/pie.rb +4 -0
  28. data/lib/gruff/mini/side_bar.rb +4 -0
  29. data/lib/gruff/net.rb +7 -1
  30. data/lib/gruff/patch/rmagick.rb +11 -0
  31. data/lib/gruff/patch/string.rb +3 -0
  32. data/lib/gruff/pie.rb +8 -0
  33. data/lib/gruff/renderer/bezier.rb +1 -0
  34. data/lib/gruff/renderer/circle.rb +1 -0
  35. data/lib/gruff/renderer/dash_line.rb +1 -0
  36. data/lib/gruff/renderer/dot.rb +13 -0
  37. data/lib/gruff/renderer/ellipse.rb +1 -0
  38. data/lib/gruff/renderer/line.rb +7 -0
  39. data/lib/gruff/renderer/polygon.rb +2 -0
  40. data/lib/gruff/renderer/polyline.rb +1 -0
  41. data/lib/gruff/renderer/rectangle.rb +1 -0
  42. data/lib/gruff/renderer/renderer.rb +26 -3
  43. data/lib/gruff/renderer/text.rb +5 -1
  44. data/lib/gruff/scatter.rb +17 -0
  45. data/lib/gruff/side_bar.rb +9 -0
  46. data/lib/gruff/side_stacked_bar.rb +3 -0
  47. data/lib/gruff/spider.rb +26 -2
  48. data/lib/gruff/stacked_area.rb +5 -0
  49. data/lib/gruff/stacked_bar.rb +5 -0
  50. data/lib/gruff/store/basic_data.rb +4 -0
  51. data/lib/gruff/store/store.rb +8 -0
  52. data/lib/gruff/store/xy_data.rb +2 -0
  53. data/lib/gruff/store/xy_pointsizes_data.rb +2 -0
  54. data/lib/gruff/version.rb +1 -1
  55. data/lib/gruff.rb +2 -0
  56. data/sig/generated/gruff/accumulator_bar.rbs +2 -1
  57. data/sig/generated/gruff/area.rbs +4 -2
  58. data/sig/generated/gruff/bar.rbs +10 -5
  59. data/sig/generated/gruff/base.rbs +113 -53
  60. data/sig/generated/gruff/bezier.rbs +2 -1
  61. data/sig/generated/gruff/box.rbs +13 -5
  62. data/sig/generated/gruff/bubble.rbs +8 -4
  63. data/sig/generated/gruff/bullet.rbs +8 -4
  64. data/sig/generated/gruff/candlestick.rbs +26 -14
  65. data/sig/generated/gruff/dot.rbs +8 -4
  66. data/sig/generated/gruff/font.rbs +3 -1
  67. data/sig/generated/gruff/helper/bar_value_label.rbs +4 -2
  68. data/sig/generated/gruff/helper/stacked_mixin.rbs +2 -1
  69. data/sig/generated/gruff/histogram.rbs +6 -3
  70. data/sig/generated/gruff/line.rbs +44 -16
  71. data/sig/generated/gruff/mini/bar.rbs +27 -0
  72. data/sig/generated/gruff/mini/legend.rbs +36 -0
  73. data/sig/generated/gruff/mini/pie.rbs +26 -0
  74. data/sig/generated/gruff/mini/side_bar.rbs +34 -0
  75. data/sig/generated/gruff/net.rbs +12 -6
  76. data/sig/generated/gruff/patch/rmagick.rbs +25 -0
  77. data/sig/generated/gruff/patch/string.rbs +11 -0
  78. data/sig/generated/gruff/pie.rbs +15 -7
  79. data/sig/generated/gruff/renderer/bezier.rbs +2 -1
  80. data/sig/generated/gruff/renderer/circle.rbs +2 -1
  81. data/sig/generated/gruff/renderer/dash_line.rbs +2 -1
  82. data/sig/generated/gruff/renderer/dot.rbs +17 -4
  83. data/sig/generated/gruff/renderer/ellipse.rbs +2 -1
  84. data/sig/generated/gruff/renderer/line.rbs +9 -2
  85. data/sig/generated/gruff/renderer/polygon.rbs +17 -0
  86. data/sig/generated/gruff/renderer/polyline.rbs +2 -1
  87. data/sig/generated/gruff/renderer/rectangle.rbs +2 -1
  88. data/sig/generated/gruff/renderer/renderer.rbs +31 -8
  89. data/sig/generated/gruff/renderer/text.rbs +7 -3
  90. data/sig/generated/gruff/scatter.rbs +30 -13
  91. data/sig/generated/gruff/side_bar.rbs +15 -6
  92. data/sig/generated/gruff/side_stacked_bar.rbs +6 -3
  93. data/sig/generated/gruff/spider.rbs +35 -11
  94. data/sig/generated/gruff/stacked_area.rbs +9 -4
  95. data/sig/generated/gruff/stacked_bar.rbs +10 -5
  96. data/sig/generated/gruff/store/basic_data.rbs +8 -4
  97. data/sig/generated/gruff/store/store.rbs +12 -4
  98. data/sig/generated/gruff/store/xy_data.rbs +4 -2
  99. data/sig/generated/gruff/store/xy_pointsizes_data.rbs +4 -2
  100. data/sig/generated/gruff.rbs +3 -1
  101. metadata +12 -3
@@ -15,6 +15,7 @@ module Gruff
15
15
  # @rbs x_points: Array[nil | Float | Integer] | nil
16
16
  # @rbs y_points: Array[nil | Float | Integer] | nil
17
17
  # @rbs color: String
18
+ # @rbs return: void
18
19
  def initialize(label, x_points, y_points, color)
19
20
  y_points = Array(y_points)
20
21
  x_points = x_points ? Array(x_points) : Array.new(y_points.length)
@@ -33,6 +34,7 @@ module Gruff
33
34
  x_points.zip(y_points)
34
35
  end
35
36
 
37
+ # @rbs return: void
36
38
  def coordinate_and_pointsizes
37
39
  raise NotImplementedError, 'This method is not implemented for XYData'
38
40
  end
@@ -17,6 +17,7 @@ module Gruff
17
17
  # @rbs y_points: Array[nil | Float | Integer] | nil
18
18
  # @rbs point_sizes: Array[nil | Float | Integer]
19
19
  # @rbs color: String
20
+ # @rbs return: void
20
21
  def initialize(label, x_points, y_points, point_sizes, color)
21
22
  y_points = Array(y_points)
22
23
  x_points = x_points ? Array(x_points) : Array.new(y_points.length)
@@ -32,6 +33,7 @@ module Gruff
32
33
 
33
34
  alias points y_points
34
35
 
36
+ # @rbs return: void
35
37
  def coordinates
36
38
  raise NotImplementedError, 'This method is not implemented for XYPointsizeData'
37
39
  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.28.0'
6
+ VERSION = '0.30.0'
7
7
  end
data/lib/gruff.rb CHANGED
@@ -17,6 +17,8 @@ require_relative 'gruff/version'
17
17
  #
18
18
  module Gruff
19
19
  # @private
20
+ # @rbs path: String
21
+ # @rbs return: String
20
22
  def self.libpath(path)
21
23
  File.join(__dir__, 'gruff', path) # steep:ignore
22
24
  end
@@ -15,5 +15,6 @@
15
15
  class Gruff::AccumulatorBar < Gruff::StackedBar
16
16
  private
17
17
 
18
- def setup_data: () -> untyped
18
+ # @rbs return: void
19
+ def setup_data: () -> void
19
20
  end
@@ -21,7 +21,9 @@ class Gruff::Area < Gruff::Base
21
21
 
22
22
  private
23
23
 
24
- def initialize_attributes: () -> untyped
24
+ # @rbs return: void
25
+ def initialize_attributes: () -> void
25
26
 
26
- def draw_graph: () -> untyped
27
+ # @rbs return: void
28
+ def draw_graph: () -> void
27
29
  end
@@ -45,13 +45,16 @@ class Gruff::Bar < Gruff::Base
45
45
  # Default value is +0.9+.
46
46
  #
47
47
  # @rbs space_percent: Float | Integer
48
- def spacing_factor=: (Float | Integer space_percent) -> untyped
48
+ # @rbs return: void
49
+ def spacing_factor=: (Float | Integer space_percent) -> void
49
50
 
50
51
  private
51
52
 
52
- def initialize_attributes: () -> untyped
53
+ # @rbs return: void
54
+ def initialize_attributes: () -> void
53
55
 
54
- def setup_drawing: () -> untyped
56
+ # @rbs return: void
57
+ def setup_drawing: () -> void
55
58
 
56
59
  # @rbs return: bool
57
60
  def hide_labels?: () -> bool
@@ -62,9 +65,11 @@ class Gruff::Bar < Gruff::Base
62
65
  # @rbs return: bool
63
66
  def hide_bottom_label_area?: () -> bool
64
67
 
65
- def setup_graph_measurements: () -> untyped
68
+ # @rbs return: void
69
+ def setup_graph_measurements: () -> void
66
70
 
67
- def draw_graph: () -> untyped
71
+ # @rbs return: void
72
+ def draw_graph: () -> void
68
73
 
69
74
  # @rbs return: Float | Integer
70
75
  def calculate_spacing: () -> (Float | Integer)
@@ -133,9 +133,11 @@ module Gruff
133
133
  # @rbs return: void
134
134
  def initialize: (?String | Float | Integer target_width) -> void
135
135
 
136
- def initialize_graph_scale: () -> untyped
136
+ # @rbs return: void
137
+ def initialize_graph_scale: () -> void
137
138
 
138
- def initialize_store: () -> untyped
139
+ # @rbs return: void
140
+ def initialize_store: () -> void
139
141
 
140
142
  # Initialize instance variable of attributes
141
143
  #
@@ -143,7 +145,9 @@ module Gruff
143
145
  #
144
146
  # This makes it possible to set defaults in a subclass but still allow
145
147
  # developers to change this values in their program.
146
- def initialize_attributes: () -> untyped
148
+ #
149
+ # @rbs return: void
150
+ def initialize_attributes: () -> void
147
151
 
148
152
  # A hash of names for the individual columns, where the key is the array
149
153
  # index for the column this label represents.
@@ -160,18 +164,22 @@ module Gruff
160
164
  #
161
165
  # g = Gruff::Bar.new
162
166
  # g.labels = ['2005', nil, nil, '2006', nil, nil, '2007', nil, nil, '2008'] # same labels for columns
163
- def labels=: (Hash[Integer, String] | [ String | nil ] labels) -> untyped
167
+ #
168
+ # @rbs return: void
169
+ def labels=: (Hash[Integer, String] | [ String | nil ] labels) -> void
164
170
 
165
171
  # Set a rotation for labels. You can use Default is +0+.
166
172
  # You can use a rotation between +0.0+ and +45.0+, or between +0.0+ and +-45.0+.
167
173
  #
168
174
  # @param rotation [Numeric] the rotation.
169
175
  # @rbs rotation: Float | Integer
170
- def label_rotation=: (Float | Integer rotation) -> untyped
176
+ # @rbs return: void
177
+ def label_rotation=: (Float | Integer rotation) -> void
171
178
 
172
179
  # Height of staggering between labels.
173
180
  # @deprecated
174
- def label_stagger_height=: (untyped _value) -> untyped
181
+ # @rbs return: void
182
+ def label_stagger_height=: (untyped _value) -> void
175
183
 
176
184
  # Set the large title of the graph displayed at the top.
177
185
  # You can draw a multi-line title by putting a line break in the string
@@ -186,37 +194,44 @@ module Gruff
186
194
  #
187
195
  # g = Gruff::Bar.new
188
196
  # g.title = ['The first line of title', 'The second line of title']
189
- def title=: (String | Array[String] title) -> untyped
197
+ #
198
+ # @rbs return: void
199
+ def title=: (String | Array[String] title) -> void
190
200
 
191
201
  # Sets the top, bottom, left and right margins to +margin+.
192
202
  #
193
203
  # @param margin [Numeric] The margin size.
194
204
  # @rbs margin: Float | Integer
195
- def margins=: (Float | Integer margin) -> untyped
205
+ # @rbs return: void
206
+ def margins=: (Float | Integer margin) -> void
196
207
 
197
208
  # Sets the font for graph text to the font at +font_path+.
198
209
  #
199
210
  # @param font_path [String] The path to font.
200
211
  # @rbs font_path: String
201
- def font=: (String font_path) -> untyped
212
+ # @rbs return: void
213
+ def font=: (String font_path) -> void
202
214
 
203
215
  # Same as {#font=} but for the title.
204
216
  #
205
217
  # @param font_path [String] The path to font.
206
218
  # @rbs font_path: String
207
- def title_font=: (String font_path) -> untyped
219
+ # @rbs return: void
220
+ def title_font=: (String font_path) -> void
208
221
 
209
222
  # Set the font size of the large title at the top of the graph. Default is +36+.
210
223
  #
211
224
  # @param value [Numeric] title font size
212
225
  # @rbs value: Float | Integer
213
- def title_font_size=: (Float | Integer value) -> untyped
226
+ # @rbs return: void
227
+ def title_font_size=: (Float | Integer value) -> void
214
228
 
215
229
  # The font size of the labels around the graph. Default is +21+.
216
230
  #
217
231
  # @param value [Numeric] marker font size
218
232
  # @rbs value: Float | Integer
219
- def marker_font_size=: (Float | Integer value) -> untyped
233
+ # @rbs return: void
234
+ def marker_font_size=: (Float | Integer value) -> void
220
235
 
221
236
  # Optionally set the size of the font. Based on an 800x600px graph.
222
237
  # Default is +20+.
@@ -225,25 +240,29 @@ module Gruff
225
240
  #
226
241
  # @param value [Numeric] legend font size
227
242
  # @rbs value: Float | Integer
228
- def legend_font_size=: (Float | Integer value) -> untyped
243
+ # @rbs return: void
244
+ def legend_font_size=: (Float | Integer value) -> void
229
245
 
230
246
  # Set the font size of the no data message. Default is +80+.
231
247
  #
232
248
  # @param value [Numeric] no data font size
233
249
  # @rbs value: Float | Integer
234
- def no_data_font_size=: (Float | Integer value) -> untyped
250
+ # @rbs return: void
251
+ def no_data_font_size=: (Float | Integer value) -> void
235
252
 
236
253
  # Specifies whether to draw the title bolded or not. Default is +true+.
237
254
  #
238
255
  # @param value [Boolean] specifies whether to draw the title bolded or not.
239
256
  # @rbs value: bool
240
- def bold_title=: (bool value) -> untyped
257
+ # @rbs return: void
258
+ def bold_title=: (bool value) -> void
241
259
 
242
260
  # Specifies the text color.
243
261
  #
244
262
  # @param value [String] color
245
263
  # @rbs value: String
246
- def font_color=: (String value) -> untyped
264
+ # @rbs return: void
265
+ def font_color=: (String value) -> void
247
266
 
248
267
  # Add a color to the list of available colors for lines.
249
268
  #
@@ -252,7 +271,8 @@ module Gruff
252
271
  #
253
272
  # @example
254
273
  # add_color('#c0e9d3')
255
- def add_color: (String colorname) -> untyped
274
+ # @rbs return: void
275
+ def add_color: (String colorname) -> void
256
276
 
257
277
  # Replace the entire color list with a new array of colors. Also
258
278
  # aliased as the {#colors=} setter method.
@@ -270,13 +290,15 @@ module Gruff
270
290
  #
271
291
  # @example
272
292
  # replace_colors ['#cc99cc', '#d9e043', '#34d8a2']
273
- def replace_colors: (?Array[String] color_list) -> untyped
293
+ # @rbs return: void
294
+ def replace_colors: (?Array[String] color_list) -> void
274
295
 
275
296
  # Set whether to make background transparent.
276
297
  #
277
298
  # @param value [Boolean] Specify whether to make background transparent.
278
299
  # @rbs value: bool
279
- def transparent_background=: (bool value) -> untyped
300
+ # @rbs return: void
301
+ def transparent_background=: (bool value) -> void
280
302
 
281
303
  # You can set a theme manually. Assign a hash to this method before you
282
304
  # send your data.
@@ -309,25 +331,32 @@ module Gruff
309
331
  #
310
332
  # @param options [Hash] The optional setting for theme
311
333
  # @rbs options: Hash[Symbol, untyped]
312
- def theme=: (Hash[Symbol, untyped] options) -> untyped
334
+ # @rbs return: void
335
+ def theme=: (Hash[Symbol, untyped] options) -> void
313
336
 
314
337
  # Apply Apple's keynote theme.
315
- def theme_keynote: () -> untyped
338
+ # @rbs return: void
339
+ def theme_keynote: () -> void
316
340
 
317
341
  # Apply 37signals theme.
318
- def theme_37signals: () -> untyped
342
+ # @rbs return: void
343
+ def theme_37signals: () -> void
319
344
 
320
345
  # Apply Rails theme.
321
- def theme_rails_keynote: () -> untyped
346
+ # @rbs return: void
347
+ def theme_rails_keynote: () -> void
322
348
 
323
349
  # Apply Odeo theme.
324
- def theme_odeo: () -> untyped
350
+ # @rbs return: void
351
+ def theme_odeo: () -> void
325
352
 
326
353
  # Apply pastel theme.
327
- def theme_pastel: () -> untyped
354
+ # @rbs return: void
355
+ def theme_pastel: () -> void
328
356
 
329
357
  # Apply greyscale theme.
330
- def theme_greyscale: () -> untyped
358
+ # @rbs return: void
359
+ def theme_greyscale: () -> void
331
360
 
332
361
  # Input the data in the graph.
333
362
  #
@@ -352,7 +381,8 @@ module Gruff
352
381
  #
353
382
  # @example
354
383
  # data("Bart S.", [95, 45, 78, 89, 88, 76], '#ffcc00')
355
- def data: (String | Symbol name, ?Array[Float | Integer] | nil data_points, ?String color) -> untyped
384
+ # @rbs return: void
385
+ def data: (String | Symbol name, ?Array[Float | Integer] | nil data_points, ?String color) -> void
356
386
 
357
387
  # You can manually set a minimum value instead of having the values
358
388
  # guessed for you.
@@ -384,7 +414,8 @@ module Gruff
384
414
  #
385
415
  # @example
386
416
  # write('graphs/my_pretty_graph.png')
387
- def write: (?String file_name) -> untyped
417
+ # @rbs return: void
418
+ def write: (?String file_name) -> void
388
419
 
389
420
  # Return a rendered graph image.
390
421
  # This can use RMagick's methods to adjust the image before saving.
@@ -402,6 +433,8 @@ module Gruff
402
433
  # image = g.to_image
403
434
  # image = image.resize(400, 300).quantize(128, Magick::RGBColorspace)
404
435
  # image.write('test.png')
436
+ #
437
+ # @rbs return: untyped
405
438
  def to_image: (?String format) -> untyped
406
439
 
407
440
  # Return the graph as a rendered binary blob.
@@ -416,19 +449,22 @@ module Gruff
416
449
  def to_blob: (?String format) -> String
417
450
 
418
451
  # Draw a graph.
419
- def draw: () -> untyped
452
+ # @rbs return: void
453
+ def draw: () -> void
420
454
 
421
455
  attr_reader renderer: Gruff::Renderer
422
456
 
423
457
  # Perform data manipulation before calculating chart measurements
424
- def setup_data: () -> untyped
458
+ # @rbs return: void
459
+ def setup_data: () -> void
425
460
 
426
461
  # Calculates size of drawable area and generates normalized data.
427
462
  #
428
463
  # * line markers
429
464
  # * legend
430
465
  # * title
431
- def setup_drawing: () -> untyped
466
+ # @rbs return: void
467
+ def setup_drawing: () -> void
432
468
 
433
469
  attr_reader store: Gruff::Store
434
470
 
@@ -443,9 +479,11 @@ module Gruff
443
479
 
444
480
  # Make copy of data with values scaled between 0-100
445
481
  # @rbs return: Array[Gruff::Store::BasicData | Gruff::Store::XYData | Gruff::Store::XYPointsizeData]
482
+ # @rbs return: void
446
483
  def normalize: () -> Array[Gruff::Store::BasicData | Gruff::Store::XYData | Gruff::Store::XYPointsizeData]
447
484
 
448
- def calculate_spread: () -> untyped
485
+ # @rbs return: Float
486
+ def calculate_spread: () -> Float
449
487
 
450
488
  # @rbs return: bool
451
489
  def hide_title?: () -> bool
@@ -459,17 +497,25 @@ module Gruff
459
497
  # @rbs return: bool
460
498
  def hide_bottom_label_area?: () -> bool
461
499
 
462
- def setup_graph_measurements: () -> untyped
500
+ # @rbs return: void
501
+ def setup_graph_measurements: () -> void
463
502
 
464
503
  # Draw the optional labels for the x axis and y axis.
465
- def draw_axis_labels: () -> untyped
504
+ # @rbs return: void
505
+ def draw_axis_labels: () -> void
466
506
 
467
507
  # Draws horizontal background lines and labels
468
- def draw_line_markers: () -> untyped
508
+ # @rbs return: void
509
+ def draw_line_markers: () -> void
469
510
 
470
- def draw_marker_horizontal_line: (untyped y) -> untyped
511
+ # @rbs y: Float | Integer
512
+ # @rbs return: void
513
+ def draw_marker_horizontal_line: (Float | Integer y) -> void
471
514
 
472
- def draw_marker_vertical_line: (untyped x, ?tick_mark_mode: untyped) -> untyped
515
+ # @rbs x: Float | Integer
516
+ # @rbs tick_mark_mode: bool
517
+ # @rbs return: void
518
+ def draw_marker_vertical_line: (Float | Integer x, ?tick_mark_mode: bool) -> void
473
519
 
474
520
  # Return a calculation of center
475
521
  # @rbs size: Float | Integer
@@ -478,10 +524,12 @@ module Gruff
478
524
 
479
525
  # Draws a legend with the names of the datasets matched
480
526
  # to the colors used to draw them.
481
- def draw_legend: () -> untyped
527
+ # @rbs return: void
528
+ def draw_legend: () -> void
482
529
 
483
530
  # Draws a title on the graph.
484
- def draw_title: () -> untyped
531
+ # @rbs return: void
532
+ def draw_title: () -> void
485
533
 
486
534
  # Draws column labels below graph, centered over x
487
535
  #
@@ -489,11 +537,13 @@ module Gruff
489
537
  # @rbs index: Integer
490
538
  # @rbs gravity: untyped
491
539
  # @rbs &: () -> void
492
- def draw_label: (Float | Integer x, Integer index, ?untyped gravity) { () -> void } -> untyped
540
+ # @rbs return: void
541
+ def draw_label: (Float | Integer x, Integer index, ?untyped gravity) { () -> void } -> void
493
542
 
494
543
  # @rbs index: Integer
495
544
  # @rbs yields: () -> void
496
- def draw_unique_label: (Integer index) -> untyped
545
+ # @rbs return: void
546
+ def draw_unique_label: (Integer index) -> void
497
547
 
498
548
  # @rbs width: Float | Integer
499
549
  # @rbs height: Float | Integer
@@ -502,7 +552,8 @@ module Gruff
502
552
  # @rbs text: String | _ToS
503
553
  # @rbs gravity: untyped
504
554
  # @rbs rotation: Float | Integer
505
- def draw_label_at: (Float | Integer width, Float | Integer height, Float | Integer x, Float | Integer y, String | _ToS text, ?gravity: untyped, ?rotation: Float | Integer) -> untyped
555
+ # @rbs return: void
556
+ def draw_label_at: (Float | Integer width, Float | Integer height, Float | Integer x, Float | Integer y, String | _ToS text, ?gravity: untyped, ?rotation: Float | Integer) -> void
506
557
 
507
558
  # Draws the data value over the data point in bar graphs
508
559
  #
@@ -512,15 +563,19 @@ module Gruff
512
563
  # @rbs y_offset: Float | Integer
513
564
  # @rbs data_point: String | _ToS
514
565
  # @rbs gravity: untyped
515
- def draw_value_label: (Float | Integer width, Float | Integer height, Float | Integer x_offset, Float | Integer y_offset, String | _ToS data_point, ?gravity: untyped) -> untyped
566
+ # @rbs return: void
567
+ def draw_value_label: (Float | Integer width, Float | Integer height, Float | Integer x_offset, Float | Integer y_offset, String | _ToS data_point, ?gravity: untyped) -> void
516
568
 
517
569
  # Shows an error message because you have no data.
518
- def draw_no_data: () -> untyped
570
+ # @rbs return: void
571
+ def draw_no_data: () -> void
519
572
 
520
- def draw_graph: () -> untyped
573
+ # @rbs return: void
574
+ def draw_graph: () -> void
521
575
 
522
576
  # Resets everything to defaults (except data).
523
- def reset_themes: () -> untyped
577
+ # @rbs return: void
578
+ def reset_themes: () -> void
524
579
 
525
580
  # @rbs value: Float | Integer
526
581
  # @rbs max_value: Float | Integer
@@ -533,14 +588,17 @@ module Gruff
533
588
  def significant: (Integer i) -> (Integer | Float | BigDecimal)
534
589
 
535
590
  # Sort with largest overall summed value at front of array.
536
- def sort_data: () -> untyped
591
+ # @rbs return: void
592
+ def sort_data: () -> void
537
593
 
538
594
  # Set the color for each data set unless it was given in the data(...) call.
539
- def set_colors: () -> untyped
595
+ # @rbs return: void
596
+ def set_colors: () -> void
540
597
 
541
598
  # Sort with largest overall summed value at front of array so it shows up
542
599
  # correctly in the drawn graph.
543
- def sort_norm_data: () -> untyped
600
+ # @rbs return: void
601
+ def sort_norm_data: () -> void
544
602
 
545
603
  private
546
604
 
@@ -599,11 +657,13 @@ module Gruff
599
657
  # @rbs return: String
600
658
  def y_axis_label: (Float | Integer | BigDecimal value, Float | Integer increment) -> String
601
659
 
602
- # TODO: RBS signature
603
- def calculate_legend_label_widths_for_each_line: (untyped legend_labels, untyped legend_square_width) -> untyped
660
+ # @rbs legend_labels: Array[String]
661
+ # @rbs legend_square_width: Float | Integer
662
+ # @rbs return: Array[Array[Float | Integer]]
663
+ def calculate_legend_label_widths_for_each_line: (Array[String] legend_labels, Float | Integer legend_square_width) -> Array[Array[Float | Integer]]
604
664
 
605
- # TODO: RBS signature
606
- def calculate_legend_height: () -> untyped
665
+ # @rbs return: Float
666
+ def calculate_legend_height: () -> Float
607
667
 
608
668
  # Returns the height of the capital letter 'X' for the current font and
609
669
  # size.
@@ -20,5 +20,6 @@
20
20
  class Gruff::Bezier < Gruff::Base
21
21
  private
22
22
 
23
- def draw_graph: () -> untyped
23
+ # @rbs return: void
24
+ def draw_graph: () -> void
24
25
  end
@@ -23,15 +23,19 @@ class Gruff::Box < Gruff::Base
23
23
  # Default value is +0.8+.
24
24
  #
25
25
  # @rbs space_percent: Float | Integer
26
- def spacing_factor=: (Float | Integer space_percent) -> untyped
26
+ # @rbs return: void
27
+ def spacing_factor=: (Float | Integer space_percent) -> void
27
28
 
28
29
  private
29
30
 
30
- def initialize_attributes: () -> untyped
31
+ # @rbs return: void
32
+ def initialize_attributes: () -> void
31
33
 
32
- def draw_graph: () -> untyped
34
+ # @rbs return: void
35
+ def draw_graph: () -> void
33
36
 
34
- def normalized_boxes: () -> untyped
37
+ # @rbs return: Array[Gruff::Box::BoxData]
38
+ def normalized_boxes: () -> Array[Gruff::Box::BoxData]
35
39
 
36
40
  # @rbs return: Integer
37
41
  def column_count: () -> Integer
@@ -47,7 +51,11 @@ class Gruff::Box < Gruff::Base
47
51
 
48
52
  attr_accessor color: String
49
53
 
50
- def initialize: (untyped label, untyped points, untyped color) -> untyped
54
+ # @rbs label: String
55
+ # @rbs points: Array[Float | Integer]
56
+ # @rbs color: String
57
+ # @rbs return: void
58
+ def initialize: (String label, Array[Float | Integer] points, String color) -> void
51
59
 
52
60
  # @rbs return: Float | Integer
53
61
  def min: () -> (Float | Integer)
@@ -57,13 +57,17 @@ class Gruff::Bubble < Gruff::Scatter
57
57
  # @rbs y_data_points: Array[nil | Float | Integer] | nil
58
58
  # @rbs point_sizes: Array[nil | Float | Integer] | nil
59
59
  # @rbs color: String
60
- def data: (String | Symbol name, ?Array[nil | Float | Integer] | nil x_data_points, ?Array[nil | Float | Integer] | nil y_data_points, ?Array[nil | Float | Integer] | nil point_sizes, ?String color) -> untyped
60
+ # @rbs return: void
61
+ def data: (String | Symbol name, ?Array[nil | Float | Integer] | nil x_data_points, ?Array[nil | Float | Integer] | nil y_data_points, ?Array[nil | Float | Integer] | nil point_sizes, ?String color) -> void
61
62
 
62
63
  private
63
64
 
64
- def initialize_store: () -> untyped
65
+ # @rbs return: void
66
+ def initialize_store: () -> void
65
67
 
66
- def initialize_attributes: () -> untyped
68
+ # @rbs return: void
69
+ def initialize_attributes: () -> void
67
70
 
68
- def draw_graph: () -> untyped
71
+ # @rbs return: void
72
+ def draw_graph: () -> void
69
73
  end
@@ -15,16 +15,20 @@ class Gruff::Bullet < Gruff::Base
15
15
  # @rbs return: void
16
16
  def initialize: (?String | Float | Integer target_width) -> void
17
17
 
18
- def initialize_attributes: () -> untyped
18
+ # @rbs return: void
19
+ def initialize_attributes: () -> void
19
20
 
20
21
  # @rbs value: Float | Integer
21
22
  # @rbs maximum_value: Float | Integer
22
23
  # @rbs options: Hash[Symbol, Float | Integer]
23
- def data: (Float | Integer value, Float | Integer maximum_value, ?Hash[Symbol, Float | Integer] options) -> untyped
24
+ # @rbs return: void
25
+ def data: (Float | Integer value, Float | Integer maximum_value, ?Hash[Symbol, Float | Integer] options) -> void
24
26
 
25
- def draw: () -> untyped
27
+ # @rbs return: void
28
+ def draw: () -> void
26
29
 
27
30
  private
28
31
 
29
- def draw_title: () -> untyped
32
+ # @rbs return: void
33
+ def draw_title: () -> void
30
34
  end