gruff 0.29.0-java → 0.31.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 +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/ci.yml +19 -26
- data/.github/workflows/release.yml +24 -0
- data/.rubocop.yml +15 -0
- data/.rubocop_todo.yml +11 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile +2 -0
- data/gruff.gemspec +1 -0
- data/init.rb +1 -0
- data/lib/gruff/accumulator_bar.rb +1 -0
- data/lib/gruff/area.rb +2 -0
- data/lib/gruff/bar.rb +5 -0
- data/lib/gruff/base.rb +59 -2
- data/lib/gruff/bezier.rb +1 -0
- data/lib/gruff/box.rb +8 -0
- data/lib/gruff/bubble.rb +4 -0
- data/lib/gruff/bullet.rb +4 -0
- data/lib/gruff/candlestick.rb +20 -8
- data/lib/gruff/dot.rb +4 -0
- data/lib/gruff/font.rb +2 -0
- data/lib/gruff/helper/bar_value_label.rb +2 -0
- data/lib/gruff/helper/stacked_mixin.rb +1 -0
- data/lib/gruff/histogram.rb +3 -0
- data/lib/gruff/line.rb +28 -0
- data/lib/gruff/mini/bar.rb +4 -0
- data/lib/gruff/mini/legend.rb +15 -3
- data/lib/gruff/mini/pie.rb +4 -0
- data/lib/gruff/mini/side_bar.rb +4 -0
- data/lib/gruff/net.rb +7 -1
- data/lib/gruff/patch/rmagick.rb +11 -0
- data/lib/gruff/patch/string.rb +3 -0
- data/lib/gruff/pie.rb +8 -0
- data/lib/gruff/renderer/bezier.rb +1 -0
- data/lib/gruff/renderer/circle.rb +1 -0
- data/lib/gruff/renderer/dash_line.rb +1 -0
- data/lib/gruff/renderer/dot.rb +13 -0
- data/lib/gruff/renderer/ellipse.rb +1 -0
- data/lib/gruff/renderer/line.rb +7 -0
- data/lib/gruff/renderer/polygon.rb +2 -0
- data/lib/gruff/renderer/polyline.rb +1 -0
- data/lib/gruff/renderer/rectangle.rb +1 -0
- data/lib/gruff/renderer/renderer.rb +26 -3
- data/lib/gruff/renderer/text.rb +5 -1
- data/lib/gruff/scatter.rb +17 -0
- data/lib/gruff/side_bar.rb +9 -0
- data/lib/gruff/side_stacked_bar.rb +3 -0
- data/lib/gruff/spider.rb +26 -2
- data/lib/gruff/stacked_area.rb +5 -0
- data/lib/gruff/stacked_bar.rb +5 -0
- data/lib/gruff/store/basic_data.rb +4 -0
- data/lib/gruff/store/store.rb +8 -0
- data/lib/gruff/store/xy_data.rb +2 -0
- data/lib/gruff/store/xy_pointsizes_data.rb +2 -0
- data/lib/gruff/version.rb +1 -1
- data/lib/gruff.rb +2 -0
- data/sig/generated/gruff/accumulator_bar.rbs +2 -1
- data/sig/generated/gruff/area.rbs +4 -2
- data/sig/generated/gruff/bar.rbs +10 -5
- data/sig/generated/gruff/base.rbs +113 -53
- data/sig/generated/gruff/bezier.rbs +2 -1
- data/sig/generated/gruff/box.rbs +13 -5
- data/sig/generated/gruff/bubble.rbs +8 -4
- data/sig/generated/gruff/bullet.rbs +8 -4
- data/sig/generated/gruff/candlestick.rbs +26 -14
- data/sig/generated/gruff/dot.rbs +8 -4
- data/sig/generated/gruff/font.rbs +3 -1
- data/sig/generated/gruff/helper/bar_value_label.rbs +4 -2
- data/sig/generated/gruff/helper/stacked_mixin.rbs +2 -1
- data/sig/generated/gruff/histogram.rbs +6 -3
- data/sig/generated/gruff/line.rbs +44 -16
- data/sig/generated/gruff/mini/bar.rbs +27 -0
- data/sig/generated/gruff/mini/legend.rbs +36 -0
- data/sig/generated/gruff/mini/pie.rbs +26 -0
- data/sig/generated/gruff/mini/side_bar.rbs +34 -0
- data/sig/generated/gruff/net.rbs +12 -6
- data/sig/generated/gruff/patch/rmagick.rbs +25 -0
- data/sig/generated/gruff/patch/string.rbs +11 -0
- data/sig/generated/gruff/pie.rbs +15 -7
- data/sig/generated/gruff/renderer/bezier.rbs +2 -1
- data/sig/generated/gruff/renderer/circle.rbs +2 -1
- data/sig/generated/gruff/renderer/dash_line.rbs +2 -1
- data/sig/generated/gruff/renderer/dot.rbs +17 -4
- data/sig/generated/gruff/renderer/ellipse.rbs +2 -1
- data/sig/generated/gruff/renderer/line.rbs +9 -2
- data/sig/generated/gruff/renderer/polygon.rbs +17 -0
- data/sig/generated/gruff/renderer/polyline.rbs +2 -1
- data/sig/generated/gruff/renderer/rectangle.rbs +2 -1
- data/sig/generated/gruff/renderer/renderer.rbs +31 -8
- data/sig/generated/gruff/renderer/text.rbs +7 -3
- data/sig/generated/gruff/scatter.rbs +30 -13
- data/sig/generated/gruff/side_bar.rbs +15 -6
- data/sig/generated/gruff/side_stacked_bar.rbs +6 -3
- data/sig/generated/gruff/spider.rbs +35 -11
- data/sig/generated/gruff/stacked_area.rbs +9 -4
- data/sig/generated/gruff/stacked_bar.rbs +10 -5
- data/sig/generated/gruff/store/basic_data.rbs +8 -4
- data/sig/generated/gruff/store/store.rbs +12 -4
- data/sig/generated/gruff/store/xy_data.rbs +4 -2
- data/sig/generated/gruff/store/xy_pointsizes_data.rbs +4 -2
- data/sig/generated/gruff.rbs +3 -1
- metadata +13 -3
|
@@ -133,9 +133,11 @@ module Gruff
|
|
|
133
133
|
# @rbs return: void
|
|
134
134
|
def initialize: (?String | Float | Integer target_width) -> void
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
# @rbs return: void
|
|
137
|
+
def initialize_graph_scale: () -> void
|
|
137
138
|
|
|
138
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
334
|
+
# @rbs return: void
|
|
335
|
+
def theme=: (Hash[Symbol, untyped] options) -> void
|
|
313
336
|
|
|
314
337
|
# Apply Apple's keynote theme.
|
|
315
|
-
|
|
338
|
+
# @rbs return: void
|
|
339
|
+
def theme_keynote: () -> void
|
|
316
340
|
|
|
317
341
|
# Apply 37signals theme.
|
|
318
|
-
|
|
342
|
+
# @rbs return: void
|
|
343
|
+
def theme_37signals: () -> void
|
|
319
344
|
|
|
320
345
|
# Apply Rails theme.
|
|
321
|
-
|
|
346
|
+
# @rbs return: void
|
|
347
|
+
def theme_rails_keynote: () -> void
|
|
322
348
|
|
|
323
349
|
# Apply Odeo theme.
|
|
324
|
-
|
|
350
|
+
# @rbs return: void
|
|
351
|
+
def theme_odeo: () -> void
|
|
325
352
|
|
|
326
353
|
# Apply pastel theme.
|
|
327
|
-
|
|
354
|
+
# @rbs return: void
|
|
355
|
+
def theme_pastel: () -> void
|
|
328
356
|
|
|
329
357
|
# Apply greyscale theme.
|
|
330
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
504
|
+
# @rbs return: void
|
|
505
|
+
def draw_axis_labels: () -> void
|
|
466
506
|
|
|
467
507
|
# Draws horizontal background lines and labels
|
|
468
|
-
|
|
508
|
+
# @rbs return: void
|
|
509
|
+
def draw_line_markers: () -> void
|
|
469
510
|
|
|
470
|
-
|
|
511
|
+
# @rbs y: Float | Integer
|
|
512
|
+
# @rbs return: void
|
|
513
|
+
def draw_marker_horizontal_line: (Float | Integer y) -> void
|
|
471
514
|
|
|
472
|
-
|
|
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
|
-
|
|
527
|
+
# @rbs return: void
|
|
528
|
+
def draw_legend: () -> void
|
|
482
529
|
|
|
483
530
|
# Draws a title on the graph.
|
|
484
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
570
|
+
# @rbs return: void
|
|
571
|
+
def draw_no_data: () -> void
|
|
519
572
|
|
|
520
|
-
|
|
573
|
+
# @rbs return: void
|
|
574
|
+
def draw_graph: () -> void
|
|
521
575
|
|
|
522
576
|
# Resets everything to defaults (except data).
|
|
523
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
#
|
|
603
|
-
|
|
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
|
-
#
|
|
606
|
-
def calculate_legend_height: () ->
|
|
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.
|
data/sig/generated/gruff/box.rbs
CHANGED
|
@@ -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
|
-
|
|
26
|
+
# @rbs return: void
|
|
27
|
+
def spacing_factor=: (Float | Integer space_percent) -> void
|
|
27
28
|
|
|
28
29
|
private
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
# @rbs return: void
|
|
32
|
+
def initialize_attributes: () -> void
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
# @rbs return: void
|
|
35
|
+
def draw_graph: () -> void
|
|
33
36
|
|
|
34
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
65
|
+
# @rbs return: void
|
|
66
|
+
def initialize_store: () -> void
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
# @rbs return: void
|
|
69
|
+
def initialize_attributes: () -> void
|
|
67
70
|
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
|
|
24
|
+
# @rbs return: void
|
|
25
|
+
def data: (Float | Integer value, Float | Integer maximum_value, ?Hash[Symbol, Float | Integer] options) -> void
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
# @rbs return: void
|
|
28
|
+
def draw: () -> void
|
|
26
29
|
|
|
27
30
|
private
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
# @rbs return: void
|
|
33
|
+
def draw_title: () -> void
|
|
30
34
|
end
|
|
@@ -33,47 +33,59 @@ class Gruff::Candlestick < Gruff::Base
|
|
|
33
33
|
# Default value is +0.9+.
|
|
34
34
|
#
|
|
35
35
|
# @rbs space_percent: Float | Integer
|
|
36
|
-
|
|
36
|
+
# @rbs return: void
|
|
37
|
+
def spacing_factor=: (Float | Integer space_percent) -> void
|
|
37
38
|
|
|
38
39
|
# The sort feature is not supported in this graph.
|
|
39
|
-
|
|
40
|
+
# @rbs return: void
|
|
41
|
+
def sort=: (untyped _value) -> void
|
|
40
42
|
|
|
41
43
|
# The sort feature is not supported in this graph.
|
|
42
|
-
|
|
44
|
+
# @rbs return: void
|
|
45
|
+
def sorted_drawing=: (untyped _value) -> void
|
|
43
46
|
|
|
44
47
|
# @rbs low: Float | Integer
|
|
45
48
|
# @rbs high: Float | Integer
|
|
46
49
|
# @rbs open: Float | Integer
|
|
47
50
|
# @rbs close: Float | Integer
|
|
48
|
-
|
|
51
|
+
# @rbs return: void
|
|
52
|
+
def data: (low: Float | Integer, high: Float | Integer, open: Float | Integer, close: Float | Integer) -> void
|
|
49
53
|
|
|
50
54
|
private
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
# @rbs return: void
|
|
57
|
+
def initialize_attributes: () -> void
|
|
53
58
|
|
|
54
|
-
|
|
59
|
+
# @rbs return: void
|
|
60
|
+
def draw_graph: () -> void
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
# @rbs return: Array[Gruff::Candlestick::CandlestickData]
|
|
63
|
+
def normalized_candlesticks: () -> Array[Gruff::Candlestick::CandlestickData]
|
|
57
64
|
|
|
58
65
|
# @rbs return: Integer
|
|
59
66
|
def column_count: () -> Integer
|
|
60
67
|
|
|
61
|
-
# @rbs return:
|
|
62
|
-
def calculate_spacing: () ->
|
|
68
|
+
# @rbs return: Float
|
|
69
|
+
def calculate_spacing: () -> Float
|
|
63
70
|
|
|
64
71
|
# @rbs return: bool
|
|
65
72
|
def show_marker_vertical_line?: () -> bool
|
|
66
73
|
|
|
67
74
|
# @private
|
|
68
75
|
class CandlestickData
|
|
69
|
-
attr_accessor low:
|
|
76
|
+
attr_accessor low: Float | Integer
|
|
70
77
|
|
|
71
|
-
attr_accessor high:
|
|
78
|
+
attr_accessor high: Float | Integer
|
|
72
79
|
|
|
73
|
-
attr_accessor open:
|
|
80
|
+
attr_accessor open: Float | Integer
|
|
74
81
|
|
|
75
|
-
attr_accessor close:
|
|
82
|
+
attr_accessor close: Float | Integer
|
|
76
83
|
|
|
77
|
-
|
|
84
|
+
# @rbs low: Float | Integer
|
|
85
|
+
# @rbs high: Float | Integer
|
|
86
|
+
# @rbs open: Float | Integer
|
|
87
|
+
# @rbs close: Float | Integer
|
|
88
|
+
# @rbs return: void
|
|
89
|
+
def initialize: (Float | Integer low, Float | Integer high, Float | Integer open, Float | Integer close) -> void
|
|
78
90
|
end
|
|
79
91
|
end
|
data/sig/generated/gruff/dot.rbs
CHANGED
|
@@ -22,7 +22,8 @@ class Gruff::Dot < Gruff::Base
|
|
|
22
22
|
|
|
23
23
|
private
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
# @rbs return: void
|
|
26
|
+
def initialize_attributes: () -> void
|
|
26
27
|
|
|
27
28
|
# @rbs return: bool
|
|
28
29
|
def hide_labels?: () -> bool
|
|
@@ -33,12 +34,15 @@ class Gruff::Dot < Gruff::Base
|
|
|
33
34
|
# @rbs return: bool
|
|
34
35
|
def hide_bottom_label_area?: () -> bool
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
# @rbs return: void
|
|
38
|
+
def draw_graph: () -> void
|
|
37
39
|
|
|
38
40
|
# Instead of base class version, draws vertical background lines and label
|
|
39
|
-
|
|
41
|
+
# @rbs return: void
|
|
42
|
+
def draw_line_markers: () -> void
|
|
40
43
|
|
|
41
44
|
# @rbs y_offset: Float | Integer
|
|
42
45
|
# @rbs index: Integer
|
|
43
|
-
|
|
46
|
+
# @rbs return: void
|
|
47
|
+
def draw_label: (Float | Integer y_offset, Integer index) -> void
|
|
44
48
|
end
|
|
@@ -22,11 +22,13 @@ class Gruff::Font
|
|
|
22
22
|
# @rbs size: Float | Integer
|
|
23
23
|
# @rbs bold: bool
|
|
24
24
|
# @rbs color: String
|
|
25
|
-
|
|
25
|
+
# @rbs return: void
|
|
26
|
+
def initialize: (?path: String | nil, ?size: Float | Integer, ?bold: bool, ?color: String) -> void
|
|
26
27
|
|
|
27
28
|
# Get font weight.
|
|
28
29
|
# @return [Magick::WeightType] font weight
|
|
29
30
|
# TODO: type annotation of return value
|
|
31
|
+
# @rbs return: untyped
|
|
30
32
|
def weight: () -> untyped
|
|
31
33
|
|
|
32
34
|
# @private
|
|
@@ -28,7 +28,8 @@ module Gruff::BarValueLabel
|
|
|
28
28
|
# @rbs format: nil | String | Proc
|
|
29
29
|
# @rbs proc_text_metrics: Proc
|
|
30
30
|
# @rbs yields: (Float | Integer, Float | Integer, String, Float, Float) -> void
|
|
31
|
-
|
|
31
|
+
# @rbs return: void
|
|
32
|
+
def prepare_rendering: (nil | String | Proc format, Proc proc_text_metrics) -> void
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
# @private
|
|
@@ -36,6 +37,7 @@ module Gruff::BarValueLabel
|
|
|
36
37
|
# @rbs format: nil | String | Proc
|
|
37
38
|
# @rbs proc_text_metrics: Proc
|
|
38
39
|
# @rbs yields: (Float | Integer, Float | Integer, String, Float, Float) -> void
|
|
39
|
-
|
|
40
|
+
# @rbs return: void
|
|
41
|
+
def prepare_rendering: (nil | String | Proc format, Proc proc_text_metrics) -> void
|
|
40
42
|
end
|
|
41
43
|
end
|
|
@@ -5,7 +5,8 @@ module Gruff::Base::StackedMixin
|
|
|
5
5
|
# Used by StackedBar and child classes.
|
|
6
6
|
#
|
|
7
7
|
# tsal: moved from Base 03 FEB 2007
|
|
8
|
-
|
|
8
|
+
# @rbs return: void
|
|
9
|
+
def calculate_maximum_by_stack: () -> void
|
|
9
10
|
|
|
10
11
|
# @rbs return: Array[Array[Gruff::Base::StackedMixin::BarData]]
|
|
11
12
|
def normalized_stacked_bars: () -> Array[Array[Gruff::Base::StackedMixin::BarData]]
|
|
@@ -27,13 +27,16 @@ class Gruff::Histogram < Gruff::Bar
|
|
|
27
27
|
# @rbs name: String | Symbol
|
|
28
28
|
# @rbs data_points: Array[Float | Integer] | nil
|
|
29
29
|
# @rbs color: String
|
|
30
|
-
|
|
30
|
+
# @rbs return: void
|
|
31
|
+
def data: (String | Symbol name, ?Array[Float | Integer] | nil data_points, ?String color) -> void
|
|
31
32
|
|
|
32
33
|
private
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
# @rbs return: void
|
|
36
|
+
def initialize_attributes: () -> void
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
# @rbs return: void
|
|
39
|
+
def setup_data: () -> void
|
|
37
40
|
|
|
38
41
|
# @private
|
|
39
42
|
# @rbs inherits Array[Float | Integer | nil]
|