app/assets/javascripts/highcharts.js in highcharts-rails-5.0.3 vs app/assets/javascripts/highcharts.js in highcharts-rails-5.0.4
- old
+ new
@@ -1,7 +1,7 @@
/**
- * @license Highcharts JS v5.0.3 (2016-11-18)
+ * @license Highcharts JS v5.0.4 (2016-11-25)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
@@ -19,11 +19,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
/* global window */
var win = window,
doc = win.document;
var SVG_NS = 'http://www.w3.org/2000/svg',
@@ -34,11 +33,11 @@
isFirefox = /Firefox/.test(userAgent),
hasBidiBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4; // issue #38
var Highcharts = win.Highcharts ? win.Highcharts.error(16, true) : {
product: 'Highcharts',
- version: '5.0.3',
+ version: '5.0.4',
deg2rad: Math.PI * 2 / 360,
doc: doc,
hasBidiBug: hasBidiBug,
hasTouch: doc && doc.documentElement.ontouchstart !== undefined,
isMS: isMS,
@@ -56,20 +55,20 @@
marginNames: ['plotTop', 'marginRight', 'marginBottom', 'plotLeft'],
noop: function() {
return undefined;
}
};
+
return Highcharts;
}());
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* eslint max-len: ["warn", 80, 4] */
- 'use strict';
/**
* The Highcharts object is the placeholder for all other members, and various
* utility functions.
* @namespace Highcharts
@@ -151,11 +150,13 @@
}
// If animation is finished or length not matching, land on right value
} else {
ret = end;
}
+ this.elem.animProp = 'd';
this.elem.attr('d', ret);
+ this.elem.animProp = null;
},
/**
* Update the element with the current animation step.
*
@@ -173,11 +174,13 @@
this[prop + 'Setter']();
// Other animations on SVGElement
} else if (elem.attr) {
if (elem.element) {
+ elem.animProp = prop;
elem.attr(prop, now);
+ elem.animProp = null;
}
// HTML styles, raw HTML content like container size
} else {
elem.style[prop] = now + this.unit;
@@ -212,10 +215,11 @@
this.unit = unit;
this.now = this.start;
this.pos = 0;
timer.elem = this.elem;
+ timer.prop = this.prop;
if (timer() && timers.push(timer) === 1) {
timer.timerId = setInterval(function() {
for (i = 0; i < timers.length; i++) {
@@ -308,16 +312,24 @@
isArea = elem.isArea,
positionFactor = isArea ? 2 : 1,
reverse;
/**
- * In splines make move points have six parameters like bezier curves
+ * In splines make moveTo and lineTo points have six parameters like
+ * bezier curves, to allow animation one-to-one.
*/
function sixify(arr) {
+ var isOperator,
+ nextIsOperator;
i = arr.length;
while (i--) {
- if (arr[i] === 'M' || arr[i] === 'L') {
+
+ // Fill in dummy coordinates only if the next operator comes
+ // three places behind (#5788)
+ isOperator = arr[i] === 'M' || arr[i] === 'L';
+ nextIsOperator = /[a-zA-Z]/.test(arr[i + 3]);
+ if (isOperator && !nextIsOperator) {
arr.splice(
i + 1, 0,
arr[i + 1], arr[i + 2],
arr[i + 1], arr[i + 2]
);
@@ -1541,19 +1553,21 @@
* stopping everything, we can just stop the actual attributes we're setting.
*
* @function #stop
* @memberOf Highcharts
* @param {SVGElement} el - The SVGElement to stop animation on.
+ * @param {string} [prop] - The property to stop animating. If given, the stop
+ * method will stop a single property from animating, while others continue.
* @returns {void}
*/
- H.stop = function(el) {
+ H.stop = function(el, prop) {
var i = timers.length;
// Remove timers related to this element (#4519)
while (i--) {
- if (timers[i].elem === el) {
+ if (timers[i].elem === el && (!prop || prop === timers[i].prop)) {
timers[i].stopped = true; // #4667
}
}
};
@@ -1826,10 +1840,14 @@
opt.easing :
(Math[opt.easing] || Math.easeInOutSine);
opt.curAnim = H.merge(params);
for (prop in params) {
+
+ // Stop current running animation of this property
+ H.stop(el, prop);
+
fx = new H.Fx(el, opt, prop);
end = null;
if (prop === 'd') {
fx.paths = fx.initPath(
@@ -2043,11 +2061,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var each = H.each,
isNumber = H.isNumber,
map = H.map,
merge = H.merge,
pInt = H.pInt;
@@ -2212,11 +2229,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var SVGElement,
SVGRenderer,
addEvent = H.addEvent,
animate = H.animate,
@@ -2322,11 +2338,10 @@
* @param {Function} [complete] Function to perform at the end of animation.
* @returns {SVGElement} Returns the SVGElement for chaining.
*/
animate: function(params, options, complete) {
var animOptions = pick(options, this.renderer.globalAnimation, true);
- stop(this); // stop regardless of animation actually running, or reverting to .attr (#607)
if (animOptions) {
if (complete) { // allows using a callback with the global animation without overwriting it
animOptions.complete = complete;
}
animate(this, params, animOptions);
@@ -2562,12 +2577,10 @@
// Remove then erase
erase(tspans, elem.removeChild(tspan));
}
});
- this.realBox = elem.getBBox();
-
// For each of the tspans, create a stroked copy behind it.
each(tspans, function(tspan, y) {
var clone;
// Let the first line start at the correct X position
@@ -2676,12 +2689,16 @@
for (key in hash) {
value = hash[key];
skipAttr = false;
+ // Unless .attr is from the animator update, stop current
+ // running animation of this property
+ if (key !== this.animProp) {
+ stop(this, key);
+ }
-
if (this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(key)) {
if (!hasSetSymbolSize) {
this.symbolAttr(hash);
hasSetSymbolSize = true;
}
@@ -3940,11 +3957,11 @@
.replace(/ /g, '%20') : // replace spaces (needed for Safari only)
'';
// Add description
desc = this.createElement('desc').add();
- desc.element.appendChild(doc.createTextNode('Created with Highcharts 5.0.3'));
+ desc.element.appendChild(doc.createTextNode('Created with Highcharts 5.0.4'));
renderer.defs = this.createElement('defs').add();
renderer.allowHTML = allowHTML;
renderer.forExport = forExport;
@@ -5650,11 +5667,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var attr = H.attr,
createElement = H.createElement,
css = H.css,
defined = H.defined,
each = H.each,
@@ -6007,11 +6023,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var VMLRenderer,
VMLRendererExtension,
VMLElement,
@@ -7159,11 +7174,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var color = H.color,
each = H.each,
getTZOffset = H.getTZOffset,
isTouchDevice = H.isTouchDevice,
merge = H.merge,
@@ -7195,11 +7209,11 @@
},
global: {
useUTC: true,
//timezoneOffset: 0,
- VMLRadialGradientURL: 'http://code.highcharts.com/5.0.3/gfx/vml-radial-gradient.png'
+ VMLRadialGradientURL: 'http://code.highcharts.com/5.0.4/gfx/vml-radial-gradient.png'
},
chart: {
//animation: true,
//alignTicks: false,
@@ -7519,11 +7533,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var arrayMax = H.arrayMax,
arrayMin = H.arrayMin,
defined = H.defined,
destroyObjectProperties = H.destroyObjectProperties,
each = H.each,
@@ -7845,18 +7858,16 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var correctFloat = H.correctFloat,
defined = H.defined,
destroyObjectProperties = H.destroyObjectProperties,
isNumber = H.isNumber,
merge = H.merge,
pick = H.pick,
- stop = H.stop,
deg2rad = H.deg2rad;
/**
* The Tick class
*/
@@ -8239,11 +8250,10 @@
// Set the new position, and show or hide
if (show && isNumber(xy.y)) {
xy.opacity = opacity;
label[tick.isNew ? 'attr' : 'animate'](xy);
} else {
- stop(label); // #5332
label.attr('y', -9999); // #1338
}
tick.isNew = false;
}
},
@@ -8261,11 +8271,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var addEvent = H.addEvent,
animObject = H.animObject,
arrayMax = H.arrayMax,
arrayMin = H.arrayMin,
@@ -10830,11 +10839,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var Axis = H.Axis,
Date = H.Date,
dateFormat = H.dateFormat,
defaultOptions = H.defaultOptions,
defined = H.defined,
@@ -11084,11 +11092,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var Axis = H.Axis,
getMagnitude = H.getMagnitude,
map = H.map,
normalizeTickInterval = H.normalizeTickInterval,
pick = H.pick;
@@ -11208,21 +11215,19 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var dateFormat = H.dateFormat,
each = H.each,
extend = H.extend,
format = H.format,
isNumber = H.isNumber,
map = H.map,
merge = H.merge,
pick = H.pick,
splat = H.splat,
- stop = H.stop,
syncTimeout = H.syncTimeout,
timeUnits = H.timeUnits;
/**
* The tooltip object
* @param {Object} chart The chart instance
@@ -11671,11 +11676,10 @@
label = tooltip.getLabel();
// show it
if (tooltip.isHidden) {
- stop(label);
label.attr({
opacity: 1
}).show();
}
@@ -11952,11 +11956,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var addEvent = H.addEvent,
attr = H.attr,
charts = H.charts,
color = H.color,
css = H.css,
@@ -12731,11 +12734,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var charts = H.charts,
each = H.each,
extend = H.extend,
map = H.map,
noop = H.noop,
@@ -12936,10 +12938,15 @@
var chart = this.chart,
hasMoved,
pinchDown,
isInside;
+ if (chart.index !== H.hoverChartIndex) {
+ this.onContainerMouseLeave({
+ relatedTarget: true
+ });
+ }
H.hoverChartIndex = chart.index;
if (e.touches.length === 1) {
e = this.normalize(e);
@@ -13004,11 +13011,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var addEvent = H.addEvent,
charts = H.charts,
css = H.css,
doc = H.doc,
extend = H.extend,
@@ -13124,11 +13130,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var Legend,
addEvent = H.addEvent,
css = H.css,
discardElement = H.discardElement,
@@ -14064,11 +14069,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var addEvent = H.addEvent,
animate = H.animate,
animObject = H.animObject,
attr = H.attr,
doc = H.doc,
@@ -15619,11 +15623,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var Point,
each = H.each,
extend = H.extend,
erase = H.erase,
@@ -15966,11 +15969,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var addEvent = H.addEvent,
animObject = H.animObject,
arrayMax = H.arrayMax,
arrayMin = H.arrayMin,
correctFloat = H.correctFloat,
@@ -17984,11 +17986,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var Axis = H.Axis,
Chart = H.Chart,
correctFloat = H.correctFloat,
defined = H.defined,
destroyObjectProperties = H.destroyObjectProperties,
@@ -18470,11 +18471,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var addEvent = H.addEvent,
animate = H.animate,
Axis = H.Axis,
Chart = H.Chart,
createElement = H.createElement,
@@ -19181,11 +19181,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var color = H.color,
each = H.each,
LegendSymbolMixin = H.LegendSymbolMixin,
map = H.map,
pick = H.pick,
@@ -19511,11 +19510,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var pick = H.pick,
seriesType = H.seriesType;
/**
* Spline series type.
@@ -19647,11 +19645,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var areaProto = H.seriesTypes.area.prototype,
defaultPlotOptions = H.defaultPlotOptions,
LegendSymbolMixin = H.LegendSymbolMixin,
seriesType = H.seriesType;
/**
@@ -19670,11 +19667,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var animObject = H.animObject,
color = H.color,
each = H.each,
extend = H.extend,
isNumber = H.isNumber,
@@ -19682,11 +19678,10 @@
merge = H.merge,
noop = H.noop,
pick = H.pick,
Series = H.Series,
seriesType = H.seriesType,
- stop = H.stop,
svg = H.svg;
/**
* The column series type.
*
* @constructor seriesTypes.column
@@ -20038,11 +20033,10 @@
if (isNumber(plotY) && point.y !== null) {
shapeArgs = point.shapeArgs;
if (graphic) { // update
- stop(graphic);
graphic[chart.pointCount < animationLimit ? 'animate' : 'attr'](
merge(shapeArgs)
);
} else {
@@ -20133,11 +20127,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var seriesType = H.seriesType;
/**
* The Bar series class
@@ -20151,11 +20144,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var Series = H.Series,
seriesType = H.seriesType;
/**
* The scatter series type
*/
@@ -20189,11 +20181,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var pick = H.pick,
relativeLength = H.relativeLength;
H.CenteredSeriesMixin = {
/**
@@ -20239,11 +20230,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var addEvent = H.addEvent,
CenteredSeriesMixin = H.CenteredSeriesMixin,
defined = H.defined,
each = H.each,
extend = H.extend,
@@ -20737,11 +20727,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var addEvent = H.addEvent,
arrayMax = H.arrayMax,
defined = H.defined,
each = H.each,
extend = H.extend,
@@ -20751,12 +20740,11 @@
noop = H.noop,
pick = H.pick,
relativeLength = H.relativeLength,
Series = H.Series,
seriesTypes = H.seriesTypes,
- stableSort = H.stableSort,
- stop = H.stop;
+ stableSort = H.stableSort;
/**
* Generatl distribution algorithm for distributing labels of differing size along a
* confined length in two dimensions. The algorithm takes an array of objects containing
@@ -21140,11 +21128,10 @@
}
}
// Show or hide based on the final aligned position
if (!visible) {
- stop(dataLabel);
dataLabel.attr({
y: -9999
});
dataLabel.placed = false; // don't animate back in
}
@@ -21596,11 +21583,10 @@
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
/**
* Highcharts module to hide overlapping data labels. This module is included in Highcharts.
*/
var Chart = H.Chart,
each = H.each,
@@ -21745,11 +21731,10 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var addEvent = H.addEvent,
Chart = H.Chart,
createElement = H.createElement,
css = H.css,
defaultOptions = H.defaultOptions,
@@ -22436,11 +22421,10 @@
if (!halo) {
series.halo = halo = chart.renderer.path()
// #5818, #5903
.add(hasMarkers ? series.markerGroup : series.group);
}
- H.stop(halo);
halo[move ? 'animate' : 'attr']({
d: point.haloPath(haloOptions.size)
});
halo.attr({
'class': 'highcharts-halo highcharts-color-' + pick(point.colorIndex, series.colorIndex)
@@ -22703,10 +22687,9 @@
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
- 'use strict';
var Chart = H.Chart,
each = H.each,
inArray = H.inArray,
isObject = H.isObject,
pick = H.pick,