highcharts-rails 4.1.10 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
  // @compilation_level SIMPLE_OPTIMIZATIONS
3
3
 
4
4
  /**
5
- * @license Highcharts JS v4.1.10 (2015-12-07)
5
+ * @license Highcharts JS v4.2.0 (2105-12-15)
6
6
  *
7
7
  * 3D features for Highcharts JS
8
8
  *
@@ -2,7 +2,7 @@
2
2
  // @compilation_level SIMPLE_OPTIMIZATIONS
3
3
 
4
4
  /**
5
- * @license Highcharts JS v4.1.10 (2015-12-07)
5
+ * @license Highcharts JS v4.2.0 (2105-12-15)
6
6
  *
7
7
  * (c) 2009-2014 Torstein Honsi
8
8
  *
@@ -966,6 +966,8 @@ var arrayMin = Highcharts.arrayMin,
966
966
  translate: function () {
967
967
  var series = this,
968
968
  yAxis = series.yAxis,
969
+ xAxis = series.xAxis,
970
+ chart = series.chart,
969
971
  plotHigh;
970
972
 
971
973
  colProto.translate.apply(series);
@@ -978,7 +980,6 @@ var arrayMin = Highcharts.arrayMin,
978
980
  height,
979
981
  y;
980
982
 
981
- point.tooltipPos = null; // don't inherit from column
982
983
  point.plotHigh = plotHigh = yAxis.translate(point.high, 0, 1, 0, 1);
983
984
  point.plotLow = point.plotY;
984
985
 
@@ -1000,6 +1001,17 @@ var arrayMin = Highcharts.arrayMin,
1000
1001
 
1001
1002
  shapeArgs.height = height;
1002
1003
  shapeArgs.y = y;
1004
+
1005
+ point.tooltipPos = chart.inverted ?
1006
+ [
1007
+ yAxis.len + yAxis.pos - chart.plotLeft - y - height / 2,
1008
+ xAxis.len + xAxis.pos - chart.plotTop - shapeArgs.x - shapeArgs.width / 2,
1009
+ height
1010
+ ] : [
1011
+ xAxis.left - chart.plotLeft + shapeArgs.x + shapeArgs.width / 2,
1012
+ yAxis.pos - chart.plotTop + y + height / 2,
1013
+ height
1014
+ ]; // don't inherit from column tooltip position - #3372
1003
1015
  });
1004
1016
  },
1005
1017
  directTouch: true,
@@ -54,7 +54,9 @@
54
54
 
55
55
  'use strict';
56
56
 
57
- var noop = function () {},
57
+ var win = H.win,
58
+ doc = win.document,
59
+ noop = function () {},
58
60
  Color = H.Color,
59
61
  Series = H.Series,
60
62
  seriesTypes = H.seriesTypes,
@@ -198,7 +200,7 @@
198
200
  };
199
201
 
200
202
  if (!this.canvas) {
201
- this.canvas = document.createElement('canvas');
203
+ this.canvas = doc.createElement('canvas');
202
204
  this.image = chart.renderer.image('', 0, 0, width, height).add(this.group);
203
205
  this.ctx = ctx = this.canvas.getContext('2d');
204
206
  if (chart.inverted) {
@@ -571,8 +573,10 @@
571
573
 
572
574
  if (boostPoint && !(boostPoint instanceof this.pointClass)) {
573
575
  point = (new this.pointClass()).init(this, this.options.data[boostPoint.i]);
574
- point.dist = boostPoint.dist;
575
576
  point.category = point.x;
577
+
578
+ point.dist = boostPoint.dist;
579
+ point.distX = boostPoint.distX;
576
580
  point.plotX = boostPoint.plotX;
577
581
  point.plotY = boostPoint.plotY;
578
582
  }
@@ -1,16 +1,19 @@
1
1
  /**
2
- * Highcharts JS v4.1.10 (2015-12-07)
2
+ * Highcharts JS v4.2.0 (2105-12-15)
3
3
  * Highcharts Broken Axis module
4
4
  *
5
5
  * License: www.highcharts.com/license
6
6
  */
7
7
 
8
8
  (function (factory) {
9
+ /*= if (!build.assembly) { =*/
9
10
  if (typeof module === 'object' && module.exports) {
10
11
  module.exports = factory;
11
- } else {
12
- factory(Highcharts);
12
+ return;
13
13
  }
14
+ /*= } =*/
15
+ factory(Highcharts);
16
+
14
17
  }(function (H) {
15
18
 
16
19
  'use strict';
@@ -2908,7 +2908,7 @@ if (CanvasRenderingContext2D) {
2908
2908
  });
2909
2909
  }
2910
2910
  }/**
2911
- * @license Highcharts JS v4.1.10 (2015-12-07)
2911
+ * @license Highcharts JS v4.2.0 (2105-12-15)
2912
2912
  * CanVGRenderer Extension module
2913
2913
  *
2914
2914
  * (c) 2011-2012 Torstein Honsi, Erik Olsson
@@ -2918,6 +2918,7 @@ if (CanvasRenderingContext2D) {
2918
2918
 
2919
2919
  (function (Highcharts) {
2920
2920
  var UNDEFINED,
2921
+ win = Highcharts.win,
2921
2922
  DIV = 'div',
2922
2923
  ABSOLUTE = 'absolute',
2923
2924
  RELATIVE = 'relative',
@@ -3108,7 +3109,7 @@ if (CanvasRenderingContext2D) {
3108
3109
  */
3109
3110
  draw: function () {
3110
3111
  var renderer = this;
3111
- window.canvg(renderer.canvas, renderer.hiddenSvg.innerHTML);
3112
+ win.canvg(renderer.canvas, renderer.hiddenSvg.innerHTML);
3112
3113
  }
3113
3114
  });
3114
3115
  }(Highcharts));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.10 (2015-12-07)
2
+ * @license Highcharts JS v4.2.0 (2105-12-15)
3
3
  * Data module
4
4
  *
5
5
  * (c) 2012-2014 Torstein Honsi
@@ -17,7 +17,9 @@
17
17
  }(function (Highcharts) {
18
18
 
19
19
  // Utilities
20
- var each = Highcharts.each,
20
+ var win = Highcharts.win,
21
+ doc = win.document,
22
+ each = Highcharts.each,
21
23
  pick = Highcharts.pick,
22
24
  inArray = Highcharts.inArray,
23
25
  splat = Highcharts.splat,
@@ -240,7 +242,7 @@
240
242
  if (table) {
241
243
 
242
244
  if (typeof table === 'string') {
243
- table = document.getElementById(table);
245
+ table = doc.getElementById(table);
244
246
  }
245
247
 
246
248
  each(table.getElementsByTagName('tr'), function (tr, rowNo) {
@@ -65,9 +65,9 @@
65
65
  * Handle animation of the color attributes directly
66
66
  */
67
67
  each(['fill', 'stroke'], function (prop) {
68
- H.addAnimSetter(prop, function (fx) {
69
- fx.elem.attr(prop, tweenColors(H.Color(fx.start), H.Color(fx.end), fx.pos));
70
- });
68
+ H.Fx.prototype[prop + 'Setter'] = function () {
69
+ this.elem.attr(prop, tweenColors(H.Color(this.start), H.Color(this.end), this.pos));
70
+ };
71
71
  });
72
72
 
73
73
  // Add language
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.10 (2015-12-07)
2
+ * @license Highcharts JS v4.2.0 (2105-12-15)
3
3
  * Exporting module
4
4
  *
5
5
  * (c) 2010-2014 Torstein Honsi
@@ -17,7 +17,9 @@
17
17
  }(function (Highcharts) {
18
18
 
19
19
  // create shortcuts
20
- var Chart = Highcharts.Chart,
20
+ var win = Highcharts.win,
21
+ doc = win.document,
22
+ Chart = Highcharts.Chart,
21
23
  addEvent = Highcharts.addEvent,
22
24
  removeEvent = Highcharts.removeEvent,
23
25
  fireEvent = Highcharts.fireEvent,
@@ -30,8 +32,6 @@ var Chart = Highcharts.Chart,
30
32
  splat = Highcharts.splat,
31
33
  math = Math,
32
34
  mathMax = math.max,
33
- doc = document,
34
- win = window,
35
35
  isTouchDevice = Highcharts.isTouchDevice,
36
36
  M = 'M',
37
37
  L = 'L',
@@ -539,9 +539,9 @@ extend(Chart.prototype, {
539
539
 
540
540
 
541
541
  // Hide it on clicking or touching outside the menu (#2258, #2335, #2407)
542
- addEvent(document, 'mouseup', docMouseUpHandler);
542
+ addEvent(doc, 'mouseup', docMouseUpHandler);
543
543
  addEvent(chart, 'destroy', function () {
544
- removeEvent(document, 'mouseup', docMouseUpHandler);
544
+ removeEvent(doc, 'mouseup', docMouseUpHandler);
545
545
  });
546
546
 
547
547
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.10 (2015-12-07)
2
+ * @license Highcharts JS v4.2.0 (2105-12-15)
3
3
  *
4
4
  * (c) 2011-2014 Torstein Honsi
5
5
  *
@@ -488,9 +488,9 @@
488
488
  * Handle animation of the color attributes directly
489
489
  */
490
490
  each(['fill', 'stroke'], function (prop) {
491
- Highcharts.addAnimSetter(prop, function (fx) {
492
- fx.elem.attr(prop, ColorAxis.prototype.tweenColors(Color(fx.start), Color(fx.end), fx.pos));
493
- });
491
+ Highcharts.Fx.prototype[prop + 'Setter'] = function () {
492
+ this.elem.attr(prop, ColorAxis.prototype.tweenColors(Color(this.start), Color(this.end), this.pos));
493
+ };
494
494
  });
495
495
 
496
496
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.10 (2015-12-07)
2
+ * @license Highcharts JS v4.2.0 (2105-12-15)
3
3
  * Plugin for displaying a message when there is no data visible in chart.
4
4
  *
5
5
  * (c) 2010-2014 Highsoft AS
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.10 (2015-12-07)
2
+ * @license Highcharts JS v4.2.0 (2105-12-15)
3
3
  * Client side exporting module
4
4
  *
5
5
  * (c) 2015 Torstein Honsi / Oystein Moseng
@@ -16,19 +16,40 @@
16
16
  }
17
17
  }(function (Highcharts) {
18
18
 
19
+ var win = Highcharts.win,
20
+ nav = win.navigator,
21
+ doc = win.document;
22
+
19
23
  // Dummy object so we can reuse our canvas-tools.js without errors
20
24
  Highcharts.CanVGRenderer = {};
21
25
 
26
+
27
+ /**
28
+ * Downloads a script and executes a callback when done.
29
+ * @param {String} scriptLocation
30
+ * @param {Function} callback
31
+ */
32
+ function getScript(scriptLocation, callback) {
33
+ var head = doc.getElementsByTagName('head')[0],
34
+ script = doc.createElement('script');
35
+
36
+ script.type = 'text/javascript';
37
+ script.src = scriptLocation;
38
+ script.onload = callback;
39
+
40
+ head.appendChild(script);
41
+ }
42
+
22
43
  /**
23
44
  * Add a new method to the Chart object to perform a local download
24
45
  */
25
46
  Highcharts.Chart.prototype.exportChartLocal = function (exportingOptions, chartOptions) {
26
47
  var chart = this,
27
48
  options = Highcharts.merge(chart.options.exporting, exportingOptions),
28
- webKit = navigator.userAgent.indexOf('WebKit') > -1 && navigator.userAgent.indexOf('Chrome') < 0, // Webkit and not chrome
49
+ webKit = nav.userAgent.indexOf('WebKit') > -1 && nav.userAgent.indexOf('Chrome') < 0, // Webkit and not chrome
29
50
  scale = options.scale || 2,
30
51
  chartCopyContainer,
31
- domurl = window.URL || window.webkitURL || window,
52
+ domurl = win.URL || win.webkitURL || win,
32
53
  images,
33
54
  imagesEmbedded = 0,
34
55
  el,
@@ -44,12 +65,12 @@
44
65
  // Pass in callbacks to handle results. finallyCallback is always called at the end of the process. Supplying this callback is optional.
45
66
  // All callbacks receive two arguments: imageURL, and callbackArgs. callbackArgs is used only by callbacks and can contain whatever.
46
67
  imageToDataUrl = function (imageURL, callbackArgs, successCallback, taintedCallback, noCanvasSupportCallback, failedLoadCallback, finallyCallback) {
47
- var img = new Image();
68
+ var img = new win.Image();
48
69
  if (!webKit) {
49
70
  img.crossOrigin = 'Anonymous'; // For some reason Safari chokes on this attribute
50
71
  }
51
72
  img.onload = function () {
52
- var canvas = document.createElement('canvas'),
73
+ var canvas = doc.createElement('canvas'),
53
74
  ctx = canvas.getContext && canvas.getContext('2d'),
54
75
  dataURL;
55
76
 
@@ -90,8 +111,8 @@
90
111
  try {
91
112
  // Safari requires data URI since it doesn't allow navigation to blob URLs
92
113
  // Firefox has an issue with Blobs and internal references, leading to gradients not working using Blobs (#4550)
93
- if (!webKit && navigator.userAgent.toLowerCase().indexOf('firefox') < 0) {
94
- return domurl.createObjectURL(new Blob([svg], { type: 'image/svg+xml;charset-utf-16' }));
114
+ if (!webKit && nav.userAgent.toLowerCase().indexOf('firefox') < 0) {
115
+ return domurl.createObjectURL(new win.Blob([svg], { type: 'image/svg+xml;charset-utf-16' }));
95
116
  }
96
117
  } catch (e) {
97
118
  // Ignore
@@ -100,13 +121,13 @@
100
121
  },
101
122
  // Download contents by dataURL/blob
102
123
  download = function (dataURL, extension) {
103
- var a = document.createElement('a'),
124
+ var a = doc.createElement('a'),
104
125
  filename = (options.filename || 'chart') + '.' + extension,
105
126
  windowRef;
106
127
 
107
128
  // IE specific blob implementation
108
- if (navigator.msSaveOrOpenBlob) {
109
- navigator.msSaveOrOpenBlob(dataURL, filename);
129
+ if (nav.msSaveOrOpenBlob) {
130
+ nav.msSaveOrOpenBlob(dataURL, filename);
110
131
  return;
111
132
  }
112
133
 
@@ -115,19 +136,19 @@
115
136
  a.href = dataURL;
116
137
  a.download = filename; // HTML5 download attribute
117
138
  a.target = '_blank';
118
- document.body.appendChild(a);
139
+ doc.body.appendChild(a);
119
140
  a.click();
120
- document.body.removeChild(a);
141
+ doc.body.removeChild(a);
121
142
  } else {
122
143
  // No download attr, just opening data URI
123
144
  try {
124
- windowRef = window.open(dataURL, 'chart');
145
+ windowRef = win.open(dataURL, 'chart');
125
146
  if (windowRef === undefined || windowRef === null) {
126
147
  throw 1;
127
148
  }
128
149
  } catch (e) {
129
150
  // window.open failed, trying location.href
130
- window.location.href = dataURL;
151
+ win.location.href = dataURL;
131
152
  }
132
153
  }
133
154
  },
@@ -141,7 +162,7 @@
141
162
  if (options && options.type === 'image/svg+xml') {
142
163
  // SVG download. In this case, we want to use Microsoft specific Blob if available
143
164
  try {
144
- if (navigator.msSaveOrOpenBlob) {
165
+ if (nav.msSaveOrOpenBlob) {
145
166
  blob = new MSBlobBuilder();
146
167
  blob.append(svg);
147
168
  svgurl = blob.getBlob('image/svg+xml');
@@ -167,14 +188,14 @@
167
188
  }, function () {
168
189
  // Failed due to tainted canvas
169
190
  // Create new and untainted canvas
170
- var canvas = document.createElement('canvas'),
191
+ var canvas = doc.createElement('canvas'),
171
192
  ctx = canvas.getContext('2d'),
172
193
  imageWidth = svg.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale,
173
194
  imageHeight = svg.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale,
174
195
  downloadWithCanVG = function () {
175
196
  ctx.drawSvg(svg, 0, 0, imageWidth, imageHeight);
176
197
  try {
177
- download(navigator.msSaveOrOpenBlob ? canvas.msToBlob() : canvas.toDataURL('image/png'), 'png');
198
+ download(nav.msSaveOrOpenBlob ? canvas.msToBlob() : canvas.toDataURL('image/png'), 'png');
178
199
  } catch (e) {
179
200
  fallbackToExportServer();
180
201
  }
@@ -182,13 +203,13 @@
182
203
 
183
204
  canvas.width = imageWidth;
184
205
  canvas.height = imageHeight;
185
- if (window.canvg) {
206
+ if (win.canvg) {
186
207
  // Use preloaded canvg
187
208
  downloadWithCanVG();
188
209
  } else {
189
210
  // Must load canVG first
190
211
  chart.showLoading();
191
- Highcharts.getScript(Highcharts.getOptions().global.canvasToolsURL, function () {
212
+ getScript(Highcharts.getOptions().global.canvasToolsURL, function () {
192
213
  chart.hideLoading();
193
214
  downloadWithCanVG();
194
215
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.10 (2015-12-07)
2
+ * @license Highcharts JS v4.2.0 (2105-12-15)
3
3
  * Solid angular gauge module
4
4
  *
5
5
  * (c) 2010-2014 Torstein Honsi
@@ -158,9 +158,9 @@
158
158
  * Handle animation of the color attributes directly
159
159
  */
160
160
  each(['fill', 'stroke'], function (prop) {
161
- H.addAnimSetter(prop, function (fx) {
162
- fx.elem.attr(prop, colorAxisMethods.tweenColors(H.Color(fx.start), H.Color(fx.end), fx.pos));
163
- });
161
+ H.Fx.prototype[prop + 'Setter'] = function () {
162
+ this.elem.attr(prop, colorAxisMethods.tweenColors(H.Color(this.start), H.Color(this.end), this.pos));
163
+ };
164
164
  });
165
165
 
166
166
  // The series prototype
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Highcharts JS v4.1.10 (2015-12-07)
2
+ * @license Highcharts JS v4.2.0 (2105-12-15)
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.1.10"
2
+ VERSION = "4.2.0"
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.1.10
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Per Christian B. Viken
@@ -72,8 +72,6 @@ files:
72
72
  - app/assets/images/highcharts/snow.png
73
73
  - app/assets/images/highcharts/sun.png
74
74
  - app/assets/javascripts/highcharts.js
75
- - app/assets/javascripts/highcharts/adapters/mootools-adapter.js
76
- - app/assets/javascripts/highcharts/adapters/prototype-adapter.js
77
75
  - app/assets/javascripts/highcharts/adapters/standalone-framework.js
78
76
  - app/assets/javascripts/highcharts/highcharts-3d.js
79
77
  - app/assets/javascripts/highcharts/highcharts-more.js