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
@@ -1,28 +1,509 @@
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
1
11
 
2
- RGraph=window.RGraph||{isRGraph:true};if(!RGraph.AJAX)RGraph.AJAX=function(url,callback)
3
- {if(window.XMLHttpRequest){var httpRequest=new XMLHttpRequest();}else if(window.ActiveXObject){var httpRequest=new ActiveXObject("Microsoft.XMLHTTP");}
4
- httpRequest.onreadystatechange=function()
5
- {if(this.readyState==4&&this.status==200){this.__user_callback__=callback;this.__user_callback__(this.responseText);}}
6
- httpRequest.open('GET',url,true);httpRequest.send();};if(!RGraph.AJAX.getString)RGraph.AJAX.getString=function(url,callback)
7
- {RGraph.AJAX(url,function()
8
- {var str=String(this.responseText);callback(str);});};if(!RGraph.createUID)RGraph.createUID=function()
9
- {return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c)
10
- {var r=Math.random()*16|0,v=c=='x'?r:(r&0x3|0x8);return v.toString(16);});};RGraph.CSV=function(url,func)
11
- {this.url=url;this.ready=func;this.data=null;this.numrows=null;this.numcols=null;this.seperator=arguments[2]||',';this.endofline=arguments[3]||/\r?\n/;this.uid=RGraph.createUID();this.splitCSV=function(str,split)
12
- {var arr=[];var field='';var inDoubleQuotes=false;var inSingleQuotes=false;var preserve=(typeof split==='object'&&split.preserve)?true:false;if(typeof split==='object'){if(typeof split.char==='string'){split=split.char;}else{split=',';}}
13
- for(var i=0,len=str.length;i<len;i+=1){char=str.charAt(i);if((char==='"')&&!inDoubleQuotes){inDoubleQuotes=true;continue;}else if((char==='"')&&inDoubleQuotes){inDoubleQuotes=false;continue;}
14
- if((char==="'")&&!inSingleQuotes){inSingleQuotes=true;continue;}else if((char==="'")&&inSingleQuotes){inSingleQuotes=false;continue;}else if(char===split&&!inDoubleQuotes&&!inSingleQuotes){arr.push(field);field='';continue;}else{field=field+char;}}
15
- arr.push(field);if(!preserve){for(i=0,len=arr.length;i<len;i+=1){arr[i]=arr[i].trim();}}
16
- return arr;};this.fetch=function()
17
- {var sep=this.seperator,eol=this.endofline,obj=this;if(this.url.substring(0,3)==='id:'||this.url.substring(0,4)==='str:'){if(this.url.substring(0,3)==='id:'){var data=document.getElementById(this.url.substring(3)).innerHTML.trim();}else if(this.url.substring(0,4)==='str:'){var data=this.url.substring(4).trim();}
18
- obj.data=data.split(eol);obj.numrows=obj.data.length;for(var i=0,len=obj.data.length;i<len;i+=1){var row=obj.splitCSV(obj.data[i],{preserve:false,char:sep});if(!obj.numcols){obj.numcols=row.length;}
19
- for(var j=0;j<row.length;j+=1){if((/^\-?[0-9.]+$/).test(row[j])){row[j]=parseFloat(row[j]);}
20
- obj.data[i]=row;}}
21
- obj.ready(obj);}else{RGraph.AJAX.getString(this.url,function(data)
22
- {data=data.replace(/(\r?\n)+$/,'');obj.data=data.split(eol);obj.numrows=obj.data.length;for(var i=0,len=obj.data.length;i<len;i+=1){var row=obj.splitCSV(obj.data[i],{preserve:false,char:sep});if(!obj.numcols){obj.numcols=row.length;}
23
- for(var j=0;j<row.length;j+=1){if((/^\-?[0-9.]+$/).test(row[j])){row[j]=parseFloat(row[j]);}
24
- obj.data[i]=row;}}
25
- obj.ready(obj);});}};this.getRow=function(index)
26
- {var row=[],start=parseInt(arguments[1])||0;row=this.data[index].slice(start);return row;};this.getCol=this.getColumn=function(index)
27
- {var col=[],start=arguments[1]||0;for(var i=start;i<this.data.length;i+=1){if(this.data[i]&&this.data[i][index]){col.push(this.data[i][index]);}else{col.push(null);}}
28
- return col;};this.fetch();};
12
+ //
13
+ // Initialise the various objects
14
+ //
15
+ RGraph = window.RGraph || {isrgraph:true,isRGraph: true,rgraph:true};
16
+
17
+
18
+ //
19
+ // This function has been taken out of the RGraph.common.core.js file to
20
+ // enable the CSV reader to work standalone.
21
+ //
22
+ if (!RGraph.AJAX) RGraph.AJAX = function ()
23
+ {
24
+ var args = RGraph.getArgs(arguments, 'url,callback');
25
+
26
+ // Mozilla, Safari, ...
27
+ if (window.XMLHttpRequest) {
28
+ var httpRequest = new XMLHttpRequest();
29
+
30
+ // MSIE
31
+ } else if (window.ActiveXObject) {
32
+ var httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
33
+ }
34
+
35
+ httpRequest.onreadystatechange = function ()
36
+ {
37
+ if (this.readyState == 4 && this.status == 200) {
38
+ this.__user_callback__ = args.callback;
39
+
40
+ this.__user_callback__(this.responseText);
41
+ }
42
+ }
43
+
44
+ httpRequest.open('GET', args.url, true);
45
+ httpRequest.send();
46
+ };
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+ //
56
+ // Use the AJAX function above to fetch a string
57
+ //
58
+ if (!RGraph.AJAX.getString) RGraph.AJAX.getString = function ()
59
+ {
60
+ var args = RGraph.getArgs(arguments, 'url,callback');
61
+
62
+ RGraph.AJAX(args.url, function ()
63
+ {
64
+ var str = String(this.responseText);
65
+
66
+ args.callback(str);
67
+ });
68
+ };
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+ // This function simply creates UID. Formerly the function in
78
+ // RGraph.common.core.js was being used - but now the CSV code
79
+ // is now standalone, hence this function
80
+ if (!RGraph.createUID) RGraph.createUID = function ()
81
+ {
82
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c)
83
+ {
84
+ var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
85
+ return v.toString(16);
86
+ });
87
+ };
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ //
97
+ // This function allows both object based arguments to functions
98
+ // and also regular arguments as well.
99
+ //
100
+ // You can call it from inside a function like this:
101
+ //
102
+ // args = RGraph.HTMLTable.getArgs(arguments, 'object,id,foo,bar');
103
+ //
104
+ // So you're passing it the arguments object and a comma seperated list of names
105
+ // for the arguments.
106
+ //
107
+ // @param array args The arguments object that you get when inside a function
108
+ // @param string names A comma seperated list of desired names for the arguments
109
+ // eg: 'object,color,size'
110
+ //
111
+ if (!RGraph.getArgs) RGraph.getArgs = function (args, names)
112
+ {
113
+ var ret = {};
114
+ var count = 0;
115
+ names = names.trim().split(/ *, */);
116
+
117
+ if ( args
118
+ && args[0]
119
+ && args.length === 1
120
+ && typeof args[0][names[0]] !== 'undefined') {
121
+
122
+ for (var i=0; i<names.length; ++i) {
123
+ if (typeof args[0][names[i]] === 'undefined') {
124
+ args[0][names[i]] = null;
125
+ }
126
+ }
127
+
128
+ return args[0];
129
+ } else {
130
+ for (var i in names) {
131
+ ret[names[i]] = typeof args[count] === 'undefined' ? null : args[count];
132
+
133
+ count += 1;
134
+ }
135
+ }
136
+
137
+ return ret;
138
+ };
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ RGraph.CSV = function ()
148
+ {
149
+ var args = RGraph.getArgs(arguments, 'url,callback,separator,eol');
150
+
151
+ //
152
+ // Some default values
153
+ //
154
+ this.url = args.url;
155
+ this.ready = args.callback;
156
+ this.data = null;
157
+ this.numrows = null;
158
+ this.numcols = null;
159
+ this.separator = args.separator || ',';
160
+ this.endofline = args.eol || /\r?\n/;
161
+ this.uid = RGraph.createUID();
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+ //
171
+ // A Custom split function
172
+ //
173
+ // @param string str The CSV string to split
174
+ // @param mixed char The character to split on - or it can also be an object like this:
175
+ // {
176
+ // preserve: false, // Whether to preserve whitespace
177
+ // char: ',' // The character to split on
178
+ // }
179
+ //
180
+ this.splitCSV = function (str, split)
181
+ {
182
+ // Defaults
183
+ var arr = [];
184
+ var field = '';
185
+ var inDoubleQuotes = false;
186
+ var inSingleQuotes = false;
187
+ var preserve = (typeof split === 'object' && split.preserve) ? true : false;
188
+
189
+ // The character to split the CSV string on
190
+ if (typeof split === 'object') {
191
+ if (typeof split.char === 'string') {
192
+ split = split.char;
193
+ } else {
194
+ split = ',';
195
+ }
196
+ } // If not an object just leave the char as it's supplied
197
+
198
+
199
+
200
+ for (var i=0,len=str.length; i<len; i+=1) {
201
+
202
+ char = str.charAt(i);
203
+
204
+ if ( (char === '"') && !inDoubleQuotes) {
205
+ inDoubleQuotes = true;
206
+ continue;
207
+
208
+ } else if ( (char === '"') && inDoubleQuotes) {
209
+ inDoubleQuotes = false;
210
+ continue;
211
+ }
212
+ if ( (char === "'") && !inSingleQuotes) {
213
+ inSingleQuotes = true;
214
+ continue;
215
+
216
+ } else if ( (char === "'") && inSingleQuotes) {
217
+ inSingleQuotes = false;
218
+ continue;
219
+
220
+ } else if (char === split && !inDoubleQuotes && !inSingleQuotes) {
221
+ // TODO look ahead in order to allow for multi-character separators
222
+ arr.push(field);
223
+ field = '';
224
+ continue;
225
+
226
+ } else {
227
+ field = field + char;
228
+ }
229
+ }
230
+
231
+ // Add the last field
232
+ arr.push(field);
233
+
234
+ // Now trim each value if necessary
235
+ if (!preserve) {
236
+ for (i=0,len=arr.length; i<len; i+=1) {
237
+ arr[i] = arr[i].trim();
238
+ }
239
+ }
240
+
241
+ return arr;
242
+ };
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+ //
252
+ // This function splits the CSV data into an array so that it can be useful.
253
+ //
254
+ this.fetch = function ()
255
+ {
256
+ var sep = this.separator,
257
+ eol = this.endofline,
258
+ obj = this;
259
+
260
+ if (this.url.substring(0,3) === 'id:' || this.url.substring(0,4) === 'str:') {
261
+
262
+ // Get rid of any surrounding whitespace
263
+ if (this.url.substring(0,3) === 'id:') {
264
+ var data = document.getElementById(this.url.substring(3)).innerHTML.trim();
265
+
266
+ } else if (this.url.substring(0,4) === 'str:') {
267
+ var data = this.url.substring(4).trim();
268
+ }
269
+
270
+ // Store the CSV data on the CSV object (ie - this object)
271
+ obj.data = data.split(eol);
272
+
273
+ // Store the number of rows
274
+ obj.numrows = obj.data.length;
275
+
276
+ for (var i=0,len=obj.data.length; i<len; i+=1) {
277
+
278
+
279
+ //
280
+ // Split the individual line
281
+ //
282
+ //var row = obj.data[i].split(sep);
283
+ var row = obj.splitCSV(obj.data[i], {preserve: false, char: sep});
284
+
285
+
286
+ if (!obj.numcols) {
287
+ obj.numcols = row.length;
288
+ }
289
+
290
+ //
291
+ // If the cell is purely made up of numbers - convert it
292
+ //
293
+ for (var j=0; j<row.length; j+=1) {
294
+ if ((/^\-?[0-9.]+$/).test(row[j])) {
295
+ row[j] = parseFloat(row[j]);
296
+ }
297
+
298
+ // Assign the split-up-row back to the data array
299
+ obj.data[i] = row;
300
+ }
301
+ }
302
+
303
+ // Call the ready function straight away
304
+ obj.ready(obj);
305
+
306
+ } else {
307
+
308
+ RGraph.AJAX.getString({url: this.url, callback: function (data)
309
+ {
310
+ data = data.replace(/(\r?\n)+$/, '');
311
+
312
+ //
313
+ // Split the lines in the CSV
314
+ //
315
+ obj.data = data.split(eol);
316
+
317
+ //
318
+ // Store the number of rows
319
+ //
320
+ obj.numrows = obj.data.length;
321
+
322
+
323
+
324
+ //
325
+ // Loop thru each lines in the CSV file
326
+ //
327
+ for (var i=0,len=obj.data.length; i<len; i+=1) {
328
+ //
329
+ // Use the new split function to split each row NOT preserving whitespace
330
+ //
331
+ //var row = obj.data[i].split(sep);
332
+ var row = obj.splitCSV(obj.data[i], {preserve: false, char: sep});
333
+
334
+ if (!obj.numcols) {
335
+ obj.numcols = row.length;
336
+ }
337
+
338
+ //
339
+ // If the cell is purely made up of numbers - convert it
340
+ //
341
+ for (var j=0; j<row.length; j+=1) {
342
+ if ((/^\-?[0-9.]+$/).test(row[j])) {
343
+ row[j] = parseFloat(row[j]);
344
+ }
345
+
346
+ // Assign the split-up-row back to the data array
347
+ obj.data[i] = row;
348
+ }
349
+ }
350
+
351
+ // Call the ready function straight away
352
+ obj.ready(obj);
353
+ }});
354
+ }
355
+ };
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+ //
365
+ // Returns a row of the CSV file
366
+ //
367
+ // @param number index The index of the row to fetch
368
+ // @param start OPTIONAL If desired you can specify a column to
369
+ // start at (which starts at 0 by default)
370
+ //
371
+ this.row =
372
+ this.getRow = function (index)
373
+ {
374
+ var row = [],
375
+ start = parseInt(arguments[1]) || 0,
376
+ length = arguments[2];
377
+
378
+ // Convert a string based row name to a
379
+ // numeric index
380
+ if (typeof index === 'string') {
381
+ for (var i=0; i<this.data.length; ++i) {
382
+ if (this.data[i][0] === index) {
383
+ var found = true;
384
+ index = i;
385
+ break;
386
+ }
387
+ }
388
+
389
+ if (!found) {
390
+ return null;
391
+ }
392
+ }
393
+
394
+
395
+ if (start < 0) {
396
+ row = this.data[index].slice(this.data[index].length - Math.abs(start));
397
+ } else {
398
+ row = this.data[index].slice(start);
399
+ }
400
+
401
+ // Zero length
402
+ if (typeof length === 'number' && length === 0) {
403
+ row = [];
404
+
405
+ } else {
406
+ // Positive length
407
+ if (typeof length === 'number' && length > 0) {
408
+ row = row.slice(0, length)
409
+
410
+ // Negative length
411
+ } else if (typeof length === 'number' && length < 0) {
412
+ for (var i=0; i<Math.abs(length); ++i) {
413
+ row.pop();
414
+ }
415
+ }
416
+ }
417
+
418
+
419
+
420
+ return row;
421
+ };
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+ //
431
+ // This fuunction allows you to fetch a column
432
+ // of the HTML table data.
433
+ //
434
+ this.col =
435
+ this.column =
436
+ this.getColumn =
437
+ this.getCol = function (index)
438
+ {
439
+ var col = [],
440
+ start = arguments[1] || 0,
441
+ length = arguments[2];
442
+
443
+
444
+ // Convert a string based column name to a
445
+ // numeric index
446
+ if (RGraph.isString(index)) {
447
+ for (var i=0; i<this.data.length; ++i) {
448
+ if (this.data[0][i] === index) {
449
+ var found = true;
450
+ index = i;
451
+ break;
452
+ }
453
+ }
454
+
455
+ if (!found) {
456
+ return null;
457
+ }
458
+ }
459
+
460
+
461
+ if (start >= 0) {
462
+ for (var i=start; i<this.data.length; i+=1) {
463
+ if (this.data[i]) {
464
+ col.push(this.data[i][index]);
465
+ } else {
466
+ col.push(null);
467
+ }
468
+ }
469
+ } else {
470
+ for (var i=(this.data.length - Math.abs(start)); i<this.data.length; i+=1) {
471
+ if (this.data[i]) {
472
+ col.push(this.data[i][index]);
473
+ } else {
474
+ col.push(null);
475
+ }
476
+ }
477
+ }
478
+
479
+ // Zero length
480
+ if (typeof length === 'number' && length === 0) {
481
+ col = [];
482
+
483
+ } else {
484
+ // Positive length
485
+ if (typeof length === 'number' && length > 0) {
486
+ col = col.slice(0, length)
487
+
488
+ // Negative length
489
+ } else if (typeof length === 'number' && length < 0) {
490
+ for (var i=0; i<Math.abs(length); ++i) {
491
+ col.pop();
492
+ }
493
+ }
494
+ }
495
+
496
+ return col;
497
+ };
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+ // Fetch the CSV file
508
+ this.fetch();
509
+ };