highmaps-release
Advanced tools
Comparing version 1.1.9 to 1.1.10
/* | ||
Highstock JS v2.1.9 (2015-10-07) | ||
Highstock JS v2.1.10 (2015-12-07) | ||
@@ -8,12 +8,12 @@ Standalone Highcharts Framework | ||
*/ | ||
var HighchartsAdapter=function(){function o(c){function a(a,b,d){a.removeEventListener(b,d,!1)}function d(a,b,d){d=a.HCProxiedMethods[d.toString()];a.detachEvent("on"+b,d)}function b(b,c){var f=b.HCEvents,k,h,l,g;if(b.removeEventListener)k=a;else if(b.attachEvent)k=d;else return;c?(h={},h[c]=!0):h=f;for(g in h)if(f[g])for(l=f[g].length;l--;)k(b,g,f[g][l])}c.HCExtended||Highcharts.extend(c,{HCExtended:!0,HCEvents:{},bind:function(a,b){var d=this,c=this.HCEvents,h;if(d.addEventListener)d.addEventListener(a, | ||
b,!1);else if(d.attachEvent){h=function(a){a.target=a.srcElement||window;b.call(d,a)};if(!d.HCProxiedMethods)d.HCProxiedMethods={};d.HCProxiedMethods[b.toString()]=h;d.attachEvent("on"+a,h)}c[a]===q&&(c[a]=[]);c[a].push(b)},unbind:function(c,i){var f,k;c?(f=this.HCEvents[c]||[],i?(k=HighchartsAdapter.inArray(i,f),k>-1&&(f.splice(k,1),this.HCEvents[c]=f),this.removeEventListener?a(this,c,i):this.attachEvent&&d(this,c,i)):(b(this,c),this.HCEvents[c]=[])):(b(this),this.HCEvents={})},trigger:function(a, | ||
b){var d=this.HCEvents[a]||[],c=d.length,h,g,j;g=function(){b.defaultPrevented=!0};for(h=0;h<c;h++){j=d[h];if(b.stopped)break;b.preventDefault=g;b.target=this;if(!b.type)b.type=a;j.call(this,b)===!1&&b.preventDefault()}}});return c}var q,j=document,p=[],g=[],m={},n;Math.easeInOutSine=function(c,a,d,b){return-d/2*(Math.cos(Math.PI*c/b)-1)+a};return{init:function(c){if(!j.defaultView)this._getStyle=function(a,d){var b;return a.style[d]?a.style[d]:(d==="opacity"&&(d="filter"),b=a.currentStyle[d.replace(/\-(\w)/g, | ||
function(a,b){return b.toUpperCase()})],d==="filter"&&(b=b.replace(/alpha\(opacity=([0-9]+)\)/,function(a,b){return b/100})),b===""?1:b)},this.adapterRun=function(a,d){var b={width:"clientWidth",height:"clientHeight"}[d];if(b)return a.style.zoom=1,a[b]-2*parseInt(HighchartsAdapter._getStyle(a,"padding"),10)};if(!Array.prototype.forEach)this.each=function(a,d){for(var b=0,c=a.length;b<c;b++)if(d.call(a[b],a[b],b,a)===!1)return b};if(!Array.prototype.indexOf)this.inArray=function(a,d){var b,c=0;if(d)for(b= | ||
d.length;c<b;c++)if(d[c]===a)return c;return-1};if(!Array.prototype.filter)this.grep=function(a,d){for(var b=[],c=0,i=a.length;c<i;c++)d(a[c],c)&&b.push(a[c]);return b};n=function(a,c,b){this.options=c;this.elem=a;this.prop=b};n.prototype={update:function(){var a;a=this.paths;var d=this.elem,b=d.element;if(m[this.prop])m[this.prop](this);else a&&b?d.attr("d",c.step(a[0],a[1],this.now,this.toD)):d.attr?b&&d.attr(this.prop,this.now):(a={},a[this.prop]=this.now+this.unit,Highcharts.css(d,a));this.options.step&& | ||
this.options.step.call(this.elem,this.now,this)},custom:function(a,c,b){var e=this,i=function(a){return e.step(a)},f;this.startTime=+new Date;this.start=a;this.end=c;this.unit=b;this.now=this.start;this.pos=this.state=0;i.elem=this.elem;if(i()&&g.push(i)===1)i.timerId=setInterval(function(){for(f=0;f<g.length;f++)g[f]()||g.splice(f--,1);g.length||clearInterval(i.timerId)},13)},step:function(a){var c=+new Date,b;b=this.options;var e=this.elem,i;if(e.attr&&!e.element)b=!1;else if(a||c>=b.duration+this.startTime){this.now= | ||
this.end;this.pos=this.state=1;this.update();a=this.options.curAnim[this.prop]=!0;for(i in b.curAnim)b.curAnim[i]!==!0&&(a=!1);a&&b.complete&&b.complete.call(e);b=!1}else e=c-this.startTime,this.state=e/b.duration,this.pos=b.easing(e,0,1,b.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update(),b=!0;return b}};this.animate=function(a,d,b){var e,i="",f,g,h;if(typeof b!=="object"||b===null)e=arguments,b={duration:e[2],easing:e[3],complete:e[4]};if(typeof b.duration!=="number")b.duration= | ||
400;b.easing=Math[b.easing]||Math.easeInOutSine;b.curAnim=Highcharts.extend({},d);for(h in d)g=new n(a,b,h),f=null,h==="d"?(g.paths=c.init(a,a.d,d.d),g.toD=d.d,e=0,f=1):a.attr?e=a.attr(h):(e=parseFloat(HighchartsAdapter._getStyle(a,h))||0,h!=="opacity"&&(i="px")),f||(f=d[h]),f.match&&f.match("px")&&(f=f.replace(/px/g,"")),g.custom(e,f,i)}},_getStyle:function(c,a){return window.getComputedStyle(c,void 0).getPropertyValue(a)},addAnimSetter:function(c,a){m[c]=a},getScript:function(c,a){var d=j.getElementsByTagName("head")[0], | ||
b=j.createElement("script");b.type="text/javascript";b.src=c;b.onload=a;d.appendChild(b)},inArray:function(c,a){return a.indexOf?a.indexOf(c):p.indexOf.call(a,c)},adapterRun:function(c,a){return parseInt(HighchartsAdapter._getStyle(c,a),10)},grep:function(c,a){return p.filter.call(c,a)},map:function(c,a){for(var d=[],b=0,e=c.length;b<e;b++)d[b]=a.call(c[b],c[b],b,c);return d},offset:function(c){var a=document.documentElement,c=c.getBoundingClientRect();return{top:c.top+(window.pageYOffset||a.scrollTop)- | ||
(a.clientTop||0),left:c.left+(window.pageXOffset||a.scrollLeft)-(a.clientLeft||0)}},addEvent:function(c,a,d){o(c).bind(a,d)},removeEvent:function(c,a,d){o(c).unbind(a,d)},fireEvent:function(c,a,d,b){var e;j.createEvent&&(c.dispatchEvent||c.fireEvent)?(e=j.createEvent("Events"),e.initEvent(a,!0,!0),e.target=c,Highcharts.extend(e,d),c.dispatchEvent?c.dispatchEvent(e):c.fireEvent(a,e)):c.HCExtended===!0&&(d=d||{},c.trigger(a,d));d&&d.defaultPrevented&&(b=null);b&&b(d)},washMouseEvent:function(c){return c}, | ||
stop:function(c){for(var a=g.length,d;a--;)d=g[a],d.elem===c&&g.splice(a,1)},each:function(c,a){return Array.prototype.forEach.call(c,a)}}}(); | ||
(function(j,l){typeof module==="object"&&module.exports?module.exports=j.document?l(j):function(j){return l(j)}:j.HighchartsAdapter=l()})(typeof window!=="undefined"?window:this,function(j){function l(c){function a(a,b,d){a.removeEventListener(b,d,!1)}function d(a,b,d){d=a.HCProxiedMethods[d.toString()];a.detachEvent("on"+b,d)}function b(b,c){var f=b.HCEvents,k,h,p,g;if(b.removeEventListener)k=a;else if(b.attachEvent)k=d;else return;c?(h={},h[c]=!0):h=f;for(g in h)if(f[g])for(p=f[g].length;p--;)k(b, | ||
g,f[g][p])}if(!c.HCExtended)c.HCExtended=!0,c.HCEvents={},c.bind=function(a,b){var d=this,c=this.HCEvents,h;if(d.addEventListener)d.addEventListener(a,b,!1);else if(d.attachEvent){h=function(a){a.target=a.srcElement||m;b.call(d,a)};if(!d.HCProxiedMethods)d.HCProxiedMethods={};d.HCProxiedMethods[b.toString()]=h;d.attachEvent("on"+a,h)}c[a]===u&&(c[a]=[]);c[a].push(b)},c.unbind=function(c,i){var f,k;c?(f=this.HCEvents[c]||[],i?(k=s.inArray(i,f),k>-1&&(f.splice(k,1),this.HCEvents[c]=f),this.removeEventListener? | ||
a(this,c,i):this.attachEvent&&d(this,c,i)):(b(this,c),this.HCEvents[c]=[])):(b(this),this.HCEvents={})},c.trigger=function(a,b){var d=this.HCEvents[a]||[],c=d.length,h,g,j;g=function(){b.defaultPrevented=!0};for(h=0;h<c;h++){j=d[h];if(b.stopped)break;b.preventDefault=g;b.target=this;if(!b.type)b.type=a;j.call(this,b)===!1&&b.preventDefault()}};return c}var u,m=j||window,n=m.document,t=[],o,g=[],q={},s,r;Math.easeInOutSine=function(c,a,d,b){return-d/2*(Math.cos(Math.PI*c/b)-1)+a};o=function(c,a){var d= | ||
m.getComputedStyle(c,void 0);return d&&d.getPropertyValue(a)};return s={init:function(c){if(!n.defaultView)o=function(a,d){var b;if(a.style[d])return a.style[d];d==="opacity"&&(d="filter");b=a.currentStyle[d.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()})];d==="filter"&&(b=b.replace(/alpha\(opacity=([0-9]+)\)/,function(a,b){return b/100}));return b===""?1:b},this.adapterRun=function(a,d){var b={width:"clientWidth",height:"clientHeight"}[d];if(b)return a.style.zoom=1,a[b]-2*parseInt(o(a,"padding"), | ||
10)};if(!Array.prototype.forEach)this.each=function(a,d){for(var b=0,c=a.length;b<c;b++)if(d.call(a[b],a[b],b,a)===!1)return b};if(!Array.prototype.indexOf)this.inArray=function(a,d){var b,c=0;if(d)for(b=d.length;c<b;c++)if(d[c]===a)return c;return-1};if(!Array.prototype.filter)this.grep=function(a,d){for(var b=[],c=0,i=a.length;c<i;c++)d(a[c],c)&&b.push(a[c]);return b};r=function(a,c,b){this.options=c;this.elem=a;this.prop=b};r.prototype={update:function(){var a;a=this.paths;var d=this.elem,b=d.element, | ||
e;if(q[this.prop])q[this.prop](this);else if(a&&b)d.attr("d",c.step(a[0],a[1],this.now,this.toD));else if(d.attr)b&&d.attr(this.prop,this.now);else for(e in a={},a[this.prop]=this.now+this.unit,a)d.style[e]=a[e];this.options.step&&this.options.step.call(this.elem,this.now,this)},custom:function(a,c,b){var e=this,i=function(a){return e.step(a)},f;this.startTime=+new Date;this.start=a;this.end=c;this.unit=b;this.now=this.start;this.pos=this.state=0;i.elem=this.elem;if(i()&&g.push(i)===1)i.timerId=setInterval(function(){for(f= | ||
0;f<g.length;f++)g[f]()||g.splice(f--,1);g.length||clearInterval(i.timerId)},13)},step:function(a){var c=+new Date,b;b=this.options;var e=this.elem,i;if(e.attr&&!e.element)b=!1;else if(a||c>=b.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();a=this.options.curAnim[this.prop]=!0;for(i in b.curAnim)b.curAnim[i]!==!0&&(a=!1);a&&b.complete&&b.complete.call(e);b=!1}else e=c-this.startTime,this.state=e/b.duration,this.pos=b.easing(e,0,1,b.duration),this.now=this.start+(this.end- | ||
this.start)*this.pos,this.update(),b=!0;return b}};this.animate=function(a,d,b){var e,i="",f,g,h;if(typeof b!=="object"||b===null)e=arguments,b={duration:e[2],easing:e[3],complete:e[4]};if(typeof b.duration!=="number")b.duration=400;b.easing=Math[b.easing]||Math.easeInOutSine;b.curAnim={};for(f in d)b.curAnim[f]=d[f];for(h in d)g=new r(a,b,h),f=null,h==="d"?(g.paths=c.init(a,a.d,d.d),g.toD=d.d,e=0,f=1):a.attr?e=a.attr(h):(e=parseFloat(o(a,h))||0,h!=="opacity"&&(i="px")),f||(f=d[h]),f.match&&f.match("px")&& | ||
(f=f.replace(/px/g,"")),g.custom(e,f,i)}},addAnimSetter:function(c,a){q[c]=a},getScript:function(c,a){var d=n.getElementsByTagName("head")[0],b=n.createElement("script");b.type="text/javascript";b.src=c;b.onload=a;d.appendChild(b)},inArray:function(c,a){return a.indexOf?a.indexOf(c):t.indexOf.call(a,c)},adapterRun:function(c,a){return parseInt(o(c,a),10)},grep:function(c,a){return t.filter.call(c,a)},map:function(c,a){for(var d=[],b=0,e=c.length;b<e;b++)d[b]=a.call(c[b],c[b],b,c);return d},offset:function(c){var a= | ||
document.documentElement,c=c.getBoundingClientRect();return{top:c.top+(m.pageYOffset||a.scrollTop)-(a.clientTop||0),left:c.left+(m.pageXOffset||a.scrollLeft)-(a.clientLeft||0)}},addEvent:function(c,a,d){l(c).bind(a,d)},removeEvent:function(c,a,d){l(c).unbind(a,d)},fireEvent:function(c,a,d,b){var e,g;if(n.createEvent&&(c.dispatchEvent||c.fireEvent)){e=n.createEvent("Events");e.initEvent(a,!0,!0);e.target=c;for(g in d)e[g]=d[g];c.dispatchEvent?c.dispatchEvent(e):c.fireEvent(a,e)}else c.HCExtended=== | ||
!0&&(d=d||{},c.trigger(a,d));d&&d.defaultPrevented&&(b=null);b&&b(d)},washMouseEvent:function(c){return c},stop:function(c){for(var a=g.length,d;a--;)d=g[a],d.elem===c&&g.splice(a,1)},each:function(c,a){return Array.prototype.forEach.call(c,a)}}}); |
/** | ||
* @license Highmaps JS v1.1.9 (2015-10-07) | ||
* @license Highmaps JS v1.1.10 (2015-12-07) | ||
* | ||
@@ -9,11 +9,22 @@ * Standalone Highcharts Framework | ||
(function (root, factory) { | ||
if (typeof module === 'object' && module.exports) { | ||
module.exports = root.document ? | ||
factory(root) : | ||
function (w) { | ||
return factory(w); | ||
}; | ||
} else { | ||
root.HighchartsAdapter = factory(); | ||
} | ||
}(typeof window !== 'undefined' ? window : this, function (w) { | ||
/*global Highcharts */ | ||
var HighchartsAdapter = (function () { | ||
var UNDEFINED, | ||
doc = document, | ||
win = w || window, | ||
doc = win.document, | ||
emptyArray = [], | ||
_getStyle, | ||
timers = [], | ||
animSetters = {}, | ||
HighchartsAdapter, | ||
Fx; | ||
@@ -25,2 +36,9 @@ | ||
/** | ||
* Internal method to return CSS value for given element and property | ||
*/ | ||
_getStyle = function (el, prop) { | ||
var style = win.getComputedStyle(el, undefined); | ||
return style && style.getPropertyValue(prop); | ||
}; | ||
@@ -75,109 +93,107 @@ | ||
if (!obj.HCExtended) { | ||
Highcharts.extend(obj, { | ||
HCExtended: true, | ||
obj.HCExtended = true; | ||
HCEvents: {}, | ||
obj.HCEvents = {}; | ||
bind: function (name, fn) { | ||
var el = this, | ||
events = this.HCEvents, | ||
wrappedFn; | ||
obj.bind = function (name, fn) { | ||
var el = this, | ||
events = this.HCEvents, | ||
wrappedFn; | ||
// handle DOM events in modern browsers | ||
if (el.addEventListener) { | ||
el.addEventListener(name, fn, false); | ||
// handle DOM events in modern browsers | ||
if (el.addEventListener) { | ||
el.addEventListener(name, fn, false); | ||
// handle old IE implementation | ||
} else if (el.attachEvent) { | ||
wrappedFn = function (e) { | ||
e.target = e.srcElement || window; // #2820 | ||
fn.call(el, e); | ||
}; | ||
// handle old IE implementation | ||
} else if (el.attachEvent) { | ||
wrappedFn = function (e) { | ||
e.target = e.srcElement || win; // #2820 | ||
fn.call(el, e); | ||
}; | ||
if (!el.HCProxiedMethods) { | ||
el.HCProxiedMethods = {}; | ||
} | ||
if (!el.HCProxiedMethods) { | ||
el.HCProxiedMethods = {}; | ||
} | ||
// link wrapped fn with original fn, so we can get this in removeEvent | ||
el.HCProxiedMethods[fn.toString()] = wrappedFn; | ||
// link wrapped fn with original fn, so we can get this in removeEvent | ||
el.HCProxiedMethods[fn.toString()] = wrappedFn; | ||
el.attachEvent('on' + name, wrappedFn); | ||
} | ||
el.attachEvent('on' + name, wrappedFn); | ||
} | ||
if (events[name] === UNDEFINED) { | ||
events[name] = []; | ||
} | ||
if (events[name] === UNDEFINED) { | ||
events[name] = []; | ||
} | ||
events[name].push(fn); | ||
}, | ||
events[name].push(fn); | ||
}; | ||
unbind: function (name, fn) { | ||
var events, | ||
index; | ||
obj.unbind = function (name, fn) { | ||
var events, | ||
index; | ||
if (name) { | ||
events = this.HCEvents[name] || []; | ||
if (fn) { | ||
index = HighchartsAdapter.inArray(fn, events); | ||
if (index > -1) { | ||
events.splice(index, 1); | ||
this.HCEvents[name] = events; | ||
} | ||
if (this.removeEventListener) { | ||
removeOneEvent(this, name, fn); | ||
} else if (this.attachEvent) { | ||
IERemoveOneEvent(this, name, fn); | ||
} | ||
} else { | ||
removeAllEvents(this, name); | ||
this.HCEvents[name] = []; | ||
if (name) { | ||
events = this.HCEvents[name] || []; | ||
if (fn) { | ||
index = HighchartsAdapter.inArray(fn, events); | ||
if (index > -1) { | ||
events.splice(index, 1); | ||
this.HCEvents[name] = events; | ||
} | ||
if (this.removeEventListener) { | ||
removeOneEvent(this, name, fn); | ||
} else if (this.attachEvent) { | ||
IERemoveOneEvent(this, name, fn); | ||
} | ||
} else { | ||
removeAllEvents(this); | ||
this.HCEvents = {}; | ||
removeAllEvents(this, name); | ||
this.HCEvents[name] = []; | ||
} | ||
}, | ||
} else { | ||
removeAllEvents(this); | ||
this.HCEvents = {}; | ||
} | ||
}; | ||
trigger: function (name, args) { | ||
var events = this.HCEvents[name] || [], | ||
target = this, | ||
len = events.length, | ||
i, | ||
preventDefault, | ||
fn; | ||
obj.trigger = function (name, args) { | ||
var events = this.HCEvents[name] || [], | ||
target = this, | ||
len = events.length, | ||
i, | ||
preventDefault, | ||
fn; | ||
// Attach a simple preventDefault function to skip default handler if called | ||
preventDefault = function () { | ||
args.defaultPrevented = true; | ||
}; | ||
for (i = 0; i < len; i++) { | ||
fn = events[i]; | ||
// Attach a simple preventDefault function to skip default handler if called | ||
preventDefault = function () { | ||
args.defaultPrevented = true; | ||
}; | ||
for (i = 0; i < len; i++) { | ||
fn = events[i]; | ||
// args is never null here | ||
if (args.stopped) { | ||
return; | ||
} | ||
// args is never null here | ||
if (args.stopped) { | ||
return; | ||
} | ||
args.preventDefault = preventDefault; | ||
args.target = target; | ||
args.preventDefault = preventDefault; | ||
args.target = target; | ||
// If the type is not set, we're running a custom event (#2297). If it is set, | ||
// we're running a browser event, and setting it will cause en error in | ||
// IE8 (#2465). | ||
if (!args.type) { | ||
args.type = name; | ||
} | ||
// If the type is not set, we're running a custom event (#2297). If it is set, | ||
// we're running a browser event, and setting it will cause en error in | ||
// IE8 (#2465). | ||
if (!args.type) { | ||
args.type = name; | ||
} | ||
// If the event handler return false, prevent the default handler from executing | ||
if (fn.call(this, args) === false) { | ||
args.preventDefault(); | ||
} | ||
// If the event handler return false, prevent the default handler from executing | ||
if (fn.call(this, args) === false) { | ||
args.preventDefault(); | ||
} | ||
} | ||
}); | ||
}; | ||
} | ||
@@ -189,3 +205,3 @@ | ||
return { | ||
HighchartsAdapter = { | ||
@@ -202,23 +218,24 @@ /** | ||
if (!doc.defaultView) { | ||
this._getStyle = function (el, prop) { | ||
_getStyle = function (el, prop) { | ||
var val; | ||
if (el.style[prop]) { | ||
return el.style[prop]; | ||
} else { | ||
if (prop === 'opacity') { | ||
prop = 'filter'; | ||
} | ||
/*jslint unparam: true*/ | ||
val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b) { return b.toUpperCase(); })]; | ||
if (prop === 'filter') { | ||
val = val.replace( | ||
/alpha\(opacity=([0-9]+)\)/, | ||
function (a, b) { | ||
return b / 100; | ||
} | ||
); | ||
} | ||
/*jslint unparam: false*/ | ||
return val === '' ? 1 : val; | ||
} | ||
} | ||
if (prop === 'opacity') { | ||
prop = 'filter'; | ||
} | ||
val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b) { | ||
return b.toUpperCase(); | ||
})]; | ||
if (prop === 'filter') { | ||
val = val.replace( | ||
/alpha\(opacity=([0-9]+)\)/, | ||
function (a, b) { | ||
return b / 100; | ||
} | ||
); | ||
} | ||
return val === '' ? 1 : val; | ||
}; | ||
@@ -230,3 +247,3 @@ this.adapterRun = function (elem, method) { | ||
elem.style.zoom = 1; | ||
return elem[alias] - 2 * parseInt(HighchartsAdapter._getStyle(elem, 'padding'), 10); | ||
return elem[alias] - 2 * parseInt(_getStyle(elem, 'padding'), 10); | ||
} | ||
@@ -268,3 +285,3 @@ }; | ||
if (!Array.prototype.filter) { | ||
this.grep = function (elements, callback) { | ||
this.grep = function (elements, fn) { | ||
var ret = [], | ||
@@ -275,3 +292,3 @@ i = 0, | ||
for (; i < length; i++) { | ||
if (!!callback(elements[i], i)) { | ||
if (!!fn(elements[i], i)) { | ||
ret.push(elements[i]); | ||
@@ -302,3 +319,4 @@ } | ||
elem = this.elem, | ||
elemelem = elem.element; // if destroyed, it is null | ||
elemelem = elem.element, | ||
prop; // if destroyed, it is null | ||
@@ -319,7 +337,9 @@ // Animation setter defined from outside | ||
// HTML styles | ||
// HTML styles, raw HTML content like container size | ||
} else { | ||
styles = {}; | ||
styles[this.prop] = this.now + this.unit; | ||
Highcharts.css(elem, styles); | ||
for (prop in styles) { | ||
elem.style[prop] = styles[prop]; | ||
} | ||
} | ||
@@ -418,2 +438,3 @@ | ||
name, | ||
key, | ||
PX = 'px'; | ||
@@ -433,3 +454,6 @@ | ||
opt.easing = Math[opt.easing] || Math.easeInOutSine; | ||
opt.curAnim = Highcharts.extend({}, prop); | ||
opt.curAnim = {}; | ||
for (key in prop) { | ||
opt.curAnim[key] = prop[key]; | ||
} | ||
@@ -452,3 +476,3 @@ for (name in prop) { | ||
} else { | ||
start = parseFloat(HighchartsAdapter._getStyle(el, name)) || 0; | ||
start = parseFloat(_getStyle(el, name)) || 0; | ||
if (name !== 'opacity') { | ||
@@ -471,9 +495,2 @@ unit = PX; | ||
/** | ||
* Internal method to return CSS value for given element and property | ||
*/ | ||
_getStyle: function (el, prop) { | ||
return window.getComputedStyle(el, undefined).getPropertyValue(prop); | ||
}, | ||
/** | ||
* Add an animation setter for a specific property | ||
@@ -514,3 +531,3 @@ */ | ||
adapterRun: function (elem, method) { | ||
return parseInt(HighchartsAdapter._getStyle(elem, method), 10); | ||
return parseInt(_getStyle(elem, method), 10); | ||
}, | ||
@@ -546,4 +563,4 @@ | ||
return { | ||
top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), | ||
left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) | ||
top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), | ||
left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) | ||
}; | ||
@@ -570,3 +587,4 @@ }, | ||
fireEvent: function (el, type, eventArguments, defaultFunction) { | ||
var e; | ||
var e, | ||
key; | ||
@@ -578,3 +596,5 @@ if (doc.createEvent && (el.dispatchEvent || el.fireEvent)) { | ||
Highcharts.extend(e, eventArguments); | ||
for (key in eventArguments) { | ||
e[key] = eventArguments[key]; | ||
} | ||
@@ -632,2 +652,3 @@ if (el.dispatchEvent) { | ||
}; | ||
}()); | ||
return HighchartsAdapter; | ||
})); |
{ | ||
"name": "highmaps", | ||
"version": "v1.1.9", | ||
"version": "v1.1.10", | ||
"main": [ | ||
@@ -5,0 +5,0 @@ "highmaps.js", |
@@ -1,11 +0,12 @@ | ||
(function(g,p){function x(a,b,c,d,i){i=i||0;d=d||y;m(a.slice(i,i+d),b);i+d<a.length?setTimeout(function(){x(a,b,c,d,i+d)}):c&&c()}var O=function(){},P=g.Color,l=g.Series,e=g.seriesTypes,m=g.each,s=g.extend,Q=p.addEvent,R=p.fireEvent,S=g.merge,T=g.pick,k=g.wrap,q=g.getOptions().plotOptions,y=5E4;m(["area","arearange","column","line","scatter"],function(a){if(q[a])q[a].boostThreshold=5E3});m(["translate","generatePoints","drawTracker","drawPoints","render"],function(a){function b(b){var d=this.options.stacking&& | ||
(a==="translate"||a==="generatePoints");if((this.processedXData||this.options.data).length<(this.options.boostThreshold||Number.MAX_VALUE)||d){if(a==="render"&&this.image)this.image.attr({href:""}),this.animate=null;b.call(this)}else if(this[a+"Canvas"])this[a+"Canvas"]()}k(l.prototype,a,b);a==="translate"&&(e.column&&k(e.column.prototype,a,b),e.arearange&&k(e.arearange.prototype,a,b))});k(l.prototype,"getExtremes",function(a){this.hasExtremes()||a.apply(this,Array.prototype.slice.call(arguments, | ||
1))});k(l.prototype,"setData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});k(l.prototype,"processData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});g.extend(l.prototype,{pointRange:0,hasExtremes:function(a){var b=this.options,c=this.xAxis&&this.xAxis.options,d=this.yAxis&&this.yAxis.options;return b.data.length>(b.boostThreshold||Number.MAX_VALUE)&&typeof d.min==="number"&&typeof d.max==="number"&&(!a||typeof c.min=== | ||
"number"&&typeof c.max==="number")},destroyGraphics:function(){var a=this,b=this.points,c,d;for(d=0;d<b.length;d+=1)if((c=b[d])&&c.graphic)c.graphic=c.graphic.destroy();m(["graph","area"],function(b){a[b]&&(a[b]=a[b].destroy())})},getContext:function(){var a=this.chart.plotWidth,b=this.chart.plotHeight;this.canvas?this.ctx.clearRect(0,0,a,b):(this.canvas=document.createElement("canvas"),this.image=this.chart.renderer.image("",0,0,a,b).add(this.group),this.ctx=this.canvas.getContext("2d"));this.canvas.setAttribute("width", | ||
a);this.canvas.setAttribute("height",b);this.image.attr({width:a,height:b});return this.ctx},canvasToSVG:function(){this.image.attr({href:this.canvas.toDataURL("image/png")})},cvsLineTo:function(a,b,c){a.lineTo(b,c)},renderCanvas:function(){var a=this,b=a.options,c=a.chart,d=this.xAxis,i=this.yAxis,h,g,e=0,k=a.processedXData,l=a.processedYData,m=b.data,j=d.getExtremes(),p=j.min,q=j.max,j=i.getExtremes(),U=j.min,V=j.max,z={},t,W=!!a.sampling,A,B=b.marker&&b.marker.radius,C=this.cvsDrawPoint,D=b.lineWidth? | ||
this.cvsLineTo:!1,E=B<=1?this.cvsMarkerSquare:this.cvsMarkerCircle,X=b.enableMouseTracking!==!1,F,j=b.threshold,n=i.getThreshold(j),G=typeof j==="number",H=n,Y=this.fill,I=a.pointArrayMap&&a.pointArrayMap.join(",")==="low,high",J=!!b.stacking,Z=a.cropStart||0,j=c.options.loading,$=a.requireSorting,K,aa=b.connectNulls,L=!k,u,v,o,r,ba=a.fillOpacity?(new P(a.color)).setOpacity(T(b.fillOpacity,0.75)).get():a.color,M=function(){Y?(h.fillStyle=ba,h.fill()):(h.strokeStyle=a.color,h.lineWidth=b.lineWidth, | ||
h.stroke())},N=function(a,b,c){e===0&&h.beginPath();K?h.moveTo(a,b):C?C(h,a,b,c,F):D?D(h,a,b):E&&E(h,a,b,B);e+=1;e===1E3&&(M(),e=0);F={clientX:a,plotY:b,yBottom:c}},w=function(a,b,c){X&&!z[a+","+b]&&(A.push({clientX:a,plotX:a,plotY:b,i:Z+c}),z[a+","+b]=!0)};this.points&&this.destroyGraphics();a.plotGroup("group","series",a.visible?"visible":"hidden",b.zIndex,c.seriesGroup);a.getAttribs();a.markerGroup=a.group;Q(a,"destroy",function(){a.markerGroup=null});A=this.points=[];h=this.getContext();a.buildKDTree= | ||
O;if(m.length>99999)c.options.loading=S(j,{labelStyle:{backgroundColor:"rgba(255,255,255,0.75)",padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),c.showLoading("Drawing..."),c.options.loading=j,c.loadingShown===!0?c.loadingShown=1:c.loadingShown+=1;g=0;x(J?a.data:k||m,function(b){var c,f,e,h=!0;L?(c=b[0],f=b[1]):(c=b,f=l[g]);if(I)L&&(f=b.slice(1,3)),e=f[0],f=f[1];else if(J)c=b.x,f=b.stackY,e=f-b.y;b=f===null;$||(h=f>=U&&f<=V);if(!b&&c>=p&&c<=q&&h)if(c=Math.round(d.toPixels(c, | ||
!0)),W){if(o===void 0||c===t){I||(e=f);if(r===void 0||f>v)v=f,r=g;if(o===void 0||e<u)u=e,o=g}c!==t&&(o!==void 0&&(f=i.toPixels(v,!0),n=i.toPixels(u,!0),N(c,G?Math.min(f,H):f,G?Math.max(n,H):n),w(c,f,r),n!==f&&w(c,n,o)),o=r=void 0,t=c)}else f=Math.round(i.toPixels(f,!0)),N(c,f,n),w(c,f,g);K=b&&!aa;g+=1;g%y===0&&a.canvasToSVG()},function(){var b=c.loadingDiv,d=+c.loadingShown;M();a.canvasToSVG();R(a,"renderedCanvas");if(d===1)s(b.style,{transition:"opacity 250ms",opacity:0}),c.loadingShown=!1,setTimeout(function(){b.parentNode&& | ||
b.parentNode.removeChild(b);c.loadingDiv=c.loadingSpan=null},250);if(d)c.loadingShown=d-1;a.directTouch=!1;a.options.stickyTracking=!0;delete a.buildKDTree;a.buildKDTree()},c.renderer.forExport?Number.MAX_VALUE:void 0)}});e.scatter.prototype.cvsMarkerCircle=function(a,b,c,d){a.moveTo(b,c);a.arc(b,c,d,0,2*Math.PI,!1)};e.scatter.prototype.cvsMarkerSquare=function(a,b,c,d){a.moveTo(b,c);a.rect(b-d,c-d,d*2,d*2)};e.scatter.prototype.fill=!0;s(e.area.prototype,{cvsDrawPoint:function(a,b,c,d,e){e&&b!==e.clientX&& | ||
(a.moveTo(e.clientX,e.yBottom),a.lineTo(e.clientX,e.plotY),a.lineTo(b,c),a.lineTo(b,d))},fill:!0,fillOpacity:!0,sampling:!0});s(e.column.prototype,{cvsDrawPoint:function(a,b,c,d){a.rect(b-1,c,1,d-c)},fill:!0,sampling:!0});k(l.prototype,"searchPoint",function(a){var b=a.apply(this,[].slice.call(arguments,1)),c=b;if(b&&!(b instanceof this.pointClass))c=(new this.pointClass).init(this,this.options.data[b.i]),c.dist=b.dist,c.category=c.x,c.plotX=b.plotX,c.plotY=b.plotY;return c})})(Highcharts,HighchartsAdapter); | ||
(function(c){typeof module==="object"&&module.exports?module.exports=c:c(Highcharts)})(function(c){function u(a,b,d,e,f){f=f||0;e=e||v;k(a.slice(f,f+e),b);f+e<a.length?setTimeout(function(){u(a,b,d,e,f+e)}):d&&d()}var L=function(){},M=c.Color,j=c.Series,h=c.seriesTypes,k=c.each,p=c.extend,N=c.addEvent,O=c.fireEvent,P=c.merge,Q=c.pick,g=c.wrap,n=c.getOptions().plotOptions,v=5E4;k(["area","arearange","column","line","scatter"],function(a){if(n[a])n[a].boostThreshold=5E3});k(["translate","generatePoints", | ||
"drawTracker","drawPoints","render"],function(a){function b(b){var e=this.options.stacking&&(a==="translate"||a==="generatePoints");if((this.processedXData||this.options.data).length<(this.options.boostThreshold||Number.MAX_VALUE)||e){if(a==="render"&&this.image)this.image.attr({href:""}),this.animate=null;b.call(this)}else if(this[a+"Canvas"])this[a+"Canvas"]()}g(j.prototype,a,b);a==="translate"&&(h.column&&g(h.column.prototype,a,b),h.arearange&&g(h.arearange.prototype,a,b))});g(j.prototype,"getExtremes", | ||
function(a){this.hasExtremes()||a.apply(this,Array.prototype.slice.call(arguments,1))});g(j.prototype,"setData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});g(j.prototype,"processData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});c.extend(j.prototype,{pointRange:0,hasExtremes:function(a){var b=this.options,d=this.xAxis&&this.xAxis.options,e=this.yAxis&&this.yAxis.options;return b.data.length>(b.boostThreshold|| | ||
Number.MAX_VALUE)&&typeof e.min==="number"&&typeof e.max==="number"&&(!a||typeof d.min==="number"&&typeof d.max==="number")},destroyGraphics:function(){var a=this,b=this.points,d,e;if(b)for(e=0;e<b.length;e+=1)if((d=b[e])&&d.graphic)d.graphic=d.graphic.destroy();k(["graph","area","tracker"],function(b){a[b]&&(a[b]=a[b].destroy())})},getContext:function(){var a=this.chart,b=a.plotWidth,d=a.plotHeight,e=this.ctx,f=function(a,b,d,e,f,c,i){a.call(this,d,b,e,f,c,i)};this.canvas?e.clearRect(0,0,b,d):(this.canvas= | ||
document.createElement("canvas"),this.image=a.renderer.image("",0,0,b,d).add(this.group),this.ctx=e=this.canvas.getContext("2d"),a.inverted&&k(["moveTo","lineTo","rect","arc"],function(a){g(e,a,f)}));this.canvas.setAttribute("width",b);this.canvas.setAttribute("height",d);this.image.attr({width:b,height:d});return e},canvasToSVG:function(){this.image.attr({href:this.canvas.toDataURL("image/png")})},cvsLineTo:function(a,b,d){a.lineTo(b,d)},renderCanvas:function(){var a=this,b=a.options,d=a.chart,e= | ||
this.xAxis,f=this.yAxis,c,h,g=0,j=a.processedXData,k=a.processedYData,n=b.data,i=e.getExtremes(),R=i.min,S=i.max,i=f.getExtremes(),T=i.min,U=i.max,w={},q,V=!!a.sampling,x,y=b.marker&&b.marker.radius,z=this.cvsDrawPoint,A=b.lineWidth?this.cvsLineTo:!1,B=y<=1?this.cvsMarkerSquare:this.cvsMarkerCircle,W=b.enableMouseTracking!==!1,C,i=b.threshold,l=f.getThreshold(i),D=typeof i==="number",E=l,X=this.fill,F=a.pointArrayMap&&a.pointArrayMap.join(",")==="low,high",G=!!b.stacking,Y=a.cropStart||0,i=d.options.loading, | ||
Z=a.requireSorting,H,$=b.connectNulls,I=!j,r,s,m,o,aa=a.fillOpacity?(new M(a.color)).setOpacity(Q(b.fillOpacity,0.75)).get():a.color,J=function(){X?(c.fillStyle=aa,c.fill()):(c.strokeStyle=a.color,c.lineWidth=b.lineWidth,c.stroke())},K=function(a,b,d){g===0&&c.beginPath();H?c.moveTo(a,b):z?z(c,a,b,d,C):A?A(c,a,b):B&&B(c,a,b,y);g+=1;g===1E3&&(J(),g=0);C={clientX:a,plotY:b,yBottom:d}},t=function(a,b,c){W&&!w[a+","+b]&&(w[a+","+b]=!0,d.inverted&&(a=e.len-a,b=f.len-b),x.push({clientX:a,plotX:a,plotY:b, | ||
i:Y+c}))};(this.points||this.graph)&&this.destroyGraphics();a.plotGroup("group","series",a.visible?"visible":"hidden",b.zIndex,d.seriesGroup);a.getAttribs();a.markerGroup=a.group;N(a,"destroy",function(){a.markerGroup=null});x=this.points=[];c=this.getContext();a.buildKDTree=L;if(n.length>99999)d.options.loading=P(i,{labelStyle:{backgroundColor:"rgba(255,255,255,0.75)",padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),d.showLoading("Drawing..."),d.options.loading=i,d.loadingShown=== | ||
!0?d.loadingShown=1:d.loadingShown+=1;h=0;u(G?a.data:j||n,function(b){var d,c,g,i=!0;I?(d=b[0],c=b[1]):(d=b,c=k[h]);if(F)I&&(c=b.slice(1,3)),g=c[0],c=c[1];else if(G)d=b.x,c=b.stackY,g=c-b.y;b=c===null;Z||(i=c>=T&&c<=U);if(!b&&d>=R&&d<=S&&i)if(d=Math.round(e.toPixels(d,!0)),V){if(m===void 0||d===q){F||(g=c);if(o===void 0||c>s)s=c,o=h;if(m===void 0||g<r)r=g,m=h}d!==q&&(m!==void 0&&(c=f.toPixels(s,!0),l=f.toPixels(r,!0),K(d,D?Math.min(c,E):c,D?Math.max(l,E):l),t(d,c,o),l!==c&&t(d,l,m)),m=o=void 0,q= | ||
d)}else c=Math.round(f.toPixels(c,!0)),K(d,c,l),t(d,c,h);H=b&&!$;h+=1;h%v===0&&a.canvasToSVG()},function(){var b=d.loadingDiv,c=+d.loadingShown;J();a.canvasToSVG();O(a,"renderedCanvas");if(c===1)p(b.style,{transition:"opacity 250ms",opacity:0}),d.loadingShown=!1,setTimeout(function(){b.parentNode&&b.parentNode.removeChild(b);d.loadingDiv=d.loadingSpan=null},250);if(c)d.loadingShown=c-1;a.directTouch=!1;a.options.stickyTracking=!0;delete a.buildKDTree;a.buildKDTree()},d.renderer.forExport?Number.MAX_VALUE: | ||
void 0)}});h.scatter.prototype.cvsMarkerCircle=function(a,b,d,c){a.moveTo(b,d);a.arc(b,d,c,0,2*Math.PI,!1)};h.scatter.prototype.cvsMarkerSquare=function(a,b,d,c){a.moveTo(b,d);a.rect(b-c,d-c,c*2,c*2)};h.scatter.prototype.fill=!0;p(h.area.prototype,{cvsDrawPoint:function(a,b,d,c,f){f&&b!==f.clientX&&(a.moveTo(f.clientX,f.yBottom),a.lineTo(f.clientX,f.plotY),a.lineTo(b,d),a.lineTo(b,c))},fill:!0,fillOpacity:!0,sampling:!0});p(h.column.prototype,{cvsDrawPoint:function(a,b,c,e){a.rect(b-1,c,1,e-c)},fill:!0, | ||
sampling:!0});j.prototype.getPoint=function(a){var b=a;if(a&&!(a instanceof this.pointClass))b=(new this.pointClass).init(this,this.options.data[a.i]),b.dist=a.dist,b.category=b.x,b.plotX=a.plotX,b.plotY=a.plotY;return b};g(j.prototype,"searchPoint",function(a){return this.getPoint(a.apply(this,[].slice.call(arguments,1)))})}); |
@@ -45,8 +45,15 @@ /** | ||
*/ | ||
/*global document, Highcharts, HighchartsAdapter, setTimeout */ | ||
(function (H, HA) { | ||
/* eslint indent: [2, 4] */ | ||
(function (factory) { | ||
if (typeof module === 'object' && module.exports) { | ||
module.exports = factory; | ||
} else { | ||
factory(Highcharts); | ||
} | ||
}(function (H) { | ||
'use strict'; | ||
var noop = function () { return undefined; }, | ||
var noop = function () {}, | ||
Color = H.Color, | ||
@@ -57,4 +64,4 @@ Series = H.Series, | ||
extend = H.extend, | ||
addEvent = HA.addEvent, | ||
fireEvent = HA.fireEvent, | ||
addEvent = H.addEvent, | ||
fireEvent = H.fireEvent, | ||
merge = H.merge, | ||
@@ -66,3 +73,3 @@ pick = H.pick, | ||
function eachAsync(arr, fn, callback, chunkSize, i) { | ||
function eachAsync(arr, fn, finalFunc, chunkSize, i) { | ||
i = i || 0; | ||
@@ -73,6 +80,6 @@ chunkSize = chunkSize || CHUNK_SIZE; | ||
setTimeout(function () { | ||
eachAsync(arr, fn, callback, chunkSize, i + chunkSize); | ||
eachAsync(arr, fn, finalFunc, chunkSize, i + chunkSize); | ||
}); | ||
} else if (callback) { | ||
callback(); | ||
} else if (finalFunc) { | ||
finalFunc(); | ||
} | ||
@@ -168,10 +175,12 @@ } | ||
for (i = 0; i < points.length; i = i + 1) { | ||
point = points[i]; | ||
if (point && point.graphic) { | ||
point.graphic = point.graphic.destroy(); | ||
if (points) { | ||
for (i = 0; i < points.length; i = i + 1) { | ||
point = points[i]; | ||
if (point && point.graphic) { | ||
point.graphic = point.graphic.destroy(); | ||
} | ||
} | ||
} | ||
each(['graph', 'area'], function (prop) { | ||
each(['graph', 'area', 'tracker'], function (prop) { | ||
if (series[prop]) { | ||
@@ -188,11 +197,21 @@ series[prop] = series[prop].destroy(); | ||
getContext: function () { | ||
var width = this.chart.plotWidth, | ||
height = this.chart.plotHeight; | ||
var chart = this.chart, | ||
width = chart.plotWidth, | ||
height = chart.plotHeight, | ||
ctx = this.ctx, | ||
swapXY = function (proceed, x, y, a, b, c, d) { | ||
proceed.call(this, y, x, a, b, c, d); | ||
}; | ||
if (!this.canvas) { | ||
this.canvas = document.createElement('canvas'); | ||
this.image = this.chart.renderer.image('', 0, 0, width, height).add(this.group); | ||
this.ctx = this.canvas.getContext('2d'); | ||
this.image = chart.renderer.image('', 0, 0, width, height).add(this.group); | ||
this.ctx = ctx = this.canvas.getContext('2d'); | ||
if (chart.inverted) { | ||
each(['moveTo', 'lineTo', 'rect', 'arc'], function (fn) { | ||
wrap(ctx, fn, swapXY); | ||
}); | ||
} | ||
} else { | ||
this.ctx.clearRect(0, 0, width, height); | ||
ctx.clearRect(0, 0, width, height); | ||
} | ||
@@ -207,3 +226,3 @@ | ||
return this.ctx; | ||
return ctx; | ||
}, | ||
@@ -318,2 +337,9 @@ | ||
if (enableMouseTracking && !pointTaken[clientX + ',' + plotY]) { | ||
pointTaken[clientX + ',' + plotY] = true; | ||
if (chart.inverted) { | ||
clientX = xAxis.len - clientX; | ||
plotY = yAxis.len - plotY; | ||
} | ||
points.push({ | ||
@@ -325,3 +351,2 @@ clientX: clientX, | ||
}); | ||
pointTaken[clientX + ',' + plotY] = true; | ||
} | ||
@@ -331,3 +356,3 @@ }; | ||
// If we are zooming out from SVG mode, destroy the graphics | ||
if (this.points) { | ||
if (this.points || this.graph) { | ||
this.destroyGraphics(); | ||
@@ -501,3 +526,3 @@ } | ||
// Pass tests in Pointer. | ||
// TODO: Replace this with a single property, and replace when zooming in | ||
// Replace this with a single property, and replace when zooming in | ||
// below boostThreshold. | ||
@@ -550,17 +575,29 @@ series.directTouch = false; | ||
/** | ||
* Return a full Point object based on the index. The boost module uses stripped point objects | ||
* for performance reasons. | ||
* @param {Number} boostPoint A stripped-down point object | ||
* @returns {Object} A Point object as per http://api.highcharts.com/highcharts#Point | ||
*/ | ||
Series.prototype.getPoint = function (boostPoint) { | ||
var point = boostPoint; | ||
if (boostPoint && !(boostPoint instanceof this.pointClass)) { | ||
point = (new this.pointClass()).init(this, this.options.data[boostPoint.i]); | ||
point.dist = boostPoint.dist; | ||
point.category = point.x; | ||
point.plotX = boostPoint.plotX; | ||
point.plotY = boostPoint.plotY; | ||
} | ||
return point; | ||
}; | ||
/** | ||
* Return a point instance from the k-d-tree | ||
*/ | ||
wrap(Series.prototype, 'searchPoint', function (proceed) { | ||
var point = proceed.apply(this, [].slice.call(arguments, 1)), | ||
ret = point; | ||
if (point && !(point instanceof this.pointClass)) { | ||
ret = (new this.pointClass()).init(this, this.options.data[point.i]); | ||
ret.dist = point.dist; | ||
ret.category = ret.x; | ||
ret.plotX = point.plotX; | ||
ret.plotY = point.plotY; | ||
} | ||
return ret; | ||
return this.getPoint( | ||
proceed.apply(this, [].slice.call(arguments, 1)) | ||
); | ||
}); | ||
}(Highcharts, HighchartsAdapter)); | ||
})); |
@@ -14,3 +14,3 @@ /* | ||
Highmaps JS v1.1.9 (2015-10-07) | ||
Highcharts JS v4.1.10 (2015-12-07) | ||
CanVGRenderer Extension module | ||
@@ -131,5 +131,5 @@ | ||
if(CanvasRenderingContext2D)CanvasRenderingContext2D.prototype.drawSvg=function(m,a,c,d,b){canvg(this.canvas,m,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:a,offsetY:c,scaleWidth:d,scaleHeight:b})}; | ||
(function(m){var a=m.css,c=m.CanVGRenderer,d=m.SVGRenderer,b=m.extend,k=m.merge,e=m.addEvent,f=m.createElement,g=m.discardElement;b(c.prototype,d.prototype);b(c.prototype,{create:function(a,b,c,d){this.setContainer(b,c,d);this.configure(a)},setContainer:function(a,b,c){var d=a.style,e=a.parentNode,g=d.left,d=d.top,k=a.offsetWidth,m=a.offsetHeight,s={visibility:"hidden",position:"absolute"};this.init.apply(this,[a,b,c]);this.canvas=f("canvas",{width:k,height:m},{position:"relative",left:g,top:d},a); | ||
this.ttLine=f("div",null,s,e);this.ttDiv=f("div",null,s,e);this.ttTimer=void 0;this.hiddenSvg=a=f("div",{width:k,height:m},{visibility:"hidden",left:g,top:d},e);a.appendChild(this.box)},configure:function(b){var c=this,d=b.options.tooltip,f=d.borderWidth,g=c.ttDiv,m=d.style,p=c.ttLine,t=parseInt(m.padding,10),m=k(m,{padding:t+"px","background-color":d.backgroundColor,"border-style":"solid","border-width":f+"px","border-radius":d.borderRadius+"px"});d.shadow&&(m=k(m,{"box-shadow":"1px 1px 3px gray", | ||
"-webkit-box-shadow":"1px 1px 3px gray"}));a(g,m);a(p,{"border-left":"1px solid darkgray"});e(b,"tooltipRefresh",function(d){var e=b.container,f=e.offsetLeft,e=e.offsetTop,k;g.innerHTML=d.text;k=b.tooltip.getPosition(g.offsetWidth,g.offsetHeight,{plotX:d.x,plotY:d.y});a(g,{visibility:"visible",left:k.x+"px",top:k.y+"px","border-color":d.borderColor});a(p,{visibility:"visible",left:f+d.x+"px",top:e+b.plotTop+"px",height:b.plotHeight+"px"});c.ttTimer!==void 0&&clearTimeout(c.ttTimer);c.ttTimer=setTimeout(function(){a(g, | ||
{visibility:"hidden"});a(p,{visibility:"hidden"})},3E3)})},destroy:function(){g(this.canvas);this.ttTimer!==void 0&&clearTimeout(this.ttTimer);g(this.ttLine);g(this.ttDiv);g(this.hiddenSvg);return d.prototype.destroy.apply(this)},color:function(a,b,c){a&&a.linearGradient&&(a=a.stops[a.stops.length-1][1]);return d.prototype.color.call(this,a,b,c)},draw:function(){window.canvg(this.canvas,this.hiddenSvg.innerHTML)}})})(Highcharts); | ||
(function(m){var a=m.css,c=m.CanVGRenderer,d=m.SVGRenderer,b=m.extend,k=m.merge,e=m.addEvent,f=m.createElement,g=m.discardElement;b(c.prototype,d.prototype);b(c.prototype,{create:function(a,b,c,d){this.setContainer(b,c,d);this.configure(a)},setContainer:function(a,b,c){var d=a.style,e=a.parentNode,g=d.left,d=d.top,k=a.offsetWidth,m=a.offsetHeight,s={visibility:"hidden",position:"absolute"};this.init(a,b,c);this.canvas=f("canvas",{width:k,height:m},{position:"relative",left:g,top:d},a);this.ttLine= | ||
f("div",null,s,e);this.ttDiv=f("div",null,s,e);this.ttTimer=void 0;this.hiddenSvg=a=f("div",{width:k,height:m},{visibility:"hidden",left:g,top:d},e);a.appendChild(this.box)},configure:function(b){var c=this,d=b.options.tooltip,f=d.borderWidth,g=c.ttDiv,m=d.style,p=c.ttLine,t=parseInt(m.padding,10),m=k(m,{padding:t+"px","background-color":d.backgroundColor,"border-style":"solid","border-width":f+"px","border-radius":d.borderRadius+"px"});d.shadow&&(m=k(m,{"box-shadow":"1px 1px 3px gray","-webkit-box-shadow":"1px 1px 3px gray"})); | ||
a(g,m);a(p,{"border-left":"1px solid darkgray"});e(b,"tooltipRefresh",function(d){var e=b.container,f=e.offsetLeft,e=e.offsetTop,k;g.innerHTML=d.text;k=b.tooltip.getPosition(g.offsetWidth,g.offsetHeight,{plotX:d.x,plotY:d.y});a(g,{visibility:"visible",left:k.x+"px",top:k.y+"px","border-color":d.borderColor});a(p,{visibility:"visible",left:f+d.x+"px",top:e+b.plotTop+"px",height:b.plotHeight+"px"});c.ttTimer!==void 0&&clearTimeout(c.ttTimer);c.ttTimer=setTimeout(function(){a(g,{visibility:"hidden"}); | ||
a(p,{visibility:"hidden"})},3E3)})},destroy:function(){g(this.canvas);this.ttTimer!==void 0&&clearTimeout(this.ttTimer);g(this.ttLine);g(this.ttDiv);g(this.hiddenSvg);return d.prototype.destroy.apply(this)},color:function(a,b,c){a&&a.linearGradient&&(a=a.stops[a.stops.length-1][1]);return d.prototype.color.call(this,a,b,c)},draw:function(){window.canvg(this.canvas,this.hiddenSvg.innerHTML)}})})(Highcharts); |
/* | ||
Highmaps JS v1.1.9 (2015-10-07) | ||
Highmaps JS v1.1.10 (2015-12-07) | ||
Data module | ||
@@ -9,19 +9,19 @@ | ||
*/ | ||
(function(g){var k=g.each,t=g.pick,r=HighchartsAdapter.inArray,u=g.splat,j,p=function(b,a){this.init(b,a)};g.extend(p.prototype,{init:function(b,a){this.options=b;this.chartOptions=a;this.columns=b.columns||this.rowsToColumns(b.rows)||[];this.firstRowAsNames=t(b.firstRowAsNames,!0);this.decimalRegex=b.decimalPoint&&RegExp("^([0-9]+)"+b.decimalPoint+"([0-9]+)$");this.rawColumns=[];this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var b= | ||
this.chartOptions,a=this.options,e=[],f=function(b){return(g.seriesTypes[b||"line"].prototype.pointArrayMap||[0]).length},d=b&&b.chart&&b.chart.type,c=[],h=[],n=0,i;k(b&&b.series||[],function(b){c.push(f(b.type||d))});k(a&&a.seriesMapping||[],function(b){e.push(b.x||0)});e.length===0&&e.push(0);k(a&&a.seriesMapping||[],function(a){var e=new j,o,q=c[n]||f(d),m=g.seriesTypes[((b&&b.series||[])[n]||{}).type||d||"line"].prototype.pointArrayMap||["y"];e.addColumnReader(a.x,"x");for(o in a)a.hasOwnProperty(o)&& | ||
o!=="x"&&e.addColumnReader(a[o],o);for(i=0;i<q;i++)e.hasReader(m[i])||e.addColumnReader(void 0,m[i]);h.push(e);n++});a=g.seriesTypes[d||"line"].prototype.pointArrayMap;a===void 0&&(a=["y"]);this.valueCount={global:f(d),xColumns:e,individual:c,seriesBuilders:h,globalPointArrayMap:a}},dataFound:function(){if(this.options.switchRowsAndColumns)this.columns=this.rowsToColumns(this.columns);this.getColumnDistribution();this.parseTypes();this.parsed()!==!1&&this.complete()},parseCSV:function(){var b=this, | ||
a=this.options,e=a.csv,f=this.columns,d=a.startRow||0,c=a.endRow||Number.MAX_VALUE,h=a.startColumn||0,n=a.endColumn||Number.MAX_VALUE,i,g,s=0;e&&(g=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(a.lineDelimiter||"\n"),i=a.itemDelimiter||(e.indexOf("\t")!==-1?"\t":","),k(g,function(a,e){var g=b.trim(a),v=g.indexOf("#")===0;e>=d&&e<=c&&!v&&g!==""&&(g=a.split(i),k(g,function(b,a){a>=h&&a<=n&&(f[a-h]||(f[a-h]=[]),f[a-h][s]=b)}),s+=1)}),this.dataFound())},parseTable:function(){var b=this.options,a= | ||
b.table,e=this.columns,f=b.startRow||0,d=b.endRow||Number.MAX_VALUE,c=b.startColumn||0,h=b.endColumn||Number.MAX_VALUE;a&&(typeof a==="string"&&(a=document.getElementById(a)),k(a.getElementsByTagName("tr"),function(b,a){a>=f&&a<=d&&k(b.children,function(b,d){if((b.tagName==="TD"||b.tagName==="TH")&&d>=c&&d<=h)e[d-c]||(e[d-c]=[]),e[d-c][a-f]=b.innerHTML})}),this.dataFound())},parseGoogleSpreadsheet:function(){var b=this,a=this.options,e=a.googleSpreadsheetKey,f=this.columns,d=a.startRow||0,c=a.endRow|| | ||
Number.MAX_VALUE,h=a.startColumn||0,n=a.endColumn||Number.MAX_VALUE,i,g;e&&jQuery.ajax({dataType:"json",url:"https://spreadsheets.google.com/feeds/cells/"+e+"/"+(a.googleSpreadsheetWorksheet||"od6")+"/public/values?alt=json-in-script&callback=?",error:a.error,success:function(a){var a=a.feed.entry,e,k=a.length,m=0,j=0,l;for(l=0;l<k;l++)e=a[l],m=Math.max(m,e.gs$cell.col),j=Math.max(j,e.gs$cell.row);for(l=0;l<m;l++)if(l>=h&&l<=n)f[l-h]=[],f[l-h].length=Math.min(j,c-d);for(l=0;l<k;l++)if(e=a[l],i=e.gs$cell.row- | ||
1,g=e.gs$cell.col-1,g>=h&&g<=n&&i>=d&&i<=c)f[g-h][i-d]=e.content.$t;b.dataFound()}})},trim:function(b,a){typeof b==="string"&&(b=b.replace(/^\s+|\s+$/g,""),a&&/^[0-9\s]+$/.test(b)&&(b=b.replace(/\s/g,"")),this.decimalRegex&&(b=b.replace(this.decimalRegex,"$1.$2")));return b},parseTypes:function(){for(var b=this.columns,a=b.length;a--;)this.parseColumn(b[a],a)},parseColumn:function(b,a){var e=this.rawColumns,f=this.columns,d=b.length,c,h,g,i,k=this.firstRowAsNames,j=r(a,this.valueCount.xColumns)!== | ||
-1,o=[],q=this.chartOptions,m,p=(this.options.columnTypes||[])[a],q=j&&(q&&q.xAxis&&u(q.xAxis)[0].type==="category"||p==="string");for(e[a]||(e[a]=[]);d--;)if(c=o[d]||b[d],g=this.trim(c),i=this.trim(c,!0),h=parseFloat(i),e[a][d]===void 0&&(e[a][d]=g),q||d===0&&k)b[d]=g;else if(+i===h)b[d]=h,h>31536E6&&p!=="float"?b.isDatetime=!0:b.isNumeric=!0,b[d+1]!==void 0&&(m=h>b[d+1]);else if(h=this.parseDate(c),j&&typeof h==="number"&&!isNaN(h)&&p!=="float"){if(o[d]=c,b[d]=h,b.isDatetime=!0,b[d+1]!==void 0){c= | ||
h>b[d+1];if(c!==m&&m!==void 0)this.alternativeFormat?(this.dateFormat=this.alternativeFormat,d=b.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative):b.unsorted=!0;m=c}}else if(b[d]=g===""?null:g,d!==0&&(b.isDatetime||b.isNumeric))b.mixed=!0;j&&b.mixed&&(f[a]=e[a]);if(j&&m&&this.options.sort)for(a=0;a<f.length;a++)f[a].reverse(),k&&f[a].unshift(f[a].pop())},dateFormats:{"YYYY-mm-dd":{regex:/^([0-9]{4})[\-\/\.]([0-9]{2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[1], | ||
b[2]-1,+b[3])}},"dd/mm/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[2]-1,+b[1])},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[1]-1,+b[2])}},"dd/mm/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[3]+2E3,b[2]-1,+b[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/, | ||
parser:function(b){return Date.UTC(+b[3]+2E3,b[1]-1,+b[2])}}},parseDate:function(b){var a=this.options.parseDate,e,f,d=this.options.dateFormat||this.dateFormat,c;if(a)e=a(b);else if(typeof b==="string"){if(d)a=this.dateFormats[d],(c=b.match(a.regex))&&(e=a.parser(c));else for(f in this.dateFormats)if(a=this.dateFormats[f],c=b.match(a.regex)){this.dateFormat=f;this.alternativeFormat=a.alternative;e=a.parser(c);break}c||(c=Date.parse(b),typeof c==="object"&&c!==null&&c.getTime?e=c.getTime()-c.getTimezoneOffset()* | ||
6E4:typeof c==="number"&&!isNaN(c)&&(e=c-(new Date(c)).getTimezoneOffset()*6E4))}return e},rowsToColumns:function(b){var a,e,f,d,c;if(b){c=[];e=b.length;for(a=0;a<e;a++){d=b[a].length;for(f=0;f<d;f++)c[f]||(c[f]=[]),c[f][a]=b[a][f]}}return c},parsed:function(){if(this.options.parsed)return this.options.parsed.call(this,this.columns)},getFreeIndexes:function(b,a){var e,f,d=[],c=[],h;for(f=0;f<b;f+=1)d.push(!0);for(e=0;e<a.length;e+=1){h=a[e].getReferencedColumnIndexes();for(f=0;f<h.length;f+=1)d[h[f]]= | ||
!1}for(f=0;f<d.length;f+=1)d[f]&&c.push(f);return c},complete:function(){var b=this.columns,a,e=this.options,f,d,c,h,g=[],i;if(e.complete||e.afterComplete){for(c=0;c<b.length;c++)if(this.firstRowAsNames)b[c].name=b[c].shift();f=[];d=this.getFreeIndexes(b.length,this.valueCount.seriesBuilders);for(c=0;c<this.valueCount.seriesBuilders.length;c++)i=this.valueCount.seriesBuilders[c],i.populateColumns(d)&&g.push(i);for(;d.length>0;){i=new j;i.addColumnReader(0,"x");c=r(0,d);c!==-1&&d.splice(c,1);for(c= | ||
0;c<this.valueCount.global;c++)i.addColumnReader(void 0,this.valueCount.globalPointArrayMap[c]);i.populateColumns(d)&&g.push(i)}g.length>0&&g[0].readers.length>0&&(i=b[g[0].readers[0].columnIndex],i!==void 0&&(i.isDatetime?a="datetime":i.isNumeric||(a="category")));if(a==="category")for(c=0;c<g.length;c++){i=g[c];for(d=0;d<i.readers.length;d++)if(i.readers[d].configName==="x")i.readers[d].configName="name"}for(c=0;c<g.length;c++){i=g[c];d=[];for(h=0;h<b[0].length;h++)d[h]=i.read(b,h);f[c]={data:d}; | ||
if(i.name)f[c].name=i.name;if(a==="category")f[c].turboThreshold=0}b={series:f};if(a)b.xAxis={type:a};e.complete&&e.complete(b);e.afterComplete&&e.afterComplete(b)}}});g.Data=p;g.data=function(b,a){return new p(b,a)};g.wrap(g.Chart.prototype,"init",function(b,a,e){var f=this;a&&a.data?g.data(g.extend(a.data,{afterComplete:function(d){var c,h;if(a.hasOwnProperty("series"))if(typeof a.series==="object")for(c=Math.max(a.series.length,d.series.length);c--;)h=a.series[c]||{},a.series[c]=g.merge(h,d.series[c]); | ||
else delete a.series;a=g.merge(d,a);b.call(f,a,e)}}),a):b.call(f,a,e)});j=function(){this.readers=[];this.pointIsArray=!0};j.prototype.populateColumns=function(b){var a=!0;k(this.readers,function(a){if(a.columnIndex===void 0)a.columnIndex=b.shift()});k(this.readers,function(b){b.columnIndex===void 0&&(a=!1)});return a};j.prototype.read=function(b,a){var e=this.pointIsArray,f=e?[]:{},d;k(this.readers,function(c){var d=b[c.columnIndex][a];e?f.push(d):f[c.configName]=d});if(this.name===void 0&&this.readers.length>= | ||
2&&(d=this.getReferencedColumnIndexes(),d.length>=2))d.shift(),d.sort(),this.name=b[d.shift()].name;return f};j.prototype.addColumnReader=function(b,a){this.readers.push({columnIndex:b,configName:a});if(!(a==="x"||a==="y"||a===void 0))this.pointIsArray=!1};j.prototype.getReferencedColumnIndexes=function(){var b,a=[],e;for(b=0;b<this.readers.length;b+=1)e=this.readers[b],e.columnIndex!==void 0&&a.push(e.columnIndex);return a};j.prototype.hasReader=function(b){var a,e;for(a=0;a<this.readers.length;a+= | ||
1)if(e=this.readers[a],e.configName===b)return!0}})(Highcharts); | ||
(function(g){typeof module==="object"&&module.exports?module.exports=g:g(Highcharts)})(function(g){var j=g.each,t=g.pick,r=g.inArray,u=g.splat,k,p=function(b,a){this.init(b,a)};g.extend(p.prototype,{init:function(b,a){this.options=b;this.chartOptions=a;this.columns=b.columns||this.rowsToColumns(b.rows)||[];this.firstRowAsNames=t(b.firstRowAsNames,!0);this.decimalRegex=b.decimalPoint&&RegExp("^(-?[0-9]+)"+b.decimalPoint+"([0-9]+)$");this.rawColumns=[];this.columns.length?this.dataFound():(this.parseCSV(), | ||
this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var b=this.chartOptions,a=this.options,e=[],f=function(b){return(g.seriesTypes[b||"line"].prototype.pointArrayMap||[0]).length},d=b&&b.chart&&b.chart.type,c=[],h=[],q=0,i;j(b&&b.series||[],function(b){c.push(f(b.type||d))});j(a&&a.seriesMapping||[],function(b){e.push(b.x||0)});e.length===0&&e.push(0);j(a&&a.seriesMapping||[],function(a){var e=new k,o,n=c[q]||f(d),m=g.seriesTypes[((b&&b.series||[])[q]||{}).type||d|| | ||
"line"].prototype.pointArrayMap||["y"];e.addColumnReader(a.x,"x");for(o in a)a.hasOwnProperty(o)&&o!=="x"&&e.addColumnReader(a[o],o);for(i=0;i<n;i++)e.hasReader(m[i])||e.addColumnReader(void 0,m[i]);h.push(e);q++});a=g.seriesTypes[d||"line"].prototype.pointArrayMap;a===void 0&&(a=["y"]);this.valueCount={global:f(d),xColumns:e,individual:c,seriesBuilders:h,globalPointArrayMap:a}},dataFound:function(){if(this.options.switchRowsAndColumns)this.columns=this.rowsToColumns(this.columns);this.getColumnDistribution(); | ||
this.parseTypes();this.parsed()!==!1&&this.complete()},parseCSV:function(){var b=this,a=this.options,e=a.csv,f=this.columns,d=a.startRow||0,c=a.endRow||Number.MAX_VALUE,h=a.startColumn||0,q=a.endColumn||Number.MAX_VALUE,i,g,s=0;e&&(g=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(a.lineDelimiter||"\n"),i=a.itemDelimiter||(e.indexOf("\t")!==-1?"\t":","),j(g,function(a,e){var g=b.trim(a),v=g.indexOf("#")===0;e>=d&&e<=c&&!v&&g!==""&&(g=a.split(i),j(g,function(b,a){a>=h&&a<=q&&(f[a-h]||(f[a-h]=[]), | ||
f[a-h][s]=b)}),s+=1)}),this.dataFound())},parseTable:function(){var b=this.options,a=b.table,e=this.columns,f=b.startRow||0,d=b.endRow||Number.MAX_VALUE,c=b.startColumn||0,h=b.endColumn||Number.MAX_VALUE;a&&(typeof a==="string"&&(a=document.getElementById(a)),j(a.getElementsByTagName("tr"),function(b,a){a>=f&&a<=d&&j(b.children,function(b,d){if((b.tagName==="TD"||b.tagName==="TH")&&d>=c&&d<=h)e[d-c]||(e[d-c]=[]),e[d-c][a-f]=b.innerHTML})}),this.dataFound())},parseGoogleSpreadsheet:function(){var b= | ||
this,a=this.options,e=a.googleSpreadsheetKey,f=this.columns,d=a.startRow||0,c=a.endRow||Number.MAX_VALUE,h=a.startColumn||0,g=a.endColumn||Number.MAX_VALUE,i,j;e&&jQuery.ajax({dataType:"json",url:"https://spreadsheets.google.com/feeds/cells/"+e+"/"+(a.googleSpreadsheetWorksheet||"od6")+"/public/values?alt=json-in-script&callback=?",error:a.error,success:function(a){var a=a.feed.entry,e,n=a.length,m=0,k=0,l;for(l=0;l<n;l++)e=a[l],m=Math.max(m,e.gs$cell.col),k=Math.max(k,e.gs$cell.row);for(l=0;l<m;l++)if(l>= | ||
h&&l<=g)f[l-h]=[],f[l-h].length=Math.min(k,c-d);for(l=0;l<n;l++)if(e=a[l],i=e.gs$cell.row-1,j=e.gs$cell.col-1,j>=h&&j<=g&&i>=d&&i<=c)f[j-h][i-d]=e.content.$t;b.dataFound()}})},trim:function(b,a){typeof b==="string"&&(b=b.replace(/^\s+|\s+$/g,""),a&&/^[0-9\s]+$/.test(b)&&(b=b.replace(/\s/g,"")),this.decimalRegex&&(b=b.replace(this.decimalRegex,"$1.$2")));return b},parseTypes:function(){for(var b=this.columns,a=b.length;a--;)this.parseColumn(b[a],a)},parseColumn:function(b,a){var e=this.rawColumns, | ||
f=this.columns,d=b.length,c,h,g,i,j=this.firstRowAsNames,k=r(a,this.valueCount.xColumns)!==-1,o=[],n=this.chartOptions,m,p=(this.options.columnTypes||[])[a],n=k&&(n&&n.xAxis&&u(n.xAxis)[0].type==="category"||p==="string");for(e[a]||(e[a]=[]);d--;)if(c=o[d]||b[d],g=this.trim(c),i=this.trim(c,!0),h=parseFloat(i),e[a][d]===void 0&&(e[a][d]=g),n||d===0&&j)b[d]=g;else if(+i===h)b[d]=h,h>31536E6&&p!=="float"?b.isDatetime=!0:b.isNumeric=!0,b[d+1]!==void 0&&(m=h>b[d+1]);else if(h=this.parseDate(c),k&&typeof h=== | ||
"number"&&!isNaN(h)&&p!=="float"){if(o[d]=c,b[d]=h,b.isDatetime=!0,b[d+1]!==void 0){c=h>b[d+1];if(c!==m&&m!==void 0)this.alternativeFormat?(this.dateFormat=this.alternativeFormat,d=b.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative):b.unsorted=!0;m=c}}else if(b[d]=g===""?null:g,d!==0&&(b.isDatetime||b.isNumeric))b.mixed=!0;k&&b.mixed&&(f[a]=e[a]);if(k&&m&&this.options.sort)for(a=0;a<f.length;a++)f[a].reverse(),j&&f[a].unshift(f[a].pop())},dateFormats:{"YYYY-mm-dd":{regex:/^([0-9]{4})[\-\/\.]([0-9]{2})[\-\/\.]([0-9]{2})$/, | ||
parser:function(b){return Date.UTC(+b[1],b[2]-1,+b[3])}},"dd/mm/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[2]-1,+b[1])},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[1]-1,+b[2])}},"dd/mm/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[3]+2E3,b[2]-1,+b[1])},alternative:"mm/dd/YY"}, | ||
"mm/dd/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[3]+2E3,b[1]-1,+b[2])}}},parseDate:function(b){var a=this.options.parseDate,e,f,d=this.options.dateFormat||this.dateFormat,c;if(a)e=a(b);else if(typeof b==="string"){if(d)a=this.dateFormats[d],(c=b.match(a.regex))&&(e=a.parser(c));else for(f in this.dateFormats)if(a=this.dateFormats[f],c=b.match(a.regex)){this.dateFormat=f;this.alternativeFormat=a.alternative;e=a.parser(c);break}c||(c=Date.parse(b), | ||
typeof c==="object"&&c!==null&&c.getTime?e=c.getTime()-c.getTimezoneOffset()*6E4:typeof c==="number"&&!isNaN(c)&&(e=c-(new Date(c)).getTimezoneOffset()*6E4))}return e},rowsToColumns:function(b){var a,e,f,d,c;if(b){c=[];e=b.length;for(a=0;a<e;a++){d=b[a].length;for(f=0;f<d;f++)c[f]||(c[f]=[]),c[f][a]=b[a][f]}}return c},parsed:function(){if(this.options.parsed)return this.options.parsed.call(this,this.columns)},getFreeIndexes:function(b,a){var e,f,d=[],c=[],h;for(f=0;f<b;f+=1)d.push(!0);for(e=0;e<a.length;e+= | ||
1){h=a[e].getReferencedColumnIndexes();for(f=0;f<h.length;f+=1)d[h[f]]=!1}for(f=0;f<d.length;f+=1)d[f]&&c.push(f);return c},complete:function(){var b=this.columns,a,e=this.options,f,d,c,h,g=[],i;if(e.complete||e.afterComplete){for(c=0;c<b.length;c++)if(this.firstRowAsNames)b[c].name=b[c].shift();f=[];d=this.getFreeIndexes(b.length,this.valueCount.seriesBuilders);for(c=0;c<this.valueCount.seriesBuilders.length;c++)i=this.valueCount.seriesBuilders[c],i.populateColumns(d)&&g.push(i);for(;d.length>0;){i= | ||
new k;i.addColumnReader(0,"x");c=r(0,d);c!==-1&&d.splice(c,1);for(c=0;c<this.valueCount.global;c++)i.addColumnReader(void 0,this.valueCount.globalPointArrayMap[c]);i.populateColumns(d)&&g.push(i)}g.length>0&&g[0].readers.length>0&&(i=b[g[0].readers[0].columnIndex],i!==void 0&&(i.isDatetime?a="datetime":i.isNumeric||(a="category")));if(a==="category")for(c=0;c<g.length;c++){i=g[c];for(d=0;d<i.readers.length;d++)if(i.readers[d].configName==="x")i.readers[d].configName="name"}for(c=0;c<g.length;c++){i= | ||
g[c];d=[];for(h=0;h<b[0].length;h++)d[h]=i.read(b,h);f[c]={data:d};if(i.name)f[c].name=i.name;if(a==="category")f[c].turboThreshold=0}b={series:f};if(a)b.xAxis={type:a};e.complete&&e.complete(b);e.afterComplete&&e.afterComplete(b)}}});g.Data=p;g.data=function(b,a){return new p(b,a)};g.wrap(g.Chart.prototype,"init",function(b,a,e){var f=this;a&&a.data?g.data(g.extend(a.data,{afterComplete:function(d){var c,h;if(a.hasOwnProperty("series"))if(typeof a.series==="object")for(c=Math.max(a.series.length, | ||
d.series.length);c--;)h=a.series[c]||{},a.series[c]=g.merge(h,d.series[c]);else delete a.series;a=g.merge(d,a);b.call(f,a,e)}}),a):b.call(f,a,e)});k=function(){this.readers=[];this.pointIsArray=!0};k.prototype.populateColumns=function(b){var a=!0;j(this.readers,function(a){if(a.columnIndex===void 0)a.columnIndex=b.shift()});j(this.readers,function(b){b.columnIndex===void 0&&(a=!1)});return a};k.prototype.read=function(b,a){var e=this.pointIsArray,f=e?[]:{},d;j(this.readers,function(c){var d=b[c.columnIndex][a]; | ||
e?f.push(d):f[c.configName]=d});if(this.name===void 0&&this.readers.length>=2&&(d=this.getReferencedColumnIndexes(),d.length>=2))d.shift(),d.sort(),this.name=b[d.shift()].name;return f};k.prototype.addColumnReader=function(b,a){this.readers.push({columnIndex:b,configName:a});if(!(a==="x"||a==="y"||a===void 0))this.pointIsArray=!1};k.prototype.getReferencedColumnIndexes=function(){var b,a=[],e;for(b=0;b<this.readers.length;b+=1)e=this.readers[b],e.columnIndex!==void 0&&a.push(e.columnIndex);return a}; | ||
k.prototype.hasReader=function(b){var a,e;for(a=0;a<this.readers.length;a+=1)if(e=this.readers[a],e.configName===b)return!0}}); |
/** | ||
* @license Highmaps JS v1.1.9 (2015-10-07) | ||
* @license Highmaps JS v1.1.10 (2015-12-07) | ||
* Data module | ||
@@ -10,6 +10,10 @@ * | ||
// JSLint options: | ||
/*global jQuery, HighchartsAdapter */ | ||
(function (Highcharts) { | ||
/*global jQuery */ | ||
(function (factory) { | ||
if (typeof module === 'object' && module.exports) { | ||
module.exports = factory; | ||
} else { | ||
factory(Highcharts); | ||
} | ||
}(function (Highcharts) { | ||
@@ -19,3 +23,3 @@ // Utilities | ||
pick = Highcharts.pick, | ||
inArray = HighchartsAdapter.inArray, | ||
inArray = Highcharts.inArray, | ||
splat = Highcharts.splat, | ||
@@ -33,736 +37,736 @@ SeriesBuilder; | ||
/** | ||
* Initialize the Data object with the given options | ||
*/ | ||
init: function (options, chartOptions) { | ||
this.options = options; | ||
this.chartOptions = chartOptions; | ||
this.columns = options.columns || this.rowsToColumns(options.rows) || []; | ||
this.firstRowAsNames = pick(options.firstRowAsNames, true); | ||
this.decimalRegex = options.decimalPoint && new RegExp('^([0-9]+)' + options.decimalPoint + '([0-9]+)$'); | ||
/** | ||
* Initialize the Data object with the given options | ||
*/ | ||
init: function (options, chartOptions) { | ||
this.options = options; | ||
this.chartOptions = chartOptions; | ||
this.columns = options.columns || this.rowsToColumns(options.rows) || []; | ||
this.firstRowAsNames = pick(options.firstRowAsNames, true); | ||
this.decimalRegex = options.decimalPoint && new RegExp('^(-?[0-9]+)' + options.decimalPoint + '([0-9]+)$'); | ||
// This is a two-dimensional array holding the raw, trimmed string values | ||
// with the same organisation as the columns array. It makes it possible | ||
// for example to revert from interpreted timestamps to string-based | ||
// categories. | ||
this.rawColumns = []; | ||
// This is a two-dimensional array holding the raw, trimmed string values | ||
// with the same organisation as the columns array. It makes it possible | ||
// for example to revert from interpreted timestamps to string-based | ||
// categories. | ||
this.rawColumns = []; | ||
// No need to parse or interpret anything | ||
if (this.columns.length) { | ||
this.dataFound(); | ||
// No need to parse or interpret anything | ||
if (this.columns.length) { | ||
this.dataFound(); | ||
// Parse and interpret | ||
} else { | ||
// Parse and interpret | ||
} else { | ||
// Parse a CSV string if options.csv is given | ||
this.parseCSV(); | ||
// Parse a HTML table if options.table is given | ||
this.parseTable(); | ||
// Parse a CSV string if options.csv is given | ||
this.parseCSV(); | ||
// Parse a HTML table if options.table is given | ||
this.parseTable(); | ||
// Parse a Google Spreadsheet | ||
this.parseGoogleSpreadsheet(); | ||
} | ||
// Parse a Google Spreadsheet | ||
this.parseGoogleSpreadsheet(); | ||
} | ||
}, | ||
}, | ||
/** | ||
* Get the column distribution. For example, a line series takes a single column for | ||
* Y values. A range series takes two columns for low and high values respectively, | ||
* and an OHLC series takes four columns. | ||
*/ | ||
getColumnDistribution: function () { | ||
var chartOptions = this.chartOptions, | ||
options = this.options, | ||
xColumns = [], | ||
getValueCount = function (type) { | ||
return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length; | ||
}, | ||
getPointArrayMap = function (type) { | ||
return Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap; | ||
}, | ||
globalType = chartOptions && chartOptions.chart && chartOptions.chart.type, | ||
individualCounts = [], | ||
seriesBuilders = [], | ||
seriesIndex = 0, | ||
i; | ||
/** | ||
* Get the column distribution. For example, a line series takes a single column for | ||
* Y values. A range series takes two columns for low and high values respectively, | ||
* and an OHLC series takes four columns. | ||
*/ | ||
getColumnDistribution: function () { | ||
var chartOptions = this.chartOptions, | ||
options = this.options, | ||
xColumns = [], | ||
getValueCount = function (type) { | ||
return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length; | ||
}, | ||
getPointArrayMap = function (type) { | ||
return Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap; | ||
}, | ||
globalType = chartOptions && chartOptions.chart && chartOptions.chart.type, | ||
individualCounts = [], | ||
seriesBuilders = [], | ||
seriesIndex = 0, | ||
i; | ||
each((chartOptions && chartOptions.series) || [], function (series) { | ||
individualCounts.push(getValueCount(series.type || globalType)); | ||
}); | ||
each((chartOptions && chartOptions.series) || [], function (series) { | ||
individualCounts.push(getValueCount(series.type || globalType)); | ||
}); | ||
// Collect the x-column indexes from seriesMapping | ||
each((options && options.seriesMapping) || [], function (mapping) { | ||
xColumns.push(mapping.x || 0); | ||
}); | ||
// Collect the x-column indexes from seriesMapping | ||
each((options && options.seriesMapping) || [], function (mapping) { | ||
xColumns.push(mapping.x || 0); | ||
}); | ||
// If there are no defined series with x-columns, use the first column as x column | ||
if (xColumns.length === 0) { | ||
xColumns.push(0); | ||
} | ||
// If there are no defined series with x-columns, use the first column as x column | ||
if (xColumns.length === 0) { | ||
xColumns.push(0); | ||
} | ||
// Loop all seriesMappings and constructs SeriesBuilders from | ||
// the mapping options. | ||
each((options && options.seriesMapping) || [], function (mapping) { | ||
var builder = new SeriesBuilder(), | ||
name, | ||
numberOfValueColumnsNeeded = individualCounts[seriesIndex] || getValueCount(globalType), | ||
seriesArr = (chartOptions && chartOptions.series) || [], | ||
series = seriesArr[seriesIndex] || {}, | ||
pointArrayMap = getPointArrayMap(series.type || globalType) || ['y']; | ||
// Loop all seriesMappings and constructs SeriesBuilders from | ||
// the mapping options. | ||
each((options && options.seriesMapping) || [], function (mapping) { | ||
var builder = new SeriesBuilder(), | ||
name, | ||
numberOfValueColumnsNeeded = individualCounts[seriesIndex] || getValueCount(globalType), | ||
seriesArr = (chartOptions && chartOptions.series) || [], | ||
series = seriesArr[seriesIndex] || {}, | ||
pointArrayMap = getPointArrayMap(series.type || globalType) || ['y']; | ||
// Add an x reader from the x property or from an undefined column | ||
// if the property is not set. It will then be auto populated later. | ||
builder.addColumnReader(mapping.x, 'x'); | ||
// Add an x reader from the x property or from an undefined column | ||
// if the property is not set. It will then be auto populated later. | ||
builder.addColumnReader(mapping.x, 'x'); | ||
// Add all column mappings | ||
for (name in mapping) { | ||
if (mapping.hasOwnProperty(name) && name !== 'x') { | ||
builder.addColumnReader(mapping[name], name); | ||
// Add all column mappings | ||
for (name in mapping) { | ||
if (mapping.hasOwnProperty(name) && name !== 'x') { | ||
builder.addColumnReader(mapping[name], name); | ||
} | ||
} | ||
} | ||
// Add missing columns | ||
for (i = 0; i < numberOfValueColumnsNeeded; i++) { | ||
if (!builder.hasReader(pointArrayMap[i])) { | ||
//builder.addNextColumnReader(pointArrayMap[i]); | ||
// Create and add a column reader for the next free column index | ||
builder.addColumnReader(undefined, pointArrayMap[i]); | ||
// Add missing columns | ||
for (i = 0; i < numberOfValueColumnsNeeded; i++) { | ||
if (!builder.hasReader(pointArrayMap[i])) { | ||
//builder.addNextColumnReader(pointArrayMap[i]); | ||
// Create and add a column reader for the next free column index | ||
builder.addColumnReader(undefined, pointArrayMap[i]); | ||
} | ||
} | ||
} | ||
seriesBuilders.push(builder); | ||
seriesIndex++; | ||
}); | ||
seriesBuilders.push(builder); | ||
seriesIndex++; | ||
}); | ||
var globalPointArrayMap = getPointArrayMap(globalType); | ||
if (globalPointArrayMap === undefined) { | ||
globalPointArrayMap = ['y']; | ||
} | ||
var globalPointArrayMap = getPointArrayMap(globalType); | ||
if (globalPointArrayMap === undefined) { | ||
globalPointArrayMap = ['y']; | ||
} | ||
this.valueCount = { | ||
global: getValueCount(globalType), | ||
xColumns: xColumns, | ||
individual: individualCounts, | ||
seriesBuilders: seriesBuilders, | ||
globalPointArrayMap: globalPointArrayMap | ||
}; | ||
}, | ||
this.valueCount = { | ||
global: getValueCount(globalType), | ||
xColumns: xColumns, | ||
individual: individualCounts, | ||
seriesBuilders: seriesBuilders, | ||
globalPointArrayMap: globalPointArrayMap | ||
}; | ||
}, | ||
/** | ||
* When the data is parsed into columns, either by CSV, table, GS or direct input, | ||
* continue with other operations. | ||
*/ | ||
dataFound: function () { | ||
if (this.options.switchRowsAndColumns) { | ||
this.columns = this.rowsToColumns(this.columns); | ||
} | ||
/** | ||
* When the data is parsed into columns, either by CSV, table, GS or direct input, | ||
* continue with other operations. | ||
*/ | ||
dataFound: function () { | ||
if (this.options.switchRowsAndColumns) { | ||
this.columns = this.rowsToColumns(this.columns); | ||
} | ||
// Interpret the info about series and columns | ||
this.getColumnDistribution(); | ||
// Interpret the info about series and columns | ||
this.getColumnDistribution(); | ||
// Interpret the values into right types | ||
this.parseTypes(); | ||
// Handle columns if a handleColumns callback is given | ||
if (this.parsed() !== false) { | ||
// Complete if a complete callback is given | ||
this.complete(); | ||
} | ||
}, | ||
/** | ||
* Parse a CSV input string | ||
*/ | ||
parseCSV: function () { | ||
var self = this, | ||
options = this.options, | ||
csv = options.csv, | ||
columns = this.columns, | ||
startRow = options.startRow || 0, | ||
endRow = options.endRow || Number.MAX_VALUE, | ||
startColumn = options.startColumn || 0, | ||
endColumn = options.endColumn || Number.MAX_VALUE, | ||
itemDelimiter, | ||
lines, | ||
activeRowNo = 0; | ||
// Interpret the values into right types | ||
this.parseTypes(); | ||
if (csv) { | ||
// Handle columns if a handleColumns callback is given | ||
if (this.parsed() !== false) { | ||
lines = csv | ||
.replace(/\r\n/g, "\n") // Unix | ||
.replace(/\r/g, "\n") // Mac | ||
.split(options.lineDelimiter || "\n"); | ||
itemDelimiter = options.itemDelimiter || (csv.indexOf('\t') !== -1 ? '\t' : ','); | ||
// Complete if a complete callback is given | ||
this.complete(); | ||
} | ||
each(lines, function (line, rowNo) { | ||
var trimmed = self.trim(line), | ||
isComment = trimmed.indexOf('#') === 0, | ||
isBlank = trimmed === '', | ||
items; | ||
}, | ||
/** | ||
* Parse a CSV input string | ||
*/ | ||
parseCSV: function () { | ||
var self = this, | ||
options = this.options, | ||
csv = options.csv, | ||
columns = this.columns, | ||
startRow = options.startRow || 0, | ||
endRow = options.endRow || Number.MAX_VALUE, | ||
startColumn = options.startColumn || 0, | ||
endColumn = options.endColumn || Number.MAX_VALUE, | ||
itemDelimiter, | ||
lines, | ||
activeRowNo = 0; | ||
if (rowNo >= startRow && rowNo <= endRow && !isComment && !isBlank) { | ||
items = line.split(itemDelimiter); | ||
each(items, function (item, colNo) { | ||
if (colNo >= startColumn && colNo <= endColumn) { | ||
if (!columns[colNo - startColumn]) { | ||
columns[colNo - startColumn] = []; | ||
if (csv) { | ||
lines = csv | ||
.replace(/\r\n/g, '\n') // Unix | ||
.replace(/\r/g, '\n') // Mac | ||
.split(options.lineDelimiter || '\n'); | ||
itemDelimiter = options.itemDelimiter || (csv.indexOf('\t') !== -1 ? '\t' : ','); | ||
each(lines, function (line, rowNo) { | ||
var trimmed = self.trim(line), | ||
isComment = trimmed.indexOf('#') === 0, | ||
isBlank = trimmed === '', | ||
items; | ||
if (rowNo >= startRow && rowNo <= endRow && !isComment && !isBlank) { | ||
items = line.split(itemDelimiter); | ||
each(items, function (item, colNo) { | ||
if (colNo >= startColumn && colNo <= endColumn) { | ||
if (!columns[colNo - startColumn]) { | ||
columns[colNo - startColumn] = []; | ||
} | ||
columns[colNo - startColumn][activeRowNo] = item; | ||
} | ||
columns[colNo - startColumn][activeRowNo] = item; | ||
} | ||
}); | ||
activeRowNo += 1; | ||
} | ||
}); | ||
}); | ||
activeRowNo += 1; | ||
} | ||
}); | ||
this.dataFound(); | ||
} | ||
}, | ||
/** | ||
* Parse a HTML table | ||
*/ | ||
parseTable: function () { | ||
var options = this.options, | ||
table = options.table, | ||
columns = this.columns, | ||
startRow = options.startRow || 0, | ||
endRow = options.endRow || Number.MAX_VALUE, | ||
startColumn = options.startColumn || 0, | ||
endColumn = options.endColumn || Number.MAX_VALUE; | ||
this.dataFound(); | ||
} | ||
}, | ||
/** | ||
* Parse a HTML table | ||
*/ | ||
parseTable: function () { | ||
var options = this.options, | ||
table = options.table, | ||
columns = this.columns, | ||
startRow = options.startRow || 0, | ||
endRow = options.endRow || Number.MAX_VALUE, | ||
startColumn = options.startColumn || 0, | ||
endColumn = options.endColumn || Number.MAX_VALUE; | ||
if (table) { | ||
if (typeof table === 'string') { | ||
table = document.getElementById(table); | ||
} | ||
each(table.getElementsByTagName('tr'), function (tr, rowNo) { | ||
if (rowNo >= startRow && rowNo <= endRow) { | ||
each(tr.children, function (item, colNo) { | ||
if ((item.tagName === 'TD' || item.tagName === 'TH') && colNo >= startColumn && colNo <= endColumn) { | ||
if (!columns[colNo - startColumn]) { | ||
columns[colNo - startColumn] = []; | ||
if (table) { | ||
if (typeof table === 'string') { | ||
table = document.getElementById(table); | ||
} | ||
each(table.getElementsByTagName('tr'), function (tr, rowNo) { | ||
if (rowNo >= startRow && rowNo <= endRow) { | ||
each(tr.children, function (item, colNo) { | ||
if ((item.tagName === 'TD' || item.tagName === 'TH') && colNo >= startColumn && colNo <= endColumn) { | ||
if (!columns[colNo - startColumn]) { | ||
columns[colNo - startColumn] = []; | ||
} | ||
columns[colNo - startColumn][rowNo - startRow] = item.innerHTML; | ||
} | ||
columns[colNo - startColumn][rowNo - startRow] = item.innerHTML; | ||
} | ||
}); | ||
} | ||
}); | ||
}); | ||
} | ||
}); | ||
this.dataFound(); // continue | ||
} | ||
}, | ||
this.dataFound(); // continue | ||
} | ||
}, | ||
/** | ||
*/ | ||
parseGoogleSpreadsheet: function () { | ||
var self = this, | ||
options = this.options, | ||
googleSpreadsheetKey = options.googleSpreadsheetKey, | ||
columns = this.columns, | ||
startRow = options.startRow || 0, | ||
endRow = options.endRow || Number.MAX_VALUE, | ||
startColumn = options.startColumn || 0, | ||
endColumn = options.endColumn || Number.MAX_VALUE, | ||
gr, // google row | ||
gc; // google column | ||
/** | ||
*/ | ||
parseGoogleSpreadsheet: function () { | ||
var self = this, | ||
options = this.options, | ||
googleSpreadsheetKey = options.googleSpreadsheetKey, | ||
columns = this.columns, | ||
startRow = options.startRow || 0, | ||
endRow = options.endRow || Number.MAX_VALUE, | ||
startColumn = options.startColumn || 0, | ||
endColumn = options.endColumn || Number.MAX_VALUE, | ||
gr, // google row | ||
gc; // google column | ||
if (googleSpreadsheetKey) { | ||
jQuery.ajax({ | ||
dataType: 'json', | ||
url: 'https://spreadsheets.google.com/feeds/cells/' + | ||
googleSpreadsheetKey + '/' + (options.googleSpreadsheetWorksheet || 'od6') + | ||
'/public/values?alt=json-in-script&callback=?', | ||
error: options.error, | ||
success: function (json) { | ||
// Prepare the data from the spreadsheat | ||
var cells = json.feed.entry, | ||
cell, | ||
cellCount = cells.length, | ||
colCount = 0, | ||
rowCount = 0, | ||
i; | ||
// First, find the total number of columns and rows that | ||
// are actually filled with data | ||
for (i = 0; i < cellCount; i++) { | ||
cell = cells[i]; | ||
colCount = Math.max(colCount, cell.gs$cell.col); | ||
rowCount = Math.max(rowCount, cell.gs$cell.row); | ||
} | ||
// Set up arrays containing the column data | ||
for (i = 0; i < colCount; i++) { | ||
if (i >= startColumn && i <= endColumn) { | ||
// Create new columns with the length of either end-start or rowCount | ||
columns[i - startColumn] = []; | ||
// Setting the length to avoid jslint warning | ||
columns[i - startColumn].length = Math.min(rowCount, endRow - startRow); | ||
if (googleSpreadsheetKey) { | ||
jQuery.ajax({ | ||
dataType: 'json', | ||
url: 'https://spreadsheets.google.com/feeds/cells/' + | ||
googleSpreadsheetKey + '/' + (options.googleSpreadsheetWorksheet || 'od6') + | ||
'/public/values?alt=json-in-script&callback=?', | ||
error: options.error, | ||
success: function (json) { | ||
// Prepare the data from the spreadsheat | ||
var cells = json.feed.entry, | ||
cell, | ||
cellCount = cells.length, | ||
colCount = 0, | ||
rowCount = 0, | ||
i; | ||
// First, find the total number of columns and rows that | ||
// are actually filled with data | ||
for (i = 0; i < cellCount; i++) { | ||
cell = cells[i]; | ||
colCount = Math.max(colCount, cell.gs$cell.col); | ||
rowCount = Math.max(rowCount, cell.gs$cell.row); | ||
} | ||
} | ||
// Loop over the cells and assign the value to the right | ||
// place in the column arrays | ||
for (i = 0; i < cellCount; i++) { | ||
cell = cells[i]; | ||
gr = cell.gs$cell.row - 1; // rows start at 1 | ||
gc = cell.gs$cell.col - 1; // columns start at 1 | ||
// Set up arrays containing the column data | ||
for (i = 0; i < colCount; i++) { | ||
if (i >= startColumn && i <= endColumn) { | ||
// Create new columns with the length of either end-start or rowCount | ||
columns[i - startColumn] = []; | ||
// If both row and col falls inside start and end | ||
// set the transposed cell value in the newly created columns | ||
if (gc >= startColumn && gc <= endColumn && | ||
gr >= startRow && gr <= endRow) { | ||
columns[gc - startColumn][gr - startRow] = cell.content.$t; | ||
// Setting the length to avoid jslint warning | ||
columns[i - startColumn].length = Math.min(rowCount, endRow - startRow); | ||
} | ||
} | ||
// Loop over the cells and assign the value to the right | ||
// place in the column arrays | ||
for (i = 0; i < cellCount; i++) { | ||
cell = cells[i]; | ||
gr = cell.gs$cell.row - 1; // rows start at 1 | ||
gc = cell.gs$cell.col - 1; // columns start at 1 | ||
// If both row and col falls inside start and end | ||
// set the transposed cell value in the newly created columns | ||
if (gc >= startColumn && gc <= endColumn && | ||
gr >= startRow && gr <= endRow) { | ||
columns[gc - startColumn][gr - startRow] = cell.content.$t; | ||
} | ||
} | ||
self.dataFound(); | ||
} | ||
self.dataFound(); | ||
}); | ||
} | ||
}, | ||
/** | ||
* Trim a string from whitespace | ||
*/ | ||
trim: function (str, inside) { | ||
if (typeof str === 'string') { | ||
str = str.replace(/^\s+|\s+$/g, ''); | ||
// Clear white space insdie the string, like thousands separators | ||
if (inside && /^[0-9\s]+$/.test(str)) { | ||
str = str.replace(/\s/g, ''); | ||
} | ||
}); | ||
} | ||
}, | ||
/** | ||
* Trim a string from whitespace | ||
*/ | ||
trim: function (str, inside) { | ||
if (typeof str === 'string') { | ||
str = str.replace(/^\s+|\s+$/g, ''); | ||
// Clear white space insdie the string, like thousands separators | ||
if (inside && /^[0-9\s]+$/.test(str)) { | ||
str = str.replace(/\s/g, ''); | ||
if (this.decimalRegex) { | ||
str = str.replace(this.decimalRegex, '$1.$2'); | ||
} | ||
} | ||
return str; | ||
}, | ||
/** | ||
* Parse numeric cells in to number types and date types in to true dates. | ||
*/ | ||
parseTypes: function () { | ||
var columns = this.columns, | ||
col = columns.length; | ||
if (this.decimalRegex) { | ||
str = str.replace(this.decimalRegex, '$1.$2'); | ||
while (col--) { | ||
this.parseColumn(columns[col], col); | ||
} | ||
} | ||
return str; | ||
}, | ||
/** | ||
* Parse numeric cells in to number types and date types in to true dates. | ||
*/ | ||
parseTypes: function () { | ||
var columns = this.columns, | ||
col = columns.length; | ||
while (col--) { | ||
this.parseColumn(columns[col], col); | ||
} | ||
}, | ||
}, | ||
/** | ||
* Parse a single column. Set properties like .isDatetime and .isNumeric. | ||
*/ | ||
parseColumn: function (column, col) { | ||
var rawColumns = this.rawColumns, | ||
columns = this.columns, | ||
row = column.length, | ||
val, | ||
floatVal, | ||
trimVal, | ||
trimInsideVal, | ||
firstRowAsNames = this.firstRowAsNames, | ||
isXColumn = inArray(col, this.valueCount.xColumns) !== -1, | ||
dateVal, | ||
backup = [], | ||
diff, | ||
chartOptions = this.chartOptions, | ||
descending, | ||
columnTypes = this.options.columnTypes || [], | ||
columnType = columnTypes[col], | ||
forceCategory = isXColumn && ((chartOptions && chartOptions.xAxis && splat(chartOptions.xAxis)[0].type === 'category') || columnType === 'string'); | ||
if (!rawColumns[col]) { | ||
rawColumns[col] = []; | ||
} | ||
while (row--) { | ||
val = backup[row] || column[row]; | ||
/** | ||
* Parse a single column. Set properties like .isDatetime and .isNumeric. | ||
*/ | ||
parseColumn: function (column, col) { | ||
var rawColumns = this.rawColumns, | ||
columns = this.columns, | ||
row = column.length, | ||
val, | ||
floatVal, | ||
trimVal, | ||
trimInsideVal, | ||
firstRowAsNames = this.firstRowAsNames, | ||
isXColumn = inArray(col, this.valueCount.xColumns) !== -1, | ||
dateVal, | ||
backup = [], | ||
diff, | ||
chartOptions = this.chartOptions, | ||
descending, | ||
columnTypes = this.options.columnTypes || [], | ||
columnType = columnTypes[col], | ||
forceCategory = isXColumn && ((chartOptions && chartOptions.xAxis && splat(chartOptions.xAxis)[0].type === 'category') || columnType === 'string'); | ||
trimVal = this.trim(val); | ||
trimInsideVal = this.trim(val, true); | ||
floatVal = parseFloat(trimInsideVal); | ||
// Set it the first time | ||
if (rawColumns[col][row] === undefined) { | ||
rawColumns[col][row] = trimVal; | ||
if (!rawColumns[col]) { | ||
rawColumns[col] = []; | ||
} | ||
// Disable number or date parsing by setting the X axis type to category | ||
if (forceCategory || (row === 0 && firstRowAsNames)) { | ||
column[row] = trimVal; | ||
} else if (+trimInsideVal === floatVal) { // is numeric | ||
column[row] = floatVal; | ||
while (row--) { | ||
val = backup[row] || column[row]; | ||
// If the number is greater than milliseconds in a year, assume datetime | ||
if (floatVal > 365 * 24 * 3600 * 1000 && columnType !== 'float') { | ||
column.isDatetime = true; | ||
} else { | ||
column.isNumeric = true; | ||
} | ||
trimVal = this.trim(val); | ||
trimInsideVal = this.trim(val, true); | ||
floatVal = parseFloat(trimInsideVal); | ||
if (column[row + 1] !== undefined) { | ||
descending = floatVal > column[row + 1]; | ||
// Set it the first time | ||
if (rawColumns[col][row] === undefined) { | ||
rawColumns[col][row] = trimVal; | ||
} | ||
// String, continue to determine if it is a date string or really a string | ||
} else { | ||
dateVal = this.parseDate(val); | ||
// Only allow parsing of dates if this column is an x-column | ||
if (isXColumn && typeof dateVal === 'number' && !isNaN(dateVal) && columnType !== 'float') { // is date | ||
backup[row] = val; | ||
column[row] = dateVal; | ||
column.isDatetime = true; | ||
// Disable number or date parsing by setting the X axis type to category | ||
if (forceCategory || (row === 0 && firstRowAsNames)) { | ||
column[row] = trimVal; | ||
// Check if the dates are uniformly descending or ascending. If they | ||
// are not, chances are that they are a different time format, so check | ||
// for alternative. | ||
} else if (+trimInsideVal === floatVal) { // is numeric | ||
column[row] = floatVal; | ||
// If the number is greater than milliseconds in a year, assume datetime | ||
if (floatVal > 365 * 24 * 3600 * 1000 && columnType !== 'float') { | ||
column.isDatetime = true; | ||
} else { | ||
column.isNumeric = true; | ||
} | ||
if (column[row + 1] !== undefined) { | ||
diff = dateVal > column[row + 1]; | ||
if (diff !== descending && descending !== undefined) { | ||
if (this.alternativeFormat) { | ||
this.dateFormat = this.alternativeFormat; | ||
row = column.length; | ||
this.alternativeFormat = this.dateFormats[this.dateFormat].alternative; | ||
} else { | ||
column.unsorted = true; | ||
descending = floatVal > column[row + 1]; | ||
} | ||
// String, continue to determine if it is a date string or really a string | ||
} else { | ||
dateVal = this.parseDate(val); | ||
// Only allow parsing of dates if this column is an x-column | ||
if (isXColumn && typeof dateVal === 'number' && !isNaN(dateVal) && columnType !== 'float') { // is date | ||
backup[row] = val; | ||
column[row] = dateVal; | ||
column.isDatetime = true; | ||
// Check if the dates are uniformly descending or ascending. If they | ||
// are not, chances are that they are a different time format, so check | ||
// for alternative. | ||
if (column[row + 1] !== undefined) { | ||
diff = dateVal > column[row + 1]; | ||
if (diff !== descending && descending !== undefined) { | ||
if (this.alternativeFormat) { | ||
this.dateFormat = this.alternativeFormat; | ||
row = column.length; | ||
this.alternativeFormat = this.dateFormats[this.dateFormat].alternative; | ||
} else { | ||
column.unsorted = true; | ||
} | ||
} | ||
descending = diff; | ||
} | ||
descending = diff; | ||
} else { // string | ||
column[row] = trimVal === '' ? null : trimVal; | ||
if (row !== 0 && (column.isDatetime || column.isNumeric)) { | ||
column.mixed = true; | ||
} | ||
} | ||
} else { // string | ||
column[row] = trimVal === '' ? null : trimVal; | ||
if (row !== 0 && (column.isDatetime || column.isNumeric)) { | ||
column.mixed = true; | ||
} | ||
} | ||
} | ||
} | ||
// If strings are intermixed with numbers or dates in a parsed column, it is an indication | ||
// that parsing went wrong or the data was not intended to display as numbers or dates and | ||
// parsing is too aggressive. Fall back to categories. Demonstrated in the | ||
// highcharts/demo/column-drilldown sample. | ||
if (isXColumn && column.mixed) { | ||
columns[col] = rawColumns[col]; | ||
} | ||
// If strings are intermixed with numbers or dates in a parsed column, it is an indication | ||
// that parsing went wrong or the data was not intended to display as numbers or dates and | ||
// parsing is too aggressive. Fall back to categories. Demonstrated in the | ||
// highcharts/demo/column-drilldown sample. | ||
if (isXColumn && column.mixed) { | ||
columns[col] = rawColumns[col]; | ||
} | ||
// If the 0 column is date or number and descending, reverse all columns. | ||
if (isXColumn && descending && this.options.sort) { | ||
for (col = 0; col < columns.length; col++) { | ||
columns[col].reverse(); | ||
if (firstRowAsNames) { | ||
columns[col].unshift(columns[col].pop()); | ||
// If the 0 column is date or number and descending, reverse all columns. | ||
if (isXColumn && descending && this.options.sort) { | ||
for (col = 0; col < columns.length; col++) { | ||
columns[col].reverse(); | ||
if (firstRowAsNames) { | ||
columns[col].unshift(columns[col].pop()); | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
/** | ||
* A collection of available date formats, extendable from the outside to support | ||
* custom date formats. | ||
*/ | ||
dateFormats: { | ||
'YYYY-mm-dd': { | ||
regex: /^([0-9]{4})[\-\/\.]([0-9]{2})[\-\/\.]([0-9]{2})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[1], match[2] - 1, +match[3]); | ||
} | ||
}, | ||
'dd/mm/YYYY': { | ||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[3], match[2] - 1, +match[1]); | ||
/** | ||
* A collection of available date formats, extendable from the outside to support | ||
* custom date formats. | ||
*/ | ||
dateFormats: { | ||
'YYYY-mm-dd': { | ||
regex: /^([0-9]{4})[\-\/\.]([0-9]{2})[\-\/\.]([0-9]{2})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[1], match[2] - 1, +match[3]); | ||
} | ||
}, | ||
alternative: 'mm/dd/YYYY' // different format with the same regex | ||
}, | ||
'mm/dd/YYYY': { | ||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[3], match[1] - 1, +match[2]); | ||
'dd/mm/YYYY': { | ||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[3], match[2] - 1, +match[1]); | ||
}, | ||
alternative: 'mm/dd/YYYY' // different format with the same regex | ||
}, | ||
'mm/dd/YYYY': { | ||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[3], match[1] - 1, +match[2]); | ||
} | ||
}, | ||
'dd/mm/YY': { | ||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[3] + 2000, match[2] - 1, +match[1]); | ||
}, | ||
alternative: 'mm/dd/YY' // different format with the same regex | ||
}, | ||
'mm/dd/YY': { | ||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[3] + 2000, match[1] - 1, +match[2]); | ||
} | ||
} | ||
}, | ||
'dd/mm/YY': { | ||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[3] + 2000, match[2] - 1, +match[1]); | ||
}, | ||
alternative: 'mm/dd/YY' // different format with the same regex | ||
}, | ||
'mm/dd/YY': { | ||
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/, | ||
parser: function (match) { | ||
return Date.UTC(+match[3] + 2000, match[1] - 1, +match[2]); | ||
} | ||
} | ||
}, | ||
/** | ||
* Parse a date and return it as a number. Overridable through options.parseDate. | ||
*/ | ||
parseDate: function (val) { | ||
var parseDate = this.options.parseDate, | ||
ret, | ||
key, | ||
format, | ||
dateFormat = this.options.dateFormat || this.dateFormat, | ||
match; | ||
/** | ||
* Parse a date and return it as a number. Overridable through options.parseDate. | ||
*/ | ||
parseDate: function (val) { | ||
var parseDate = this.options.parseDate, | ||
ret, | ||
key, | ||
format, | ||
dateFormat = this.options.dateFormat || this.dateFormat, | ||
match; | ||
if (parseDate) { | ||
ret = parseDate(val); | ||
} else if (typeof val === 'string') { | ||
// Auto-detect the date format the first time | ||
if (!dateFormat) { | ||
for (key in this.dateFormats) { | ||
format = this.dateFormats[key]; | ||
if (parseDate) { | ||
ret = parseDate(val); | ||
} else if (typeof val === 'string') { | ||
// Auto-detect the date format the first time | ||
if (!dateFormat) { | ||
for (key in this.dateFormats) { | ||
format = this.dateFormats[key]; | ||
match = val.match(format.regex); | ||
if (match) { | ||
this.dateFormat = dateFormat = key; | ||
this.alternativeFormat = format.alternative; | ||
ret = format.parser(match); | ||
break; | ||
} | ||
} | ||
// Next time, use the one previously found | ||
} else { | ||
format = this.dateFormats[dateFormat]; | ||
match = val.match(format.regex); | ||
if (match) { | ||
this.dateFormat = dateFormat = key; | ||
this.alternativeFormat = format.alternative; | ||
ret = format.parser(match); | ||
break; | ||
} | ||
} | ||
// Next time, use the one previously found | ||
} else { | ||
format = this.dateFormats[dateFormat]; | ||
match = val.match(format.regex); | ||
if (match) { | ||
ret = format.parser(match); | ||
// Fall back to Date.parse | ||
if (!match) { | ||
match = Date.parse(val); | ||
// External tools like Date.js and MooTools extend Date object and | ||
// returns a date. | ||
if (typeof match === 'object' && match !== null && match.getTime) { | ||
ret = match.getTime() - match.getTimezoneOffset() * 60000; | ||
// Timestamp | ||
} else if (typeof match === 'number' && !isNaN(match)) { | ||
ret = match - (new Date(match)).getTimezoneOffset() * 60000; | ||
} | ||
} | ||
} | ||
// Fall back to Date.parse | ||
if (!match) { | ||
match = Date.parse(val); | ||
// External tools like Date.js and MooTools extend Date object and | ||
// returns a date. | ||
if (typeof match === 'object' && match !== null && match.getTime) { | ||
ret = match.getTime() - match.getTimezoneOffset() * 60000; | ||
// Timestamp | ||
} else if (typeof match === 'number' && !isNaN(match)) { | ||
ret = match - (new Date(match)).getTimezoneOffset() * 60000; | ||
} | ||
} | ||
} | ||
return ret; | ||
}, | ||
/** | ||
* Reorganize rows into columns | ||
*/ | ||
rowsToColumns: function (rows) { | ||
var row, | ||
rowsLength, | ||
col, | ||
colsLength, | ||
columns; | ||
return ret; | ||
}, | ||
/** | ||
* Reorganize rows into columns | ||
*/ | ||
rowsToColumns: function (rows) { | ||
var row, | ||
rowsLength, | ||
col, | ||
colsLength, | ||
columns; | ||
if (rows) { | ||
columns = []; | ||
rowsLength = rows.length; | ||
for (row = 0; row < rowsLength; row++) { | ||
colsLength = rows[row].length; | ||
for (col = 0; col < colsLength; col++) { | ||
if (!columns[col]) { | ||
columns[col] = []; | ||
if (rows) { | ||
columns = []; | ||
rowsLength = rows.length; | ||
for (row = 0; row < rowsLength; row++) { | ||
colsLength = rows[row].length; | ||
for (col = 0; col < colsLength; col++) { | ||
if (!columns[col]) { | ||
columns[col] = []; | ||
} | ||
columns[col][row] = rows[row][col]; | ||
} | ||
columns[col][row] = rows[row][col]; | ||
} | ||
} | ||
} | ||
return columns; | ||
}, | ||
/** | ||
* A hook for working directly on the parsed columns | ||
*/ | ||
parsed: function () { | ||
if (this.options.parsed) { | ||
return this.options.parsed.call(this, this.columns); | ||
} | ||
}, | ||
return columns; | ||
}, | ||
/** | ||
* A hook for working directly on the parsed columns | ||
*/ | ||
parsed: function () { | ||
if (this.options.parsed) { | ||
return this.options.parsed.call(this, this.columns); | ||
} | ||
}, | ||
getFreeIndexes: function (numberOfColumns, seriesBuilders) { | ||
var s, | ||
i, | ||
freeIndexes = [], | ||
freeIndexValues = [], | ||
referencedIndexes; | ||
getFreeIndexes: function (numberOfColumns, seriesBuilders) { | ||
var s, | ||
i, | ||
freeIndexes = [], | ||
freeIndexValues = [], | ||
referencedIndexes; | ||
// Add all columns as free | ||
for (i = 0; i < numberOfColumns; i = i + 1) { | ||
freeIndexes.push(true); | ||
} | ||
// Add all columns as free | ||
for (i = 0; i < numberOfColumns; i = i + 1) { | ||
freeIndexes.push(true); | ||
} | ||
// Loop all defined builders and remove their referenced columns | ||
for (s = 0; s < seriesBuilders.length; s = s + 1) { | ||
referencedIndexes = seriesBuilders[s].getReferencedColumnIndexes(); | ||
// Loop all defined builders and remove their referenced columns | ||
for (s = 0; s < seriesBuilders.length; s = s + 1) { | ||
referencedIndexes = seriesBuilders[s].getReferencedColumnIndexes(); | ||
for (i = 0; i < referencedIndexes.length; i = i + 1) { | ||
freeIndexes[referencedIndexes[i]] = false; | ||
for (i = 0; i < referencedIndexes.length; i = i + 1) { | ||
freeIndexes[referencedIndexes[i]] = false; | ||
} | ||
} | ||
} | ||
// Collect the values for the free indexes | ||
for (i = 0; i < freeIndexes.length; i = i + 1) { | ||
if (freeIndexes[i]) { | ||
freeIndexValues.push(i); | ||
// Collect the values for the free indexes | ||
for (i = 0; i < freeIndexes.length; i = i + 1) { | ||
if (freeIndexes[i]) { | ||
freeIndexValues.push(i); | ||
} | ||
} | ||
} | ||
return freeIndexValues; | ||
}, | ||
/** | ||
* If a complete callback function is provided in the options, interpret the | ||
* columns into a Highcharts options object. | ||
*/ | ||
complete: function () { | ||
return freeIndexValues; | ||
}, | ||
var columns = this.columns, | ||
xColumns = [], | ||
type, | ||
options = this.options, | ||
series, | ||
data, | ||
i, | ||
j, | ||
r, | ||
seriesIndex, | ||
chartOptions, | ||
allSeriesBuilders = [], | ||
builder, | ||
freeIndexes, | ||
typeCol, | ||
index; | ||
/** | ||
* If a complete callback function is provided in the options, interpret the | ||
* columns into a Highcharts options object. | ||
*/ | ||
complete: function () { | ||
var columns = this.columns, | ||
xColumns = [], | ||
type, | ||
options = this.options, | ||
series, | ||
data, | ||
i, | ||
j, | ||
r, | ||
seriesIndex, | ||
chartOptions, | ||
allSeriesBuilders = [], | ||
builder, | ||
freeIndexes, | ||
typeCol, | ||
index; | ||
xColumns.length = columns.length; | ||
if (options.complete || options.afterComplete) { | ||
xColumns.length = columns.length; | ||
if (options.complete || options.afterComplete) { | ||
// Get the names and shift the top row | ||
for (i = 0; i < columns.length; i++) { | ||
if (this.firstRowAsNames) { | ||
columns[i].name = columns[i].shift(); | ||
// Get the names and shift the top row | ||
for (i = 0; i < columns.length; i++) { | ||
if (this.firstRowAsNames) { | ||
columns[i].name = columns[i].shift(); | ||
} | ||
} | ||
} | ||
// Use the next columns for series | ||
series = []; | ||
freeIndexes = this.getFreeIndexes(columns.length, this.valueCount.seriesBuilders); | ||
// Use the next columns for series | ||
series = []; | ||
freeIndexes = this.getFreeIndexes(columns.length, this.valueCount.seriesBuilders); | ||
// Populate defined series | ||
for (seriesIndex = 0; seriesIndex < this.valueCount.seriesBuilders.length; seriesIndex++) { | ||
builder = this.valueCount.seriesBuilders[seriesIndex]; | ||
// Populate defined series | ||
for (seriesIndex = 0; seriesIndex < this.valueCount.seriesBuilders.length; seriesIndex++) { | ||
builder = this.valueCount.seriesBuilders[seriesIndex]; | ||
// If the builder can be populated with remaining columns, then add it to allBuilders | ||
if (builder.populateColumns(freeIndexes)) { | ||
allSeriesBuilders.push(builder); | ||
// If the builder can be populated with remaining columns, then add it to allBuilders | ||
if (builder.populateColumns(freeIndexes)) { | ||
allSeriesBuilders.push(builder); | ||
} | ||
} | ||
} | ||
// Populate dynamic series | ||
while (freeIndexes.length > 0) { | ||
builder = new SeriesBuilder(); | ||
builder.addColumnReader(0, 'x'); | ||
// Mark index as used (not free) | ||
index = inArray(0, freeIndexes); | ||
if (index !== -1) { | ||
freeIndexes.splice(index, 1); | ||
} | ||
// Populate dynamic series | ||
while (freeIndexes.length > 0) { | ||
builder = new SeriesBuilder(); | ||
builder.addColumnReader(0, 'x'); | ||
// Mark index as used (not free) | ||
index = inArray(0, freeIndexes); | ||
if (index !== -1) { | ||
freeIndexes.splice(index, 1); | ||
} | ||
for (i = 0; i < this.valueCount.global; i++) { | ||
// Create and add a column reader for the next free column index | ||
builder.addColumnReader(undefined, this.valueCount.globalPointArrayMap[i]); | ||
} | ||
for (i = 0; i < this.valueCount.global; i++) { | ||
// Create and add a column reader for the next free column index | ||
builder.addColumnReader(undefined, this.valueCount.globalPointArrayMap[i]); | ||
} | ||
// If the builder can be populated with remaining columns, then add it to allBuilders | ||
if (builder.populateColumns(freeIndexes)) { | ||
allSeriesBuilders.push(builder); | ||
// If the builder can be populated with remaining columns, then add it to allBuilders | ||
if (builder.populateColumns(freeIndexes)) { | ||
allSeriesBuilders.push(builder); | ||
} | ||
} | ||
} | ||
// Get the data-type from the first series x column | ||
if (allSeriesBuilders.length > 0 && allSeriesBuilders[0].readers.length > 0) { | ||
typeCol = columns[allSeriesBuilders[0].readers[0].columnIndex]; | ||
if (typeCol !== undefined) { | ||
if (typeCol.isDatetime) { | ||
type = 'datetime'; | ||
} else if (!typeCol.isNumeric) { | ||
type = 'category'; | ||
// Get the data-type from the first series x column | ||
if (allSeriesBuilders.length > 0 && allSeriesBuilders[0].readers.length > 0) { | ||
typeCol = columns[allSeriesBuilders[0].readers[0].columnIndex]; | ||
if (typeCol !== undefined) { | ||
if (typeCol.isDatetime) { | ||
type = 'datetime'; | ||
} else if (!typeCol.isNumeric) { | ||
type = 'category'; | ||
} | ||
} | ||
} | ||
} | ||
// Axis type is category, then the "x" column should be called "name" | ||
if (type === 'category') { | ||
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) { | ||
builder = allSeriesBuilders[seriesIndex]; | ||
for (r = 0; r < builder.readers.length; r++) { | ||
if (builder.readers[r].configName === 'x') { | ||
builder.readers[r].configName = 'name'; | ||
// Axis type is category, then the "x" column should be called "name" | ||
if (type === 'category') { | ||
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) { | ||
builder = allSeriesBuilders[seriesIndex]; | ||
for (r = 0; r < builder.readers.length; r++) { | ||
if (builder.readers[r].configName === 'x') { | ||
builder.readers[r].configName = 'name'; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
// Read data for all builders | ||
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) { | ||
builder = allSeriesBuilders[seriesIndex]; | ||
// Read data for all builders | ||
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) { | ||
builder = allSeriesBuilders[seriesIndex]; | ||
// Iterate down the cells of each column and add data to the series | ||
data = []; | ||
for (j = 0; j < columns[0].length; j++) { // TODO: which column's length should we use here | ||
data[j] = builder.read(columns, j); | ||
} | ||
// Iterate down the cells of each column and add data to the series | ||
data = []; | ||
for (j = 0; j < columns[0].length; j++) { | ||
data[j] = builder.read(columns, j); | ||
} | ||
// Add the series | ||
series[seriesIndex] = { | ||
data: data | ||
}; | ||
if (builder.name) { | ||
series[seriesIndex].name = builder.name; | ||
// Add the series | ||
series[seriesIndex] = { | ||
data: data | ||
}; | ||
if (builder.name) { | ||
series[seriesIndex].name = builder.name; | ||
} | ||
if (type === 'category') { | ||
series[seriesIndex].turboThreshold = 0; | ||
} | ||
} | ||
if (type === 'category') { | ||
series[seriesIndex].turboThreshold = 0; | ||
} | ||
} | ||
// Do the callback | ||
chartOptions = { | ||
series: series | ||
}; | ||
if (type) { | ||
chartOptions.xAxis = { | ||
type: type | ||
// Do the callback | ||
chartOptions = { | ||
series: series | ||
}; | ||
} | ||
if (options.complete) { | ||
options.complete(chartOptions); | ||
} | ||
if (type) { | ||
chartOptions.xAxis = { | ||
type: type | ||
}; | ||
} | ||
if (options.complete) { | ||
options.complete(chartOptions); | ||
} | ||
// The afterComplete hook is used internally to avoid conflict with the externally | ||
// available complete option. | ||
if (options.afterComplete) { | ||
options.afterComplete(chartOptions); | ||
// The afterComplete hook is used internally to avoid conflict with the externally | ||
// available complete option. | ||
if (options.afterComplete) { | ||
options.afterComplete(chartOptions); | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
@@ -956,2 +960,2 @@ | ||
}(Highcharts)); | ||
})); |
@@ -1,17 +0,17 @@ | ||
(function(f){function A(b,a,c){var d;!a.rgba.length||!b.rgba.length?b=a.raw||"none":(b=b.rgba,a=a.rgba,d=a[3]!==1||b[3]!==1,b=(d?"rgba(":"rgb(")+Math.round(a[0]+(b[0]-a[0])*(1-c))+","+Math.round(a[1]+(b[1]-a[1])*(1-c))+","+Math.round(a[2]+(b[2]-a[2])*(1-c))+(d?","+(a[3]+(b[3]-a[3])*(1-c)):"")+")");return b}var t=function(){},q=f.getOptions(),h=f.each,l=f.extend,B=f.format,u=f.pick,r=f.wrap,m=f.Chart,p=f.seriesTypes,v=p.pie,n=p.column,w=f.Tick,x=HighchartsAdapter.fireEvent,y=HighchartsAdapter.inArray, | ||
z=1;h(["fill","stroke"],function(b){HighchartsAdapter.addAnimSetter(b,function(a){a.elem.attr(b,A(f.Color(a.start),f.Color(a.end),a.pos))})});l(q.lang,{drillUpText:"\u25c1 Back to {series.name}"});q.drilldown={activeAxisLabelStyle:{cursor:"pointer",color:"#0d233a",fontWeight:"bold",textDecoration:"underline"},activeDataLabelStyle:{cursor:"pointer",color:"#0d233a",fontWeight:"bold",textDecoration:"underline"},animation:{duration:500},drillUpButton:{position:{align:"right",x:-10,y:10}}};f.SVGRenderer.prototype.Element.prototype.fadeIn= | ||
function(b){this.attr({opacity:0.1,visibility:"inherit"}).animate({opacity:u(this.newOpacity,1)},b||{duration:250})};m.prototype.addSeriesAsDrilldown=function(b,a){this.addSingleSeriesAsDrilldown(b,a);this.applyDrilldown()};m.prototype.addSingleSeriesAsDrilldown=function(b,a){var c=b.series,d=c.xAxis,g=c.yAxis,e;e=b.color||c.color;var i,f=[],j=[],k,o;if(!this.drilldownLevels)this.drilldownLevels=[];k=c.options._levelNumber||0;(o=this.drilldownLevels[this.drilldownLevels.length-1])&&o.levelNumber!== | ||
k&&(o=void 0);a=l({color:e,_ddSeriesId:z++},a);i=y(b,c.points);h(c.chart.series,function(a){if(a.xAxis===d&&!a.isDrilling)a.options._ddSeriesId=a.options._ddSeriesId||z++,a.options._colorIndex=a.userOptions._colorIndex,a.options._levelNumber=a.options._levelNumber||k,o?(f=o.levelSeries,j=o.levelSeriesOptions):(f.push(a),j.push(a.options))});e={levelNumber:k,seriesOptions:c.options,levelSeriesOptions:j,levelSeries:f,shapeArgs:b.shapeArgs,bBox:b.graphic?b.graphic.getBBox():{},color:e,lowerSeriesOptions:a, | ||
pointOptions:c.options.data[i],pointIndex:i,oldExtremes:{xMin:d&&d.userMin,xMax:d&&d.userMax,yMin:g&&g.userMin,yMax:g&&g.userMax}};this.drilldownLevels.push(e);e=e.lowerSeries=this.addSeries(a,!1);e.options._levelNumber=k+1;if(d)d.oldPos=d.pos,d.userMin=d.userMax=null,g.userMin=g.userMax=null;if(c.type===e.type)e.animate=e.animateDrilldown||t,e.options.animation=!0};m.prototype.applyDrilldown=function(){var b=this.drilldownLevels,a;if(b&&b.length>0)a=b[b.length-1].levelNumber,h(this.drilldownLevels, | ||
function(b){b.levelNumber===a&&h(b.levelSeries,function(b){b.options&&b.options._levelNumber===a&&b.remove(!1)})});this.redraw();this.showDrillUpButton()};m.prototype.getDrilldownBackText=function(){var b=this.drilldownLevels;if(b&&b.length>0)return b=b[b.length-1],b.series=b.seriesOptions,B(this.options.lang.drillUpText,b)};m.prototype.showDrillUpButton=function(){var b=this,a=this.getDrilldownBackText(),c=b.options.drilldown.drillUpButton,d,g;this.drillUpButton?this.drillUpButton.attr({text:a}).align(): | ||
(g=(d=c.theme)&&d.states,this.drillUpButton=this.renderer.button(a,null,null,function(){b.drillUp()},d,g&&g.hover,g&&g.select).attr({align:c.position.align,zIndex:9}).add().align(c.position,!1,c.relativeTo||"plotBox"))};m.prototype.drillUp=function(){for(var b=this,a=b.drilldownLevels,c=a[a.length-1].levelNumber,d=a.length,g=b.series,e,i,f,j,k=function(a){var c;h(g,function(b){b.options._ddSeriesId===a._ddSeriesId&&(c=b)});c=c||b.addSeries(a,!1);if(c.type===f.type&&c.animateDrillupTo)c.animate=c.animateDrillupTo; | ||
a===i.seriesOptions&&(j=c)};d--;)if(i=a[d],i.levelNumber===c){a.pop();f=i.lowerSeries;if(!f.chart)for(e=g.length;e--;)if(g[e].options.id===i.lowerSeriesOptions.id&&g[e].options._levelNumber===c+1){f=g[e];break}f.xData=[];h(i.levelSeriesOptions,k);x(b,"drillup",{seriesOptions:i.seriesOptions});if(j.type===f.type)j.drilldownLevel=i,j.options.animation=b.options.drilldown.animation,f.animateDrillupFrom&&f.chart&&f.animateDrillupFrom(i);j.options._levelNumber=c;f.remove(!1);if(j.xAxis)e=i.oldExtremes, | ||
j.xAxis.setExtremes(e.xMin,e.xMax,!1),j.yAxis.setExtremes(e.yMin,e.yMax,!1)}this.redraw();this.drilldownLevels.length===0?this.drillUpButton=this.drillUpButton.destroy():this.drillUpButton.attr({text:this.getDrilldownBackText()}).align();this.ddDupes.length=[]};n.prototype.supportsDrilldown=!0;n.prototype.animateDrillupTo=function(b){if(!b){var a=this,c=a.drilldownLevel;h(this.points,function(a){a.graphic&&a.graphic.hide();a.dataLabel&&a.dataLabel.hide();a.connector&&a.connector.hide()});setTimeout(function(){a.points&& | ||
h(a.points,function(a,b){var e=b===(c&&c.pointIndex)?"show":"fadeIn",f=e==="show"?!0:void 0;if(a.graphic)a.graphic[e](f);if(a.dataLabel)a.dataLabel[e](f);if(a.connector)a.connector[e](f)})},Math.max(this.chart.options.drilldown.animation.duration-50,0));this.animate=t}};n.prototype.animateDrilldown=function(b){var a=this,c=this.chart.drilldownLevels,d,g=this.chart.options.drilldown.animation,e=this.xAxis;if(!b)h(c,function(b){if(a.options._ddSeriesId===b.lowerSeriesOptions._ddSeriesId)d=b.shapeArgs, | ||
d.fill=b.color}),d.x+=u(e.oldPos,e.pos)-e.pos,h(this.points,function(a){a.graphic&&a.graphic.attr(d).animate(l(a.shapeArgs,{fill:a.color}),g);a.dataLabel&&a.dataLabel.fadeIn(g)}),this.animate=null};n.prototype.animateDrillupFrom=function(b){var a=this.chart.options.drilldown.animation,c=this.group,d=this;h(d.trackerGroups,function(a){if(d[a])d[a].on("mouseover")});delete this.group;h(this.points,function(d){var e=d.graphic,i=function(){e.destroy();c&&(c=c.destroy())};e&&(delete d.graphic,a?e.animate(l(b.shapeArgs, | ||
{fill:b.color}),f.merge(a,{complete:i})):(e.attr(b.shapeArgs),i()))})};v&&l(v.prototype,{supportsDrilldown:!0,animateDrillupTo:n.prototype.animateDrillupTo,animateDrillupFrom:n.prototype.animateDrillupFrom,animateDrilldown:function(b){var a=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],c=this.chart.options.drilldown.animation,d=a.shapeArgs,g=d.start,e=(d.end-g)/this.points.length;if(!b)h(this.points,function(b,h){b.graphic.attr(f.merge(d,{start:g+h*e,end:g+(h+1)*e,fill:a.color}))[c? | ||
"animate":"attr"](l(b.shapeArgs,{fill:b.color}),c)}),this.animate=null}});f.Point.prototype.doDrilldown=function(b,a){var c=this.series.chart,d=c.options.drilldown,f=(d.series||[]).length,e;if(!c.ddDupes)c.ddDupes=[];for(;f--&&!e;)d.series[f].id===this.drilldown&&y(this.drilldown,c.ddDupes)===-1&&(e=d.series[f],c.ddDupes.push(this.drilldown));x(c,"drilldown",{point:this,seriesOptions:e,category:a,points:a!==void 0&&this.series.xAxis.ddPoints[a].slice(0)});e&&(b?c.addSingleSeriesAsDrilldown(this,e): | ||
c.addSeriesAsDrilldown(this,e))};f.Axis.prototype.drilldownCategory=function(b){var a,c,d=this.ddPoints[b];for(a in d)(c=d[a])&&c.series&&c.series.visible&&c.doDrilldown&&c.doDrilldown(!0,b);this.chart.applyDrilldown()};f.Axis.prototype.getDDPoints=function(b,a){var c=this.ddPoints;if(!c)this.ddPoints=c={};c[b]||(c[b]=[]);if(c[b].levelNumber!==a)c[b].length=0;return c[b]};w.prototype.drillable=function(){var b=this.pos,a=this.label,c=this.axis,d=c.ddPoints&&c.ddPoints[b];if(a&&d&&d.length){if(!a.basicStyles)a.basicStyles= | ||
f.merge(a.styles);a.addClass("highcharts-drilldown-axis-label").css(c.chart.options.drilldown.activeAxisLabelStyle).on("click",function(){c.drilldownCategory(b)})}else if(a&&a.basicStyles)a.styles={},a.css(a.basicStyles),a.on("click",null)};r(w.prototype,"addLabel",function(b){b.call(this);this.drillable()});r(f.Point.prototype,"init",function(b,a,c,d){var g=b.call(this,a,c,d),b=(c=a.xAxis)&&c.ticks[d],c=c&&c.getDDPoints(d,a.options._levelNumber);if(g.drilldown&&(f.addEvent(g,"click",function(){a.xAxis&& | ||
a.chart.options.drilldown.allowPointDrilldown===!1?a.xAxis.drilldownCategory(d):g.doDrilldown()}),c))c.push(g),c.levelNumber=a.options._levelNumber;b&&b.drillable();return g});r(f.Series.prototype,"drawDataLabels",function(b){var a=this.chart.options.drilldown.activeDataLabelStyle;b.call(this);h(this.points,function(b){b.drilldown&&b.dataLabel&&b.dataLabel.attr({"class":"highcharts-drilldown-data-label"}).css(a)})});var s,q=function(b){b.call(this);h(this.points,function(a){a.drilldown&&a.graphic&& | ||
a.graphic.attr({"class":"highcharts-drilldown-point"}).css({cursor:"pointer"})})};for(s in p)p[s].prototype.supportsDrilldown&&r(p[s].prototype,"drawTracker",q)})(Highcharts); | ||
(function(d){typeof module==="object"&&module.exports?module.exports=d:d(Highcharts)})(function(d){function A(b,a,c){var e;!a.rgba.length||!b.rgba.length?b=a.input||"none":(b=b.rgba,a=a.rgba,e=a[3]!==1||b[3]!==1,b=(e?"rgba(":"rgb(")+Math.round(a[0]+(b[0]-a[0])*(1-c))+","+Math.round(a[1]+(b[1]-a[1])*(1-c))+","+Math.round(a[2]+(b[2]-a[2])*(1-c))+(e?","+(a[3]+(b[3]-a[3])*(1-c)):"")+")");return b}var t=function(){},q=d.getOptions(),h=d.each,l=d.extend,B=d.format,u=d.pick,r=d.wrap,m=d.Chart,p=d.seriesTypes, | ||
v=p.pie,n=p.column,w=d.Tick,x=d.fireEvent,y=d.inArray,z=1;h(["fill","stroke"],function(b){d.addAnimSetter(b,function(a){a.elem.attr(b,A(d.Color(a.start),d.Color(a.end),a.pos))})});l(q.lang,{drillUpText:"\u25c1 Back to {series.name}"});q.drilldown={activeAxisLabelStyle:{cursor:"pointer",color:"#0d233a",fontWeight:"bold",textDecoration:"underline"},activeDataLabelStyle:{cursor:"pointer",color:"#0d233a",fontWeight:"bold",textDecoration:"underline"},animation:{duration:500},drillUpButton:{position:{align:"right", | ||
x:-10,y:10}}};d.SVGRenderer.prototype.Element.prototype.fadeIn=function(b){this.attr({opacity:0.1,visibility:"inherit"}).animate({opacity:u(this.newOpacity,1)},b||{duration:250})};m.prototype.addSeriesAsDrilldown=function(b,a){this.addSingleSeriesAsDrilldown(b,a);this.applyDrilldown()};m.prototype.addSingleSeriesAsDrilldown=function(b,a){var c=b.series,e=c.xAxis,g=c.yAxis,f;f=b.color||c.color;var i,d=[],j=[],k,o;if(!this.drilldownLevels)this.drilldownLevels=[];k=c.options._levelNumber||0;(o=this.drilldownLevels[this.drilldownLevels.length- | ||
1])&&o.levelNumber!==k&&(o=void 0);a=l({color:f,_ddSeriesId:z++},a);i=y(b,c.points);h(c.chart.series,function(a){if(a.xAxis===e&&!a.isDrilling)a.options._ddSeriesId=a.options._ddSeriesId||z++,a.options._colorIndex=a.userOptions._colorIndex,a.options._levelNumber=a.options._levelNumber||k,o?(d=o.levelSeries,j=o.levelSeriesOptions):(d.push(a),j.push(a.options))});f={levelNumber:k,seriesOptions:c.options,levelSeriesOptions:j,levelSeries:d,shapeArgs:b.shapeArgs,bBox:b.graphic?b.graphic.getBBox():{},color:f, | ||
lowerSeriesOptions:a,pointOptions:c.options.data[i],pointIndex:i,oldExtremes:{xMin:e&&e.userMin,xMax:e&&e.userMax,yMin:g&&g.userMin,yMax:g&&g.userMax}};this.drilldownLevels.push(f);f=f.lowerSeries=this.addSeries(a,!1);f.options._levelNumber=k+1;if(e)e.oldPos=e.pos,e.userMin=e.userMax=null,g.userMin=g.userMax=null;if(c.type===f.type)f.animate=f.animateDrilldown||t,f.options.animation=!0};m.prototype.applyDrilldown=function(){var b=this.drilldownLevels,a;if(b&&b.length>0)a=b[b.length-1].levelNumber, | ||
h(this.drilldownLevels,function(b){b.levelNumber===a&&h(b.levelSeries,function(b){b.options&&b.options._levelNumber===a&&b.remove(!1)})});this.redraw();this.showDrillUpButton()};m.prototype.getDrilldownBackText=function(){var b=this.drilldownLevels;if(b&&b.length>0)return b=b[b.length-1],b.series=b.seriesOptions,B(this.options.lang.drillUpText,b)};m.prototype.showDrillUpButton=function(){var b=this,a=this.getDrilldownBackText(),c=b.options.drilldown.drillUpButton,e,g;this.drillUpButton?this.drillUpButton.attr({text:a}).align(): | ||
(g=(e=c.theme)&&e.states,this.drillUpButton=this.renderer.button(a,null,null,function(){b.drillUp()},e,g&&g.hover,g&&g.select).attr({align:c.position.align,zIndex:9}).add().align(c.position,!1,c.relativeTo||"plotBox"))};m.prototype.drillUp=function(){for(var b=this,a=b.drilldownLevels,c=a[a.length-1].levelNumber,e=a.length,g=b.series,f,i,d,j,k=function(a){var c;h(g,function(b){b.options._ddSeriesId===a._ddSeriesId&&(c=b)});c=c||b.addSeries(a,!1);if(c.type===d.type&&c.animateDrillupTo)c.animate=c.animateDrillupTo; | ||
a===i.seriesOptions&&(j=c)};e--;)if(i=a[e],i.levelNumber===c){a.pop();d=i.lowerSeries;if(!d.chart)for(f=g.length;f--;)if(g[f].options.id===i.lowerSeriesOptions.id&&g[f].options._levelNumber===c+1){d=g[f];break}d.xData=[];h(i.levelSeriesOptions,k);x(b,"drillup",{seriesOptions:i.seriesOptions});if(j.type===d.type)j.drilldownLevel=i,j.options.animation=b.options.drilldown.animation,d.animateDrillupFrom&&d.chart&&d.animateDrillupFrom(i);j.options._levelNumber=c;d.remove(!1);if(j.xAxis)f=i.oldExtremes, | ||
j.xAxis.setExtremes(f.xMin,f.xMax,!1),j.yAxis.setExtremes(f.yMin,f.yMax,!1)}this.redraw();this.drilldownLevels.length===0?this.drillUpButton=this.drillUpButton.destroy():this.drillUpButton.attr({text:this.getDrilldownBackText()}).align();this.ddDupes.length=[]};n.prototype.supportsDrilldown=!0;n.prototype.animateDrillupTo=function(b){if(!b){var a=this,c=a.drilldownLevel;h(this.points,function(a){a.graphic&&a.graphic.hide();a.dataLabel&&a.dataLabel.hide();a.connector&&a.connector.hide()});setTimeout(function(){a.points&& | ||
h(a.points,function(a,b){var f=b===(c&&c.pointIndex)?"show":"fadeIn",d=f==="show"?!0:void 0;if(a.graphic)a.graphic[f](d);if(a.dataLabel)a.dataLabel[f](d);if(a.connector)a.connector[f](d)})},Math.max(this.chart.options.drilldown.animation.duration-50,0));this.animate=t}};n.prototype.animateDrilldown=function(b){var a=this,c=this.chart.drilldownLevels,e,d=this.chart.options.drilldown.animation,f=this.xAxis;if(!b)h(c,function(b){if(a.options._ddSeriesId===b.lowerSeriesOptions._ddSeriesId)e=b.shapeArgs, | ||
e.fill=b.color}),e.x+=u(f.oldPos,f.pos)-f.pos,h(this.points,function(a){a.graphic&&a.graphic.attr(e).animate(l(a.shapeArgs,{fill:a.color}),d);a.dataLabel&&a.dataLabel.fadeIn(d)}),this.animate=null};n.prototype.animateDrillupFrom=function(b){var a=this.chart.options.drilldown.animation,c=this.group,e=this;h(e.trackerGroups,function(a){if(e[a])e[a].on("mouseover")});delete this.group;h(this.points,function(e){var f=e.graphic,i=function(){f.destroy();c&&(c=c.destroy())};f&&(delete e.graphic,a?f.animate(l(b.shapeArgs, | ||
{fill:b.color}),d.merge(a,{complete:i})):(f.attr(b.shapeArgs),i()))})};v&&l(v.prototype,{supportsDrilldown:!0,animateDrillupTo:n.prototype.animateDrillupTo,animateDrillupFrom:n.prototype.animateDrillupFrom,animateDrilldown:function(b){var a=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],c=this.chart.options.drilldown.animation,e=a.shapeArgs,g=e.start,f=(e.end-g)/this.points.length;if(!b)h(this.points,function(b,h){b.graphic.attr(d.merge(e,{start:g+h*f,end:g+(h+1)*f,fill:a.color}))[c? | ||
"animate":"attr"](l(b.shapeArgs,{fill:b.color}),c)}),this.animate=null}});d.Point.prototype.doDrilldown=function(b,a){var c=this.series.chart,e=c.options.drilldown,d=(e.series||[]).length,f;if(!c.ddDupes)c.ddDupes=[];for(;d--&&!f;)e.series[d].id===this.drilldown&&y(this.drilldown,c.ddDupes)===-1&&(f=e.series[d],c.ddDupes.push(this.drilldown));x(c,"drilldown",{point:this,seriesOptions:f,category:a,points:a!==void 0&&this.series.xAxis.ddPoints[a].slice(0)});f&&(b?c.addSingleSeriesAsDrilldown(this,f): | ||
c.addSeriesAsDrilldown(this,f))};d.Axis.prototype.drilldownCategory=function(b){var a,c,d=this.ddPoints[b];for(a in d)(c=d[a])&&c.series&&c.series.visible&&c.doDrilldown&&c.doDrilldown(!0,b);this.chart.applyDrilldown()};d.Axis.prototype.getDDPoints=function(b,a){var c=this.ddPoints;if(!c)this.ddPoints=c={};c[b]||(c[b]=[]);if(c[b].levelNumber!==a)c[b].length=0;return c[b]};w.prototype.drillable=function(){var b=this.pos,a=this.label,c=this.axis,e=c.ddPoints&&c.ddPoints[b];if(a&&e&&e.length){if(!a.basicStyles)a.basicStyles= | ||
d.merge(a.styles);a.addClass("highcharts-drilldown-axis-label").css(c.chart.options.drilldown.activeAxisLabelStyle).on("click",function(){c.drilldownCategory(b)})}else if(a&&a.basicStyles)a.styles={},a.css(a.basicStyles),a.on("click",null)};r(w.prototype,"addLabel",function(b){b.call(this);this.drillable()});r(d.Point.prototype,"init",function(b,a,c,e){var g=b.call(this,a,c,e),b=(c=a.xAxis)&&c.ticks[e],c=c&&c.getDDPoints(e,a.options._levelNumber);if(g.drilldown&&(d.addEvent(g,"click",function(){a.xAxis&& | ||
a.chart.options.drilldown.allowPointDrilldown===!1?a.xAxis.drilldownCategory(e):g.doDrilldown()}),c))c.push(g),c.levelNumber=a.options._levelNumber;b&&b.drillable();return g});r(d.Series.prototype,"drawDataLabels",function(b){var a=this.chart.options.drilldown.activeDataLabelStyle;b.call(this);h(this.points,function(b){b.drilldown&&b.dataLabel&&b.dataLabel.attr({"class":"highcharts-drilldown-data-label"}).css(a)})});var s,q=function(b){b.call(this);h(this.points,function(a){a.drilldown&&a.graphic&& | ||
a.graphic.attr({"class":"highcharts-drilldown-point"}).css({cursor:"pointer"})})};for(s in p)p[s].prototype.supportsDrilldown&&r(p[s].prototype,"drawTracker",q)}); |
/** | ||
* Highcharts Drilldown plugin | ||
* Highcharts Drilldown module | ||
* | ||
* Author: Torstein Honsi | ||
* License: MIT License | ||
* License: www.highcharts.com/license | ||
* | ||
* Demo: http://jsfiddle.net/highcharts/Vf3yT/ | ||
*/ | ||
/*global Highcharts,HighchartsAdapter*/ | ||
(function (H) { | ||
(function (factory) { | ||
if (typeof module === 'object' && module.exports) { | ||
module.exports = factory; | ||
} else { | ||
factory(Highcharts); | ||
} | ||
}(function (H) { | ||
"use strict"; | ||
'use strict'; | ||
@@ -27,4 +31,4 @@ var noop = function () {}, | ||
Tick = H.Tick, | ||
fireEvent = HighchartsAdapter.fireEvent, | ||
inArray = HighchartsAdapter.inArray, | ||
fireEvent = H.fireEvent, | ||
inArray = H.inArray, | ||
ddSeriesId = 1; | ||
@@ -46,3 +50,3 @@ | ||
if (!to.rgba.length || !from.rgba.length) { | ||
ret = to.raw || 'none'; | ||
ret = to.input || 'none'; | ||
@@ -66,3 +70,3 @@ // Interpolate | ||
each(['fill', 'stroke'], function (prop) { | ||
HighchartsAdapter.addAnimSetter(prop, function (fx) { | ||
H.addAnimSetter(prop, function (fx) { | ||
fx.elem.attr(prop, tweenColors(H.Color(fx.start), H.Color(fx.end), fx.pos)); | ||
@@ -716,2 +720,2 @@ }); | ||
}(Highcharts)); | ||
})); |
/* | ||
Highmaps JS v1.1.9 (2015-10-07) | ||
Highmaps JS v1.1.10 (2015-12-07) | ||
Exporting module | ||
@@ -9,17 +9,17 @@ | ||
*/ | ||
(function(g){var z=g.Chart,s=g.addEvent,A=g.removeEvent,B=HighchartsAdapter.fireEvent,j=g.createElement,p=g.discardElement,u=g.css,l=g.merge,m=g.each,q=g.extend,E=g.splat,F=Math.max,k=document,C=window,G=g.isTouchDevice,H=g.Renderer.prototype.symbols,r=g.getOptions(),x;q(r.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});r.navigation= | ||
{menuStyle:{border:"1px solid #A0A0A0",background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:"none",color:"#303030",fontSize:G?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{symbolFill:"#E0E0E0",symbolSize:14,symbolStroke:"#666",symbolStrokeWidth:3,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,theme:{fill:"white",stroke:"none"},verticalAlign:"top",width:24}};r.exporting={type:"image/png",url:"http://export.highcharts.com/", | ||
buttons:{contextButton:{menuClassName:"highcharts-contextmenu",symbol:"menu",_titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}}; | ||
g.post=function(b,a,e){var c,b=j("form",l({method:"post",action:b,enctype:"multipart/form-data"},e),{display:"none"},k.body);for(c in a)j("input",{type:"hidden",name:c,value:a[c]},null,b);b.submit();p(b)};q(z.prototype,{sanitizeSVG:function(b){return b.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ (NS[0-9]+\:)?href=/g, | ||
(function(f){typeof module==="object"&&module.exports?module.exports=f:f(Highcharts)})(function(f){var z=f.Chart,t=f.addEvent,A=f.removeEvent,B=f.fireEvent,n=f.createElement,r=f.discardElement,v=f.css,l=f.merge,i=f.each,q=f.extend,E=f.splat,F=Math.max,m=document,C=window,G=f.isTouchDevice,H=f.Renderer.prototype.symbols,s=f.getOptions(),y;q(s.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image", | ||
contextButtonTitle:"Chart context menu"});s.navigation={menuStyle:{border:"1px solid #A0A0A0",background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:"none",color:"#303030",fontSize:G?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{symbolFill:"#E0E0E0",symbolSize:14,symbolStroke:"#666",symbolStrokeWidth:3,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,theme:{fill:"white",stroke:"none"},verticalAlign:"top",width:24}}; | ||
s.exporting={type:"image/png",url:"http://export.highcharts.com/",buttons:{contextButton:{menuClassName:"highcharts-contextmenu",symbol:"menu",_titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG", | ||
onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};f.post=function(a,b,e){var c,a=n("form",l({method:"post",action:a,enctype:"multipart/form-data"},e),{display:"none"},m.body);for(c in b)n("input",{type:"hidden",name:c,value:b[c]},null,a);a.submit();r(a)};q(z.prototype,{sanitizeSVG:function(a){return a.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ (NS[0-9]+\:)?href=/g, | ||
" xlink:href=").replace(/\n/," ").replace(/<\/svg>.*?$/,"</svg>").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1="rgb($2)" $1-opacity="$3"').replace(/ /g,"\u00a0").replace(/­/g,"\u00ad").replace(/<IMG /g,"<image ").replace(/<(\/?)TITLE>/g,"<$1title>").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g,'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/ id=([^" >]+)/g,' id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g, | ||
" ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()})},getChartHTML:function(){return this.container.innerHTML},getSVG:function(b){var a=this,e,c,f,y,h,d=l(a.options,b),I=d.exporting.allowHTML;if(!k.createElementNS)k.createElementNS=function(a,b){return k.createElement(b)};c=j("div",null,{position:"absolute",top:"-9999em",width:a.chartWidth+"px",height:a.chartHeight+"px"},k.body);f=a.renderTo.style.width;h=a.renderTo.style.height;f=d.exporting.sourceWidth|| | ||
d.chart.width||/px$/.test(f)&&parseInt(f,10)||600;h=d.exporting.sourceHeight||d.chart.height||/px$/.test(h)&&parseInt(h,10)||400;q(d.chart,{animation:!1,renderTo:c,forExport:!0,renderer:"SVGRenderer",width:f,height:h});d.exporting.enabled=!1;delete d.data;d.series=[];m(a.series,function(a){y=l(a.options,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});y.isInternal||d.series.push(y)});b&&m(["xAxis","yAxis"],function(a){m(E(b[a]),function(b,c){d[a][c]=l(d[a][c],b)})});e=new g.Chart(d, | ||
a.callback);m(["xAxis","yAxis"],function(b){m(a[b],function(a,c){var d=e[b][c],f=a.getExtremes(),h=f.userMin,f=f.userMax;d&&(h!==void 0||f!==void 0)&&d.setExtremes(h,f,!0,!1)})});f=e.getChartHTML();d=null;e.destroy();p(c);if(I&&(c=f.match(/<\/svg>(.*?$)/)))c='<foreignObject x="0" y="0" width="200" height="200"><body xmlns="http://www.w3.org/1999/xhtml">'+c[1]+"</body></foreignObject>",f=f.replace("</svg>",c+"</svg>");f=this.sanitizeSVG(f);return f=f.replace(/(url\(#highcharts-[0-9]+)"/g,"$1").replace(/"/g, | ||
"'")},getSVGForExport:function(b,a){var e=this.options.exporting;return this.getSVG(l({chart:{borderRadius:0}},e.chartOptions,a,{exporting:{sourceWidth:b&&b.sourceWidth||e.sourceWidth,sourceHeight:b&&b.sourceHeight||e.sourceHeight}}))},exportChart:function(b,a){var e=this.getSVGForExport(b,a),b=l(this.options.exporting,b);g.post(b.url,{filename:b.filename||"chart",type:b.type,width:b.width||0,scale:b.scale||2,svg:e},b.formAttributes)},print:function(){var b=this,a=b.container,e=[],c=a.parentNode, | ||
f=k.body,g=f.childNodes;if(!b.isPrinting)b.isPrinting=!0,B(b,"beforePrint"),m(g,function(a,b){if(a.nodeType===1)e[b]=a.style.display,a.style.display="none"}),f.appendChild(a),C.focus(),C.print(),setTimeout(function(){c.appendChild(a);m(g,function(a,b){if(a.nodeType===1)a.style.display=e[b]});b.isPrinting=!1;B(b,"afterPrint")},1E3)},contextMenu:function(b,a,e,c,f,g,h){var d=this,l=d.options.navigation,D=l.menuItemStyle,n=d.chartWidth,o=d.chartHeight,k="cache-"+b,i=d[k],t=F(f,g),v,w,p,r=function(a){d.pointer.inClass(a.target, | ||
b)||w()};if(!i)d[k]=i=j("div",{className:b},{position:"absolute",zIndex:1E3,padding:t+"px"},d.container),v=j("div",null,q({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},l.menuStyle),i),w=function(){u(i,{display:"none"});h&&h.setState(0);d.openMenu=!1},s(i,"mouseleave",function(){p=setTimeout(w,500)}),s(i,"mouseenter",function(){clearTimeout(p)}),s(document,"mouseup",r),s(d,"destroy",function(){A(document,"mouseup",r)}),m(a,function(a){if(a){var b= | ||
a.separator?j("hr",null,null,v):j("div",{onmouseover:function(){u(this,l.menuItemHoverStyle)},onmouseout:function(){u(this,D)},onclick:function(b){b.stopPropagation();w();a.onclick&&a.onclick.apply(d,arguments)},innerHTML:a.text||d.options.lang[a.textKey]},q({cursor:"pointer"},D),v);d.exportDivElements.push(b)}}),d.exportDivElements.push(v,i),d.exportMenuWidth=i.offsetWidth,d.exportMenuHeight=i.offsetHeight;a={display:"block"};e+d.exportMenuWidth>n?a.right=n-e-f-t+"px":a.left=e-t+"px";c+g+d.exportMenuHeight> | ||
o&&h.alignOptions.verticalAlign!=="top"?a.bottom=o-c-t+"px":a.top=c+g-t+"px";u(i,a);d.openMenu=!0},addButton:function(b){var a=this,e=a.renderer,c=l(a.options.navigation.buttonOptions,b),f=c.onclick,k=c.menuItems,h,d,m={stroke:c.symbolStroke,fill:c.symbolFill},j=c.symbolSize||12;if(!a.btnCount)a.btnCount=0;if(!a.exportDivElements)a.exportDivElements=[],a.exportSVGElements=[];if(c.enabled!==!1){var n=c.theme,o=n.states,p=o&&o.hover,o=o&&o.select,i;delete n.states;f?i=function(b){b.stopPropagation(); | ||
f.call(a,b)}:k&&(i=function(){a.contextMenu(d.menuClassName,k,d.translateX,d.translateY,d.width,d.height,d);d.setState(2)});c.text&&c.symbol?n.paddingLeft=g.pick(n.paddingLeft,25):c.text||q(n,{width:c.width,height:c.height,padding:0});d=e.button(c.text,0,0,i,n,p,o).attr({title:a.options.lang[c._titleKey],"stroke-linecap":"round"});d.menuClassName=b.menuClassName||"highcharts-menu-"+a.btnCount++;c.symbol&&(h=e.symbol(c.symbol,c.symbolX-j/2,c.symbolY-j/2,j,j).attr(q(m,{"stroke-width":c.symbolStrokeWidth|| | ||
1,zIndex:1})).add(d));d.add().align(q(c,{width:d.width,x:g.pick(c.x,x)}),!0,"spacingBox");x+=(d.width+c.buttonSpacing)*(c.align==="right"?-1:1);a.exportSVGElements.push(d,h)}},destroyExport:function(b){var b=b.target,a,e;for(a=0;a<b.exportSVGElements.length;a++)if(e=b.exportSVGElements[a])e.onclick=e.ontouchstart=null,b.exportSVGElements[a]=e.destroy();for(a=0;a<b.exportDivElements.length;a++)e=b.exportDivElements[a],A(e,"mouseleave"),b.exportDivElements[a]=e.onmouseout=e.onmouseover=e.ontouchstart= | ||
e.onclick=null,p(e)}});H.menu=function(b,a,e,c){return["M",b,a+2.5,"L",b+e,a+2.5,"M",b,a+c/2+0.5,"L",b+e,a+c/2+0.5,"M",b,a+c-1.5,"L",b+e,a+c-1.5]};z.prototype.callbacks.push(function(b){var a,e=b.options.exporting,c=e.buttons;x=0;if(e.enabled!==!1){for(a in c)b.addButton(c[a]);s(b,"destroy",b.destroyExport)}})})(Highcharts); | ||
" ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(b){return b.toLowerCase()})},getChartHTML:function(){return this.container.innerHTML},getSVG:function(a){var b=this,e,c,g,j,k,d=l(b.options,a),I=d.exporting.allowHTML;if(!m.createElementNS)m.createElementNS=function(b,a){return m.createElement(a)};c=n("div",null,{position:"absolute",top:"-9999em",width:b.chartWidth+"px",height:b.chartHeight+"px"},m.body);g=b.renderTo.style.width;k=b.renderTo.style.height;g=d.exporting.sourceWidth|| | ||
d.chart.width||/px$/.test(g)&&parseInt(g,10)||600;k=d.exporting.sourceHeight||d.chart.height||/px$/.test(k)&&parseInt(k,10)||400;q(d.chart,{animation:!1,renderTo:c,forExport:!0,renderer:"SVGRenderer",width:g,height:k});d.exporting.enabled=!1;delete d.data;d.series=[];i(b.series,function(a){j=l(a.options,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});j.isInternal||d.series.push(j)});a&&i(["xAxis","yAxis"],function(b){i(E(a[b]),function(a,c){d[b][c]=l(d[b][c],a)})});e=new f.Chart(d, | ||
b.callback);i(["xAxis","yAxis"],function(a){i(b[a],function(b,c){var d=e[a][c],f=b.getExtremes(),g=f.userMin,f=f.userMax;d&&(g!==void 0||f!==void 0)&&d.setExtremes(g,f,!0,!1)})});g=e.getChartHTML();d=null;e.destroy();r(c);if(I&&(c=g.match(/<\/svg>(.*?$)/)))c='<foreignObject x="0" y="0" width="200" height="200"><body xmlns="http://www.w3.org/1999/xhtml">'+c[1]+"</body></foreignObject>",g=g.replace("</svg>",c+"</svg>");g=this.sanitizeSVG(g);return g=g.replace(/(url\(#highcharts-[0-9]+)"/g,"$1").replace(/"/g, | ||
"'")},getSVGForExport:function(a,b){var e=this.options.exporting;return this.getSVG(l({chart:{borderRadius:0}},e.chartOptions,b,{exporting:{sourceWidth:a&&a.sourceWidth||e.sourceWidth,sourceHeight:a&&a.sourceHeight||e.sourceHeight}}))},exportChart:function(a,b){var e=this.getSVGForExport(a,b),a=l(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale||2,svg:e},a.formAttributes)},print:function(){var a=this,b=a.container,e=[],c=b.parentNode, | ||
f=m.body,j=f.childNodes;if(!a.isPrinting)a.isPrinting=!0,a.pointer.reset(null,0),B(a,"beforePrint"),i(j,function(a,b){if(a.nodeType===1)e[b]=a.style.display,a.style.display="none"}),f.appendChild(b),C.focus(),C.print(),setTimeout(function(){c.appendChild(b);i(j,function(a,b){if(a.nodeType===1)a.style.display=e[b]});a.isPrinting=!1;B(a,"afterPrint")},1E3)},contextMenu:function(a,b,e,c,f,j,k){var d=this,l=d.options.navigation,D=l.menuItemStyle,o=d.chartWidth,p=d.chartHeight,m="cache-"+a,h=d[m],u=F(f, | ||
j),w,x,r,s=function(b){d.pointer.inClass(b.target,a)||x()};if(!h)d[m]=h=n("div",{className:a},{position:"absolute",zIndex:1E3,padding:u+"px"},d.container),w=n("div",null,q({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},l.menuStyle),h),x=function(){v(h,{display:"none"});k&&k.setState(0);d.openMenu=!1},t(h,"mouseleave",function(){r=setTimeout(x,500)}),t(h,"mouseenter",function(){clearTimeout(r)}),t(document,"mouseup",s),t(d,"destroy",function(){A(document, | ||
"mouseup",s)}),i(b,function(a){if(a){var b=a.separator?n("hr",null,null,w):n("div",{onmouseover:function(){v(this,l.menuItemHoverStyle)},onmouseout:function(){v(this,D)},onclick:function(b){b&&b.stopPropagation();x();a.onclick&&a.onclick.apply(d,arguments)},innerHTML:a.text||d.options.lang[a.textKey]},q({cursor:"pointer"},D),w);d.exportDivElements.push(b)}}),d.exportDivElements.push(w,h),d.exportMenuWidth=h.offsetWidth,d.exportMenuHeight=h.offsetHeight;b={display:"block"};e+d.exportMenuWidth>o?b.right= | ||
o-e-f-u+"px":b.left=e-u+"px";c+j+d.exportMenuHeight>p&&k.alignOptions.verticalAlign!=="top"?b.bottom=p-c-u+"px":b.top=c+j-u+"px";v(h,b);d.openMenu=!0},addButton:function(a){var b=this,e=b.renderer,c=l(b.options.navigation.buttonOptions,a),g=c.onclick,j=c.menuItems,k,d,m={stroke:c.symbolStroke,fill:c.symbolFill},i=c.symbolSize||12;if(!b.btnCount)b.btnCount=0;if(!b.exportDivElements)b.exportDivElements=[],b.exportSVGElements=[];if(c.enabled!==!1){var o=c.theme,p=o.states,n=p&&p.hover,p=p&&p.select, | ||
h;delete o.states;g?h=function(a){a.stopPropagation();g.call(b,a)}:j&&(h=function(){b.contextMenu(d.menuClassName,j,d.translateX,d.translateY,d.width,d.height,d);d.setState(2)});c.text&&c.symbol?o.paddingLeft=f.pick(o.paddingLeft,25):c.text||q(o,{width:c.width,height:c.height,padding:0});d=e.button(c.text,0,0,h,o,n,p).attr({title:b.options.lang[c._titleKey],"stroke-linecap":"round"});d.menuClassName=a.menuClassName||"highcharts-menu-"+b.btnCount++;c.symbol&&(k=e.symbol(c.symbol,c.symbolX-i/2,c.symbolY- | ||
i/2,i,i).attr(q(m,{"stroke-width":c.symbolStrokeWidth||1,zIndex:1})).add(d));d.add().align(q(c,{width:d.width,x:f.pick(c.x,y)}),!0,"spacingBox");y+=(d.width+c.buttonSpacing)*(c.align==="right"?-1:1);b.exportSVGElements.push(d,k)}},destroyExport:function(a){var a=a.target,b,e;for(b=0;b<a.exportSVGElements.length;b++)if(e=a.exportSVGElements[b])e.onclick=e.ontouchstart=null,a.exportSVGElements[b]=e.destroy();for(b=0;b<a.exportDivElements.length;b++)e=a.exportDivElements[b],A(e,"mouseleave"),a.exportDivElements[b]= | ||
e.onmouseout=e.onmouseover=e.ontouchstart=e.onclick=null,r(e)}});H.menu=function(a,b,e,c){return["M",a,b+2.5,"L",a+e,b+2.5,"M",a,b+c/2+0.5,"L",a+e,b+c/2+0.5,"M",a,b+c-1.5,"L",a+e,b+c-1.5]};z.prototype.callbacks.push(function(a){var b,e=a.options.exporting,c=e.buttons;y=0;if(e.enabled!==!1){for(b in c)a.addButton(c[b]);t(a,"destroy",a.destroyExport)}})}); |
/** | ||
* @license Highmaps JS v1.1.9 (2015-10-07) | ||
* @license Highmaps JS v1.1.10 (2015-12-07) | ||
* Exporting module | ||
@@ -10,7 +10,11 @@ * | ||
// JSLint options: | ||
/*global Highcharts, HighchartsAdapter, document, window, Math, setTimeout */ | ||
/* eslint indent:0 */ | ||
(function (factory) { | ||
if (typeof module === 'object' && module.exports) { | ||
module.exports = factory; | ||
} else { | ||
factory(Highcharts); | ||
} | ||
}(function (Highcharts) { | ||
(function (Highcharts) { // encapsulate | ||
// create shortcuts | ||
@@ -20,3 +24,3 @@ var Chart = Highcharts.Chart, | ||
removeEvent = Highcharts.removeEvent, | ||
fireEvent = HighchartsAdapter.fireEvent, | ||
fireEvent = Highcharts.fireEvent, | ||
createElement = Highcharts.createElement, | ||
@@ -262,3 +266,3 @@ discardElement = Highcharts.discardElement, | ||
options = merge(chart.options, additionalOptions), // copy the options and add extra options | ||
allowHTML = options.exporting.allowHTML; // docs: experimental, see #2473 | ||
allowHTML = options.exporting.allowHTML; | ||
@@ -268,7 +272,5 @@ | ||
if (!doc.createElementNS) { | ||
/*jslint unparam: true*//* allow unused parameter ns in function below */ | ||
doc.createElementNS = function (ns, tagName) { | ||
return doc.createElement(tagName); | ||
}; | ||
/*jslint unparam: false*/ | ||
} | ||
@@ -375,3 +377,3 @@ | ||
svg = svg.replace(/(url\(#highcharts-[0-9]+)"/g, '$1') | ||
.replace(/"/g, "'"); | ||
.replace(/"/g, '\''); | ||
@@ -437,2 +439,3 @@ return svg; | ||
chart.isPrinting = true; | ||
chart.pointer.reset(null, 0); | ||
@@ -564,3 +567,5 @@ fireEvent(chart, 'beforePrint'); | ||
onclick: function (e) { | ||
e.stopPropagation(); | ||
if (e) { // IE7 | ||
e.stopPropagation(); | ||
} | ||
hide(); | ||
@@ -782,2 +787,2 @@ if (item.onclick) { | ||
}(Highcharts)); | ||
})); |
/* | ||
Highmaps JS v1.1.9 (2015-10-07) | ||
Highcharts JS v4.1.10 (2015-12-07) | ||
@@ -8,17 +8,17 @@ (c) 2011-2014 Torstein Honsi | ||
*/ | ||
(function(h){var n=h.Axis,r=h.Chart,k=h.Color,y=h.Legend,t=h.LegendSymbolMixin,u=h.Series,z=h.Point,v=h.getOptions(),i=h.each,s=h.extend,w=h.extendClass,l=h.merge,m=h.pick,p=h.seriesTypes,x=h.wrap,o=function(){},q=h.ColorAxis=function(){this.isColorAxis=!0;this.init.apply(this,arguments)};s(q.prototype,n.prototype);s(q.prototype,{defaultColorAxisOptions:{lineWidth:0,minPadding:0,maxPadding:0,gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50}, | ||
color:"gray",width:0.01},labels:{overflow:"justify"},minColor:"#EFEFFF",maxColor:"#003875",tickLength:5},init:function(a,b){var c=a.options.legend.layout!=="vertical",e;e=l(this.defaultColorAxisOptions,{side:c?2:1,reversed:!c},b,{opposite:!c,showEmpty:!1,title:null,isColor:!0});n.prototype.init.call(this,a,e);b.dataClasses&&this.initDataClasses(b);this.initStops(b);this.horiz=c;this.zoomEnabled=!1},tweenColors:function(a,b,c){var e;!b.rgba.length||!a.rgba.length?a=b.raw||"none":(a=a.rgba,b=b.rgba, | ||
e=b[3]!==1||a[3]!==1,a=(e?"rgba(":"rgb(")+Math.round(b[0]+(a[0]-b[0])*(1-c))+","+Math.round(b[1]+(a[1]-b[1])*(1-c))+","+Math.round(b[2]+(a[2]-b[2])*(1-c))+(e?","+(b[3]+(a[3]-b[3])*(1-c)):"")+")");return a},initDataClasses:function(a){var b=this,c=this.chart,e,d=0,f=this.options,g=a.dataClasses.length;this.dataClasses=e=[];this.legendItems=[];i(a.dataClasses,function(a,h){var i,a=l(a);e.push(a);if(!a.color)f.dataClassColor==="category"?(i=c.options.colors,a.color=i[d++],d===i.length&&(d=0)):a.color= | ||
b.tweenColors(k(f.minColor),k(f.maxColor),g<2?0.5:h/(g-1))})},initStops:function(a){this.stops=a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];i(this.stops,function(a){a.color=k(a[1])})},setOptions:function(a){n.prototype.setOptions.call(this,a);this.options.crosshair=this.options.marker;this.coll="colorAxis"},setAxisSize:function(){var a=this.legendSymbol,b=this.chart,c,e,d;if(a)this.left=c=a.attr("x"),this.top=e=a.attr("y"),this.width=d=a.attr("width"),this.height=a=a.attr("height"), | ||
this.right=b.chartWidth-c-d,this.bottom=b.chartHeight-e-a,this.len=this.horiz?d:a,this.pos=this.horiz?c:e},toColor:function(a,b){var c,e=this.stops,d,f=this.dataClasses,g,j;if(f)for(j=f.length;j--;){if(g=f[j],d=g.from,e=g.to,(d===void 0||a>=d)&&(e===void 0||a<=e)){c=g.color;if(b)b.dataClass=j;break}}else{this.isLog&&(a=this.val2lin(a));c=1-(this.max-a)/(this.max-this.min||1);for(j=e.length;j--;)if(c>e[j][0])break;d=e[j]||e[j+1];e=e[j+1]||d;c=1-(e[0]-c)/(e[0]-d[0]||1);c=this.tweenColors(d.color,e.color, | ||
c)}return c},getOffset:function(){var a=this.legendGroup,b=this.chart.axisOffset[this.side];if(a){this.axisParent=a;n.prototype.getOffset.call(this);if(!this.added)this.added=!0,this.labelLeft=0,this.labelRight=this.width;this.chart.axisOffset[this.side]=b}},setLegendColor:function(){var a,b=this.options;a=this.reversed;a=this.horiz?[+a,0,+!a,0]:[0,+!a,0,+a];this.legendColor={linearGradient:{x1:a[0],y1:a[1],x2:a[2],y2:a[3]},stops:b.stops||[[0,b.minColor],[1,b.maxColor]]}},drawLegendSymbol:function(a, | ||
b){var c=a.padding,e=a.options,d=this.horiz,f=m(e.symbolWidth,d?200:12),g=m(e.symbolHeight,d?12:200),j=m(e.labelPadding,d?16:30),e=m(e.itemDistance,10);this.setLegendColor();b.legendSymbol=this.chart.renderer.rect(0,a.baseline-11,f,g).attr({zIndex:1}).add(b.legendGroup);b.legendSymbol.getBBox();this.legendItemWidth=f+c+(d?e:j);this.legendItemHeight=g+c+(d?j:0)},setState:o,visible:!0,setVisible:o,getSeriesExtremes:function(){var a;if(this.series.length)a=this.series[0],this.dataMin=a.valueMin,this.dataMax= | ||
a.valueMax},drawCrosshair:function(a,b){var c=b&&b.plotX,e=b&&b.plotY,d,f=this.pos,g=this.len;if(b)d=this.toPixels(b[b.series.colorKey]),d<f?d=f-2:d>f+g&&(d=f+g+2),b.plotX=d,b.plotY=this.len-d,n.prototype.drawCrosshair.call(this,a,b),b.plotX=c,b.plotY=e,this.cross&&this.cross.attr({fill:this.crosshair.color}).add(this.legendGroup)},getPlotLinePath:function(a,b,c,e,d){return typeof d==="number"?this.horiz?["M",d-4,this.top-6,"L",d+4,this.top-6,d,this.top,"Z"]:["M",this.left,d,"L",this.left-6,d+6,this.left- | ||
6,d-6,"Z"]:n.prototype.getPlotLinePath.call(this,a,b,c,e)},update:function(a,b){var c=this.chart,e=c.legend;i(this.series,function(a){a.isDirtyData=!0});if(a.dataClasses&&e.allItems)i(e.allItems,function(a){a.isDataClass&&a.legendGroup.destroy()}),c.isDirtyLegend=!0;c.options[this.coll]=l(this.userOptions,a);n.prototype.update.call(this,a,b);this.legendItem&&(this.setLegendColor(),e.colorizeItem(this,!0))},getDataClassLegendSymbols:function(){var a=this,b=this.chart,c=this.legendItems,e=b.options.legend, | ||
d=e.valueDecimals,f=e.valueSuffix||"",g;c.length||i(this.dataClasses,function(e,n){var k=!0,l=e.from,m=e.to;g="";l===void 0?g="< ":m===void 0&&(g="> ");l!==void 0&&(g+=h.numberFormat(l,d)+f);l!==void 0&&m!==void 0&&(g+=" - ");m!==void 0&&(g+=h.numberFormat(m,d)+f);c.push(s({chart:b,name:g,options:{},drawLegendSymbol:t.drawRectangle,visible:!0,setState:o,isDataClass:!0,setVisible:function(){k=this.visible=!k;i(a.series,function(a){i(a.points,function(a){a.dataClass===n&&a.setVisible(k)})});b.legend.colorizeItem(this, | ||
k)}},e))});return c},name:""});i(["fill","stroke"],function(a){HighchartsAdapter.addAnimSetter(a,function(b){b.elem.attr(a,q.prototype.tweenColors(k(b.start),k(b.end),b.pos))})});x(r.prototype,"getAxes",function(a){var b=this.options.colorAxis;a.call(this);this.colorAxis=[];b&&new q(this,b)});x(y.prototype,"getAllItems",function(a){var b=[],c=this.chart.colorAxis[0];c&&(c.options.dataClasses?b=b.concat(c.getDataClassLegendSymbols()):b.push(c),i(c.series,function(a){a.options.showInLegend=!1}));return b.concat(a.call(this))}); | ||
r={pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",dashstyle:"dashStyle"},pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],optionalAxis:"colorAxis",trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:o,parallelArrays:["x","y","value"],colorKey:"value",translateColors:function(){var a=this,b=this.options.nullColor,c=this.colorAxis,e=this.colorKey;i(this.data,function(d){var f=d[e];if(f=d.options.color||(f===null?b:c&&f!==void 0?c.toColor(f, | ||
d):d.color||a.color))d.color=f})}};v.plotOptions.heatmap=l(v.plotOptions.scatter,{animation:!1,borderWidth:0,nullColor:"#F8F8F8",dataLabels:{formatter:function(){return this.point.value},inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},marker:null,pointRange:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{normal:{animation:!0},hover:{halo:!1,brightness:0.2}}});p.heatmap=w(p.scatter,l(r,{type:"heatmap",pointArrayMap:["y","value"],hasPointSpecificOptions:!0, | ||
pointClass:w(z,{setVisible:function(a){var b=this,c=a?"show":"hide";i(["graphic","dataLabel"],function(a){if(b[a])b[a][c]()})}}),supportsDrilldown:!0,getExtremesFromAll:!0,directTouch:!0,init:function(){var a;p.scatter.prototype.init.apply(this,arguments);a=this.options;this.pointRange=a.pointRange=m(a.pointRange,a.colsize||1);this.yAxis.axisPointRange=a.rowsize||1},translate:function(){var a=this.options,b=this.xAxis,c=this.yAxis,e=function(a,b,c){return Math.min(Math.max(b,a),c)};this.generatePoints(); | ||
i(this.points,function(d){var f=(a.colsize||1)/2,g=(a.rowsize||1)/2,h=e(Math.round(b.len-b.translate(d.x-f,0,1,0,1)),0,b.len),f=e(Math.round(b.len-b.translate(d.x+f,0,1,0,1)),0,b.len),i=e(Math.round(c.translate(d.y-g,0,1,0,1)),0,c.len),g=e(Math.round(c.translate(d.y+g,0,1,0,1)),0,c.len);d.plotX=d.clientX=(h+f)/2;d.plotY=(i+g)/2;d.shapeType="rect";d.shapeArgs={x:Math.min(h,f),y:Math.min(i,g),width:Math.abs(f-h),height:Math.abs(g-i)}});this.translateColors();this.chart.hasRendered&&i(this.points,function(a){a.shapeArgs.fill= | ||
a.options.color||a.color})},drawPoints:p.column.prototype.drawPoints,animate:o,getBox:o,drawLegendSymbol:t.drawRectangle,getExtremes:function(){u.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;u.prototype.getExtremes.call(this)}}))})(Highcharts); | ||
(function(d){typeof module==="object"&&module.exports?module.exports=d:d(Highcharts)})(function(d){var m=d.Axis,q=d.Chart,i=d.Color,x=d.Legend,s=d.LegendSymbolMixin,t=d.Series,y=d.Point,u=d.getOptions(),h=d.each,r=d.extend,v=d.extendClass,j=d.merge,k=d.pick,o=d.seriesTypes,w=d.wrap,n=function(){},p=d.ColorAxis=function(){this.isColorAxis=!0;this.init.apply(this,arguments)};r(p.prototype,m.prototype);r(p.prototype,{defaultColorAxisOptions:{lineWidth:0,minPadding:0,maxPadding:0,gridLineWidth:1,tickPixelInterval:72, | ||
startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},color:"gray",width:0.01},labels:{overflow:"justify"},minColor:"#EFEFFF",maxColor:"#003875",tickLength:5},init:function(a,b){var c=a.options.legend.layout!=="vertical",f;f=j(this.defaultColorAxisOptions,{side:c?2:1,reversed:!c},b,{opposite:!c,showEmpty:!1,title:null,isColor:!0});m.prototype.init.call(this,a,f);b.dataClasses&&this.initDataClasses(b);this.initStops(b);this.horiz=c;this.zoomEnabled=!1},tweenColors:function(a,b,c){var f; | ||
!b.rgba.length||!a.rgba.length?a=b.input||"none":(a=a.rgba,b=b.rgba,f=b[3]!==1||a[3]!==1,a=(f?"rgba(":"rgb(")+Math.round(b[0]+(a[0]-b[0])*(1-c))+","+Math.round(b[1]+(a[1]-b[1])*(1-c))+","+Math.round(b[2]+(a[2]-b[2])*(1-c))+(f?","+(b[3]+(a[3]-b[3])*(1-c)):"")+")");return a},initDataClasses:function(a){var b=this,c=this.chart,f,e=0,l=this.options,g=a.dataClasses.length;this.dataClasses=f=[];this.legendItems=[];h(a.dataClasses,function(a,d){var h,a=j(a);f.push(a);if(!a.color)l.dataClassColor==="category"? | ||
(h=c.options.colors,a.color=h[e++],e===h.length&&(e=0)):a.color=b.tweenColors(i(l.minColor),i(l.maxColor),g<2?0.5:d/(g-1))})},initStops:function(a){this.stops=a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];h(this.stops,function(a){a.color=i(a[1])})},setOptions:function(a){m.prototype.setOptions.call(this,a);this.options.crosshair=this.options.marker;this.coll="colorAxis"},setAxisSize:function(){var a=this.legendSymbol,b=this.chart,c,f,e;if(a)this.left=c=a.attr("x"),this.top=f=a.attr("y"), | ||
this.width=e=a.attr("width"),this.height=a=a.attr("height"),this.right=b.chartWidth-c-e,this.bottom=b.chartHeight-f-a,this.len=this.horiz?e:a,this.pos=this.horiz?c:f},toColor:function(a,b){var c,f=this.stops,e,l=this.dataClasses,g,d;if(l)for(d=l.length;d--;){if(g=l[d],e=g.from,f=g.to,(e===void 0||a>=e)&&(f===void 0||a<=f)){c=g.color;if(b)b.dataClass=d;break}}else{this.isLog&&(a=this.val2lin(a));c=1-(this.max-a)/(this.max-this.min||1);for(d=f.length;d--;)if(c>f[d][0])break;e=f[d]||f[d+1];f=f[d+1]|| | ||
e;c=1-(f[0]-c)/(f[0]-e[0]||1);c=this.tweenColors(e.color,f.color,c)}return c},getOffset:function(){var a=this.legendGroup,b=this.chart.axisOffset[this.side];if(a){this.axisParent=a;m.prototype.getOffset.call(this);if(!this.added)this.added=!0,this.labelLeft=0,this.labelRight=this.width;this.chart.axisOffset[this.side]=b}},setLegendColor:function(){var a,b=this.options,c=this.reversed;a=c?1:0;c=c?0:1;a=this.horiz?[a,0,c,0]:[0,c,0,a];this.legendColor={linearGradient:{x1:a[0],y1:a[1],x2:a[2],y2:a[3]}, | ||
stops:b.stops||[[0,b.minColor],[1,b.maxColor]]}},drawLegendSymbol:function(a,b){var c=a.padding,f=a.options,e=this.horiz,d=k(f.symbolWidth,e?200:12),g=k(f.symbolHeight,e?12:200),h=k(f.labelPadding,e?16:30),f=k(f.itemDistance,10);this.setLegendColor();b.legendSymbol=this.chart.renderer.rect(0,a.baseline-11,d,g).attr({zIndex:1}).add(b.legendGroup);this.legendItemWidth=d+c+(e?f:h);this.legendItemHeight=g+c+(e?h:0)},setState:n,visible:!0,setVisible:n,getSeriesExtremes:function(){var a;if(this.series.length)a= | ||
this.series[0],this.dataMin=a.valueMin,this.dataMax=a.valueMax},drawCrosshair:function(a,b){var c=b&&b.plotX,f=b&&b.plotY,e,d=this.pos,g=this.len;if(b)e=this.toPixels(b[b.series.colorKey]),e<d?e=d-2:e>d+g&&(e=d+g+2),b.plotX=e,b.plotY=this.len-e,m.prototype.drawCrosshair.call(this,a,b),b.plotX=c,b.plotY=f,this.cross&&this.cross.attr({fill:this.crosshair.color}).add(this.legendGroup)},getPlotLinePath:function(a,b,c,f,e){return typeof e==="number"?this.horiz?["M",e-4,this.top-6,"L",e+4,this.top-6,e, | ||
this.top,"Z"]:["M",this.left,e,"L",this.left-6,e+6,this.left-6,e-6,"Z"]:m.prototype.getPlotLinePath.call(this,a,b,c,f)},update:function(a,b){var c=this.chart,f=c.legend;h(this.series,function(a){a.isDirtyData=!0});if(a.dataClasses&&f.allItems)h(f.allItems,function(a){a.isDataClass&&a.legendGroup.destroy()}),c.isDirtyLegend=!0;c.options[this.coll]=j(this.userOptions,a);m.prototype.update.call(this,a,b);this.legendItem&&(this.setLegendColor(),f.colorizeItem(this,!0))},getDataClassLegendSymbols:function(){var a= | ||
this,b=this.chart,c=this.legendItems,f=b.options.legend,e=f.valueDecimals,l=f.valueSuffix||"",g;c.length||h(this.dataClasses,function(f,m){var i=!0,j=f.from,k=f.to;g="";j===void 0?g="< ":k===void 0&&(g="> ");j!==void 0&&(g+=d.numberFormat(j,e)+l);j!==void 0&&k!==void 0&&(g+=" - ");k!==void 0&&(g+=d.numberFormat(k,e)+l);c.push(r({chart:b,name:g,options:{},drawLegendSymbol:s.drawRectangle,visible:!0,setState:n,isDataClass:!0,setVisible:function(){i=this.visible=!i;h(a.series,function(a){h(a.points, | ||
function(a){a.dataClass===m&&a.setVisible(i)})});b.legend.colorizeItem(this,i)}},f))});return c},name:""});h(["fill","stroke"],function(a){d.addAnimSetter(a,function(b){b.elem.attr(a,p.prototype.tweenColors(i(b.start),i(b.end),b.pos))})});w(q.prototype,"getAxes",function(a){var b=this.options.colorAxis;a.call(this);this.colorAxis=[];b&&new p(this,b)});w(x.prototype,"getAllItems",function(a){var b=[],c=this.chart.colorAxis[0];c&&(c.options.dataClasses?b=b.concat(c.getDataClassLegendSymbols()):b.push(c), | ||
h(c.series,function(a){a.options.showInLegend=!1}));return b.concat(a.call(this))});q={pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",dashstyle:"dashStyle"},pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],optionalAxis:"colorAxis",trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:n,parallelArrays:["x","y","value"],colorKey:"value",translateColors:function(){var a=this,b=this.options.nullColor,c=this.colorAxis,f=this.colorKey;h(this.data, | ||
function(e){var d=e[f];if(d=e.options.color||(d===null?b:c&&d!==void 0?c.toColor(d,e):e.color||a.color))e.color=d})}};u.plotOptions.heatmap=j(u.plotOptions.scatter,{animation:!1,borderWidth:0,nullColor:"#F8F8F8",dataLabels:{formatter:function(){return this.point.value},inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},marker:null,pointRange:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{normal:{animation:!0},hover:{halo:!1,brightness:0.2}}});o.heatmap= | ||
v(o.scatter,j(q,{type:"heatmap",pointArrayMap:["y","value"],hasPointSpecificOptions:!0,pointClass:v(y,{setVisible:function(a){var b=this,c=a?"show":"hide";h(["graphic","dataLabel"],function(a){if(b[a])b[a][c]()})}}),supportsDrilldown:!0,getExtremesFromAll:!0,directTouch:!0,init:function(){var a;o.scatter.prototype.init.apply(this,arguments);a=this.options;a.pointRange=k(a.pointRange,a.colsize||1);this.yAxis.axisPointRange=a.rowsize||1},translate:function(){var a=this.options,b=this.xAxis,c=this.yAxis, | ||
f=function(a,b,c){return Math.min(Math.max(b,a),c)};this.generatePoints();h(this.points,function(e){var d=(a.colsize||1)/2,g=(a.rowsize||1)/2,h=f(Math.round(b.len-b.translate(e.x-d,0,1,0,1)),0,b.len),d=f(Math.round(b.len-b.translate(e.x+d,0,1,0,1)),0,b.len),i=f(Math.round(c.translate(e.y-g,0,1,0,1)),0,c.len),g=f(Math.round(c.translate(e.y+g,0,1,0,1)),0,c.len);e.plotX=e.clientX=(h+d)/2;e.plotY=(i+g)/2;e.shapeType="rect";e.shapeArgs={x:Math.min(h,d),y:Math.min(i,g),width:Math.abs(d-h),height:Math.abs(g- | ||
i)}});this.translateColors();this.chart.hasRendered&&h(this.points,function(a){a.shapeArgs.fill=a.options.color||a.color})},drawPoints:o.column.prototype.drawPoints,animate:n,getBox:n,drawLegendSymbol:s.drawRectangle,getExtremes:function(){t.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;t.prototype.getExtremes.call(this)}}))}); |
/** | ||
* @license Highmaps JS v1.1.9 (2015-10-07) | ||
* @license Highcharts JS v4.1.10 (2015-12-07) | ||
* | ||
@@ -8,699 +8,705 @@ * (c) 2011-2014 Torstein Honsi | ||
*/ | ||
/* eslint indent: [2, 4] */ | ||
(function (factory) { | ||
if (typeof module === 'object' && module.exports) { | ||
module.exports = factory; | ||
} else { | ||
factory(Highcharts); | ||
} | ||
}(function (Highcharts) { | ||
/*global HighchartsAdapter*/ | ||
(function (Highcharts) { | ||
var UNDEFINED, | ||
Axis = Highcharts.Axis, | ||
Chart = Highcharts.Chart, | ||
Color = Highcharts.Color, | ||
Legend = Highcharts.Legend, | ||
LegendSymbolMixin = Highcharts.LegendSymbolMixin, | ||
Series = Highcharts.Series, | ||
Point = Highcharts.Point, | ||
var UNDEFINED, | ||
Axis = Highcharts.Axis, | ||
Chart = Highcharts.Chart, | ||
Color = Highcharts.Color, | ||
Legend = Highcharts.Legend, | ||
LegendSymbolMixin = Highcharts.LegendSymbolMixin, | ||
Series = Highcharts.Series, | ||
Point = Highcharts.Point, | ||
defaultOptions = Highcharts.getOptions(), | ||
each = Highcharts.each, | ||
extend = Highcharts.extend, | ||
extendClass = Highcharts.extendClass, | ||
merge = Highcharts.merge, | ||
pick = Highcharts.pick, | ||
seriesTypes = Highcharts.seriesTypes, | ||
wrap = Highcharts.wrap, | ||
noop = function () {}; | ||
defaultOptions = Highcharts.getOptions(), | ||
each = Highcharts.each, | ||
extend = Highcharts.extend, | ||
extendClass = Highcharts.extendClass, | ||
merge = Highcharts.merge, | ||
pick = Highcharts.pick, | ||
seriesTypes = Highcharts.seriesTypes, | ||
wrap = Highcharts.wrap, | ||
noop = function () {}; | ||
/** | ||
* The ColorAxis object for inclusion in gradient legends | ||
*/ | ||
var ColorAxis = Highcharts.ColorAxis = function () { | ||
this.isColorAxis = true; | ||
this.init.apply(this, arguments); | ||
}; | ||
extend(ColorAxis.prototype, Axis.prototype); | ||
extend(ColorAxis.prototype, { | ||
defaultColorAxisOptions: { | ||
lineWidth: 0, | ||
minPadding: 0, | ||
maxPadding: 0, | ||
gridLineWidth: 1, | ||
tickPixelInterval: 72, | ||
startOnTick: true, | ||
endOnTick: true, | ||
offset: 0, | ||
marker: { | ||
animation: { | ||
duration: 50 | ||
}, | ||
color: 'gray', | ||
width: 0.01 | ||
}, | ||
labels: { | ||
overflow: 'justify' | ||
}, | ||
minColor: '#EFEFFF', | ||
maxColor: '#003875', | ||
tickLength: 5 | ||
}, | ||
init: function (chart, userOptions) { | ||
var horiz = chart.options.legend.layout !== 'vertical', | ||
options; | ||
/** | ||
* The ColorAxis object for inclusion in gradient legends | ||
*/ | ||
var ColorAxis = Highcharts.ColorAxis = function () { | ||
this.isColorAxis = true; | ||
this.init.apply(this, arguments); | ||
}; | ||
extend(ColorAxis.prototype, Axis.prototype); | ||
extend(ColorAxis.prototype, { | ||
defaultColorAxisOptions: { | ||
lineWidth: 0, | ||
minPadding: 0, | ||
maxPadding: 0, | ||
gridLineWidth: 1, | ||
tickPixelInterval: 72, | ||
startOnTick: true, | ||
endOnTick: true, | ||
offset: 0, | ||
marker: { | ||
animation: { | ||
duration: 50 | ||
}, | ||
color: 'gray', | ||
width: 0.01 | ||
}, | ||
labels: { | ||
overflow: 'justify' | ||
}, | ||
minColor: '#EFEFFF', | ||
maxColor: '#003875', | ||
tickLength: 5 | ||
}, | ||
init: function (chart, userOptions) { | ||
var horiz = chart.options.legend.layout !== 'vertical', | ||
options; | ||
// Build the options | ||
options = merge(this.defaultColorAxisOptions, { | ||
side: horiz ? 2 : 1, | ||
reversed: !horiz | ||
}, userOptions, { | ||
opposite: !horiz, | ||
showEmpty: false, | ||
title: null, | ||
isColor: true | ||
}); | ||
// Build the options | ||
options = merge(this.defaultColorAxisOptions, { | ||
side: horiz ? 2 : 1, | ||
reversed: !horiz | ||
}, userOptions, { | ||
opposite: !horiz, | ||
showEmpty: false, | ||
title: null, | ||
isColor: true | ||
}); | ||
Axis.prototype.init.call(this, chart, options); | ||
Axis.prototype.init.call(this, chart, options); | ||
// Base init() pushes it to the xAxis array, now pop it again | ||
//chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop(); | ||
// Base init() pushes it to the xAxis array, now pop it again | ||
//chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop(); | ||
// Prepare data classes | ||
if (userOptions.dataClasses) { | ||
this.initDataClasses(userOptions); | ||
} | ||
this.initStops(userOptions); | ||
// Prepare data classes | ||
if (userOptions.dataClasses) { | ||
this.initDataClasses(userOptions); | ||
} | ||
this.initStops(userOptions); | ||
// Override original axis properties | ||
this.horiz = horiz; | ||
this.zoomEnabled = false; | ||
}, | ||
// Override original axis properties | ||
this.horiz = horiz; | ||
this.zoomEnabled = false; | ||
}, | ||
/* | ||
* Return an intermediate color between two colors, according to pos where 0 | ||
* is the from color and 1 is the to color. | ||
* NOTE: Changes here should be copied | ||
* to the same function in drilldown.src.js and solid-gauge-src.js. | ||
*/ | ||
tweenColors: function (from, to, pos) { | ||
// Check for has alpha, because rgba colors perform worse due to lack of | ||
// support in WebKit. | ||
var hasAlpha, | ||
ret; | ||
/* | ||
* Return an intermediate color between two colors, according to pos where 0 | ||
* is the from color and 1 is the to color. | ||
* NOTE: Changes here should be copied | ||
* to the same function in drilldown.src.js and solid-gauge-src.js. | ||
*/ | ||
tweenColors: function (from, to, pos) { | ||
// Check for has alpha, because rgba colors perform worse due to lack of | ||
// support in WebKit. | ||
var hasAlpha, | ||
ret; | ||
// Unsupported color, return to-color (#3920) | ||
if (!to.rgba.length || !from.rgba.length) { | ||
ret = to.raw || 'none'; | ||
// Unsupported color, return to-color (#3920) | ||
if (!to.rgba.length || !from.rgba.length) { | ||
ret = to.input || 'none'; | ||
// Interpolate | ||
} else { | ||
from = from.rgba; | ||
to = to.rgba; | ||
hasAlpha = (to[3] !== 1 || from[3] !== 1); | ||
ret = (hasAlpha ? 'rgba(' : 'rgb(') + | ||
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' + | ||
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' + | ||
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) + | ||
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')'; | ||
} | ||
return ret; | ||
}, | ||
// Interpolate | ||
} else { | ||
from = from.rgba; | ||
to = to.rgba; | ||
hasAlpha = (to[3] !== 1 || from[3] !== 1); | ||
ret = (hasAlpha ? 'rgba(' : 'rgb(') + | ||
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' + | ||
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' + | ||
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) + | ||
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')'; | ||
} | ||
return ret; | ||
}, | ||
initDataClasses: function (userOptions) { | ||
var axis = this, | ||
chart = this.chart, | ||
dataClasses, | ||
colorCounter = 0, | ||
options = this.options, | ||
len = userOptions.dataClasses.length; | ||
this.dataClasses = dataClasses = []; | ||
this.legendItems = []; | ||
initDataClasses: function (userOptions) { | ||
var axis = this, | ||
chart = this.chart, | ||
dataClasses, | ||
colorCounter = 0, | ||
options = this.options, | ||
len = userOptions.dataClasses.length; | ||
this.dataClasses = dataClasses = []; | ||
this.legendItems = []; | ||
each(userOptions.dataClasses, function (dataClass, i) { | ||
var colors; | ||
each(userOptions.dataClasses, function (dataClass, i) { | ||
var colors; | ||
dataClass = merge(dataClass); | ||
dataClasses.push(dataClass); | ||
if (!dataClass.color) { | ||
if (options.dataClassColor === 'category') { | ||
colors = chart.options.colors; | ||
dataClass.color = colors[colorCounter++]; | ||
// loop back to zero | ||
if (colorCounter === colors.length) { | ||
colorCounter = 0; | ||
} | ||
} else { | ||
dataClass.color = axis.tweenColors( | ||
Color(options.minColor), | ||
Color(options.maxColor), | ||
len < 2 ? 0.5 : i / (len - 1) // #3219 | ||
); | ||
} | ||
} | ||
}); | ||
}, | ||
dataClass = merge(dataClass); | ||
dataClasses.push(dataClass); | ||
if (!dataClass.color) { | ||
if (options.dataClassColor === 'category') { | ||
colors = chart.options.colors; | ||
dataClass.color = colors[colorCounter++]; | ||
// loop back to zero | ||
if (colorCounter === colors.length) { | ||
colorCounter = 0; | ||
} | ||
} else { | ||
dataClass.color = axis.tweenColors( | ||
Color(options.minColor), | ||
Color(options.maxColor), | ||
len < 2 ? 0.5 : i / (len - 1) // #3219 | ||
); | ||
} | ||
} | ||
}); | ||
}, | ||
initStops: function (userOptions) { | ||
this.stops = userOptions.stops || [ | ||
[0, this.options.minColor], | ||
[1, this.options.maxColor] | ||
]; | ||
each(this.stops, function (stop) { | ||
stop.color = Color(stop[1]); | ||
}); | ||
}, | ||
initStops: function (userOptions) { | ||
this.stops = userOptions.stops || [ | ||
[0, this.options.minColor], | ||
[1, this.options.maxColor] | ||
]; | ||
each(this.stops, function (stop) { | ||
stop.color = Color(stop[1]); | ||
}); | ||
}, | ||
/** | ||
* Extend the setOptions method to process extreme colors and color | ||
* stops. | ||
*/ | ||
setOptions: function (userOptions) { | ||
Axis.prototype.setOptions.call(this, userOptions); | ||
/** | ||
* Extend the setOptions method to process extreme colors and color | ||
* stops. | ||
*/ | ||
setOptions: function (userOptions) { | ||
Axis.prototype.setOptions.call(this, userOptions); | ||
this.options.crosshair = this.options.marker; | ||
this.coll = 'colorAxis'; | ||
}, | ||
this.options.crosshair = this.options.marker; | ||
this.coll = 'colorAxis'; | ||
}, | ||
setAxisSize: function () { | ||
var symbol = this.legendSymbol, | ||
chart = this.chart, | ||
x, | ||
y, | ||
width, | ||
height; | ||
setAxisSize: function () { | ||
var symbol = this.legendSymbol, | ||
chart = this.chart, | ||
x, | ||
y, | ||
width, | ||
height; | ||
if (symbol) { | ||
this.left = x = symbol.attr('x'); | ||
this.top = y = symbol.attr('y'); | ||
this.width = width = symbol.attr('width'); | ||
this.height = height = symbol.attr('height'); | ||
this.right = chart.chartWidth - x - width; | ||
this.bottom = chart.chartHeight - y - height; | ||
if (symbol) { | ||
this.left = x = symbol.attr('x'); | ||
this.top = y = symbol.attr('y'); | ||
this.width = width = symbol.attr('width'); | ||
this.height = height = symbol.attr('height'); | ||
this.right = chart.chartWidth - x - width; | ||
this.bottom = chart.chartHeight - y - height; | ||
this.len = this.horiz ? width : height; | ||
this.pos = this.horiz ? x : y; | ||
} | ||
}, | ||
this.len = this.horiz ? width : height; | ||
this.pos = this.horiz ? x : y; | ||
} | ||
}, | ||
/** | ||
* Translate from a value to a color | ||
*/ | ||
toColor: function (value, point) { | ||
var pos, | ||
stops = this.stops, | ||
from, | ||
to, | ||
color, | ||
dataClasses = this.dataClasses, | ||
dataClass, | ||
i; | ||
/** | ||
* Translate from a value to a color | ||
*/ | ||
toColor: function (value, point) { | ||
var pos, | ||
stops = this.stops, | ||
from, | ||
to, | ||
color, | ||
dataClasses = this.dataClasses, | ||
dataClass, | ||
i; | ||
if (dataClasses) { | ||
i = dataClasses.length; | ||
while (i--) { | ||
dataClass = dataClasses[i]; | ||
from = dataClass.from; | ||
to = dataClass.to; | ||
if ((from === UNDEFINED || value >= from) && (to === UNDEFINED || value <= to)) { | ||
color = dataClass.color; | ||
if (point) { | ||
point.dataClass = i; | ||
} | ||
break; | ||
} | ||
} | ||
if (dataClasses) { | ||
i = dataClasses.length; | ||
while (i--) { | ||
dataClass = dataClasses[i]; | ||
from = dataClass.from; | ||
to = dataClass.to; | ||
if ((from === UNDEFINED || value >= from) && (to === UNDEFINED || value <= to)) { | ||
color = dataClass.color; | ||
if (point) { | ||
point.dataClass = i; | ||
} | ||
break; | ||
} | ||
} | ||
} else { | ||
} else { | ||
if (this.isLog) { | ||
value = this.val2lin(value); | ||
} | ||
pos = 1 - ((this.max - value) / ((this.max - this.min) || 1)); | ||
i = stops.length; | ||
while (i--) { | ||
if (pos > stops[i][0]) { | ||
break; | ||
} | ||
} | ||
from = stops[i] || stops[i + 1]; | ||
to = stops[i + 1] || from; | ||
if (this.isLog) { | ||
value = this.val2lin(value); | ||
} | ||
pos = 1 - ((this.max - value) / ((this.max - this.min) || 1)); | ||
i = stops.length; | ||
while (i--) { | ||
if (pos > stops[i][0]) { | ||
break; | ||
} | ||
} | ||
from = stops[i] || stops[i + 1]; | ||
to = stops[i + 1] || from; | ||
// The position within the gradient | ||
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1); | ||
// The position within the gradient | ||
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1); | ||
color = this.tweenColors( | ||
from.color, | ||
to.color, | ||
pos | ||
); | ||
} | ||
return color; | ||
}, | ||
color = this.tweenColors( | ||
from.color, | ||
to.color, | ||
pos | ||
); | ||
} | ||
return color; | ||
}, | ||
/** | ||
* Override the getOffset method to add the whole axis groups inside the legend. | ||
*/ | ||
getOffset: function () { | ||
var group = this.legendGroup, | ||
sideOffset = this.chart.axisOffset[this.side]; | ||
if (group) { | ||
/** | ||
* Override the getOffset method to add the whole axis groups inside the legend. | ||
*/ | ||
getOffset: function () { | ||
var group = this.legendGroup, | ||
sideOffset = this.chart.axisOffset[this.side]; | ||
// Hook for the getOffset method to add groups to this parent group | ||
this.axisParent = group; | ||
if (group) { | ||
// Call the base | ||
Axis.prototype.getOffset.call(this); | ||
// Hook for the getOffset method to add groups to this parent group | ||
this.axisParent = group; | ||
// First time only | ||
if (!this.added) { | ||
// Call the base | ||
Axis.prototype.getOffset.call(this); | ||
this.added = true; | ||
// First time only | ||
if (!this.added) { | ||
this.labelLeft = 0; | ||
this.labelRight = this.width; | ||
} | ||
// Reset it to avoid color axis reserving space | ||
this.chart.axisOffset[this.side] = sideOffset; | ||
} | ||
}, | ||
this.added = true; | ||
/** | ||
* Create the color gradient | ||
*/ | ||
setLegendColor: function () { | ||
var grad, | ||
horiz = this.horiz, | ||
options = this.options, | ||
reversed = this.reversed; | ||
this.labelLeft = 0; | ||
this.labelRight = this.width; | ||
} | ||
// Reset it to avoid color axis reserving space | ||
this.chart.axisOffset[this.side] = sideOffset; | ||
} | ||
}, | ||
grad = horiz ? [+reversed, 0, +!reversed, 0] : [0, +!reversed, 0, +reversed]; // #3190 | ||
this.legendColor = { | ||
linearGradient: { x1: grad[0], y1: grad[1], x2: grad[2], y2: grad[3] }, | ||
stops: options.stops || [ | ||
[0, options.minColor], | ||
[1, options.maxColor] | ||
] | ||
}; | ||
}, | ||
/** | ||
* Create the color gradient | ||
*/ | ||
setLegendColor: function () { | ||
var grad, | ||
horiz = this.horiz, | ||
options = this.options, | ||
reversed = this.reversed, | ||
one = reversed ? 1 : 0, | ||
zero = reversed ? 0 : 1; | ||
/** | ||
* The color axis appears inside the legend and has its own legend symbol | ||
*/ | ||
drawLegendSymbol: function (legend, item) { | ||
var padding = legend.padding, | ||
legendOptions = legend.options, | ||
horiz = this.horiz, | ||
box, | ||
width = pick(legendOptions.symbolWidth, horiz ? 200 : 12), | ||
height = pick(legendOptions.symbolHeight, horiz ? 12 : 200), | ||
labelPadding = pick(legendOptions.labelPadding, horiz ? 16 : 30), | ||
itemDistance = pick(legendOptions.itemDistance, 10); | ||
grad = horiz ? [one, 0, zero, 0] : [0, zero, 0, one]; // #3190 | ||
this.legendColor = { | ||
linearGradient: { x1: grad[0], y1: grad[1], x2: grad[2], y2: grad[3] }, | ||
stops: options.stops || [ | ||
[0, options.minColor], | ||
[1, options.maxColor] | ||
] | ||
}; | ||
}, | ||
this.setLegendColor(); | ||
/** | ||
* The color axis appears inside the legend and has its own legend symbol | ||
*/ | ||
drawLegendSymbol: function (legend, item) { | ||
var padding = legend.padding, | ||
legendOptions = legend.options, | ||
horiz = this.horiz, | ||
width = pick(legendOptions.symbolWidth, horiz ? 200 : 12), | ||
height = pick(legendOptions.symbolHeight, horiz ? 12 : 200), | ||
labelPadding = pick(legendOptions.labelPadding, horiz ? 16 : 30), | ||
itemDistance = pick(legendOptions.itemDistance, 10); | ||
// Create the gradient | ||
item.legendSymbol = this.chart.renderer.rect( | ||
0, | ||
legend.baseline - 11, | ||
width, | ||
height | ||
).attr({ | ||
zIndex: 1 | ||
}).add(item.legendGroup); | ||
box = item.legendSymbol.getBBox(); | ||
this.setLegendColor(); | ||
// Set how much space this legend item takes up | ||
this.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding); | ||
this.legendItemHeight = height + padding + (horiz ? labelPadding : 0); | ||
}, | ||
/** | ||
* Fool the legend | ||
*/ | ||
setState: noop, | ||
visible: true, | ||
setVisible: noop, | ||
getSeriesExtremes: function () { | ||
var series; | ||
if (this.series.length) { | ||
series = this.series[0]; | ||
this.dataMin = series.valueMin; | ||
this.dataMax = series.valueMax; | ||
} | ||
}, | ||
drawCrosshair: function (e, point) { | ||
var plotX = point && point.plotX, | ||
plotY = point && point.plotY, | ||
crossPos, | ||
axisPos = this.pos, | ||
axisLen = this.len; | ||
if (point) { | ||
crossPos = this.toPixels(point[point.series.colorKey]); | ||
if (crossPos < axisPos) { | ||
crossPos = axisPos - 2; | ||
} else if (crossPos > axisPos + axisLen) { | ||
crossPos = axisPos + axisLen + 2; | ||
} | ||
point.plotX = crossPos; | ||
point.plotY = this.len - crossPos; | ||
Axis.prototype.drawCrosshair.call(this, e, point); | ||
point.plotX = plotX; | ||
point.plotY = plotY; | ||
if (this.cross) { | ||
this.cross | ||
.attr({ | ||
fill: this.crosshair.color | ||
}) | ||
.add(this.legendGroup); | ||
} | ||
} | ||
}, | ||
getPlotLinePath: function (a, b, c, d, pos) { | ||
if (typeof pos === 'number') { // crosshairs only // #3969 pos can be 0 !! | ||
return this.horiz ? | ||
['M', pos - 4, this.top - 6, 'L', pos + 4, this.top - 6, pos, this.top, 'Z'] : | ||
['M', this.left, pos, 'L', this.left - 6, pos + 6, this.left - 6, pos - 6, 'Z']; | ||
} else { | ||
return Axis.prototype.getPlotLinePath.call(this, a, b, c, d); | ||
} | ||
}, | ||
// Create the gradient | ||
item.legendSymbol = this.chart.renderer.rect( | ||
0, | ||
legend.baseline - 11, | ||
width, | ||
height | ||
).attr({ | ||
zIndex: 1 | ||
}).add(item.legendGroup); | ||
update: function (newOptions, redraw) { | ||
var chart = this.chart, | ||
legend = chart.legend; | ||
// Set how much space this legend item takes up | ||
this.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding); | ||
this.legendItemHeight = height + padding + (horiz ? labelPadding : 0); | ||
}, | ||
/** | ||
* Fool the legend | ||
*/ | ||
setState: noop, | ||
visible: true, | ||
setVisible: noop, | ||
getSeriesExtremes: function () { | ||
var series; | ||
if (this.series.length) { | ||
series = this.series[0]; | ||
this.dataMin = series.valueMin; | ||
this.dataMax = series.valueMax; | ||
} | ||
}, | ||
drawCrosshair: function (e, point) { | ||
var plotX = point && point.plotX, | ||
plotY = point && point.plotY, | ||
crossPos, | ||
axisPos = this.pos, | ||
axisLen = this.len; | ||
each(this.series, function (series) { | ||
series.isDirtyData = true; // Needed for Axis.update when choropleth colors change | ||
}); | ||
if (point) { | ||
crossPos = this.toPixels(point[point.series.colorKey]); | ||
if (crossPos < axisPos) { | ||
crossPos = axisPos - 2; | ||
} else if (crossPos > axisPos + axisLen) { | ||
crossPos = axisPos + axisLen + 2; | ||
} | ||
// When updating data classes, destroy old items and make sure new ones are created (#3207) | ||
if (newOptions.dataClasses && legend.allItems) { | ||
each(legend.allItems, function (item) { | ||
if (item.isDataClass) { | ||
item.legendGroup.destroy(); | ||
} | ||
}); | ||
chart.isDirtyLegend = true; | ||
} | ||
point.plotX = crossPos; | ||
point.plotY = this.len - crossPos; | ||
Axis.prototype.drawCrosshair.call(this, e, point); | ||
point.plotX = plotX; | ||
point.plotY = plotY; | ||
// Keep the options structure updated for export. Unlike xAxis and yAxis, the colorAxis is | ||
// not an array. (#3207) | ||
chart.options[this.coll] = merge(this.userOptions, newOptions); | ||
if (this.cross) { | ||
this.cross | ||
.attr({ | ||
fill: this.crosshair.color | ||
}) | ||
.add(this.legendGroup); | ||
} | ||
} | ||
}, | ||
getPlotLinePath: function (a, b, c, d, pos) { | ||
return typeof pos === 'number' ? // crosshairs only // #3969 pos can be 0 !! | ||
(this.horiz ? | ||
['M', pos - 4, this.top - 6, 'L', pos + 4, this.top - 6, pos, this.top, 'Z'] : | ||
['M', this.left, pos, 'L', this.left - 6, pos + 6, this.left - 6, pos - 6, 'Z'] | ||
) : | ||
Axis.prototype.getPlotLinePath.call(this, a, b, c, d); | ||
}, | ||
Axis.prototype.update.call(this, newOptions, redraw); | ||
if (this.legendItem) { | ||
this.setLegendColor(); | ||
legend.colorizeItem(this, true); | ||
} | ||
}, | ||
update: function (newOptions, redraw) { | ||
var chart = this.chart, | ||
legend = chart.legend; | ||
/** | ||
* Get the legend item symbols for data classes | ||
*/ | ||
getDataClassLegendSymbols: function () { | ||
var axis = this, | ||
chart = this.chart, | ||
legendItems = this.legendItems, | ||
legendOptions = chart.options.legend, | ||
valueDecimals = legendOptions.valueDecimals, | ||
valueSuffix = legendOptions.valueSuffix || '', | ||
name; | ||
each(this.series, function (series) { | ||
series.isDirtyData = true; // Needed for Axis.update when choropleth colors change | ||
}); | ||
if (!legendItems.length) { | ||
each(this.dataClasses, function (dataClass, i) { | ||
var vis = true, | ||
from = dataClass.from, | ||
to = dataClass.to; | ||
// Assemble the default name. This can be overridden by legend.options.labelFormatter | ||
name = ''; | ||
if (from === UNDEFINED) { | ||
name = '< '; | ||
} else if (to === UNDEFINED) { | ||
name = '> '; | ||
} | ||
if (from !== UNDEFINED) { | ||
name += Highcharts.numberFormat(from, valueDecimals) + valueSuffix; | ||
} | ||
if (from !== UNDEFINED && to !== UNDEFINED) { | ||
name += ' - '; | ||
} | ||
if (to !== UNDEFINED) { | ||
name += Highcharts.numberFormat(to, valueDecimals) + valueSuffix; | ||
} | ||
// Add a mock object to the legend items | ||
legendItems.push(extend({ | ||
chart: chart, | ||
name: name, | ||
options: {}, | ||
drawLegendSymbol: LegendSymbolMixin.drawRectangle, | ||
visible: true, | ||
setState: noop, | ||
isDataClass: true, | ||
setVisible: function () { | ||
vis = this.visible = !vis; | ||
each(axis.series, function (series) { | ||
each(series.points, function (point) { | ||
if (point.dataClass === i) { | ||
point.setVisible(vis); | ||
} | ||
}); | ||
}); | ||
chart.legend.colorizeItem(this, vis); | ||
} | ||
}, dataClass)); | ||
}); | ||
} | ||
return legendItems; | ||
}, | ||
name: '' // Prevents 'undefined' in legend in IE8 | ||
}); | ||
// When updating data classes, destroy old items and make sure new ones are created (#3207) | ||
if (newOptions.dataClasses && legend.allItems) { | ||
each(legend.allItems, function (item) { | ||
if (item.isDataClass) { | ||
item.legendGroup.destroy(); | ||
} | ||
}); | ||
chart.isDirtyLegend = true; | ||
} | ||
/** | ||
* Handle animation of the color attributes directly | ||
*/ | ||
each(['fill', 'stroke'], function (prop) { | ||
HighchartsAdapter.addAnimSetter(prop, function (fx) { | ||
fx.elem.attr(prop, ColorAxis.prototype.tweenColors(Color(fx.start), Color(fx.end), fx.pos)); | ||
}); | ||
}); | ||
// Keep the options structure updated for export. Unlike xAxis and yAxis, the colorAxis is | ||
// not an array. (#3207) | ||
chart.options[this.coll] = merge(this.userOptions, newOptions); | ||
/** | ||
* Extend the chart getAxes method to also get the color axis | ||
*/ | ||
wrap(Chart.prototype, 'getAxes', function (proceed) { | ||
Axis.prototype.update.call(this, newOptions, redraw); | ||
if (this.legendItem) { | ||
this.setLegendColor(); | ||
legend.colorizeItem(this, true); | ||
} | ||
}, | ||
var options = this.options, | ||
colorAxisOptions = options.colorAxis; | ||
/** | ||
* Get the legend item symbols for data classes | ||
*/ | ||
getDataClassLegendSymbols: function () { | ||
var axis = this, | ||
chart = this.chart, | ||
legendItems = this.legendItems, | ||
legendOptions = chart.options.legend, | ||
valueDecimals = legendOptions.valueDecimals, | ||
valueSuffix = legendOptions.valueSuffix || '', | ||
name; | ||
proceed.call(this); | ||
if (!legendItems.length) { | ||
each(this.dataClasses, function (dataClass, i) { | ||
var vis = true, | ||
from = dataClass.from, | ||
to = dataClass.to; | ||
this.colorAxis = []; | ||
if (colorAxisOptions) { | ||
proceed = new ColorAxis(this, colorAxisOptions); // Fake assignment for jsLint | ||
} | ||
}); | ||
// Assemble the default name. This can be overridden by legend.options.labelFormatter | ||
name = ''; | ||
if (from === UNDEFINED) { | ||
name = '< '; | ||
} else if (to === UNDEFINED) { | ||
name = '> '; | ||
} | ||
if (from !== UNDEFINED) { | ||
name += Highcharts.numberFormat(from, valueDecimals) + valueSuffix; | ||
} | ||
if (from !== UNDEFINED && to !== UNDEFINED) { | ||
name += ' - '; | ||
} | ||
if (to !== UNDEFINED) { | ||
name += Highcharts.numberFormat(to, valueDecimals) + valueSuffix; | ||
} | ||
// Add a mock object to the legend items | ||
legendItems.push(extend({ | ||
chart: chart, | ||
name: name, | ||
options: {}, | ||
drawLegendSymbol: LegendSymbolMixin.drawRectangle, | ||
visible: true, | ||
setState: noop, | ||
isDataClass: true, | ||
setVisible: function () { | ||
vis = this.visible = !vis; | ||
each(axis.series, function (series) { | ||
each(series.points, function (point) { | ||
if (point.dataClass === i) { | ||
point.setVisible(vis); | ||
} | ||
}); | ||
}); | ||
/** | ||
* Wrap the legend getAllItems method to add the color axis. This also removes the | ||
* axis' own series to prevent them from showing up individually. | ||
*/ | ||
wrap(Legend.prototype, 'getAllItems', function (proceed) { | ||
var allItems = [], | ||
colorAxis = this.chart.colorAxis[0]; | ||
chart.legend.colorizeItem(this, vis); | ||
} | ||
}, dataClass)); | ||
}); | ||
} | ||
return legendItems; | ||
}, | ||
name: '' // Prevents 'undefined' in legend in IE8 | ||
}); | ||
if (colorAxis) { | ||
/** | ||
* Handle animation of the color attributes directly | ||
*/ | ||
each(['fill', 'stroke'], function (prop) { | ||
Highcharts.addAnimSetter(prop, function (fx) { | ||
fx.elem.attr(prop, ColorAxis.prototype.tweenColors(Color(fx.start), Color(fx.end), fx.pos)); | ||
}); | ||
}); | ||
// Data classes | ||
if (colorAxis.options.dataClasses) { | ||
allItems = allItems.concat(colorAxis.getDataClassLegendSymbols()); | ||
// Gradient legend | ||
} else { | ||
// Add this axis on top | ||
allItems.push(colorAxis); | ||
} | ||
/** | ||
* Extend the chart getAxes method to also get the color axis | ||
*/ | ||
wrap(Chart.prototype, 'getAxes', function (proceed) { | ||
// Don't add the color axis' series | ||
each(colorAxis.series, function (series) { | ||
series.options.showInLegend = false; | ||
}); | ||
} | ||
var options = this.options, | ||
colorAxisOptions = options.colorAxis; | ||
return allItems.concat(proceed.call(this)); | ||
});/** | ||
* Mixin for maps and heatmaps | ||
*/ | ||
var colorPointMixin = { | ||
/** | ||
* Set the visibility of a single point | ||
*/ | ||
setVisible: function (vis) { | ||
var point = this, | ||
method = vis ? 'show' : 'hide'; | ||
proceed.call(this); | ||
// Show and hide associated elements | ||
each(['graphic', 'dataLabel'], function (key) { | ||
if (point[key]) { | ||
point[key][method](); | ||
} | ||
}); | ||
} | ||
}; | ||
var colorSeriesMixin = { | ||
this.colorAxis = []; | ||
if (colorAxisOptions) { | ||
new ColorAxis(this, colorAxisOptions); // eslint-disable-line no-new | ||
} | ||
}); | ||
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options | ||
stroke: 'borderColor', | ||
'stroke-width': 'borderWidth', | ||
fill: 'color', | ||
dashstyle: 'dashStyle' | ||
}, | ||
pointArrayMap: ['value'], | ||
axisTypes: ['xAxis', 'yAxis', 'colorAxis'], | ||
optionalAxis: 'colorAxis', | ||
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'], | ||
getSymbol: noop, | ||
parallelArrays: ['x', 'y', 'value'], | ||
colorKey: 'value', | ||
/** | ||
* In choropleth maps, the color is a result of the value, so this needs translation too | ||
*/ | ||
translateColors: function () { | ||
var series = this, | ||
nullColor = this.options.nullColor, | ||
colorAxis = this.colorAxis, | ||
colorKey = this.colorKey; | ||
each(this.data, function (point) { | ||
var value = point[colorKey], | ||
color; | ||
/** | ||
* Wrap the legend getAllItems method to add the color axis. This also removes the | ||
* axis' own series to prevent them from showing up individually. | ||
*/ | ||
wrap(Legend.prototype, 'getAllItems', function (proceed) { | ||
var allItems = [], | ||
colorAxis = this.chart.colorAxis[0]; | ||
color = point.options.color || | ||
(value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color); | ||
if (colorAxis) { | ||
if (color) { | ||
point.color = color; | ||
} | ||
}); | ||
} | ||
}; | ||
/** | ||
* Extend the default options with map options | ||
*/ | ||
defaultOptions.plotOptions.heatmap = merge(defaultOptions.plotOptions.scatter, { | ||
animation: false, | ||
borderWidth: 0, | ||
nullColor: '#F8F8F8', | ||
dataLabels: { | ||
formatter: function () { // #2945 | ||
return this.point.value; | ||
}, | ||
inside: true, | ||
verticalAlign: 'middle', | ||
crop: false, | ||
overflow: false, | ||
padding: 0 // #3837 | ||
}, | ||
marker: null, | ||
pointRange: null, // dynamically set to colsize by default | ||
tooltip: { | ||
pointFormat: '{point.x}, {point.y}: {point.value}<br/>' | ||
}, | ||
states: { | ||
normal: { | ||
animation: true | ||
}, | ||
hover: { | ||
halo: false, // #3406, halo is not required on heatmaps | ||
brightness: 0.2 | ||
} | ||
} | ||
}); | ||
// Data classes | ||
if (colorAxis.options.dataClasses) { | ||
allItems = allItems.concat(colorAxis.getDataClassLegendSymbols()); | ||
// Gradient legend | ||
} else { | ||
// Add this axis on top | ||
allItems.push(colorAxis); | ||
} | ||
// The Heatmap series type | ||
seriesTypes.heatmap = extendClass(seriesTypes.scatter, merge(colorSeriesMixin, { | ||
type: 'heatmap', | ||
pointArrayMap: ['y', 'value'], | ||
hasPointSpecificOptions: true, | ||
pointClass: extendClass(Point, colorPointMixin), | ||
supportsDrilldown: true, | ||
getExtremesFromAll: true, | ||
directTouch: true, | ||
// Don't add the color axis' series | ||
each(colorAxis.series, function (series) { | ||
series.options.showInLegend = false; | ||
}); | ||
} | ||
/** | ||
* Override the init method to add point ranges on both axes. | ||
*/ | ||
init: function () { | ||
var options; | ||
seriesTypes.scatter.prototype.init.apply(this, arguments); | ||
return allItems.concat(proceed.call(this)); | ||
}); | ||
/** | ||
* Mixin for maps and heatmaps | ||
*/ | ||
var colorPointMixin = { | ||
/** | ||
* Set the visibility of a single point | ||
*/ | ||
setVisible: function (vis) { | ||
var point = this, | ||
method = vis ? 'show' : 'hide'; | ||
options = this.options; | ||
this.pointRange = options.pointRange = pick(options.pointRange, options.colsize || 1); // #3758, prevent resetting in setData | ||
this.yAxis.axisPointRange = options.rowsize || 1; // general point range | ||
}, | ||
translate: function () { | ||
var series = this, | ||
options = series.options, | ||
xAxis = series.xAxis, | ||
yAxis = series.yAxis, | ||
between = function (x, a, b) { | ||
return Math.min(Math.max(a, x), b); | ||
}; | ||
// Show and hide associated elements | ||
each(['graphic', 'dataLabel'], function (key) { | ||
if (point[key]) { | ||
point[key][method](); | ||
} | ||
}); | ||
} | ||
}; | ||
var colorSeriesMixin = { | ||
series.generatePoints(); | ||
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options | ||
stroke: 'borderColor', | ||
'stroke-width': 'borderWidth', | ||
fill: 'color', | ||
dashstyle: 'dashStyle' | ||
}, | ||
pointArrayMap: ['value'], | ||
axisTypes: ['xAxis', 'yAxis', 'colorAxis'], | ||
optionalAxis: 'colorAxis', | ||
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'], | ||
getSymbol: noop, | ||
parallelArrays: ['x', 'y', 'value'], | ||
colorKey: 'value', | ||
each(series.points, function (point) { | ||
var xPad = (options.colsize || 1) / 2, | ||
yPad = (options.rowsize || 1) / 2, | ||
x1 = between(Math.round(xAxis.len - xAxis.translate(point.x - xPad, 0, 1, 0, 1)), 0, xAxis.len), | ||
x2 = between(Math.round(xAxis.len - xAxis.translate(point.x + xPad, 0, 1, 0, 1)), 0, xAxis.len), | ||
y1 = between(Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)), 0, yAxis.len), | ||
y2 = between(Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1)), 0, yAxis.len); | ||
/** | ||
* In choropleth maps, the color is a result of the value, so this needs translation too | ||
*/ | ||
translateColors: function () { | ||
var series = this, | ||
nullColor = this.options.nullColor, | ||
colorAxis = this.colorAxis, | ||
colorKey = this.colorKey; | ||
// Set plotX and plotY for use in K-D-Tree and more | ||
point.plotX = point.clientX = (x1 + x2) / 2; | ||
point.plotY = (y1 + y2) / 2; | ||
each(this.data, function (point) { | ||
var value = point[colorKey], | ||
color; | ||
point.shapeType = 'rect'; | ||
point.shapeArgs = { | ||
x: Math.min(x1, x2), | ||
y: Math.min(y1, y2), | ||
width: Math.abs(x2 - x1), | ||
height: Math.abs(y2 - y1) | ||
}; | ||
}); | ||
series.translateColors(); | ||
color = point.options.color || | ||
(value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color); | ||
// Make sure colors are updated on colorAxis update (#2893) | ||
if (this.chart.hasRendered) { | ||
each(series.points, function (point) { | ||
point.shapeArgs.fill = point.options.color || point.color; // #3311 | ||
}); | ||
} | ||
}, | ||
drawPoints: seriesTypes.column.prototype.drawPoints, | ||
animate: noop, | ||
getBox: noop, | ||
drawLegendSymbol: LegendSymbolMixin.drawRectangle, | ||
if (color) { | ||
point.color = color; | ||
} | ||
}); | ||
} | ||
}; | ||
getExtremes: function () { | ||
// Get the extremes from the value data | ||
Series.prototype.getExtremes.call(this, this.valueData); | ||
this.valueMin = this.dataMin; | ||
this.valueMax = this.dataMax; | ||
/** | ||
* Extend the default options with map options | ||
*/ | ||
defaultOptions.plotOptions.heatmap = merge(defaultOptions.plotOptions.scatter, { | ||
animation: false, | ||
borderWidth: 0, | ||
nullColor: '#F8F8F8', | ||
dataLabels: { | ||
formatter: function () { // #2945 | ||
return this.point.value; | ||
}, | ||
inside: true, | ||
verticalAlign: 'middle', | ||
crop: false, | ||
overflow: false, | ||
padding: 0 // #3837 | ||
}, | ||
marker: null, | ||
pointRange: null, // dynamically set to colsize by default | ||
tooltip: { | ||
pointFormat: '{point.x}, {point.y}: {point.value}<br/>' | ||
}, | ||
states: { | ||
normal: { | ||
animation: true | ||
}, | ||
hover: { | ||
halo: false, // #3406, halo is not required on heatmaps | ||
brightness: 0.2 | ||
} | ||
} | ||
}); | ||
// Get the extremes from the y data | ||
Series.prototype.getExtremes.call(this); | ||
} | ||
})); | ||
// The Heatmap series type | ||
seriesTypes.heatmap = extendClass(seriesTypes.scatter, merge(colorSeriesMixin, { | ||
type: 'heatmap', | ||
pointArrayMap: ['y', 'value'], | ||
hasPointSpecificOptions: true, | ||
pointClass: extendClass(Point, colorPointMixin), | ||
supportsDrilldown: true, | ||
getExtremesFromAll: true, | ||
directTouch: true, | ||
/** | ||
* Override the init method to add point ranges on both axes. | ||
*/ | ||
init: function () { | ||
var options; | ||
seriesTypes.scatter.prototype.init.apply(this, arguments); | ||
}(Highcharts)); | ||
options = this.options; | ||
options.pointRange = pick(options.pointRange, options.colsize || 1); // #3758, prevent resetting in setData | ||
this.yAxis.axisPointRange = options.rowsize || 1; // general point range | ||
}, | ||
translate: function () { | ||
var series = this, | ||
options = series.options, | ||
xAxis = series.xAxis, | ||
yAxis = series.yAxis, | ||
between = function (x, a, b) { | ||
return Math.min(Math.max(a, x), b); | ||
}; | ||
series.generatePoints(); | ||
each(series.points, function (point) { | ||
var xPad = (options.colsize || 1) / 2, | ||
yPad = (options.rowsize || 1) / 2, | ||
x1 = between(Math.round(xAxis.len - xAxis.translate(point.x - xPad, 0, 1, 0, 1)), 0, xAxis.len), | ||
x2 = between(Math.round(xAxis.len - xAxis.translate(point.x + xPad, 0, 1, 0, 1)), 0, xAxis.len), | ||
y1 = between(Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)), 0, yAxis.len), | ||
y2 = between(Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1)), 0, yAxis.len); | ||
// Set plotX and plotY for use in K-D-Tree and more | ||
point.plotX = point.clientX = (x1 + x2) / 2; | ||
point.plotY = (y1 + y2) / 2; | ||
point.shapeType = 'rect'; | ||
point.shapeArgs = { | ||
x: Math.min(x1, x2), | ||
y: Math.min(y1, y2), | ||
width: Math.abs(x2 - x1), | ||
height: Math.abs(y2 - y1) | ||
}; | ||
}); | ||
series.translateColors(); | ||
// Make sure colors are updated on colorAxis update (#2893) | ||
if (this.chart.hasRendered) { | ||
each(series.points, function (point) { | ||
point.shapeArgs.fill = point.options.color || point.color; // #3311 | ||
}); | ||
} | ||
}, | ||
drawPoints: seriesTypes.column.prototype.drawPoints, | ||
animate: noop, | ||
getBox: noop, | ||
drawLegendSymbol: LegendSymbolMixin.drawRectangle, | ||
getExtremes: function () { | ||
// Get the extremes from the value data | ||
Series.prototype.getExtremes.call(this, this.valueData); | ||
this.valueMin = this.dataMin; | ||
this.valueMax = this.dataMax; | ||
// Get the extremes from the y data | ||
Series.prototype.getExtremes.call(this); | ||
} | ||
})); | ||
})); |
/* | ||
Highmaps JS v1.1.9 (2015-10-07) | ||
Highmaps JS v1.1.10 (2015-12-07) | ||
Highmaps as a plugin for Highcharts 4.1.x or Highstock 2.1.x (x being the patch version of this file) | ||
@@ -9,49 +9,50 @@ | ||
*/ | ||
(function(l){function J(a,b){var c,d,e,f,g=!1,h=a.x,i=a.y;for(c=0,d=b.length-1;c<b.length;d=c++)e=b[c][1]>i,f=b[d][1]>i,e!==f&&h<(b[d][0]-b[c][0])*(i-b[c][1])/(b[d][1]-b[c][1])+b[c][0]&&(g=!g);return g}function K(a,b,c,d,e,f,g,h){return["M",a+e,b,"L",a+c-f,b,"C",a+c-f/2,b,a+c,b+f/2,a+c,b+f,"L",a+c,b+d-g,"C",a+c,b+d-g/2,a+c-g/2,b+d,a+c-g,b+d,"L",a+h,b+d,"C",a+h/2,b+d,a,b+d-h/2,a,b+d-h,"L",a,b+e,"C",a,b+e/2,a+e/2,b,a+e,b,"Z"]}var p=l.Axis,s=l.Chart,x=l.Color,t=l.Point,F=l.Pointer,C=l.Legend,G=l.LegendSymbolMixin, | ||
O=l.Renderer,y=l.Series,H=l.SVGRenderer,L=l.VMLRenderer,I=l.addEvent,j=l.each,D=l.error,o=l.extend,u=l.extendClass,n=l.merge,k=l.pick,z=l.getOptions(),m=l.seriesTypes,w=z.plotOptions,v=l.wrap,q=function(){};v(p.prototype,"getSeriesExtremes",function(a){var b=this.isXAxis,c,d,e=[],f;b&&j(this.series,function(a,b){if(a.useMapGeometry)e[b]=a.xData,a.xData=[]});a.call(this);if(b&&(c=k(this.dataMin,Number.MAX_VALUE),d=k(this.dataMax,-Number.MAX_VALUE),j(this.series,function(a,b){if(a.useMapGeometry)c= | ||
Math.min(c,k(a.minX,c)),d=Math.max(d,k(a.maxX,c)),a.xData=e[b],f=!0}),f))this.dataMin=c,this.dataMax=d});v(p.prototype,"setAxisTranslation",function(a){var b=this.chart,c=b.plotWidth/b.plotHeight,b=b.xAxis[0],d;a.call(this);this.coll==="yAxis"&&b.transA!==void 0&&j(this.series,function(a){a.preserveAspectRatio&&(d=!0)});if(d&&(this.transA=b.transA=Math.min(this.transA,b.transA),a=c/((b.max-b.min)/(this.max-this.min)),a=a<1?this:b,c=(a.max-a.min)*a.transA,a.pixelPadding=a.len-c,a.minPixelPadding=a.pixelPadding/ | ||
2,c=a.fixTo)){c=c[1]-a.toValue(c[0],!0);c*=a.transA;if(Math.abs(c)>a.minPixelPadding||a.min===a.dataMin&&a.max===a.dataMax)c=0;a.minPixelPadding-=c}});v(p.prototype,"render",function(a){a.call(this);this.fixTo=null});var B=l.ColorAxis=function(){this.isColorAxis=!0;this.init.apply(this,arguments)};o(B.prototype,p.prototype);o(B.prototype,{defaultColorAxisOptions:{lineWidth:0,minPadding:0,maxPadding:0,gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50}, | ||
color:"gray",width:0.01},labels:{overflow:"justify"},minColor:"#EFEFFF",maxColor:"#003875",tickLength:5},init:function(a,b){var c=a.options.legend.layout!=="vertical",d;d=n(this.defaultColorAxisOptions,{side:c?2:1,reversed:!c},b,{opposite:!c,showEmpty:!1,title:null,isColor:!0});p.prototype.init.call(this,a,d);b.dataClasses&&this.initDataClasses(b);this.initStops(b);this.horiz=c;this.zoomEnabled=!1},tweenColors:function(a,b,c){var d;!b.rgba.length||!a.rgba.length?a=b.raw||"none":(a=a.rgba,b=b.rgba, | ||
d=b[3]!==1||a[3]!==1,a=(d?"rgba(":"rgb(")+Math.round(b[0]+(a[0]-b[0])*(1-c))+","+Math.round(b[1]+(a[1]-b[1])*(1-c))+","+Math.round(b[2]+(a[2]-b[2])*(1-c))+(d?","+(b[3]+(a[3]-b[3])*(1-c)):"")+")");return a},initDataClasses:function(a){var b=this,c=this.chart,d,e=0,f=this.options,g=a.dataClasses.length;this.dataClasses=d=[];this.legendItems=[];j(a.dataClasses,function(a,i){var r,a=n(a);d.push(a);if(!a.color)f.dataClassColor==="category"?(r=c.options.colors,a.color=r[e++],e===r.length&&(e=0)):a.color= | ||
b.tweenColors(x(f.minColor),x(f.maxColor),g<2?0.5:i/(g-1))})},initStops:function(a){this.stops=a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];j(this.stops,function(a){a.color=x(a[1])})},setOptions:function(a){p.prototype.setOptions.call(this,a);this.options.crosshair=this.options.marker;this.coll="colorAxis"},setAxisSize:function(){var a=this.legendSymbol,b=this.chart,c,d,e;if(a)this.left=c=a.attr("x"),this.top=d=a.attr("y"),this.width=e=a.attr("width"),this.height=a=a.attr("height"), | ||
this.right=b.chartWidth-c-e,this.bottom=b.chartHeight-d-a,this.len=this.horiz?e:a,this.pos=this.horiz?c:d},toColor:function(a,b){var c,d=this.stops,e,f=this.dataClasses,g,h;if(f)for(h=f.length;h--;){if(g=f[h],e=g.from,d=g.to,(e===void 0||a>=e)&&(d===void 0||a<=d)){c=g.color;if(b)b.dataClass=h;break}}else{this.isLog&&(a=this.val2lin(a));c=1-(this.max-a)/(this.max-this.min||1);for(h=d.length;h--;)if(c>d[h][0])break;e=d[h]||d[h+1];d=d[h+1]||e;c=1-(d[0]-c)/(d[0]-e[0]||1);c=this.tweenColors(e.color,d.color, | ||
c)}return c},getOffset:function(){var a=this.legendGroup,b=this.chart.axisOffset[this.side];if(a){this.axisParent=a;p.prototype.getOffset.call(this);if(!this.added)this.added=!0,this.labelLeft=0,this.labelRight=this.width;this.chart.axisOffset[this.side]=b}},setLegendColor:function(){var a,b=this.options;a=this.reversed;a=this.horiz?[+a,0,+!a,0]:[0,+!a,0,+a];this.legendColor={linearGradient:{x1:a[0],y1:a[1],x2:a[2],y2:a[3]},stops:b.stops||[[0,b.minColor],[1,b.maxColor]]}},drawLegendSymbol:function(a, | ||
b){var c=a.padding,d=a.options,e=this.horiz,f=k(d.symbolWidth,e?200:12),g=k(d.symbolHeight,e?12:200),h=k(d.labelPadding,e?16:30),d=k(d.itemDistance,10);this.setLegendColor();b.legendSymbol=this.chart.renderer.rect(0,a.baseline-11,f,g).attr({zIndex:1}).add(b.legendGroup);b.legendSymbol.getBBox();this.legendItemWidth=f+c+(e?d:h);this.legendItemHeight=g+c+(e?h:0)},setState:q,visible:!0,setVisible:q,getSeriesExtremes:function(){var a;if(this.series.length)a=this.series[0],this.dataMin=a.valueMin,this.dataMax= | ||
a.valueMax},drawCrosshair:function(a,b){var c=b&&b.plotX,d=b&&b.plotY,e,f=this.pos,g=this.len;if(b)e=this.toPixels(b[b.series.colorKey]),e<f?e=f-2:e>f+g&&(e=f+g+2),b.plotX=e,b.plotY=this.len-e,p.prototype.drawCrosshair.call(this,a,b),b.plotX=c,b.plotY=d,this.cross&&this.cross.attr({fill:this.crosshair.color}).add(this.legendGroup)},getPlotLinePath:function(a,b,c,d,e){return typeof e==="number"?this.horiz?["M",e-4,this.top-6,"L",e+4,this.top-6,e,this.top,"Z"]:["M",this.left,e,"L",this.left-6,e+6,this.left- | ||
6,e-6,"Z"]:p.prototype.getPlotLinePath.call(this,a,b,c,d)},update:function(a,b){var c=this.chart,d=c.legend;j(this.series,function(a){a.isDirtyData=!0});if(a.dataClasses&&d.allItems)j(d.allItems,function(a){a.isDataClass&&a.legendGroup.destroy()}),c.isDirtyLegend=!0;c.options[this.coll]=n(this.userOptions,a);p.prototype.update.call(this,a,b);this.legendItem&&(this.setLegendColor(),d.colorizeItem(this,!0))},getDataClassLegendSymbols:function(){var a=this,b=this.chart,c=this.legendItems,d=b.options.legend, | ||
e=d.valueDecimals,f=d.valueSuffix||"",g;c.length||j(this.dataClasses,function(d,i){var r=!0,A=d.from,k=d.to;g="";A===void 0?g="< ":k===void 0&&(g="> ");A!==void 0&&(g+=l.numberFormat(A,e)+f);A!==void 0&&k!==void 0&&(g+=" - ");k!==void 0&&(g+=l.numberFormat(k,e)+f);c.push(o({chart:b,name:g,options:{},drawLegendSymbol:G.drawRectangle,visible:!0,setState:q,isDataClass:!0,setVisible:function(){r=this.visible=!r;j(a.series,function(a){j(a.points,function(a){a.dataClass===i&&a.setVisible(r)})});b.legend.colorizeItem(this, | ||
r)}},d))});return c},name:""});j(["fill","stroke"],function(a){HighchartsAdapter.addAnimSetter(a,function(b){b.elem.attr(a,B.prototype.tweenColors(x(b.start),x(b.end),b.pos))})});v(s.prototype,"getAxes",function(a){var b=this.options.colorAxis;a.call(this);this.colorAxis=[];b&&new B(this,b)});v(C.prototype,"getAllItems",function(a){var b=[],c=this.chart.colorAxis[0];c&&(c.options.dataClasses?b=b.concat(c.getDataClassLegendSymbols()):b.push(c),j(c.series,function(a){a.options.showInLegend=!1}));return b.concat(a.call(this))}); | ||
var C={setVisible:function(a){var b=this,c=a?"show":"hide";j(["graphic","dataLabel"],function(a){if(b[a])b[a][c]()})}},M={pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",dashstyle:"dashStyle"},pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],optionalAxis:"colorAxis",trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:q,parallelArrays:["x","y","value"],colorKey:"value",translateColors:function(){var a=this,b=this.options.nullColor,c=this.colorAxis, | ||
d=this.colorKey;j(this.data,function(e){var f=e[d];if(f=e.options.color||(f===null?b:c&&f!==void 0?c.toColor(f,e):e.color||a.color))e.color=f})}};o(s.prototype,{renderMapNavigation:function(){var a=this,b=this.options.mapNavigation,c=b.buttons,d,e,f,g,h=function(a){if(a)a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},i=function(b){this.handler.call(a,b);h(b)};if(k(b.enableButtons,b.enabled)&&!a.renderer.forExport)for(d in c)if(c.hasOwnProperty(d))f=n(b.buttonOptions, | ||
c[d]),e=f.theme,e.style=n(f.theme.style,f.style),g=e.states,e=a.renderer.button(f.text,0,0,i,e,g&&g.hover,g&&g.select,0,d==="zoomIn"?"topbutton":"bottombutton").attr({width:f.width,height:f.height,title:a.options.lang[d],zIndex:5}).add(),e.handler=f.onclick,e.align(o(f,{width:e.width,height:2*e.height}),null,f.alignTo),I(e.element,"dblclick",h)},fitToBox:function(a,b){j([["x","width"],["y","height"]],function(c){var d=c[0],c=c[1];a[d]+a[c]>b[d]+b[c]&&(a[c]>b[c]?(a[c]=b[c],a[d]=b[d]):a[d]=b[d]+b[c]- | ||
a[c]);a[c]>b[c]&&(a[c]=b[c]);a[d]<b[d]&&(a[d]=b[d])});return a},mapZoom:function(a,b,c,d,e){var f=this.xAxis[0],g=f.max-f.min,h=k(b,f.min+g/2),i=g*a,g=this.yAxis[0],j=g.max-g.min,A=k(c,g.min+j/2);j*=a;h=this.fitToBox({x:h-i*(d?(d-f.pos)/f.len:0.5),y:A-j*(e?(e-g.pos)/g.len:0.5),width:i,height:j},{x:f.dataMin,y:g.dataMin,width:f.dataMax-f.dataMin,height:g.dataMax-g.dataMin});if(d)f.fixTo=[d-f.pos,b];if(e)g.fixTo=[e-g.pos,c];a!==void 0?(f.setExtremes(h.x,h.x+h.width,!1),g.setExtremes(h.y,h.y+h.height, | ||
!1)):(f.setExtremes(void 0,void 0,!1),g.setExtremes(void 0,void 0,!1));this.redraw()}});v(s.prototype,"render",function(a){var b=this,c=b.options.mapNavigation;b.renderMapNavigation();a.call(b);(k(c.enableDoubleClickZoom,c.enabled)||c.enableDoubleClickZoomTo)&&I(b.container,"dblclick",function(a){b.pointer.onContainerDblClick(a)});k(c.enableMouseWheelZoom,c.enabled)&&I(b.container,document.onmousewheel===void 0?"DOMMouseScroll":"mousewheel",function(a){b.pointer.onContainerMouseWheel(a);return!1})}); | ||
o(F.prototype,{onContainerDblClick:function(a){var b=this.chart,a=this.normalize(a);b.options.mapNavigation.enableDoubleClickZoomTo?b.pointer.inClass(a.target,"highcharts-tracker")&&b.hoverPoint.zoomTo():b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&b.mapZoom(0.5,b.xAxis[0].toValue(a.chartX),b.yAxis[0].toValue(a.chartY),a.chartX,a.chartY)},onContainerMouseWheel:function(a){var b=this.chart,c,a=this.normalize(a);c=a.detail||-(a.wheelDelta/120);b.isInsidePlot(a.chartX-b.plotLeft,a.chartY- | ||
b.plotTop)&&b.mapZoom(Math.pow(2,c),b.xAxis[0].toValue(a.chartX),b.yAxis[0].toValue(a.chartY),a.chartX,a.chartY)}});v(F.prototype,"init",function(a,b,c){a.call(this,b,c);if(k(c.mapNavigation.enableTouchZoom,c.mapNavigation.enabled))this.pinchX=this.pinchHor=this.pinchY=this.pinchVert=this.hasZoom=!0});v(F.prototype,"pinchTranslate",function(a,b,c,d,e,f,g){a.call(this,b,c,d,e,f,g);this.chart.options.chart.type==="map"&&this.hasZoom&&(a=d.scaleX>d.scaleY,this.pinchTranslateDirection(!a,b,c,d,e,f,g, | ||
a?d.scaleX:d.scaleY))});var E=document.documentElement.style.vectorEffect!==void 0;w.map=n(w.scatter,{allAreas:!0,animation:!1,nullColor:"#F8F8F8",borderColor:"silver",borderWidth:1,marker:null,stickyTracking:!1,dataLabels:{formatter:function(){return this.point.value},inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},turboThreshold:0,tooltip:{followPointer:!0,pointFormat:"{point.name}: {point.value}<br/>"},states:{normal:{animation:!0},hover:{brightness:0.2,halo:null}}});var N=u(t, | ||
o({applyOptions:function(a,b){var c=t.prototype.applyOptions.call(this,a,b),d=this.series,e=d.joinBy;if(d.mapData)if(e=c[e[1]]!==void 0&&d.mapMap[c[e[1]]]){if(d.xyFromShape)c.x=e._midX,c.y=e._midY;o(c,e)}else c.value=c.value||null;return c},onMouseOver:function(a){clearTimeout(this.colorInterval);if(this.value!==null)t.prototype.onMouseOver.call(this,a);else this.series.onMouseOut(a)},onMouseOut:function(){var a=this,b=+new Date,c=x(a.color),d=x(a.pointAttr.hover.fill),e=a.series.options.states.normal.animation, | ||
f=e&&(e.duration||500),g;if(f&&c.rgba.length===4&&d.rgba.length===4&&a.state!=="select")g=a.pointAttr[""].fill,delete a.pointAttr[""].fill,clearTimeout(a.colorInterval),a.colorInterval=setInterval(function(){var e=(new Date-b)/f,g=a.graphic;e>1&&(e=1);g&&g.attr("fill",B.prototype.tweenColors.call(0,d,c,e));e>=1&&clearTimeout(a.colorInterval)},13);t.prototype.onMouseOut.call(a);if(g)a.pointAttr[""].fill=g},zoomTo:function(){var a=this.series;a.xAxis.setExtremes(this._minX,this._maxX,!1);a.yAxis.setExtremes(this._minY, | ||
this._maxY,!1);a.chart.redraw()}},C));m.map=u(m.scatter,n(M,{type:"map",pointClass:N,supportsDrilldown:!0,getExtremesFromAll:!0,useMapGeometry:!0,forceDL:!0,searchPoint:q,directTouch:!0,preserveAspectRatio:!0,getBox:function(a){var b=Number.MAX_VALUE,c=-b,d=b,e=-b,f=b,g=b,h=this.xAxis,i=this.yAxis,r;j(a||[],function(a){if(a.path){if(typeof a.path==="string")a.path=l.splitPath(a.path);var h=a.path||[],i=h.length,j=!1,m=-b,n=b,o=-b,p=b,q=a.properties;if(!a._foundBox){for(;i--;)typeof h[i]==="number"&& | ||
!isNaN(h[i])&&(j?(m=Math.max(m,h[i]),n=Math.min(n,h[i])):(o=Math.max(o,h[i]),p=Math.min(p,h[i])),j=!j);a._midX=n+(m-n)*(a.middleX||q&&q["hc-middle-x"]||0.5);a._midY=p+(o-p)*(a.middleY||q&&q["hc-middle-y"]||0.5);a._maxX=m;a._minX=n;a._maxY=o;a._minY=p;a.labelrank=k(a.labelrank,(m-n)*(o-p));a._foundBox=!0}c=Math.max(c,a._maxX);d=Math.min(d,a._minX);e=Math.max(e,a._maxY);f=Math.min(f,a._minY);g=Math.min(a._maxX-a._minX,a._maxY-a._minY,g);r=!0}});if(r){this.minY=Math.min(f,k(this.minY,b));this.maxY=Math.max(e, | ||
k(this.maxY,-b));this.minX=Math.min(d,k(this.minX,b));this.maxX=Math.max(c,k(this.maxX,-b));if(h&&h.options.minRange===void 0)h.minRange=Math.min(5*g,(this.maxX-this.minX)/5,h.minRange||b);if(i&&i.options.minRange===void 0)i.minRange=Math.min(5*g,(this.maxY-this.minY)/5,i.minRange||b)}},getExtremes:function(){y.prototype.getExtremes.call(this,this.valueData);this.chart.hasRendered&&this.isDirtyData&&this.getBox(this.options.data);this.valueMin=this.dataMin;this.valueMax=this.dataMax;this.dataMin= | ||
this.minY;this.dataMax=this.maxY},translatePath:function(a){var b=!1,c=this.xAxis,d=this.yAxis,e=c.min,f=c.transA,c=c.minPixelPadding,g=d.min,h=d.transA,d=d.minPixelPadding,i,j=[];if(a)for(i=a.length;i--;)typeof a[i]==="number"?(j[i]=b?(a[i]-e)*f+c:(a[i]-g)*h+d,b=!b):j[i]=a[i];return j},setData:function(a,b){var c=this.options,d=c.mapData,e=c.joinBy,f=e===null,g=[],h,i,k;f&&(e="_i");e=this.joinBy=l.splat(e);e[1]||(e[1]=e[0]);a&&j(a,function(b,c){typeof b==="number"&&(a[c]={value:b});if(f)a[c]._i= | ||
c});this.getBox(a);if(d){if(d.type==="FeatureCollection"){if(d["hc-transform"])for(h in this.chart.mapTransforms=i=d["hc-transform"],i)if(i.hasOwnProperty(h)&&h.rotation)h.cosAngle=Math.cos(h.rotation),h.sinAngle=Math.sin(h.rotation);d=l.geojson(d,this.type,this)}this.getBox(d);this.mapData=d;this.mapMap={};for(k=0;k<d.length;k++)h=d[k],i=h.properties,h._i=k,e[0]&&i&&i[e[0]]&&(h[e[0]]=i[e[0]]),this.mapMap[h[e[0]]]=h;c.allAreas&&(a=a||[],e[1]&&j(a,function(a){g.push(a[e[1]])}),g="|"+g.join("|")+"|", | ||
j(d,function(b){(!e[0]||g.indexOf("|"+b[e[0]]+"|")===-1)&&a.push(n(b,{value:null}))}))}y.prototype.setData.call(this,a,b)},drawGraph:q,drawDataLabels:q,doFullTranslate:function(){return this.isDirtyData||this.chart.isResizing||this.chart.renderer.isVML||!this.baseTrans},translate:function(){var a=this,b=a.xAxis,c=a.yAxis,d=a.doFullTranslate();a.generatePoints();j(a.data,function(e){e.plotX=b.toPixels(e._midX,!0);e.plotY=c.toPixels(e._midY,!0);if(d)e.shapeType="path",e.shapeArgs={d:a.translatePath(e.path)}, | ||
E&&(e.shapeArgs["vector-effect"]="non-scaling-stroke")});a.translateColors()},drawPoints:function(){var a=this,b=a.xAxis,c=a.yAxis,d=a.group,e=a.chart,f=e.renderer,g,h=this.baseTrans;if(!a.transformGroup)a.transformGroup=f.g().attr({scaleX:1,scaleY:1}).add(d),a.transformGroup.survive=!0;a.doFullTranslate()?(e.hasRendered&&a.pointAttrToOptions.fill==="color"&&j(a.points,function(a){if(a.shapeArgs)a.shapeArgs.fill=a.pointAttr[k(a.state,"")].fill}),E||j(a.points,function(b){b=b.pointAttr[""];b["stroke-width"]=== | ||
a.pointAttr[""]["stroke-width"]&&(b["stroke-width"]="inherit")}),a.group=a.transformGroup,m.column.prototype.drawPoints.apply(a),a.group=d,j(a.points,function(a){a.graphic&&(a.name&&a.graphic.addClass("highcharts-name-"+a.name.replace(" ","-").toLowerCase()),a.properties&&a.properties["hc-key"]&&a.graphic.addClass("highcharts-key-"+a.properties["hc-key"].toLowerCase()),E||(a.graphic["stroke-widthSetter"]=q))}),this.baseTrans={originX:b.min-b.minPixelPadding/b.transA,originY:c.min-c.minPixelPadding/ | ||
c.transA+(c.reversed?0:c.len/c.transA),transAX:b.transA,transAY:c.transA},this.transformGroup.animate({translateX:0,translateY:0,scaleX:1,scaleY:1})):(g=b.transA/h.transAX,d=c.transA/h.transAY,b=b.toPixels(h.originX,!0),c=c.toPixels(h.originY,!0),g>0.99&&g<1.01&&d>0.99&&d<1.01&&(d=g=1,b=Math.round(b),c=Math.round(c)),this.transformGroup.animate({translateX:b,translateY:c,scaleX:g,scaleY:d}));E||a.group.element.setAttribute("stroke-width",a.options.borderWidth/(g||1));this.drawMapDataLabels()},drawMapDataLabels:function(){y.prototype.drawDataLabels.call(this); | ||
this.dataLabelsGroup&&this.dataLabelsGroup.clip(this.chart.clipRect)},render:function(){var a=this,b=y.prototype.render;a.chart.renderer.isVML&&a.data.length>3E3?setTimeout(function(){b.call(a)}):b.call(a)},animate:function(a){var b=this.options.animation,c=this.group,d=this.xAxis,e=this.yAxis,f=d.pos,g=e.pos;if(this.chart.renderer.isSVG)b===!0&&(b={duration:1E3}),a?c.attr({translateX:f+d.len/2,translateY:g+e.len/2,scaleX:0.001,scaleY:0.001}):(c.animate({translateX:f,translateY:g,scaleX:1,scaleY:1}, | ||
b),this.animate=null)},animateDrilldown:function(a){var b=this.chart.plotBox,c=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],d=c.bBox,e=this.chart.options.drilldown.animation;if(!a)a=Math.min(d.width/b.width,d.height/b.height),c.shapeArgs={scaleX:a,scaleY:a,translateX:d.x,translateY:d.y},j(this.points,function(a){a.graphic&&a.graphic.attr(c.shapeArgs).animate({scaleX:1,scaleY:1,translateX:0,translateY:0},e)}),this.animate=null},drawLegendSymbol:G.drawRectangle,animateDrillupFrom:function(a){m.column.prototype.animateDrillupFrom.call(this, | ||
a)},animateDrillupTo:function(a){m.column.prototype.animateDrillupTo.call(this,a)}}));w.mapline=n(w.map,{lineWidth:1,fillColor:"none"});m.mapline=u(m.map,{type:"mapline",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth",fill:"fillColor",dashstyle:"dashStyle"},drawLegendSymbol:m.line.prototype.drawLegendSymbol});w.mappoint=n(w.scatter,{dataLabels:{enabled:!0,formatter:function(){return this.point.name},crop:!1,defer:!1,overflow:!1,style:{color:"#000000"}}});m.mappoint=u(m.scatter,{type:"mappoint", | ||
forceDL:!0,pointClass:u(t,{applyOptions:function(a,b){var c=t.prototype.applyOptions.call(this,a,b);a.lat!==void 0&&a.lon!==void 0&&(c=o(c,this.series.chart.fromLatLonToPoint(c)));return c}})});if(m.bubble)w.mapbubble=n(w.bubble,{animationLimit:500,tooltip:{pointFormat:"{point.name}: {point.z}"}}),m.mapbubble=u(m.bubble,{pointClass:u(t,{applyOptions:function(a,b){var c;a&&a.lat!==void 0&&a.lon!==void 0?(c=t.prototype.applyOptions.call(this,a,b),c=o(c,this.series.chart.fromLatLonToPoint(c))):c=N.prototype.applyOptions.call(this, | ||
a,b);return c},ttBelow:!1}),xyFromShape:!0,type:"mapbubble",pointArrayMap:["z"],getMapData:m.map.prototype.getMapData,getBox:m.map.prototype.getBox,setData:m.map.prototype.setData});z.plotOptions.heatmap=n(z.plotOptions.scatter,{animation:!1,borderWidth:0,nullColor:"#F8F8F8",dataLabels:{formatter:function(){return this.point.value},inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},marker:null,pointRange:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{normal:{animation:!0}, | ||
hover:{halo:!1,brightness:0.2}}});m.heatmap=u(m.scatter,n(M,{type:"heatmap",pointArrayMap:["y","value"],hasPointSpecificOptions:!0,pointClass:u(t,C),supportsDrilldown:!0,getExtremesFromAll:!0,directTouch:!0,init:function(){var a;m.scatter.prototype.init.apply(this,arguments);a=this.options;this.pointRange=a.pointRange=k(a.pointRange,a.colsize||1);this.yAxis.axisPointRange=a.rowsize||1},translate:function(){var a=this.options,b=this.xAxis,c=this.yAxis,d=function(a,b,c){return Math.min(Math.max(b,a), | ||
c)};this.generatePoints();j(this.points,function(e){var f=(a.colsize||1)/2,g=(a.rowsize||1)/2,h=d(Math.round(b.len-b.translate(e.x-f,0,1,0,1)),0,b.len),f=d(Math.round(b.len-b.translate(e.x+f,0,1,0,1)),0,b.len),i=d(Math.round(c.translate(e.y-g,0,1,0,1)),0,c.len),g=d(Math.round(c.translate(e.y+g,0,1,0,1)),0,c.len);e.plotX=e.clientX=(h+f)/2;e.plotY=(i+g)/2;e.shapeType="rect";e.shapeArgs={x:Math.min(h,f),y:Math.min(i,g),width:Math.abs(f-h),height:Math.abs(g-i)}});this.translateColors();this.chart.hasRendered&& | ||
j(this.points,function(a){a.shapeArgs.fill=a.options.color||a.color})},drawPoints:m.column.prototype.drawPoints,animate:q,getBox:q,drawLegendSymbol:G.drawRectangle,getExtremes:function(){y.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;y.prototype.getExtremes.call(this)}}));s.prototype.transformFromLatLon=function(a,b){if(window.proj4===void 0)return D(21),{x:0,y:null};var c=window.proj4(b.crs,[a.lon,a.lat]),d=b.cosAngle||b.rotation&&Math.cos(b.rotation), | ||
e=b.sinAngle||b.rotation&&Math.sin(b.rotation),c=b.rotation?[c[0]*d+c[1]*e,-c[0]*e+c[1]*d]:c;return{x:((c[0]-(b.xoffset||0))*(b.scale||1)+(b.xpan||0))*(b.jsonres||1)+(b.jsonmarginX||0),y:(((b.yoffset||0)-c[1])*(b.scale||1)+(b.ypan||0))*(b.jsonres||1)-(b.jsonmarginY||0)}};s.prototype.transformToLatLon=function(a,b){if(window.proj4===void 0)D(21);else{var c={x:((a.x-(b.jsonmarginX||0))/(b.jsonres||1)-(b.xpan||0))/(b.scale||1)+(b.xoffset||0),y:((-a.y-(b.jsonmarginY||0))/(b.jsonres||1)+(b.ypan||0))/(b.scale|| | ||
1)+(b.yoffset||0)},d=b.cosAngle||b.rotation&&Math.cos(b.rotation),e=b.sinAngle||b.rotation&&Math.sin(b.rotation),c=window.proj4(b.crs,"WGS84",b.rotation?{x:c.x*d+c.y*-e,y:c.x*e+c.y*d}:c);return{lat:c.y,lon:c.x}}};s.prototype.fromPointToLatLon=function(a){var b=this.mapTransforms,c;if(b){for(c in b)if(b.hasOwnProperty(c)&&b[c].hitZone&&J({x:a.x,y:-a.y},b[c].hitZone.coordinates[0]))return this.transformToLatLon(a,b[c]);return this.transformToLatLon(a,b["default"])}else D(22)};s.prototype.fromLatLonToPoint= | ||
function(a){var b=this.mapTransforms,c,d;if(!b)return D(22),{x:0,y:null};for(c in b)if(b.hasOwnProperty(c)&&b[c].hitZone&&(d=this.transformFromLatLon(a,b[c]),J({x:d.x,y:-d.y},b[c].hitZone.coordinates[0])))return d;return this.transformFromLatLon(a,b["default"])};l.geojson=function(a,b,c){var d=[],e=[],f=function(a){var b=0,c=a.length;for(e.push("M");b<c;b++)b===1&&e.push("L"),e.push(a[b][0],-a[b][1])},b=b||"map";j(a.features,function(a){var c=a.geometry,i=c.type,c=c.coordinates,a=a.properties,k;e= | ||
[];b==="map"||b==="mapbubble"?(i==="Polygon"?(j(c,f),e.push("Z")):i==="MultiPolygon"&&(j(c,function(a){j(a,f)}),e.push("Z")),e.length&&(k={path:e})):b==="mapline"?(i==="LineString"?f(c):i==="MultiLineString"&&j(c,f),e.length&&(k={path:e})):b==="mappoint"&&i==="Point"&&(k={x:c[0],y:-c[1]});k&&d.push(o(k,{name:a.name||a.NAME,properties:a}))});if(c&&a.copyrightShort)c.chart.mapCredits='<a href="http://www.highcharts.com">Highcharts</a> \u00a9 <a href="'+a.copyrightUrl+'">'+a.copyrightShort+"</a>",c.chart.mapCreditsFull= | ||
a.copyright;return d};v(s.prototype,"showCredits",function(a,b){if(z.credits.text===this.options.credits.text&&this.mapCredits)b.text=this.mapCredits,b.href=null;a.call(this,b);this.credits&&this.credits.attr({title:this.mapCreditsFull})});o(z.lang,{zoomIn:"Zoom in",zoomOut:"Zoom out"});z.mapNavigation={buttonOptions:{alignTo:"plotBox",align:"left",verticalAlign:"top",x:0,width:18,height:18,style:{fontSize:"15px",fontWeight:"bold",textAlign:"center"},theme:{"stroke-width":1}},buttons:{zoomIn:{onclick:function(){this.mapZoom(0.5)}, | ||
text:"+",y:0},zoomOut:{onclick:function(){this.mapZoom(2)},text:"-",y:28}}};l.splitPath=function(a){var b,a=a.replace(/([A-Za-z])/g," $1 "),a=a.replace(/^\s*/,"").replace(/\s*$/,""),a=a.split(/[ ,]+/);for(b=0;b<a.length;b++)/[a-zA-Z]/.test(a[b])||(a[b]=parseFloat(a[b]));return a};l.maps={};H.prototype.symbols.topbutton=function(a,b,c,d,e){return K(a-1,b-1,c,d,e.r,e.r,0,0)};H.prototype.symbols.bottombutton=function(a,b,c,d,e){return K(a-1,b-1,c,d,0,0,e.r,e.r)};O===L&&j(["topbutton","bottombutton"], | ||
function(a){L.prototype.symbols[a]=H.prototype.symbols[a]});l.Map=function(a,b){var c={endOnTick:!1,gridLineWidth:0,lineWidth:0,minPadding:0,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]},d;d=a.series;a.series=null;a=n({chart:{panning:"xy",type:"map"},xAxis:c,yAxis:n(c,{reversed:!0})},a,{chart:{inverted:!1,alignTicks:!1}});a.series=d;return new s(a,b)}})(Highcharts); | ||
(function(j){typeof module==="object"&&module.exports?module.exports=j:j(Highcharts)})(function(j){function J(a,b){var c,d,e,f,g=!1,h=a.x,i=a.y;for(c=0,d=b.length-1;c<b.length;d=c++)e=b[c][1]>i,f=b[d][1]>i,e!==f&&h<(b[d][0]-b[c][0])*(i-b[c][1])/(b[d][1]-b[c][1])+b[c][0]&&(g=!g);return g}function K(a,b,c,d,e,f,g,h){return["M",a+e,b,"L",a+c-f,b,"C",a+c-f/2,b,a+c,b+f/2,a+c,b+f,"L",a+c,b+d-g,"C",a+c,b+d-g/2,a+c-g/2,b+d,a+c-g,b+d,"L",a+h,b+d,"C",a+h/2,b+d,a,b+d-h/2,a,b+d-h,"L",a,b+e,"C",a,b+e/2,a+e/2, | ||
b,a+e,b,"Z"]}var p=j.Axis,s=j.Chart,x=j.Color,t=j.Point,F=j.Pointer,C=j.Legend,G=j.LegendSymbolMixin,O=j.Renderer,y=j.Series,H=j.SVGRenderer,L=j.VMLRenderer,I=j.addEvent,k=j.each,D=j.error,o=j.extend,u=j.extendClass,n=j.merge,l=j.pick,z=j.getOptions(),m=j.seriesTypes,w=z.plotOptions,v=j.wrap,q=function(){};v(p.prototype,"getSeriesExtremes",function(a){var b=this.isXAxis,c,d,e=[],f;b&&k(this.series,function(a,b){if(a.useMapGeometry)e[b]=a.xData,a.xData=[]});a.call(this);if(b&&(c=l(this.dataMin,Number.MAX_VALUE), | ||
d=l(this.dataMax,-Number.MAX_VALUE),k(this.series,function(a,b){if(a.useMapGeometry)c=Math.min(c,l(a.minX,c)),d=Math.max(d,l(a.maxX,c)),a.xData=e[b],f=!0}),f))this.dataMin=c,this.dataMax=d});v(p.prototype,"setAxisTranslation",function(a){var b=this.chart,c=b.plotWidth/b.plotHeight,b=b.xAxis[0],d;a.call(this);this.coll==="yAxis"&&b.transA!==void 0&&k(this.series,function(a){a.preserveAspectRatio&&(d=!0)});if(d&&(this.transA=b.transA=Math.min(this.transA,b.transA),a=c/((b.max-b.min)/(this.max-this.min)), | ||
a=a<1?this:b,c=(a.max-a.min)*a.transA,a.pixelPadding=a.len-c,a.minPixelPadding=a.pixelPadding/2,c=a.fixTo)){c=c[1]-a.toValue(c[0],!0);c*=a.transA;if(Math.abs(c)>a.minPixelPadding||a.min===a.dataMin&&a.max===a.dataMax)c=0;a.minPixelPadding-=c}});v(p.prototype,"render",function(a){a.call(this);this.fixTo=null});var B=j.ColorAxis=function(){this.isColorAxis=!0;this.init.apply(this,arguments)};o(B.prototype,p.prototype);o(B.prototype,{defaultColorAxisOptions:{lineWidth:0,minPadding:0,maxPadding:0,gridLineWidth:1, | ||
tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},color:"gray",width:0.01},labels:{overflow:"justify"},minColor:"#EFEFFF",maxColor:"#003875",tickLength:5},init:function(a,b){var c=a.options.legend.layout!=="vertical",d;d=n(this.defaultColorAxisOptions,{side:c?2:1,reversed:!c},b,{opposite:!c,showEmpty:!1,title:null,isColor:!0});p.prototype.init.call(this,a,d);b.dataClasses&&this.initDataClasses(b);this.initStops(b);this.horiz=c;this.zoomEnabled=!1},tweenColors:function(a, | ||
b,c){var d;!b.rgba.length||!a.rgba.length?a=b.input||"none":(a=a.rgba,b=b.rgba,d=b[3]!==1||a[3]!==1,a=(d?"rgba(":"rgb(")+Math.round(b[0]+(a[0]-b[0])*(1-c))+","+Math.round(b[1]+(a[1]-b[1])*(1-c))+","+Math.round(b[2]+(a[2]-b[2])*(1-c))+(d?","+(b[3]+(a[3]-b[3])*(1-c)):"")+")");return a},initDataClasses:function(a){var b=this,c=this.chart,d,e=0,f=this.options,g=a.dataClasses.length;this.dataClasses=d=[];this.legendItems=[];k(a.dataClasses,function(a,i){var r,a=n(a);d.push(a);if(!a.color)f.dataClassColor=== | ||
"category"?(r=c.options.colors,a.color=r[e++],e===r.length&&(e=0)):a.color=b.tweenColors(x(f.minColor),x(f.maxColor),g<2?0.5:i/(g-1))})},initStops:function(a){this.stops=a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];k(this.stops,function(a){a.color=x(a[1])})},setOptions:function(a){p.prototype.setOptions.call(this,a);this.options.crosshair=this.options.marker;this.coll="colorAxis"},setAxisSize:function(){var a=this.legendSymbol,b=this.chart,c,d,e;if(a)this.left=c=a.attr("x"),this.top= | ||
d=a.attr("y"),this.width=e=a.attr("width"),this.height=a=a.attr("height"),this.right=b.chartWidth-c-e,this.bottom=b.chartHeight-d-a,this.len=this.horiz?e:a,this.pos=this.horiz?c:d},toColor:function(a,b){var c,d=this.stops,e,f=this.dataClasses,g,h;if(f)for(h=f.length;h--;){if(g=f[h],e=g.from,d=g.to,(e===void 0||a>=e)&&(d===void 0||a<=d)){c=g.color;if(b)b.dataClass=h;break}}else{this.isLog&&(a=this.val2lin(a));c=1-(this.max-a)/(this.max-this.min||1);for(h=d.length;h--;)if(c>d[h][0])break;e=d[h]||d[h+ | ||
1];d=d[h+1]||e;c=1-(d[0]-c)/(d[0]-e[0]||1);c=this.tweenColors(e.color,d.color,c)}return c},getOffset:function(){var a=this.legendGroup,b=this.chart.axisOffset[this.side];if(a){this.axisParent=a;p.prototype.getOffset.call(this);if(!this.added)this.added=!0,this.labelLeft=0,this.labelRight=this.width;this.chart.axisOffset[this.side]=b}},setLegendColor:function(){var a,b=this.options,c=this.reversed;a=c?1:0;c=c?0:1;a=this.horiz?[a,0,c,0]:[0,c,0,a];this.legendColor={linearGradient:{x1:a[0],y1:a[1],x2:a[2], | ||
y2:a[3]},stops:b.stops||[[0,b.minColor],[1,b.maxColor]]}},drawLegendSymbol:function(a,b){var c=a.padding,d=a.options,e=this.horiz,f=l(d.symbolWidth,e?200:12),g=l(d.symbolHeight,e?12:200),h=l(d.labelPadding,e?16:30),d=l(d.itemDistance,10);this.setLegendColor();b.legendSymbol=this.chart.renderer.rect(0,a.baseline-11,f,g).attr({zIndex:1}).add(b.legendGroup);this.legendItemWidth=f+c+(e?d:h);this.legendItemHeight=g+c+(e?h:0)},setState:q,visible:!0,setVisible:q,getSeriesExtremes:function(){var a;if(this.series.length)a= | ||
this.series[0],this.dataMin=a.valueMin,this.dataMax=a.valueMax},drawCrosshair:function(a,b){var c=b&&b.plotX,d=b&&b.plotY,e,f=this.pos,g=this.len;if(b)e=this.toPixels(b[b.series.colorKey]),e<f?e=f-2:e>f+g&&(e=f+g+2),b.plotX=e,b.plotY=this.len-e,p.prototype.drawCrosshair.call(this,a,b),b.plotX=c,b.plotY=d,this.cross&&this.cross.attr({fill:this.crosshair.color}).add(this.legendGroup)},getPlotLinePath:function(a,b,c,d,e){return typeof e==="number"?this.horiz?["M",e-4,this.top-6,"L",e+4,this.top-6,e, | ||
this.top,"Z"]:["M",this.left,e,"L",this.left-6,e+6,this.left-6,e-6,"Z"]:p.prototype.getPlotLinePath.call(this,a,b,c,d)},update:function(a,b){var c=this.chart,d=c.legend;k(this.series,function(a){a.isDirtyData=!0});if(a.dataClasses&&d.allItems)k(d.allItems,function(a){a.isDataClass&&a.legendGroup.destroy()}),c.isDirtyLegend=!0;c.options[this.coll]=n(this.userOptions,a);p.prototype.update.call(this,a,b);this.legendItem&&(this.setLegendColor(),d.colorizeItem(this,!0))},getDataClassLegendSymbols:function(){var a= | ||
this,b=this.chart,c=this.legendItems,d=b.options.legend,e=d.valueDecimals,f=d.valueSuffix||"",g;c.length||k(this.dataClasses,function(d,i){var r=!0,A=d.from,l=d.to;g="";A===void 0?g="< ":l===void 0&&(g="> ");A!==void 0&&(g+=j.numberFormat(A,e)+f);A!==void 0&&l!==void 0&&(g+=" - ");l!==void 0&&(g+=j.numberFormat(l,e)+f);c.push(o({chart:b,name:g,options:{},drawLegendSymbol:G.drawRectangle,visible:!0,setState:q,isDataClass:!0,setVisible:function(){r=this.visible=!r;k(a.series,function(a){k(a.points, | ||
function(a){a.dataClass===i&&a.setVisible(r)})});b.legend.colorizeItem(this,r)}},d))});return c},name:""});k(["fill","stroke"],function(a){j.addAnimSetter(a,function(b){b.elem.attr(a,B.prototype.tweenColors(x(b.start),x(b.end),b.pos))})});v(s.prototype,"getAxes",function(a){var b=this.options.colorAxis;a.call(this);this.colorAxis=[];b&&new B(this,b)});v(C.prototype,"getAllItems",function(a){var b=[],c=this.chart.colorAxis[0];c&&(c.options.dataClasses?b=b.concat(c.getDataClassLegendSymbols()):b.push(c), | ||
k(c.series,function(a){a.options.showInLegend=!1}));return b.concat(a.call(this))});var C={setVisible:function(a){var b=this,c=a?"show":"hide";k(["graphic","dataLabel"],function(a){if(b[a])b[a][c]()})}},M={pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",dashstyle:"dashStyle"},pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],optionalAxis:"colorAxis",trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:q,parallelArrays:["x","y","value"], | ||
colorKey:"value",translateColors:function(){var a=this,b=this.options.nullColor,c=this.colorAxis,d=this.colorKey;k(this.data,function(e){var f=e[d];if(f=e.options.color||(f===null?b:c&&f!==void 0?c.toColor(f,e):e.color||a.color))e.color=f})}};o(s.prototype,{renderMapNavigation:function(){var a=this,b=this.options.mapNavigation,c=b.buttons,d,e,f,g,h=function(a){if(a)a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},i=function(b){this.handler.call(a,b);h(b)}; | ||
if(l(b.enableButtons,b.enabled)&&!a.renderer.forExport)for(d in c)if(c.hasOwnProperty(d))f=n(b.buttonOptions,c[d]),e=f.theme,e.style=n(f.theme.style,f.style),g=e.states,e=a.renderer.button(f.text,0,0,i,e,g&&g.hover,g&&g.select,0,d==="zoomIn"?"topbutton":"bottombutton").attr({width:f.width,height:f.height,title:a.options.lang[d],zIndex:5}).add(),e.handler=f.onclick,e.align(o(f,{width:e.width,height:2*e.height}),null,f.alignTo),I(e.element,"dblclick",h)},fitToBox:function(a,b){k([["x","width"],["y", | ||
"height"]],function(c){var d=c[0],c=c[1];a[d]+a[c]>b[d]+b[c]&&(a[c]>b[c]?(a[c]=b[c],a[d]=b[d]):a[d]=b[d]+b[c]-a[c]);a[c]>b[c]&&(a[c]=b[c]);a[d]<b[d]&&(a[d]=b[d])});return a},mapZoom:function(a,b,c,d,e){var f=this.xAxis[0],g=f.max-f.min,h=l(b,f.min+g/2),i=g*a,g=this.yAxis[0],j=g.max-g.min,A=l(c,g.min+j/2);j*=a;h=this.fitToBox({x:h-i*(d?(d-f.pos)/f.len:0.5),y:A-j*(e?(e-g.pos)/g.len:0.5),width:i,height:j},{x:f.dataMin,y:g.dataMin,width:f.dataMax-f.dataMin,height:g.dataMax-g.dataMin});if(d)f.fixTo=[d- | ||
f.pos,b];if(e)g.fixTo=[e-g.pos,c];a!==void 0?(f.setExtremes(h.x,h.x+h.width,!1),g.setExtremes(h.y,h.y+h.height,!1)):(f.setExtremes(void 0,void 0,!1),g.setExtremes(void 0,void 0,!1));this.redraw()}});v(s.prototype,"render",function(a){var b=this,c=b.options.mapNavigation;b.renderMapNavigation();a.call(b);(l(c.enableDoubleClickZoom,c.enabled)||c.enableDoubleClickZoomTo)&&I(b.container,"dblclick",function(a){b.pointer.onContainerDblClick(a)});l(c.enableMouseWheelZoom,c.enabled)&&I(b.container,document.onmousewheel=== | ||
void 0?"DOMMouseScroll":"mousewheel",function(a){b.pointer.onContainerMouseWheel(a);return!1})});o(F.prototype,{onContainerDblClick:function(a){var b=this.chart,a=this.normalize(a);b.options.mapNavigation.enableDoubleClickZoomTo?b.pointer.inClass(a.target,"highcharts-tracker")&&b.hoverPoint.zoomTo():b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&b.mapZoom(0.5,b.xAxis[0].toValue(a.chartX),b.yAxis[0].toValue(a.chartY),a.chartX,a.chartY)},onContainerMouseWheel:function(a){var b=this.chart,c, | ||
a=this.normalize(a);c=a.detail||-(a.wheelDelta/120);b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&b.mapZoom(Math.pow(2,c),b.xAxis[0].toValue(a.chartX),b.yAxis[0].toValue(a.chartY),a.chartX,a.chartY)}});v(F.prototype,"init",function(a,b,c){a.call(this,b,c);if(l(c.mapNavigation.enableTouchZoom,c.mapNavigation.enabled))this.pinchX=this.pinchHor=this.pinchY=this.pinchVert=this.hasZoom=!0});v(F.prototype,"pinchTranslate",function(a,b,c,d,e,f,g){a.call(this,b,c,d,e,f,g);this.chart.options.chart.type=== | ||
"map"&&this.hasZoom&&(a=d.scaleX>d.scaleY,this.pinchTranslateDirection(!a,b,c,d,e,f,g,a?d.scaleX:d.scaleY))});var E=document.documentElement.style.vectorEffect!==void 0;w.map=n(w.scatter,{allAreas:!0,animation:!1,nullColor:"#F8F8F8",borderColor:"silver",borderWidth:1,marker:null,stickyTracking:!1,dataLabels:{formatter:function(){return this.point.value},inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},turboThreshold:0,tooltip:{followPointer:!0,pointFormat:"{point.name}: {point.value}<br/>"}, | ||
states:{normal:{animation:!0},hover:{brightness:0.2,halo:null}}});var N=u(t,o({applyOptions:function(a,b){var c=t.prototype.applyOptions.call(this,a,b),d=this.series,e=d.joinBy;if(d.mapData)if(e=c[e[1]]!==void 0&&d.mapMap[c[e[1]]]){if(d.xyFromShape)c.x=e._midX,c.y=e._midY;o(c,e)}else c.value=c.value||null;return c},onMouseOver:function(a){clearTimeout(this.colorInterval);if(this.value!==null)t.prototype.onMouseOver.call(this,a);else this.series.onMouseOut(a)},onMouseOut:function(){var a=this,b=+new Date, | ||
c=x(a.color),d=x(a.pointAttr.hover.fill),e=a.series.options.states.normal.animation,f=e&&(e.duration||500),g;if(f&&c.rgba.length===4&&d.rgba.length===4&&a.state!=="select")g=a.pointAttr[""].fill,delete a.pointAttr[""].fill,clearTimeout(a.colorInterval),a.colorInterval=setInterval(function(){var e=(new Date-b)/f,g=a.graphic;e>1&&(e=1);g&&g.attr("fill",B.prototype.tweenColors.call(0,d,c,e));e>=1&&clearTimeout(a.colorInterval)},13);t.prototype.onMouseOut.call(a);if(g)a.pointAttr[""].fill=g},zoomTo:function(){var a= | ||
this.series;a.xAxis.setExtremes(this._minX,this._maxX,!1);a.yAxis.setExtremes(this._minY,this._maxY,!1);a.chart.redraw()}},C));m.map=u(m.scatter,n(M,{type:"map",pointClass:N,supportsDrilldown:!0,getExtremesFromAll:!0,useMapGeometry:!0,forceDL:!0,searchPoint:q,directTouch:!0,preserveAspectRatio:!0,getBox:function(a){var b=Number.MAX_VALUE,c=-b,d=b,e=-b,f=b,g=b,h=this.xAxis,i=this.yAxis,r;k(a||[],function(a){if(a.path){if(typeof a.path==="string")a.path=j.splitPath(a.path);var h=a.path||[],i=h.length, | ||
k=!1,m=-b,n=b,o=-b,p=b,q=a.properties;if(!a._foundBox){for(;i--;)typeof h[i]==="number"&&!isNaN(h[i])&&(k?(m=Math.max(m,h[i]),n=Math.min(n,h[i])):(o=Math.max(o,h[i]),p=Math.min(p,h[i])),k=!k);a._midX=n+(m-n)*(a.middleX||q&&q["hc-middle-x"]||0.5);a._midY=p+(o-p)*(a.middleY||q&&q["hc-middle-y"]||0.5);a._maxX=m;a._minX=n;a._maxY=o;a._minY=p;a.labelrank=l(a.labelrank,(m-n)*(o-p));a._foundBox=!0}c=Math.max(c,a._maxX);d=Math.min(d,a._minX);e=Math.max(e,a._maxY);f=Math.min(f,a._minY);g=Math.min(a._maxX- | ||
a._minX,a._maxY-a._minY,g);r=!0}});if(r){this.minY=Math.min(f,l(this.minY,b));this.maxY=Math.max(e,l(this.maxY,-b));this.minX=Math.min(d,l(this.minX,b));this.maxX=Math.max(c,l(this.maxX,-b));if(h&&h.options.minRange===void 0)h.minRange=Math.min(5*g,(this.maxX-this.minX)/5,h.minRange||b);if(i&&i.options.minRange===void 0)i.minRange=Math.min(5*g,(this.maxY-this.minY)/5,i.minRange||b)}},getExtremes:function(){y.prototype.getExtremes.call(this,this.valueData);this.chart.hasRendered&&this.isDirtyData&& | ||
this.getBox(this.options.data);this.valueMin=this.dataMin;this.valueMax=this.dataMax;this.dataMin=this.minY;this.dataMax=this.maxY},translatePath:function(a){var b=!1,c=this.xAxis,d=this.yAxis,e=c.min,f=c.transA,c=c.minPixelPadding,g=d.min,h=d.transA,d=d.minPixelPadding,i,j=[];if(a)for(i=a.length;i--;)typeof a[i]==="number"?(j[i]=b?(a[i]-e)*f+c:(a[i]-g)*h+d,b=!b):j[i]=a[i];return j},setData:function(a,b){var c=this.options,d=c.mapData,e=c.joinBy,f=e===null,g=[],h,i,l;f&&(e="_i");e=this.joinBy=j.splat(e); | ||
e[1]||(e[1]=e[0]);a&&k(a,function(b,c){typeof b==="number"&&(a[c]={value:b});if(f)a[c]._i=c});this.getBox(a);if(d){if(d.type==="FeatureCollection"){if(d["hc-transform"])for(h in this.chart.mapTransforms=i=d["hc-transform"],i)if(i.hasOwnProperty(h)&&h.rotation)h.cosAngle=Math.cos(h.rotation),h.sinAngle=Math.sin(h.rotation);d=j.geojson(d,this.type,this)}this.getBox(d);this.mapData=d;this.mapMap={};for(l=0;l<d.length;l++)h=d[l],i=h.properties,h._i=l,e[0]&&i&&i[e[0]]&&(h[e[0]]=i[e[0]]),this.mapMap[h[e[0]]]= | ||
h;c.allAreas&&(a=a||[],e[1]&&k(a,function(a){g.push(a[e[1]])}),g="|"+g.join("|")+"|",k(d,function(b){(!e[0]||g.indexOf("|"+b[e[0]]+"|")===-1)&&a.push(n(b,{value:null}))}))}y.prototype.setData.call(this,a,b)},drawGraph:q,drawDataLabels:q,doFullTranslate:function(){return this.isDirtyData||this.chart.isResizing||this.chart.renderer.isVML||!this.baseTrans},translate:function(){var a=this,b=a.xAxis,c=a.yAxis,d=a.doFullTranslate();a.generatePoints();k(a.data,function(e){e.plotX=b.toPixels(e._midX,!0); | ||
e.plotY=c.toPixels(e._midY,!0);if(d)e.shapeType="path",e.shapeArgs={d:a.translatePath(e.path)},E&&(e.shapeArgs["vector-effect"]="non-scaling-stroke")});a.translateColors()},drawPoints:function(){var a=this,b=a.xAxis,c=a.yAxis,d=a.group,e=a.chart,f=e.renderer,g,h=this.baseTrans;if(!a.transformGroup)a.transformGroup=f.g().attr({scaleX:1,scaleY:1}).add(d),a.transformGroup.survive=!0;a.doFullTranslate()?(e.hasRendered&&a.pointAttrToOptions.fill==="color"&&k(a.points,function(a){if(a.shapeArgs)a.shapeArgs.fill= | ||
a.pointAttr[l(a.state,"")].fill}),E||k(a.points,function(b){b=b.pointAttr[""];b["stroke-width"]===a.pointAttr[""]["stroke-width"]&&(b["stroke-width"]="inherit")}),a.group=a.transformGroup,m.column.prototype.drawPoints.apply(a),a.group=d,k(a.points,function(a){a.graphic&&(a.name&&a.graphic.addClass("highcharts-name-"+a.name.replace(" ","-").toLowerCase()),a.properties&&a.properties["hc-key"]&&a.graphic.addClass("highcharts-key-"+a.properties["hc-key"].toLowerCase()),E||(a.graphic["stroke-widthSetter"]= | ||
q))}),this.baseTrans={originX:b.min-b.minPixelPadding/b.transA,originY:c.min-c.minPixelPadding/c.transA+(c.reversed?0:c.len/c.transA),transAX:b.transA,transAY:c.transA},this.transformGroup.animate({translateX:0,translateY:0,scaleX:1,scaleY:1})):(g=b.transA/h.transAX,d=c.transA/h.transAY,b=b.toPixels(h.originX,!0),c=c.toPixels(h.originY,!0),g>0.99&&g<1.01&&d>0.99&&d<1.01&&(d=g=1,b=Math.round(b),c=Math.round(c)),this.transformGroup.animate({translateX:b,translateY:c,scaleX:g,scaleY:d}));E||a.group.element.setAttribute("stroke-width", | ||
a.options.borderWidth/(g||1));this.drawMapDataLabels()},drawMapDataLabels:function(){y.prototype.drawDataLabels.call(this);this.dataLabelsGroup&&this.dataLabelsGroup.clip(this.chart.clipRect)},render:function(){var a=this,b=y.prototype.render;a.chart.renderer.isVML&&a.data.length>3E3?setTimeout(function(){b.call(a)}):b.call(a)},animate:function(a){var b=this.options.animation,c=this.group,d=this.xAxis,e=this.yAxis,f=d.pos,g=e.pos;if(this.chart.renderer.isSVG)b===!0&&(b={duration:1E3}),a?c.attr({translateX:f+ | ||
d.len/2,translateY:g+e.len/2,scaleX:0.001,scaleY:0.001}):(c.animate({translateX:f,translateY:g,scaleX:1,scaleY:1},b),this.animate=null)},animateDrilldown:function(a){var b=this.chart.plotBox,c=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],d=c.bBox,e=this.chart.options.drilldown.animation;if(!a)a=Math.min(d.width/b.width,d.height/b.height),c.shapeArgs={scaleX:a,scaleY:a,translateX:d.x,translateY:d.y},k(this.points,function(a){a.graphic&&a.graphic.attr(c.shapeArgs).animate({scaleX:1, | ||
scaleY:1,translateX:0,translateY:0},e)}),this.animate=null},drawLegendSymbol:G.drawRectangle,animateDrillupFrom:function(a){m.column.prototype.animateDrillupFrom.call(this,a)},animateDrillupTo:function(a){m.column.prototype.animateDrillupTo.call(this,a)}}));w.mapline=n(w.map,{lineWidth:1,fillColor:"none"});m.mapline=u(m.map,{type:"mapline",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth",fill:"fillColor",dashstyle:"dashStyle"},drawLegendSymbol:m.line.prototype.drawLegendSymbol});w.mappoint= | ||
n(w.scatter,{dataLabels:{enabled:!0,formatter:function(){return this.point.name},crop:!1,defer:!1,overflow:!1,style:{color:"#000000"}}});m.mappoint=u(m.scatter,{type:"mappoint",forceDL:!0,pointClass:u(t,{applyOptions:function(a,b){var c=t.prototype.applyOptions.call(this,a,b);a.lat!==void 0&&a.lon!==void 0&&(c=o(c,this.series.chart.fromLatLonToPoint(c)));return c}})});if(m.bubble)w.mapbubble=n(w.bubble,{animationLimit:500,tooltip:{pointFormat:"{point.name}: {point.z}"}}),m.mapbubble=u(m.bubble,{pointClass:u(t, | ||
{applyOptions:function(a,b){var c;a&&a.lat!==void 0&&a.lon!==void 0?(c=t.prototype.applyOptions.call(this,a,b),c=o(c,this.series.chart.fromLatLonToPoint(c))):c=N.prototype.applyOptions.call(this,a,b);return c},ttBelow:!1}),xyFromShape:!0,type:"mapbubble",pointArrayMap:["z"],getMapData:m.map.prototype.getMapData,getBox:m.map.prototype.getBox,setData:m.map.prototype.setData});z.plotOptions.heatmap=n(z.plotOptions.scatter,{animation:!1,borderWidth:0,nullColor:"#F8F8F8",dataLabels:{formatter:function(){return this.point.value}, | ||
inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},marker:null,pointRange:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{normal:{animation:!0},hover:{halo:!1,brightness:0.2}}});m.heatmap=u(m.scatter,n(M,{type:"heatmap",pointArrayMap:["y","value"],hasPointSpecificOptions:!0,pointClass:u(t,C),supportsDrilldown:!0,getExtremesFromAll:!0,directTouch:!0,init:function(){var a;m.scatter.prototype.init.apply(this,arguments);a=this.options;a.pointRange=l(a.pointRange, | ||
a.colsize||1);this.yAxis.axisPointRange=a.rowsize||1},translate:function(){var a=this.options,b=this.xAxis,c=this.yAxis,d=function(a,b,c){return Math.min(Math.max(b,a),c)};this.generatePoints();k(this.points,function(e){var f=(a.colsize||1)/2,g=(a.rowsize||1)/2,h=d(Math.round(b.len-b.translate(e.x-f,0,1,0,1)),0,b.len),f=d(Math.round(b.len-b.translate(e.x+f,0,1,0,1)),0,b.len),i=d(Math.round(c.translate(e.y-g,0,1,0,1)),0,c.len),g=d(Math.round(c.translate(e.y+g,0,1,0,1)),0,c.len);e.plotX=e.clientX=(h+ | ||
f)/2;e.plotY=(i+g)/2;e.shapeType="rect";e.shapeArgs={x:Math.min(h,f),y:Math.min(i,g),width:Math.abs(f-h),height:Math.abs(g-i)}});this.translateColors();this.chart.hasRendered&&k(this.points,function(a){a.shapeArgs.fill=a.options.color||a.color})},drawPoints:m.column.prototype.drawPoints,animate:q,getBox:q,drawLegendSymbol:G.drawRectangle,getExtremes:function(){y.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;y.prototype.getExtremes.call(this)}})); | ||
s.prototype.transformFromLatLon=function(a,b){if(window.proj4===void 0)return D(21),{x:0,y:null};var c=window.proj4(b.crs,[a.lon,a.lat]),d=b.cosAngle||b.rotation&&Math.cos(b.rotation),e=b.sinAngle||b.rotation&&Math.sin(b.rotation),c=b.rotation?[c[0]*d+c[1]*e,-c[0]*e+c[1]*d]:c;return{x:((c[0]-(b.xoffset||0))*(b.scale||1)+(b.xpan||0))*(b.jsonres||1)+(b.jsonmarginX||0),y:(((b.yoffset||0)-c[1])*(b.scale||1)+(b.ypan||0))*(b.jsonres||1)-(b.jsonmarginY||0)}};s.prototype.transformToLatLon=function(a,b){if(window.proj4=== | ||
void 0)D(21);else{var c={x:((a.x-(b.jsonmarginX||0))/(b.jsonres||1)-(b.xpan||0))/(b.scale||1)+(b.xoffset||0),y:((-a.y-(b.jsonmarginY||0))/(b.jsonres||1)+(b.ypan||0))/(b.scale||1)+(b.yoffset||0)},d=b.cosAngle||b.rotation&&Math.cos(b.rotation),e=b.sinAngle||b.rotation&&Math.sin(b.rotation),c=window.proj4(b.crs,"WGS84",b.rotation?{x:c.x*d+c.y*-e,y:c.x*e+c.y*d}:c);return{lat:c.y,lon:c.x}}};s.prototype.fromPointToLatLon=function(a){var b=this.mapTransforms,c;if(b){for(c in b)if(b.hasOwnProperty(c)&&b[c].hitZone&& | ||
J({x:a.x,y:-a.y},b[c].hitZone.coordinates[0]))return this.transformToLatLon(a,b[c]);return this.transformToLatLon(a,b["default"])}else D(22)};s.prototype.fromLatLonToPoint=function(a){var b=this.mapTransforms,c,d;if(!b)return D(22),{x:0,y:null};for(c in b)if(b.hasOwnProperty(c)&&b[c].hitZone&&(d=this.transformFromLatLon(a,b[c]),J({x:d.x,y:-d.y},b[c].hitZone.coordinates[0])))return d;return this.transformFromLatLon(a,b["default"])};j.geojson=function(a,b,c){var d=[],e=[],f=function(a){var b,c=a.length; | ||
e.push("M");for(b=0;b<c;b++)b===1&&e.push("L"),e.push(a[b][0],-a[b][1])},b=b||"map";k(a.features,function(a){var c=a.geometry,i=c.type,c=c.coordinates,a=a.properties,j;e=[];b==="map"||b==="mapbubble"?(i==="Polygon"?(k(c,f),e.push("Z")):i==="MultiPolygon"&&(k(c,function(a){k(a,f)}),e.push("Z")),e.length&&(j={path:e})):b==="mapline"?(i==="LineString"?f(c):i==="MultiLineString"&&k(c,f),e.length&&(j={path:e})):b==="mappoint"&&i==="Point"&&(j={x:c[0],y:-c[1]});j&&d.push(o(j,{name:a.name||a.NAME,properties:a}))}); | ||
if(c&&a.copyrightShort)c.chart.mapCredits='<a href="http://www.highcharts.com">Highcharts</a> \u00a9 <a href="'+a.copyrightUrl+'">'+a.copyrightShort+"</a>",c.chart.mapCreditsFull=a.copyright;return d};v(s.prototype,"showCredits",function(a,b){if(z.credits.text===this.options.credits.text&&this.mapCredits)b.text=this.mapCredits,b.href=null;a.call(this,b);this.credits&&this.credits.attr({title:this.mapCreditsFull})});o(z.lang,{zoomIn:"Zoom in",zoomOut:"Zoom out"});z.mapNavigation={buttonOptions:{alignTo:"plotBox", | ||
align:"left",verticalAlign:"top",x:0,width:18,height:18,style:{fontSize:"15px",fontWeight:"bold",textAlign:"center"},theme:{"stroke-width":1}},buttons:{zoomIn:{onclick:function(){this.mapZoom(0.5)},text:"+",y:0},zoomOut:{onclick:function(){this.mapZoom(2)},text:"-",y:28}}};j.splitPath=function(a){var b,a=a.replace(/([A-Za-z])/g," $1 "),a=a.replace(/^\s*/,"").replace(/\s*$/,""),a=a.split(/[ ,]+/);for(b=0;b<a.length;b++)/[a-zA-Z]/.test(a[b])||(a[b]=parseFloat(a[b]));return a};j.maps={};H.prototype.symbols.topbutton= | ||
function(a,b,c,d,e){return K(a-1,b-1,c,d,e.r,e.r,0,0)};H.prototype.symbols.bottombutton=function(a,b,c,d,e){return K(a-1,b-1,c,d,0,0,e.r,e.r)};O===L&&k(["topbutton","bottombutton"],function(a){L.prototype.symbols[a]=H.prototype.symbols[a]});j.Map=function(a,b){var c={endOnTick:!1,gridLineWidth:0,lineWidth:0,minPadding:0,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]},d;d=a.series;a.series=null;a=n({chart:{panning:"xy",type:"map"},xAxis:c,yAxis:n(c,{reversed:!0})},a,{chart:{inverted:!1,alignTicks:!1}}); | ||
a.series=d;return new s(a,b)}}); |
/* | ||
Highmaps JS v1.1.9 (2015-10-07) | ||
Highmaps JS v1.1.10 (2015-12-07) | ||
Client side exporting module | ||
@@ -9,7 +9,7 @@ | ||
*/ | ||
(function(d){d.CanVGRenderer={};d.Chart.prototype.exportChartLocal=function(x,y){var i=this,e=d.merge(i.options.exporting,x),q=navigator.userAgent.indexOf("WebKit")>-1&&navigator.userAgent.indexOf("Chrome")<0,l=e.scale||2,n,r=window.URL||window.webkitURL||window,f,s=0,o,m,t,g=function(){if(e.fallbackToExportServer===!1)throw"Fallback to export server disabled";i.exportChart(e)},u=function(a,b,c,g,k,d,e){var j=new Image;if(!q)j.crossOrigin="Anonymous";j.onload=function(){var h=document.createElement("canvas"), | ||
d=h.getContext&&h.getContext("2d"),i;if(d){h.height=j.height*l;h.width=j.width*l;d.drawImage(j,0,0,h.width,h.height);try{i=h.toDataURL(),c(i,b)}catch(f){if(f.name==="SecurityError"||f.name==="SECURITY_ERR"||f.message==="SecurityError")g(a,b);else throw f;}}else k(a,b);e&&e(a,b)};j.onerror=function(){d(a,b);e&&e(a,b)};j.src=a},v=function(a){try{if(!q&&navigator.userAgent.toLowerCase().indexOf("firefox")<0)return r.createObjectURL(new Blob([a],{type:"image/svg+xml;charset-utf-16"}))}catch(b){}return"data:image/svg+xml;charset=UTF-8,"+ | ||
encodeURIComponent(a)},p=function(a,b){var c=document.createElement("a"),d=(e.filename||"chart")+"."+b,k;if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(a,d);else if(typeof c.download!=="undefined")c.href=a,c.download=d,c.target="_blank",document.body.appendChild(c),c.click(),document.body.removeChild(c);else try{if(k=window.open(a,"chart"),typeof k==="undefined"||k===null)throw 1;}catch(g){window.location.href=a}},w=function(){var a,b,c=i.sanitizeSVG(n.innerHTML);if(e&&e.type==="image/svg+xml")try{navigator.msSaveOrOpenBlob? | ||
(b=new MSBlobBuilder,b.append(c),a=b.getBlob("image/svg+xml")):a=v(c),p(a,"svg")}catch(f){g()}else a=v(c),u(a,{},function(a){try{p(a,"png")}catch(c){g()}},function(){var a=document.createElement("canvas"),b=a.getContext("2d"),e=c.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*l,f=c.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*l,h=function(){b.drawSvg(c,0,0,e,f);try{p(navigator.msSaveOrOpenBlob?a.msToBlob():a.toDataURL("image/png"),"png")}catch(d){g()}};a.width=e;a.height=f;window.canvg? | ||
h():(i.showLoading(),HighchartsAdapter.getScript(d.getOptions().global.canvasToolsURL,function(){i.hideLoading();h()}))},g,g,function(){try{r.revokeObjectURL(a)}catch(b){}})};d.wrap(d.Chart.prototype,"getChartHTML",function(a){n=this.container.cloneNode(!0);return a.apply(this,Array.prototype.slice.call(arguments,1))});i.getSVGForExport(e,y);f=n.getElementsByTagName("image");try{f.length||w();var z=function(a,b){++s;b.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",a);s===f.length&& | ||
w()};for(m=0,t=f.length;m<t;++m)o=f[m],u(o.getAttributeNS("http://www.w3.org/1999/xlink","href"),{imageElement:o},z,g,g,g)}catch(A){g()}};d.getOptions().exporting.buttons.contextButton.menuItems=[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChartLocal()}},{textKey:"downloadSVG",onclick:function(){this.exportChartLocal({type:"image/svg+xml"})}}]})(Highcharts); | ||
(function(c){typeof module==="object"&&module.exports?module.exports=c:c(Highcharts)})(function(c){c.CanVGRenderer={};c.Chart.prototype.exportChartLocal=function(w,x){var i=this,e=c.merge(i.options.exporting,w),p=navigator.userAgent.indexOf("WebKit")>-1&&navigator.userAgent.indexOf("Chrome")<0,l=e.scale||2,m,q=window.URL||window.webkitURL||window,h,r=0,n,f,s,b=function(){if(e.fallbackToExportServer===!1)throw"Fallback to export server disabled";i.exportChart(e)},t=function(a,g,d,c,k,b,e){var j=new Image; | ||
if(!p)j.crossOrigin="Anonymous";j.onload=function(){var b=document.createElement("canvas"),i=b.getContext&&b.getContext("2d"),h;if(i){b.height=j.height*l;b.width=j.width*l;i.drawImage(j,0,0,b.width,b.height);try{h=b.toDataURL(),d(h,g)}catch(f){if(f.name==="SecurityError"||f.name==="SECURITY_ERR"||f.message==="SecurityError")c(a,g);else throw f;}}else k(a,g);e&&e(a,g)};j.onerror=function(){b(a,g);e&&e(a,g)};j.src=a},u=function(a){try{if(!p&&navigator.userAgent.toLowerCase().indexOf("firefox")<0)return q.createObjectURL(new Blob([a], | ||
{type:"image/svg+xml;charset-utf-16"}))}catch(b){}return"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(a)},o=function(a,b){var d=document.createElement("a"),c=(e.filename||"chart")+"."+b,k;if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(a,c);else if(d.download!==void 0)d.href=a,d.download=c,d.target="_blank",document.body.appendChild(d),d.click(),document.body.removeChild(d);else try{if(k=window.open(a,"chart"),k===void 0||k===null)throw 1;}catch(i){window.location.href=a}},v=function(){var a, | ||
g,d=i.sanitizeSVG(m.innerHTML);if(e&&e.type==="image/svg+xml")try{navigator.msSaveOrOpenBlob?(g=new MSBlobBuilder,g.append(d),a=g.getBlob("image/svg+xml")):a=u(d),o(a,"svg")}catch(f){b()}else a=u(d),t(a,{},function(a){try{o(a,"png")}catch(c){b()}},function(){var a=document.createElement("canvas"),e=a.getContext("2d"),g=d.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*l,f=d.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*l,h=function(){e.drawSvg(d,0,0,g,f);try{o(navigator.msSaveOrOpenBlob? | ||
a.msToBlob():a.toDataURL("image/png"),"png")}catch(c){b()}};a.width=g;a.height=f;window.canvg?h():(i.showLoading(),c.getScript(c.getOptions().global.canvasToolsURL,function(){i.hideLoading();h()}))},b,b,function(){try{q.revokeObjectURL(a)}catch(b){}})},y=function(a,b){++r;b.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",a);r===h.length&&v()};c.wrap(c.Chart.prototype,"getChartHTML",function(a){m=this.container.cloneNode(!0);return a.apply(this,Array.prototype.slice.call(arguments, | ||
1))});i.getSVGForExport(e,x);h=m.getElementsByTagName("image");try{h.length||v();for(f=0,s=h.length;f<s;++f)n=h[f],t(n.getAttributeNS("http://www.w3.org/1999/xlink","href"),{imageElement:n},y,b,b,b)}catch(z){b()}};c.getOptions().exporting.buttons.contextButton.menuItems=[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChartLocal()}},{textKey:"downloadSVG",onclick:function(){this.exportChartLocal({type:"image/svg+xml"})}}]}); |
/** | ||
* @license Highmaps JS v1.1.9 (2015-10-07) | ||
* @license Highmaps JS v1.1.10 (2015-12-07) | ||
* Client side exporting module | ||
@@ -10,269 +10,272 @@ * | ||
// JSLint options: | ||
/*global Highcharts, HighchartsAdapter, document, window, Blob, MSBlobBuilder */ | ||
/*global MSBlobBuilder */ | ||
(function (factory) { | ||
if (typeof module === 'object' && module.exports) { | ||
module.exports = factory; | ||
} else { | ||
factory(Highcharts); | ||
} | ||
}(function (Highcharts) { | ||
(function (Highcharts) { | ||
// Dummy object so we can reuse our canvas-tools.js without errors | ||
Highcharts.CanVGRenderer = {}; | ||
// Dummy object so we can reuse our canvas-tools.js without errors | ||
Highcharts.CanVGRenderer = {}; | ||
/** | ||
* Add a new method to the Chart object to perform a local download | ||
*/ | ||
Highcharts.Chart.prototype.exportChartLocal = function (exportingOptions, chartOptions) { | ||
var chart = this, | ||
options = Highcharts.merge(chart.options.exporting, exportingOptions), | ||
webKit = navigator.userAgent.indexOf('WebKit') > -1 && navigator.userAgent.indexOf('Chrome') < 0, // Webkit and not chrome | ||
scale = options.scale || 2, | ||
chartCopyContainer, | ||
domurl = window.URL || window.webkitURL || window, | ||
images, | ||
imagesEmbedded = 0, | ||
el, | ||
i, | ||
l, | ||
fallbackToExportServer = function () { | ||
if (options.fallbackToExportServer === false) { | ||
throw 'Fallback to export server disabled'; | ||
} | ||
chart.exportChart(options); | ||
}, | ||
// Get data:URL from image URL | ||
// Pass in callbacks to handle results. finallyCallback is always called at the end of the process. Supplying this callback is optional. | ||
// All callbacks receive two arguments: imageURL, and callbackArgs. callbackArgs is used only by callbacks and can contain whatever. | ||
imageToDataUrl = function (imageURL, callbackArgs, successCallback, taintedCallback, noCanvasSupportCallback, failedLoadCallback, finallyCallback) { | ||
var img = new Image(); | ||
if (!webKit) { | ||
img.crossOrigin = 'Anonymous'; // For some reason Safari chokes on this attribute | ||
} | ||
img.onload = function () { | ||
var canvas = document.createElement('canvas'), | ||
ctx = canvas.getContext && canvas.getContext('2d'), | ||
dataURL; | ||
/** | ||
* Add a new method to the Chart object to perform a local download | ||
*/ | ||
Highcharts.Chart.prototype.exportChartLocal = function (exportingOptions, chartOptions) { | ||
var chart = this, | ||
options = Highcharts.merge(chart.options.exporting, exportingOptions), | ||
webKit = navigator.userAgent.indexOf('WebKit') > -1 && navigator.userAgent.indexOf("Chrome") < 0, // Webkit and not chrome | ||
scale = options.scale || 2, | ||
chartCopyContainer, | ||
domurl = window.URL || window.webkitURL || window, | ||
images, | ||
imagesEmbedded = 0, | ||
el, | ||
i, | ||
l, | ||
fallbackToExportServer = function () { | ||
if (options.fallbackToExportServer === false) { | ||
throw 'Fallback to export server disabled'; | ||
} | ||
chart.exportChart(options); | ||
}, | ||
// Get data:URL from image URL | ||
// Pass in callbacks to handle results. finallyCallback is always called at the end of the process. Supplying this callback is optional. | ||
// All callbacks receive two arguments: imageURL, and callbackArgs. callbackArgs is used only by callbacks and can contain whatever. | ||
imageToDataUrl = function (imageURL, callbackArgs, successCallback, taintedCallback, noCanvasSupportCallback, failedLoadCallback, finallyCallback) { | ||
var img = new Image(); | ||
if (!webKit) { | ||
img.crossOrigin = 'Anonymous'; // For some reason Safari chokes on this attribute | ||
} | ||
img.onload = function () { | ||
var canvas = document.createElement('canvas'), | ||
ctx = canvas.getContext && canvas.getContext('2d'), | ||
dataURL; | ||
if (!ctx) { | ||
noCanvasSupportCallback(imageURL, callbackArgs); | ||
} else { | ||
canvas.height = img.height * scale; | ||
canvas.width = img.width * scale; | ||
ctx.drawImage(img, 0, 0, canvas.width, canvas.height); | ||
if (!ctx) { | ||
noCanvasSupportCallback(imageURL, callbackArgs); | ||
} else { | ||
canvas.height = img.height * scale; | ||
canvas.width = img.width * scale; | ||
ctx.drawImage(img, 0, 0, canvas.width, canvas.height); | ||
// Now we try to get the contents of the canvas. | ||
try { | ||
dataURL = canvas.toDataURL(); | ||
successCallback(dataURL, callbackArgs); | ||
} catch (e) { | ||
// Failed - either tainted canvas or something else went horribly wrong | ||
if (e.name === 'SecurityError' || e.name === 'SECURITY_ERR' || e.message === 'SecurityError') { | ||
taintedCallback(imageURL, callbackArgs); | ||
} else { | ||
throw e; | ||
// Now we try to get the contents of the canvas. | ||
try { | ||
dataURL = canvas.toDataURL(); | ||
successCallback(dataURL, callbackArgs); | ||
} catch (e) { | ||
// Failed - either tainted canvas or something else went horribly wrong | ||
if (e.name === 'SecurityError' || e.name === 'SECURITY_ERR' || e.message === 'SecurityError') { | ||
taintedCallback(imageURL, callbackArgs); | ||
} else { | ||
throw e; | ||
} | ||
} | ||
} | ||
} | ||
if (finallyCallback) { | ||
finallyCallback(imageURL, callbackArgs); | ||
} | ||
}; | ||
img.onerror = function () { | ||
failedLoadCallback(imageURL, callbackArgs); | ||
if (finallyCallback) { | ||
finallyCallback(imageURL, callbackArgs); | ||
} | ||
}; | ||
img.src = imageURL; | ||
}, | ||
// Get blob URL from SVG code. Falls back to normal data URI. | ||
svgToDataUrl = function (svg) { | ||
try { | ||
// Safari requires data URI since it doesn't allow navigation to blob URLs | ||
// Firefox has an issue with Blobs and internal references, leading to gradients not working using Blobs (#4550) | ||
if (!webKit && navigator.userAgent.toLowerCase().indexOf('firefox') < 0) { | ||
return domurl.createObjectURL(new Blob([svg], { type: 'image/svg+xml;charset-utf-16'})); | ||
} | ||
} catch (e) { | ||
// Ignore | ||
} | ||
return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svg); | ||
}, | ||
// Download contents by dataURL/blob | ||
download = function (dataURL, extension) { | ||
var a = document.createElement('a'), | ||
filename = (options.filename || 'chart') + '.' + extension, | ||
windowRef; | ||
// IE specific blob implementation | ||
if (navigator.msSaveOrOpenBlob) { | ||
navigator.msSaveOrOpenBlob(dataURL, filename); | ||
return; | ||
} | ||
// Try HTML5 download attr if supported | ||
if (typeof a.download !== 'undefined') { | ||
a.href = dataURL; | ||
a.download = filename; // HTML5 download attribute | ||
a.target = '_blank'; | ||
document.body.appendChild(a); | ||
a.click(); | ||
document.body.removeChild(a); | ||
} else { | ||
// No download attr, just opening data URI | ||
if (finallyCallback) { | ||
finallyCallback(imageURL, callbackArgs); | ||
} | ||
}; | ||
img.onerror = function () { | ||
failedLoadCallback(imageURL, callbackArgs); | ||
if (finallyCallback) { | ||
finallyCallback(imageURL, callbackArgs); | ||
} | ||
}; | ||
img.src = imageURL; | ||
}, | ||
// Get blob URL from SVG code. Falls back to normal data URI. | ||
svgToDataUrl = function (svg) { | ||
try { | ||
windowRef = window.open(dataURL, 'chart'); | ||
if (typeof windowRef === 'undefined' || windowRef === null) { | ||
throw 1; | ||
// Safari requires data URI since it doesn't allow navigation to blob URLs | ||
// Firefox has an issue with Blobs and internal references, leading to gradients not working using Blobs (#4550) | ||
if (!webKit && navigator.userAgent.toLowerCase().indexOf('firefox') < 0) { | ||
return domurl.createObjectURL(new Blob([svg], { type: 'image/svg+xml;charset-utf-16' })); | ||
} | ||
} catch (e) { | ||
// window.open failed, trying location.href | ||
window.location.href = dataURL; | ||
// Ignore | ||
} | ||
} | ||
}, | ||
// Get data URL to an image of the chart and call download on it | ||
initiateDownload = function () { | ||
var svgurl, | ||
blob, | ||
svg = chart.sanitizeSVG(chartCopyContainer.innerHTML); // SVG of chart copy | ||
return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svg); | ||
}, | ||
// Download contents by dataURL/blob | ||
download = function (dataURL, extension) { | ||
var a = document.createElement('a'), | ||
filename = (options.filename || 'chart') + '.' + extension, | ||
windowRef; | ||
// Initiate download depending on file type | ||
if (options && options.type === 'image/svg+xml') { | ||
// SVG download. In this case, we want to use Microsoft specific Blob if available | ||
try { | ||
if (navigator.msSaveOrOpenBlob) { | ||
blob = new MSBlobBuilder(); | ||
blob.append(svg); | ||
svgurl = blob.getBlob('image/svg+xml'); | ||
} else { | ||
svgurl = svgToDataUrl(svg); | ||
} | ||
download(svgurl, 'svg'); | ||
} catch (e) { | ||
fallbackToExportServer(); | ||
// IE specific blob implementation | ||
if (navigator.msSaveOrOpenBlob) { | ||
navigator.msSaveOrOpenBlob(dataURL, filename); | ||
return; | ||
} | ||
} else { | ||
// PNG download - create bitmap from SVG | ||
// First, try to get PNG by rendering on canvas | ||
svgurl = svgToDataUrl(svg); | ||
imageToDataUrl(svgurl, { /* args */ }, function (imageURL) { | ||
// Success | ||
// Try HTML5 download attr if supported | ||
if (a.download !== undefined) { | ||
a.href = dataURL; | ||
a.download = filename; // HTML5 download attribute | ||
a.target = '_blank'; | ||
document.body.appendChild(a); | ||
a.click(); | ||
document.body.removeChild(a); | ||
} else { | ||
// No download attr, just opening data URI | ||
try { | ||
download(imageURL, 'png'); | ||
windowRef = window.open(dataURL, 'chart'); | ||
if (windowRef === undefined || windowRef === null) { | ||
throw 1; | ||
} | ||
} catch (e) { | ||
fallbackToExportServer(); | ||
// window.open failed, trying location.href | ||
window.location.href = dataURL; | ||
} | ||
}, function () { | ||
// Failed due to tainted canvas | ||
// Create new and untainted canvas | ||
var canvas = document.createElement('canvas'), | ||
ctx = canvas.getContext('2d'), | ||
imageWidth = svg.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale, | ||
imageHeight = svg.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale, | ||
downloadWithCanVG = function () { | ||
ctx.drawSvg(svg, 0, 0, imageWidth, imageHeight); | ||
try { | ||
download(navigator.msSaveOrOpenBlob ? canvas.msToBlob() : canvas.toDataURL('image/png'), 'png'); | ||
} catch (e) { | ||
fallbackToExportServer(); | ||
} | ||
}; | ||
} | ||
}, | ||
// Get data URL to an image of the chart and call download on it | ||
initiateDownload = function () { | ||
var svgurl, | ||
blob, | ||
svg = chart.sanitizeSVG(chartCopyContainer.innerHTML); // SVG of chart copy | ||
canvas.width = imageWidth; | ||
canvas.height = imageHeight; | ||
if (window.canvg) { | ||
// Use preloaded canvg | ||
downloadWithCanVG(); | ||
} else { | ||
// Must load canVG first | ||
chart.showLoading(); | ||
HighchartsAdapter.getScript(Highcharts.getOptions().global.canvasToolsURL, function () { | ||
chart.hideLoading(); | ||
downloadWithCanVG(); | ||
}); | ||
} | ||
}, | ||
// No canvas support | ||
fallbackToExportServer, | ||
// Failed to load image | ||
fallbackToExportServer, | ||
// Finally | ||
function () { | ||
// Initiate download depending on file type | ||
if (options && options.type === 'image/svg+xml') { | ||
// SVG download. In this case, we want to use Microsoft specific Blob if available | ||
try { | ||
domurl.revokeObjectURL(svgurl); | ||
if (navigator.msSaveOrOpenBlob) { | ||
blob = new MSBlobBuilder(); | ||
blob.append(svg); | ||
svgurl = blob.getBlob('image/svg+xml'); | ||
} else { | ||
svgurl = svgToDataUrl(svg); | ||
} | ||
download(svgurl, 'svg'); | ||
} catch (e) { | ||
// Ignore | ||
fallbackToExportServer(); | ||
} | ||
}); | ||
} | ||
}; | ||
} else { | ||
// PNG download - create bitmap from SVG | ||
// First, try to get PNG by rendering on canvas | ||
svgurl = svgToDataUrl(svg); | ||
imageToDataUrl(svgurl, { /* args */ }, function (imageURL) { | ||
// Success | ||
try { | ||
download(imageURL, 'png'); | ||
} catch (e) { | ||
fallbackToExportServer(); | ||
} | ||
}, function () { | ||
// Failed due to tainted canvas | ||
// Create new and untainted canvas | ||
var canvas = document.createElement('canvas'), | ||
ctx = canvas.getContext('2d'), | ||
imageWidth = svg.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale, | ||
imageHeight = svg.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale, | ||
downloadWithCanVG = function () { | ||
ctx.drawSvg(svg, 0, 0, imageWidth, imageHeight); | ||
try { | ||
download(navigator.msSaveOrOpenBlob ? canvas.msToBlob() : canvas.toDataURL('image/png'), 'png'); | ||
} catch (e) { | ||
fallbackToExportServer(); | ||
} | ||
}; | ||
// Hook into getSVG to get a copy of the chart copy's container | ||
Highcharts.wrap(Highcharts.Chart.prototype, 'getChartHTML', function (proceed) { | ||
chartCopyContainer = this.container.cloneNode(true); | ||
return proceed.apply(this, Array.prototype.slice.call(arguments, 1)); | ||
}); | ||
canvas.width = imageWidth; | ||
canvas.height = imageHeight; | ||
if (window.canvg) { | ||
// Use preloaded canvg | ||
downloadWithCanVG(); | ||
} else { | ||
// Must load canVG first | ||
chart.showLoading(); | ||
Highcharts.getScript(Highcharts.getOptions().global.canvasToolsURL, function () { | ||
chart.hideLoading(); | ||
downloadWithCanVG(); | ||
}); | ||
} | ||
}, | ||
// No canvas support | ||
fallbackToExportServer, | ||
// Failed to load image | ||
fallbackToExportServer, | ||
// Finally | ||
function () { | ||
try { | ||
domurl.revokeObjectURL(svgurl); | ||
} catch (e) { | ||
// Ignore | ||
} | ||
}); | ||
} | ||
}, | ||
// Success handler, we converted image to base64! | ||
embeddedSuccess = function (imageURL, callbackArgs) { | ||
++imagesEmbedded; | ||
// Trigger hook to get chart copy | ||
chart.getSVGForExport(options, chartOptions); | ||
images = chartCopyContainer.getElementsByTagName('image'); | ||
// Change image href in chart copy | ||
callbackArgs.imageElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', imageURL); | ||
try { | ||
// If there are no images to embed, just go ahead and start the download process | ||
if (!images.length) { | ||
initiateDownload(); | ||
} | ||
// Start download when done with the last image | ||
if (imagesEmbedded === images.length) { | ||
initiateDownload(); | ||
} | ||
}; | ||
// Success handler, we converted image to base64! | ||
function embeddedSuccess(imageURL, callbackArgs) { | ||
++imagesEmbedded; | ||
// Hook into getSVG to get a copy of the chart copy's container | ||
Highcharts.wrap(Highcharts.Chart.prototype, 'getChartHTML', function (proceed) { | ||
chartCopyContainer = this.container.cloneNode(true); | ||
return proceed.apply(this, Array.prototype.slice.call(arguments, 1)); | ||
}); | ||
// Change image href in chart copy | ||
callbackArgs.imageElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', imageURL); | ||
// Trigger hook to get chart copy | ||
chart.getSVGForExport(options, chartOptions); | ||
images = chartCopyContainer.getElementsByTagName('image'); | ||
// Start download when done with the last image | ||
if (imagesEmbedded === images.length) { | ||
try { | ||
// If there are no images to embed, just go ahead and start the download process | ||
if (!images.length) { | ||
initiateDownload(); | ||
} | ||
// Go through the images we want to embed | ||
for (i = 0, l = images.length; i < l; ++i) { | ||
el = images[i]; | ||
imageToDataUrl(el.getAttributeNS('http://www.w3.org/1999/xlink', 'href'), { imageElement: el }, | ||
embeddedSuccess, | ||
// Tainted canvas | ||
fallbackToExportServer, | ||
// No canvas support | ||
fallbackToExportServer, | ||
// Failed to load source | ||
fallbackToExportServer | ||
); | ||
} | ||
} catch (e) { | ||
fallbackToExportServer(); | ||
} | ||
}; | ||
// Go through the images we want to embed | ||
for (i = 0, l = images.length; i < l; ++i) { | ||
el = images[i]; | ||
imageToDataUrl(el.getAttributeNS('http://www.w3.org/1999/xlink', 'href'), { imageElement: el }, | ||
embeddedSuccess, | ||
// Tainted canvas | ||
fallbackToExportServer, | ||
// No canvas support | ||
fallbackToExportServer, | ||
// Failed to load source | ||
fallbackToExportServer | ||
); | ||
// Extend the default options to use the local exporter logic | ||
Highcharts.getOptions().exporting.buttons.contextButton.menuItems = [{ | ||
textKey: 'printChart', | ||
onclick: function () { | ||
this.print(); | ||
} | ||
} catch (e) { | ||
fallbackToExportServer(); | ||
} | ||
}; | ||
}, { | ||
separator: true | ||
}, { | ||
textKey: 'downloadPNG', | ||
onclick: function () { | ||
this.exportChartLocal(); | ||
} | ||
}, { | ||
textKey: 'downloadSVG', | ||
onclick: function () { | ||
this.exportChartLocal({ | ||
type: 'image/svg+xml' | ||
}); | ||
} | ||
}]; | ||
// Extend the default options to use the local exporter logic | ||
Highcharts.getOptions().exporting.buttons.contextButton.menuItems = [{ | ||
textKey: 'printChart', | ||
onclick: function () { | ||
this.print(); | ||
} | ||
}, { | ||
separator: true | ||
}, { | ||
textKey: 'downloadPNG', | ||
onclick: function () { | ||
this.exportChartLocal(); | ||
} | ||
}, { | ||
textKey: 'downloadSVG', | ||
onclick: function () { | ||
this.exportChartLocal({ | ||
type: 'image/svg+xml' | ||
}); | ||
} | ||
}]; | ||
}(Highcharts)); | ||
})); |
/* | ||
Highmaps JS v1.1.9 (2015-10-07) | ||
Highmaps JS v1.1.10 (2015-12-07) | ||
@@ -9,23 +9,23 @@ (c) 2014 Highsoft AS | ||
*/ | ||
(function(h){var j=h.seriesTypes,A=h.map,o=h.merge,t=h.extend,u=h.extendClass,v=h.getOptions().plotOptions,w=function(){},k=h.each,r=HighchartsAdapter.grep,i=h.pick,m=h.Series,x=h.Color,B=function(a,b,c){var d,c=c||this;for(d in a)a.hasOwnProperty(d)&&b.call(c,a[d],d,a)},y=function(a,b,c,d){d=d||this;a=a||[];k(a,function(e,f){c=b.call(d,c,e,f,a)});return c},q=function(a,b,c){c=c||this;a=b.call(c,a);a!==!1&&q(a,b,c)};v.treemap=o(v.scatter,{showInLegend:!1,marker:!1,borderColor:"#E0E0E0",borderWidth:1, | ||
dataLabels:{enabled:!0,defer:!1,verticalAlign:"middle",formatter:function(){return this.point.name||this.point.id},inside:!0},tooltip:{headerFormat:"",pointFormat:"<b>{point.name}</b>: {point.node.val}</b><br/>"},layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,states:{hover:{borderColor:"#A0A0A0",brightness:j.heatmap?0:0.1,shadow:!1}},drillUpButton:{position:{align:"left",x:10,y:-50}}});j.treemap=u(j.scatter,o({pointAttrToOptions:{}, | ||
pointArrayMap:["value"],axisTypes:j.heatmap?["xAxis","yAxis","colorAxis"]:["xAxis","yAxis"],optionalAxis:"colorAxis",getSymbol:w,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",translateColors:j.heatmap&&j.heatmap.prototype.translateColors},{type:"treemap",trackerGroups:["group","dataLabelsGroup"],pointClass:u(h.Point,{setVisible:j.pie.prototype.pointClass.prototype.setVisible}),getListOfParents:function(a,b){var c=y(a,function(a,c,b){c=i(c.parent,"");a[c]===void 0&&(a[c]=[]); | ||
a[c].push(b);return a},{});B(c,function(a,c,f){c!==""&&HighchartsAdapter.inArray(c,b)===-1&&(k(a,function(a){f[""].push(a)}),delete f[c])});return c},getTree:function(){var a,b=this;a=A(this.data,function(a){return a.id});a=b.getListOfParents(this.data,a);b.nodeMap=[];a=b.buildNode("",-1,0,a,null);q(this.nodeMap[this.rootNode],function(a){var d=!1,e=a.parent;a.visible=!0;if(e||e==="")d=b.nodeMap[e];return d});q(this.nodeMap[this.rootNode].children,function(a){var b=!1;k(a,function(a){a.visible=!0; | ||
a.children.length&&(b=(b||[]).concat(a.children))});return b});this.setTreeValues(a);return a},init:function(a,b){m.prototype.init.call(this,a,b);this.options.allowDrillToNode&&this.drillTo()},buildNode:function(a,b,c,d,e){var f=this,g=[],n=f.points[b],z;k(d[a]||[],function(b){z=f.buildNode(f.points[b].id,b,c+1,d,a);g.push(z)});b={id:a,i:b,children:g,level:c,parent:e,visible:!1};f.nodeMap[b.id]=b;if(n)n.node=b;return b},setTreeValues:function(a){var b=this,c=b.options,d=0,e=[],f,g=b.points[a.i];k(a.children, | ||
function(a){a=b.setTreeValues(a);b.insertElementSorted(e,a,function(a,c){return a.val>c.val});a.ignore?q(a.children,function(a){var c=!1;k(a,function(a){t(a,{ignore:!0,isLeaf:!1,visible:!1});a.children.length&&(c=(c||[]).concat(a.children))});return c}):d+=a.val});f=i(g&&g.value,d);t(a,{children:e,childrenTotal:d,ignore:!(i(g&&g.visible,!0)&&f>0),isLeaf:a.visible&&!d,levelDynamic:c.levelIsConstant?a.level:a.level-b.nodeMap[b.rootNode].level,name:i(g&&g.name,""),val:f});return a},calculateChildrenAreas:function(a, | ||
b){var c=this,d=c.options,e=this.levelMap[a.levelDynamic+1],f=i(c[e&&e.layoutAlgorithm]&&e.layoutAlgorithm,d.layoutAlgorithm),g=d.alternateStartingDirection,n=[],d=r(a.children,function(a){return!a.ignore});if(e&&e.layoutStartingDirection)b.direction=e.layoutStartingDirection==="vertical"?0:1;n=c[f](b,d);k(d,function(a,d){var e=n[d];a.values=o(e,{val:a.childrenTotal,direction:g?1-b.direction:b.direction});a.pointValues=o(e,{x:e.x/c.axisRatio,width:e.width/c.axisRatio});a.children.length&&c.calculateChildrenAreas(a, | ||
a.values)})},setPointValues:function(){var a=this.xAxis,b=this.yAxis;k(this.points,function(c){var d=c.node.pointValues,e,f,g;d?(e=Math.round(a.translate(d.x,0,0,0,1)),f=Math.round(a.translate(d.x+d.width,0,0,0,1)),g=Math.round(b.translate(d.y,0,0,0,1)),d=Math.round(b.translate(d.y+d.height,0,0,0,1)),c.shapeType="rect",c.shapeArgs={x:Math.min(e,f),y:Math.min(g,d),width:Math.abs(f-e),height:Math.abs(d-g)},c.plotX=c.shapeArgs.x+c.shapeArgs.width/2,c.plotY=c.shapeArgs.y+c.shapeArgs.height/2):(delete c.plotX, | ||
delete c.plotY)})},setColorRecursive:function(a,b){var c=this,d,e;if(a){d=c.points[a.i];e=c.levelMap[a.levelDynamic];b=i(d&&d.options.color,e&&e.color,b);if(d)d.color=b;a.children.length&&k(a.children,function(a){c.setColorRecursive(a,b)})}},alg_func_group:function(a,b,c,d){this.height=a;this.width=b;this.plot=d;this.startDirection=this.direction=c;this.lH=this.nH=this.lW=this.nW=this.total=0;this.elArr=[];this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(a,c){return Math.max(a/ | ||
c,c/a)}};this.addElement=function(a){this.lP.total=this.elArr[this.elArr.length-1];this.total+=a;this.direction===0?(this.lW=this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,this.lP.lH),this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW,this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/this.nH,this.lP.nR= | ||
this.lP.aspectRatio(this.lP.nW,this.nH));this.elArr.push(a)};this.reset=function(){this.lW=this.nW=0;this.elArr=[];this.total=0}},alg_func_calcPoints:function(a,b,c,d){var e,f,g,n,h=c.lW,s=c.lH,l=c.plot,j,i=0,p=c.elArr.length-1;b?(h=c.nW,s=c.nH):j=c.elArr[c.elArr.length-1];k(c.elArr,function(a){if(b||i<p)c.direction===0?(e=l.x,f=l.y,g=h,n=a/g):(e=l.x,f=l.y,n=s,g=a/n),d.push({x:e,y:f,width:g,height:n}),c.direction===0?l.y+=n:l.x+=g;i+=1});c.reset();c.direction===0?c.width-=h:c.height-=s;l.y=l.parent.y+ | ||
(l.parent.height-c.height);l.x=l.parent.x+(l.parent.width-c.width);if(a)c.direction=1-c.direction;b||c.addElement(j)},alg_func_lowAspectRatio:function(a,b,c){var d=[],e=this,f,g={x:b.x,y:b.y,parent:b},h=0,j=c.length-1,i=new this.alg_func_group(b.height,b.width,b.direction,g);k(c,function(c){f=b.width*b.height*(c.val/b.val);i.addElement(f);i.lP.nR>i.lP.lR&&e.alg_func_calcPoints(a,!1,i,d,g);h===j&&e.alg_func_calcPoints(a,!0,i,d,g);h+=1});return d},alg_func_fill:function(a,b,c){var d=[],e,f=b.direction, | ||
g=b.x,h=b.y,i=b.width,j=b.height,l,o,m,p;k(c,function(c){e=b.width*b.height*(c.val/b.val);l=g;o=h;f===0?(p=j,m=e/p,i-=m,g+=m):(m=i,p=e/m,j-=p,h+=p);d.push({x:l,y:o,width:m,height:p});a&&(f=1-f)});return d},strip:function(a,b){return this.alg_func_lowAspectRatio(!1,a,b)},squarified:function(a,b){return this.alg_func_lowAspectRatio(!0,a,b)},sliceAndDice:function(a,b){return this.alg_func_fill(!0,a,b)},stripes:function(a,b){return this.alg_func_fill(!1,a,b)},translate:function(){var a,b;m.prototype.translate.call(this); | ||
if(this.points.length)this.rootNode=i(this.options.rootId,""),this.levelMap=y(this.options.levels,function(a,b){a[b.level]=b;return a},{}),b=this.tree=this.getTree(),this.axisRatio=this.xAxis.len/this.yAxis.len,this.nodeMap[""].pointValues=a={x:0,y:0,width:100,height:100},this.nodeMap[""].values=a=o(a,{width:a.width*this.axisRatio,direction:this.options.layoutStartingDirection==="vertical"?0:1,val:b.val}),this.calculateChildrenAreas(b,a);this.colorAxis?this.translateColors():this.options.colorByPoint|| | ||
this.setColorRecursive(this.tree,void 0);b=this.nodeMap[this.rootNode].pointValues;this.xAxis.setExtremes(b.x,b.x+b.width,!1);this.yAxis.setExtremes(b.y,b.y+b.height,!1);this.xAxis.setScale();this.yAxis.setScale();this.setPointValues()},drawDataLabels:function(){var a=this,b=r(a.points,function(a){return a.node.visible}),c,d;k(b,function(b){d=a.levelMap[b.node.levelDynamic];c={style:{}};if(!b.node.isLeaf)c.enabled=!1;if(d&&d.dataLabels)c=o(c,d.dataLabels),a._hasPointLabels=!0;if(b.shapeArgs)c.style.width= | ||
b.shapeArgs.width;b.dlOptions=o(c,b.options.dataLabels)});m.prototype.drawDataLabels.call(this)},alignDataLabel:j.column.prototype.alignDataLabel,pointAttribs:function(a,b){var c=this.levelMap[a.node.levelDynamic]||{},d=this.options,e=b&&d.states[b]||{},c={stroke:a.borderColor||c.borderColor||e.borderColor||d.borderColor,"stroke-width":i(a.borderWidth,c.borderWidth,e.borderWidth,d.borderWidth),dashstyle:a.borderDashStyle||c.borderDashStyle||e.borderDashStyle||d.borderDashStyle,fill:a.color||this.color}; | ||
if(b==="hover")c.zIndex=1;if(a.node.level<=this.nodeMap[this.rootNode].level)c.fill="none",c["stroke-width"]=0;else if(a.node.isLeaf){if(b)c.fill=x(c.fill).brighten(e.brightness).get()}else c.fill=i(d.interactByLeaf,!d.allowDrillToNode)?"none":x(c.fill).setOpacity(b==="hover"?0.75:0.15).get();return c},drawPoints:function(){var a=this,b=r(a.points,function(a){return a.node.visible});k(b,function(c){var b="levelGroup-"+c.node.levelDynamic;a[b]||(a[b]=a.chart.renderer.g(b).attr({zIndex:1E3-c.node.levelDynamic}).add(a.group)); | ||
c.group=a[b];c.pointAttr={"":a.pointAttribs(c),hover:a.pointAttribs(c,"hover"),select:{}}});j.column.prototype.drawPoints.call(this);a.options.allowDrillToNode&&k(b,function(b){var d;if(b.graphic)d=b.drillId=a.options.interactByLeaf?a.drillToByLeaf(b):a.drillToByGroup(b),b.graphic.css({cursor:d?"pointer":"default"})})},insertElementSorted:function(a,b,c){var d=0,e=!1;a.length!==0&&k(a,function(f){c(b,f)&&!e&&(a.splice(d,0,b),e=!0);d+=1});e||a.push(b)},drillTo:function(){var a=this;h.addEvent(a,"click", | ||
function(b){var b=b.point,c=b.drillId,d;c&&(d=a.nodeMap[a.rootNode].name||a.rootNode,b.setState(""),a.drillToNode(c),a.showDrillUpButton(d))})},drillToByGroup:function(a){var b=!1;if(a.node.level-this.nodeMap[this.rootNode].level===1&&!a.node.isLeaf)b=a.id;return b},drillToByLeaf:function(a){var b=!1;if(a.node.parent!==this.rootNode&&a.node.isLeaf)for(a=a.node;!b;)if(a=this.nodeMap[a.parent],a.parent===this.rootNode)b=a.id;return b},drillUp:function(){var a=null;this.rootNode&&(a=this.nodeMap[this.rootNode], | ||
a=a.parent!==null?this.nodeMap[a.parent]:this.nodeMap[""]);if(a!==null)this.drillToNode(a.id),a.id===""?this.drillUpButton=this.drillUpButton.destroy():(a=this.nodeMap[a.parent],this.showDrillUpButton(a.name||a.id))},drillToNode:function(a){this.options.rootId=a;this.isDirty=!0;this.chart.redraw()},showDrillUpButton:function(a){var b=this,a=a||"< Back",c=b.options.drillUpButton,d,e;if(c.text)a=c.text;this.drillUpButton?this.drillUpButton.attr({text:a}).align():(e=(d=c.theme)&&d.states,this.drillUpButton= | ||
this.chart.renderer.button(a,null,null,function(){b.drillUp()},d,e&&e.hover,e&&e.select).attr({align:c.position.align,zIndex:9}).add().align(c.position,!1,c.relativeTo||"plotBox"))},buildKDTree:w,drawLegendSymbol:h.LegendSymbolMixin.drawRectangle,getExtremes:function(){m.prototype.getExtremes.call(this,this.colorValueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;m.prototype.getExtremes.call(this)},getExtremesFromAll:!0,bindAxes:function(){var a={endOnTick:!1,gridLineWidth:0,lineWidth:0, | ||
min:0,dataMin:0,minPadding:0,max:100,dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};m.prototype.bindAxes.call(this);h.extend(this.yAxis.options,a);h.extend(this.xAxis.options,a)}}))})(Highcharts); | ||
(function(f){typeof module==="object"&&module.exports?module.exports=f:f(Highcharts)})(function(f){var j=f.seriesTypes,A=f.map,o=f.merge,t=f.extend,u=f.extendClass,v=f.getOptions().plotOptions,w=function(){},k=f.each,s=f.grep,i=f.pick,m=f.Series,B=f.stableSort,x=f.Color,C=function(a,b,c){var d,c=c||this;for(d in a)a.hasOwnProperty(d)&&b.call(c,a[d],d,a)},y=function(a,b,c,d){d=d||this;a=a||[];k(a,function(e,g){c=b.call(d,c,e,g,a)});return c},r=function(a,b,c){c=c||this;a=b.call(c,a);a!==!1&&r(a,b, | ||
c)};v.treemap=o(v.scatter,{showInLegend:!1,marker:!1,borderColor:"#E0E0E0",borderWidth:1,dataLabels:{enabled:!0,defer:!1,verticalAlign:"middle",formatter:function(){return this.point.name||this.point.id},inside:!0},tooltip:{headerFormat:"",pointFormat:"<b>{point.name}</b>: {point.node.val}</b><br/>"},layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,states:{hover:{borderColor:"#A0A0A0",brightness:j.heatmap?0:0.1,shadow:!1}},drillUpButton:{position:{align:"right", | ||
x:-10,y:10}}});j.treemap=u(j.scatter,o({pointAttrToOptions:{},pointArrayMap:["value"],axisTypes:j.heatmap?["xAxis","yAxis","colorAxis"]:["xAxis","yAxis"],optionalAxis:"colorAxis",getSymbol:w,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",translateColors:j.heatmap&&j.heatmap.prototype.translateColors},{type:"treemap",trackerGroups:["group","dataLabelsGroup"],pointClass:u(f.Point,{setVisible:j.pie.prototype.pointClass.prototype.setVisible}),getListOfParents:function(a,b){var c= | ||
y(a,function(a,c,b){c=i(c.parent,"");a[c]===void 0&&(a[c]=[]);a[c].push(b);return a},{});C(c,function(a,c,g){c!==""&&f.inArray(c,b)===-1&&(k(a,function(a){g[""].push(a)}),delete g[c])});return c},getTree:function(){var a,b=this;a=A(this.data,function(a){return a.id});a=b.getListOfParents(this.data,a);b.nodeMap=[];a=b.buildNode("",-1,0,a,null);r(this.nodeMap[this.rootNode],function(a){var d=!1,e=a.parent;a.visible=!0;if(e||e==="")d=b.nodeMap[e];return d});r(this.nodeMap[this.rootNode].children,function(a){var b= | ||
!1;k(a,function(a){a.visible=!0;a.children.length&&(b=(b||[]).concat(a.children))});return b});this.setTreeValues(a);return a},init:function(a,b){m.prototype.init.call(this,a,b);this.options.allowDrillToNode&&this.drillTo()},buildNode:function(a,b,c,d,e){var g=this,h=[],z=g.points[b],q;k(d[a]||[],function(b){q=g.buildNode(g.points[b].id,b,c+1,d,a);h.push(q)});b={id:a,i:b,children:h,level:c,parent:e,visible:!1};g.nodeMap[b.id]=b;if(z)z.node=b;return b},setTreeValues:function(a){var b=this,c=b.options, | ||
d=0,e=[],g,h=b.points[a.i];k(a.children,function(a){a=b.setTreeValues(a);e.push(a);a.ignore?r(a.children,function(a){var c=!1;k(a,function(a){t(a,{ignore:!0,isLeaf:!1,visible:!1});a.children.length&&(c=(c||[]).concat(a.children))});return c}):d+=a.val});B(e,function(a,c){return a.sortIndex-c.sortIndex});g=i(h&&h.value,d);t(a,{children:e,childrenTotal:d,ignore:!(i(h&&h.visible,!0)&&g>0),isLeaf:a.visible&&!d,levelDynamic:c.levelIsConstant?a.level:a.level-b.nodeMap[b.rootNode].level,name:i(h&&h.name, | ||
""),sortIndex:i(h&&h.sortIndex,-g),val:g});return a},calculateChildrenAreas:function(a,b){var c=this,d=c.options,e=this.levelMap[a.levelDynamic+1],g=i(c[e&&e.layoutAlgorithm]&&e.layoutAlgorithm,d.layoutAlgorithm),h=d.alternateStartingDirection,f=[],d=s(a.children,function(a){return!a.ignore});if(e&&e.layoutStartingDirection)b.direction=e.layoutStartingDirection==="vertical"?0:1;f=c[g](b,d);k(d,function(a,d){var e=f[d];a.values=o(e,{val:a.childrenTotal,direction:h?1-b.direction:b.direction});a.pointValues= | ||
o(e,{x:e.x/c.axisRatio,width:e.width/c.axisRatio});a.children.length&&c.calculateChildrenAreas(a,a.values)})},setPointValues:function(){var a=this.xAxis,b=this.yAxis;k(this.points,function(c){var d=c.node.pointValues,e,g,h;d?(e=Math.round(a.translate(d.x,0,0,0,1)),g=Math.round(a.translate(d.x+d.width,0,0,0,1)),h=Math.round(b.translate(d.y,0,0,0,1)),d=Math.round(b.translate(d.y+d.height,0,0,0,1)),c.shapeType="rect",c.shapeArgs={x:Math.min(e,g),y:Math.min(h,d),width:Math.abs(g-e),height:Math.abs(d- | ||
h)},c.plotX=c.shapeArgs.x+c.shapeArgs.width/2,c.plotY=c.shapeArgs.y+c.shapeArgs.height/2):(delete c.plotX,delete c.plotY)})},setColorRecursive:function(a,b){var c=this,d,e;if(a){d=c.points[a.i];e=c.levelMap[a.levelDynamic];b=i(d&&d.options.color,e&&e.color,b);if(d)d.color=b;a.children.length&&k(a.children,function(a){c.setColorRecursive(a,b)})}},algorithmGroup:function(a,b,c,d){this.height=a;this.width=b;this.plot=d;this.startDirection=this.direction=c;this.lH=this.nH=this.lW=this.nW=this.total=0; | ||
this.elArr=[];this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(a,c){return Math.max(a/c,c/a)}};this.addElement=function(a){this.lP.total=this.elArr[this.elArr.length-1];this.total+=a;this.direction===0?(this.lW=this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,this.lP.lH),this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW, | ||
this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/this.nH,this.lP.nR=this.lP.aspectRatio(this.lP.nW,this.nH));this.elArr.push(a)};this.reset=function(){this.lW=this.nW=0;this.elArr=[];this.total=0}},algorithmCalcPoints:function(a,b,c,d){var e,g,h,f,q=c.lW,n=c.lH,l=c.plot,i,j=0,p=c.elArr.length-1;b?(q=c.nW,n=c.nH):i=c.elArr[c.elArr.length-1];k(c.elArr,function(a){if(b||j<p)c.direction===0?(e=l.x,g=l.y,h=q,f=a/h):(e=l.x,g=l.y,f=n,h=a/f),d.push({x:e,y:g,width:h,height:f}),c.direction=== | ||
0?l.y+=f:l.x+=h;j+=1});c.reset();c.direction===0?c.width-=q:c.height-=n;l.y=l.parent.y+(l.parent.height-c.height);l.x=l.parent.x+(l.parent.width-c.width);if(a)c.direction=1-c.direction;b||c.addElement(i)},algorithmLowAspectRatio:function(a,b,c){var d=[],e=this,g,f={x:b.x,y:b.y,parent:b},i=0,j=c.length-1,n=new this.algorithmGroup(b.height,b.width,b.direction,f);k(c,function(c){g=b.width*b.height*(c.val/b.val);n.addElement(g);n.lP.nR>n.lP.lR&&e.algorithmCalcPoints(a,!1,n,d,f);i===j&&e.algorithmCalcPoints(a, | ||
!0,n,d,f);i+=1});return d},algorithmFill:function(a,b,c){var d=[],e,f=b.direction,h=b.x,i=b.y,j=b.width,n=b.height,l,o,m,p;k(c,function(c){e=b.width*b.height*(c.val/b.val);l=h;o=i;f===0?(p=n,m=e/p,j-=m,h+=m):(m=j,p=e/m,n-=p,i+=p);d.push({x:l,y:o,width:m,height:p});a&&(f=1-f)});return d},strip:function(a,b){return this.algorithmLowAspectRatio(!1,a,b)},squarified:function(a,b){return this.algorithmLowAspectRatio(!0,a,b)},sliceAndDice:function(a,b){return this.algorithmFill(!0,a,b)},stripes:function(a, | ||
b){return this.algorithmFill(!1,a,b)},translate:function(){var a,b;m.prototype.translate.call(this);this.rootNode=i(this.options.rootId,"");this.levelMap=y(this.options.levels,function(a,b){a[b.level]=b;return a},{});b=this.tree=this.getTree();this.axisRatio=this.xAxis.len/this.yAxis.len;this.nodeMap[""].pointValues=a={x:0,y:0,width:100,height:100};this.nodeMap[""].values=a=o(a,{width:a.width*this.axisRatio,direction:this.options.layoutStartingDirection==="vertical"?0:1,val:b.val});this.calculateChildrenAreas(b, | ||
a);this.colorAxis?this.translateColors():this.options.colorByPoint||this.setColorRecursive(this.tree,void 0);b=this.nodeMap[this.rootNode].pointValues;this.xAxis.setExtremes(b.x,b.x+b.width,!1);this.yAxis.setExtremes(b.y,b.y+b.height,!1);this.xAxis.setScale();this.yAxis.setScale();this.setPointValues()},drawDataLabels:function(){var a=this,b=s(a.points,function(a){return a.node.visible}),c,d;k(b,function(b){d=a.levelMap[b.node.levelDynamic];c={style:{}};if(!b.node.isLeaf)c.enabled=!1;if(d&&d.dataLabels)c= | ||
o(c,d.dataLabels),a._hasPointLabels=!0;if(b.shapeArgs)c.style.width=b.shapeArgs.width;b.dlOptions=o(c,b.options.dataLabels)});m.prototype.drawDataLabels.call(this)},alignDataLabel:j.column.prototype.alignDataLabel,pointAttribs:function(a,b){var c=this.levelMap[a.node.levelDynamic]||{},d=this.options,e=b&&d.states[b]||{},c={stroke:a.borderColor||c.borderColor||e.borderColor||d.borderColor,"stroke-width":i(a.borderWidth,c.borderWidth,e.borderWidth,d.borderWidth),dashstyle:a.borderDashStyle||c.borderDashStyle|| | ||
e.borderDashStyle||d.borderDashStyle,fill:a.color||this.color,zIndex:b==="hover"?1:0};if(a.node.level<=this.nodeMap[this.rootNode].level)c.fill="none",c["stroke-width"]=0;else if(a.node.isLeaf){if(b)c.fill=x(c.fill).brighten(e.brightness).get()}else c.fill=i(d.interactByLeaf,!d.allowDrillToNode)?"none":x(c.fill).setOpacity(b==="hover"?0.75:0.15).get();return c},drawPoints:function(){var a=this,b=s(a.points,function(a){return a.node.visible});k(b,function(c){var b="levelGroup-"+c.node.levelDynamic; | ||
a[b]||(a[b]=a.chart.renderer.g(b).attr({zIndex:1E3-c.node.levelDynamic}).add(a.group));c.group=a[b];c.pointAttr={"":a.pointAttribs(c),hover:a.pointAttribs(c,"hover"),select:{}}});j.column.prototype.drawPoints.call(this);a.options.allowDrillToNode&&k(b,function(b){var d;if(b.graphic)d=b.drillId=a.options.interactByLeaf?a.drillToByLeaf(b):a.drillToByGroup(b),b.graphic.css({cursor:d?"pointer":"default"})})},drillTo:function(){var a=this;f.addEvent(a,"click",function(b){var b=b.point,c=b.drillId,d;c&& | ||
(d=a.nodeMap[a.rootNode].name||a.rootNode,b.setState(""),a.drillToNode(c),a.showDrillUpButton(d))})},drillToByGroup:function(a){var b=!1;if(a.node.level-this.nodeMap[this.rootNode].level===1&&!a.node.isLeaf)b=a.id;return b},drillToByLeaf:function(a){var b=!1;if(a.node.parent!==this.rootNode&&a.node.isLeaf)for(a=a.node;!b;)if(a=this.nodeMap[a.parent],a.parent===this.rootNode)b=a.id;return b},drillUp:function(){var a=null;this.rootNode&&(a=this.nodeMap[this.rootNode],a=a.parent!==null?this.nodeMap[a.parent]: | ||
this.nodeMap[""]);if(a!==null)this.drillToNode(a.id),a.id===""?this.drillUpButton=this.drillUpButton.destroy():(a=this.nodeMap[a.parent],this.showDrillUpButton(a.name||a.id))},drillToNode:function(a){this.options.rootId=a;this.isDirty=!0;this.chart.redraw()},showDrillUpButton:function(a){var b=this,a=a||"< Back",c=b.options.drillUpButton,d,e;if(c.text)a=c.text;this.drillUpButton?this.drillUpButton.attr({text:a}).align():(e=(d=c.theme)&&d.states,this.drillUpButton=this.chart.renderer.button(a,null, | ||
null,function(){b.drillUp()},d,e&&e.hover,e&&e.select).attr({align:c.position.align,zIndex:9}).add().align(c.position,!1,c.relativeTo||"plotBox"))},buildKDTree:w,drawLegendSymbol:f.LegendSymbolMixin.drawRectangle,getExtremes:function(){m.prototype.getExtremes.call(this,this.colorValueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;m.prototype.getExtremes.call(this)},getExtremesFromAll:!0,bindAxes:function(){var a={endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,dataMin:0,minPadding:0,max:100, | ||
dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};m.prototype.bindAxes.call(this);f.extend(this.yAxis.options,a);f.extend(this.xAxis.options,a)}}))}); |
/** | ||
* @license Highmaps JS v1.1.9 (2015-10-07) | ||
* @license Highmaps JS v1.1.10 (2015-12-07) | ||
* | ||
@@ -10,4 +10,9 @@ * (c) 2014 Highsoft AS | ||
/*global HighchartsAdapter */ | ||
(function (H) { | ||
(function (factory) { | ||
if (typeof module === 'object' && module.exports) { | ||
module.exports = factory; | ||
} else { | ||
factory(Highcharts); | ||
} | ||
}(function (H) { | ||
var seriesTypes = H.seriesTypes, | ||
@@ -20,7 +25,9 @@ map = H.map, | ||
plotOptions = defaultOptions.plotOptions, | ||
noop = function () { return; }, | ||
noop = function () { | ||
}, | ||
each = H.each, | ||
grep = HighchartsAdapter.grep, | ||
grep = H.grep, | ||
pick = H.pick, | ||
Series = H.Series, | ||
stableSort = H.stableSort, | ||
Color = H.Color, | ||
@@ -86,5 +93,5 @@ eachObject = function (list, func, context) { | ||
position: { | ||
align: 'left', | ||
x: 10, | ||
y: -50 | ||
align: 'right', | ||
x: -10, | ||
y: 10 | ||
} | ||
@@ -123,3 +130,3 @@ } | ||
var listOfParents = reduce(data, function (prev, curr, i) { | ||
var parent = pick(curr.parent, ""); | ||
var parent = pick(curr.parent, ''); | ||
if (prev[parent] === undefined) { | ||
@@ -134,5 +141,5 @@ prev[parent] = []; | ||
eachObject(listOfParents, function (children, parent, list) { | ||
if ((parent !== "") && (HighchartsAdapter.inArray(parent, ids) === -1)) { | ||
if ((parent !== '') && (H.inArray(parent, ids) === -1)) { | ||
each(children, function (child) { | ||
list[""].push(child); | ||
list[''].push(child); | ||
}); | ||
@@ -156,3 +163,3 @@ delete list[parent]; | ||
series.nodeMap = []; | ||
tree = series.buildNode("", -1, 0, parentList, null); | ||
tree = series.buildNode('', -1, 0, parentList, null); | ||
recursive(this.nodeMap[this.rootNode], function (node) { | ||
@@ -162,3 +169,3 @@ var next = false, | ||
node.visible = true; | ||
if (p || p === "") { | ||
if (p || p === '') { | ||
next = series.nodeMap[p]; | ||
@@ -218,3 +225,3 @@ } | ||
childrenTotal = 0, | ||
sorted = [], | ||
children = [], | ||
val, | ||
@@ -226,5 +233,3 @@ point = series.points[tree.i]; | ||
child = series.setTreeValues(child); | ||
series.insertElementSorted(sorted, child, function (el, el2) { | ||
return el.val > el2.val; | ||
}); | ||
children.push(child); | ||
@@ -251,7 +256,10 @@ if (!child.ignore) { | ||
}); | ||
// Sort the children | ||
stableSort(children, function (a, b) { | ||
return a.sortIndex - b.sortIndex; | ||
}); | ||
// Set the values | ||
val = pick(point && point.value, childrenTotal); | ||
extend(tree, { | ||
children: sorted, | ||
children: children, | ||
childrenTotal: childrenTotal, | ||
@@ -262,3 +270,4 @@ // Ignore this node if point is not visible | ||
levelDynamic: (options.levelIsConstant ? tree.level : (tree.level - series.nodeMap[series.rootNode].level)), | ||
name: pick(point && point.name, ""), | ||
name: pick(point && point.name, ''), | ||
sortIndex: pick(point && point.sortIndex, -val), | ||
val: val | ||
@@ -361,3 +370,3 @@ }); | ||
}, | ||
alg_func_group: function (h, w, d, p) { | ||
algorithmGroup: function (h, w, d, p) { | ||
this.height = h; | ||
@@ -417,3 +426,3 @@ this.width = w; | ||
}, | ||
alg_func_calcPoints: function (directionChange, last, group, childrenArea) { | ||
algorithmCalcPoints: function (directionChange, last, group, childrenArea) { | ||
var pX, | ||
@@ -479,3 +488,3 @@ pY, | ||
}, | ||
alg_func_lowAspectRatio: function (directionChange, parent, children) { | ||
algorithmLowAspectRatio: function (directionChange, parent, children) { | ||
var childrenArea = [], | ||
@@ -492,3 +501,3 @@ series = this, | ||
end = children.length - 1, | ||
group = new this.alg_func_group(parent.height, parent.width, direction, plot); | ||
group = new this.algorithmGroup(parent.height, parent.width, direction, plot); | ||
// Loop through and calculate all areas | ||
@@ -499,7 +508,7 @@ each(children, function (child) { | ||
if (group.lP.nR > group.lP.lR) { | ||
series.alg_func_calcPoints(directionChange, false, group, childrenArea, plot); | ||
series.algorithmCalcPoints(directionChange, false, group, childrenArea, plot); | ||
} | ||
// If last child, then calculate all remaining areas | ||
if (i === end) { | ||
series.alg_func_calcPoints(directionChange, true, group, childrenArea, plot); | ||
series.algorithmCalcPoints(directionChange, true, group, childrenArea, plot); | ||
} | ||
@@ -510,3 +519,3 @@ i = i + 1; | ||
}, | ||
alg_func_fill: function (directionChange, parent, children) { | ||
algorithmFill: function (directionChange, parent, children) { | ||
var childrenArea = [], | ||
@@ -551,12 +560,12 @@ pTot, | ||
strip: function (parent, children) { | ||
return this.alg_func_lowAspectRatio(false, parent, children); | ||
return this.algorithmLowAspectRatio(false, parent, children); | ||
}, | ||
squarified: function (parent, children) { | ||
return this.alg_func_lowAspectRatio(true, parent, children); | ||
return this.algorithmLowAspectRatio(true, parent, children); | ||
}, | ||
sliceAndDice: function (parent, children) { | ||
return this.alg_func_fill(true, parent, children); | ||
return this.algorithmFill(true, parent, children); | ||
}, | ||
stripes: function (parent, children) { | ||
return this.alg_func_fill(false, parent, children); | ||
return this.algorithmFill(false, parent, children); | ||
}, | ||
@@ -572,22 +581,20 @@ translate: function () { | ||
if (this.points.length) { | ||
// Assign variables | ||
this.rootNode = pick(this.options.rootId, ""); | ||
// Create a object map from level to options | ||
this.levelMap = reduce(this.options.levels, function (arr, item) { | ||
arr[item.level] = item; | ||
return arr; | ||
}, {}); | ||
tree = this.tree = this.getTree(); // @todo Only if series.isDirtyData is true | ||
// Assign variables | ||
this.rootNode = pick(this.options.rootId, ''); | ||
// Create a object map from level to options | ||
this.levelMap = reduce(this.options.levels, function (arr, item) { | ||
arr[item.level] = item; | ||
return arr; | ||
}, {}); | ||
tree = this.tree = this.getTree(); // @todo Only if series.isDirtyData is true | ||
// Calculate plotting values. | ||
this.axisRatio = (this.xAxis.len / this.yAxis.len); | ||
this.nodeMap[""].pointValues = pointValues = {x: 0, y: 0, width: 100, height: 100 }; | ||
this.nodeMap[""].values = seriesArea = merge(pointValues, { | ||
width: (pointValues.width * this.axisRatio), | ||
direction: (this.options.layoutStartingDirection === 'vertical' ? 0 : 1), | ||
val: tree.val | ||
}); | ||
this.calculateChildrenAreas(tree, seriesArea); | ||
} | ||
// Calculate plotting values. | ||
this.axisRatio = (this.xAxis.len / this.yAxis.len); | ||
this.nodeMap[''].pointValues = pointValues = { x: 0, y: 0, width: 100, height: 100 }; | ||
this.nodeMap[''].values = seriesArea = merge(pointValues, { | ||
width: (pointValues.width * this.axisRatio), | ||
direction: (this.options.layoutStartingDirection === 'vertical' ? 0 : 1), | ||
val: tree.val | ||
}); | ||
this.calculateChildrenAreas(tree, seriesArea); | ||
@@ -627,3 +634,3 @@ // Logic for point colors | ||
// Set options to new object to avoid problems with scope | ||
options = {style: {}}; | ||
options = { style: {} }; | ||
@@ -668,13 +675,10 @@ // If not a leaf, then label should be disabled as default | ||
'dashstyle': point.borderDashStyle || level.borderDashStyle || stateOptions.borderDashStyle || options.borderDashStyle, | ||
'fill': point.color || this.color | ||
'fill': point.color || this.color, | ||
'zIndex': state === 'hover' ? 1 : 0 | ||
}; | ||
if (state === 'hover') { | ||
attr.zIndex = 1; | ||
} | ||
if (point.node.level <= this.nodeMap[this.rootNode].level) { | ||
// Hide levels above the current view | ||
attr.fill = 'none'; | ||
attr["stroke-width"] = 0; | ||
attr['stroke-width'] = 0; | ||
} else if (!point.node.isLeaf) { | ||
@@ -702,3 +706,3 @@ // If not a leaf, then remove fill | ||
each(points, function (point) { | ||
var groupKey = "levelGroup-" + point.node.levelDynamic; | ||
var groupKey = 'levelGroup-' + point.node.levelDynamic; | ||
if (!series[groupKey]) { | ||
@@ -729,3 +733,3 @@ series[groupKey] = series.chart.renderer.g(groupKey) | ||
drillId = point.drillId = series.options.interactByLeaf ? series.drillToByLeaf(point) : series.drillToByGroup(point); | ||
cursor = drillId ? "pointer" : "default"; | ||
cursor = drillId ? 'pointer' : 'default'; | ||
point.graphic.css({ cursor: cursor }); | ||
@@ -737,25 +741,2 @@ } | ||
/** | ||
* Inserts an element into an array, sorted by a condition. | ||
* Modifies the referenced array | ||
* @param {*[]} arr The array which the element is inserted into. | ||
* @param {*} el The element to insert. | ||
* @param {function} cond The condition to sort on. First parameter is el, second parameter is array element | ||
*/ | ||
insertElementSorted: function (arr, el, cond) { | ||
var i = 0, | ||
inserted = false; | ||
if (arr.length !== 0) { | ||
each(arr, function (arrayElement) { | ||
if (cond(el, arrayElement) && !inserted) { | ||
arr.splice(i, 0, el); | ||
inserted = true; | ||
} | ||
i = i + 1; | ||
}); | ||
} | ||
if (!inserted) { | ||
arr.push(el); | ||
} | ||
}, | ||
/** | ||
* Add drilling on the suitable points | ||
@@ -822,3 +803,3 @@ */ | ||
} else { | ||
drillPoint = this.nodeMap[""]; | ||
drillPoint = this.nodeMap['']; | ||
} | ||
@@ -829,3 +810,3 @@ } | ||
this.drillToNode(drillPoint.id); | ||
if (drillPoint.id === "") { | ||
if (drillPoint.id === '') { | ||
this.drillUpButton = this.drillUpButton.destroy(); | ||
@@ -913,2 +894,2 @@ } else { | ||
})); | ||
}(Highcharts)); | ||
})); |
@@ -5,7 +5,8 @@ { | ||
"homepage": "http://www.highcharts.com", | ||
"version": "v1.1.9", | ||
"version": "v1.1.10", | ||
"main": "highmaps.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/highslide-software/highmaps-release" | ||
"url": "https://github.com/highcharts/highmaps-release" | ||
} | ||
} |
@@ -70,3 +70,3 @@ /** | ||
background2: '#F0F0EA' | ||
}; | ||
@@ -73,0 +73,0 @@ |
@@ -100,3 +100,3 @@ /** | ||
background2: '#E0E0E8' | ||
}; | ||
@@ -103,0 +103,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
2316101
46850