From 9650708d76ccdb5ea28fcc915426ea7867ec1e36 Mon Sep 17 00:00:00 2001 From: konstantin Date: Fri, 19 Dec 2014 12:55:16 +0300 Subject: [PATCH] release 0.2.22 --- build/plugins/tauCharts.legend.css | 20 +- build/plugins/tauCharts.legend.min.css | 2 +- build/plugins/tauCharts.legend.min.js | 2 +- build/plugins/tauCharts.tooltip.min.js | 2 +- build/plugins/tauCharts.trendline.min.js | 2 +- build/tauCharts.color-brewer.js | 646 ++++++------ build/tauCharts.color-brewer.min.js | 2 +- build/tauCharts.js | 1170 ++++++++++------------ build/tauCharts.min.js | 6 +- css/legend.css | 20 +- 10 files changed, 898 insertions(+), 974 deletions(-) diff --git a/build/plugins/tauCharts.legend.css b/build/plugins/tauCharts.legend.css index e7de4aa76..06d868c16 100644 --- a/build/plugins/tauCharts.legend.css +++ b/build/plugins/tauCharts.legend.css @@ -47,71 +47,71 @@ } .graphical-report__legend__item .color10-1 { background: #377eb8; + border: 1px solid #377eb8; } .graphical-report__legend__item.disabled .color10-1 { - border: 1px solid #377eb8; background-color: transparent; } .graphical-report__legend__item .color10-2 { background: #e41a1c; + border: 1px solid #e41a1c; } .graphical-report__legend__item.disabled .color10-2 { - border: 1px solid #e41a1c; background-color: transparent; } .graphical-report__legend__item .color10-3 { background: #4daf4a; + border: 1px solid #4daf4a; } .graphical-report__legend__item.disabled .color10-3 { - border: 1px solid #4daf4a; background-color: transparent; } .graphical-report__legend__item .color10-4 { background: #984ea3; + border: 1px solid #984ea3; } .graphical-report__legend__item.disabled .color10-4 { - border: 1px solid #984ea3; background-color: transparent; } .graphical-report__legend__item .color10-5 { background: #ff7f00; + border: 1px solid #ff7f00; } .graphical-report__legend__item.disabled .color10-5 { - border: 1px solid #ff7f00; background-color: transparent; } .graphical-report__legend__item .color10-6 { background: #e9e964; + border: 1px solid #e9e964; } .graphical-report__legend__item.disabled .color10-6 { - border: 1px solid #e9e964; background-color: transparent; } .graphical-report__legend__item .color10-7 { background: #a65628; + border: 1px solid #a65628; } .graphical-report__legend__item.disabled .color10-7 { - border: 1px solid #a65628; background-color: transparent; } .graphical-report__legend__item .color10-8 { background: #f781bf; + border: 1px solid #f781bf; } .graphical-report__legend__item.disabled .color10-8 { - border: 1px solid #f781bf; background-color: transparent; } .graphical-report__legend__item .color10-9 { background: #999999; + border: 1px solid #999999; } .graphical-report__legend__item.disabled .color10-9 { - border: 1px solid #999999; background-color: transparent; } .graphical-report__legend__item .color10-10 { background: #222222; + border: 1px solid #222222; } .graphical-report__legend__item.disabled .color10-10 { - border: 1px solid #222222; background-color: transparent; } diff --git a/build/plugins/tauCharts.legend.min.css b/build/plugins/tauCharts.legend.min.css index 21e3073ad..54a601e04 100644 --- a/build/plugins/tauCharts.legend.min.css +++ b/build/plugins/tauCharts.legend.min.css @@ -1 +1 @@ -.graphical-report__legend{padding:20px 0 20px 10px;margin-right:20px;width:160px;box-sizing:border-box}.graphical-report__legend__title{margin:0 0 10px 10px}.graphical-report__legend__item{padding:10px 30px}.graphical-report__legend__item:hover{background-color:rgba(189,195,205,.2)}.graphical-report__legend__item .color-default{background:#377eb8;border-radius:4px}.graphical-report__legend__title{text-transform:uppercase;font-weight:600;font-size:13px}.graphical-report__legend__item{position:relative;font-size:13px;cursor:pointer}.graphical-report__legend__item.disabled,.graphical-report__legend__item:disabled{color:#ccc}.graphical-report__legend__item.disabled .graphical-report__legend__guide{background:0 0}.graphical-report__legend__guide{width:15px;height:15px;box-sizing:border-box;border-width:1px;border-style:solid;border-radius:50%;position:absolute;top:10px;left:10px}.graphical-report__legend__item .color10-1{background:#377eb8}.graphical-report__legend__item.disabled .color10-1{border:1px solid #377eb8;background-color:transparent}.graphical-report__legend__item .color10-2{background:#e41a1c}.graphical-report__legend__item.disabled .color10-2{border:1px solid #e41a1c;background-color:transparent}.graphical-report__legend__item .color10-3{background:#4daf4a}.graphical-report__legend__item.disabled .color10-3{border:1px solid #4daf4a;background-color:transparent}.graphical-report__legend__item .color10-4{background:#984ea3}.graphical-report__legend__item.disabled .color10-4{border:1px solid #984ea3;background-color:transparent}.graphical-report__legend__item .color10-5{background:#ff7f00}.graphical-report__legend__item.disabled .color10-5{border:1px solid #ff7f00;background-color:transparent}.graphical-report__legend__item .color10-6{background:#e9e964}.graphical-report__legend__item.disabled .color10-6{border:1px solid #e9e964;background-color:transparent}.graphical-report__legend__item .color10-7{background:#a65628}.graphical-report__legend__item.disabled .color10-7{border:1px solid #a65628;background-color:transparent}.graphical-report__legend__item .color10-8{background:#f781bf}.graphical-report__legend__item.disabled .color10-8{border:1px solid #f781bf;background-color:transparent}.graphical-report__legend__item .color10-9{background:#999}.graphical-report__legend__item.disabled .color10-9{border:1px solid #999;background-color:transparent}.graphical-report__legend__item .color10-10{background:#222}.graphical-report__legend__item.disabled .color10-10{border:1px solid #222;background-color:transparent} \ No newline at end of file +.graphical-report__legend{padding:20px 0 20px 10px;margin-right:20px;width:160px;box-sizing:border-box}.graphical-report__legend__title{margin:0 0 10px 10px}.graphical-report__legend__item{padding:10px 30px}.graphical-report__legend__item:hover{background-color:rgba(189,195,205,.2)}.graphical-report__legend__item .color-default{background:#377eb8;border-radius:4px}.graphical-report__legend__title{text-transform:uppercase;font-weight:600;font-size:13px}.graphical-report__legend__item{position:relative;font-size:13px;cursor:pointer}.graphical-report__legend__item.disabled,.graphical-report__legend__item:disabled{color:#ccc}.graphical-report__legend__item.disabled .graphical-report__legend__guide{background:0 0}.graphical-report__legend__guide{width:15px;height:15px;box-sizing:border-box;border-width:1px;border-style:solid;border-radius:50%;position:absolute;top:10px;left:10px}.graphical-report__legend__item .color10-1{background:#377eb8;border:1px solid #377eb8}.graphical-report__legend__item.disabled .color10-1{background-color:transparent}.graphical-report__legend__item .color10-2{background:#e41a1c;border:1px solid #e41a1c}.graphical-report__legend__item.disabled .color10-2{background-color:transparent}.graphical-report__legend__item .color10-3{background:#4daf4a;border:1px solid #4daf4a}.graphical-report__legend__item.disabled .color10-3{background-color:transparent}.graphical-report__legend__item .color10-4{background:#984ea3;border:1px solid #984ea3}.graphical-report__legend__item.disabled .color10-4{background-color:transparent}.graphical-report__legend__item .color10-5{background:#ff7f00;border:1px solid #ff7f00}.graphical-report__legend__item.disabled .color10-5{background-color:transparent}.graphical-report__legend__item .color10-6{background:#e9e964;border:1px solid #e9e964}.graphical-report__legend__item.disabled .color10-6{background-color:transparent}.graphical-report__legend__item .color10-7{background:#a65628;border:1px solid #a65628}.graphical-report__legend__item.disabled .color10-7{background-color:transparent}.graphical-report__legend__item .color10-8{background:#f781bf;border:1px solid #f781bf}.graphical-report__legend__item.disabled .color10-8{background-color:transparent}.graphical-report__legend__item .color10-9{background:#999;border:1px solid #999}.graphical-report__legend__item.disabled .color10-9{background-color:transparent}.graphical-report__legend__item .color10-10{background:#222;border:1px solid #222}.graphical-report__legend__item.disabled .color10-10{background-color:transparent} \ No newline at end of file diff --git a/build/plugins/tauCharts.legend.min.js b/build/plugins/tauCharts.legend.min.js index 6362b77a6..cf6e1d1f5 100644 --- a/build/plugins/tauCharts.legend.min.js +++ b/build/plugins/tauCharts.legend.min.js @@ -1,4 +1,4 @@ -/*! taucharts - v0.2.21 - 2014-12-18 +/*! taucharts - v0.2.21 - 2014-12-19 * https://github.com/TargetProcess/tauCharts * Copyright (c) 2014 Taucraft Limited; Licensed Creative Commons */ !function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){{require("tauCharts")}module.exports=a()}else a(this.tauCharts)}(function(a){var b=function(a){if(a.color)return a;var c,d,e,f=a.unit||[];for(c=0;c',_template:c.template('
<%=name%>
<%=items%>'),_itemTemplate:c.template(["
\">",'
<%=label%>',"
"].join("")),onRender:function(a){if(this._container){var d=this._unit.options.color,e=d.dimension,f=this._getColorMap(a,d,e),g=a.getConfig(),h=b(g.spec.unit);h.guide=h.guide||{},h.guide.color=this._unit.guide.color,h.guide.color.brewer=f;var i=c.map(f,function(a,b){var d=JSON.stringify({dimension:e,value:b,color:a});return this._itemTemplate({color:a,classDisabled:this._currentFilters[d]?"disabled":"",label:c.escape(b),value:d})},this).join("");this._container.innerHTML=this._template({items:i,name:this._unit.guide.color.label.text||this._unit.options.color.dimension})}}}};return a.api.plugins.add("legend",e),e}); \ No newline at end of file diff --git a/build/plugins/tauCharts.tooltip.min.js b/build/plugins/tauCharts.tooltip.min.js index 8421b0e25..b9558ce85 100644 --- a/build/plugins/tauCharts.tooltip.min.js +++ b/build/plugins/tauCharts.tooltip.min.js @@ -1,4 +1,4 @@ -/*! taucharts - v0.2.21 - 2014-12-18 +/*! taucharts - v0.2.21 - 2014-12-19 * https://github.com/TargetProcess/tauCharts * Copyright (c) 2014 Taucraft Limited; Licensed Creative Commons */ !function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){{require("tauCharts")}module.exports=a()}else a(this.tauCharts)}(function(a){function b(a){return a=a||{},{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:{},_getFormatter:function(a){return this.formatters[a]||c.identity},init:function(b){this._chart=b,this._dataFields=a.fields,c.extend(this,c.omit(a,"fields")),this._timeoutHideId=null,this._dataWithCoords={},this._unitMeta={},this._templateItem=c.template(this.itemTemplate),this._tooltip=b.addBalloon({spacing:3,auto:!0,effectClass:"fade"}),this._elementTooltip=this._tooltip.getElement();var d=this._elementTooltip;d.addEventListener("mouseover",function(){clearTimeout(this._timeoutHideId)}.bind(this),!1),d.addEventListener("mouseleave",function(){this._hide()}.bind(this),!1),d.addEventListener("click",function(a){var b=a.target;b.classList.contains("i-role-exclude")&&(this._exclude(),this._hide())}.bind(this),!1),d.insertAdjacentHTML("afterbegin",this.template)},onUnitReady:function(a,b){if(b.type&&0===b.type.indexOf("ELEMENT")){var c=this._generateKey(b.$where);this._unitMeta[c]=b;var d=b.partition();this._dataWithCoords[c]=d.map(function(a){return{x:b.options.xScale(a[b.x.scaleDim]),y:b.options.yScale(a[b.y.scaleDim]),item:a}},this)}},render:function(a,b){return b=c.unique(b),b.map(function(b){var d=a[b],e=c.isNull(d)||c.isUndefined(d)?"No "+b:d;return this._templateItem({label:b,value:this._getFormatter(b)(e)})},this).join("")},onRender:function(){this._hide()},_exclude:function(){this._chart.addFilter({tag:"exclude",predicate:function(a){return function(b){return JSON.stringify(b)!==JSON.stringify(a)}}(this._currentElement)}),this.onExcludeData(this._currentElement)},_calculateLength:function(a,b,c,d){return(c-a)*(c-a)+(d-b)*(d-b)},_calculateLengthToLine:function(a,b,c,d,f,g){var h={x:c-a,y:d-b},i={x:f-a,y:g-b},j=h.x*i.x+h.y*i.y;if(0>j)return e(a,f,b,g);var k={x:a-c,y:b-d},l={x:f-c,y:g-d},m=k.x*l.x+k.y*l.y;return 0>m?e(c,f,d,g):Math.abs(((c-a)*(g-b)-(d-b)*(f-a))/e(a,c,b,d))},_generateKey:function(a){return JSON.stringify(a)},_getFields:function(a){if(this._dataFields)return this._dataFields;for(var b=[a.size&&a.size.scaleDim,a.color&&a.color.scaleDim],d=[],e=[];a=a.parentUnit;)d.push(a.x.scaleDim),e.push(a.y.scaleDim);return c.compact(b.concat(e,d).reverse())},isLine:function(a){return a.elementData.key&&Array.isArray(a.elementData.values)},_onElementMouseOver:function(a,b,e,f){clearTimeout(this._timeoutHideId);var g=this._generateKey(b.cellData.$where),h=b.elementData,i=this.isLine(b);if(i){var j=this._dataWithCoords[g],k=j.filter(function(a){return c.contains(h.values,a.item)}),l=c.reduce(k,function(a,b,c,d){var f;if(c+1===d.length){var g=b;b=d[c-1],f=g}else f=d[c+1];var h=this._calculateLengthToLine(b.x,b.y,f.x,f.y,e[0],e[1]);return h1&&f("i-trendline-"+e,n,j.xScale,j.yScale,j.color.get(g),j.container)});var r=function(a){return function(){var b=e.select(this);b.classed({active:a,"graphical-report__line-width-1":!a,"graphical-report__line-width-2":a})}};j.container.selectAll(".graphical-report__trendline").on("mouseenter",r(!0)).on("mouseleave",r(!1))}},containerTemplate:'
',template:d.template(['","
",'","
",'
<%= error %>
'].join("")),onRender:function(){if(this._container){var a=this.isApplicable?"applicable-true":"applicable-false",c=this.isApplicable?"applicable-false":"applicable-true";this._container.classList.add(a),this._container.classList.remove(c),this._container.innerHTML=this.template({title:"Trend line",error:this.error,showTrend:b.showTrend&&this.isApplicable?"checked":"",models:["linear","exponential","logarithmic"].map(function(a){var c=b.type===a?"selected":"";return""})})}}}}var c=function(){"use strict";var a=function(a,b){var c=0,d=0,e=0,f=0,g=0,h=a.length-1,i=new Array(b);for(c=0;h>c;c++){for(f=c,d=c+1;h>d;d++)Math.abs(a[c][d])>Math.abs(a[c][f])&&(f=d);for(e=c;h+1>e;e++)g=a[e][c],a[e][c]=a[e][f],a[e][f]=g;for(d=c+1;h>d;d++)for(e=h;e>=c;e--)a[e][d]-=a[e][c]*a[c][d]/a[c][c]}for(d=h-1;d>=0;d--){for(g=0,e=d+1;h>e;e++)g+=a[e][d]*i[e];i[d]=(a[h][d]-g)/a[d][d]}return i},b={linear:function(a){for(var b=[0,0,0,0,0],c=0,d=[];cg;g++){var i=[a[g][0],a[g][0]*e+f];d.push(i)}var j="y = "+Math.round(100*e)/100+"x + "+Math.round(100*f)/100;return{equation:[e,f],points:d,string:j}},exponential:function(a){var b=[0,0,0,0,0,0],c=0,d=[];for(i=a.length;i>c;c++)a[c][1]&&(b[0]+=a[c][0],b[1]+=a[c][1],b[2]+=a[c][0]*a[c][0]*a[c][1],b[3]+=a[c][1]*Math.log(a[c][1]),b[4]+=a[c][0]*a[c][1]*Math.log(a[c][1]),b[5]+=a[c][0]*a[c][1]);for(var e=b[1]*b[2]-b[5]*b[5],f=Math.pow(Math.E,(b[2]*b[3]-b[5]*b[4])/e),g=(b[1]*b[4]-b[5]*b[3])/e,h=0,i=a.length;i>h;h++){var j=[a[h][0],f*Math.pow(Math.E,g*a[h][0])];d.push(j)}var k="y = "+Math.round(100*f)/100+"e^("+Math.round(100*g)/100+"x)";return{equation:[f,g],points:d,string:k}},logarithmic:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=a[c][1]*Math.log(a[c][0]),b[2]+=a[c][1],b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=(b[2]-e*b[0])/c,g=0,h=a.length;h>g;g++){var i=[a[g][0],f+e*Math.log(a[g][0])];d.push(i)}var j="y = "+Math.round(100*f)/100+" + "+Math.round(100*e)/100+" ln(x)";return{equation:[f,e],points:d,string:j}},power:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=Math.log(a[c][1])*Math.log(a[c][0]),b[2]+=Math.log(a[c][1]),b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=Math.pow(Math.E,(b[2]-e*b[0])/c),g=0,h=a.length;h>g;g++){var i=[a[g][0],f*Math.pow(a[g][0],e)];d.push(i)}var j="y = "+Math.round(100*f)/100+"x^"+Math.round(100*e)/100;return{equation:[f,e],points:d,string:j}},polynomial:function(b,c){"undefined"==typeof c&&(c=2);for(var d=[],e=[],f=[],g=0,h=0,i=0,j=c+1;j>i;i++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(g+=Math.pow(b[k][0],i)*b[k][1]);d.push(g),g=0;for(var m=[],n=0;j>n;n++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(h+=Math.pow(b[k][0],i+n));m.push(h),h=0}e.push(m)}e.push(d);for(var o=a(e,j),i=0,l=b.length;l>i;i++){for(var p=0,q=0;q=0;i--)r+=i>1?Math.round(100*o[i])/100+"x^"+i+" + ":1==i?Math.round(100*o[i])/100+"x + ":Math.round(100*o[i])/100;return{equation:o,points:f,string:r}},lastvalue:function(a){for(var b=[],c=null,d=0;d= winPos.right) { place[1] = "left"; } break; - default: if (target.left + target.width / 2 + this.width / 2 >= winPos.right) { - place[1] = "left"; - } else if (target.right - target.width / 2 - this.width / 2 <= winPos.left) { - place[1] = "right"; - } + default: + if (target.left + target.width / 2 + this.width / 2 >= winPos.right) { + place[1] = "left"; + } else if (target.right - target.width / 2 - this.width / 2 <= winPos.left) { + place[1] = "right"; + } } } else { if (target.left - this.width - spacing <= winPos.left) { @@ -1024,35 +1007,34 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { } switch (place[1]) { case "top": - if (target.bottom - this.height <= winPos.top) { place[1] = "bottom"; } break; case "bottom": - if (target.top + this.height >= winPos.bottom) { place[1] = "top"; } break; - default: if (target.top + target.height / 2 + this.height / 2 >= winPos.bottom) { - place[1] = "top"; - } else if (target.bottom - target.height / 2 - this.height / 2 <= winPos.top) { - place[1] = "bottom"; - } + default: + if (target.top + target.height / 2 + this.height / 2 >= winPos.bottom) { + place[1] = "top"; + } else if (target.bottom - target.height / 2 - this.height / 2 <= winPos.top) { + place[1] = "bottom"; + } } } return place.join("-"); }; - /** - * Position the element to an element or a specific coordinates. - * - * @param {Integer|Element} x - * @param {Integer} y - * - * @return {Tooltip} + /** + * Position the element to an element or a specific coordinates. + * + * @param {Integer|Element} x + * @param {Integer} y + * + * @return {Tooltip} */ Tooltip.prototype.position = function (x, y) { if (this.attachedTo) { @@ -1088,65 +1070,53 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { var top, left; switch (this.curPlace) { case "top": - top = target.top - this.height - spacing; left = target.left + target.width / 2 - this.width / 2; break; case "top-left": - top = target.top - this.height - spacing; left = target.right - this.width; break; case "top-right": - top = target.top - this.height - spacing; left = target.left; break; case "bottom": - top = target.bottom + spacing; left = target.left + target.width / 2 - this.width / 2; break; case "bottom-left": - top = target.bottom + spacing; left = target.right - this.width; break; case "bottom-right": - top = target.bottom + spacing; left = target.left; break; case "left": - top = target.top + target.height / 2 - this.height / 2; left = target.left - this.width - spacing; break; case "left-top": - top = target.bottom - this.height; left = target.left - this.width - spacing; break; case "left-bottom": - top = target.top; left = target.left - this.width - spacing; break; case "right": - top = target.top + target.height / 2 - this.height / 2; left = target.right + spacing; break; case "right-top": - top = target.bottom - this.height; left = target.right + spacing; break; case "right-bottom": - top = target.top; left = target.right + spacing; break; @@ -1159,13 +1129,13 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this; }; - /** - * Show the tooltip. - * - * @param {Integer|Element} x - * @param {Integer} y - * - * @return {Tooltip} + /** + * Show the tooltip. + * + * @param {Integer|Element} x + * @param {Integer} y + * + * @return {Tooltip} */ Tooltip.prototype.show = function (x, y) { x = this.attachedTo ? this.attachedTo : x; @@ -1203,10 +1173,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { return this.element; }; - /** - * Hide the tooltip. - * - * @return {Tooltip} + /** + * Hide the tooltip. + * + * @return {Tooltip} */ Tooltip.prototype.hide = function () { if (this.hidden) { @@ -1253,10 +1223,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { this.element = this.options = null; }; - /** - * Make the tip window resize aware. - * - * @return {Void} + /** + * Make the tip window resize aware. + * + * @return {Void} */ Tooltip.prototype._aware = function () { var index = indexOf(Tooltip.winAware, this); @@ -1265,10 +1235,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { } }; - /** - * Remove the window resize awareness. - * - * @return {Void} + /** + * Remove the window resize awareness. + * + * @return {Void} */ Tooltip.prototype._unaware = function () { var index = indexOf(Tooltip.winAware, this); @@ -1277,10 +1247,10 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { } }; - /** - * Handles repositioning of tooltips on window resize. - * - * @return {Void} + /** + * Handles repositioning of tooltips on window resize. + * + * @return {Void} */ Tooltip.reposition = (function () { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || function (fn) { @@ -1312,17 +1282,17 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { window.addEventListener("resize", Tooltip.reposition); window.addEventListener("scroll", Tooltip.reposition); - /** - * Array with dynamic class types. - * - * @type {Array} + /** + * Array with dynamic class types. + * + * @type {Array} */ Tooltip.classTypes = ["type", "effect"]; - /** - * Default options for Tooltip constructor. - * - * @type {Object} + /** + * Default options for Tooltip constructor. + * + * @type {Object} */ Tooltip.defaults = { baseClass: CSS_PREFIX + "tooltip", // Base tooltip class name. @@ -1339,19 +1309,14 @@ define('api/balloon',["exports", "../const"], function (exports, _const) { define('event',["exports"], function (exports) { - var _classProps = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); - }; - var NULL_HANDLER = {}; var events = {}; - /** - * Creates new type of event or returns existing one, if it was created before. - * @param {string} eventName - * @return {function(..eventArgs)} + + /** + * Creates new type of event or returns existing one, if it was created before. + * @param {string} eventName + * @return {function(..eventArgs)} */ function createDispatcher(eventName) { var eventFunction = events[eventName]; @@ -1406,73 +1371,72 @@ define('event',["exports"], function (exports) { return eventFunction; } + /** + * Base class for event dispatching. It provides interface for instance + * to add and remove handler for desired events, and call it when event happens. + * @class + */ + var Emitter = (function () { - var Emitter = function Emitter() { + var Emitter = + /** + * @constructor + */ + function Emitter() { this.handler = null; this.emit_destroy = createDispatcher("destroy"); }; - _classProps(Emitter, null, { - addHandler: { - writable: true, - value: function (callbacks, context) { - context = context || this; - // add handler - this.handler = { - callbacks: callbacks, - context: context, - handler: this.handler - }; - } - }, - on: { - writable: true, - value: function (name, callback, context) { - var obj = {}; - obj[name] = callback; - this.addHandler(obj, context); - return obj; - } - }, - fire: { - writable: true, - value: function (name, data) { - createDispatcher.call(this, name).call(this, data); - } - }, - removeHandler: { - writable: true, - value: function (callbacks, context) { - var cursor = this; - var prev; + Emitter.prototype.addHandler = function (callbacks, context) { + context = context || this; + // add handler + this.handler = { + callbacks: callbacks, + context: context, + handler: this.handler + }; + }; - context = context || this; + Emitter.prototype.on = function (name, callback, context) { + var obj = {}; + obj[name] = callback; + this.addHandler(obj, context); + return obj; + }; - // search for handler and remove it - while (prev = cursor, cursor = cursor.handler) { - // jshint ignore:line - if (cursor.callbacks === callbacks && cursor.context === context) { - // make it non-callable - cursor.callbacks = NULL_HANDLER; + Emitter.prototype.fire = function (name, data) { + createDispatcher.call(this, name).call(this, data); + }; - // remove from list - prev.handler = cursor.handler; + Emitter.prototype.removeHandler = function (callbacks, context) { + var cursor = this; + var prev; - return; - } - } - } - }, - destroy: { - writable: true, - value: function () { - // fire object destroy event handlers - this.emit_destroy(); - // drop event handlers if any - this.handler = null; + context = context || this; + + // search for handler and remove it + while (prev = cursor, cursor = cursor.handler) { + // jshint ignore:line + if (cursor.callbacks === callbacks && cursor.context === context) { + // make it non-callable + cursor.callbacks = NULL_HANDLER; + + // remove from list + prev.handler = cursor.handler; + + return; } } - }); + + + }; + + Emitter.prototype.destroy = function () { + // fire object destroy event handlers + this.emit_destroy(); + // drop event handlers if any + this.handler = null; + }; return Emitter; })(); @@ -1556,12 +1520,10 @@ define('utils/utils',["exports"], function (exports) { exports.utils = utils; }); -/* jshint ignore:start */ define('formatter-registry',["exports", "d3"], function (exports, _d3) { var d3 = _d3; - /* jshint ignore:end */ var FORMATS_MAP = { "x-num-auto": function (x) { @@ -1661,7 +1623,6 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", var FormatterRegistry = _formatterRegistry.FormatterRegistry; var _ = _underscore; var d3 = _d3; - /* jshint ignore:end */ var translate = function (left, top) { @@ -1674,6 +1635,7 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", return _.contains(["bottom", "top"], scaleOrient.toLowerCase()) ? "h" : "v"; }; + var cutText = function (textString, widthLimit) { textString.each(function () { var textD3 = d3.select(this); @@ -1965,6 +1927,7 @@ define('utils/utils-draw',["exports", "../utils/utils", "../formatter-registry", node.guide.size = extendLabel(node.guide, "size"); node.guide.color = extendLabel(node.guide, "color"); + return node; }; @@ -1987,6 +1950,8 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var utilsDraw = _utilsUtilsDraw.utilsDraw; var FormatterRegistry = _formatterRegistry.FormatterRegistry; + + function extendGuide(guide, targetUnit, dimension, properties) { var guide_dim = guide.hasOwnProperty(dimension) ? guide[dimension] : {}; _.each(properties, function (prop) { @@ -2106,6 +2071,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", return defaultFormats[key] || defaultFormats[tag] || defaultFormats[dimType] || null; }; + var calcUnitGuide = function (unit, meta, settings, allowXVertical, allowYVertical, inlineLabels) { var dimX = meta.dimension(unit.x); var dimY = meta.dimension(unit.y); @@ -2136,6 +2102,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var maxYTickSize = getMaxTickLabelSize(yValues, FormatterRegistry.get(unit.guide.y.tickFormat, unit.guide.y.tickFormatNullAlias), settings.getAxisTickLabelSize, settings.yAxisTickLabelLimit); + var xAxisPadding = settings.xAxisPadding; var yAxisPadding = settings.yAxisPadding; @@ -2157,6 +2124,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", unit.guide.x.tickFormatWordWrapLimit = settings.xAxisTickLabelLimit; unit.guide.y.tickFormatWordWrapLimit = settings.yAxisTickLabelLimit; + var xTickBox = isXVertical ? { w: maxXTickSize.height, h: maxXTickSize.width } : { h: maxXTickSize.height, w: maxXTickSize.width }; if (maxXTickSize.width > settings.xAxisTickLabelLimit) { @@ -2176,6 +2144,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", } } + var yTickBox = isYVertical ? { w: maxYTickSize.height, h: maxYTickSize.width } : { h: maxYTickSize.height, w: maxYTickSize.width }; if (maxYTickSize.width > settings.yAxisTickLabelLimit) { @@ -2259,6 +2228,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", return unit; }; + var SpecEngineTypeMap = { NONE: function (srcSpec, meta, settings) { var spec = utils.clone(srcSpec); @@ -2359,6 +2329,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var yMeta = meta.scaleMeta(unit.y, unit.guide.y); var yValues = yMeta.values; + unit.guide.x.tickFormat = unit.guide.x.tickFormat || getTickFormat(dimX, xMeta, settings.defaultFormats); unit.guide.y.tickFormat = unit.guide.y.tickFormat || getTickFormat(dimY, yMeta, settings.defaultFormats); @@ -2369,6 +2340,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var maxYTickSize = getMaxTickLabelSize(yValues, FormatterRegistry.get(unit.guide.y.tickFormat, unit.guide.y.tickFormatNullAlias), settings.getAxisTickLabelSize, settings.yAxisTickLabelLimit); + var xAxisPadding = selectorPredicates.isLeafParent ? settings.xAxisPadding : 0; var yAxisPadding = selectorPredicates.isLeafParent ? settings.yAxisPadding : 0; @@ -2414,6 +2386,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var distToXAxisLabel = settings.distToXAxisLabel; var distToYAxisLabel = settings.distToYAxisLabel; + var xTickLabelW = Math.min(settings.xAxisTickLabelLimit, (isXVertical ? maxXTickSize.height : maxXTickSize.width)); unit.guide.x.density = settings.xDensityKoeff * xTickLabelW; @@ -2422,12 +2395,15 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", var yTickLabelH = Math.min(settings.yAxisTickLabelLimit, koeffLinesCount * maxYTickSize.height); unit.guide.y.density = settings.yDensityKoeff * yTickLabelH; + unit.guide.x.label.padding = (unit.guide.x.label.text) ? (xFontH + distToXAxisLabel) : 0; unit.guide.y.label.padding = (unit.guide.y.label.text) ? (yFontW + distToYAxisLabel) : 0; + var xLabelPadding = (unit.guide.x.label.text) ? (unit.guide.x.label.padding + xFontLabelHeight) : (xFontH); var yLabelPadding = (unit.guide.y.label.text) ? (unit.guide.y.label.padding + yFontLabelHeight) : (yFontW); + unit.guide.padding.b = xAxisPadding + xLabelPadding; unit.guide.padding.l = yAxisPadding + yLabelPadding; @@ -2495,6 +2471,7 @@ define('spec-engine-factory',["exports", "./utils/utils", "./utils/utils-draw", }, srcSpec); }; + var fnTraverseSpec = function (orig, specUnitRef, transformRules) { var xRef = utilsDraw.applyNodeDefaults(specUnitRef); xRef = transformRules(createSelectorPredicates(xRef), xRef); @@ -2580,6 +2557,8 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" var utilsDraw = _utilsUtilsDraw.utilsDraw; var TMatrix = _matrix.TMatrix; + + var specUnitSummary = function (spec, boxOpt) { var box = boxOpt ? boxOpt : { depth: -1, paddings: [] }; var p = spec.guide.padding; @@ -2698,43 +2677,33 @@ define('layout-engine-factory',["exports", "./utils/utils", "./utils/utils-draw" exports.LayoutEngineFactory = LayoutEngineFactory; }); -//plugins -/** @class - * @extends Plugin */ define('plugins',["exports"], function (exports) { - var _classProps = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); - }; - + //plugins + /** @class + * @extends Plugin */ var Plugins = (function () { - var Plugins = function Plugins(plugins, chart) { + var Plugins = + /** @constructs */ + function Plugins(plugins, chart) { this.chart = chart; this._plugins = plugins.map(this.initPlugin, this); }; - _classProps(Plugins, null, { - initPlugin: { - writable: true, - value: function (plugin) { - var _this = this; - - if (plugin.init) { - plugin.init(this.chart); - } - this.chart.on("destroy", plugin.destroy || (function () {})); - Object.keys(plugin).forEach(function (name) { - if (name.indexOf("on") === 0) { - var event = name.substr(2); - _this.chart.on(event.toLowerCase(), plugin[name].bind(plugin)); - } - }); - } + Plugins.prototype.initPlugin = function (plugin) { + var _this = this; + if (plugin.init) { + plugin.init(this.chart); } - }); + this.chart.on("destroy", plugin.destroy || (function () {})); + Object.keys(plugin).forEach(function (name) { + if (name.indexOf("on") === 0) { + var event = name.substr(2); + _this.chart.on(event.toLowerCase(), plugin[name].bind(plugin)); + } + }); + }; return Plugins; })(); @@ -2754,6 +2723,7 @@ define('plugins',["exports"], function (exports) { }; }; + exports.propagateDatumEvents = propagateDatumEvents; exports.Plugins = Plugins; }); @@ -2848,17 +2818,10 @@ define('unit-domain-period-generator',["exports"], function (exports) { define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./utils/utils", "underscore", "d3"], function (exports, _unitDomainPeriodGenerator, _utilsUtils, _underscore, _d3) { - var _classProps = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); - }; - var UnitDomainPeriodGenerator = _unitDomainPeriodGenerator.UnitDomainPeriodGenerator; var utils = _utilsUtils.utils; var _ = _underscore; var d3 = _d3; - /* jshint ignore:end */ var autoScaleMethods = { @@ -3080,27 +3043,22 @@ define('unit-domain-mixin',["exports", "./unit-domain-period-generator", "./util }; }; - _classProps(UnitDomainMixin, null, { - mix: { - writable: true, - value: function (unit) { - unit.dimension = this.fnDimension; - unit.source = this.fnSource; - unit.domain = this.fnDomain; - unit.scaleMeta = this.fnScaleMeta; - unit.scaleTo = this.fnScaleTo; - unit.partition = (function () { - return unit.data || unit.source(unit.$where); - }); - unit.groupBy = (function (srcValues, splitByProperty) { - return d3.nest().key(function (d) { - return d[splitByProperty]; - }).entries(srcValues); - }); - return unit; - } - } - }); + UnitDomainMixin.prototype.mix = function (unit) { + unit.dimension = this.fnDimension; + unit.source = this.fnSource; + unit.domain = this.fnDomain; + unit.scaleMeta = this.fnScaleMeta; + unit.scaleTo = this.fnScaleTo; + unit.partition = (function () { + return unit.data || unit.source(unit.$where); + }); + unit.groupBy = (function (srcValues, splitByProperty) { + return d3.nest().key(function (d) { + return d[splitByProperty]; + }).entries(srcValues); + }); + return unit; + }; return UnitDomainMixin; })(); @@ -3139,6 +3097,7 @@ define('data-processor',["exports", "./utils/utils"], function (exports, _utilsU var utils = _utilsUtils.utils; + var DataProcessor = { isYFunctionOfX: function (data, xFields, yFields) { var isRelationAFunction = true; @@ -3285,7 +3244,6 @@ define('utils/layuot-template',["exports", "../const"], function (exports, _cons var CSS_PREFIX = _const.CSS_PREFIX; - var createElement = function (cssClass, parent) { var tag = "div"; var element = document.createElement(tag); @@ -3317,17 +3275,12 @@ define('utils/layuot-template',["exports", "../const"], function (exports, _cons /* jshint ignore:end */ }; + exports.getLayout = getLayout; }); define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../event", "../spec-engine-factory", "../layout-engine-factory", "../plugins", "../utils/utils", "../utils/utils-dom", "../const", "../unit-domain-mixin", "../units-registry", "../data-processor", "../utils/layuot-template"], function (exports, _dslReader, _apiBalloon, _event, _specEngineFactory, _layoutEngineFactory, _plugins, _utilsUtils, _utilsUtilsDom, _const, _unitDomainMixin, _unitsRegistry, _dataProcessor, _utilsLayuotTemplate) { - var _classProps = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); - }; - var _extends = function (child, parent) { child.prototype = Object.create(parent.prototype, { constructor: { @@ -3355,6 +3308,7 @@ define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../even var DataProcessor = _dataProcessor.DataProcessor; var getLayout = _utilsLayuotTemplate.getLayout; + var traverseFromDeep = function (root) { var r; @@ -3426,224 +3380,193 @@ define('charts/tau.plot',["exports", "../dsl-reader", "../api/balloon", "../even _extends(Plot, Emitter); - _classProps(Plot, null, { - setupConfig: { - writable: true, - value: function (config) { - this.config = _.defaults(config, { - spec: {}, - data: [], - plugins: [], - settings: {} - }); - this._emptyContainer = config.emptyContainer || ""; - // TODO: remove this particular config cases - this.config.settings.specEngine = this.config.specEngine || this.config.settings.specEngine; - this.config.settings.layoutEngine = this.config.layoutEngine || this.config.settings.layoutEngine; - this.config.settings = this.setupSettings(this.config.settings); - if (!utils.isArray(this.config.settings.specEngine)) { - this.config.settings.specEngine = [{ - width: Number.MAX_VALUE, - name: this.config.settings.specEngine - }]; - } + Plot.prototype.setupConfig = function (config) { + this.config = _.defaults(config, { + spec: {}, + data: [], + plugins: [], + settings: {} + }); + this._emptyContainer = config.emptyContainer || ""; + // TODO: remove this particular config cases + this.config.settings.specEngine = this.config.specEngine || this.config.settings.specEngine; + this.config.settings.layoutEngine = this.config.layoutEngine || this.config.settings.layoutEngine; + this.config.settings = this.setupSettings(this.config.settings); + if (!utils.isArray(this.config.settings.specEngine)) { + this.config.settings.specEngine = [{ + width: Number.MAX_VALUE, + name: this.config.settings.specEngine + }]; + } - this.config.spec.dimensions = this.setupMetaInfo(this.config.spec.dimensions, this.config.data); + this.config.spec.dimensions = this.setupMetaInfo(this.config.spec.dimensions, this.config.data); - var log = this.config.settings.log; - if (this.config.settings.excludeNull) { - this.addFilter({ - tag: "default", - predicate: DataProcessor.excludeNullValues(this.config.spec.dimensions, function (item) { - log([item, "point was excluded, because it has undefined values."], "WARN"); - }) - }); - } - } - }, - getConfig: { - writable: true, - value: function () { - return this.config; - } - }, - setupMetaInfo: { - writable: true, - value: function (dims, data) { - var meta = (dims) ? dims : DataProcessor.autoDetectDimTypes(data); - return DataProcessor.autoAssignScales(meta); - } - }, - setupSettings: { - writable: true, - value: function (configSettings) { - var globalSettings = Plot.globalSettings; - var localSettings = {}; - Object.keys(globalSettings).forEach(function (k) { - localSettings[k] = (_.isFunction(globalSettings[k])) ? globalSettings[k] : utils.clone(globalSettings[k]); - }); + var log = this.config.settings.log; + if (this.config.settings.excludeNull) { + this.addFilter({ + tag: "default", + predicate: DataProcessor.excludeNullValues(this.config.spec.dimensions, function (item) { + log([item, "point was excluded, because it has undefined values."], "WARN"); + }) + }); + } + }; - return _.defaults(configSettings || {}, localSettings); - } - }, - insertToRightSidebar: { - writable: true, - value: function (el) { - return utilsDom.appendTo(el, this._layout.rightSidebar); - } - }, - addBalloon: { - writable: true, - value: function (conf) { - return new Tooltip("", conf || {}); - } - }, - renderTo: { - writable: true, - value: function (target, xSize) { - this._svg = null; - this._defaultSize = _.clone(xSize); - var container = d3.select(target); - var containerNode = container.node(); - this._target = target; - this._targetSizes = xSize; - if (containerNode === null) { - throw new Error("Target element not found"); - } - var content = this._layout.content; - containerNode.appendChild(this._layout.layout); - container = d3.select(this._layout.content); - //todo don't compute width if width or height were passed - var size = xSize || {}; - this._layout.content.innerHTML = ""; - if (!size.width || !size.height) { - size = _.defaults(size, utilsDom.getContainerSize(this._layout.content.parentNode)); - } + Plot.prototype.getConfig = function () { + return this.config; + }; - var drawData = this.getData(); - if (drawData.length === 0) { - this._layout.content.innerHTML = this._emptyContainer; - return; - } - this._targetSizes = size; - this._layout.content.innerHTML = ""; + Plot.prototype.setupMetaInfo = function (dims, data) { + var meta = (dims) ? dims : DataProcessor.autoDetectDimTypes(data); + return DataProcessor.autoAssignScales(meta); + }; - var domainMixin = new UnitDomainMixin(this.config.spec.dimensions, drawData); + Plot.prototype.setupSettings = function (configSettings) { + var globalSettings = Plot.globalSettings; + var localSettings = {}; + Object.keys(globalSettings).forEach(function (k) { + localSettings[k] = (_.isFunction(globalSettings[k])) ? globalSettings[k] : utils.clone(globalSettings[k]); + }); - var specItem = _.find(this.config.settings.specEngine, function (item) { - return (size.width <= item.width); - }); + return _.defaults(configSettings || {}, localSettings); + }; - var specEngine = SpecEngineFactory.get(specItem.name, this.config.settings); + Plot.prototype.insertToRightSidebar = function (el) { + return utilsDom.appendTo(el, this._layout.rightSidebar); + }; - var fullSpec = specEngine(this.config.spec, domainMixin.mix({})); + Plot.prototype.addBalloon = function (conf) { + return new Tooltip("", conf || {}); + }; - var optimalSize = traverseFromDeep(fullSpec.unit); - var recommendedWidth = optimalSize.w; - var recommendedHeight = optimalSize.h; + Plot.prototype.renderTo = function (target, xSize) { + this._svg = null; + this._defaultSize = _.clone(xSize); + var container = d3.select(target); + var containerNode = container.node(); + this._target = target; + this._targetSizes = xSize; + if (containerNode === null) { + throw new Error("Target element not found"); + } + var content = this._layout.content; + containerNode.appendChild(this._layout.layout); + container = d3.select(this._layout.content); + //todo don't compute width if width or height were passed + var size = xSize || {}; + this._layout.content.innerHTML = ""; + if (!size.width || !size.height) { + size = _.defaults(size, utilsDom.getContainerSize(this._layout.content.parentNode)); + } - var scrollSize = utilsDom.getScrollbarWidth(); + var drawData = this.getData(); + if (drawData.length === 0) { + this._layout.content.innerHTML = this._emptyContainer; + return; + } + this._targetSizes = size; + this._layout.content.innerHTML = ""; - var deltaW = (size.width - recommendedWidth); - var deltaH = (size.height - recommendedHeight); + var domainMixin = new UnitDomainMixin(this.config.spec.dimensions, drawData); - var screenW = (deltaW >= 0) ? size.width : recommendedWidth; - var scrollW = (deltaH >= 0) ? 0 : scrollSize; + var specItem = _.find(this.config.settings.specEngine, function (item) { + return (size.width <= item.width); + }); - var screenH = (deltaH >= 0) ? size.height : recommendedHeight; - var scrollH = (deltaW >= 0) ? 0 : scrollSize; + var specEngine = SpecEngineFactory.get(specItem.name, this.config.settings); - size.height = screenH - scrollH; - size.width = screenW - scrollW; + var fullSpec = specEngine(this.config.spec, domainMixin.mix({})); - // optimize full spec depending on size - var localSettings = this.config.settings; + var optimalSize = traverseFromDeep(fullSpec.unit); + var recommendedWidth = optimalSize.w; + var recommendedHeight = optimalSize.h; - traverseToDeep(fullSpec.unit, size, localSettings); + var scrollSize = utilsDom.getScrollbarWidth(); - var reader = new DSLReader(domainMixin, UnitsRegistry); + var deltaW = (size.width - recommendedWidth); + var deltaH = (size.height - recommendedHeight); - var logicXGraph = reader.buildGraph(fullSpec); - var layoutGraph = LayoutEngineFactory.get(this.config.settings.layoutEngine)(logicXGraph); - var renderGraph = reader.calcLayout(layoutGraph, size); - var svgXElement = reader.renderGraph(renderGraph, container.append("svg").attr("class", CSS_PREFIX + "svg").attr("width", size.width).attr("height", size.height), this); - this._svg = svgXElement.node(); - svgXElement.selectAll(".i-role-datum").call(propagateDatumEvents(this)); - this._layout.rightSidebar.style.maxHeight = size.height + "px"; - this.fire("render", this._svg); - } - }, - getData: { - writable: true, - value: function (param) { - param = param || {}; - var filters = _.chain(this._filtersStore.filters).values().flatten().reject(function (filter) { - return _.contains(param.excludeFilter, filter.tag); - }).pluck("predicate").value(); - return _.filter(this.config.data, _.reduce(filters, function (newPredicate, filter) { - return function (x) { - return newPredicate(x) && filter(x); - }; - }, function () { - return true; - })); - } - }, - setData: { - writable: true, - value: function (data) { - this.config.data = data; - this.refresh(); - } - }, - getSVG: { - writable: true, - value: function () { - return this._svg; - } - }, - addFilter: { - writable: true, - value: function (filter) { - var tag = filter.tag; - var filters = this._filtersStore.filters[tag] = this._filtersStore.filters[tag] || []; - var id = this._filtersStore.tick++; - filter.id = id; - filters.push(filter); - this.refresh(); - return id; - } - }, - refresh: { - writable: true, - value: function () { - if (this._target) { - this.renderTo(this._target, this._defaultSize); - } - } - }, - resize: { - writable: true, - value: function (sizes) { - if (sizes === undefined) sizes = {}; + var screenW = (deltaW >= 0) ? size.width : recommendedWidth; + var scrollW = (deltaH >= 0) ? 0 : scrollSize; - this.renderTo(this._target, sizes); - } - }, - removeFilter: { - writable: true, - value: function (id) { - var _this = this; + var screenH = (deltaH >= 0) ? size.height : recommendedHeight; + var scrollH = (deltaW >= 0) ? 0 : scrollSize; - _.each(this._filtersStore.filters, function (filters, key) { - _this._filtersStore.filters[key] = _.reject(filters, function (item) { - return item.id === id; - }); - }); - this.refresh(); - } + size.height = screenH - scrollH; + size.width = screenW - scrollW; + + + // optimize full spec depending on size + var localSettings = this.config.settings; + + traverseToDeep(fullSpec.unit, size, localSettings); + + + var reader = new DSLReader(domainMixin, UnitsRegistry); + + var logicXGraph = reader.buildGraph(fullSpec); + var layoutGraph = LayoutEngineFactory.get(this.config.settings.layoutEngine)(logicXGraph); + var renderGraph = reader.calcLayout(layoutGraph, size); + var svgXElement = reader.renderGraph(renderGraph, container.append("svg").attr("class", CSS_PREFIX + "svg").attr("width", size.width).attr("height", size.height), this); + this._svg = svgXElement.node(); + svgXElement.selectAll(".i-role-datum").call(propagateDatumEvents(this)); + this._layout.rightSidebar.style.maxHeight = size.height + "px"; + this.fire("render", this._svg); + }; + + Plot.prototype.getData = function (param) { + param = param || {}; + var filters = _.chain(this._filtersStore.filters).values().flatten().reject(function (filter) { + return _.contains(param.excludeFilter, filter.tag); + }).pluck("predicate").value(); + return _.filter(this.config.data, _.reduce(filters, function (newPredicate, filter) { + return function (x) { + return newPredicate(x) && filter(x); + }; + }, function () { + return true; + })); + }; + + Plot.prototype.setData = function (data) { + this.config.data = data; + this.refresh(); + }; + + Plot.prototype.getSVG = function () { + return this._svg; + }; + + Plot.prototype.addFilter = function (filter) { + var tag = filter.tag; + var filters = this._filtersStore.filters[tag] = this._filtersStore.filters[tag] || []; + var id = this._filtersStore.tick++; + filter.id = id; + filters.push(filter); + this.refresh(); + return id; + }; + + Plot.prototype.refresh = function () { + if (this._target) { + this.renderTo(this._target, this._defaultSize); } - }); + }; + + Plot.prototype.resize = function (sizes) { + if (sizes === undefined) sizes = {}; + this.renderTo(this._target, sizes); + }; + + Plot.prototype.removeFilter = function (id) { + var _this = this; + _.each(this._filtersStore.filters, function (filters, key) { + _this._filtersStore.filters[key] = _.reject(filters, function (item) { + return item.id === id; + }); + }); + this.refresh(); + }; return Plot; })(Emitter); @@ -3669,6 +3592,7 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p var utils = _utilsUtils.utils; var DataProcessor = _dataProcessor.DataProcessor; + var convertAxis = function (data) { return (!data) ? null : data; }; @@ -3701,15 +3625,18 @@ define('charts/tau.chart',["exports", "./tau.plot", "../utils/utils", "../data-p _strategyNormalizeAxis[status.SUCCESS] = function (axis) { return axis; }; + _strategyNormalizeAxis[status.FAIL] = function () { throw new Error("This configuration is not supported, See http://api.taucharts.com/basic/facet.html#easy-approach-for-creating-facet-chart"); }; + _strategyNormalizeAxis[status.WARNING] = function (axis, config) { var measure = axis[config.indexMeasureAxis[0]]; var newAxis = _.without(axis, measure); newAxis.push(measure); return newAxis; }; + return _strategyNormalizeAxis; })({}); /* jshint ignore:end */ @@ -3896,6 +3823,7 @@ define('elements/coords',["exports", "../utils/utils-draw", "../const", "../util var utils = _utilsUtils.utils; var TMatrix = _matrix.TMatrix; + var FacetAlgebra = { CROSS: function (root, dimX, dimY) { var domainX = root.domain(dimX); @@ -4054,7 +3982,6 @@ define('elements/point',["exports", "../utils/utils-draw", "../const", "./size"] var utilsDraw = _utilsUtilsDraw.utilsDraw; var CSS_PREFIX = _const.CSS_PREFIX; var sizeScale = _size.sizeScale; - var point = function (node) { var options = node.options; @@ -4094,7 +4021,6 @@ define('utils/css-class-map',["exports", "../const"], function (exports, _const) var CSS_PREFIX = _const.CSS_PREFIX; - var arrayNumber = [1, 2, 3, 4, 5]; var countLineClasses = arrayNumber.map(function (i) { return CSS_PREFIX + "line-opacity-" + i; @@ -4129,7 +4055,6 @@ define('elements/line',["exports", "../utils/utils-draw", "./point", "../const", var CSS_PREFIX = _const.CSS_PREFIX; var getLineClassesByWidth = _utilsCssClassMap.getLineClassesByWidth; var getLineClassesByCount = _utilsCssClassMap.getLineClassesByCount; - var line = function (node) { var options = node.options; @@ -4202,6 +4127,7 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var utilsDraw = _utilsUtilsDraw.utilsDraw; var CSS_PREFIX = _const.CSS_PREFIX; + var BAR_GROUP = "i-role-bar-group"; var isMeasure = function (dim) { @@ -4242,10 +4168,8 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var tickWidth; var intervalWidth; var offsetCategory; - (function () { xMin = Math.min.apply(null, xScale.domain()); - var startPoint = (xMin <= 0) ? 0 : xMin; _ref = getSizesParams({ @@ -4257,7 +4181,6 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct tickWidth = _ref.tickWidth; intervalWidth = _ref.intervalWidth; offsetCategory = _ref.offsetCategory; - /* jshint ignore:end */ calculateX = isMeasure(node.x) ? function (d) { return xScale(Math.min(startPoint, d[node.x.scaleDim])); @@ -4283,10 +4206,8 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct var tickWidth; var intervalWidth; var offsetCategory; - (function () { yMin = Math.min.apply(null, yScale.domain()); - var startPoint = (yMin <= 0) ? 0 : yMin; _ref2 = getSizesParams({ @@ -4298,7 +4219,6 @@ define('elements/interval',["exports", "../utils/utils-draw", "../const"], funct tickWidth = _ref2.tickWidth; intervalWidth = _ref2.intervalWidth; offsetCategory = _ref2.offsetCategory; - /* jshint ignore:end */ calculateX = function (d) { return xScale(d[node.x.scaleDim]) - (tickWidth / 2); @@ -4355,6 +4275,7 @@ define('elements/coords-parallel',["exports", "../utils/utils-draw", "../const", var utils = _utilsUtils.utils; var TMatrix = _matrix.TMatrix; + var inheritRootProps = function (unit, root, props) { var r = _.defaults(utils.clone(unit), _.pick.apply(_, [root].concat(props))); r.guide = _.extend(utils.clone(root.guide || {}), (r.guide || {})); @@ -4403,6 +4324,7 @@ define('elements/coords-parallel',["exports", "../utils/utils-draw", "../const", var container = options.container.append("g").attr("class", "graphical-report__" + "cell " + "cell").attr("transform", utilsDraw.translate(L, T)); + var translate = function (left, top) { return "translate(" + left + "," + top + ")"; }; @@ -4410,6 +4332,7 @@ define('elements/coords-parallel',["exports", "../utils/utils-draw", "../const", return "rotate(" + angle + ")"; }; + var fnDrawDimAxis = function (xScaleObj, AXIS_POSITION) { var container = this; @@ -4443,6 +4366,7 @@ define('elements/coords-parallel-line',["exports", "../utils/utils-draw", "../co var utilsDraw = _utilsUtilsDraw.utilsDraw; var CSS_PREFIX = _const.CSS_PREFIX; + var CoordsParallelLine = { draw: function (node) { node.color = node.dimension(node.color, node); @@ -4515,6 +4439,7 @@ define('node-map',["exports", "./elements/coords", "./elements/line", "./element var CoordsParallel = _elementsCoordsParallel.CoordsParallel; var CoordsParallelLine = _elementsCoordsParallelLine.CoordsParallelLine; + var setupElementNode = function (node, dimensions) { dimensions.forEach(function (dimName) { node[dimName] = node.dimension(node[dimName], node); @@ -4578,7 +4503,6 @@ define('tau.newCharts',["exports", "./utils/utils-dom", "./charts/tau.plot", "./ var FormatterRegistry = _formatterRegistry.FormatterRegistry; var nodeMap = _nodeMap.nodeMap; var UnitsRegistry = _unitsRegistry.UnitsRegistry; - var colorBrewers = {}; var plugins = {}; @@ -4684,11 +4608,11 @@ define('tau.newCharts',["exports", "./utils/utils-dom", "./charts/tau.plot", "./ exports.__api__ = __api__; exports.api = api; }); - define('underscore',function(){ - return _; - }); - define('d3',function(){ - return d3; - }); - return require('tau.newCharts'); + define('underscore',function(){ + return _; + }); + define('d3',function(){ + return d3; + }); + return require('tau.newCharts'); })); \ No newline at end of file diff --git a/build/tauCharts.min.js b/build/tauCharts.min.js index d73d61518..0cd4191fa 100644 --- a/build/tauCharts.min.js +++ b/build/tauCharts.min.js @@ -1,5 +1,5 @@ -/*! taucharts - v0.2.21 - 2014-12-18 +/*! taucharts - v0.2.21 - 2014-12-19 * https://github.com/TargetProcess/tauCharts * Copyright (c) 2014 Taucraft Limited; Licensed Creative Commons */ -!function(a,b){if("function"==typeof define&&define.amd)define(["underscore","d3"],function(a,c){return b(a,c)});else if("object"==typeof module&&module.exports){{var c=require("underscore");require("d3")}module.exports=b(c)}else a.tauCharts=b(a._,a.d3)}(this,function(a,b){var c,d,e;return function(a){function b(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(b,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(a,d.concat([b,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(c){if(b(r,c)){var d=r[c];delete r[c],t[c]=!0,m.apply(a,d)}if(!b(q,c)&&!b(t,c))throw new Error("No "+c);return q[c]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(c,d,e,f){var h,k,l,m,n,s,u=[],v=typeof e;if(f=f||c,"undefined"===v||"function"===v){for(d=!d.length&&e.length?["require","exports","module"]:d,n=0;n','','','<%= xTick %>',"","",""].join(""),e=a.template(d),f=document.createElement("div");f.style.position="absolute",f.style.visibility="hidden",f.style.width="100px",f.style.height="100px",f.style.border="1px solid green",document.body.appendChild(f),f.innerHTML=e({xTick:c});var g=b.select(f).selectAll(".x.axis .tick text")[0][0],h={width:0,height:0},i=g.getBoundingClientRect();return h.width=i.right-i.left,h.height=i.bottom-i.top,document.body.removeChild(f),h}};c.utilsDom=e}),e("dsl-reader",["exports"],function(b){var c=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},d=function(){var b=function(a,b){this.domain=a,this.UnitsRegistry=b};return c(b,null,{buildGraph:{writable:!0,value:function(a){var b=this,c=function(a){return b.UnitsRegistry.get(a.type).walk(b.domain.mix(a),c)};return c(a.unit)}},calcLayout:{writable:!0,value:function(b,c){b.options={top:0,left:0,width:c.width,height:c.height};var d=function(b){if(!b.$matrix)return b;var c,e=b.options,f=b.guide.padding,g=e.width-(f.l+f.r),h=e.height-(f.t+f.b),i=b.$matrix.sizeR(),j=b.$matrix.sizeC(),k=g/j,l=h/i;return c=b.guide.split?{calcHeight:function(a,b,c,d){return a/d},calcTop:function(a,b,c,d){return(b+1)*(a/d)*c}}:{calcHeight:function(a){return a},calcTop:function(a,b){return b*l}},b.$matrix.iterate(function(b,e,f){var g=f.length;a.each(f,function(a,f){a.options={width:k,left:e*k,height:c.calcHeight(l,b,f,g),top:c.calcTop(l,b,f,g)},d(a)})}),b};return d(b)}},renderGraph:{writable:!0,value:function(a,b,c){var d=this;a.options.container=b;var e=function(a){var b=d.domain.mix(a);d.UnitsRegistry.get(a.type).draw(b,function(b){b.parentUnit=a,e(b)}),c&&c.fire("unitready",b)};return a.parentUnit=null,e(a),a.options.container}}}),b}();b.DSLReader=d}),e("const",["exports"],function(a){a.CSS_PREFIX="graphical-report__"}),e("api/balloon",["exports","../const"],function(a,b){function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){return a&&null!=a.setInterval}function e(a){var b=l.pageYOffset||o.scrollTop,e=l.pageXOffset||o.scrollLeft,f={left:0,right:0,top:0,bottom:0,width:0,height:0};if(d(a))f.width=l.innerWidth||o.clientWidth,f.height=l.innerHeight||o.clientHeight;else{if(!o.contains(a)||null==a.getBoundingClientRect)return f;c(f,a.getBoundingClientRect()),f.width=f.right-f.left,f.height=f.bottom-f.top}return f.top=f.top+b-o.clientTop,f.left=f.left+e-o.clientLeft,f.right=f.left+f.width,f.bottom=f.top+f.height,f}function f(a){return 0|Math.round(String(a).replace(/[^\-0-9.]/g,""))}function g(a){var b=String(q(a,g.propName)),c=b.match(/([0-9.]+)([ms]{1,2})/);return c&&(b=Number(c[1]),"s"===c[2]&&(b*=1e3)),0|b}function h(a,b){return this instanceof h?(this.hidden=1,this.options=c(r(h.defaults),b),this._createElement(),void this.content(a)):new h(a,b)}var i=b.CSS_PREFIX,j=function(a){return{add:function(b){a.classList.add(b)},remove:function(b){a.classList.remove(b)}}},k=function(a,b){return a.indexOf(b)},l=window,m=l.document,n=m.body,o=m.documentElement,p=["top","bottom"],q=l.getComputedStyle;g.propName=function(){for(var a=m.createElement("div"),b=["transitionDuration","webkitTransitionDuration"],c="1s",d=0;d=b.bottom&&(c[0]="top"),c[1]){case"left":a.right-this.width<=b.left&&(c[1]="right");break;case"right":a.left+this.width>=b.right&&(c[1]="left");break;default:a.left+a.width/2+this.width/2>=b.right?c[1]="left":a.right-a.width/2-this.width/2<=b.left&&(c[1]="right")}else switch(a.left-this.width-d<=b.left?c[0]="right":a.right+this.width+d>=b.right&&(c[0]="left"),c[1]){case"top":a.bottom-this.height<=b.top&&(c[1]="bottom");break;case"bottom":a.top+this.height>=b.bottom&&(c[1]="top");break;default:a.top+a.height/2+this.height/2>=b.bottom?c[1]="top":a.bottom-a.height/2-this.height/2<=b.top&&(c[1]="bottom")}return c.join("-")},h.prototype.position=function(a,b){this.attachedTo&&(a=this.attachedTo),null==a&&this._p?(a=this._p[0],b=this._p[1]):this._p=arguments;var c="number"==typeof a?{left:0|a,right:0|a,top:0|b,bottom:0|b,width:0,height:0}:e(a),d=this.spacing,f=this._pickPlace(c);f!==this.curPlace&&(this.curPlace&&this.classes.remove(this.curPlace),this.classes.add(f),this.curPlace=f);var g,h;switch(this.curPlace){case"top":g=c.top-this.height-d,h=c.left+c.width/2-this.width/2;break;case"top-left":g=c.top-this.height-d,h=c.right-this.width;break;case"top-right":g=c.top-this.height-d,h=c.left;break;case"bottom":g=c.bottom+d,h=c.left+c.width/2-this.width/2;break;case"bottom-left":g=c.bottom+d,h=c.right-this.width;break;case"bottom-right":g=c.bottom+d,h=c.left;break;case"left":g=c.top+c.height/2-this.height/2,h=c.left-this.width-d;break;case"left-top":g=c.bottom-this.height,h=c.left-this.width-d;break;case"left-bottom":g=c.top,h=c.left-this.width-d;break;case"right":g=c.top+c.height/2-this.height/2,h=c.right+d;break;case"right-top":g=c.bottom-this.height,h=c.right+d;break;case"right-bottom":g=c.top,h=c.right+d}return this.element.style.top=Math.round(g)+"px",this.element.style.left=Math.round(h)+"px",this},h.prototype.show=function(a,b){return a=this.attachedTo?this.attachedTo:a,clearTimeout(this.aIndex),null!=a&&this.position(a,b),this.hidden&&(this.hidden=0,n.appendChild(this.element)),this.attachedTo&&this._aware(),this.options.inClass&&(this.options.effectClass&&void this.element.clientHeight,this.classes.add(this.options.inClass)),this},h.prototype.getElement=function(){return this.element},h.prototype.hide=function(){if(!this.hidden){var a=this,b=0;return this.options.inClass&&(this.classes.remove(this.options.inClass),this.options.effectClass&&(b=g(this.element))),this.attachedTo&&this._unaware(),clearTimeout(this.aIndex),this.aIndex=setTimeout(function(){a.aIndex=0,n.removeChild(a.element),a.hidden=1},b),this}},h.prototype.toggle=function(a,b){return this[this.hidden?"show":"hide"](a,b)},h.prototype.destroy=function(){clearTimeout(this.aIndex),this._unaware(),this.hidden||n.removeChild(this.element),this.element=this.options=null},h.prototype._aware=function(){var a=k(h.winAware,this);~a||h.winAware.push(this)},h.prototype._unaware=function(){var a=k(h.winAware,this);~a&&h.winAware.splice(a,1)},h.reposition=function(){function a(){!c&&h.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=h.winAware.length;d>b;b++)a=h.winAware[b],a.position()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),h.winAware=[],window.addEventListener("resize",h.reposition),window.addEventListener("scroll",h.reposition),h.classTypes=["type","effect"],h.defaults={baseClass:i+"tooltip",typeClass:null,effectClass:null,inClass:"in",place:"top",spacing:null,auto:0},a.Tooltip=h}),e("event",["exports"],function(a){function b(a){var b=e[a];return b||(b=function(){for(var b,c,d=this,e=0;d=d.handler;){if(c=d.callbacks[a],"function"==typeof c){if(!b)for(b=[this],e=0;e=0?-1:1,f=d||1;d-=e*f/b}for(var g=[c,d],h=g[1]-g[0],i=Math.pow(10,Math.floor(Math.log(h/b)/Math.LN10)),j=b/h*i,k=[[.15,10],[.35,5],[.75,2],[1,1],[2,1]],l=-1;j>k[++l][0];);i*=k[l][1],g[0]=Math.floor(g[0]/i)*i,g[1]=Math.ceil(g[1]/i)*i;var m=c-g[0],n=g[1]-d,o=i/2;if(c>=0)g[0]=0;else{var p=o>=m?i:0;g[0]=g[0]-p}if(0>=d)g[1]=0;else{var q=o>=n?i:0;g[1]=g[1]+q}return[parseFloat(g[0].toFixed(15)),parseFloat(g[1].toFixed(15))]},traverseJSON:b};a.utils=c}),e("formatter-registry",["exports","d3"],function(b,c){var d=c,e={"x-num-auto":function(a){var b=parseFloat(a.toFixed(2));return Math.abs(b)<1?b.toString():d.format("s")(b)},percent:function(a){var b=parseFloat((100*a).toFixed(2));return b.toString()+"%"},day:d.time.format("%d-%b-%Y"),"day-short":d.time.format("%d-%b"),week:d.time.format("%d-%b-%Y"),"week-short":d.time.format("%d-%b"),"week-range":function(a){var b=new Date(a),c=new Date(a),e=new Date(c.setDate(c.getDate()+7)),f=d.time.format("%d-%b-%Y");return f(b)+" - "+f(e)},month:function(a){var b=new Date(a),c=b.getMonth(),e=0===c?"%B, %Y":"%B";return d.time.format(e)(a)},"month-short":function(a){var b=new Date(a),c=b.getMonth(),e=0===c?"%b '%Y":"%b";return d.time.format(e)(a)},"month-year":d.time.format("%B, %Y"),quarter:function(a){var b=new Date(a),c=b.getMonth(),d=(c-c%3)/3;return"Q"+(d+1)+" "+b.getFullYear()},year:d.time.format("%Y"),"x-time-auto":null},f={get:function(b,c){var f=c||"",g=function(a){return(null===a||"undefined"==typeof a?f:a).toString()},h=e.hasOwnProperty(b),i=h?e[b]:g;return h&&(i=e[b]),!h&&b&&(i=function(c){var e=a.isDate(c)?d.time.format(b):d.format(b);return e(c)}),h||b||(i=g),i},add:function(a,b){e[a]=b}};b.FormatterRegistry=f}),e("utils/utils-draw",["exports","../utils/utils","../formatter-registry","underscore","d3"],function(a,b,c,d,e){var f=b.utils,g=c.FormatterRegistry,h=d,i=e,j=function(a,b){return"translate("+a+","+b+")"},k=function(a){return"rotate("+a+")"},l=function(a){return h.contains(["bottom","top"],a.toLowerCase())?"h":"v"},m=function(a,b){a.each(function(){var a=i.select(this),c=a.text().split(/\s+/).reverse();a.text(null);for(var d,e=[],f=!1;!f&&(d=c.pop());)if(e.push(d),a.text(e.join(" ")),a.node().getComputedTextLength()>b){e.pop();var g=e.join(" ");g+="...",a.text(g),f=!0}})},n=function(a,b,c,d,e){var f=function(a,b,c,d,e,f,g){var h=g*c+f,i=a.append("tspan").attr("x",d).attr("y",e).attr("dy",h+"em").text(b);return i};a.each(function(){var a=i.select(this),g=a.text().split(/\s+/),h=1.1,j=a.attr("x"),k=a.attr("y"),l=parseFloat(a.attr("dy"));a.text(null);var m=f(a,null,h,j,k,l,0),n=!1,o=g.reduce(function(a,d){if(n)return a;var e=a.length===c,f=a[a.length-1],g=m.text(f+d).node().getComputedTextLength()>b;return g&&e&&(a[a.length-1]=f+"...",n=!0),g&&!e&&a.push(d),g||(a[a.length-1]=f+" "+d),a},[""]);k=e?-1*(o.length-1)*Math.floor(.5*d):k,o.forEach(function(b,c){return f(a,b,h,j,k,l,c)}),m.remove()})},o=function(a,b,c){var d=a.selectAll(".tick line"),e=c/d[0].length,f=e/2;if("ordinal"===b.scaleType||"period"===b.scaleType){var g="h"===l(b.guide.scaleOrient),h=g?"x":"y",i=g?f:-f;d.attr(h+"1",i).attr(h+"2",i)}},p=function(a,b){var c=l(b.guide.scaleOrient),d="h"===c?1:-1,e=a.append("text").attr("transform",k(b.guide.label.rotate)).attr("class",b.guide.label.cssClass).attr("x",d*b.guide.size*.5).attr("y",d*b.guide.label.padding).style("text-anchor",b.guide.label.textAnchor),f=" > ",g=b.guide.label.text.split(f),h=g.length;if(g.forEach(function(a,b){e.append("tspan").attr("class","label-token label-token-"+b).text(a),h-1>b&&e.append("tspan").attr("class","label-token-delimiter label-token-delimiter-"+b).text(f)}),"right"===b.guide.label.dock){var i=a.node().getBBox();e.attr("x","h"===c?i.width:0)}else if("left"===b.guide.label.dock){var i=a.node().getBBox();e.attr("x","h"===c?0:10-i.height)}},q=function(a,b){var c="h"===l(b.guide.scaleOrient),d=b.guide.rotate,e=a.selectAll(".tick text");e.attr("transform",k(d)).style("text-anchor",b.guide.textAnchor),90===d&&e.attr("x",9).attr("y",0),b.guide.tickFormatWordWrap?e.call(n,b.guide.tickFormatWordWrapLimit,b.guide.tickFormatWordWrapLines,b.guide.$maxTickTextH,!c):e.call(m,b.guide.tickFormatWordWrapLimit)},r=function(a,b,c){var d=this;if(a.scaleDim){var e=i.svg.axis().scale(a.scaleObj).orient(a.guide.scaleOrient),f=g.get(a.guide.tickFormat,a.guide.tickFormatNullAlias);null!==f&&(e.ticks(Math.round(c/a.guide.density)),e.tickFormat(f));var h=d.append("g").attr("class",a.guide.cssClass).attr("transform",j.apply(null,b)).call(e);o(h,a,c),q(h,a),p(h,a)}},s=function(a,b,c){var d=this,e=d.append("g").attr("class","grid").attr("transform",j(0,0)),f=(a.guide.showGridLines||"").toLowerCase();if(f.length>0){var h=e.append("g").attr("class","grid-lines");if(f.indexOf("x")>-1&&a.x.scaleDim){var k=a.x,l=i.svg.axis().scale(k.scaleObj).orient(k.guide.scaleOrient).tickSize(b),m=g.get(k.guide.tickFormat);null!==m&&(l.ticks(Math.round(c/k.guide.density)),l.tickFormat(m));var n=h.append("g").attr("class","grid-lines-x").call(l);o(n,k,c);var p=n.select("g.tick");if(p.node()&&"translate(0,0)"!==p.attr("transform")){var q=p.node().cloneNode(!0);h.node().appendChild(q),i.select(q).attr("class","border").attr("transform",j(0,0)).select("line").attr("x1",0).attr("x2",0)}}if(f.indexOf("y")>-1&&a.y.scaleDim){var r=a.y,s=i.svg.axis().scale(r.scaleObj).orient(r.guide.scaleOrient).tickSize(-c),m=g.get(r.guide.tickFormat);null!==m&&(s.ticks(Math.round(b/r.guide.density)),s.tickFormat(m));var t=h.append("g").attr("class","grid-lines-y").call(s);o(t,r,b)}h.selectAll("text").remove()}return e},t=h.times(10,function(a){return"color10-"+(1+a)}),u=function(a){var b,c,d=a.guide.color||{},e=a.color,g=e.scaleDim,h=d.brewer||t;f.isArray(h)?(c=a.domain(g).map(function(a){return String(a).toString()}),b=h):(c=Object.keys(h),b=c.map(function(a){return h[a]}));var j=i.scale.ordinal().range(b).domain(c),k=function(a){return c.indexOf(a)>-1?j(a):"color-default"};return{get:function(a){return k(String(a).toString())},dimension:g}},v=function(a,b,c){return a[b]=h.defaults(a[b]||{},{label:""}),a[b].label=h.isObject(a[b].label)?a[b].label:{text:a[b].label},a[b].label=h.defaults(a[b].label,c||{},{padding:32,rotate:0,textAnchor:"middle",cssClass:"label",dock:null}),a[b]},w=function(a,b,c){return a[b]=h.defaults(a[b],c||{},{padding:0,density:30,rotate:0,tickPeriod:null,tickFormat:null,autoScale:!0}),a[b].tickFormat=a[b].tickFormat||a[b].tickPeriod,a[b]},x=function(a){return a.options=a.options||{},a.guide=a.guide||{},a.guide.padding=h.defaults(a.guide.padding||{},{l:0,b:0,r:0,t:0}),a.guide.x=v(a.guide,"x"),a.guide.x=w(a.guide,"x",{cssClass:"x axis",scaleOrient:"bottom",textAnchor:"middle"}),a.guide.y=v(a.guide,"y",{rotate:-90}),a.guide.y=w(a.guide,"y",{cssClass:"y axis",scaleOrient:"left",textAnchor:"end"}),a.guide.size=v(a.guide,"size"),a.guide.color=v(a.guide,"color"),a},y={translate:j,rotate:k,getOrientation:l,fnDrawDimAxis:r,fnDrawGrid:s,generateColor:u,applyNodeDefaults:x};a.utilsDraw=y}),e("spec-engine-factory",["exports","./utils/utils","./utils/utils-draw","./formatter-registry"],function(b,c,d,e){function f(b,c,d,e){var f=b.hasOwnProperty(d)?b[d]:{};a.each(e,function(b){a.extend(c.guide[d][b],f[b])}),a.extend(c.guide[d],a.omit.apply(a,[f].concat[e]))}var g=c.utils,h=d.utilsDraw,i=e.FormatterRegistry,j=function(b,c){var d=c.guide||{},e={x:["label"],y:["label"],size:["label"],color:["label"],padding:[]};return a.each(e,function(a,c){f(d,b,c,a)}),a.extend(b.guide,a.omit.apply(a,[d].concat(a.keys(e)))),b},k=function(b,c){return b.guide=b.guide||{},b.guide.padding=b.guide.padding||{l:0,t:0,r:0,b:0},b.hasOwnProperty("unit")||(b=a.defaults(b,c),b.guide=a.defaults(b.guide,g.clone(c.guide)),b.guide.x=a.defaults(b.guide.x,g.clone(c.guide.x)),b.guide.y=a.defaults(b.guide.y,g.clone(c.guide.y))),b},l=function(a){var b=a.unit||[],c=!a.hasOwnProperty("unit"),d=!b.some(function(a){return a.hasOwnProperty("unit")});return{type:a.type,isLeaf:c,isLeafParent:!c&&d}},m=function(b,c,d,e){if(0===b.length)return{width:0,height:0};if(null===c){var f=d("TauChart Library");return f.width=.625*e,f}var g=a.max(b,function(a){return c(a).toString().length}),h=a.isNumber(g)?".00":"";return d(c(g)+h)},n=function(a,b,c){var d=a.dimType,e=a.scaleType,f="*";if("measure"===d&&"time"===e){var g=b.source.filter(function(a){return null!==a}).sort(),h=0;if(g.length>1){for(var i=1,j=g.length,k=[];j>i;)k.push(g[i]-g[i-1]),++i;var l=k.reduce(function(a,b){return a+=b},0);h=l/k.length}var m=[[31536e6,"year"],[7776e6,"quarter"],[2592e6,"month"],[6048e5,"week"],[864e5,"day"],[36e5,"hour"],[6e4,"min"],[1e3,"sec"],[0,"ms"]],n=-1;do++n;while(m[n][0]>h);f=m[n][1]}var o=[d,e,f].join(":"),p=[d,e].join(":");return c[o]||c[p]||c[d]||null},o=function(a,b,c,d,e,f){var g=b.dimension(a.x),h=b.dimension(a.y),j="measure"===g.dimType,k="measure"===h.dimType,l=b.scaleMeta(a.x,a.guide.x),o=l.values,p=b.scaleMeta(a.y,a.guide.y),q=p.values;a.guide.x.tickFormat=a.guide.x.tickFormat||n(g,l,c.defaultFormats),a.guide.y.tickFormat=a.guide.y.tickFormat||n(h,p,c.defaultFormats),["day","week","month"].indexOf(a.guide.x.tickFormat)>=0&&(a.guide.x.tickFormat+="-short"),["day","week","month"].indexOf(a.guide.y.tickFormat)>=0&&(a.guide.y.tickFormat+="-short");var r=0===o.length,s=0===q.length,t=m(o,i.get(a.guide.x.tickFormat,a.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),u=m(q,i.get(a.guide.y.tickFormat,a.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),v=c.xAxisPadding,w=c.yAxisPadding,x=d?!j:!1,y=e?!k:!1;a.guide.x.padding=r?0:v,a.guide.y.padding=s?0:w,a.guide.x.rotate=x?90:0,a.guide.x.textAnchor=x?"start":a.guide.x.textAnchor,a.guide.y.rotate=y?-90:0,a.guide.y.textAnchor=y?"middle":a.guide.y.textAnchor;var z=r?0:c.xTickWidth,A=s?0:c.yTickWidth;a.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,a.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var B=x?{w:t.height,h:t.width}:{h:t.height,w:t.width};if(t.width>c.xAxisTickLabelLimit){a.guide.x.tickFormatWordWrap=!0,a.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit;var C=Math.ceil(t.width/c.xAxisTickLabelLimit),D=Math.min(C,c.xTickWordWrapLinesLimit),E=D*t.height;x?(B.h=c.xAxisTickLabelLimit,B.w=E):(B.h=E,B.w=c.xAxisTickLabelLimit)}var F=y?{w:u.height,h:u.width}:{h:u.height,w:u.width};if(u.width>c.yAxisTickLabelLimit){a.guide.y.tickFormatWordWrap=!0,a.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit;var C=Math.ceil(u.width/c.yAxisTickLabelLimit),D=Math.min(C,c.yTickWordWrapLinesLimit),E=D*u.height;y?(F.w=E,F.h=c.yAxisTickLabelLimit):(F.w=c.yAxisTickLabelLimit,F.h=E)}var G=z+B.h,H=A+F.w,I=c.xFontLabelHeight,J=c.yFontLabelHeight,K=c.distToXAxisLabel,L=c.distToYAxisLabel;if(a.guide.x.density=c.xDensityKoeff*B.w,a.guide.y.density=c.yDensityKoeff*F.h,f){var M=(v-I)/2;a.guide.x.label.padding=0+I-K+M,a.guide.y.label.padding=0-L+M,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=v+G,a.guide.padding.l=w+H,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=+I+(a.guide.x.label.text?G+K:0),a.guide.y.label.padding=-I+(a.guide.y.label.text?H+L:0);var N=a.guide.x.label.text?a.guide.x.label.padding+I:G,O=a.guide.y.label.text?a.guide.y.label.padding+J:H;a.guide.padding.b=v+N-z,a.guide.padding.l=w+O,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=t.height,a.guide.y.tickFontHeight=u.height,a.guide.x.$minimalDomain=o.length,a.guide.y.$minimalDomain=q.length,a.guide.x.$maxTickTextW=t.width,a.guide.x.$maxTickTextH=t.height,a.guide.y.$maxTickTextW=u.width,a.guide.y.$maxTickTextH=u.height,a},p={NONE:function(a,b,c){var d=g.clone(a);return q(g.clone(d.unit),d.unit,function(a,b){return b.guide.x.tickFontHeight=c.getAxisTickLabelSize("X").height,b.guide.y.tickFontHeight=c.getAxisTickLabelSize("Y").height,b}),d},"BUILD-LABELS":function(b){var c=g.clone(b),d=[],e=[],f=null,h=null;return g.traverseJSON(c.unit,"unit",l,function(b,c){if(b.isLeaf)return c;!f&&c.x&&(f=c),!h&&c.y&&(h=c),c.guide=c.guide||{},c.guide.x=c.guide.x||{label:""},c.guide.y=c.guide.y||{label:""},c.guide.x.label=a.isObject(c.guide.x.label)?c.guide.x.label:{text:c.guide.x.label},c.guide.y.label=a.isObject(c.guide.y.label)?c.guide.y.label:{text:c.guide.y.label},c.x&&(c.guide.x.label.text=c.guide.x.label.text||c.x),c.y&&(c.guide.y.label.text=c.guide.y.label.text||c.y);var g=c.guide.x.label.text;g&&(d.push(g),c.guide.x.tickFormatNullAlias=c.guide.x.hasOwnProperty("tickFormatNullAlias")?c.guide.x.tickFormatNullAlias:"No "+g,c.guide.x.label.text="");var i=c.guide.y.label.text;return i&&(e.push(i),c.guide.y.tickFormatNullAlias=c.guide.y.hasOwnProperty("tickFormatNullAlias")?c.guide.y.tickFormatNullAlias:"No "+i,c.guide.y.label.text=""),c}),f&&(f.guide.x.label.text=d.join(" > ")),h&&(h.guide.y.label.text=e.join(" > ")),c},"BUILD-GUIDE":function(a,b,c){var d=g.clone(a);return q(g.clone(d.unit),d.unit,function(a,d){if(a.isLeaf)return d;a.isLeafParent&&!d.guide.hasOwnProperty("showGridLines")&&(d.guide.showGridLines="xy");var e=!a.isLeaf&&!a.isLeafParent;e&&(d.guide.x.cssClass+=" facet-axis",d.guide.y.cssClass+=" facet-axis");var f=b.dimension(d.x),g=b.dimension(d.y),h="measure"===f.dimType,j="measure"===g.dimType,k=b.scaleMeta(d.x,d.guide.x),l=k.values,o=b.scaleMeta(d.y,d.guide.y),p=o.values;d.guide.x.tickFormat=d.guide.x.tickFormat||n(f,k,c.defaultFormats),d.guide.y.tickFormat=d.guide.y.tickFormat||n(g,o,c.defaultFormats);var q=0===l.length,r=0===p.length,s=m(l,i.get(d.guide.x.tickFormat,d.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),t=m(p,i.get(d.guide.y.tickFormat,d.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),u=a.isLeafParent?c.xAxisPadding:0,v=a.isLeafParent?c.yAxisPadding:0,w=!e&&!!f.dimType&&"measure"!==f.dimType;d.guide.x.padding=q?0:u,d.guide.y.padding=r?0:v,d.guide.x.rotate=w?90:0,d.guide.x.textAnchor=w?"start":d.guide.x.textAnchor;var x=q?0:c.xTickWidth,y=r?0:c.yTickWidth;d.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,d.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var z=w?s.width:s.height;!h&&z>c.xAxisTickLabelLimit&&(z=c.xAxisTickLabelLimit),!w&&s.width>c.xAxisTickLabelLimit&&(d.guide.x.tickFormatWordWrap=!0,d.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit,z=c.xTickWordWrapLinesLimit*s.height);var A=t.width;!j&&A>c.yAxisTickLabelLimit&&(A=c.yAxisTickLabelLimit,d.guide.y.tickFormatWordWrap=!0,d.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit);var B=x+z,C=y+A,D=c.xFontLabelHeight,E=c.yFontLabelHeight,F=c.distToXAxisLabel,G=c.distToYAxisLabel,H=Math.min(c.xAxisTickLabelLimit,w?s.height:s.width);d.guide.x.density=c.xDensityKoeff*H;var I=Math.ceil(t.width/c.yAxisTickLabelLimit),J=Math.min(I,c.yTickWordWrapLinesLimit),K=Math.min(c.yAxisTickLabelLimit,J*t.height);d.guide.y.density=c.yDensityKoeff*K,d.guide.x.label.padding=d.guide.x.label.text?B+F:0,d.guide.y.label.padding=d.guide.y.label.text?C+G:0;var L=d.guide.x.label.text?d.guide.x.label.padding+D:B,M=d.guide.y.label.text?d.guide.y.label.padding+E:C;return d.guide.padding.b=u+L,d.guide.padding.l=v+M,d.guide.padding.b=d.guide.x.hide?0:d.guide.padding.b,d.guide.padding.l=d.guide.y.hide?0:d.guide.padding.l,d.guide.x.tickFontHeight=s.height,d.guide.y.tickFontHeight=t.height,d.guide.x.$minimalDomain=l.length,d.guide.y.$minimalDomain=p.length,d.guide.x.$maxTickTextW=s.width,d.guide.x.$maxTickTextH=s.height,d.guide.y.$maxTickTextW=t.width,d.guide.y.$maxTickTextH=t.height,d}),d},"BUILD-COMPACT":function(b,c,d){var e=g.clone(b);return q(g.clone(e.unit),e.unit,function(b,e){return b.isLeaf?e:b.isLeafParent?(e.guide.showGridLines=e.guide.hasOwnProperty("showGridLines")?e.guide.showGridLines:"xy",o(e,c,a.defaults({xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!0,!1,!0)):(e.guide.x.cssClass+=" facet-axis compact",e.guide.y.cssClass+=" facet-axis compact",o(e,c,a.defaults({xAxisPadding:0,yAxisPadding:0,distToXAxisLabel:0,distToYAxisLabel:0},d),!1,!0,!1))}),e}};p.AUTO=function(a,b,c){return["BUILD-LABELS","BUILD-GUIDE"].reduce(function(a,d){return p[d](a,b,c)},a)},p.COMPACT=function(a,b,c){return["BUILD-LABELS","BUILD-COMPACT"].reduce(function(a,d){return p[d](a,b,c)},a)};var q=function(b,c,d){var e=h.applyNodeDefaults(c);e=d(l(e),e),e=j(e,b);var f=a.omit(e,"unit");return(e.unit||[]).forEach(function(a){return q(g.clone(a),k(a,f),d)}),e},r={get:function(a,b){var c=p[a]||p.NONE;return function(a,d){return c(a,d,b)}}};b.SpecEngineFactory=r}),e("matrix",["exports"],function(b){var c=function(){var b=function(b,c){var d,e=a.toArray(arguments);d=a.isArray(e[0])?e[0]:a.times(b,function(){return a.times(c,function(){return null})}),this.cube=d};return b.prototype={iterate:function(b){var c=this.cube;return a.each(c,function(c,d){a.each(c,function(a,c){b(d,c,a)})}),this},getRC:function(a,b){return this.cube[a][b]},setRC:function(a,b,c){return this.cube[a][b]=c,this},sizeR:function(){return this.cube.length},sizeC:function(){var a=this.cube[0]||[];return a.length}},b}();b.TMatrix=c}),e("layout-engine-factory",["exports","./utils/utils","./utils/utils-draw","./matrix"],function(a,b,c,d){var e=b.utils,f=c.utilsDraw,g=d.TMatrix,h=function(a,b){var c=b?b:{depth:-1,paddings:[]},d=a.guide.padding;return c.depth+=1,c.paddings.unshift({l:d.l,b:d.b,r:d.r,t:d.t}),a.unit&&a.unit.length&&h(a.unit[0],c),c},i={NONE:function(a){return a},EXTRACT:function(a){var b=function(a,c,d){var e=a,f=e.sizeR(),h=e.sizeC();e.iterate(function(a,e,i){i.forEach(function(b){return d(b,{firstRow:0===a,firstCol:0===e,lastRow:a===f-1,lastCol:e===h-1,depth:c})}),i.filter(function(a){return a.$matrix -}).forEach(function(a){a.$matrix=new g(a.$matrix.cube),b(a.$matrix,c-1,d)})})},c=e.clone(a),d=new g([[[c]]]),i=h(c),j=i.paddings.reduce(function(a,b){return a.l+=b.l,a.b+=b.b,a},{l:0,b:0}),k=e.clone(j),l=i.paddings.reverse().map(function(a){return a.l=k.l-a.l,a.b=k.b-a.b,k={l:a.l,b:a.b},a});i.paddings=l.reverse();var m=10,n=f.applyNodeDefaults({type:"COORDS.RECT",options:e.clone(a.options),$matrix:new g([[[c]]]),guide:{padding:{l:j.l-m,b:j.b-m,r:0,t:0}}});return b(d,i.depth,function(a,b){var c=b.depth;a.guide.x.hide=a.guide.x.hide?a.guide.x.hide:!b.lastRow,a.guide.y.hide=a.guide.y.hide?a.guide.y.hide:!b.firstCol;var d=c>1?0:m,e=c>1?m:0;return a.guide.x.padding+=i.paddings[c].b,a.guide.y.padding+=i.paddings[c].l,a.guide.x.padding-=e,a.guide.y.padding-=e,a.guide.padding.l=d,a.guide.padding.b=d,a.guide.padding.r=d,a.guide.padding.t=d,a}),n}},j={get:function(a){return i[a]||i.NONE}};a.LayoutEngineFactory=j}),e("plugins",["exports"],function(a){var c=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},d=function(){var a=function(a,b){this.chart=b,this._plugins=a.map(this.initPlugin,this)};return c(a,null,{initPlugin:{writable:!0,value:function(a){var b=this;a.init&&a.init(this.chart),this.chart.on("destroy",a.destroy||function(){}),Object.keys(a).forEach(function(c){if(0===c.indexOf("on")){var d=c.substr(2);b.chart.on(d.toLowerCase(),a[c].bind(a))}})}}}),a}(),e=["click","mouseover","mouseout","mousemove"],f=function(a){return function(){e.forEach(function(c){this.on(c,function(d){a.fire("element"+c,{elementData:d,element:this,cellData:b.select(this.parentNode.parentNode).datum()})})},this)}};a.propagateDatumEvents=f,a.Plugins=d}),e("unit-domain-period-generator",["exports"],function(a){var b={day:{cast:function(a){return new Date(a.setHours(0,0,0,0))},next:function(a){return new Date(a.setDate(a.getDate()+1))}},week:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(a.getDate()-a.getDay()))},next:function(a){return new Date(a.setDate(a.getDate()+7))}},month:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1))},next:function(a){return new Date(a.setMonth(a.getMonth()+1))}},quarter:{cast:function(a){a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1));var b=a.getMonth(),c=b-b%3;return new Date(a.setMonth(c))},next:function(a){return new Date(a.setMonth(a.getMonth()+3))}},year:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1)),a=new Date(a.setMonth(0))},next:function(a){return new Date(a.setFullYear(a.getFullYear()+1))}}},c={add:function(a,c){return b[a.toLowerCase()]=c,this},get:function(a){return b[a.toLowerCase()]},generate:function(a,c,d){var e=[],f=b[d.toLowerCase()];if(f){var g=f.cast(new Date(c)),h=f.cast(new Date(a));for(e.push(h);(h=f.next(new Date(h)))<=g;)e.push(h)}return e}};a.UnitDomainPeriodGenerator=c}),e("unit-domain-mixin",["exports","./unit-domain-period-generator","./utils/utils","underscore","d3"],function(a,b,c,d,e){var f=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},g=b.UnitDomainPeriodGenerator,h=c.utils,i=d,j=e,k={ordinal:function(a){return a},linear:function(a,b){var c=b.autoScale?h.autoScale(a):j.extent(a),d=i.isNumber(b.min)?b.min:c[0],e=i.isNumber(b.max)?b.max:c[1];return[Math.min(d,c[0]),Math.max(e,c[1])]},period:function(a,b){var c=j.extent(a),d=i.isNull(b.min)||i.isUndefined(b.min)?c[0]:new Date(b.min).getTime(),e=i.isNull(b.max)||i.isUndefined(b.max)?c[1]:new Date(b.max).getTime(),f=[new Date(Math.min(d,c[0])),new Date(Math.max(e,c[1]))];return g.generate(f[0],f[1],b.period)},time:function(a,b){var c=j.extent(a),d=i.isNull(b.min)||i.isUndefined(b.min)?c[0]:new Date(b.min).getTime(),e=i.isNull(b.max)||i.isUndefined(b.max)?c[1]:new Date(b.max).getTime();return[new Date(Math.min(d,c[0])),new Date(Math.max(e,c[1]))]}},l={ordinal:function(a,b){return j.scale.ordinal().domain(a).rangePoints(b,1)},linear:function(a,b){return j.scale.linear().domain(a).rangeRound(b,1)},period:function(a,b){return j.scale.ordinal().domain(a).rangePoints(b,1)},time:function(a,b){return j.time.scale().domain(a).range(b)}},m=function(){var a=function(a,b){var c=function(a){return function(b){var c=b||{};return c.hasOwnProperty(a)?c[a]:null}},d=function(b){var d=a[b]||{},e=d.value?c(d.value):function(a){return a},f=i.contains(["period","time"],d.scale);return f?i.compose(function(a){return new Date(a).getTime()},e):e},e=function(b){var c=a[b]||{};return c.order||null},f=function(a){var b={category:function(a,b,c){return c},order:function(a,b,c){var d=e(a);return d?i.union(d,c):i.sortBy(c,b)},measure:function(a,b,c){return i.sortBy(c,b)},"as-is":function(a,b,c){return c}};return b[a]||b["as-is"]},h=function(a){var b={category:f("category"),order:f("order"),measure:f("measure"),"as-is":f("as-is")};return b[a]||b["as-is"]};this.fnDimension=function(b,c){var d=(c||{}).dimensions||{},e=a[b]||{},f=d[b]||{};return{scaleDim:b,scaleType:f.scale||e.scale,dimType:f.type||e.type}},this.fnSource=function(a){var c=i.map(a,function(a,b){return function(c){return d(b)(c[b])===a}});return i(b).filter(function(a){return i.every(c,function(b){return b(a)})})};var j=function(c,e){if(!a[c])return[null];var f=d(c),g=i(b).chain().pluck(c).uniq(f).value();return e(c,f,g)};this.fnDomain=function(b){var c=d(b),e=(a[b]||{}).type,g=j(b,f(e));return g.map(c)};var m=function(b,e){var f={},l=e||{};f.map=l.hasOwnProperty("map")?l.map:l.tickLabel,f.min=l.hasOwnProperty("min")?l.min:l.tickMin,f.max=l.hasOwnProperty("max")?l.max:l.tickMax,f.period=l.hasOwnProperty("period")?l.period:l.tickPeriod,f.autoScale=l.autoScale;var m=i.defaults({},a[b]),n={"order:period":function(a){return function(b){return g.get(a.period).cast(new Date(b))}},"*":function(){return function(a){return a}}},o=f.map?c(f.map):d(b),p=[m.type,m.scale].join(":"),q=(n[p]||n["*"])(f),r=j(b,h(m.type)).map(o),s=m.scale?k[m.scale](r,f):[];return{extract:function(a){return q(o(a))},values:s,source:r}};this.fnScaleMeta=m,this.fnScaleTo=function(b,c,d){var e=d||{},f=i.defaults({},a[b]),g=m(b,d),h=l[f.scale](g.values,c,e),j=function(a){return h(g.extract(a))};return Object.keys(h).forEach(function(a){return j[a]=h[a]}),j}};return f(a,null,{mix:{writable:!0,value:function(a){return a.dimension=this.fnDimension,a.source=this.fnSource,a.domain=this.fnDomain,a.scaleMeta=this.fnScaleMeta,a.scaleTo=this.fnScaleTo,a.partition=function(){return a.data||a.source(a.$where)},a.groupBy=function(a,b){return j.nest().key(function(a){return a[b]}).entries(a)},a}}}),a}();a.UnitDomainMixin=m}),e("units-registry",["exports"],function(a){var b={},c={add:function(a,c){var d={};return d.draw="function"==typeof c?c:c.draw,d.walk=c.walk||function(a){return a},b[a]=d,this},get:function(a){if(!b.hasOwnProperty(a))throw new Error("Unknown unit type: "+a);return b[a]}};a.UnitsRegistry=c}),e("data-processor",["exports","./utils/utils"],function(b,c){var d=c.utils,e={isYFunctionOfX:function(a,b,c){var d=!0,e=null;try{a.reduce(function(a,d){var f=function(a,b){return a.push(d[b]),a},g=b.reduce(f,[]).join("/"),h=c.reduce(f,[]).join("/");if(a.hasOwnProperty(g)){var i=a[g];if(i!==h)throw e={type:"RelationIsNotAFunction",keyX:b.join("/"),keyY:c.join("/"),valX:g,errY:[i,h]},new Error("RelationIsNotAFunction")}else a[g]=h;return a},{})}catch(f){if("RelationIsNotAFunction"!==f.message)throw f;d=!1}return{result:d,error:e}},excludeNullValues:function(a,b){var c=Object.keys(a).reduce(function(b,c){var d=a[c];return d.hasOwnProperty("hasNull")&&!d.hasNull||"measure"!==d.type&&"period"!==d.scale||b.push(c),b},[]);return function(a){var d=!c.some(function(b){return!(b in a)||null===a[b]});return d||b(a),d}},autoAssignScales:function(a){var b="category",c={category:"ordinal",order:"ordinal",measure:"linear"},d={};return Object.keys(a).forEach(function(e){var f=a[e],g=(f.type||b).toLowerCase();d[e]={},d[e].type=g,d[e].scale=f.scale||c[g],d[e].value=f.value}),d},autoDetectDimTypes:function(b){var c={type:"category",scale:"ordinal"},e=function(b,c){var d=c;return a.isDate(b)?(d.type="measure",d.scale="time"):a.isObject(b)?(d.type="order",d.scale="ordinal"):a.isNumber(b)&&(d.type="measure",d.scale="linear"),d},f=function(a,b){return Object.keys(b).forEach(function(f){var g=b.hasOwnProperty(f)?b[f]:null;if(a[f]=a[f]||{type:null,hasNull:!1},null===g)a[f].hasNull=!0;else{var h=e(g,d.clone(c)),i=h.type,j=h.scale,k=null!==a[f].type&&a[f].type!==i;a[f].type=k?c.type:i,a[f].scale=k?c.scale:j}}),a};return a.reduce(b,f,{})}};b.DataProcessor=e}),e("utils/layuot-template",["exports","../const"],function(a,b){var c=b.CSS_PREFIX,d=function(a,b){var d="div",e=document.createElement(d);return e.classList.add(c+a),b&&b.appendChild(e),e},e=function(){var a=d("layout"),b=d("layout__header",a),c=d("layout__container",a),e=d("layout__sidebar",c),f=d("layout__content",c),g=d("layout__content__wrap",f),h=d("layout__sidebar-right",c),i=d("layout__sidebar-right__wrap",h),j=d("layout__footer",a);return{layout:a,header:b,content:g,leftSidebar:e,rightSidebar:i,footer:j}};a.getLayout=e}),e("charts/tau.plot",["exports","../dsl-reader","../api/balloon","../event","../spec-engine-factory","../layout-engine-factory","../plugins","../utils/utils","../utils/utils-dom","../const","../unit-domain-mixin","../units-registry","../data-processor","../utils/layuot-template"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p){var q=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},r=function(a,b){a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),a.__proto__=b},s=d.DSLReader,t=e.Tooltip,u=f.Emitter,v=g.SpecEngineFactory,w=h.LayoutEngineFactory,x=i.Plugins,y=i.propagateDatumEvents,z=j.utils,A=k.utilsDom,B=l.CSS_PREFIX,C=m.UnitDomainMixin,D=n.UnitsRegistry,E=o.DataProcessor,F=p.getLayout,G=function(a){var b;if(a.unit){var c=G(a.unit[0]),d=a.guide,e=d.x.$minimalDomain||1,f=d.y.$minimalDomain||1,g=Math.max(e*d.x.density,e*c.w),h=Math.max(f*d.y.density,f*c.h);b={w:g+d.padding.l+d.padding.r,h:h+d.padding.t+d.padding.b}}else b={w:0,h:0};return b},H=function(a,b,c){var d=a.guide.x.$minimalDomain||1,e=a.guide.y.$minimalDomain||1,f=b.width/d,g=b.height/e,h=c.xMinimumDensityKoeff;if(a.guide.x.hide!==!0&&0!==a.guide.x.rotate&&f>h*a.guide.x.$maxTickTextW){a.guide.x.rotate=0,a.guide.x.textAnchor="middle",a.guide.x.tickFormatWordWrapLimit=f;var i=Math.min(c.xAxisTickLabelLimit,a.guide.x.$maxTickTextW),j=0-i+a.guide.x.$maxTickTextH;a.guide.padding.b+=a.guide.padding.b>0?j:0,a.guide.x.label.padding>i+c.xAxisPadding&&(a.guide.x.label.padding+=j)}var k={width:f,height:g};a.unit&&H(a.unit[0],k,c)},I=function(c){var d=function(a){c.call(this),this._svg=null,this._filtersStore={filters:{},tick:0},this._layout=F(),this.setupConfig(a),this._plugins=new x(this.config.plugins,this)};return r(d,c),q(d,null,{setupConfig:{writable:!0,value:function(b){this.config=a.defaults(b,{spec:{},data:[],plugins:[],settings:{}}),this._emptyContainer=b.emptyContainer||"",this.config.settings.specEngine=this.config.specEngine||this.config.settings.specEngine,this.config.settings.layoutEngine=this.config.layoutEngine||this.config.settings.layoutEngine,this.config.settings=this.setupSettings(this.config.settings),z.isArray(this.config.settings.specEngine)||(this.config.settings.specEngine=[{width:Number.MAX_VALUE,name:this.config.settings.specEngine}]),this.config.spec.dimensions=this.setupMetaInfo(this.config.spec.dimensions,this.config.data);var c=this.config.settings.log;this.config.settings.excludeNull&&this.addFilter({tag:"default",predicate:E.excludeNullValues(this.config.spec.dimensions,function(a){c([a,"point was excluded, because it has undefined values."],"WARN")})})}},getConfig:{writable:!0,value:function(){return this.config}},setupMetaInfo:{writable:!0,value:function(a,b){var c=a?a:E.autoDetectDimTypes(b);return E.autoAssignScales(c)}},setupSettings:{writable:!0,value:function(b){var c=d.globalSettings,e={};return Object.keys(c).forEach(function(b){e[b]=a.isFunction(c[b])?c[b]:z.clone(c[b])}),a.defaults(b||{},e)}},insertToRightSidebar:{writable:!0,value:function(a){return A.appendTo(a,this._layout.rightSidebar)}},addBalloon:{writable:!0,value:function(a){return new t("",a||{})}},renderTo:{writable:!0,value:function(c,d){this._svg=null,this._defaultSize=a.clone(d);var e=b.select(c),f=e.node();if(this._target=c,this._targetSizes=d,null===f)throw new Error("Target element not found");this._layout.content;f.appendChild(this._layout.layout),e=b.select(this._layout.content);var g=d||{};this._layout.content.innerHTML="",g.width&&g.height||(g=a.defaults(g,A.getContainerSize(this._layout.content.parentNode)));var h=this.getData();if(0===h.length)return void(this._layout.content.innerHTML=this._emptyContainer);this._targetSizes=g,this._layout.content.innerHTML="";var i=new C(this.config.spec.dimensions,h),j=a.find(this.config.settings.specEngine,function(a){return g.width<=a.width}),k=v.get(j.name,this.config.settings),l=k(this.config.spec,i.mix({})),m=G(l.unit),n=m.w,o=m.h,p=A.getScrollbarWidth(),q=g.width-n,r=g.height-o,t=q>=0?g.width:n,u=r>=0?0:p,x=r>=0?g.height:o,z=q>=0?0:p;g.height=x-z,g.width=t-u;var E=this.config.settings;H(l.unit,g,E);var F=new s(i,D),I=F.buildGraph(l),J=w.get(this.config.settings.layoutEngine)(I),K=F.calcLayout(J,g),L=F.renderGraph(K,e.append("svg").attr("class",B+"svg").attr("width",g.width).attr("height",g.height),this);this._svg=L.node(),L.selectAll(".i-role-datum").call(y(this)),this._layout.rightSidebar.style.maxHeight=g.height+"px",this.fire("render",this._svg)}},getData:{writable:!0,value:function(b){b=b||{};var c=a.chain(this._filtersStore.filters).values().flatten().reject(function(c){return a.contains(b.excludeFilter,c.tag)}).pluck("predicate").value();return a.filter(this.config.data,a.reduce(c,function(a,b){return function(c){return a(c)&&b(c)}},function(){return!0}))}},setData:{writable:!0,value:function(a){this.config.data=a,this.refresh()}},getSVG:{writable:!0,value:function(){return this._svg}},addFilter:{writable:!0,value:function(a){var b=a.tag,c=this._filtersStore.filters[b]=this._filtersStore.filters[b]||[],d=this._filtersStore.tick++;return a.id=d,c.push(a),this.refresh(),d}},refresh:{writable:!0,value:function(){this._target&&this.renderTo(this._target,this._defaultSize)}},resize:{writable:!0,value:function(a){void 0===a&&(a={}),this.renderTo(this._target,a)}},removeFilter:{writable:!0,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()}}}),d}(u);c.Plot=I}),e("charts/tau.chart",["exports","./tau.plot","../utils/utils","../data-processor"],function(b,c,d,e){function f(a,b){return b.reduce(function(b,c,d){return"measure"===a[c].type&&(b.countMeasureAxis++,b.indexMeasureAxis.push(d)),"measure"!==a[c].type&&1===b.countMeasureAxis?b.status=o.WARNING:b.countMeasureAxis>1&&(b.status=o.FAIL),b},{status:o.SUCCESS,countMeasureAxis:0,indexMeasureAxis:[]})}function g(b,c){var d=m(c.x),e=m(c.y),g=f(c.dimensions,d),h=f(c.dimensions,e);d=p[g.status](d,g),e=p[h.status](e,h);for(var i=m(c.guide),j=Math.max(d.length,e.length);i.length0;o--){var q=d.pop(),r=e.pop(),s=i.pop()||{};o===j?(k.x=q,k.y=r,k.unit.push(n(b,{x:l(q),y:l(r),color:c.color,size:c.size,flip:c.flip,colorGuide:s.color})),k.guide=a.defaults(s,{x:{label:q},y:{label:r}})):k={type:"COORDS.RECT",x:l(q),y:l(r),unit:[k],guide:a.defaults(s,{x:{label:q},y:{label:r}})}}return c.spec={dimensions:c.dimensions,unit:k},c}var h=function(a,b){a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),a.__proto__=b},i=c.Plot,j=d.utils,k=e.DataProcessor,l=function(a){return a?a:null},m=function(a){return j.isArray(a)?a:[a]},n=function(a,b){return{type:a,x:b.x,y:b.y,color:b.color,guide:{color:b.colorGuide},flip:b.flip,size:b.size}},o={SUCCESS:"SUCCESS",WARNING:"WARNING",FAIL:"FAIL"},p=function(b){return b[o.SUCCESS]=function(a){return a},b[o.FAIL]=function(){throw new Error("This configuration is not supported, See http://api.taucharts.com/basic/facet.html#easy-approach-for-creating-facet-chart")},b[o.WARNING]=function(b,c){var d=b[c.indexMeasureAxis[0]],e=a.without(b,d);return e.push(d),e},b}({}),q={scatterplot:function(a){return g("ELEMENT.POINT",a)},line:function(b){var c=b.data,d=b.settings.log,e={none:function(){return null},horizontal:function(a){var b=j.isArray(a.x)?a.x:[a.x];return b[b.length-1]},vertical:function(a){var b=j.isArray(a.y)?a.y:[a.y];return b[b.length-1]},auto:function(a){var b,e=j.isArray(a.x)?a.x:[a.x],f=j.isArray(a.y)?a.y:[a.y],g=e[e.length-1],h=e.slice(0,e.length-1),i=f[f.length-1],l=f.slice(0,f.length-1),m=a.color,n=h.concat(l).concat([m]).filter(function(a){return null!==a}),o=-1,p=[[[g].concat(n),i],[[i].concat(n),g]],q=p.some(function(a,b){var e=a[0],f=a[1],g=k.isYFunctionOfX(c,e,[f]);return g.result?o=b:d(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+g.error.keyY+" values (e.g. "+g.error.errY.join(",")+")","for ("+g.error.keyX+" = "+g.error.valX+")."].join(" ")),g.result});return q?b=p[o][0][0]:(d(["All attempts are failed.","Will orient line horizontally by default.","NOTE: the [scatterplot] chart is more convenient for that data."].join(" ")),b=g),b}},f=(b.lineOrientation||"auto").toLowerCase(),h=e.hasOwnProperty(f)?e[f]:e.auto,i=h(b);return null!==i&&(b.data=a(c).sortBy(i)),g("ELEMENT.LINE",b)},bar:function(a){return a.flip=!1,g("ELEMENT.INTERVAL",a)},horizontalBar:function(a){return a.flip=!0,g("ELEMENT.INTERVAL",a)}},r=function(a){var b=function(b){b.settings=this.setupSettings(b.settings),b.dimensions=this.setupMetaInfo(b.dimensions,b.data),a.call(this,q[b.type](b))};return h(b,a),b}(i);b.Chart=r}),e("elements/coords",["exports","../utils/utils-draw","../const","../utils/utils","../matrix"],function(b,c,d,e,f){var g=c.utilsDraw,h=d.CSS_PREFIX,i=e.utils,j=f.TMatrix,k={CROSS:function(b,c,d){var e=b.domain(c),f=b.domain(d).reverse();return a(f).map(function(b){return a(e).map(function(a){var e={};return c&&(e[c]=a),d&&(e[d]=b),e})})}},l=function(a){return k[a]||function(){return[[{}]]}},m=function(b,c,d){var e=a.defaults(i.clone(b),a.pick.apply(a,[c].concat(d)));return e.guide=a.extend(i.clone(c.guide),e.guide),e},n={walk:function(b,c){var d=a.defaults(b,{$where:{}}),e=a.any(d.unit,function(a){return 0===a.type.indexOf("COORDS.")}),f=l(e?"CROSS":""),g=new j(f(d,d.x,d.y)),h=new j(g.sizeR(),g.sizeC());return g.iterate(function(b,c,e){var f=a.extend({},d.$where,e),g=a(d.unit).map(function(b){return a.extend(m(b,d,["x","y"]),{$where:f})});h.setRC(b,c,g)}),d.$matrix=h,h.iterate(function(b,d,e){a.each(e,function(a){return c(a)})}),d},draw:function(b,c){var d=b.options,e=b.guide.padding;b.x.guide=b.guide.x,b.y.guide=b.guide.y;var f=d.left+e.l,i=d.top+e.t,j=d.width-(e.l+e.r),k=d.height-(e.t+e.b);b.x.scaleObj=b.x.scaleDim&&b.scaleTo(b.x.scaleDim,[0,j],b.x.guide),b.y.scaleObj=b.y.scaleDim&&b.scaleTo(b.y.scaleDim,[k,0],b.y.guide),b.x.guide.size=j,b.y.guide.size=k;var l=[0,k+b.guide.x.padding],m=[0-b.guide.y.padding,0],n=d.container.append("g").attr("class",h+"cell cell").attr("transform",g.translate(f,i)).datum({$where:b.$where});b.x.guide.hide||g.fnDrawDimAxis.call(n,b.x,l,j),b.y.guide.hide||g.fnDrawDimAxis.call(n,b.y,m,k);var o=g.fnDrawGrid.call(n,b,k,j);b.$matrix.iterate(function(b,d,e){e.forEach(function(b){b.options=a.extend({container:o},b.options),c(b)})})}};b.coords=n}),e("elements/size",["exports"],function(b){var c=function(a){return Math.sqrt(a)},d=function(b,d,e,f){var g=a.filter(b,a.isFinite);if(0===g.length)return function(){return f};var h=1,i=0,j=Math.min.apply(null,g),k=Math.max.apply(null,g),l=c(Math.max.apply(null,[Math.abs(j),Math.abs(k),k-j]));return i=0>j?j:0,h=0===l?1:(e-d)/l,function(b){var f=null!==b?parseFloat(b):0;if(!a.isFinite(f))return e;var g=f-i;return d+c(g)*h}};b.sizeScale=d}),e("elements/point",["exports","../utils/utils-draw","../const","./size"],function(b,c,d,e){var f=(c.utilsDraw,d.CSS_PREFIX),g=e.sizeScale,h=function(b){var c=b.options,d=c.xScale,e=c.yScale,h=c.color,i=.5*a.min([b.guide.x.tickFontHeight,b.guide.y.tickFontHeight].filter(function(a){return 0!==a})),j=.5*a.min([b.guide.x.density,b.guide.y.density].filter(function(a){return 0!==a})),k=g(b.domain(b.size.scaleDim),2,j,i),l=function(){return this.attr("r",function(a){return k(a[b.size.scaleDim])}).attr("cx",function(a){return d(a[b.x.scaleDim])}).attr("cy",function(a){return e(a[b.y.scaleDim])}).attr("class",function(a){return f+"dot dot i-role-datum "+h.get(a[h.dimension])})},m=c.container.selectAll(".dot").data(b.partition());m.call(l),m.exit().remove(),m.enter().append("circle").call(l)};b.point=h}),e("utils/css-class-map",["exports","../const"],function(a,b){function c(a){return g[a-1]||g[4]}function d(a){var b=0;return a>=160&&320>a?b=1:a>=320&&480>a?b=2:a>=480&&640>a?b=3:a>=640&&(b=4),h[b]}var e=b.CSS_PREFIX,f=[1,2,3,4,5],g=f.map(function(a){return e+"line-opacity-"+a}),h=f.map(function(a){return e+"line-width-"+a});a.getLineClassesByWidth=d,a.getLineClassesByCount=c}),e("elements/line",["exports","../utils/utils-draw","./point","../const","../utils/css-class-map"],function(a,c,d,e,f){var g=(c.utilsDraw,d.point,e.CSS_PREFIX),h=f.getLineClassesByWidth,i=f.getLineClassesByCount,j=function(a){var c=a.options,d=c.xScale,e=c.yScale,f=c.color;a.size={};var j=a.groupBy(a.partition(),f.dimension),k=h(c.width),l=i(j.length),m=function(){this.attr("class",function(a){return[g+"line i-role-datum ","line",f.get(a.key),k,l].join(" ")});var a=this.selectAll("path").data(function(a){return[a.values]});a.call(p),a.enter().append("path").call(p),a.exit().remove()},n=function(b){var h=b.reduce(function(a,b){var c=b.values;return 1===c.length&&a.push(c[0]),a},[]),i=function(){return this.attr("r",1.5).attr("class",function(a){return g+"dot-line dot-line i-role-datum "+g+"dot i-role-datum "+f.get(a[f.dimension])}).attr("cx",function(b){return d(b[a.x.scaleDim])}).attr("cy",function(b){return e(b[a.y.scaleDim])})},j=c.container.selectAll(".dot-line").data(h);j.call(i),j.exit().remove(),j.enter().append("circle").call(i)},o=b.svg.line().x(function(b){return d(b[a.x.scaleDim])}).y(function(b){return e(b[a.y.scaleDim])}),p=function(){this.attr("d",o)};n(j);var q=c.container.selectAll(".line").data(j);q.call(m),q.enter().append("g").call(m),q.exit().remove()};a.line=j}),e("elements/interval",["exports","../utils/utils-draw","../const"],function(a,b,c){var d=b.utilsDraw,e=c.CSS_PREFIX,f="i-role-bar-group",g=function(a){return"measure"===a.dimType},h=function(a){var b,c,d;return g(a.dim)?(b=5,c=5,d=0):(b=a.size/a.domain().length,c=b/(a.categories.length+1),d=c),{tickWidth:b,intervalWidth:c,offsetCategory:d}},i=function(a){var b,c,i,j,k,l=a.options,m=l.xScale,n=l.yScale,o=l.color,p=a.groupBy(a.partition(),o.dimension);if(a.flip){var q,r,s,t,u;!function(){q=Math.min.apply(null,m.domain());var e=0>=q?0:q;r=h({domain:n.domain,dim:a.y,categories:p,size:l.height}),s=r.tickWidth,t=r.intervalWidth,u=r.offsetCategory,b=g(a.x)?function(b){return m(Math.min(e,b[a.x.scaleDim]))}:0,c=function(b){return n(b[a.y.scaleDim])-s/2},i=g(a.x)?function(b){return Math.abs(m(b[a.x.scaleDim])-m(e))}:function(b){return m(b[a.x.scaleDim])},j=function(){return t},k=function(a,b){return d.translate(0,b*u+u/2)}}()}else{var v,w,s,t,u;!function(){v=Math.min.apply(null,n.domain());var e=0>=v?0:v;w=h({domain:m.domain,dim:a.x,categories:p,size:l.width}),s=w.tickWidth,t=w.intervalWidth,u=w.offsetCategory,b=function(b){return m(b[a.x.scaleDim])-s/2},c=g(a.y)?function(b){return n(Math.max(e,b[a.y.scaleDim]))}:function(b){return n(b[a.y.scaleDim])},i=function(){return t},j=g(a.y)?function(b){return Math.abs(n(b[a.y.scaleDim])-n(e))}:function(b){return l.height-n(b[a.y.scaleDim])},k=function(a,b){return d.translate(b*u+u/2,0)}}()}var x=function(){return this.attr("class",function(a){return"i-role-datum bar "+e+"bar "+o.get(a[o.dimension])}).attr("x",b).attr("y",c).attr("width",i).attr("height",j)},y=function(){this.attr("class",f).attr("transform",k);var a=this.selectAll("bar").data(function(a){return a.values});a.call(x),a.enter().append("rect").call(x),a.exit().remove()},z=l.container.selectAll("."+f).data(p);z.call(y),z.enter().append("g").call(y),z.exit().remove()};a.interval=i}),e("elements/coords-parallel",["exports","../utils/utils-draw","../const","../utils/utils","../matrix"],function(c,d,e,f,g){var h=d.utilsDraw,i=(e.CSS_PREFIX,f.utils),j=g.TMatrix,k=function(b,c,d){var e=a.defaults(i.clone(b),a.pick.apply(a,[c].concat(d)));return e.guide=a.extend(i.clone(c.guide||{}),e.guide||{}),e},l={walk:function(b,c){var d=a.defaults(b,{$where:{}}),e=new j(1,1),f=new j(1,1);return e.iterate(function(b,c){var e=a.extend({},d.$where),g=a(d.unit).map(function(b){return a.extend(k(b,d,["x"]),{$where:e})});f.setRC(b,c,g)}),d.$matrix=f,f.iterate(function(b,d,e){a.each(e,function(a){return c(a)})}),d},draw:function(c,d){var e=c.options,f=c.guide.padding,g=e.left+f.l,i=e.top+f.t,j=e.width-(f.l+f.r),k=e.height-(f.t+f.b),l=c.x.map(function(a){return c.scaleTo(a,[k,0],{})}),m=e.container.append("g").attr("class","graphical-report__cell cell").attr("transform",h.translate(g,i)),n=function(a,b){return"translate("+a+","+b+")"},o=function(a){return"rotate("+a+")"},p=function(a,c){var d=this,e=b.svg.axis().scale(a).orient("left"),f=d.append("g").attr("class","y axis").attr("transform",n.apply(null,c)).call(e);f.selectAll(".tick text").attr("transform",o(0)).style("text-anchor","end")},q=j/(c.x.length-1);l.forEach(function(a,b){p.call(m,a,[b*q,0])});var r=m.append("g").attr("class","grid").attr("transform",n(0,0));c.$matrix.iterate(function(b,c,e){e.forEach(function(b){b.options=a.extend({container:r},b.options),d(b)})})}};c.CoordsParallel=l}),e("elements/coords-parallel-line",["exports","../utils/utils-draw","../const"],function(a,c,d){var e=c.utilsDraw,f=(d.CSS_PREFIX,{draw:function(a){a.color=a.dimension(a.color,a);var c=a.options,d=a.x.reduce(function(b,d){return b[d]=a.scaleTo(d,[c.height,0],{}),b},{}),f=e.generateColor(a),g=b.nest().key(function(a){return a[f.dimension]}).entries(a.partition()).map(function(b){var c=b.values[0],d=[];return a.x.forEach(function(a){d.push({key:a,val:c[a]})}),d}),h=function(){this.attr("class",function(){return"graphical-report__line line color10-9"});var a=this.selectAll("path").data(function(a){return[a]});a.call(l),a.enter().append("path").call(l),a.exit().remove()},i=c.width/(a.x.length-1),j={};a.x.forEach(function(a,b){j[a]=b*i});var k=b.svg.line().x(function(a){return j[a.key]}).y(function(a){return d[a.key](a.val)}),l=function(){this.attr("d",k)},m=c.container.selectAll(".line").data(g);m.call(h),m.enter().append("g").call(h),m.exit().remove()}});a.CoordsParallelLine=f}),e("node-map",["exports","./elements/coords","./elements/line","./elements/point","./elements/interval","./utils/utils-draw","./elements/coords-parallel","./elements/coords-parallel-line"],function(a,b,c,d,e,f,g,h){var i=b.coords,j=c.line,k=d.point,l=e.interval,m=f.utilsDraw,n=g.CoordsParallel,o=h.CoordsParallelLine,p=function(a,b){b.forEach(function(b){a[b]=a.dimension(a[b],a)});var c=a.options,d=c.width,e=c.height;return a.x.guide=a.guide.x,a.y.guide=a.guide.y,a.options.xScale=a.x.scaleDim&&a.scaleTo(a.x.scaleDim,[0,d],a.x.guide),a.options.yScale=a.y.scaleDim&&a.scaleTo(a.y.scaleDim,[e,0],a.y.guide),a.options.color=m.generateColor(a),a},q={"COORDS.RECT":{walk:i.walk,draw:function(a,b){a.x=a.dimension(a.x,a),a.y=a.dimension(a.y,a),i.draw(a,b)}},"ELEMENT.POINT":function(a){k(p(a,["x","y","color","size"]))},"ELEMENT.LINE":function(a){j(p(a,["x","y","color"]))},"ELEMENT.INTERVAL":function(a){l(p(a,["x","y","color"]))},"COORDS.PARALLEL":n,"PARALLEL/ELEMENT.LINE":o};a.nodeMap=q}),e("tau.newCharts",["exports","./utils/utils-dom","./charts/tau.plot","./charts/tau.chart","./unit-domain-mixin","./unit-domain-period-generator","./dsl-reader","./spec-engine-factory","./layout-engine-factory","./formatter-registry","./node-map","./units-registry"],function(c,d,e,f,g,h,i,j,k,l,m,n){var o=d.utilsDom,p=e.Plot,q=f.Chart,r=g.UnitDomainMixin,s=h.UnitDomainPeriodGenerator,t=i.DSLReader,u=j.SpecEngineFactory,v=k.LayoutEngineFactory,w=l.FormatterRegistry,x=m.nodeMap,y=n.UnitsRegistry,z={},A={},B={UnitDomainMixin:r,UnitDomainPeriodGenerator:s,DSLReader:t,SpecEngineFactory:u,LayoutEngineFactory:v},C={UnitsRegistry:y,tickFormat:w,d3:b,_:a,tickPeriod:s,colorBrewers:{add:function(a,b){a in z||(z[a]=b)},get:function(a){return z[a]}},plugins:{add:function(a,b){if(a in A)throw new Error("Plugins is already registred.");A[a]=b},get:function(a){return A[a]}},globalSettings:{log:function(a,b){b=b||"INFO",Array.isArray(a)||(a=[a]),console[b.toLowerCase()].apply(console,a)},excludeNull:!0,specEngine:[{name:"COMPACT",width:600},{name:"AUTO",width:Number.MAX_VALUE}],layoutEngine:"EXTRACT",getAxisTickLabelSize:o.getAxisTickLabelSize,xAxisTickLabelLimit:100,yAxisTickLabelLimit:100,xTickWordWrapLinesLimit:2,yTickWordWrapLinesLimit:3,xTickWidth:9,yTickWidth:9,distToXAxisLabel:20,distToYAxisLabel:20,xAxisPadding:20,yAxisPadding:20,xFontLabelHeight:10,yFontLabelHeight:10,xDensityKoeff:2.2,xMinimumDensityKoeff:1.1,yDensityKoeff:2.2,yMinimumDensityKoeff:1.1,defaultFormats:{measure:"x-num-auto","measure:time":"x-time-auto","measure:time:year":"year","measure:time:quarter":"quarter","measure:time:month":"month","measure:time:week":"x-time-auto","measure:time:day":"x-time-auto","measure:time:hour":"x-time-auto","measure:time:min":"x-time-auto","measure:time:sec":"x-time-auto","measure:time:ms":"x-time-auto"}}};p.globalSettings=C.globalSettings,C.UnitsRegistry.add("COORDS.PARALLEL",x["COORDS.PARALLEL"]).add("PARALLEL/ELEMENT.LINE",x["PARALLEL/ELEMENT.LINE"]).add("COORDS.RECT",x["COORDS.RECT"]).add("ELEMENT.POINT",x["ELEMENT.POINT"]).add("ELEMENT.LINE",x["ELEMENT.LINE"]).add("ELEMENT.INTERVAL",x["ELEMENT.INTERVAL"]),c.Plot=p,c.Chart=q,c.__api__=B,c.api=C}),e("underscore",function(){return a}),e("d3",function(){return b}),d("tau.newCharts")}); \ No newline at end of file +!function(a,b){if("function"==typeof define&&define.amd)define(["underscore","d3"],function(a,c){return b(a,c)});else if("object"==typeof module&&module.exports){{var c=require("underscore");require("d3")}module.exports=b(c)}else a.tauCharts=b(a._,a.d3)}(this,function(a,b){var c,d,e;return function(a){function b(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(b,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(a,d.concat([b,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(c){if(b(r,c)){var d=r[c];delete r[c],t[c]=!0,m.apply(a,d)}if(!b(q,c)&&!b(t,c))throw new Error("No "+c);return q[c]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(c,d,e,f){var h,k,l,m,n,s,u=[],v=typeof e;if(f=f||c,"undefined"===v||"function"===v){for(d=!d.length&&e.length?["require","exports","module"]:d,n=0;n','','','<%= xTick %>',"","",""].join(""),e=a.template(d),f=document.createElement("div");f.style.position="absolute",f.style.visibility="hidden",f.style.width="100px",f.style.height="100px",f.style.border="1px solid green",document.body.appendChild(f),f.innerHTML=e({xTick:c});var g=b.select(f).selectAll(".x.axis .tick text")[0][0],h={width:0,height:0},i=g.getBoundingClientRect();return h.width=i.right-i.left,h.height=i.bottom-i.top,document.body.removeChild(f),h}};c.utilsDom=e}),e("dsl-reader",["exports"],function(b){var c=function(){var b=function(a,b){this.domain=a,this.UnitsRegistry=b};return b.prototype.buildGraph=function(a){var b=this,c=function(a){return b.UnitsRegistry.get(a.type).walk(b.domain.mix(a),c)};return c(a.unit)},b.prototype.calcLayout=function(b,c){b.options={top:0,left:0,width:c.width,height:c.height};var d=function(b){if(!b.$matrix)return b;var c,e=b.options,f=b.guide.padding,g=e.width-(f.l+f.r),h=e.height-(f.t+f.b),i=b.$matrix.sizeR(),j=b.$matrix.sizeC(),k=g/j,l=h/i;return c=b.guide.split?{calcHeight:function(a,b,c,d){return a/d},calcTop:function(a,b,c,d){return(b+1)*(a/d)*c}}:{calcHeight:function(a){return a},calcTop:function(a,b){return b*l}},b.$matrix.iterate(function(b,e,f){var g=f.length;a.each(f,function(a,f){a.options={width:k,left:e*k,height:c.calcHeight(l,b,f,g),top:c.calcTop(l,b,f,g)},d(a)})}),b};return d(b)},b.prototype.renderGraph=function(a,b,c){var d=this;a.options.container=b;var e=function(a){var b=d.domain.mix(a);d.UnitsRegistry.get(a.type).draw(b,function(b){b.parentUnit=a,e(b)}),c&&c.fire("unitready",b)};return a.parentUnit=null,e(a),a.options.container},b}();b.DSLReader=c}),e("const",["exports"],function(a){a.CSS_PREFIX="graphical-report__"}),e("api/balloon",["exports","../const"],function(a,b){function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){return a&&null!=a.setInterval}function e(a){var b=l.pageYOffset||o.scrollTop,e=l.pageXOffset||o.scrollLeft,f={left:0,right:0,top:0,bottom:0,width:0,height:0};if(d(a))f.width=l.innerWidth||o.clientWidth,f.height=l.innerHeight||o.clientHeight;else{if(!o.contains(a)||null==a.getBoundingClientRect)return f;c(f,a.getBoundingClientRect()),f.width=f.right-f.left,f.height=f.bottom-f.top}return f.top=f.top+b-o.clientTop,f.left=f.left+e-o.clientLeft,f.right=f.left+f.width,f.bottom=f.top+f.height,f}function f(a){return 0|Math.round(String(a).replace(/[^\-0-9.]/g,""))}function g(a){var b=String(q(a,g.propName)),c=b.match(/([0-9.]+)([ms]{1,2})/);return c&&(b=Number(c[1]),"s"===c[2]&&(b*=1e3)),0|b}function h(a,b){return this instanceof h?(this.hidden=1,this.options=c(r(h.defaults),b),this._createElement(),void this.content(a)):new h(a,b)}var i=b.CSS_PREFIX,j=function(a){return{add:function(b){a.classList.add(b)},remove:function(b){a.classList.remove(b)}}},k=function(a,b){return a.indexOf(b)},l=window,m=l.document,n=m.body,o=m.documentElement,p=["top","bottom"],q=l.getComputedStyle;g.propName=function(){for(var a=m.createElement("div"),b=["transitionDuration","webkitTransitionDuration"],c="1s",d=0;d=b.bottom&&(c[0]="top"),c[1]){case"left":a.right-this.width<=b.left&&(c[1]="right");break;case"right":a.left+this.width>=b.right&&(c[1]="left");break;default:a.left+a.width/2+this.width/2>=b.right?c[1]="left":a.right-a.width/2-this.width/2<=b.left&&(c[1]="right")}else switch(a.left-this.width-d<=b.left?c[0]="right":a.right+this.width+d>=b.right&&(c[0]="left"),c[1]){case"top":a.bottom-this.height<=b.top&&(c[1]="bottom");break;case"bottom":a.top+this.height>=b.bottom&&(c[1]="top");break;default:a.top+a.height/2+this.height/2>=b.bottom?c[1]="top":a.bottom-a.height/2-this.height/2<=b.top&&(c[1]="bottom")}return c.join("-")},h.prototype.position=function(a,b){this.attachedTo&&(a=this.attachedTo),null==a&&this._p?(a=this._p[0],b=this._p[1]):this._p=arguments;var c="number"==typeof a?{left:0|a,right:0|a,top:0|b,bottom:0|b,width:0,height:0}:e(a),d=this.spacing,f=this._pickPlace(c);f!==this.curPlace&&(this.curPlace&&this.classes.remove(this.curPlace),this.classes.add(f),this.curPlace=f);var g,h;switch(this.curPlace){case"top":g=c.top-this.height-d,h=c.left+c.width/2-this.width/2;break;case"top-left":g=c.top-this.height-d,h=c.right-this.width;break;case"top-right":g=c.top-this.height-d,h=c.left;break;case"bottom":g=c.bottom+d,h=c.left+c.width/2-this.width/2;break;case"bottom-left":g=c.bottom+d,h=c.right-this.width;break;case"bottom-right":g=c.bottom+d,h=c.left;break;case"left":g=c.top+c.height/2-this.height/2,h=c.left-this.width-d;break;case"left-top":g=c.bottom-this.height,h=c.left-this.width-d;break;case"left-bottom":g=c.top,h=c.left-this.width-d;break;case"right":g=c.top+c.height/2-this.height/2,h=c.right+d;break;case"right-top":g=c.bottom-this.height,h=c.right+d;break;case"right-bottom":g=c.top,h=c.right+d}return this.element.style.top=Math.round(g)+"px",this.element.style.left=Math.round(h)+"px",this},h.prototype.show=function(a,b){return a=this.attachedTo?this.attachedTo:a,clearTimeout(this.aIndex),null!=a&&this.position(a,b),this.hidden&&(this.hidden=0,n.appendChild(this.element)),this.attachedTo&&this._aware(),this.options.inClass&&(this.options.effectClass&&void this.element.clientHeight,this.classes.add(this.options.inClass)),this},h.prototype.getElement=function(){return this.element},h.prototype.hide=function(){if(!this.hidden){var a=this,b=0;return this.options.inClass&&(this.classes.remove(this.options.inClass),this.options.effectClass&&(b=g(this.element))),this.attachedTo&&this._unaware(),clearTimeout(this.aIndex),this.aIndex=setTimeout(function(){a.aIndex=0,n.removeChild(a.element),a.hidden=1},b),this}},h.prototype.toggle=function(a,b){return this[this.hidden?"show":"hide"](a,b)},h.prototype.destroy=function(){clearTimeout(this.aIndex),this._unaware(),this.hidden||n.removeChild(this.element),this.element=this.options=null},h.prototype._aware=function(){var a=k(h.winAware,this);~a||h.winAware.push(this)},h.prototype._unaware=function(){var a=k(h.winAware,this);~a&&h.winAware.splice(a,1)},h.reposition=function(){function a(){!c&&h.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=h.winAware.length;d>b;b++)a=h.winAware[b],a.position()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),h.winAware=[],window.addEventListener("resize",h.reposition),window.addEventListener("scroll",h.reposition),h.classTypes=["type","effect"],h.defaults={baseClass:i+"tooltip",typeClass:null,effectClass:null,inClass:"in",place:"top",spacing:null,auto:0},a.Tooltip=h}),e("event",["exports"],function(a){function b(a){var b=d[a];return b||(b=function(){for(var b,c,d=this,e=0;d=d.handler;){if(c=d.callbacks[a],"function"==typeof c){if(!b)for(b=[this],e=0;e=0?-1:1,f=d||1;d-=e*f/b}for(var g=[c,d],h=g[1]-g[0],i=Math.pow(10,Math.floor(Math.log(h/b)/Math.LN10)),j=b/h*i,k=[[.15,10],[.35,5],[.75,2],[1,1],[2,1]],l=-1;j>k[++l][0];);i*=k[l][1],g[0]=Math.floor(g[0]/i)*i,g[1]=Math.ceil(g[1]/i)*i;var m=c-g[0],n=g[1]-d,o=i/2;if(c>=0)g[0]=0;else{var p=o>=m?i:0;g[0]=g[0]-p}if(0>=d)g[1]=0;else{var q=o>=n?i:0;g[1]=g[1]+q}return[parseFloat(g[0].toFixed(15)),parseFloat(g[1].toFixed(15))]},traverseJSON:b};a.utils=c}),e("formatter-registry",["exports","d3"],function(b,c){var d=c,e={"x-num-auto":function(a){var b=parseFloat(a.toFixed(2));return Math.abs(b)<1?b.toString():d.format("s")(b)},percent:function(a){var b=parseFloat((100*a).toFixed(2));return b.toString()+"%"},day:d.time.format("%d-%b-%Y"),"day-short":d.time.format("%d-%b"),week:d.time.format("%d-%b-%Y"),"week-short":d.time.format("%d-%b"),"week-range":function(a){var b=new Date(a),c=new Date(a),e=new Date(c.setDate(c.getDate()+7)),f=d.time.format("%d-%b-%Y");return f(b)+" - "+f(e)},month:function(a){var b=new Date(a),c=b.getMonth(),e=0===c?"%B, %Y":"%B";return d.time.format(e)(a)},"month-short":function(a){var b=new Date(a),c=b.getMonth(),e=0===c?"%b '%Y":"%b";return d.time.format(e)(a)},"month-year":d.time.format("%B, %Y"),quarter:function(a){var b=new Date(a),c=b.getMonth(),d=(c-c%3)/3;return"Q"+(d+1)+" "+b.getFullYear()},year:d.time.format("%Y"),"x-time-auto":null},f={get:function(b,c){var f=c||"",g=function(a){return(null===a||"undefined"==typeof a?f:a).toString()},h=e.hasOwnProperty(b),i=h?e[b]:g;return h&&(i=e[b]),!h&&b&&(i=function(c){var e=a.isDate(c)?d.time.format(b):d.format(b);return e(c)}),h||b||(i=g),i},add:function(a,b){e[a]=b}};b.FormatterRegistry=f}),e("utils/utils-draw",["exports","../utils/utils","../formatter-registry","underscore","d3"],function(a,b,c,d,e){var f=b.utils,g=c.FormatterRegistry,h=d,i=e,j=function(a,b){return"translate("+a+","+b+")"},k=function(a){return"rotate("+a+")"},l=function(a){return h.contains(["bottom","top"],a.toLowerCase())?"h":"v"},m=function(a,b){a.each(function(){var a=i.select(this),c=a.text().split(/\s+/).reverse();a.text(null);for(var d,e=[],f=!1;!f&&(d=c.pop());)if(e.push(d),a.text(e.join(" ")),a.node().getComputedTextLength()>b){e.pop();var g=e.join(" ");g+="...",a.text(g),f=!0}})},n=function(a,b,c,d,e){var f=function(a,b,c,d,e,f,g){var h=g*c+f,i=a.append("tspan").attr("x",d).attr("y",e).attr("dy",h+"em").text(b);return i};a.each(function(){var a=i.select(this),g=a.text().split(/\s+/),h=1.1,j=a.attr("x"),k=a.attr("y"),l=parseFloat(a.attr("dy"));a.text(null);var m=f(a,null,h,j,k,l,0),n=!1,o=g.reduce(function(a,d){if(n)return a;var e=a.length===c,f=a[a.length-1],g=m.text(f+d).node().getComputedTextLength()>b;return g&&e&&(a[a.length-1]=f+"...",n=!0),g&&!e&&a.push(d),g||(a[a.length-1]=f+" "+d),a},[""]);k=e?-1*(o.length-1)*Math.floor(.5*d):k,o.forEach(function(b,c){return f(a,b,h,j,k,l,c)}),m.remove()})},o=function(a,b,c){var d=a.selectAll(".tick line"),e=c/d[0].length,f=e/2;if("ordinal"===b.scaleType||"period"===b.scaleType){var g="h"===l(b.guide.scaleOrient),h=g?"x":"y",i=g?f:-f;d.attr(h+"1",i).attr(h+"2",i)}},p=function(a,b){var c=l(b.guide.scaleOrient),d="h"===c?1:-1,e=a.append("text").attr("transform",k(b.guide.label.rotate)).attr("class",b.guide.label.cssClass).attr("x",d*b.guide.size*.5).attr("y",d*b.guide.label.padding).style("text-anchor",b.guide.label.textAnchor),f=" > ",g=b.guide.label.text.split(f),h=g.length;if(g.forEach(function(a,b){e.append("tspan").attr("class","label-token label-token-"+b).text(a),h-1>b&&e.append("tspan").attr("class","label-token-delimiter label-token-delimiter-"+b).text(f)}),"right"===b.guide.label.dock){var i=a.node().getBBox();e.attr("x","h"===c?i.width:0)}else if("left"===b.guide.label.dock){var i=a.node().getBBox();e.attr("x","h"===c?0:10-i.height)}},q=function(a,b){var c="h"===l(b.guide.scaleOrient),d=b.guide.rotate,e=a.selectAll(".tick text");e.attr("transform",k(d)).style("text-anchor",b.guide.textAnchor),90===d&&e.attr("x",9).attr("y",0),b.guide.tickFormatWordWrap?e.call(n,b.guide.tickFormatWordWrapLimit,b.guide.tickFormatWordWrapLines,b.guide.$maxTickTextH,!c):e.call(m,b.guide.tickFormatWordWrapLimit)},r=function(a,b,c){var d=this;if(a.scaleDim){var e=i.svg.axis().scale(a.scaleObj).orient(a.guide.scaleOrient),f=g.get(a.guide.tickFormat,a.guide.tickFormatNullAlias);null!==f&&(e.ticks(Math.round(c/a.guide.density)),e.tickFormat(f));var h=d.append("g").attr("class",a.guide.cssClass).attr("transform",j.apply(null,b)).call(e);o(h,a,c),q(h,a),p(h,a)}},s=function(a,b,c){var d=this,e=d.append("g").attr("class","grid").attr("transform",j(0,0)),f=(a.guide.showGridLines||"").toLowerCase();if(f.length>0){var h=e.append("g").attr("class","grid-lines");if(f.indexOf("x")>-1&&a.x.scaleDim){var k=a.x,l=i.svg.axis().scale(k.scaleObj).orient(k.guide.scaleOrient).tickSize(b),m=g.get(k.guide.tickFormat);null!==m&&(l.ticks(Math.round(c/k.guide.density)),l.tickFormat(m));var n=h.append("g").attr("class","grid-lines-x").call(l);o(n,k,c);var p=n.select("g.tick");if(p.node()&&"translate(0,0)"!==p.attr("transform")){var q=p.node().cloneNode(!0);h.node().appendChild(q),i.select(q).attr("class","border").attr("transform",j(0,0)).select("line").attr("x1",0).attr("x2",0)}}if(f.indexOf("y")>-1&&a.y.scaleDim){var r=a.y,s=i.svg.axis().scale(r.scaleObj).orient(r.guide.scaleOrient).tickSize(-c),m=g.get(r.guide.tickFormat);null!==m&&(s.ticks(Math.round(b/r.guide.density)),s.tickFormat(m));var t=h.append("g").attr("class","grid-lines-y").call(s);o(t,r,b)}h.selectAll("text").remove()}return e},t=h.times(10,function(a){return"color10-"+(1+a)}),u=function(a){var b,c,d=a.guide.color||{},e=a.color,g=e.scaleDim,h=d.brewer||t;f.isArray(h)?(c=a.domain(g).map(function(a){return String(a).toString()}),b=h):(c=Object.keys(h),b=c.map(function(a){return h[a]}));var j=i.scale.ordinal().range(b).domain(c),k=function(a){return c.indexOf(a)>-1?j(a):"color-default"};return{get:function(a){return k(String(a).toString())},dimension:g}},v=function(a,b,c){return a[b]=h.defaults(a[b]||{},{label:""}),a[b].label=h.isObject(a[b].label)?a[b].label:{text:a[b].label},a[b].label=h.defaults(a[b].label,c||{},{padding:32,rotate:0,textAnchor:"middle",cssClass:"label",dock:null}),a[b]},w=function(a,b,c){return a[b]=h.defaults(a[b],c||{},{padding:0,density:30,rotate:0,tickPeriod:null,tickFormat:null,autoScale:!0}),a[b].tickFormat=a[b].tickFormat||a[b].tickPeriod,a[b]},x=function(a){return a.options=a.options||{},a.guide=a.guide||{},a.guide.padding=h.defaults(a.guide.padding||{},{l:0,b:0,r:0,t:0}),a.guide.x=v(a.guide,"x"),a.guide.x=w(a.guide,"x",{cssClass:"x axis",scaleOrient:"bottom",textAnchor:"middle"}),a.guide.y=v(a.guide,"y",{rotate:-90}),a.guide.y=w(a.guide,"y",{cssClass:"y axis",scaleOrient:"left",textAnchor:"end"}),a.guide.size=v(a.guide,"size"),a.guide.color=v(a.guide,"color"),a},y={translate:j,rotate:k,getOrientation:l,fnDrawDimAxis:r,fnDrawGrid:s,generateColor:u,applyNodeDefaults:x};a.utilsDraw=y}),e("spec-engine-factory",["exports","./utils/utils","./utils/utils-draw","./formatter-registry"],function(b,c,d,e){function f(b,c,d,e){var f=b.hasOwnProperty(d)?b[d]:{};a.each(e,function(b){a.extend(c.guide[d][b],f[b])}),a.extend(c.guide[d],a.omit.apply(a,[f].concat[e]))}var g=c.utils,h=d.utilsDraw,i=e.FormatterRegistry,j=function(b,c){var d=c.guide||{},e={x:["label"],y:["label"],size:["label"],color:["label"],padding:[]};return a.each(e,function(a,c){f(d,b,c,a)}),a.extend(b.guide,a.omit.apply(a,[d].concat(a.keys(e)))),b},k=function(b,c){return b.guide=b.guide||{},b.guide.padding=b.guide.padding||{l:0,t:0,r:0,b:0},b.hasOwnProperty("unit")||(b=a.defaults(b,c),b.guide=a.defaults(b.guide,g.clone(c.guide)),b.guide.x=a.defaults(b.guide.x,g.clone(c.guide.x)),b.guide.y=a.defaults(b.guide.y,g.clone(c.guide.y))),b},l=function(a){var b=a.unit||[],c=!a.hasOwnProperty("unit"),d=!b.some(function(a){return a.hasOwnProperty("unit")});return{type:a.type,isLeaf:c,isLeafParent:!c&&d}},m=function(b,c,d,e){if(0===b.length)return{width:0,height:0};if(null===c){var f=d("TauChart Library");return f.width=.625*e,f}var g=a.max(b,function(a){return c(a).toString().length}),h=a.isNumber(g)?".00":"";return d(c(g)+h)},n=function(a,b,c){var d=a.dimType,e=a.scaleType,f="*";if("measure"===d&&"time"===e){var g=b.source.filter(function(a){return null!==a}).sort(),h=0;if(g.length>1){for(var i=1,j=g.length,k=[];j>i;)k.push(g[i]-g[i-1]),++i;var l=k.reduce(function(a,b){return a+=b},0);h=l/k.length}var m=[[31536e6,"year"],[7776e6,"quarter"],[2592e6,"month"],[6048e5,"week"],[864e5,"day"],[36e5,"hour"],[6e4,"min"],[1e3,"sec"],[0,"ms"]],n=-1;do++n;while(m[n][0]>h);f=m[n][1]}var o=[d,e,f].join(":"),p=[d,e].join(":");return c[o]||c[p]||c[d]||null},o=function(a,b,c,d,e,f){var g=b.dimension(a.x),h=b.dimension(a.y),j="measure"===g.dimType,k="measure"===h.dimType,l=b.scaleMeta(a.x,a.guide.x),o=l.values,p=b.scaleMeta(a.y,a.guide.y),q=p.values;a.guide.x.tickFormat=a.guide.x.tickFormat||n(g,l,c.defaultFormats),a.guide.y.tickFormat=a.guide.y.tickFormat||n(h,p,c.defaultFormats),["day","week","month"].indexOf(a.guide.x.tickFormat)>=0&&(a.guide.x.tickFormat+="-short"),["day","week","month"].indexOf(a.guide.y.tickFormat)>=0&&(a.guide.y.tickFormat+="-short");var r=0===o.length,s=0===q.length,t=m(o,i.get(a.guide.x.tickFormat,a.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),u=m(q,i.get(a.guide.y.tickFormat,a.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),v=c.xAxisPadding,w=c.yAxisPadding,x=d?!j:!1,y=e?!k:!1;a.guide.x.padding=r?0:v,a.guide.y.padding=s?0:w,a.guide.x.rotate=x?90:0,a.guide.x.textAnchor=x?"start":a.guide.x.textAnchor,a.guide.y.rotate=y?-90:0,a.guide.y.textAnchor=y?"middle":a.guide.y.textAnchor;var z=r?0:c.xTickWidth,A=s?0:c.yTickWidth;a.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,a.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var B=x?{w:t.height,h:t.width}:{h:t.height,w:t.width};if(t.width>c.xAxisTickLabelLimit){a.guide.x.tickFormatWordWrap=!0,a.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit;var C=Math.ceil(t.width/c.xAxisTickLabelLimit),D=Math.min(C,c.xTickWordWrapLinesLimit),E=D*t.height;x?(B.h=c.xAxisTickLabelLimit,B.w=E):(B.h=E,B.w=c.xAxisTickLabelLimit)}var F=y?{w:u.height,h:u.width}:{h:u.height,w:u.width};if(u.width>c.yAxisTickLabelLimit){a.guide.y.tickFormatWordWrap=!0,a.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit;var C=Math.ceil(u.width/c.yAxisTickLabelLimit),D=Math.min(C,c.yTickWordWrapLinesLimit),E=D*u.height;y?(F.w=E,F.h=c.yAxisTickLabelLimit):(F.w=c.yAxisTickLabelLimit,F.h=E)}var G=z+B.h,H=A+F.w,I=c.xFontLabelHeight,J=c.yFontLabelHeight,K=c.distToXAxisLabel,L=c.distToYAxisLabel;if(a.guide.x.density=c.xDensityKoeff*B.w,a.guide.y.density=c.yDensityKoeff*F.h,f){var M=(v-I)/2;a.guide.x.label.padding=0+I-K+M,a.guide.y.label.padding=0-L+M,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=v+G,a.guide.padding.l=w+H,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=+I+(a.guide.x.label.text?G+K:0),a.guide.y.label.padding=-I+(a.guide.y.label.text?H+L:0);var N=a.guide.x.label.text?a.guide.x.label.padding+I:G,O=a.guide.y.label.text?a.guide.y.label.padding+J:H;a.guide.padding.b=v+N-z,a.guide.padding.l=w+O,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=t.height,a.guide.y.tickFontHeight=u.height,a.guide.x.$minimalDomain=o.length,a.guide.y.$minimalDomain=q.length,a.guide.x.$maxTickTextW=t.width,a.guide.x.$maxTickTextH=t.height,a.guide.y.$maxTickTextW=u.width,a.guide.y.$maxTickTextH=u.height,a},p={NONE:function(a,b,c){var d=g.clone(a);return q(g.clone(d.unit),d.unit,function(a,b){return b.guide.x.tickFontHeight=c.getAxisTickLabelSize("X").height,b.guide.y.tickFontHeight=c.getAxisTickLabelSize("Y").height,b}),d},"BUILD-LABELS":function(b){var c=g.clone(b),d=[],e=[],f=null,h=null;return g.traverseJSON(c.unit,"unit",l,function(b,c){if(b.isLeaf)return c;!f&&c.x&&(f=c),!h&&c.y&&(h=c),c.guide=c.guide||{},c.guide.x=c.guide.x||{label:""},c.guide.y=c.guide.y||{label:""},c.guide.x.label=a.isObject(c.guide.x.label)?c.guide.x.label:{text:c.guide.x.label},c.guide.y.label=a.isObject(c.guide.y.label)?c.guide.y.label:{text:c.guide.y.label},c.x&&(c.guide.x.label.text=c.guide.x.label.text||c.x),c.y&&(c.guide.y.label.text=c.guide.y.label.text||c.y);var g=c.guide.x.label.text;g&&(d.push(g),c.guide.x.tickFormatNullAlias=c.guide.x.hasOwnProperty("tickFormatNullAlias")?c.guide.x.tickFormatNullAlias:"No "+g,c.guide.x.label.text="");var i=c.guide.y.label.text;return i&&(e.push(i),c.guide.y.tickFormatNullAlias=c.guide.y.hasOwnProperty("tickFormatNullAlias")?c.guide.y.tickFormatNullAlias:"No "+i,c.guide.y.label.text=""),c}),f&&(f.guide.x.label.text=d.join(" > ")),h&&(h.guide.y.label.text=e.join(" > ")),c},"BUILD-GUIDE":function(a,b,c){var d=g.clone(a);return q(g.clone(d.unit),d.unit,function(a,d){if(a.isLeaf)return d;a.isLeafParent&&!d.guide.hasOwnProperty("showGridLines")&&(d.guide.showGridLines="xy");var e=!a.isLeaf&&!a.isLeafParent;e&&(d.guide.x.cssClass+=" facet-axis",d.guide.y.cssClass+=" facet-axis");var f=b.dimension(d.x),g=b.dimension(d.y),h="measure"===f.dimType,j="measure"===g.dimType,k=b.scaleMeta(d.x,d.guide.x),l=k.values,o=b.scaleMeta(d.y,d.guide.y),p=o.values;d.guide.x.tickFormat=d.guide.x.tickFormat||n(f,k,c.defaultFormats),d.guide.y.tickFormat=d.guide.y.tickFormat||n(g,o,c.defaultFormats);var q=0===l.length,r=0===p.length,s=m(l,i.get(d.guide.x.tickFormat,d.guide.x.tickFormatNullAlias),c.getAxisTickLabelSize,c.xAxisTickLabelLimit),t=m(p,i.get(d.guide.y.tickFormat,d.guide.y.tickFormatNullAlias),c.getAxisTickLabelSize,c.yAxisTickLabelLimit),u=a.isLeafParent?c.xAxisPadding:0,v=a.isLeafParent?c.yAxisPadding:0,w=!e&&!!f.dimType&&"measure"!==f.dimType;d.guide.x.padding=q?0:u,d.guide.y.padding=r?0:v,d.guide.x.rotate=w?90:0,d.guide.x.textAnchor=w?"start":d.guide.x.textAnchor;var x=q?0:c.xTickWidth,y=r?0:c.yTickWidth;d.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,d.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit;var z=w?s.width:s.height;!h&&z>c.xAxisTickLabelLimit&&(z=c.xAxisTickLabelLimit),!w&&s.width>c.xAxisTickLabelLimit&&(d.guide.x.tickFormatWordWrap=!0,d.guide.x.tickFormatWordWrapLines=c.xTickWordWrapLinesLimit,z=c.xTickWordWrapLinesLimit*s.height);var A=t.width;!j&&A>c.yAxisTickLabelLimit&&(A=c.yAxisTickLabelLimit,d.guide.y.tickFormatWordWrap=!0,d.guide.y.tickFormatWordWrapLines=c.yTickWordWrapLinesLimit);var B=x+z,C=y+A,D=c.xFontLabelHeight,E=c.yFontLabelHeight,F=c.distToXAxisLabel,G=c.distToYAxisLabel,H=Math.min(c.xAxisTickLabelLimit,w?s.height:s.width);d.guide.x.density=c.xDensityKoeff*H;var I=Math.ceil(t.width/c.yAxisTickLabelLimit),J=Math.min(I,c.yTickWordWrapLinesLimit),K=Math.min(c.yAxisTickLabelLimit,J*t.height);d.guide.y.density=c.yDensityKoeff*K,d.guide.x.label.padding=d.guide.x.label.text?B+F:0,d.guide.y.label.padding=d.guide.y.label.text?C+G:0;var L=d.guide.x.label.text?d.guide.x.label.padding+D:B,M=d.guide.y.label.text?d.guide.y.label.padding+E:C;return d.guide.padding.b=u+L,d.guide.padding.l=v+M,d.guide.padding.b=d.guide.x.hide?0:d.guide.padding.b,d.guide.padding.l=d.guide.y.hide?0:d.guide.padding.l,d.guide.x.tickFontHeight=s.height,d.guide.y.tickFontHeight=t.height,d.guide.x.$minimalDomain=l.length,d.guide.y.$minimalDomain=p.length,d.guide.x.$maxTickTextW=s.width,d.guide.x.$maxTickTextH=s.height,d.guide.y.$maxTickTextW=t.width,d.guide.y.$maxTickTextH=t.height,d}),d},"BUILD-COMPACT":function(b,c,d){var e=g.clone(b);return q(g.clone(e.unit),e.unit,function(b,e){return b.isLeaf?e:b.isLeafParent?(e.guide.showGridLines=e.guide.hasOwnProperty("showGridLines")?e.guide.showGridLines:"xy",o(e,c,a.defaults({xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},d),!0,!1,!0)):(e.guide.x.cssClass+=" facet-axis compact",e.guide.y.cssClass+=" facet-axis compact",o(e,c,a.defaults({xAxisPadding:0,yAxisPadding:0,distToXAxisLabel:0,distToYAxisLabel:0},d),!1,!0,!1))}),e}};p.AUTO=function(a,b,c){return["BUILD-LABELS","BUILD-GUIDE"].reduce(function(a,d){return p[d](a,b,c)},a)},p.COMPACT=function(a,b,c){return["BUILD-LABELS","BUILD-COMPACT"].reduce(function(a,d){return p[d](a,b,c)},a)};var q=function(b,c,d){var e=h.applyNodeDefaults(c);e=d(l(e),e),e=j(e,b);var f=a.omit(e,"unit");return(e.unit||[]).forEach(function(a){return q(g.clone(a),k(a,f),d)}),e},r={get:function(a,b){var c=p[a]||p.NONE;return function(a,d){return c(a,d,b)}}};b.SpecEngineFactory=r}),e("matrix",["exports"],function(b){var c=function(){var b=function(b,c){var d,e=a.toArray(arguments);d=a.isArray(e[0])?e[0]:a.times(b,function(){return a.times(c,function(){return null})}),this.cube=d};return b.prototype={iterate:function(b){var c=this.cube;return a.each(c,function(c,d){a.each(c,function(a,c){b(d,c,a)})}),this},getRC:function(a,b){return this.cube[a][b]},setRC:function(a,b,c){return this.cube[a][b]=c,this},sizeR:function(){return this.cube.length},sizeC:function(){var a=this.cube[0]||[];return a.length}},b}();b.TMatrix=c}),e("layout-engine-factory",["exports","./utils/utils","./utils/utils-draw","./matrix"],function(a,b,c,d){var e=b.utils,f=c.utilsDraw,g=d.TMatrix,h=function(a,b){var c=b?b:{depth:-1,paddings:[]},d=a.guide.padding;return c.depth+=1,c.paddings.unshift({l:d.l,b:d.b,r:d.r,t:d.t}),a.unit&&a.unit.length&&h(a.unit[0],c),c},i={NONE:function(a){return a},EXTRACT:function(a){var b=function(a,c,d){var e=a,f=e.sizeR(),h=e.sizeC();e.iterate(function(a,e,i){i.forEach(function(b){return d(b,{firstRow:0===a,firstCol:0===e,lastRow:a===f-1,lastCol:e===h-1,depth:c})}),i.filter(function(a){return a.$matrix}).forEach(function(a){a.$matrix=new g(a.$matrix.cube),b(a.$matrix,c-1,d)})})},c=e.clone(a),d=new g([[[c]]]),i=h(c),j=i.paddings.reduce(function(a,b){return a.l+=b.l,a.b+=b.b,a},{l:0,b:0}),k=e.clone(j),l=i.paddings.reverse().map(function(a){return a.l=k.l-a.l,a.b=k.b-a.b,k={l:a.l,b:a.b},a +});i.paddings=l.reverse();var m=10,n=f.applyNodeDefaults({type:"COORDS.RECT",options:e.clone(a.options),$matrix:new g([[[c]]]),guide:{padding:{l:j.l-m,b:j.b-m,r:0,t:0}}});return b(d,i.depth,function(a,b){var c=b.depth;a.guide.x.hide=a.guide.x.hide?a.guide.x.hide:!b.lastRow,a.guide.y.hide=a.guide.y.hide?a.guide.y.hide:!b.firstCol;var d=c>1?0:m,e=c>1?m:0;return a.guide.x.padding+=i.paddings[c].b,a.guide.y.padding+=i.paddings[c].l,a.guide.x.padding-=e,a.guide.y.padding-=e,a.guide.padding.l=d,a.guide.padding.b=d,a.guide.padding.r=d,a.guide.padding.t=d,a}),n}},j={get:function(a){return i[a]||i.NONE}};a.LayoutEngineFactory=j}),e("plugins",["exports"],function(a){var c=function(){var a=function(a,b){this.chart=b,this._plugins=a.map(this.initPlugin,this)};return a.prototype.initPlugin=function(a){var b=this;a.init&&a.init(this.chart),this.chart.on("destroy",a.destroy||function(){}),Object.keys(a).forEach(function(c){if(0===c.indexOf("on")){var d=c.substr(2);b.chart.on(d.toLowerCase(),a[c].bind(a))}})},a}(),d=["click","mouseover","mouseout","mousemove"],e=function(a){return function(){d.forEach(function(c){this.on(c,function(d){a.fire("element"+c,{elementData:d,element:this,cellData:b.select(this.parentNode.parentNode).datum()})})},this)}};a.propagateDatumEvents=e,a.Plugins=c}),e("unit-domain-period-generator",["exports"],function(a){var b={day:{cast:function(a){return new Date(a.setHours(0,0,0,0))},next:function(a){return new Date(a.setDate(a.getDate()+1))}},week:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(a.getDate()-a.getDay()))},next:function(a){return new Date(a.setDate(a.getDate()+7))}},month:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1))},next:function(a){return new Date(a.setMonth(a.getMonth()+1))}},quarter:{cast:function(a){a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1));var b=a.getMonth(),c=b-b%3;return new Date(a.setMonth(c))},next:function(a){return new Date(a.setMonth(a.getMonth()+3))}},year:{cast:function(a){return a=new Date(a.setHours(0,0,0,0)),a=new Date(a.setDate(1)),a=new Date(a.setMonth(0))},next:function(a){return new Date(a.setFullYear(a.getFullYear()+1))}}},c={add:function(a,c){return b[a.toLowerCase()]=c,this},get:function(a){return b[a.toLowerCase()]},generate:function(a,c,d){var e=[],f=b[d.toLowerCase()];if(f){var g=f.cast(new Date(c)),h=f.cast(new Date(a));for(e.push(h);(h=f.next(new Date(h)))<=g;)e.push(h)}return e}};a.UnitDomainPeriodGenerator=c}),e("unit-domain-mixin",["exports","./unit-domain-period-generator","./utils/utils","underscore","d3"],function(a,b,c,d,e){var f=b.UnitDomainPeriodGenerator,g=c.utils,h=d,i=e,j={ordinal:function(a){return a},linear:function(a,b){var c=b.autoScale?g.autoScale(a):i.extent(a),d=h.isNumber(b.min)?b.min:c[0],e=h.isNumber(b.max)?b.max:c[1];return[Math.min(d,c[0]),Math.max(e,c[1])]},period:function(a,b){var c=i.extent(a),d=h.isNull(b.min)||h.isUndefined(b.min)?c[0]:new Date(b.min).getTime(),e=h.isNull(b.max)||h.isUndefined(b.max)?c[1]:new Date(b.max).getTime(),g=[new Date(Math.min(d,c[0])),new Date(Math.max(e,c[1]))];return f.generate(g[0],g[1],b.period)},time:function(a,b){var c=i.extent(a),d=h.isNull(b.min)||h.isUndefined(b.min)?c[0]:new Date(b.min).getTime(),e=h.isNull(b.max)||h.isUndefined(b.max)?c[1]:new Date(b.max).getTime();return[new Date(Math.min(d,c[0])),new Date(Math.max(e,c[1]))]}},k={ordinal:function(a,b){return i.scale.ordinal().domain(a).rangePoints(b,1)},linear:function(a,b){return i.scale.linear().domain(a).rangeRound(b,1)},period:function(a,b){return i.scale.ordinal().domain(a).rangePoints(b,1)},time:function(a,b){return i.time.scale().domain(a).range(b)}},l=function(){var a=function(a,b){var c=function(a){return function(b){var c=b||{};return c.hasOwnProperty(a)?c[a]:null}},d=function(b){var d=a[b]||{},e=d.value?c(d.value):function(a){return a},f=h.contains(["period","time"],d.scale);return f?h.compose(function(a){return new Date(a).getTime()},e):e},e=function(b){var c=a[b]||{};return c.order||null},g=function(a){var b={category:function(a,b,c){return c},order:function(a,b,c){var d=e(a);return d?h.union(d,c):h.sortBy(c,b)},measure:function(a,b,c){return h.sortBy(c,b)},"as-is":function(a,b,c){return c}};return b[a]||b["as-is"]},i=function(a){var b={category:g("category"),order:g("order"),measure:g("measure"),"as-is":g("as-is")};return b[a]||b["as-is"]};this.fnDimension=function(b,c){var d=(c||{}).dimensions||{},e=a[b]||{},f=d[b]||{};return{scaleDim:b,scaleType:f.scale||e.scale,dimType:f.type||e.type}},this.fnSource=function(a){var c=h.map(a,function(a,b){return function(c){return d(b)(c[b])===a}});return h(b).filter(function(a){return h.every(c,function(b){return b(a)})})};var l=function(c,e){if(!a[c])return[null];var f=d(c),g=h(b).chain().pluck(c).uniq(f).value();return e(c,f,g)};this.fnDomain=function(b){var c=d(b),e=(a[b]||{}).type,f=l(b,g(e));return f.map(c)};var m=function(b,e){var g={},k=e||{};g.map=k.hasOwnProperty("map")?k.map:k.tickLabel,g.min=k.hasOwnProperty("min")?k.min:k.tickMin,g.max=k.hasOwnProperty("max")?k.max:k.tickMax,g.period=k.hasOwnProperty("period")?k.period:k.tickPeriod,g.autoScale=k.autoScale;var m=h.defaults({},a[b]),n={"order:period":function(a){return function(b){return f.get(a.period).cast(new Date(b))}},"*":function(){return function(a){return a}}},o=g.map?c(g.map):d(b),p=[m.type,m.scale].join(":"),q=(n[p]||n["*"])(g),r=l(b,i(m.type)).map(o),s=m.scale?j[m.scale](r,g):[];return{extract:function(a){return q(o(a))},values:s,source:r}};this.fnScaleMeta=m,this.fnScaleTo=function(b,c,d){var e=d||{},f=h.defaults({},a[b]),g=m(b,d),i=k[f.scale](g.values,c,e),j=function(a){return i(g.extract(a))};return Object.keys(i).forEach(function(a){return j[a]=i[a]}),j}};return a.prototype.mix=function(a){return a.dimension=this.fnDimension,a.source=this.fnSource,a.domain=this.fnDomain,a.scaleMeta=this.fnScaleMeta,a.scaleTo=this.fnScaleTo,a.partition=function(){return a.data||a.source(a.$where)},a.groupBy=function(a,b){return i.nest().key(function(a){return a[b]}).entries(a)},a},a}();a.UnitDomainMixin=l}),e("units-registry",["exports"],function(a){var b={},c={add:function(a,c){var d={};return d.draw="function"==typeof c?c:c.draw,d.walk=c.walk||function(a){return a},b[a]=d,this},get:function(a){if(!b.hasOwnProperty(a))throw new Error("Unknown unit type: "+a);return b[a]}};a.UnitsRegistry=c}),e("data-processor",["exports","./utils/utils"],function(b,c){var d=c.utils,e={isYFunctionOfX:function(a,b,c){var d=!0,e=null;try{a.reduce(function(a,d){var f=function(a,b){return a.push(d[b]),a},g=b.reduce(f,[]).join("/"),h=c.reduce(f,[]).join("/");if(a.hasOwnProperty(g)){var i=a[g];if(i!==h)throw e={type:"RelationIsNotAFunction",keyX:b.join("/"),keyY:c.join("/"),valX:g,errY:[i,h]},new Error("RelationIsNotAFunction")}else a[g]=h;return a},{})}catch(f){if("RelationIsNotAFunction"!==f.message)throw f;d=!1}return{result:d,error:e}},excludeNullValues:function(a,b){var c=Object.keys(a).reduce(function(b,c){var d=a[c];return d.hasOwnProperty("hasNull")&&!d.hasNull||"measure"!==d.type&&"period"!==d.scale||b.push(c),b},[]);return function(a){var d=!c.some(function(b){return!(b in a)||null===a[b]});return d||b(a),d}},autoAssignScales:function(a){var b="category",c={category:"ordinal",order:"ordinal",measure:"linear"},d={};return Object.keys(a).forEach(function(e){var f=a[e],g=(f.type||b).toLowerCase();d[e]={},d[e].type=g,d[e].scale=f.scale||c[g],d[e].value=f.value}),d},autoDetectDimTypes:function(b){var c={type:"category",scale:"ordinal"},e=function(b,c){var d=c;return a.isDate(b)?(d.type="measure",d.scale="time"):a.isObject(b)?(d.type="order",d.scale="ordinal"):a.isNumber(b)&&(d.type="measure",d.scale="linear"),d},f=function(a,b){return Object.keys(b).forEach(function(f){var g=b.hasOwnProperty(f)?b[f]:null;if(a[f]=a[f]||{type:null,hasNull:!1},null===g)a[f].hasNull=!0;else{var h=e(g,d.clone(c)),i=h.type,j=h.scale,k=null!==a[f].type&&a[f].type!==i;a[f].type=k?c.type:i,a[f].scale=k?c.scale:j}}),a};return a.reduce(b,f,{})}};b.DataProcessor=e}),e("utils/layuot-template",["exports","../const"],function(a,b){var c=b.CSS_PREFIX,d=function(a,b){var d="div",e=document.createElement(d);return e.classList.add(c+a),b&&b.appendChild(e),e},e=function(){var a=d("layout"),b=d("layout__header",a),c=d("layout__container",a),e=d("layout__sidebar",c),f=d("layout__content",c),g=d("layout__content__wrap",f),h=d("layout__sidebar-right",c),i=d("layout__sidebar-right__wrap",h),j=d("layout__footer",a);return{layout:a,header:b,content:g,leftSidebar:e,rightSidebar:i,footer:j}};a.getLayout=e}),e("charts/tau.plot",["exports","../dsl-reader","../api/balloon","../event","../spec-engine-factory","../layout-engine-factory","../plugins","../utils/utils","../utils/utils-dom","../const","../unit-domain-mixin","../units-registry","../data-processor","../utils/layuot-template"],function(c,d,e,f,g,h,i,j,k,l,m,n,o,p){var q=function(a,b){a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),a.__proto__=b},r=d.DSLReader,s=e.Tooltip,t=f.Emitter,u=g.SpecEngineFactory,v=h.LayoutEngineFactory,w=i.Plugins,x=i.propagateDatumEvents,y=j.utils,z=k.utilsDom,A=l.CSS_PREFIX,B=m.UnitDomainMixin,C=n.UnitsRegistry,D=o.DataProcessor,E=p.getLayout,F=function(a){var b;if(a.unit){var c=F(a.unit[0]),d=a.guide,e=d.x.$minimalDomain||1,f=d.y.$minimalDomain||1,g=Math.max(e*d.x.density,e*c.w),h=Math.max(f*d.y.density,f*c.h);b={w:g+d.padding.l+d.padding.r,h:h+d.padding.t+d.padding.b}}else b={w:0,h:0};return b},G=function(a,b,c){var d=a.guide.x.$minimalDomain||1,e=a.guide.y.$minimalDomain||1,f=b.width/d,g=b.height/e,h=c.xMinimumDensityKoeff;if(a.guide.x.hide!==!0&&0!==a.guide.x.rotate&&f>h*a.guide.x.$maxTickTextW){a.guide.x.rotate=0,a.guide.x.textAnchor="middle",a.guide.x.tickFormatWordWrapLimit=f;var i=Math.min(c.xAxisTickLabelLimit,a.guide.x.$maxTickTextW),j=0-i+a.guide.x.$maxTickTextH;a.guide.padding.b+=a.guide.padding.b>0?j:0,a.guide.x.label.padding>i+c.xAxisPadding&&(a.guide.x.label.padding+=j)}var k={width:f,height:g};a.unit&&G(a.unit[0],k,c)},H=function(c){var d=function(a){c.call(this),this._svg=null,this._filtersStore={filters:{},tick:0},this._layout=E(),this.setupConfig(a),this._plugins=new w(this.config.plugins,this)};return q(d,c),d.prototype.setupConfig=function(b){this.config=a.defaults(b,{spec:{},data:[],plugins:[],settings:{}}),this._emptyContainer=b.emptyContainer||"",this.config.settings.specEngine=this.config.specEngine||this.config.settings.specEngine,this.config.settings.layoutEngine=this.config.layoutEngine||this.config.settings.layoutEngine,this.config.settings=this.setupSettings(this.config.settings),y.isArray(this.config.settings.specEngine)||(this.config.settings.specEngine=[{width:Number.MAX_VALUE,name:this.config.settings.specEngine}]),this.config.spec.dimensions=this.setupMetaInfo(this.config.spec.dimensions,this.config.data);var c=this.config.settings.log;this.config.settings.excludeNull&&this.addFilter({tag:"default",predicate:D.excludeNullValues(this.config.spec.dimensions,function(a){c([a,"point was excluded, because it has undefined values."],"WARN")})})},d.prototype.getConfig=function(){return this.config},d.prototype.setupMetaInfo=function(a,b){var c=a?a:D.autoDetectDimTypes(b);return D.autoAssignScales(c)},d.prototype.setupSettings=function(b){var c=d.globalSettings,e={};return Object.keys(c).forEach(function(b){e[b]=a.isFunction(c[b])?c[b]:y.clone(c[b])}),a.defaults(b||{},e)},d.prototype.insertToRightSidebar=function(a){return z.appendTo(a,this._layout.rightSidebar)},d.prototype.addBalloon=function(a){return new s("",a||{})},d.prototype.renderTo=function(c,d){this._svg=null,this._defaultSize=a.clone(d);var e=b.select(c),f=e.node();if(this._target=c,this._targetSizes=d,null===f)throw new Error("Target element not found");this._layout.content;f.appendChild(this._layout.layout),e=b.select(this._layout.content);var g=d||{};this._layout.content.innerHTML="",g.width&&g.height||(g=a.defaults(g,z.getContainerSize(this._layout.content.parentNode)));var h=this.getData();if(0===h.length)return void(this._layout.content.innerHTML=this._emptyContainer);this._targetSizes=g,this._layout.content.innerHTML="";var i=new B(this.config.spec.dimensions,h),j=a.find(this.config.settings.specEngine,function(a){return g.width<=a.width}),k=u.get(j.name,this.config.settings),l=k(this.config.spec,i.mix({})),m=F(l.unit),n=m.w,o=m.h,p=z.getScrollbarWidth(),q=g.width-n,s=g.height-o,t=q>=0?g.width:n,w=s>=0?0:p,y=s>=0?g.height:o,D=q>=0?0:p;g.height=y-D,g.width=t-w;var E=this.config.settings;G(l.unit,g,E);var H=new r(i,C),I=H.buildGraph(l),J=v.get(this.config.settings.layoutEngine)(I),K=H.calcLayout(J,g),L=H.renderGraph(K,e.append("svg").attr("class",A+"svg").attr("width",g.width).attr("height",g.height),this);this._svg=L.node(),L.selectAll(".i-role-datum").call(x(this)),this._layout.rightSidebar.style.maxHeight=g.height+"px",this.fire("render",this._svg)},d.prototype.getData=function(b){b=b||{};var c=a.chain(this._filtersStore.filters).values().flatten().reject(function(c){return a.contains(b.excludeFilter,c.tag)}).pluck("predicate").value();return a.filter(this.config.data,a.reduce(c,function(a,b){return function(c){return a(c)&&b(c)}},function(){return!0}))},d.prototype.setData=function(a){this.config.data=a,this.refresh()},d.prototype.getSVG=function(){return this._svg},d.prototype.addFilter=function(a){var b=a.tag,c=this._filtersStore.filters[b]=this._filtersStore.filters[b]||[],d=this._filtersStore.tick++;return a.id=d,c.push(a),this.refresh(),d},d.prototype.refresh=function(){this._target&&this.renderTo(this._target,this._defaultSize)},d.prototype.resize=function(a){void 0===a&&(a={}),this.renderTo(this._target,a)},d.prototype.removeFilter=function(b){var c=this;a.each(this._filtersStore.filters,function(d,e){c._filtersStore.filters[e]=a.reject(d,function(a){return a.id===b})}),this.refresh()},d}(t);c.Plot=H}),e("charts/tau.chart",["exports","./tau.plot","../utils/utils","../data-processor"],function(b,c,d,e){function f(a,b){return b.reduce(function(b,c,d){return"measure"===a[c].type&&(b.countMeasureAxis++,b.indexMeasureAxis.push(d)),"measure"!==a[c].type&&1===b.countMeasureAxis?b.status=o.WARNING:b.countMeasureAxis>1&&(b.status=o.FAIL),b},{status:o.SUCCESS,countMeasureAxis:0,indexMeasureAxis:[]})}function g(b,c){var d=m(c.x),e=m(c.y),g=f(c.dimensions,d),h=f(c.dimensions,e);d=p[g.status](d,g),e=p[h.status](e,h);for(var i=m(c.guide),j=Math.max(d.length,e.length);i.length0;o--){var q=d.pop(),r=e.pop(),s=i.pop()||{};o===j?(k.x=q,k.y=r,k.unit.push(n(b,{x:l(q),y:l(r),color:c.color,size:c.size,flip:c.flip,colorGuide:s.color})),k.guide=a.defaults(s,{x:{label:q},y:{label:r}})):k={type:"COORDS.RECT",x:l(q),y:l(r),unit:[k],guide:a.defaults(s,{x:{label:q},y:{label:r}})}}return c.spec={dimensions:c.dimensions,unit:k},c}var h=function(a,b){a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),a.__proto__=b},i=c.Plot,j=d.utils,k=e.DataProcessor,l=function(a){return a?a:null},m=function(a){return j.isArray(a)?a:[a]},n=function(a,b){return{type:a,x:b.x,y:b.y,color:b.color,guide:{color:b.colorGuide},flip:b.flip,size:b.size}},o={SUCCESS:"SUCCESS",WARNING:"WARNING",FAIL:"FAIL"},p=function(b){return b[o.SUCCESS]=function(a){return a},b[o.FAIL]=function(){throw new Error("This configuration is not supported, See http://api.taucharts.com/basic/facet.html#easy-approach-for-creating-facet-chart")},b[o.WARNING]=function(b,c){var d=b[c.indexMeasureAxis[0]],e=a.without(b,d);return e.push(d),e},b}({}),q={scatterplot:function(a){return g("ELEMENT.POINT",a)},line:function(b){var c=b.data,d=b.settings.log,e={none:function(){return null},horizontal:function(a){var b=j.isArray(a.x)?a.x:[a.x];return b[b.length-1]},vertical:function(a){var b=j.isArray(a.y)?a.y:[a.y];return b[b.length-1]},auto:function(a){var b,e=j.isArray(a.x)?a.x:[a.x],f=j.isArray(a.y)?a.y:[a.y],g=e[e.length-1],h=e.slice(0,e.length-1),i=f[f.length-1],l=f.slice(0,f.length-1),m=a.color,n=h.concat(l).concat([m]).filter(function(a){return null!==a}),o=-1,p=[[[g].concat(n),i],[[i].concat(n),g]],q=p.some(function(a,b){var e=a[0],f=a[1],g=k.isYFunctionOfX(c,e,[f]);return g.result?o=b:d(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+g.error.keyY+" values (e.g. "+g.error.errY.join(",")+")","for ("+g.error.keyX+" = "+g.error.valX+")."].join(" ")),g.result});return q?b=p[o][0][0]:(d(["All attempts are failed.","Will orient line horizontally by default.","NOTE: the [scatterplot] chart is more convenient for that data."].join(" ")),b=g),b}},f=(b.lineOrientation||"auto").toLowerCase(),h=e.hasOwnProperty(f)?e[f]:e.auto,i=h(b);return null!==i&&(b.data=a(c).sortBy(i)),g("ELEMENT.LINE",b)},bar:function(a){return a.flip=!1,g("ELEMENT.INTERVAL",a)},horizontalBar:function(a){return a.flip=!0,g("ELEMENT.INTERVAL",a)}},r=function(a){var b=function(b){b.settings=this.setupSettings(b.settings),b.dimensions=this.setupMetaInfo(b.dimensions,b.data),a.call(this,q[b.type](b))};return h(b,a),b}(i);b.Chart=r}),e("elements/coords",["exports","../utils/utils-draw","../const","../utils/utils","../matrix"],function(b,c,d,e,f){var g=c.utilsDraw,h=d.CSS_PREFIX,i=e.utils,j=f.TMatrix,k={CROSS:function(b,c,d){var e=b.domain(c),f=b.domain(d).reverse();return a(f).map(function(b){return a(e).map(function(a){var e={};return c&&(e[c]=a),d&&(e[d]=b),e})})}},l=function(a){return k[a]||function(){return[[{}]]}},m=function(b,c,d){var e=a.defaults(i.clone(b),a.pick.apply(a,[c].concat(d)));return e.guide=a.extend(i.clone(c.guide),e.guide),e},n={walk:function(b,c){var d=a.defaults(b,{$where:{}}),e=a.any(d.unit,function(a){return 0===a.type.indexOf("COORDS.")}),f=l(e?"CROSS":""),g=new j(f(d,d.x,d.y)),h=new j(g.sizeR(),g.sizeC());return g.iterate(function(b,c,e){var f=a.extend({},d.$where,e),g=a(d.unit).map(function(b){return a.extend(m(b,d,["x","y"]),{$where:f})});h.setRC(b,c,g)}),d.$matrix=h,h.iterate(function(b,d,e){a.each(e,function(a){return c(a)})}),d},draw:function(b,c){var d=b.options,e=b.guide.padding;b.x.guide=b.guide.x,b.y.guide=b.guide.y;var f=d.left+e.l,i=d.top+e.t,j=d.width-(e.l+e.r),k=d.height-(e.t+e.b);b.x.scaleObj=b.x.scaleDim&&b.scaleTo(b.x.scaleDim,[0,j],b.x.guide),b.y.scaleObj=b.y.scaleDim&&b.scaleTo(b.y.scaleDim,[k,0],b.y.guide),b.x.guide.size=j,b.y.guide.size=k;var l=[0,k+b.guide.x.padding],m=[0-b.guide.y.padding,0],n=d.container.append("g").attr("class",h+"cell cell").attr("transform",g.translate(f,i)).datum({$where:b.$where});b.x.guide.hide||g.fnDrawDimAxis.call(n,b.x,l,j),b.y.guide.hide||g.fnDrawDimAxis.call(n,b.y,m,k);var o=g.fnDrawGrid.call(n,b,k,j);b.$matrix.iterate(function(b,d,e){e.forEach(function(b){b.options=a.extend({container:o},b.options),c(b)})})}};b.coords=n}),e("elements/size",["exports"],function(b){var c=function(a){return Math.sqrt(a)},d=function(b,d,e,f){var g=a.filter(b,a.isFinite);if(0===g.length)return function(){return f};var h=1,i=0,j=Math.min.apply(null,g),k=Math.max.apply(null,g),l=c(Math.max.apply(null,[Math.abs(j),Math.abs(k),k-j]));return i=0>j?j:0,h=0===l?1:(e-d)/l,function(b){var f=null!==b?parseFloat(b):0;if(!a.isFinite(f))return e;var g=f-i;return d+c(g)*h}};b.sizeScale=d}),e("elements/point",["exports","../utils/utils-draw","../const","./size"],function(b,c,d,e){var f=(c.utilsDraw,d.CSS_PREFIX),g=e.sizeScale,h=function(b){var c=b.options,d=c.xScale,e=c.yScale,h=c.color,i=.5*a.min([b.guide.x.tickFontHeight,b.guide.y.tickFontHeight].filter(function(a){return 0!==a})),j=.5*a.min([b.guide.x.density,b.guide.y.density].filter(function(a){return 0!==a})),k=g(b.domain(b.size.scaleDim),2,j,i),l=function(){return this.attr("r",function(a){return k(a[b.size.scaleDim])}).attr("cx",function(a){return d(a[b.x.scaleDim])}).attr("cy",function(a){return e(a[b.y.scaleDim])}).attr("class",function(a){return f+"dot dot i-role-datum "+h.get(a[h.dimension])})},m=c.container.selectAll(".dot").data(b.partition());m.call(l),m.exit().remove(),m.enter().append("circle").call(l)};b.point=h}),e("utils/css-class-map",["exports","../const"],function(a,b){function c(a){return g[a-1]||g[4]}function d(a){var b=0;return a>=160&&320>a?b=1:a>=320&&480>a?b=2:a>=480&&640>a?b=3:a>=640&&(b=4),h[b]}var e=b.CSS_PREFIX,f=[1,2,3,4,5],g=f.map(function(a){return e+"line-opacity-"+a}),h=f.map(function(a){return e+"line-width-"+a});a.getLineClassesByWidth=d,a.getLineClassesByCount=c}),e("elements/line",["exports","../utils/utils-draw","./point","../const","../utils/css-class-map"],function(a,c,d,e,f){var g=(c.utilsDraw,d.point,e.CSS_PREFIX),h=f.getLineClassesByWidth,i=f.getLineClassesByCount,j=function(a){var c=a.options,d=c.xScale,e=c.yScale,f=c.color;a.size={};var j=a.groupBy(a.partition(),f.dimension),k=h(c.width),l=i(j.length),m=function(){this.attr("class",function(a){return[g+"line i-role-datum ","line",f.get(a.key),k,l].join(" ")});var a=this.selectAll("path").data(function(a){return[a.values]});a.call(p),a.enter().append("path").call(p),a.exit().remove()},n=function(b){var h=b.reduce(function(a,b){var c=b.values;return 1===c.length&&a.push(c[0]),a},[]),i=function(){return this.attr("r",1.5).attr("class",function(a){return g+"dot-line dot-line i-role-datum "+g+"dot i-role-datum "+f.get(a[f.dimension])}).attr("cx",function(b){return d(b[a.x.scaleDim])}).attr("cy",function(b){return e(b[a.y.scaleDim])})},j=c.container.selectAll(".dot-line").data(h);j.call(i),j.exit().remove(),j.enter().append("circle").call(i)},o=b.svg.line().x(function(b){return d(b[a.x.scaleDim])}).y(function(b){return e(b[a.y.scaleDim])}),p=function(){this.attr("d",o)};n(j);var q=c.container.selectAll(".line").data(j);q.call(m),q.enter().append("g").call(m),q.exit().remove()};a.line=j}),e("elements/interval",["exports","../utils/utils-draw","../const"],function(a,b,c){var d=b.utilsDraw,e=c.CSS_PREFIX,f="i-role-bar-group",g=function(a){return"measure"===a.dimType},h=function(a){var b,c,d;return g(a.dim)?(b=5,c=5,d=0):(b=a.size/a.domain().length,c=b/(a.categories.length+1),d=c),{tickWidth:b,intervalWidth:c,offsetCategory:d}},i=function(a){var b,c,i,j,k,l=a.options,m=l.xScale,n=l.yScale,o=l.color,p=a.groupBy(a.partition(),o.dimension);if(a.flip){var q,r,s,t,u;!function(){q=Math.min.apply(null,m.domain());var e=0>=q?0:q;r=h({domain:n.domain,dim:a.y,categories:p,size:l.height}),s=r.tickWidth,t=r.intervalWidth,u=r.offsetCategory,b=g(a.x)?function(b){return m(Math.min(e,b[a.x.scaleDim]))}:0,c=function(b){return n(b[a.y.scaleDim])-s/2},i=g(a.x)?function(b){return Math.abs(m(b[a.x.scaleDim])-m(e))}:function(b){return m(b[a.x.scaleDim])},j=function(){return t},k=function(a,b){return d.translate(0,b*u+u/2)}}()}else{var v,w,s,t,u;!function(){v=Math.min.apply(null,n.domain());var e=0>=v?0:v;w=h({domain:m.domain,dim:a.x,categories:p,size:l.width}),s=w.tickWidth,t=w.intervalWidth,u=w.offsetCategory,b=function(b){return m(b[a.x.scaleDim])-s/2},c=g(a.y)?function(b){return n(Math.max(e,b[a.y.scaleDim]))}:function(b){return n(b[a.y.scaleDim])},i=function(){return t},j=g(a.y)?function(b){return Math.abs(n(b[a.y.scaleDim])-n(e))}:function(b){return l.height-n(b[a.y.scaleDim])},k=function(a,b){return d.translate(b*u+u/2,0)}}()}var x=function(){return this.attr("class",function(a){return"i-role-datum bar "+e+"bar "+o.get(a[o.dimension])}).attr("x",b).attr("y",c).attr("width",i).attr("height",j)},y=function(){this.attr("class",f).attr("transform",k);var a=this.selectAll("bar").data(function(a){return a.values});a.call(x),a.enter().append("rect").call(x),a.exit().remove()},z=l.container.selectAll("."+f).data(p);z.call(y),z.enter().append("g").call(y),z.exit().remove()};a.interval=i}),e("elements/coords-parallel",["exports","../utils/utils-draw","../const","../utils/utils","../matrix"],function(c,d,e,f,g){var h=d.utilsDraw,i=(e.CSS_PREFIX,f.utils),j=g.TMatrix,k=function(b,c,d){var e=a.defaults(i.clone(b),a.pick.apply(a,[c].concat(d)));return e.guide=a.extend(i.clone(c.guide||{}),e.guide||{}),e},l={walk:function(b,c){var d=a.defaults(b,{$where:{}}),e=new j(1,1),f=new j(1,1);return e.iterate(function(b,c){var e=a.extend({},d.$where),g=a(d.unit).map(function(b){return a.extend(k(b,d,["x"]),{$where:e})});f.setRC(b,c,g)}),d.$matrix=f,f.iterate(function(b,d,e){a.each(e,function(a){return c(a)})}),d},draw:function(c,d){var e=c.options,f=c.guide.padding,g=e.left+f.l,i=e.top+f.t,j=e.width-(f.l+f.r),k=e.height-(f.t+f.b),l=c.x.map(function(a){return c.scaleTo(a,[k,0],{})}),m=e.container.append("g").attr("class","graphical-report__cell cell").attr("transform",h.translate(g,i)),n=function(a,b){return"translate("+a+","+b+")"},o=function(a){return"rotate("+a+")"},p=function(a,c){var d=this,e=b.svg.axis().scale(a).orient("left"),f=d.append("g").attr("class","y axis").attr("transform",n.apply(null,c)).call(e);f.selectAll(".tick text").attr("transform",o(0)).style("text-anchor","end")},q=j/(c.x.length-1);l.forEach(function(a,b){p.call(m,a,[b*q,0])});var r=m.append("g").attr("class","grid").attr("transform",n(0,0));c.$matrix.iterate(function(b,c,e){e.forEach(function(b){b.options=a.extend({container:r},b.options),d(b)})})}};c.CoordsParallel=l}),e("elements/coords-parallel-line",["exports","../utils/utils-draw","../const"],function(a,c,d){var e=c.utilsDraw,f=(d.CSS_PREFIX,{draw:function(a){a.color=a.dimension(a.color,a);var c=a.options,d=a.x.reduce(function(b,d){return b[d]=a.scaleTo(d,[c.height,0],{}),b},{}),f=e.generateColor(a),g=b.nest().key(function(a){return a[f.dimension]}).entries(a.partition()).map(function(b){var c=b.values[0],d=[];return a.x.forEach(function(a){d.push({key:a,val:c[a]})}),d}),h=function(){this.attr("class",function(){return"graphical-report__line line color10-9"});var a=this.selectAll("path").data(function(a){return[a]});a.call(l),a.enter().append("path").call(l),a.exit().remove()},i=c.width/(a.x.length-1),j={};a.x.forEach(function(a,b){j[a]=b*i});var k=b.svg.line().x(function(a){return j[a.key]}).y(function(a){return d[a.key](a.val)}),l=function(){this.attr("d",k)},m=c.container.selectAll(".line").data(g);m.call(h),m.enter().append("g").call(h),m.exit().remove()}});a.CoordsParallelLine=f}),e("node-map",["exports","./elements/coords","./elements/line","./elements/point","./elements/interval","./utils/utils-draw","./elements/coords-parallel","./elements/coords-parallel-line"],function(a,b,c,d,e,f,g,h){var i=b.coords,j=c.line,k=d.point,l=e.interval,m=f.utilsDraw,n=g.CoordsParallel,o=h.CoordsParallelLine,p=function(a,b){b.forEach(function(b){a[b]=a.dimension(a[b],a)});var c=a.options,d=c.width,e=c.height;return a.x.guide=a.guide.x,a.y.guide=a.guide.y,a.options.xScale=a.x.scaleDim&&a.scaleTo(a.x.scaleDim,[0,d],a.x.guide),a.options.yScale=a.y.scaleDim&&a.scaleTo(a.y.scaleDim,[e,0],a.y.guide),a.options.color=m.generateColor(a),a},q={"COORDS.RECT":{walk:i.walk,draw:function(a,b){a.x=a.dimension(a.x,a),a.y=a.dimension(a.y,a),i.draw(a,b)}},"ELEMENT.POINT":function(a){k(p(a,["x","y","color","size"]))},"ELEMENT.LINE":function(a){j(p(a,["x","y","color"]))},"ELEMENT.INTERVAL":function(a){l(p(a,["x","y","color"]))},"COORDS.PARALLEL":n,"PARALLEL/ELEMENT.LINE":o};a.nodeMap=q}),e("tau.newCharts",["exports","./utils/utils-dom","./charts/tau.plot","./charts/tau.chart","./unit-domain-mixin","./unit-domain-period-generator","./dsl-reader","./spec-engine-factory","./layout-engine-factory","./formatter-registry","./node-map","./units-registry"],function(c,d,e,f,g,h,i,j,k,l,m,n){var o=d.utilsDom,p=e.Plot,q=f.Chart,r=g.UnitDomainMixin,s=h.UnitDomainPeriodGenerator,t=i.DSLReader,u=j.SpecEngineFactory,v=k.LayoutEngineFactory,w=l.FormatterRegistry,x=m.nodeMap,y=n.UnitsRegistry,z={},A={},B={UnitDomainMixin:r,UnitDomainPeriodGenerator:s,DSLReader:t,SpecEngineFactory:u,LayoutEngineFactory:v},C={UnitsRegistry:y,tickFormat:w,d3:b,_:a,tickPeriod:s,colorBrewers:{add:function(a,b){a in z||(z[a]=b)},get:function(a){return z[a]}},plugins:{add:function(a,b){if(a in A)throw new Error("Plugins is already registred.");A[a]=b},get:function(a){return A[a]}},globalSettings:{log:function(a,b){b=b||"INFO",Array.isArray(a)||(a=[a]),console[b.toLowerCase()].apply(console,a)},excludeNull:!0,specEngine:[{name:"COMPACT",width:600},{name:"AUTO",width:Number.MAX_VALUE}],layoutEngine:"EXTRACT",getAxisTickLabelSize:o.getAxisTickLabelSize,xAxisTickLabelLimit:100,yAxisTickLabelLimit:100,xTickWordWrapLinesLimit:2,yTickWordWrapLinesLimit:3,xTickWidth:9,yTickWidth:9,distToXAxisLabel:20,distToYAxisLabel:20,xAxisPadding:20,yAxisPadding:20,xFontLabelHeight:10,yFontLabelHeight:10,xDensityKoeff:2.2,xMinimumDensityKoeff:1.1,yDensityKoeff:2.2,yMinimumDensityKoeff:1.1,defaultFormats:{measure:"x-num-auto","measure:time":"x-time-auto","measure:time:year":"year","measure:time:quarter":"quarter","measure:time:month":"month","measure:time:week":"x-time-auto","measure:time:day":"x-time-auto","measure:time:hour":"x-time-auto","measure:time:min":"x-time-auto","measure:time:sec":"x-time-auto","measure:time:ms":"x-time-auto"}}};p.globalSettings=C.globalSettings,C.UnitsRegistry.add("COORDS.PARALLEL",x["COORDS.PARALLEL"]).add("PARALLEL/ELEMENT.LINE",x["PARALLEL/ELEMENT.LINE"]).add("COORDS.RECT",x["COORDS.RECT"]).add("ELEMENT.POINT",x["ELEMENT.POINT"]).add("ELEMENT.LINE",x["ELEMENT.LINE"]).add("ELEMENT.INTERVAL",x["ELEMENT.INTERVAL"]),c.Plot=p,c.Chart=q,c.__api__=B,c.api=C}),e("underscore",function(){return a}),e("d3",function(){return b}),d("tau.newCharts")}); \ No newline at end of file diff --git a/css/legend.css b/css/legend.css index e7de4aa76..06d868c16 100644 --- a/css/legend.css +++ b/css/legend.css @@ -47,71 +47,71 @@ } .graphical-report__legend__item .color10-1 { background: #377eb8; + border: 1px solid #377eb8; } .graphical-report__legend__item.disabled .color10-1 { - border: 1px solid #377eb8; background-color: transparent; } .graphical-report__legend__item .color10-2 { background: #e41a1c; + border: 1px solid #e41a1c; } .graphical-report__legend__item.disabled .color10-2 { - border: 1px solid #e41a1c; background-color: transparent; } .graphical-report__legend__item .color10-3 { background: #4daf4a; + border: 1px solid #4daf4a; } .graphical-report__legend__item.disabled .color10-3 { - border: 1px solid #4daf4a; background-color: transparent; } .graphical-report__legend__item .color10-4 { background: #984ea3; + border: 1px solid #984ea3; } .graphical-report__legend__item.disabled .color10-4 { - border: 1px solid #984ea3; background-color: transparent; } .graphical-report__legend__item .color10-5 { background: #ff7f00; + border: 1px solid #ff7f00; } .graphical-report__legend__item.disabled .color10-5 { - border: 1px solid #ff7f00; background-color: transparent; } .graphical-report__legend__item .color10-6 { background: #e9e964; + border: 1px solid #e9e964; } .graphical-report__legend__item.disabled .color10-6 { - border: 1px solid #e9e964; background-color: transparent; } .graphical-report__legend__item .color10-7 { background: #a65628; + border: 1px solid #a65628; } .graphical-report__legend__item.disabled .color10-7 { - border: 1px solid #a65628; background-color: transparent; } .graphical-report__legend__item .color10-8 { background: #f781bf; + border: 1px solid #f781bf; } .graphical-report__legend__item.disabled .color10-8 { - border: 1px solid #f781bf; background-color: transparent; } .graphical-report__legend__item .color10-9 { background: #999999; + border: 1px solid #999999; } .graphical-report__legend__item.disabled .color10-9 { - border: 1px solid #999999; background-color: transparent; } .graphical-report__legend__item .color10-10 { background: #222222; + border: 1px solid #222222; } .graphical-report__legend__item.disabled .color10-10 { - border: 1px solid #222222; background-color: transparent; }