highcharts-rails 4.2.0 → 4.2.2

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Highcharts JS v4.2.0 (2105-12-15)
2
+ * Highcharts JS v4.2.2 (2016-02-04)
3
3
  * Highcharts Broken Axis module
4
4
  *
5
5
  * License: www.highcharts.com/license
@@ -109,7 +109,7 @@
109
109
 
110
110
  var axis = this;
111
111
 
112
- axis.doPostTranslate = true;
112
+ axis.isBroken = true;
113
113
 
114
114
  this.val2lin = function (val) {
115
115
  var nval = val,
@@ -314,7 +314,7 @@
314
314
  if ((threshold < brk.from && y > brk.to) || (threshold > brk.from && y < brk.from)) {
315
315
  eventName = 'pointBreak';
316
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'; // docs
317
+ eventName = 'pointInBreak';
318
318
  }
319
319
  if (eventName) {
320
320
  fireEvent(axis, eventName, { point: point, brk: brk });
@@ -2908,10 +2908,10 @@ if (CanvasRenderingContext2D) {
2908
2908
  });
2909
2909
  }
2910
2910
  }/**
2911
- * @license Highcharts JS v4.2.0 (2105-12-15)
2911
+ * @license Highcharts JS v4.2.2 (2016-02-04)
2912
2912
  * CanVGRenderer Extension module
2913
2913
  *
2914
- * (c) 2011-2012 Torstein Honsi, Erik Olsson
2914
+ * (c) 2011-2016 Torstein Honsi, Erik Olsson
2915
2915
  *
2916
2916
  * License: www.highcharts.com/license
2917
2917
  */
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.0 (2105-12-15)
2
+ * @license Highcharts JS v4.2.2 (2016-02-04)
3
3
  * Data module
4
4
  *
5
- * (c) 2012-2014 Torstein Honsi
5
+ * (c) 2012-2016 Torstein Honsi
6
6
  *
7
7
  * License: www.highcharts.com/license
8
8
  */
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.0 (2105-12-15)
2
+ * @license Highcharts JS v4.2.2 (2016-02-04)
3
3
  * Exporting module
4
4
  *
5
- * (c) 2010-2014 Torstein Honsi
5
+ * (c) 2010-2016 Torstein Honsi
6
6
  *
7
7
  * License: www.highcharts.com/license
8
8
  */
@@ -306,7 +306,7 @@ extend(Chart.prototype, {
306
306
  // prepare for replicating the chart
307
307
  options.series = [];
308
308
  each(chart.series, function (serie) {
309
- seriesOptions = merge(serie.options, {
309
+ seriesOptions = merge(serie.userOptions, { // #4912
310
310
  animation: false, // turn off animation
311
311
  enableMouseTracking: false,
312
312
  showCheckbox: false,
@@ -678,7 +678,8 @@ extend(Chart.prototype, {
678
678
  button = renderer.button(btnOptions.text, 0, 0, callback, attr, hover, select)
679
679
  .attr({
680
680
  title: chart.options.lang[btnOptions._titleKey],
681
- 'stroke-linecap': 'round'
681
+ 'stroke-linecap': 'round',
682
+ zIndex: 3 // #4955
682
683
  });
683
684
  button.menuClassName = options.menuClassName || PREFIX + 'menu-' + chart.btnCount++;
684
685
 
@@ -2,7 +2,7 @@
2
2
  * @license
3
3
  * Highcharts funnel module
4
4
  *
5
- * (c) 2010-2014 Torstein Honsi
5
+ * (c) 2010-2016 Torstein Honsi
6
6
  *
7
7
  * License: www.highcharts.com/license
8
8
  */
@@ -231,24 +231,30 @@ seriesTypes.funnel = Highcharts.extendClass(seriesTypes.pie, {
231
231
  var series = this,
232
232
  options = series.options,
233
233
  chart = series.chart,
234
- renderer = chart.renderer;
234
+ renderer = chart.renderer,
235
+ pointOptions,
236
+ pointAttr,
237
+ shapeArgs,
238
+ graphic;
235
239
 
236
240
  each(series.data, function (point) {
237
- var pointOptions = point.options,
238
- graphic = point.graphic,
239
- shapeArgs = point.shapeArgs;
241
+ pointOptions = point.options;
242
+ graphic = point.graphic;
243
+ shapeArgs = point.shapeArgs;
244
+
245
+ pointAttr = {
246
+ fill: point.color,
247
+ stroke: pick(pointOptions.borderColor, options.borderColor),
248
+ 'stroke-width': pick(pointOptions.borderWidth, options.borderWidth)
249
+ };
240
250
 
241
251
  if (!graphic) { // Create the shapes
242
252
  point.graphic = renderer.path(shapeArgs)
243
- .attr({
244
- fill: point.color,
245
- stroke: pick(pointOptions.borderColor, options.borderColor),
246
- 'stroke-width': pick(pointOptions.borderWidth, options.borderWidth)
247
- })
253
+ .attr(pointAttr)
248
254
  .add(series.group);
249
255
 
250
256
  } else { // Update the shapes
251
- graphic.animate(shapeArgs);
257
+ graphic.attr(pointAttr).animate(shapeArgs);
252
258
  }
253
259
  });
254
260
  },
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.0 (2105-12-15)
2
+ * @license Highcharts JS v4.2.2 (2016-02-04)
3
3
  *
4
- * (c) 2011-2014 Torstein Honsi
4
+ * (c) 2011-2016 Torstein Honsi
5
5
  *
6
6
  * License: www.highcharts.com/license
7
7
  */
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.0 (2105-12-15)
2
+ * @license Highcharts JS v4.2.2 (2016-02-04)
3
3
  * Plugin for displaying a message when there is no data visible in chart.
4
4
  *
5
- * (c) 2010-2014 Highsoft AS
5
+ * (c) 2010-2016 Highsoft AS
6
6
  * Author: Oystein Moseng
7
7
  *
8
8
  * License: www.highcharts.com/license
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.0 (2105-12-15)
2
+ * @license Highcharts JS v4.2.2 (2016-02-04)
3
3
  * Client side exporting module
4
4
  *
5
5
  * (c) 2015 Torstein Honsi / Oystein Moseng
@@ -57,53 +57,73 @@
57
57
  l,
58
58
  fallbackToExportServer = function () {
59
59
  if (options.fallbackToExportServer === false) {
60
- throw 'Fallback to export server disabled';
60
+ if (options.error) {
61
+ options.error();
62
+ } else {
63
+ throw 'Fallback to export server disabled';
64
+ }
65
+ } else {
66
+ chart.exportChart(options);
61
67
  }
62
- chart.exportChart(options);
63
68
  },
64
69
  // Get data:URL from image URL
65
70
  // Pass in callbacks to handle results. finallyCallback is always called at the end of the process. Supplying this callback is optional.
66
71
  // All callbacks receive two arguments: imageURL, and callbackArgs. callbackArgs is used only by callbacks and can contain whatever.
67
72
  imageToDataUrl = function (imageURL, callbackArgs, successCallback, taintedCallback, noCanvasSupportCallback, failedLoadCallback, finallyCallback) {
68
- var img = new win.Image();
69
- if (!webKit) {
70
- img.crossOrigin = 'Anonymous'; // For some reason Safari chokes on this attribute
71
- }
72
- img.onload = function () {
73
- var canvas = doc.createElement('canvas'),
74
- ctx = canvas.getContext && canvas.getContext('2d'),
75
- dataURL;
76
-
77
- if (!ctx) {
78
- noCanvasSupportCallback(imageURL, callbackArgs);
79
- } else {
80
- canvas.height = img.height * scale;
81
- canvas.width = img.width * scale;
82
- ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
83
-
84
- // Now we try to get the contents of the canvas.
73
+ var img = new win.Image(),
74
+ taintedHandler,
75
+ loadHandler = function () {
76
+ var canvas = doc.createElement('canvas'),
77
+ ctx = canvas.getContext && canvas.getContext('2d'),
78
+ dataURL;
85
79
  try {
86
- dataURL = canvas.toDataURL();
87
- successCallback(dataURL, callbackArgs);
88
- } catch (e) {
89
- // Failed - either tainted canvas or something else went horribly wrong
90
- if (e.name === 'SecurityError' || e.name === 'SECURITY_ERR' || e.message === 'SecurityError') {
91
- taintedCallback(imageURL, callbackArgs);
80
+ if (!ctx) {
81
+ noCanvasSupportCallback(imageURL, callbackArgs);
92
82
  } else {
93
- throw e;
83
+ canvas.height = img.height * scale;
84
+ canvas.width = img.width * scale;
85
+ ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
86
+
87
+ // Now we try to get the contents of the canvas.
88
+ try {
89
+ dataURL = canvas.toDataURL();
90
+ successCallback(dataURL, callbackArgs);
91
+ } catch (e) {
92
+ // Failed - either tainted canvas or something else went horribly wrong
93
+ if (e.name === 'SecurityError' || e.name === 'SECURITY_ERR' || e.message === 'SecurityError') {
94
+ taintedHandler(imageURL, callbackArgs);
95
+ } else {
96
+ throw e;
97
+ }
98
+ }
99
+ }
100
+ } finally {
101
+ if (finallyCallback) {
102
+ finallyCallback(imageURL, callbackArgs);
94
103
  }
95
104
  }
96
- }
97
- if (finallyCallback) {
98
- finallyCallback(imageURL, callbackArgs);
99
- }
100
- };
101
- img.onerror = function () {
102
- failedLoadCallback(imageURL, callbackArgs);
103
- if (finallyCallback) {
104
- finallyCallback(imageURL, callbackArgs);
105
- }
105
+ },
106
+ // Image load failed (e.g. invalid URL)
107
+ errorHandler = function () {
108
+ failedLoadCallback(imageURL, callbackArgs);
109
+ if (finallyCallback) {
110
+ finallyCallback(imageURL, callbackArgs);
111
+ }
112
+ };
113
+
114
+ // This is called on load if the image drawing to canvas failed with a security error.
115
+ // We retry the drawing with crossOrigin set to Anonymous.
116
+ taintedHandler = function () {
117
+ img = new win.Image();
118
+ taintedHandler = taintedCallback;
119
+ img.crossOrigin = 'Anonymous'; // Must be set prior to loading image source
120
+ img.onload = loadHandler;
121
+ img.onerror = errorHandler;
122
+ img.src = imageURL;
106
123
  };
124
+
125
+ img.onload = loadHandler;
126
+ img.onerror = errorHandler;
107
127
  img.src = imageURL;
108
128
  },
109
129
  // Get blob URL from SVG code. Falls back to normal data URI.
@@ -144,7 +164,7 @@
144
164
  try {
145
165
  windowRef = win.open(dataURL, 'chart');
146
166
  if (windowRef === undefined || windowRef === null) {
147
- throw 1;
167
+ throw 'Failed to open window';
148
168
  }
149
169
  } catch (e) {
150
170
  // window.open failed, trying location.href
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.0 (2105-12-15)
2
+ * @license Highcharts JS v4.2.2 (2016-02-04)
3
3
  * Solid angular gauge module
4
4
  *
5
- * (c) 2010-2014 Torstein Honsi
5
+ * (c) 2010-2016 Torstein Honsi
6
6
  *
7
7
  * License: www.highcharts.com/license
8
8
  */
@@ -204,7 +204,8 @@
204
204
  axisMinAngle = Math.min(yAxis.startAngleRad, yAxis.endAngleRad),
205
205
  axisMaxAngle = Math.max(yAxis.startAngleRad, yAxis.endAngleRad),
206
206
  minAngle,
207
- maxAngle;
207
+ maxAngle,
208
+ attribs;
208
209
 
209
210
  if (toColor === 'none') { // #3708
210
211
  toColor = point.color || series.color || 'none';
@@ -245,14 +246,18 @@
245
246
  if (d) {
246
247
  shapeArgs.d = d; // animate alters it
247
248
  }
248
- } else {
249
+ } else {
250
+ attribs = {
251
+ stroke: options.borderColor || 'none',
252
+ 'stroke-width': options.borderWidth || 0,
253
+ fill: toColor,
254
+ 'sweep-flag': 0
255
+ };
256
+ if (options.linecap !== 'square') {
257
+ attribs['stroke-linecap'] = attribs['stroke-linejoin'] = 'round';
258
+ }
249
259
  point.graphic = renderer.arc(shapeArgs)
250
- .attr({
251
- stroke: options.borderColor || 'none',
252
- 'stroke-width': options.borderWidth || 0,
253
- fill: toColor,
254
- 'sweep-flag': 0
255
- })
260
+ .attr(attribs)
256
261
  .add(series.group);
257
262
  }
258
263
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.2.0 (2105-12-15)
2
+ * @license Highcharts JS v4.2.2 (2016-02-04)
3
3
  *
4
4
  * (c) 2014 Highsoft AS
5
5
  * Authors: Jon Arild Nygard / Oystein Moseng
@@ -1,3 +1,3 @@
1
1
  module Highcharts
2
- VERSION = "4.2.0"
2
+ VERSION = "4.2.2"
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: 4.2.0
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Per Christian B. Viken