gruff 0.30.0 → 0.32.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 +3 -3
- data/.github/workflows/release.yml +24 -0
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +0 -6
- data/CHANGELOG.md +21 -0
- data/lib/gruff/accumulator_bar.rb +1 -0
- data/lib/gruff/area.rb +2 -0
- data/lib/gruff/bar.rb +5 -5
- data/lib/gruff/base.rb +144 -90
- 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 +17 -5
- data/lib/gruff/dot.rb +4 -5
- 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 +3 -0
- data/lib/gruff/mini/legend.rb +13 -2
- data/lib/gruff/mini/pie.rb +3 -0
- data/lib/gruff/mini/side_bar.rb +3 -0
- data/lib/gruff/net.rb +6 -0
- data/lib/gruff/patch/rmagick.rb +10 -0
- data/lib/gruff/patch/string.rb +2 -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 +1 -0
- data/lib/gruff/renderer/polyline.rb +1 -0
- data/lib/gruff/renderer/rectangle.rb +15 -5
- 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 -5
- 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 -5
- 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 -8
- data/sig/generated/gruff/base.rbs +129 -64
- 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 +24 -12
- data/sig/generated/gruff/dot.rbs +8 -7
- 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 +6 -3
- data/sig/generated/gruff/mini/legend.rbs +20 -10
- data/sig/generated/gruff/mini/pie.rbs +6 -3
- data/sig/generated/gruff/mini/side_bar.rbs +6 -3
- data/sig/generated/gruff/net.rbs +12 -6
- data/sig/generated/gruff/patch/rmagick.rbs +12 -2
- data/sig/generated/gruff/patch/string.rbs +3 -1
- 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 +2 -1
- data/sig/generated/gruff/renderer/polyline.rbs +2 -1
- data/sig/generated/gruff/renderer/rectangle.rbs +4 -2
- 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 -9
- 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 -8
- 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 +3 -2
data/sig/generated/gruff/bar.rbs
CHANGED
|
@@ -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
|
-
|
|
48
|
+
# @rbs return: void
|
|
49
|
+
def spacing_factor=: (Float | Integer space_percent) -> void
|
|
49
50
|
|
|
50
51
|
private
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
# @rbs return: void
|
|
54
|
+
def initialize_attributes: () -> void
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
# @rbs return: void
|
|
57
|
+
def setup_drawing: () -> void
|
|
55
58
|
|
|
56
59
|
# @rbs return: bool
|
|
57
60
|
def hide_labels?: () -> bool
|
|
@@ -59,12 +62,11 @@ class Gruff::Bar < Gruff::Base
|
|
|
59
62
|
# @rbs return: bool
|
|
60
63
|
def hide_left_label_area?: () -> bool
|
|
61
64
|
|
|
62
|
-
# @rbs return:
|
|
63
|
-
def
|
|
64
|
-
|
|
65
|
-
def setup_graph_measurements: () -> untyped
|
|
65
|
+
# @rbs return: void
|
|
66
|
+
def setup_graph_measurements: () -> void
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
# @rbs return: void
|
|
69
|
+
def draw_graph: () -> void
|
|
68
70
|
|
|
69
71
|
# @rbs return: Float | Integer
|
|
70
72
|
def calculate_spacing: () -> (Float | Integer)
|
|
@@ -45,9 +45,6 @@ module Gruff
|
|
|
45
45
|
# Blank space below the title. Default is +20+.
|
|
46
46
|
attr_writer title_margin: Float | Integer
|
|
47
47
|
|
|
48
|
-
# Blank space below the legend. Default is +20+.
|
|
49
|
-
attr_writer legend_margin: Float | Integer
|
|
50
|
-
|
|
51
48
|
# Truncates labels if longer than max specified.
|
|
52
49
|
attr_writer label_max_size: Float | Integer
|
|
53
50
|
|
|
@@ -112,13 +109,16 @@ module Gruff
|
|
|
112
109
|
# first. This does not affect the legend. Default is +false+.
|
|
113
110
|
attr_writer sorted_drawing: bool
|
|
114
111
|
|
|
115
|
-
#
|
|
116
|
-
attr_writer
|
|
112
|
+
# Blank space below the legend. Default is +20+.
|
|
113
|
+
attr_writer legend_margin: Float | Integer
|
|
114
|
+
|
|
115
|
+
# Set the vertical spacing between individual legend items. Default is +5.0+.
|
|
116
|
+
attr_writer legend_spacing: Float | Integer
|
|
117
117
|
|
|
118
|
-
#
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
#
|
|
118
|
+
# Set the inner padding between the legend frame and its contents. Default is +7.0+.
|
|
119
|
+
attr_writer legend_padding: Float | Integer
|
|
120
|
+
|
|
121
|
+
# Optionally set the size of the colored box by each item in the legend. Default is +20.0+.
|
|
122
122
|
attr_writer legend_box_size: Float | Integer
|
|
123
123
|
|
|
124
124
|
# If one numerical argument is given, the graph is drawn at 4/3 ratio
|
|
@@ -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,35 @@ 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
|
|
178
|
+
|
|
179
|
+
# Set the corner position of the floating legend. Accepts +:top_right+ (default),
|
|
180
|
+
# +:top_left+, +:bottom_right+, or +:bottom_left+.
|
|
181
|
+
#
|
|
182
|
+
# @param position [Symbol] the position.
|
|
183
|
+
# @rbs position: Symbol
|
|
184
|
+
# @rbs return: void
|
|
185
|
+
def legend_position=: (Symbol position) -> void
|
|
171
186
|
|
|
172
187
|
# Height of staggering between labels.
|
|
173
188
|
# @deprecated
|
|
174
|
-
|
|
189
|
+
# @rbs return: void
|
|
190
|
+
def label_stagger_height=: (untyped _value) -> void
|
|
191
|
+
|
|
192
|
+
# Set the legend position to the bottom of the graph.
|
|
193
|
+
# @deprecated
|
|
194
|
+
# @rbs return: void
|
|
195
|
+
def legend_at_bottom=: (untyped _value) -> void
|
|
175
196
|
|
|
176
197
|
# Set the large title of the graph displayed at the top.
|
|
177
198
|
# You can draw a multi-line title by putting a line break in the string
|
|
@@ -186,37 +207,44 @@ module Gruff
|
|
|
186
207
|
#
|
|
187
208
|
# g = Gruff::Bar.new
|
|
188
209
|
# g.title = ['The first line of title', 'The second line of title']
|
|
189
|
-
|
|
210
|
+
#
|
|
211
|
+
# @rbs return: void
|
|
212
|
+
def title=: (String | Array[String] title) -> void
|
|
190
213
|
|
|
191
214
|
# Sets the top, bottom, left and right margins to +margin+.
|
|
192
215
|
#
|
|
193
216
|
# @param margin [Numeric] The margin size.
|
|
194
217
|
# @rbs margin: Float | Integer
|
|
195
|
-
|
|
218
|
+
# @rbs return: void
|
|
219
|
+
def margins=: (Float | Integer margin) -> void
|
|
196
220
|
|
|
197
221
|
# Sets the font for graph text to the font at +font_path+.
|
|
198
222
|
#
|
|
199
223
|
# @param font_path [String] The path to font.
|
|
200
224
|
# @rbs font_path: String
|
|
201
|
-
|
|
225
|
+
# @rbs return: void
|
|
226
|
+
def font=: (String font_path) -> void
|
|
202
227
|
|
|
203
228
|
# Same as {#font=} but for the title.
|
|
204
229
|
#
|
|
205
230
|
# @param font_path [String] The path to font.
|
|
206
231
|
# @rbs font_path: String
|
|
207
|
-
|
|
232
|
+
# @rbs return: void
|
|
233
|
+
def title_font=: (String font_path) -> void
|
|
208
234
|
|
|
209
235
|
# Set the font size of the large title at the top of the graph. Default is +36+.
|
|
210
236
|
#
|
|
211
237
|
# @param value [Numeric] title font size
|
|
212
238
|
# @rbs value: Float | Integer
|
|
213
|
-
|
|
239
|
+
# @rbs return: void
|
|
240
|
+
def title_font_size=: (Float | Integer value) -> void
|
|
214
241
|
|
|
215
242
|
# The font size of the labels around the graph. Default is +21+.
|
|
216
243
|
#
|
|
217
244
|
# @param value [Numeric] marker font size
|
|
218
245
|
# @rbs value: Float | Integer
|
|
219
|
-
|
|
246
|
+
# @rbs return: void
|
|
247
|
+
def marker_font_size=: (Float | Integer value) -> void
|
|
220
248
|
|
|
221
249
|
# Optionally set the size of the font. Based on an 800x600px graph.
|
|
222
250
|
# Default is +20+.
|
|
@@ -225,25 +253,29 @@ module Gruff
|
|
|
225
253
|
#
|
|
226
254
|
# @param value [Numeric] legend font size
|
|
227
255
|
# @rbs value: Float | Integer
|
|
228
|
-
|
|
256
|
+
# @rbs return: void
|
|
257
|
+
def legend_font_size=: (Float | Integer value) -> void
|
|
229
258
|
|
|
230
259
|
# Set the font size of the no data message. Default is +80+.
|
|
231
260
|
#
|
|
232
261
|
# @param value [Numeric] no data font size
|
|
233
262
|
# @rbs value: Float | Integer
|
|
234
|
-
|
|
263
|
+
# @rbs return: void
|
|
264
|
+
def no_data_font_size=: (Float | Integer value) -> void
|
|
235
265
|
|
|
236
266
|
# Specifies whether to draw the title bolded or not. Default is +true+.
|
|
237
267
|
#
|
|
238
268
|
# @param value [Boolean] specifies whether to draw the title bolded or not.
|
|
239
269
|
# @rbs value: bool
|
|
240
|
-
|
|
270
|
+
# @rbs return: void
|
|
271
|
+
def bold_title=: (bool value) -> void
|
|
241
272
|
|
|
242
273
|
# Specifies the text color.
|
|
243
274
|
#
|
|
244
275
|
# @param value [String] color
|
|
245
276
|
# @rbs value: String
|
|
246
|
-
|
|
277
|
+
# @rbs return: void
|
|
278
|
+
def font_color=: (String value) -> void
|
|
247
279
|
|
|
248
280
|
# Add a color to the list of available colors for lines.
|
|
249
281
|
#
|
|
@@ -252,7 +284,8 @@ module Gruff
|
|
|
252
284
|
#
|
|
253
285
|
# @example
|
|
254
286
|
# add_color('#c0e9d3')
|
|
255
|
-
|
|
287
|
+
# @rbs return: void
|
|
288
|
+
def add_color: (String colorname) -> void
|
|
256
289
|
|
|
257
290
|
# Replace the entire color list with a new array of colors. Also
|
|
258
291
|
# aliased as the {#colors=} setter method.
|
|
@@ -270,13 +303,15 @@ module Gruff
|
|
|
270
303
|
#
|
|
271
304
|
# @example
|
|
272
305
|
# replace_colors ['#cc99cc', '#d9e043', '#34d8a2']
|
|
273
|
-
|
|
306
|
+
# @rbs return: void
|
|
307
|
+
def replace_colors: (?Array[String] color_list) -> void
|
|
274
308
|
|
|
275
309
|
# Set whether to make background transparent.
|
|
276
310
|
#
|
|
277
311
|
# @param value [Boolean] Specify whether to make background transparent.
|
|
278
312
|
# @rbs value: bool
|
|
279
|
-
|
|
313
|
+
# @rbs return: void
|
|
314
|
+
def transparent_background=: (bool value) -> void
|
|
280
315
|
|
|
281
316
|
# You can set a theme manually. Assign a hash to this method before you
|
|
282
317
|
# send your data.
|
|
@@ -309,25 +344,32 @@ module Gruff
|
|
|
309
344
|
#
|
|
310
345
|
# @param options [Hash] The optional setting for theme
|
|
311
346
|
# @rbs options: Hash[Symbol, untyped]
|
|
312
|
-
|
|
347
|
+
# @rbs return: void
|
|
348
|
+
def theme=: (Hash[Symbol, untyped] options) -> void
|
|
313
349
|
|
|
314
350
|
# Apply Apple's keynote theme.
|
|
315
|
-
|
|
351
|
+
# @rbs return: void
|
|
352
|
+
def theme_keynote: () -> void
|
|
316
353
|
|
|
317
354
|
# Apply 37signals theme.
|
|
318
|
-
|
|
355
|
+
# @rbs return: void
|
|
356
|
+
def theme_37signals: () -> void
|
|
319
357
|
|
|
320
358
|
# Apply Rails theme.
|
|
321
|
-
|
|
359
|
+
# @rbs return: void
|
|
360
|
+
def theme_rails_keynote: () -> void
|
|
322
361
|
|
|
323
362
|
# Apply Odeo theme.
|
|
324
|
-
|
|
363
|
+
# @rbs return: void
|
|
364
|
+
def theme_odeo: () -> void
|
|
325
365
|
|
|
326
366
|
# Apply pastel theme.
|
|
327
|
-
|
|
367
|
+
# @rbs return: void
|
|
368
|
+
def theme_pastel: () -> void
|
|
328
369
|
|
|
329
370
|
# Apply greyscale theme.
|
|
330
|
-
|
|
371
|
+
# @rbs return: void
|
|
372
|
+
def theme_greyscale: () -> void
|
|
331
373
|
|
|
332
374
|
# Input the data in the graph.
|
|
333
375
|
#
|
|
@@ -352,7 +394,8 @@ module Gruff
|
|
|
352
394
|
#
|
|
353
395
|
# @example
|
|
354
396
|
# data("Bart S.", [95, 45, 78, 89, 88, 76], '#ffcc00')
|
|
355
|
-
|
|
397
|
+
# @rbs return: void
|
|
398
|
+
def data: (String | Symbol name, ?Array[Float | Integer] | nil data_points, ?String color) -> void
|
|
356
399
|
|
|
357
400
|
# You can manually set a minimum value instead of having the values
|
|
358
401
|
# guessed for you.
|
|
@@ -384,7 +427,8 @@ module Gruff
|
|
|
384
427
|
#
|
|
385
428
|
# @example
|
|
386
429
|
# write('graphs/my_pretty_graph.png')
|
|
387
|
-
|
|
430
|
+
# @rbs return: void
|
|
431
|
+
def write: (?String file_name) -> void
|
|
388
432
|
|
|
389
433
|
# Return a rendered graph image.
|
|
390
434
|
# This can use RMagick's methods to adjust the image before saving.
|
|
@@ -402,6 +446,8 @@ module Gruff
|
|
|
402
446
|
# image = g.to_image
|
|
403
447
|
# image = image.resize(400, 300).quantize(128, Magick::RGBColorspace)
|
|
404
448
|
# image.write('test.png')
|
|
449
|
+
#
|
|
450
|
+
# @rbs return: untyped
|
|
405
451
|
def to_image: (?String format) -> untyped
|
|
406
452
|
|
|
407
453
|
# Return the graph as a rendered binary blob.
|
|
@@ -416,19 +462,22 @@ module Gruff
|
|
|
416
462
|
def to_blob: (?String format) -> String
|
|
417
463
|
|
|
418
464
|
# Draw a graph.
|
|
419
|
-
|
|
465
|
+
# @rbs return: void
|
|
466
|
+
def draw: () -> void
|
|
420
467
|
|
|
421
468
|
attr_reader renderer: Gruff::Renderer
|
|
422
469
|
|
|
423
470
|
# Perform data manipulation before calculating chart measurements
|
|
424
|
-
|
|
471
|
+
# @rbs return: void
|
|
472
|
+
def setup_data: () -> void
|
|
425
473
|
|
|
426
474
|
# Calculates size of drawable area and generates normalized data.
|
|
427
475
|
#
|
|
428
476
|
# * line markers
|
|
429
477
|
# * legend
|
|
430
478
|
# * title
|
|
431
|
-
|
|
479
|
+
# @rbs return: void
|
|
480
|
+
def setup_drawing: () -> void
|
|
432
481
|
|
|
433
482
|
attr_reader store: Gruff::Store
|
|
434
483
|
|
|
@@ -443,9 +492,11 @@ module Gruff
|
|
|
443
492
|
|
|
444
493
|
# Make copy of data with values scaled between 0-100
|
|
445
494
|
# @rbs return: Array[Gruff::Store::BasicData | Gruff::Store::XYData | Gruff::Store::XYPointsizeData]
|
|
495
|
+
# @rbs return: void
|
|
446
496
|
def normalize: () -> Array[Gruff::Store::BasicData | Gruff::Store::XYData | Gruff::Store::XYPointsizeData]
|
|
447
497
|
|
|
448
|
-
|
|
498
|
+
# @rbs return: Float
|
|
499
|
+
def calculate_spread: () -> Float
|
|
449
500
|
|
|
450
501
|
# @rbs return: bool
|
|
451
502
|
def hide_title?: () -> bool
|
|
@@ -459,17 +510,25 @@ module Gruff
|
|
|
459
510
|
# @rbs return: bool
|
|
460
511
|
def hide_bottom_label_area?: () -> bool
|
|
461
512
|
|
|
462
|
-
|
|
513
|
+
# @rbs return: void
|
|
514
|
+
def setup_graph_measurements: () -> void
|
|
463
515
|
|
|
464
516
|
# Draw the optional labels for the x axis and y axis.
|
|
465
|
-
|
|
517
|
+
# @rbs return: void
|
|
518
|
+
def draw_axis_labels: () -> void
|
|
466
519
|
|
|
467
520
|
# Draws horizontal background lines and labels
|
|
468
|
-
|
|
521
|
+
# @rbs return: void
|
|
522
|
+
def draw_line_markers: () -> void
|
|
469
523
|
|
|
470
|
-
|
|
524
|
+
# @rbs y: Float | Integer
|
|
525
|
+
# @rbs return: void
|
|
526
|
+
def draw_marker_horizontal_line: (Float | Integer y) -> void
|
|
471
527
|
|
|
472
|
-
|
|
528
|
+
# @rbs x: Float | Integer
|
|
529
|
+
# @rbs tick_mark_mode: bool
|
|
530
|
+
# @rbs return: void
|
|
531
|
+
def draw_marker_vertical_line: (Float | Integer x, ?tick_mark_mode: bool) -> void
|
|
473
532
|
|
|
474
533
|
# Return a calculation of center
|
|
475
534
|
# @rbs size: Float | Integer
|
|
@@ -478,10 +537,12 @@ module Gruff
|
|
|
478
537
|
|
|
479
538
|
# Draws a legend with the names of the datasets matched
|
|
480
539
|
# to the colors used to draw them.
|
|
481
|
-
|
|
540
|
+
# @rbs return: void
|
|
541
|
+
def draw_legend: () -> void
|
|
482
542
|
|
|
483
543
|
# Draws a title on the graph.
|
|
484
|
-
|
|
544
|
+
# @rbs return: void
|
|
545
|
+
def draw_title: () -> void
|
|
485
546
|
|
|
486
547
|
# Draws column labels below graph, centered over x
|
|
487
548
|
#
|
|
@@ -489,11 +550,13 @@ module Gruff
|
|
|
489
550
|
# @rbs index: Integer
|
|
490
551
|
# @rbs gravity: untyped
|
|
491
552
|
# @rbs &: () -> void
|
|
492
|
-
|
|
553
|
+
# @rbs return: void
|
|
554
|
+
def draw_label: (Float | Integer x, Integer index, ?untyped gravity) { () -> void } -> void
|
|
493
555
|
|
|
494
556
|
# @rbs index: Integer
|
|
495
557
|
# @rbs yields: () -> void
|
|
496
|
-
|
|
558
|
+
# @rbs return: void
|
|
559
|
+
def draw_unique_label: (Integer index) -> void
|
|
497
560
|
|
|
498
561
|
# @rbs width: Float | Integer
|
|
499
562
|
# @rbs height: Float | Integer
|
|
@@ -502,7 +565,8 @@ module Gruff
|
|
|
502
565
|
# @rbs text: String | _ToS
|
|
503
566
|
# @rbs gravity: untyped
|
|
504
567
|
# @rbs rotation: Float | Integer
|
|
505
|
-
|
|
568
|
+
# @rbs return: void
|
|
569
|
+
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
570
|
|
|
507
571
|
# Draws the data value over the data point in bar graphs
|
|
508
572
|
#
|
|
@@ -512,15 +576,19 @@ module Gruff
|
|
|
512
576
|
# @rbs y_offset: Float | Integer
|
|
513
577
|
# @rbs data_point: String | _ToS
|
|
514
578
|
# @rbs gravity: untyped
|
|
515
|
-
|
|
579
|
+
# @rbs return: void
|
|
580
|
+
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
581
|
|
|
517
582
|
# Shows an error message because you have no data.
|
|
518
|
-
|
|
583
|
+
# @rbs return: void
|
|
584
|
+
def draw_no_data: () -> void
|
|
519
585
|
|
|
520
|
-
|
|
586
|
+
# @rbs return: void
|
|
587
|
+
def draw_graph: () -> void
|
|
521
588
|
|
|
522
589
|
# Resets everything to defaults (except data).
|
|
523
|
-
|
|
590
|
+
# @rbs return: void
|
|
591
|
+
def reset_themes: () -> void
|
|
524
592
|
|
|
525
593
|
# @rbs value: Float | Integer
|
|
526
594
|
# @rbs max_value: Float | Integer
|
|
@@ -533,14 +601,17 @@ module Gruff
|
|
|
533
601
|
def significant: (Integer i) -> (Integer | Float | BigDecimal)
|
|
534
602
|
|
|
535
603
|
# Sort with largest overall summed value at front of array.
|
|
536
|
-
|
|
604
|
+
# @rbs return: void
|
|
605
|
+
def sort_data: () -> void
|
|
537
606
|
|
|
538
607
|
# Set the color for each data set unless it was given in the data(...) call.
|
|
539
|
-
|
|
608
|
+
# @rbs return: void
|
|
609
|
+
def set_colors: () -> void
|
|
540
610
|
|
|
541
611
|
# Sort with largest overall summed value at front of array so it shows up
|
|
542
612
|
# correctly in the drawn graph.
|
|
543
|
-
|
|
613
|
+
# @rbs return: void
|
|
614
|
+
def sort_norm_data: () -> void
|
|
544
615
|
|
|
545
616
|
private
|
|
546
617
|
|
|
@@ -599,12 +670,6 @@ module Gruff
|
|
|
599
670
|
# @rbs return: String
|
|
600
671
|
def y_axis_label: (Float | Integer | BigDecimal value, Float | Integer increment) -> String
|
|
601
672
|
|
|
602
|
-
# TODO: RBS signature
|
|
603
|
-
def calculate_legend_label_widths_for_each_line: (untyped legend_labels, untyped legend_square_width) -> untyped
|
|
604
|
-
|
|
605
|
-
# TODO: RBS signature
|
|
606
|
-
def calculate_legend_height: () -> untyped
|
|
607
|
-
|
|
608
673
|
# Returns the height of the capital letter 'X' for the current font and
|
|
609
674
|
# size.
|
|
610
675
|
#
|
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,27 +33,34 @@ 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
|
|
@@ -66,14 +73,19 @@ class Gruff::Candlestick < Gruff::Base
|
|
|
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
|