diff --git a/build/development/tauCharts.js b/build/development/tauCharts.js index bd207cbc7..d801f0a3a 100644 --- a/build/development/tauCharts.js +++ b/build/development/tauCharts.js @@ -4656,6 +4656,7 @@ define('spec-transform-auto-layout',['exports', 'underscore', './utils/utils', ' // facet level unit.guide.x.cssClass += ' facet-axis compact'; + unit.guide.x.avoidCollisions = true; unit.guide.y.cssClass += ' facet-axis compact'; return calcUnitGuide(unit, meta, _2['default'].defaults({ diff --git a/build/production/tauCharts.min.js b/build/production/tauCharts.min.js index b855b3d0b..f1cb10241 100644 --- a/build/production/tauCharts.min.js +++ b/build/production/tauCharts.min.js @@ -2,11 +2,11 @@ * 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"),d=require("d3");module.exports=b(c,d)}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(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).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("const",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b="graphical-report__";a.CSS_PREFIX=b}),e("elements/element.point",["exports","../const"],function(b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c=160&&320>a?b=1:a>=320&&480>a?b=2:a>=480&&640>a?b=3:a>=640&&(b=4),g[b]}Object.defineProperty(a,"__esModule",{value:!0});var e=[1,2,3,4,5],f=e.map(function(a){return b.CSS_PREFIX+"line-opacity-"+a}),g=e.map(function(a){return b.CSS_PREFIX+"line-width-"+a});a.getLineClassesByWidth=d,a.getLineClassesByCount=c}),e("elements/element.line",["exports","../const","../utils/css-class-map"],function(c,d,e){"use strict";function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var g=function(){function a(a,b){for(var c=0;c1}),t("anch","anch-"+f.uid,function(a){var b=a.data;return b.data.length<2})}}]),c}();c.Line=h}),e("elements/element.interval",["exports","../const"],function(b,c){"use strict";function d(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);bc;return d&&b[e.dim]>0?o-n:o}return o},height:function(a){var b=a.data,c=l(b);if(h){var d=b[e.dim];return 0===d?c:Math.max(n,c)}return c},width:function(a){var b=a.data;return m(b)},"class":function(a){var d=a.data;return"i-role-element i-role-datum bar "+c.CSS_PREFIX+"bar "+b(d[b.dim])}}}},{key:"_buildHorizontalDrawMethod",value:function(a){var b=a.colorScale,d=a.xScale,e=a.yScale,f=a.colorIndexScale,g=(a.width,a.height,a.prettify),h=this._buildDrawMethod({baseScale:e,valsScale:d,colorIndexScale:f,defaultBaseAbsPosition:0}),i=h.calculateBarX,j=h.calculateBarY,k=h.calculateBarH,l=h.calculateBarW,m=1;return{y:function(a){var b=a.data;return i(b)},x:function n(a){var b=a.data,n=j(b);if(g){var c=k(b),e=b[d.dim],f=0;0===e&&(f=0),e>0&&(f=c),0>e&&(f=0-m);var h=m>c;return h?n+f:n}return n},height:function(a){var b=a.data;return l(b)},width:function(a){var b=a.data,c=k(b);if(g){var e=b[d.dim];return 0===e?c:Math.max(m,c)}return c},"class":function(a){var d=a.data;return"i-role-element i-role-datum bar "+c.CSS_PREFIX+"bar "+b(d[b.dim])}}}},{key:"_buildDrawMethod",value:function(a){var b=a.valsScale,c=a.baseScale,e=a.colorIndexScale,f=a.defaultBaseAbsPosition,g=5,h=1,i=function(){var a=Math.min.apply(Math,d(b.domain())),c=!isNaN(a);return c?b(0>=a?0:a):f}(),j=function(a){return c.stepSize(a[c.dim])*e.koeff||g},k=function(a){return a>2*h?h:0},l=function(a){return 0===c.stepSize(a[c.dim])?0:j(a)},m=function(a){var b=j(a),c=k(b);return b-2*c},n=function(a){return Math.abs(b(a[b.dim])-i)},o=function(a){var b=a[c.dim],d=c(b)-c.stepSize(b)/2,f=d-m(a)/2,g=(e(a)+1)*l(a);return f+g},p=function(a){return Math.min(i,b(a[b.dim]))};return{calculateBarX:o,calculateBarY:p,calculateBarH:n,calculateBarW:m}}}]),b}();b.Interval=g}),e("error",["exports"],function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function c(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)}Object.defineProperty(a,"__esModule",{value:!0});var d=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;h=j=i=void 0,d=!1;var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;return void 0===i?void 0:i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return void 0;a=j,b=f,c=g,d=!0}},e=function(a){function e(a,c){b(this,e),d(Object.getPrototypeOf(e.prototype),"constructor",this).call(this),this.name="TauChartError",this.message=a,this.errorCode=c}return c(e,a),e}(Error),f={INVALID_DATA_TO_STACKED_BAR_CHART:"INVALID_DATA_TO_STACKED_BAR_CHART",NO_DATA:"NO_DATA",NOT_SUPPORTED_TYPE_CHART:"NOT_SUPPORTED_TYPE_CHART",UNKNOWN_UNIT_TYPE:"UNKNOWN_UNIT_TYPE"};a.TauChartError=e,a.errorCodes=f}),e("elements/element.interval.stacked",["exports","underscore","./../const","./../error"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);bc)throw new d.TauChartError("Stacked field ["+l+"] should be a non-negative number",d.errorCodes.INVALID_DATA_TO_STACKED_BAR_CHART);var e=b[k];return a[e]=a[e]||0,a[e]+=c,a},a)},{}),n=Math.max.apply(Math,f(i["default"].values(m)));(!h.hasOwnProperty("max")||h.maxd;d++)if(b[d][0]===a)return b[d][1];return void 0},deepCopy:function(a){if(null===a)return null;if("object"!=typeof a)return a;var b=this.getCachedResult(a);if(b)return b;for(var c=0;cthis.maxDepth)throw new Error("Exceeded max recursion depth in deep copy.");return a.populate(this.recursiveDeepCopy,b,c),this.depth--,c}},d.DeepCopier=b,d.deepCopiers=e,d.register=function(a){a instanceof b||(a=new b(a)),e.unshift(a)},d.register({canCopy:function(){return!0},create:function(b){return b instanceof b.constructor?a(b.constructor.prototype):{}},populate:function(a,b,c){for(var d in b)b.hasOwnProperty(d)&&(c[d]=a(b[d]));return c}}),d.register({canCopy:function(a){return a instanceof Array},create:function(a){return new a.constructor},populate:function(a,b,c){for(var d=0;d=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:g,generateHash:function(a){var b=btoa(encodeURIComponent(a)).replace(/=/g,"_");return j.hasOwnProperty(b)||(j[b]="H"+ ++i),j[b]},generateRatioFunction:function(b,c,d){var e=function(a){return a instanceof Date?a.getTime():a},f=0,g=null,h=a.memoize(function(b,c){return a(b).chain().map(function(a){return c.reduce(function(b,c){return b.concat(e(a[c]))},[])}).uniq(function(a){return JSON.stringify(a)}).reduce(function(a,b){var c=b[0];return a[c]=a[c]||0,a[c]+=1,a},{}).value()},function(a,b){var c=g===a?f:++f;return g=a,""+b.join("")+"-"+c});return function(e,f,g){var i=g.length,j=d.getSpec(),k=j.sources["/"].data,l=j.unit.units[0].guide||{};l.padding=l.padding||{l:0,r:0,t:0,b:0};var m=0;"x"===b?m=l.padding.l+l.padding.r:"y"===b&&(m=l.padding.t+l.padding.b);var n=function(b){return a.values(h(k,b)).reduce(function(a,b){return a+b},0)},o=function(a,b){return h(k,a)[b]},p=n(c),q=(f-i*m)/p,r=o(c,e);return(r*q+m)/f}},traverseSpec:h,isSpecRectCoordsOnly:function(a){var b=!0;try{m.traverseSpec(a,function(a){if(0===a.type.indexOf("COORDS.")&&"COORDS.RECT"!==a.type)throw new Error("Not applicable")},function(a){return a})}catch(c){"Not applicable"===c.message&&(b=!1)}return b}};b.utils=m}),e("event",["exports"],function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function c(a){var b=f[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=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,m.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(a,b){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,m.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||m.removeChild(this.element),this.element=this.options=null},h.prototype._aware=function(){var a=j(h.winAware,this);-1===a&&h.winAware.push(this)},h.prototype._unaware=function(){var a=j(h.winAware,this);-1!==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:b.CSS_PREFIX+"tooltip",typeClass:null,effectClass:null,inClass:"in",place:"top",spacing:null,auto:0},a.Tooltip=h}),e("plugins",["exports","d3","./utils/utils"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c=0&&(a[b]=new Date(a[b])),a},b)})}},{key:"ruleAssignSourceDims",value:function(a,b){var c=a.spec.dimensions;b.sources["/"].dims=Object.keys(c).reduce(function(a,b){return a[b]={type:c[b].type},a},{})}},{key:"ruleAssignStructure",value:function(a,b){var d=this,e=function h(a){var b=c.utils.clone(g["default"].omit(a,"unit"));return b.expression=d.ruleInferExpression(a),d.ruleCreateScales(a,b),a.unit&&(b.units=a.unit.map(h)),b},f=e(a.spec.unit);f.expression.inherit=!1,b.unit=f}},{key:"ruleCreateScales",value:function(a,b){var c=this,d=a.guide||{};["color","size","x","y"].forEach(function(e){a.hasOwnProperty(e)&&(b[e]=c.scalesPool(e,a[e],d[e]||{}))})}},{key:"ruleInferDim",value:function(a,b){var c=a,d=this.spec.spec.dimensions;if(!d.hasOwnProperty(c))return c;b.hasOwnProperty("tickLabel")?c=""+a+"."+b.tickLabel:d[a].value&&(c=""+a+"."+d[a].value);var e=this.dist.sources["/"].dims;return e.hasOwnProperty(c)||(e[c]={type:e[a].type}),c}},{key:"scalesPool",value:function(a,b,c){var d=""+a+"_"+b;if(this.dist.scales.hasOwnProperty(d))return d;var e=this.spec.spec.dimensions,f={};return"color"===a&&null!==b&&(f={type:"color",source:"/",dim:this.ruleInferDim(b,c)},c.hasOwnProperty("brewer")&&(f.brewer=c.brewer)),"size"===a&&null!==b&&(f={type:"size",source:"/",dim:this.ruleInferDim(b,c),min:2,max:10,mid:5}),!e.hasOwnProperty(b)||"x"!==a&&"y"!==a||(f={type:e[b].scale,source:"/",dim:this.ruleInferDim(b,c)},e[b].hasOwnProperty("order")&&(f.order=e[b].order),c.hasOwnProperty("min")&&(f.min=c.min),c.hasOwnProperty("max")&&(f.max=c.max),c.hasOwnProperty("autoScale")?f.autoScale=c.autoScale:f.autoScale=!0,c.hasOwnProperty("tickPeriod")&&(f.period=c.tickPeriod),f.fitToFrameByDims=c.fitToFrameByDims,f.ratio=c.ratio),this.dist.scales[d]=f,d}},{key:"ruleInferExpression",value:function(a){var b={operator:"none",params:[]},c=a.guide||{},d=c.x||{},e=c.y||{};return 0===a.type.indexOf("ELEMENT.")?a.color&&(b={operator:"groupBy",params:[this.ruleInferDim(a.color,c.color||{})]}):"COORDS.RECT"===a.type&&1===a.unit.length&&"COORDS.RECT"===a.unit[0].type&&(b=d.tickPeriod||e.tickPeriod?{operator:"cross_period",params:[this.ruleInferDim(a.x,d),this.ruleInferDim(a.y,e),d.tickPeriod,e.tickPeriod]}:{operator:"cross",params:[this.ruleInferDim(a.x,d),this.ruleInferDim(a.y,e)]}),g["default"].extend({inherit:!0,source:"/"},b)}}]),a}();a.SpecConverter=h}),e("utils/utils-draw",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b={translate:function(a,b){return"translate("+a+","+b+")"},rotate:function(a){return"rotate("+a+")"},getOrientation:function(a){return["bottom","top"].indexOf(a.toLowerCase())>=0?"h":"v"},isIntersect:function(a,b,c,d,e,f,g,h){var i,j,k,l;i=c-a,j=d-b,k=g-e,l=h-f;var m,n;return m=(-j*(a-e)+i*(b-f))/(-k*j+i*l),n=(k*(b-f)-l*(a-e))/(-k*j+i*l),m>=0&&1>=m&&n>=0&&1>=n}};a.utilsDraw=b}),e("formatter-registry",["exports","d3"],function(b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0});var e=d(c),f={"x-num-auto":function(a){var b=parseFloat(a.toFixed(2));return Math.abs(b)<1?b.toString():e["default"].format("s")(b)},percent:function(a){var b=parseFloat((100*a).toFixed(2));return b.toString()+"%"},day:e["default"].time.format("%d-%b-%Y"),"day-short":e["default"].time.format("%d-%b"),week:e["default"].time.format("%d-%b-%Y"),"week-short":e["default"].time.format("%d-%b"),month:function(a){var b=new Date(a),c=b.getMonth(),d=0===c?"%B, %Y":"%B";return e["default"].time.format(d)(a)},"month-short":function(a){var b=new Date(a),c=b.getMonth(),d=0===c?"%b '%y":"%b";return e["default"].time.format(d)(a)},"month-year":e["default"].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:e["default"].time.format("%Y"),"x-time-auto":null},g={get:function(b,c){var d=c||"",g=function(a){return(null===a||"undefined"==typeof a?d:a).toString()},h=f.hasOwnProperty(b),i=h?f[b]:g;return h&&(i=f[b]),!h&&b&&(i=function(c){var d=a.isDate(c)?e["default"].time.format(b):e["default"].format(b);return d(c)}),h||b||(i=g),i},add:function(a,b){f[a]=b}};b.FormatterRegistry=g}),e("spec-transform-auto-layout",["exports","underscore","./utils/utils","./utils/utils-draw","./formatter-registry","./utils/utils-dom","./scales-factory"],function(a,b,c,d,e,f,g){"use strict";function h(a){return a&&a.__esModule?a:{"default":a}}function i(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function j(a,b,c,d){var e=a.hasOwnProperty(c)?a[c]:{};e=e||{},l["default"].each(d,function(a){l["default"].extend(b.guide[c][a],e[a])}),l["default"].extend(b.guide[c],l["default"].omit.apply(l["default"],[e].concat[d]))}Object.defineProperty(a,"__esModule",{value:!0});var k=function(){function a(a,b){for(var c=0;c=0&&(a.guide.x.tickFormat+="-short"),["day","week","month"].indexOf(a.guide.y.tickFormat)>=0&&(a.guide.y.tickFormat+="-short");var r=0===o.length,u=0===q.length,v=s(o,e.FormatterRegistry.get(a.guide.x.tickFormat,a.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),w=s(q,e.FormatterRegistry.get(a.guide.y.tickFormat,a.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),x=c.xAxisPadding,y=c.yAxisPadding,z=d?!j:!1,A=f?!k:!1;a.guide.x.padding=r?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=r?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,g){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=o.length,a.guide.y.$minimalDomain=q.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},v={NONE:function(a,b,d){var e=c.utils.clone(a);return w(c.utils.clone(e.unit),e.unit,function(a,b){return b.guide.x.tickFontHeight=d.getAxisTickLabelSize("X").height,b.guide.y.tickFontHeight=d.getAxisTickLabelSize("Y").height,b.guide.x.tickFormatWordWrapLimit=d.xAxisTickLabelLimit,b.guide.y.tickFormatWordWrapLimit=d.yAxisTickLabelLimit,b}),e},"BUILD-LABELS":function(a,b,d){var e=c.utils.clone(a),f=[],g=[],h=null,i=null;return c.utils.traverseJSON(e.unit,"units",r,function(a,c){if(a.isLeaf)return c;!h&&c.x&&(h=c),!i&&c.y&&(i=c),c.guide=c.guide||{},c.guide.x=c.guide.x||{label:""},c.guide.y=c.guide.y||{label:""},c.guide.x.label=l["default"].isObject(c.guide.x.label)?c.guide.x.label:{text:c.guide.x.label},c.guide.y.label=l["default"].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||b.dimension(c.x).dimName),c.y&&(c.guide.y.label.text=c.guide.y.label.text||b.dimension(c.y).dimName);var d=c.guide.x.label.text;d&&(f.push(d),c.guide.x.tickFormatNullAlias=c.guide.x.hasOwnProperty("tickFormatNullAlias")?c.guide.x.tickFormatNullAlias:"No "+d,c.guide.x.label.text="");var e=c.guide.y.label.text;return e&&(g.push(e),c.guide.y.tickFormatNullAlias=c.guide.y.hasOwnProperty("tickFormatNullAlias")?c.guide.y.tickFormatNullAlias:"No "+e,c.guide.y.label.text=""),c}),h&&(h.guide.x.label.text=f.join(" > ")),i&&(i.guide.y.label.text=g.join(" > ")),e},"BUILD-GUIDE":function(a,b,d){var f=c.utils.clone(a);return w(c.utils.clone(f.unit),f.unit,function(a,c){if(a.isLeaf)return c;c.guide.hasOwnProperty("showGridLines")||(c.guide.showGridLines=a.isLeafParent?"xy":"");var f=!a.isLeaf&&!a.isLeafParent;f&&(c.guide.x.cssClass+=" facet-axis",c.guide.x.avoidCollisions=!0,c.guide.y.cssClass+=" facet-axis");var g=b.dimension(c.x),h=b.dimension(c.y),i="measure"===g.dimType,j="measure"===h.dimType,k=d.hasOwnProperty("xDensityPadding:"+g.dimType)?d["xDensityPadding:"+g.dimType]:d.xDensityPadding,l=d.hasOwnProperty("yDensityPadding:"+h.dimType)?d["yDensityPadding:"+h.dimType]:d.yDensityPadding,m=b.scaleMeta(c.x,c.guide.x),n=m.values,o=b.scaleMeta(c.y,c.guide.y),p=o.values;c.guide.x.tickFormat=c.guide.x.tickFormat||t(g,d.defaultFormats),c.guide.y.tickFormat=c.guide.y.tickFormat||t(h,d.defaultFormats);var q=0===n.length,r=0===p.length,u=s(n,e.FormatterRegistry.get(c.guide.x.tickFormat,c.guide.x.tickFormatNullAlias),d.getAxisTickLabelSize,d.xAxisTickLabelLimit),v=s(p,e.FormatterRegistry.get(c.guide.y.tickFormat,c.guide.y.tickFormatNullAlias),d.getAxisTickLabelSize,d.yAxisTickLabelLimit),w=a.isLeafParent?d.xAxisPadding:0,x=a.isLeafParent?d.yAxisPadding:0,y=!f&&Boolean(g.dimType)&&"measure"!==g.dimType;c.guide.x.padding=q?0:w,c.guide.y.padding=r?0:x,c.guide.x.rotate=y?90:0,c.guide.x.textAnchor=y?"start":c.guide.x.textAnchor;var z=q?0:d.xTickWidth,A=r?0:d.yTickWidth;c.guide.x.tickFormatWordWrapLimit=d.xAxisTickLabelLimit,c.guide.y.tickFormatWordWrapLimit=d.yAxisTickLabelLimit;var B=y?u.width:u.height;!i&&B>d.xAxisTickLabelLimit&&(B=d.xAxisTickLabelLimit),!y&&u.width>d.xAxisTickLabelLimit&&(c.guide.x.tickFormatWordWrap=!0,c.guide.x.tickFormatWordWrapLines=d.xTickWordWrapLinesLimit,B=d.xTickWordWrapLinesLimit*u.height);var C=v.width;!j&&C>d.yAxisTickLabelLimit&&(C=d.yAxisTickLabelLimit,c.guide.y.tickFormatWordWrap=!0,c.guide.y.tickFormatWordWrapLines=d.yTickWordWrapLinesLimit);var D=z+B,E=A+C,F=d.xFontLabelHeight,G=d.yFontLabelHeight,H=d.distToXAxisLabel,I=d.distToYAxisLabel,J=Math.min(d.xAxisTickLabelLimit,y?u.height:u.width);c.guide.x.density=J+2*k;var K=Math.ceil(v.width/d.yAxisTickLabelLimit),L=Math.min(K,d.yTickWordWrapLinesLimit),M=Math.min(d.yAxisTickLabelLimit,L*v.height);c.guide.y.density=M+2*l,c.guide.x.label.padding=c.guide.x.label.text?D+H:0,c.guide.y.label.padding=c.guide.y.label.text?E+I:0;var N=c.guide.x.label.text?c.guide.x.label.padding+F:D,O=c.guide.y.label.text?c.guide.y.label.padding+G:E;return c.guide.padding.b=w+N,c.guide.padding.l=x+O,c.guide.padding.b=c.guide.x.hide?0:c.guide.padding.b,c.guide.padding.l=c.guide.y.hide?0:c.guide.padding.l,c.guide.x.tickFontHeight=u.height,c.guide.y.tickFontHeight=v.height,c.guide.x.$minimalDomain=n.length,c.guide.y.$minimalDomain=p.length,c.guide.x.$maxTickTextW=u.width,c.guide.x.$maxTickTextH=u.height,c.guide.y.$maxTickTextW=v.width,c.guide.y.$maxTickTextH=v.height,c}),f},"BUILD-COMPACT":function(a,b,d){var e=c.utils.clone(a);return w(c.utils.clone(e.unit),e.unit,function(a,c){return a.isLeaf?c:(c.guide.hasOwnProperty("showGridLines")||(c.guide.showGridLines=a.isLeafParent?"xy":""),a.isLeafParent?u(c,b,l["default"].defaults({xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!0,!1,!0):(c.guide.x.cssClass+=" facet-axis compact",c.guide.y.cssClass+=" facet-axis compact",u(c,b,l["default"].defaults({xAxisPadding:0,yAxisPadding:0,distToXAxisLabel:0,distToYAxisLabel:0,xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!1,!0,!1)))}),e}};v.AUTO=function(a,b,c){return["BUILD-LABELS","BUILD-GUIDE"].reduce(function(a,d){return v[d](a,b,c)},a)},v.COMPACT=function(a,b,c){return["BUILD-LABELS","BUILD-COMPACT"].reduce(function(a,d){return v[d](a,b,c)},a)};var w=function z(a,b,d){var e=p(b);e=d(r(e),e),e=m(e,a);var f=l["default"].omit(e,"units");return(e.units||[]).forEach(function(a){return z(c.utils.clone(a),q(a,f),d)}),e},x={get:function(a,b,d,e){var f=v[a]||v.NONE,g={dimension:function(a){var b=d.scales[a],c=d.sources[b.source].dims[b.dim]||{};return{dimName:b.dim,dimType:c.type,scaleType:b.type}},scaleMeta:function(a){var b=e("pos",a);return{values:b.domain()}}},h={unit:c.utils.clone(d.unit)},i=f(h,g,b);return d.unit=i.unit,d}},y=function(){function a(b){i(this,a),this.spec=b,this.scalesCreator=new g.ScalesFactory(b.sources),this.isApplicable=c.utils.isSpecRectCoordsOnly(b.unit)}return k(a,[{key:"transform",value:function(){var a=this,b=this.spec;if(!this.isApplicable)return b;var c=b.settings.size,d=l["default"].find(b.settings.specEngine,function(a){return c.width<=a.width}),e=x.get(d.name,b.settings,b,function(c,d){var e=d?d:""+c+":default";return a.scalesCreator.create(b.scales[e],null,[0,100])});return e}}]),a}();a.SpecTransformAutoLayout=y}),e("spec-transform-calc-size",["exports","./scales-factory","./utils/utils"],function(a,b,c){"use strict";function d(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b0?d:0,a.guide.x.label.padding>c+b.xAxisPadding&&(a.guide.x.label.padding+=d)}(a.units||[]).filter(function(a){return"COORDS.RECT"===a.type}).forEach(function(a){return l(a,b)})},h=function(a){return a.$maxTickTextW},i=function(a){return a.density},j={"entire-view":function(a,b,c){var d=b("x",c.unit,h);d<=a.width&&g(c.unit,c.settings);var e=a.width,f=a.height;return{newW:e,newH:f}},minimal:function(a,b,c){var d=b("x",c.unit,i),e=b("y",c.unit,i);return{newW:d,newH:e}},normal:function(a,b,c){var d,e=b("x",c.unit,h),f=a.width;f>=e?(g(c.unit,c.settings),d=Math.max(f,e)):d=Math.max(f,Math.max(a.width,b("x",c.unit,i)));var j=Math.max(a.height,b("y",c.unit,i));return{newW:d,newH:j}},"fit-width":function(a,b,c){var d=b("x",c.unit,h);d<=a.width&&g(c.unit,c.settings);var e=a.width,f=b("y",c.unit,i);return{newW:e,newH:f}},"fit-height":function(a,b,c){var d=b("x",c.unit,i),e=a.height;return{newW:d,newH:e}}},k=function(){function a(b){e(this,a),this.spec=b,this.isApplicable=c.utils.isSpecRectCoordsOnly(b.unit)}return f(a,[{key:"transform",value:function(){var a=this.spec;if(!this.isApplicable)return a;var c=a.settings.fitModel;if(!c)return a;var e=a.scales,f=new b.ScalesFactory(a.sources),g=function(a,b){return a.reduce(function(a,c){var d=c.key||{},e=d[b];return a[e]=a[e]||[],a[e].push(c),a},{})},h=function(a,b){var c=0;if(["ordinal","period"].indexOf(a.scaleType)>=0){var d=a.domain();c=b*d.length}else c=4*b;return c},i=function q(a,b,c){var i=void 0===arguments[3]?null:arguments[3],j="x"===a?e[b.x]:e[b.y],k="x"===a?e[b.y]:e[b.x],l=b.guide,m=c("x"===a?l.x:l.y),n="x"===a?l.padding.l+l.padding.r:l.padding.b+l.padding.t;if("COORDS.RECT"!==b.units[0].type){var o=f.create(j,i,[0,100]);return n+h(o,m)}var p=g(b.frames,k.dim),r=Object.keys(p).map(function(b){return p[b].map(function(b){return q(a,b.units[0],c,b)}).reduce(function(a,b){return a+b},0)}),s=Math.max.apply(Math,d(r));return n+s},k=a.settings.size,l=k.width,m=k.height,n=j[c];if(n){var o=n(k,i,a);l=o.newW,m=o.newH}var p=function(b,c){var d=a.settings.getScrollBarWidth(),e=c.width,f=c.height,g=b.width-e,h=b.height-f,i=h>=0?0:d,j=g>=0?0:d;return{height:f-j,width:e-i}};return a.settings.size=p(k,{width:l,height:m}),a}}]),a}();a.SpecTransformCalcSize=k}),e("spec-transform-apply-ratio",["exports","underscore","./utils/utils"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c1||!d(a))throw new Error("Not applicable");g.push(a.x),h.push(a.y);var c=a.units||[],f=c.map(function(a){if(!d(a)&&!e(a))throw new Error("Not applicable");return a}).filter(d);return 1===f.length};f(a.unit,i,function(a,b){return 0});var j=function(b){return a.scales[b]},k=function(a){return"/"===a.source&&!a.ratio&&!a.fitToFrameByDims},l=function(a){return"ordinal"===a.type||"period"===a.type&&!a.period},m=g.map(j).filter(k),n=h.map(j).filter(k),o=2;[m.length,n.length].some(function(a){return a===o})&&!function(){var a=function(a){return a.dim},d=function(b,c,d){return b.fitToFrameByDims=d.slice(0,c).map(a)},e=function(e,f){f.filter(l).length===o&&(f.forEach(d),f[0].ratio=c.utils.generateRatioFunction(e,f.map(a),b))};e("x",m),e("y",n)}()}}]),a}());a.SpecTransformApplyRatio=g}),e("spec-transform-extract-axes",["exports","underscore","./utils/utils"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c1||!b(a))throw new Error("Not applicable");a.guide=a.guide||{};var g=a.guide,h=g.padding||{l:0,r:0,t:0,b:0};e.l+=h.l,e.r+=h.r,e.t+=h.t,e.b+=h.b,f.push({l:e.l,r:e.r,t:e.t,b:e.b});var i=a.units||[],j=i.map(function(a){if(!b(a)&&!d(a))throw new Error("Not applicable");return a}).filter(b);return 1===j.length},h=function(a){return a?10:0},i=function(a){var b=f.pop(),c=a.guide||{};c.x=c.x||{},c.x.padding=c.x.padding||0,c.y=c.y||{},c.y.padding=c.y.padding||0,c.padding={l:h(a.y),r:h(1),t:h(1),b:h(a.x)},c.autoLayout="extract-axes",c.x.padding+=e.b-b.b,c.y.padding+=e.l-b.l};c.utils.traverseSpec(a.unit,g,i),a.unit.guide.padding=e,a.unit.guide.autoLayout=""}}]),a}());a.SpecTransformExtractAxes=g}),e("charts/tau.plot",["exports","../api/balloon","../event","../plugins","../utils/utils","../utils/utils-dom","../const","../units-registry","../data-processor","../utils/layuot-template","../spec-converter","../spec-transform-auto-layout","../spec-transform-calc-size","../spec-transform-apply-ratio","../spec-transform-extract-axes","./tau.gpl"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){"use strict";function s(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function t(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)}Object.defineProperty(c,"__esModule",{value:!0});var u=function(){function a(a,b){for(var c=0;c0}).length}},{key:"setData",value:function(b){this.config.data=b,this.configGPL.sources["/"].data=b,this._originData=a.clone(this.configGPL.sources),this.refresh()}},{key:"getSVG",value:function(){return this._svg}},{key:"addFilter",value:function(a){a.src=a.src||"/";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}},{key:"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()}},{key:"refresh",value:function(){this._target&&this.renderTo(this._target,this._defaultSize)}},{key:"resize",value:function(){var a=void 0===arguments[0]?{}:arguments[0];this.renderTo(this._target,a)}},{key:"select",value:function(a){return this._nodes.filter(a)}},{key:"traverseSpec",value:function(a,b){var c=function d(a,b,c){b(a,c),(a.units||[]).map(function(c){return d(c,b,a)})};c(a.unit,b,null)}},{key:"getSpec",value:function(){return this._liveSpec}}],[{key:"setupMetaInfo",value:function(a,b){var c=a?a:k.DataProcessor.autoDetectDimTypes(b);return k.DataProcessor.autoAssignScales(c)}},{key:"setupSettings",value:function(b){var c=e.globalSettings,d={};Object.keys(c).forEach(function(b){d[b]=a.isFunction(c[b])?c[b]:g.utils.clone(c[b])});var f=a.defaults(b||{},d);return g.utils.isArray(f.specEngine)||(f.specEngine=[{width:Number.MAX_VALUE,name:f.specEngine}]),f}}]),e}(e.Emitter);c.Plot=w}),e("chart-alias-registry",["exports","d3","./utils/utils","./data-processor","./error"],function(b,c,d,e,f){"use strict";function g(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0});var h=(g(c),{}),i={},j=function(b){var c="Chart type "+b+" is not supported.";throw console.log(c),console.log("Use one of "+a.keys(h).join(", ")+"."),new f.TauChartError(c,f.errorCodes.NOT_SUPPORTED_TYPE_CHART)},k={validate:function(a,b){return i.hasOwnProperty(a)||j(a),i[a].reduce(function(a,c){return a.concat(c(b)||[])},[])},get:function(b){var c=h[b];return a.isFunction(c)||j(b),c},add:function(a,b){var c=void 0===arguments[2]?[]:arguments[2];return h[a]=b,i[a]=c,this},getAllRegisteredTypes:function(){return h}};b.chartTypesRegistry=k}),e("charts/tau.chart",["exports","./tau.plot","../chart-alias-registry"],function(b,c,d){"use strict";function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(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)}Object.defineProperty(b,"__esModule",{value:!0});var g=function(){function a(a,b){for(var c=0;c0)throw new Error(f[0]);var g=d.chartTypesRegistry.get(b.type);b=a.defaults(b,{autoResize:!0}),b.settings=c.Plot.setupSettings(b.settings),b.dimensions=c.Plot.setupMetaInfo(b.dimensions,b.data),h(Object.getPrototypeOf(i.prototype),"constructor",this).call(this,g(b)),b.autoResize&&i.winAware.push(this)}return f(i,b),g(i,[{key:"destroy",value:function(){var a=i.winAware.indexOf(this);-1!==a&&i.winAware.splice(a,1),h(Object.getPrototypeOf(i.prototype),"destroy",this).call(this)}}]),i}(c.Plot);i.resizeOnWindowEvent=function(){function a(){!c&&i.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=i.winAware.length;d>b;b++)a=i.winAware[b],a.resize()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),i.winAware=[],window.addEventListener("resize",i.resizeOnWindowEvent),b.Chart=i}),e("utils/d3-decorators",["exports","../utils/utils-draw","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(a,"__esModule",{value:!0});var f=e(c),g=e(d),h=f["default"].memoize(function(a){return a.node().getComputedTextLength()},function(a){return a.node().textContent.length}),i=function(a,b,c){c=c||h,a.each(function(){var a=g["default"].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)})},j=function(a,b,c,d,e,f){f=f||h;var i=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=g["default"].select(this),h=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=i(a,null,j,k,l,m,0),o=!1,p=h.length-1,q=h.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 i(a,b,j,k,l,m,c)}),n.remove()})},k=function(a,b,c){a.selectAll(".tick line").empty()||a.selectAll(".tick")[0].forEach(function(a){var d=g["default"].select(a),e=d.data()[0],f=b(e),h=c?f:0,i=c?0:f;d.attr("transform","translate("+h+","+i+")");var j=.5*b.stepSize(e),k=c?"x":"y",l=c?j:-j;d.select("line").attr(k+"1",l).attr(k+"2",l)})},l=function(a){var b=a.selectAll(".tick")[0];if(!(b.length<2)){var c=parseFloat(b[0].attributes.transform.value.replace("translate(","")),d=parseFloat(b[1].attributes.transform.value.replace("translate(","")),e=d-c,f=0,g=-1,h=a.selectAll(".tick text")[0];if(h.forEach(function(a,b){var c=a.textContent||"",d=c.length;d>f&&(f=d,g=b)}),g>=0){var i=h[g].getBoundingClientRect();e-i.width<8&&a.classed({"graphical-report__d3-time-overflown":!0})}}},m=function(a,c,d){var e=a.selectAll(".tick line");if(!e.empty()){var f=-1;if(d)f=0;else{var g=c/e[0].length,h=g/2;f=-h}var i=a.select(".tick").node().cloneNode(!0);a.append(function(){return i}).attr("transform",b.utilsDraw.translate(0,c-f))}},n=function(a,c,d){var e=d?1:-1,f=a.append("text").attr("transform",b.utilsDraw.rotate(c.rotate)).attr("class",c.cssClass).attr("x",e*c.size*.5).attr("y",e*c.padding).style("text-anchor",c.textAnchor),g=" > ",h=c.text.split(g),i=h.length;if(h.forEach(function(a,b){f.append("tspan").attr("class","label-token label-token-"+b).text(a),i-1>b&&f.append("tspan").attr("class","label-token-delimiter label-token-delimiter-"+b).text(g)}),"right"===c.dock){var j=a.selectAll("path.domain").node().getBBox();f.attr("x",d?j.width:0)}else if("left"===c.dock){var j=a.selectAll("path.domain").node().getBBox();f.attr("x",d?0:-j.height)}},o=function(a,c,d){var e=c.rotate,f=a.selectAll(".tick text");if(f.attr("transform",b.utilsDraw.rotate(e)).style("text-anchor",c.textAnchor),90===e){var g=parseFloat(f.attr("dy"))/2;f.attr("x",9).attr("y",0).attr("dy",""+g+"em")}c.tickFormatWordWrap?f.call(j,c.tickFormatWordWrapLimit,c.tickFormatWordWrapLines,c.$maxTickTextH,!d):f.call(i,c.tickFormatWordWrapLimit)},p=function(a){var b=11,c=-10,d=[];a.selectAll(".tick").each(function(a,b){var c=g["default"].select(this),e=(c.text(),parseFloat(c.attr("transform").replace("translate(","").split(",")[0])),f=c.selectAll("text"),h=f.selectAll("tspan"),i=h.empty()?f:h,j=i.node().getBBox().width,k=j/2,l=e-k,m=e+k;d.push({s:l,e:m,l:0,textRef:i,tickRef:c})});var e=function(a,b){return a.map(function(a,c,d){return b(d[c-1]||{e:-(1/0),s:-(1/0),l:0},a,d[c+1]||{e:1/0,s:1/0,l:0})})},f=function(a,b){var c={"[T][1]":-1,"[T][-1]":0,"[T][0]":1,"[F][0]":-1},d="["+b.toString().toUpperCase().charAt(0)+"]["+a+"]";return c.hasOwnProperty(d)?c[d]:0};e(d,function(a,d,e){var g=a.e>d.s,h=e.s0,d.y.hide=Math.floor(c.options.left)>0}}return k(a,[{key:"drawLayout",value:function(a){var b=this.config,c=b.options,d=b.guide.padding,e=c.width-(d.l+d.r),f=c.height-(d.t+d.b);return this.xScale=a("pos",b.x,[0,e]),this.yScale=a("pos",b.y,[f,0]),this.W=e,this.H=f,this}},{key:"drawFrames",value:function(a,b){var c=m["default"].extend({},this.config),f=c.options,g=c.guide.padding,h=f.left+g.l,i=f.top+g.t,j=this.W,k=this.H;c.x=this.xScale,c.y=this.yScale,c.x.scaleObj=this.xScale,c.y.scaleObj=this.yScale,c.x.guide=c.guide.x,c.y.guide=c.guide.y,c.x.guide.label.size=j,c.y.guide.label.size=k,f.container.attr("transform",d.utilsDraw.translate(h,i));var n=c.x.getHash()+k,o=c.y.getHash()+j;c.x.guide.hide||this._fnDrawDimAxis(f.container,c.x,[0,k+c.guide.x.padding],j,""+f.frameId+"x",n),c.y.guide.hide||this._fnDrawDimAxis(f.container,c.y,[0-c.guide.y.padding,0],k,""+f.frameId+"y",o);var p=function(a,d,e){var f,g=e.hash();if(e.key){var h=e.key[c.x.dim],i=e.key[c.y.dim],m=c.x(h),n=c.y(i),o=c.x.stepSize(h),p=c.y.stepSize(i);f=function(a,b){return a.options={uid:g+b,frameId:g,container:d,containerWidth:j,containerHeight:k,left:m-o/2,top:n-p/2,width:o,height:p},a}}else f=function(a,b){return a.options={uid:g+b,frameId:g,container:d,containerWidth:j,containerHeight:k,left:0,top:0,width:j,height:k},a};var q=function(a){a.options.container=l["default"].select(this),b(a,e)},r=d.selectAll(".layer_"+a).data(e.units.map(f),function(a){return a.options.uid+a.type});r.exit().remove(),r.each(q),r.enter().append("g").attr("class","layer_"+a).each(q)},q=function(a){p(f.frameId,l["default"].select(this),a)},r=this._fnDrawGrid(f.container,c,k,j,f.frameId,n+o).selectAll(".parent-frame-"+f.frameId).data(a,function(a){return a.hash()});r.exit().remove(),r.each(q),r.enter().append("g").attr("class",function(a){return""+e.CSS_PREFIX+"cell cell parent-frame-"+f.frameId+" frame-"+a.hash()}).each(q)}},{key:"_fnDrawDimAxis",value:function(a,b,c,e,h,j){var k=l["default"].svg.axis().scale(b.scaleObj).orient(b.guide.scaleOrient),m=f.FormatterRegistry.get(b.guide.tickFormat,b.guide.tickFormatNullAlias);null!==m&&(k.ticks(Math.round(e/b.guide.density)),k.tickFormat(m));var n=a.selectAll(".axis_"+h).data([j],function(a){return a});n.exit().remove(),n.enter().append("g").attr("class",b.guide.cssClass+" axis_"+h).attr("transform",d.utilsDraw.translate.apply(d.utilsDraw,i(c))).call(function(a){if(!a.empty()){k.call(this,a);var c="h"===d.utilsDraw.getOrientation(b.guide.scaleOrient),e="ordinal"===b.scaleType||"period"===b.scaleType;e&&g.d3_decorator_prettify_categorical_axis_ticks(a,b,c),e&&c&&b.guide.avoidCollisions&&g.d3_decorator_avoid_labels_collisions(a),g.d3_decorator_wrap_tick_label(a,b.guide,c),g.d3_decorator_prettify_axis_label(a,b.guide.label,c),c&&"time"===b.scaleType&&g.d3_decorator_fix_horizontal_axis_ticks_overflow(a)}})}},{key:"_fnDrawGrid",value:function(a,b,c,e,h,i){var j=a.selectAll(".grid_"+h).data([i],function(a){return a});return j.exit().remove(),j.enter().append("g").attr("class","grid grid_"+h).attr("transform",d.utilsDraw.translate(0,0)).call(function(a){if(!a.empty()){var h=a,i=(b.guide.showGridLines||"").toLowerCase();if(i.length>0){var j=h.append("g").attr("class","grid-lines");if(i.indexOf("x")>-1){var k=b.x,n=l["default"].svg.axis().scale(k.scaleObj).orient(k.guide.scaleOrient).tickSize(c),o=f.FormatterRegistry.get(k.guide.tickFormat);null!==o&&(n.ticks(Math.round(e/k.guide.density)),n.tickFormat(o));var p=j.append("g").attr("class","grid-lines-x").call(n),q="h"===d.utilsDraw.getOrientation(k.guide.scaleOrient),r="ordinal"===k.scaleType||"period"===k.scaleType;r&&g.d3_decorator_prettify_categorical_axis_ticks(p,k,q);var s=p.select("g.tick");if(s.node()&&"translate(0,0)"!==s.attr("transform")){var t=s.node().cloneNode(!0);j.node().appendChild(t),l["default"].select(t).attr("class","border").attr("transform",d.utilsDraw.translate(0,0)).select("line").attr("x1",0).attr("x2",0)}}if(i.indexOf("y")>-1){var u=b.y,v=l["default"].svg.axis().scale(u.scaleObj).orient(u.guide.scaleOrient).tickSize(-e),o=f.FormatterRegistry.get(u.guide.tickFormat);null!==o&&(v.ticks(Math.round(c/u.guide.density)),v.tickFormat(o));var w=j.append("g").attr("class","grid-lines-y").call(v),q="h"===d.utilsDraw.getOrientation(u.guide.scaleOrient),r="ordinal"===u.scaleType||"period"===u.scaleType;r&&g.d3_decorator_prettify_categorical_axis_ticks(w,u,q);var x=["time","ordinal","period"],y=m["default"].contains(x,u.scaleType);y&&g.d3_decorator_fix_axis_bottom_line(w,c,"time"===u.scaleType)}j.selectAll("text").remove()}}}),j}}]),a}();a.Cartesian=n}),e("elements/element",["exports","../event"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(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)}Object.defineProperty(a,"__esModule",{value:!0});var e=function(a){function b(){c(this,b),null!=a&&a.apply(this,arguments)}return d(b,a),b}(b.Emitter);a.Element=e}),e("elements/coords.parallel",["exports","d3","underscore","./element","../utils/utils-draw","../utils/utils","../const"],function(a,b,c,d,e,f,g){"use strict";function h(a){return a&&a.__esModule?a:{"default":a}}function i(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b=e}):[b[0],b[1]],{dim:d[a].dim,func:d[a].descrete?"inset":"between",args:c}});b.fire("brush",c)};return a.selectAll(".brush").remove(),a.append("g").attr("class","brush").each(function(a){e[a]=n["default"].svg.brush().y(d[a]).on("brushstart",g).on("brush",i).on("brushend",h),n["default"].select(this).classed("brush-"+f.utils.generateHash(a),!0).call(e[a])}).selectAll("rect").attr("x",c/2*-1).attr("width",c),a}},{key:"_forceBrushing",value:function(){var a=void 0===arguments[0]?{}:arguments[0],b=this.columnsBrushes,c=this.columnsScalesMap;Object.keys(a).filter(function(d){return b[d]&&c[d]&&a[d]}).forEach(function(d){var e=a[d],g=[];if(c[d].descrete){var h=e.map(c[d]).filter(function(a){return a>=0}),j=c[d].stepSize()/2;g=[Math.min.apply(Math,i(h))-j,Math.max.apply(Math,i(h))+j]}else g=[e[0],e[1]];var k=f.utils.generateHash(d);b[d].extent(g),b[d](n["default"].select(".brush-"+k)),b[d].event(n["default"].select(".brush-"+k))})}}]),b}(d.Element);a.Parallel=p}),!function(){function a(a,b){function c(b){var c,d=a.arcs[0>b?~b:b],e=d[0];return a.transform?(c=[0,0],d.forEach(function(a){c[0]+=a[0],c[1]+=a[1]})):c=d[d.length-1],0>b?[c,e]:[e,c]}function d(a,b){for(var c in a){var d=a[c];delete b[d.start],delete d.start,delete d.end,d.forEach(function(a){e[0>a?~a:a]=1}),h.push(d)}}var e={},f={},g={},h=[],i=-1;return b.forEach(function(c,d){var e,f=a.arcs[0>c?~c:c];f.length<3&&!f[1][0]&&!f[1][1]&&(e=b[++i],b[i]=c,b[d]=e)}),b.forEach(function(a){var b,d,e=c(a),h=e[0],i=e[1];if(b=g[h])if(delete g[b.end],b.push(a),b.end=i,d=f[i]){delete f[d.start];var j=d===b?b:b.concat(d);f[j.start=b.start]=g[j.end=d.end]=j}else f[b.start]=g[b.end]=b;else if(b=f[i])if(delete f[b.start],b.unshift(a),b.start=h,d=g[h]){delete g[d.end];var k=d===b?b:d.concat(b);f[k.start=d.start]=g[k.end=b.end]=k}else f[b.start]=g[b.end]=b;else b=[a],f[b.start=h]=g[b.end=i]=b}),d(g,f),d(f,g),b.forEach(function(a){e[0>a?~a:a]||h.push([a])}),h}function b(b,c,d){function e(a){var b=0>a?~a:a;(k[b]||(k[b]=[])).push({i:a,g:j})}function f(a){a.forEach(e)}function g(a){a.forEach(f)}function h(a){"GeometryCollection"===a.type?a.geometries.forEach(h):a.type in l&&(j=a,l[a.type](a.arcs))}var i=[];if(arguments.length>1){var j,k=[],l={LineString:f,MultiLineString:g,Polygon:g,MultiPolygon:function(a){a.forEach(g)}};h(c),k.forEach(arguments.length<3?function(a){i.push(a[0].i)}:function(a){d(a[0].g,a[a.length-1].g)&&i.push(a[0].i)})}else for(var m=0,n=b.arcs.length;n>m;++m)i.push(m);return{type:"MultiLineString",arcs:a(b,i)}}function c(b,c){function d(a){a.forEach(function(b){b.forEach(function(b){(f[b=0>b?~b:b]||(f[b]=[])).push(a)})}),h.push(a)}function e(a){return l(g(b,{type:"Polygon",arcs:[a]}).coordinates[0])>0}var f={},h=[],i=[];return c.forEach(function(a){"Polygon"===a.type?d(a.arcs):"MultiPolygon"===a.type&&a.arcs.forEach(d)}),h.forEach(function(a){if(!a._){var b=[],c=[a];for(a._=1,i.push(b);a=c.pop();)b.push(a),a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].forEach(function(a){a._||(a._=1,c.push(a))})})})}}),h.forEach(function(a){delete a._}),{type:"MultiPolygon",arcs:i.map(function(c){var d=[];if(c.forEach(function(a){a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].length<2&&d.push(a)})})}),d=a(b,d),(n=d.length)>1)for(var g,h=e(c[0][0]),i=0;ia?~a:a],e=0,f=d.length;f>e;++e)b.push(c=d[e].slice()),j(c,e);0>a&&h(b,f)}function d(a){return a=a.slice(),j(a,0),a}function e(a){for(var b=[],d=0,e=a.length;e>d;++d)c(a[d],b);return b.length<2&&b.push(b[0].slice()),b}function f(a){for(var b=e(a);b.length<4;)b.push(b[0].slice());return b}function g(a){return a.map(f)}function i(a){var b=a.type;return"GeometryCollection"===b?{type:b,geometries:a.geometries.map(i)}:b in l?{type:b,coordinates:l[b](a)}:null}var j=q(a.transform),k=a.arcs,l={Point:function(a){return d(a.coordinates)},MultiPoint:function(a){return a.coordinates.map(d)},LineString:function(a){return e(a.arcs)},MultiLineString:function(a){return a.arcs.map(e)},Polygon:function(a){return g(a.arcs)},MultiPolygon:function(a){return a.arcs.map(g)}};return i(b)}function h(a,b){for(var c,d=a.length,e=d-b;e<--d;)c=a[e],a[e++]=a[d],a[d]=c}function i(a,b){for(var c=0,d=a.length;d>c;){var e=c+d>>>1;a[e]a&&(a=~a);var c=e[a];c?c.push(b):e[a]=[b]})}function c(a,c){a.forEach(function(a){b(a,c)})}function d(a,b){"GeometryCollection"===a.type?a.geometries.forEach(function(a){d(a,b)}):a.type in g&&g[a.type](a.arcs,b)}var e={},f=a.map(function(){return[]}),g={LineString:b,MultiLineString:c,Polygon:c,MultiPolygon:function(a,b){a.forEach(function(a){c(a,b)})}};a.forEach(d);for(var h in e)for(var j=e[h],k=j.length,l=0;k>l;++l)for(var m=l+1;k>m;++m){var n,o=j[l],p=j[m];(n=f[o])[h=i(n,p)]!==p&&n.splice(h,0,p),(n=f[p])[h=i(n,o)]!==o&&n.splice(h,0,o)}return f}function k(a,b){function c(a){f.remove(a),a[1][2]=b(a),f.push(a)}var d=q(a.transform),e=r(a.transform),f=p();return b||(b=m),a.arcs.forEach(function(a){for(var g,h,i=[],j=0,k=0,l=a.length;l>k;++k)h=a[k],d(a[k]=[h[0],h[1],1/0],k);for(var k=1,l=a.length-1;l>k;++k)g=a.slice(k-1,k+2),g[1][2]=b(g),i.push(g),f.push(g);for(var k=0,l=i.length;l>k;++k)g=i[k],g.previous=i[k-1],g.next=i[k+1];for(;g=f.pop();){var m=g.previous,n=g.next;g[1][2]0;){var c=(b+1>>1)-1,e=d[c];if(o(a,e)>=0)break;d[e._=b]=e,d[a._=b=c]=a}}function b(a,b){for(;;){var c=b+1<<1,f=c-1,g=b,h=d[g];if(e>f&&o(d[f],h)<0&&(h=d[g=f]),e>c&&o(d[c],h)<0&&(h=d[g=c]),g===b)break;d[h._=b]=h,d[a._=b=g]=a}}var c={},d=[],e=0;return c.push=function(b){return a(d[b._=e]=b,e++),e},c.pop=function(){if(!(0>=e)){var a,c=d[0];return--e>0&&(a=d[e],b(d[a._=0]=a,0)),c}},c.remove=function(c){var f,g=c._;if(d[g]===c)return g!==--e&&(f=d[e],(o(f,c)<0?a:b)(d[f._=g]=f,g)),g},c}function q(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0),a[0]=(b+=a[0])*d+f,a[1]=(c+=a[1])*e+g}}function r(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0);var i=(a[0]-f)/d|0,j=(a[1]-g)/e|0;a[0]=i-b,a[1]=j-c,b=i,c=j}}function s(){}var t={version:"1.6.19",mesh:function(a){return g(a,b.apply(this,arguments))},meshArcs:b,merge:function(a){return g(a,c.apply(this,arguments))},mergeArcs:c,feature:d,neighbors:j,presimplify:k};"function"==typeof e&&e.amd?e("topojson",t):"object"==typeof module&&module.exports?module.exports=t:this.topojson=t}(),e("utils/d3-labeler",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b=function(){var a,b,c=[],d=[],e=1,f=1,g={},h=5,i=.5,j=0,k=0,l=.2,m=1,n=30,o=30,p=3,q=!1,r=!1,s=function(a){var b=c.length,e=0,f=c[a].x-d[a].x,g=d[a].y-c[a].y,h=Math.sqrt(f*f+g*g),i=!0;h>0&&(e+=h*l),f/=h,g/=h,e+=f>0&&g>0?0*p:0>f&&g>0?1*p:0>f&&0>g?2*p:3*p;for(var j,k,q,r,s,t,u,w=c[a].x,x=c[a].y-c[a].height+2,y=c[a].x+c[a].width,z=c[a].y+2,A=0;b>A;A++)A!=a&&(i=v(d[a].x,c[a].x,d[A].x,c[A].x,d[a].y,c[a].y,d[A].y,c[A].y),i&&(e+=m),j=c[A].x,q=c[A].y-c[A].height+2,k=c[A].x+c[A].width,r=c[A].y+2,s=Math.max(0,Math.min(k,y)-Math.max(j,w)),t=Math.max(0,Math.min(r,z)-Math.max(q,x)),u=s*t,e+=u*n),j=d[A].x-d[A].r,q=d[A].y-d[A].r,k=d[A].x+d[A].r,r=d[A].y+d[A].r,s=Math.max(0,Math.min(k,y)-Math.max(j,w)),t=Math.max(0,Math.min(r,z)-Math.max(q,x)),u=s*t,e+=u*o;return e},t=function(b){var g,i=Math.floor(Math.random()*c.length),l=c[i].x,m=c[i].y;g=q?a(i,c,d):s(i),c[i].x+=(Math.random()-.5)*h,c[i].y+=(Math.random()-.5)*h,c[i].x>e&&(c[i].x=l),c[i].x<0&&(c[i].x=l),c[i].y>f&&(c[i].y=m),c[i].y<0&&(c[i].y=m);var n;n=q?a(i,c,d):s(i);var o=n-g;Math.random()e&&(c[h].x=l),c[h].x<0&&(c[h].x=l),c[h].y>f&&(c[h].y=m),c[h].y<0&&(c[h].y=m);var u;u=q?a(h,c,d):s(h);var v=u-g;Math.random()i||i>1||0>j||j>1?!1:!0},w=function(a,b,c){return a-b/c};return g.start=function(a){for(var b=c.length,d=1,e=1,f=0;a>f;f++){for(var g=0;b>g;g++)Math.random()<.5?t(d):u(d);d=w(d,e,a)}},g.width=function(a){return arguments.length?(e=a,g):e},g.height=function(a){return arguments.length?(f=a,g):f},g.label=function(a){return arguments.length?(c=a,g):c},g.anchor=function(a){return arguments.length?(d=a,g):d},g.alt_energy=function(b){return arguments.length?(a=b,q=!0,g):s},g.alt_schedule=function(a){return arguments.length?(b=a,r=!0,g):w},g};a.d3Labeler=b}),e("elements/coords.geomap",["exports","d3","underscore","topojson","../utils/utils-draw","../utils/d3-labeler","../const","../formatter-registry"],function(a,b,c,d,e,f,g,h){"use strict";function i(a){return a&&a.__esModule?a:{"default":a}}function j(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var k=function(){function a(a,b){for(var c=0;cl,s=r?d-h-3*o:0;return{id:""+b+"-"+a.id,sx:h,sy:i,x:h+s,y:i,width:q.length*o,height:10,name:q,r:s,isRef:r}}).filter(function(a){return!isNaN(a.x)&&!isNaN(a.y)}),i=h.map(function(a){return{x:a.sx,y:a.sy,r:a.r}});l["default"].labeler().label(h).anchor(i).width(d).height(e).start(100),h.filter(function(a){return!a.isRef}).map(function(a){return a.x=a.sx,a.y=a.sy,a}).reduce(function(a,b){return a[b.id]=b,a},f);var j=h.filter(function(a){return a.isRef});j.length<6&&j.reduce(function(a,b){return a[b.id]=b,a},f)}),f}},{key:"_drawMap",value:function(a,b){var c=this,d=this.config.guide,e=this.config.options,f=this.config.options.container,g=this.latScale,h=this.lonScale,i=this.sizeScale,j=this.colorScale,k=this.codeScale,q=this.fillScale,r=this.W,s=this.H,t=p.filter(function(a){return(b.objects||{}).hasOwnProperty(a)});if(0===t.length)throw new Error("Invalid map: should contain some contours");var u;if(q.dim){if(!k.georole)throw console.log("Specify [georole] for code scale"),new Error("[georole] is missing");if(-1===t.indexOf(k.georole))throw console.log('There is no contour for georole "'+k.georole+'"'),console.log("Available contours are: "+t.join(" | ")),new Error("Invalid [georole]");u=k.georole}else u=t[t.length-1];var v;if(g.dim&&h.dim){var w=l["default"].extent(g.domain()),x=l["default"].extent(h.domain());v=[(x[1]+x[0])/2,(w[1]+w[0])/2]}var y=this._createProjection(b,t[0],v),z=l["default"].geo.path().projection(y),A=f.selectAll(".map-container").data([""+r+s+t.join("-")],m["default"].identity);A.exit().remove(),A.enter().append("g").call(function(){var a=this;a.attr("class","map-container");var e={},f=t.reduceRight(function(a,b){return a.concat(b)},[]);if(d.showNames&&(e=c._calcLabels(b,f,z)),f.forEach(function(c,d){var f=function(a){return e[""+c+"-"+a.id]};a.selectAll(".map-contour-"+c).data(n["default"].feature(b,b.objects[c]).features||[]).enter().append("g").call(function(){var a=this;a.attr("class","map-contour-"+c+" map-contour-level map-contour-level-"+d).attr("fill","none"),a.append("title").text(function(a){return(a.properties||{}).name}),a.append("path").attr("d",z),a.append("text").attr("class","place-label-"+c).attr("transform",function(a){var b=f(a);return b?"translate("+[b.x,b.y]+")":""}).text(function(a){var b=f(a);return b?b.name:""}),a.append("line").attr("class","place-label-link-"+c).attr("stroke","gray").attr("stroke-width",.25).attr("x1",function(a){var b=f(a);return b&&b.isRef?b.sx:0}).attr("y1",function(a){var b=f(a);return b&&b.isRef?b.sy:0}).attr("x2",function(a){var b=f(a);return b&&b.isRef?b.x-.6*b.name.length*o:0}).attr("y2",function(a){var b=f(a);return b&&b.isRef?b.y-3.5:0})})}),b.objects.hasOwnProperty("places")){var g=n["default"].feature(b,b.objects.places),h=g.features.map(function(a){var b=y(a.geometry.coordinates);return{x:b[0]+3.5,y:b[1]+3.5,width:a.properties.name.length*o,height:12,name:a.properties.name}}),i=g.features.map(function(a){var b=y(a.geometry.coordinates);return{x:b[0],y:b[1],r:2.5}});l["default"].labeler().label(h).anchor(i).width(r).height(s).start(100),a.selectAll(".place").data(i).enter().append("circle").attr("class","place").attr("transform",function(a){return"translate("+a.x+","+a.y+")"}).attr("r",function(a){return""+a.r+"px"}),a.selectAll(".place-label").data(h).enter().append("text").attr("class","place-label").attr("transform",function(a){return"translate("+a.x+","+a.y+")"}).text(function(a){return a.name})}});var B=a.reduce(function(a,b){var c=b.take();return c.reduce(function(a,b){var c=(b[k.dim]||"").toLowerCase();return a[c]=b[q.dim],a},a)},{});if(A.selectAll(".map-contour-"+u).data(n["default"].feature(b,b.objects[u]).features).call(function(){this.classed("map-contour",!0).attr("fill",function(a){var b,c=a.properties,e=["c1","c2","c3","abbr","name"].filter(function(a){return c.hasOwnProperty(a)&&c[a]&&B.hasOwnProperty(c[a].toLowerCase())});return 0===e.length?b=d.defaultFill:e.length>0&&(b=q(B[c[e[0]].toLowerCase()])),b})}),!g.dim||!h.dim)return[];var C=function(){return this.attr({r:function(a){var b=a.data;return i(b[i.dim])},transform:function(a){var b=a.data;return"translate("+y([b[h.dim],b[g.dim]])+")"},"class":function(a){var b=a.data;return j(b[j.dim])},opacity:.5})},D=function(){this.attr("class",function(a){return"frame-id-"+e.uid+" frame-"+a.hash}).call(function(){var a=this.selectAll("circle").data(function(a){return a.data.map(function(a){return{data:a,uid:e.uid}})});a.exit().remove(),a.call(C),a.enter().append("circle").call(C)})},E=function(a){return{tags:a.key||{},hash:a.hash(),data:a.take()}},F=A.selectAll(".frame-id-"+e.uid).data(a.map(E),function(a){return a.hash});return F.exit().remove(),F.call(D),F.enter().append("g").call(D),[]}},{key:"_createProjection",value:function(a,b,c){var d=this.W,e=this.H,f=this.config.guide,g=100,h=[d/2,e/2],i=c||a.center,j=f.projection||a.projection||"mercator",k=this._createD3Projection(j,i,g,h),m=l["default"].geo.path().projection(k),o=m.bounds(n["default"].feature(a,a.objects[b])),p=g*d/(o[1][0]-o[0][0]),q=g*e/(o[1][1]-o[0][1]);return g=q>p?p:q,h=[d-(o[0][0]+o[1][0])/2,e-(o[0][1]+o[1][1])/2],this._createD3Projection(j,i,g,h)}},{key:"_createD3Projection",value:function(a,b,c,d){var e=l["default"].geo[a];if(!e)throw console.log('Unknown projection "'+a+'"'),console.log("See available projection types here: https://github.com/mbostock/d3/wiki/Geo-Projections"),new Error('Invalid map: unknown projection "'+a+'"');var f=e(),g=[{method:"scale",args:c},{method:"center",args:b},{method:"translate",args:d}].filter(function(a){return a.args});return g.reduce(function(a,b){return a[b.method]&&(a=a[b.method](b.args)),a},f)}}]),a}();a.GeoMap=q}),e("elements/element.pie",["exports","../const","../utils/css-class-map"],function(c,d,e){"use strict";function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var g=function(){function a(a,b){for(var c=0;cs?s:0,q=0===u?1:(i-h)/u,a=function(a){var b=null!==a?parseFloat(a):0;if(!j["default"].isFinite(b))return p(i,i);var c=b-r;return p(h+m(c)*q,i)}}return a.scaleType="size",this.toBaseScale(a,b)}}]),b}(b.BaseScale);a.SizeScale=l}),e("scales/ordinal",["exports","./base","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);be&&(a=e),c>a&&(a=c),d(new Date(a))};return Object.keys(d).forEach(function(a){return e[a]=d[a]}),e.scaleType="time",e.stepSize=function(){return 0},this.toBaseScale(e,a)}}]),b}(b.BaseScale);a.TimeScale=l}),e("scales/linear",["exports","./base","../utils/utils","underscore","d3"],function(a,b,c,d,e){"use strict";function f(a){return a&&a.__esModule?a:{"default":a}}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(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)}Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function a(a,b){for(var c=0;ce&&(f=e),c>f&&(f=c),d(f)};return Object.keys(d).forEach(function(a){return e[a]=d[a]}),e.scaleType="linear",e.stepSize=function(){return 0},this.toBaseScale(e,a)}}]),b}(b.BaseScale);a.LinearScale=m}),e("scales/value",["exports","./base","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}Object.defineProperty(a,"__esModule",{value:!0});var h=function(){function a(a,b){for(var c=0;c1&&(b.status=n.FAIL,b.messages.push('There is more than one measure dimension for "'+c+'" axis'))):(b.status=n.FAIL,d?b.messages.push('"'+d+'" dimension is undefined for "'+c+'" axis'):b.messages.push('"'+c+'" axis should be specified')),b},{status:n.SUCCESS,countMeasureAxis:0,indexMeasureAxis:[],messages:[],axis:c})}function h(b){var c=l(b.x),d=l(b.y),e=Math.max(c.length,d.length),f=l(b.guide,{});a.times(e-f.length,function(){return f.push({})}),f=f.slice(0,e);var h=g(b.dimensions,c,"x"),i=g(b.dimensions,d,"y");return c=o[h.status](c,h,f),d=o[i.status](d,i,f),a.extend({},b,{x:c,y:d,guide:f})}function i(b,c){for(var d=c.x,e=c.y,f=c.guide,g=Math.max(d.length,e.length),h={type:"COORDS.RECT",unit:[]},i=[].concat(d),j=[].concat(e),l=[].concat(f),n=g;n>0;n--){var o=i.pop(),p=j.pop(),q=l.pop()||{};n===g?(h.x=o,h.y=p,h.unit.push(m(b,{x:k(o),y:k(p),color:c.color,size:c.size,flip:c.flip,colorGuide:q.color,sizeGuide:q.size})),h.guide=a.defaults(q,{x:{label:o},y:{label:p}})):h={type:"COORDS.RECT",x:k(o),y:k(p),unit:[h],guide:a.defaults(q,{x:{label:o},y:{label:p}})}}return c.spec={dimensions:c.dimensions,unit:h},c}Object.defineProperty(b,"__esModule",{value:!0});var j,k=(e(c),function(a){return a?a:null}),l=function(a){var b=void 0===arguments[1]?null:arguments[1];return d.utils.isArray(a)?0===a.length?[b]:a:[a]},m=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}},n={SUCCESS:"SUCCESS",WARNING:"WARNING",FAIL:"FAIL"},o=(j={},f(j,n.SUCCESS,function(a){return a}),f(j,n.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")}),f(j,n.WARNING,function(b,c,d){var e=c.axis,f=c.indexMeasureAxis[0],g=b[f],h=a.without(b,g);h.push(g);var i=d[f][e]||{},j=d[d.length-1][e]||{};return d[d.length-1][e]=i,d[f][e]=j,h}),j);b.normalizeConfig=h,b.transformConfig=i}),e("api/chart-interval",["exports","./converter-helpers"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a){var c=b.normalizeConfig(a);return b.transformConfig("ELEMENT.INTERVAL",c)};a.ChartInterval=c}),e("api/chart-scatterplot",["exports","./converter-helpers"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a){var c=b.normalizeConfig(a);return b.transformConfig("ELEMENT.POINT",c)};a.ChartScatterplot=c}),e("api/chart-line",["exports","../utils/utils","../data-processor","./converter-helpers"],function(b,c,d,e){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var f=function(b){var f=e.normalizeConfig(b),g=f.data,h=f.settings.log,i={none:function(a){return null},horizontal:function(a){var b=c.utils.isArray(a.x)?a.x:[a.x];return b[b.length-1]},vertical:function(a){var b=c.utils.isArray(a.y)?a.y:[a.y];return b[b.length-1]},auto:function(a){var b,e=c.utils.isArray(a.x)?a.x:[a.x],f=c.utils.isArray(a.y)?a.y:[a.y],i=e[e.length-1],j=e.slice(0,e.length-1),k=f[f.length-1],l=f.slice(0,f.length-1),m=a.color,n=j.concat(l).concat([m]).filter(function(a){return null!==a}),o=-1,p=[[[i].concat(n),k],[[k].concat(n),i]],q=p.some(function(a,b){var c=a[0],e=a[1],f=d.DataProcessor.isYFunctionOfX(g,c,[e]);return f.result?o=b:h(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+f.error.keyY+" values (e.g. "+f.error.errY.join(",")+")","for ("+f.error.keyX+" = "+f.error.valX+")."].join(" ")),f.result});return q?b=p[o][0][0]:(h(["All attempts are failed.","Will orient line horizontally by default.","NOTE: the [scatterplot] chart is more convenient for that data."].join(" ")),b=i),b}},j=(f.lineOrientation||"auto").toLowerCase(),k=i.hasOwnProperty(j)?i[j]:i.auto,l=k(f);return null!==l&&(f.data=a(g).sortBy(l)),e.transformConfig("ELEMENT.LINE",f)};b.ChartLine=f}),e("api/chart-interval-stacked",["exports","./converter-helpers"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a){var c=b.normalizeConfig(a);return b.transformConfig("ELEMENT.INTERVAL.STACKED",c)};a.ChartIntervalStacked=c}),e("api/chart-parallel",["exports"],function(b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c=function(b){var c=a.extend({columns:{}},b.guide||{}),d={},e=function(b,c){var e,f,g=void 0===arguments[2]?{}:arguments[2],h=c;return c?(e=""+b+"_"+c,f="/"):(e=""+b+":default",f="?"),d.hasOwnProperty(e)||(d[e]=a.extend({type:b,source:f,dim:h},g)),e},f=b.columns.map(function(a){return e(b.dimensions[a].scale,a,c.columns[a])});return{sources:{"?":{dims:{},data:[{}]},"/":{dims:Object.keys(b.dimensions).reduce(function(a,c){return a[c]={type:b.dimensions[c].type},a},{}),data:b.data}},scales:d,unit:{type:"COORDS.PARALLEL",expression:{operator:"none",source:"/"},columns:f,guide:c,units:[{type:"PARALLEL/ELEMENT.LINE",color:e("color",b.color,c.color),columns:f,expression:{operator:"none",source:"/"}}]},plugins:b.plugins||[]}};b.ChartParallel=c}),e("tau.charts",["exports","./utils/utils-dom","./utils/utils","./charts/tau.gpl","./charts/tau.plot","./charts/tau.chart","./unit-domain-period-generator","./formatter-registry","./units-registry","./scales-registry","./elements/coords.cartesian","./elements/coords.parallel","./elements/coords.geomap","./elements/element.point","./elements/element.line","./elements/element.pie","./elements/element.interval","./elements/element.interval.stacked","./elements/element.parallel.line","./scales/color","./scales/size","./scales/ordinal","./scales/period","./scales/time","./scales/linear","./scales/value","./scales/fill","./chart-alias-registry","./api/chart-map","./api/chart-interval","./api/chart-scatterplot","./api/chart-line","./api/chart-interval-stacked","./api/chart-parallel","./error"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var L={},M={},N={UnitDomainPeriodGenerator:i.UnitDomainPeriodGenerator},O={errorCodes:K.errorCodes,unitsRegistry:k.unitsRegistry,scalesRegistry:l.scalesRegistry,tickFormat:j.FormatterRegistry,isChartElement:e.utils.isChartElement,isLineElement:e.utils.isLineElement,d3:b,_:a,tickPeriod:i.UnitDomainPeriodGenerator,colorBrewers:{add:function(a,b){a in L||(L[a]=b)},get:function(a){return L[a]}},plugins:{add:function(a,b){if(a in M)throw new Error("Plugin is already registered.");M[a]=b},get:function(a){return M[a]||function(a){throw new Error(""+a+" plugin is not defined")}}},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}],fitModel:"normal",optimizeGuideBySize:!0,layoutEngine:"EXTRACT",autoRatio:!0,defaultSourceMap:["https://raw.githubusercontent.com","TargetProcess/tauCharts/master/src/addons","world-countries.json"].join("/"),getAxisTickLabelSize:a.memoize(d.utilsDom.getAxisTickLabelSize,function(a){return(a||"").length}),getScrollBarWidth:a.memoize(d.utilsDom.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"}}};g.Plot.globalSettings=O.globalSettings,O.unitsRegistry.reg("COORDS.RECT",m.Cartesian).reg("COORDS.MAP",o.GeoMap).reg("COORDS.PARALLEL",n.Parallel).reg("ELEMENT.POINT",p.Point).reg("ELEMENT.LINE",q.Line).reg("ELEMENT.INTERVAL",s.Interval).reg("ELEMENT.INTERVAL.STACKED",t.StackedInterval).reg("RECT",m.Cartesian).reg("POINT",p.Point).reg("INTERVAL",s.Interval).reg("LINE",q.Line).reg("PARALLEL/ELEMENT.LINE",u.ParallelLine).reg("PIE",r.Pie),O.scalesRegistry.reg("color",v.ColorScale).reg("fill",C.FillScale).reg("size",w.SizeScale).reg("ordinal",x.OrdinalScale).reg("period",y.PeriodScale).reg("time",z.TimeScale).reg("linear",A.LinearScale).reg("value",B.ValueScale);var P=[function(a){return a.data?[]:["[data] must be specified"]}];O.chartTypesRegistry=D.chartTypesRegistry.add("scatterplot",G.ChartScatterplot,P).add("line",H.ChartLine,P).add("bar",function(b){return F.ChartInterval(a.defaults({flip:!1},b))},P).add("horizontalBar",function(b){return F.ChartInterval(a.defaults({flip:!0},b))},P).add("horizontal-bar",function(b){return F.ChartInterval(a.defaults({flip:!0},b))},P).add("map",E.ChartMap,P.concat([function(a){var b=a.fill&&a.code;return a.fill&&!b?"[code] must be specified when using [fill]":void 0},function(a){var b=a.latitude&&a.longitude;return!a.latitude&&!a.longitude||b?void 0:"[latitude] and [longitude] both must be specified"}])).add("stacked-bar",function(b){return I.ChartIntervalStacked(a.defaults({flip:!1},b))},P).add("horizontal-stacked-bar",function(b){return I.ChartIntervalStacked(a.defaults({flip:!0},b))},P).add("parallel",J.ChartParallel,P.concat([function(a){var b=a.columns&&a.columns.length>1;return b?void 0:"[columns] property must contain at least 2 dimensions"}])),c.GPL=f.GPL,c.Plot=g.Plot,c.Chart=h.Chart,c.__api__=N,c.api=O}),e("underscore",function(){return a}),e("d3",function(){return b}),d("tau.charts")}),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;return 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(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).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(a){},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(a){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():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=i;i++)for(var j=-1;1>=j;j++)h.save(),h.translate(i*g.width,j*g.height),e.render(h),h.restore();var k=a.createPattern(g,"repeat");return k}},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(a){}},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(a){},f.Element.title.prototype=new f.Element.ElementBase,f.Element.desc=function(a){},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}),d("../bower_components/FileSaver.js/FileSaver",[],function(){return window.saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(a){"use strict";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}}(window)}),function(){"use strict";function a(a){return"function"==typeof a||"object"==typeof a&&null!==a}function b(a){return"function"==typeof a}function c(a){return"object"==typeof a&&null!==a}function e(){}function f(){return function(){process.nextTick(j)}}function g(){var a=0,b=new M(j),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function h(){var a=new MessageChannel;return a.port1.onmessage=j,function(){a.port2.postMessage(0)}}function i(){return function(){setTimeout(j,1)}}function j(){for(var a=0;J>a;a+=2){var b=O[a],c=O[a+1];b(c),O[a]=void 0,O[a+1]=void 0}J=0}function k(){}function l(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function n(a){try{return a.then}catch(b){return S.error=b,S}}function o(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function p(a,b,c){K(function(a){var d=!1,e=o(c,b,function(c){d||(d=!0,b!==c?s(a,c):u(a,c))},function(b){d||(d=!0,v(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,v(a,e))},a)}function q(a,b){b._state===Q?u(a,b._result):a._state===R?v(a,b._result):w(b,void 0,function(b){s(a,b)},function(b){v(a,b)})}function r(a,c){if(c.constructor===a.constructor)q(a,c);else{var d=n(c);d===S?v(a,S.error):void 0===d?u(a,c):b(d)?p(a,c,d):u(a,c)}}function s(b,c){b===c?v(b,l()):a(c)?r(b,c):u(b,c)}function t(a){a._onerror&&a._onerror(a._result),x(a)}function u(a,b){a._state===P&&(a._result=b,a._state=Q,0===a._subscribers.length||K(x,a))}function v(a,b){a._state===P&&(a._state=R,a._result=b,K(t,a))}function w(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+Q]=c,e[f+R]=d,0===f&&a._state&&K(x,a)}function x(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d,e,f=a._result,g=0;g1)throw new Error("Second argument not supported");if("object"!=typeof a)throw new TypeError("Argument must be an object");return e.prototype=a,new e},0),K=function(a,b){O[J]=a,O[J+1]=b,J+=2,2===J&&H()},L="undefined"!=typeof window?window:{},M=L.MutationObserver||L.WebKitMutationObserver,N="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,O=new Array(1e3);H="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?f():M?g():N?h():i();var P=void 0,Q=1,R=2,S=new y,T=new y;C.prototype._validateInput=function(a){return I(a)},C.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},C.prototype._init=function(){this._result=new Array(this.length)};var U=C;C.prototype._enumerate=function(){for(var a=this.length,b=this.promise,c=this._input,d=0;b._state===P&&a>d;d++)this._eachEntry(c[d],d)},C.prototype._eachEntry=function(a,b){var d=this._instanceConstructor;c(a)?a.constructor===d&&a._state!==P?(a._onerror=null,this._settledAt(a._state,b,a._result)):this._willSettleAt(d.resolve(a),b):(this._remaining--,this._result[b]=this._makeResult(Q,b,a))},C.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===P&&(this._remaining--,this._abortOnReject&&a===R?v(d,c):this._result[b]=this._makeResult(a,b,c)),0===this._remaining&&u(d,this._result)},C.prototype._makeResult=function(a,b,c){return c},C.prototype._willSettleAt=function(a,b){var c=this;w(a,void 0,function(a){c._settledAt(Q,b,a)},function(a){c._settledAt(R,b,a)})};var V=function(a,b){return new U(this,a,!0,b).promise},W=function(a,b){function c(a){s(f,a)}function d(a){v(f,a)}var e=this,f=new e(k,b);if(!I(a))return v(f,new TypeError("You must pass an array to race.")),f;for(var g=a.length,h=0;f._state===P&&g>h;h++)w(e.resolve(a[h]),void 0,c,d);return f},X=function(a,b){var c=this;if(a&&"object"==typeof a&&a.constructor===c)return a;var d=new c(k,b);return s(d,a),d},Y=function(a,b){var c=this,d=new c(k,b);return v(d,a),d},Z=0,$=F;F.all=V,F.race=W,F.resolve=X,F.reject=Y,F.prototype={constructor:F,then:function(a,b){var c=this,d=c._state;if(d===Q&&!a||d===R&&!b)return this;var e=new this.constructor(k),f=c._result;if(d){var g=arguments[d-1];K(function(){A(d,e,g,f)})}else w(c,e,a,b);return e},"catch":function(a){return this.then(null,a)}};var _=function(){var a;a="undefined"!=typeof global?global:"undefined"!=typeof window&&window.document?window:self;var c="Promise"in a&&"resolve"in a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var c;return new a.Promise(function(a){c=a}),b(c)}();c||(a.Promise=$)},aa={Promise:$,polyfill:_};"function"==typeof d&&d.amd?d("../bower_components/es6-promise/promise",[],function(){return aa}):"undefined"!=typeof module&&module.exports?module.exports=aa:"undefined"!=typeof this&&(this.ES6Promise=aa)}.call(this),d("../node_modules/requirejs-text/text",["module"],function(a){"use strict";var b,d,e,f,g,h=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,j=/]*>\s*([\s\S]+)\s*<\/body>/im,k="undefined"!=typeof location&&location.href,l=k&&location.protocol&&location.protocol.replace(/\:/,""),m=k&&location.hostname,n=k&&(location.port||void 0),o={},p=a.config&&a.config()||{};return b={version:"2.0.12",strip:function(a){if(a){a=a.replace(i,"");var b=a.match(j);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=h[b];try{a=new ActiveXObject(c)}catch(d){}if(a){h=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.indexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1,a.length)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,d,e){var f,g,h,i=b.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==c||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,c,d,e){d=c?b.strip(d):d,p.isBuild&&(o[a]=d),e(d)},load:function(a,c,d,e){if(e&&e.isBuild&&!e.inlineText)return void d();p.isBuild=e&&e.isBuild;var f=b.parseName(a),g=f.moduleName+(f.ext?"."+f.ext:""),h=c.toUrl(g),i=p.useXhr||b.useXhr;return 0===h.indexOf("empty:")?void d():void(!k||i(h,l,m,n)?b.get(h,function(c){b.finishLoad(a,f.strip,c,d)},function(a){d.error&&d.error(a)}):c([g],function(a){b.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)}))},write:function(a,c,d,e){if(o.hasOwnProperty(c)){var f=b.jsEscape(o[c]);d.asModule(a+"!"+c,"define(function () { return '"+f+"';});\n")}},writeFile:function(a,c,d,e,f){var g=b.parseName(c),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";b.load(i,d,function(c){var d=function(a){return e(j,a)};d.asModule=function(a,b){return e.asModule(a,j,b)},b.write(a,i,d,f)},f)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(d=c.nodeRequire("fs"),b.get=function(a,b,c){try{var e=d.readFileSync(a,"utf8");0===e.indexOf("\ufeff")&&(e=e.substring(1)),b(e)}catch(f){c&&c(f)}}):"xhr"===p.env||!p.env&&b.createXhr()?b.get=function(a,c,d,e){var f,g=b.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);p.onXhr&&p.onXhr(g,a),g.onreadystatechange=function(b){var e,f;4===g.readyState&&(e=g.status||0,e>399&&600>e?(f=new Error(a+" HTTP status: "+e),f.xhr=g,d&&d(f)):c(g.responseText),p.onXhrComplete&&p.onXhrComplete(g,a))},g.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?b.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),null!==d&&c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(e=Components.classes,f=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),g="@mozilla.org/windows-registry-key;1"in e,b.get=function(a,b){var c,d,h,i={};g&&(a=a.replace(/\//g,"\\")),h=new FileUtils.File(a);try{c=e["@mozilla.org/network/file-input-stream;1"].createInstance(f.nsIFileInputStream),c.init(h,1,0,!1),d=e["@mozilla.org/intl/converter-input-stream;1"].createInstance(f.nsIConverterInputStream),d.init(c,"utf-8",c.available(),f.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),d.readString(c.available(),i),d.close(),c.close(),b(i.value)}catch(j){throw new Error((h&&h.path||"")+": "+j)}}),b}),d("../node_modules/requirejs-text/text!print.style.css",[],function(){return"body > * {\r\n visibility: hidden;\r\n}\r\nbody {\r\n overflow: hidden;\r\n}\r\nbody * {\r\n visibility: hidden !important;\r\n}\r\n\r\n.graphical-report__print-block {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n visibility: visible !important;\r\n display: block !important;\r\n width: 100%;\r\n /*height: 100%;*/\r\n}\r\n"}),function(){"use strict";function a(b){this.map={};var c=this;b instanceof a?b.forEach(function(a,b){b.forEach(function(b){c.append(a,b)})}):b&&Object.getOwnPropertyNames(b).forEach(function(a){c.append(a,b[a])})}function b(a){return a.bodyUsed?Promise.reject(new TypeError("Already read")):void(a.bodyUsed=!0)}function c(a){return new Promise(function(b,c){a.onload=function(){b(a.result)},a.onerror=function(){c(a.error)}})}function d(a){var b=new FileReader;return b.readAsArrayBuffer(a),c(b)}function e(a){var b=new FileReader;return b.readAsText(a),c(b)}function f(){return this.bodyUsed=!1,l?(this.blob=function(){var a=b(this);return a?a:Promise.resolve(this._bodyBlob)},this.arrayBuffer=function(){return this.blob().then(d)},this.text=function(){return this.blob().then(e)}):this.text=function(){var a=b(this);return a?a:Promise.resolve(this._bodyText)},"FormData"in self&&(this.formData=function(){return this.text().then(i)}),this.json=function(){return this.text().then(JSON.parse)},this}function g(a){var b=a.toUpperCase();return m.indexOf(b)>-1?b:a}function h(b,c){c=c||{},this.url=b,this._body=c.body,this.credentials=c.credentials||"omit",this.headers=new a(c.headers),this.method=g(c.method||"GET"),this.mode=c.mode||null,this.referrer=null}function i(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function j(b){var c=new a,d=b.getAllResponseHeaders().trim().split("\n");return d.forEach(function(a){var b=a.trim().split(":"),d=b.shift().trim(),e=b.join(":").trim();c.append(d,e)}),c}function k(a,b){b||(b={}),l?"string"==typeof a?this._bodyBlob=new Blob([a]):this._bodyBlob=a:this._bodyText=a,this.type="default",this.url=null,this.status=b.status,this.statusText=b.statusText,this.headers=b.headers,this.url=b.url||""}if(!self.fetch){a.prototype.append=function(a,b){a=a.toLowerCase();var c=this.map[a];c||(c=[],this.map[a]=c),c.push(b)},a.prototype["delete"]=function(a){delete this.map[a.toLowerCase()]},a.prototype.get=function(a){var b=this.map[a.toLowerCase()];return b?b[0]:null},a.prototype.getAll=function(a){return this.map[a.toLowerCase()]||[]},a.prototype.has=function(a){return this.map.hasOwnProperty(a.toLowerCase())},a.prototype.set=function(a,b){this.map[a.toLowerCase()]=[b]},a.prototype.forEach=function(a){var b=this;Object.getOwnPropertyNames(this.map).forEach(function(c){a(c,b.map[c])})};var l="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(a){return!1}}(),m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.fetch=function(){var a=this;return new Promise(function(b,c){function d(){return"responseURL"in e?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):void 0}var e=new XMLHttpRequest;e.onload=function(){var a=1223===e.status?204:e.status;if(100>a||a>599)return void c(new TypeError("Network request failed"));var f={status:a,statusText:e.statusText,headers:j(e),url:d()},g="response"in e?e.response:e.responseText;b(new k(g,f))},e.onerror=function(){c(new TypeError("Network request failed"))},e.open(a.method,a.url),"responseType"in e&&l&&(e.responseType="blob"),a.headers.forEach(function(a,b){b.forEach(function(b){e.setRequestHeader(a,b)})}),e.send(void 0===a._body?null:a._body)})},f.call(h.prototype), -f.call(k.prototype),self.Headers=a,self.Request=h,self.Response=k,self.fetch=function(a,b){return new h(a,b).fetch()},self.fetch.polyfill=!0}}(),d("../bower_components/fetch/fetch",function(){}),function(a){"function"==typeof d&&d.amd?d("export",["tauCharts","canvg","FileSaver","promise","print.style.css","fetch"],function(b,c,d,e,f){return window.Promise=window.Promise||e.Promise,a(b,c,d,window.Promise,f)}):a(this.tauCharts,this.canvg,this.saveAs)}(function(a,b,c,d,e){function f(a){return Math.log(a)/Math.LN10}function g(e){return{_createDataUrl:function(a){var c=this._cssPaths.map(function(a){return fetch(a).then(function(a){return a.text()})});return d.all(c).then(function(a){return a.join(" ")}).then(function(c){var d=o(c),e=document.createElement("div"),f=a.getSVG().cloneNode(!0);e.appendChild(f),i.select(f).attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg"),f.insertBefore(d,f.firstChild),this._renderAdditionalInfo(f,a);var g=document.createElement("canvas");return g.height=f.getAttribute("height"),g.width=f.getAttribute("width"),b(g,f.parentNode.innerHTML),g.toDataURL("image/png")}.bind(this))},_findUnit:function(a){var b=a.getConfig(),c=a.getConfig(),d=function(a){var b=c.scales[a];return b&&b.dim&&b.source&&c.sources[b.source].dims[b.dim]};return k(b.unit,function(a){if(d(a.color))return!0;if(d(a.size)){var b=c.scales[a.size];return"measure"===c.sources[b.source].dims[b.dim].type}})},_toPng:function(a){this._createDataUrl(a).then(function(a){for(var b=atob(a.substring("data:image/png;base64,".length)),d=new Uint8Array(b.length),e=0,f=b.length;f>e;++e)d[e]=b.charCodeAt(e);var g=new Blob([d.buffer],{type:"image/png"});c(g,(this._fileName||"export")+".png")}.bind(this))},_toPrint:function(a){this._createDataUrl(a).then(function(a){h=document.createElement("img"),h.classList.add("graphical-report__print-block");var b=h;document.body.appendChild(b),b.src=a,document.head.appendChild(p),b.onload=function(){window.print()}})},_renderColorLegend:function(a,b,c,d){var f=this._unit.color,g=this._unit.color.dim;a.guide=a.guide||{},a.guide.color=a.guide.color||{};var h=j.isObject(a.guide.color.label)?a.guide.color.label.text:a.guide.color.label,i=h||f.dim,k=this._getColorMap(c.getData({excludeFilter:["legend"]}),f,g).values,l=function(){this.attr("transform",function(a,b){return"translate(5,"+20*(b+1)+")"}),this.append("circle").attr("r",6).attr("class",function(a){return a.color}),this.append("text").attr("x",12).attr("y",5).text(function(a){return j.escape(m(a.label)?"No "+i:a.label)}).style({"font-size":e.fontSize+"px"})},n=b.append("g").attr("class","legend").attr("transform","translate("+(d+10)+","+e.paddingTop+")");return n.append("text").text(i.toUpperCase()).style({"text-transform":"uppercase","font-weight":"600","font-size":e.fontSize+"px"}),n.selectAll("g").data(k).enter().append("g").call(l),{h:20*k.length+20,w:0}},_renderSizeLegend:function(a,b,c,d,g){var h=this._unit.size,i=this._unit.size.scaleDim;a.guide=a.guide||{},a.guide.size=this._unit.config.guide.size;var k,m=a.guide.size.label.text||i,n=j.sortBy(c.getData(),function(a){return h(a[i])}),o=n.length,p=n[0][i],q=n[o-1][i];if(q-p){var r=f(q-p),s=0>4-r?0:Math.round(4-r),t=Math.pow(10,s),u=(q-p)/5;k=j([p,p+u,p+2*u,p+3*u,q]).chain().map(function(a){return a===q||a===p?a:Math.round(a*t)/t}).unique().value()}else k=[p];var v=k.map(function(b){var c=h(b);return{diameter:l(2*c+2),radius:c,value:b,className:a.color?"color-definite":""}}.bind(this)).reverse(),w=Math.max.apply(null,j.pluck(v,"diameter")),x=e.fontSize,y=0,z=function(){this.attr("transform",function(a){y+=w;var b="translate(5,"+y+")";return y+=10,b}),this.append("circle").attr("r",function(a){return a.radius}).attr("class",function(a){return a.className}).style({opacity:.4}),this.append("g").attr("transform",function(a){return"translate("+w+","+x/2+")"}).append("text").attr("x",function(a){return 0}).attr("y",function(a){return 0}).text(function(a){return a.value}).style({"font-size":x+"px"})},A=b.append("g").attr("class","legend").attr("transform","translate("+(d+10)+","+(e.paddingTop+g.h+20)+")");A.append("text").text(m.toUpperCase()).style({"text-transform":"uppercase","font-weight":"600","font-size":x+"px"}),A.selectAll("g").data(v).enter().append("g").call(z)},_renderAdditionalInfo:function(a,b){var c=this._findUnit(b);if(c){var d={h:0,w:0},e=b.getConfig();a=i.select(a);var f=parseInt(a.attr("width"),10);a.attr("height");a.attr("width",f+160);var g=function(a){var b=e.scales[a];return b&&b.dim&&b.source&&e.sources[b.source].dims[b.dim]};if(g(c.color)){var h=this._renderColorLegend(c,a,b,f);d.h=h.h,d.w=h.w}var e=b.getConfig(),j=e.scales[c.size];c.size&&j.dim&&"measure"===e.sources[j.source].dims[j.dim].type&&this._renderSizeLegend(c,a,b,f,d)}},onUnitDraw:function(b,c){a.api.isChartElement(c)&&(this._unit=c)},_getColorMap:function(a,b,c){return j(a).chain().map(function(a){var d=a[c];return{color:b(d),value:d,label:d}}).uniq(function(a){return a.value}).value().reduce(function(a,b){return a.brewer[b.value]=b.color,a.values.push(b),a},{brewer:{},values:[]})},_select:function(a,b){a=a||"";var c=this["_to"+a.charAt(0).toUpperCase()+a.slice(1)];c&&c.call(this,b)},_handleMenu:function(a,b,c){a.addEventListener("click",function(a){if("a"===a.target.tagName.toLowerCase()){var d=a.target.getAttribute("data-value");this._select(d,b),c.hide()}}.bind(this)),a.addEventListener("mouseover",function(a){"a"===a.target.tagName.toLowerCase()&&a.target.focus()}.bind(this)),a.addEventListener("keydown",function(a){if(a.keyCode===n.ESCAPE&&c.hide(),a.keyCode===n.DOWN&&(a.target.parentNode.nextSibling?a.target.parentNode.nextSibling.childNodes[0].focus():a.target.parentNode.parentNode.firstChild.childNodes[0].focus()),a.keyCode===n.UP&&(a.target.parentNode.previousSibling?a.target.parentNode.previousSibling.childNodes[0].focus():a.target.parentNode.parentNode.lastChild.childNodes[0].focus()),a.keyCode===n.ENTER){var d=a.target.getAttribute("data-value");this._select(d,b)}a.preventDefault()}.bind(this));var d=null,e=t(),f=e?"focusin":"focus",g=e?"focusout":"blur";a.addEventListener(g,function(){d=setTimeout(function(){c.hide()},100)},!e),a.addEventListener(f,function(){clearTimeout(d)},!e),this._container.addEventListener("click",function(){c.toggle(),c.hidden||a.querySelectorAll("a")[0].focus()})},init:function(b){e=e||{},this._cssPaths=e.cssPaths,this._fileName=e.fileName,this._cssPaths||(this._cssPaths=[],a.api.globalSettings.log('[export plugin]: the "cssPath" parameter should be specified for correct operation',"warn")),e=j.defaults(e,{fontSize:13,paddingTop:30}),this._container=b.insertToHeader('Export>');var c=b.addBalloon({place:"bottom-left"});this._popup=c,c.content(['"].join("")),c.attach(this._container);var d=c.getElement();d.setAttribute("tabindex","-1"),this._handleMenu(d,b,c),b.on("exportTo",function(a,b){this._select(b,a)}.bind(this))},destroy:function(){this._popup&&this._popup.destroy()}}}var h,i=a.api.d3,j=a.api._,k=function(a,b){if(b(a))return a;var c,d,e,f=a.units||[];for(c=0;c',_template:e.template('
<%=name%>
<%=items%>
'),_itemTemplate:e.template(["
\">",'
<%=label%>',"
"].join("")),_itemSizeTemplate:e.template(['
','
','',"
<%=value%>","
"].join("")),_renderColorLegend:function(a,b){var c=b.getConfig(),d=function(a){var b=c.scales[a];return b&&b.dim&&b.source&&c.sources[b.source].dims[b.dim]};if(d(a.color)){var f=this._unit.color,h=this._unit.color.dim;a.guide=a.guide||{},a.guide.color=a.guide.color||{};var i=e.isObject(a.guide.color.label)?a.guide.color.label.text:a.guide.color.label,j=i||f.dim,k=this._getColorMap(b.getData({excludeFilter:["legend"]}),f,h);b.configGPL.scales[this._unit.config.color].brewer=k.brewer;var l=e.reduce(k.values,function(a,b){var c={dimension:h,value:b.value},d=JSON.stringify(c),f=e.escape(g(b.label)?"No "+j:b.label);return a.items.push(this._itemTemplate({color:b.color,classDisabled:this._currentFilters[d]?"disabled":"",label:f,value:e.escape(d)})),a.storageValues[d]=e.extend({color:b.color},c),a},{items:[],storageValues:{}},this);this._storageValues=l.storageValues,this._container.insertAdjacentHTML("beforeend",this._template({items:l.items.join(""),name:j})),this._colorScaleSize=l.items.length}},_renderSizeLegend:function(a,c){var f=c.getConfig(),g=f.scales[a.size];if(a.size&&g.dim&&"measure"===f.sources[g.source].dims[g.dim].type){var h=this._unit.size,i=this._unit.size.scaleDim;a.guide=a.guide||{},a.guide.size=this._unit.config.guide.size;var j,k=a.guide.size.label.text||i,l=e.sortBy(c.getData(),function(a){return h(a[i])}),m=l.length,n=l[0][i],o=l[m-1][i];if(o-n){var p=b(o-n),q=Math.round(4-p),r=Math.pow(10,q),s=(o-n)/5,t=[n,n+s,n+2*s,n+3*s,o];j=e(t).chain().map(function(a){return a===o||a===n?a:Math.round(a*r)/r}).unique().value()}else j=[n];var u=e.map(j,function(b){var c=h(b);return this._itemSizeTemplate({diameter:d(2*c+2),radius:c,value:b,className:a.color?"color-definite":"color-default-size"})},this).reverse();this._container.insertAdjacentHTML("beforeend",this._template({items:u.join(""),name:k}))}},onRender:function(a){if(this._container){this._container.innerHTML="";var b=this._findUnit(a);this._renderColorLegend(b,a),this._renderSizeLegend(b,a)}}}};return a.api.plugins.add("legend",h),h}),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(),e=this._findDimensionGuides(d),f=c.reduce(e,function(a,b,d){return a[d]=c.last(b),a},{}),g=this._generateDefaultFormatters(f,d.scales);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(a){},onUnitDraw:function(b,c){if(a.api.isChartElement(c)){var d=this._generateKey(c.config.options.uid);this._unitMeta[d]=c;var e=c.config.frames.reduce(function(a,b){return a.concat(b.data)},[]);this._dataWithCoords[d]=e.map(function(a){return{x:c.xScale(a[c.xScale.dim]),y:c.yScale(a[c.yScale.dim]),item:a}},this)}},renderItem:function(a,b,c,d){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(a){},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 b.label?(a[c]=b.label,b.label.hasOwnProperty("text")&&(a[c]=b.label.text)):a[c]=c,a},{})},_generateDefaultFormatters:function(b,d){return c.reduce(b,function(b,c,d){var e=function(b){if(null==b)return null;var d=c.tickPeriod||c.tickFormat;if(d){var e="x-time-auto"===d?"day":d;return a.api.tickFormat.get(e)(b)}return c.tickLabel?b[c.tickLabel]:b};return b[d]=function(a){var b=e(a);return null==b?"No "+c.label:b},b},{})},_findDimensionGuides:function(a){var b={},c=a.scales,d=function(a,d){var e=d[a];if(e){var f=(d.guide||{})[a],g=c[e].dim;if(g&&f){var h=f.tickLabel?g.replace(new RegExp("\\."+f.tickLabel),""):g;b[h]||(b[h]=[]),b[h].push(f)}}};return f(a.unit,function(a){return d("x",a),d("y",a),d("color",a),d("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.dim,a.color&&a.color.dim],d=[],e=[];a=a.parentUnit;)d.push(a.xScale.dim),e.push(a.yScale.dim);return c.compact(b.concat(e,d).reverse())},_handleLineElement:function(a,b,e){var f=a.elementData,g=this._dataWithCoords[b],h=g.filter(function(a){return c.contains(f.data,a.item)});if(1===h.length)return h[0].item;var i=c.reduce(h,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?i:[]},a.traverseSpec(e,function(a,c){if(f.predicateIsApplicable(e,a,c)){var d=e.scales[a.x],g=e.scales[a.y],h=JSON.parse(JSON.stringify(a));h.type="ELEMENT.LINE",h.transformation=h.transformation||[],h.transformation.push({type:"regression",args:{type:b.type,x:d.dim,y:g.dim}}),h.guide=h.guide||{},h.guide.cssClass="graphical-report__trendline",h.guide.widthCssClass="graphical-report__line-width-1",c.units.push(h)}}))},containerTemplate:'
',template:d.template(['","
",'","
",'
<%= error %>
'].join("")),onRender:function(a){if(this._container){this._container.innerHTML=this.template({title:"Trend line",error:this._error,showTrend:b.showTrend&&this._isApplicable?"checked":"",models:b.models.map(function(a){var c=b.type===a?"selected":"";return""})});var c=function(a){return function(){e.select(this).classed({active:a,"graphical-report__line-width-1":!a,"graphical-report__line-width-3":a})}},d=e.select(a.getSVG());d.selectAll(".graphical-report__trendline").on("mouseenter",c(!0)).on("mouseleave",c(!1))}}}}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&&ga[g]-a[h]?f:g;for(var k=Math.abs(1/(a[j]-i)),l=0,m=0,n=0,o=0,p=0,q=f;g>=q;){var r,s=a[q],t=b[q];r=h>q?i-s:s-i;var u=d(r*k),v=s*u;l+=u,m+=v,n+=s*v,o+=t*u,p+=t*v,q++}var w,x=m/l,y=o/l,z=p/l,A=n/l;w=A==x*x?0:(z-x*y)/(A-x*x);var B=y-w*x;e[h]=w*i+B}return e}return{equation:"loess",points:b(a,.5),string:"loess"}}};return function(a,c,d){return"string"==typeof a?b[a](c,d):void 0}}(),d=a.api._,e=a.api.d3;return a.api.plugins.add("trendline",b),b}); \ No newline at end of file +return a.every(d,function(a){return a(b)})})}}),this.onUnitDraw=b.onUnitDraw,this.onUnitsStructureExpanded=b.onUnitsStructureExpanded||function(a){return a}}return m(d,c),n(d,[{key:"renderTo",value:function(c,d){var e=b.select(c);this.config.settings.size=d||a.defaults(f.utilsDom.getContainerSize(e.node())),this.root=this._expandUnitsStructure(this.config.unit),this._adaptSpecToUnitsStructure(this.root,this.config),this.onUnitsStructureExpanded(this.config);var g=e.selectAll("svg").data([1]),h=this.config.settings.size,i={"class":""+j.CSS_PREFIX+"svg",width:h.width,height:h.height};g.attr(i),g.enter().append("svg").attr(i).append("g").attr("class",""+j.CSS_PREFIX+"cell cell frame-root"),this.root.options={container:e.select(".frame-root"),frameId:"root",left:0,top:0,width:h.width,height:h.height},this._drawUnitsStructure(this.root,this._datify({source:this.root.expression.source,pipe:[]}))}},{key:"_expandUnitsStructure",value:function(a){var b=this,c=void 0===arguments[1]?[]:arguments[1],d=this;if(a.expression.operator!==!1){var f=this._parseExpression(a.expression,c);a.transformation=a.transformation||[],a.frames=f.exec().map(function(b){var g=f.inherit?c:[],h=g.concat([{type:"where",args:b}]).concat(a.transformation),i={source:f.source,pipe:h};return b&&(i.key=b),i.units=a.units?a.units.map(function(a){var b=e.utils.clone(a);return b.guide=a.guide,b}):[],d._datify(i)})}return a.frames.forEach(function(a){return a.units.forEach(function(c){return b._expandUnitsStructure(c,a.pipe)})}),a}},{key:"_adaptSpecToUnitsStructure",value:function(a,b){var c=this,d=this.unitSet.get(a.type);return d.embedUnitFrameToSpec&&d.embedUnitFrameToSpec(a,b),a.frames.forEach(function(a){return a.units.forEach(function(a){return c._adaptSpecToUnitsStructure(a,b)})}),a}},{key:"_drawUnitsStructure",value:function(a,b){var c=void 0===arguments[2]?null:arguments[2],d=this,e=d.unitSet.get(a.type),f=new e(a);return f.parentUnit=c,f.drawLayout(function(a,c,e){var f=c?c:""+a+":default";return d.scalesCreator.create(d.scales[f],b,e)}).drawFrames(a.frames,function(a){return function(b,c){d._drawUnitsStructure.bind(d)(b,c,a)}}(f)),d.onUnitDraw&&d.onUnitDraw(f),a}},{key:"_datify",value:function(a){var b=this.sources[a.source].data,c=this.transformations,d=function(a,b){return c[b.type](a,b.args)};return a.hash=function(){return e.utils.generateHash([a.pipe,a.key,a.source].map(JSON.stringify).join(""))},a.take=function(){return a.pipe.reduce(d,b)},a.partByDims=function(c){return a.pipe.map(function(a){var b={};return"where"===a.type&&a.args?(b.type=a.type,b.args=c.reduce(function(b,c){return a.args.hasOwnProperty(c)&&(b[c]=a.args[c]),b},{})):b=a,b}).reduce(d,b)},a.data=a.take(),a}},{key:"_parseExpression",value:function(a,b){var c=this,d=a.operator||"none",e=a.source,f=a.inherit!==!1,g=a.params,h=this.sources[e],i=f?function(){return b.reduce(function(a,b){return c.transformations[b.type](a,b.args)},h.data)}:function(){return h.data},j=k.FramesAlgebra[d];if(!j)throw new Error(""+d+" operator is not supported");return{source:e,inherit:f,func:j,args:g,exec:function(){return j.apply(null,[i].concat(g))}}}}]),d}(d.Emitter);c.GPL=q}),e("api/balloon",["exports","../const"],function(a,b){"use strict";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=k.pageYOffset||n.scrollTop,e=k.pageXOffset||n.scrollLeft,f={left:0,right:0,top:0,bottom:0,width:0,height:0};if(d(a))f.width=k.innerWidth||n.clientWidth,f.height=k.innerHeight||n.clientHeight;else{if(!n.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-n.clientTop,f.left=f.left+e-n.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(p(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(q(h.defaults),b),this._createElement(),void(a&&this.content(a))):new h(a,b)}Object.defineProperty(a,"__esModule",{value:!0});var i=function(a){return{add:function(b){a.classList.add(b)},remove:function(b){a.classList.remove(b)}}},j=function(a,b){return a.indexOf(b)},k=window,l=k.document,m=l.body,n=l.documentElement,o=["top","bottom"],p=k.getComputedStyle;g.propName=function(){for(var a=l.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,m.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(a,b){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,m.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||m.removeChild(this.element),this.element=this.options=null},h.prototype._aware=function(){var a=j(h.winAware,this);-1===a&&h.winAware.push(this)},h.prototype._unaware=function(){var a=j(h.winAware,this);-1!==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:b.CSS_PREFIX+"tooltip",typeClass:null,effectClass:null,inClass:"in",place:"top",spacing:null,auto:0},a.Tooltip=h}),e("plugins",["exports","d3","./utils/utils"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c=0&&(a[b]=new Date(a[b])),a},b)})}},{key:"ruleAssignSourceDims",value:function(a,b){var c=a.spec.dimensions;b.sources["/"].dims=Object.keys(c).reduce(function(a,b){return a[b]={type:c[b].type},a},{})}},{key:"ruleAssignStructure",value:function(a,b){var d=this,e=function h(a){var b=c.utils.clone(g["default"].omit(a,"unit"));return b.expression=d.ruleInferExpression(a),d.ruleCreateScales(a,b),a.unit&&(b.units=a.unit.map(h)),b},f=e(a.spec.unit);f.expression.inherit=!1,b.unit=f}},{key:"ruleCreateScales",value:function(a,b){var c=this,d=a.guide||{};["color","size","x","y"].forEach(function(e){a.hasOwnProperty(e)&&(b[e]=c.scalesPool(e,a[e],d[e]||{}))})}},{key:"ruleInferDim",value:function(a,b){var c=a,d=this.spec.spec.dimensions;if(!d.hasOwnProperty(c))return c;b.hasOwnProperty("tickLabel")?c=""+a+"."+b.tickLabel:d[a].value&&(c=""+a+"."+d[a].value);var e=this.dist.sources["/"].dims;return e.hasOwnProperty(c)||(e[c]={type:e[a].type}),c}},{key:"scalesPool",value:function(a,b,c){var d=""+a+"_"+b;if(this.dist.scales.hasOwnProperty(d))return d;var e=this.spec.spec.dimensions,f={};return"color"===a&&null!==b&&(f={type:"color",source:"/",dim:this.ruleInferDim(b,c)},c.hasOwnProperty("brewer")&&(f.brewer=c.brewer)),"size"===a&&null!==b&&(f={type:"size",source:"/",dim:this.ruleInferDim(b,c),min:2,max:10,mid:5}),!e.hasOwnProperty(b)||"x"!==a&&"y"!==a||(f={type:e[b].scale,source:"/",dim:this.ruleInferDim(b,c)},e[b].hasOwnProperty("order")&&(f.order=e[b].order),c.hasOwnProperty("min")&&(f.min=c.min),c.hasOwnProperty("max")&&(f.max=c.max),c.hasOwnProperty("autoScale")?f.autoScale=c.autoScale:f.autoScale=!0,c.hasOwnProperty("tickPeriod")&&(f.period=c.tickPeriod),f.fitToFrameByDims=c.fitToFrameByDims,f.ratio=c.ratio),this.dist.scales[d]=f,d}},{key:"ruleInferExpression",value:function(a){var b={operator:"none",params:[]},c=a.guide||{},d=c.x||{},e=c.y||{};return 0===a.type.indexOf("ELEMENT.")?a.color&&(b={operator:"groupBy",params:[this.ruleInferDim(a.color,c.color||{})]}):"COORDS.RECT"===a.type&&1===a.unit.length&&"COORDS.RECT"===a.unit[0].type&&(b=d.tickPeriod||e.tickPeriod?{operator:"cross_period",params:[this.ruleInferDim(a.x,d),this.ruleInferDim(a.y,e),d.tickPeriod,e.tickPeriod]}:{operator:"cross",params:[this.ruleInferDim(a.x,d),this.ruleInferDim(a.y,e)]}),g["default"].extend({inherit:!0,source:"/"},b)}}]),a}();a.SpecConverter=h}),e("utils/utils-draw",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b={translate:function(a,b){return"translate("+a+","+b+")"},rotate:function(a){return"rotate("+a+")"},getOrientation:function(a){return["bottom","top"].indexOf(a.toLowerCase())>=0?"h":"v"},isIntersect:function(a,b,c,d,e,f,g,h){var i,j,k,l;i=c-a,j=d-b,k=g-e,l=h-f;var m,n;return m=(-j*(a-e)+i*(b-f))/(-k*j+i*l),n=(k*(b-f)-l*(a-e))/(-k*j+i*l),m>=0&&1>=m&&n>=0&&1>=n}};a.utilsDraw=b}),e("formatter-registry",["exports","d3"],function(b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0});var e=d(c),f={"x-num-auto":function(a){var b=parseFloat(a.toFixed(2));return Math.abs(b)<1?b.toString():e["default"].format("s")(b)},percent:function(a){var b=parseFloat((100*a).toFixed(2));return b.toString()+"%"},day:e["default"].time.format("%d-%b-%Y"),"day-short":e["default"].time.format("%d-%b"),week:e["default"].time.format("%d-%b-%Y"),"week-short":e["default"].time.format("%d-%b"),month:function(a){var b=new Date(a),c=b.getMonth(),d=0===c?"%B, %Y":"%B";return e["default"].time.format(d)(a)},"month-short":function(a){var b=new Date(a),c=b.getMonth(),d=0===c?"%b '%y":"%b";return e["default"].time.format(d)(a)},"month-year":e["default"].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:e["default"].time.format("%Y"),"x-time-auto":null},g={get:function(b,c){var d=c||"",g=function(a){return(null===a||"undefined"==typeof a?d:a).toString()},h=f.hasOwnProperty(b),i=h?f[b]:g;return h&&(i=f[b]),!h&&b&&(i=function(c){var d=a.isDate(c)?e["default"].time.format(b):e["default"].format(b);return d(c)}),h||b||(i=g),i},add:function(a,b){f[a]=b}};b.FormatterRegistry=g}),e("spec-transform-auto-layout",["exports","underscore","./utils/utils","./utils/utils-draw","./formatter-registry","./utils/utils-dom","./scales-factory"],function(a,b,c,d,e,f,g){"use strict";function h(a){return a&&a.__esModule?a:{"default":a}}function i(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function j(a,b,c,d){var e=a.hasOwnProperty(c)?a[c]:{};e=e||{},l["default"].each(d,function(a){l["default"].extend(b.guide[c][a],e[a])}),l["default"].extend(b.guide[c],l["default"].omit.apply(l["default"],[e].concat[d]))}Object.defineProperty(a,"__esModule",{value:!0});var k=function(){function a(a,b){for(var c=0;c=0&&(a.guide.x.tickFormat+="-short"),["day","week","month"].indexOf(a.guide.y.tickFormat)>=0&&(a.guide.y.tickFormat+="-short");var r=0===o.length,u=0===q.length,v=s(o,e.FormatterRegistry.get(a.guide.x.tickFormat,a.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),w=s(q,e.FormatterRegistry.get(a.guide.y.tickFormat,a.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),x=c.xAxisPadding,y=c.yAxisPadding,z=d?!j:!1,A=f?!k:!1;a.guide.x.padding=r?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=r?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,g){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=o.length,a.guide.y.$minimalDomain=q.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},v={NONE:function(a,b,d){var e=c.utils.clone(a);return w(c.utils.clone(e.unit),e.unit,function(a,b){return b.guide.x.tickFontHeight=d.getAxisTickLabelSize("X").height,b.guide.y.tickFontHeight=d.getAxisTickLabelSize("Y").height,b.guide.x.tickFormatWordWrapLimit=d.xAxisTickLabelLimit,b.guide.y.tickFormatWordWrapLimit=d.yAxisTickLabelLimit,b}),e},"BUILD-LABELS":function(a,b,d){var e=c.utils.clone(a),f=[],g=[],h=null,i=null;return c.utils.traverseJSON(e.unit,"units",r,function(a,c){if(a.isLeaf)return c;!h&&c.x&&(h=c),!i&&c.y&&(i=c),c.guide=c.guide||{},c.guide.x=c.guide.x||{label:""},c.guide.y=c.guide.y||{label:""},c.guide.x.label=l["default"].isObject(c.guide.x.label)?c.guide.x.label:{text:c.guide.x.label},c.guide.y.label=l["default"].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||b.dimension(c.x).dimName),c.y&&(c.guide.y.label.text=c.guide.y.label.text||b.dimension(c.y).dimName);var d=c.guide.x.label.text;d&&(f.push(d),c.guide.x.tickFormatNullAlias=c.guide.x.hasOwnProperty("tickFormatNullAlias")?c.guide.x.tickFormatNullAlias:"No "+d,c.guide.x.label.text="");var e=c.guide.y.label.text;return e&&(g.push(e),c.guide.y.tickFormatNullAlias=c.guide.y.hasOwnProperty("tickFormatNullAlias")?c.guide.y.tickFormatNullAlias:"No "+e,c.guide.y.label.text=""),c}),h&&(h.guide.x.label.text=f.join(" > ")),i&&(i.guide.y.label.text=g.join(" > ")),e},"BUILD-GUIDE":function(a,b,d){var f=c.utils.clone(a);return w(c.utils.clone(f.unit),f.unit,function(a,c){if(a.isLeaf)return c;c.guide.hasOwnProperty("showGridLines")||(c.guide.showGridLines=a.isLeafParent?"xy":"");var f=!a.isLeaf&&!a.isLeafParent;f&&(c.guide.x.cssClass+=" facet-axis",c.guide.x.avoidCollisions=!0,c.guide.y.cssClass+=" facet-axis");var g=b.dimension(c.x),h=b.dimension(c.y),i="measure"===g.dimType,j="measure"===h.dimType,k=d.hasOwnProperty("xDensityPadding:"+g.dimType)?d["xDensityPadding:"+g.dimType]:d.xDensityPadding,l=d.hasOwnProperty("yDensityPadding:"+h.dimType)?d["yDensityPadding:"+h.dimType]:d.yDensityPadding,m=b.scaleMeta(c.x,c.guide.x),n=m.values,o=b.scaleMeta(c.y,c.guide.y),p=o.values;c.guide.x.tickFormat=c.guide.x.tickFormat||t(g,d.defaultFormats),c.guide.y.tickFormat=c.guide.y.tickFormat||t(h,d.defaultFormats);var q=0===n.length,r=0===p.length,u=s(n,e.FormatterRegistry.get(c.guide.x.tickFormat,c.guide.x.tickFormatNullAlias),d.getAxisTickLabelSize,d.xAxisTickLabelLimit),v=s(p,e.FormatterRegistry.get(c.guide.y.tickFormat,c.guide.y.tickFormatNullAlias),d.getAxisTickLabelSize,d.yAxisTickLabelLimit),w=a.isLeafParent?d.xAxisPadding:0,x=a.isLeafParent?d.yAxisPadding:0,y=!f&&Boolean(g.dimType)&&"measure"!==g.dimType;c.guide.x.padding=q?0:w,c.guide.y.padding=r?0:x,c.guide.x.rotate=y?90:0,c.guide.x.textAnchor=y?"start":c.guide.x.textAnchor;var z=q?0:d.xTickWidth,A=r?0:d.yTickWidth;c.guide.x.tickFormatWordWrapLimit=d.xAxisTickLabelLimit,c.guide.y.tickFormatWordWrapLimit=d.yAxisTickLabelLimit;var B=y?u.width:u.height;!i&&B>d.xAxisTickLabelLimit&&(B=d.xAxisTickLabelLimit),!y&&u.width>d.xAxisTickLabelLimit&&(c.guide.x.tickFormatWordWrap=!0,c.guide.x.tickFormatWordWrapLines=d.xTickWordWrapLinesLimit,B=d.xTickWordWrapLinesLimit*u.height);var C=v.width;!j&&C>d.yAxisTickLabelLimit&&(C=d.yAxisTickLabelLimit,c.guide.y.tickFormatWordWrap=!0,c.guide.y.tickFormatWordWrapLines=d.yTickWordWrapLinesLimit);var D=z+B,E=A+C,F=d.xFontLabelHeight,G=d.yFontLabelHeight,H=d.distToXAxisLabel,I=d.distToYAxisLabel,J=Math.min(d.xAxisTickLabelLimit,y?u.height:u.width);c.guide.x.density=J+2*k;var K=Math.ceil(v.width/d.yAxisTickLabelLimit),L=Math.min(K,d.yTickWordWrapLinesLimit),M=Math.min(d.yAxisTickLabelLimit,L*v.height);c.guide.y.density=M+2*l,c.guide.x.label.padding=c.guide.x.label.text?D+H:0,c.guide.y.label.padding=c.guide.y.label.text?E+I:0;var N=c.guide.x.label.text?c.guide.x.label.padding+F:D,O=c.guide.y.label.text?c.guide.y.label.padding+G:E;return c.guide.padding.b=w+N,c.guide.padding.l=x+O,c.guide.padding.b=c.guide.x.hide?0:c.guide.padding.b,c.guide.padding.l=c.guide.y.hide?0:c.guide.padding.l,c.guide.x.tickFontHeight=u.height,c.guide.y.tickFontHeight=v.height,c.guide.x.$minimalDomain=n.length,c.guide.y.$minimalDomain=p.length,c.guide.x.$maxTickTextW=u.width,c.guide.x.$maxTickTextH=u.height,c.guide.y.$maxTickTextW=v.width,c.guide.y.$maxTickTextH=v.height,c}),f},"BUILD-COMPACT":function(a,b,d){var e=c.utils.clone(a);return w(c.utils.clone(e.unit),e.unit,function(a,c){return a.isLeaf?c:(c.guide.hasOwnProperty("showGridLines")||(c.guide.showGridLines=a.isLeafParent?"xy":""),a.isLeafParent?u(c,b,l["default"].defaults({xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!0,!1,!0):(c.guide.x.cssClass+=" facet-axis compact",c.guide.x.avoidCollisions=!0,c.guide.y.cssClass+=" facet-axis compact",u(c,b,l["default"].defaults({xAxisPadding:0,yAxisPadding:0,distToXAxisLabel:0,distToYAxisLabel:0,xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!1,!0,!1)))}),e}};v.AUTO=function(a,b,c){return["BUILD-LABELS","BUILD-GUIDE"].reduce(function(a,d){return v[d](a,b,c)},a)},v.COMPACT=function(a,b,c){return["BUILD-LABELS","BUILD-COMPACT"].reduce(function(a,d){return v[d](a,b,c)},a)};var w=function z(a,b,d){var e=p(b);e=d(r(e),e),e=m(e,a);var f=l["default"].omit(e,"units");return(e.units||[]).forEach(function(a){return z(c.utils.clone(a),q(a,f),d)}),e},x={get:function(a,b,d,e){var f=v[a]||v.NONE,g={dimension:function(a){var b=d.scales[a],c=d.sources[b.source].dims[b.dim]||{};return{dimName:b.dim,dimType:c.type,scaleType:b.type}},scaleMeta:function(a){var b=e("pos",a);return{values:b.domain()}}},h={unit:c.utils.clone(d.unit)},i=f(h,g,b);return d.unit=i.unit,d}},y=function(){function a(b){i(this,a),this.spec=b,this.scalesCreator=new g.ScalesFactory(b.sources),this.isApplicable=c.utils.isSpecRectCoordsOnly(b.unit)}return k(a,[{key:"transform",value:function(){var a=this,b=this.spec;if(!this.isApplicable)return b;var c=b.settings.size,d=l["default"].find(b.settings.specEngine,function(a){return c.width<=a.width}),e=x.get(d.name,b.settings,b,function(c,d){var e=d?d:""+c+":default";return a.scalesCreator.create(b.scales[e],null,[0,100])});return e}}]),a}();a.SpecTransformAutoLayout=y}),e("spec-transform-calc-size",["exports","./scales-factory","./utils/utils"],function(a,b,c){"use strict";function d(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b0?d:0,a.guide.x.label.padding>c+b.xAxisPadding&&(a.guide.x.label.padding+=d)}(a.units||[]).filter(function(a){return"COORDS.RECT"===a.type}).forEach(function(a){return l(a,b)})},h=function(a){return a.$maxTickTextW},i=function(a){return a.density},j={"entire-view":function(a,b,c){var d=b("x",c.unit,h);d<=a.width&&g(c.unit,c.settings);var e=a.width,f=a.height;return{newW:e,newH:f}},minimal:function(a,b,c){var d=b("x",c.unit,i),e=b("y",c.unit,i);return{newW:d,newH:e}},normal:function(a,b,c){var d,e=b("x",c.unit,h),f=a.width;f>=e?(g(c.unit,c.settings),d=Math.max(f,e)):d=Math.max(f,Math.max(a.width,b("x",c.unit,i)));var j=Math.max(a.height,b("y",c.unit,i));return{newW:d,newH:j}},"fit-width":function(a,b,c){var d=b("x",c.unit,h);d<=a.width&&g(c.unit,c.settings);var e=a.width,f=b("y",c.unit,i);return{newW:e,newH:f}},"fit-height":function(a,b,c){var d=b("x",c.unit,i),e=a.height;return{newW:d,newH:e}}},k=function(){function a(b){e(this,a),this.spec=b,this.isApplicable=c.utils.isSpecRectCoordsOnly(b.unit)}return f(a,[{key:"transform",value:function(){var a=this.spec;if(!this.isApplicable)return a;var c=a.settings.fitModel;if(!c)return a;var e=a.scales,f=new b.ScalesFactory(a.sources),g=function(a,b){return a.reduce(function(a,c){var d=c.key||{},e=d[b];return a[e]=a[e]||[],a[e].push(c),a},{})},h=function(a,b){var c=0;if(["ordinal","period"].indexOf(a.scaleType)>=0){var d=a.domain();c=b*d.length}else c=4*b;return c},i=function q(a,b,c){var i=void 0===arguments[3]?null:arguments[3],j="x"===a?e[b.x]:e[b.y],k="x"===a?e[b.y]:e[b.x],l=b.guide,m=c("x"===a?l.x:l.y),n="x"===a?l.padding.l+l.padding.r:l.padding.b+l.padding.t;if("COORDS.RECT"!==b.units[0].type){var o=f.create(j,i,[0,100]);return n+h(o,m)}var p=g(b.frames,k.dim),r=Object.keys(p).map(function(b){return p[b].map(function(b){return q(a,b.units[0],c,b)}).reduce(function(a,b){return a+b},0)}),s=Math.max.apply(Math,d(r));return n+s},k=a.settings.size,l=k.width,m=k.height,n=j[c];if(n){var o=n(k,i,a);l=o.newW,m=o.newH}var p=function(b,c){var d=a.settings.getScrollBarWidth(),e=c.width,f=c.height,g=b.width-e,h=b.height-f,i=h>=0?0:d,j=g>=0?0:d;return{height:f-j,width:e-i}};return a.settings.size=p(k,{width:l,height:m}),a}}]),a}();a.SpecTransformCalcSize=k}),e("spec-transform-apply-ratio",["exports","underscore","./utils/utils"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c1||!d(a))throw new Error("Not applicable");g.push(a.x),h.push(a.y);var c=a.units||[],f=c.map(function(a){if(!d(a)&&!e(a))throw new Error("Not applicable");return a}).filter(d);return 1===f.length};f(a.unit,i,function(a,b){return 0});var j=function(b){return a.scales[b]},k=function(a){return"/"===a.source&&!a.ratio&&!a.fitToFrameByDims},l=function(a){return"ordinal"===a.type||"period"===a.type&&!a.period},m=g.map(j).filter(k),n=h.map(j).filter(k),o=2;[m.length,n.length].some(function(a){return a===o})&&!function(){var a=function(a){return a.dim},d=function(b,c,d){return b.fitToFrameByDims=d.slice(0,c).map(a)},e=function(e,f){f.filter(l).length===o&&(f.forEach(d),f[0].ratio=c.utils.generateRatioFunction(e,f.map(a),b))};e("x",m),e("y",n)}()}}]),a}());a.SpecTransformApplyRatio=g}),e("spec-transform-extract-axes",["exports","underscore","./utils/utils"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var f=function(){function a(a,b){for(var c=0;c1||!b(a))throw new Error("Not applicable");a.guide=a.guide||{};var g=a.guide,h=g.padding||{l:0,r:0,t:0,b:0};e.l+=h.l,e.r+=h.r,e.t+=h.t,e.b+=h.b,f.push({l:e.l,r:e.r,t:e.t,b:e.b});var i=a.units||[],j=i.map(function(a){if(!b(a)&&!d(a))throw new Error("Not applicable");return a}).filter(b);return 1===j.length},h=function(a){return a?10:0},i=function(a){var b=f.pop(),c=a.guide||{};c.x=c.x||{},c.x.padding=c.x.padding||0,c.y=c.y||{},c.y.padding=c.y.padding||0,c.padding={l:h(a.y),r:h(1),t:h(1),b:h(a.x)},c.autoLayout="extract-axes",c.x.padding+=e.b-b.b,c.y.padding+=e.l-b.l};c.utils.traverseSpec(a.unit,g,i),a.unit.guide.padding=e,a.unit.guide.autoLayout=""}}]),a}());a.SpecTransformExtractAxes=g}),e("charts/tau.plot",["exports","../api/balloon","../event","../plugins","../utils/utils","../utils/utils-dom","../const","../units-registry","../data-processor","../utils/layuot-template","../spec-converter","../spec-transform-auto-layout","../spec-transform-calc-size","../spec-transform-apply-ratio","../spec-transform-extract-axes","./tau.gpl"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){"use strict";function s(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function t(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)}Object.defineProperty(c,"__esModule",{value:!0});var u=function(){function a(a,b){for(var c=0;c0}).length}},{key:"setData",value:function(b){this.config.data=b,this.configGPL.sources["/"].data=b,this._originData=a.clone(this.configGPL.sources),this.refresh()}},{key:"getSVG",value:function(){return this._svg}},{key:"addFilter",value:function(a){a.src=a.src||"/";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}},{key:"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()}},{key:"refresh",value:function(){this._target&&this.renderTo(this._target,this._defaultSize)}},{key:"resize",value:function(){var a=void 0===arguments[0]?{}:arguments[0];this.renderTo(this._target,a)}},{key:"select",value:function(a){return this._nodes.filter(a)}},{key:"traverseSpec",value:function(a,b){var c=function d(a,b,c){b(a,c),(a.units||[]).map(function(c){return d(c,b,a)})};c(a.unit,b,null)}},{key:"getSpec",value:function(){return this._liveSpec}}],[{key:"setupMetaInfo",value:function(a,b){var c=a?a:k.DataProcessor.autoDetectDimTypes(b);return k.DataProcessor.autoAssignScales(c)}},{key:"setupSettings",value:function(b){var c=e.globalSettings,d={};Object.keys(c).forEach(function(b){d[b]=a.isFunction(c[b])?c[b]:g.utils.clone(c[b])});var f=a.defaults(b||{},d);return g.utils.isArray(f.specEngine)||(f.specEngine=[{width:Number.MAX_VALUE,name:f.specEngine}]),f}}]),e}(e.Emitter);c.Plot=w}),e("chart-alias-registry",["exports","d3","./utils/utils","./data-processor","./error"],function(b,c,d,e,f){"use strict";function g(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0});var h=(g(c),{}),i={},j=function(b){var c="Chart type "+b+" is not supported.";throw console.log(c),console.log("Use one of "+a.keys(h).join(", ")+"."),new f.TauChartError(c,f.errorCodes.NOT_SUPPORTED_TYPE_CHART)},k={validate:function(a,b){return i.hasOwnProperty(a)||j(a),i[a].reduce(function(a,c){return a.concat(c(b)||[])},[])},get:function(b){var c=h[b];return a.isFunction(c)||j(b),c},add:function(a,b){var c=void 0===arguments[2]?[]:arguments[2];return h[a]=b,i[a]=c,this},getAllRegisteredTypes:function(){return h}};b.chartTypesRegistry=k}),e("charts/tau.chart",["exports","./tau.plot","../chart-alias-registry"],function(b,c,d){"use strict";function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(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)}Object.defineProperty(b,"__esModule",{value:!0});var g=function(){function a(a,b){for(var c=0;c0)throw new Error(f[0]);var g=d.chartTypesRegistry.get(b.type);b=a.defaults(b,{autoResize:!0}),b.settings=c.Plot.setupSettings(b.settings),b.dimensions=c.Plot.setupMetaInfo(b.dimensions,b.data),h(Object.getPrototypeOf(i.prototype),"constructor",this).call(this,g(b)),b.autoResize&&i.winAware.push(this)}return f(i,b),g(i,[{key:"destroy",value:function(){var a=i.winAware.indexOf(this);-1!==a&&i.winAware.splice(a,1),h(Object.getPrototypeOf(i.prototype),"destroy",this).call(this)}}]),i}(c.Plot);i.resizeOnWindowEvent=function(){function a(){!c&&i.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=i.winAware.length;d>b;b++)a=i.winAware[b],a.resize()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),i.winAware=[],window.addEventListener("resize",i.resizeOnWindowEvent),b.Chart=i}),e("utils/d3-decorators",["exports","../utils/utils-draw","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(a,"__esModule",{value:!0});var f=e(c),g=e(d),h=f["default"].memoize(function(a){return a.node().getComputedTextLength()},function(a){return a.node().textContent.length}),i=function(a,b,c){c=c||h,a.each(function(){var a=g["default"].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)})},j=function(a,b,c,d,e,f){f=f||h;var i=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=g["default"].select(this),h=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=i(a,null,j,k,l,m,0),o=!1,p=h.length-1,q=h.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 i(a,b,j,k,l,m,c)}),n.remove()})},k=function(a,b,c){a.selectAll(".tick line").empty()||a.selectAll(".tick")[0].forEach(function(a){var d=g["default"].select(a),e=d.data()[0],f=b(e),h=c?f:0,i=c?0:f;d.attr("transform","translate("+h+","+i+")");var j=.5*b.stepSize(e),k=c?"x":"y",l=c?j:-j;d.select("line").attr(k+"1",l).attr(k+"2",l)})},l=function(a){var b=a.selectAll(".tick")[0];if(!(b.length<2)){var c=parseFloat(b[0].attributes.transform.value.replace("translate(","")),d=parseFloat(b[1].attributes.transform.value.replace("translate(","")),e=d-c,f=0,g=-1,h=a.selectAll(".tick text")[0];if(h.forEach(function(a,b){var c=a.textContent||"",d=c.length;d>f&&(f=d,g=b)}),g>=0){var i=h[g].getBoundingClientRect();e-i.width<8&&a.classed({"graphical-report__d3-time-overflown":!0})}}},m=function(a,c,d){var e=a.selectAll(".tick line");if(!e.empty()){var f=-1;if(d)f=0;else{var g=c/e[0].length,h=g/2;f=-h}var i=a.select(".tick").node().cloneNode(!0);a.append(function(){return i}).attr("transform",b.utilsDraw.translate(0,c-f))}},n=function(a,c,d){var e=d?1:-1,f=a.append("text").attr("transform",b.utilsDraw.rotate(c.rotate)).attr("class",c.cssClass).attr("x",e*c.size*.5).attr("y",e*c.padding).style("text-anchor",c.textAnchor),g=" > ",h=c.text.split(g),i=h.length;if(h.forEach(function(a,b){f.append("tspan").attr("class","label-token label-token-"+b).text(a),i-1>b&&f.append("tspan").attr("class","label-token-delimiter label-token-delimiter-"+b).text(g)}),"right"===c.dock){var j=a.selectAll("path.domain").node().getBBox();f.attr("x",d?j.width:0)}else if("left"===c.dock){var j=a.selectAll("path.domain").node().getBBox();f.attr("x",d?0:-j.height)}},o=function(a,c,d){var e=c.rotate,f=a.selectAll(".tick text");if(f.attr("transform",b.utilsDraw.rotate(e)).style("text-anchor",c.textAnchor),90===e){var g=parseFloat(f.attr("dy"))/2;f.attr("x",9).attr("y",0).attr("dy",""+g+"em")}c.tickFormatWordWrap?f.call(j,c.tickFormatWordWrapLimit,c.tickFormatWordWrapLines,c.$maxTickTextH,!d):f.call(i,c.tickFormatWordWrapLimit)},p=function(a){var b=11,c=-10,d=[];a.selectAll(".tick").each(function(a,b){var c=g["default"].select(this),e=(c.text(),parseFloat(c.attr("transform").replace("translate(","").split(",")[0])),f=c.selectAll("text"),h=f.selectAll("tspan"),i=h.empty()?f:h,j=i.node().getBBox().width,k=j/2,l=e-k,m=e+k;d.push({s:l,e:m,l:0,textRef:i,tickRef:c})});var e=function(a,b){return a.map(function(a,c,d){return b(d[c-1]||{e:-(1/0),s:-(1/0),l:0},a,d[c+1]||{e:1/0,s:1/0,l:0})})},f=function(a,b){var c={"[T][1]":-1,"[T][-1]":0,"[T][0]":1,"[F][0]":-1},d="["+b.toString().toUpperCase().charAt(0)+"]["+a+"]";return c.hasOwnProperty(d)?c[d]:0};e(d,function(a,d,e){var g=a.e>d.s,h=e.s0,d.y.hide=Math.floor(c.options.left)>0}}return k(a,[{key:"drawLayout",value:function(a){var b=this.config,c=b.options,d=b.guide.padding,e=c.width-(d.l+d.r),f=c.height-(d.t+d.b);return this.xScale=a("pos",b.x,[0,e]),this.yScale=a("pos",b.y,[f,0]),this.W=e,this.H=f,this}},{key:"drawFrames",value:function(a,b){var c=m["default"].extend({},this.config),f=c.options,g=c.guide.padding,h=f.left+g.l,i=f.top+g.t,j=this.W,k=this.H;c.x=this.xScale,c.y=this.yScale,c.x.scaleObj=this.xScale,c.y.scaleObj=this.yScale,c.x.guide=c.guide.x,c.y.guide=c.guide.y,c.x.guide.label.size=j,c.y.guide.label.size=k,f.container.attr("transform",d.utilsDraw.translate(h,i));var n=c.x.getHash()+k,o=c.y.getHash()+j;c.x.guide.hide||this._fnDrawDimAxis(f.container,c.x,[0,k+c.guide.x.padding],j,""+f.frameId+"x",n),c.y.guide.hide||this._fnDrawDimAxis(f.container,c.y,[0-c.guide.y.padding,0],k,""+f.frameId+"y",o);var p=function(a,d,e){var f,g=e.hash();if(e.key){var h=e.key[c.x.dim],i=e.key[c.y.dim],m=c.x(h),n=c.y(i),o=c.x.stepSize(h),p=c.y.stepSize(i);f=function(a,b){return a.options={uid:g+b,frameId:g,container:d,containerWidth:j,containerHeight:k,left:m-o/2,top:n-p/2,width:o,height:p},a}}else f=function(a,b){return a.options={uid:g+b,frameId:g,container:d,containerWidth:j,containerHeight:k,left:0,top:0,width:j,height:k},a};var q=function(a){a.options.container=l["default"].select(this),b(a,e)},r=d.selectAll(".layer_"+a).data(e.units.map(f),function(a){return a.options.uid+a.type});r.exit().remove(),r.each(q),r.enter().append("g").attr("class","layer_"+a).each(q)},q=function(a){p(f.frameId,l["default"].select(this),a)},r=this._fnDrawGrid(f.container,c,k,j,f.frameId,n+o).selectAll(".parent-frame-"+f.frameId).data(a,function(a){return a.hash()});r.exit().remove(),r.each(q),r.enter().append("g").attr("class",function(a){return""+e.CSS_PREFIX+"cell cell parent-frame-"+f.frameId+" frame-"+a.hash()}).each(q)}},{key:"_fnDrawDimAxis",value:function(a,b,c,e,h,j){var k=l["default"].svg.axis().scale(b.scaleObj).orient(b.guide.scaleOrient),m=f.FormatterRegistry.get(b.guide.tickFormat,b.guide.tickFormatNullAlias);null!==m&&(k.ticks(Math.round(e/b.guide.density)),k.tickFormat(m));var n=a.selectAll(".axis_"+h).data([j],function(a){return a});n.exit().remove(),n.enter().append("g").attr("class",b.guide.cssClass+" axis_"+h).attr("transform",d.utilsDraw.translate.apply(d.utilsDraw,i(c))).call(function(a){if(!a.empty()){k.call(this,a);var c="h"===d.utilsDraw.getOrientation(b.guide.scaleOrient),e="ordinal"===b.scaleType||"period"===b.scaleType;e&&g.d3_decorator_prettify_categorical_axis_ticks(a,b,c),e&&c&&b.guide.avoidCollisions&&g.d3_decorator_avoid_labels_collisions(a),g.d3_decorator_wrap_tick_label(a,b.guide,c),g.d3_decorator_prettify_axis_label(a,b.guide.label,c),c&&"time"===b.scaleType&&g.d3_decorator_fix_horizontal_axis_ticks_overflow(a)}})}},{key:"_fnDrawGrid",value:function(a,b,c,e,h,i){var j=a.selectAll(".grid_"+h).data([i],function(a){return a});return j.exit().remove(),j.enter().append("g").attr("class","grid grid_"+h).attr("transform",d.utilsDraw.translate(0,0)).call(function(a){if(!a.empty()){var h=a,i=(b.guide.showGridLines||"").toLowerCase();if(i.length>0){var j=h.append("g").attr("class","grid-lines");if(i.indexOf("x")>-1){var k=b.x,n=l["default"].svg.axis().scale(k.scaleObj).orient(k.guide.scaleOrient).tickSize(c),o=f.FormatterRegistry.get(k.guide.tickFormat);null!==o&&(n.ticks(Math.round(e/k.guide.density)),n.tickFormat(o));var p=j.append("g").attr("class","grid-lines-x").call(n),q="h"===d.utilsDraw.getOrientation(k.guide.scaleOrient),r="ordinal"===k.scaleType||"period"===k.scaleType;r&&g.d3_decorator_prettify_categorical_axis_ticks(p,k,q);var s=p.select("g.tick");if(s.node()&&"translate(0,0)"!==s.attr("transform")){var t=s.node().cloneNode(!0);j.node().appendChild(t),l["default"].select(t).attr("class","border").attr("transform",d.utilsDraw.translate(0,0)).select("line").attr("x1",0).attr("x2",0)}}if(i.indexOf("y")>-1){var u=b.y,v=l["default"].svg.axis().scale(u.scaleObj).orient(u.guide.scaleOrient).tickSize(-e),o=f.FormatterRegistry.get(u.guide.tickFormat);null!==o&&(v.ticks(Math.round(c/u.guide.density)),v.tickFormat(o));var w=j.append("g").attr("class","grid-lines-y").call(v),q="h"===d.utilsDraw.getOrientation(u.guide.scaleOrient),r="ordinal"===u.scaleType||"period"===u.scaleType;r&&g.d3_decorator_prettify_categorical_axis_ticks(w,u,q);var x=["time","ordinal","period"],y=m["default"].contains(x,u.scaleType);y&&g.d3_decorator_fix_axis_bottom_line(w,c,"time"===u.scaleType)}j.selectAll("text").remove()}}}),j}}]),a}();a.Cartesian=n}),e("elements/element",["exports","../event"],function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(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)}Object.defineProperty(a,"__esModule",{value:!0});var e=function(a){function b(){c(this,b),null!=a&&a.apply(this,arguments)}return d(b,a),b}(b.Emitter);a.Element=e}),e("elements/coords.parallel",["exports","d3","underscore","./element","../utils/utils-draw","../utils/utils","../const"],function(a,b,c,d,e,f,g){"use strict";function h(a){return a&&a.__esModule?a:{"default":a}}function i(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b=e}):[b[0],b[1]],{dim:d[a].dim,func:d[a].descrete?"inset":"between",args:c}});b.fire("brush",c)};return a.selectAll(".brush").remove(),a.append("g").attr("class","brush").each(function(a){e[a]=n["default"].svg.brush().y(d[a]).on("brushstart",g).on("brush",i).on("brushend",h),n["default"].select(this).classed("brush-"+f.utils.generateHash(a),!0).call(e[a])}).selectAll("rect").attr("x",c/2*-1).attr("width",c),a}},{key:"_forceBrushing",value:function(){var a=void 0===arguments[0]?{}:arguments[0],b=this.columnsBrushes,c=this.columnsScalesMap;Object.keys(a).filter(function(d){return b[d]&&c[d]&&a[d]}).forEach(function(d){var e=a[d],g=[];if(c[d].descrete){var h=e.map(c[d]).filter(function(a){return a>=0}),j=c[d].stepSize()/2;g=[Math.min.apply(Math,i(h))-j,Math.max.apply(Math,i(h))+j]}else g=[e[0],e[1]];var k=f.utils.generateHash(d);b[d].extent(g),b[d](n["default"].select(".brush-"+k)),b[d].event(n["default"].select(".brush-"+k))})}}]),b}(d.Element);a.Parallel=p}),!function(){function a(a,b){function c(b){var c,d=a.arcs[0>b?~b:b],e=d[0];return a.transform?(c=[0,0],d.forEach(function(a){c[0]+=a[0],c[1]+=a[1]})):c=d[d.length-1],0>b?[c,e]:[e,c]}function d(a,b){for(var c in a){var d=a[c];delete b[d.start],delete d.start,delete d.end,d.forEach(function(a){e[0>a?~a:a]=1}),h.push(d)}}var e={},f={},g={},h=[],i=-1;return b.forEach(function(c,d){var e,f=a.arcs[0>c?~c:c];f.length<3&&!f[1][0]&&!f[1][1]&&(e=b[++i],b[i]=c,b[d]=e)}),b.forEach(function(a){var b,d,e=c(a),h=e[0],i=e[1];if(b=g[h])if(delete g[b.end],b.push(a),b.end=i,d=f[i]){delete f[d.start];var j=d===b?b:b.concat(d);f[j.start=b.start]=g[j.end=d.end]=j}else f[b.start]=g[b.end]=b;else if(b=f[i])if(delete f[b.start],b.unshift(a),b.start=h,d=g[h]){delete g[d.end];var k=d===b?b:d.concat(b);f[k.start=d.start]=g[k.end=b.end]=k}else f[b.start]=g[b.end]=b;else b=[a],f[b.start=h]=g[b.end=i]=b}),d(g,f),d(f,g),b.forEach(function(a){e[0>a?~a:a]||h.push([a])}),h}function b(b,c,d){function e(a){var b=0>a?~a:a;(k[b]||(k[b]=[])).push({i:a,g:j})}function f(a){a.forEach(e)}function g(a){a.forEach(f)}function h(a){"GeometryCollection"===a.type?a.geometries.forEach(h):a.type in l&&(j=a,l[a.type](a.arcs))}var i=[];if(arguments.length>1){var j,k=[],l={LineString:f,MultiLineString:g,Polygon:g,MultiPolygon:function(a){a.forEach(g)}};h(c),k.forEach(arguments.length<3?function(a){i.push(a[0].i)}:function(a){d(a[0].g,a[a.length-1].g)&&i.push(a[0].i)})}else for(var m=0,n=b.arcs.length;n>m;++m)i.push(m);return{type:"MultiLineString",arcs:a(b,i)}}function c(b,c){function d(a){a.forEach(function(b){b.forEach(function(b){(f[b=0>b?~b:b]||(f[b]=[])).push(a)})}),h.push(a)}function e(a){return l(g(b,{type:"Polygon",arcs:[a]}).coordinates[0])>0}var f={},h=[],i=[];return c.forEach(function(a){"Polygon"===a.type?d(a.arcs):"MultiPolygon"===a.type&&a.arcs.forEach(d)}),h.forEach(function(a){if(!a._){var b=[],c=[a];for(a._=1,i.push(b);a=c.pop();)b.push(a),a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].forEach(function(a){a._||(a._=1,c.push(a))})})})}}),h.forEach(function(a){delete a._}),{type:"MultiPolygon",arcs:i.map(function(c){var d=[];if(c.forEach(function(a){a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].length<2&&d.push(a)})})}),d=a(b,d),(n=d.length)>1)for(var g,h=e(c[0][0]),i=0;ia?~a:a],e=0,f=d.length;f>e;++e)b.push(c=d[e].slice()),j(c,e);0>a&&h(b,f)}function d(a){return a=a.slice(),j(a,0),a}function e(a){for(var b=[],d=0,e=a.length;e>d;++d)c(a[d],b);return b.length<2&&b.push(b[0].slice()),b}function f(a){for(var b=e(a);b.length<4;)b.push(b[0].slice());return b}function g(a){return a.map(f)}function i(a){var b=a.type;return"GeometryCollection"===b?{type:b,geometries:a.geometries.map(i)}:b in l?{type:b,coordinates:l[b](a)}:null}var j=q(a.transform),k=a.arcs,l={Point:function(a){return d(a.coordinates)},MultiPoint:function(a){return a.coordinates.map(d)},LineString:function(a){return e(a.arcs)},MultiLineString:function(a){return a.arcs.map(e)},Polygon:function(a){return g(a.arcs)},MultiPolygon:function(a){return a.arcs.map(g)}};return i(b)}function h(a,b){for(var c,d=a.length,e=d-b;e<--d;)c=a[e],a[e++]=a[d],a[d]=c}function i(a,b){for(var c=0,d=a.length;d>c;){var e=c+d>>>1;a[e]a&&(a=~a);var c=e[a];c?c.push(b):e[a]=[b]})}function c(a,c){a.forEach(function(a){b(a,c)})}function d(a,b){"GeometryCollection"===a.type?a.geometries.forEach(function(a){d(a,b)}):a.type in g&&g[a.type](a.arcs,b)}var e={},f=a.map(function(){return[]}),g={LineString:b,MultiLineString:c,Polygon:c,MultiPolygon:function(a,b){a.forEach(function(a){c(a,b)})}};a.forEach(d);for(var h in e)for(var j=e[h],k=j.length,l=0;k>l;++l)for(var m=l+1;k>m;++m){var n,o=j[l],p=j[m];(n=f[o])[h=i(n,p)]!==p&&n.splice(h,0,p),(n=f[p])[h=i(n,o)]!==o&&n.splice(h,0,o)}return f}function k(a,b){function c(a){f.remove(a),a[1][2]=b(a),f.push(a)}var d=q(a.transform),e=r(a.transform),f=p();return b||(b=m),a.arcs.forEach(function(a){for(var g,h,i=[],j=0,k=0,l=a.length;l>k;++k)h=a[k],d(a[k]=[h[0],h[1],1/0],k);for(var k=1,l=a.length-1;l>k;++k)g=a.slice(k-1,k+2),g[1][2]=b(g),i.push(g),f.push(g);for(var k=0,l=i.length;l>k;++k)g=i[k],g.previous=i[k-1],g.next=i[k+1];for(;g=f.pop();){var m=g.previous,n=g.next;g[1][2]0;){var c=(b+1>>1)-1,e=d[c];if(o(a,e)>=0)break;d[e._=b]=e,d[a._=b=c]=a}}function b(a,b){for(;;){var c=b+1<<1,f=c-1,g=b,h=d[g];if(e>f&&o(d[f],h)<0&&(h=d[g=f]),e>c&&o(d[c],h)<0&&(h=d[g=c]),g===b)break;d[h._=b]=h,d[a._=b=g]=a}}var c={},d=[],e=0;return c.push=function(b){return a(d[b._=e]=b,e++),e},c.pop=function(){if(!(0>=e)){var a,c=d[0];return--e>0&&(a=d[e],b(d[a._=0]=a,0)),c}},c.remove=function(c){var f,g=c._;if(d[g]===c)return g!==--e&&(f=d[e],(o(f,c)<0?a:b)(d[f._=g]=f,g)),g},c}function q(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0),a[0]=(b+=a[0])*d+f,a[1]=(c+=a[1])*e+g}}function r(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0);var i=(a[0]-f)/d|0,j=(a[1]-g)/e|0;a[0]=i-b,a[1]=j-c,b=i,c=j}}function s(){}var t={version:"1.6.19",mesh:function(a){return g(a,b.apply(this,arguments))},meshArcs:b,merge:function(a){return g(a,c.apply(this,arguments))},mergeArcs:c,feature:d,neighbors:j,presimplify:k};"function"==typeof e&&e.amd?e("topojson",t):"object"==typeof module&&module.exports?module.exports=t:this.topojson=t}(),e("utils/d3-labeler",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b=function(){var a,b,c=[],d=[],e=1,f=1,g={},h=5,i=.5,j=0,k=0,l=.2,m=1,n=30,o=30,p=3,q=!1,r=!1,s=function(a){var b=c.length,e=0,f=c[a].x-d[a].x,g=d[a].y-c[a].y,h=Math.sqrt(f*f+g*g),i=!0;h>0&&(e+=h*l),f/=h,g/=h,e+=f>0&&g>0?0*p:0>f&&g>0?1*p:0>f&&0>g?2*p:3*p;for(var j,k,q,r,s,t,u,w=c[a].x,x=c[a].y-c[a].height+2,y=c[a].x+c[a].width,z=c[a].y+2,A=0;b>A;A++)A!=a&&(i=v(d[a].x,c[a].x,d[A].x,c[A].x,d[a].y,c[a].y,d[A].y,c[A].y),i&&(e+=m),j=c[A].x,q=c[A].y-c[A].height+2,k=c[A].x+c[A].width,r=c[A].y+2,s=Math.max(0,Math.min(k,y)-Math.max(j,w)),t=Math.max(0,Math.min(r,z)-Math.max(q,x)),u=s*t,e+=u*n),j=d[A].x-d[A].r,q=d[A].y-d[A].r,k=d[A].x+d[A].r,r=d[A].y+d[A].r,s=Math.max(0,Math.min(k,y)-Math.max(j,w)),t=Math.max(0,Math.min(r,z)-Math.max(q,x)),u=s*t,e+=u*o;return e},t=function(b){var g,i=Math.floor(Math.random()*c.length),l=c[i].x,m=c[i].y;g=q?a(i,c,d):s(i),c[i].x+=(Math.random()-.5)*h,c[i].y+=(Math.random()-.5)*h,c[i].x>e&&(c[i].x=l),c[i].x<0&&(c[i].x=l),c[i].y>f&&(c[i].y=m),c[i].y<0&&(c[i].y=m);var n;n=q?a(i,c,d):s(i);var o=n-g;Math.random()e&&(c[h].x=l),c[h].x<0&&(c[h].x=l),c[h].y>f&&(c[h].y=m),c[h].y<0&&(c[h].y=m);var u;u=q?a(h,c,d):s(h);var v=u-g;Math.random()i||i>1||0>j||j>1?!1:!0},w=function(a,b,c){return a-b/c};return g.start=function(a){for(var b=c.length,d=1,e=1,f=0;a>f;f++){for(var g=0;b>g;g++)Math.random()<.5?t(d):u(d);d=w(d,e,a)}},g.width=function(a){return arguments.length?(e=a,g):e},g.height=function(a){return arguments.length?(f=a,g):f},g.label=function(a){return arguments.length?(c=a,g):c},g.anchor=function(a){return arguments.length?(d=a,g):d},g.alt_energy=function(b){return arguments.length?(a=b,q=!0,g):s},g.alt_schedule=function(a){return arguments.length?(b=a,r=!0,g):w},g};a.d3Labeler=b}),e("elements/coords.geomap",["exports","d3","underscore","topojson","../utils/utils-draw","../utils/d3-labeler","../const","../formatter-registry"],function(a,b,c,d,e,f,g,h){"use strict";function i(a){return a&&a.__esModule?a:{"default":a}}function j(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var k=function(){function a(a,b){for(var c=0;cl,s=r?d-h-3*o:0;return{id:""+b+"-"+a.id,sx:h,sy:i,x:h+s,y:i,width:q.length*o,height:10,name:q,r:s,isRef:r}}).filter(function(a){return!isNaN(a.x)&&!isNaN(a.y)}),i=h.map(function(a){return{x:a.sx,y:a.sy,r:a.r}});l["default"].labeler().label(h).anchor(i).width(d).height(e).start(100),h.filter(function(a){return!a.isRef}).map(function(a){return a.x=a.sx,a.y=a.sy,a}).reduce(function(a,b){return a[b.id]=b,a},f);var j=h.filter(function(a){return a.isRef});j.length<6&&j.reduce(function(a,b){return a[b.id]=b,a},f)}),f}},{key:"_drawMap",value:function(a,b){var c=this,d=this.config.guide,e=this.config.options,f=this.config.options.container,g=this.latScale,h=this.lonScale,i=this.sizeScale,j=this.colorScale,k=this.codeScale,q=this.fillScale,r=this.W,s=this.H,t=p.filter(function(a){return(b.objects||{}).hasOwnProperty(a)});if(0===t.length)throw new Error("Invalid map: should contain some contours");var u;if(q.dim){if(!k.georole)throw console.log("Specify [georole] for code scale"),new Error("[georole] is missing");if(-1===t.indexOf(k.georole))throw console.log('There is no contour for georole "'+k.georole+'"'),console.log("Available contours are: "+t.join(" | ")),new Error("Invalid [georole]");u=k.georole}else u=t[t.length-1];var v;if(g.dim&&h.dim){var w=l["default"].extent(g.domain()),x=l["default"].extent(h.domain());v=[(x[1]+x[0])/2,(w[1]+w[0])/2]}var y=this._createProjection(b,t[0],v),z=l["default"].geo.path().projection(y),A=f.selectAll(".map-container").data([""+r+s+t.join("-")],m["default"].identity);A.exit().remove(),A.enter().append("g").call(function(){var a=this;a.attr("class","map-container");var e={},f=t.reduceRight(function(a,b){return a.concat(b)},[]);if(d.showNames&&(e=c._calcLabels(b,f,z)),f.forEach(function(c,d){var f=function(a){return e[""+c+"-"+a.id]};a.selectAll(".map-contour-"+c).data(n["default"].feature(b,b.objects[c]).features||[]).enter().append("g").call(function(){var a=this;a.attr("class","map-contour-"+c+" map-contour-level map-contour-level-"+d).attr("fill","none"),a.append("title").text(function(a){return(a.properties||{}).name}),a.append("path").attr("d",z),a.append("text").attr("class","place-label-"+c).attr("transform",function(a){var b=f(a);return b?"translate("+[b.x,b.y]+")":""}).text(function(a){var b=f(a);return b?b.name:""}),a.append("line").attr("class","place-label-link-"+c).attr("stroke","gray").attr("stroke-width",.25).attr("x1",function(a){var b=f(a);return b&&b.isRef?b.sx:0}).attr("y1",function(a){var b=f(a);return b&&b.isRef?b.sy:0}).attr("x2",function(a){var b=f(a);return b&&b.isRef?b.x-.6*b.name.length*o:0}).attr("y2",function(a){var b=f(a);return b&&b.isRef?b.y-3.5:0})})}),b.objects.hasOwnProperty("places")){var g=n["default"].feature(b,b.objects.places),h=g.features.map(function(a){var b=y(a.geometry.coordinates);return{x:b[0]+3.5,y:b[1]+3.5,width:a.properties.name.length*o,height:12,name:a.properties.name}}),i=g.features.map(function(a){var b=y(a.geometry.coordinates);return{x:b[0],y:b[1],r:2.5}});l["default"].labeler().label(h).anchor(i).width(r).height(s).start(100),a.selectAll(".place").data(i).enter().append("circle").attr("class","place").attr("transform",function(a){return"translate("+a.x+","+a.y+")"}).attr("r",function(a){return""+a.r+"px"}),a.selectAll(".place-label").data(h).enter().append("text").attr("class","place-label").attr("transform",function(a){return"translate("+a.x+","+a.y+")"}).text(function(a){return a.name})}});var B=a.reduce(function(a,b){var c=b.take();return c.reduce(function(a,b){var c=(b[k.dim]||"").toLowerCase();return a[c]=b[q.dim],a},a)},{});if(A.selectAll(".map-contour-"+u).data(n["default"].feature(b,b.objects[u]).features).call(function(){this.classed("map-contour",!0).attr("fill",function(a){var b,c=a.properties,e=["c1","c2","c3","abbr","name"].filter(function(a){return c.hasOwnProperty(a)&&c[a]&&B.hasOwnProperty(c[a].toLowerCase())});return 0===e.length?b=d.defaultFill:e.length>0&&(b=q(B[c[e[0]].toLowerCase()])),b})}),!g.dim||!h.dim)return[];var C=function(){return this.attr({r:function(a){var b=a.data;return i(b[i.dim])},transform:function(a){var b=a.data;return"translate("+y([b[h.dim],b[g.dim]])+")"},"class":function(a){var b=a.data;return j(b[j.dim])},opacity:.5})},D=function(){this.attr("class",function(a){return"frame-id-"+e.uid+" frame-"+a.hash}).call(function(){var a=this.selectAll("circle").data(function(a){return a.data.map(function(a){return{data:a,uid:e.uid}})});a.exit().remove(),a.call(C),a.enter().append("circle").call(C)})},E=function(a){return{tags:a.key||{},hash:a.hash(),data:a.take()}},F=A.selectAll(".frame-id-"+e.uid).data(a.map(E),function(a){return a.hash});return F.exit().remove(),F.call(D),F.enter().append("g").call(D),[]}},{key:"_createProjection",value:function(a,b,c){var d=this.W,e=this.H,f=this.config.guide,g=100,h=[d/2,e/2],i=c||a.center,j=f.projection||a.projection||"mercator",k=this._createD3Projection(j,i,g,h),m=l["default"].geo.path().projection(k),o=m.bounds(n["default"].feature(a,a.objects[b])),p=g*d/(o[1][0]-o[0][0]),q=g*e/(o[1][1]-o[0][1]);return g=q>p?p:q,h=[d-(o[0][0]+o[1][0])/2,e-(o[0][1]+o[1][1])/2],this._createD3Projection(j,i,g,h)}},{key:"_createD3Projection",value:function(a,b,c,d){var e=l["default"].geo[a];if(!e)throw console.log('Unknown projection "'+a+'"'),console.log("See available projection types here: https://github.com/mbostock/d3/wiki/Geo-Projections"),new Error('Invalid map: unknown projection "'+a+'"');var f=e(),g=[{method:"scale",args:c},{method:"center",args:b},{method:"translate",args:d}].filter(function(a){return a.args});return g.reduce(function(a,b){return a[b.method]&&(a=a[b.method](b.args)),a},f)}}]),a}();a.GeoMap=q}),e("elements/element.pie",["exports","../const","../utils/css-class-map"],function(c,d,e){"use strict";function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var g=function(){function a(a,b){for(var c=0;cs?s:0,q=0===u?1:(i-h)/u,a=function(a){var b=null!==a?parseFloat(a):0;if(!j["default"].isFinite(b))return p(i,i);var c=b-r;return p(h+m(c)*q,i)}}return a.scaleType="size",this.toBaseScale(a,b)}}]),b}(b.BaseScale);a.SizeScale=l}),e("scales/ordinal",["exports","./base","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);be&&(a=e),c>a&&(a=c),d(new Date(a))};return Object.keys(d).forEach(function(a){return e[a]=d[a]}),e.scaleType="time",e.stepSize=function(){return 0},this.toBaseScale(e,a)}}]),b}(b.BaseScale);a.TimeScale=l}),e("scales/linear",["exports","./base","../utils/utils","underscore","d3"],function(a,b,c,d,e){"use strict";function f(a){return a&&a.__esModule?a:{"default":a}}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(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)}Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function a(a,b){for(var c=0;ce&&(f=e),c>f&&(f=c),d(f)};return Object.keys(d).forEach(function(a){return e[a]=d[a]}),e.scaleType="linear",e.stepSize=function(){return 0},this.toBaseScale(e,a)}}]),b}(b.BaseScale);a.LinearScale=m}),e("scales/value",["exports","./base","underscore","d3"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(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)}Object.defineProperty(a,"__esModule",{value:!0});var h=function(){function a(a,b){for(var c=0;c1&&(b.status=n.FAIL,b.messages.push('There is more than one measure dimension for "'+c+'" axis'))):(b.status=n.FAIL,d?b.messages.push('"'+d+'" dimension is undefined for "'+c+'" axis'):b.messages.push('"'+c+'" axis should be specified')),b},{status:n.SUCCESS,countMeasureAxis:0,indexMeasureAxis:[],messages:[],axis:c})}function h(b){var c=l(b.x),d=l(b.y),e=Math.max(c.length,d.length),f=l(b.guide,{});a.times(e-f.length,function(){return f.push({})}),f=f.slice(0,e);var h=g(b.dimensions,c,"x"),i=g(b.dimensions,d,"y");return c=o[h.status](c,h,f),d=o[i.status](d,i,f),a.extend({},b,{x:c,y:d,guide:f})}function i(b,c){for(var d=c.x,e=c.y,f=c.guide,g=Math.max(d.length,e.length),h={type:"COORDS.RECT",unit:[]},i=[].concat(d),j=[].concat(e),l=[].concat(f),n=g;n>0;n--){var o=i.pop(),p=j.pop(),q=l.pop()||{};n===g?(h.x=o,h.y=p,h.unit.push(m(b,{x:k(o),y:k(p),color:c.color,size:c.size,flip:c.flip,colorGuide:q.color,sizeGuide:q.size})),h.guide=a.defaults(q,{x:{label:o},y:{label:p}})):h={type:"COORDS.RECT",x:k(o),y:k(p),unit:[h],guide:a.defaults(q,{x:{label:o},y:{label:p}})}}return c.spec={dimensions:c.dimensions,unit:h},c}Object.defineProperty(b,"__esModule",{value:!0});var j,k=(e(c),function(a){return a?a:null}),l=function(a){var b=void 0===arguments[1]?null:arguments[1];return d.utils.isArray(a)?0===a.length?[b]:a:[a]},m=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}},n={SUCCESS:"SUCCESS",WARNING:"WARNING",FAIL:"FAIL"},o=(j={},f(j,n.SUCCESS,function(a){return a}),f(j,n.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")}),f(j,n.WARNING,function(b,c,d){var e=c.axis,f=c.indexMeasureAxis[0],g=b[f],h=a.without(b,g);h.push(g);var i=d[f][e]||{},j=d[d.length-1][e]||{};return d[d.length-1][e]=i,d[f][e]=j,h}),j);b.normalizeConfig=h,b.transformConfig=i}),e("api/chart-interval",["exports","./converter-helpers"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a){var c=b.normalizeConfig(a);return b.transformConfig("ELEMENT.INTERVAL",c)};a.ChartInterval=c}),e("api/chart-scatterplot",["exports","./converter-helpers"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a){var c=b.normalizeConfig(a);return b.transformConfig("ELEMENT.POINT",c)};a.ChartScatterplot=c}),e("api/chart-line",["exports","../utils/utils","../data-processor","./converter-helpers"],function(b,c,d,e){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var f=function(b){var f=e.normalizeConfig(b),g=f.data,h=f.settings.log,i={none:function(a){return null},horizontal:function(a){var b=c.utils.isArray(a.x)?a.x:[a.x];return b[b.length-1]},vertical:function(a){var b=c.utils.isArray(a.y)?a.y:[a.y];return b[b.length-1]},auto:function(a){var b,e=c.utils.isArray(a.x)?a.x:[a.x],f=c.utils.isArray(a.y)?a.y:[a.y],i=e[e.length-1],j=e.slice(0,e.length-1),k=f[f.length-1],l=f.slice(0,f.length-1),m=a.color,n=j.concat(l).concat([m]).filter(function(a){return null!==a}),o=-1,p=[[[i].concat(n),k],[[k].concat(n),i]],q=p.some(function(a,b){var c=a[0],e=a[1],f=d.DataProcessor.isYFunctionOfX(g,c,[e]);return f.result?o=b:h(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+f.error.keyY+" values (e.g. "+f.error.errY.join(",")+")","for ("+f.error.keyX+" = "+f.error.valX+")."].join(" ")),f.result});return q?b=p[o][0][0]:(h(["All attempts are failed.","Will orient line horizontally by default.","NOTE: the [scatterplot] chart is more convenient for that data."].join(" ")),b=i),b}},j=(f.lineOrientation||"auto").toLowerCase(),k=i.hasOwnProperty(j)?i[j]:i.auto,l=k(f);return null!==l&&(f.data=a(g).sortBy(l)),e.transformConfig("ELEMENT.LINE",f)};b.ChartLine=f}),e("api/chart-interval-stacked",["exports","./converter-helpers"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var c=function(a){var c=b.normalizeConfig(a);return b.transformConfig("ELEMENT.INTERVAL.STACKED",c)};a.ChartIntervalStacked=c}),e("api/chart-parallel",["exports"],function(b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c=function(b){var c=a.extend({columns:{}},b.guide||{}),d={},e=function(b,c){var e,f,g=void 0===arguments[2]?{}:arguments[2],h=c;return c?(e=""+b+"_"+c,f="/"):(e=""+b+":default",f="?"),d.hasOwnProperty(e)||(d[e]=a.extend({type:b,source:f,dim:h},g)),e},f=b.columns.map(function(a){return e(b.dimensions[a].scale,a,c.columns[a])});return{sources:{"?":{dims:{},data:[{}]},"/":{dims:Object.keys(b.dimensions).reduce(function(a,c){return a[c]={type:b.dimensions[c].type},a},{}),data:b.data}},scales:d,unit:{type:"COORDS.PARALLEL",expression:{operator:"none",source:"/"},columns:f,guide:c,units:[{type:"PARALLEL/ELEMENT.LINE",color:e("color",b.color,c.color),columns:f,expression:{operator:"none",source:"/"}}]},plugins:b.plugins||[]}};b.ChartParallel=c}),e("tau.charts",["exports","./utils/utils-dom","./utils/utils","./charts/tau.gpl","./charts/tau.plot","./charts/tau.chart","./unit-domain-period-generator","./formatter-registry","./units-registry","./scales-registry","./elements/coords.cartesian","./elements/coords.parallel","./elements/coords.geomap","./elements/element.point","./elements/element.line","./elements/element.pie","./elements/element.interval","./elements/element.interval.stacked","./elements/element.parallel.line","./scales/color","./scales/size","./scales/ordinal","./scales/period","./scales/time","./scales/linear","./scales/value","./scales/fill","./chart-alias-registry","./api/chart-map","./api/chart-interval","./api/chart-scatterplot","./api/chart-line","./api/chart-interval-stacked","./api/chart-parallel","./error"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var L={},M={},N={UnitDomainPeriodGenerator:i.UnitDomainPeriodGenerator},O={errorCodes:K.errorCodes,unitsRegistry:k.unitsRegistry,scalesRegistry:l.scalesRegistry,tickFormat:j.FormatterRegistry,isChartElement:e.utils.isChartElement,isLineElement:e.utils.isLineElement,d3:b,_:a,tickPeriod:i.UnitDomainPeriodGenerator,colorBrewers:{add:function(a,b){a in L||(L[a]=b)},get:function(a){return L[a]}},plugins:{add:function(a,b){if(a in M)throw new Error("Plugin is already registered.");M[a]=b},get:function(a){return M[a]||function(a){throw new Error(""+a+" plugin is not defined")}}},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}],fitModel:"normal",optimizeGuideBySize:!0,layoutEngine:"EXTRACT",autoRatio:!0,defaultSourceMap:["https://raw.githubusercontent.com","TargetProcess/tauCharts/master/src/addons","world-countries.json"].join("/"),getAxisTickLabelSize:a.memoize(d.utilsDom.getAxisTickLabelSize,function(a){return(a||"").length}),getScrollBarWidth:a.memoize(d.utilsDom.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"}}};g.Plot.globalSettings=O.globalSettings,O.unitsRegistry.reg("COORDS.RECT",m.Cartesian).reg("COORDS.MAP",o.GeoMap).reg("COORDS.PARALLEL",n.Parallel).reg("ELEMENT.POINT",p.Point).reg("ELEMENT.LINE",q.Line).reg("ELEMENT.INTERVAL",s.Interval).reg("ELEMENT.INTERVAL.STACKED",t.StackedInterval).reg("RECT",m.Cartesian).reg("POINT",p.Point).reg("INTERVAL",s.Interval).reg("LINE",q.Line).reg("PARALLEL/ELEMENT.LINE",u.ParallelLine).reg("PIE",r.Pie),O.scalesRegistry.reg("color",v.ColorScale).reg("fill",C.FillScale).reg("size",w.SizeScale).reg("ordinal",x.OrdinalScale).reg("period",y.PeriodScale).reg("time",z.TimeScale).reg("linear",A.LinearScale).reg("value",B.ValueScale);var P=[function(a){return a.data?[]:["[data] must be specified"]}];O.chartTypesRegistry=D.chartTypesRegistry.add("scatterplot",G.ChartScatterplot,P).add("line",H.ChartLine,P).add("bar",function(b){return F.ChartInterval(a.defaults({flip:!1},b))},P).add("horizontalBar",function(b){return F.ChartInterval(a.defaults({flip:!0},b))},P).add("horizontal-bar",function(b){return F.ChartInterval(a.defaults({flip:!0},b))},P).add("map",E.ChartMap,P.concat([function(a){var b=a.fill&&a.code;return a.fill&&!b?"[code] must be specified when using [fill]":void 0},function(a){var b=a.latitude&&a.longitude;return!a.latitude&&!a.longitude||b?void 0:"[latitude] and [longitude] both must be specified"}])).add("stacked-bar",function(b){return I.ChartIntervalStacked(a.defaults({flip:!1},b))},P).add("horizontal-stacked-bar",function(b){return I.ChartIntervalStacked(a.defaults({flip:!0},b))},P).add("parallel",J.ChartParallel,P.concat([function(a){var b=a.columns&&a.columns.length>1;return b?void 0:"[columns] property must contain at least 2 dimensions"}])),c.GPL=f.GPL,c.Plot=g.Plot,c.Chart=h.Chart,c.__api__=N,c.api=O}),e("underscore",function(){return a}),e("d3",function(){return b}),d("tau.charts")}),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;return 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(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).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(a){},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(a){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():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=i;i++)for(var j=-1;1>=j;j++)h.save(),h.translate(i*g.width,j*g.height),e.render(h),h.restore();var k=a.createPattern(g,"repeat");return k}},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(a){}},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(a){},f.Element.title.prototype=new f.Element.ElementBase,f.Element.desc=function(a){},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}),d("../bower_components/FileSaver.js/FileSaver",[],function(){return window.saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(a){"use strict";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}}(window)}),function(){"use strict";function a(a){return"function"==typeof a||"object"==typeof a&&null!==a}function b(a){return"function"==typeof a}function c(a){return"object"==typeof a&&null!==a}function e(){}function f(){return function(){process.nextTick(j)}}function g(){var a=0,b=new M(j),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function h(){var a=new MessageChannel;return a.port1.onmessage=j,function(){a.port2.postMessage(0)}}function i(){return function(){setTimeout(j,1)}}function j(){for(var a=0;J>a;a+=2){var b=O[a],c=O[a+1];b(c),O[a]=void 0,O[a+1]=void 0}J=0}function k(){}function l(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function n(a){try{return a.then}catch(b){return S.error=b,S}}function o(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function p(a,b,c){K(function(a){var d=!1,e=o(c,b,function(c){d||(d=!0,b!==c?s(a,c):u(a,c))},function(b){d||(d=!0,v(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,v(a,e))},a)}function q(a,b){b._state===Q?u(a,b._result):a._state===R?v(a,b._result):w(b,void 0,function(b){s(a,b)},function(b){v(a,b)})}function r(a,c){if(c.constructor===a.constructor)q(a,c);else{var d=n(c);d===S?v(a,S.error):void 0===d?u(a,c):b(d)?p(a,c,d):u(a,c)}}function s(b,c){b===c?v(b,l()):a(c)?r(b,c):u(b,c)}function t(a){a._onerror&&a._onerror(a._result),x(a)}function u(a,b){a._state===P&&(a._result=b,a._state=Q,0===a._subscribers.length||K(x,a))}function v(a,b){a._state===P&&(a._state=R,a._result=b,K(t,a))}function w(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+Q]=c,e[f+R]=d,0===f&&a._state&&K(x,a)}function x(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d,e,f=a._result,g=0;g1)throw new Error("Second argument not supported");if("object"!=typeof a)throw new TypeError("Argument must be an object");return e.prototype=a,new e},0),K=function(a,b){O[J]=a,O[J+1]=b,J+=2,2===J&&H()},L="undefined"!=typeof window?window:{},M=L.MutationObserver||L.WebKitMutationObserver,N="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,O=new Array(1e3);H="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?f():M?g():N?h():i();var P=void 0,Q=1,R=2,S=new y,T=new y;C.prototype._validateInput=function(a){return I(a)},C.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},C.prototype._init=function(){this._result=new Array(this.length)};var U=C;C.prototype._enumerate=function(){for(var a=this.length,b=this.promise,c=this._input,d=0;b._state===P&&a>d;d++)this._eachEntry(c[d],d)},C.prototype._eachEntry=function(a,b){var d=this._instanceConstructor;c(a)?a.constructor===d&&a._state!==P?(a._onerror=null,this._settledAt(a._state,b,a._result)):this._willSettleAt(d.resolve(a),b):(this._remaining--,this._result[b]=this._makeResult(Q,b,a))},C.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===P&&(this._remaining--,this._abortOnReject&&a===R?v(d,c):this._result[b]=this._makeResult(a,b,c)),0===this._remaining&&u(d,this._result)},C.prototype._makeResult=function(a,b,c){return c},C.prototype._willSettleAt=function(a,b){var c=this;w(a,void 0,function(a){c._settledAt(Q,b,a)},function(a){c._settledAt(R,b,a)})};var V=function(a,b){return new U(this,a,!0,b).promise},W=function(a,b){function c(a){s(f,a)}function d(a){v(f,a)}var e=this,f=new e(k,b);if(!I(a))return v(f,new TypeError("You must pass an array to race.")),f;for(var g=a.length,h=0;f._state===P&&g>h;h++)w(e.resolve(a[h]),void 0,c,d);return f},X=function(a,b){var c=this;if(a&&"object"==typeof a&&a.constructor===c)return a;var d=new c(k,b);return s(d,a),d},Y=function(a,b){var c=this,d=new c(k,b);return v(d,a),d},Z=0,$=F;F.all=V,F.race=W,F.resolve=X,F.reject=Y,F.prototype={constructor:F,then:function(a,b){var c=this,d=c._state;if(d===Q&&!a||d===R&&!b)return this;var e=new this.constructor(k),f=c._result;if(d){var g=arguments[d-1];K(function(){A(d,e,g,f)})}else w(c,e,a,b);return e},"catch":function(a){return this.then(null,a)}};var _=function(){var a;a="undefined"!=typeof global?global:"undefined"!=typeof window&&window.document?window:self;var c="Promise"in a&&"resolve"in a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var c;return new a.Promise(function(a){c=a}),b(c)}();c||(a.Promise=$)},aa={Promise:$,polyfill:_};"function"==typeof d&&d.amd?d("../bower_components/es6-promise/promise",[],function(){return aa}):"undefined"!=typeof module&&module.exports?module.exports=aa:"undefined"!=typeof this&&(this.ES6Promise=aa)}.call(this),d("../node_modules/requirejs-text/text",["module"],function(a){"use strict";var b,d,e,f,g,h=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,j=/]*>\s*([\s\S]+)\s*<\/body>/im,k="undefined"!=typeof location&&location.href,l=k&&location.protocol&&location.protocol.replace(/\:/,""),m=k&&location.hostname,n=k&&(location.port||void 0),o={},p=a.config&&a.config()||{};return b={version:"2.0.12",strip:function(a){if(a){a=a.replace(i,"");var b=a.match(j);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=h[b];try{a=new ActiveXObject(c)}catch(d){}if(a){h=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.indexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1,a.length)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,d,e){var f,g,h,i=b.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==c||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,c,d,e){d=c?b.strip(d):d,p.isBuild&&(o[a]=d),e(d)},load:function(a,c,d,e){if(e&&e.isBuild&&!e.inlineText)return void d();p.isBuild=e&&e.isBuild;var f=b.parseName(a),g=f.moduleName+(f.ext?"."+f.ext:""),h=c.toUrl(g),i=p.useXhr||b.useXhr;return 0===h.indexOf("empty:")?void d():void(!k||i(h,l,m,n)?b.get(h,function(c){b.finishLoad(a,f.strip,c,d)},function(a){d.error&&d.error(a)}):c([g],function(a){b.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)}))},write:function(a,c,d,e){if(o.hasOwnProperty(c)){var f=b.jsEscape(o[c]);d.asModule(a+"!"+c,"define(function () { return '"+f+"';});\n")}},writeFile:function(a,c,d,e,f){var g=b.parseName(c),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";b.load(i,d,function(c){var d=function(a){return e(j,a)};d.asModule=function(a,b){return e.asModule(a,j,b)},b.write(a,i,d,f)},f)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(d=c.nodeRequire("fs"),b.get=function(a,b,c){try{var e=d.readFileSync(a,"utf8");0===e.indexOf("\ufeff")&&(e=e.substring(1)),b(e)}catch(f){c&&c(f)}}):"xhr"===p.env||!p.env&&b.createXhr()?b.get=function(a,c,d,e){var f,g=b.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);p.onXhr&&p.onXhr(g,a),g.onreadystatechange=function(b){var e,f;4===g.readyState&&(e=g.status||0,e>399&&600>e?(f=new Error(a+" HTTP status: "+e),f.xhr=g,d&&d(f)):c(g.responseText),p.onXhrComplete&&p.onXhrComplete(g,a))},g.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?b.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),null!==d&&c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(e=Components.classes,f=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),g="@mozilla.org/windows-registry-key;1"in e,b.get=function(a,b){var c,d,h,i={};g&&(a=a.replace(/\//g,"\\")),h=new FileUtils.File(a);try{c=e["@mozilla.org/network/file-input-stream;1"].createInstance(f.nsIFileInputStream),c.init(h,1,0,!1),d=e["@mozilla.org/intl/converter-input-stream;1"].createInstance(f.nsIConverterInputStream),d.init(c,"utf-8",c.available(),f.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),d.readString(c.available(),i),d.close(),c.close(),b(i.value)}catch(j){throw new Error((h&&h.path||"")+": "+j)}}),b}),d("../node_modules/requirejs-text/text!print.style.css",[],function(){return"body > * {\r\n visibility: hidden;\r\n}\r\nbody {\r\n overflow: hidden;\r\n}\r\nbody * {\r\n visibility: hidden !important;\r\n}\r\n\r\n.graphical-report__print-block {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n visibility: visible !important;\r\n display: block !important;\r\n width: 100%;\r\n /*height: 100%;*/\r\n}\r\n"}),function(){"use strict";function a(b){this.map={};var c=this;b instanceof a?b.forEach(function(a,b){b.forEach(function(b){c.append(a,b)})}):b&&Object.getOwnPropertyNames(b).forEach(function(a){c.append(a,b[a])})}function b(a){return a.bodyUsed?Promise.reject(new TypeError("Already read")):void(a.bodyUsed=!0)}function c(a){return new Promise(function(b,c){a.onload=function(){b(a.result)},a.onerror=function(){c(a.error)}})}function d(a){var b=new FileReader;return b.readAsArrayBuffer(a),c(b)}function e(a){var b=new FileReader;return b.readAsText(a),c(b)}function f(){return this.bodyUsed=!1,l?(this.blob=function(){var a=b(this);return a?a:Promise.resolve(this._bodyBlob)},this.arrayBuffer=function(){return this.blob().then(d)},this.text=function(){return this.blob().then(e)}):this.text=function(){var a=b(this);return a?a:Promise.resolve(this._bodyText)},"FormData"in self&&(this.formData=function(){return this.text().then(i)}),this.json=function(){return this.text().then(JSON.parse)},this}function g(a){var b=a.toUpperCase();return m.indexOf(b)>-1?b:a}function h(b,c){c=c||{},this.url=b,this._body=c.body,this.credentials=c.credentials||"omit",this.headers=new a(c.headers),this.method=g(c.method||"GET"),this.mode=c.mode||null,this.referrer=null}function i(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function j(b){var c=new a,d=b.getAllResponseHeaders().trim().split("\n");return d.forEach(function(a){var b=a.trim().split(":"),d=b.shift().trim(),e=b.join(":").trim();c.append(d,e)}),c}function k(a,b){b||(b={}),l?"string"==typeof a?this._bodyBlob=new Blob([a]):this._bodyBlob=a:this._bodyText=a,this.type="default",this.url=null,this.status=b.status,this.statusText=b.statusText,this.headers=b.headers,this.url=b.url||""}if(!self.fetch){a.prototype.append=function(a,b){a=a.toLowerCase();var c=this.map[a];c||(c=[],this.map[a]=c),c.push(b)},a.prototype["delete"]=function(a){delete this.map[a.toLowerCase()]},a.prototype.get=function(a){var b=this.map[a.toLowerCase()];return b?b[0]:null},a.prototype.getAll=function(a){return this.map[a.toLowerCase()]||[]},a.prototype.has=function(a){return this.map.hasOwnProperty(a.toLowerCase())},a.prototype.set=function(a,b){this.map[a.toLowerCase()]=[b]},a.prototype.forEach=function(a){var b=this;Object.getOwnPropertyNames(this.map).forEach(function(c){a(c,b.map[c])})};var l="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(a){return!1}}(),m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.fetch=function(){var a=this;return new Promise(function(b,c){function d(){return"responseURL"in e?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):void 0}var e=new XMLHttpRequest;e.onload=function(){var a=1223===e.status?204:e.status;if(100>a||a>599)return void c(new TypeError("Network request failed"));var f={status:a,statusText:e.statusText,headers:j(e),url:d()},g="response"in e?e.response:e.responseText;b(new k(g,f))},e.onerror=function(){c(new TypeError("Network request failed"))},e.open(a.method,a.url),"responseType"in e&&l&&(e.responseType="blob"),a.headers.forEach(function(a,b){b.forEach(function(b){ +e.setRequestHeader(a,b)})}),e.send(void 0===a._body?null:a._body)})},f.call(h.prototype),f.call(k.prototype),self.Headers=a,self.Request=h,self.Response=k,self.fetch=function(a,b){return new h(a,b).fetch()},self.fetch.polyfill=!0}}(),d("../bower_components/fetch/fetch",function(){}),function(a){"function"==typeof d&&d.amd?d("export",["tauCharts","canvg","FileSaver","promise","print.style.css","fetch"],function(b,c,d,e,f){return window.Promise=window.Promise||e.Promise,a(b,c,d,window.Promise,f)}):a(this.tauCharts,this.canvg,this.saveAs)}(function(a,b,c,d,e){function f(a){return Math.log(a)/Math.LN10}function g(e){return{_createDataUrl:function(a){var c=this._cssPaths.map(function(a){return fetch(a).then(function(a){return a.text()})});return d.all(c).then(function(a){return a.join(" ")}).then(function(c){var d=o(c),e=document.createElement("div"),f=a.getSVG().cloneNode(!0);e.appendChild(f),i.select(f).attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg"),f.insertBefore(d,f.firstChild),this._renderAdditionalInfo(f,a);var g=document.createElement("canvas");return g.height=f.getAttribute("height"),g.width=f.getAttribute("width"),b(g,f.parentNode.innerHTML),g.toDataURL("image/png")}.bind(this))},_findUnit:function(a){var b=a.getConfig(),c=a.getConfig(),d=function(a){var b=c.scales[a];return b&&b.dim&&b.source&&c.sources[b.source].dims[b.dim]};return k(b.unit,function(a){if(d(a.color))return!0;if(d(a.size)){var b=c.scales[a.size];return"measure"===c.sources[b.source].dims[b.dim].type}})},_toPng:function(a){this._createDataUrl(a).then(function(a){for(var b=atob(a.substring("data:image/png;base64,".length)),d=new Uint8Array(b.length),e=0,f=b.length;f>e;++e)d[e]=b.charCodeAt(e);var g=new Blob([d.buffer],{type:"image/png"});c(g,(this._fileName||"export")+".png")}.bind(this))},_toPrint:function(a){this._createDataUrl(a).then(function(a){h=document.createElement("img"),h.classList.add("graphical-report__print-block");var b=h;document.body.appendChild(b),b.src=a,document.head.appendChild(p),b.onload=function(){window.print()}})},_renderColorLegend:function(a,b,c,d){var f=this._unit.color,g=this._unit.color.dim;a.guide=a.guide||{},a.guide.color=a.guide.color||{};var h=j.isObject(a.guide.color.label)?a.guide.color.label.text:a.guide.color.label,i=h||f.dim,k=this._getColorMap(c.getData({excludeFilter:["legend"]}),f,g).values,l=function(){this.attr("transform",function(a,b){return"translate(5,"+20*(b+1)+")"}),this.append("circle").attr("r",6).attr("class",function(a){return a.color}),this.append("text").attr("x",12).attr("y",5).text(function(a){return j.escape(m(a.label)?"No "+i:a.label)}).style({"font-size":e.fontSize+"px"})},n=b.append("g").attr("class","legend").attr("transform","translate("+(d+10)+","+e.paddingTop+")");return n.append("text").text(i.toUpperCase()).style({"text-transform":"uppercase","font-weight":"600","font-size":e.fontSize+"px"}),n.selectAll("g").data(k).enter().append("g").call(l),{h:20*k.length+20,w:0}},_renderSizeLegend:function(a,b,c,d,g){var h=this._unit.size,i=this._unit.size.scaleDim;a.guide=a.guide||{},a.guide.size=this._unit.config.guide.size;var k,m=a.guide.size.label.text||i,n=j.sortBy(c.getData(),function(a){return h(a[i])}),o=n.length,p=n[0][i],q=n[o-1][i];if(q-p){var r=f(q-p),s=0>4-r?0:Math.round(4-r),t=Math.pow(10,s),u=(q-p)/5;k=j([p,p+u,p+2*u,p+3*u,q]).chain().map(function(a){return a===q||a===p?a:Math.round(a*t)/t}).unique().value()}else k=[p];var v=k.map(function(b){var c=h(b);return{diameter:l(2*c+2),radius:c,value:b,className:a.color?"color-definite":""}}.bind(this)).reverse(),w=Math.max.apply(null,j.pluck(v,"diameter")),x=e.fontSize,y=0,z=function(){this.attr("transform",function(a){y+=w;var b="translate(5,"+y+")";return y+=10,b}),this.append("circle").attr("r",function(a){return a.radius}).attr("class",function(a){return a.className}).style({opacity:.4}),this.append("g").attr("transform",function(a){return"translate("+w+","+x/2+")"}).append("text").attr("x",function(a){return 0}).attr("y",function(a){return 0}).text(function(a){return a.value}).style({"font-size":x+"px"})},A=b.append("g").attr("class","legend").attr("transform","translate("+(d+10)+","+(e.paddingTop+g.h+20)+")");A.append("text").text(m.toUpperCase()).style({"text-transform":"uppercase","font-weight":"600","font-size":x+"px"}),A.selectAll("g").data(v).enter().append("g").call(z)},_renderAdditionalInfo:function(a,b){var c=this._findUnit(b);if(c){var d={h:0,w:0},e=b.getConfig();a=i.select(a);var f=parseInt(a.attr("width"),10);a.attr("height");a.attr("width",f+160);var g=function(a){var b=e.scales[a];return b&&b.dim&&b.source&&e.sources[b.source].dims[b.dim]};if(g(c.color)){var h=this._renderColorLegend(c,a,b,f);d.h=h.h,d.w=h.w}var e=b.getConfig(),j=e.scales[c.size];c.size&&j.dim&&"measure"===e.sources[j.source].dims[j.dim].type&&this._renderSizeLegend(c,a,b,f,d)}},onUnitDraw:function(b,c){a.api.isChartElement(c)&&(this._unit=c)},_getColorMap:function(a,b,c){return j(a).chain().map(function(a){var d=a[c];return{color:b(d),value:d,label:d}}).uniq(function(a){return a.value}).value().reduce(function(a,b){return a.brewer[b.value]=b.color,a.values.push(b),a},{brewer:{},values:[]})},_select:function(a,b){a=a||"";var c=this["_to"+a.charAt(0).toUpperCase()+a.slice(1)];c&&c.call(this,b)},_handleMenu:function(a,b,c){a.addEventListener("click",function(a){if("a"===a.target.tagName.toLowerCase()){var d=a.target.getAttribute("data-value");this._select(d,b),c.hide()}}.bind(this)),a.addEventListener("mouseover",function(a){"a"===a.target.tagName.toLowerCase()&&a.target.focus()}.bind(this)),a.addEventListener("keydown",function(a){if(a.keyCode===n.ESCAPE&&c.hide(),a.keyCode===n.DOWN&&(a.target.parentNode.nextSibling?a.target.parentNode.nextSibling.childNodes[0].focus():a.target.parentNode.parentNode.firstChild.childNodes[0].focus()),a.keyCode===n.UP&&(a.target.parentNode.previousSibling?a.target.parentNode.previousSibling.childNodes[0].focus():a.target.parentNode.parentNode.lastChild.childNodes[0].focus()),a.keyCode===n.ENTER){var d=a.target.getAttribute("data-value");this._select(d,b)}a.preventDefault()}.bind(this));var d=null,e=t(),f=e?"focusin":"focus",g=e?"focusout":"blur";a.addEventListener(g,function(){d=setTimeout(function(){c.hide()},100)},!e),a.addEventListener(f,function(){clearTimeout(d)},!e),this._container.addEventListener("click",function(){c.toggle(),c.hidden||a.querySelectorAll("a")[0].focus()})},init:function(b){e=e||{},this._cssPaths=e.cssPaths,this._fileName=e.fileName,this._cssPaths||(this._cssPaths=[],a.api.globalSettings.log('[export plugin]: the "cssPath" parameter should be specified for correct operation',"warn")),e=j.defaults(e,{fontSize:13,paddingTop:30}),this._container=b.insertToHeader('Export>');var c=b.addBalloon({place:"bottom-left"});this._popup=c,c.content(['"].join("")),c.attach(this._container);var d=c.getElement();d.setAttribute("tabindex","-1"),this._handleMenu(d,b,c),b.on("exportTo",function(a,b){this._select(b,a)}.bind(this))},destroy:function(){this._popup&&this._popup.destroy()}}}var h,i=a.api.d3,j=a.api._,k=function(a,b){if(b(a))return a;var c,d,e,f=a.units||[];for(c=0;c',_template:e.template('
<%=name%>
<%=items%>
'),_itemTemplate:e.template(["
\">",'
<%=label%>',"
"].join("")),_itemSizeTemplate:e.template(['
','
','',"
<%=value%>","
"].join("")),_renderColorLegend:function(a,b){var c=b.getConfig(),d=function(a){var b=c.scales[a];return b&&b.dim&&b.source&&c.sources[b.source].dims[b.dim]};if(d(a.color)){var f=this._unit.color,h=this._unit.color.dim;a.guide=a.guide||{},a.guide.color=a.guide.color||{};var i=e.isObject(a.guide.color.label)?a.guide.color.label.text:a.guide.color.label,j=i||f.dim,k=this._getColorMap(b.getData({excludeFilter:["legend"]}),f,h);b.configGPL.scales[this._unit.config.color].brewer=k.brewer;var l=e.reduce(k.values,function(a,b){var c={dimension:h,value:b.value},d=JSON.stringify(c),f=e.escape(g(b.label)?"No "+j:b.label);return a.items.push(this._itemTemplate({color:b.color,classDisabled:this._currentFilters[d]?"disabled":"",label:f,value:e.escape(d)})),a.storageValues[d]=e.extend({color:b.color},c),a},{items:[],storageValues:{}},this);this._storageValues=l.storageValues,this._container.insertAdjacentHTML("beforeend",this._template({items:l.items.join(""),name:j})),this._colorScaleSize=l.items.length}},_renderSizeLegend:function(a,c){var f=c.getConfig(),g=f.scales[a.size];if(a.size&&g.dim&&"measure"===f.sources[g.source].dims[g.dim].type){var h=this._unit.size,i=this._unit.size.scaleDim;a.guide=a.guide||{},a.guide.size=this._unit.config.guide.size;var j,k=a.guide.size.label.text||i,l=e.sortBy(c.getData(),function(a){return h(a[i])}),m=l.length,n=l[0][i],o=l[m-1][i];if(o-n){var p=b(o-n),q=Math.round(4-p),r=Math.pow(10,q),s=(o-n)/5,t=[n,n+s,n+2*s,n+3*s,o];j=e(t).chain().map(function(a){return a===o||a===n?a:Math.round(a*r)/r}).unique().value()}else j=[n];var u=e.map(j,function(b){var c=h(b);return this._itemSizeTemplate({diameter:d(2*c+2),radius:c,value:b,className:a.color?"color-definite":"color-default-size"})},this).reverse();this._container.insertAdjacentHTML("beforeend",this._template({items:u.join(""),name:k}))}},onRender:function(a){if(this._container){this._container.innerHTML="";var b=this._findUnit(a);this._renderColorLegend(b,a),this._renderSizeLegend(b,a)}}}};return a.api.plugins.add("legend",h),h}),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(),e=this._findDimensionGuides(d),f=c.reduce(e,function(a,b,d){return a[d]=c.last(b),a},{}),g=this._generateDefaultFormatters(f,d.scales);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(a){},onUnitDraw:function(b,c){if(a.api.isChartElement(c)){var d=this._generateKey(c.config.options.uid);this._unitMeta[d]=c;var e=c.config.frames.reduce(function(a,b){return a.concat(b.data)},[]);this._dataWithCoords[d]=e.map(function(a){return{x:c.xScale(a[c.xScale.dim]),y:c.yScale(a[c.yScale.dim]),item:a}},this)}},renderItem:function(a,b,c,d){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(a){},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 b.label?(a[c]=b.label,b.label.hasOwnProperty("text")&&(a[c]=b.label.text)):a[c]=c,a},{})},_generateDefaultFormatters:function(b,d){return c.reduce(b,function(b,c,d){var e=function(b){if(null==b)return null;var d=c.tickPeriod||c.tickFormat;if(d){var e="x-time-auto"===d?"day":d;return a.api.tickFormat.get(e)(b)}return c.tickLabel?b[c.tickLabel]:b};return b[d]=function(a){var b=e(a);return null==b?"No "+c.label:b},b},{})},_findDimensionGuides:function(a){var b={},c=a.scales,d=function(a,d){var e=d[a];if(e){var f=(d.guide||{})[a],g=c[e].dim;if(g&&f){var h=f.tickLabel?g.replace(new RegExp("\\."+f.tickLabel),""):g;b[h]||(b[h]=[]),b[h].push(f)}}};return f(a.unit,function(a){return d("x",a),d("y",a),d("color",a),d("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.dim,a.color&&a.color.dim],d=[],e=[];a=a.parentUnit;)d.push(a.xScale.dim),e.push(a.yScale.dim);return c.compact(b.concat(e,d).reverse())},_handleLineElement:function(a,b,e){var f=a.elementData,g=this._dataWithCoords[b],h=g.filter(function(a){return c.contains(f.data,a.item)});if(1===h.length)return h[0].item;var i=c.reduce(h,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?i:[]},a.traverseSpec(e,function(a,c){if(f.predicateIsApplicable(e,a,c)){var d=e.scales[a.x],g=e.scales[a.y],h=JSON.parse(JSON.stringify(a));h.type="ELEMENT.LINE",h.transformation=h.transformation||[],h.transformation.push({type:"regression",args:{type:b.type,x:d.dim,y:g.dim}}),h.guide=h.guide||{},h.guide.cssClass="graphical-report__trendline",h.guide.widthCssClass="graphical-report__line-width-1",c.units.push(h)}}))},containerTemplate:'
',template:d.template(['","
",'","
",'
<%= error %>
'].join("")),onRender:function(a){if(this._container){this._container.innerHTML=this.template({title:"Trend line",error:this._error,showTrend:b.showTrend&&this._isApplicable?"checked":"",models:b.models.map(function(a){var c=b.type===a?"selected":"";return""})});var c=function(a){return function(){e.select(this).classed({active:a,"graphical-report__line-width-1":!a,"graphical-report__line-width-3":a})}},d=e.select(a.getSVG());d.selectAll(".graphical-report__trendline").on("mouseenter",c(!0)).on("mouseleave",c(!1))}}}}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&&ga[g]-a[h]?f:g;for(var k=Math.abs(1/(a[j]-i)),l=0,m=0,n=0,o=0,p=0,q=f;g>=q;){var r,s=a[q],t=b[q];r=h>q?i-s:s-i;var u=d(r*k),v=s*u;l+=u,m+=v,n+=s*v,o+=t*u,p+=t*v,q++}var w,x=m/l,y=o/l,z=p/l,A=n/l;w=A==x*x?0:(z-x*y)/(A-x*x);var B=y-w*x;e[h]=w*i+B}return e}return{equation:"loess",points:b(a,.5),string:"loess"}}};return function(a,c,d){return"string"==typeof a?b[a](c,d):void 0}}(),d=a.api._,e=a.api.d3;return a.api.plugins.add("trendline",b),b}); \ No newline at end of file