highcharts-rails 4.2.7 → 5.0.0

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