rgraph-rails 1.0.5 → 1.0.6

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.
Files changed (67) hide show
  1. checksums.yaml +8 -8
  2. data/.travis.yml +0 -1
  3. data/README.md +3 -3
  4. data/lib/rgraph-rails/version.rb +1 -1
  5. data/vendor/assets/javascripts/RGraph.bar.js +239 -3764
  6. data/vendor/assets/javascripts/RGraph.bipolar.js +115 -1986
  7. data/vendor/assets/javascripts/RGraph.common.annotate.js +35 -399
  8. data/vendor/assets/javascripts/RGraph.common.context.js +30 -600
  9. data/vendor/assets/javascripts/RGraph.common.core.js +403 -5187
  10. data/vendor/assets/javascripts/RGraph.common.csv.js +19 -275
  11. data/vendor/assets/javascripts/RGraph.common.deprecated.js +35 -454
  12. data/vendor/assets/javascripts/RGraph.common.dynamic.js +84 -1189
  13. data/vendor/assets/javascripts/RGraph.common.effects.js +90 -1548
  14. data/vendor/assets/javascripts/RGraph.common.key.js +54 -755
  15. data/vendor/assets/javascripts/RGraph.common.resizing.js +37 -567
  16. data/vendor/assets/javascripts/RGraph.common.sheets.js +29 -356
  17. data/vendor/assets/javascripts/RGraph.common.tooltips.js +32 -614
  18. data/vendor/assets/javascripts/RGraph.common.zoom.js +14 -223
  19. data/vendor/assets/javascripts/RGraph.cornergauge.js +71 -0
  20. data/vendor/assets/javascripts/RGraph.drawing.background.js +35 -620
  21. data/vendor/assets/javascripts/RGraph.drawing.circle.js +35 -576
  22. data/vendor/assets/javascripts/RGraph.drawing.image.js +52 -807
  23. data/vendor/assets/javascripts/RGraph.drawing.marker1.js +41 -717
  24. data/vendor/assets/javascripts/RGraph.drawing.marker2.js +37 -668
  25. data/vendor/assets/javascripts/RGraph.drawing.marker3.js +36 -563
  26. data/vendor/assets/javascripts/RGraph.drawing.poly.js +40 -608
  27. data/vendor/assets/javascripts/RGraph.drawing.rect.js +35 -597
  28. data/vendor/assets/javascripts/RGraph.drawing.text.js +34 -642
  29. data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +50 -809
  30. data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +51 -856
  31. data/vendor/assets/javascripts/RGraph.fuel.js +58 -964
  32. data/vendor/assets/javascripts/RGraph.funnel.js +55 -984
  33. data/vendor/assets/javascripts/RGraph.gantt.js +75 -1241
  34. data/vendor/assets/javascripts/RGraph.gauge.js +87 -1397
  35. data/vendor/assets/javascripts/RGraph.hbar.js +143 -2376
  36. data/vendor/assets/javascripts/RGraph.hprogress.js +80 -1397
  37. data/vendor/assets/javascripts/RGraph.line.js +241 -4162
  38. data/vendor/assets/javascripts/RGraph.meter.js +74 -1278
  39. metadata +3 -30
  40. data/vendor/assets/images/bg.png +0 -0
  41. data/vendor/assets/images/bullet.png +0 -0
  42. data/vendor/assets/images/facebook-large.png +0 -0
  43. data/vendor/assets/images/google-plus-large.png +0 -0
  44. data/vendor/assets/images/logo.png +0 -0
  45. data/vendor/assets/images/meter-image-sd-needle.png +0 -0
  46. data/vendor/assets/images/meter-image-sd.png +0 -0
  47. data/vendor/assets/images/meter-sketch-needle.png +0 -0
  48. data/vendor/assets/images/meter-sketch.png +0 -0
  49. data/vendor/assets/images/odometer-background.png +0 -0
  50. data/vendor/assets/images/rgraph.jpg +0 -0
  51. data/vendor/assets/images/title.png +0 -0
  52. data/vendor/assets/images/twitter-large.png +0 -0
  53. data/vendor/assets/javascripts/RGraph.modaldialog.js +0 -301
  54. data/vendor/assets/javascripts/RGraph.odo.js +0 -1265
  55. data/vendor/assets/javascripts/RGraph.pie.js +0 -2272
  56. data/vendor/assets/javascripts/RGraph.radar.js +0 -1847
  57. data/vendor/assets/javascripts/RGraph.rose.js +0 -1877
  58. data/vendor/assets/javascripts/RGraph.rscatter.js +0 -1425
  59. data/vendor/assets/javascripts/RGraph.scatter.js +0 -2970
  60. data/vendor/assets/javascripts/RGraph.semicircularprogress.js +0 -1015
  61. data/vendor/assets/javascripts/RGraph.thermometer.js +0 -1129
  62. data/vendor/assets/javascripts/RGraph.vprogress.js +0 -1452
  63. data/vendor/assets/javascripts/RGraph.waterfall.js +0 -1252
  64. data/vendor/assets/javascripts/financial-data.js +0 -1067
  65. data/vendor/assets/stylesheets/ModalDialog.css +0 -90
  66. data/vendor/assets/stylesheets/animations.css +0 -3347
  67. data/vendor/assets/stylesheets/website.css +0 -446
@@ -1,357 +1,30 @@
1
- // version: 2016-06-04
2
- /**
3
- * o--------------------------------------------------------------------------------o
4
- * | This file is part of the RGraph package - you can learn more at: |
5
- * | |
6
- * | http://www.rgraph.net |
7
- * | |
8
- * | RGraph is dual licensed under the Open Source GPL (General Public License) |
9
- * | v2.0 license and a commercial license which means that you're not bound by |
10
- * | the terms of the GPL. The commercial license starts at just 99 GBP and |
11
- * | you can read about it here: |
12
- * | |
13
- * | http://www.rgraph.net/license |
14
- * o--------------------------------------------------------------------------------o
15
- */
16
1
 
17
- /**
18
- * Initialise the various objects
19
- */
20
- RGraph = window.RGraph || {isRGraph: true};
21
-
22
- // Module pattern
23
- (function (win, doc, undefined)
24
- {
25
- RGraph.Sheets = function (key)
26
- {
27
- var worksheet,
28
- callback,
29
- letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
30
-
31
- // 3 arguments
32
- if (arguments.length === 3) {
33
- worksheet = Number(arguments[1]);
34
- callback = arguments[2];
35
-
36
- // 2 arguments
37
- } else {
38
- worksheet = 1;
39
- callback = arguments[1];
40
- }
41
-
42
- var url = 'https://spreadsheets.google.com/feeds/cells/[KEY]/[WORKSHEET]/public/full?alt=json-in-script&callback=__rgraph_JSONPCallback'.replace(/\[KEY\]/, key).replace(/\[WORKSHEET\]/, worksheet);
43
-
44
- /*
45
- * https://spreadsheets.google.com/feeds/cells/1q_BMjvKO_kKbAO3VjoaITSDyrLAk8f0SK5UFMmE3oRs/2/public/full?alt=json-in-script
46
- */
47
-
48
-
49
-
50
-
51
-
52
- //
53
- // Loads the spreadsheet
54
- //
55
- this.load = function(url, userCallback)
56
- {
57
- var obj = this;
58
-
59
- // A global on purpose
60
- __rgraph_JSONPCallback = function (json)
61
- {
62
- // Save the JSON on the RGraph.Sheets object
63
- obj.json = json;
64
-
65
- //
66
- // Put the entries in the JSON feed into a grid
67
- //
68
- var grid = [], row = 0, col = 0;
69
-
70
- for (var i=0; i<json.feed.entry.length; ++i) {
71
-
72
- row = json.feed.entry[i].gs$cell.row - 1;
73
- col = json.feed.entry[i].gs$cell.col - 1;
74
-
75
- if (!grid[row]) {
76
- grid[row] = [];
77
- }
78
-
79
- grid[row][col] = json.feed.entry[i].content.$t;
80
- }
81
-
82
-
83
- //
84
- // Determine the longest row
85
- //
86
- var maxcols = 0; // The max length of the rows
87
-
88
- for (var i=0; i<grid.length; ++i) {
89
- maxcols = grid[i] ? Math.max(maxcols, grid[i].length) : maxcols;
90
- }
91
-
92
-
93
-
94
- //
95
- // Now go through the array and fill in any blank holes.
96
- //
97
- for (var i=0; i<grid.length; ++i) {
98
-
99
- if (typeof grid[i] === 'undefined') {
100
- grid[i] = new Array(maxcols);
101
- }
102
-
103
- for (var j=0; j<maxcols; j++) {
104
- if (typeof grid[i][j] === 'undefined') {
105
- grid[i][j] = '';
106
- }
107
-
108
- // Convert numbers to real numbers and floats here too
109
- if (grid[i][j].match(/^[0-9]+$/)) {
110
- grid[i][j] = parseInt(grid[i][j]);
111
- } else if (grid[i][j].match(/^[0-9.]+$/)) {
112
- grid[i][j] = parseFloat(grid[i][j]);
113
- }
114
- }
115
- }
116
-
117
- //
118
- // Save the grid on the object
119
- //
120
- obj.data = grid;
121
-
122
-
123
-
124
- //
125
- // Call the users callback function. Users can access the raw data if
126
- // they want with the obj.data property or by using the accessor
127
- // methods (better)
128
- //
129
- userCallback(obj);
130
- };
131
-
132
- // Add the new script tag to the document that pulls in the JSON
133
- //
134
- // With jQuery...
135
- //
136
- //$('body').append("<script src='" + url + "'></script>");
137
- //
138
- // And without jQuery...
139
-
140
- var scriptNode = document.createElement('SCRIPT');
141
- scriptNode.src = url;
142
- document.body.appendChild(scriptNode);
143
- };
144
-
145
-
146
-
147
-
148
- //
149
- // Fetches a row of data and returns it
150
- //
151
- // @param id number The numeric index of the column to fetch (starts at 1)
152
- // @param start number The index to start fetching/returning at. The first
153
- // character is 1
154
- // @param opt An option object containing options
155
- //
156
- this.row = function (index, start)
157
- {
158
- var opt = {}, row;
159
-
160
- // Default for start is 1
161
- start = start || 1;
162
-
163
- //
164
- // Parse the .trim argument
165
- //
166
-
167
- if (arguments && typeof arguments[2] === 'object' && typeof arguments[2].trim === 'boolean') {
168
- opt.trim = arguments[2].trim;
169
- } else {
170
- opt.trim = true;
171
- }
172
-
173
- row = this.data[index - 1].slice(start - 1);
174
-
175
- // Trim the array if required
176
- if (opt.trim) {
177
- row = RGraph.arrayTrim(row);
178
- }
179
-
180
- return row;
181
- };
182
-
183
-
184
-
185
- //
186
- // Fetches a column of data and returns it
187
- //
188
- // @param id number The letter that corresponds to the column
189
- // @param start number The index to start fetching/returning at. The first
190
- // character is 1
191
- // @param opt An option object containing options
192
- //
193
- this.col = function (index, start)
194
- {
195
- var opt = {},
196
- col = [];
197
-
198
- // Default for start is 1
199
- start = start || 1;
200
-
201
- if (arguments && typeof arguments[2] === 'object' && typeof arguments[2].trim === 'boolean') {
202
- opt.trim = arguments[2].trim;
203
- } else {
204
- opt.trim = true;
205
- }
206
-
207
- for (var i=0; i<this.data.length; ++i) {
208
- col.push(this.data[i][index - 1]);
209
- }
210
-
211
- // Trim the array if required
212
- if (opt.trim) {
213
- col = RGraph.arrayTrim(col);
214
- }
215
-
216
- // Now account for the start index
217
-
218
- col = col.slice(start - 1);
219
-
220
- return col;
221
- };
222
-
223
-
224
-
225
- //
226
- // Returns the index (zero index) of the given letters
227
- //
228
- this.getIndexOfLetters = function (l)
229
- {
230
- var parts = l.split('');
231
-
232
- if (parts.length === 1) {
233
- return letters.indexOf(l) + 1;
234
- } else if (parts.length === 2){
235
- var idx = ((letters.indexOf(parts[0]) + 1) * 26) + (letters.indexOf(parts[1]) + 1);
236
- return idx;
237
- }
238
- }
239
-
240
-
241
-
242
-
243
-
244
- //
245
- // The get method makes retrieving cells very straightforward,
246
- // for example: obj.get('B1');
247
- //
248
- // @param str string The cells(s) to fetch
249
- // @param string Optional set of options that are passed
250
- // to the relevant row/col function
251
- //
252
- this.get = function (str)
253
- {
254
- // Uppercase letters please!
255
- str = str.toUpperCase();
256
-
257
- //
258
- // Handle the style of .get('C') or .get('AA'
259
- //
260
- if (str.match(/^[a-z]+$/i)) {
261
- if (str.length === 1) {
262
- var index = letters.indexOf(str) + 1;
263
- return this.col(index, 1, arguments[1]);
264
-
265
- } else if (str.length === 2) {
266
- var index = ((letters.indexOf(str[0]) + 1) * 26) + letters.indexOf(str[1]) + 1;
267
- return this.col(index, 1, arguments[1]);
268
- }
269
- }
270
-
271
-
272
-
273
-
274
- //
275
- // Handle the style of .get('2');
276
- //(fetching a whole row
277
- //
278
- if (str.match(/^[0-9]+$/i)) {
279
- return this.row(str, null, arguments[1]);
280
- }
281
-
282
-
283
-
284
-
285
- //
286
- // Handle the style of .get('E2');
287
- //(fetching a single cell)
288
- //
289
- if (str.match(/^([a-z]{1,2})([0-9]+)$/i)) {
290
-
291
- var letter = RegExp.$1,
292
- number = RegExp.$2,
293
- col = this.get(letter, {trim: false});
294
-
295
-
296
- return col[number - 1];
297
- }
298
-
299
-
300
-
301
-
302
- //
303
- // Handle the style of .get('B2:E2');
304
- //(fetching the E2 cell to the E2 cell)
305
- //
306
- if (str.match(/^([a-z]{1,2})([0-9]+):([a-z]{1,2})([0-9]+)$/i)) {
307
-
308
- var letter1 = RegExp.$1,
309
- number1 = RegExp.$2,
310
- letter2 = RegExp.$3,
311
- number2 = RegExp.$4
312
-
313
-
314
- if (letter1 === letter2) {
315
- var cells = [],
316
- index = this.getIndexOfLetters(letter1),
317
- col = this.col(index, null, {trim: false});
318
-
319
- for (var i=(number1 - 1); i<=(number2 - 1); ++i) {
320
- cells.push(col[i]);
321
- }
322
-
323
- } else if (number1 === number2) {
324
-
325
- var cells = [],
326
- row = this.row(number1, null, {trim: false}),
327
- index1 = this.getIndexOfLetters(letter1),
328
- index2 = this.getIndexOfLetters(letter2)
329
-
330
- for (var i=(index1 - 1); i<=(index2 - 1); ++i) {
331
- cells.push(row[i]);
332
- }
333
- }
334
-
335
- // Trim the results
336
- if (arguments[1] && arguments[1].trim === false) {
337
- // Nada
338
- } else {
339
- cells = RGraph.arrayTrim(cells);
340
- }
341
-
342
- return cells;
343
-
344
- }
345
- };
346
-
347
-
348
-
349
-
350
- //
351
- // Load the data
352
- //
353
- this.load(url, callback);
354
- };
355
-
356
- // End module pattern
357
- })(window, document);
2
+ RGraph=window.RGraph||{isRGraph:true};(function(win,doc,undefined)
3
+ {RGraph.Sheets=function(key)
4
+ {var worksheet,callback,letters='ABCDEFGHIJKLMNOPQRSTUVWXYZ';if(arguments.length===3){worksheet=Number(arguments[1]);callback=arguments[2];}else{worksheet=1;callback=arguments[1];}
5
+ var url='https://spreadsheets.google.com/feeds/cells/[KEY]/[WORKSHEET]/public/full?alt=json-in-script&callback=__rgraph_JSONPCallback'.replace(/\[KEY\]/,key).replace(/\[WORKSHEET\]/,worksheet);this.load=function(url,userCallback)
6
+ {var obj=this;__rgraph_JSONPCallback=function(json)
7
+ {obj.json=json;var grid=[],row=0,col=0;for(var i=0;i<json.feed.entry.length;++i){row=json.feed.entry[i].gs$cell.row-1;col=json.feed.entry[i].gs$cell.col-1;if(!grid[row]){grid[row]=[];}
8
+ grid[row][col]=json.feed.entry[i].content.$t;}
9
+ var maxcols=0;for(var i=0;i<grid.length;++i){maxcols=grid[i]?Math.max(maxcols,grid[i].length):maxcols;}
10
+ for(var i=0;i<grid.length;++i){if(typeof grid[i]==='undefined'){grid[i]=new Array(maxcols);}
11
+ for(var j=0;j<maxcols;j++){if(typeof grid[i][j]==='undefined'){grid[i][j]='';}
12
+ if(grid[i][j].match(/^[0-9]+$/)){grid[i][j]=parseInt(grid[i][j]);}else if(grid[i][j].match(/^[0-9.]+$/)){grid[i][j]=parseFloat(grid[i][j]);}}}
13
+ obj.data=grid;userCallback(obj);};var scriptNode=document.createElement('SCRIPT');scriptNode.src=url;document.body.appendChild(scriptNode);};this.row=function(index,start)
14
+ {var opt={},row;start=start||1;if(arguments&&typeof arguments[2]==='object'&&typeof arguments[2].trim==='boolean'){opt.trim=arguments[2].trim;}else{opt.trim=true;}
15
+ row=this.data[index-1].slice(start-1);if(opt.trim){row=RGraph.arrayTrim(row);}
16
+ return row;};this.col=function(index,start)
17
+ {var opt={},col=[];start=start||1;if(arguments&&typeof arguments[2]==='object'&&typeof arguments[2].trim==='boolean'){opt.trim=arguments[2].trim;}else{opt.trim=true;}
18
+ for(var i=0;i<this.data.length;++i){col.push(this.data[i][index-1]);}
19
+ if(opt.trim){col=RGraph.arrayTrim(col);}
20
+ col=col.slice(start-1);return col;};this.getIndexOfLetters=function(l)
21
+ {var parts=l.split('');if(parts.length===1){return letters.indexOf(l)+1;}else if(parts.length===2){var idx=((letters.indexOf(parts[0])+1)*26)+(letters.indexOf(parts[1])+1);return idx;}}
22
+ this.get=function(str)
23
+ {str=str.toUpperCase();if(str.match(/^[a-z]+$/i)){if(str.length===1){var index=letters.indexOf(str)+1;return this.col(index,1,arguments[1]);}else if(str.length===2){var index=((letters.indexOf(str[0])+1)*26)+letters.indexOf(str[1])+1;return this.col(index,1,arguments[1]);}}
24
+ if(str.match(/^[0-9]+$/i)){return this.row(str,null,arguments[1]);}
25
+ if(str.match(/^([a-z]{1,2})([0-9]+)$/i)){var letter=RegExp.$1,number=RegExp.$2,col=this.get(letter,{trim:false});return col[number-1];}
26
+ if(str.match(/^([a-z]{1,2})([0-9]+):([a-z]{1,2})([0-9]+)$/i)){var letter1=RegExp.$1,number1=RegExp.$2,letter2=RegExp.$3,number2=RegExp.$4
27
+ if(letter1===letter2){var cells=[],index=this.getIndexOfLetters(letter1),col=this.col(index,null,{trim:false});for(var i=(number1-1);i<=(number2-1);++i){cells.push(col[i]);}}else if(number1===number2){var cells=[],row=this.row(number1,null,{trim:false}),index1=this.getIndexOfLetters(letter1),index2=this.getIndexOfLetters(letter2)
28
+ for(var i=(index1-1);i<=(index2-1);++i){cells.push(row[i]);}}
29
+ if(arguments[1]&&arguments[1].trim===false){}else{cells=RGraph.arrayTrim(cells);}
30
+ return cells;}};this.load(url,callback);};})(window,document);