rgraph-rails 5.00 → 6.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/publish-geml.yaml +46 -0
  3. data/.gitignore +1 -0
  4. data/README.md +4 -5
  5. data/lib/rgraph-rails/version.rb +1 -1
  6. data/rgraph-rails.gemspec +4 -4
  7. data/vendor/assets/javascripts/RGraph.activity.js +1691 -0
  8. data/vendor/assets/javascripts/RGraph.bar.js +4253 -236
  9. data/vendor/assets/javascripts/RGraph.bipolar.js +3958 -162
  10. data/vendor/assets/javascripts/RGraph.common.annotate.js +414 -35
  11. data/vendor/assets/javascripts/RGraph.common.context.js +635 -30
  12. data/vendor/assets/javascripts/RGraph.common.core.js +10485 -419
  13. data/vendor/assets/javascripts/RGraph.common.csv.js +508 -27
  14. data/vendor/assets/javascripts/RGraph.common.dynamic.js +1693 -90
  15. data/vendor/assets/javascripts/RGraph.common.effects.js +1629 -89
  16. data/vendor/assets/javascripts/RGraph.common.key.js +1003 -53
  17. data/vendor/assets/javascripts/RGraph.common.moment.js +5670 -0
  18. data/vendor/assets/javascripts/RGraph.common.sheets.js +541 -31
  19. data/vendor/assets/javascripts/RGraph.common.sheets.php +351 -0
  20. data/vendor/assets/javascripts/RGraph.common.starburst.js +382 -0
  21. data/vendor/assets/javascripts/RGraph.common.table.js +386 -0
  22. data/vendor/assets/javascripts/RGraph.common.tooltips.js +1433 -32
  23. data/vendor/assets/javascripts/RGraph.drawing.background.js +660 -35
  24. data/vendor/assets/javascripts/RGraph.drawing.circle.js +618 -34
  25. data/vendor/assets/javascripts/RGraph.drawing.image.js +857 -52
  26. data/vendor/assets/javascripts/RGraph.drawing.line.js +712 -0
  27. data/vendor/assets/javascripts/RGraph.drawing.marker1.js +760 -38
  28. data/vendor/assets/javascripts/RGraph.drawing.marker2.js +740 -37
  29. data/vendor/assets/javascripts/RGraph.drawing.marker3.js +573 -36
  30. data/vendor/assets/javascripts/RGraph.drawing.poly.js +667 -36
  31. data/vendor/assets/javascripts/RGraph.drawing.rect.js +638 -34
  32. data/vendor/assets/javascripts/RGraph.drawing.text.js +672 -37
  33. data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +653 -52
  34. data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +714 -51
  35. data/vendor/assets/javascripts/RGraph.fuel.js +1149 -59
  36. data/vendor/assets/javascripts/RGraph.funnel.js +1277 -56
  37. data/vendor/assets/javascripts/RGraph.gantt.js +1646 -82
  38. data/vendor/assets/javascripts/RGraph.gauge.js +1773 -89
  39. data/vendor/assets/javascripts/RGraph.hbar.js +3869 -159
  40. data/vendor/assets/javascripts/RGraph.horseshoe.js +970 -0
  41. data/vendor/assets/javascripts/RGraph.hprogress.js +1829 -81
  42. data/vendor/assets/javascripts/RGraph.line.js +5293 -244
  43. data/vendor/assets/javascripts/RGraph.meter.js +1570 -77
  44. data/vendor/assets/javascripts/RGraph.modaldialog.js +300 -19
  45. data/vendor/assets/javascripts/RGraph.odo.js +1553 -68
  46. data/vendor/assets/javascripts/RGraph.pie.js +3273 -129
  47. data/vendor/assets/javascripts/RGraph.radar.js +2333 -108
  48. data/vendor/assets/javascripts/RGraph.rose.js +2685 -114
  49. data/vendor/assets/javascripts/RGraph.rscatter.js +1920 -80
  50. data/vendor/assets/javascripts/RGraph.scatter.js +4215 -171
  51. data/vendor/assets/javascripts/RGraph.segmented.js +1006 -0
  52. data/vendor/assets/javascripts/RGraph.semicircularprogress.js +1980 -59
  53. data/vendor/assets/javascripts/RGraph.svg.activity.js +1696 -0
  54. data/vendor/assets/javascripts/RGraph.svg.bar.js +2575 -77
  55. data/vendor/assets/javascripts/RGraph.svg.bipolar.js +3533 -106
  56. data/vendor/assets/javascripts/RGraph.svg.common.ajax.js +240 -21
  57. data/vendor/assets/javascripts/RGraph.svg.common.core.js +7105 -299
  58. data/vendor/assets/javascripts/RGraph.svg.common.csv.js +408 -28
  59. data/vendor/assets/javascripts/RGraph.svg.common.fx.js +1291 -68
  60. data/vendor/assets/javascripts/RGraph.svg.common.key.js +451 -20
  61. data/vendor/assets/javascripts/RGraph.svg.common.sheets.js +543 -31
  62. data/vendor/assets/javascripts/RGraph.svg.common.table.js +391 -0
  63. data/vendor/assets/javascripts/RGraph.svg.common.tooltips.js +1072 -23
  64. data/vendor/assets/javascripts/RGraph.svg.funnel.js +1151 -32
  65. data/vendor/assets/javascripts/RGraph.svg.gauge.js +1429 -34
  66. data/vendor/assets/javascripts/RGraph.svg.hbar.js +2692 -65
  67. data/vendor/assets/javascripts/RGraph.svg.horseshoe.js +969 -0
  68. data/vendor/assets/javascripts/RGraph.svg.line.js +2855 -86
  69. data/vendor/assets/javascripts/RGraph.svg.pie.js +1630 -58
  70. data/vendor/assets/javascripts/RGraph.svg.radar.js +1772 -58
  71. data/vendor/assets/javascripts/RGraph.svg.rose.js +2419 -83
  72. data/vendor/assets/javascripts/RGraph.svg.scatter.js +2280 -65
  73. data/vendor/assets/javascripts/RGraph.svg.segmented.js +930 -0
  74. data/vendor/assets/javascripts/RGraph.svg.semicircularprogress.js +1612 -29
  75. data/vendor/assets/javascripts/RGraph.svg.waterfall.js +1525 -50
  76. data/vendor/assets/javascripts/RGraph.thermometer.js +1411 -64
  77. data/vendor/assets/javascripts/RGraph.vprogress.js +1915 -81
  78. data/vendor/assets/javascripts/RGraph.waterfall.js +1896 -89
  79. data/vendor/assets/javascripts/financial-data.js +1067 -0
  80. metadata +37 -16
  81. data/.travis.yml +0 -11
  82. data/vendor/assets/javascripts/RGraph.common.deprecated.js +0 -35
  83. data/vendor/assets/javascripts/RGraph.common.resizing.js +0 -38
  84. data/vendor/assets/javascripts/RGraph.common.zoom.js +0 -15
  85. data/vendor/assets/javascripts/RGraph.cornergauge.js +0 -71
@@ -0,0 +1,386 @@
1
+ 'version:2023-09-16 (6.14)';
2
+ //
3
+ // o--------------------------------------------------------------------------------o
4
+ // | This file is part of the RGraph package - you can learn more at: |
5
+ // | |
6
+ // | https://www.rgraph.net |
7
+ // | |
8
+ // | RGraph is licensed under the Open Source MIT license. That means that it's |
9
+ // | totally free to use and there are no restrictions on what you can do with it! |
10
+ // o--------------------------------------------------------------------------------o
11
+
12
+ //
13
+ // Initialise the various objects
14
+ //
15
+ window.RGraph = window.RGraph || {isrgraph:true,isRGraph: true,rgraph:true};
16
+ window.RGraph.HTMLTable = {};
17
+
18
+ // Module pattern
19
+ (function (win, doc, undefined)
20
+ {
21
+ //
22
+ // This function has been taken out of the RGraph.common.core.js file to
23
+ // enable the table reader to work standalone.
24
+ //
25
+ RGraph.HTMLTable.AJAX = function ()
26
+ {
27
+ var args = RGraph.HTMLTable.getArgs(arguments, 'url,callback');
28
+
29
+ // Mozilla, Safari, ...
30
+ if (win.XMLHttpRequest) {
31
+ var httpRequest = new XMLHttpRequest();
32
+
33
+ // MSIE
34
+ } else if (win.ActiveXObject) {
35
+ var httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
36
+ }
37
+
38
+ httpRequest.onreadystatechange = function ()
39
+ {
40
+ if (this.readyState == 4 && this.status == 200) {
41
+ this.__user_callback__ = args.callback;
42
+
43
+ this.__user_callback__(this.responseText);
44
+ }
45
+ }
46
+
47
+ httpRequest.open('GET', args.url, true);
48
+ httpRequest.send();
49
+ };
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+ //
59
+ // Use the AJAX function above to fetch a string
60
+ //
61
+ RGraph.HTMLTable.AJAX.getString = function ()
62
+ {
63
+ var args = RGraph.HTMLTable.getArgs(arguments, 'url,callback');
64
+
65
+ RGraph.HTMLTable.AJAX(args.url, function ()
66
+ {
67
+ var str = String(this.responseText);
68
+
69
+ args.callback(str);
70
+ });
71
+ };
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+ RGraph.HTMLTable = function ()
81
+ {
82
+ //
83
+ // The fetch function that starts everythjing going
84
+ //
85
+ this.fetch = function ()
86
+ {
87
+ //
88
+ // Parse the HTML table for the data
89
+ //
90
+ this.parseTable();
91
+
92
+ //
93
+ // Call the callback
94
+ //
95
+ this.callback(this);
96
+ };
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+ //
106
+ // Parse the HTML table to get the data from it. If the <ID that we've been given is a
107
+ // string then first convert it to an HTML element using the HTML5 <template> tag
108
+ //
109
+ this.parseTable = function ()
110
+ {
111
+ // Allow for string: <table>...</table>
112
+ if (this.id.substr(0, 7) === 'string:') {
113
+
114
+ this.id = this.id.substr(7);
115
+
116
+ var template = doc.createElement('template');
117
+ html = this.id.trim(); // Never return a text node of whitespace as the result
118
+ template.innerHTML = html;
119
+
120
+ var table = template.content.firstChild;
121
+ } else {
122
+ var table = doc.getElementById(this.id.replace(/^#/,''));
123
+ }
124
+
125
+ var rows = table.getElementsByTagName('tr');
126
+
127
+ // Loop thru the rows
128
+ for (var i=0; i<rows.length; ++i) {
129
+
130
+ var row = rows[i].getElementsByTagName('td');
131
+
132
+ // Get the headers if there's no td cell
133
+ if (!row.length) {
134
+ var row = rows[i].getElementsByTagName('th');
135
+ }
136
+
137
+ // Create a row in the data array
138
+ this.data[i] = [];
139
+
140
+ // Loop thru the cells in the row
141
+ for (var j=0; j<row.length; ++j) {
142
+ var cell = row[j];
143
+ var data = cell.innerHTML;
144
+
145
+ // Convert the cell data to a number if it'as numeric
146
+ if (data.match(/^[ 0-9]+$/)) {
147
+ data = parseInt(data.trim());
148
+ } else if (data.match(/^[ 0-9.]+$/)) {
149
+ data = parseFloat(data.trim());
150
+ }
151
+
152
+ this.data[i][j] = data;
153
+
154
+ //
155
+ // Store the number of rows as an object property
156
+ //
157
+ this.numrows = this.data.length;
158
+
159
+ //
160
+ // Store the number of cells as an object property
161
+ //(based on the first row)
162
+ //
163
+ this.numcols = this.data[0].length;
164
+ }
165
+ }
166
+ };
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ //
176
+ // This function allows you to fetch a row
177
+ // of the HTML table data.
178
+ //
179
+ this.row =
180
+ this.getRow = function (index)
181
+ {
182
+ var row = [],
183
+ start = parseInt(arguments[1]) || 0,
184
+ length = arguments[2];
185
+
186
+ // Convert a string based row name to a
187
+ // numeric index
188
+ if (typeof index === 'string') {
189
+ for (var i=0; i<this.data.length; ++i) {
190
+ if (this.data[i][0].trim() === index.trim()) {
191
+ var found = true;
192
+ index = i;
193
+ break;
194
+ }
195
+ }
196
+
197
+ if (!found) {
198
+ return null;
199
+ }
200
+ }
201
+
202
+ if (start < 0) {
203
+ row = this.data[index].slice(this.data[index].length - Math.abs(start));
204
+ } else {
205
+ row = this.data[index].slice(start);
206
+ }
207
+
208
+ // Zero length
209
+ if (typeof length === 'number' && length === 0) {
210
+ row = [];
211
+
212
+ } else {
213
+ // Positive length
214
+ if (typeof length === 'number' && length > 0) {
215
+ row = row.slice(0, length)
216
+
217
+ // Negative length
218
+ } else if (typeof length === 'number' && length < 0) {
219
+ for (var i=0; i<Math.abs(length); ++i) {
220
+ row.pop();
221
+ }
222
+ }
223
+ }
224
+
225
+
226
+
227
+ return row;
228
+ };
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+ //
238
+ // This fuunction allows you to fetch a column
239
+ // of the HTML table data.
240
+ //
241
+ this.col =
242
+ this.column =
243
+ this.getColumn =
244
+ this.getCol = function (index)
245
+ {
246
+ var col = [],
247
+ start = arguments[1] || 0,
248
+ length = arguments[2];
249
+
250
+
251
+ // Convert a string based column name to a
252
+ // numeric index
253
+ if (typeof index === 'string') {
254
+ for (var i=0; i<this.data.length; ++i) {
255
+ if (this.data[0][i].trim() === index.trim()) {
256
+ var found = true;
257
+ index = i;
258
+ break;
259
+ }
260
+ }
261
+
262
+ if (!found) {
263
+ return null;
264
+ }
265
+ }
266
+
267
+
268
+
269
+ if (start >= 0) {
270
+ for (var i=start; i<this.data.length; i+=1) {
271
+ if (this.data[i]) {
272
+ col.push(this.data[i][index]);
273
+ } else {
274
+ col.push(null);
275
+ }
276
+ }
277
+ } else {
278
+ for (var i=(this.data.length - Math.abs(start)); i<this.data.length; i+=1) {
279
+ if (this.data[i]) {
280
+ col.push(this.data[i][index]);
281
+ } else {
282
+ col.push(null);
283
+ }
284
+ }
285
+ }
286
+
287
+ // Zero length
288
+ if (typeof length === 'number' && length === 0) {
289
+ col = [];
290
+
291
+ } else {
292
+ // Positive length
293
+ if (typeof length === 'number' && length > 0) {
294
+ col = col.slice(0, length)
295
+
296
+ // Negative length
297
+ } else if (typeof length === 'number' && length < 0) {
298
+ for (var i=0; i<Math.abs(length); ++i) {
299
+ col.pop();
300
+ }
301
+ }
302
+ }
303
+
304
+ return col;
305
+ };
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+ var args = RGraph.HTMLTable.getArgs(arguments, 'id,callback');
316
+
317
+ //
318
+ // Some default values
319
+ //
320
+ this.id = args.id.replace(/^#/,'');
321
+ this.callback = args.callback;
322
+ this.data = [];
323
+
324
+ this.fetch();
325
+ };
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+ //
335
+ // This function allows both object based arguments to functions
336
+ // and also regular arguments as well.
337
+ //
338
+ // You can call it from inside a function like this:
339
+ //
340
+ // args = RGraph.HTMLTable.getArgs(arguments, 'object,id,foo,bar');
341
+ //
342
+ // So you're passing it the arguments object and a comma seperated list of names
343
+ // for the arguments.
344
+ //
345
+ // @param array args The arguments object that you get when inside a function
346
+ // @param string names A comma seperated list of desired names for the arguments
347
+ // eg: 'object,color,size'
348
+ //
349
+ RGraph.HTMLTable.getArgs = function (args, names)
350
+ {
351
+ var ret = {};
352
+ var count = 0;
353
+ names = names.trim().split(/ *, */);
354
+
355
+ if ( args
356
+ && args[0]
357
+ && args.length === 1
358
+ && typeof args[0][names[0]] !== 'undefined') {
359
+
360
+ for (var i=0; i<names.length; ++i) {
361
+ if (typeof args[0][names[i]] === 'undefined') {
362
+ args[0][names[i]] = null;
363
+ }
364
+ }
365
+
366
+ return args[0];
367
+ } else {
368
+ for (var i in names) {
369
+ ret[names[i]] = typeof args[count] === 'undefined' ? null : args[count];
370
+
371
+ count += 1;
372
+ }
373
+ }
374
+
375
+ return ret;
376
+ };
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+ // End module pattern
386
+ })(window, document);