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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v5.0.14 (2017-07-28)
2
+ * @license Highcharts JS v6.0.0 (2017-10-04)
3
3
  *
4
4
  * (c) 2009-2017 Torstein Honsi
5
5
  *
@@ -36,6 +36,11 @@
36
36
  function collectAndHide() {
37
37
  var labels = [];
38
38
 
39
+ // Consider external label collectors
40
+ each(chart.labelCollectors || [], function(collector) {
41
+ labels = labels.concat(collector());
42
+ });
43
+
39
44
  each(chart.yAxis || [], function(yAxis) {
40
45
  if (
41
46
  yAxis.options.stackLabels &&
@@ -75,11 +80,8 @@
75
80
  chart.hideOverlappingLabels(labels);
76
81
  }
77
82
 
78
- // Do it now ...
79
- collectAndHide();
80
-
81
- // ... and after each chart redraw
82
- addEvent(chart, 'redraw', collectAndHide);
83
+ // Do it on render and after each chart redraw
84
+ addEvent(chart, 'render', collectAndHide);
83
85
 
84
86
  });
85
87
 
@@ -0,0 +1,494 @@
1
+ /**
2
+ * @license Highcharts JS v6.0.0 (2017-10-04)
3
+ *
4
+ * Support for parallel coordinates in Highcharts
5
+ *
6
+ * (c) 2010-2017 Pawel Fus
7
+ *
8
+ * License: www.highcharts.com/license
9
+ */
10
+ 'use strict';
11
+ (function(factory) {
12
+ if (typeof module === 'object' && module.exports) {
13
+ module.exports = factory;
14
+ } else {
15
+ factory(Highcharts);
16
+ }
17
+ }(function(Highcharts) {
18
+ (function(H) {
19
+ /**
20
+ * Parallel coordinates module
21
+ *
22
+ * (c) 2010-2017 Pawel Fus
23
+ *
24
+ * License: www.highcharts.com/license
25
+ */
26
+ /* eslint max-len: ["warn", 80, 4] */
27
+
28
+ /**
29
+ * Extensions for parallel coordinates plot.
30
+ */
31
+ var SeriesProto = H.Series.prototype,
32
+ ChartProto = H.Chart.prototype,
33
+ AxisProto = H.Axis.prototype;
34
+
35
+ var pick = H.pick,
36
+ each = H.each,
37
+ wrap = H.wrap,
38
+ merge = H.merge,
39
+ erase = H.erase,
40
+ splat = H.splat,
41
+ extend = H.extend,
42
+ defined = H.defined,
43
+ arrayMin = H.arrayMin,
44
+ arrayMax = H.arrayMax;
45
+
46
+ var defaultXAxisOptions = {
47
+
48
+ lineWidth: 0,
49
+ tickLength: 0,
50
+
51
+ opposite: true,
52
+ type: 'category'
53
+ };
54
+
55
+ /**
56
+ * @optionparent chart
57
+ */
58
+ var defaultParallelOptions = {
59
+ /**
60
+ * Flag to render charts as a parallel coordinates plot. In a parallel
61
+ * coordinates plot (||-coords) by default all required yAxes are generated
62
+ * and the legend is disabled. This feature requires
63
+ * `modules/parallel-coordinates.js`.
64
+ *
65
+ * @sample {highcharts} /highcharts/demo/parallel-coordinates/
66
+ * Parallel coordinates demo
67
+ * @since 6.0.0
68
+ * @product highcharts
69
+ */
70
+ parallelCoordinates: false,
71
+ /**
72
+ * Common options for all yAxes rendered in a parallel coordinates plot.
73
+ * This feature requires `modules/parallel-coordinates.js`.
74
+ *
75
+ * The default options are:
76
+ * <pre>
77
+ * parallelAxes: {
78
+ * lineWidth: 1, // classic mode only
79
+ * gridlinesWidth: 0, // classic mode only
80
+ * title: {
81
+ * text: '',
82
+ * reserveSpace: false
83
+ * },
84
+ * labels: {
85
+ * x: 0,
86
+ * y: 0,
87
+ * align: 'center',
88
+ * reserveSpace: false
89
+ * },
90
+ * offset: 0
91
+ * }</pre>
92
+ *
93
+ * @extends {yAxis}
94
+ * @excluding alternateGridColor,breaks,id,gridLineColor,gridLineDashStyle,
95
+ * gridLineWidth,minorGridLineColor,minorGridLineDashStyle,
96
+ * minorGridLineWidth,plotBands,plotLines,angle,
97
+ * gridLineInterpolation,maxColor,maxZoom,minColor,scrollbar,
98
+ * stackLabels,stops
99
+ *
100
+ * @product highcharts
101
+ * @sample {highcharts} highcharts/parallel-coordinates/parallelaxes/
102
+ * Set the same tickAmount for all yAxes
103
+ * @since 6.0.0
104
+ */
105
+ parallelAxes: {
106
+
107
+ lineWidth: 1,
108
+
109
+ /**
110
+ * Titles for yAxes are taken from
111
+ * [xAxis.categories](#xAxis.categories). All options for
112
+ * `xAxis.labels` applies to parallel coordinates titles.
113
+ * For example, to style categories, use
114
+ * [xAxis.labels.style](#xAxis.labels.style).
115
+ *
116
+ * @excluding align,enabled,margin,offset,position3d,reserveSpace,
117
+ * rotation,skew3d,style,text,useHTML,x,y
118
+ */
119
+ title: {
120
+ text: '',
121
+ reserveSpace: false
122
+ },
123
+ labels: {
124
+ x: 0,
125
+ y: 4,
126
+ align: 'center',
127
+ reserveSpace: false
128
+ },
129
+ offset: 0
130
+ }
131
+ };
132
+
133
+ H.setOptions({
134
+ chart: defaultParallelOptions
135
+ });
136
+
137
+ /**
138
+ * Initialize parallelCoordinates
139
+ */
140
+ wrap(ChartProto, 'init', function(proceed, options) {
141
+ var defaultyAxis = splat(options.yAxis || {}),
142
+ yAxisLength = defaultyAxis.length,
143
+ newYAxes = [];
144
+ /**
145
+ * Flag used in parallel coordinates plot to check if chart has ||-coords.
146
+ *
147
+ * @name hasParallelCoordinates
148
+ * @memberOf Chart
149
+ * @type {Boolean}
150
+ */
151
+ this.hasParallelCoordinates = options.chart &&
152
+ options.chart.parallelCoordinates;
153
+
154
+ if (this.hasParallelCoordinates) {
155
+
156
+ this.setParallelInfo(options);
157
+
158
+ // Push empty yAxes in case user did not define them:
159
+ for (; yAxisLength <= this.parallelInfo.counter; yAxisLength++) {
160
+ newYAxes.push({});
161
+ }
162
+
163
+ options = merge({
164
+ legend: {
165
+ enabled: false
166
+ }
167
+ },
168
+ options,
169
+ // Disable boost:
170
+ {
171
+ boost: {
172
+ seriesThreshold: Number.MAX_SAFE_INTEGER
173
+ },
174
+ plotOptions: {
175
+ series: {
176
+ boostThreshold: Number.MAX_SAFE_INTEGER
177
+ }
178
+ }
179
+ }
180
+ );
181
+
182
+ options.yAxis = defaultyAxis.concat(newYAxes);
183
+ options.xAxis = merge(
184
+ defaultXAxisOptions, // docs
185
+ splat(options.xAxis || {})[0]
186
+ );
187
+ }
188
+
189
+ return proceed.call(this, options);
190
+ });
191
+
192
+ /**
193
+ * Initialize parallelCoordinates
194
+ */
195
+ wrap(ChartProto, 'update', function(proceed, options) {
196
+ if (options.chart) {
197
+ if (defined(options.chart.parallelCoordinates)) {
198
+ this.hasParallelCoordinates = options.chart.parallelCoordinates;
199
+ }
200
+
201
+ if (this.hasParallelCoordinates && options.chart.parallelAxes) {
202
+ this.options.chart.parallelAxes = merge(
203
+ this.options.chart.parallelAxes,
204
+ options.chart.parallelAxes
205
+ );
206
+ each(this.yAxis, function(axis) {
207
+ axis.update({}, false);
208
+ });
209
+ }
210
+ }
211
+
212
+ return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
213
+ });
214
+
215
+ extend(ChartProto, /** @lends Highcharts.Chart.prototype */ {
216
+ /**
217
+ * Define how many parellel axes we have according to the longest dataset
218
+ * This is quite heavy - loop over all series and check series.data.length
219
+ * Consider:
220
+ * - make this an option, so user needs to set this to get better
221
+ * performance
222
+ * - check only first series for number of points and assume the rest is the
223
+ * same
224
+ *
225
+ * @param {Object} options User options
226
+ */
227
+ setParallelInfo: function(options) {
228
+ var chart = this,
229
+ seriesOptions = options.series;
230
+
231
+ chart.parallelInfo = {
232
+ counter: 0
233
+ };
234
+
235
+ each(seriesOptions, function(series) {
236
+ if (series.data) {
237
+ chart.parallelInfo.counter = Math.max(
238
+ chart.parallelInfo.counter,
239
+ series.data.length - 1
240
+ );
241
+ }
242
+ });
243
+ }
244
+ });
245
+
246
+
247
+ /**
248
+ * On update, keep parallelPosition.
249
+ */
250
+ AxisProto.keepProps.push('parallelPosition');
251
+
252
+ /**
253
+ * Update default options with predefined for a parallel coords.
254
+ */
255
+ wrap(AxisProto, 'setOptions', function(proceed, userOptions) {
256
+ var axis = this,
257
+ chart = axis.chart,
258
+ axisPosition = ['left', 'width', 'height', 'top'];
259
+
260
+ proceed.apply(axis, Array.prototype.slice.call(arguments, 1));
261
+
262
+ if (chart.hasParallelCoordinates) {
263
+ if (chart.inverted) {
264
+ axisPosition = axisPosition.reverse();
265
+ }
266
+
267
+ if (axis.isXAxis) {
268
+ axis.options = merge(
269
+ axis.options,
270
+ defaultXAxisOptions,
271
+ userOptions
272
+ );
273
+ } else {
274
+ axis.options = merge(
275
+ axis.options,
276
+ axis.chart.options.chart.parallelAxes,
277
+ userOptions
278
+ );
279
+ axis.parallelPosition = pick(
280
+ axis.parallelPosition,
281
+ chart.yAxis.length
282
+ );
283
+ axis.setParallelPosition(axisPosition, axis.options);
284
+ }
285
+ }
286
+ });
287
+
288
+
289
+ /**
290
+ * Each axis should gather extremes from points on a particular position in
291
+ * series.data. Not like the default one, which gathers extremes from all series
292
+ * bind to this axis.
293
+ * Consider:
294
+ * - using series.points instead of series.yData
295
+ */
296
+ wrap(AxisProto, 'getSeriesExtremes', function(proceed) {
297
+ if (this.chart.hasParallelCoordinates && !this.isXAxis) {
298
+ var index = this.parallelPosition,
299
+ currentPoints = [];
300
+ each(this.series, function(series) {
301
+ if (defined(series.yData[index])) {
302
+ // We need to use push() beacause of null points
303
+ currentPoints.push(series.yData[index]);
304
+ }
305
+ });
306
+ this.dataMin = arrayMin(currentPoints);
307
+ this.dataMax = arrayMax(currentPoints);
308
+ } else {
309
+ proceed.apply(this, Array.prototype.slice.call(arguments, 1));
310
+ }
311
+ });
312
+
313
+
314
+ extend(AxisProto, /** @lends Highcharts.Axis.prototype */ {
315
+ /**
316
+ * Set predefined left+width and top+height (inverted) for yAxes. This
317
+ * method modifies options param.
318
+ *
319
+ * @param {Array} axisPosition
320
+ * ['left', 'width', 'height', 'top'] or
321
+ * ['top', 'height', 'width', 'left'] for an inverted chart.
322
+ * @param {Object} options {@link Highcharts.Axis#options}.
323
+ */
324
+ setParallelPosition: function(axisPosition, options) {
325
+ options[axisPosition[0]] = 100 * (this.parallelPosition + 0.5) /
326
+ (this.chart.parallelInfo.counter + 1) + '%';
327
+ this[axisPosition[1]] = options[axisPosition[1]] = 0;
328
+
329
+ // In case of chart.update(inverted), remove old options:
330
+ this[axisPosition[2]] = options[axisPosition[2]] = null;
331
+ this[axisPosition[3]] = options[axisPosition[3]] = null;
332
+ }
333
+ });
334
+
335
+
336
+ /**
337
+ * Bind each series to each yAxis.
338
+ * yAxis needs a reference to all series to calculate extremes.
339
+ */
340
+ wrap(SeriesProto, 'bindAxes', function(proceed) {
341
+ if (this.chart.hasParallelCoordinates) {
342
+ var series = this;
343
+ each(this.chart.axes, function(axis) {
344
+ series.insert(axis.series);
345
+ axis.isDirty = true;
346
+ });
347
+ series.xAxis = this.chart.xAxis[0];
348
+ series.yAxis = this.chart.yAxis[0];
349
+ } else {
350
+ proceed.apply(this, Array.prototype.slice.call(arguments, 1));
351
+ }
352
+ });
353
+
354
+
355
+ /**
356
+ * Translate each point using corresponding yAxis.
357
+ */
358
+ wrap(SeriesProto, 'translate', function(proceed) {
359
+ proceed.apply(this, Array.prototype.slice.call(arguments, 1));
360
+
361
+ var series = this,
362
+ chart = this.chart,
363
+ points = series.points,
364
+ dataLength = points && points.length,
365
+ closestPointRangePx = Number.MAX_VALUE,
366
+ lastPlotX,
367
+ point,
368
+ i;
369
+
370
+ if (this.chart.hasParallelCoordinates) {
371
+ for (i = 0; i < dataLength; i++) {
372
+ point = points[i];
373
+ if (defined(point.y)) {
374
+ point.plotX = point.clientX = chart.inverted ?
375
+ chart.plotHeight - chart.yAxis[i].top + chart.plotTop :
376
+ chart.yAxis[i].left - chart.plotLeft;
377
+
378
+ point.plotY = chart.yAxis[i]
379
+ .translate(point.y, false, true, null, true);
380
+
381
+ if (lastPlotX !== undefined) {
382
+ closestPointRangePx = Math.min(
383
+ closestPointRangePx,
384
+ Math.abs(point.plotX - lastPlotX)
385
+ );
386
+ }
387
+ lastPlotX = point.plotX;
388
+ point.isInside = chart.isInsidePlot(
389
+ point.plotX,
390
+ point.plotY,
391
+ chart.inverted
392
+ );
393
+ } else {
394
+ point.isNull = true;
395
+ }
396
+ }
397
+ this.closestPointRangePx = closestPointRangePx;
398
+ }
399
+ });
400
+
401
+ /**
402
+ * On destroy, we need to remove series from each axis.series
403
+ */
404
+ wrap(SeriesProto, 'destroy', function(proceed) {
405
+ if (this.chart.hasParallelCoordinates) {
406
+ var series = this;
407
+ each(this.chart.axes || [], function(axis) {
408
+ if (axis && axis.series) {
409
+ erase(axis.series, series);
410
+ axis.isDirty = axis.forceRedraw = true;
411
+ }
412
+ });
413
+ }
414
+ proceed.apply(this, Array.prototype.slice.call(arguments, 1));
415
+ });
416
+
417
+ function addFormattedValue(proceed) {
418
+ var chart = this.series.chart,
419
+ config = proceed.apply(this, Array.prototype.slice.call(arguments, 1)),
420
+ formattedValue,
421
+ yAxisOptions,
422
+ labelFormat,
423
+ yAxis;
424
+
425
+ if (chart.hasParallelCoordinates && !defined(config.formattedValue)) {
426
+ yAxis = chart.yAxis[this.x];
427
+ yAxisOptions = yAxis.options;
428
+
429
+ labelFormat = pick(
430
+ /**
431
+ * Parallel coordinates only. Format that will be used for point.y
432
+ * and available in [tooltip.pointFormat](#tooltip.pointFormat) as
433
+ * `{point.formattedValue}`. If not set, `{point.formattedValue}`
434
+ * will use other options, in this order:
435
+ *
436
+ * 1. [yAxis.labels.format](#yAxis.labels.format) will be used if
437
+ * set
438
+ * 2. if yAxis is a category, then category name will be displayed
439
+ * 3. if yAxis is a datetime, then value will use the same format as
440
+ * yAxis labels
441
+ * 4. if yAxis is linear/logarithmic type, then simple value will be
442
+ * used
443
+ *
444
+ * @default undefined
445
+ * @memberOf yAxis
446
+ * @sample {highcharts}
447
+ * /highcharts/parallel-coordinates/tooltipvalueformat/
448
+ * Different tooltipValueFormats's
449
+ * @apioption yAxis.tooltipValueFormat
450
+ * @product highcharts
451
+ * @since 6.0.0
452
+ * @type {String}
453
+ */
454
+ yAxisOptions.tooltipValueFormat,
455
+ yAxisOptions.labels.format
456
+ );
457
+ if (labelFormat) {
458
+ formattedValue = H.format(
459
+ labelFormat,
460
+ extend(
461
+ this, {
462
+ value: this.y
463
+ }
464
+ )
465
+ );
466
+ } else if (yAxis.isDatetimeAxis) {
467
+ formattedValue = H.dateFormat(
468
+ yAxisOptions.dateTimeLabelFormats[
469
+ yAxis.tickPositions.info.unitName
470
+ ],
471
+ this.y
472
+ );
473
+ } else if (yAxisOptions.categories) {
474
+ formattedValue = yAxisOptions.categories[this.y];
475
+ } else {
476
+ formattedValue = this.y;
477
+ }
478
+
479
+ config.formattedValue = config.point.formattedValue = formattedValue;
480
+ }
481
+
482
+ return config;
483
+ }
484
+
485
+ each(['line', 'spline'], function(seriesName) {
486
+ wrap(
487
+ H.seriesTypes[seriesName].prototype.pointClass.prototype,
488
+ 'getLabelConfig',
489
+ addFormattedValue
490
+ );
491
+ });
492
+
493
+ }(Highcharts));
494
+ }));