var chartUtils = (function () { var exports = {}; exports.override = function (_objA, _objB) { for (var x in _objA) {if (x in _objB) {_objB[x] = _objA[x];}} }; exports.cloneJSON = function(_obj){ return JSON.parse(JSON.stringify(_obj)); }; exports.deepExtend = function extend(destination, source) { for (var property in source) { if (source[property] && source[property].constructor && source[property].constructor === Object) { destination[property] = destination[property] || {}; extend(destination[property], source[property]); } else { destination[property] = source[property]; } } return destination; }; //DOMParser shim for Safari (function(DOMParser) { "use strict"; var DOMParser_proto = DOMParser.prototype, real_parseFromString = DOMParser_proto.parseFromString; try { if ((new DOMParser()).parseFromString("", "text/html")) { return; } } catch (ex) {} DOMParser_proto.parseFromString = function(markup, type) { if (/^\s*text\/html\s*(?:;|$)/i.test(type)) { var doc = document.implementation.createHTMLDocument(""); if (markup.toLowerCase().indexOf(' -1) { doc.documentElement.innerHTML = markup; } else { doc.body.innerHTML = markup; } return doc; } else { return real_parseFromString.apply(this, arguments); } }; }(DOMParser)); exports.throttle = function(func, wait, options) { var context, args, result; var timeout = null; var previous = 0; options = options || {}; var later = function() { previous = options.leading === false ? 0 : new Date(); timeout = null; result = func.apply(context, args); context = args = null; }; return function() { var now = new Date(); if (!previous && options.leading === false) {previous = now;} var remaining = wait - (now - previous); context = this; args = arguments; if (remaining <= 0) { clearTimeout(timeout); timeout = null; previous = now; result = func.apply(context, args); context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; }; }; return exports; })();