highcharts_rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +106 -0
  9. data/Rakefile +6 -0
  10. data/highcharts_rails.gemspec +27 -0
  11. data/lib/highcharts_rails/version.rb +3 -0
  12. data/lib/highcharts_rails.rb +8 -0
  13. data/vendor/assets/javascripts/highcharts-3d.src.js +2139 -0
  14. data/vendor/assets/javascripts/highcharts-more.src.js +2982 -0
  15. data/vendor/assets/javascripts/highcharts.src.js +22947 -0
  16. data/vendor/assets/javascripts/js/highcharts-3d.src.js +2085 -0
  17. data/vendor/assets/javascripts/js/highcharts-more.src.js +2820 -0
  18. data/vendor/assets/javascripts/js/highcharts.src.js +20917 -0
  19. data/vendor/assets/javascripts/js/modules/accessibility.src.js +1072 -0
  20. data/vendor/assets/javascripts/js/modules/annotations.src.js +408 -0
  21. data/vendor/assets/javascripts/js/modules/boost.src.js +652 -0
  22. data/vendor/assets/javascripts/js/modules/broken-axis.src.js +338 -0
  23. data/vendor/assets/javascripts/js/modules/data.src.js +981 -0
  24. data/vendor/assets/javascripts/js/modules/drilldown.src.js +756 -0
  25. data/vendor/assets/javascripts/js/modules/exporting.src.js +953 -0
  26. data/vendor/assets/javascripts/js/modules/funnel.src.js +290 -0
  27. data/vendor/assets/javascripts/js/modules/gantt.src.js +791 -0
  28. data/vendor/assets/javascripts/js/modules/grid-axis.src.js +545 -0
  29. data/vendor/assets/javascripts/js/modules/heatmap.src.js +798 -0
  30. data/vendor/assets/javascripts/js/modules/no-data-to-display.src.js +150 -0
  31. data/vendor/assets/javascripts/js/modules/offline-exporting.src.js +492 -0
  32. data/vendor/assets/javascripts/js/modules/overlapping-datalabels.src.js +164 -0
  33. data/vendor/assets/javascripts/js/modules/series-label.src.js +606 -0
  34. data/vendor/assets/javascripts/js/modules/solid-gauge.src.js +305 -0
  35. data/vendor/assets/javascripts/js/modules/treemap.src.js +881 -0
  36. data/vendor/assets/javascripts/js/modules/xrange-series.src.js +254 -0
  37. data/vendor/assets/javascripts/js/themes/dark-blue.js +317 -0
  38. data/vendor/assets/javascripts/js/themes/dark-green.js +314 -0
  39. data/vendor/assets/javascripts/js/themes/dark-unica.js +243 -0
  40. data/vendor/assets/javascripts/js/themes/gray.js +326 -0
  41. data/vendor/assets/javascripts/js/themes/grid-light.js +99 -0
  42. data/vendor/assets/javascripts/js/themes/grid.js +131 -0
  43. data/vendor/assets/javascripts/js/themes/sand-signika.js +129 -0
  44. data/vendor/assets/javascripts/js/themes/skies.js +112 -0
  45. data/vendor/assets/javascripts/lib/canvg.src.js +3073 -0
  46. data/vendor/assets/javascripts/lib/jspdf.src.js +3031 -0
  47. data/vendor/assets/javascripts/lib/rgbcolor.src.js +299 -0
  48. data/vendor/assets/javascripts/lib/svg2pdf.src.js +1451 -0
  49. data/vendor/assets/javascripts/modules/accessibility.src.js +1072 -0
  50. data/vendor/assets/javascripts/modules/annotations.src.js +408 -0
  51. data/vendor/assets/javascripts/modules/boost.src.js +652 -0
  52. data/vendor/assets/javascripts/modules/broken-axis.src.js +338 -0
  53. data/vendor/assets/javascripts/modules/data.src.js +981 -0
  54. data/vendor/assets/javascripts/modules/drilldown.src.js +797 -0
  55. data/vendor/assets/javascripts/modules/exporting.src.js +882 -0
  56. data/vendor/assets/javascripts/modules/funnel.src.js +304 -0
  57. data/vendor/assets/javascripts/modules/gantt.src.js +815 -0
  58. data/vendor/assets/javascripts/modules/grid-axis.src.js +547 -0
  59. data/vendor/assets/javascripts/modules/heatmap.src.js +810 -0
  60. data/vendor/assets/javascripts/modules/no-data-to-display.src.js +161 -0
  61. data/vendor/assets/javascripts/modules/offline-exporting.src.js +492 -0
  62. data/vendor/assets/javascripts/modules/overlapping-datalabels.src.js +164 -0
  63. data/vendor/assets/javascripts/modules/series-label.src.js +606 -0
  64. data/vendor/assets/javascripts/modules/solid-gauge.src.js +316 -0
  65. data/vendor/assets/javascripts/modules/treemap.src.js +935 -0
  66. data/vendor/assets/javascripts/modules/xrange-series.src.js +276 -0
  67. data/vendor/assets/javascripts/themes/dark-blue.js +317 -0
  68. data/vendor/assets/javascripts/themes/dark-green.js +314 -0
  69. data/vendor/assets/javascripts/themes/dark-unica.js +243 -0
  70. data/vendor/assets/javascripts/themes/gray.js +326 -0
  71. data/vendor/assets/javascripts/themes/grid-light.js +99 -0
  72. data/vendor/assets/javascripts/themes/grid.js +131 -0
  73. data/vendor/assets/javascripts/themes/sand-signika.js +129 -0
  74. data/vendor/assets/javascripts/themes/skies.js +112 -0
  75. data/vendor/assets/stylesheets/highcharts.scss +610 -0
  76. metadata +161 -0
@@ -0,0 +1,338 @@
1
+ /**
2
+ * @license Highcharts JS v5.0.6 (2016-12-07)
3
+ *
4
+ * (c) 2009-2016 Torstein Honsi
5
+ *
6
+ * License: www.highcharts.com/license
7
+ */
8
+ (function(factory) {
9
+ if (typeof module === 'object' && module.exports) {
10
+ module.exports = factory;
11
+ } else {
12
+ factory(Highcharts);
13
+ }
14
+ }(function(Highcharts) {
15
+ (function(H) {
16
+ /**
17
+ * (c) 2009-2016 Torstein Honsi
18
+ *
19
+ * License: www.highcharts.com/license
20
+ */
21
+ 'use strict';
22
+
23
+ var pick = H.pick,
24
+ wrap = H.wrap,
25
+ each = H.each,
26
+ extend = H.extend,
27
+ fireEvent = H.fireEvent,
28
+ Axis = H.Axis,
29
+ Series = H.Series;
30
+
31
+ function stripArguments() {
32
+ return Array.prototype.slice.call(arguments, 1);
33
+ }
34
+
35
+ extend(Axis.prototype, {
36
+ isInBreak: function(brk, val) {
37
+ var ret,
38
+ repeat = brk.repeat || Infinity,
39
+ from = brk.from,
40
+ length = brk.to - brk.from,
41
+ test = (val >= from ? (val - from) % repeat : repeat - ((from - val) % repeat));
42
+
43
+ if (!brk.inclusive) {
44
+ ret = test < length && test !== 0;
45
+ } else {
46
+ ret = test <= length;
47
+ }
48
+ return ret;
49
+ },
50
+
51
+ isInAnyBreak: function(val, testKeep) {
52
+
53
+ var breaks = this.options.breaks,
54
+ i = breaks && breaks.length,
55
+ inbrk,
56
+ keep,
57
+ ret;
58
+
59
+
60
+ if (i) {
61
+
62
+ while (i--) {
63
+ if (this.isInBreak(breaks[i], val)) {
64
+ inbrk = true;
65
+ if (!keep) {
66
+ keep = pick(breaks[i].showPoints, this.isXAxis ? false : true);
67
+ }
68
+ }
69
+ }
70
+
71
+ if (inbrk && testKeep) {
72
+ ret = inbrk && !keep;
73
+ } else {
74
+ ret = inbrk;
75
+ }
76
+ }
77
+ return ret;
78
+ }
79
+ });
80
+
81
+ wrap(Axis.prototype, 'setTickPositions', function(proceed) {
82
+ proceed.apply(this, Array.prototype.slice.call(arguments, 1));
83
+
84
+ if (this.options.breaks) {
85
+ var axis = this,
86
+ tickPositions = this.tickPositions,
87
+ info = this.tickPositions.info,
88
+ newPositions = [],
89
+ i;
90
+
91
+ for (i = 0; i < tickPositions.length; i++) {
92
+ if (!axis.isInAnyBreak(tickPositions[i])) {
93
+ newPositions.push(tickPositions[i]);
94
+ }
95
+ }
96
+
97
+ this.tickPositions = newPositions;
98
+ this.tickPositions.info = info;
99
+ }
100
+ });
101
+
102
+ wrap(Axis.prototype, 'init', function(proceed, chart, userOptions) {
103
+ // Force Axis to be not-ordinal when breaks are defined
104
+ if (userOptions.breaks && userOptions.breaks.length) {
105
+ userOptions.ordinal = false;
106
+ }
107
+
108
+ proceed.call(this, chart, userOptions);
109
+
110
+ if (this.options.breaks) {
111
+
112
+ var axis = this;
113
+
114
+ axis.isBroken = true;
115
+
116
+ this.val2lin = function(val) {
117
+ var nval = val,
118
+ brk,
119
+ i;
120
+
121
+ for (i = 0; i < axis.breakArray.length; i++) {
122
+ brk = axis.breakArray[i];
123
+ if (brk.to <= val) {
124
+ nval -= brk.len;
125
+ } else if (brk.from >= val) {
126
+ break;
127
+ } else if (axis.isInBreak(brk, val)) {
128
+ nval -= (val - brk.from);
129
+ break;
130
+ }
131
+ }
132
+
133
+ return nval;
134
+ };
135
+
136
+ this.lin2val = function(val) {
137
+ var nval = val,
138
+ brk,
139
+ i;
140
+
141
+ for (i = 0; i < axis.breakArray.length; i++) {
142
+ brk = axis.breakArray[i];
143
+ if (brk.from >= nval) {
144
+ break;
145
+ } else if (brk.to < nval) {
146
+ nval += brk.len;
147
+ } else if (axis.isInBreak(brk, nval)) {
148
+ nval += brk.len;
149
+ }
150
+ }
151
+ return nval;
152
+ };
153
+
154
+ this.setExtremes = function(newMin, newMax, redraw, animation, eventArguments) {
155
+ // If trying to set extremes inside a break, extend it to before and after the break ( #3857 )
156
+ while (this.isInAnyBreak(newMin)) {
157
+ newMin -= this.closestPointRange;
158
+ }
159
+ while (this.isInAnyBreak(newMax)) {
160
+ newMax -= this.closestPointRange;
161
+ }
162
+ Axis.prototype.setExtremes.call(this, newMin, newMax, redraw, animation, eventArguments);
163
+ };
164
+
165
+ this.setAxisTranslation = function(saveOld) {
166
+ Axis.prototype.setAxisTranslation.call(this, saveOld);
167
+
168
+ var breaks = axis.options.breaks,
169
+ breakArrayT = [], // Temporary one
170
+ breakArray = [],
171
+ length = 0,
172
+ inBrk,
173
+ repeat,
174
+ brk,
175
+ min = axis.userMin || axis.min,
176
+ max = axis.userMax || axis.max,
177
+ start,
178
+ i,
179
+ j;
180
+
181
+ // Min & max check (#4247)
182
+ for (i in breaks) {
183
+ brk = breaks[i];
184
+ repeat = brk.repeat || Infinity;
185
+ if (axis.isInBreak(brk, min)) {
186
+ min += (brk.to % repeat) - (min % repeat);
187
+ }
188
+ if (axis.isInBreak(brk, max)) {
189
+ max -= (max % repeat) - (brk.from % repeat);
190
+ }
191
+ }
192
+
193
+ // Construct an array holding all breaks in the axis
194
+ for (i in breaks) {
195
+ brk = breaks[i];
196
+ start = brk.from;
197
+ repeat = brk.repeat || Infinity;
198
+
199
+ while (start - repeat > min) {
200
+ start -= repeat;
201
+ }
202
+ while (start < min) {
203
+ start += repeat;
204
+ }
205
+
206
+ for (j = start; j < max; j += repeat) {
207
+ breakArrayT.push({
208
+ value: j,
209
+ move: 'in'
210
+ });
211
+ breakArrayT.push({
212
+ value: j + (brk.to - brk.from),
213
+ move: 'out',
214
+ size: brk.breakSize
215
+ });
216
+ }
217
+ }
218
+
219
+ breakArrayT.sort(function(a, b) {
220
+ var ret;
221
+ if (a.value === b.value) {
222
+ ret = (a.move === 'in' ? 0 : 1) - (b.move === 'in' ? 0 : 1);
223
+ } else {
224
+ ret = a.value - b.value;
225
+ }
226
+ return ret;
227
+ });
228
+
229
+ // Simplify the breaks
230
+ inBrk = 0;
231
+ start = min;
232
+
233
+ for (i in breakArrayT) {
234
+ brk = breakArrayT[i];
235
+ inBrk += (brk.move === 'in' ? 1 : -1);
236
+
237
+ if (inBrk === 1 && brk.move === 'in') {
238
+ start = brk.value;
239
+ }
240
+ if (inBrk === 0) {
241
+ breakArray.push({
242
+ from: start,
243
+ to: brk.value,
244
+ len: brk.value - start - (brk.size || 0)
245
+ });
246
+ length += brk.value - start - (brk.size || 0);
247
+ }
248
+ }
249
+
250
+ axis.breakArray = breakArray;
251
+
252
+ fireEvent(axis, 'afterBreaks');
253
+
254
+ axis.transA *= ((max - axis.min) / (max - min - length));
255
+
256
+ axis.min = min;
257
+ axis.max = max;
258
+ };
259
+ }
260
+ });
261
+
262
+ wrap(Series.prototype, 'generatePoints', function(proceed) {
263
+
264
+ proceed.apply(this, stripArguments(arguments));
265
+
266
+ var series = this,
267
+ xAxis = series.xAxis,
268
+ yAxis = series.yAxis,
269
+ points = series.points,
270
+ point,
271
+ i = points.length,
272
+ connectNulls = series.options.connectNulls,
273
+ nullGap;
274
+
275
+
276
+ if (xAxis && yAxis && (xAxis.options.breaks || yAxis.options.breaks)) {
277
+ while (i--) {
278
+ point = points[i];
279
+
280
+ nullGap = point.y === null && connectNulls === false; // respect nulls inside the break (#4275)
281
+ if (!nullGap && (xAxis.isInAnyBreak(point.x, true) || yAxis.isInAnyBreak(point.y, true))) {
282
+ points.splice(i, 1);
283
+ if (this.data[i]) {
284
+ this.data[i].destroyElements(); // removes the graphics for this point if they exist
285
+ }
286
+ }
287
+ }
288
+ }
289
+
290
+ });
291
+
292
+ function drawPointsWrapped(proceed) {
293
+ proceed.apply(this);
294
+ this.drawBreaks(this.xAxis, ['x']);
295
+ this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y']));
296
+ }
297
+
298
+ H.Series.prototype.drawBreaks = function(axis, keys) {
299
+ var series = this,
300
+ points = series.points,
301
+ breaks,
302
+ threshold,
303
+ eventName,
304
+ y;
305
+
306
+ if (!axis) {
307
+ return; // #5950
308
+ }
309
+
310
+ each(keys, function(key) {
311
+ breaks = axis.breakArray || [];
312
+ threshold = axis.isXAxis ? axis.min : pick(series.options.threshold, axis.min);
313
+ each(points, function(point) {
314
+ y = pick(point['stack' + key.toUpperCase()], point[key]);
315
+ each(breaks, function(brk) {
316
+ eventName = false;
317
+
318
+ if ((threshold < brk.from && y > brk.to) || (threshold > brk.from && y < brk.from)) {
319
+ eventName = 'pointBreak';
320
+ } else if ((threshold < brk.from && y > brk.from && y < brk.to) || (threshold > brk.from && y > brk.to && y < brk.from)) { // point falls inside the break
321
+ eventName = 'pointInBreak';
322
+ }
323
+ if (eventName) {
324
+ fireEvent(axis, eventName, {
325
+ point: point,
326
+ brk: brk
327
+ });
328
+ }
329
+ });
330
+ });
331
+ });
332
+ };
333
+
334
+ wrap(H.seriesTypes.column.prototype, 'drawPoints', drawPointsWrapped);
335
+ wrap(H.Series.prototype, 'drawPoints', drawPointsWrapped);
336
+
337
+ }(Highcharts));
338
+ }));