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,391 @@
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.SVG = window.RGraph.SVG || {};
17
+ window.RGraph.SVG.HTMLTable = {};
18
+
19
+ // Module pattern
20
+ (function (win, doc, undefined)
21
+ {
22
+ //
23
+ // This function has been taken out of the RGraph.common.core.js file to
24
+ // enable the table reader to work standalone.
25
+ //
26
+ RGraph.SVG.HTMLTable.AJAX = function ()
27
+ {
28
+ var args = RGraph.SVG.HTMLTable.getArgs(arguments, 'url,callback');
29
+
30
+ // Mozilla, Safari, ...
31
+ if (win.XMLHttpRequest) {
32
+ var httpRequest = new XMLHttpRequest();
33
+
34
+ // MSIE
35
+ } else if (win.ActiveXObject) {
36
+ var httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
37
+ }
38
+
39
+ httpRequest.onreadystatechange = function ()
40
+ {
41
+ if (this.readyState == 4 && this.status == 200) {
42
+ this.__user_callback__ = callback;
43
+
44
+ this.__user_callback__(this.responseText);
45
+ }
46
+ }
47
+
48
+ httpRequest.open('GET', args.url, true);
49
+ httpRequest.send();
50
+ };
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+ //
60
+ // Use the AJAX function above to fetch a string
61
+ //
62
+ RGraph.SVG.HTMLTable.AJAX.getString = function ()
63
+ {
64
+ var args = RGraph.SVG.HTMLTable.getArgs(arguments, 'url,callback');
65
+
66
+ RGraph.SVG.HTMLTable.AJAX(args.url, function ()
67
+ {
68
+ var str = String(this.responseText);
69
+
70
+ args.callback(str);
71
+ });
72
+ };
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ //
82
+ // The HTMLTable object
83
+ //
84
+ RGraph.HTMLTable =
85
+ RGraph.SVG.HTMLTable = function ()
86
+ {
87
+ //
88
+ // The fetch function that starts everythjing going
89
+ //
90
+ this.fetch = function ()
91
+ {
92
+ //
93
+ // Parse the HTML table for the data
94
+ //
95
+ this.parseTable();
96
+
97
+ //
98
+ // Call the callback
99
+ //
100
+ this.callback(this);
101
+ };
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ //
111
+ // Parse the HTML table to get the data from it. If the <ID that we've been given is a
112
+ // string then first convert it to an HTML element using the HTML5 <template> tag
113
+ //
114
+ this.parseTable = function ()
115
+ {
116
+ // Allow for string: <table>...</table>
117
+ if (this.id.substr(0, 7) === 'string:') {
118
+
119
+ this.id = this.id.substr(7);
120
+
121
+ var template = doc.createElement('template');
122
+ html = this.id.trim(); // Never return a text node of whitespace as the result
123
+ template.innerHTML = html;
124
+
125
+ var table = template.content.firstChild;
126
+ } else {
127
+ var table = doc.getElementById(this.id.replace(/^#/,''));
128
+ }
129
+
130
+ var rows = table.getElementsByTagName('tr');
131
+
132
+ // Loop thru the rows
133
+ for (var i=0; i<rows.length; ++i) {
134
+
135
+ var row = rows[i].getElementsByTagName('td');
136
+
137
+ // Get the headers if there's no td cell
138
+ if (!row.length) {
139
+ var row = rows[i].getElementsByTagName('th');
140
+ }
141
+
142
+ // Create a row in the data array
143
+ this.data[i] = [];
144
+
145
+ // Loop thru the cells in the row
146
+ for (var j=0; j<row.length; ++j) {
147
+ var cell = row[j];
148
+ var data = cell.innerHTML;
149
+
150
+ // Convert the cell data to a number if it'as numeric
151
+ if (data.match(/^[ 0-9]+$/)) {
152
+ data = parseInt(data.trim());
153
+ } else if (data.match(/^[ 0-9.]+$/)) {
154
+ data = parseFloat(data.trim());
155
+ }
156
+
157
+ this.data[i][j] = data;
158
+
159
+ //
160
+ // Store the number of rows as an object property
161
+ //
162
+ this.numrows = this.data.length;
163
+
164
+ //
165
+ // Store the number of cells as an object property
166
+ //(based on the first row)
167
+ //
168
+ this.numcols = this.data[0].length;
169
+ }
170
+ }
171
+ };
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ //
181
+ // This function allows you to fetch a row
182
+ // of the HTML table data.
183
+ //
184
+ this.row =
185
+ this.getRow = function (index)
186
+ {
187
+ var row = [],
188
+ start = parseInt(arguments[1]) || 0,
189
+ length = arguments[2];
190
+
191
+ // Convert a string based row name to a
192
+ // numeric index
193
+ if (typeof index === 'string') {
194
+ for (var i=0; i<this.data.length; ++i) {
195
+ if (this.data[i][0].trim() === index.trim()) {
196
+ var found = true;
197
+ index = i;
198
+ break;
199
+ }
200
+ }
201
+
202
+ if (!found) {
203
+ return null;
204
+ }
205
+ }
206
+
207
+ if (start < 0) {
208
+ row = this.data[index].slice(this.data[index].length - Math.abs(start));
209
+ } else {
210
+ row = this.data[index].slice(start);
211
+ }
212
+
213
+ // Zero length
214
+ if (typeof length === 'number' && length === 0) {
215
+ row = [];
216
+
217
+ } else {
218
+ // Positive length
219
+ if (typeof length === 'number' && length > 0) {
220
+ row = row.slice(0, length)
221
+
222
+ // Negative length
223
+ } else if (typeof length === 'number' && length < 0) {
224
+ for (var i=0; i<Math.abs(length); ++i) {
225
+ row.pop();
226
+ }
227
+ }
228
+ }
229
+
230
+
231
+
232
+ return row;
233
+ };
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+ //
243
+ // This fuunction allows you to fetch a column
244
+ // of the HTML table data.
245
+ //
246
+ this.col =
247
+ this.column =
248
+ this.getColumn =
249
+ this.getCol = function (index)
250
+ {
251
+ var col = [],
252
+ start = arguments[1] || 0,
253
+ length = arguments[2];
254
+
255
+
256
+
257
+ // Convert a string based column name to a
258
+ // numeric index
259
+ if (typeof index === 'string') {
260
+ for (var i=0; i<this.data.length; ++i) {
261
+ if (this.data[0][i].trim() === index.trim()) {
262
+ var found = true;
263
+ index = i;
264
+ break;
265
+ }
266
+ }
267
+
268
+ if (!found) {
269
+ return null;
270
+ }
271
+ }
272
+
273
+
274
+ if (start >= 0) {
275
+ for (var i=start; i<this.data.length; i+=1) {
276
+ if (this.data[i]) {
277
+ col.push(this.data[i][index]);
278
+ } else {
279
+ col.push(null);
280
+ }
281
+ }
282
+ } else {
283
+ for (var i=(this.data.length - Math.abs(start)); i<this.data.length; i+=1) {
284
+ if (this.data[i]) {
285
+ col.push(this.data[i][index]);
286
+ } else {
287
+ col.push(null);
288
+ }
289
+ }
290
+ }
291
+
292
+ // Zero length
293
+ if (typeof length === 'number' && length === 0) {
294
+ col = [];
295
+
296
+ } else {
297
+ // Positive length
298
+ if (typeof length === 'number' && length > 0) {
299
+ col = col.slice(0, length)
300
+
301
+ // Negative length
302
+ } else if (typeof length === 'number' && length < 0) {
303
+ for (var i=0; i<Math.abs(length); ++i) {
304
+ col.pop();
305
+ }
306
+ }
307
+ }
308
+
309
+ return col;
310
+ };
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+ var args = RGraph.SVG.HTMLTable.getArgs(arguments, 'id,callback');
321
+
322
+ //
323
+ // Some default values
324
+ //
325
+ this.id = args.id.replace(/^#/,'');
326
+ this.callback = args.callback;
327
+ this.data = [];
328
+
329
+ this.fetch();
330
+ };
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+ //
340
+ // This function allows both object based arguments to functions
341
+ // and also regular arguments as well.
342
+ //
343
+ // You can call it from inside a function like this:
344
+ //
345
+ // args = RGraph.SVG.HTMLTable.getArgs(arguments, 'object,id,foo,bar');
346
+ //
347
+ // So you're passing it the arguments object and a comma seperated list of names
348
+ // for the arguments.
349
+ //
350
+ // @param array args The arguments object that you get when inside a function
351
+ // @param string names A comma seperated list of desired names for the arguments
352
+ // eg: 'object,color,size'
353
+ //
354
+ RGraph.SVG.HTMLTable.getArgs = function (args, names)
355
+ {
356
+ var ret = {};
357
+ var count = 0;
358
+ names = names.trim().split(/ *, */);
359
+
360
+ if ( args
361
+ && args[0]
362
+ && args.length === 1
363
+ && typeof args[0][names[0]] !== 'undefined') {
364
+
365
+ for (var i=0; i<names.length; ++i) {
366
+ if (typeof args[0][names[i]] === 'undefined') {
367
+ args[0][names[i]] = null;
368
+ }
369
+ }
370
+
371
+ return args[0];
372
+ } else {
373
+ for (var i in names) {
374
+ ret[names[i]] = typeof args[count] === 'undefined' ? null : args[count];
375
+
376
+ count += 1;
377
+ }
378
+ }
379
+
380
+ return ret;
381
+ };
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+ // End module pattern
391
+ })(window, document);