From af28b52316a1dd638b73a9850bcc8c22252aa7bd Mon Sep 17 00:00:00 2001 From: Vladimir Petriko Date: Mon, 19 Jan 2015 16:30:00 +0300 Subject: [PATCH] Updates --- build/development/plugins/tauCharts.export.js | 4708 ----------------- build/development/tauCharts.js | 1399 ++--- build/production/tauCharts.min.js | 10 +- 3 files changed, 573 insertions(+), 5544 deletions(-) delete mode 100644 build/development/plugins/tauCharts.export.js diff --git a/build/development/plugins/tauCharts.export.js b/build/development/plugins/tauCharts.export.js deleted file mode 100644 index 0a69d0aa5..000000000 --- a/build/development/plugins/tauCharts.export.js +++ /dev/null @@ -1,4708 +0,0 @@ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - define(['tauCharts'],function(tauCharts){ - return factory(tauCharts); - }); - } else if (typeof module === "object" && module.exports) { - var tauChart = require('tauCharts'); - module.exports = factory(tauCharts); - } else { - factory(root.tauCharts); - } -}(this, function (tauCharts) { -/** - * @license almond 0.3.0 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/almond for details - */ -//Going sloppy to avoid 'use strict' string cost, but strict practices should -//be followed. -/*jslint sloppy: true */ -/*global setTimeout: false */ - -var requirejs, require, define; -(function (undef) { - var main, req, makeMap, handlers, - defined = {}, - waiting = {}, - config = {}, - defining = {}, - hasOwn = Object.prototype.hasOwnProperty, - aps = [].slice, - jsSuffixRegExp = /\.js$/; - - function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - /** - * Given a relative module name, like ./something, normalize it to - * a real name that can be mapped to a path. - * @param {String} name the relative name - * @param {String} baseName a real name that the name arg is relative - * to. - * @returns {String} normalized name - */ - function normalize(name, baseName) { - var nameParts, nameSegment, mapValue, foundMap, lastIndex, - foundI, foundStarMap, starI, i, j, part, - baseParts = baseName && baseName.split("/"), - map = config.map, - starMap = (map && map['*']) || {}; - - //Adjust any relative paths. - if (name && name.charAt(0) === ".") { - //If have a base name, try to normalize against it, - //otherwise, assume it is a top-level require that will - //be relative to baseUrl in the end. - if (baseName) { - //Convert baseName to array, and lop off the last part, - //so that . matches that "directory" and not name of the baseName's - //module. For instance, baseName of "one/two/three", maps to - //"one/two/three.js", but we want the directory, "one/two" for - //this normalization. - baseParts = baseParts.slice(0, baseParts.length - 1); - name = name.split('/'); - lastIndex = name.length - 1; - - // Node .js allowance: - if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { - name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); - } - - name = baseParts.concat(name); - - //start trimDots - for (i = 0; i < name.length; i += 1) { - part = name[i]; - if (part === ".") { - name.splice(i, 1); - i -= 1; - } else if (part === "..") { - if (i === 1 && (name[2] === '..' || name[0] === '..')) { - //End of the line. Keep at least one non-dot - //path segment at the front so it can be mapped - //correctly to disk. Otherwise, there is likely - //no path mapping for a path starting with '..'. - //This can still fail, but catches the most reasonable - //uses of .. - break; - } else if (i > 0) { - name.splice(i - 1, 2); - i -= 2; - } - } - } - //end trimDots - - name = name.join("/"); - } else if (name.indexOf('./') === 0) { - // No baseName, so this is ID is resolved relative - // to baseUrl, pull off the leading dot. - name = name.substring(2); - } - } - - //Apply map config if available. - if ((baseParts || starMap) && map) { - nameParts = name.split('/'); - - for (i = nameParts.length; i > 0; i -= 1) { - nameSegment = nameParts.slice(0, i).join("/"); - - if (baseParts) { - //Find the longest baseName segment match in the config. - //So, do joins on the biggest to smallest lengths of baseParts. - for (j = baseParts.length; j > 0; j -= 1) { - mapValue = map[baseParts.slice(0, j).join('/')]; - - //baseName segment has config, find if it has one for - //this name. - if (mapValue) { - mapValue = mapValue[nameSegment]; - if (mapValue) { - //Match, update name to the new value. - foundMap = mapValue; - foundI = i; - break; - } - } - } - } - - if (foundMap) { - break; - } - - //Check for a star map match, but just hold on to it, - //if there is a shorter segment match later in a matching - //config, then favor over this star map. - if (!foundStarMap && starMap && starMap[nameSegment]) { - foundStarMap = starMap[nameSegment]; - starI = i; - } - } - - if (!foundMap && foundStarMap) { - foundMap = foundStarMap; - foundI = starI; - } - - if (foundMap) { - nameParts.splice(0, foundI, foundMap); - name = nameParts.join('/'); - } - } - - return name; - } - - function makeRequire(relName, forceSync) { - return function () { - //A version of a require function that passes a moduleName - //value for items that may need to - //look up paths relative to the moduleName - var args = aps.call(arguments, 0); - - //If first arg is not require('string'), and there is only - //one arg, it is the array form without a callback. Insert - //a null so that the following concat is correct. - if (typeof args[0] !== 'string' && args.length === 1) { - args.push(null); - } - return req.apply(undef, args.concat([relName, forceSync])); - }; - } - - function makeNormalize(relName) { - return function (name) { - return normalize(name, relName); - }; - } - - function makeLoad(depName) { - return function (value) { - defined[depName] = value; - }; - } - - function callDep(name) { - if (hasProp(waiting, name)) { - var args = waiting[name]; - delete waiting[name]; - defining[name] = true; - main.apply(undef, args); - } - - if (!hasProp(defined, name) && !hasProp(defining, name)) { - throw new Error('No ' + name); - } - return defined[name]; - } - - //Turns a plugin!resource to [plugin, resource] - //with the plugin being undefined if the name - //did not have a plugin prefix. - function splitPrefix(name) { - var prefix, - index = name ? name.indexOf('!') : -1; - if (index > -1) { - prefix = name.substring(0, index); - name = name.substring(index + 1, name.length); - } - return [prefix, name]; - } - - /** - * Makes a name map, normalizing the name, and using a plugin - * for normalization if necessary. Grabs a ref to plugin - * too, as an optimization. - */ - makeMap = function (name, relName) { - var plugin, - parts = splitPrefix(name), - prefix = parts[0]; - - name = parts[1]; - - if (prefix) { - prefix = normalize(prefix, relName); - plugin = callDep(prefix); - } - - //Normalize according - if (prefix) { - if (plugin && plugin.normalize) { - name = plugin.normalize(name, makeNormalize(relName)); - } else { - name = normalize(name, relName); - } - } else { - name = normalize(name, relName); - parts = splitPrefix(name); - prefix = parts[0]; - name = parts[1]; - if (prefix) { - plugin = callDep(prefix); - } - } - - //Using ridiculous property names for space reasons - return { - f: prefix ? prefix + '!' + name : name, //fullName - n: name, - pr: prefix, - p: plugin - }; - }; - - function makeConfig(name) { - return function () { - return (config && config.config && config.config[name]) || {}; - }; - } - - handlers = { - require: function (name) { - return makeRequire(name); - }, - exports: function (name) { - var e = defined[name]; - if (typeof e !== 'undefined') { - return e; - } else { - return (defined[name] = {}); - } - }, - module: function (name) { - return { - id: name, - uri: '', - exports: defined[name], - config: makeConfig(name) - }; - } - }; - - main = function (name, deps, callback, relName) { - var cjsModule, depName, ret, map, i, - args = [], - callbackType = typeof callback, - usingExports; - - //Use name if no relName - relName = relName || name; - - //Call the callback to define the module, if necessary. - if (callbackType === 'undefined' || callbackType === 'function') { - //Pull out the defined dependencies and pass the ordered - //values to the callback. - //Default to [require, exports, module] if no deps - deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; - for (i = 0; i < deps.length; i += 1) { - map = makeMap(deps[i], relName); - depName = map.f; - - //Fast path CommonJS standard dependencies. - if (depName === "require") { - args[i] = handlers.require(name); - } else if (depName === "exports") { - //CommonJS module spec 1.1 - args[i] = handlers.exports(name); - usingExports = true; - } else if (depName === "module") { - //CommonJS module spec 1.1 - cjsModule = args[i] = handlers.module(name); - } else if (hasProp(defined, depName) || - hasProp(waiting, depName) || - hasProp(defining, depName)) { - args[i] = callDep(depName); - } else if (map.p) { - map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); - args[i] = defined[depName]; - } else { - throw new Error(name + ' missing ' + depName); - } - } - - ret = callback ? callback.apply(defined[name], args) : undefined; - - if (name) { - //If setting exports via "module" is in play, - //favor that over return value and exports. After that, - //favor a non-undefined return value over exports use. - if (cjsModule && cjsModule.exports !== undef && - cjsModule.exports !== defined[name]) { - defined[name] = cjsModule.exports; - } else if (ret !== undef || !usingExports) { - //Use the return value from the function. - defined[name] = ret; - } - } - } else if (name) { - //May just be an object definition for the module. Only - //worry about defining if have a module name. - defined[name] = callback; - } - }; - - requirejs = require = req = function (deps, callback, relName, forceSync, alt) { - if (typeof deps === "string") { - if (handlers[deps]) { - //callback in this case is really relName - return handlers[deps](callback); - } - //Just return the module wanted. In this scenario, the - //deps arg is the module name, and second arg (if passed) - //is just the relName. - //Normalize module name, if it contains . or .. - return callDep(makeMap(deps, callback).f); - } else if (!deps.splice) { - //deps is a config object, not an array. - config = deps; - if (config.deps) { - req(config.deps, config.callback); - } - if (!callback) { - return; - } - - if (callback.splice) { - //callback is an array, which means it is a dependency list. - //Adjust args if there are dependencies - deps = callback; - callback = relName; - relName = null; - } else { - deps = undef; - } - } - - //Support require(['a']) - callback = callback || function () {}; - - //If relName is a function, it is an errback handler, - //so remove it. - if (typeof relName === 'function') { - relName = forceSync; - forceSync = alt; - } - - //Simulate async callback; - if (forceSync) { - main(undef, deps, callback, relName); - } else { - //Using a non-zero value because of concern for what old browsers - //do, and latest browsers "upgrade" to 4 if lower value is used: - //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: - //If want a value immediately, use require('id') instead -- something - //that works in almond on the global level, but not guaranteed and - //unlikely to work in other AMD implementations. - setTimeout(function () { - main(undef, deps, callback, relName); - }, 4); - } - - return req; - }; - - /** - * Just drops the config on the floor, but returns req in case - * the config return value is used. - */ - req.config = function (cfg) { - return req(cfg); - }; - - /** - * Expose module registry for debugging and tooling - */ - requirejs._defined = defined; - - define = function (name, deps, callback) { - - //This module may not have dependencies - if (!deps.splice) { - //deps is not an array, so probably means - //an object literal or factory function for - //the value. Adjust args. - callback = deps; - deps = []; - } - - if (!hasProp(defined, name) && !hasProp(waiting, name)) { - waiting[name] = [name, deps, callback]; - } - }; - - define.amd = { - jQuery: true - }; -}()); - -define("../node_modules/almond/almond", function(){}); - -/** - * A class to parse color values - * @author Stoyan Stefanov - * @link http://www.phpied.com/rgb-color-parser-in-javascript/ - * @license Use it if you like it - */ -(function ( global ) { - - function RGBColor(color_string) - { - this.ok = false; - - // strip any leading # - if (color_string.charAt(0) == '#') { // remove # if any - color_string = color_string.substr(1,6); - } - - color_string = color_string.replace(/ /g,''); - color_string = color_string.toLowerCase(); - - // before getting into regexps, try simple matches - // and overwrite the input - var simple_colors = { - aliceblue: 'f0f8ff', - antiquewhite: 'faebd7', - aqua: '00ffff', - aquamarine: '7fffd4', - azure: 'f0ffff', - beige: 'f5f5dc', - bisque: 'ffe4c4', - black: '000000', - blanchedalmond: 'ffebcd', - blue: '0000ff', - blueviolet: '8a2be2', - brown: 'a52a2a', - burlywood: 'deb887', - cadetblue: '5f9ea0', - chartreuse: '7fff00', - chocolate: 'd2691e', - coral: 'ff7f50', - cornflowerblue: '6495ed', - cornsilk: 'fff8dc', - crimson: 'dc143c', - cyan: '00ffff', - darkblue: '00008b', - darkcyan: '008b8b', - darkgoldenrod: 'b8860b', - darkgray: 'a9a9a9', - darkgreen: '006400', - darkkhaki: 'bdb76b', - darkmagenta: '8b008b', - darkolivegreen: '556b2f', - darkorange: 'ff8c00', - darkorchid: '9932cc', - darkred: '8b0000', - darksalmon: 'e9967a', - darkseagreen: '8fbc8f', - darkslateblue: '483d8b', - darkslategray: '2f4f4f', - darkturquoise: '00ced1', - darkviolet: '9400d3', - deeppink: 'ff1493', - deepskyblue: '00bfff', - dimgray: '696969', - dodgerblue: '1e90ff', - feldspar: 'd19275', - firebrick: 'b22222', - floralwhite: 'fffaf0', - forestgreen: '228b22', - fuchsia: 'ff00ff', - gainsboro: 'dcdcdc', - ghostwhite: 'f8f8ff', - gold: 'ffd700', - goldenrod: 'daa520', - gray: '808080', - green: '008000', - greenyellow: 'adff2f', - honeydew: 'f0fff0', - hotpink: 'ff69b4', - indianred : 'cd5c5c', - indigo : '4b0082', - ivory: 'fffff0', - khaki: 'f0e68c', - lavender: 'e6e6fa', - lavenderblush: 'fff0f5', - lawngreen: '7cfc00', - lemonchiffon: 'fffacd', - lightblue: 'add8e6', - lightcoral: 'f08080', - lightcyan: 'e0ffff', - lightgoldenrodyellow: 'fafad2', - lightgrey: 'd3d3d3', - lightgreen: '90ee90', - lightpink: 'ffb6c1', - lightsalmon: 'ffa07a', - lightseagreen: '20b2aa', - lightskyblue: '87cefa', - lightslateblue: '8470ff', - lightslategray: '778899', - lightsteelblue: 'b0c4de', - lightyellow: 'ffffe0', - lime: '00ff00', - limegreen: '32cd32', - linen: 'faf0e6', - magenta: 'ff00ff', - maroon: '800000', - mediumaquamarine: '66cdaa', - mediumblue: '0000cd', - mediumorchid: 'ba55d3', - mediumpurple: '9370d8', - mediumseagreen: '3cb371', - mediumslateblue: '7b68ee', - mediumspringgreen: '00fa9a', - mediumturquoise: '48d1cc', - mediumvioletred: 'c71585', - midnightblue: '191970', - mintcream: 'f5fffa', - mistyrose: 'ffe4e1', - moccasin: 'ffe4b5', - navajowhite: 'ffdead', - navy: '000080', - oldlace: 'fdf5e6', - olive: '808000', - olivedrab: '6b8e23', - orange: 'ffa500', - orangered: 'ff4500', - orchid: 'da70d6', - palegoldenrod: 'eee8aa', - palegreen: '98fb98', - paleturquoise: 'afeeee', - palevioletred: 'd87093', - papayawhip: 'ffefd5', - peachpuff: 'ffdab9', - peru: 'cd853f', - pink: 'ffc0cb', - plum: 'dda0dd', - powderblue: 'b0e0e6', - purple: '800080', - red: 'ff0000', - rosybrown: 'bc8f8f', - royalblue: '4169e1', - saddlebrown: '8b4513', - salmon: 'fa8072', - sandybrown: 'f4a460', - seagreen: '2e8b57', - seashell: 'fff5ee', - sienna: 'a0522d', - silver: 'c0c0c0', - skyblue: '87ceeb', - slateblue: '6a5acd', - slategray: '708090', - snow: 'fffafa', - springgreen: '00ff7f', - steelblue: '4682b4', - tan: 'd2b48c', - teal: '008080', - thistle: 'd8bfd8', - tomato: 'ff6347', - turquoise: '40e0d0', - violet: 'ee82ee', - violetred: 'd02090', - wheat: 'f5deb3', - white: 'ffffff', - whitesmoke: 'f5f5f5', - yellow: 'ffff00', - yellowgreen: '9acd32' - }; - for (var key in simple_colors) { - if (color_string == key) { - color_string = simple_colors[key]; - } - } - // emd of simple type-in colors - - // array of color definition objects - var color_defs = [ - { - re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, - example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'], - process: function (bits){ - return [ - parseInt(bits[1]), - parseInt(bits[2]), - parseInt(bits[3]) - ]; - } - }, - { - re: /^(\w{2})(\w{2})(\w{2})$/, - example: ['#00ff00', '336699'], - process: function (bits){ - return [ - parseInt(bits[1], 16), - parseInt(bits[2], 16), - parseInt(bits[3], 16) - ]; - } - }, - { - re: /^(\w{1})(\w{1})(\w{1})$/, - example: ['#fb0', 'f0f'], - process: function (bits){ - return [ - parseInt(bits[1] + bits[1], 16), - parseInt(bits[2] + bits[2], 16), - parseInt(bits[3] + bits[3], 16) - ]; - } - } - ]; - - // search through the definitions to find a match - for (var i = 0; i < color_defs.length; i++) { - var re = color_defs[i].re; - var processor = color_defs[i].process; - var bits = re.exec(color_string); - if (bits) { - channels = processor(bits); - this.r = channels[0]; - this.g = channels[1]; - this.b = channels[2]; - this.ok = true; - } - - } - - // validate/cleanup values - this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r); - this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g); - this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b); - - // some getters - this.toRGB = function () { - return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')'; - } - this.toHex = function () { - var r = this.r.toString(16); - var g = this.g.toString(16); - var b = this.b.toString(16); - if (r.length == 1) r = '0' + r; - if (g.length == 1) g = '0' + g; - if (b.length == 1) b = '0' + b; - return '#' + r + g + b; - } - - // help - this.getHelpXML = function () { - - var examples = new Array(); - // add regexps - for (var i = 0; i < color_defs.length; i++) { - var example = color_defs[i].example; - for (var j = 0; j < example.length; j++) { - examples[examples.length] = example[j]; - } - } - // add type-in colors - for (var sc in simple_colors) { - examples[examples.length] = sc; - } - - var xml = document.createElement('ul'); - xml.setAttribute('id', 'rgbcolor-examples'); - for (var i = 0; i < examples.length; i++) { - try { - var list_item = document.createElement('li'); - var list_color = new RGBColor(examples[i]); - var example_div = document.createElement('div'); - example_div.style.cssText = - 'margin: 3px; ' - + 'border: 1px solid black; ' - + 'background:' + list_color.toHex() + '; ' - + 'color:' + list_color.toHex() - ; - example_div.appendChild(document.createTextNode('test')); - var list_item_value = document.createTextNode( - ' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex() - ); - list_item.appendChild(example_div); - list_item.appendChild(list_item_value); - xml.appendChild(list_item); - - } catch(e){} - } - return xml; - - } - - } - - // export as AMD... - if ( typeof define !== 'undefined' && define.amd ) { - define( '../bower_components/canvg/rgbcolor',[],function () { return RGBColor; }); - } - - // ...or as browserify - else if ( typeof module !== 'undefined' && module.exports ) { - module.exports = RGBColor; - } - - global.RGBColor = RGBColor; - -}( typeof window !== 'undefined' ? window : this )); -/* - -StackBlur - a fast almost Gaussian Blur For Canvas - -Version: 0.5 -Author: Mario Klingemann -Contact: mario@quasimondo.com -Website: http://www.quasimondo.com/StackBlurForCanvas -Twitter: @quasimondo - -In case you find this class useful - especially in commercial projects - -I am not totally unhappy for a small donation to my PayPal account -mario@quasimondo.de - -Or support me on flattr: -https://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript - -Copyright (c) 2010 Mario Klingemann - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. -*/ - -(function ( global ) { - - var mul_table = [ - 512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512, - 454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512, - 482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456, - 437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512, - 497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328, - 320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456, - 446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335, - 329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512, - 505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405, - 399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328, - 324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271, - 268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456, - 451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388, - 385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335, - 332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292, - 289,287,285,282,280,278,275,273,271,269,267,265,263,261,259]; - - - var shg_table = [ - 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, - 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 ]; - - function stackBlurImage( imageID, canvasID, radius, blurAlphaChannel ) - { - - var img = document.getElementById( imageID ); - var w = img.naturalWidth; - var h = img.naturalHeight; - - var canvas = document.getElementById( canvasID ); - - canvas.style.width = w + "px"; - canvas.style.height = h + "px"; - canvas.width = w; - canvas.height = h; - - var context = canvas.getContext("2d"); - context.clearRect( 0, 0, w, h ); - context.drawImage( img, 0, 0 ); - - if ( isNaN(radius) || radius < 1 ) return; - - if ( blurAlphaChannel ) - stackBlurCanvasRGBA( canvasID, 0, 0, w, h, radius ); - else - stackBlurCanvasRGB( canvasID, 0, 0, w, h, radius ); - } - - - function stackBlurCanvasRGBA( id, top_x, top_y, width, height, radius ) - { - if ( isNaN(radius) || radius < 1 ) return; - radius |= 0; - - var canvas = document.getElementById( id ); - var context = canvas.getContext("2d"); - var imageData; - - try { - try { - imageData = context.getImageData( top_x, top_y, width, height ); - } catch(e) { - - // NOTE: this part is supposedly only needed if you want to work with local files - // so it might be okay to remove the whole try/catch block and just use - // imageData = context.getImageData( top_x, top_y, width, height ); - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); - imageData = context.getImageData( top_x, top_y, width, height ); - } catch(e) { - alert("Cannot access local image"); - throw new Error("unable to access local image data: " + e); - return; - } - } - } catch(e) { - alert("Cannot access image"); - throw new Error("unable to access image data: " + e); - } - - var pixels = imageData.data; - - var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, - r_out_sum, g_out_sum, b_out_sum, a_out_sum, - r_in_sum, g_in_sum, b_in_sum, a_in_sum, - pr, pg, pb, pa, rbs; - - var div = radius + radius + 1; - var w4 = width << 2; - var widthMinus1 = width - 1; - var heightMinus1 = height - 1; - var radiusPlus1 = radius + 1; - var sumFactor = radiusPlus1 * ( radiusPlus1 + 1 ) / 2; - - var stackStart = new BlurStack(); - var stack = stackStart; - for ( i = 1; i < div; i++ ) - { - stack = stack.next = new BlurStack(); - if ( i == radiusPlus1 ) var stackEnd = stack; - } - stack.next = stackStart; - var stackIn = null; - var stackOut = null; - - yw = yi = 0; - - var mul_sum = mul_table[radius]; - var shg_sum = shg_table[radius]; - - for ( y = 0; y < height; y++ ) - { - r_in_sum = g_in_sum = b_in_sum = a_in_sum = r_sum = g_sum = b_sum = a_sum = 0; - - r_out_sum = radiusPlus1 * ( pr = pixels[yi] ); - g_out_sum = radiusPlus1 * ( pg = pixels[yi+1] ); - b_out_sum = radiusPlus1 * ( pb = pixels[yi+2] ); - a_out_sum = radiusPlus1 * ( pa = pixels[yi+3] ); - - r_sum += sumFactor * pr; - g_sum += sumFactor * pg; - b_sum += sumFactor * pb; - a_sum += sumFactor * pa; - - stack = stackStart; - - for( i = 0; i < radiusPlus1; i++ ) - { - stack.r = pr; - stack.g = pg; - stack.b = pb; - stack.a = pa; - stack = stack.next; - } - - for( i = 1; i < radiusPlus1; i++ ) - { - p = yi + (( widthMinus1 < i ? widthMinus1 : i ) << 2 ); - r_sum += ( stack.r = ( pr = pixels[p])) * ( rbs = radiusPlus1 - i ); - g_sum += ( stack.g = ( pg = pixels[p+1])) * rbs; - b_sum += ( stack.b = ( pb = pixels[p+2])) * rbs; - a_sum += ( stack.a = ( pa = pixels[p+3])) * rbs; - - r_in_sum += pr; - g_in_sum += pg; - b_in_sum += pb; - a_in_sum += pa; - - stack = stack.next; - } - - - stackIn = stackStart; - stackOut = stackEnd; - for ( x = 0; x < width; x++ ) - { - pixels[yi+3] = pa = (a_sum * mul_sum) >> shg_sum; - if ( pa != 0 ) - { - pa = 255 / pa; - pixels[yi] = ((r_sum * mul_sum) >> shg_sum) * pa; - pixels[yi+1] = ((g_sum * mul_sum) >> shg_sum) * pa; - pixels[yi+2] = ((b_sum * mul_sum) >> shg_sum) * pa; - } else { - pixels[yi] = pixels[yi+1] = pixels[yi+2] = 0; - } - - r_sum -= r_out_sum; - g_sum -= g_out_sum; - b_sum -= b_out_sum; - a_sum -= a_out_sum; - - r_out_sum -= stackIn.r; - g_out_sum -= stackIn.g; - b_out_sum -= stackIn.b; - a_out_sum -= stackIn.a; - - p = ( yw + ( ( p = x + radius + 1 ) < widthMinus1 ? p : widthMinus1 ) ) << 2; - - r_in_sum += ( stackIn.r = pixels[p]); - g_in_sum += ( stackIn.g = pixels[p+1]); - b_in_sum += ( stackIn.b = pixels[p+2]); - a_in_sum += ( stackIn.a = pixels[p+3]); - - r_sum += r_in_sum; - g_sum += g_in_sum; - b_sum += b_in_sum; - a_sum += a_in_sum; - - stackIn = stackIn.next; - - r_out_sum += ( pr = stackOut.r ); - g_out_sum += ( pg = stackOut.g ); - b_out_sum += ( pb = stackOut.b ); - a_out_sum += ( pa = stackOut.a ); - - r_in_sum -= pr; - g_in_sum -= pg; - b_in_sum -= pb; - a_in_sum -= pa; - - stackOut = stackOut.next; - - yi += 4; - } - yw += width; - } - - - for ( x = 0; x < width; x++ ) - { - g_in_sum = b_in_sum = a_in_sum = r_in_sum = g_sum = b_sum = a_sum = r_sum = 0; - - yi = x << 2; - r_out_sum = radiusPlus1 * ( pr = pixels[yi]); - g_out_sum = radiusPlus1 * ( pg = pixels[yi+1]); - b_out_sum = radiusPlus1 * ( pb = pixels[yi+2]); - a_out_sum = radiusPlus1 * ( pa = pixels[yi+3]); - - r_sum += sumFactor * pr; - g_sum += sumFactor * pg; - b_sum += sumFactor * pb; - a_sum += sumFactor * pa; - - stack = stackStart; - - for( i = 0; i < radiusPlus1; i++ ) - { - stack.r = pr; - stack.g = pg; - stack.b = pb; - stack.a = pa; - stack = stack.next; - } - - yp = width; - - for( i = 1; i <= radius; i++ ) - { - yi = ( yp + x ) << 2; - - r_sum += ( stack.r = ( pr = pixels[yi])) * ( rbs = radiusPlus1 - i ); - g_sum += ( stack.g = ( pg = pixels[yi+1])) * rbs; - b_sum += ( stack.b = ( pb = pixels[yi+2])) * rbs; - a_sum += ( stack.a = ( pa = pixels[yi+3])) * rbs; - - r_in_sum += pr; - g_in_sum += pg; - b_in_sum += pb; - a_in_sum += pa; - - stack = stack.next; - - if( i < heightMinus1 ) - { - yp += width; - } - } - - yi = x; - stackIn = stackStart; - stackOut = stackEnd; - for ( y = 0; y < height; y++ ) - { - p = yi << 2; - pixels[p+3] = pa = (a_sum * mul_sum) >> shg_sum; - if ( pa > 0 ) - { - pa = 255 / pa; - pixels[p] = ((r_sum * mul_sum) >> shg_sum ) * pa; - pixels[p+1] = ((g_sum * mul_sum) >> shg_sum ) * pa; - pixels[p+2] = ((b_sum * mul_sum) >> shg_sum ) * pa; - } else { - pixels[p] = pixels[p+1] = pixels[p+2] = 0; - } - - r_sum -= r_out_sum; - g_sum -= g_out_sum; - b_sum -= b_out_sum; - a_sum -= a_out_sum; - - r_out_sum -= stackIn.r; - g_out_sum -= stackIn.g; - b_out_sum -= stackIn.b; - a_out_sum -= stackIn.a; - - p = ( x + (( ( p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1 ) * width )) << 2; - - r_sum += ( r_in_sum += ( stackIn.r = pixels[p])); - g_sum += ( g_in_sum += ( stackIn.g = pixels[p+1])); - b_sum += ( b_in_sum += ( stackIn.b = pixels[p+2])); - a_sum += ( a_in_sum += ( stackIn.a = pixels[p+3])); - - stackIn = stackIn.next; - - r_out_sum += ( pr = stackOut.r ); - g_out_sum += ( pg = stackOut.g ); - b_out_sum += ( pb = stackOut.b ); - a_out_sum += ( pa = stackOut.a ); - - r_in_sum -= pr; - g_in_sum -= pg; - b_in_sum -= pb; - a_in_sum -= pa; - - stackOut = stackOut.next; - - yi += width; - } - } - - context.putImageData( imageData, top_x, top_y ); - - } - - - function stackBlurCanvasRGB( id, top_x, top_y, width, height, radius ) - { - if ( isNaN(radius) || radius < 1 ) return; - radius |= 0; - - var canvas = document.getElementById( id ); - var context = canvas.getContext("2d"); - var imageData; - - try { - try { - imageData = context.getImageData( top_x, top_y, width, height ); - } catch(e) { - - // NOTE: this part is supposedly only needed if you want to work with local files - // so it might be okay to remove the whole try/catch block and just use - // imageData = context.getImageData( top_x, top_y, width, height ); - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); - imageData = context.getImageData( top_x, top_y, width, height ); - } catch(e) { - alert("Cannot access local image"); - throw new Error("unable to access local image data: " + e); - return; - } - } - } catch(e) { - alert("Cannot access image"); - throw new Error("unable to access image data: " + e); - } - - var pixels = imageData.data; - - var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, - r_out_sum, g_out_sum, b_out_sum, - r_in_sum, g_in_sum, b_in_sum, - pr, pg, pb, rbs; - - var div = radius + radius + 1; - var w4 = width << 2; - var widthMinus1 = width - 1; - var heightMinus1 = height - 1; - var radiusPlus1 = radius + 1; - var sumFactor = radiusPlus1 * ( radiusPlus1 + 1 ) / 2; - - var stackStart = new BlurStack(); - var stack = stackStart; - for ( i = 1; i < div; i++ ) - { - stack = stack.next = new BlurStack(); - if ( i == radiusPlus1 ) var stackEnd = stack; - } - stack.next = stackStart; - var stackIn = null; - var stackOut = null; - - yw = yi = 0; - - var mul_sum = mul_table[radius]; - var shg_sum = shg_table[radius]; - - for ( y = 0; y < height; y++ ) - { - r_in_sum = g_in_sum = b_in_sum = r_sum = g_sum = b_sum = 0; - - r_out_sum = radiusPlus1 * ( pr = pixels[yi] ); - g_out_sum = radiusPlus1 * ( pg = pixels[yi+1] ); - b_out_sum = radiusPlus1 * ( pb = pixels[yi+2] ); - - r_sum += sumFactor * pr; - g_sum += sumFactor * pg; - b_sum += sumFactor * pb; - - stack = stackStart; - - for( i = 0; i < radiusPlus1; i++ ) - { - stack.r = pr; - stack.g = pg; - stack.b = pb; - stack = stack.next; - } - - for( i = 1; i < radiusPlus1; i++ ) - { - p = yi + (( widthMinus1 < i ? widthMinus1 : i ) << 2 ); - r_sum += ( stack.r = ( pr = pixels[p])) * ( rbs = radiusPlus1 - i ); - g_sum += ( stack.g = ( pg = pixels[p+1])) * rbs; - b_sum += ( stack.b = ( pb = pixels[p+2])) * rbs; - - r_in_sum += pr; - g_in_sum += pg; - b_in_sum += pb; - - stack = stack.next; - } - - - stackIn = stackStart; - stackOut = stackEnd; - for ( x = 0; x < width; x++ ) - { - pixels[yi] = (r_sum * mul_sum) >> shg_sum; - pixels[yi+1] = (g_sum * mul_sum) >> shg_sum; - pixels[yi+2] = (b_sum * mul_sum) >> shg_sum; - - r_sum -= r_out_sum; - g_sum -= g_out_sum; - b_sum -= b_out_sum; - - r_out_sum -= stackIn.r; - g_out_sum -= stackIn.g; - b_out_sum -= stackIn.b; - - p = ( yw + ( ( p = x + radius + 1 ) < widthMinus1 ? p : widthMinus1 ) ) << 2; - - r_in_sum += ( stackIn.r = pixels[p]); - g_in_sum += ( stackIn.g = pixels[p+1]); - b_in_sum += ( stackIn.b = pixels[p+2]); - - r_sum += r_in_sum; - g_sum += g_in_sum; - b_sum += b_in_sum; - - stackIn = stackIn.next; - - r_out_sum += ( pr = stackOut.r ); - g_out_sum += ( pg = stackOut.g ); - b_out_sum += ( pb = stackOut.b ); - - r_in_sum -= pr; - g_in_sum -= pg; - b_in_sum -= pb; - - stackOut = stackOut.next; - - yi += 4; - } - yw += width; - } - - - for ( x = 0; x < width; x++ ) - { - g_in_sum = b_in_sum = r_in_sum = g_sum = b_sum = r_sum = 0; - - yi = x << 2; - r_out_sum = radiusPlus1 * ( pr = pixels[yi]); - g_out_sum = radiusPlus1 * ( pg = pixels[yi+1]); - b_out_sum = radiusPlus1 * ( pb = pixels[yi+2]); - - r_sum += sumFactor * pr; - g_sum += sumFactor * pg; - b_sum += sumFactor * pb; - - stack = stackStart; - - for( i = 0; i < radiusPlus1; i++ ) - { - stack.r = pr; - stack.g = pg; - stack.b = pb; - stack = stack.next; - } - - yp = width; - - for( i = 1; i <= radius; i++ ) - { - yi = ( yp + x ) << 2; - - r_sum += ( stack.r = ( pr = pixels[yi])) * ( rbs = radiusPlus1 - i ); - g_sum += ( stack.g = ( pg = pixels[yi+1])) * rbs; - b_sum += ( stack.b = ( pb = pixels[yi+2])) * rbs; - - r_in_sum += pr; - g_in_sum += pg; - b_in_sum += pb; - - stack = stack.next; - - if( i < heightMinus1 ) - { - yp += width; - } - } - - yi = x; - stackIn = stackStart; - stackOut = stackEnd; - for ( y = 0; y < height; y++ ) - { - p = yi << 2; - pixels[p] = (r_sum * mul_sum) >> shg_sum; - pixels[p+1] = (g_sum * mul_sum) >> shg_sum; - pixels[p+2] = (b_sum * mul_sum) >> shg_sum; - - r_sum -= r_out_sum; - g_sum -= g_out_sum; - b_sum -= b_out_sum; - - r_out_sum -= stackIn.r; - g_out_sum -= stackIn.g; - b_out_sum -= stackIn.b; - - p = ( x + (( ( p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1 ) * width )) << 2; - - r_sum += ( r_in_sum += ( stackIn.r = pixels[p])); - g_sum += ( g_in_sum += ( stackIn.g = pixels[p+1])); - b_sum += ( b_in_sum += ( stackIn.b = pixels[p+2])); - - stackIn = stackIn.next; - - r_out_sum += ( pr = stackOut.r ); - g_out_sum += ( pg = stackOut.g ); - b_out_sum += ( pb = stackOut.b ); - - r_in_sum -= pr; - g_in_sum -= pg; - b_in_sum -= pb; - - stackOut = stackOut.next; - - yi += width; - } - } - - context.putImageData( imageData, top_x, top_y ); - - } - - function BlurStack() - { - this.r = 0; - this.g = 0; - this.b = 0; - this.a = 0; - this.next = null; - } - - var stackBlur = { - image: stackBlurImage, - canvasRGBA: stackBlurCanvasRGBA, - canvasRGB: stackBlurCanvasRGB - }; - - // export as AMD... - if ( typeof define !== 'undefined' && define.amd ) { - define( '../bower_components/canvg/StackBlur',[],function () { return stackBlur; }); - } - - // ...or as browserify - else if ( typeof module !== 'undefined' && module.exports ) { - module.exports = stackBlur; - } - - global.stackBlur = stackBlur; - -}( typeof window !== 'undefined' ? window : this )); -/* - * canvg.js - Javascript SVG parser and renderer on Canvas - * MIT Licensed - * Gabe Lerner (gabelerner@gmail.com) - * http://code.google.com/p/canvg/ - * - * Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/ - */ -(function ( global, factory ) { - - - - // export as AMD... - if ( typeof define !== 'undefined' && define.amd ) { - define('../bower_components/canvg/canvg',[ 'rgbcolor', 'stackblur' ], factory ); - } - - // ...or as browserify - else if ( typeof module !== 'undefined' && module.exports ) { - module.exports = factory( require( 'rgbcolor' ), require( 'stackblur' ) ); - } - - global.canvg = factory( global.RGBColor, global.stackBlur ); - -}( typeof window !== 'undefined' ? window : this, function ( RGBColor, stackBlur ) { - - // canvg(target, s) - // empty parameters: replace all 'svg' elements on page with 'canvas' elements - // target: canvas element or the id of a canvas element - // s: svg string, url to svg file, or xml document - // opts: optional hash of options - // ignoreMouse: true => ignore mouse events - // ignoreAnimation: true => ignore animations - // ignoreDimensions: true => does not try to resize canvas - // ignoreClear: true => does not clear canvas - // offsetX: int => draws at a x offset - // offsetY: int => draws at a y offset - // scaleWidth: int => scales horizontally to width - // scaleHeight: int => scales vertically to height - // renderCallback: function => will call the function after the first render is completed - // forceRedraw: function => will call the function on every frame, if it returns true, will redraw - var canvg = function (target, s, opts) { - // no parameters - if (target == null && s == null && opts == null) { - var svgTags = document.querySelectorAll('svg'); - for (var i=0; i~\.\[:]+)/g; - var classRegex = /(\.[^\s\+>~\.\[:]+)/g; - var pseudoElementRegex = /(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi; - var pseudoClassWithBracketsRegex = /(:[\w-]+\([^\)]*\))/gi; - var pseudoClassRegex = /(:[^\s\+>~\.\[:]+)/g; - var elementRegex = /([^\s\+>~\.\[:]+)/g; - function getSelectorSpecificity(selector) { - var typeCount = [0, 0, 0]; - var findMatch = function(regex, type) { - var matches = selector.match(regex); - if (matches == null) { - return; - } - typeCount[type] += matches.length; - selector = selector.replace(regex, ' '); - }; - - selector = selector.replace(/:not\(([^\)]*)\)/g, ' $1 '); - selector = selector.replace(/{[^]*/gm, ' '); - findMatch(attributeRegex, 1); - findMatch(idRegex, 0); - findMatch(classRegex, 1); - findMatch(pseudoElementRegex, 2); - findMatch(pseudoClassWithBracketsRegex, 1); - findMatch(pseudoClassRegex, 1); - selector = selector.replace(/[\*\s\+>~]/g, ' '); - selector = selector.replace(/[#\.]/g, ' '); - findMatch(elementRegex, 2); - return typeCount.join(''); - } - - function build(opts) { - var svg = { opts: opts }; - - svg.FRAMERATE = 30; - svg.MAX_VIRTUAL_PIXELS = 30000; - - svg.log = function(msg) {}; - if (svg.opts['log'] == true && typeof(console) != 'undefined') { - svg.log = function(msg) { console.log(msg); }; - }; - - // globals - svg.init = function(ctx) { - var uniqueId = 0; - svg.UniqueId = function () { uniqueId++; return 'canvg' + uniqueId; }; - svg.Definitions = {}; - svg.Styles = {}; - svg.StylesSpecificity = {}; - svg.Animations = []; - svg.Images = []; - svg.ctx = ctx; - svg.ViewPort = new (function () { - this.viewPorts = []; - this.Clear = function() { this.viewPorts = []; } - this.SetCurrent = function(width, height) { this.viewPorts.push({ width: width, height: height }); } - this.RemoveCurrent = function() { this.viewPorts.pop(); } - this.Current = function() { return this.viewPorts[this.viewPorts.length - 1]; } - this.width = function() { return this.Current().width; } - this.height = function() { return this.Current().height; } - this.ComputeSize = function(d) { - if (d != null && typeof(d) == 'number') return d; - if (d == 'x') return this.width(); - if (d == 'y') return this.height(); - return Math.sqrt(Math.pow(this.width(), 2) + Math.pow(this.height(), 2)) / Math.sqrt(2); - } - }); - } - svg.init(); - - // images loaded - svg.ImagesLoaded = function() { - for (var i=0; i]*>/, ''); - var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); - xmlDoc.async = 'false'; - xmlDoc.loadXML(xml); - return xmlDoc; - } - } - - svg.Property = function(name, value) { - this.name = name; - this.value = value; - } - svg.Property.prototype.getValue = function() { - return this.value; - } - - svg.Property.prototype.hasValue = function() { - return (this.value != null && this.value !== ''); - } - - // return the numerical value of the property - svg.Property.prototype.numValue = function() { - if (!this.hasValue()) return 0; - - var n = parseFloat(this.value); - if ((this.value + '').match(/%$/)) { - n = n / 100.0; - } - return n; - } - - svg.Property.prototype.valueOrDefault = function(def) { - if (this.hasValue()) return this.value; - return def; - } - - svg.Property.prototype.numValueOrDefault = function(def) { - if (this.hasValue()) return this.numValue(); - return def; - } - - // color extensions - // augment the current color value with the opacity - svg.Property.prototype.addOpacity = function(opacityProp) { - var newValue = this.value; - if (opacityProp.value != null && opacityProp.value != '' && typeof(this.value)=='string') { // can only add opacity to colors, not patterns - var color = new RGBColor(this.value); - if (color.ok) { - newValue = 'rgba(' + color.r + ', ' + color.g + ', ' + color.b + ', ' + opacityProp.numValue() + ')'; - } - } - return new svg.Property(this.name, newValue); - } - - // definition extensions - // get the definition from the definitions table - svg.Property.prototype.getDefinition = function() { - var name = this.value.match(/#([^\)'"]+)/); - if (name) { name = name[1]; } - if (!name) { name = this.value; } - return svg.Definitions[name]; - } - - svg.Property.prototype.isUrlDefinition = function() { - return this.value.indexOf('url(') == 0 - } - - svg.Property.prototype.getFillStyleDefinition = function(e, opacityProp) { - var def = this.getDefinition(); - - // gradient - if (def != null && def.createGradient) { - return def.createGradient(svg.ctx, e, opacityProp); - } - - // pattern - if (def != null && def.createPattern) { - if (def.getHrefAttribute().hasValue()) { - var pt = def.attribute('patternTransform'); - def = def.getHrefAttribute().getDefinition(); - if (pt.hasValue()) { def.attribute('patternTransform', true).value = pt.value; } - } - return def.createPattern(svg.ctx, e); - } - - return null; - } - - // length extensions - svg.Property.prototype.getDPI = function(viewPort) { - return 96.0; // TODO: compute? - } - - svg.Property.prototype.getEM = function(viewPort) { - var em = 12; - - var fontSize = new svg.Property('fontSize', svg.Font.Parse(svg.ctx.font).fontSize); - if (fontSize.hasValue()) em = fontSize.toPixels(viewPort); - - return em; - } - - svg.Property.prototype.getUnits = function() { - var s = this.value+''; - return s.replace(/[0-9\.\-]/g,''); - } - - // get the length as pixels - svg.Property.prototype.toPixels = function(viewPort, processPercent) { - if (!this.hasValue()) return 0; - var s = this.value+''; - if (s.match(/em$/)) return this.numValue() * this.getEM(viewPort); - if (s.match(/ex$/)) return this.numValue() * this.getEM(viewPort) / 2.0; - if (s.match(/px$/)) return this.numValue(); - if (s.match(/pt$/)) return this.numValue() * this.getDPI(viewPort) * (1.0 / 72.0); - if (s.match(/pc$/)) return this.numValue() * 15; - if (s.match(/cm$/)) return this.numValue() * this.getDPI(viewPort) / 2.54; - if (s.match(/mm$/)) return this.numValue() * this.getDPI(viewPort) / 25.4; - if (s.match(/in$/)) return this.numValue() * this.getDPI(viewPort); - if (s.match(/%$/)) return this.numValue() * svg.ViewPort.ComputeSize(viewPort); - var n = this.numValue(); - if (processPercent && n < 1.0) return n * svg.ViewPort.ComputeSize(viewPort); - return n; - } - - // time extensions - // get the time as milliseconds - svg.Property.prototype.toMilliseconds = function() { - if (!this.hasValue()) return 0; - var s = this.value+''; - if (s.match(/s$/)) return this.numValue() * 1000; - if (s.match(/ms$/)) return this.numValue(); - return this.numValue(); - } - - // angle extensions - // get the angle as radians - svg.Property.prototype.toRadians = function() { - if (!this.hasValue()) return 0; - var s = this.value+''; - if (s.match(/deg$/)) return this.numValue() * (Math.PI / 180.0); - if (s.match(/grad$/)) return this.numValue() * (Math.PI / 200.0); - if (s.match(/rad$/)) return this.numValue(); - return this.numValue() * (Math.PI / 180.0); - } - - // text extensions - // get the text baseline - var textBaselineMapping = { - 'baseline': 'alphabetic', - 'before-edge': 'top', - 'text-before-edge': 'top', - 'middle': 'middle', - 'central': 'middle', - 'after-edge': 'bottom', - 'text-after-edge': 'bottom', - 'ideographic': 'ideographic', - 'alphabetic': 'alphabetic', - 'hanging': 'hanging', - 'mathematical': 'alphabetic' - }; - svg.Property.prototype.toTextBaseline = function () { - if (!this.hasValue()) return null; - return textBaselineMapping[this.value]; - } - - // fonts - svg.Font = new (function() { - this.Styles = 'normal|italic|oblique|inherit'; - this.Variants = 'normal|small-caps|inherit'; - this.Weights = 'normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit'; - - this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { - var f = inherit != null ? this.Parse(inherit) : this.CreateFont('', '', '', '', '', svg.ctx.font); - return { - fontFamily: fontFamily || f.fontFamily, - fontSize: fontSize || f.fontSize, - fontStyle: fontStyle || f.fontStyle, - fontWeight: fontWeight || f.fontWeight, - fontVariant: fontVariant || f.fontVariant, - toString: function () { return [this.fontStyle, this.fontVariant, this.fontWeight, this.fontSize, this.fontFamily].join(' ') } - } - } - - var that = this; - this.Parse = function(s) { - var f = {}; - var d = svg.trim(svg.compressSpaces(s || '')).split(' '); - var set = { fontSize: false, fontStyle: false, fontWeight: false, fontVariant: false } - var ff = ''; - for (var i=0; i this.x2) this.x2 = x; - } - - if (y != null) { - if (isNaN(this.y1) || isNaN(this.y2)) { - this.y1 = y; - this.y2 = y; - } - if (y < this.y1) this.y1 = y; - if (y > this.y2) this.y2 = y; - } - } - this.addX = function(x) { this.addPoint(x, null); } - this.addY = function(y) { this.addPoint(null, y); } - - this.addBoundingBox = function(bb) { - this.addPoint(bb.x1, bb.y1); - this.addPoint(bb.x2, bb.y2); - } - - this.addQuadraticCurve = function(p0x, p0y, p1x, p1y, p2x, p2y) { - var cp1x = p0x + 2/3 * (p1x - p0x); // CP1 = QP0 + 2/3 *(QP1-QP0) - var cp1y = p0y + 2/3 * (p1y - p0y); // CP1 = QP0 + 2/3 *(QP1-QP0) - var cp2x = cp1x + 1/3 * (p2x - p0x); // CP2 = CP1 + 1/3 *(QP2-QP0) - var cp2y = cp1y + 1/3 * (p2y - p0y); // CP2 = CP1 + 1/3 *(QP2-QP0) - this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y); - } - - this.addBezierCurve = function(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) { - // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html - var p0 = [p0x, p0y], p1 = [p1x, p1y], p2 = [p2x, p2y], p3 = [p3x, p3y]; - this.addPoint(p0[0], p0[1]); - this.addPoint(p3[0], p3[1]); - - for (i=0; i<=1; i++) { - var f = function(t) { - return Math.pow(1-t, 3) * p0[i] - + 3 * Math.pow(1-t, 2) * t * p1[i] - + 3 * (1-t) * Math.pow(t, 2) * p2[i] - + Math.pow(t, 3) * p3[i]; - } - - var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; - var a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; - var c = 3 * p1[i] - 3 * p0[i]; - - if (a == 0) { - if (b == 0) continue; - var t = -c / b; - if (0 < t && t < 1) { - if (i == 0) this.addX(f(t)); - if (i == 1) this.addY(f(t)); - } - continue; - } - - var b2ac = Math.pow(b, 2) - 4 * c * a; - if (b2ac < 0) continue; - var t1 = (-b + Math.sqrt(b2ac)) / (2 * a); - if (0 < t1 && t1 < 1) { - if (i == 0) this.addX(f(t1)); - if (i == 1) this.addY(f(t1)); - } - var t2 = (-b - Math.sqrt(b2ac)) / (2 * a); - if (0 < t2 && t2 < 1) { - if (i == 0) this.addX(f(t2)); - if (i == 1) this.addY(f(t2)); - } - } - } - - this.isPointInBox = function(x, y) { - return (this.x1 <= x && x <= this.x2 && this.y1 <= y && y <= this.y2); - } - - this.addPoint(x1, y1); - this.addPoint(x2, y2); - } - - // transforms - svg.Transform = function(v) { - var that = this; - this.Type = {} - - // translate - this.Type.translate = function(s) { - this.p = svg.CreatePoint(s); - this.apply = function(ctx) { - ctx.translate(this.p.x || 0.0, this.p.y || 0.0); - } - this.unapply = function(ctx) { - ctx.translate(-1.0 * this.p.x || 0.0, -1.0 * this.p.y || 0.0); - } - this.applyToPoint = function(p) { - p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); - } - } - - // rotate - this.Type.rotate = function(s) { - var a = svg.ToNumberArray(s); - this.angle = new svg.Property('angle', a[0]); - this.cx = a[1] || 0; - this.cy = a[2] || 0; - this.apply = function(ctx) { - ctx.translate(this.cx, this.cy); - ctx.rotate(this.angle.toRadians()); - ctx.translate(-this.cx, -this.cy); - } - this.unapply = function(ctx) { - ctx.translate(this.cx, this.cy); - ctx.rotate(-1.0 * this.angle.toRadians()); - ctx.translate(-this.cx, -this.cy); - } - this.applyToPoint = function(p) { - var a = this.angle.toRadians(); - p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); - p.applyTransform([Math.cos(a), Math.sin(a), -Math.sin(a), Math.cos(a), 0, 0]); - p.applyTransform([1, 0, 0, 1, -this.p.x || 0.0, -this.p.y || 0.0]); - } - } - - this.Type.scale = function(s) { - this.p = svg.CreatePoint(s); - this.apply = function(ctx) { - ctx.scale(this.p.x || 1.0, this.p.y || this.p.x || 1.0); - } - this.unapply = function(ctx) { - ctx.scale(1.0 / this.p.x || 1.0, 1.0 / this.p.y || this.p.x || 1.0); - } - this.applyToPoint = function(p) { - p.applyTransform([this.p.x || 0.0, 0, 0, this.p.y || 0.0, 0, 0]); - } - } - - this.Type.matrix = function(s) { - this.m = svg.ToNumberArray(s); - this.apply = function(ctx) { - ctx.transform(this.m[0], this.m[1], this.m[2], this.m[3], this.m[4], this.m[5]); - } - this.unapply = function(ctx) { - var a = this.m[0]; - var b = this.m[2]; - var c = this.m[4]; - var d = this.m[1]; - var e = this.m[3]; - var f = this.m[5]; - var g = 0.0; - var h = 0.0; - var i = 1.0; - var det = 1 / (a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g)); - ctx.transform( - det*(e*i-f*h), - det*(f*g-d*i), - det*(c*h-b*i), - det*(a*i-c*g), - det*(b*f-c*e), - det*(c*d-a*f) - ); - } - this.applyToPoint = function(p) { - p.applyTransform(this.m); - } - } - - this.Type.SkewBase = function(s) { - this.base = that.Type.matrix; - this.base(s); - this.angle = new svg.Property('angle', s); - } - this.Type.SkewBase.prototype = new this.Type.matrix; - - this.Type.skewX = function(s) { - this.base = that.Type.SkewBase; - this.base(s); - this.m = [1, 0, Math.tan(this.angle.toRadians()), 1, 0, 0]; - } - this.Type.skewX.prototype = new this.Type.SkewBase; - - this.Type.skewY = function(s) { - this.base = that.Type.SkewBase; - this.base(s); - this.m = [1, Math.tan(this.angle.toRadians()), 0, 1, 0, 0]; - } - this.Type.skewY.prototype = new this.Type.SkewBase; - - this.transforms = []; - - this.apply = function(ctx) { - for (var i=0; i=0; i--) { - this.transforms[i].unapply(ctx); - } - } - - this.applyToPoint = function(p) { - for (var i=0; i existingSpecificity) { - this.styles[name] = styles[name]; - this.stylesSpecificity[name] = specificity; - } - } - } - } - } - - // add inline styles - if (this.attribute('style').hasValue()) { - var styles = this.attribute('style').value.split(';'); - for (var i=0; i= this.tokens.length - 1; - } - - this.isCommandOrEnd = function() { - if (this.isEnd()) return true; - return this.tokens[this.i + 1].match(/^[A-Za-z]$/) != null; - } - - this.isRelativeCommand = function() { - switch(this.command) - { - case 'm': - case 'l': - case 'h': - case 'v': - case 'c': - case 's': - case 'q': - case 't': - case 'a': - case 'z': - return true; - break; - } - return false; - } - - this.getToken = function() { - this.i++; - return this.tokens[this.i]; - } - - this.getScalar = function() { - return parseFloat(this.getToken()); - } - - this.nextCommand = function() { - this.previousCommand = this.command; - this.command = this.getToken(); - } - - this.getPoint = function() { - var p = new svg.Point(this.getScalar(), this.getScalar()); - return this.makeAbsolute(p); - } - - this.getAsControlPoint = function() { - var p = this.getPoint(); - this.control = p; - return p; - } - - this.getAsCurrentPoint = function() { - var p = this.getPoint(); - this.current = p; - return p; - } - - this.getReflectedControlPoint = function() { - if (this.previousCommand.toLowerCase() != 'c' && - this.previousCommand.toLowerCase() != 's' && - this.previousCommand.toLowerCase() != 'q' && - this.previousCommand.toLowerCase() != 't' ){ - return this.current; - } - - // reflect point - var p = new svg.Point(2 * this.current.x - this.control.x, 2 * this.current.y - this.control.y); - return p; - } - - this.makeAbsolute = function(p) { - if (this.isRelativeCommand()) { - p.x += this.current.x; - p.y += this.current.y; - } - return p; - } - - this.addMarker = function(p, from, priorTo) { - // if the last angle isn't filled in because we didn't have this point yet ... - if (priorTo != null && this.angles.length > 0 && this.angles[this.angles.length-1] == null) { - this.angles[this.angles.length-1] = this.points[this.points.length-1].angleTo(priorTo); - } - this.addMarkerAngle(p, from == null ? null : from.angleTo(p)); - } - - this.addMarkerAngle = function(p, a) { - this.points.push(p); - this.angles.push(a); - } - - this.getMarkerPoints = function() { return this.points; } - this.getMarkerAngles = function() { - for (var i=0; i 1) { - rx *= Math.sqrt(l); - ry *= Math.sqrt(l); - } - // cx', cy' - var s = (largeArcFlag == sweepFlag ? -1 : 1) * Math.sqrt( - ((Math.pow(rx,2)*Math.pow(ry,2))-(Math.pow(rx,2)*Math.pow(currp.y,2))-(Math.pow(ry,2)*Math.pow(currp.x,2))) / - (Math.pow(rx,2)*Math.pow(currp.y,2)+Math.pow(ry,2)*Math.pow(currp.x,2)) - ); - if (isNaN(s)) s = 0; - var cpp = new svg.Point(s * rx * currp.y / ry, s * -ry * currp.x / rx); - // cx, cy - var centp = new svg.Point( - (curr.x + cp.x) / 2.0 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, - (curr.y + cp.y) / 2.0 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y - ); - // vector magnitude - var m = function(v) { return Math.sqrt(Math.pow(v[0],2) + Math.pow(v[1],2)); } - // ratio between two vectors - var r = function(u, v) { return (u[0]*v[0]+u[1]*v[1]) / (m(u)*m(v)) } - // angle between two vectors - var a = function(u, v) { return (u[0]*v[1] < u[1]*v[0] ? -1 : 1) * Math.acos(r(u,v)); } - // initial angle - var a1 = a([1,0], [(currp.x-cpp.x)/rx,(currp.y-cpp.y)/ry]); - // angle delta - var u = [(currp.x-cpp.x)/rx,(currp.y-cpp.y)/ry]; - var v = [(-currp.x-cpp.x)/rx,(-currp.y-cpp.y)/ry]; - var ad = a(u, v); - if (r(u,v) <= -1) ad = Math.PI; - if (r(u,v) >= 1) ad = 0; - - // for markers - var dir = 1 - sweepFlag ? 1.0 : -1.0; - var ah = a1 + dir * (ad / 2.0); - var halfWay = new svg.Point( - centp.x + rx * Math.cos(ah), - centp.y + ry * Math.sin(ah) - ); - pp.addMarkerAngle(halfWay, ah - dir * Math.PI / 2); - pp.addMarkerAngle(cp, ah - dir * Math.PI); - - bb.addPoint(cp.x, cp.y); // TODO: this is too naive, make it better - if (ctx != null) { - var r = rx > ry ? rx : ry; - var sx = rx > ry ? 1 : rx / ry; - var sy = rx > ry ? ry / rx : 1; - - ctx.translate(centp.x, centp.y); - ctx.rotate(xAxisRotation); - ctx.scale(sx, sy); - ctx.arc(0, 0, r, a1, a1 + ad, 1 - sweepFlag); - ctx.scale(1/sx, 1/sy); - ctx.rotate(-xAxisRotation); - ctx.translate(-centp.x, -centp.y); - } - } - break; - case 'Z': - case 'z': - if (ctx != null) ctx.closePath(); - pp.current = pp.start; - } - } - - return bb; - } - - this.getMarkers = function() { - var points = this.PathParser.getMarkerPoints(); - var angles = this.PathParser.getMarkerAngles(); - - var markers = []; - for (var i=0; i 1) this.offset = 1; - - var stopColor = this.style('stop-color'); - if (this.style('stop-opacity').hasValue()) stopColor = stopColor.addOpacity(this.style('stop-opacity')); - this.color = stopColor.value; - } - svg.Element.stop.prototype = new svg.Element.ElementBase; - - // animation base element - svg.Element.AnimateBase = function(node) { - this.base = svg.Element.ElementBase; - this.base(node); - - svg.Animations.push(this); - - this.duration = 0.0; - this.begin = this.attribute('begin').toMilliseconds(); - this.maxDuration = this.begin + this.attribute('dur').toMilliseconds(); - - this.getProperty = function() { - var attributeType = this.attribute('attributeType').value; - var attributeName = this.attribute('attributeName').value; - - if (attributeType == 'CSS') { - return this.parent.style(attributeName, true); - } - return this.parent.attribute(attributeName, true); - }; - - this.initialValue = null; - this.initialUnits = ''; - this.removed = false; - - this.calcValue = function() { - // OVERRIDE ME! - return ''; - } - - this.update = function(delta) { - // set initial value - if (this.initialValue == null) { - this.initialValue = this.getProperty().value; - this.initialUnits = this.getProperty().getUnits(); - } - - // if we're past the end time - if (this.duration > this.maxDuration) { - // loop for indefinitely repeating animations - if (this.attribute('repeatCount').value == 'indefinite' - || this.attribute('repeatDur').value == 'indefinite') { - this.duration = 0.0 - } - else if (this.attribute('fill').valueOrDefault('remove') == 'freeze' && !this.frozen) { - this.frozen = true; - this.parent.animationFrozen = true; - this.parent.animationFrozenValue = this.getProperty().value; - } - else if (this.attribute('fill').valueOrDefault('remove') == 'remove' && !this.removed) { - this.removed = true; - this.getProperty().value = this.parent.animationFrozen ? this.parent.animationFrozenValue : this.initialValue; - return true; - } - return false; - } - this.duration = this.duration + delta; - - // if we're past the begin time - var updated = false; - if (this.begin < this.duration) { - var newValue = this.calcValue(); // tween - - if (this.attribute('type').hasValue()) { - // for transform, etc. - var type = this.attribute('type').value; - newValue = type + '(' + newValue + ')'; - } - - this.getProperty().value = newValue; - updated = true; - } - - return updated; - } - - this.from = this.attribute('from'); - this.to = this.attribute('to'); - this.values = this.attribute('values'); - if (this.values.hasValue()) this.values.value = this.values.value.split(';'); - - // fraction of duration we've covered - this.progress = function() { - var ret = { progress: (this.duration - this.begin) / (this.maxDuration - this.begin) }; - if (this.values.hasValue()) { - var p = ret.progress * (this.values.value.length - 1); - var lb = Math.floor(p), ub = Math.ceil(p); - ret.from = new svg.Property('from', parseFloat(this.values.value[lb])); - ret.to = new svg.Property('to', parseFloat(this.values.value[ub])); - ret.progress = (p - lb) / (ub - lb); - } - else { - ret.from = this.from; - ret.to = this.to; - } - return ret; - } - } - svg.Element.AnimateBase.prototype = new svg.Element.ElementBase; - - // animate element - svg.Element.animate = function(node) { - this.base = svg.Element.AnimateBase; - this.base(node); - - this.calcValue = function() { - var p = this.progress(); - - // tween value linearly - var newValue = p.from.numValue() + (p.to.numValue() - p.from.numValue()) * p.progress; - return newValue + this.initialUnits; - }; - } - svg.Element.animate.prototype = new svg.Element.AnimateBase; - - // animate color element - svg.Element.animateColor = function(node) { - this.base = svg.Element.AnimateBase; - this.base(node); - - this.calcValue = function() { - var p = this.progress(); - var from = new RGBColor(p.from.value); - var to = new RGBColor(p.to.value); - - if (from.ok && to.ok) { - // tween color linearly - var r = from.r + (to.r - from.r) * p.progress; - var g = from.g + (to.g - from.g) * p.progress; - var b = from.b + (to.b - from.b) * p.progress; - return 'rgb('+parseInt(r,10)+','+parseInt(g,10)+','+parseInt(b,10)+')'; - } - return this.attribute('from').value; - }; - } - svg.Element.animateColor.prototype = new svg.Element.AnimateBase; - - // animate transform element - svg.Element.animateTransform = function(node) { - this.base = svg.Element.AnimateBase; - this.base(node); - - this.calcValue = function() { - var p = this.progress(); - - // tween value linearly - var from = svg.ToNumberArray(p.from.value); - var to = svg.ToNumberArray(p.to.value); - var newValue = ''; - for (var i=0; i startI && child.attribute('x').hasValue()) break; // new group - width += child.measureTextRecursive(ctx); - } - return -1 * (textAnchor == 'end' ? width : width / 2.0); - } - return 0; - } - - this.renderChild = function(ctx, parent, i) { - var child = parent.children[i]; - if (child.attribute('x').hasValue()) { - child.x = child.attribute('x').toPixels('x') + this.getAnchorDelta(ctx, parent, i); - if (child.attribute('dx').hasValue()) child.x += child.attribute('dx').toPixels('x'); - } - else { - if (this.attribute('dx').hasValue()) this.x += this.attribute('dx').toPixels('x'); - if (child.attribute('dx').hasValue()) this.x += child.attribute('dx').toPixels('x'); - child.x = this.x; - } - this.x = child.x + child.measureText(ctx); - - if (child.attribute('y').hasValue()) { - child.y = child.attribute('y').toPixels('y'); - if (child.attribute('dy').hasValue()) child.y += child.attribute('dy').toPixels('y'); - } - else { - if (this.attribute('dy').hasValue()) this.y += this.attribute('dy').toPixels('y'); - if (child.attribute('dy').hasValue()) this.y += child.attribute('dy').toPixels('y'); - child.y = this.y; - } - this.y = child.y; - - child.render(ctx); - - for (var i=0; i0 && text[i-1]!=' ' && i0 && text[i-1]!=' ' && (i == text.length-1 || text[i+1]==' ')) arabicForm = 'initial'; - if (typeof(font.glyphs[c]) != 'undefined') { - glyph = font.glyphs[c][arabicForm]; - if (glyph == null && font.glyphs[c].type == 'glyph') glyph = font.glyphs[c]; - } - } - else { - glyph = font.glyphs[c]; - } - if (glyph == null) glyph = font.missingGlyph; - return glyph; - } - - this.renderChildren = function(ctx) { - var customFont = this.parent.style('font-family').getDefinition(); - if (customFont != null) { - var fontSize = this.parent.style('font-size').numValueOrDefault(svg.Font.Parse(svg.ctx.font).fontSize); - var fontStyle = this.parent.style('font-style').valueOrDefault(svg.Font.Parse(svg.ctx.font).fontStyle); - var text = this.getText(); - if (customFont.isRTL) text = text.split("").reverse().join(""); - - var dx = svg.ToNumberArray(this.parent.attribute('dx').value); - for (var i=0; i 0; - for (var i=0; i 0) { - // render as temporary group - var g = new svg.Element.g(); - g.children = this.children; - g.parent = this; - g.render(ctx); - } - } - - this.onclick = function() { - window.open(this.getHrefAttribute().value); - } - - this.onmousemove = function() { - svg.ctx.canvas.style.cursor = 'pointer'; - } - } - svg.Element.a.prototype = new svg.Element.TextElementBase; - - // image element - svg.Element.image = function(node) { - this.base = svg.Element.RenderedElementBase; - this.base(node); - - var href = this.getHrefAttribute().value; - if (href == '') { return; } - var isSvg = href.match(/\.svg$/) - - svg.Images.push(this); - this.loaded = false; - if (!isSvg) { - this.img = document.createElement('img'); - if (svg.opts['useCORS'] == true) { this.img.crossOrigin = 'Anonymous'; } - var self = this; - this.img.onload = function() { self.loaded = true; } - this.img.onerror = function() { svg.log('ERROR: image "' + href + '" not found'); self.loaded = true; } - this.img.src = href; - } - else { - this.img = svg.ajax(href); - this.loaded = true; - } - - this.renderChildren = function(ctx) { - var x = this.attribute('x').toPixels('x'); - var y = this.attribute('y').toPixels('y'); - - var width = this.attribute('width').toPixels('x'); - var height = this.attribute('height').toPixels('y'); - if (width == 0 || height == 0) return; - - ctx.save(); - if (isSvg) { - ctx.drawSvg(this.img, x, y, width, height); - } - else { - ctx.translate(x, y); - svg.AspectRatio(ctx, - this.attribute('preserveAspectRatio').value, - width, - this.img.width, - height, - this.img.height, - 0, - 0); - ctx.drawImage(this.img, 0, 0); - } - ctx.restore(); - } - - this.getBoundingBox = function() { - var x = this.attribute('x').toPixels('x'); - var y = this.attribute('y').toPixels('y'); - var width = this.attribute('width').toPixels('x'); - var height = this.attribute('height').toPixels('y'); - return new svg.BoundingBox(x, y, x + width, y + height); - } - } - svg.Element.image.prototype = new svg.Element.RenderedElementBase; - - // group element - svg.Element.g = function(node) { - this.base = svg.Element.RenderedElementBase; - this.base(node); - - this.getBoundingBox = function() { - var bb = new svg.BoundingBox(); - for (var i=0; i 0) { - var urlStart = srcs[s].indexOf('url'); - var urlEnd = srcs[s].indexOf(')', urlStart); - var url = srcs[s].substr(urlStart + 5, urlEnd - urlStart - 6); - var doc = svg.parseXml(svg.ajax(url)); - var fonts = doc.getElementsByTagName('font'); - for (var f=0; f= 0 ? -1 : 1; - var d = top || 1; + var k = (top >= 0) ? -1 : 1; + var d = (top || 1); top = top - k * d / m; } @@ -1571,21 +1503,21 @@ define('utils/utils',["exports"], function (exports) { var deltaLow = low - extent[0]; var deltaTop = extent[1] - top; - var limit = step / 2; + var limit = (step / 2); if (low >= 0) { // include 0 by default extent[0] = 0; } else { - var koeffLow = deltaLow <= limit ? step : 0; - extent[0] = extent[0] - koeffLow; + var koeffLow = (deltaLow <= limit) ? step : 0; + extent[0] = (extent[0] - koeffLow); } if (top <= 0) { // include 0 by default extent[1] = 0; } else { - var koeffTop = deltaTop <= limit ? step : 0; + var koeffTop = (deltaTop <= limit) ? step : 0; extent[1] = extent[1] + koeffTop; } @@ -1600,14 +1532,12 @@ define('utils/utils',["exports"], function (exports) { define('formatter-registry',["exports", "d3"], function (exports, _d3) { - /* jshint ignore:start */ var d3 = _d3; /* jshint ignore:end */ var FORMATS_MAP = { - "x-num-auto": function (x) { var v = parseFloat(x.toFixed(2)); - return Math.abs(v) < 1 ? v.toString() : d3.format("s")(v); + return (Math.abs(v) < 1) ? v.toString() : d3.format("s")(v); }, percent: function (x) { @@ -1626,14 +1556,14 @@ define('formatter-registry',["exports", "d3"], function (exports, _d3) { month: function (x) { var d = new Date(x); var m = d.getMonth(); - var formatSpec = m === 0 ? "%B, %Y" : "%B"; + var formatSpec = (m === 0) ? "%B, %Y" : "%B"; return d3.time.format(formatSpec)(x); }, "month-short": function (x) { var d = new Date(x); var m = d.getMonth(); - var formatSpec = m === 0 ? "%b '%y" : "%b"; + var formatSpec = (m === 0) ? "%b '%y" : "%b"; return d3.time.format(formatSpec)(x); }, @@ -1642,7 +1572,7 @@ define('formatter-registry',["exports", "d3"], function (exports, _d3) { quarter: function (x) { var d = new Date(x); var m = d.getMonth(); - var q = (m - m % 3) / 3; + var q = (m - (m % 3)) / 3; return "Q" + (q + 1) + " " + d.getFullYear(); }, @@ -1652,13 +1582,12 @@ define('formatter-registry',["exports", "d3"], function (exports, _d3) { }; var FormatterRegistry = { - get: function (formatAlias, nullOrUndefinedAlias) { var nullAlias = nullOrUndefinedAlias || ""; - var identity = function (x) { - return (x === null || typeof x === "undefined" ? nullAlias : x).toString(); - }; + var identity = (function (x) { + return (((x === null) || (typeof x === "undefined")) ? nullAlias : x).toString(); + }); var hasFormat = FORMATS_MAP.hasOwnProperty(formatAlias); var formatter = hasFormat ? FORMATS_MAP[formatAlias] : identity; @@ -1693,7 +1622,6 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", var utils = _utilsUtils.utils; var FormatterRegistry = _formatterRegistry.FormatterRegistry; - /* jshint ignore:start */ var _ = _underscore; var d3 = _d3; /* jshint ignore:end */ @@ -1709,9 +1637,9 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", }; var cutText = function (textString, widthLimit, getComputedTextLength) { - getComputedTextLength = getComputedTextLength || function (d3Text) { + getComputedTextLength = getComputedTextLength || (function (d3Text) { return d3Text.node().getComputedTextLength(); - }; + }); textString.each(function () { var textD3 = d3.select(this); @@ -1723,7 +1651,7 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", return memo; } - var text = i > 0 ? [memo, t].join(" ") : t; + var text = (i > 0) ? [memo, t].join(" ") : t; var len = getComputedTextLength(textD3.text(text)); if (len < widthLimit) { memo = text; @@ -1741,37 +1669,32 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", }; var wrapText = function (textNode, widthLimit, linesLimit, tickLabelFontHeight, isY, getComputedTextLength) { - getComputedTextLength = getComputedTextLength || function (d3Text) { + getComputedTextLength = getComputedTextLength || (function (d3Text) { return d3Text.node().getComputedTextLength(); - }; + }); var addLine = function (targetD3, text, lineHeight, x, y, dy, lineNumber) { - var dyNew = lineNumber * lineHeight + dy; + var dyNew = (lineNumber * lineHeight) + dy; return targetD3.append("tspan").attr("x", x).attr("y", y).attr("dy", dyNew + "em").text(text); }; textNode.each(function () { - var textD3 = d3.select(this), - tokens = textD3.text().split(/\s+/), - lineHeight = 1.1, - // ems - x = textD3.attr("x"), - y = textD3.attr("y"), - dy = parseFloat(textD3.attr("dy")); + var textD3 = d3.select(this), tokens = textD3.text().split(/\s+/), lineHeight = 1.1, // ems + x = textD3.attr("x"), y = textD3.attr("y"), dy = parseFloat(textD3.attr("dy")); textD3.text(null); var tempSpan = addLine(textD3, null, lineHeight, x, y, dy, 0); var stopReduce = false; - var tokensCount = tokens.length - 1; + var tokensCount = (tokens.length - 1); var lines = tokens.reduce(function (memo, next, i) { if (stopReduce) { return memo; } - var isLimit = memo.length === linesLimit || i === tokensCount; + var isLimit = (memo.length === linesLimit) || (i === tokensCount); var last = memo[memo.length - 1]; - var text = last !== "" ? last + " " + next : next; + var text = (last !== "") ? (last + " " + next) : next; var tLen = getComputedTextLength(tempSpan.text(text)); var over = tLen > widthLimit; @@ -1794,7 +1717,7 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", return l.length > 0; }); - y = isY ? -1 * (lines.length - 1) * Math.floor(tickLabelFontHeight * 0.5) : y; + y = isY ? (-1 * (lines.length - 1) * Math.floor(tickLabelFontHeight * 0.5)) : y; lines.forEach(function (text, i) { return addLine(textD3, text, lineHeight, x, y, dy, i); }); @@ -1810,10 +1733,10 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", var offsetSize = sectorSize / 2; if (x.scaleType === "ordinal" || x.scaleType === "period") { - var isHorizontal = "h" === getOrientation(x.guide.scaleOrient); + var isHorizontal = ("h" === getOrientation(x.guide.scaleOrient)); - var key = isHorizontal ? "x" : "y"; - var val = isHorizontal ? offsetSize : -offsetSize; + var key = (isHorizontal) ? "x" : "y"; + var val = (isHorizontal) ? offsetSize : (-offsetSize); selection.attr(key + "1", val).attr(key + "2", val); } @@ -1821,7 +1744,7 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", var decorateAxisLabel = function (nodeScale, x) { var orient = getOrientation(x.guide.scaleOrient); - var koeff = "h" === orient ? 1 : -1; + var koeff = ("h" === orient) ? 1 : -1; var labelTextNode = nodeScale.append("text").attr("transform", rotate(x.guide.label.rotate)).attr("class", x.guide.label.cssClass).attr("x", koeff * x.guide.size * 0.5).attr("y", koeff * x.guide.label.padding).style("text-anchor", x.guide.label.textAnchor); var delimiter = " > "; @@ -1830,22 +1753,22 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", tags.forEach(function (token, i) { labelTextNode.append("tspan").attr("class", "label-token label-token-" + i).text(token); - if (i < tLen - 1) { + if (i < (tLen - 1)) { labelTextNode.append("tspan").attr("class", "label-token-delimiter label-token-delimiter-" + i).text(delimiter); } }); if (x.guide.label.dock === "right") { var box = nodeScale.selectAll("path.domain").node().getBBox(); - labelTextNode.attr("x", orient === "h" ? box.width : 0); + labelTextNode.attr("x", (orient === "h") ? (box.width) : 0); } else if (x.guide.label.dock === "left") { var box = nodeScale.selectAll("path.domain").node().getBBox(); - labelTextNode.attr("x", orient === "h" ? 0 : -box.height); + labelTextNode.attr("x", (orient === "h") ? 0 : (-box.height)); } }; var decorateTickLabel = function (nodeScale, x) { - var isHorizontal = "h" === getOrientation(x.guide.scaleOrient); + var isHorizontal = ("h" === getOrientation(x.guide.scaleOrient)); var angle = x.guide.rotate; @@ -1891,7 +1814,7 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", if (linesOptions.length > 0) { var gridLines = grid.append("g").attr("class", "grid-lines"); - if (linesOptions.indexOf("x") > -1 && node.x.scaleDim) { + if ((linesOptions.indexOf("x") > -1) && node.x.scaleDim) { var x = node.x; var xGridAxis = d3.svg.axis().scale(x.scaleObj).orient(x.guide.scaleOrient).tickSize(H); @@ -1913,7 +1836,7 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", } } - if (linesOptions.indexOf("y") > -1 && node.y.scaleDim) { + if ((linesOptions.indexOf("y") > -1) && node.y.scaleDim) { var y = node.y; var yGridAxis = d3.svg.axis().scale(y.scaleObj).orient(y.guide.scaleOrient).tickSize(-W); @@ -2000,8 +1923,6 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", cutText: cutText, wrapText: wrapText }; - /* jshint ignore:end */ - exports.utilsDraw = utilsDraw; }); define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", "./formatter-registry", "./utils/utils-dom"], function (exports, _utilsUtils, _utilsUtilsDraw, _formatterRegistry, _utilsUtilsDom) { @@ -2097,7 +2018,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var specifier = "*"; if (dimType === "measure" && scaleType === "time") { var src = meta.source.filter(function (x) { - return x !== null; + return (x !== null); }).sort(); var resolutionAvg = 0; if (src.length > 1) { @@ -2137,8 +2058,8 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var dimX = meta.dimension(unit.x); var dimY = meta.dimension(unit.y); - var isXContinues = dimX.dimType === "measure"; - var isYContinues = dimY.dimType === "measure"; + var isXContinues = (dimX.dimType === "measure"); + var isYContinues = (dimY.dimType === "measure"); var xDensityPadding = settings.hasOwnProperty("xDensityPadding:" + dimX.dimType) ? settings["xDensityPadding:" + dimX.dimType] : settings.xDensityPadding; @@ -2160,8 +2081,8 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", unit.guide.y.tickFormat += "-short"; } - var xIsEmptyAxis = xValues.length === 0; - var yIsEmptyAxis = yValues.length === 0; + var xIsEmptyAxis = (xValues.length === 0); + var yIsEmptyAxis = (yValues.length === 0); var maxXTickSize = getMaxTickLabelSize(xValues, FormatterRegistry.get(unit.guide.x.tickFormat, unit.guide.x.tickFormatNullAlias), settings.getAxisTickLabelSize, settings.xAxisTickLabelLimit); @@ -2242,17 +2163,17 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", unit.guide.y.density = yTickBox.h + yDensityPadding * 2; if (!inlineLabels) { - unit.guide.x.label.padding = +xFontLabelHeight + (unit.guide.x.label.text ? xFontH + distToXAxisLabel : 0); - unit.guide.y.label.padding = -xFontLabelHeight + (unit.guide.y.label.text ? yFontW + distToYAxisLabel : 0); + unit.guide.x.label.padding = +xFontLabelHeight + ((unit.guide.x.label.text) ? (xFontH + distToXAxisLabel) : 0); + unit.guide.y.label.padding = -xFontLabelHeight + ((unit.guide.y.label.text) ? (yFontW + distToYAxisLabel) : 0); - var xLabelPadding = unit.guide.x.label.text ? unit.guide.x.label.padding + xFontLabelHeight : xFontH; - var yLabelPadding = unit.guide.y.label.text ? unit.guide.y.label.padding + yFontLabelHeight : yFontW; + var xLabelPadding = (unit.guide.x.label.text) ? (unit.guide.x.label.padding + xFontLabelHeight) : (xFontH); + var yLabelPadding = (unit.guide.y.label.text) ? (unit.guide.y.label.padding + yFontLabelHeight) : (yFontW); unit.guide.padding.b = xAxisPadding + xLabelPadding - xTickWidth; unit.guide.padding.l = yAxisPadding + yLabelPadding; - unit.guide.padding.b = unit.guide.x.hide ? 0 : unit.guide.padding.b; - unit.guide.padding.l = unit.guide.y.hide ? 0 : unit.guide.padding.l; + unit.guide.padding.b = (unit.guide.x.hide) ? 0 : unit.guide.padding.b; + unit.guide.padding.l = (unit.guide.y.hide) ? 0 : unit.guide.padding.l; } else { var pd = (xAxisPadding - xFontLabelHeight) / 2; unit.guide.x.label.padding = 0 + xFontLabelHeight - distToXAxisLabel + pd; @@ -2274,8 +2195,8 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", unit.guide.padding.b = xAxisPadding + xFontH; unit.guide.padding.l = yAxisPadding + yFontW; - unit.guide.padding.b = unit.guide.x.hide ? 0 : unit.guide.padding.b; - unit.guide.padding.l = unit.guide.y.hide ? 0 : unit.guide.padding.l; + unit.guide.padding.b = (unit.guide.x.hide) ? 0 : unit.guide.padding.b; + unit.guide.padding.l = (unit.guide.y.hide) ? 0 : unit.guide.padding.l; } unit.guide.x.tickFontHeight = maxXTickSize.height; @@ -2295,7 +2216,6 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var SpecEngineTypeMap = { - NONE: function (srcSpec, meta, settings) { var spec = utils.clone(srcSpec); fnTraverseSpec(utils.clone(spec.unit), spec.unit, function (selectorPredicates, unit) { @@ -2323,8 +2243,8 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", return unit; } - if (!xUnit && unit.x) xUnit = unit; - if (!yUnit && unit.y) yUnit = unit; + if (!xUnit && unit.x) (xUnit = unit); + if (!yUnit && unit.y) (yUnit = unit); unit.guide = unit.guide || {}; @@ -2381,7 +2301,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", unit.guide.showGridLines = "xy"; } - var isFacetUnit = !selectorPredicates.isLeaf && !selectorPredicates.isLeafParent; + var isFacetUnit = (!selectorPredicates.isLeaf && !selectorPredicates.isLeafParent); if (isFacetUnit) { // unit is a facet! unit.guide.x.cssClass += " facet-axis"; @@ -2391,8 +2311,8 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var dimX = meta.dimension(unit.x); var dimY = meta.dimension(unit.y); - var isXContinues = dimX.dimType === "measure"; - var isYContinues = dimY.dimType === "measure"; + var isXContinues = (dimX.dimType === "measure"); + var isYContinues = (dimY.dimType === "measure"); var xDensityPadding = settings.hasOwnProperty("xDensityPadding:" + dimX.dimType) ? settings["xDensityPadding:" + dimX.dimType] : settings.xDensityPadding; @@ -2407,8 +2327,8 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", unit.guide.x.tickFormat = unit.guide.x.tickFormat || getTickFormat(dimX, xMeta, settings.defaultFormats); unit.guide.y.tickFormat = unit.guide.y.tickFormat || getTickFormat(dimY, yMeta, settings.defaultFormats); - var xIsEmptyAxis = xValues.length === 0; - var yIsEmptyAxis = yValues.length === 0; + var xIsEmptyAxis = (xValues.length === 0); + var yIsEmptyAxis = (yValues.length === 0); var maxXTickSize = getMaxTickLabelSize(xValues, FormatterRegistry.get(unit.guide.x.tickFormat, unit.guide.x.tickFormatNullAlias), settings.getAxisTickLabelSize, settings.xAxisTickLabelLimit); @@ -2434,18 +2354,18 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var maxXTickH = isXVertical ? maxXTickSize.width : maxXTickSize.height; - if (!isXContinues && maxXTickH > settings.xAxisTickLabelLimit) { + if (!isXContinues && (maxXTickH > settings.xAxisTickLabelLimit)) { maxXTickH = settings.xAxisTickLabelLimit; } - if (!isXVertical && maxXTickSize.width > settings.xAxisTickLabelLimit) { + if (!isXVertical && (maxXTickSize.width > settings.xAxisTickLabelLimit)) { unit.guide.x.tickFormatWordWrap = true; unit.guide.x.tickFormatWordWrapLines = settings.xTickWordWrapLinesLimit; maxXTickH = settings.xTickWordWrapLinesLimit * maxXTickSize.height; } var maxYTickW = maxYTickSize.width; - if (!isYContinues && maxYTickW > settings.yAxisTickLabelLimit) { + if (!isYContinues && (maxYTickW > settings.yAxisTickLabelLimit)) { maxYTickW = settings.yAxisTickLabelLimit; unit.guide.y.tickFormatWordWrap = true; unit.guide.y.tickFormatWordWrapLines = settings.yTickWordWrapLinesLimit; @@ -2461,7 +2381,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var distToYAxisLabel = settings.distToYAxisLabel; - var xTickLabelW = Math.min(settings.xAxisTickLabelLimit, isXVertical ? maxXTickSize.height : maxXTickSize.width); + var xTickLabelW = Math.min(settings.xAxisTickLabelLimit, (isXVertical ? maxXTickSize.height : maxXTickSize.width)); unit.guide.x.density = xTickLabelW + xDensityPadding * 2; var guessLinesCount = Math.ceil(maxYTickSize.width / settings.yAxisTickLabelLimit); @@ -2470,19 +2390,19 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", unit.guide.y.density = yTickLabelH + yDensityPadding * 2; - unit.guide.x.label.padding = unit.guide.x.label.text ? xFontH + distToXAxisLabel : 0; - unit.guide.y.label.padding = unit.guide.y.label.text ? yFontW + distToYAxisLabel : 0; + unit.guide.x.label.padding = (unit.guide.x.label.text) ? (xFontH + distToXAxisLabel) : 0; + unit.guide.y.label.padding = (unit.guide.y.label.text) ? (yFontW + distToYAxisLabel) : 0; - var xLabelPadding = unit.guide.x.label.text ? unit.guide.x.label.padding + xFontLabelHeight : xFontH; - var yLabelPadding = unit.guide.y.label.text ? unit.guide.y.label.padding + yFontLabelHeight : yFontW; + var xLabelPadding = (unit.guide.x.label.text) ? (unit.guide.x.label.padding + xFontLabelHeight) : (xFontH); + var yLabelPadding = (unit.guide.y.label.text) ? (unit.guide.y.label.padding + yFontLabelHeight) : (yFontW); unit.guide.padding.b = xAxisPadding + xLabelPadding; unit.guide.padding.l = yAxisPadding + yLabelPadding; - unit.guide.padding.b = unit.guide.x.hide ? 0 : unit.guide.padding.b; - unit.guide.padding.l = unit.guide.y.hide ? 0 : unit.guide.padding.l; + unit.guide.padding.b = (unit.guide.x.hide) ? 0 : unit.guide.padding.b; + unit.guide.padding.l = (unit.guide.y.hide) ? 0 : unit.guide.padding.l; unit.guide.x.tickFontHeight = maxXTickSize.height; unit.guide.y.tickFontHeight = maxYTickSize.height; @@ -2547,8 +2467,8 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var g = root.guide; var xmd = g.x.$minimalDomain || 1; var ymd = g.y.$minimalDomain || 1; - var maxW = Math.max(xmd * g.x.density, xmd * s.w); - var maxH = Math.max(ymd * g.y.density, ymd * s.h); + var maxW = Math.max((xmd * g.x.density), (xmd * s.w)); + var maxH = Math.max((ymd * g.y.density), (ymd * s.h)); r = { w: maxW + g.padding.l + g.padding.r, @@ -2572,7 +2492,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var yDensityPadding = localSettings.hasOwnProperty("yDensityPadding:" + dimY.dimType) ? localSettings["yDensityPadding:" + dimY.dimType] : localSettings.yDensityPadding; - if (root.guide.x.hide !== true && root.guide.x.rotate !== 0 && perTickX > root.guide.x.$maxTickTextW + xDensityPadding * 2) { + if (root.guide.x.hide !== true && root.guide.x.rotate !== 0 && (perTickX > (root.guide.x.$maxTickTextW + xDensityPadding * 2))) { root.guide.x.rotate = 0; root.guide.x.textAnchor = "middle"; root.guide.x.tickFormatWordWrapLimit = perTickX; @@ -2580,15 +2500,15 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var xDelta = 0 - s + root.guide.x.$maxTickTextH; - root.guide.padding.b += root.guide.padding.b > 0 ? xDelta : 0; + root.guide.padding.b += (root.guide.padding.b > 0) ? xDelta : 0; - if (root.guide.x.label.padding > s + localSettings.xAxisPadding) { + if (root.guide.x.label.padding > (s + localSettings.xAxisPadding)) { root.guide.x.label.padding += xDelta; } } - if (root.guide.y.hide !== true && root.guide.y.rotate !== 0 && root.guide.y.tickFormatWordWrapLines === 1 && perTickY > root.guide.y.$maxTickTextW + yDensityPadding * 2) { - root.guide.y.tickFormatWordWrapLimit = perTickY - yDensityPadding * 2; + if (root.guide.y.hide !== true && root.guide.y.rotate !== 0 && (root.guide.y.tickFormatWordWrapLines === 1) && (perTickY > (root.guide.y.$maxTickTextW + yDensityPadding * 2))) { + root.guide.y.tickFormatWordWrapLimit = (perTickY - yDensityPadding * 2); } var newSize = { @@ -2608,14 +2528,14 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var size = settings.size; var scrollSize = settings.scrollBarWidth; - var deltaW = size.width - recommendedWidth; - var deltaH = size.height - recommendedHeight; + var deltaW = (size.width - recommendedWidth); + var deltaH = (size.height - recommendedHeight); - var screenW = deltaW >= 0 ? size.width : recommendedWidth; - var scrollW = deltaH >= 0 ? 0 : scrollSize; + var screenW = (deltaW >= 0) ? size.width : recommendedWidth; + var scrollW = (deltaH >= 0) ? 0 : scrollSize; - var screenH = deltaH >= 0 ? size.height : recommendedHeight; - var scrollH = deltaW >= 0 ? 0 : scrollSize; + var screenH = (deltaH >= 0) ? size.height : recommendedHeight; + var scrollH = (deltaW >= 0) ? 0 : scrollSize; settings.size.height = screenH - scrollH; settings.size.width = screenW - scrollW; @@ -2653,7 +2573,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var SpecEngineFactory = { get: function (typeName, settings) { - var engine = SpecEngineTypeMap[typeName] || SpecEngineTypeMap.NONE; + var engine = (SpecEngineTypeMap[typeName] || SpecEngineTypeMap.NONE); return function (srcSpec, meta) { var fullSpec = engine(srcSpec, meta, settings); if (settings.fitSize) { @@ -2688,7 +2608,6 @@ define('matrix',["exports"], function (exports) { }; Matrix.prototype = { - iterate: function (iterator) { var cube = this.cube; _.each(cube, function (row, ir) { @@ -2746,13 +2665,12 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" }; var LayoutEngineTypeMap = { - - NONE: function (rootNode) { + NONE: (function (rootNode) { return rootNode; - }, + }), EXTRACT: function (rootNode) { - var traverse = function (rootNodeMatrix, depth, rule) { + var traverse = (function (rootNodeMatrix, depth, rule) { var matrix = rootNodeMatrix; var rows = matrix.sizeR(); @@ -2761,10 +2679,10 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" matrix.iterate(function (r, c, subNodes) { subNodes.forEach(function (unit) { return rule(unit, { - firstRow: r === 0, - firstCol: c === 0, - lastRow: r === rows - 1, - lastCol: c === cols - 1, + firstRow: (r === 0), + firstCol: (c === 0), + lastRow: (r === (rows - 1)), + lastCol: (c === (cols - 1)), depth: depth }); }); @@ -2776,7 +2694,7 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" traverse(unit.$matrix, depth - 1, rule); }); }); - }; + }); var coordNode = utils.clone(rootNode); @@ -2818,14 +2736,14 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" traverse(coordMatrix, box.depth, function (unit, selectorPredicates) { var depth = selectorPredicates.depth; - unit.guide.x.hide = unit.guide.x.hide ? unit.guide.x.hide : !selectorPredicates.lastRow; - unit.guide.y.hide = unit.guide.y.hide ? unit.guide.y.hide : !selectorPredicates.firstCol; + unit.guide.x.hide = (unit.guide.x.hide) ? unit.guide.x.hide : !selectorPredicates.lastRow; + unit.guide.y.hide = (unit.guide.y.hide) ? unit.guide.y.hide : !selectorPredicates.firstCol; - var positiveFeedbackLoop = depth > 1 ? 0 : distanceBetweenFacets; - var negativeFeedbackLoop = depth > 1 ? distanceBetweenFacets : 0; + var positiveFeedbackLoop = (depth > 1) ? 0 : distanceBetweenFacets; + var negativeFeedbackLoop = (depth > 1) ? distanceBetweenFacets : 0; - unit.guide.x.padding += box.paddings[depth].b; - unit.guide.y.padding += box.paddings[depth].l; + unit.guide.x.padding += (box.paddings[depth].b); + unit.guide.y.padding += (box.paddings[depth].l); unit.guide.x.padding -= negativeFeedbackLoop; unit.guide.y.padding -= negativeFeedbackLoop; @@ -2843,10 +2761,9 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" }; var LayoutEngineFactory = { - - get: function (typeName) { - return LayoutEngineTypeMap[typeName] || LayoutEngineTypeMap.NONE; - } + get: (function (typeName) { + return (LayoutEngineTypeMap[typeName] || LayoutEngineTypeMap.NONE); + }) }; @@ -2855,41 +2772,30 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" define('plugins',["exports"], function (exports) { - var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); - }; - //plugins /** @class * @extends Plugin */ var Plugins = (function () { + var Plugins = /** @constructs */ function Plugins(plugins, chart) { this.chart = chart; this._plugins = plugins.map(this.initPlugin, this); - } + }; - _prototypeProperties(Plugins, null, { - initPlugin: { - value: function (plugin) { - var _this = this; - if (plugin.init) { - plugin.init(this.chart); - } - this.chart.on("destroy", plugin.destroy && plugin.destroy.bind(plugin) || function () {}); - Object.keys(plugin).forEach(function (name) { - if (name.indexOf("on") === 0) { - var event = name.substr(2); - _this.chart.on(event.toLowerCase(), plugin[name].bind(plugin)); - } - }); - }, - writable: true, - enumerable: true, - configurable: true + Plugins.prototype.initPlugin = function (plugin) { + var _this = this; + if (plugin.init) { + plugin.init(this.chart); } - }); + this.chart.on("destroy", plugin.destroy && plugin.destroy.bind(plugin) || (function () {})); + Object.keys(plugin).forEach(function (name) { + if (name.indexOf("on") === 0) { + var event = name.substr(2); + _this.chart.on(event.toLowerCase(), plugin[name].bind(plugin)); + } + }); + }; return Plugins; })(); @@ -2917,7 +2823,6 @@ define('unit-domain-period-generator',["exports"], function (exports) { var PERIODS_MAP = { - day: { cast: function (date) { return new Date(date.setHours(0, 0, 0, 0)); @@ -2954,7 +2859,7 @@ define('unit-domain-period-generator',["exports"], function (exports) { date = new Date(date.setHours(0, 0, 0, 0)); date = new Date(date.setDate(1)); var currentMonth = date.getMonth(); - var firstQuarterMonth = currentMonth - currentMonth % 3; + var firstQuarterMonth = currentMonth - (currentMonth % 3); return new Date(date.setMonth(firstQuarterMonth)); }, next: function (prevDate) { @@ -2976,7 +2881,6 @@ define('unit-domain-period-generator',["exports"], function (exports) { }; var UnitDomainPeriodGenerator = { - add: function (periodAlias, obj) { PERIODS_MAP[periodAlias.toLowerCase()] = obj; return this; @@ -3027,19 +2931,19 @@ define('size',["exports"], function (exports) { var len = f(Math.max.apply(null, [Math.abs(min), Math.abs(max), max - min])); - xMin = min < 0 ? min : 0; - k = len === 0 ? 1 : (maxSize - minSize) / len; + xMin = (min < 0) ? min : 0; + k = (len === 0) ? 1 : ((maxSize - minSize) / len); return function (x) { - var numX = x !== null ? parseFloat(x) : 0; + var numX = (x !== null) ? parseFloat(x) : 0; if (!_.isFinite(numX)) { return maxSize; } - var posX = numX - xMin; // translate to positive x domain + var posX = (numX - xMin); // translate to positive x domain - return minSize + f(posX) * k; + return (minSize + (f(posX) * k)); }; }; @@ -3048,15 +2952,9 @@ define('size',["exports"], function (exports) { define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./utils/utils", "./size", "underscore", "d3"], function (exports, _unitDomainPeriodGenerator, _utilsUtils, _size, _underscore, _d3) { - var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); - }; - var UnitDomainPeriodGenerator = _unitDomainPeriodGenerator.UnitDomainPeriodGenerator; var utils = _utilsUtils.utils; var sizeScale = _size.sizeScale; - /* jshint ignore:start */ var _ = _underscore; var d3 = _d3; /* jshint ignore:end */ @@ -3067,7 +2965,7 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util }, linear: function (inputValues, props) { - var domainParam = props.autoScale ? utils.autoScale(inputValues) : d3.extent(inputValues); + var domainParam = (props.autoScale) ? utils.autoScale(inputValues) : d3.extent(inputValues); var min = _.isNumber(props.min) ? props.min : domainParam[0]; var max = _.isNumber(props.max) ? props.max : domainParam[1]; @@ -3077,8 +2975,8 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util period: function (inputValues, props) { var domainParam = d3.extent(inputValues); - var min = _.isNull(props.min) || _.isUndefined(props.min) ? domainParam[0] : new Date(props.min).getTime(); - var max = _.isNull(props.max) || _.isUndefined(props.max) ? domainParam[1] : new Date(props.max).getTime(); + var min = (_.isNull(props.min) || _.isUndefined(props.min)) ? domainParam[0] : new Date(props.min).getTime(); + var max = (_.isNull(props.max) || _.isUndefined(props.max)) ? domainParam[1] : new Date(props.max).getTime(); var range = [new Date(Math.min(min, domainParam[0])), new Date(Math.max(max, domainParam[1]))]; @@ -3087,15 +2985,14 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util time: function (inputValues, props) { var domainParam = d3.extent(inputValues); - var min = _.isNull(props.min) || _.isUndefined(props.min) ? domainParam[0] : new Date(props.min).getTime(); - var max = _.isNull(props.max) || _.isUndefined(props.max) ? domainParam[1] : new Date(props.max).getTime(); + var min = (_.isNull(props.min) || _.isUndefined(props.min)) ? domainParam[0] : new Date(props.min).getTime(); + var max = (_.isNull(props.max) || _.isUndefined(props.max)) ? domainParam[1] : new Date(props.max).getTime(); return [new Date(Math.min(min, domainParam[0])), new Date(Math.max(max, domainParam[1]))]; } }; var rangeMethods = { - ordinal: function (inputValues, interval) { return d3.scale.ordinal().domain(inputValues).rangePoints(interval, 1); }, @@ -3114,25 +3011,25 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util }; var UnitDomainMixin = (function () { - function UnitDomainMixin(meta, data) { + var UnitDomainMixin = function UnitDomainMixin(meta, data) { var getPropMapper = function (prop) { - return function (propObj) { - var xObject = propObj || {}; + return (function (propObj) { + var xObject = (propObj || {}); return xObject.hasOwnProperty(prop) ? xObject[prop] : null; - }; + }); }; var getValueMapper = function (dim) { var d = meta[dim] || {}; - var f = d.value ? getPropMapper(d.value) : function (x) { + var f = d.value ? getPropMapper(d.value) : (function (x) { return x; - }; + }); var isTime = _.contains(["period", "time"], d.scale); - return isTime ? _.compose(function (v) { - return new Date(v).getTime(); - }, f) : f; + return isTime ? _.compose((function (v) { + return (new Date(v)).getTime(); + }), f) : f; }; var getOrder = function (dim) { @@ -3142,14 +3039,13 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util var getDomainSortStrategy = function (type) { var map = { - category: function (dim, fnMapperId, domain) { return domain; }, order: function (dim, fnMapperId, domain) { var metaOrder = getOrder(dim); - return metaOrder ? _.union(metaOrder, domain) : // arguments order is important + return (metaOrder) ? _.union(metaOrder, domain) : // arguments order is important _.sortBy(domain, fnMapperId); }, @@ -3157,9 +3053,9 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util return _.sortBy(domain, fnMapperId); }, - "as-is": function (dim, fnMapperId, domain) { + "as-is": (function (dim, fnMapperId, domain) { return domain; - } + }) }; return map[type] || map["as-is"]; @@ -3167,7 +3063,6 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util var getScaleSortStrategy = function (type) { var map = { - category: getDomainSortStrategy("category"), order: getDomainSortStrategy("order"), @@ -3198,9 +3093,9 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util }; }); return _(data).filter(function (row) { - return _.every(predicates, function (p) { + return _.every(predicates, (function (p) { return p(row); - }); + })); }); }; @@ -3236,15 +3131,15 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util var fValHub = { "order:period": function (xOptions) { - return function (x) { + return (function (x) { return UnitDomainPeriodGenerator.get(xOptions.period).cast(new Date(x)); - }; + }); }, "*": function (opts) { - return function (x) { + return (function (x) { return x; - }; + }); } }; @@ -3277,7 +3172,7 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util }; // have to copy properties since d3 produce Function with methods Object.keys(func).forEach(function (p) { - return wrap[p] = func[p]; + return (wrap[p] = func[p]); }); return wrap; }; @@ -3294,7 +3189,7 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util }); var buildArrayGetClass = function (domain, brewer) { - if (domain.length === 0 || domain.length === 1 && domain[0] === null) { + if (domain.length === 0 || (domain.length === 1 && domain[0] === null)) { return defaultColorClass; } else { var fullDomain = domain.map(function (x) { @@ -3343,7 +3238,7 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util wrap.legend = function (domainPropObject) { var value = info.extract(domainPropObject); - var label = opts.tickLabel ? (domainPropObject || {})[opts.tickLabel] : value; + var label = (opts.tickLabel) ? ((domainPropObject || {})[opts.tickLabel]) : (value); var color = func(value); return { value: value, color: color, label: label }; @@ -3369,42 +3264,35 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util return wrap; }; - } + }; - _prototypeProperties(UnitDomainMixin, null, { - mix: { - value: function (unit) { - unit.dimension = this.fnDimension; - unit.source = this.fnSource; - unit.domain = this.fnDomain; - unit.scaleMeta = this.fnScaleMeta; - - unit.scaleTo = this.fnScaleTo; - unit.scaleDist = this.fnScaleTo; - unit.scaleColor = this.fnScaleColor; - unit.scaleSize = this.fnScaleSize; - - unit.partition = function () { - return unit.data || unit.source(unit.$where); - }; - unit.groupBy = function (srcValues, splitByProperty) { - var varMeta = unit.scaleMeta(splitByProperty); - return _.chain(srcValues).groupBy(function (item) { - return varMeta.extract(item[splitByProperty]); - }).map(function (values) { - return { - key: values[0][splitByProperty], - values: values - }; - }).value(); - }; - return unit; - }, - writable: true, - enumerable: true, - configurable: true - } - }); + UnitDomainMixin.prototype.mix = function (unit) { + unit.dimension = this.fnDimension; + unit.source = this.fnSource; + unit.domain = this.fnDomain; + unit.scaleMeta = this.fnScaleMeta; + + unit.scaleTo = this.fnScaleTo; + unit.scaleDist = this.fnScaleTo; + unit.scaleColor = this.fnScaleColor; + unit.scaleSize = this.fnScaleSize; + + unit.partition = (function () { + return unit.data || unit.source(unit.$where); + }); + unit.groupBy = (function (srcValues, splitByProperty) { + var varMeta = unit.scaleMeta(splitByProperty); + return _.chain(srcValues).groupBy(function (item) { + return varMeta.extract(item[splitByProperty]); + }).map(function (values) { + return ({ + key: values[0][splitByProperty], + values: values + }); + }).value(); + }); + return unit; + }; return UnitDomainMixin; })(); @@ -3417,13 +3305,12 @@ define('units-registry',["exports"], function (exports) { var UnitsMap = {}; var UnitsRegistry = { - add: function (unitType, xUnit) { var unit = {}; - unit.draw = typeof xUnit === "function" ? xUnit : xUnit.draw; - unit.walk = xUnit.walk || function (x) { + unit.draw = (typeof xUnit === "function") ? xUnit : xUnit.draw; + unit.walk = xUnit.walk || (function (x) { return x; - }; + }); UnitsMap[unitType] = unit; return this; }, @@ -3446,7 +3333,6 @@ define('data-processor',["exports", "./utils/utils"], function (exports, _utilsU var DataProcessor = { - isYFunctionOfX: function (data, xFields, yFields) { var isRelationAFunction = true; var error = null; @@ -3496,7 +3382,7 @@ define('data-processor',["exports", "./utils/utils"], function (exports, _utilsU excludeNullValues: function (dimensions, onExclude) { var fields = Object.keys(dimensions).reduce(function (fields, k) { var d = dimensions[k]; - if ((!d.hasOwnProperty("hasNull") || d.hasNull) && (d.type === "measure" || d.scale === "period")) { + if ((!d.hasOwnProperty("hasNull") || d.hasNull) && ((d.type === "measure") || (d.scale === "period"))) { // rule: exclude null values of "measure" type or "period" scale fields.push(k); } @@ -3504,7 +3390,7 @@ define('data-processor',["exports", "./utils/utils"], function (exports, _utilsU }, []); return function (row) { var result = !fields.some(function (f) { - return !(f in row) || row[f] === null; + return (!(f in row) || (row[f] === null)); }); if (!result) { onExclude(row); @@ -3573,7 +3459,7 @@ define('data-processor',["exports", "./utils/utils"], function (exports, _utilsU var detectedType = typeScalePair.type; var detectedScale = typeScalePair.scale; - var isInContraToPrev = memo[key].type !== null && memo[key].type !== detectedType; + var isInContraToPrev = (memo[key].type !== null && memo[key].type !== detectedType); memo[key].type = isInContraToPrev ? defaultDetect.type : detectedType; memo[key].scale = isInContraToPrev ? defaultDetect.scale : detectedScale; } @@ -3629,46 +3515,16 @@ define('utils/layuot-template',["exports", "../const"], function (exports, _cons define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../event", "../spec-engine-factory", "../layout-engine-factory", "../plugins", "../utils/utils", "../utils/utils-dom", "../const", "../unit-domain-mixin", "../units-registry", "../data-processor", "../utils/layuot-template"], function (exports, _dslReader, _apiBalloon, _event, _specEngineFactory, _layoutEngineFactory, _plugins, _utilsUtils, _utilsUtilsDom, _const, _unitDomainMixin, _unitsRegistry, _dataProcessor, _utilsLayuotTemplate) { - var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); - }; - - var _get = function get(object, property, receiver) { - var desc = Object.getOwnPropertyDescriptor(object, property); - - if (desc === undefined) { - var parent = Object.getPrototypeOf(object); - - if (parent === null) { - return undefined; - } else { - return get(parent, property, receiver); - } - } else if ("value" in desc && desc.writable) { - return desc.value; - } else { - var getter = desc.get; - if (getter === undefined) { - return undefined; - } - return getter.call(receiver); - } - }; - - var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { + var _extends = function (child, parent) { + child.prototype = Object.create(parent.prototype, { constructor: { - value: subClass, + value: child, enumerable: false, writable: true, configurable: true } }); - if (superClass) subClass.__proto__ = superClass; + child.__proto__ = parent; }; var DSLReader = _dslReader.DSLReader; @@ -3686,8 +3542,8 @@ define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../even var DataProcessor = _dataProcessor.DataProcessor; var getLayout = _utilsLayuotTemplate.getLayout; var Plot = (function (Emitter) { - function Plot(config) { - _get(Object.getPrototypeOf(Plot.prototype), "constructor", this).call(this); + var Plot = function Plot(config) { + Emitter.call(this); this._svg = null; this._filtersStore = { filters: {}, @@ -3697,325 +3553,227 @@ define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../even this.setupConfig(config); //plugins this._plugins = new Plugins(this.config.plugins, this); - } + }; - _inherits(Plot, Emitter); + _extends(Plot, Emitter); - _prototypeProperties(Plot, null, { - setupConfig: { - value: function (config) { - this.config = _.defaults(config, { - spec: {}, - data: [], - plugins: [], - settings: {} - }); - this._emptyContainer = config.emptyContainer || ""; - // TODO: remove this particular config cases - this.config.settings.specEngine = this.config.specEngine || this.config.settings.specEngine; - this.config.settings.layoutEngine = this.config.layoutEngine || this.config.settings.layoutEngine; - this.config.settings = this.setupSettings(this.config.settings); - if (!utils.isArray(this.config.settings.specEngine)) { - this.config.settings.specEngine = [{ - width: Number.MAX_VALUE, - name: this.config.settings.specEngine - }]; - } + Plot.prototype.setupConfig = function (config) { + if (!config.spec && !config.spec.unit) { + throw new Error("Provide spec for plot"); + } - this.config.spec.dimensions = this.setupMetaInfo(this.config.spec.dimensions, this.config.data); + this.config = _.defaults(config, { + spec: {}, + data: [], + plugins: [], + settings: {} + }); + this._emptyContainer = config.emptyContainer || ""; + // TODO: remove this particular config cases + this.config.settings.specEngine = this.config.specEngine || this.config.settings.specEngine; + this.config.settings.layoutEngine = this.config.layoutEngine || this.config.settings.layoutEngine; + this.config.settings = this.setupSettings(this.config.settings); + if (!utils.isArray(this.config.settings.specEngine)) { + this.config.settings.specEngine = [{ + width: Number.MAX_VALUE, + name: this.config.settings.specEngine + }]; + } - var log = this.config.settings.log; - if (this.config.settings.excludeNull) { - this.addFilter({ - tag: "default", - predicate: DataProcessor.excludeNullValues(this.config.spec.dimensions, function (item) { - log([item, "point was excluded, because it has undefined values."], "WARN"); - }) - }); - } - }, - writable: true, - enumerable: true, - configurable: true - }, - getConfig: { - value: function () { - return this.config; - }, - writable: true, - enumerable: true, - configurable: true - }, - setupMetaInfo: { - value: function (dims, data) { - var meta = dims ? dims : DataProcessor.autoDetectDimTypes(data); - return DataProcessor.autoAssignScales(meta); - }, - writable: true, - enumerable: true, - configurable: true - }, - setupSettings: { - value: function (configSettings) { - var globalSettings = Plot.globalSettings; - var localSettings = {}; - Object.keys(globalSettings).forEach(function (k) { - localSettings[k] = _.isFunction(globalSettings[k]) ? globalSettings[k] : utils.clone(globalSettings[k]); - }); + this.config.spec.dimensions = this.setupMetaInfo(this.config.spec.dimensions, this.config.data); - return _.defaults(configSettings || {}, localSettings); - }, - writable: true, - enumerable: true, - configurable: true - }, - insertToRightSidebar: { - value: function (el) { - return utilsDom.appendTo(el, this._layout.rightSidebar); - }, - writable: true, - enumerable: true, - configurable: true - }, - addBalloon: { - value: function (conf) { - return new Tooltip("", conf || {}); - }, - writable: true, - enumerable: true, - configurable: true - }, - renderTo: { - value: function (target, xSize) { - this._renderGraph = null; - this._svg = null; - this._defaultSize = _.clone(xSize); - var container = d3.select(target); - var containerNode = container.node(); - this._target = target; - this._targetSizes = xSize; - if (containerNode === null) { - throw new Error("Target element not found"); - } + var log = this.config.settings.log; + if (this.config.settings.excludeNull) { + this.addFilter({ + tag: "default", + predicate: DataProcessor.excludeNullValues(this.config.spec.dimensions, function (item) { + log([item, "point was excluded, because it has undefined values."], "WARN"); + }) + }); + } + }; - containerNode.appendChild(this._layout.layout); - container = d3.select(this._layout.content); - //todo don't compute width if width or height were passed - var size = xSize || {}; - this._layout.content.innerHTML = ""; - if (!size.width || !size.height) { - size = _.defaults(size, utilsDom.getContainerSize(this._layout.content.parentNode)); - } + Plot.prototype.getConfig = function () { + return this.config; + }; - var drawData = this.getData(); - if (drawData.length === 0) { - this._layout.content.innerHTML = this._emptyContainer; - return; - } - this._targetSizes = size; - this._layout.content.innerHTML = ""; + Plot.prototype.setupMetaInfo = function (dims, data) { + var meta = (dims) ? dims : DataProcessor.autoDetectDimTypes(data); + return DataProcessor.autoAssignScales(meta); + }; - var domainMixin = new UnitDomainMixin(this.config.spec.dimensions, drawData); + Plot.prototype.setupSettings = function (configSettings) { + var globalSettings = Plot.globalSettings; + var localSettings = {}; + Object.keys(globalSettings).forEach(function (k) { + localSettings[k] = (_.isFunction(globalSettings[k])) ? globalSettings[k] : utils.clone(globalSettings[k]); + }); - var specItem = _.find(this.config.settings.specEngine, function (item) { - return size.width <= item.width; - }); + return _.defaults(configSettings || {}, localSettings); + }; + Plot.prototype.insertToRightSidebar = function (el) { + return utilsDom.appendTo(el, this._layout.rightSidebar); + }; - this.config.settings.size = size; - var specEngine = SpecEngineFactory.get(specItem.name, this.config.settings); + Plot.prototype.addBalloon = function (conf) { + return new Tooltip("", conf || {}); + }; - var fullSpec = specEngine(this.config.spec, domainMixin.mix({})); + Plot.prototype.renderTo = function (target, xSize) { + this._renderGraph = null; + this._svg = null; + this._defaultSize = _.clone(xSize); + var container = d3.select(target); + var containerNode = container.node(); + this._target = target; + this._targetSizes = xSize; + if (containerNode === null) { + throw new Error("Target element not found"); + } - var optimalSize = this.config.settings.size; + containerNode.appendChild(this._layout.layout); + container = d3.select(this._layout.content); + //todo don't compute width if width or height were passed + var size = xSize || {}; + this._layout.content.innerHTML = ""; + if (!size.width || !size.height) { + size = _.defaults(size, utilsDom.getContainerSize(this._layout.content.parentNode)); + } - var reader = new DSLReader(domainMixin, UnitsRegistry); + var drawData = this.getData(); + if (drawData.length === 0) { + this._layout.content.innerHTML = this._emptyContainer; + return; + } + this._targetSizes = size; + this._layout.content.innerHTML = ""; - var chart = this; - var logicXGraph = reader.buildGraph(fullSpec); - var layoutGraph = LayoutEngineFactory.get(this.config.settings.layoutEngine)(logicXGraph); - var renderGraph = reader.calcLayout(layoutGraph, optimalSize); - var svgXElement = reader.renderGraph(renderGraph, container.append("svg").attr("class", CSS_PREFIX + "svg").attr("width", optimalSize.width).attr("height", optimalSize.height), function (unitMeta) { - return chart.fire("unitready", unitMeta); - }); - this._renderGraph = renderGraph; - this._svg = svgXElement.node(); - svgXElement.selectAll(".i-role-datum").call(propagateDatumEvents(this)); - this._layout.rightSidebar.style.maxHeight = optimalSize.height + "px"; - this.fire("render", this._svg); - }, - writable: true, - enumerable: true, - configurable: true - }, - getData: { - value: function (param) { - param = param || {}; - var filters = _.chain(this._filtersStore.filters).values().flatten().reject(function (filter) { - return _.contains(param.excludeFilter, filter.tag); - }).pluck("predicate").value(); - return _.filter(this.config.data, _.reduce(filters, function (newPredicate, filter) { - return function (x) { - return newPredicate(x) && filter(x); - }; - }, function () { - return true; - })); - }, - writable: true, - enumerable: true, - configurable: true - }, - setData: { - value: function (data) { - this.config.data = data; - this.refresh(); - }, - writable: true, - enumerable: true, - configurable: true - }, - getSVG: { - value: function () { - return this._svg; - }, - writable: true, - enumerable: true, - configurable: true - }, - addFilter: { - value: function (filter) { - var tag = filter.tag; - var filters = this._filtersStore.filters[tag] = this._filtersStore.filters[tag] || []; - var id = this._filtersStore.tick++; - filter.id = id; - filters.push(filter); - this.refresh(); - return id; - }, - writable: true, - enumerable: true, - configurable: true - }, - removeFilter: { - value: function (id) { - var _this = this; - _.each(this._filtersStore.filters, function (filters, key) { - _this._filtersStore.filters[key] = _.reject(filters, function (item) { - return item.id === id; - }); - }); - this.refresh(); - }, - writable: true, - enumerable: true, - configurable: true - }, - refresh: { - value: function () { - if (this._target) { - this.renderTo(this._target, this._defaultSize); - } - }, - writable: true, - enumerable: true, - configurable: true - }, - resize: { - value: function () { - var sizes = arguments[0] === undefined ? {} : arguments[0]; - this.renderTo(this._target, sizes); - }, - writable: true, - enumerable: true, - configurable: true - }, - select: { - value: function (queryFilter) { - var r = []; + var domainMixin = new UnitDomainMixin(this.config.spec.dimensions, drawData); - if (!this._renderGraph) { - return r; - } + var specItem = _.find(this.config.settings.specEngine, function (item) { + return (size.width <= item.width); + }); - var fnTraverseLayout = function (node, iterator) { - iterator(node); - (node.childUnits || []).forEach(function (subNode) { - return fnTraverseLayout(subNode, iterator); - }); - }; - fnTraverseLayout(this._renderGraph, function (node) { - if (queryFilter(node)) { - r.push(node); - } - }); + this.config.settings.size = size; + var specEngine = SpecEngineFactory.get(specItem.name, this.config.settings); - return r; - }, - writable: true, - enumerable: true, - configurable: true - } - }); + var fullSpec = specEngine(this.config.spec, domainMixin.mix({})); - return Plot; - })(Emitter); + var optimalSize = this.config.settings.size; - exports.Plot = Plot; -}); -define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-processor"], function (exports, _tauPlot, _utilsUtils, _dataProcessor) { - + var reader = new DSLReader(domainMixin, UnitsRegistry); - var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - }; + var chart = this; + var logicXGraph = reader.buildGraph(fullSpec); + var layoutGraph = LayoutEngineFactory.get(this.config.settings.layoutEngine)(logicXGraph); + var renderGraph = reader.calcLayout(layoutGraph, optimalSize); + var svgXElement = reader.renderGraph(renderGraph, container.append("svg").attr("class", CSS_PREFIX + "svg").attr("width", optimalSize.width).attr("height", optimalSize.height), function (unitMeta) { + return chart.fire("unitready", unitMeta); + }); + this._renderGraph = renderGraph; + this._svg = svgXElement.node(); + svgXElement.selectAll(".i-role-datum").call(propagateDatumEvents(this)); + this._layout.rightSidebar.style.maxHeight = optimalSize.height + "px"; + this.fire("render", this._svg); + }; - var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); - }; + Plot.prototype.getData = function (param) { + param = param || {}; + var filters = _.chain(this._filtersStore.filters).values().flatten().reject(function (filter) { + return _.contains(param.excludeFilter, filter.tag); + }).pluck("predicate").value(); + return _.filter(this.config.data, _.reduce(filters, function (newPredicate, filter) { + return function (x) { + return newPredicate(x) && filter(x); + }; + }, function () { + return true; + })); + }; + + Plot.prototype.setData = function (data) { + this.config.data = data; + this.refresh(); + }; - var _get = function get(object, property, receiver) { - var desc = Object.getOwnPropertyDescriptor(object, property); + Plot.prototype.getSVG = function () { + return this._svg; + }; - if (desc === undefined) { - var parent = Object.getPrototypeOf(object); + Plot.prototype.addFilter = function (filter) { + var tag = filter.tag; + var filters = this._filtersStore.filters[tag] = this._filtersStore.filters[tag] || []; + var id = this._filtersStore.tick++; + filter.id = id; + filters.push(filter); + this.refresh(); + return id; + }; - if (parent === null) { - return undefined; - } else { - return get(parent, property, receiver); + Plot.prototype.removeFilter = function (id) { + var _this = this; + _.each(this._filtersStore.filters, function (filters, key) { + _this._filtersStore.filters[key] = _.reject(filters, function (item) { + return item.id === id; + }); + }); + this.refresh(); + }; + + Plot.prototype.refresh = function () { + if (this._target) { + this.renderTo(this._target, this._defaultSize); } - } else if ("value" in desc && desc.writable) { - return desc.value; - } else { - var getter = desc.get; - if (getter === undefined) { - return undefined; + }; + + Plot.prototype.resize = function (sizes) { + if (sizes === undefined) sizes = {}; + this.renderTo(this._target, sizes); + }; + + Plot.prototype.select = function (queryFilter) { + var r = []; + + if (!this._renderGraph) { + return r; } - return getter.call(receiver); - } - }; - var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { + var fnTraverseLayout = function (node, iterator) { + iterator(node); + (node.childUnits || []).forEach(function (subNode) { + return fnTraverseLayout(subNode, iterator); + }); + }; + + fnTraverseLayout(this._renderGraph, function (node) { + if (queryFilter(node)) { + r.push(node); + } + }); + + return r; + }; + + return Plot; + })(Emitter); + + exports.Plot = Plot; +}); +define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-processor"], function (exports, _tauPlot, _utilsUtils, _dataProcessor) { + + + var _extends = function (child, parent) { + child.prototype = Object.create(parent.prototype, { constructor: { - value: subClass, + value: child, enumerable: false, writable: true, configurable: true } }); - if (superClass) subClass.__proto__ = superClass; + child.__proto__ = parent; }; var Plot = _tauPlot.Plot; @@ -4024,11 +3782,11 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p var convertAxis = function (data) { - return !data ? null : data; + return (!data) ? null : data; }; var normalizeSettings = function (axis) { - return !utils.isArray(axis) ? [axis] : axis; + return (!utils.isArray(axis)) ? [axis] : axis; }; var createElement = function (type, config) { @@ -4052,26 +3810,24 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p FAIL: "FAIL" }; /* jshint ignore:start */ - var strategyNormalizeAxis = (function () { - var _strategyNormalizeAxis = {}; - - _defineProperty(_strategyNormalizeAxis, status.SUCCESS, function (axis) { + var strategyNormalizeAxis = (function (_strategyNormalizeAxis) { + _strategyNormalizeAxis[status.SUCCESS] = function (axis) { return axis; - }); + }; - _defineProperty(_strategyNormalizeAxis, status.FAIL, function (axis, data) { + _strategyNormalizeAxis[status.FAIL] = function (axis, data) { throw new Error((data.messages || []).join("\n") || "This configuration is not supported, See http://api.taucharts.com/basic/facet.html#easy-approach-for-creating-facet-chart"); - }); + }; - _defineProperty(_strategyNormalizeAxis, status.WARNING, function (axis, config) { + _strategyNormalizeAxis[status.WARNING] = function (axis, config) { var measure = axis[config.indexMeasureAxis[0]]; var newAxis = _.without(axis, measure); newAxis.push(measure); return newAxis; - }); + }; return _strategyNormalizeAxis; - })(); + })({}); /* jshint ignore:end */ function validateAxis(dimensions, axis, axisName) { return axis.reduce(function (result, item, index) { @@ -4088,7 +3844,7 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p result.status = status.WARNING; } else if (result.countMeasureAxis > 1) { result.status = status.FAIL; - result.messages.push("There are more then one measure dimensions for axis \"" + axisName + "\""); + result.messages.push("There is more than one measure dimension for \"" + axisName + "\" axis"); } } return result; @@ -4169,7 +3925,6 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p var log = config.settings.log; var lineOrientationStrategies = { - none: function (config) { return null; }, @@ -4243,7 +3998,7 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p } }; var Chart = (function (Plot) { - function Chart(config) { + var Chart = function Chart(config) { config = _.defaults(config, { autoResize: true }); if (config.autoResize) { Chart.winAware.push(this); @@ -4251,29 +4006,23 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p config.settings = this.setupSettings(config.settings); config.dimensions = this.setupMetaInfo(config.dimensions, config.data); var chartFactory = typesChart[config.type]; + if (_.isFunction(chartFactory)) { - _get(Object.getPrototypeOf(Chart.prototype), "constructor", this).call(this, chartFactory(config)); + Plot.call(this, chartFactory(config)); } else { throw new Error("Chart type " + config.type + " is not supported. Use one of " + _.keys(typesChart).join(", ") + "."); } - } + }; - _inherits(Chart, Plot); + _extends(Chart, Plot); - _prototypeProperties(Chart, null, { - destroy: { - value: function () { - var index = Chart.winAware.indexOf(this); - if (index !== -1) { - Chart.winAware.splice(index, 1); - } - _get(Object.getPrototypeOf(Chart.prototype), "destroy", this).call(this); - }, - writable: true, - enumerable: true, - configurable: true + Chart.prototype.destroy = function () { + var index = Chart.winAware.indexOf(this); + if (index !== -1) { + Chart.winAware.splice(index, 1); } - }); + Plot.prototype.destroy.call(this); + }; return Chart; })(Plot); @@ -4294,15 +4043,14 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p function resize() { rIndex = 0; var chart; - for (var i = 0, - l = Chart.winAware.length; i < l; i++) { + for (var i = 0, l = Chart.winAware.length; i < l; i++) { chart = Chart.winAware[i]; chart.resize(); } } return requestReposition; - })(); + }()); Chart.winAware = []; window.addEventListener("resize", Chart.resizeOnWindowEvent); exports.Chart = Chart; @@ -4317,13 +4065,12 @@ define('elements/coords',["exports", "../utils/utils-draw", "../const", "../util var FacetAlgebra = { - CROSS: function (root, dimX, domainX, dimY, domainY) { var domX = domainX.length === 0 ? [null] : domainX; var domY = domainY.length === 0 ? [null] : domainY.reverse(); var convert = function (v) { - return v instanceof Date ? v.getTime() : v; + return (v instanceof Date) ? v.getTime() : v; }; return _(domY).map(function (rowVal) { @@ -4345,9 +4092,9 @@ define('elements/coords',["exports", "../utils/utils-draw", "../const", "../util }; var TFuncMap = function (opName) { - return FacetAlgebra[opName] || function () { + return FacetAlgebra[opName] || (function () { return [[{}]]; - }; + }); }; var inheritRootProps = function (unit, root, props) { @@ -4357,12 +4104,11 @@ define('elements/coords',["exports", "../utils/utils-draw", "../const", "../util }; var coords = { - walk: function (unit, continueTraverse) { var root = _.defaults(unit, { $where: {} }); var isFacet = _.any(root.unit, function (n) { - return n.type.indexOf("COORDS.") === 0; + return (n.type.indexOf("COORDS.") === 0); }); var unitFunc = TFuncMap(isFacet ? "CROSS" : ""); @@ -4598,12 +4344,11 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct }; var flipHub = { - NORM: function (node, xScale, yScale, width, height, defaultSizeParams, category) { var minimalHeight = 1; var yMin = Math.min.apply(Math, _toArray(yScale.domain())); var isYNumber = !isNaN(yMin); - var startValue = !isYNumber || yMin <= 0 ? 0 : yMin; + var startValue = (!isYNumber || (yMin <= 0)) ? 0 : yMin; var isXNumber = isMeasure(node.x); var _ref = isXNumber ? defaultSizeParams : getSizesParams({ @@ -4617,28 +4362,28 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var calculateX = function (d) { - return xScale(d[node.x.scaleDim]) - tickWidth / 2; + return xScale(d[node.x.scaleDim]) - (tickWidth / 2); }; - var calculateY = isYNumber ? function (d) { + var calculateY = isYNumber ? (function (d) { var valY = d[node.y.scaleDim]; var dotY = yScale(Math.max(startValue, valY)); var h = Math.abs(yScale(valY) - yScale(startValue)); - var isTooSmall = h < minimalHeight; - return isTooSmall && valY > 0 ? dotY - minimalHeight : dotY; - } : function (d) { + var isTooSmall = (h < minimalHeight); + return (isTooSmall && (valY > 0)) ? (dotY - minimalHeight) : dotY; + }) : (function (d) { return yScale(d[node.y.scaleDim]); - }; + }); var calculateWidth = function (d) { return intervalWidth; }; - var calculateHeight = isYNumber ? function (d) { + var calculateHeight = isYNumber ? (function (d) { var valY = d[node.y.scaleDim]; var h = Math.abs(yScale(valY) - yScale(startValue)); - return valY === 0 ? h : Math.max(minimalHeight, h); - } : function (d) { - return height - yScale(d[node.y.scaleDim]); - }; + return (valY === 0) ? h : Math.max(minimalHeight, h); + }) : (function (d) { + return (height - yScale(d[node.y.scaleDim])); + }); var calculateTranslate = function (d, index) { return utilsDraw.translate(index * offsetCategory + offsetCategory / 2, 0); @@ -4651,7 +4396,7 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var minimalHeight = 1; var xMin = Math.min.apply(Math, _toArray(xScale.domain())); var isXNumber = !isNaN(xMin); - var startValue = !isXNumber || xMin <= 0 ? 0 : xMin; + var startValue = (!isXNumber || (xMin <= 0)) ? 0 : xMin; var isYNumber = isMeasure(node.y); var _ref2 = isYNumber ? defaultSizeParams : getSizesParams({ @@ -4664,26 +4409,26 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var offsetCategory = _ref2.offsetCategory; - var calculateX = isXNumber ? function (d) { + var calculateX = isXNumber ? (function (d) { var valX = d[node.x.scaleDim]; var h = Math.abs(xScale(valX) - xScale(startValue)); var dotX = xScale(Math.min(startValue, valX)); - var delta = h - minimalHeight; - var offset = valX > 0 ? minimalHeight + delta : valX < 0 ? 0 - minimalHeight : 0; + var delta = (h - minimalHeight); + var offset = (valX > 0) ? (minimalHeight + delta) : ((valX < 0) ? (0 - minimalHeight) : 0); - var isTooSmall = delta < 0; - return isTooSmall ? dotX + offset : dotX; - } : 0; + var isTooSmall = (delta < 0); + return (isTooSmall) ? (dotX + offset) : (dotX); + }) : 0; var calculateY = function (d) { - return yScale(d[node.y.scaleDim]) - tickWidth / 2; + return yScale(d[node.y.scaleDim]) - (tickWidth / 2); }; - var calculateWidth = isXNumber ? function (d) { + var calculateWidth = isXNumber ? (function (d) { var valX = d[node.x.scaleDim]; var h = Math.abs(xScale(valX) - xScale(startValue)); - return valX === 0 ? h : Math.max(minimalHeight, h); - } : function (d) { + return (valX === 0) ? h : Math.max(minimalHeight, h); + }) : (function (d) { return xScale(d[node.x.scaleDim]); - }; + }); var calculateHeight = function (d) { return intervalWidth; }; @@ -4698,29 +4443,27 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var interval = function (node) { var options = node.options; - var xScale = options.xScale, - yScale = options.yScale, - colorScale = options.color; + var xScale = options.xScale, yScale = options.yScale, colorScale = options.color; var categories = node.groupBy(node.partition(), node.color.scaleDim); var method = flipHub[node.flip ? "FLIP" : "NORM"]; var facetNode = node.parentUnit.parentUnit || node.parentUnit; - var _method = method(node, xScale, yScale, options.width, options.height, { + var _ref3 = method(node, xScale, yScale, options.width, options.height, { tickWidth: 5, intervalWidth: 5, offsetCategory: 0 }, node.groupBy(facetNode.partition(), node.color.scaleDim)); - var calculateX = _method.calculateX; - var calculateY = _method.calculateY; - var calculateWidth = _method.calculateWidth; - var calculateHeight = _method.calculateHeight; - var calculateTranslate = _method.calculateTranslate; + var calculateX = _ref3.calculateX; + var calculateY = _ref3.calculateY; + var calculateWidth = _ref3.calculateWidth; + var calculateHeight = _ref3.calculateHeight; + var calculateTranslate = _ref3.calculateTranslate; var updateBar = function () { return this.attr("height", calculateHeight).attr("width", calculateWidth).attr("class", function (d) { - return "i-role-element i-role-datum bar " + CSS_PREFIX + "bar " + colorScale(d[node.color.scaleDim]); + return ("i-role-element i-role-datum bar " + CSS_PREFIX + "bar " + colorScale(d[node.color.scaleDim])); }).attr("x", calculateX).attr("y", calculateY); }; @@ -4753,12 +4496,11 @@ define('elements/coords-parallel',["exports", "../utils/utils-draw", "../const", var inheritRootProps = function (unit, root, props) { var r = _.defaults(utils.clone(unit), _.pick.apply(_, [root].concat(props))); - r.guide = _.extend(utils.clone(root.guide || {}), r.guide || {}); + r.guide = _.extend(utils.clone(root.guide || {}), (r.guide || {})); return r; }; var CoordsParallel = { - walk: function (unit, continueTraverse) { var root = _.defaults(unit, { $where: {} }); @@ -4837,7 +4579,6 @@ define('elements/coords-parallel-line',["exports", "../utils/utils-draw", "../co var CoordsParallelLine = { - draw: function (node) { node.color = node.dimension(node.color, node); @@ -4877,7 +4618,7 @@ define('elements/coords-parallel-line',["exports", "../utils/utils-draw", "../co var segment = options.width / (node.x.length - 1); var segmentMap = {}; node.x.forEach(function (propName, i) { - segmentMap[propName] = i * segment; + segmentMap[propName] = (i * segment); }); var fnLine = d3.svg.line().x(function (d) { @@ -4945,7 +4686,6 @@ define('node-map',["exports", "./elements/coords", "./elements/line", "./element }; var nodeMap = { - "COORDS.RECT": { walk: coords.walk, draw: function (node, continueTraverse) { @@ -5026,7 +4766,6 @@ define('tau.newCharts',["exports", "./utils/utils-dom", "./charts/tau.plot", "./ } }, globalSettings: { - log: function (msg, type) { type = type || "INFO"; if (!Array.isArray(msg)) { diff --git a/build/production/tauCharts.min.js b/build/production/tauCharts.min.js index 0b81fdef8..e5a10d396 100644 --- a/build/production/tauCharts.min.js +++ b/build/production/tauCharts.min.js @@ -1,9 +1,7 @@ /*! taucharts - v0.3.4 - 2015-01-19 * https://github.com/TargetProcess/tauCharts * Copyright (c) 2015 Taucraft Limited; Licensed Apache License 2.0 */ -!function(a,b){if("function"==typeof define&&define.amd)define(["underscore","d3"],function(a,c){return b(a,c)});else if("object"==typeof module&&module.exports){{var c=require("underscore");require("d3")}module.exports=b(c)}else a.tauCharts=b(a._,a.d3)}(this,function(a,b){var c,d,e;return function(a){function b(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(b,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(a,d.concat([b,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(c){if(b(r,c)){var d=r[c];delete r[c],t[c]=!0,m.apply(a,d)}if(!b(q,c)&&!b(t,c))throw new Error("No "+c);return q[c]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(c,d,e,f){var h,k,l,m,n,s,u=[],v=typeof e;if(f=f||c,"undefined"===v||"function"===v){for(d=!d.length&&e.length?["require","exports","module"]:d,n=0;n','','','<%= xTick %>',"","",""].join(""),e=a.template(d),f=document.createElement("div");f.style.position="absolute",f.style.visibility="hidden",f.style.width="100px",f.style.height="100px",f.style.border="1px solid green",document.body.appendChild(f),f.innerHTML=e({xTick:c});var g=b.select(f).selectAll(".x.axis .tick text")[0][0],h={width:0,height:0},i=g.getBoundingClientRect();h.width=i.right-i.left,h.height=i.bottom-i.top;var j=0!==c.length?h.width/c.length:0;return h.width=h.width+1.5*j,document.body.removeChild(f),h}};c.utilsDom=e}),e("dsl-reader",["exports"],function(b){var c=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},d=function(){function b(a,b){this.domain=a,this.UnitsRegistry=b}return c(b,null,{buildGraph:{value:function(a){var b=this,c=function(a){return b.UnitsRegistry.get(a.type).walk(b.domain.mix(a),c)};return c(a.unit)},writable:!0,enumerable:!0,configurable:!0},calcLayout:{value:function(a,b){a.options={top:0,left:0,width:b.width,height:b.height};var c=function(a){if(!a.$matrix)return a;var b,d=a.options,e=a.guide.padding,f=d.width-(e.l+e.r),g=d.height-(e.t+e.b),h=a.$matrix.sizeR(),i=a.$matrix.sizeC(),j=f/i,k=g/h;return b=a.guide.split?{calcHeight:function(a,b,c,d){return a/d},calcTop:function(a,b,c,d){return(b+1)*(a/d)*c}}:{calcHeight:function(a){return a},calcTop:function(a,b){return b*k}},a.childUnits=a.childUnits||[],a.$matrix.iterate(function(d,e,f){var g=f.length;f.forEach(function(f,h){f.options={width:j,left:e*j,height:b.calcHeight(k,d,h,g),top:b.calcTop(k,d,h,g)},a.childUnits.push(f),c(f)})}),a};return c(a)},writable:!0,enumerable:!0,configurable:!0},renderGraph:{value:function(b,c,d){var e=this,f=d||function(a){return a};b.options.container=c;var g=function(b){var c=e.domain.mix(b),d=e.UnitsRegistry.get(b.type).draw(c),h=b.childUnits||[];h.forEach(function(c){c.options=a.extend({container:d},c.options),c.parentUnit=b,g(c)}),f(c)};return b.parentUnit=null,g(b),b.options.container},writable:!0,enumerable:!0,configurable:!0}}),b}();b.DSLReader=d}),e("const",["exports"],function(a){a.CSS_PREFIX="graphical-report__"}),e("api/balloon",["exports","../const"],function(a,b){function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){return a&&null!=a.setInterval}function e(a){var b=l.pageYOffset||o.scrollTop,e=l.pageXOffset||o.scrollLeft,f={left:0,right:0,top:0,bottom:0,width:0,height:0};if(d(a))f.width=l.innerWidth||o.clientWidth,f.height=l.innerHeight||o.clientHeight;else{if(!o.contains(a)||null==a.getBoundingClientRect)return f;c(f,a.getBoundingClientRect()),f.width=f.right-f.left,f.height=f.bottom-f.top}return f.top=f.top+b-o.clientTop,f.left=f.left+e-o.clientLeft,f.right=f.left+f.width,f.bottom=f.top+f.height,f}function f(a){return 0|Math.round(String(a).replace(/[^\-0-9.]/g,""))}function g(a){var b=String(q(a,g.propName)),c=b.match(/([0-9.]+)([ms]{1,2})/);return c&&(b=Number(c[1]),"s"===c[2]&&(b*=1e3)),0|b}function h(a,b){return this instanceof h?(this.hidden=1,this.options=c(r(h.defaults),b),this._createElement(),void this.content(a)):new h(a,b)}var i=b.CSS_PREFIX,j=function(a){return{add:function(b){a.classList.add(b)},remove:function(b){a.classList.remove(b)}}},k=function(a,b){return a.indexOf(b)},l=window,m=l.document,n=m.body,o=m.documentElement,p=["top","bottom"],q=l.getComputedStyle;g.propName=function(){for(var a=m.createElement("div"),b=["transitionDuration","webkitTransitionDuration"],c="1s",d=0;d=b.bottom&&(c[0]="top"),c[1]){case"left":a.right-this.width<=b.left&&(c[1]="right");break;case"right":a.left+this.width>=b.right&&(c[1]="left");break;default:a.left+a.width/2+this.width/2>=b.right?c[1]="left":a.right-a.width/2-this.width/2<=b.left&&(c[1]="right")}else switch(a.left-this.width-d<=b.left?c[0]="right":a.right+this.width+d>=b.right&&(c[0]="left"),c[1]){case"top":a.bottom-this.height<=b.top&&(c[1]="bottom");break;case"bottom":a.top+this.height>=b.bottom&&(c[1]="top");break;default:a.top+a.height/2+this.height/2>=b.bottom?c[1]="top":a.bottom-a.height/2-this.height/2<=b.top&&(c[1]="bottom")}return c.join("-")},h.prototype.position=function(a,b){this.attachedTo&&(a=this.attachedTo),null==a&&this._p?(a=this._p[0],b=this._p[1]):this._p=arguments;var c="number"==typeof a?{left:0|a,right:0|a,top:0|b,bottom:0|b,width:0,height:0}:e(a),d=this.spacing,f=this._pickPlace(c);f!==this.curPlace&&(this.curPlace&&this.classes.remove(this.curPlace),this.classes.add(f),this.curPlace=f);var g,h;switch(this.curPlace){case"top":g=c.top-this.height-d,h=c.left+c.width/2-this.width/2;break;case"top-left":g=c.top-this.height-d,h=c.right-this.width;break;case"top-right":g=c.top-this.height-d,h=c.left;break;case"bottom":g=c.bottom+d,h=c.left+c.width/2-this.width/2;break;case"bottom-left":g=c.bottom+d,h=c.right-this.width;break;case"bottom-right":g=c.bottom+d,h=c.left;break;case"left":g=c.top+c.height/2-this.height/2,h=c.left-this.width-d;break;case"left-top":g=c.bottom-this.height,h=c.left-this.width-d;break;case"left-bottom":g=c.top,h=c.left-this.width-d;break;case"right":g=c.top+c.height/2-this.height/2,h=c.right+d;break;case"right-top":g=c.bottom-this.height,h=c.right+d;break;case"right-bottom":g=c.top,h=c.right+d}return this.element.style.top=Math.round(g)+"px",this.element.style.left=Math.round(h)+"px",this},h.prototype.show=function(a,b){return a=this.attachedTo?this.attachedTo:a,clearTimeout(this.aIndex),null!=a&&this.position(a,b),this.hidden&&(this.hidden=0,n.appendChild(this.element)),this.attachedTo&&this._aware(),this.options.inClass&&(this.options.effectClass&&void this.element.clientHeight,this.classes.add(this.options.inClass)),this},h.prototype.getElement=function(){return this.element},h.prototype.hide=function(){if(!this.hidden){var a=this,b=0;return this.options.inClass&&(this.classes.remove(this.options.inClass),this.options.effectClass&&(b=g(this.element))),this.attachedTo&&this._unaware(),clearTimeout(this.aIndex),this.aIndex=setTimeout(function(){a.aIndex=0,n.removeChild(a.element),a.hidden=1},b),this}},h.prototype.toggle=function(a,b){return this[this.hidden?"show":"hide"](a,b)},h.prototype.destroy=function(){clearTimeout(this.aIndex),this._unaware(),this.hidden||n.removeChild(this.element),this.element=this.options=null},h.prototype._aware=function(){var a=k(h.winAware,this);~a||h.winAware.push(this)},h.prototype._unaware=function(){var a=k(h.winAware,this);~a&&h.winAware.splice(a,1)},h.reposition=function(){function a(){!c&&h.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=h.winAware.length;d>b;b++)a=h.winAware[b],a.position()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),h.winAware=[],window.addEventListener("resize",h.reposition),window.addEventListener("scroll",h.reposition),h.classTypes=["type","effect"],h.defaults={baseClass:i+"tooltip",typeClass:null,effectClass:null,inClass:"in",place:"top",spacing:null,auto:0},a.Tooltip=h}),e("event",["exports"],function(a){function b(a){var b=e[a];return b||(b=function(){for(var b,c,d=this,e=0;d=d.handler;){if(c=d.callbacks[a],"function"==typeof c){if(!b)for(b=[this],e=0;e=0?-1:1,f=d||1;d-=e*f/b}for(var g=[c,d],h=g[1]-g[0],i=Math.pow(10,Math.floor(Math.log(h/b)/Math.LN10)),j=b/h*i,k=[[.15,10],[.35,5],[.75,2],[1,1],[2,1]],l=-1;j>k[++l][0];);i*=k[l][1],g[0]=Math.floor(g[0]/i)*i,g[1]=Math.ceil(g[1]/i)*i;var m=c-g[0],n=g[1]-d,o=i/2;if(c>=0)g[0]=0;else{var p=o>=m?i:0;g[0]=g[0]-p}if(0>=d)g[1]=0;else{var q=o>=n?i:0;g[1]=g[1]+q}return[parseFloat(g[0].toFixed(15)),parseFloat(g[1].toFixed(15))]},traverseJSON:b};a.utils=c}),e("formatter-registry",["exports","d3"],function(b,c){var d=c,e={"x-num-auto":function(a){var b=parseFloat(a.toFixed(2));return Math.abs(b)<1?b.toString():d.format("s")(b)},percent:function(a){var b=parseFloat((100*a).toFixed(2));return b.toString()+"%"},day:d.time.format("%d-%b-%Y"),"day-short":d.time.format("%d-%b"),week:d.time.format("%d-%b-%Y"),"week-short":d.time.format("%d-%b"),month:function(a){var b=new Date(a),c=b.getMonth(),e=0===c?"%B, %Y":"%B";return d.time.format(e)(a)},"month-short":function(a){var b=new Date(a),c=b.getMonth(),e=0===c?"%b '%y":"%b";return d.time.format(e)(a)},"month-year":d.time.format("%B, %Y"),quarter:function(a){var b=new Date(a),c=b.getMonth(),d=(c-c%3)/3;return"Q"+(d+1)+" "+b.getFullYear()},year:d.time.format("%Y"),"x-time-auto":null},f={get:function(b,c){var f=c||"",g=function(a){return(null===a||"undefined"==typeof a?f:a).toString()},h=e.hasOwnProperty(b),i=h?e[b]:g;return h&&(i=e[b]),!h&&b&&(i=function(c){var e=a.isDate(c)?d.time.format(b):d.format(b);return e(c)}),h||b||(i=g),i},add:function(a,b){e[a]=b}};b.FormatterRegistry=f}),e("utils/utils-draw",["exports","../utils/utils","../formatter-registry","underscore","d3"],function(a,b,c,d,e){var f=(b.utils,c.FormatterRegistry),g=d,h=e,i=function(a,b){return"translate("+a+","+b+")"},j=function(a){return"rotate("+a+")"},k=function(a){return g.contains(["bottom","top"],a.toLowerCase())?"h":"v"},l=function(a,b,c){c=c||function(a){return a.node().getComputedTextLength()},a.each(function(){var a=h.select(this),d=a.text().split(/\s+/),e=!1,f=d.reduce(function(d,f,g){if(e)return d;var h=g>0?[d,f].join(" "):f,i=c(a.text(h));if(b>i)d=h;else{var j=Math.floor(b/i*h.length);d=h.substr(0,j-4)+"...",e=!0}return d},"");a.text(f)})},m=function(a,b,c,d,e,f){f=f||function(a){return a.node().getComputedTextLength()};var g=function(a,b,c,d,e,f,g){var h=g*c+f;return a.append("tspan").attr("x",d).attr("y",e).attr("dy",h+"em").text(b)};a.each(function(){var a=h.select(this),i=a.text().split(/\s+/),j=1.1,k=a.attr("x"),l=a.attr("y"),m=parseFloat(a.attr("dy"));a.text(null);var n=g(a,null,j,k,l,m,0),o=!1,p=i.length-1,q=i.reduce(function(a,d,e){if(o)return a;var g=a.length===c||e===p,h=a[a.length-1],i=""!==h?h+" "+d:d,j=f(n.text(i)),k=j>b;if(k&&g){var l=Math.floor(b/j*i.length);a[a.length-1]=i.substr(0,l-4)+"...",o=!0}return k&&!g&&a.push(d),k||(a[a.length-1]=i),a},[""]).filter(function(a){return a.length>0});l=e?-1*(q.length-1)*Math.floor(.5*d):l,q.forEach(function(b,c){return g(a,b,j,k,l,m,c)}),n.remove()})},n=function(a,b,c){var d=a.selectAll(".tick line"),e=c/d[0].length,f=e/2;if("ordinal"===b.scaleType||"period"===b.scaleType){var g="h"===k(b.guide.scaleOrient),h=g?"x":"y",i=g?f:-f;d.attr(h+"1",i).attr(h+"2",i)}},o=function(a,b){var c=k(b.guide.scaleOrient),d="h"===c?1:-1,e=a.append("text").attr("transform",j(b.guide.label.rotate)).attr("class",b.guide.label.cssClass).attr("x",d*b.guide.size*.5).attr("y",d*b.guide.label.padding).style("text-anchor",b.guide.label.textAnchor),f=" > ",g=b.guide.label.text.split(f),h=g.length;if(g.forEach(function(a,b){e.append("tspan").attr("class","label-token label-token-"+b).text(a),h-1>b&&e.append("tspan").attr("class","label-token-delimiter label-token-delimiter-"+b).text(f)}),"right"===b.guide.label.dock){var i=a.selectAll("path.domain").node().getBBox();e.attr("x","h"===c?i.width:0)}else if("left"===b.guide.label.dock){var i=a.selectAll("path.domain").node().getBBox();e.attr("x","h"===c?0:-i.height)}},p=function(a,b){var c="h"===k(b.guide.scaleOrient),d=b.guide.rotate,e=a.selectAll(".tick text");e.attr("transform",j(d)).style("text-anchor",b.guide.textAnchor),90===d&&e.attr("x",9).attr("y",0),b.guide.tickFormatWordWrap?e.call(m,b.guide.tickFormatWordWrapLimit,b.guide.tickFormatWordWrapLines,b.guide.$maxTickTextH,!c):e.call(l,b.guide.tickFormatWordWrapLimit)},q=function(a,b,c){var d=this;if(a.scaleDim){var e=h.svg.axis().scale(a.scaleObj).orient(a.guide.scaleOrient),g=f.get(a.guide.tickFormat,a.guide.tickFormatNullAlias);null!==g&&(e.ticks(Math.round(c/a.guide.density)),e.tickFormat(g));var j=d.append("g").attr("class",a.guide.cssClass).attr("transform",i.apply(null,b)).call(e);n(j,a,c),p(j,a),o(j,a)}},r=function(a,b,c){var d=this,e=d.append("g").attr("class","grid").attr("transform",i(0,0)),g=(a.guide.showGridLines||"").toLowerCase();if(g.length>0){var j=e.append("g").attr("class","grid-lines");if(g.indexOf("x")>-1&&a.x.scaleDim){var k=a.x,l=h.svg.axis().scale(k.scaleObj).orient(k.guide.scaleOrient).tickSize(b),m=f.get(k.guide.tickFormat);null!==m&&(l.ticks(Math.round(c/k.guide.density)),l.tickFormat(m));var o=j.append("g").attr("class","grid-lines-x").call(l);n(o,k,c);var p=o.select("g.tick");if(p.node()&&"translate(0,0)"!==p.attr("transform")){var q=p.node().cloneNode(!0);j.node().appendChild(q),h.select(q).attr("class","border").attr("transform",i(0,0)).select("line").attr("x1",0).attr("x2",0)}}if(g.indexOf("y")>-1&&a.y.scaleDim){var r=a.y,s=h.svg.axis().scale(r.scaleObj).orient(r.guide.scaleOrient).tickSize(-c),m=f.get(r.guide.tickFormat);null!==m&&(s.ticks(Math.round(b/r.guide.density)),s.tickFormat(m));var t=j.append("g").attr("class","grid-lines-y").call(s);n(t,r,b)}j.selectAll("text").remove()}return e},s=function(a,b,c){return a[b]=g.defaults(a[b]||{},{label:""}),a[b].label=g.isObject(a[b].label)?a[b].label:{text:a[b].label},a[b].label=g.defaults(a[b].label,c||{},{padding:32,rotate:0,textAnchor:"middle",cssClass:"label",dock:null}),a[b]},t=function(a,b,c){return a[b]=g.defaults(a[b],c||{},{padding:0,density:30,rotate:0,tickPeriod:null,tickFormat:null,autoScale:!0}),a[b].tickFormat=a[b].tickFormat||a[b].tickPeriod,a[b]},u=function(a){return a.options=a.options||{},a.guide=a.guide||{},a.guide.padding=g.defaults(a.guide.padding||{},{l:0,b:0,r:0,t:0}),a.guide.x=s(a.guide,"x"),a.guide.x=t(a.guide,"x",{cssClass:"x axis",scaleOrient:"bottom",textAnchor:"middle"}),a.guide.y=s(a.guide,"y",{rotate:-90}),a.guide.y=t(a.guide,"y",{cssClass:"y axis",scaleOrient:"left",textAnchor:"end"}),a.guide.size=s(a.guide,"size"),a.guide.color=s(a.guide,"color"),a},v={translate:i,rotate:j,getOrientation:k,fnDrawDimAxis:q,fnDrawGrid:r,applyNodeDefaults:u,cutText:l,wrapText:m};a.utilsDraw=v}),e("spec-engine-factory",["exports","./utils/utils","./utils/utils-draw","./formatter-registry","./utils/utils-dom"],function(b,c,d,e,f){function g(b,c,d,e){var f=b.hasOwnProperty(d)?b[d]:{};a.each(e,function(b){a.extend(c.guide[d][b],f[b])}),a.extend(c.guide[d],a.omit.apply(a,[f].concat[e]))}var h=c.utils,i=d.utilsDraw,j=e.FormatterRegistry,k=(f.utilsDom,function(b,c){var d=c.guide||{},e={x:["label"],y:["label"],size:["label"],color:["label"],padding:[]};return a.each(e,function(a,c){g(d,b,c,a)}),a.extend(b.guide,a.omit.apply(a,[d].concat(a.keys(e)))),b}),l=function(b,c){return b.guide=b.guide||{},b.guide.padding=b.guide.padding||{l:0,t:0,r:0,b:0},b.hasOwnProperty("unit")||(b=a.defaults(b,c),b.guide=a.defaults(b.guide,h.clone(c.guide)),b.guide.x=a.defaults(b.guide.x,h.clone(c.guide.x)),b.guide.y=a.defaults(b.guide.y,h.clone(c.guide.y))),b},m=function(a){var b=a.unit||[],c=!a.hasOwnProperty("unit"),d=!b.some(function(a){return a.hasOwnProperty("unit")});return{type:a.type,isLeaf:c,isLeafParent:!c&&d}},n=function(b,c,d,e){if(0===b.length)return{width:0,height:0};if(null===c){var f=d("TauChart Library");return f.width=.625*e,f}var g=a.max(b,function(a){return c(a).toString().length}),h=a.isNumber(g)?".00":"";return d(c(g)+h)},o=function(a,b,c){var d=a.dimType,e=a.scaleType,f="*";if("measure"===d&&"time"===e){var g=b.source.filter(function(a){return null!==a}).sort(),h=0;if(g.length>1){for(var i=1,j=g.length,k=[];j>i;)k.push(g[i]-g[i-1]),++i;var l=k.reduce(function(a,b){return a+=b},0);h=l/k.length}var m=[[31536e6,"year"],[7776e6,"quarter"],[2592e6,"month"],[6048e5,"week"],[864e5,"day"],[36e5,"hour"],[6e4,"min"],[1e3,"sec"],[0,"ms"]],n=-1;do++n;while(m[n][0]>h);f=m[n][1]}var o=[d,e,f].join(":"),p=[d,e].join(":");return c[o]||c[p]||c[d]||null},p=function(a,b,c,d,e,f){var g=b.dimension(a.x),h=b.dimension(a.y),i="measure"===g.dimType,k="measure"===h.dimType,l=c.hasOwnProperty("xDensityPadding:"+g.dimType)?c["xDensityPadding:"+g.dimType]:c.xDensityPadding,m=c.hasOwnProperty("yDensityPadding:"+h.dimType)?c["yDensityPadding:"+h.dimType]:c.yDensityPadding,p=b.scaleMeta(a.x,a.guide.x),q=p.values,r=b.scaleMeta(a.y,a.guide.y),s=r.values;a.guide.x.tickFormat=a.guide.x.tickFormat||o(g,p,c.defaultFormats),a.guide.y.tickFormat=a.guide.y.tickFormat||o(h,r,c.defaultFormats),["day","week","month"].indexOf(a.guide.x.tickFormat)>=0&&(a.guide.x.tickFormat+="-short"),["day","week","month"].indexOf(a.guide.y.tickFormat)>=0&&(a.guide.y.tickFormat+="-short");var t=0===q.length,u=0===s.length,v=n(q,j.get(a.guide.x.tickFormat,a.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),w=n(s,j.get(a.guide.y.tickFormat,a.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),x=c.xAxisPadding,y=c.yAxisPadding,z=d?!i:!1,A=e?!k:!1;a.guide.x.padding=t?0:x,a.guide.y.padding=u?0:y,a.guide.x.rotate=z?90:0,a.guide.x.textAnchor=z?"start":a.guide.x.textAnchor,a.guide.y.rotate=A?-90:0,a.guide.y.textAnchor=A?"middle":a.guide.y.textAnchor;var B=t?0:c.xTickWidth,C=u?0:c.yTickWidth;a.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,a.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var D=z?{w:v.height,h:v.width}:{h:v.height,w:v.width};if(v.width>c.xAxisTickLabelLimit){a.guide.x.tickFormatWordWrap=!0,a.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit;var E=Math.ceil(v.width/c.xAxisTickLabelLimit),F=Math.min(E,c.xTickWordWrapLinesLimit),G=F*v.height;z?(D.h=c.xAxisTickLabelLimit,D.w=G):(D.h=G,D.w=c.xAxisTickLabelLimit)}var H=A?{w:w.height,h:w.width}:{h:w.height,w:w.width};if(w.width>c.yAxisTickLabelLimit){a.guide.y.tickFormatWordWrap=!0,a.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit;var E=Math.ceil(w.width/c.yAxisTickLabelLimit),F=Math.min(E,c.yTickWordWrapLinesLimit),G=F*w.height;A?(H.w=G,H.h=c.yAxisTickLabelLimit):(H.w=c.yAxisTickLabelLimit,H.h=G)}var I=B+D.h,J=C+H.w,K=c.xFontLabelHeight,L=c.yFontLabelHeight,M=c.distToXAxisLabel,N=c.distToYAxisLabel;if(a.guide.x.density=D.w+2*l,a.guide.y.density=H.h+2*m,f){var O=(x-K)/2;a.guide.x.label.padding=0+K-M+O,a.guide.y.label.padding=0-N+O,a.guide.x.label.cssClass+=" inline",a.guide.x.label.dock="right",a.guide.x.label.textAnchor="end",a.guide.y.label.cssClass+=" inline",a.guide.y.label.dock="right",a.guide.y.label.textAnchor="end",a.guide.padding.b=x+I,a.guide.padding.l=y+J,a.guide.padding.b=a.guide.x.hide?0:a.guide.padding.b,a.guide.padding.l=a.guide.y.hide?0:a.guide.padding.l}else{a.guide.x.label.padding=+K+(a.guide.x.label.text?I+M:0),a.guide.y.label.padding=-K+(a.guide.y.label.text?J+N:0);var P=a.guide.x.label.text?a.guide.x.label.padding+K:I,Q=a.guide.y.label.text?a.guide.y.label.padding+L:J;a.guide.padding.b=x+P-B,a.guide.padding.l=y+Q,a.guide.padding.b=a.guide.x.hide?0:a.guide.padding.b,a.guide.padding.l=a.guide.y.hide?0:a.guide.padding.l}return a.guide.x.tickFontHeight=v.height,a.guide.y.tickFontHeight=w.height,a.guide.x.$minimalDomain=q.length,a.guide.y.$minimalDomain=s.length,a.guide.x.$maxTickTextW=v.width,a.guide.x.$maxTickTextH=v.height,a.guide.y.$maxTickTextW=w.width,a.guide.y.$maxTickTextH=w.height,a},q={NONE:function(a,b,c){var d=h.clone(a);return r(h.clone(d.unit),d.unit,function(a,b){return b.guide.x.tickFontHeight=c.getAxisTickLabelSize("X").height,b.guide.y.tickFontHeight=c.getAxisTickLabelSize("Y").height,b.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,b.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit,b}),d},"BUILD-LABELS":function(b){var c=h.clone(b),d=[],e=[],f=null,g=null;return h.traverseJSON(c.unit,"unit",m,function(b,c){if(b.isLeaf)return c;!f&&c.x&&(f=c),!g&&c.y&&(g=c),c.guide=c.guide||{},c.guide.x=c.guide.x||{label:""},c.guide.y=c.guide.y||{label:""},c.guide.x.label=a.isObject(c.guide.x.label)?c.guide.x.label:{text:c.guide.x.label},c.guide.y.label=a.isObject(c.guide.y.label)?c.guide.y.label:{text:c.guide.y.label},c.x&&(c.guide.x.label.text=c.guide.x.label.text||c.x),c.y&&(c.guide.y.label.text=c.guide.y.label.text||c.y);var h=c.guide.x.label.text;h&&(d.push(h),c.guide.x.tickFormatNullAlias=c.guide.x.hasOwnProperty("tickFormatNullAlias")?c.guide.x.tickFormatNullAlias:"No "+h,c.guide.x.label.text="");var i=c.guide.y.label.text;return i&&(e.push(i),c.guide.y.tickFormatNullAlias=c.guide.y.hasOwnProperty("tickFormatNullAlias")?c.guide.y.tickFormatNullAlias:"No "+i,c.guide.y.label.text=""),c}),f&&(f.guide.x.label.text=d.join(" > ")),g&&(g.guide.y.label.text=e.join(" > ")),c},"BUILD-GUIDE":function(a,b,c){var d=h.clone(a);return r(h.clone(d.unit),d.unit,function(a,d){if(a.isLeaf)return d;a.isLeafParent&&!d.guide.hasOwnProperty("showGridLines")&&(d.guide.showGridLines="xy");var e=!a.isLeaf&&!a.isLeafParent;e&&(d.guide.x.cssClass+=" facet-axis",d.guide.y.cssClass+=" facet-axis");var f=b.dimension(d.x),g=b.dimension(d.y),h="measure"===f.dimType,i="measure"===g.dimType,k=c.hasOwnProperty("xDensityPadding:"+f.dimType)?c["xDensityPadding:"+f.dimType]:c.xDensityPadding,l=c.hasOwnProperty("yDensityPadding:"+g.dimType)?c["yDensityPadding:"+g.dimType]:c.yDensityPadding,m=b.scaleMeta(d.x,d.guide.x),p=m.values,q=b.scaleMeta(d.y,d.guide.y),r=q.values;d.guide.x.tickFormat=d.guide.x.tickFormat||o(f,m,c.defaultFormats),d.guide.y.tickFormat=d.guide.y.tickFormat||o(g,q,c.defaultFormats);var s=0===p.length,t=0===r.length,u=n(p,j.get(d.guide.x.tickFormat,d.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),v=n(r,j.get(d.guide.y.tickFormat,d.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),w=a.isLeafParent?c.xAxisPadding:0,x=a.isLeafParent?c.yAxisPadding:0,y=!e&&!!f.dimType&&"measure"!==f.dimType;d.guide.x.padding=s?0:w,d.guide.y.padding=t?0:x,d.guide.x.rotate=y?90:0,d.guide.x.textAnchor=y?"start":d.guide.x.textAnchor;var z=s?0:c.xTickWidth,A=t?0:c.yTickWidth;d.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,d.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var B=y?u.width:u.height;!h&&B>c.xAxisTickLabelLimit&&(B=c.xAxisTickLabelLimit),!y&&u.width>c.xAxisTickLabelLimit&&(d.guide.x.tickFormatWordWrap=!0,d.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit,B=c.xTickWordWrapLinesLimit*u.height);var C=v.width;!i&&C>c.yAxisTickLabelLimit&&(C=c.yAxisTickLabelLimit,d.guide.y.tickFormatWordWrap=!0,d.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit);var D=z+B,E=A+C,F=c.xFontLabelHeight,G=c.yFontLabelHeight,H=c.distToXAxisLabel,I=c.distToYAxisLabel,J=Math.min(c.xAxisTickLabelLimit,y?u.height:u.width);d.guide.x.density=J+2*k;var K=Math.ceil(v.width/c.yAxisTickLabelLimit),L=Math.min(K,c.yTickWordWrapLinesLimit),M=Math.min(c.yAxisTickLabelLimit,L*v.height);d.guide.y.density=M+2*l,d.guide.x.label.padding=d.guide.x.label.text?D+H:0,d.guide.y.label.padding=d.guide.y.label.text?E+I:0;var N=d.guide.x.label.text?d.guide.x.label.padding+F:D,O=d.guide.y.label.text?d.guide.y.label.padding+G:E;return d.guide.padding.b=w+N,d.guide.padding.l=x+O,d.guide.padding.b=d.guide.x.hide?0:d.guide.padding.b,d.guide.padding.l=d.guide.y.hide?0:d.guide.padding.l,d.guide.x.tickFontHeight=u.height,d.guide.y.tickFontHeight=v.height,d.guide.x.$minimalDomain=p.length,d.guide.y.$minimalDomain=r.length,d.guide.x.$maxTickTextW=u.width,d.guide.x.$maxTickTextH=u.height,d.guide.y.$maxTickTextW=v.width,d.guide.y.$maxTickTextH=v.height,d}),d},"BUILD-COMPACT":function(b,c,d){var e=h.clone(b);return r(h.clone(e.unit),e.unit,function(b,e){return b.isLeaf?e:b.isLeafParent?(e.guide.showGridLines=e.guide.hasOwnProperty("showGridLines")?e.guide.showGridLines:"xy",p(e,c,a.defaults({xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!0,!1,!0)):(e.guide.x.cssClass+=" facet-axis compact",e.guide.y.cssClass+=" facet-axis compact",p(e,c,a.defaults({xAxisPadding:0,yAxisPadding:0,distToXAxisLabel:0,distToYAxisLabel:0,xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!1,!0,!1))}),e},"OPTIMAL-SIZE":function(a,b,c){var d=h.clone(a),e=function(a){var b;if(a.unit){var c=e(a.unit[0]),d=a.guide,f=d.x.$minimalDomain||1,g=d.y.$minimalDomain||1,h=Math.max(f*d.x.density,f*c.w),i=Math.max(g*d.y.density,g*c.h);b={w:h+d.padding.l+d.padding.r,h:i+d.padding.t+d.padding.b}}else b={w:0,h:0};return b},f=function(a,b,c,d){var e=b.guide.x.$minimalDomain||1,g=b.guide.y.$minimalDomain||1,h=c.width/e,i=c.height/g,j=a.dimension(b.x),k=a.dimension(b.y),l=d.hasOwnProperty("xDensityPadding:"+j.dimType)?d["xDensityPadding:"+j.dimType]:d.xDensityPadding,m=d.hasOwnProperty("yDensityPadding:"+k.dimType)?d["yDensityPadding:"+k.dimType]:d.yDensityPadding;if(b.guide.x.hide!==!0&&0!==b.guide.x.rotate&&h>b.guide.x.$maxTickTextW+2*l){b.guide.x.rotate=0,b.guide.x.textAnchor="middle",b.guide.x.tickFormatWordWrapLimit=h;var n=Math.min(d.xAxisTickLabelLimit,b.guide.x.$maxTickTextW),o=0-n+b.guide.x.$maxTickTextH;b.guide.padding.b+=b.guide.padding.b>0?o:0,b.guide.x.label.padding>n+d.xAxisPadding&&(b.guide.x.label.padding+=o) -}b.guide.y.hide!==!0&&0!==b.guide.y.rotate&&1===b.guide.y.tickFormatWordWrapLines&&i>b.guide.y.$maxTickTextW+2*m&&(b.guide.y.tickFormatWordWrapLimit=i-2*m);var p={width:h,height:i};b.unit&&f(a,b.unit[0],p,d)},g=e(d.unit),i=g.w,j=g.h,k=c.size,l=c.scrollBarWidth,m=k.width-i,n=k.height-j,o=m>=0?k.width:i,p=n>=0?0:l,q=n>=0?k.height:j,r=m>=0?0:l;return c.size.height=q-r,c.size.width=o-p,f(b,d.unit,c.size,c),d}};q.AUTO=function(a,b,c){return["BUILD-LABELS","BUILD-GUIDE"].reduce(function(a,d){return q[d](a,b,c)},a)},q.COMPACT=function(a,b,c){return["BUILD-LABELS","BUILD-COMPACT"].reduce(function(a,d){return q[d](a,b,c)},a)};var r=function(b,c,d){var e=i.applyNodeDefaults(c);e=d(m(e),e),e=k(e,b);var f=a.omit(e,"unit");return(e.unit||[]).forEach(function(a){return r(h.clone(a),l(a,f),d)}),e},s={get:function(a,b){var c=q[a]||q.NONE;return function(a,d){var e=c(a,d,b);return b.fitSize&&(e=q["OPTIMAL-SIZE"](e,d,b)),e}}};b.SpecEngineFactory=s}),e("matrix",["exports"],function(b){var c=function(){var b=function(b,c){var d,e=a.toArray(arguments);d=a.isArray(e[0])?e[0]:a.times(b,function(){return a.times(c,function(){return null})}),this.cube=d};return b.prototype={iterate:function(b){var c=this.cube;return a.each(c,function(c,d){a.each(c,function(a,c){b(d,c,a)})}),this},getRC:function(a,b){return this.cube[a][b]},setRC:function(a,b,c){return this.cube[a][b]=c,this},sizeR:function(){return this.cube.length},sizeC:function(){var a=this.cube[0]||[];return a.length}},b}();b.TMatrix=c}),e("layout-engine-factory",["exports","./utils/utils","./utils/utils-draw","./matrix"],function(a,b,c,d){var e=b.utils,f=c.utilsDraw,g=d.TMatrix,h=function(a,b){var c=b?b:{depth:-1,paddings:[]},d=a.guide.padding;return c.depth+=1,c.paddings.unshift({l:d.l,b:d.b,r:d.r,t:d.t}),a.unit&&a.unit.length&&h(a.unit[0],c),c},i={NONE:function(a){return a},EXTRACT:function(a){var b=function(a,c,d){var e=a,f=e.sizeR(),h=e.sizeC();e.iterate(function(a,e,i){i.forEach(function(b){return d(b,{firstRow:0===a,firstCol:0===e,lastRow:a===f-1,lastCol:e===h-1,depth:c})}),i.filter(function(a){return a.$matrix}).forEach(function(a){a.$matrix=new g(a.$matrix.cube),b(a.$matrix,c-1,d)})})},c=e.clone(a),d=new g([[[c]]]),i=h(c),j=i.paddings.reduce(function(a,b){return a.l+=b.l,a.b+=b.b,a},{l:0,b:0}),k=e.clone(j),l=i.paddings.reverse().map(function(a){return a.l=k.l-a.l,a.b=k.b-a.b,k={l:a.l,b:a.b},a});i.paddings=l.reverse();var m=10,n=f.applyNodeDefaults({type:"COORDS.RECT",options:e.clone(a.options),$matrix:new g([[[c]]]),guide:{padding:{l:j.l-m,b:j.b-m,r:0,t:0}}});return b(d,i.depth,function(a,b){var c=b.depth;a.guide.x.hide=a.guide.x.hide?a.guide.x.hide:!b.lastRow,a.guide.y.hide=a.guide.y.hide?a.guide.y.hide:!b.firstCol;var d=c>1?0:m,e=c>1?m:0;return a.guide.x.padding+=i.paddings[c].b,a.guide.y.padding+=i.paddings[c].l,a.guide.x.padding-=e,a.guide.y.padding-=e,a.guide.padding.l=d,a.guide.padding.b=d,a.guide.padding.r=d,a.guide.padding.t=d,a}),n}},j={get:function(a){return i[a]||i.NONE}};a.LayoutEngineFactory=j}),e("plugins",["exports"],function(a){var c=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},d=function(){function a(a,b){this.chart=b,this._plugins=a.map(this.initPlugin,this)}return c(a,null,{initPlugin:{value:function(a){var b=this;a.init&&a.init(this.chart),this.chart.on("destroy",a.destroy&&a.destroy.bind(a)||function(){}),Object.keys(a).forEach(function(c){if(0===c.indexOf("on")){var d=c.substr(2);b.chart.on(d.toLowerCase(),a[c].bind(a))}})},writable:!0,enumerable:!0,configurable:!0}}),a}(),e=["click","mouseover","mouseout","mousemove"],f=function(a){return function(){e.forEach(function(c){this.on(c,function(d){a.fire("element"+c,{elementData:d,element:this,cellData:b.select(this.parentNode.parentNode).datum()})})},this)}};a.propagateDatumEvents=f,a.Plugins=d}),e("unit-domain-period-generator",["exports"],function(a){var b={day:{cast:function(a){return new Date(a.setHours(0,0,0,0))},next:function(a){return new Date(a.setDate(a.getDate()+1))}},week:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(a.getDate()-a.getDay()))},next:function(a){return new Date(a.setDate(a.getDate()+7))}},month:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1))},next:function(a){return new Date(a.setMonth(a.getMonth()+1))}},quarter:{cast:function(a){a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1));var b=a.getMonth(),c=b-b%3;return new Date(a.setMonth(c))},next:function(a){return new Date(a.setMonth(a.getMonth()+3))}},year:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1)),a=new Date(a.setMonth(0))},next:function(a){return new Date(a.setFullYear(a.getFullYear()+1))}}},c={add:function(a,c){return b[a.toLowerCase()]=c,this},get:function(a){return b[a.toLowerCase()]},generate:function(a,c,d){var e=[],f=b[d.toLowerCase()];if(f){var g=f.cast(new Date(c)),h=f.cast(new Date(a));for(e.push(h);(h=f.next(new Date(h)))<=g;)e.push(h)}return e}};a.UnitDomainPeriodGenerator=c}),e("size",["exports"],function(b){var c=function(a){return Math.sqrt(a)},d=function(b,d,e,f){var g=a.filter(b,a.isFinite);if(0===g.length)return function(){return f};var h=1,i=0,j=Math.min.apply(null,g),k=Math.max.apply(null,g),l=c(Math.max.apply(null,[Math.abs(j),Math.abs(k),k-j]));return i=0>j?j:0,h=0===l?1:(e-d)/l,function(b){var f=null!==b?parseFloat(b):0;if(!a.isFinite(f))return e;var g=f-i;return d+c(g)*h}};b.sizeScale=d}),e("unit-domain-mixin",["exports","./unit-domain-period-generator","./utils/utils","./size","underscore","d3"],function(a,b,c,d,e,f){var g=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},h=b.UnitDomainPeriodGenerator,i=c.utils,j=d.sizeScale,k=e,l=f,m={ordinal:function(a){return a},linear:function(a,b){var c=b.autoScale?i.autoScale(a):l.extent(a),d=k.isNumber(b.min)?b.min:c[0],e=k.isNumber(b.max)?b.max:c[1];return[Math.min(d,c[0]),Math.max(e,c[1])]},period:function(a,b){var c=l.extent(a),d=k.isNull(b.min)||k.isUndefined(b.min)?c[0]:new Date(b.min).getTime(),e=k.isNull(b.max)||k.isUndefined(b.max)?c[1]:new Date(b.max).getTime(),f=[new Date(Math.min(d,c[0])),new Date(Math.max(e,c[1]))];return h.generate(f[0],f[1],b.period)},time:function(a,b){var c=l.extent(a),d=k.isNull(b.min)||k.isUndefined(b.min)?c[0]:new Date(b.min).getTime(),e=k.isNull(b.max)||k.isUndefined(b.max)?c[1]:new Date(b.max).getTime();return[new Date(Math.min(d,c[0])),new Date(Math.max(e,c[1]))]}},n={ordinal:function(a,b){return l.scale.ordinal().domain(a).rangePoints(b,1)},linear:function(a,b){return l.scale.linear().domain(a).rangeRound(b,1)},period:function(a,b){return l.scale.ordinal().domain(a).rangePoints(b,1)},time:function(a,b){return l.time.scale().domain(a).range(b)}},o=function(){function a(a,b){var c=function(a){return function(b){var c=b||{};return c.hasOwnProperty(a)?c[a]:null}},d=function(b){var d=a[b]||{},e=d.value?c(d.value):function(a){return a},f=k.contains(["period","time"],d.scale);return f?k.compose(function(a){return new Date(a).getTime()},e):e},e=function(b){var c=a[b]||{};return c.order||null},f=function(a){var b={category:function(a,b,c){return c},order:function(a,b,c){var d=e(a);return d?k.union(d,c):k.sortBy(c,b)},measure:function(a,b,c){return k.sortBy(c,b)},"as-is":function(a,b,c){return c}};return b[a]||b["as-is"]},g=function(a){var b={category:f("category"),order:f("order"),measure:f("measure"),"as-is":f("as-is")};return b[a]||b["as-is"]};this.fnDimension=function(b,c){var d=(c||{}).dimensions||{},e=a[b]||{},f=d[b]||{};return{scaleDim:b,scaleType:f.scale||e.scale,dimType:f.type||e.type}},this.fnSource=function(a){var c=k.map(a,function(a,b){return function(c){return d(b)(c[b])===a}});return k(b).filter(function(a){return k.every(c,function(b){return b(a)})})};var i=function(c,e){if(!a[c])return[];var f=d(c),g=k(b).chain().pluck(c).uniq(f).value();return e(c,f,g)};this.fnDomain=function(b){var c=d(b),e=(a[b]||{}).type,g=i(b,f(e));return g.map(c)};var o=function(b,e){var f={},j=e||{};f.map=j.hasOwnProperty("map")?j.map:j.tickLabel,f.min=j.hasOwnProperty("min")?j.min:j.tickMin,f.max=j.hasOwnProperty("max")?j.max:j.tickMax,f.period=j.hasOwnProperty("period")?j.period:j.tickPeriod,f.autoScale=j.autoScale;var l=k.defaults({},a[b]),n={"order:period":function(a){return function(b){return h.get(a.period).cast(new Date(b))}},"*":function(){return function(a){return a}}},o=f.map?c(f.map):d(b),p=[l.type,l.scale].join(":"),q=(n[p]||n["*"])(f),r=i(b,g(l.type)).map(o),s=l.scale?m[l.scale](r,f):r;return{extract:function(a){return q(o(a))},values:s,source:r}};this.fnScaleMeta=o,this.fnScaleTo=function(b,c,d){var e=d||{},f=k.defaults({},a[b]),g=o(b,d),h=n[f.scale](g.values,c,e),i=function(a){return h(g.extract(a))};return Object.keys(h).forEach(function(a){return i[a]=h[a]}),i},this.fnScaleColor=function(a,b,c){var d,e=c||{},f=o(a,e),g=k.constant("color-default"),h=k.times(20,function(a){return"color20-"+(1+a)}),i=function(a,b){if(0===a.length||1===a.length&&null===a[0])return g;var c=a.map(function(a){return String(a).toString()});return l.scale.ordinal().range(b).domain(c)},j=function(a,b){var c=k.keys(a),d=k.values(a),e=l.scale.ordinal().range(d).domain(c);return function(c){return a.hasOwnProperty(c)?e(c):b(c)}},m=function(a){return function(b){return a(String(b).toString())}};if(b)if(k.isArray(b))d=m(i(f.values,b));else if(k.isFunction(b))d=function(a){return b(a,m(i(f.values,h)))};else{if(!k.isObject(b))throw new Error("This brewer is not supported");d=j(b,g)}else d=m(i(f.values,h));var n=function(a){return d(f.extract(a))};return n.get=n,n.dimension=a,n.legend=function(a){var b=f.extract(a),c=e.tickLabel?(a||{})[e.tickLabel]:b,g=d(b);return{value:b,color:g,label:c}},n},this.fnScaleSize=function(a,b,c){var d=c||{},e=b[0],f=b[1],g=b[b.length-1],h=o(a,d),i=j(h.source,e,f,g),k=function(a){return i(h.extract(a))};return k}}return g(a,null,{mix:{value:function(a){return a.dimension=this.fnDimension,a.source=this.fnSource,a.domain=this.fnDomain,a.scaleMeta=this.fnScaleMeta,a.scaleTo=this.fnScaleTo,a.scaleDist=this.fnScaleTo,a.scaleColor=this.fnScaleColor,a.scaleSize=this.fnScaleSize,a.partition=function(){return a.data||a.source(a.$where)},a.groupBy=function(b,c){var d=a.scaleMeta(c);return k.chain(b).groupBy(function(a){return d.extract(a[c])}).map(function(a){return{key:a[0][c],values:a}}).value()},a},writable:!0,enumerable:!0,configurable:!0}}),a}();a.UnitDomainMixin=o}),e("units-registry",["exports"],function(a){var b={},c={add:function(a,c){var d={};return d.draw="function"==typeof c?c:c.draw,d.walk=c.walk||function(a){return a},b[a]=d,this},get:function(a){if(!b.hasOwnProperty(a))throw new Error("Unknown unit type: "+a);return b[a]}};a.UnitsRegistry=c}),e("data-processor",["exports","./utils/utils"],function(b,c){var d=c.utils,e={isYFunctionOfX:function(a,b,c){var d=!0,e=null;try{a.reduce(function(a,d){var f=function(a,b){return a.push(d[b]),a},g=b.reduce(f,[]).join("/"),h=c.reduce(f,[]).join("/");if(a.hasOwnProperty(g)){var i=a[g];if(i!==h)throw e={type:"RelationIsNotAFunction",keyX:b.join("/"),keyY:c.join("/"),valX:g,errY:[i,h]},new Error("RelationIsNotAFunction")}else a[g]=h;return a},{})}catch(f){if("RelationIsNotAFunction"!==f.message)throw f;d=!1}return{result:d,error:e}},excludeNullValues:function(a,b){var c=Object.keys(a).reduce(function(b,c){var d=a[c];return d.hasOwnProperty("hasNull")&&!d.hasNull||"measure"!==d.type&&"period"!==d.scale||b.push(c),b},[]);return function(a){var d=!c.some(function(b){return!(b in a)||null===a[b]});return d||b(a),d}},autoAssignScales:function(a){var b="category",c={category:"ordinal",order:"ordinal",measure:"linear"},d={};return Object.keys(a).forEach(function(e){var f=a[e],g=(f.type||b).toLowerCase();d[e]={},d[e].type=g,d[e].scale=f.scale||c[g],d[e].value=f.value}),d},autoDetectDimTypes:function(b){var c={type:"category",scale:"ordinal"},e=function(b,c){var d=c;return a.isDate(b)?(d.type="measure",d.scale="time"):a.isObject(b)?(d.type="order",d.scale="ordinal"):a.isNumber(b)&&(d.type="measure",d.scale="linear"),d},f=function(a,b){return Object.keys(b).forEach(function(f){var g=b.hasOwnProperty(f)?b[f]:null;if(a[f]=a[f]||{type:null,hasNull:!1},null===g)a[f].hasNull=!0;else{var h=e(g,d.clone(c)),i=h.type,j=h.scale,k=null!==a[f].type&&a[f].type!==i;a[f].type=k?c.type:i,a[f].scale=k?c.scale:j}}),a};return a.reduce(b,f,{})}};b.DataProcessor=e}),e("utils/layuot-template",["exports","../const"],function(a,b){var c=b.CSS_PREFIX,d=function(a,b){var d="div",e=document.createElement(d);return e.classList.add(c+a),b&&b.appendChild(e),e},e=function(){var a=d("layout"),b=d("layout__header",a),c=d("layout__container",a),e=d("layout__sidebar",c),f=d("layout__content",c),g=d("layout__content__wrap",f),h=d("layout__sidebar-right",c),i=d("layout__sidebar-right__wrap",h),j=d("layout__footer",a);return{layout:a,header:b,content:g,leftSidebar:e,rightSidebar:i,footer:j}};a.getLayout=e}),e("charts/tau.plot",["exports","../dsl-reader","../api/balloon","../event","../spec-engine-factory","../layout-engine-factory","../plugins","../utils/utils","../utils/utils-dom","../const","../unit-domain-mixin","../units-registry","../data-processor","../utils/layuot-template"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p){var q=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},r=function I(a,b,c){var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){var e=Object.getPrototypeOf(a);return null===e?void 0:I(e,b,c)}if("value"in d&&d.writable)return d.value;var f=d.get;return void 0===f?void 0:f.call(c)},s=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)},t=d.DSLReader,u=e.Tooltip,v=f.Emitter,w=g.SpecEngineFactory,x=h.LayoutEngineFactory,y=i.Plugins,z=i.propagateDatumEvents,A=j.utils,B=k.utilsDom,C=l.CSS_PREFIX,D=m.UnitDomainMixin,E=n.UnitsRegistry,F=o.DataProcessor,G=p.getLayout,H=function(c){function d(a){r(Object.getPrototypeOf(d.prototype),"constructor",this).call(this),this._svg=null,this._filtersStore={filters:{},tick:0},this._layout=G(),this.setupConfig(a),this._plugins=new y(this.config.plugins,this)}return s(d,c),q(d,null,{setupConfig:{value:function(b){this.config=a.defaults(b,{spec:{},data:[],plugins:[],settings:{}}),this._emptyContainer=b.emptyContainer||"",this.config.settings.specEngine=this.config.specEngine||this.config.settings.specEngine,this.config.settings.layoutEngine=this.config.layoutEngine||this.config.settings.layoutEngine,this.config.settings=this.setupSettings(this.config.settings),A.isArray(this.config.settings.specEngine)||(this.config.settings.specEngine=[{width:Number.MAX_VALUE,name:this.config.settings.specEngine}]),this.config.spec.dimensions=this.setupMetaInfo(this.config.spec.dimensions,this.config.data);var c=this.config.settings.log;this.config.settings.excludeNull&&this.addFilter({tag:"default",predicate:F.excludeNullValues(this.config.spec.dimensions,function(a){c([a,"point was excluded, because it has undefined values."],"WARN")})})},writable:!0,enumerable:!0,configurable:!0},getConfig:{value:function(){return this.config},writable:!0,enumerable:!0,configurable:!0},setupMetaInfo:{value:function(a,b){var c=a?a:F.autoDetectDimTypes(b);return F.autoAssignScales(c)},writable:!0,enumerable:!0,configurable:!0},setupSettings:{value:function(b){var c=d.globalSettings,e={};return Object.keys(c).forEach(function(b){e[b]=a.isFunction(c[b])?c[b]:A.clone(c[b])}),a.defaults(b||{},e)},writable:!0,enumerable:!0,configurable:!0},insertToRightSidebar:{value:function(a){return B.appendTo(a,this._layout.rightSidebar)},writable:!0,enumerable:!0,configurable:!0},addBalloon:{value:function(a){return new u("",a||{})},writable:!0,enumerable:!0,configurable:!0},renderTo:{value:function(c,d){this._renderGraph=null,this._svg=null,this._defaultSize=a.clone(d);var e=b.select(c),f=e.node();if(this._target=c,this._targetSizes=d,null===f)throw new Error("Target element not found");f.appendChild(this._layout.layout),e=b.select(this._layout.content);var g=d||{};this._layout.content.innerHTML="",g.width&&g.height||(g=a.defaults(g,B.getContainerSize(this._layout.content.parentNode)));var h=this.getData();if(0===h.length)return void(this._layout.content.innerHTML=this._emptyContainer);this._targetSizes=g,this._layout.content.innerHTML="";var i=new D(this.config.spec.dimensions,h),j=a.find(this.config.settings.specEngine,function(a){return g.width<=a.width});this.config.settings.size=g;var k=w.get(j.name,this.config.settings),l=k(this.config.spec,i.mix({})),m=this.config.settings.size,n=new t(i,E),o=this,p=n.buildGraph(l),q=x.get(this.config.settings.layoutEngine)(p),r=n.calcLayout(q,m),s=n.renderGraph(r,e.append("svg").attr("class",C+"svg").attr("width",m.width).attr("height",m.height),function(a){return o.fire("unitready",a)});this._renderGraph=r,this._svg=s.node(),s.selectAll(".i-role-datum").call(z(this)),this._layout.rightSidebar.style.maxHeight=m.height+"px",this.fire("render",this._svg)},writable:!0,enumerable:!0,configurable:!0},getData:{value:function(b){b=b||{};var c=a.chain(this._filtersStore.filters).values().flatten().reject(function(c){return a.contains(b.excludeFilter,c.tag)}).pluck("predicate").value();return a.filter(this.config.data,a.reduce(c,function(a,b){return function(c){return a(c)&&b(c)}},function(){return!0}))},writable:!0,enumerable:!0,configurable:!0},setData:{value:function(a){this.config.data=a,this.refresh()},writable:!0,enumerable:!0,configurable:!0},getSVG:{value:function(){return this._svg},writable:!0,enumerable:!0,configurable:!0},addFilter:{value:function(a){var b=a.tag,c=this._filtersStore.filters[b]=this._filtersStore.filters[b]||[],d=this._filtersStore.tick++;return a.id=d,c.push(a),this.refresh(),d},writable:!0,enumerable:!0,configurable:!0},removeFilter:{value:function(b){var c=this;a.each(this._filtersStore.filters,function(d,e){c._filtersStore.filters[e]=a.reject(d,function(a){return a.id===b})}),this.refresh()},writable:!0,enumerable:!0,configurable:!0},refresh:{value:function(){this._target&&this.renderTo(this._target,this._defaultSize)},writable:!0,enumerable:!0,configurable:!0},resize:{value:function(){var a=void 0===arguments[0]?{}:arguments[0];this.renderTo(this._target,a)},writable:!0,enumerable:!0,configurable:!0},select:{value:function(a){var b=[];if(!this._renderGraph)return b;var c=function(a,b){b(a),(a.childUnits||[]).forEach(function(a){return c(a,b)})};return c(this._renderGraph,function(c){a(c)&&b.push(c)}),b},writable:!0,enumerable:!0,configurable:!0}}),d}(v);c.Plot=H}),e("charts/tau.chart",["exports","./tau.plot","../utils/utils","../data-processor"],function(b,c,d,e){function f(a,b,c){return b.reduce(function(b,d,e){var f=a[d];return f?b.status!=r.FAIL&&("measure"===f.type&&(b.countMeasureAxis++,b.indexMeasureAxis.push(e)),"measure"!==f.type&&1===b.countMeasureAxis?b.status=r.WARNING:b.countMeasureAxis>1&&(b.status=r.FAIL,b.messages.push('There are more then one measure dimensions for axis "'+c+'"'))):(b.status=r.FAIL,b.messages.push('Undefined dimension "'+d+'" for axis "'+c+'"')),b},{status:r.SUCCESS,countMeasureAxis:0,indexMeasureAxis:[],messages:[]})}function g(b,c){var d=p(c.x),e=p(c.y),g=f(c.dimensions,d,"x"),h=f(c.dimensions,e,"y");d=s[g.status](d,g),e=s[h.status](e,h);for(var i=p(c.guide),j=Math.max(d.length,e.length);i.length0;l--){var m=d.pop(),n=e.pop(),r=i.pop()||{};l===j?(k.x=m,k.y=n,k.unit.push(q(b,{x:o(m),y:o(n),color:c.color,size:c.size,flip:c.flip,colorGuide:r.color,sizeGuide:r.size})),k.guide=a.defaults(r,{x:{label:m},y:{label:n}})):k={type:"COORDS.RECT",x:o(m),y:o(n),unit:[k],guide:a.defaults(r,{x:{label:m},y:{label:n}})}}return c.spec={dimensions:c.dimensions,unit:k},c}var h=function(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})},i=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},j=function v(a,b,c){var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){var e=Object.getPrototypeOf(a);return null===e?void 0:v(e,b,c)}if("value"in d&&d.writable)return d.value;var f=d.get;return void 0===f?void 0:f.call(c)},k=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)},l=c.Plot,m=d.utils,n=e.DataProcessor,o=function(a){return a?a:null},p=function(a){return m.isArray(a)?a:[a]},q=function(a,b){return{type:a,x:b.x,y:b.y,color:b.color,guide:{color:b.colorGuide,size:b.sizeGuide},flip:b.flip,size:b.size}},r={SUCCESS:"SUCCESS",WARNING:"WARNING",FAIL:"FAIL"},s=function(){var b={};return h(b,r.SUCCESS,function(a){return a}),h(b,r.FAIL,function(a,b){throw new Error((b.messages||[]).join("\n")||"This configuration is not supported, See http://api.taucharts.com/basic/facet.html#easy-approach-for-creating-facet-chart")}),h(b,r.WARNING,function(b,c){var d=b[c.indexMeasureAxis[0]],e=a.without(b,d);return e.push(d),e}),b}(),t={scatterplot:function(a){return g("ELEMENT.POINT",a)},line:function(b){var c=b.data,d=b.settings.log,e={none:function(){return null},horizontal:function(a){var b=m.isArray(a.x)?a.x:[a.x];return b[b.length-1]},vertical:function(a){var b=m.isArray(a.y)?a.y:[a.y];return b[b.length-1]},auto:function(a){var b,e=m.isArray(a.x)?a.x:[a.x],f=m.isArray(a.y)?a.y:[a.y],g=e[e.length-1],h=e.slice(0,e.length-1),i=f[f.length-1],j=f.slice(0,f.length-1),k=a.color,l=h.concat(j).concat([k]).filter(function(a){return null!==a}),o=-1,p=[[[g].concat(l),i],[[i].concat(l),g]],q=p.some(function(a,b){var e=a[0],f=a[1],g=n.isYFunctionOfX(c,e,[f]);return g.result?o=b:d(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+g.error.keyY+" values (e.g. "+g.error.errY.join(",")+")","for ("+g.error.keyX+" = "+g.error.valX+")."].join(" ")),g.result});return q?b=p[o][0][0]:(d(["All attempts are failed.","Will orient line horizontally by default.","NOTE: the [scatterplot] chart is more convenient for that data."].join(" ")),b=g),b}},f=(b.lineOrientation||"auto").toLowerCase(),h=e.hasOwnProperty(f)?e[f]:e.auto,i=h(b);return null!==i&&(b.data=a(c).sortBy(i)),g("ELEMENT.LINE",b)},bar:function(a){return a.flip=!1,g("ELEMENT.INTERVAL",a)},horizontalBar:function(a){return a.flip=!0,g("ELEMENT.INTERVAL",a)}},u=function(b){function c(b){b=a.defaults(b,{autoResize:!0}),b.autoResize&&c.winAware.push(this),b.settings=this.setupSettings(b.settings),b.dimensions=this.setupMetaInfo(b.dimensions,b.data);var d=t[b.type];if(!a.isFunction(d))throw new Error("Chart type "+b.type+" is not supported. Use one of "+a.keys(t).join(", ")+".");j(Object.getPrototypeOf(c.prototype),"constructor",this).call(this,d(b))}return k(c,b),i(c,null,{destroy:{value:function(){var a=c.winAware.indexOf(this);-1!==a&&c.winAware.splice(a,1),j(Object.getPrototypeOf(c.prototype),"destroy",this).call(this)},writable:!0,enumerable:!0,configurable:!0}}),c}(l);u.resizeOnWindowEvent=function(){function a(){!c&&u.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=u.winAware.length;d>b;b++)a=u.winAware[b],a.resize()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),u.winAware=[],window.addEventListener("resize",u.resizeOnWindowEvent),b.Chart=u}),e("elements/coords",["exports","../utils/utils-draw","../const","../utils/utils","../matrix"],function(b,c,d,e,f){var g=c.utilsDraw,h=d.CSS_PREFIX,i=e.utils,j=f.TMatrix,k={CROSS:function(b,c,d,e,f){var g=0===d.length?[null]:d,h=0===f.length?[null]:f.reverse(),i=function(a){return a instanceof Date?a.getTime():a};return a(h).map(function(b){return a(g).map(function(a){var d={};return c&&(d[c]=i(a)),e&&(d[e]=i(b)),d})})}},l=function(a){return k[a]||function(){return[[{}]]}},m=function(b,c,d){var e=a.defaults(i.clone(b),a.pick.apply(a,[c].concat(d)));return e.guide=a.extend(i.clone(c.guide),e.guide),e},n={walk:function(b,c){var d=a.defaults(b,{$where:{}}),e=a.any(d.unit,function(a){return 0===a.type.indexOf("COORDS.")}),f=l(e?"CROSS":""),g=d.scaleMeta(d.x,a.omit(d.guide.x,"tickLabel")).values,h=d.scaleMeta(d.y,a.omit(d.guide.y,"tickLabel")).values,i=new j(f(d,d.x,g,d.y,h)),k=new j(i.sizeR(),i.sizeC());return i.iterate(function(b,c,e){var f=a.extend({},d.$where,e),g=a(d.unit).map(function(b){return a.extend(m(b,d,["x","y"]),{$where:f})});k.setRC(b,c,g)}),d.$matrix=k,k.iterate(function(b,d,e){a.each(e,function(a){return c(a)})}),d},draw:function(a){var b=a.options,c=a.guide.padding;a.x.guide=a.guide.x,a.y.guide=a.guide.y;var d=b.left+c.l,e=b.top+c.t,f=b.width-(c.l+c.r),i=b.height-(c.t+c.b);a.x.scaleObj=a.x.scaleDim&&a.scaleTo(a.x.scaleDim,[0,f],a.x.guide),a.y.scaleObj=a.y.scaleDim&&a.scaleTo(a.y.scaleDim,[i,0],a.y.guide),a.x.guide.size=f,a.y.guide.size=i;var j=[0,i+a.guide.x.padding],k=[0-a.guide.y.padding,0],l=b.container.append("g").attr("class",h+"cell cell").attr("transform",g.translate(d,e)).datum({$where:a.$where});return a.x.guide.hide||g.fnDrawDimAxis.call(l,a.x,j,f),a.y.guide.hide||g.fnDrawDimAxis.call(l,a.y,k,i),g.fnDrawGrid.call(l,a,i,f)}};b.coords=n}),e("utils/css-class-map",["exports","../const"],function(a,b){function c(a){return g[a-1]||g[4]}function d(a){var b=0;return a>=160&&320>a?b=1:a>=320&&480>a?b=2:a>=480&&640>a?b=3:a>=640&&(b=4),h[b]}var e=b.CSS_PREFIX,f=[1,2,3,4,5],g=f.map(function(a){return e+"line-opacity-"+a}),h=f.map(function(a){return e+"line-width-"+a});a.getLineClassesByWidth=d,a.getLineClassesByCount=c}),e("elements/line",["exports","../const","../utils/css-class-map"],function(a,c,d){var e=c.CSS_PREFIX,f=d.getLineClassesByWidth,g=d.getLineClassesByCount,h=function(a){var c=a.options,d=c.xScale,h=c.yScale,i=c.color,j=a.groupBy(a.partition(),a.color.scaleDim),k=f(c.width),l=g(j.length),m=function(){this.attr("class",function(a){return""+e+"line i-role-element i-role-datum line "+i(a.key)+" "+k+" "+l});var a=this.selectAll("path").data(function(a){return[a.values]});a.call(p),a.enter().append("path").call(p),a.exit().remove()},n=function(b){var f=function(){return this.attr("r",1.5).attr("class",function(b){return""+e+"dot-line dot-line i-role-element "+e+"dot i-role-datum "+i(b[a.color.scaleDim])}).attr("cx",function(b){return d(b[a.x.scaleDim])}).attr("cy",function(b){return h(b[a.y.scaleDim])})},g=c.container.selectAll(".dot-line").data(b);g.call(f),g.exit().remove(),g.enter().append("circle").call(f)},o=b.svg.line().x(function(b){return d(b[a.x.scaleDim])}).y(function(b){return h(b[a.y.scaleDim])}),p=function(){this.attr("d",o)},q=j.reduce(function(a,b){var c=b.values;return 1===c.length&&a.push(c[0]),a},[]);q.length>0&&n(q);var r=c.container.selectAll(".line").data(j);r.call(m),r.enter().append("g").call(m),r.exit().remove()};a.line=h}),e("elements/point",["exports","../const"],function(a,b){var c=b.CSS_PREFIX,d=function(a){var b=a.options,d=b.xScale,e=b.yScale,f=b.color,g=b.sizeScale,h=function(){return this.attr("r",function(b){return g(b[a.size.scaleDim])}).attr("cx",function(b){return d(b[a.x.scaleDim])}).attr("cy",function(b){return e(b[a.y.scaleDim])}).attr("class",function(b){return""+c+"dot dot i-role-element i-role-datum "+f(b[a.color.scaleDim])})},i=b.container.selectAll(".dot").data(a.partition());i.call(h),i.exit().remove(),i.enter().append("circle").call(h)};a.point=d}),e("elements/interval",["exports","../utils/utils-draw","../const"],function(a,b,c){var d=function(a){return Array.isArray(a)?a:Array.from(a)},e=b.utilsDraw,f=c.CSS_PREFIX,g="i-role-bar-group",h=function(a){return"measure"===a.dimType},i=function(a){var b=a.domain().length,c=a.category.length,d=a.size/b,e=d/(c+1);return{tickWidth:d,intervalWidth:e,offsetCategory:e}},j={NORM:function(a,b,c,f,g,j,k){var l=1,m=Math.min.apply(Math,d(c.domain())),n=!isNaN(m),o=!n||0>=m?0:m,p=h(a.x),q=p?j:i({domain:b.domain,category:k,size:f}),r=q.tickWidth,s=q.intervalWidth,t=q.offsetCategory,u=function(c){return b(c[a.x.scaleDim])-r/2},v=n?function(b){var d=b[a.y.scaleDim],e=c(Math.max(o,d)),f=Math.abs(c(d)-c(o)),g=l>f;return g&&d>0?e-l:e}:function(b){return c(b[a.y.scaleDim])},w=function(){return s},x=n?function(b){var d=b[a.y.scaleDim],e=Math.abs(c(d)-c(o));return 0===d?e:Math.max(l,e)}:function(b){return g-c(b[a.y.scaleDim])},y=function(a,b){return e.translate(b*t+t/2,0)};return{calculateX:u,calculateY:v,calculateWidth:w,calculateHeight:x,calculateTranslate:y}},FLIP:function(a,b,c,f,g,j,k){var l=1,m=Math.min.apply(Math,d(b.domain())),n=!isNaN(m),o=!n||0>=m?0:m,p=h(a.y),q=p?j:i({domain:c.domain,category:k,size:g}),r=q.tickWidth,s=q.intervalWidth,t=q.offsetCategory,u=n?function(c){var d=c[a.x.scaleDim],e=Math.abs(b(d)-b(o)),f=b(Math.min(o,d)),g=e-l,h=d>0?l+g:0>d?0-l:0,i=0>g;return i?f+h:f}:0,v=function(b){return c(b[a.y.scaleDim])-r/2},w=n?function(c){var d=c[a.x.scaleDim],e=Math.abs(b(d)-b(o));return 0===d?e:Math.max(l,e)}:function(c){return b(c[a.x.scaleDim])},x=function(){return s},y=function(a,b){return e.translate(0,b*t+t/2)};return{calculateX:u,calculateY:v,calculateWidth:w,calculateHeight:x,calculateTranslate:y}}},k=function(a){var b=a.options,c=b.xScale,d=b.yScale,e=b.color,h=a.groupBy(a.partition(),a.color.scaleDim),i=j[a.flip?"FLIP":"NORM"],k=a.parentUnit.parentUnit||a.parentUnit,l=i(a,c,d,b.width,b.height,{tickWidth:5,intervalWidth:5,offsetCategory:0},a.groupBy(k.partition(),a.color.scaleDim)),m=l.calculateX,n=l.calculateY,o=l.calculateWidth,p=l.calculateHeight,q=l.calculateTranslate,r=function(){return this.attr("height",p).attr("width",o).attr("class",function(b){return"i-role-element i-role-datum bar "+f+"bar "+e(b[a.color.scaleDim])}).attr("x",m).attr("y",n)},s=function(){this.attr("class",g).attr("transform",q);var a=this.selectAll("bar").data(function(a){return a.values});a.call(r),a.enter().append("rect").call(r),a.exit().remove()},t=b.container.selectAll("."+g).data(h);t.call(s),t.enter().append("g").call(s),t.exit().remove()};a.interval=k}),e("elements/coords-parallel",["exports","../utils/utils-draw","../const","../utils/utils","../matrix"],function(c,d,e,f,g){var h=d.utilsDraw,i=(e.CSS_PREFIX,f.utils),j=g.TMatrix,k=function(b,c,d){var e=a.defaults(i.clone(b),a.pick.apply(a,[c].concat(d)));return e.guide=a.extend(i.clone(c.guide||{}),e.guide||{}),e},l={walk:function(b,c){var d=a.defaults(b,{$where:{}}),e=new j(1,1),f=new j(1,1);return e.iterate(function(b,c){var e=a.extend({},d.$where),g=a(d.unit).map(function(b){return a.extend(k(b,d,["x"]),{$where:e})});f.setRC(b,c,g)}),d.$matrix=f,f.iterate(function(b,d,e){a.each(e,function(a){return c(a)})}),d},draw:function(a){var c=a.options,d=a.guide.padding,e=c.left+d.l,f=c.top+d.t,g=c.width-(d.l+d.r),i=c.height-(d.t+d.b),j=a.x.map(function(b){return a.scaleTo(b,[i,0],{})}),k=c.container.append("g").attr("class","graphical-report__cell cell").attr("transform",h.translate(e,f)),l=function(a,b){return"translate("+a+","+b+")"},m=function(a){return"rotate("+a+")"},n=function(a,c){var d=this,e=b.svg.axis().scale(a).orient("left"),f=d.append("g").attr("class","y axis").attr("transform",l.apply(null,c)).call(e);f.selectAll(".tick text").attr("transform",m(0)).style("text-anchor","end")},o=g/(a.x.length-1);return j.forEach(function(a,b){n.call(k,a,[b*o,0])}),k.append("g").attr("class","grid").attr("transform",l(0,0))}};c.CoordsParallel=l}),e("elements/coords-parallel-line",["exports","../utils/utils-draw","../const"],function(a,c,d){var e=(c.utilsDraw,d.CSS_PREFIX,{draw:function(a){a.color=a.dimension(a.color,a);var c=a.guide.color||{},d=a.scaleColor(a.color.scaleDim,c.brewer,c),e=a.options,f=a.x.reduce(function(b,c){return b[c]=a.scaleTo(c,[e.height,0],{}),b},{}),g=b.nest().key(function(a){return a[d.dimension]}).entries(a.partition()).map(function(b){var c=b.values[0],d=[];return a.x.forEach(function(a){d.push({key:a,val:c[a]}) -}),d}),h=function(){this.attr("class",function(){return"graphical-report__line line color20-9"});var a=this.selectAll("path").data(function(a){return[a]});a.call(l),a.enter().append("path").call(l),a.exit().remove()},i=e.width/(a.x.length-1),j={};a.x.forEach(function(a,b){j[a]=b*i});var k=b.svg.line().x(function(a){return j[a.key]}).y(function(a){return f[a.key](a.val)}),l=function(){this.attr("d",k)},m=e.container.selectAll(".line").data(g);m.call(h),m.enter().append("g").call(h),m.exit().remove()}});a.CoordsParallelLine=e}),e("node-map",["exports","./elements/coords","./elements/line","./elements/point","./elements/interval","./utils/utils-draw","./elements/coords-parallel","./elements/coords-parallel-line"],function(b,c,d,e,f,g,h,i){var j=c.coords,k=d.line,l=e.point,m=f.interval,n=(g.utilsDraw,h.CoordsParallel),o=i.CoordsParallelLine,p=function(b,c){c.forEach(function(a){b[a]=b.dimension(b[a],b)});var d=b.options,e=d.width,f=d.height;b.x.guide=b.guide.x,b.y.guide=b.guide.y,b.options.xScale=b.x.scaleDim&&b.scaleTo(b.x.scaleDim,[0,e],b.x.guide),b.options.yScale=b.y.scaleDim&&b.scaleTo(b.y.scaleDim,[f,0],b.y.guide);var g=b.guide.color||{};if(b.options.color=b.scaleColor(b.color.scaleDim,g.brewer,g),b.size){var h=.5*a.min([b.guide.x.tickFontHeight,b.guide.y.tickFontHeight].filter(function(a){return 0!==a})),i=.5*a.min([b.guide.x.density,b.guide.y.density].filter(function(a){return 0!==a})),j=b.guide.size||{};b.options.sizeScale=b.scaleSize(b.size.scaleDim,[2,i,h],j)}return b},q={"COORDS.RECT":{walk:j.walk,draw:function(a,b){return a.x=a.dimension(a.x,a),a.y=a.dimension(a.y,a),j.draw(a,b)}},"ELEMENT.POINT":function(a){return l(p(a,["x","y","color","size"]))},"ELEMENT.LINE":function(a){return k(p(a,["x","y","color"]))},"ELEMENT.INTERVAL":function(a){return m(p(a,["x","y","color"]))},"COORDS.PARALLEL":n,"PARALLEL/ELEMENT.LINE":o};b.nodeMap=q}),e("tau.newCharts",["exports","./utils/utils-dom","./charts/tau.plot","./charts/tau.chart","./unit-domain-mixin","./unit-domain-period-generator","./dsl-reader","./spec-engine-factory","./layout-engine-factory","./formatter-registry","./node-map","./units-registry"],function(c,d,e,f,g,h,i,j,k,l,m,n){var o=d.utilsDom,p=e.Plot,q=f.Chart,r=g.UnitDomainMixin,s=h.UnitDomainPeriodGenerator,t=i.DSLReader,u=j.SpecEngineFactory,v=k.LayoutEngineFactory,w=l.FormatterRegistry,x=m.nodeMap,y=n.UnitsRegistry,z={},A={},B={UnitDomainMixin:r,UnitDomainPeriodGenerator:s,DSLReader:t,SpecEngineFactory:u,LayoutEngineFactory:v},C={UnitsRegistry:y,tickFormat:w,d3:b,_:a,tickPeriod:s,colorBrewers:{add:function(a,b){a in z||(z[a]=b)},get:function(a){return z[a]}},plugins:{add:function(a,b){if(a in A)throw new Error("Plugins is already registred.");A[a]=b},get:function(a){return A[a]}},globalSettings:{log:function(a,b){b=b||"INFO",Array.isArray(a)||(a=[a]),console[b.toLowerCase()].apply(console,a)},excludeNull:!0,specEngine:[{name:"COMPACT",width:600},{name:"AUTO",width:Number.MAX_VALUE}],fitSize:!0,layoutEngine:"EXTRACT",getAxisTickLabelSize:o.getAxisTickLabelSize,scrollBarWidth:o.getScrollbarWidth(),xAxisTickLabelLimit:100,yAxisTickLabelLimit:100,xTickWordWrapLinesLimit:2,yTickWordWrapLinesLimit:2,xTickWidth:9,yTickWidth:9,distToXAxisLabel:20,distToYAxisLabel:20,xAxisPadding:20,yAxisPadding:20,xFontLabelHeight:10,yFontLabelHeight:10,xDensityPadding:4,yDensityPadding:4,"xDensityPadding:measure":8,"yDensityPadding:measure":8,defaultFormats:{measure:"x-num-auto","measure:time":"x-time-auto","measure:time:year":"year","measure:time:quarter":"quarter","measure:time:month":"month","measure:time:week":"x-time-auto","measure:time:day":"x-time-auto","measure:time:hour":"x-time-auto","measure:time:min":"x-time-auto","measure:time:sec":"x-time-auto","measure:time:ms":"x-time-auto"}}};p.globalSettings=C.globalSettings,C.UnitsRegistry.add("COORDS.PARALLEL",x["COORDS.PARALLEL"]).add("PARALLEL/ELEMENT.LINE",x["PARALLEL/ELEMENT.LINE"]).add("COORDS.RECT",x["COORDS.RECT"]).add("ELEMENT.POINT",x["ELEMENT.POINT"]).add("ELEMENT.LINE",x["ELEMENT.LINE"]).add("ELEMENT.INTERVAL",x["ELEMENT.INTERVAL"]),c.Plot=p,c.Chart=q,c.__api__=B,c.api=C}),e("underscore",function(){return a}),e("d3",function(){return b}),d("tau.newCharts")}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){var b={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},c=function(a,c){return b[a][c].map(function(b,d){return a+" q"+d+"-"+c})};return a.api.colorBrewers.add("tauBrewer",c),c}),function(a,b){if("function"==typeof define&&define.amd)define(["tauCharts"],function(a){return b(a)});else if("object"==typeof module&&module.exports){{require("tauCharts")}module.exports=b(tauCharts)}else b(a.tauCharts)}(this,function(a){var b,c,d;!function(a){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(b,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(a,d.concat([b,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(b){if(e(r,b)){var c=r[b];delete r[b],t[b]=!0,m.apply(a,c)}if(!e(q,b)&&!e(t,b))throw new Error("No "+b);return q[b]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(b,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||b,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var a=this.r.toString(16),b=this.g.toString(16),c=this.b.toString(16);return 1==a.length&&(a="0"+a),1==b.length&&(b="0"+b),1==c.length&&(c="0"+c),"#"+a+b+c},this.getHelpXML=function(){for(var a=new Array,d=0;d "+k.toRGB()+" -> "+k.toHex());j.appendChild(l),j.appendChild(m),i.appendChild(j)}catch(n){}return i}}"undefined"!=typeof d&&d.amd?d("../bower_components/canvg/rgbcolor",[],function(){return b}):"undefined"!=typeof module&&module.exports&&(module.exports=b),a.RGBColor=b}("undefined"!=typeof window?window:this),function(a){function b(a,b,d,f){var g=document.getElementById(a),h=g.naturalWidth,i=g.naturalHeight,j=document.getElementById(b);j.style.width=h+"px",j.style.height=i+"px",j.width=h,j.height=i;var k=j.getContext("2d");k.clearRect(0,0,h,i),k.drawImage(g,0,0),isNaN(d)||1>d||(f?c(b,0,0,h,i,d):e(b,0,0,h,i,d))}function c(a,b,c,d,e,i){if(!(isNaN(i)||1>i)){i|=0;var j,k=document.getElementById(a),l=k.getContext("2d");try{try{j=l.getImageData(b,c,d,e)}catch(m){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"),j=l.getImageData(b,c,d,e)}catch(m){throw alert("Cannot access local image"),new Error("unable to access local image data: "+m)}}}catch(m){throw alert("Cannot access image"),new Error("unable to access image data: "+m)}var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L=j.data,M=i+i+1,N=d-1,O=e-1,P=i+1,Q=P*(P+1)/2,R=new f,S=R;for(p=1;M>p;p++)if(S=S.next=new f,p==P)var T=S;S.next=R;var U=null,V=null;t=s=0;var W=g[i],X=h[i];for(o=0;e>o;o++){for(C=D=E=F=u=v=w=x=0,y=P*(G=L[s]),z=P*(H=L[s+1]),A=P*(I=L[s+2]),B=P*(J=L[s+3]),u+=Q*G,v+=Q*H,w+=Q*I,x+=Q*J,S=R,p=0;P>p;p++)S.r=G,S.g=H,S.b=I,S.a=J,S=S.next;for(p=1;P>p;p++)q=s+((p>N?N:p)<<2),u+=(S.r=G=L[q])*(K=P-p),v+=(S.g=H=L[q+1])*K,w+=(S.b=I=L[q+2])*K,x+=(S.a=J=L[q+3])*K,C+=G,D+=H,E+=I,F+=J,S=S.next;for(U=R,V=T,n=0;d>n;n++)L[s+3]=J=x*W>>X,0!=J?(J=255/J,L[s]=(u*W>>X)*J,L[s+1]=(v*W>>X)*J,L[s+2]=(w*W>>X)*J):L[s]=L[s+1]=L[s+2]=0,u-=y,v-=z,w-=A,x-=B,y-=U.r,z-=U.g,A-=U.b,B-=U.a,q=t+((q=n+i+1)n;n++){for(D=E=F=C=v=w=x=u=0,s=n<<2,y=P*(G=L[s]),z=P*(H=L[s+1]),A=P*(I=L[s+2]),B=P*(J=L[s+3]),u+=Q*G,v+=Q*H,w+=Q*I,x+=Q*J,S=R,p=0;P>p;p++)S.r=G,S.g=H,S.b=I,S.a=J,S=S.next;for(r=d,p=1;i>=p;p++)s=r+n<<2,u+=(S.r=G=L[s])*(K=P-p),v+=(S.g=H=L[s+1])*K,w+=(S.b=I=L[s+2])*K,x+=(S.a=J=L[s+3])*K,C+=G,D+=H,E+=I,F+=J,S=S.next,O>p&&(r+=d);for(s=n,U=R,V=T,o=0;e>o;o++)q=s<<2,L[q+3]=J=x*W>>X,J>0?(J=255/J,L[q]=(u*W>>X)*J,L[q+1]=(v*W>>X)*J,L[q+2]=(w*W>>X)*J):L[q]=L[q+1]=L[q+2]=0,u-=y,v-=z,w-=A,x-=B,y-=U.r,z-=U.g,A-=U.b,B-=U.a,q=n+((q=o+P)i)){i|=0;var j,k=document.getElementById(a),l=k.getContext("2d");try{try{j=l.getImageData(b,c,d,e)}catch(m){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"),j=l.getImageData(b,c,d,e)}catch(m){throw alert("Cannot access local image"),new Error("unable to access local image data: "+m)}}}catch(m){throw alert("Cannot access image"),new Error("unable to access image data: "+m)}var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=j.data,I=i+i+1,J=d-1,K=e-1,L=i+1,M=L*(L+1)/2,N=new f,O=N;for(p=1;I>p;p++)if(O=O.next=new f,p==L)var P=O;O.next=N;var Q=null,R=null;t=s=0;var S=g[i],T=h[i];for(o=0;e>o;o++){for(A=B=C=u=v=w=0,x=L*(D=H[s]),y=L*(E=H[s+1]),z=L*(F=H[s+2]),u+=M*D,v+=M*E,w+=M*F,O=N,p=0;L>p;p++)O.r=D,O.g=E,O.b=F,O=O.next;for(p=1;L>p;p++)q=s+((p>J?J:p)<<2),u+=(O.r=D=H[q])*(G=L-p),v+=(O.g=E=H[q+1])*G,w+=(O.b=F=H[q+2])*G,A+=D,B+=E,C+=F,O=O.next;for(Q=N,R=P,n=0;d>n;n++)H[s]=u*S>>T,H[s+1]=v*S>>T,H[s+2]=w*S>>T,u-=x,v-=y,w-=z,x-=Q.r,y-=Q.g,z-=Q.b,q=t+((q=n+i+1)n;n++){for(B=C=A=v=w=u=0,s=n<<2,x=L*(D=H[s]),y=L*(E=H[s+1]),z=L*(F=H[s+2]),u+=M*D,v+=M*E,w+=M*F,O=N,p=0;L>p;p++)O.r=D,O.g=E,O.b=F,O=O.next;for(r=d,p=1;i>=p;p++)s=r+n<<2,u+=(O.r=D=H[s])*(G=L-p),v+=(O.g=E=H[s+1])*G,w+=(O.b=F=H[s+2])*G,A+=D,B+=E,C+=F,O=O.next,K>p&&(r+=d);for(s=n,Q=N,R=P,o=0;e>o;o++)q=s<<2,H[q]=u*S>>T,H[q+1]=v*S>>T,H[q+2]=w*S>>T,u-=x,v-=y,w-=z,x-=Q.r,y-=Q.g,z-=Q.b,q=n+((q=o+L)~]/g," "),a=a.replace(/[#\.]/g," "),c(n,2),b.join("")}function d(d){var f={opts:d};f.FRAMERATE=30,f.MAX_VIRTUAL_PIXELS=3e4,f.log=function(){},1==f.opts.log&&"undefined"!=typeof console&&(f.log=function(a){console.log(a)}),f.init=function(a){var b=0;f.UniqueId=function(){return b++,"canvg"+b},f.Definitions={},f.Styles={},f.StylesSpecificity={},f.Animations=[],f.Images=[],f.ctx=a,f.ViewPort=new function(){this.viewPorts=[],this.Clear=function(){this.viewPorts=[]},this.SetCurrent=function(a,b){this.viewPorts.push({width:a,height:b})},this.RemoveCurrent=function(){this.viewPorts.pop()},this.Current=function(){return this.viewPorts[this.viewPorts.length-1]},this.width=function(){return this.Current().width},this.height=function(){return this.Current().height},this.ComputeSize=function(a){return null!=a&&"number"==typeof a?a:"x"==a?this.width():"y"==a?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}},f.init(),f.ImagesLoaded=function(){for(var a=0;a]*>/,"");var b=new ActiveXObject("Microsoft.XMLDOM");return b.async="false",b.loadXML(a),b},f.Property=function(a,b){this.name=a,this.value=b},f.Property.prototype.getValue=function(){return this.value},f.Property.prototype.hasValue=function(){return null!=this.value&&""!==this.value},f.Property.prototype.numValue=function(){if(!this.hasValue())return 0;var a=parseFloat(this.value);return(this.value+"").match(/%$/)&&(a/=100),a},f.Property.prototype.valueOrDefault=function(a){return this.hasValue()?this.value:a},f.Property.prototype.numValueOrDefault=function(a){return this.hasValue()?this.numValue():a},f.Property.prototype.addOpacity=function(b){var c=this.value;if(null!=b.value&&""!=b.value&&"string"==typeof this.value){var d=new a(this.value);d.ok&&(c="rgba("+d.r+", "+d.g+", "+d.b+", "+b.numValue()+")")}return new f.Property(this.name,c)},f.Property.prototype.getDefinition=function(){var a=this.value.match(/#([^\)'"]+)/);return a&&(a=a[1]),a||(a=this.value),f.Definitions[a]},f.Property.prototype.isUrlDefinition=function(){return 0==this.value.indexOf("url(")},f.Property.prototype.getFillStyleDefinition=function(a,b){var c=this.getDefinition();if(null!=c&&c.createGradient)return c.createGradient(f.ctx,a,b);if(null!=c&&c.createPattern){if(c.getHrefAttribute().hasValue()){var d=c.attribute("patternTransform");c=c.getHrefAttribute().getDefinition(),d.hasValue()&&(c.attribute("patternTransform",!0).value=d.value)}return c.createPattern(f.ctx,a)}return null},f.Property.prototype.getDPI=function(){return 96},f.Property.prototype.getEM=function(a){var b=12,c=new f.Property("fontSize",f.Font.Parse(f.ctx.font).fontSize);return c.hasValue()&&(b=c.toPixels(a)),b},f.Property.prototype.getUnits=function(){var a=this.value+"";return a.replace(/[0-9\.\-]/g,"")},f.Property.prototype.toPixels=function(a,b){if(!this.hasValue())return 0;var c=this.value+"";if(c.match(/em$/))return this.numValue()*this.getEM(a);if(c.match(/ex$/))return this.numValue()*this.getEM(a)/2;if(c.match(/px$/))return this.numValue();if(c.match(/pt$/))return this.numValue()*this.getDPI(a)*(1/72);if(c.match(/pc$/))return 15*this.numValue();if(c.match(/cm$/))return this.numValue()*this.getDPI(a)/2.54;if(c.match(/mm$/))return this.numValue()*this.getDPI(a)/25.4;if(c.match(/in$/))return this.numValue()*this.getDPI(a);if(c.match(/%$/))return this.numValue()*f.ViewPort.ComputeSize(a);var d=this.numValue();return b&&1>d?d*f.ViewPort.ComputeSize(a):d},f.Property.prototype.toMilliseconds=function(){if(!this.hasValue())return 0;var a=this.value+"";return a.match(/s$/)?1e3*this.numValue():(a.match(/ms$/),this.numValue())},f.Property.prototype.toRadians=function(){if(!this.hasValue())return 0;var a=this.value+"";return a.match(/deg$/)?this.numValue()*(Math.PI/180):a.match(/grad$/)?this.numValue()*(Math.PI/200):a.match(/rad$/)?this.numValue():this.numValue()*(Math.PI/180)};var g={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};return f.Property.prototype.toTextBaseline=function(){return this.hasValue()?g[this.value]:null},f.Font=new function(){this.Styles="normal|italic|oblique|inherit",this.Variants="normal|small-caps|inherit",this.Weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit",this.CreateFont=function(a,b,c,d,e,g){var h=null!=g?this.Parse(g):this.CreateFont("","","","","",f.ctx.font);return{fontFamily:e||h.fontFamily,fontSize:d||h.fontSize,fontStyle:a||h.fontStyle,fontWeight:c||h.fontWeight,fontVariant:b||h.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var a=this;this.Parse=function(b){for(var c={},d=f.trim(f.compressSpaces(b||"")).split(" "),e={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1},g="",h=0;hthis.x2&&(this.x2=a)),null!=b&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=b,this.y2=b),bthis.y2&&(this.y2=b))},this.addX=function(a){this.addPoint(a,null)},this.addY=function(a){this.addPoint(null,a)},this.addBoundingBox=function(a){this.addPoint(a.x1,a.y1),this.addPoint(a.x2,a.y2)},this.addQuadraticCurve=function(a,b,c,d,e,f){var g=a+2/3*(c-a),h=b+2/3*(d-b),i=g+1/3*(e-a),j=h+1/3*(f-b);this.addBezierCurve(a,b,g,i,h,j,e,f)},this.addBezierCurve=function(a,b,c,d,e,f,g,h){var j=[a,b],k=[c,d],l=[e,f],m=[g,h];for(this.addPoint(j[0],j[1]),this.addPoint(m[0],m[1]),i=0;i<=1;i++){var n=function(a){return Math.pow(1-a,3)*j[i]+3*Math.pow(1-a,2)*a*k[i]+3*(1-a)*Math.pow(a,2)*l[i]+Math.pow(a,3)*m[i]},o=6*j[i]-12*k[i]+6*l[i],p=-3*j[i]+9*k[i]-9*l[i]+3*m[i],q=3*k[i]-3*j[i];if(0!=p){var r=Math.pow(o,2)-4*q*p;if(!(0>r)){var s=(-o+Math.sqrt(r))/(2*p);s>0&&1>s&&(0==i&&this.addX(n(s)),1==i&&this.addY(n(s)));var t=(-o-Math.sqrt(r))/(2*p);t>0&&1>t&&(0==i&&this.addX(n(t)),1==i&&this.addY(n(t)))}}else{if(0==o)continue;var u=-q/o;u>0&&1>u&&(0==i&&this.addX(n(u)),1==i&&this.addY(n(u)))}}},this.isPointInBox=function(a,b){return this.x1<=a&&a<=this.x2&&this.y1<=b&&b<=this.y2},this.addPoint(a,b),this.addPoint(c,d)},f.Transform=function(a){var b=this;this.Type={},this.Type.translate=function(a){this.p=f.CreatePoint(a),this.apply=function(a){a.translate(this.p.x||0,this.p.y||0)},this.unapply=function(a){a.translate(-1*this.p.x||0,-1*this.p.y||0)},this.applyToPoint=function(a){a.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0])}},this.Type.rotate=function(a){var b=f.ToNumberArray(a);this.angle=new f.Property("angle",b[0]),this.cx=b[1]||0,this.cy=b[2]||0,this.apply=function(a){a.translate(this.cx,this.cy),a.rotate(this.angle.toRadians()),a.translate(-this.cx,-this.cy)},this.unapply=function(a){a.translate(this.cx,this.cy),a.rotate(-1*this.angle.toRadians()),a.translate(-this.cx,-this.cy)},this.applyToPoint=function(a){var b=this.angle.toRadians();a.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]),a.applyTransform([Math.cos(b),Math.sin(b),-Math.sin(b),Math.cos(b),0,0]),a.applyTransform([1,0,0,1,-this.p.x||0,-this.p.y||0])}},this.Type.scale=function(a){this.p=f.CreatePoint(a),this.apply=function(a){a.scale(this.p.x||1,this.p.y||this.p.x||1)},this.unapply=function(a){a.scale(1/this.p.x||1,1/this.p.y||this.p.x||1)},this.applyToPoint=function(a){a.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}},this.Type.matrix=function(a){this.m=f.ToNumberArray(a),this.apply=function(a){a.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])},this.unapply=function(a){var b=this.m[0],c=this.m[2],d=this.m[4],e=this.m[1],f=this.m[3],g=this.m[5],h=0,i=0,j=1,k=1/(b*(f*j-g*i)-c*(e*j-g*h)+d*(e*i-f*h));a.transform(k*(f*j-g*i),k*(g*h-e*j),k*(d*i-c*j),k*(b*j-d*h),k*(c*g-d*f),k*(d*e-b*g))},this.applyToPoint=function(a){a.applyTransform(this.m)}},this.Type.SkewBase=function(a){this.base=b.Type.matrix,this.base(a),this.angle=new f.Property("angle",a)},this.Type.SkewBase.prototype=new this.Type.matrix,this.Type.skewX=function(a){this.base=b.Type.SkewBase,this.base(a),this.m=[1,0,Math.tan(this.angle.toRadians()),1,0,0]},this.Type.skewX.prototype=new this.Type.SkewBase,this.Type.skewY=function(a){this.base=b.Type.SkewBase,this.base(a),this.m=[1,Math.tan(this.angle.toRadians()),0,1,0,0]},this.Type.skewY.prototype=new this.Type.SkewBase,this.transforms=[],this.apply=function(a){for(var b=0;b=0;b--)this.transforms[b].unapply(a)},this.applyToPoint=function(a){for(var b=0;bj&&(this.styles[i]=g[i],this.stylesSpecificity[i]=h)}}if(this.attribute("style").hasValue())for(var g=this.attribute("style").value.split(";"),b=0;b=this.tokens.length-1},this.isCommandOrEnd=function(){return this.isEnd()?!0:null!=this.tokens[this.i+1].match(/^[A-Za-z]$/)},this.isRelativeCommand=function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0}return!1},this.getToken=function(){return this.i++,this.tokens[this.i]},this.getScalar=function(){return parseFloat(this.getToken())},this.nextCommand=function(){this.previousCommand=this.command,this.command=this.getToken()},this.getPoint=function(){var a=new f.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(a)},this.getAsControlPoint=function(){var a=this.getPoint();return this.control=a,a},this.getAsCurrentPoint=function(){var a=this.getPoint();return this.current=a,a},this.getReflectedControlPoint=function(){if("c"!=this.previousCommand.toLowerCase()&&"s"!=this.previousCommand.toLowerCase()&&"q"!=this.previousCommand.toLowerCase()&&"t"!=this.previousCommand.toLowerCase())return this.current;var a=new f.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y);return a},this.makeAbsolute=function(a){return this.isRelativeCommand()&&(a.x+=this.current.x,a.y+=this.current.y),a},this.addMarker=function(a,b,c){null!=c&&this.angles.length>0&&null==this.angles[this.angles.length-1]&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(c)),this.addMarkerAngle(a,null==b?null:b.angleTo(a))},this.addMarkerAngle=function(a,b){this.points.push(a),this.angles.push(b)},this.getMarkerPoints=function(){return this.points},this.getMarkerAngles=function(){for(var a=0;a1&&(l*=Math.sqrt(r),m*=Math.sqrt(r));var s=(o==p?-1:1)*Math.sqrt((Math.pow(l,2)*Math.pow(m,2)-Math.pow(l,2)*Math.pow(q.y,2)-Math.pow(m,2)*Math.pow(q.x,2))/(Math.pow(l,2)*Math.pow(q.y,2)+Math.pow(m,2)*Math.pow(q.x,2)));isNaN(s)&&(s=0);var t=new f.Point(s*l*q.y/m,s*-m*q.x/l),u=new f.Point((h.x+k.x)/2+Math.cos(n)*t.x-Math.sin(n)*t.y,(h.y+k.y)/2+Math.sin(n)*t.x+Math.cos(n)*t.y),v=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))},w=function(a,b){return(a[0]*b[0]+a[1]*b[1])/(v(a)*v(b))},x=function(a,b){return(a[0]*b[1]=1&&(B=0);var C=1-p?1:-1,D=y+C*(B/2),E=new f.Point(u.x+l*Math.cos(D),u.y+m*Math.sin(D));if(b.addMarkerAngle(E,D-C*Math.PI/2),b.addMarkerAngle(k,D-C*Math.PI),c.addPoint(k.x,k.y),null!=a){var w=l>m?l:m,F=l>m?1:l/m,G=l>m?m/l:1;a.translate(u.x,u.y),a.rotate(n),a.scale(F,G),a.arc(0,0,w,y,y+B,1-p),a.scale(1/F,1/G),a.rotate(-n),a.translate(-u.x,-u.y)}}break;case"Z":case"z":null!=a&&a.closePath(),b.current=b.start}return c},this.getMarkers=function(){for(var a=this.PathParser.getMarkerPoints(),b=this.PathParser.getMarkerAngles(),c=[],d=0;d=h;h++)for(var i=-1;1>=i;i++)g.save(),g.translate(h*e.width,i*e.height),d.render(g),g.restore();var j=a.createPattern(e,"repeat");return j}},f.Element.pattern.prototype=new f.Element.ElementBase,f.Element.marker=function(a){this.base=f.Element.ElementBase,this.base(a),this.baseRender=this.render,this.render=function(a,b,c){a.translate(b.x,b.y),"auto"==this.attribute("orient").valueOrDefault("auto")&&a.rotate(c),"strokeWidth"==this.attribute("markerUnits").valueOrDefault("strokeWidth")&&a.scale(a.lineWidth,a.lineWidth),a.save();var d=new f.Element.svg;d.attributes.viewBox=new f.Property("viewBox",this.attribute("viewBox").value),d.attributes.refX=new f.Property("refX",this.attribute("refX").value),d.attributes.refY=new f.Property("refY",this.attribute("refY").value),d.attributes.width=new f.Property("width",this.attribute("markerWidth").value),d.attributes.height=new f.Property("height",this.attribute("markerHeight").value),d.attributes.fill=new f.Property("fill",this.attribute("fill").valueOrDefault("black")),d.attributes.stroke=new f.Property("stroke",this.attribute("stroke").valueOrDefault("none")),d.children=this.children,d.render(a),a.restore(),"strokeWidth"==this.attribute("markerUnits").valueOrDefault("strokeWidth")&&a.scale(1/a.lineWidth,1/a.lineWidth),"auto"==this.attribute("orient").valueOrDefault("auto")&&a.rotate(-c),a.translate(-b.x,-b.y)}},f.Element.marker.prototype=new f.Element.ElementBase,f.Element.defs=function(a){this.base=f.Element.ElementBase,this.base(a),this.render=function(){}},f.Element.defs.prototype=new f.Element.ElementBase,f.Element.GradientBase=function(a){this.base=f.Element.ElementBase,this.base(a),this.gradientUnits=this.attribute("gradientUnits").valueOrDefault("objectBoundingBox"),this.stops=[];for(var b=0;b1&&(this.offset=1);var b=this.style("stop-color");this.style("stop-opacity").hasValue()&&(b=b.addOpacity(this.style("stop-opacity"))),this.color=b.value},f.Element.stop.prototype=new f.Element.ElementBase,f.Element.AnimateBase=function(a){this.base=f.Element.ElementBase,this.base(a),f.Animations.push(this),this.duration=0,this.begin=this.attribute("begin").toMilliseconds(),this.maxDuration=this.begin+this.attribute("dur").toMilliseconds(),this.getProperty=function(){var a=this.attribute("attributeType").value,b=this.attribute("attributeName").value;return"CSS"==a?this.parent.style(b,!0):this.parent.attribute(b,!0)},this.initialValue=null,this.initialUnits="",this.removed=!1,this.calcValue=function(){return""},this.update=function(a){if(null==this.initialValue&&(this.initialValue=this.getProperty().value,this.initialUnits=this.getProperty().getUnits()),this.duration>this.maxDuration){if("indefinite"==this.attribute("repeatCount").value||"indefinite"==this.attribute("repeatDur").value)this.duration=0;else if("freeze"!=this.attribute("fill").valueOrDefault("remove")||this.frozen){if("remove"==this.attribute("fill").valueOrDefault("remove")&&!this.removed)return this.removed=!0,this.getProperty().value=this.parent.animationFrozen?this.parent.animationFrozenValue:this.initialValue,!0}else this.frozen=!0,this.parent.animationFrozen=!0,this.parent.animationFrozenValue=this.getProperty().value;return!1}this.duration=this.duration+a;var b=!1;if(this.beginc&&g.attribute("x").hasValue())break;e+=g.measureTextRecursive(a)}return-1*("end"==d?e:e/2)}return 0},this.renderChild=function(a,b,c){var d=b.children[c];d.attribute("x").hasValue()?(d.x=d.attribute("x").toPixels("x")+this.getAnchorDelta(a,b,c),d.attribute("dx").hasValue()&&(d.x+=d.attribute("dx").toPixels("x"))):(this.attribute("dx").hasValue()&&(this.x+=this.attribute("dx").toPixels("x")),d.attribute("dx").hasValue()&&(this.x+=d.attribute("dx").toPixels("x")),d.x=this.x),this.x=d.x+d.measureText(a),d.attribute("y").hasValue()?(d.y=d.attribute("y").toPixels("y"),d.attribute("dy").hasValue()&&(d.y+=d.attribute("dy").toPixels("y"))):(this.attribute("dy").hasValue()&&(this.y+=this.attribute("dy").toPixels("y")),d.attribute("dy").hasValue()&&(this.y+=d.attribute("dy").toPixels("y")),d.y=this.y),this.y=d.y,d.render(a);for(var c=0;c0&&" "!=b[c-1]&&c0&&" "!=b[c-1]&&(c==b.length-1||" "==b[c+1])&&(f="initial"),"undefined"!=typeof a.glyphs[d]&&(e=a.glyphs[d][f],null==e&&"glyph"==a.glyphs[d].type&&(e=a.glyphs[d]))}else e=a.glyphs[d];return null==e&&(e=a.missingGlyph),e},this.renderChildren=function(a){var b=this.parent.style("font-family").getDefinition();if(null==b)""!=a.fillStyle&&a.fillText(f.compressSpaces(this.getText()),this.x,this.y),""!=a.strokeStyle&&a.strokeText(f.compressSpaces(this.getText()),this.x,this.y);else{var c=this.parent.style("font-size").numValueOrDefault(f.Font.Parse(f.ctx.font).fontSize),d=this.parent.style("font-style").valueOrDefault(f.Font.Parse(f.ctx.font).fontStyle),e=this.getText();b.isRTL&&(e=e.split("").reverse().join(""));for(var g=f.ToNumberArray(this.parent.attribute("dx").value),h=0;h0;for(var b=0;b0){var c=new f.Element.g;c.children=this.children,c.parent=this,c.render(a)}},this.onclick=function(){window.open(this.getHrefAttribute().value)},this.onmousemove=function(){f.ctx.canvas.style.cursor="pointer"}},f.Element.a.prototype=new f.Element.TextElementBase,f.Element.image=function(a){this.base=f.Element.RenderedElementBase,this.base(a);var b=this.getHrefAttribute().value;if(""!=b){var c=b.match(/\.svg$/);if(f.Images.push(this),this.loaded=!1,c)this.img=f.ajax(b),this.loaded=!0;else{this.img=document.createElement("img"),1==f.opts.useCORS&&(this.img.crossOrigin="Anonymous");var d=this;this.img.onload=function(){d.loaded=!0},this.img.onerror=function(){f.log('ERROR: image "'+b+'" not found'),d.loaded=!0},this.img.src=b}this.renderChildren=function(a){var b=this.attribute("x").toPixels("x"),d=this.attribute("y").toPixels("y"),e=this.attribute("width").toPixels("x"),g=this.attribute("height").toPixels("y");0!=e&&0!=g&&(a.save(),c?a.drawSvg(this.img,b,d,e,g):(a.translate(b,d),f.AspectRatio(a,this.attribute("preserveAspectRatio").value,e,this.img.width,g,this.img.height,0,0),a.drawImage(this.img,0,0)),a.restore())},this.getBoundingBox=function(){var a=this.attribute("x").toPixels("x"),b=this.attribute("y").toPixels("y"),c=this.attribute("width").toPixels("x"),d=this.attribute("height").toPixels("y");return new f.BoundingBox(a,b,a+c,b+d)}}},f.Element.image.prototype=new f.Element.RenderedElementBase,f.Element.g=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.getBoundingBox=function(){for(var a=new f.BoundingBox,b=0;b0)for(var t=r[s].indexOf("url"),u=r[s].indexOf(")",t),v=r[s].substr(t+5,u-t-6),w=f.parseXml(f.ajax(v)),x=w.getElementsByTagName("font"),y=0;yc?b-255:b)}this.base=f.Element.ElementBase,this.base(a);var e=f.ToNumberArray(this.attribute("values").value);switch(this.attribute("type").valueOrDefault("matrix")){case"saturate":var g=e[0];e=[.213+.787*g,.715-.715*g,.072-.072*g,0,0,.213-.213*g,.715+.285*g,.072-.072*g,0,0,.213-.213*g,.715-.715*g,.072+.928*g,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var h=e[0]*Math.PI/180,i=function(a,b,c){return a+Math.cos(h)*b+Math.sin(h)*c};e=[i(.213,.787,-.213),i(.715,-.715,-.715),i(.072,-.072,.928),0,0,i(.213,-.213,.143),i(.715,.285,.14),i(.072,-.072,-.283),0,0,i(.213,-.213,-.787),i(.715,-.715,.715),i(.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.apply=function(a,e,f,g,h){for(var i=a.getImageData(0,0,g,h),f=0;h>f;f++)for(var e=0;g>e;e++){var j=b(i.data,e,f,g,h,0),k=b(i.data,e,f,g,h,1),l=b(i.data,e,f,g,h,2),m=b(i.data,e,f,g,h,3);c(i.data,e,f,g,h,0,d(0,j)+d(1,k)+d(2,l)+d(3,m)+d(4,1)),c(i.data,e,f,g,h,1,d(5,j)+d(6,k)+d(7,l)+d(8,m)+d(9,1)),c(i.data,e,f,g,h,2,d(10,j)+d(11,k)+d(12,l)+d(13,m)+d(14,1)),c(i.data,e,f,g,h,3,d(15,j)+d(16,k)+d(17,l)+d(18,m)+d(19,1))}a.clearRect(0,0,g,h),a.putImageData(i,0,0)}},f.Element.feColorMatrix.prototype=new f.Element.ElementBase,f.Element.feGaussianBlur=function(a){this.base=f.Element.ElementBase,this.base(a),this.blurRadius=Math.floor(this.attribute("stdDeviation").numValue()),this.extraFilterDistance=this.blurRadius,this.apply=function(a,c,d,e,g){return"undefined"==typeof b.canvasRGBA?void f.log("ERROR: StackBlur.js must be included for blur to work"):(a.canvas.id=f.UniqueId(),a.canvas.style.display="none",document.body.appendChild(a.canvas),b.canvasRGBA(a.canvas.id,c,d,e,g,this.blurRadius),void document.body.removeChild(a.canvas))}},f.Element.feGaussianBlur.prototype=new f.Element.ElementBase,f.Element.title=function(){},f.Element.title.prototype=new f.Element.ElementBase,f.Element.desc=function(){},f.Element.desc.prototype=new f.Element.ElementBase,f.Element.MISSING=function(a){f.log("ERROR: Element '"+a.nodeName+"' not yet implemented.")},f.Element.MISSING.prototype=new f.Element.ElementBase,f.CreateElement=function(a){var b=a.nodeName.replace(/^[^:]+:/,"");b=b.replace(/\-/g,"");var c=null;return c="undefined"!=typeof f.Element[b]?new f.Element[b](a):new f.Element.MISSING(a),c.type=a.nodeName,c},f.load=function(a,b){f.loadXml(a,f.ajax(b))},f.loadXml=function(a,b){f.loadXmlDoc(a,f.parseXml(b))},f.loadXmlDoc=function(a,b){f.init(a);var c=function(b){for(var c=a.canvas;c;)b.x-=c.offsetLeft,b.y-=c.offsetTop,c=c.offsetParent;return window.scrollX&&(b.x+=window.scrollX),window.scrollY&&(b.y+=window.scrollY),b};1!=f.opts.ignoreMouse&&(a.canvas.onclick=function(a){var b=c(new f.Point(null!=a?a.clientX:event.clientX,null!=a?a.clientY:event.clientY));f.Mouse.onclick(b.x,b.y)},a.canvas.onmousemove=function(a){var b=c(new f.Point(null!=a?a.clientX:event.clientX,null!=a?a.clientY:event.clientY));f.Mouse.onmousemove(b.x,b.y)});var d=f.CreateElement(b.documentElement);d.root=!0;var e=!0,g=function(){f.ViewPort.Clear(),a.canvas.parentNode&&f.ViewPort.SetCurrent(a.canvas.parentNode.clientWidth,a.canvas.parentNode.clientHeight),1!=f.opts.ignoreDimensions&&(d.style("width").hasValue()&&(a.canvas.width=d.style("width").toPixels("x"),a.canvas.style.width=a.canvas.width+"px"),d.style("height").hasValue()&&(a.canvas.height=d.style("height").toPixels("y"),a.canvas.style.height=a.canvas.height+"px"));var c=a.canvas.clientWidth||a.canvas.width,g=a.canvas.clientHeight||a.canvas.height;if(1==f.opts.ignoreDimensions&&d.style("width").hasValue()&&d.style("height").hasValue()&&(c=d.style("width").toPixels("x"),g=d.style("height").toPixels("y")),f.ViewPort.SetCurrent(c,g),null!=f.opts.offsetX&&(d.attribute("x",!0).value=f.opts.offsetX),null!=f.opts.offsetY&&(d.attribute("y",!0).value=f.opts.offsetY),null!=f.opts.scaleWidth||null!=f.opts.scaleHeight){var h=null,i=null,j=f.ToNumberArray(d.attribute("viewBox").value);null!=f.opts.scaleWidth&&(d.attribute("width").hasValue()?h=d.attribute("width").toPixels("x")/f.opts.scaleWidth:isNaN(j[2])||(h=j[2]/f.opts.scaleWidth)),null!=f.opts.scaleHeight&&(d.attribute("height").hasValue()?i=d.attribute("height").toPixels("y")/f.opts.scaleHeight:isNaN(j[3])||(i=j[3]/f.opts.scaleHeight)),null==h&&(h=i),null==i&&(i=h),d.attribute("width",!0).value=f.opts.scaleWidth,d.attribute("height",!0).value=f.opts.scaleHeight,d.attribute("transform",!0).value+=" scale("+1/h+","+1/i+")"}1!=f.opts.ignoreClear&&a.clearRect(0,0,c,g),d.render(a),e&&(e=!1,"function"==typeof f.opts.renderCallback&&f.opts.renderCallback(b))},h=!0;f.ImagesLoaded()&&(h=!1,g()),f.intervalID=setInterval(function(){var a=!1;if(h&&f.ImagesLoaded()&&(h=!1,a=!0),1!=f.opts.ignoreMouse&&(a|=f.Mouse.hasEvents()),1!=f.opts.ignoreAnimation)for(var b=0;b~\.\[:]+)/g,j=/(\.[^\s\+>~\.\[:]+)/g,k=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,l=/(:[\w-]+\([^\)]*\))/gi,m=/(:[^\s\+>~\.\[:]+)/g,n=/([^\s\+>~\.\[:]+)/g;return"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.drawSvg=function(a,b,c,d,e){f(this.canvas,a,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:b,offsetY:c,scaleWidth:d,scaleHeight:e})}),f});var e=e||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(a){if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var b=a.document,c=function(){return a.URL||a.webkitURL||a},d=b.createElementNS("http://www.w3.org/1999/xhtml","a"),e="download"in d,f=function(c){var d=b.createEvent("MouseEvents");d.initMouseEvent("click",!0,!1,a,0,0,0,0,0,!1,!1,!1,!1,0,null),c.dispatchEvent(d)},g=a.webkitRequestFileSystem,h=a.requestFileSystem||g||a.mozRequestFileSystem,i=function(b){(a.setImmediate||a.setTimeout)(function(){throw b},0)},j="application/octet-stream",k=0,l=500,m=function(b){var d=function(){"string"==typeof b?c().revokeObjectURL(b):b.remove()};a.chrome?d():setTimeout(d,l)},n=function(a,b,c){b=[].concat(b);for(var d=b.length;d--;){var e=a["on"+b[d]];if("function"==typeof e)try{e.call(a,c||a)}catch(f){i(f)}}},o=function(b,i){var l,o,p,q=this,r=b.type,s=!1,t=function(){n(q,"writestart progress write writeend".split(" "))},u=function(){if((s||!l)&&(l=c().createObjectURL(b)),o)o.location.href=l;else{var d=a.open(l,"_blank");void 0==d&&"undefined"!=typeof safari&&(a.location.href=l)}q.readyState=q.DONE,t(),m(l)},v=function(a){return function(){return q.readyState!==q.DONE?a.apply(this,arguments):void 0}},w={create:!0,exclusive:!1};return q.readyState=q.INIT,i||(i="download"),e?(l=c().createObjectURL(b),d.href=l,d.download=i,f(d),q.readyState=q.DONE,t(),void m(l)):(a.chrome&&r&&r!==j&&(p=b.slice||b.webkitSlice,b=p.call(b,0,b.size,j),s=!0),g&&"download"!==i&&(i+=".download"),(r===j||g)&&(o=a),h?(k+=b.size,void h(a.TEMPORARY,k,v(function(a){a.root.getDirectory("saved",w,v(function(a){var c=function(){a.getFile(i,w,v(function(a){a.createWriter(v(function(c){c.onwriteend=function(b){o.location.href=a.toURL(),q.readyState=q.DONE,n(q,"writeend",b),m(a)},c.onerror=function(){var a=c.error;a.code!==a.ABORT_ERR&&u()},"writestart progress write abort".split(" ").forEach(function(a){c["on"+a]=q["on"+a]}),c.write(b),q.abort=function(){c.abort(),q.readyState=q.DONE},q.readyState=q.WRITING}),u)}),u)};a.getFile(i,{create:!1},v(function(a){a.remove(),c()}),v(function(a){a.code===a.NOT_FOUND_ERR?c():u()}))}),u)}),u)):void u())},p=o.prototype,q=function(a,b){return new o(a,b)};return p.abort=function(){var a=this;a.readyState=a.DONE,n(a,"abort")},p.readyState=p.INIT=0,p.WRITING=1,p.DONE=2,p.error=p.onwritestart=p.onprogress=p.onwrite=p.onabort=p.onerror=p.onwriteend=null,q}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);return"undefined"!=typeof module&&module.exports?module.exports.saveAs=e:"undefined"!=typeof d&&null!==d&&null!=d.amd&&d("../bower_components/FileSaver.js/FileSaver",[],function(){return e}),function(a){"function"==typeof d&&d.amd?d("export",["tauCharts","canvg","FileSaver"],function(b,c,d){return a(b,c,d)}):a(this.tauCharts,this.canvg,this.saveAs)}(function(a,b,c){function d(){return{onRender:function(a){d3.text("http://localhost:63342/tauCharts/css/tauCharts.css",function(d){var e=document.createElement("style");e.innerHTML=d;var f=a.getSVG().firstChild;a.getSVG().insertBefore(e,f);var g=document.createElement("canvas");g.height=1072,g.width=1800,b(g,a.getSVG().parentNode.innerHTML);for(var h=g.toDataURL("image/png"),i=atob(h.substring("data:image/png;base64,".length)),j=new Uint8Array(i.length),k=0,l=i.length;l>k;++k)j[k]=i.charCodeAt(k);var m=new Blob([j.buffer],{type:"image/png"});c(m)})}}}a.api.d3;return a.api.plugins.add("exportTo",d),d}),d("tauCharts",function(){return a}),c.config({map:{"*":{canvg:"../bower_components/canvg/canvg",FileSaver:"../bower_components/FileSaver.js/FileSaver",rgbcolor:"../bower_components/canvg/rgbcolor",stackblur:"../bower_components/canvg/StackBlur"}}}),c("export")}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){var b=function(a){if(a.color)return a;var c,d,e,f=a.unit||[];for(c=0;c',_template:c.template('
<%=name%>
<%=items%>'),_itemTemplate:c.template(["
\">",'
<%=label%>',"
"].join("")),onRender:function(a){if(this._container){var d=this._unit.options.color,f=this._unit.color.scaleDim,g=a.getConfig(),h=b(g.spec.unit);h.guide=h.guide||{},h.guide.color=this._unit.guide.color;var i=h.guide.color.label.text||d.dimension,j=this._getColorMap(a.getData({excludeFilter:["legend"]}),d,f);h.guide.color.brewer=j.brewer;var k=c.reduce(j.values,function(a,b){var d={dimension:f,value:b.value,color:b.color},g=JSON.stringify(d),h=c.escape(e(b.label)?"No "+i:b.label);return a.items.push(this._itemTemplate({color:b.color,classDisabled:this._currentFilters[g]?"disabled":"",label:h,value:c.escape(g)})),a.storageValues[g]=d,a},{items:[],storageValues:{}},this);this._storageValues=k.storageValues,this._container.innerHTML=this._template({items:k.items.join(""),name:i})}}}};return a.api.plugins.add("legend",f),f}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(b){return b=b||{},{template:['
','
','
','Exclude',"
","
"].join(""),itemTemplate:['
','
<%=label%>
','
<%=value%>
',"
"].join(""),onExcludeData:function(){},_drawPoint:function(a,b,c,d){this.circle&&this.circle.remove(),this.circle=a.append("circle").attr("cx",b).attr("cy",c).attr("class",d).attr("r",4),this.circle.node().addEventListener("mouseover",function(){clearTimeout(this._timeoutHideId)}.bind(this),!1),this.circle.node().addEventListener("mouseleave",function(){this._hide()}.bind(this),!1)},formatters:{},labels:{},init:function(a){this._chart=a,this._dataFields=b.fields,this._getDataFields=b.getFields,c.extend(this,c.omit(b,"fields","getFields")),this._timeoutHideId=null,this._dataWithCoords={},this._unitMeta={},this._templateItem=c.template(this.itemTemplate),this._tooltip=a.addBalloon({spacing:3,auto:!0,effectClass:"fade"}),this._elementTooltip=this._tooltip.getElement();var d=a.getConfig().spec,e=this._findDimensionGuides(d),f=c.reduce(e,function(a,b,d){return a[d]=c.last(b),a},{}),g=this._generateDefaultFormatters(f,d.dimensions);c.extend(this.formatters,g);var h=this._generateDefaultLabels(f);c.extend(this.labels,h);var i=this._elementTooltip;i.addEventListener("mouseover",function(){clearTimeout(this._timeoutHideId)}.bind(this),!1),i.addEventListener("mouseleave",function(){this._hide()}.bind(this),!1),i.addEventListener("click",function(a){for(var b=a.target;b!==a.currentTarget&&null!==b;)b.classList.contains("i-role-exclude")&&(this._exclude(),this._hide()),b=b.parentNode}.bind(this),!1),i.insertAdjacentHTML("afterbegin",this.template),this.afterInit(this._elementTooltip)},afterInit:function(){},onUnitReady:function(a,b){if(b.type&&0===b.type.indexOf("ELEMENT")){var c=this._generateKey(b.$where);this._unitMeta[c]=b;var d=b.partition();this._dataWithCoords[c]=d.map(function(a){return{x:b.options.xScale(a[b.x.scaleDim]),y:b.options.yScale(a[b.y.scaleDim]),item:a}},this)}},renderItem:function(a,b){return this._templateItem({label:a,value:b})},render:function(a,b){return b=c.unique(b),b.map(function(b){var c=a[b],d=this._getFormatter(b)(c),e=this._getLabel(b);return this.renderItem(e,d,b,c)},this).join("")},afterRender:function(){},onRender:function(a){c.isFunction(this._getDataFields)&&(this._dataFields=this._getDataFields(a)),this._hide()},_getFormatter:function(a){return this.formatters[a]||c.identity},_getLabel:function(a){return this.labels[a]||a},_generateDefaultLabels:function(a){return c.reduce(a,function(a,b,c){return a[c]=b.label||c,a},{})},_generateDefaultFormatters:function(b,d){return c.reduce(b,function(b,c,e){var f=function(b){if(null==b)return null;var f=c.tickPeriod||c.tickFormat;return f?a.api.tickFormat.get(f)(b):c.tickLabel?b[c.tickLabel]:d[e].value?b[d[e].value]:b};return b[e]=function(a){var b=f(a);return null==b?"No "+c.label:b},b},{})},_findDimensionGuides:function(a){var b={},c=function(a,c){var d=c[a];if(d){var e=(c.guide||{})[a];e&&(b[d]||(b[d]=[]),b[d].push(e))}};return f(a.unit,function(a){return c("x",a),c("y",a),c("color",a),c("size",a),!1}),b},_exclude:function(){this._chart.addFilter({tag:"exclude",predicate:function(a){return function(b){return JSON.stringify(b)!==JSON.stringify(a)}}(this._currentElement)}),this.onExcludeData(this._currentElement)},_calculateLength:function(a,b,c,d){return(c-a)*(c-a)+(d-b)*(d-b)},_calculateLengthToLine:function(a,b,c,d,f,g){var h={x:c-a,y:d-b},i={x:f-a,y:g-b},j=h.x*i.x+h.y*i.y;if(0>j)return e(a,f,b,g);var k={x:a-c,y:b-d},l={x:f-c,y:g-d},m=k.x*l.x+k.y*l.y;return 0>m?e(c,f,d,g):Math.abs(((c-a)*(g-b)-(d-b)*(f-a))/e(a,c,b,d))},_generateKey:function(a){return JSON.stringify(a)},_getFields:function(a){if(this._dataFields)return this._dataFields;for(var b=[a.size&&a.size.scaleDim,a.color&&a.color.scaleDim],d=[],e=[];a=a.parentUnit;)d.push(a.x.scaleDim),e.push(a.y.scaleDim);return c.compact(b.concat(e,d).reverse())},isLine:function(a){return a.elementData.hasOwnProperty("key")&&Array.isArray(a.elementData.values)},_onElementMouseOver:function(a,b,e,f){clearTimeout(this._timeoutHideId);var g=this._generateKey(b.cellData.$where),h=b.elementData,i=this.isLine(b);if(i){var j=this._dataWithCoords[g],k=j.filter(function(a){return c.contains(h.values,a.item)}),l=c.reduce(k,function(a,b,c,d){var f;if(c+1===d.length){var g=b;b=d[c-1],f=g}else f=d[c+1];var h=this._calculateLengthToLine(b.x,b.y,f.x,f.y,e[0],e[1]);return h1&&f("i-trendline-"+e,p,i.xScale,i.yScale,i.color(g),i.container,h)});var q=function(a){return function(){var b=e.select(this);b.classed({active:a,"graphical-report__line-width-1":!a,"graphical-report__line-width-2":a})}};i.container.selectAll(".graphical-report__trendline").on("mouseenter",q(!0)).on("mouseleave",q(!1))}},containerTemplate:'
',template:d.template(['","
",'","
",'
<%= error %>
'].join("")),onRender:function(){this._container&&(this._container.innerHTML=this.template({title:"Trend line",error:this._error,showTrend:b.showTrend&&this._isApplicable?"checked":"",models:["linear","exponential","logarithmic"].map(function(a){var c=b.type===a?"selected":"";return""})}))}}}var c=function(){"use strict";var a=function(a,b){var c=0,d=0,e=0,f=0,g=0,h=a.length-1,i=new Array(b);for(c=0;h>c;c++){for(f=c,d=c+1;h>d;d++)Math.abs(a[c][d])>Math.abs(a[c][f])&&(f=d);for(e=c;h+1>e;e++)g=a[e][c],a[e][c]=a[e][f],a[e][f]=g;for(d=c+1;h>d;d++)for(e=h;e>=c;e--)a[e][d]-=a[e][c]*a[c][d]/a[c][c]}for(d=h-1;d>=0;d--){for(g=0,e=d+1;h>e;e++)g+=a[e][d]*i[e];i[d]=(a[h][d]-g)/a[d][d]}return i},b={linear:function(a){for(var b=[0,0,0,0,0],c=0,d=[];cg;g++){var i=[a[g][0],a[g][0]*e+f];d.push(i)}var j="y = "+Math.round(100*e)/100+"x + "+Math.round(100*f)/100;return{equation:[e,f],points:d,string:j}},exponential:function(a){var b=[0,0,0,0,0,0],c=0,d=[];for(i=a.length;i>c;c++)a[c][1]&&(b[0]+=a[c][0],b[1]+=a[c][1],b[2]+=a[c][0]*a[c][0]*a[c][1],b[3]+=a[c][1]*Math.log(a[c][1]),b[4]+=a[c][0]*a[c][1]*Math.log(a[c][1]),b[5]+=a[c][0]*a[c][1]);for(var e=b[1]*b[2]-b[5]*b[5],f=Math.pow(Math.E,(b[2]*b[3]-b[5]*b[4])/e),g=(b[1]*b[4]-b[5]*b[3])/e,h=0,i=a.length;i>h;h++){var j=[a[h][0],f*Math.pow(Math.E,g*a[h][0])];d.push(j)}var k="y = "+Math.round(100*f)/100+"e^("+Math.round(100*g)/100+"x)";return{equation:[f,g],points:d,string:k}},logarithmic:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=a[c][1]*Math.log(a[c][0]),b[2]+=a[c][1],b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=(b[2]-e*b[0])/c,g=0,h=a.length;h>g;g++){var i=[a[g][0],f+e*Math.log(a[g][0])];d.push(i)}var j="y = "+Math.round(100*f)/100+" + "+Math.round(100*e)/100+" ln(x)";return{equation:[f,e],points:d,string:j}},power:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=Math.log(a[c][1])*Math.log(a[c][0]),b[2]+=Math.log(a[c][1]),b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=Math.pow(Math.E,(b[2]-e*b[0])/c),g=0,h=a.length;h>g;g++){var i=[a[g][0],f*Math.pow(a[g][0],e)];d.push(i)}var j="y = "+Math.round(100*f)/100+"x^"+Math.round(100*e)/100;return{equation:[f,e],points:d,string:j}},polynomial:function(b,c){"undefined"==typeof c&&(c=2);for(var d=[],e=[],f=[],g=0,h=0,i=0,j=c+1;j>i;i++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(g+=Math.pow(b[k][0],i)*b[k][1]);d.push(g),g=0;for(var m=[],n=0;j>n;n++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(h+=Math.pow(b[k][0],i+n));m.push(h),h=0}e.push(m)}e.push(d);for(var o=a(e,j),i=0,l=b.length;l>i;i++){for(var p=0,q=0;q=0;i--)r+=i>1?Math.round(100*o[i])/100+"x^"+i+" + ":1==i?Math.round(100*o[i])/100+"x + ":Math.round(100*o[i])/100;return{equation:o,points:f,string:r}},lastvalue:function(a){for(var b=[],c=null,d=0;d0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(b,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(a,d.concat([b,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(c){if(b(r,c)){var d=r[c];delete r[c],t[c]=!0,m.apply(a,d)}if(!b(q,c)&&!b(t,c))throw new Error("No "+c);return q[c]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(c,d,e,f){var h,k,l,m,n,s,u=[],v=typeof e;if(f=f||c,"undefined"===v||"function"===v){for(d=!d.length&&e.length?["require","exports","module"]:d,n=0;n','','','<%= xTick %>',"","",""].join(""),e=a.template(d),f=document.createElement("div");f.style.position="absolute",f.style.visibility="hidden",f.style.width="100px",f.style.height="100px",f.style.border="1px solid green",document.body.appendChild(f),f.innerHTML=e({xTick:c});var g=b.select(f).selectAll(".x.axis .tick text")[0][0],h={width:0,height:0},i=g.getBoundingClientRect();h.width=i.right-i.left,h.height=i.bottom-i.top;var j=0!==c.length?h.width/c.length:0;return h.width=h.width+1.5*j,document.body.removeChild(f),h}};c.utilsDom=e}),e("dsl-reader",["exports"],function(b){var c=function(){var b=function(a,b){this.domain=a,this.UnitsRegistry=b};return b.prototype.buildGraph=function(a){var b=this,c=function(a){return b.UnitsRegistry.get(a.type).walk(b.domain.mix(a),c)};return c(a.unit)},b.prototype.calcLayout=function(a,b){a.options={top:0,left:0,width:b.width,height:b.height};var c=function(a){if(!a.$matrix)return a;var b,d=a.options,e=a.guide.padding,f=d.width-(e.l+e.r),g=d.height-(e.t+e.b),h=a.$matrix.sizeR(),i=a.$matrix.sizeC(),j=f/i,k=g/h;return b=a.guide.split?{calcHeight:function(a,b,c,d){return a/d},calcTop:function(a,b,c,d){return(b+1)*(a/d)*c}}:{calcHeight:function(a){return a},calcTop:function(a,b){return b*k}},a.childUnits=a.childUnits||[],a.$matrix.iterate(function(d,e,f){var g=f.length;f.forEach(function(f,h){f.options={width:j,left:e*j,height:b.calcHeight(k,d,h,g),top:b.calcTop(k,d,h,g)},a.childUnits.push(f),c(f)})}),a};return c(a)},b.prototype.renderGraph=function(b,c,d){var e=this,f=d||function(a){return a};b.options.container=c;var g=function(b){var c=e.domain.mix(b),d=e.UnitsRegistry.get(b.type).draw(c),h=b.childUnits||[];h.forEach(function(c){c.options=a.extend({container:d},c.options),c.parentUnit=b,g(c)}),f(c)};return b.parentUnit=null,g(b),b.options.container},b}();b.DSLReader=c}),e("const",["exports"],function(a){a.CSS_PREFIX="graphical-report__"}),e("api/balloon",["exports","../const"],function(a,b){function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){return a&&null!=a.setInterval}function e(a){var b=l.pageYOffset||o.scrollTop,e=l.pageXOffset||o.scrollLeft,f={left:0,right:0,top:0,bottom:0,width:0,height:0};if(d(a))f.width=l.innerWidth||o.clientWidth,f.height=l.innerHeight||o.clientHeight;else{if(!o.contains(a)||null==a.getBoundingClientRect)return f;c(f,a.getBoundingClientRect()),f.width=f.right-f.left,f.height=f.bottom-f.top}return f.top=f.top+b-o.clientTop,f.left=f.left+e-o.clientLeft,f.right=f.left+f.width,f.bottom=f.top+f.height,f}function f(a){return 0|Math.round(String(a).replace(/[^\-0-9.]/g,""))}function g(a){var b=String(q(a,g.propName)),c=b.match(/([0-9.]+)([ms]{1,2})/);return c&&(b=Number(c[1]),"s"===c[2]&&(b*=1e3)),0|b}function h(a,b){return this instanceof h?(this.hidden=1,this.options=c(r(h.defaults),b),this._createElement(),void this.content(a)):new h(a,b)}var i=b.CSS_PREFIX,j=function(a){return{add:function(b){a.classList.add(b)},remove:function(b){a.classList.remove(b)}}},k=function(a,b){return a.indexOf(b)},l=window,m=l.document,n=m.body,o=m.documentElement,p=["top","bottom"],q=l.getComputedStyle;g.propName=function(){for(var a=m.createElement("div"),b=["transitionDuration","webkitTransitionDuration"],c="1s",d=0;d=b.bottom&&(c[0]="top"),c[1]){case"left":a.right-this.width<=b.left&&(c[1]="right");break;case"right":a.left+this.width>=b.right&&(c[1]="left");break;default:a.left+a.width/2+this.width/2>=b.right?c[1]="left":a.right-a.width/2-this.width/2<=b.left&&(c[1]="right")}else switch(a.left-this.width-d<=b.left?c[0]="right":a.right+this.width+d>=b.right&&(c[0]="left"),c[1]){case"top":a.bottom-this.height<=b.top&&(c[1]="bottom");break;case"bottom":a.top+this.height>=b.bottom&&(c[1]="top");break;default:a.top+a.height/2+this.height/2>=b.bottom?c[1]="top":a.bottom-a.height/2-this.height/2<=b.top&&(c[1]="bottom")}return c.join("-")},h.prototype.position=function(a,b){this.attachedTo&&(a=this.attachedTo),null==a&&this._p?(a=this._p[0],b=this._p[1]):this._p=arguments;var c="number"==typeof a?{left:0|a,right:0|a,top:0|b,bottom:0|b,width:0,height:0}:e(a),d=this.spacing,f=this._pickPlace(c);f!==this.curPlace&&(this.curPlace&&this.classes.remove(this.curPlace),this.classes.add(f),this.curPlace=f);var g,h;switch(this.curPlace){case"top":g=c.top-this.height-d,h=c.left+c.width/2-this.width/2;break;case"top-left":g=c.top-this.height-d,h=c.right-this.width;break;case"top-right":g=c.top-this.height-d,h=c.left;break;case"bottom":g=c.bottom+d,h=c.left+c.width/2-this.width/2;break;case"bottom-left":g=c.bottom+d,h=c.right-this.width;break;case"bottom-right":g=c.bottom+d,h=c.left;break;case"left":g=c.top+c.height/2-this.height/2,h=c.left-this.width-d;break;case"left-top":g=c.bottom-this.height,h=c.left-this.width-d;break;case"left-bottom":g=c.top,h=c.left-this.width-d;break;case"right":g=c.top+c.height/2-this.height/2,h=c.right+d;break;case"right-top":g=c.bottom-this.height,h=c.right+d;break;case"right-bottom":g=c.top,h=c.right+d}return this.element.style.top=Math.round(g)+"px",this.element.style.left=Math.round(h)+"px",this},h.prototype.show=function(a,b){return a=this.attachedTo?this.attachedTo:a,clearTimeout(this.aIndex),null!=a&&this.position(a,b),this.hidden&&(this.hidden=0,n.appendChild(this.element)),this.attachedTo&&this._aware(),this.options.inClass&&(this.options.effectClass&&void this.element.clientHeight,this.classes.add(this.options.inClass)),this},h.prototype.getElement=function(){return this.element},h.prototype.hide=function(){if(!this.hidden){var a=this,b=0;return this.options.inClass&&(this.classes.remove(this.options.inClass),this.options.effectClass&&(b=g(this.element))),this.attachedTo&&this._unaware(),clearTimeout(this.aIndex),this.aIndex=setTimeout(function(){a.aIndex=0,n.removeChild(a.element),a.hidden=1},b),this}},h.prototype.toggle=function(a,b){return this[this.hidden?"show":"hide"](a,b)},h.prototype.destroy=function(){clearTimeout(this.aIndex),this._unaware(),this.hidden||n.removeChild(this.element),this.element=this.options=null},h.prototype._aware=function(){var a=k(h.winAware,this);~a||h.winAware.push(this)},h.prototype._unaware=function(){var a=k(h.winAware,this);~a&&h.winAware.splice(a,1)},h.reposition=function(){function a(){!c&&h.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=h.winAware.length;d>b;b++)a=h.winAware[b],a.position()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),h.winAware=[],window.addEventListener("resize",h.reposition),window.addEventListener("scroll",h.reposition),h.classTypes=["type","effect"],h.defaults={baseClass:i+"tooltip",typeClass:null,effectClass:null,inClass:"in",place:"top",spacing:null,auto:0},a.Tooltip=h}),e("event",["exports"],function(a){function b(a){var b=d[a];return b||(b=function(){for(var b,c,d=this,e=0;d=d.handler;){if(c=d.callbacks[a],"function"==typeof c){if(!b)for(b=[this],e=0;e=0?-1:1,f=d||1;d-=e*f/b}for(var g=[c,d],h=g[1]-g[0],i=Math.pow(10,Math.floor(Math.log(h/b)/Math.LN10)),j=b/h*i,k=[[.15,10],[.35,5],[.75,2],[1,1],[2,1]],l=-1;j>k[++l][0];);i*=k[l][1],g[0]=Math.floor(g[0]/i)*i,g[1]=Math.ceil(g[1]/i)*i;var m=c-g[0],n=g[1]-d,o=i/2;if(c>=0)g[0]=0;else{var p=o>=m?i:0;g[0]=g[0]-p}if(0>=d)g[1]=0;else{var q=o>=n?i:0;g[1]=g[1]+q}return[parseFloat(g[0].toFixed(15)),parseFloat(g[1].toFixed(15))]},traverseJSON:b};a.utils=c}),e("formatter-registry",["exports","d3"],function(b,c){var d=c,e={"x-num-auto":function(a){var b=parseFloat(a.toFixed(2));return Math.abs(b)<1?b.toString():d.format("s")(b)},percent:function(a){var b=parseFloat((100*a).toFixed(2));return b.toString()+"%"},day:d.time.format("%d-%b-%Y"),"day-short":d.time.format("%d-%b"),week:d.time.format("%d-%b-%Y"),"week-short":d.time.format("%d-%b"),month:function(a){var b=new Date(a),c=b.getMonth(),e=0===c?"%B, %Y":"%B";return d.time.format(e)(a)},"month-short":function(a){var b=new Date(a),c=b.getMonth(),e=0===c?"%b '%y":"%b";return d.time.format(e)(a)},"month-year":d.time.format("%B, %Y"),quarter:function(a){var b=new Date(a),c=b.getMonth(),d=(c-c%3)/3;return"Q"+(d+1)+" "+b.getFullYear()},year:d.time.format("%Y"),"x-time-auto":null},f={get:function(b,c){var f=c||"",g=function(a){return(null===a||"undefined"==typeof a?f:a).toString()},h=e.hasOwnProperty(b),i=h?e[b]:g;return h&&(i=e[b]),!h&&b&&(i=function(c){var e=a.isDate(c)?d.time.format(b):d.format(b);return e(c)}),h||b||(i=g),i},add:function(a,b){e[a]=b}};b.FormatterRegistry=f}),e("utils/utils-draw",["exports","../utils/utils","../formatter-registry","underscore","d3"],function(a,b,c,d,e){var f=(b.utils,c.FormatterRegistry),g=d,h=e,i=function(a,b){return"translate("+a+","+b+")"},j=function(a){return"rotate("+a+")"},k=function(a){return g.contains(["bottom","top"],a.toLowerCase())?"h":"v"},l=function(a,b,c){c=c||function(a){return a.node().getComputedTextLength()},a.each(function(){var a=h.select(this),d=a.text().split(/\s+/),e=!1,f=d.reduce(function(d,f,g){if(e)return d;var h=g>0?[d,f].join(" "):f,i=c(a.text(h));if(b>i)d=h;else{var j=Math.floor(b/i*h.length);d=h.substr(0,j-4)+"...",e=!0}return d},"");a.text(f)})},m=function(a,b,c,d,e,f){f=f||function(a){return a.node().getComputedTextLength()};var g=function(a,b,c,d,e,f,g){var h=g*c+f;return a.append("tspan").attr("x",d).attr("y",e).attr("dy",h+"em").text(b)};a.each(function(){var a=h.select(this),i=a.text().split(/\s+/),j=1.1,k=a.attr("x"),l=a.attr("y"),m=parseFloat(a.attr("dy"));a.text(null);var n=g(a,null,j,k,l,m,0),o=!1,p=i.length-1,q=i.reduce(function(a,d,e){if(o)return a;var g=a.length===c||e===p,h=a[a.length-1],i=""!==h?h+" "+d:d,j=f(n.text(i)),k=j>b;if(k&&g){var l=Math.floor(b/j*i.length);a[a.length-1]=i.substr(0,l-4)+"...",o=!0}return k&&!g&&a.push(d),k||(a[a.length-1]=i),a},[""]).filter(function(a){return a.length>0});l=e?-1*(q.length-1)*Math.floor(.5*d):l,q.forEach(function(b,c){return g(a,b,j,k,l,m,c)}),n.remove()})},n=function(a,b,c){var d=a.selectAll(".tick line"),e=c/d[0].length,f=e/2;if("ordinal"===b.scaleType||"period"===b.scaleType){var g="h"===k(b.guide.scaleOrient),h=g?"x":"y",i=g?f:-f;d.attr(h+"1",i).attr(h+"2",i)}},o=function(a,b){var c=k(b.guide.scaleOrient),d="h"===c?1:-1,e=a.append("text").attr("transform",j(b.guide.label.rotate)).attr("class",b.guide.label.cssClass).attr("x",d*b.guide.size*.5).attr("y",d*b.guide.label.padding).style("text-anchor",b.guide.label.textAnchor),f=" > ",g=b.guide.label.text.split(f),h=g.length;if(g.forEach(function(a,b){e.append("tspan").attr("class","label-token label-token-"+b).text(a),h-1>b&&e.append("tspan").attr("class","label-token-delimiter label-token-delimiter-"+b).text(f)}),"right"===b.guide.label.dock){var i=a.selectAll("path.domain").node().getBBox();e.attr("x","h"===c?i.width:0)}else if("left"===b.guide.label.dock){var i=a.selectAll("path.domain").node().getBBox();e.attr("x","h"===c?0:-i.height)}},p=function(a,b){var c="h"===k(b.guide.scaleOrient),d=b.guide.rotate,e=a.selectAll(".tick text");e.attr("transform",j(d)).style("text-anchor",b.guide.textAnchor),90===d&&e.attr("x",9).attr("y",0),b.guide.tickFormatWordWrap?e.call(m,b.guide.tickFormatWordWrapLimit,b.guide.tickFormatWordWrapLines,b.guide.$maxTickTextH,!c):e.call(l,b.guide.tickFormatWordWrapLimit)},q=function(a,b,c){var d=this;if(a.scaleDim){var e=h.svg.axis().scale(a.scaleObj).orient(a.guide.scaleOrient),g=f.get(a.guide.tickFormat,a.guide.tickFormatNullAlias);null!==g&&(e.ticks(Math.round(c/a.guide.density)),e.tickFormat(g));var j=d.append("g").attr("class",a.guide.cssClass).attr("transform",i.apply(null,b)).call(e);n(j,a,c),p(j,a),o(j,a)}},r=function(a,b,c){var d=this,e=d.append("g").attr("class","grid").attr("transform",i(0,0)),g=(a.guide.showGridLines||"").toLowerCase();if(g.length>0){var j=e.append("g").attr("class","grid-lines");if(g.indexOf("x")>-1&&a.x.scaleDim){var k=a.x,l=h.svg.axis().scale(k.scaleObj).orient(k.guide.scaleOrient).tickSize(b),m=f.get(k.guide.tickFormat);null!==m&&(l.ticks(Math.round(c/k.guide.density)),l.tickFormat(m));var o=j.append("g").attr("class","grid-lines-x").call(l);n(o,k,c);var p=o.select("g.tick");if(p.node()&&"translate(0,0)"!==p.attr("transform")){var q=p.node().cloneNode(!0);j.node().appendChild(q),h.select(q).attr("class","border").attr("transform",i(0,0)).select("line").attr("x1",0).attr("x2",0)}}if(g.indexOf("y")>-1&&a.y.scaleDim){var r=a.y,s=h.svg.axis().scale(r.scaleObj).orient(r.guide.scaleOrient).tickSize(-c),m=f.get(r.guide.tickFormat);null!==m&&(s.ticks(Math.round(b/r.guide.density)),s.tickFormat(m));var t=j.append("g").attr("class","grid-lines-y").call(s);n(t,r,b)}j.selectAll("text").remove()}return e},s=function(a,b,c){return a[b]=g.defaults(a[b]||{},{label:""}),a[b].label=g.isObject(a[b].label)?a[b].label:{text:a[b].label},a[b].label=g.defaults(a[b].label,c||{},{padding:32,rotate:0,textAnchor:"middle",cssClass:"label",dock:null}),a[b]},t=function(a,b,c){return a[b]=g.defaults(a[b],c||{},{padding:0,density:30,rotate:0,tickPeriod:null,tickFormat:null,autoScale:!0}),a[b].tickFormat=a[b].tickFormat||a[b].tickPeriod,a[b]},u=function(a){return a.options=a.options||{},a.guide=a.guide||{},a.guide.padding=g.defaults(a.guide.padding||{},{l:0,b:0,r:0,t:0}),a.guide.x=s(a.guide,"x"),a.guide.x=t(a.guide,"x",{cssClass:"x axis",scaleOrient:"bottom",textAnchor:"middle"}),a.guide.y=s(a.guide,"y",{rotate:-90}),a.guide.y=t(a.guide,"y",{cssClass:"y axis",scaleOrient:"left",textAnchor:"end"}),a.guide.size=s(a.guide,"size"),a.guide.color=s(a.guide,"color"),a},v={translate:i,rotate:j,getOrientation:k,fnDrawDimAxis:q,fnDrawGrid:r,applyNodeDefaults:u,cutText:l,wrapText:m};a.utilsDraw=v}),e("spec-engine-factory",["exports","./utils/utils","./utils/utils-draw","./formatter-registry","./utils/utils-dom"],function(b,c,d,e,f){function g(b,c,d,e){var f=b.hasOwnProperty(d)?b[d]:{};a.each(e,function(b){a.extend(c.guide[d][b],f[b])}),a.extend(c.guide[d],a.omit.apply(a,[f].concat[e]))}var h=c.utils,i=d.utilsDraw,j=e.FormatterRegistry,k=(f.utilsDom,function(b,c){var d=c.guide||{},e={x:["label"],y:["label"],size:["label"],color:["label"],padding:[]};return a.each(e,function(a,c){g(d,b,c,a)}),a.extend(b.guide,a.omit.apply(a,[d].concat(a.keys(e)))),b}),l=function(b,c){return b.guide=b.guide||{},b.guide.padding=b.guide.padding||{l:0,t:0,r:0,b:0},b.hasOwnProperty("unit")||(b=a.defaults(b,c),b.guide=a.defaults(b.guide,h.clone(c.guide)),b.guide.x=a.defaults(b.guide.x,h.clone(c.guide.x)),b.guide.y=a.defaults(b.guide.y,h.clone(c.guide.y))),b},m=function(a){var b=a.unit||[],c=!a.hasOwnProperty("unit"),d=!b.some(function(a){return a.hasOwnProperty("unit")});return{type:a.type,isLeaf:c,isLeafParent:!c&&d}},n=function(b,c,d,e){if(0===b.length)return{width:0,height:0};if(null===c){var f=d("TauChart Library");return f.width=.625*e,f}var g=a.max(b,function(a){return c(a).toString().length}),h=a.isNumber(g)?".00":"";return d(c(g)+h)},o=function(a,b,c){var d=a.dimType,e=a.scaleType,f="*";if("measure"===d&&"time"===e){var g=b.source.filter(function(a){return null!==a}).sort(),h=0;if(g.length>1){for(var i=1,j=g.length,k=[];j>i;)k.push(g[i]-g[i-1]),++i;var l=k.reduce(function(a,b){return a+=b},0);h=l/k.length}var m=[[31536e6,"year"],[7776e6,"quarter"],[2592e6,"month"],[6048e5,"week"],[864e5,"day"],[36e5,"hour"],[6e4,"min"],[1e3,"sec"],[0,"ms"]],n=-1;do++n;while(m[n][0]>h);f=m[n][1]}var o=[d,e,f].join(":"),p=[d,e].join(":");return c[o]||c[p]||c[d]||null},p=function(a,b,c,d,e,f){var g=b.dimension(a.x),h=b.dimension(a.y),i="measure"===g.dimType,k="measure"===h.dimType,l=c.hasOwnProperty("xDensityPadding:"+g.dimType)?c["xDensityPadding:"+g.dimType]:c.xDensityPadding,m=c.hasOwnProperty("yDensityPadding:"+h.dimType)?c["yDensityPadding:"+h.dimType]:c.yDensityPadding,p=b.scaleMeta(a.x,a.guide.x),q=p.values,r=b.scaleMeta(a.y,a.guide.y),s=r.values;a.guide.x.tickFormat=a.guide.x.tickFormat||o(g,p,c.defaultFormats),a.guide.y.tickFormat=a.guide.y.tickFormat||o(h,r,c.defaultFormats),["day","week","month"].indexOf(a.guide.x.tickFormat)>=0&&(a.guide.x.tickFormat+="-short"),["day","week","month"].indexOf(a.guide.y.tickFormat)>=0&&(a.guide.y.tickFormat+="-short");var t=0===q.length,u=0===s.length,v=n(q,j.get(a.guide.x.tickFormat,a.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),w=n(s,j.get(a.guide.y.tickFormat,a.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),x=c.xAxisPadding,y=c.yAxisPadding,z=d?!i:!1,A=e?!k:!1;a.guide.x.padding=t?0:x,a.guide.y.padding=u?0:y,a.guide.x.rotate=z?90:0,a.guide.x.textAnchor=z?"start":a.guide.x.textAnchor,a.guide.y.rotate=A?-90:0,a.guide.y.textAnchor=A?"middle":a.guide.y.textAnchor;var B=t?0:c.xTickWidth,C=u?0:c.yTickWidth;a.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,a.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var D=z?{w:v.height,h:v.width}:{h:v.height,w:v.width};if(v.width>c.xAxisTickLabelLimit){a.guide.x.tickFormatWordWrap=!0,a.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit;var E=Math.ceil(v.width/c.xAxisTickLabelLimit),F=Math.min(E,c.xTickWordWrapLinesLimit),G=F*v.height;z?(D.h=c.xAxisTickLabelLimit,D.w=G):(D.h=G,D.w=c.xAxisTickLabelLimit)}var H=A?{w:w.height,h:w.width}:{h:w.height,w:w.width};if(w.width>c.yAxisTickLabelLimit){a.guide.y.tickFormatWordWrap=!0,a.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit;var E=Math.ceil(w.width/c.yAxisTickLabelLimit),F=Math.min(E,c.yTickWordWrapLinesLimit),G=F*w.height;A?(H.w=G,H.h=c.yAxisTickLabelLimit):(H.w=c.yAxisTickLabelLimit,H.h=G)}var I=B+D.h,J=C+H.w,K=c.xFontLabelHeight,L=c.yFontLabelHeight,M=c.distToXAxisLabel,N=c.distToYAxisLabel;if(a.guide.x.density=D.w+2*l,a.guide.y.density=H.h+2*m,f){var O=(x-K)/2;a.guide.x.label.padding=0+K-M+O,a.guide.y.label.padding=0-N+O,a.guide.x.label.cssClass+=" inline",a.guide.x.label.dock="right",a.guide.x.label.textAnchor="end",a.guide.y.label.cssClass+=" inline",a.guide.y.label.dock="right",a.guide.y.label.textAnchor="end",a.guide.padding.b=x+I,a.guide.padding.l=y+J,a.guide.padding.b=a.guide.x.hide?0:a.guide.padding.b,a.guide.padding.l=a.guide.y.hide?0:a.guide.padding.l}else{a.guide.x.label.padding=+K+(a.guide.x.label.text?I+M:0),a.guide.y.label.padding=-K+(a.guide.y.label.text?J+N:0);var P=a.guide.x.label.text?a.guide.x.label.padding+K:I,Q=a.guide.y.label.text?a.guide.y.label.padding+L:J;a.guide.padding.b=x+P-B,a.guide.padding.l=y+Q,a.guide.padding.b=a.guide.x.hide?0:a.guide.padding.b,a.guide.padding.l=a.guide.y.hide?0:a.guide.padding.l}return a.guide.x.tickFontHeight=v.height,a.guide.y.tickFontHeight=w.height,a.guide.x.$minimalDomain=q.length,a.guide.y.$minimalDomain=s.length,a.guide.x.$maxTickTextW=v.width,a.guide.x.$maxTickTextH=v.height,a.guide.y.$maxTickTextW=w.width,a.guide.y.$maxTickTextH=w.height,a},q={NONE:function(a,b,c){var d=h.clone(a);return r(h.clone(d.unit),d.unit,function(a,b){return b.guide.x.tickFontHeight=c.getAxisTickLabelSize("X").height,b.guide.y.tickFontHeight=c.getAxisTickLabelSize("Y").height,b.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,b.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit,b}),d},"BUILD-LABELS":function(b){var c=h.clone(b),d=[],e=[],f=null,g=null;return h.traverseJSON(c.unit,"unit",m,function(b,c){if(b.isLeaf)return c;!f&&c.x&&(f=c),!g&&c.y&&(g=c),c.guide=c.guide||{},c.guide.x=c.guide.x||{label:""},c.guide.y=c.guide.y||{label:""},c.guide.x.label=a.isObject(c.guide.x.label)?c.guide.x.label:{text:c.guide.x.label},c.guide.y.label=a.isObject(c.guide.y.label)?c.guide.y.label:{text:c.guide.y.label},c.x&&(c.guide.x.label.text=c.guide.x.label.text||c.x),c.y&&(c.guide.y.label.text=c.guide.y.label.text||c.y);var h=c.guide.x.label.text;h&&(d.push(h),c.guide.x.tickFormatNullAlias=c.guide.x.hasOwnProperty("tickFormatNullAlias")?c.guide.x.tickFormatNullAlias:"No "+h,c.guide.x.label.text="");var i=c.guide.y.label.text;return i&&(e.push(i),c.guide.y.tickFormatNullAlias=c.guide.y.hasOwnProperty("tickFormatNullAlias")?c.guide.y.tickFormatNullAlias:"No "+i,c.guide.y.label.text=""),c}),f&&(f.guide.x.label.text=d.join(" > ")),g&&(g.guide.y.label.text=e.join(" > ")),c},"BUILD-GUIDE":function(a,b,c){var d=h.clone(a);return r(h.clone(d.unit),d.unit,function(a,d){if(a.isLeaf)return d;a.isLeafParent&&!d.guide.hasOwnProperty("showGridLines")&&(d.guide.showGridLines="xy");var e=!a.isLeaf&&!a.isLeafParent;e&&(d.guide.x.cssClass+=" facet-axis",d.guide.y.cssClass+=" facet-axis");var f=b.dimension(d.x),g=b.dimension(d.y),h="measure"===f.dimType,i="measure"===g.dimType,k=c.hasOwnProperty("xDensityPadding:"+f.dimType)?c["xDensityPadding:"+f.dimType]:c.xDensityPadding,l=c.hasOwnProperty("yDensityPadding:"+g.dimType)?c["yDensityPadding:"+g.dimType]:c.yDensityPadding,m=b.scaleMeta(d.x,d.guide.x),p=m.values,q=b.scaleMeta(d.y,d.guide.y),r=q.values;d.guide.x.tickFormat=d.guide.x.tickFormat||o(f,m,c.defaultFormats),d.guide.y.tickFormat=d.guide.y.tickFormat||o(g,q,c.defaultFormats);var s=0===p.length,t=0===r.length,u=n(p,j.get(d.guide.x.tickFormat,d.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),v=n(r,j.get(d.guide.y.tickFormat,d.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),w=a.isLeafParent?c.xAxisPadding:0,x=a.isLeafParent?c.yAxisPadding:0,y=!e&&!!f.dimType&&"measure"!==f.dimType;d.guide.x.padding=s?0:w,d.guide.y.padding=t?0:x,d.guide.x.rotate=y?90:0,d.guide.x.textAnchor=y?"start":d.guide.x.textAnchor;var z=s?0:c.xTickWidth,A=t?0:c.yTickWidth;d.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,d.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var B=y?u.width:u.height;!h&&B>c.xAxisTickLabelLimit&&(B=c.xAxisTickLabelLimit),!y&&u.width>c.xAxisTickLabelLimit&&(d.guide.x.tickFormatWordWrap=!0,d.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit,B=c.xTickWordWrapLinesLimit*u.height);var C=v.width;!i&&C>c.yAxisTickLabelLimit&&(C=c.yAxisTickLabelLimit,d.guide.y.tickFormatWordWrap=!0,d.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit);var D=z+B,E=A+C,F=c.xFontLabelHeight,G=c.yFontLabelHeight,H=c.distToXAxisLabel,I=c.distToYAxisLabel,J=Math.min(c.xAxisTickLabelLimit,y?u.height:u.width);d.guide.x.density=J+2*k;var K=Math.ceil(v.width/c.yAxisTickLabelLimit),L=Math.min(K,c.yTickWordWrapLinesLimit),M=Math.min(c.yAxisTickLabelLimit,L*v.height);d.guide.y.density=M+2*l,d.guide.x.label.padding=d.guide.x.label.text?D+H:0,d.guide.y.label.padding=d.guide.y.label.text?E+I:0;var N=d.guide.x.label.text?d.guide.x.label.padding+F:D,O=d.guide.y.label.text?d.guide.y.label.padding+G:E;return d.guide.padding.b=w+N,d.guide.padding.l=x+O,d.guide.padding.b=d.guide.x.hide?0:d.guide.padding.b,d.guide.padding.l=d.guide.y.hide?0:d.guide.padding.l,d.guide.x.tickFontHeight=u.height,d.guide.y.tickFontHeight=v.height,d.guide.x.$minimalDomain=p.length,d.guide.y.$minimalDomain=r.length,d.guide.x.$maxTickTextW=u.width,d.guide.x.$maxTickTextH=u.height,d.guide.y.$maxTickTextW=v.width,d.guide.y.$maxTickTextH=v.height,d}),d},"BUILD-COMPACT":function(b,c,d){var e=h.clone(b);return r(h.clone(e.unit),e.unit,function(b,e){return b.isLeaf?e:b.isLeafParent?(e.guide.showGridLines=e.guide.hasOwnProperty("showGridLines")?e.guide.showGridLines:"xy",p(e,c,a.defaults({xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!0,!1,!0)):(e.guide.x.cssClass+=" facet-axis compact",e.guide.y.cssClass+=" facet-axis compact",p(e,c,a.defaults({xAxisPadding:0,yAxisPadding:0,distToXAxisLabel:0,distToYAxisLabel:0,xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!1,!0,!1))}),e},"OPTIMAL-SIZE":function(a,b,c){var d=h.clone(a),e=function(a){var b;if(a.unit){var c=e(a.unit[0]),d=a.guide,f=d.x.$minimalDomain||1,g=d.y.$minimalDomain||1,h=Math.max(f*d.x.density,f*c.w),i=Math.max(g*d.y.density,g*c.h);b={w:h+d.padding.l+d.padding.r,h:i+d.padding.t+d.padding.b}}else b={w:0,h:0};return b},f=function(a,b,c,d){var e=b.guide.x.$minimalDomain||1,g=b.guide.y.$minimalDomain||1,h=c.width/e,i=c.height/g,j=a.dimension(b.x),k=a.dimension(b.y),l=d.hasOwnProperty("xDensityPadding:"+j.dimType)?d["xDensityPadding:"+j.dimType]:d.xDensityPadding,m=d.hasOwnProperty("yDensityPadding:"+k.dimType)?d["yDensityPadding:"+k.dimType]:d.yDensityPadding;if(b.guide.x.hide!==!0&&0!==b.guide.x.rotate&&h>b.guide.x.$maxTickTextW+2*l){b.guide.x.rotate=0,b.guide.x.textAnchor="middle",b.guide.x.tickFormatWordWrapLimit=h;var n=Math.min(d.xAxisTickLabelLimit,b.guide.x.$maxTickTextW),o=0-n+b.guide.x.$maxTickTextH;b.guide.padding.b+=b.guide.padding.b>0?o:0,b.guide.x.label.padding>n+d.xAxisPadding&&(b.guide.x.label.padding+=o)}b.guide.y.hide!==!0&&0!==b.guide.y.rotate&&1===b.guide.y.tickFormatWordWrapLines&&i>b.guide.y.$maxTickTextW+2*m&&(b.guide.y.tickFormatWordWrapLimit=i-2*m);var p={width:h,height:i};b.unit&&f(a,b.unit[0],p,d)},g=e(d.unit),i=g.w,j=g.h,k=c.size,l=c.scrollBarWidth,m=k.width-i,n=k.height-j,o=m>=0?k.width:i,p=n>=0?0:l,q=n>=0?k.height:j,r=m>=0?0:l;return c.size.height=q-r,c.size.width=o-p,f(b,d.unit,c.size,c),d}};q.AUTO=function(a,b,c){return["BUILD-LABELS","BUILD-GUIDE"].reduce(function(a,d){return q[d](a,b,c) +},a)},q.COMPACT=function(a,b,c){return["BUILD-LABELS","BUILD-COMPACT"].reduce(function(a,d){return q[d](a,b,c)},a)};var r=function(b,c,d){var e=i.applyNodeDefaults(c);e=d(m(e),e),e=k(e,b);var f=a.omit(e,"unit");return(e.unit||[]).forEach(function(a){return r(h.clone(a),l(a,f),d)}),e},s={get:function(a,b){var c=q[a]||q.NONE;return function(a,d){var e=c(a,d,b);return b.fitSize&&(e=q["OPTIMAL-SIZE"](e,d,b)),e}}};b.SpecEngineFactory=s}),e("matrix",["exports"],function(b){var c=function(){var b=function(b,c){var d,e=a.toArray(arguments);d=a.isArray(e[0])?e[0]:a.times(b,function(){return a.times(c,function(){return null})}),this.cube=d};return b.prototype={iterate:function(b){var c=this.cube;return a.each(c,function(c,d){a.each(c,function(a,c){b(d,c,a)})}),this},getRC:function(a,b){return this.cube[a][b]},setRC:function(a,b,c){return this.cube[a][b]=c,this},sizeR:function(){return this.cube.length},sizeC:function(){var a=this.cube[0]||[];return a.length}},b}();b.TMatrix=c}),e("layout-engine-factory",["exports","./utils/utils","./utils/utils-draw","./matrix"],function(a,b,c,d){var e=b.utils,f=c.utilsDraw,g=d.TMatrix,h=function(a,b){var c=b?b:{depth:-1,paddings:[]},d=a.guide.padding;return c.depth+=1,c.paddings.unshift({l:d.l,b:d.b,r:d.r,t:d.t}),a.unit&&a.unit.length&&h(a.unit[0],c),c},i={NONE:function(a){return a},EXTRACT:function(a){var b=function(a,c,d){var e=a,f=e.sizeR(),h=e.sizeC();e.iterate(function(a,e,i){i.forEach(function(b){return d(b,{firstRow:0===a,firstCol:0===e,lastRow:a===f-1,lastCol:e===h-1,depth:c})}),i.filter(function(a){return a.$matrix}).forEach(function(a){a.$matrix=new g(a.$matrix.cube),b(a.$matrix,c-1,d)})})},c=e.clone(a),d=new g([[[c]]]),i=h(c),j=i.paddings.reduce(function(a,b){return a.l+=b.l,a.b+=b.b,a},{l:0,b:0}),k=e.clone(j),l=i.paddings.reverse().map(function(a){return a.l=k.l-a.l,a.b=k.b-a.b,k={l:a.l,b:a.b},a});i.paddings=l.reverse();var m=10,n=f.applyNodeDefaults({type:"COORDS.RECT",options:e.clone(a.options),$matrix:new g([[[c]]]),guide:{padding:{l:j.l-m,b:j.b-m,r:0,t:0}}});return b(d,i.depth,function(a,b){var c=b.depth;a.guide.x.hide=a.guide.x.hide?a.guide.x.hide:!b.lastRow,a.guide.y.hide=a.guide.y.hide?a.guide.y.hide:!b.firstCol;var d=c>1?0:m,e=c>1?m:0;return a.guide.x.padding+=i.paddings[c].b,a.guide.y.padding+=i.paddings[c].l,a.guide.x.padding-=e,a.guide.y.padding-=e,a.guide.padding.l=d,a.guide.padding.b=d,a.guide.padding.r=d,a.guide.padding.t=d,a}),n}},j={get:function(a){return i[a]||i.NONE}};a.LayoutEngineFactory=j}),e("plugins",["exports"],function(a){var c=function(){var a=function(a,b){this.chart=b,this._plugins=a.map(this.initPlugin,this)};return a.prototype.initPlugin=function(a){var b=this;a.init&&a.init(this.chart),this.chart.on("destroy",a.destroy&&a.destroy.bind(a)||function(){}),Object.keys(a).forEach(function(c){if(0===c.indexOf("on")){var d=c.substr(2);b.chart.on(d.toLowerCase(),a[c].bind(a))}})},a}(),d=["click","mouseover","mouseout","mousemove"],e=function(a){return function(){d.forEach(function(c){this.on(c,function(d){a.fire("element"+c,{elementData:d,element:this,cellData:b.select(this.parentNode.parentNode).datum()})})},this)}};a.propagateDatumEvents=e,a.Plugins=c}),e("unit-domain-period-generator",["exports"],function(a){var b={day:{cast:function(a){return new Date(a.setHours(0,0,0,0))},next:function(a){return new Date(a.setDate(a.getDate()+1))}},week:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(a.getDate()-a.getDay()))},next:function(a){return new Date(a.setDate(a.getDate()+7))}},month:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1))},next:function(a){return new Date(a.setMonth(a.getMonth()+1))}},quarter:{cast:function(a){a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1));var b=a.getMonth(),c=b-b%3;return new Date(a.setMonth(c))},next:function(a){return new Date(a.setMonth(a.getMonth()+3))}},year:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1)),a=new Date(a.setMonth(0))},next:function(a){return new Date(a.setFullYear(a.getFullYear()+1))}}},c={add:function(a,c){return b[a.toLowerCase()]=c,this},get:function(a){return b[a.toLowerCase()]},generate:function(a,c,d){var e=[],f=b[d.toLowerCase()];if(f){var g=f.cast(new Date(c)),h=f.cast(new Date(a));for(e.push(h);(h=f.next(new Date(h)))<=g;)e.push(h)}return e}};a.UnitDomainPeriodGenerator=c}),e("size",["exports"],function(b){var c=function(a){return Math.sqrt(a)},d=function(b,d,e,f){var g=a.filter(b,a.isFinite);if(0===g.length)return function(){return f};var h=1,i=0,j=Math.min.apply(null,g),k=Math.max.apply(null,g),l=c(Math.max.apply(null,[Math.abs(j),Math.abs(k),k-j]));return i=0>j?j:0,h=0===l?1:(e-d)/l,function(b){var f=null!==b?parseFloat(b):0;if(!a.isFinite(f))return e;var g=f-i;return d+c(g)*h}};b.sizeScale=d}),e("unit-domain-mixin",["exports","./unit-domain-period-generator","./utils/utils","./size","underscore","d3"],function(a,b,c,d,e,f){var g=b.UnitDomainPeriodGenerator,h=c.utils,i=d.sizeScale,j=e,k=f,l={ordinal:function(a){return a},linear:function(a,b){var c=b.autoScale?h.autoScale(a):k.extent(a),d=j.isNumber(b.min)?b.min:c[0],e=j.isNumber(b.max)?b.max:c[1];return[Math.min(d,c[0]),Math.max(e,c[1])]},period:function(a,b){var c=k.extent(a),d=j.isNull(b.min)||j.isUndefined(b.min)?c[0]:new Date(b.min).getTime(),e=j.isNull(b.max)||j.isUndefined(b.max)?c[1]:new Date(b.max).getTime(),f=[new Date(Math.min(d,c[0])),new Date(Math.max(e,c[1]))];return g.generate(f[0],f[1],b.period)},time:function(a,b){var c=k.extent(a),d=j.isNull(b.min)||j.isUndefined(b.min)?c[0]:new Date(b.min).getTime(),e=j.isNull(b.max)||j.isUndefined(b.max)?c[1]:new Date(b.max).getTime();return[new Date(Math.min(d,c[0])),new Date(Math.max(e,c[1]))]}},m={ordinal:function(a,b){return k.scale.ordinal().domain(a).rangePoints(b,1)},linear:function(a,b){return k.scale.linear().domain(a).rangeRound(b,1)},period:function(a,b){return k.scale.ordinal().domain(a).rangePoints(b,1)},time:function(a,b){return k.time.scale().domain(a).range(b)}},n=function(){var a=function(a,b){var c=function(a){return function(b){var c=b||{};return c.hasOwnProperty(a)?c[a]:null}},d=function(b){var d=a[b]||{},e=d.value?c(d.value):function(a){return a},f=j.contains(["period","time"],d.scale);return f?j.compose(function(a){return new Date(a).getTime()},e):e},e=function(b){var c=a[b]||{};return c.order||null},f=function(a){var b={category:function(a,b,c){return c},order:function(a,b,c){var d=e(a);return d?j.union(d,c):j.sortBy(c,b)},measure:function(a,b,c){return j.sortBy(c,b)},"as-is":function(a,b,c){return c}};return b[a]||b["as-is"]},h=function(a){var b={category:f("category"),order:f("order"),measure:f("measure"),"as-is":f("as-is")};return b[a]||b["as-is"]};this.fnDimension=function(b,c){var d=(c||{}).dimensions||{},e=a[b]||{},f=d[b]||{};return{scaleDim:b,scaleType:f.scale||e.scale,dimType:f.type||e.type}},this.fnSource=function(a){var c=j.map(a,function(a,b){return function(c){return d(b)(c[b])===a}});return j(b).filter(function(a){return j.every(c,function(b){return b(a)})})};var n=function(c,e){if(!a[c])return[];var f=d(c),g=j(b).chain().pluck(c).uniq(f).value();return e(c,f,g)};this.fnDomain=function(b){var c=d(b),e=(a[b]||{}).type,g=n(b,f(e));return g.map(c)};var o=function(b,e){var f={},i=e||{};f.map=i.hasOwnProperty("map")?i.map:i.tickLabel,f.min=i.hasOwnProperty("min")?i.min:i.tickMin,f.max=i.hasOwnProperty("max")?i.max:i.tickMax,f.period=i.hasOwnProperty("period")?i.period:i.tickPeriod,f.autoScale=i.autoScale;var k=j.defaults({},a[b]),m={"order:period":function(a){return function(b){return g.get(a.period).cast(new Date(b))}},"*":function(){return function(a){return a}}},o=f.map?c(f.map):d(b),p=[k.type,k.scale].join(":"),q=(m[p]||m["*"])(f),r=n(b,h(k.type)).map(o),s=k.scale?l[k.scale](r,f):r;return{extract:function(a){return q(o(a))},values:s,source:r}};this.fnScaleMeta=o,this.fnScaleTo=function(b,c,d){var e=d||{},f=j.defaults({},a[b]),g=o(b,d),h=m[f.scale](g.values,c,e),i=function(a){return h(g.extract(a))};return Object.keys(h).forEach(function(a){return i[a]=h[a]}),i},this.fnScaleColor=function(a,b,c){var d,e=c||{},f=o(a,e),g=j.constant("color-default"),h=j.times(20,function(a){return"color20-"+(1+a)}),i=function(a,b){if(0===a.length||1===a.length&&null===a[0])return g;var c=a.map(function(a){return String(a).toString()});return k.scale.ordinal().range(b).domain(c)},l=function(a,b){var c=j.keys(a),d=j.values(a),e=k.scale.ordinal().range(d).domain(c);return function(c){return a.hasOwnProperty(c)?e(c):b(c)}},m=function(a){return function(b){return a(String(b).toString())}};if(b)if(j.isArray(b))d=m(i(f.values,b));else if(j.isFunction(b))d=function(a){return b(a,m(i(f.values,h)))};else{if(!j.isObject(b))throw new Error("This brewer is not supported");d=l(b,g)}else d=m(i(f.values,h));var n=function(a){return d(f.extract(a))};return n.get=n,n.dimension=a,n.legend=function(a){var b=f.extract(a),c=e.tickLabel?(a||{})[e.tickLabel]:b,g=d(b);return{value:b,color:g,label:c}},n},this.fnScaleSize=function(a,b,c){var d=c||{},e=b[0],f=b[1],g=b[b.length-1],h=o(a,d),j=i(h.source,e,f,g),k=function(a){return j(h.extract(a))};return k}};return a.prototype.mix=function(a){return a.dimension=this.fnDimension,a.source=this.fnSource,a.domain=this.fnDomain,a.scaleMeta=this.fnScaleMeta,a.scaleTo=this.fnScaleTo,a.scaleDist=this.fnScaleTo,a.scaleColor=this.fnScaleColor,a.scaleSize=this.fnScaleSize,a.partition=function(){return a.data||a.source(a.$where)},a.groupBy=function(b,c){var d=a.scaleMeta(c);return j.chain(b).groupBy(function(a){return d.extract(a[c])}).map(function(a){return{key:a[0][c],values:a}}).value()},a},a}();a.UnitDomainMixin=n}),e("units-registry",["exports"],function(a){var b={},c={add:function(a,c){var d={};return d.draw="function"==typeof c?c:c.draw,d.walk=c.walk||function(a){return a},b[a]=d,this},get:function(a){if(!b.hasOwnProperty(a))throw new Error("Unknown unit type: "+a);return b[a]}};a.UnitsRegistry=c}),e("data-processor",["exports","./utils/utils"],function(b,c){var d=c.utils,e={isYFunctionOfX:function(a,b,c){var d=!0,e=null;try{a.reduce(function(a,d){var f=function(a,b){return a.push(d[b]),a},g=b.reduce(f,[]).join("/"),h=c.reduce(f,[]).join("/");if(a.hasOwnProperty(g)){var i=a[g];if(i!==h)throw e={type:"RelationIsNotAFunction",keyX:b.join("/"),keyY:c.join("/"),valX:g,errY:[i,h]},new Error("RelationIsNotAFunction")}else a[g]=h;return a},{})}catch(f){if("RelationIsNotAFunction"!==f.message)throw f;d=!1}return{result:d,error:e}},excludeNullValues:function(a,b){var c=Object.keys(a).reduce(function(b,c){var d=a[c];return d.hasOwnProperty("hasNull")&&!d.hasNull||"measure"!==d.type&&"period"!==d.scale||b.push(c),b},[]);return function(a){var d=!c.some(function(b){return!(b in a)||null===a[b]});return d||b(a),d}},autoAssignScales:function(a){var b="category",c={category:"ordinal",order:"ordinal",measure:"linear"},d={};return Object.keys(a).forEach(function(e){var f=a[e],g=(f.type||b).toLowerCase();d[e]={},d[e].type=g,d[e].scale=f.scale||c[g],d[e].value=f.value}),d},autoDetectDimTypes:function(b){var c={type:"category",scale:"ordinal"},e=function(b,c){var d=c;return a.isDate(b)?(d.type="measure",d.scale="time"):a.isObject(b)?(d.type="order",d.scale="ordinal"):a.isNumber(b)&&(d.type="measure",d.scale="linear"),d},f=function(a,b){return Object.keys(b).forEach(function(f){var g=b.hasOwnProperty(f)?b[f]:null;if(a[f]=a[f]||{type:null,hasNull:!1},null===g)a[f].hasNull=!0;else{var h=e(g,d.clone(c)),i=h.type,j=h.scale,k=null!==a[f].type&&a[f].type!==i;a[f].type=k?c.type:i,a[f].scale=k?c.scale:j}}),a};return a.reduce(b,f,{})}};b.DataProcessor=e}),e("utils/layuot-template",["exports","../const"],function(a,b){var c=b.CSS_PREFIX,d=function(a,b){var d="div",e=document.createElement(d);return e.classList.add(c+a),b&&b.appendChild(e),e},e=function(){var a=d("layout"),b=d("layout__header",a),c=d("layout__container",a),e=d("layout__sidebar",c),f=d("layout__content",c),g=d("layout__content__wrap",f),h=d("layout__sidebar-right",c),i=d("layout__sidebar-right__wrap",h),j=d("layout__footer",a);return{layout:a,header:b,content:g,leftSidebar:e,rightSidebar:i,footer:j}};a.getLayout=e}),e("charts/tau.plot",["exports","../dsl-reader","../api/balloon","../event","../spec-engine-factory","../layout-engine-factory","../plugins","../utils/utils","../utils/utils-dom","../const","../unit-domain-mixin","../units-registry","../data-processor","../utils/layuot-template"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p){var q=function(a,b){a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),a.__proto__=b},r=d.DSLReader,s=e.Tooltip,t=f.Emitter,u=g.SpecEngineFactory,v=h.LayoutEngineFactory,w=i.Plugins,x=i.propagateDatumEvents,y=j.utils,z=k.utilsDom,A=l.CSS_PREFIX,B=m.UnitDomainMixin,C=n.UnitsRegistry,D=o.DataProcessor,E=p.getLayout,F=function(c){var d=function(a){c.call(this),this._svg=null,this._filtersStore={filters:{},tick:0},this._layout=E(),this.setupConfig(a),this._plugins=new w(this.config.plugins,this)};return q(d,c),d.prototype.setupConfig=function(b){if(!b.spec&&!b.spec.unit)throw new Error("Provide spec for plot");this.config=a.defaults(b,{spec:{},data:[],plugins:[],settings:{}}),this._emptyContainer=b.emptyContainer||"",this.config.settings.specEngine=this.config.specEngine||this.config.settings.specEngine,this.config.settings.layoutEngine=this.config.layoutEngine||this.config.settings.layoutEngine,this.config.settings=this.setupSettings(this.config.settings),y.isArray(this.config.settings.specEngine)||(this.config.settings.specEngine=[{width:Number.MAX_VALUE,name:this.config.settings.specEngine}]),this.config.spec.dimensions=this.setupMetaInfo(this.config.spec.dimensions,this.config.data);var c=this.config.settings.log;this.config.settings.excludeNull&&this.addFilter({tag:"default",predicate:D.excludeNullValues(this.config.spec.dimensions,function(a){c([a,"point was excluded, because it has undefined values."],"WARN")})})},d.prototype.getConfig=function(){return this.config},d.prototype.setupMetaInfo=function(a,b){var c=a?a:D.autoDetectDimTypes(b);return D.autoAssignScales(c)},d.prototype.setupSettings=function(b){var c=d.globalSettings,e={};return Object.keys(c).forEach(function(b){e[b]=a.isFunction(c[b])?c[b]:y.clone(c[b])}),a.defaults(b||{},e)},d.prototype.insertToRightSidebar=function(a){return z.appendTo(a,this._layout.rightSidebar)},d.prototype.addBalloon=function(a){return new s("",a||{})},d.prototype.renderTo=function(c,d){this._renderGraph=null,this._svg=null,this._defaultSize=a.clone(d);var e=b.select(c),f=e.node();if(this._target=c,this._targetSizes=d,null===f)throw new Error("Target element not found");f.appendChild(this._layout.layout),e=b.select(this._layout.content);var g=d||{};this._layout.content.innerHTML="",g.width&&g.height||(g=a.defaults(g,z.getContainerSize(this._layout.content.parentNode)));var h=this.getData();if(0===h.length)return void(this._layout.content.innerHTML=this._emptyContainer);this._targetSizes=g,this._layout.content.innerHTML="";var i=new B(this.config.spec.dimensions,h),j=a.find(this.config.settings.specEngine,function(a){return g.width<=a.width});this.config.settings.size=g;var k=u.get(j.name,this.config.settings),l=k(this.config.spec,i.mix({})),m=this.config.settings.size,n=new r(i,C),o=this,p=n.buildGraph(l),q=v.get(this.config.settings.layoutEngine)(p),s=n.calcLayout(q,m),t=n.renderGraph(s,e.append("svg").attr("class",A+"svg").attr("width",m.width).attr("height",m.height),function(a){return o.fire("unitready",a)});this._renderGraph=s,this._svg=t.node(),t.selectAll(".i-role-datum").call(x(this)),this._layout.rightSidebar.style.maxHeight=m.height+"px",this.fire("render",this._svg)},d.prototype.getData=function(b){b=b||{};var c=a.chain(this._filtersStore.filters).values().flatten().reject(function(c){return a.contains(b.excludeFilter,c.tag)}).pluck("predicate").value();return a.filter(this.config.data,a.reduce(c,function(a,b){return function(c){return a(c)&&b(c)}},function(){return!0}))},d.prototype.setData=function(a){this.config.data=a,this.refresh()},d.prototype.getSVG=function(){return this._svg},d.prototype.addFilter=function(a){var b=a.tag,c=this._filtersStore.filters[b]=this._filtersStore.filters[b]||[],d=this._filtersStore.tick++;return a.id=d,c.push(a),this.refresh(),d},d.prototype.removeFilter=function(b){var c=this;a.each(this._filtersStore.filters,function(d,e){c._filtersStore.filters[e]=a.reject(d,function(a){return a.id===b})}),this.refresh()},d.prototype.refresh=function(){this._target&&this.renderTo(this._target,this._defaultSize)},d.prototype.resize=function(a){void 0===a&&(a={}),this.renderTo(this._target,a)},d.prototype.select=function(a){var b=[];if(!this._renderGraph)return b;var c=function(a,b){b(a),(a.childUnits||[]).forEach(function(a){return c(a,b)})};return c(this._renderGraph,function(c){a(c)&&b.push(c)}),b},d}(t);c.Plot=F}),e("charts/tau.chart",["exports","./tau.plot","../utils/utils","../data-processor"],function(b,c,d,e){function f(a,b,c){return b.reduce(function(b,d,e){var f=a[d];return f?b.status!=o.FAIL&&("measure"===f.type&&(b.countMeasureAxis++,b.indexMeasureAxis.push(e)),"measure"!==f.type&&1===b.countMeasureAxis?b.status=o.WARNING:b.countMeasureAxis>1&&(b.status=o.FAIL,b.messages.push('There is more than one measure dimension for "'+c+'" axis'))):(b.status=o.FAIL,b.messages.push('Undefined dimension "'+d+'" for axis "'+c+'"')),b},{status:o.SUCCESS,countMeasureAxis:0,indexMeasureAxis:[],messages:[]})}function g(b,c){var d=m(c.x),e=m(c.y),g=f(c.dimensions,d,"x"),h=f(c.dimensions,e,"y");d=p[g.status](d,g),e=p[h.status](e,h);for(var i=m(c.guide),j=Math.max(d.length,e.length);i.length0;o--){var q=d.pop(),r=e.pop(),s=i.pop()||{};o===j?(k.x=q,k.y=r,k.unit.push(n(b,{x:l(q),y:l(r),color:c.color,size:c.size,flip:c.flip,colorGuide:s.color,sizeGuide:s.size})),k.guide=a.defaults(s,{x:{label:q},y:{label:r}})):k={type:"COORDS.RECT",x:l(q),y:l(r),unit:[k],guide:a.defaults(s,{x:{label:q},y:{label:r}})}}return c.spec={dimensions:c.dimensions,unit:k},c}var h=function(a,b){a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),a.__proto__=b},i=c.Plot,j=d.utils,k=e.DataProcessor,l=function(a){return a?a:null},m=function(a){return j.isArray(a)?a:[a]},n=function(a,b){return{type:a,x:b.x,y:b.y,color:b.color,guide:{color:b.colorGuide,size:b.sizeGuide},flip:b.flip,size:b.size}},o={SUCCESS:"SUCCESS",WARNING:"WARNING",FAIL:"FAIL"},p=function(b){return b[o.SUCCESS]=function(a){return a},b[o.FAIL]=function(a,b){throw new Error((b.messages||[]).join("\n")||"This configuration is not supported, See http://api.taucharts.com/basic/facet.html#easy-approach-for-creating-facet-chart")},b[o.WARNING]=function(b,c){var d=b[c.indexMeasureAxis[0]],e=a.without(b,d);return e.push(d),e},b}({}),q={scatterplot:function(a){return g("ELEMENT.POINT",a)},line:function(b){var c=b.data,d=b.settings.log,e={none:function(){return null},horizontal:function(a){var b=j.isArray(a.x)?a.x:[a.x];return b[b.length-1]},vertical:function(a){var b=j.isArray(a.y)?a.y:[a.y];return b[b.length-1]},auto:function(a){var b,e=j.isArray(a.x)?a.x:[a.x],f=j.isArray(a.y)?a.y:[a.y],g=e[e.length-1],h=e.slice(0,e.length-1),i=f[f.length-1],l=f.slice(0,f.length-1),m=a.color,n=h.concat(l).concat([m]).filter(function(a){return null!==a}),o=-1,p=[[[g].concat(n),i],[[i].concat(n),g]],q=p.some(function(a,b){var e=a[0],f=a[1],g=k.isYFunctionOfX(c,e,[f]);return g.result?o=b:d(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+g.error.keyY+" values (e.g. "+g.error.errY.join(",")+")","for ("+g.error.keyX+" = "+g.error.valX+")."].join(" ")),g.result});return q?b=p[o][0][0]:(d(["All attempts are failed.","Will orient line horizontally by default.","NOTE: the [scatterplot] chart is more convenient for that data."].join(" ")),b=g),b}},f=(b.lineOrientation||"auto").toLowerCase(),h=e.hasOwnProperty(f)?e[f]:e.auto,i=h(b);return null!==i&&(b.data=a(c).sortBy(i)),g("ELEMENT.LINE",b)},bar:function(a){return a.flip=!1,g("ELEMENT.INTERVAL",a)},horizontalBar:function(a){return a.flip=!0,g("ELEMENT.INTERVAL",a)}},r=function(b){var c=function d(c){c=a.defaults(c,{autoResize:!0}),c.autoResize&&d.winAware.push(this),c.settings=this.setupSettings(c.settings),c.dimensions=this.setupMetaInfo(c.dimensions,c.data);var e=q[c.type];if(!a.isFunction(e))throw new Error("Chart type "+c.type+" is not supported. Use one of "+a.keys(q).join(", ")+".");b.call(this,e(c))};return h(c,b),c.prototype.destroy=function(){var a=c.winAware.indexOf(this);-1!==a&&c.winAware.splice(a,1),b.prototype.destroy.call(this)},c}(i);r.resizeOnWindowEvent=function(){function a(){!c&&r.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=r.winAware.length;d>b;b++)a=r.winAware[b],a.resize()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),r.winAware=[],window.addEventListener("resize",r.resizeOnWindowEvent),b.Chart=r}),e("elements/coords",["exports","../utils/utils-draw","../const","../utils/utils","../matrix"],function(b,c,d,e,f){var g=c.utilsDraw,h=d.CSS_PREFIX,i=e.utils,j=f.TMatrix,k={CROSS:function(b,c,d,e,f){var g=0===d.length?[null]:d,h=0===f.length?[null]:f.reverse(),i=function(a){return a instanceof Date?a.getTime():a};return a(h).map(function(b){return a(g).map(function(a){var d={};return c&&(d[c]=i(a)),e&&(d[e]=i(b)),d})})}},l=function(a){return k[a]||function(){return[[{}]]}},m=function(b,c,d){var e=a.defaults(i.clone(b),a.pick.apply(a,[c].concat(d)));return e.guide=a.extend(i.clone(c.guide),e.guide),e},n={walk:function(b,c){var d=a.defaults(b,{$where:{}}),e=a.any(d.unit,function(a){return 0===a.type.indexOf("COORDS.")}),f=l(e?"CROSS":""),g=d.scaleMeta(d.x,a.omit(d.guide.x,"tickLabel")).values,h=d.scaleMeta(d.y,a.omit(d.guide.y,"tickLabel")).values,i=new j(f(d,d.x,g,d.y,h)),k=new j(i.sizeR(),i.sizeC());return i.iterate(function(b,c,e){var f=a.extend({},d.$where,e),g=a(d.unit).map(function(b){return a.extend(m(b,d,["x","y"]),{$where:f})});k.setRC(b,c,g)}),d.$matrix=k,k.iterate(function(b,d,e){a.each(e,function(a){return c(a)})}),d},draw:function(a){var b=a.options,c=a.guide.padding;a.x.guide=a.guide.x,a.y.guide=a.guide.y;var d=b.left+c.l,e=b.top+c.t,f=b.width-(c.l+c.r),i=b.height-(c.t+c.b);a.x.scaleObj=a.x.scaleDim&&a.scaleTo(a.x.scaleDim,[0,f],a.x.guide),a.y.scaleObj=a.y.scaleDim&&a.scaleTo(a.y.scaleDim,[i,0],a.y.guide),a.x.guide.size=f,a.y.guide.size=i;var j=[0,i+a.guide.x.padding],k=[0-a.guide.y.padding,0],l=b.container.append("g").attr("class",h+"cell cell").attr("transform",g.translate(d,e)).datum({$where:a.$where});return a.x.guide.hide||g.fnDrawDimAxis.call(l,a.x,j,f),a.y.guide.hide||g.fnDrawDimAxis.call(l,a.y,k,i),g.fnDrawGrid.call(l,a,i,f)}};b.coords=n}),e("utils/css-class-map",["exports","../const"],function(a,b){function c(a){return g[a-1]||g[4]}function d(a){var b=0;return a>=160&&320>a?b=1:a>=320&&480>a?b=2:a>=480&&640>a?b=3:a>=640&&(b=4),h[b]}var e=b.CSS_PREFIX,f=[1,2,3,4,5],g=f.map(function(a){return e+"line-opacity-"+a}),h=f.map(function(a){return e+"line-width-"+a});a.getLineClassesByWidth=d,a.getLineClassesByCount=c}),e("elements/line",["exports","../const","../utils/css-class-map"],function(a,c,d){var e=c.CSS_PREFIX,f=d.getLineClassesByWidth,g=d.getLineClassesByCount,h=function(a){var c=a.options,d=c.xScale,h=c.yScale,i=c.color,j=a.groupBy(a.partition(),a.color.scaleDim),k=f(c.width),l=g(j.length),m=function(){this.attr("class",function(a){return""+e+"line i-role-element i-role-datum line "+i(a.key)+" "+k+" "+l});var a=this.selectAll("path").data(function(a){return[a.values]});a.call(p),a.enter().append("path").call(p),a.exit().remove()},n=function(b){var f=function(){return this.attr("r",1.5).attr("class",function(b){return""+e+"dot-line dot-line i-role-element "+e+"dot i-role-datum "+i(b[a.color.scaleDim])}).attr("cx",function(b){return d(b[a.x.scaleDim])}).attr("cy",function(b){return h(b[a.y.scaleDim])})},g=c.container.selectAll(".dot-line").data(b);g.call(f),g.exit().remove(),g.enter().append("circle").call(f)},o=b.svg.line().x(function(b){return d(b[a.x.scaleDim])}).y(function(b){return h(b[a.y.scaleDim])}),p=function(){this.attr("d",o)},q=j.reduce(function(a,b){var c=b.values;return 1===c.length&&a.push(c[0]),a},[]);q.length>0&&n(q);var r=c.container.selectAll(".line").data(j);r.call(m),r.enter().append("g").call(m),r.exit().remove()};a.line=h}),e("elements/point",["exports","../const"],function(a,b){var c=b.CSS_PREFIX,d=function(a){var b=a.options,d=b.xScale,e=b.yScale,f=b.color,g=b.sizeScale,h=function(){return this.attr("r",function(b){return g(b[a.size.scaleDim])}).attr("cx",function(b){return d(b[a.x.scaleDim])}).attr("cy",function(b){return e(b[a.y.scaleDim])}).attr("class",function(b){return""+c+"dot dot i-role-element i-role-datum "+f(b[a.color.scaleDim])})},i=b.container.selectAll(".dot").data(a.partition());i.call(h),i.exit().remove(),i.enter().append("circle").call(h)};a.point=d}),e("elements/interval",["exports","../utils/utils-draw","../const"],function(a,b,c){var d=function(a){return Array.isArray(a)?a:Array.from(a)},e=b.utilsDraw,f=c.CSS_PREFIX,g="i-role-bar-group",h=function(a){return"measure"===a.dimType},i=function(a){var b=a.domain().length,c=a.category.length,d=a.size/b,e=d/(c+1);return{tickWidth:d,intervalWidth:e,offsetCategory:e}},j={NORM:function(a,b,c,f,g,j,k){var l=1,m=Math.min.apply(Math,d(c.domain())),n=!isNaN(m),o=!n||0>=m?0:m,p=h(a.x),q=p?j:i({domain:b.domain,category:k,size:f}),r=q.tickWidth,s=q.intervalWidth,t=q.offsetCategory,u=function(c){return b(c[a.x.scaleDim])-r/2},v=n?function(b){var d=b[a.y.scaleDim],e=c(Math.max(o,d)),f=Math.abs(c(d)-c(o)),g=l>f;return g&&d>0?e-l:e}:function(b){return c(b[a.y.scaleDim])},w=function(){return s},x=n?function(b){var d=b[a.y.scaleDim],e=Math.abs(c(d)-c(o));return 0===d?e:Math.max(l,e)}:function(b){return g-c(b[a.y.scaleDim])},y=function(a,b){return e.translate(b*t+t/2,0)};return{calculateX:u,calculateY:v,calculateWidth:w,calculateHeight:x,calculateTranslate:y}},FLIP:function(a,b,c,f,g,j,k){var l=1,m=Math.min.apply(Math,d(b.domain())),n=!isNaN(m),o=!n||0>=m?0:m,p=h(a.y),q=p?j:i({domain:c.domain,category:k,size:g}),r=q.tickWidth,s=q.intervalWidth,t=q.offsetCategory,u=n?function(c){var d=c[a.x.scaleDim],e=Math.abs(b(d)-b(o)),f=b(Math.min(o,d)),g=e-l,h=d>0?l+g:0>d?0-l:0,i=0>g;return i?f+h:f}:0,v=function(b){return c(b[a.y.scaleDim])-r/2},w=n?function(c){var d=c[a.x.scaleDim],e=Math.abs(b(d)-b(o));return 0===d?e:Math.max(l,e)}:function(c){return b(c[a.x.scaleDim])},x=function(){return s},y=function(a,b){return e.translate(0,b*t+t/2)};return{calculateX:u,calculateY:v,calculateWidth:w,calculateHeight:x,calculateTranslate:y}}},k=function(a){var b=a.options,c=b.xScale,d=b.yScale,e=b.color,h=a.groupBy(a.partition(),a.color.scaleDim),i=j[a.flip?"FLIP":"NORM"],k=a.parentUnit.parentUnit||a.parentUnit,l=i(a,c,d,b.width,b.height,{tickWidth:5,intervalWidth:5,offsetCategory:0},a.groupBy(k.partition(),a.color.scaleDim)),m=l.calculateX,n=l.calculateY,o=l.calculateWidth,p=l.calculateHeight,q=l.calculateTranslate,r=function(){return this.attr("height",p).attr("width",o).attr("class",function(b){return"i-role-element i-role-datum bar "+f+"bar "+e(b[a.color.scaleDim])}).attr("x",m).attr("y",n)},s=function(){this.attr("class",g).attr("transform",q);var a=this.selectAll("bar").data(function(a){return a.values});a.call(r),a.enter().append("rect").call(r),a.exit().remove()},t=b.container.selectAll("."+g).data(h);t.call(s),t.enter().append("g").call(s),t.exit().remove()};a.interval=k}),e("elements/coords-parallel",["exports","../utils/utils-draw","../const","../utils/utils","../matrix"],function(c,d,e,f,g){var h=d.utilsDraw,i=(e.CSS_PREFIX,f.utils),j=g.TMatrix,k=function(b,c,d){var e=a.defaults(i.clone(b),a.pick.apply(a,[c].concat(d)));return e.guide=a.extend(i.clone(c.guide||{}),e.guide||{}),e},l={walk:function(b,c){var d=a.defaults(b,{$where:{}}),e=new j(1,1),f=new j(1,1);return e.iterate(function(b,c){var e=a.extend({},d.$where),g=a(d.unit).map(function(b){return a.extend(k(b,d,["x"]),{$where:e})});f.setRC(b,c,g)}),d.$matrix=f,f.iterate(function(b,d,e){a.each(e,function(a){return c(a)})}),d},draw:function(a){var c=a.options,d=a.guide.padding,e=c.left+d.l,f=c.top+d.t,g=c.width-(d.l+d.r),i=c.height-(d.t+d.b),j=a.x.map(function(b){return a.scaleTo(b,[i,0],{})}),k=c.container.append("g").attr("class","graphical-report__cell cell").attr("transform",h.translate(e,f)),l=function(a,b){return"translate("+a+","+b+")"},m=function(a){return"rotate("+a+")"},n=function(a,c){var d=this,e=b.svg.axis().scale(a).orient("left"),f=d.append("g").attr("class","y axis").attr("transform",l.apply(null,c)).call(e);f.selectAll(".tick text").attr("transform",m(0)).style("text-anchor","end")},o=g/(a.x.length-1);return j.forEach(function(a,b){n.call(k,a,[b*o,0])}),k.append("g").attr("class","grid").attr("transform",l(0,0))}};c.CoordsParallel=l}),e("elements/coords-parallel-line",["exports","../utils/utils-draw","../const"],function(a,c,d){var e=(c.utilsDraw,d.CSS_PREFIX,{draw:function(a){a.color=a.dimension(a.color,a);var c=a.guide.color||{},d=a.scaleColor(a.color.scaleDim,c.brewer,c),e=a.options,f=a.x.reduce(function(b,c){return b[c]=a.scaleTo(c,[e.height,0],{}),b},{}),g=b.nest().key(function(a){return a[d.dimension]}).entries(a.partition()).map(function(b){var c=b.values[0],d=[];return a.x.forEach(function(a){d.push({key:a,val:c[a]})}),d}),h=function(){this.attr("class",function(){return"graphical-report__line line color20-9"});var a=this.selectAll("path").data(function(a){return[a]});a.call(l),a.enter().append("path").call(l),a.exit().remove()},i=e.width/(a.x.length-1),j={};a.x.forEach(function(a,b){j[a]=b*i});var k=b.svg.line().x(function(a){return j[a.key]}).y(function(a){return f[a.key](a.val)}),l=function(){this.attr("d",k)},m=e.container.selectAll(".line").data(g);m.call(h),m.enter().append("g").call(h),m.exit().remove()}});a.CoordsParallelLine=e}),e("node-map",["exports","./elements/coords","./elements/line","./elements/point","./elements/interval","./utils/utils-draw","./elements/coords-parallel","./elements/coords-parallel-line"],function(b,c,d,e,f,g,h,i){var j=c.coords,k=d.line,l=e.point,m=f.interval,n=(g.utilsDraw,h.CoordsParallel),o=i.CoordsParallelLine,p=function(b,c){c.forEach(function(a){b[a]=b.dimension(b[a],b)});var d=b.options,e=d.width,f=d.height;b.x.guide=b.guide.x,b.y.guide=b.guide.y,b.options.xScale=b.x.scaleDim&&b.scaleTo(b.x.scaleDim,[0,e],b.x.guide),b.options.yScale=b.y.scaleDim&&b.scaleTo(b.y.scaleDim,[f,0],b.y.guide);var g=b.guide.color||{};if(b.options.color=b.scaleColor(b.color.scaleDim,g.brewer,g),b.size){var h=.5*a.min([b.guide.x.tickFontHeight,b.guide.y.tickFontHeight].filter(function(a){return 0!==a})),i=.5*a.min([b.guide.x.density,b.guide.y.density].filter(function(a){return 0!==a})),j=b.guide.size||{};b.options.sizeScale=b.scaleSize(b.size.scaleDim,[2,i,h],j)}return b},q={"COORDS.RECT":{walk:j.walk,draw:function(a,b){return a.x=a.dimension(a.x,a),a.y=a.dimension(a.y,a),j.draw(a,b)}},"ELEMENT.POINT":function(a){return l(p(a,["x","y","color","size"]))},"ELEMENT.LINE":function(a){return k(p(a,["x","y","color"]))},"ELEMENT.INTERVAL":function(a){return m(p(a,["x","y","color"]))},"COORDS.PARALLEL":n,"PARALLEL/ELEMENT.LINE":o};b.nodeMap=q}),e("tau.newCharts",["exports","./utils/utils-dom","./charts/tau.plot","./charts/tau.chart","./unit-domain-mixin","./unit-domain-period-generator","./dsl-reader","./spec-engine-factory","./layout-engine-factory","./formatter-registry","./node-map","./units-registry"],function(c,d,e,f,g,h,i,j,k,l,m,n){var o=d.utilsDom,p=e.Plot,q=f.Chart,r=g.UnitDomainMixin,s=h.UnitDomainPeriodGenerator,t=i.DSLReader,u=j.SpecEngineFactory,v=k.LayoutEngineFactory,w=l.FormatterRegistry,x=m.nodeMap,y=n.UnitsRegistry,z={},A={},B={UnitDomainMixin:r,UnitDomainPeriodGenerator:s,DSLReader:t,SpecEngineFactory:u,LayoutEngineFactory:v},C={UnitsRegistry:y,tickFormat:w,d3:b,_:a,tickPeriod:s,colorBrewers:{add:function(a,b){a in z||(z[a]=b) +},get:function(a){return z[a]}},plugins:{add:function(a,b){if(a in A)throw new Error("Plugins is already registred.");A[a]=b},get:function(a){return A[a]}},globalSettings:{log:function(a,b){b=b||"INFO",Array.isArray(a)||(a=[a]),console[b.toLowerCase()].apply(console,a)},excludeNull:!0,specEngine:[{name:"COMPACT",width:600},{name:"AUTO",width:Number.MAX_VALUE}],fitSize:!0,layoutEngine:"EXTRACT",getAxisTickLabelSize:o.getAxisTickLabelSize,scrollBarWidth:o.getScrollbarWidth(),xAxisTickLabelLimit:100,yAxisTickLabelLimit:100,xTickWordWrapLinesLimit:2,yTickWordWrapLinesLimit:2,xTickWidth:9,yTickWidth:9,distToXAxisLabel:20,distToYAxisLabel:20,xAxisPadding:20,yAxisPadding:20,xFontLabelHeight:10,yFontLabelHeight:10,xDensityPadding:4,yDensityPadding:4,"xDensityPadding:measure":8,"yDensityPadding:measure":8,defaultFormats:{measure:"x-num-auto","measure:time":"x-time-auto","measure:time:year":"year","measure:time:quarter":"quarter","measure:time:month":"month","measure:time:week":"x-time-auto","measure:time:day":"x-time-auto","measure:time:hour":"x-time-auto","measure:time:min":"x-time-auto","measure:time:sec":"x-time-auto","measure:time:ms":"x-time-auto"}}};p.globalSettings=C.globalSettings,C.UnitsRegistry.add("COORDS.PARALLEL",x["COORDS.PARALLEL"]).add("PARALLEL/ELEMENT.LINE",x["PARALLEL/ELEMENT.LINE"]).add("COORDS.RECT",x["COORDS.RECT"]).add("ELEMENT.POINT",x["ELEMENT.POINT"]).add("ELEMENT.LINE",x["ELEMENT.LINE"]).add("ELEMENT.INTERVAL",x["ELEMENT.INTERVAL"]),c.Plot=p,c.Chart=q,c.__api__=B,c.api=C}),e("underscore",function(){return a}),e("d3",function(){return b}),d("tau.newCharts")}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){var b={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},c=function(a,c){return b[a][c].map(function(b,d){return a+" q"+d+"-"+c})};return a.api.colorBrewers.add("tauBrewer",c),c}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){var b=function(a){if(a.color)return a;var c,d,e,f=a.unit||[];for(c=0;c',_template:c.template('
<%=name%>
<%=items%>'),_itemTemplate:c.template(["
\">",'
<%=label%>',"
"].join("")),onRender:function(a){if(this._container){var d=this._unit.options.color,f=this._unit.color.scaleDim,g=a.getConfig(),h=b(g.spec.unit);h.guide=h.guide||{},h.guide.color=this._unit.guide.color;var i=h.guide.color.label.text||d.dimension,j=this._getColorMap(a.getData({excludeFilter:["legend"]}),d,f);h.guide.color.brewer=j.brewer;var k=c.reduce(j.values,function(a,b){var d={dimension:f,value:b.value,color:b.color},g=JSON.stringify(d),h=c.escape(e(b.label)?"No "+i:b.label);return a.items.push(this._itemTemplate({color:b.color,classDisabled:this._currentFilters[g]?"disabled":"",label:h,value:c.escape(g)})),a.storageValues[g]=d,a},{items:[],storageValues:{}},this);this._storageValues=k.storageValues,this._container.innerHTML=this._template({items:k.items.join(""),name:i})}}}};return a.api.plugins.add("legend",f),f}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(b){return b=b||{},{template:['
','
','
','Exclude',"
","
"].join(""),itemTemplate:['
','
<%=label%>
','
<%=value%>
',"
"].join(""),onExcludeData:function(){},_drawPoint:function(a,b,c,d){this.circle&&this.circle.remove(),this.circle=a.append("circle").attr("cx",b).attr("cy",c).attr("class",d).attr("r",4),this.circle.node().addEventListener("mouseover",function(){clearTimeout(this._timeoutHideId)}.bind(this),!1),this.circle.node().addEventListener("mouseleave",function(){this._hide()}.bind(this),!1)},formatters:{},labels:{},init:function(a){this._chart=a,this._dataFields=b.fields,this._getDataFields=b.getFields,c.extend(this,c.omit(b,"fields","getFields")),this._timeoutHideId=null,this._dataWithCoords={},this._unitMeta={},this._templateItem=c.template(this.itemTemplate),this._tooltip=a.addBalloon({spacing:3,auto:!0,effectClass:"fade"}),this._elementTooltip=this._tooltip.getElement();var d=a.getConfig().spec,e=this._findDimensionGuides(d),f=c.reduce(e,function(a,b,d){return a[d]=c.last(b),a},{}),g=this._generateDefaultFormatters(f,d.dimensions);c.extend(this.formatters,g);var h=this._generateDefaultLabels(f);c.extend(this.labels,h);var i=this._elementTooltip;i.addEventListener("mouseover",function(){clearTimeout(this._timeoutHideId)}.bind(this),!1),i.addEventListener("mouseleave",function(){this._hide()}.bind(this),!1),i.addEventListener("click",function(a){for(var b=a.target;b!==a.currentTarget&&null!==b;)b.classList.contains("i-role-exclude")&&(this._exclude(),this._hide()),b=b.parentNode}.bind(this),!1),i.insertAdjacentHTML("afterbegin",this.template),this.afterInit(this._elementTooltip)},afterInit:function(){},onUnitReady:function(a,b){if(b.type&&0===b.type.indexOf("ELEMENT")){var c=this._generateKey(b.$where);this._unitMeta[c]=b;var d=b.partition();this._dataWithCoords[c]=d.map(function(a){return{x:b.options.xScale(a[b.x.scaleDim]),y:b.options.yScale(a[b.y.scaleDim]),item:a}},this)}},renderItem:function(a,b){return this._templateItem({label:a,value:b})},render:function(a,b){return b=c.unique(b),b.map(function(b){var c=a[b],d=this._getFormatter(b)(c),e=this._getLabel(b);return this.renderItem(e,d,b,c)},this).join("")},afterRender:function(){},onRender:function(a){c.isFunction(this._getDataFields)&&(this._dataFields=this._getDataFields(a)),this._hide()},_getFormatter:function(a){return this.formatters[a]||c.identity},_getLabel:function(a){return this.labels[a]||a},_generateDefaultLabels:function(a){return c.reduce(a,function(a,b,c){return a[c]=b.label||c,a},{})},_generateDefaultFormatters:function(b,d){return c.reduce(b,function(b,c,e){var f=function(b){if(null==b)return null;var f=c.tickPeriod||c.tickFormat;return f?a.api.tickFormat.get(f)(b):c.tickLabel?b[c.tickLabel]:d[e].value?b[d[e].value]:b};return b[e]=function(a){var b=f(a);return null==b?"No "+c.label:b},b},{})},_findDimensionGuides:function(a){var b={},c=function(a,c){var d=c[a];if(d){var e=(c.guide||{})[a];e&&(b[d]||(b[d]=[]),b[d].push(e))}};return f(a.unit,function(a){return c("x",a),c("y",a),c("color",a),c("size",a),!1}),b},_exclude:function(){this._chart.addFilter({tag:"exclude",predicate:function(a){return function(b){return JSON.stringify(b)!==JSON.stringify(a)}}(this._currentElement)}),this.onExcludeData(this._currentElement)},_calculateLength:function(a,b,c,d){return(c-a)*(c-a)+(d-b)*(d-b)},_calculateLengthToLine:function(a,b,c,d,f,g){var h={x:c-a,y:d-b},i={x:f-a,y:g-b},j=h.x*i.x+h.y*i.y;if(0>j)return e(a,f,b,g);var k={x:a-c,y:b-d},l={x:f-c,y:g-d},m=k.x*l.x+k.y*l.y;return 0>m?e(c,f,d,g):Math.abs(((c-a)*(g-b)-(d-b)*(f-a))/e(a,c,b,d))},_generateKey:function(a){return JSON.stringify(a)},_getFields:function(a){if(this._dataFields)return this._dataFields;for(var b=[a.size&&a.size.scaleDim,a.color&&a.color.scaleDim],d=[],e=[];a=a.parentUnit;)d.push(a.x.scaleDim),e.push(a.y.scaleDim);return c.compact(b.concat(e,d).reverse())},isLine:function(a){return a.elementData.hasOwnProperty("key")&&Array.isArray(a.elementData.values)},_onElementMouseOver:function(a,b,e,f){clearTimeout(this._timeoutHideId);var g=this._generateKey(b.cellData.$where),h=b.elementData,i=this.isLine(b);if(i){var j=this._dataWithCoords[g],k=j.filter(function(a){return c.contains(h.values,a.item)}),l=c.reduce(k,function(a,b,c,d){var f;if(c+1===d.length){var g=b;b=d[c-1],f=g}else f=d[c+1];var h=this._calculateLengthToLine(b.x,b.y,f.x,f.y,e[0],e[1]);return h1&&f("i-trendline-"+e,p,i.xScale,i.yScale,i.color(g),i.container,h)});var q=function(a){return function(){var b=e.select(this);b.classed({active:a,"graphical-report__line-width-1":!a,"graphical-report__line-width-2":a})}};i.container.selectAll(".graphical-report__trendline").on("mouseenter",q(!0)).on("mouseleave",q(!1))}},containerTemplate:'
',template:d.template(['","
",'","
",'
<%= error %>
'].join("")),onRender:function(){this._container&&(this._container.innerHTML=this.template({title:"Trend line",error:this._error,showTrend:b.showTrend&&this._isApplicable?"checked":"",models:["linear","exponential","logarithmic"].map(function(a){var c=b.type===a?"selected":"";return""})}))}}}var c=function(){"use strict";var a=function(a,b){var c=0,d=0,e=0,f=0,g=0,h=a.length-1,i=new Array(b);for(c=0;h>c;c++){for(f=c,d=c+1;h>d;d++)Math.abs(a[c][d])>Math.abs(a[c][f])&&(f=d);for(e=c;h+1>e;e++)g=a[e][c],a[e][c]=a[e][f],a[e][f]=g;for(d=c+1;h>d;d++)for(e=h;e>=c;e--)a[e][d]-=a[e][c]*a[c][d]/a[c][c]}for(d=h-1;d>=0;d--){for(g=0,e=d+1;h>e;e++)g+=a[e][d]*i[e];i[d]=(a[h][d]-g)/a[d][d]}return i},b={linear:function(a){for(var b=[0,0,0,0,0],c=0,d=[];cg;g++){var i=[a[g][0],a[g][0]*e+f];d.push(i)}var j="y = "+Math.round(100*e)/100+"x + "+Math.round(100*f)/100;return{equation:[e,f],points:d,string:j}},exponential:function(a){var b=[0,0,0,0,0,0],c=0,d=[];for(i=a.length;i>c;c++)a[c][1]&&(b[0]+=a[c][0],b[1]+=a[c][1],b[2]+=a[c][0]*a[c][0]*a[c][1],b[3]+=a[c][1]*Math.log(a[c][1]),b[4]+=a[c][0]*a[c][1]*Math.log(a[c][1]),b[5]+=a[c][0]*a[c][1]);for(var e=b[1]*b[2]-b[5]*b[5],f=Math.pow(Math.E,(b[2]*b[3]-b[5]*b[4])/e),g=(b[1]*b[4]-b[5]*b[3])/e,h=0,i=a.length;i>h;h++){var j=[a[h][0],f*Math.pow(Math.E,g*a[h][0])];d.push(j)}var k="y = "+Math.round(100*f)/100+"e^("+Math.round(100*g)/100+"x)";return{equation:[f,g],points:d,string:k}},logarithmic:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=a[c][1]*Math.log(a[c][0]),b[2]+=a[c][1],b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=(b[2]-e*b[0])/c,g=0,h=a.length;h>g;g++){var i=[a[g][0],f+e*Math.log(a[g][0])];d.push(i)}var j="y = "+Math.round(100*f)/100+" + "+Math.round(100*e)/100+" ln(x)";return{equation:[f,e],points:d,string:j}},power:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=Math.log(a[c][1])*Math.log(a[c][0]),b[2]+=Math.log(a[c][1]),b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=Math.pow(Math.E,(b[2]-e*b[0])/c),g=0,h=a.length;h>g;g++){var i=[a[g][0],f*Math.pow(a[g][0],e)];d.push(i)}var j="y = "+Math.round(100*f)/100+"x^"+Math.round(100*e)/100;return{equation:[f,e],points:d,string:j}},polynomial:function(b,c){"undefined"==typeof c&&(c=2);for(var d=[],e=[],f=[],g=0,h=0,i=0,j=c+1;j>i;i++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(g+=Math.pow(b[k][0],i)*b[k][1]);d.push(g),g=0;for(var m=[],n=0;j>n;n++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(h+=Math.pow(b[k][0],i+n));m.push(h),h=0}e.push(m)}e.push(d);for(var o=a(e,j),i=0,l=b.length;l>i;i++){for(var p=0,q=0;q=0;i--)r+=i>1?Math.round(100*o[i])/100+"x^"+i+" + ":1==i?Math.round(100*o[i])/100+"x + ":Math.round(100*o[i])/100;return{equation:o,points:f,string:r}},lastvalue:function(a){for(var b=[],c=null,d=0;d