highcharts-rails 5.0.14 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.markdown +60 -0
  3. data/Rakefile +54 -5
  4. data/app/assets/images/highcharts/earth.svg +432 -0
  5. data/app/assets/javascripts/highcharts.js +5103 -3147
  6. data/app/assets/javascripts/highcharts/highcharts-3d.js +930 -277
  7. data/app/assets/javascripts/highcharts/highcharts-more.js +1374 -249
  8. data/app/assets/javascripts/highcharts/lib/canvg.js +3073 -0
  9. data/app/assets/javascripts/highcharts/lib/jspdf.js +16624 -0
  10. data/app/assets/javascripts/highcharts/lib/rgbcolor.js +299 -0
  11. data/app/assets/javascripts/highcharts/lib/svg2pdf.js +3488 -0
  12. data/app/assets/javascripts/highcharts/modules/accessibility.js +654 -212
  13. data/app/assets/javascripts/highcharts/modules/annotations.js +1552 -274
  14. data/app/assets/javascripts/highcharts/modules/boost-canvas.js +773 -0
  15. data/app/assets/javascripts/highcharts/modules/boost.js +636 -210
  16. data/app/assets/javascripts/highcharts/modules/broken-axis.js +2 -2
  17. data/app/assets/javascripts/highcharts/modules/bullet.js +364 -0
  18. data/app/assets/javascripts/highcharts/modules/data.js +766 -38
  19. data/app/assets/javascripts/highcharts/modules/drag-panes.js +588 -0
  20. data/app/assets/javascripts/highcharts/modules/drilldown.js +106 -36
  21. data/app/assets/javascripts/highcharts/modules/export-data.js +597 -0
  22. data/app/assets/javascripts/highcharts/modules/exporting.js +424 -162
  23. data/app/assets/javascripts/highcharts/modules/funnel.js +144 -22
  24. data/app/assets/javascripts/highcharts/modules/gantt.js +1154 -0
  25. data/app/assets/javascripts/highcharts/modules/grid-axis.js +1 -1
  26. data/app/assets/javascripts/highcharts/modules/heatmap.js +406 -80
  27. data/app/assets/javascripts/highcharts/modules/histogram-bellcurve.js +513 -0
  28. data/app/assets/javascripts/highcharts/modules/item-series.js +126 -0
  29. data/app/assets/javascripts/highcharts/modules/no-data-to-display.js +31 -13
  30. data/app/assets/javascripts/highcharts/modules/offline-exporting.js +179 -57
  31. data/app/assets/javascripts/highcharts/modules/oldie.js +1378 -0
  32. data/app/assets/javascripts/highcharts/modules/overlapping-datalabels.js +8 -6
  33. data/app/assets/javascripts/highcharts/modules/parallel-coordinates.js +494 -0
  34. data/app/assets/javascripts/highcharts/modules/pareto.js +275 -0
  35. data/app/assets/javascripts/highcharts/modules/sankey.js +641 -0
  36. data/app/assets/javascripts/highcharts/modules/series-label.js +355 -145
  37. data/app/assets/javascripts/highcharts/modules/solid-gauge.js +122 -1
  38. data/app/assets/javascripts/highcharts/modules/static-scale.js +64 -0
  39. data/app/assets/javascripts/highcharts/modules/stock.js +1944 -676
  40. data/app/assets/javascripts/highcharts/modules/streamgraph.js +139 -0
  41. data/app/assets/javascripts/highcharts/modules/sunburst.js +2403 -0
  42. data/app/assets/javascripts/highcharts/modules/tilemap.js +1199 -0
  43. data/app/assets/javascripts/highcharts/modules/treemap.js +538 -134
  44. data/app/assets/javascripts/highcharts/modules/variable-pie.js +490 -0
  45. data/app/assets/javascripts/highcharts/modules/variwide.js +283 -0
  46. data/app/assets/javascripts/highcharts/modules/vector.js +294 -0
  47. data/app/assets/javascripts/highcharts/modules/windbarb.js +490 -0
  48. data/app/assets/javascripts/highcharts/modules/wordcloud.js +681 -0
  49. data/app/assets/javascripts/highcharts/modules/xrange.js +615 -0
  50. data/app/assets/javascripts/highcharts/themes/avocado.js +54 -0
  51. data/app/assets/javascripts/highcharts/themes/dark-blue.js +6 -6
  52. data/app/assets/javascripts/highcharts/themes/dark-green.js +6 -6
  53. data/app/assets/javascripts/highcharts/themes/dark-unica.js +6 -6
  54. data/app/assets/javascripts/highcharts/themes/gray.js +14 -10
  55. data/app/assets/javascripts/highcharts/themes/grid-light.js +6 -6
  56. data/app/assets/javascripts/highcharts/themes/grid.js +7 -5
  57. data/app/assets/javascripts/highcharts/themes/sand-signika.js +8 -7
  58. data/app/assets/javascripts/highcharts/themes/skies.js +15 -9
  59. data/app/assets/javascripts/highcharts/themes/sunset.js +53 -0
  60. data/app/assets/stylesheets/highcharts/highcharts.css +802 -0
  61. data/app/assets/stylesheets/highcharts/highcharts.scss +665 -0
  62. data/lib/highcharts/version.rb +1 -1
  63. metadata +31 -1
@@ -0,0 +1,490 @@
1
+ /**
2
+ * @license Highcharts JS v6.0.0 (2017-10-04)
3
+ * Wind barb series module
4
+ *
5
+ * (c) 2010-2017 Torstein Honsi
6
+ *
7
+ * License: www.highcharts.com/license
8
+ */
9
+ 'use strict';
10
+ (function(factory) {
11
+ if (typeof module === 'object' && module.exports) {
12
+ module.exports = factory;
13
+ } else {
14
+ factory(Highcharts);
15
+ }
16
+ }(function(Highcharts) {
17
+ var onSeriesMixin = (function(H) {
18
+ /**
19
+ * (c) 2010-2017 Torstein Honsi
20
+ *
21
+ * License: www.highcharts.com/license
22
+ */
23
+
24
+ var each = H.each,
25
+ seriesTypes = H.seriesTypes,
26
+ stableSort = H.stableSort;
27
+
28
+ var onSeriesMixin = {
29
+ /**
30
+ * Extend the translate method by placing the point on the related series
31
+ */
32
+ translate: function() {
33
+
34
+ seriesTypes.column.prototype.translate.apply(this);
35
+
36
+ var series = this,
37
+ options = series.options,
38
+ chart = series.chart,
39
+ points = series.points,
40
+ cursor = points.length - 1,
41
+ point,
42
+ lastPoint,
43
+ optionsOnSeries = options.onSeries,
44
+ onSeries = optionsOnSeries && chart.get(optionsOnSeries),
45
+ onKey = options.onKey || 'y',
46
+ step = onSeries && onSeries.options.step,
47
+ onData = onSeries && onSeries.points,
48
+ i = onData && onData.length,
49
+ xAxis = series.xAxis,
50
+ yAxis = series.yAxis,
51
+ xAxisExt = xAxis.getExtremes(),
52
+ xOffset = 0,
53
+ leftPoint,
54
+ lastX,
55
+ rightPoint,
56
+ currentDataGrouping;
57
+
58
+ // relate to a master series
59
+ if (onSeries && onSeries.visible && i) {
60
+ xOffset = (onSeries.pointXOffset || 0) + (onSeries.barW || 0) / 2;
61
+ currentDataGrouping = onSeries.currentDataGrouping;
62
+ lastX = (
63
+ onData[i - 1].x +
64
+ (currentDataGrouping ? currentDataGrouping.totalRange : 0)
65
+ ); // #2374
66
+
67
+ // sort the data points
68
+ stableSort(points, function(a, b) {
69
+ return (a.x - b.x);
70
+ });
71
+
72
+ onKey = 'plot' + onKey[0].toUpperCase() + onKey.substr(1);
73
+ while (i-- && points[cursor]) {
74
+ point = points[cursor];
75
+ leftPoint = onData[i];
76
+ if (leftPoint.x <= point.x && leftPoint[onKey] !== undefined) {
77
+ if (point.x <= lastX) { // #803
78
+
79
+ point.plotY = leftPoint[onKey];
80
+
81
+ // interpolate between points, #666
82
+ if (leftPoint.x < point.x && !step) {
83
+ rightPoint = onData[i + 1];
84
+ if (rightPoint && rightPoint[onKey] !== undefined) {
85
+ point.plotY +=
86
+ // the distance ratio, between 0 and 1
87
+ (
88
+ (point.x - leftPoint.x) /
89
+ (rightPoint.x - leftPoint.x)
90
+ ) *
91
+ // the y distance
92
+ (rightPoint[onKey] - leftPoint[onKey]);
93
+ }
94
+ }
95
+ }
96
+ cursor--;
97
+ i++; // check again for points in the same x position
98
+ if (cursor < 0) {
99
+ break;
100
+ }
101
+ }
102
+ }
103
+ }
104
+
105
+ // Add plotY position and handle stacking
106
+ each(points, function(point, i) {
107
+
108
+ var stackIndex;
109
+
110
+ // Undefined plotY means the point is either on axis, outside series
111
+ // range or hidden series. If the series is outside the range of the
112
+ // x axis it should fall through with an undefined plotY, but then
113
+ // we must remove the shapeArgs (#847).
114
+ if (point.plotY === undefined) {
115
+ if (point.x >= xAxisExt.min && point.x <= xAxisExt.max) {
116
+ // we're inside xAxis range
117
+ point.plotY = chart.chartHeight - xAxis.bottom -
118
+ (xAxis.opposite ? xAxis.height : 0) +
119
+ xAxis.offset - yAxis.top; // #3517
120
+ } else {
121
+ point.shapeArgs = {}; // 847
122
+ }
123
+ }
124
+ point.plotX += xOffset; // #2049
125
+ // if multiple flags appear at the same x, order them into a stack
126
+ lastPoint = points[i - 1];
127
+ if (lastPoint && lastPoint.plotX === point.plotX) {
128
+ if (lastPoint.stackIndex === undefined) {
129
+ lastPoint.stackIndex = 0;
130
+ }
131
+ stackIndex = lastPoint.stackIndex + 1;
132
+ }
133
+ point.stackIndex = stackIndex; // #3639
134
+ });
135
+
136
+
137
+ }
138
+ };
139
+ return onSeriesMixin;
140
+ }(Highcharts));
141
+ (function(H, onSeriesMixin) {
142
+ /**
143
+ * Wind barb series module
144
+ *
145
+ * (c) 2010-2017 Torstein Honsi
146
+ *
147
+ * License: www.highcharts.com/license
148
+ */
149
+
150
+ var each = H.each,
151
+ seriesType = H.seriesType;
152
+
153
+ /**
154
+ * Wind barbs are a convenient way to represent wind speed and direction in one
155
+ * graphical form. Wind direction is given by the stem direction, and wind speed
156
+ * by the number and shape of barbs.
157
+ *
158
+ * @extends {plotOptions.column}
159
+ * @excluding boostThreshold,marker,connectEnds,connectNulls,cropThreshold,
160
+ * dashStyle,gapSize,gapUnit,dataGrouping,linecap,shadow,stacking,
161
+ * step
162
+ * @product highcharts highstock
163
+ * @sample {highcharts|highstock} highcharts/demo/windbarb-series/
164
+ * Wind barb series
165
+ * @since 6.0.0
166
+ * @optionparent plotOptions.windbarb
167
+ */
168
+ seriesType('windbarb', 'column', {
169
+ /**
170
+ * The line width of the wind barb symbols.
171
+ */
172
+ lineWidth: 2,
173
+ /**
174
+ * The id of another series in the chart that the wind barbs are projected
175
+ * on. When `null`, the wind symbols are drawn on the X axis, but offset
176
+ * up or down by the `yOffset` setting.
177
+ *
178
+ * @sample {highcharts|highstock} highcharts/plotoptions/windbarb-onseries
179
+ * Projected on area series
180
+ * @type {String|null}
181
+ */
182
+ onSeries: null,
183
+ states: {
184
+ hover: {
185
+ lineWidthPlus: 0
186
+ }
187
+ },
188
+ tooltip: {
189
+ /**
190
+ * The default point format for the wind barb tooltip. Note the
191
+ * `point.beaufort` property that refers to the Beaufort wind scale. The
192
+ * names can be internationalized by modifying
193
+ * `Highcharts.seriesTypes.windbarb.prototype.beaufortNames`.
194
+ */
195
+ pointFormat: '<b>{series.name}</b>: {point.value} ({point.beaufort})<br/>'
196
+ },
197
+ /**
198
+ * Pixel length of the stems.
199
+ */
200
+ vectorLength: 20,
201
+ /**
202
+ * Vertical offset from the cartesian position, in pixels. The default value
203
+ * makes sure the symbols don't overlap the X axis when `onSeries` is
204
+ * `null`, and that they don't overlap the linked series when `onSeries` is
205
+ * given.
206
+ */
207
+ yOffset: -20
208
+ }, {
209
+ pointArrayMap: ['value', 'direction'],
210
+ parallelArrays: ['x', 'value', 'direction'],
211
+ beaufortName: ['Calm', 'Light air', 'Light breeze',
212
+ 'Gentle breeze', 'Moderate breeze', 'Fresh breeze',
213
+ 'Strong breeze', 'Near gale', 'Gale', 'Strong gale', 'Storm',
214
+ 'Violent storm', 'Hurricane'
215
+ ],
216
+ beaufortFloor: [0, 0.3, 1.6, 3.4, 5.5, 8.0, 10.8, 13.9, 17.2, 20.8,
217
+ 24.5, 28.5, 32.7
218
+ ],
219
+ trackerGroups: ['markerGroup'],
220
+
221
+ /**
222
+ * Get presentational attributes.
223
+ */
224
+ pointAttribs: function(point, state) {
225
+ var options = this.options,
226
+ stroke = this.color,
227
+ strokeWidth = this.options.lineWidth;
228
+
229
+ if (state) {
230
+ stroke = options.states[state].color || stroke;
231
+ strokeWidth =
232
+ (options.states[state].lineWidth || strokeWidth) +
233
+ (options.states[state].lineWidthPlus || 0);
234
+ }
235
+
236
+ return {
237
+ 'stroke': stroke,
238
+ 'stroke-width': strokeWidth
239
+ };
240
+ },
241
+ markerAttribs: function() {
242
+ return undefined;
243
+ },
244
+ /**
245
+ * Create a single wind arrow. It is later rotated around the zero
246
+ * centerpoint.
247
+ */
248
+ windArrow: function(point) {
249
+ var knots = point.value * 1.943844,
250
+ level = point.beaufortLevel,
251
+ path,
252
+ barbs,
253
+ u = this.options.vectorLength / 20,
254
+ pos = -10;
255
+
256
+ if (point.isNull) {
257
+ return [];
258
+ }
259
+
260
+ if (level === 0) {
261
+ return this.chart.renderer.symbols.circle(-10 * u, -10 * u,
262
+ 20 * u,
263
+ 20 * u
264
+ );
265
+ }
266
+
267
+ // The stem and the arrow head
268
+ path = [
269
+ 'M', 0, 7 * u, // base of arrow
270
+ 'L', -1.5 * u, 7 * u,
271
+ 0, 10 * u,
272
+ 1.5 * u, 7 * u,
273
+ 0, 7 * u,
274
+ 0, -10 * u // top
275
+ ];
276
+
277
+ // For each full 50 knots, add a pennant
278
+ barbs = (knots - knots % 50) / 50; // pennants
279
+ if (barbs > 0) {
280
+ while (barbs--) {
281
+ path.push(
282
+ pos === -10 ? 'L' : 'M',
283
+ 0,
284
+ pos * u,
285
+ 'L',
286
+ 5 * u,
287
+ pos * u + 2,
288
+ 'L',
289
+ 0,
290
+ pos * u + 4
291
+
292
+ );
293
+
294
+ // Substract from the rest and move position for next
295
+ knots -= 50;
296
+ pos += 7;
297
+ }
298
+ }
299
+
300
+ // For each full 10 knots, add a full barb
301
+ barbs = (knots - knots % 10) / 10;
302
+ if (barbs > 0) {
303
+ while (barbs--) {
304
+ path.push(
305
+ pos === -10 ? 'L' : 'M',
306
+ 0,
307
+ pos * u,
308
+ 'L',
309
+ 7 * u,
310
+ pos * u
311
+ );
312
+ knots -= 10;
313
+ pos += 3;
314
+ }
315
+ }
316
+
317
+ // For each full 5 knots, add a half barb
318
+ barbs = (knots - knots % 5) / 5; // half barbs
319
+ if (barbs > 0) {
320
+ while (barbs--) {
321
+ path.push(
322
+ pos === -10 ? 'L' : 'M',
323
+ 0,
324
+ pos * u,
325
+ 'L',
326
+ 4 * u,
327
+ pos * u
328
+ );
329
+ knots -= 5;
330
+ pos += 3;
331
+ }
332
+ }
333
+ return path;
334
+ },
335
+
336
+ translate: function() {
337
+ var beaufortFloor = this.beaufortFloor,
338
+ beaufortName = this.beaufortName;
339
+
340
+ onSeriesMixin.translate.call(this);
341
+
342
+ each(this.points, function(point) {
343
+ var level = 0;
344
+ // Find the beaufort level (zero based)
345
+ for (; level < beaufortFloor.length; level++) {
346
+ if (beaufortFloor[level] > point.value) {
347
+ break;
348
+ }
349
+ }
350
+ point.beaufortLevel = level - 1;
351
+ point.beaufort = beaufortName[level - 1];
352
+
353
+ });
354
+
355
+ },
356
+
357
+ drawPoints: function() {
358
+ var chart = this.chart,
359
+ yAxis = this.yAxis;
360
+ each(this.points, function(point) {
361
+ var plotX = point.plotX,
362
+ plotY = point.plotY;
363
+ if (!point.graphic) {
364
+ point.graphic = this.chart.renderer
365
+ .path()
366
+ .add(this.markerGroup);
367
+ }
368
+ point.graphic
369
+ .attr({
370
+ d: this.windArrow(point),
371
+ translateX: plotX,
372
+ translateY: plotY + this.options.yOffset,
373
+ rotation: point.direction
374
+ })
375
+ .attr(this.pointAttribs(point));
376
+
377
+ // Set the tooltip anchor position
378
+ point.tooltipPos = chart.inverted ? [
379
+ yAxis.len + yAxis.pos - chart.plotLeft - plotY,
380
+ this.xAxis.len - plotX
381
+ ] : [
382
+ plotX,
383
+ plotY + yAxis.pos - chart.plotTop + this.options.yOffset -
384
+ this.options.vectorLength / 2
385
+ ]; // #6327
386
+ }, this);
387
+ },
388
+
389
+ /**
390
+ * Fade in the arrows on initiating series.
391
+ */
392
+ animate: function(init) {
393
+ if (init) {
394
+ this.markerGroup.attr({
395
+ opacity: 0.01
396
+ });
397
+ } else {
398
+ this.markerGroup.animate({
399
+ opacity: 1
400
+ }, H.animObject(this.options.animation));
401
+
402
+ this.animate = null;
403
+ }
404
+ }
405
+ }, {
406
+ isValid: function() {
407
+ return H.isNumber(this.value) && this.value >= 0;
408
+ }
409
+ });
410
+
411
+
412
+
413
+ /**
414
+ * A `windbarb` series. If the [type](#series.windbarb.type) option is not
415
+ * specified, it is inherited from [chart.type](#chart.type).
416
+ *
417
+ * For options that apply to multiple series, it is recommended to add
418
+ * them to the [plotOptions.series](#plotOptions.series) options structure.
419
+ * To apply to all series of this specific type, apply it to [plotOptions.
420
+ * windbarb](#plotOptions.windbarb).
421
+ *
422
+ * @type {Object}
423
+ * @extends series,plotOptions.windbarb
424
+ * @excluding dataParser,dataURL
425
+ * @product highcharts highstock
426
+ * @apioption series.windbarb
427
+ */
428
+
429
+ /**
430
+ * An array of data points for the series. For the `windbarb` series type,
431
+ * points can be given in the following ways:
432
+ *
433
+ * 1. An array of arrays with 3 values. In this case, the values correspond
434
+ * to `x,value,direction`. If the first value is a string, it is applied as
435
+ * the name of the point, and the `x` value is inferred.
436
+ *
437
+ * ```js
438
+ * data: [
439
+ * [Date.UTC(2017, 0, 1, 0), 3.3, 90],
440
+ * [Date.UTC(2017, 0, 1, 1), 12.1, 180],
441
+ * [Date.UTC(2017, 0, 1, 2), 11.1, 270]
442
+ * ]
443
+ * ```
444
+ *
445
+ * 2. An array of objects with named values. The objects are point
446
+ * configuration objects as seen below. If the total number of data
447
+ * points exceeds the series' [turboThreshold](#series.area.turboThreshold),
448
+ * this option is not available.
449
+ *
450
+ * ```js
451
+ * data: [{
452
+ * x: Date.UTC(2017, 0, 1, 0),
453
+ * value: 12.1,
454
+ * direction: 90
455
+ * }, {
456
+ * x: Date.UTC(2017, 0, 1, 1),
457
+ * value: 11.1,
458
+ * direction: 270
459
+ * }]
460
+ * ```
461
+ *
462
+ * @type {Array<Object|Array|Number>}
463
+ * @extends series.line.data
464
+ * @sample {highcharts} highcharts/chart/reflow-true/ Numerical values
465
+ * @sample {highcharts} highcharts/series/data-array-of-arrays/ Arrays of numeric x and y
466
+ * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/ Arrays of datetime x and y
467
+ * @sample {highcharts} highcharts/series/data-array-of-name-value/ Arrays of point.name and y
468
+ * @sample {highcharts} highcharts/series/data-array-of-objects/ Config objects
469
+ * @product highcharts highstock
470
+ * @apioption series.windbarb.data
471
+ */
472
+
473
+ /**
474
+ * The wind speed in meters per second.
475
+ *
476
+ * @type {Number}
477
+ * @product highcharts highstock
478
+ * @apioption series.windbarb.data.value
479
+ */
480
+
481
+ /**
482
+ * The wind direction in degrees, where 0 is north (pointing towards south).
483
+ *
484
+ * @type {Number}
485
+ * @product highcharts highstock
486
+ * @apioption series.windbarb.data.direction
487
+ */
488
+
489
+ }(Highcharts, onSeriesMixin));
490
+ }));