highcharts-rails 5.0.0 → 5.0.3

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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.markdown +99 -0
  4. data/Gemfile +1 -1
  5. data/README.markdown +2 -1
  6. data/Rakefile +28 -2
  7. data/app/assets/javascripts/highcharts.js +3935 -2584
  8. data/app/assets/javascripts/highcharts/highcharts-3d.js +44 -10
  9. data/app/assets/javascripts/highcharts/highcharts-more.js +32 -12
  10. data/app/assets/javascripts/highcharts/modules/accessibility.js +85 -18
  11. data/app/assets/javascripts/highcharts/modules/annotations.js +1 -1
  12. data/app/assets/javascripts/highcharts/modules/boost.js +34 -19
  13. data/app/assets/javascripts/highcharts/modules/broken-axis.js +1 -1
  14. data/app/assets/javascripts/highcharts/modules/data.js +2 -2
  15. data/app/assets/javascripts/highcharts/modules/drilldown.js +4 -3
  16. data/app/assets/javascripts/highcharts/modules/exporting.js +15 -14
  17. data/app/assets/javascripts/highcharts/modules/funnel.js +1 -1
  18. data/app/assets/javascripts/highcharts/modules/grid-axis.js +547 -0
  19. data/app/assets/javascripts/highcharts/modules/heatmap.js +17 -2
  20. data/app/assets/javascripts/highcharts/modules/no-data-to-display.js +1 -1
  21. data/app/assets/javascripts/highcharts/modules/offline-exporting.js +115 -73
  22. data/app/assets/javascripts/highcharts/modules/overlapping-datalabels.js +1 -1
  23. data/app/assets/javascripts/highcharts/modules/series-label.js +210 -148
  24. data/app/assets/javascripts/highcharts/modules/solid-gauge.js +30 -10
  25. data/app/assets/javascripts/highcharts/modules/treemap.js +6 -1
  26. data/app/assets/javascripts/highcharts/modules/xrange-series.js +278 -0
  27. data/lib/highcharts/version.rb +1 -1
  28. metadata +3 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v5.0.0 (2016-09-29)
2
+ * @license Highcharts JS v5.0.3 (2016-11-18)
3
3
  * Solid angular gauge module
4
4
  *
5
5
  * (c) 2010-2016 Torstein Honsi
@@ -23,6 +23,7 @@
23
23
  */
24
24
 
25
25
  'use strict';
26
+
26
27
  var pInt = H.pInt,
27
28
  pick = H.pick,
28
29
  each = H.each,
@@ -168,18 +169,23 @@
168
169
  colorByPoint: true
169
170
 
170
171
  }, {
171
- bindAxes: function() {
172
- var axis;
173
- H.seriesTypes.gauge.prototype.bindAxes.call(this);
174
172
 
175
- axis = this.yAxis;
173
+ /**
174
+ * Extend the translate function to extend the Y axis with the necessary
175
+ * decoration (#5895).
176
+ */
177
+ translate: function() {
178
+ var axis = this.yAxis;
176
179
  H.extend(axis, colorAxisMethods);
177
180
 
178
181
  // Prepare data classes
179
- if (axis.options.dataClasses) {
182
+ if (!axis.dataClasses && axis.options.dataClasses) {
180
183
  axis.initDataClasses(axis.options);
181
184
  }
182
185
  axis.initStops(axis.options);
186
+
187
+ // Generate points and inherit data label position
188
+ H.seriesTypes.gauge.prototype.translate.call(this);
183
189
  },
184
190
 
185
191
  /**
@@ -192,7 +198,21 @@
192
198
  options = series.options,
193
199
  renderer = series.chart.renderer,
194
200
  overshoot = options.overshoot,
195
- overshootVal = isNumber(overshoot) ? overshoot / 180 * Math.PI : 0;
201
+ overshootVal = isNumber(overshoot) ? overshoot / 180 * Math.PI : 0,
202
+ thresholdAngleRad;
203
+
204
+ // Handle the threshold option
205
+ if (isNumber(options.threshold)) {
206
+ thresholdAngleRad = yAxis.startAngleRad + yAxis.translate(
207
+ options.threshold,
208
+ null,
209
+ null,
210
+ null,
211
+ true
212
+ );
213
+ }
214
+ this.thresholdAngleRad = pick(thresholdAngleRad, yAxis.startAngleRad);
215
+
196
216
 
197
217
  each(series.points, function(point) {
198
218
  var graphic = point.graphic,
@@ -222,8 +242,8 @@
222
242
  rotation = Math.max(axisMinAngle, Math.min(axisMaxAngle, rotation));
223
243
  }
224
244
 
225
- minAngle = Math.min(rotation, yAxis.startAngleRad);
226
- maxAngle = Math.max(rotation, yAxis.startAngleRad);
245
+ minAngle = Math.min(rotation, series.thresholdAngleRad);
246
+ maxAngle = Math.max(rotation, series.thresholdAngleRad);
227
247
 
228
248
  if (maxAngle - minAngle > 2 * Math.PI) {
229
249
  maxAngle = minAngle + 2 * Math.PI;
@@ -277,7 +297,7 @@
277
297
  animate: function(init) {
278
298
 
279
299
  if (!init) {
280
- this.startAngleRad = this.yAxis.startAngleRad;
300
+ this.startAngleRad = this.thresholdAngleRad;
281
301
  H.seriesTypes.pie.prototype.animate.call(this, init);
282
302
  }
283
303
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v5.0.0 (2016-09-29)
2
+ * @license Highcharts JS v5.0.3 (2016-11-18)
3
3
  *
4
4
  * (c) 2014 Highsoft AS
5
5
  * Authors: Jon Arild Nygard / Oystein Moseng
@@ -21,6 +21,7 @@
21
21
  * License: www.highcharts.com/license
22
22
  */
23
23
  'use strict';
24
+
24
25
  var seriesType = H.seriesType,
25
26
  seriesTypes = H.seriesTypes,
26
27
  map = H.map,
@@ -29,6 +30,7 @@
29
30
  noop = H.noop,
30
31
  each = H.each,
31
32
  grep = H.grep,
33
+ isNumber = H.isNumber,
32
34
  pick = H.pick,
33
35
  Series = H.Series,
34
36
  stableSort = H.stableSort,
@@ -917,6 +919,9 @@
917
919
  }
918
920
  return className;
919
921
  },
922
+ isValid: function() {
923
+ return isNumber(this.value);
924
+ },
920
925
  setState: function(state) {
921
926
  H.Point.prototype.setState.call(this, state);
922
927
  this.graphic.attr({
@@ -0,0 +1,278 @@
1
+ /**
2
+ * @license Highcharts JS v5.0.3 (2016-11-18)
3
+ * X-range series
4
+ *
5
+ * (c) 2010-2016 Torstein Honsi, Lars A. V. Cabrera
6
+ *
7
+ * --- WORK IN PROGRESS ---
8
+ *
9
+ * License: www.highcharts.com/license
10
+ */
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
+ * (c) 2014-2016 Highsoft AS
21
+ * Authors: Torstein Honsi, Lars A. V. Cabrera
22
+ *
23
+ * License: www.highcharts.com/license
24
+ */
25
+ 'use strict';
26
+
27
+ var defaultPlotOptions = H.getOptions().plotOptions,
28
+ color = H.Color,
29
+ columnType = H.seriesTypes.column,
30
+ each = H.each,
31
+ extendClass = H.extendClass,
32
+ isNumber = H.isNumber,
33
+ isObject = H.isObject,
34
+ merge = H.merge,
35
+ pick = H.pick,
36
+ seriesTypes = H.seriesTypes,
37
+ stop = H.stop,
38
+ wrap = H.wrap,
39
+ Axis = H.Axis,
40
+ Point = H.Point,
41
+ Series = H.Series,
42
+ pointFormat = '<span style="color:{point.color}">' +
43
+ '\u25CF' +
44
+ '</span> {series.name}: <b>{point.yCategory}</b><br/>',
45
+ xrange = 'xrange';
46
+
47
+ defaultPlotOptions.xrange = merge(defaultPlotOptions.column, {
48
+ tooltip: {
49
+ pointFormat: pointFormat
50
+ }
51
+ });
52
+ seriesTypes.xrange = extendClass(columnType, {
53
+ pointClass: extendClass(Point, {
54
+ // Add x2 and yCategory to the available properties for tooltip formats
55
+ getLabelConfig: function() {
56
+ var cfg = Point.prototype.getLabelConfig.call(this);
57
+
58
+ cfg.x2 = this.x2;
59
+ cfg.yCategory = this.yCategory = this.series.yAxis.categories && this.series.yAxis.categories[this.y];
60
+ return cfg;
61
+ }
62
+ }),
63
+ type: xrange,
64
+ forceDL: true,
65
+ parallelArrays: ['x', 'x2', 'y'],
66
+ requireSorting: false,
67
+ animate: seriesTypes.line.prototype.animate,
68
+
69
+ /**
70
+ * Borrow the column series metrics, but with swapped axes. This gives free access
71
+ * to features like groupPadding, grouping, pointWidth etc.
72
+ */
73
+ getColumnMetrics: function() {
74
+ var metrics,
75
+ chart = this.chart;
76
+
77
+ function swapAxes() {
78
+ each(chart.series, function(s) {
79
+ var xAxis = s.xAxis;
80
+ s.xAxis = s.yAxis;
81
+ s.yAxis = xAxis;
82
+ });
83
+ }
84
+
85
+ swapAxes();
86
+
87
+ this.yAxis.closestPointRange = 1;
88
+ metrics = columnType.prototype.getColumnMetrics.call(this);
89
+
90
+ swapAxes();
91
+
92
+ return metrics;
93
+ },
94
+
95
+ /**
96
+ * Override cropData to show a point where x is outside visible range
97
+ * but x2 is outside.
98
+ */
99
+ cropData: function(xData, yData, min, max) {
100
+
101
+ // Replace xData with x2Data to find the appropriate cropStart
102
+ var cropData = Series.prototype.cropData,
103
+ crop = cropData.call(this, this.x2Data, yData, min, max);
104
+
105
+ // Re-insert the cropped xData
106
+ crop.xData = xData.slice(crop.start, crop.end);
107
+
108
+ return crop;
109
+ },
110
+
111
+ translate: function() {
112
+ columnType.prototype.translate.apply(this, arguments);
113
+ var series = this,
114
+ xAxis = series.xAxis,
115
+ metrics = series.columnMetrics,
116
+ minPointLength = series.options.minPointLength || 0;
117
+
118
+ each(series.points, function(point) {
119
+ var plotX = point.plotX,
120
+ posX = pick(point.x2, point.x + (point.len || 0)),
121
+ plotX2 = xAxis.toPixels(posX, true),
122
+ width = plotX2 - plotX,
123
+ widthDifference,
124
+ shapeArgs,
125
+ partialFill;
126
+
127
+ if (minPointLength) {
128
+ widthDifference = minPointLength - width;
129
+ if (widthDifference < 0) {
130
+ widthDifference = 0;
131
+ }
132
+ plotX -= widthDifference / 2;
133
+ plotX2 += widthDifference / 2;
134
+ }
135
+
136
+ plotX = Math.max(plotX, -10);
137
+ plotX2 = Math.min(Math.max(plotX2, -10), xAxis.len + 10);
138
+
139
+ point.shapeArgs = {
140
+ x: plotX,
141
+ y: point.plotY + metrics.offset,
142
+ width: plotX2 - plotX,
143
+ height: metrics.width
144
+ };
145
+ point.tooltipPos[0] += width / 2;
146
+ point.tooltipPos[1] -= metrics.width / 2;
147
+
148
+ // Add a partShapeArgs to the point, based on the shapeArgs property
149
+ partialFill = point.partialFill;
150
+ if (partialFill) {
151
+ // Get the partial fill amount
152
+ if (isObject(partialFill)) {
153
+ partialFill = partialFill.amount;
154
+ }
155
+ // If it was not a number, assume 0
156
+ if (!isNumber(partialFill)) {
157
+ partialFill = 0;
158
+ }
159
+ shapeArgs = point.shapeArgs;
160
+ point.partShapeArgs = {
161
+ x: shapeArgs.x,
162
+ y: shapeArgs.y + 1,
163
+ width: shapeArgs.width * partialFill,
164
+ height: shapeArgs.height - 2
165
+ };
166
+ }
167
+ });
168
+ },
169
+
170
+ drawPoints: function() {
171
+ var series = this,
172
+ chart = this.chart,
173
+ options = series.options,
174
+ renderer = chart.renderer,
175
+ animationLimit = options.animationLimit || 250,
176
+ verb = chart.pointCount < animationLimit ? 'animate' : 'attr';
177
+
178
+ // draw the columns
179
+ each(series.points, function(point) {
180
+ var plotY = point.plotY,
181
+ graphic = point.graphic,
182
+ type = point.shapeType,
183
+ shapeArgs = point.shapeArgs,
184
+ partShapeArgs = point.partShapeArgs,
185
+ seriesOpts = series.options,
186
+ pfOptions = point.partialFill,
187
+ fill,
188
+ state = point.selected && 'select',
189
+ cutOff = options.stacking && !options.borderRadius;
190
+
191
+ if (isNumber(plotY) && point.y !== null) {
192
+ if (graphic) { // update
193
+ stop(graphic);
194
+ point.graphicOriginal[verb](
195
+ merge(shapeArgs)
196
+ );
197
+ if (partShapeArgs) {
198
+ point.graphicOverlay[verb](
199
+ merge(partShapeArgs)
200
+ );
201
+ }
202
+
203
+ } else {
204
+ point.graphic = graphic = renderer.g('point')
205
+ .attr({
206
+ 'class': point.getClassName()
207
+ })
208
+ .add(point.group || series.group);
209
+
210
+ point.graphicOriginal = renderer[type](shapeArgs)
211
+ .addClass('highcharts-partfill-original')
212
+ .add(graphic);
213
+ if (partShapeArgs) {
214
+ point.graphicOverlay = renderer[type](partShapeArgs)
215
+ .addClass('highcharts-partfill-overlay')
216
+ .add(graphic);
217
+ }
218
+ }
219
+
220
+
221
+ // Presentational
222
+ point.graphicOriginal
223
+ .attr(series.pointAttribs(point, state))
224
+ .shadow(options.shadow, null, cutOff);
225
+ if (partShapeArgs) {
226
+ // Ensure pfOptions is an object
227
+ if (!isObject(pfOptions)) {
228
+ pfOptions = {};
229
+ }
230
+ if (isObject(seriesOpts.partialFill)) {
231
+ pfOptions = merge(pfOptions, seriesOpts.partialFill);
232
+ }
233
+
234
+ fill = pfOptions.fill ||
235
+ color(series.color).brighten(-0.3).get('rgb');
236
+ point.graphicOverlay
237
+ .attr(series.pointAttribs(point, state))
238
+ .attr('fill', fill)
239
+ .attr('stroke-width', 0)
240
+ .shadow(options.shadow, null, cutOff);
241
+ }
242
+
243
+
244
+ } else if (graphic) {
245
+ point.graphic = graphic.destroy(); // #1269
246
+ }
247
+ });
248
+ }
249
+ });
250
+
251
+ /**
252
+ * Max x2 should be considered in xAxis extremes
253
+ */
254
+ wrap(Axis.prototype, 'getSeriesExtremes', function(proceed) {
255
+ var axis = this,
256
+ series = axis.series,
257
+ dataMax,
258
+ modMax;
259
+
260
+ proceed.call(this);
261
+ if (axis.isXAxis && series.type === xrange) {
262
+ dataMax = pick(axis.dataMax, Number.MIN_VALUE);
263
+ each(this.series, function(series) {
264
+ each(series.x2Data || [], function(val) {
265
+ if (val > dataMax) {
266
+ dataMax = val;
267
+ modMax = true;
268
+ }
269
+ });
270
+ });
271
+ if (modMax) {
272
+ axis.dataMax = dataMax;
273
+ }
274
+ }
275
+ });
276
+
277
+ }(Highcharts));
278
+ }));
@@ -1,3 +1,3 @@
1
1
  module Highcharts
2
- VERSION = "5.0.0"
2
+ VERSION = "5.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: highcharts-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Per Christian B. Viken
@@ -82,6 +82,7 @@ files:
82
82
  - app/assets/javascripts/highcharts/modules/drilldown.js
83
83
  - app/assets/javascripts/highcharts/modules/exporting.js
84
84
  - app/assets/javascripts/highcharts/modules/funnel.js
85
+ - app/assets/javascripts/highcharts/modules/grid-axis.js
85
86
  - app/assets/javascripts/highcharts/modules/heatmap.js
86
87
  - app/assets/javascripts/highcharts/modules/no-data-to-display.js
87
88
  - app/assets/javascripts/highcharts/modules/offline-exporting.js
@@ -89,6 +90,7 @@ files:
89
90
  - app/assets/javascripts/highcharts/modules/series-label.js
90
91
  - app/assets/javascripts/highcharts/modules/solid-gauge.js
91
92
  - app/assets/javascripts/highcharts/modules/treemap.js
93
+ - app/assets/javascripts/highcharts/modules/xrange-series.js
92
94
  - app/assets/javascripts/highcharts/themes/dark-blue.js
93
95
  - app/assets/javascripts/highcharts/themes/dark-green.js
94
96
  - app/assets/javascripts/highcharts/themes/dark-unica.js