juijs-chart
Advanced tools
Comparing version 2.1.7-es6 to 2.1.8-es6
@@ -1,1 +0,1 @@ | ||
!function(t){function e(e){for(var r,h,s=e[0],o=e[1],l=e[2],u=0,d=[];u<s.length;u++)h=s[u],a[h]&&d.push(a[h][0]),a[h]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r]);for(c&&c(e);d.length;)d.shift()();return n.push.apply(n,l||[]),i()}function i(){for(var t,e=0;e<n.length;e++){for(var i=n[e],r=!0,s=1;s<i.length;s++){var o=i[s];0!==a[o]&&(r=!1)}r&&(n.splice(e--,1),t=h(h.s=i[0]))}return t}var r={},a={1:0},n=[];function h(e){if(r[e])return r[e].exports;var i=r[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,h),i.l=!0,i.exports}h.m=t,h.c=r,h.d=function(t,e,i){h.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},h.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},h.t=function(t,e){if(1&e&&(t=h(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(h.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)h.d(i,r,function(e){return t[e]}.bind(null,r));return i},h.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return h.d(e,"a",e),e},h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},h.p="";var s=window.webpackJsonp=window.webpackJsonp||[],o=s.push.bind(s);s.push=e,s=s.slice();for(var l=0;l<s.length;l++)e(s[l]);var c=o;n.push([68,0]),i()}({68:function(t,e,i){"use strict";i.r(e);var r=i(2),a=i.n(r).a,n={name:"chart.brush.bar",extend:"chart.brush.core",component:function(){var t=a.include("util.base"),e=function(){var e,i,r,a,n;this.getBarStyle=function(){return{borderColor:this.chart.theme("barBorderColor"),borderWidth:this.chart.theme("barBorderWidth"),borderOpacity:this.chart.theme("barBorderOpacity"),borderRadius:this.chart.theme("barBorderRadius"),disableOpacity:this.chart.theme("barDisableBackgroundOpacity"),circleColor:this.chart.theme("barPointBorderColor")}},this.getBarElement=function(e,i,r){var a=this.getBarStyle(),n=this.color(e,i),h=this.getData(e)[this.brush.target[i]],s=this.chart.svg.pathRect({width:r.width,height:r.height,fill:n,stroke:a.borderColor,"stroke-width":a.borderWidth,"stroke-opacity":a.borderOpacity});return 0!=h&&this.addEvent(s,e,i),null==this.barList&&(this.barList=[]),this.barList.push(t.extend({element:s,color:n},r)),s},this.setActiveEffect=function(t){for(var e=this.getBarStyle(),i=this.barList,r=0;r<i.length;r++){var a=i[r]==t?1:e.disableOpacity;i[r].element.attr({opacity:a}),i[r].minmax&&i[r].minmax.style(i[r].color,e.circleColor,a)}},this.drawBefore=function(){var t=this.brush.outerPadding,h=this.brush.innerPadding,s=this.brush.target.length;e=this.chart.svg.group(),i=this.axis.x(0),r=this.axis.y.rangeBand(),this.brush.size>0?(n=this.brush.size,a=n*s+(s-1)*h):n=(n=((a=r-2*t)-(s-1)*h)/s)<0?0:n},this.drawETC=function(e){if(t.typeCheck("array",this.barList)){var i=this,r=this.getBarStyle();this.active=this.drawTooltip(),e.append(this.active.tooltip);for(var a=0;a<this.barList.length;a++){var n=this.barList[a],h=this.brush.display;("max"==h&&n.max||"min"==h&&n.min||"all"==h)&&(n.minmax=this.drawTooltip(n.color,r.circleColor,1),n.minmax.control(n.position,n.tooltipX,n.tooltipY,this.format(n.value)),e.append(n.minmax.tooltip)),0!=n.value&&null!=this.brush.activeEvent&&function(t){i.active.style(t.color,r.circleColor,1),t.element.on(i.brush.activeEvent,function(e){i.active.style(t.color,r.circleColor,1),i.active.control(t.position,t.tooltipX,t.tooltipY,i.format(t.value)),i.setActiveEffect(t)}),t.element.attr({cursor:"pointer"})}(n)}null!=(n=this.barList[this.brush.active])&&(this.active.style(n.color,r.circleColor,1),this.active.control(n.position,n.tooltipX,n.tooltipY,this.format(n.value)),this.setActiveEffect(n))}},this.draw=function(){var t=this.getXY(),r=this.getBarStyle();return this.eachData(function(h,s){for(var o=this.offset("y",s)-a/2,l=0;l<this.brush.target.length;l++){var c=h[this.brush.target[l]],u=this.axis.x(c),d=o+n/2,p=u>=i?"right":"left";Math.abs(i-u)<this.brush.minSize&&(u="right"==p?u+this.brush.minSize:u-this.brush.minSize);var f=Math.abs(i-u),g=f<r.borderRadius||n<r.borderRadius?0:r.borderRadius,v=this.getBarElement(s,l,{width:f,height:n,value:c,tooltipX:u,tooltipY:d,position:p,max:t[l].max[s],min:t[l].min[s]});u>=i?(v.round(f,n,0,g,g,0),v.translate(i,o)):(v.round(f,n,g,0,0,g),v.translate(i-f,o)),e.append(v),o+=n+this.brush.innerPadding}}),this.drawETC(e),e},this.drawAnimate=function(t){var e=this.chart.svg,i=this.brush.animate;t.append(e.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.4s",repeatCount:"1",fill:"freeze"})),t.each(function(t,r){if(r.is("util.svg.element.path")){var a=r.data("translate").split(","),n=parseInt(a[0]),h=parseInt(a[1]),s=parseInt(r.attr("width")),o="right"==i?n+s:n-s;r.append(e.animateTransform({attributeName:"transform",type:"translate",from:o+" "+h,to:n+" "+h,begin:"0s",dur:"0.7s",repeatCount:"1",fill:"freeze"}))}})}};return e.setup=function(){return{size:0,minSize:0,outerPadding:2,innerPadding:1,active:null,activeEvent:null,display:null,format:null}},e}},h={name:"chart.brush.stackbar",extend:"chart.brush.bar",component:function(){var t=a.include("util.base"),e=function(e,i,r){var a,n;this.addBarElement=function(t){null==this.barList&&(this.barList=[]),this.barList.push(t)},this.getBarElement=function(t,e){var i=this.getBarStyle(),r=this.color(e),a=this.getData(t)[this.brush.target[e]],n=this.chart.svg.rect({fill:r,stroke:i.borderColor,"stroke-width":i.borderWidth,"stroke-opacity":i.borderOpacity});return 0==a&&n.attr({display:"none"}),0!=a&&this.addEvent(n,t,e),n},this.setActiveEffect=function(e){for(var i=this.getBarStyle(),r=this.barList,a=this.stackTooltips,n=0;n<r.length;n++){var h=e==r[n]?1:i.disableOpacity;a&&(1==h||-1!=t.inArray(n,this.tooltipIndexes)?a[n].attr({opacity:1}):a[n].attr({opacity:0})),r[n].attr({opacity:h})}},this.setActiveEffectOption=function(){var t=this.brush.active;this.barList&&this.barList[t]&&this.setActiveEffect(this.barList[t])},this.setActiveEvent=function(t){var e=this;t.on(e.brush.activeEvent,function(i){e.setActiveEffect(t)})},this.setActiveEventOption=function(t){null!=this.brush.activeEvent&&(this.setActiveEvent(t),t.attr({cursor:"pointer"}))},this.getTargetSize=function(){var t=this.axis.y.rangeBand();if(this.brush.size>0)return this.brush.size;var e=t-2*this.brush.outerPadding;return e<this.brush.minSize?this.brush.minSize:e},this.setActiveTooltips=function(t,e){for(var i=this.brush.display,r="min"==i?t:e,a=0;a<this.stackTooltips.length;a++)a!=r&&"all"!=i||(this.stackTooltips[a].css({opacity:1}),this.tooltipIndexes.push(a))},this.drawStackTooltip=function(t,e,i,r,a,n){var h=this.chart.theme("tooltipPointFontSize"),s="middle",o=0,l=0;"left"==n?(s="start",o=3,l=h/3):"right"==n?(s="end",o=-3,l=h/3):l="top"==n?-h/3:h;var c=this.chart.text({fill:this.chart.theme("tooltipPointFontColor"),"font-size":h,"font-weight":this.chart.theme("tooltipPointFontWeight"),"text-anchor":s,dx:o,dy:l,opacity:0}).text(this.format(i)).translate(r,a);this.stackTooltips[e]=c,t.append(c)},this.drawStackEdge=function(t){for(var e=this.chart.theme("barStackEdgeBorderWidth"),i=1;i<this.edgeData.length;i++)for(var r=this.edgeData[i-1],a=this.edgeData[i],n=0;n<this.brush.target.length;n++)a[n].width>0&&a[n].height>0&&t.append(this.svg.line({x1:r[n].x+r[n].width-r[n].ex,x2:a[n].x+a[n].dx-a[n].ex,y1:r[n].y+r[n].height-r[n].ey,y2:a[n].y+a[n].dy,stroke:a[n].color,"stroke-width":e}))},this.drawBefore=function(){a=e.svg.group(),i.y.rangeBand(),n=this.getTargetSize(),this.stackTooltips=[],this.tooltipIndexes=[],this.edgeData=[]},this.draw=function(){var h=null,s=0,o=null,l=this.axis.x.max(),c=this.axis.get("x").reverse;return this.eachData(function(u,d){for(var p=e.svg.group(),f=this.offset("y",d),g=f-n/2,v=i.x(0),m=0,x=0,y=0;y<r.target.length;y++){var b=u[r.target[y]]+m,w=i.x(b),k={x:v<w?v:w,y:g,width:Math.abs(v-w),height:n},B=this.getBarElement(d,y).attr(k);this.edgeData[d]||(this.edgeData[d]={}),this.edgeData[d][y]=t.extend({color:this.color(y),dx:k.width,dy:0,ex:c?k.width:0,ey:0},k),v=w,m=b,x+=u[r.target[y]],p.append(B)}x>s&&(s=x,h=d),x<l&&(l=x,o=d),this.drawStackTooltip(p,d,x,v,f,c?"right":"left"),this.setActiveEventOption(p),this.addBarElement(p),a.append(p)}),this.brush.edge&&this.drawStackEdge(a),null!=this.brush.display&&this.setActiveTooltips(o,h),this.setActiveEffectOption(),a}};return e.setup=function(){return{outerPadding:15,edge:!1}},e}},s={name:"chart.brush.fullstackbar",extend:"chart.brush.stackbar",component:function(){a.include("util.base");var t=function(t,e,i){var r,a;this.drawBefore=function(){r=t.svg.group(),e.x(0),e.y.rangeBand(),a=this.getTargetSize()},this.drawText=function(t,e,i){return this.chart.text({"font-size":this.chart.theme("barFontSize"),fill:this.chart.theme("barFontColor"),x:e,y:i,"text-anchor":"middle"},t+"%")},this.draw=function(){return this.eachData(function(n,h){for(var s=t.svg.group(),o=this.offset("y",h)-a/2,l=0,c=[],u=0;u<i.target.length;u++){l+=f=n[i.target[u]],c.push(f)}var d=0,p=e.x.max();for(u=c.length-1;u>=0;u--){var f=e.x.rate(c[u],l),g=this.getBarElement(h,u);if(g.attr({x:d,y:o,width:f,height:a}),s.append(g),i.showText){var v=Math.round(c[u]/l*p),m=d+f/2,x=o+a/2+5;s.append(this.drawText(v,m,x))}this.setActiveEventOption(s),d+=f}this.addBarElement(s),r.append(s)}),this.setActiveEffectOption(),r}};return t.setup=function(){return{outerPadding:15,showText:!1}},t}},o={name:"chart.brush.rangebar",extend:"chart.brush.core",component:function(){var t=function(t,e,i){var r,a,n,h,s,o,l,c,u;this.drawBefore=function(){r=t.svg.group(),s=i.outerPadding,o=i.innerPadding,a=e.y.rangeBand(),h=((n=a-2*s)-(i.target.length-1)*o)/i.target.length,l=t.theme("barBorderColor"),c=t.theme("barBorderWidth"),u=t.theme("barBorderOpacity")},this.draw=function(){return this.eachData(function(a,s){for(var d=t.svg.group(),p=this.offset("y",s)-n/2,f=0;f<i.target.length;f++){var g=a[i.target[f]],v=e.x(g[1]),m=e.x(g[0]),x=t.svg.rect({x:m,y:p,height:h,width:Math.abs(m-v),fill:this.color(f),stroke:l,"stroke-width":c,"stroke-opacity":u});this.addEvent(x,s,f),d.append(x),p+=h+o}r.append(d)}),r}};return t.setup=function(){return{outerPadding:2,innerPadding:1}},t}},l={name:"chart.brush.column",extend:"chart.brush.bar",component:function(){return function(){var t,e,i,r,a;this.drawBefore=function(){var n=this.brush.outerPadding,h=this.brush.innerPadding,s=this.brush.target.length;t=this.chart.svg.group(),e=this.axis.y(0),i=this.axis.x.rangeBand(),this.brush.size>0?(r=this.brush.size,a=r*s+(s-1)*h):(a=i-2*n,r=(r=(i-2*n-(s-1)*h)/s)<0?0:r)},this.draw=function(){var i=this.getXY(),n=this.getBarStyle();return this.eachData(function(h,s){for(var o=this.offset("x",s)-a/2,l=0;l<this.brush.target.length;l++){var c=h[this.brush.target[l]],u=o+r/2,d=this.axis.y(c),p=d<=e?"top":"bottom";Math.abs(e-d)<this.brush.minSize&&(d="top"==p?d-this.brush.minSize:d+this.brush.minSize);var f=Math.abs(e-d),g=r<n.borderRadius||f<n.borderRadius?0:n.borderRadius,v=this.getBarElement(s,l,{width:r,height:f,value:c,tooltipX:u,tooltipY:d,position:p,max:i[l].max[s],min:i[l].min[s]});d<=e?(v.round(r,f,g,g,0,0),v.translate(o,d)):(v.round(r,f,0,0,g,g),v.translate(o,e)),t.append(v),o+=r+this.brush.innerPadding}}),this.drawETC(t),t},this.drawAnimate=function(t){var e=this.chart.svg,i=this.brush.animate;t.append(e.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.4s",repeatCount:"1",fill:"freeze"})),t.each(function(t,r){if(r.is("util.svg.element.path")){var a=r.data("translate").split(","),n=parseInt(a[0]),h=parseInt(a[1]),s=parseInt(r.attr("height")),o="top"==i?h-s:h+s;r.append(e.animateTransform({attributeName:"transform",type:"translate",from:n+" "+o,to:n+" "+h,begin:"0s",dur:"0.7s",repeatCount:"1",fill:"freeze"}))}})}}}},c={name:"chart.brush.stackcolumn",extend:"chart.brush.stackbar",component:function(){var t=a.include("util.base");return function(e,i,r){var a,n;this.getTargetSize=function(){var t=this.axis.x.rangeBand();if(this.brush.size>0)return this.brush.size;var e=t-2*this.brush.outerPadding;return e<this.brush.minSize?this.brush.minSize:e},this.drawBefore=function(){a=e.svg.group(),i.y(0),n=this.getTargetSize(),this.stackTooltips=[],this.tooltipIndexes=[],this.edgeData=[]},this.draw=function(){var h=null,s=0,o=null,l=this.axis.y.max(),c=this.axis.get("y").reverse;return this.eachData(function(u,d){for(var p=e.svg.group(),f=this.offset("x",d),g=f-n/2,v=i.y(0),m=0,x=0,y=0;y<r.target.length;y++){var b=u[r.target[y]]+m,w=i.y(b),k={x:g,y:v>w?w:v,width:n,height:Math.abs(v-w)},B=this.getBarElement(d,y).attr(k);this.edgeData[d]||(this.edgeData[d]={}),this.edgeData[d][y]=t.extend({color:this.color(y),dx:0,dy:c?k.height:0,ex:0,ey:c?0:k.height},k),v=w,m=b,x+=u[r.target[y]],p.append(B)}x>s&&(s=x,h=d),x<l&&(l=x,o=d),this.drawStackTooltip(p,d,x,f,v,c?"bottom":"top"),this.setActiveEventOption(p),this.addBarElement(p),a.append(p)}),this.brush.edge&&this.drawStackEdge(a),null!=this.brush.display&&this.setActiveTooltips(o,h),this.setActiveEffectOption(),a}}}},u={name:"chart.brush.fullstackcolumn",extend:"chart.brush.fullstackbar",component:function(){return function(t,e,i){var r,a;this.getTargetSize=function(){var t=this.axis.x.rangeBand(),e=0;return(e=this.brush.size>0?this.brush.size:t-2*this.brush.outerPadding)<0?0:e},this.drawBefore=function(){r=t.svg.group(),e.y(0),a=this.getTargetSize()},this.draw=function(){var n=e.area("height");return this.eachData(function(h,s){for(var o=t.svg.group(),l=this.offset("x",s)-a/2,c=0,u=[],d=0;d<i.target.length;d++)c+=g=h[i.target[d]],u.push(g);var p=0,f=e.y.max();for(d=u.length-1;d>=0;d--){var g=n-e.y.rate(u[d],c),v=this.getBarElement(s,d);if(isNaN(l)||isNaN(p)||isNaN(g)||v.attr({x:l,y:p,width:a,height:g}),o.append(v),i.showText){var m=Math.round(u[d]/c*f),x=l+a/2,y=p+g/2+8;isNaN(x)||isNaN(y)||o.append(this.drawText(m,x,y))}this.setActiveEventOption(o),p+=g}this.addBarElement(o),r.append(o)}),this.setActiveEffectOption(),r}}}},d={name:"chart.brush.rangecolumn",extend:"chart.brush.core",component:function(){var t=function(t,e,i){var r,a,n,h,s,o,l,c,u;this.drawBefore=function(){r=t.svg.group(),s=i.outerPadding,o=i.innerPadding,a=e.x.rangeBand(),h=a-2*s,n=(a-2*s-(i.target.length-1)*o)/i.target.length,l=t.theme("columnBorderColor"),c=t.theme("columnBorderWidth"),u=t.theme("columnBorderOpacity")},this.draw=function(){return this.eachData(function(a,s){for(var d=this.offset("x",s)-h/2,p=0;p<i.target.length;p++){var f=a[i.target[p]],g=e.y(f[1]),v=e.y(f[0]),m=t.svg.rect({x:d,y:g,width:n,height:Math.abs(v-g),fill:this.color(p),stroke:l,"stroke-width":c,"stroke-opacity":u});this.addEvent(m,s,p),r.append(m),d+=n+o}}),r}};return t.setup=function(){return{outerPadding:2,innerPadding:1}},t}},p={name:"chart.brush.line",extend:"chart.brush.core",component:function(){var t=a.include("util.base"),e=function(){var e,i,r,a,n,h;this.setActiveEffect=function(t){for(var e=this.lineList,a=0;a<e.length;a++){var n=t==e[a].element?h:r,s=e[a].element.get(0).attr("stroke");null!=e[a].tooltip&&e[a].tooltip.style(s,i,n),e[a].element.attr({opacity:n})}},this.addLineElement=function(t){this.lineList||(this.lineList=[]),this.lineList.push(t)},this.createLine=function(e,i){var r=e.x,h=e.y,s=e.value,o="curve"==this.brush.symbol?this.curvePoints(r):null,l="curve"==this.brush.symbol?this.curvePoints(h):null,c=null,u=null,d={"stroke-width":a,"stroke-dasharray":n,fill:"transparent",cursor:null!=this.brush.activeEvent?"pointer":"normal"},p=this.svg.group(),f=null;if(e.length>0)for(var g=null,v=null,m=0;m<r.length-1;m++)if(t.typeCheck(["undefined","null"],s[m])||(g=m),t.typeCheck(["undefined","null"],s[m+1])||(v=m+1),null!=g&&null!=v&&g!=v){var x=this.color(m,i),y=this.getOpacity(m);if(c!=x||u!=y?((f=this.svg.path(t.extend({"stroke-opacity":y,stroke:x,x1:r[g]},d))).css({"pointer-events":"stroke"}),f.MoveTo(r[g],h[g]),p.append(f),c=x,u=y):f.attr({x2:r[v]}),"curve"==this.brush.symbol)f.CurveTo(o.p1[g],l.p1[g],o.p2[g],l.p2[g],r[v],h[v]);else{if("step"==this.brush.symbol){var b=r[g]+(r[v]-r[g])/2;f.LineTo(b,h[g]),f.LineTo(b,h[v])}f.LineTo(r[v],h[v])}}return p},this.createTooltip=function(t,e,r){for(var a=this.brush.display,n=0;n<e.x.length;n++)if("max"==a&&e.max[n]||"min"==a&&e.min[n]||"all"==a){var s="max"==a&&e.max[n]?"top":"bottom",o=this.lineList[r].tooltip;if("all"==a||null==o){var l=this.drawTooltip(this.color(r),i,h);l.control(s,+e.x[n],+e.y[n],this.format(e.value[n])),t.append(l.tooltip),this.lineList[r].tooltip=l}}},this.getOpacity=function(e){var i=this.brush.opacity,r=this.chart.theme("lineBorderOpacity");return t.typeCheck("function",i)&&t.typeCheck("number",e)?i.call(this.chart,this.getData(e),e):t.typeCheck("number",i)?i:r},this.drawLine=function(t){for(var i=this,r=0;r<t.length;r++){var a=this.createLine(t[r],r);this.addEvent(a,null,r),e.append(a),this.addLineElement({element:a,tooltip:null}),null!=this.brush.display&&this.createTooltip(e,t[r],r),null!=this.brush.activeEvent&&function(t){t.on(i.brush.activeEvent,function(e){i.setActiveEffect(t)})}(a)}for(r=0;r<t.length;r++)this.brush.active==this.brush.target[r]&&this.setActiveEffect(this.lineList[r].element);return e},this.drawBefore=function(){e=this.chart.svg.group(),i=this.chart.theme("linePointBorderColor"),r=this.chart.theme("lineDisableBorderOpacity"),a=this.chart.theme("lineBorderWidth"),n=this.chart.theme("lineBorderDashArray"),h=this.getOpacity(null)},this.draw=function(){return this.drawLine(this.getXY())},this.drawAnimate=function(t){var e=this.chart.svg;t.each(function(t,i){if(i.is("util.svg.element.path")){var r=i.attributes["stroke-dasharray"],a=i.length();"none"==r?(i.attr({"stroke-dasharray":a}),i.append(e.animate({attributeName:"stroke-dashoffset",from:a,to:"0",begin:"0s",dur:"1s",repeatCount:"1"}))):i.append(e.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.5s",repeatCount:"1",fill:"freeze"}))}})}};return e.setup=function(){return{symbol:"normal",active:null,activeEvent:null,display:null,opacity:null}},e}},f={name:"chart.brush.area",extend:"chart.brush.line",component:function(){var t=a.include("util.base"),e=function(){this.drawArea=function(e){for(var i=this.chart.svg.group(),r=this.axis.y(this.brush.startZero?0:this.axis.y.min()),a=t.typeCheck("number",this.brush.opacity)?this.brush.opacity:this.chart.theme("areaBackgroundOpacity"),n=0;n<e.length;n++){for(var h=this.createLine(e[n],n).children,s=0;s<h.length;s++){var o=h[s];t.typeCheck("function",this.brush.opacity)&&(a=o.attr("stroke-opacity")),e[n].length>0&&(o.LineTo(o.attr("x2"),r),o.LineTo(o.attr("x1"),r),o.ClosePath()),o.attr({fill:o.attr("stroke"),"fill-opacity":a,"stroke-width":0}),i.prepend(o)}this.brush.line&&i.prepend(this.createLine(e[n],n)),this.addEvent(i,null,n)}return i},this.draw=function(){return this.drawArea(this.getXY())},this.drawAnimate=function(t){t.append(this.chart.svg.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.5s",repeatCount:"1",fill:"freeze"}))}};return e.setup=function(){return{symbol:"normal",active:null,activeEvent:null,display:null,startZero:!0,line:!0}},e}},g={name:"chart.brush.scatter",extend:"chart.brush.core",component:function(){var t=a.include("util.base"),e=function(){this.getSymbolType=function(e,i){var r=this.brush.symbol,a=this.brush.target[e];if(t.typeCheck("function",r)){var n=r.apply(this.chart,[a,i]);return"triangle"==n||"cross"==n||"rectangle"==n||"rect"==n||"circle"==n?{type:"default",uri:n}:{type:"image",uri:n}}return{type:"default",uri:r}},this.createScatter=function(t,e,i,r){var a=this,n=null,h=this.brush.size,s=this.brush.size,o=this.color(e,i),l=this.chart.theme("scatterBorderColor"),c=this.chart.theme("scatterBorderWidth"),u=this.brush.opacity;return"image"==r.type?n=this.chart.svg.image({"xlink:href":r.uri,width:h+c,height:s+c,x:t.x-h/2-c,y:t.y-s/2}):(n="triangle"==r.uri||"cross"==r.uri?this.chart.svg.group({width:h,height:s,opacity:u},function(){"triangle"==r.uri?a.chart.svg.polygon().point(0,s).point(h,s).point(h/2,0):(a.chart.svg.line({stroke:o,"stroke-width":2*c,x1:0,y1:0,x2:h,y2:s}),a.chart.svg.line({stroke:o,"stroke-width":2*c,x1:0,y1:h,x2:s,y2:0}))}).translate(t.x-h/2,t.y-s/2):"rectangle"==r.uri||"rect"==r.uri?this.chart.svg.rect({width:h,height:s,x:t.x-h/2,y:t.y-s/2,opacity:u}):this.chart.svg.ellipse({rx:h/2,ry:s/2,cx:t.x,cy:t.y,opacity:u}),"cross"!=r.uri&&n.attr({fill:o,stroke:l,"stroke-width":c}).hover(function(){if(n!=a.activeScatter){var t={fill:a.chart.theme("scatterHoverColor"),stroke:o,"stroke-width":2*c,opacity:u};if(a.brush.hoverSync)for(var i=0;i<a.cachedSymbol[e].length;i++)t.stroke=a.color(e,i),a.cachedSymbol[e][i].attr(t);else n.attr(t)}},function(){if(n!=a.activeScatter){var t={fill:o,stroke:l,"stroke-width":c,opacity:a.brush.hide?0:u};if(a.brush.hoverSync)for(var i=0;i<a.cachedSymbol[e].length;i++)t.fill=a.color(e,i),a.cachedSymbol[e][i].attr(t);else n.attr(t)}})),n},this.drawScatter=function(e){this.cachedSymbol={};for(var i=this,r=this.chart.svg.group(),a=this.chart.theme("scatterBorderColor"),n=this.chart.theme("scatterBorderWidth"),h=this.brush.opacity,s=!1,o=0;o<e.length;o++)for(var l=0;l<e[o].length;l++)if(this.cachedSymbol[l]||(this.cachedSymbol[l]=[]),!this.brush.hideZero||0!==e[o].value[l]){var c={x:e[o].x[l],y:e[o].y[l],max:e[o].max[l],min:e[o].min[l],value:e[o].value[l]};if(!t.typeCheck(["undefined","null"],c.value)){var u=this.getSymbolType(o,c.value),d=this.createScatter(c,l,o,u),p=this.brush.display;"default"==u.type&&"cross"!=u.uri&&this.cachedSymbol[l].push(d),("max"==p&&c.max||"min"==p&&c.min||"all"==p)&&("all"!=p&&s||(r.append(this.drawTooltip(c.x,c.y,this.format(c.value))),s=!0)),null!=this.brush.activeEvent&&function(t,e,r,s){var o=e.x,l=e.y,c=i.format(e.value);t.on(i.brush.activeEvent,function(e){"default"==s.type&&"cross"!=s.uri&&(null!=i.activeScatter&&i.activeScatter.attr({fill:i.activeScatter.attributes.stroke,stroke:a,"stroke-width":n,opacity:i.brush.hide?0:h}),i.activeScatter=t,i.activeScatter.attr({fill:i.chart.theme("scatterHoverColor"),stroke:r,"stroke-width":2*n,opacity:h})),i.activeTooltip.html(c),i.activeTooltip.translate(o,l)}),t.attr({cursor:"pointer"})}(d,c,this.color(l,o),this.getSymbolType(o,c.value)),this.brush.hide&&d.attr({opacity:0}),this.addEvent(d,l,o),r.append(d)}}return this.activeTooltip=this.drawTooltip(0,0,""),r.append(this.activeTooltip),r},this.drawTooltip=function(t,e,i){return this.chart.text({y:-this.brush.size,"text-anchor":"middle",fill:this.chart.theme("tooltipPointFontColor"),"font-size":this.chart.theme("tooltipPointFontSize"),"font-weight":this.chart.theme("tooltipPointFontWeight"),opacity:this.brush.opacity},i).translate(t,e)},this.draw=function(){return this.drawScatter(this.getXY())},this.drawAnimate=function(){var t=this.chart.area();return this.chart.svg.animateTransform({attributeName:"transform",type:"translate",from:t.x+" "+t.height,to:t.x+" "+t.y,begin:"0s",dur:"0.4s",repeatCount:"1"})}};return e.setup=function(){return{symbol:"circle",size:7,hide:!1,hideZero:!1,hoverSync:!1,activeEvent:null,display:null,opacity:1,clip:!1}},e}},v={name:"chart.brush.bubble",extend:"chart.brush.core",component:function(){var t=a.include("util.base"),e=a.include("util.math"),i=function(){var i=this,r=null,a=null;this.getFormatText=function(e,i){return t.typeCheck("function",this.brush.format)?this.format(this.axis.data[i]):e},this.getBubbleRadius=function(i,n){var h=this.brush.scaleKey;if(null!=h){var s=this.axis.data[n][h];i=t.typeCheck("number",s)?s:i}return e.scaleValue(i,r,a,this.brush.min,this.brush.max)},this.createBubble=function(t,e,i){var r=this.getBubbleRadius(t.value,i),a=this.svg.group().translate(t.x,t.y);if(a.append(this.svg.circle({r:r,fill:e,"fill-opacity":this.chart.theme("bubbleBackgroundOpacity"),stroke:e,"stroke-width":this.chart.theme("bubbleBorderWidth")})),this.brush.showText){var n=this.getFormatText(t.value,i);a.append(this.chart.text({"font-size":this.chart.theme("bubbleFontSize"),fill:this.chart.theme("bubbleFontColor"),"text-anchor":"middle",dy:3}).text(n))}return this.bubbleList.push(a),a},this.setActiveEffect=function(t){for(var e=this.bubbleList,i=0;i<e.length;i++){var r=e[i]==t?1:this.chart.theme("bubbleBackgroundOpacity");e[i].get(0).attr({opacity:r}),e[i].get(1).attr({opacity:r})}},this.drawBubble=function(t){for(var e=this.svg.group(),r=0;r<t.length;r++)for(var a=0;a<t[r].x.length;a++){var n=this.createBubble({x:t[r].x[a],y:t[r].y[a],value:t[r].value[a]},this.color(a,r),a);null!=this.brush.activeEvent&&function(t){t.on(i.brush.activeEvent,function(e){i.setActiveEffect(t)}),t.attr({cursor:"pointer"})}(n),this.addEvent(n,a,r),e.append(n)}var h=this.bubbleList[this.brush.active];return null!=h&&this.setActiveEffect(h),e},this.drawBefore=function(){var t=this.brush.scaleKey;if(null!=t){for(var e=[],i=0;i<this.axis.data.length;i++)e.push(this.axis.data[i][t]);r=Math.min.apply(this,e),a=Math.max.apply(this,e)}else r=this.axis.y.min(),a=this.axis.y.max();this.bubbleList=[]},this.draw=function(){return this.drawBubble(this.getXY())},this.drawAnimate=function(t){t.each(function(t,e){var r=e.children[0];r.append(i.svg.animateTransform({attributeType:"xml",attributeName:"transform",type:"scale",from:"0",to:"1",dur:"0.7s",fill:"freeze",repeatCount:"1"})),r.append(i.svg.animate({attributeType:"xml",attributeName:"fill-opacity",from:"0",to:i.chart.theme("bubbleBackgroundOpacity"),dur:"1.4s",repeatCount:"1",fill:"freeze"}))})}};return i.setup=function(){return{min:5,max:30,scaleKey:null,showText:!1,format:null,active:null,activeEvent:null}},i}},m={name:"chart.brush.pie",extend:"chart.brush.core",component:function(){var t=a.include("util.base"),e=a.include("util.math"),i=a.include("util.color"),r=function(){var r,a=this,n=0,h=0,s=1,o={};this.setActiveEvent=function(t,i,r,a){var n=this.chart.theme("pieActiveDistance"),h=Math.cos(e.radian(a))*n,s=Math.sin(e.radian(a))*n;t.translate(i+h,r+s)},this.setActiveTextEvent=function(t,i,r,a,n,h){var s=h?this.chart.theme("pieActiveDistance"):0,o=i+Math.cos(e.radian(a))*((n+s)/2),l=r+Math.sin(e.radian(a))*((n+s)/2);t.translate(o,l)},this.getFormatText=function(t,e,i){var r=t;return"function"==typeof this.brush.format?this.format(r,e,i):e?r+": "+this.format(e):r},this.drawPie=function(t,i,r,a,n,h){var s=this.chart.svg.group();if(360==n){var o=this.chart.svg.circle({cx:t,cy:i,r:r,fill:h,stroke:this.chart.theme("pieBorderColor")||h,"stroke-width":this.chart.theme("pieBorderWidth")});return s.append(o),s}var l=this.chart.svg.path({fill:h,stroke:this.chart.theme("pieBorderColor")||h,"stroke-width":this.chart.theme("pieBorderWidth")}),c=e.rotate(0,-r,e.radian(a)),u=c.x,d=c.y;return l.MoveTo(u,d),c=e.rotate(u,d,e.radian(n)),s.translate(t,i),l.Arc(r,r,0,n>180?1:0,1,c.x,c.y).LineTo(0,0).ClosePath(),s.append(l),s.order=1,s},this.drawPie3d=function(t,i,r,a,n,h){var s=this.chart.svg.group(),o=this.chart.svg.path({fill:h,stroke:this.chart.theme("pieBorderColor")||h,"stroke-width":this.chart.theme("pieBorderWidth")}),l=e.rotate(0,-r,e.radian(a)),c=l.x,u=l.y;o.MoveTo(c,u),l=e.rotate(c,u,e.radian(n)),s.translate(t,i),o.Arc(r,r,0,n>180?1:0,1,l.x,l.y);var d=l.y+10,p=l.x+5,f=c+5,g=u+10;return o.LineTo(p,d),o.Arc(r,r,0,n>180?1:0,0,f,g),o.ClosePath(),s.append(o),s.order=1,s},this.drawText=function(t,i,r,a,o){var l=this.svg.group({visibility:this.brush.showText?"visible":"hidden"}),c=r+90>180;if(""===o||!o)return l;if("inside"==this.brush.showText){var u=t+Math.cos(e.radian(r))*(a/2),d=i+Math.sin(e.radian(r))*(a/2);(o=this.chart.text({"font-size":this.chart.theme("pieInnerFontSize"),fill:this.chart.theme("pieInnerFontColor"),"text-anchor":"middle",y:3},o)).translate(u,d),l.append(o),l.order=2}else{var p=this.chart.theme("pieOuterLineRate");if(Math.abs(r-n)<2)0==h&&(h=p),h-=.05*p,s-=.25;else h=p,s=1;if(h>1.2){var f=this.chart.theme("pieOuterLineSize"),g=a*h,v=(u=t+Math.cos(e.radian(r))*a,d=i+Math.sin(e.radian(r))*a,t+Math.cos(e.radian(r))*g),m=i+Math.sin(e.radian(r))*g,x=c?v-f:v+f,y=this.svg.path({fill:"transparent",stroke:this.chart.theme("pieOuterLineColor"),"stroke-width":this.chart.theme("pieOuterLineWidth"),"stroke-opacity":s});y.MoveTo(u,d).LineTo(v,m).LineTo(x,m),(o=this.chart.text({"font-size":this.chart.theme("pieOuterFontSize"),fill:this.chart.theme("pieOuterFontColor"),"fill-opacity":s,"text-anchor":c?"end":"start",y:3},o)).translate(x+(c?-3:3),m),l.append(o),l.append(y),l.order=0,n=r}}return l},this.drawUnit=function(e,r,n){for(var h=this.getProperty(e),s=h.centerX,l=h.centerY,c=h.outerRadius,u=this.brush.target,d=this.brush.active,p=0,f=0,g=0;g<u.length;g++)f+=r[u[g]];for(g=0;g<u.length;g++)if(0!=r[u[g]]){var v=(x=r[u[g]])/f*360;if(this.brush["3d"]){var m=this.drawPie3d(s,l,c,p,v,i.darken(this.color(g),.5));n.append(m)}p+=v}p=0;for(g=0;g<u.length;g++){var x,y=p+(v=(x=r[u[g]])/f*360)/2-90,b=360==Math.abs(p-v),w=this.drawPie(s,l,c,p,v,this.color(g)),k=this.drawText(s,l,y,c,this.getFormatText(u[g],x,f));b||(d!=u[g]&&-1==t.inArray(u[g],d)||("inside"==this.brush.showText&&this.setActiveTextEvent(k.get(0),s,l,y,c,!0),this.setActiveEvent(w,s,l,y),o[y]=!0),null!=this.brush.activeEvent&&function(t,e,i,r,n,h){t.on(a.brush.activeEvent,function(s){o[n]?("inside"==a.brush.showText&&a.setActiveTextEvent(e,i,r,n,h,!1),t.translate(i,r),o[n]=!1):("inside"==a.brush.showText&&a.setActiveTextEvent(e,i,r,n,h,!0),a.setActiveEvent(t,i,r,n),o[n]=!0)}),t.attr({cursor:"pointer"})}(w,k.get(0),s,l,y,c)),a.addEvent(w,e,g),n.append(w),n.append(k),p+=v}},this.drawNoData=function(t){var e=this.getProperty(0);t.append(this.drawPie(e.centerX,e.centerY,e.outerRadius,0,360,this.chart.theme("pieNoDataBackgroundColor")))},this.drawBefore=function(){r=this.chart.svg.group()},this.draw=function(){return 0==this.listData().length?this.drawNoData(r):this.eachData(function(t,e){this.drawUnit(e,t,r)}),r},this.getProperty=function(t){var e=this.axis.c(t),i=e.width,r=e.height,a=e.x,n=e.y,h=i;return r<h&&(h=r),{centerX:i/2+a,centerY:r/2+n,outerRadius:h/2}}};return r.setup=function(){return{clip:!1,showText:null,format:null,"3d":!1,active:null,activeEvent:null}},r}},x={name:"chart.brush.donut",extend:"chart.brush.pie",component:function(){var t=a.include("util.base"),e=a.include("util.math"),i=a.include("util.color"),r=function(){var r=this,a={};this.drawDonut=function(t,i,r,a,n,h,s){s["stroke-width"]=a-r,h>=360&&(h=359.9999);var o=this.chart.svg.group(),l=this.chart.svg.path(s),c=(Math.abs(a-r),e.rotate(0,-a,e.radian(n))),u=c.x,d=c.y;return l.MoveTo(u,d),c=e.rotate(u,d,e.radian(h)),o.translate(t,i),l.Arc(a,a,0,h>180?1:0,1,c.x,c.y),l.css({"pointer-events":"stroke"}),o.append(l),o.order=1,o},this.drawDonut3d=function(t,i,r,a,n,h,s){var o=this.chart.svg.group(),l=this.chart.svg.path(s),c=Math.abs(a-r);r=(a+=c/2)-c;var u=e.rotate(0,-a,e.radian(n)),d=u.x,p=u.y,f=e.rotate(0,-r,e.radian(n)),g=f.x,v=f.y;l.MoveTo(d,p),u=e.rotate(d,p,e.radian(h)),f=e.rotate(g,v,e.radian(h)),o.translate(t,i),l.Arc(a,a,0,h>180?1:0,1,u.x,u.y);var m=u.y+10,x=u.x+5,y=f.y+10,b=f.x+5,w=d+5,k=p+10,B=g+5,C=v+10;l.LineTo(x,m),l.Arc(a,a,0,h>180?1:0,0,w,k),l.ClosePath(),o.append(l);var T=this.chart.svg.path(s);return T.MoveTo(g,v),T.Arc(r,r,0,h>180?1:0,1,f.x,f.y),T.LineTo(b,y),T.Arc(r,r,0,h>180?1:0,0,B,C),T.ClosePath(),o.append(T),o.order=1,o},this.drawDonut3dBlock=function(t,i,r,a,n,h,s){var o=this.chart.svg.group(),l=this.chart.svg.path(s),c=Math.abs(a-r);r=(a+=c/2)-c;var u=e.rotate(0,-a,e.radian(n)),d=u.x,p=u.y,f=e.rotate(0,-r,e.radian(n)),g=f.x,v=f.y;l.MoveTo(d,p),u=e.rotate(d,p,e.radian(h)),f=e.rotate(g,v,e.radian(h)),o.translate(t,i);var m=u.y+10,x=u.x+5,y=f.y+10,b=f.x+5,w=this.chart.svg.path(s);return w.MoveTo(u.x,u.y).LineTo(x,m).LineTo(b,y).LineTo(f.x,f.y).ClosePath(),o.append(w),o.order=1,o},this.drawUnit=function(e,n,h){for(var s=this.getProperty(e),o=s.centerX,l=s.centerY,c=s.innerRadius,u=s.outerRadius,d=this.brush.target,p=this.brush.active,f=0,g=0,v=0,m=0;m<d.length;m++)g+=n[d[m]];if(this.brush["3d"]){for(m=0;m<d.length;m++){var x=(b=n[d[m]])/g*360,y=this.drawDonut3dBlock(o,l,c,u,f,x,{fill:i.darken(this.color(m),.5)},m==d.length-1);h.append(y),f+=x}f=0;for(m=0;m<d.length;m++){x=(b=n[d[m]])/g*360,y=this.drawDonut3d(o,l,c,u,f,x,{fill:i.darken(this.color(m),.5)},m==d.length-1);h.append(y),f+=x}}f=0;for(m=0;m<d.length;m++)if(0!=n[d[m]]){var b,w=f+(x=(b=n[d[m]])/g*360)/2-90,k=360==Math.abs(f-x),B="inside"==this.brush.showText?this.brush.size+c+u:u,C=this.drawDonut(o,l,c,u,f,x,{stroke:this.color(m),fill:"transparent"}),T=this.drawText(o,l,w,B,this.getFormatText(d[m],b));k||(p!=d[m]&&-1==t.inArray(d[m],p)||("inside"==this.brush.showText&&this.setActiveTextEvent(T.get(0),o,l,w,B,!0),this.setActiveEvent(C,o,l,w),a[w]=!0),null!=this.brush.activeEvent&&function(t,e,i,n,h,s){t.on(r.brush.activeEvent,function(o){a[h]?("inside"==r.brush.showText&&r.setActiveTextEvent(e,i,n,h,s,!1),t.translate(i,n),a[h]=!1):("inside"==r.brush.showText&&r.setActiveTextEvent(e,i,n,h,s,!0),r.setActiveEvent(t,i,n,h),a[h]=!0)}),t.attr({cursor:"pointer"})}(C,T.get(0),o,l,w,B)),this.addEvent(C,e,m),h.append(C),h.append(T),f+=x,v+=b}this.brush.showValue&&this.drawTotalValue(h,o,l,v)},this.drawNoData=function(t){var e=this.getProperty(0);t.append(this.drawDonut(e.centerX,e.centerY,e.innerRadius,e.outerRadius,0,360,{stroke:this.chart.theme("pieNoDataBackgroundColor"),fill:"transparent"})),this.brush.showValue&&this.drawTotalValue(t,e.centerX,e.centerY,0)},this.drawTotalValue=function(t,e,i,r){var a=this.chart.theme("pieTotalValueFontSize"),n=this.chart.text({"font-size":a,"font-weight":this.chart.theme("pieTotalValueFontWeight"),fill:this.chart.theme("pieTotalValueFontColor"),"text-anchor":"middle",dy:a/3},this.format(r));n.translate(e,i),t.append(n)},this.getProperty=function(t){var e=this.axis.c(t),i=e.width,r=e.height,a=e.x,n=e.y,h=i;r<h&&(h=r),this.brush.size>=h/2&&(this.brush.size=h/4);var s=h/2-this.brush.size/2;return{centerX:i/2+a,centerY:r/2+n,outerRadius:s,innerRadius:s-this.brush.size}}};return r.setup=function(){return{size:50,showValue:!1}},r}};a.define("util.treemap",[],function(){return{sumArray:function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i];return e}}}),a.define("chart.brush.treemap.node",[],function(){return function(t){var e=this;this.text=t.text,this.value=t.value,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.index=null,this.nodenum=null,this.parent=null,this.children=[],this.depth=0,this.reload=function(t){this.nodenum=isNaN(t)?this.nodenum:t,e.parent&&(null==this.parent.index?this.index=""+this.nodenum:this.index=e.parent.index+"."+this.nodenum),this.parent&&"string"==typeof e.index&&(this.depth=this.index.split(".").length),this.children.length>0&&function t(e){for(var i=e.children,r=0;r<i.length;r++)i[r].children.length>0&&t(i[r])}(this)},this.isLeaf=function(){return 0==this.children.length},this.appendChild=function(t){this.children.push(t)},this.insertChild=function(t,e){var i=this.children.splice(0,t);i.push(e),this.children=i.concat(this.children)},this.removeChild=function(t){for(var e=0;e<this.children.length;e++)this.children[e].index==t&&this.children.splice(e,1)},this.lastChild=function(){return this.children.length>0?this.children[this.children.length-1]:null},this.lastChildLeaf=function(t){var e=t||this.lastChild();return e.isLeaf()?e:this.lastChildLeaf(e.lastChild())}}}),a.define("chart.brush.treemap.nodemanager",["util.base","chart.brush.treemap.node"],function(t,e){return function(){var i=this,r=new e({text:null,value:-1,x:-1,y:-1,width:-1,height:-1}),a=t.index();function n(t,i,r){var a=new e(t);return a.parent=r||null,a.reload(i),a}function h(t,e){var i=e.children;if(i.length>0)for(var r=0;r<i.length;r++)t.push(i[r]),i[r].children.length>0&&h(t,i[r])}this.appendNode=function(){var t=arguments[0],e=arguments[1];return e?function(t,e){var r=i.getNode(t),a=n(e,r.children.length,r);return r.appendChild(a),a}(t,e):function(t){var e=n(t,r.children.length,r);return r.appendChild(e),e}(t)},this.insertNode=function(t,e){return 0==r.children.length&&0==parseInt(t)?this.appendNode(e):function(t,e){var r=a.getIndexList(t),h=i.getNodeParent(t),s=r[r.length-1],o=n(e,s,h);return h.insertChild(s,o),o}(t,e)},this.updateNode=function(t,e){var i=this.getNode(t);for(var r in e)i.data[r]=e[r];return i.reload(i.nodenum,!0),i},this.getNode=function(t){if(null==t)return r.children;var e=r.children;if(a.isIndexDepth(t)){var i=a.getIndexList(t);return function t(e,i){if(!i)return null;var r=e.shift();return void 0==r?i:t(e,i.children[r])}(i,e[i.shift()])}return e[t]?e[t]:null},this.getNodeAll=function(t){for(var e=[],i=null==t?r.children:[this.getNode(t)],a=0;a<i.length;a++)i[a]&&(e.push(i[a]),i[a].children.length>0&&h(e,i[a]));return e},this.getNodeParent=function(t){var e=a.getIndexList(t);return 1==e.length?r:2==e.length?this.getNode(e[0]):e.length>2?(e.pop(),this.getNode(e.join("."))):void 0},this.getRoot=function(){return r}}}),a.define("chart.brush.treemap.container",["util.treemap"],function(t){var e=function(i,r,a,n){this.xoffset=i,this.yoffset=r,this.height=n,this.width=a,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(e){var i=[],r=this.xoffset,a=this.yoffset,n=t.sumArray(e)/this.height,h=t.sumArray(e)/this.width;if(this.width>=this.height)for(var s=0;s<e.length;s++)i.push([r,a,r+n,a+e[s]/n]),a+=e[s]/n;else for(s=0;s<e.length;s++)i.push([r,a,r+e[s]/h,a+h]),r+=e[s]/h;return i},this.cutArea=function(t){if(this.width>=this.height){var i=t/this.height,r=this.width-i;return new e(this.xoffset+i,this.yoffset,r,this.height)}var a=t/this.width,n=this.height-a;return new e(this.xoffset,this.yoffset+a,this.width,n)}};return e}),a.define("chart.brush.treemap.calculator",["util.base","util.treemap","chart.brush.treemap.container"],function(t,e,i){function r(t,r,n,h,s){return h=void 0===h?0:h,s=void 0===s?0:s,function(t){var e=[];if(t)for(var i=0;i<t.length;i++)for(var r=0;r<t[i].length;r++)e.push(t[i][r]);return e}(function t(i,r,n,h){var s;var o;var l;if(0===i.length)return void h.push(n.getCoordinates(r));s=n.shortestEdge();o=i[0];!function(t,e,i){var r;if(0===t.length)return!0;(r=t.slice()).push(e);var n=a(t,i),h=a(r,i);return n>=h}(r,o,s)?(l=n.cutArea(e.sumArray(r),h),h.push(n.getCoordinates(r)),t(i,[],l,h)):(r.push(o),t(i.slice(1),r,n,h));return h}(function(t,i){for(var r=[],a=i/e.sumArray(t),n=0;n<t.length;n++)r[n]=t[n]*a;return r}(t,r*n),[],new i(h,s,r,n),[]))}function a(t,i){var r=Math.min.apply(Math,t),a=Math.max.apply(Math,t),n=e.sumArray(t);return Math.max(Math.pow(i,2)*a/Math.pow(n,2),Math.pow(n,2)/(Math.pow(i,2)*r))}function n(i){var r=0;if(t.typeCheck("array",i[0]))for(var a=0;a<i.length;a++)r+=n(i[a]);else r=e.sumArray(i);return r}return function e(i,a,h,s,o){s=void 0===s?0:s,o=void 0===o?0:o;var l,c=[],u=[];if(t.typeCheck("array",i[0])){for(var d=0;d<i.length;d++)c[d]=n(i[d]);for(l=r(c,a,h,s,o),d=0;d<i.length;d++)u.push(e(i[d],l[d][2]-l[d][0],l[d][3]-l[d][1],l[d][0],l[d][1]))}else u=r(i,a,h,s,o);return u}});var y={name:"chart.brush.treemap",extend:"chart.brush.core",component:function(){var t=a.include("util.base"),e=a.include("chart.brush.treemap.calculator"),i=a.include("chart.brush.treemap.nodemanager"),r=3,n=function(){var a=new i,n={};function h(t,e,i,r){r||(r=[]);for(var a=0;a<e.length;a++)0==e[a].children.length?r.push(e[a][t]):h(t,e[a].children,i,[]);return i.push(r),i}function s(t){return 0!=t.width||0!=t.height||0!=t.x||0!=t.y}function o(e,i,a,h,s){var o=e.chart.theme("treemapTitleFontSize"),l=function t(e,i,r){if(0==e.children.length)return{x:Math.min(i,e.x),y:Math.min(r,e.y)};for(var a=0;a<e.children.length;a++)return t(e.children[a],i,r)}(a,e.axis.area("width"),e.axis.area("height")),c=e.chart.text({"font-size":o,"font-weight":"bold",fill:e.chart.theme("treemapTitleFontColor"),x:h+l.x+r,y:s+l.y+o,"text-anchor":"start"},t.typeCheck("function",e.brush.format)?e.format(a):a.text);i.append(c),n[a.index]=!0}function l(t){return t.parent.depth>0?l(t.parent):t.nodenum}this.drawBefore=function(){for(var i=0;i<this.axis.data.length;i++){var r=this.axis.data[i],n=this.getValue(r,"index");a.insertNode(n,{text:this.getValue(r,"text",""),value:this.getValue(r,"value",0),x:this.getValue(r,"x",0),y:this.getValue(r,"y",0),width:this.getValue(r,"width",0),height:this.getValue(r,"height",0)})}var s=a.getNode(),o=h("value",s,[]);!function e(i,r){for(var n=0;n<i.length;n++)if(t.typeCheck("array",i[n]))e(i[n],r[n]);else{var h=a.getNode(i[n]);h.x=r[n][0],h.y=r[n][1],h.width=r[n][2]-r[n][0],h.height=r[n][3]-r[n][1]}}(h("index",s,[]),e(o,this.axis.area("width"),this.axis.area("height")))},this.draw=function(){for(var e=this.svg.group(),i=this.axis.area("x"),h=this.axis.area("y"),c=a.getNodeAll(),u=0;u<c.length;u++)if(this.brush.titleDepth==c[u].depth&&o(this,e,c[u],i,h),s(c[u])){var d=i+c[u].x,p=h+c[u].y,f=c[u].width,g=c[u].height;if(this.brush.showText&&!n[c[u].index]){var v=d+f/2,m=p+g/2,x=this.chart.theme("treemapTextFontSize");"top"==this.brush.textOrient?m=p+x:"bottom"==this.brush.textOrient&&(m=p+g-x/2),"start"==this.brush.textAlign?v=d+r:"end"==this.brush.textAlign&&(v=d+f-r);var y=this.chart.text({"font-size":x,fill:this.chart.theme("treemapTextFontColor"),x:v,y:m,"text-anchor":this.brush.textAlign},t.typeCheck("function",this.brush.format)?this.format(c[u]):c[u].text);e.append(y)}var b=this.svg.rect({stroke:this.chart.theme("treemapNodeBorderColor"),"stroke-width":this.chart.theme("treemapNodeBorderWidth"),x:d,y:p,width:f,height:g,fill:this.color(l(c[u]))});if(t.typeCheck("function",this.brush.nodeColor)){var w=this.brush.nodeColor.call(this.chart,c[u]);b.attr({fill:this.color(w)})}this.addEvent(b,c[u]),e.prepend(b)}return e}};return n.setup=function(){return{textOrient:"top",textAlign:"middle",showText:!0,titleDepth:1,nodeColor:null,clip:!1,format:null}},n}},b={name:"chart.brush.heatmap",extend:"chart.brush.core",component:function(){var t=a.include("util.base"),e=function(){var e=this;this.draw=function(){for(var i=this.chart.theme("heatmapBorderWidth"),r=this.chart.theme("heatmapFontSize"),a=this.svg.group(),n=this.axis.x.rangeBand()-i,h=this.axis.y.rangeBand()-i,s=0;s<this.axis.data.length;s++){var o=this.svg.group(),l=this.color(s,null),c=this.axis.data[s],u=this.getValue(c,"text"),d=this.axis.x(s),p=this.axis.y(s);"none"==l&&(l=this.chart.theme("heatmapBackgroundColor"));var f=this.svg.rect({x:d-n/2,y:p-h/2,width:n,height:h,fill:l,"fill-opacity":this.chart.theme("heatmapBackgroundOpacity"),stroke:this.chart.theme("heatmapBorderColor"),"stroke-opacity":this.chart.theme("heatmapBorderOpacity"),"stroke-width":i}),g=this.chart.text({"text-anchor":"middle",fill:this.chart.theme("heatmapFontColor"),"font-size":r,width:n,height:h,x:d,y:p+r/2}).text(t.typeCheck("function",this.brush.format)?this.format(c):u);this.addEvent(o,s,null),o.append(f),o.append(g),a.append(o),function(t){o.hover(function(){t.attr({"fill-opacity":e.chart.theme("heatmapHoverBackgroundOpacity")})},function(){t.attr({"fill-opacity":e.chart.theme("heatmapBackgroundOpacity")})})}(f)}return a}};return e.setup=function(){return{format:null}},e}},w={name:"chart.brush.timeline",extend:"chart.brush.core",component:function(){var t=a.include("util.base"),e=function(){var e,i,r,a,n,h,s,o,l,c=this,u={},d=[],p=null;this.setActiveRect=function(t){for(var e=0;e<d.length;e++){var i=d[e].r1,r=d[e].r2,a=d[e].color,n=r.element==t;i.attr({fill:n?this.chart.theme("timelineActiveBarBackgroundColor"):a}),r.attr({fill:n?this.chart.theme("timelineActiveLayerBackgroundColor"):this.chart.theme("timelineHoverLayerBackgroundColor"),stroke:n?this.chart.theme("timelineActiveLayerBorderColor"):this.chart.theme("timelineHoverLayerBorderColor"),"fill-opacity":n?this.chart.theme("timelineLayerBackgroundOpacity"):0,"stroke-width":n?1:0}),n&&(p=e)}},this.setHoverRect=function(t){for(var e=0;e<d.length;e++){var i=d[e].r2,r=i.element==t;i.attr({fill:r&&p==e?c.chart.theme("timelineActiveLayerBackgroundColor"):this.chart.theme("timelineHoverLayerBackgroundColor"),stroke:r&&p==e?c.chart.theme("timelineActiveLayerBorderColor"):this.chart.theme("timelineHoverLayerBorderColor"),"fill-opacity":r||p==e?this.chart.theme("timelineLayerBackgroundOpacity"):0,"stroke-width":r||p==e?1:0})}},this.setActiveBar=function(t){for(var e=0;e<d.length;e++){var i=d[e].r1,r=d[e].t1,n=d[e].color,h=d[e].y-a/2,s=d[e].y-d[e].height/2,o=i.element==t;o?(i.attr({fill:this.chart.theme("timelineActiveBarBackgroundColor")||n,height:a,y:h}),r.attr({visibility:"visible"})):(i.attr({fill:n,height:d[e].height,y:s}),r.attr({visibility:"hidden"})),o&&(p=e)}},this.setHoverBar=function(t){for(var e=this.chart.theme("timelineHoverBarBackgroundColor"),i=this.chart.theme("timelineActiveBarBackgroundColor"),r=0;r<d.length;r++){var a=d[r].r1,n=d[r].color,h=a.element==t;a.attr({fill:h&&p!=r?e||n:p==r&&i||n})}},this.drawBefore=function(){e=this.svg.group(),i=this.axis.get("padding"),r=this.axis.y.domain(),a=this.axis.y.rangeBand(),this.axis.x.rangeBand(),n=this.axis.x.ticks(this.axis.get("x").step),s=this.brush.active,o=this.brush.activeType,l=this.brush.hideTitle?0:i.left,h=this.axis.area("x")-l;for(var t=0;t<r.length;t++)u[r[t]]=t},this.drawGrid=function(){for(var i=this.axis.get("y").format,n=this.axis.area("width")+l,s=this.chart.theme("timelineColumnBackgroundColor"),o=this.chart.theme("timelineHoverRowBackgroundColor"),u=this.chart.theme("timelineEvenRowBackgroundColor"),d=this.chart.theme("timelineOddRowBackgroundColor"),p=0;p<r.length;p++){var f=r[p],g=this.axis.y(p),v=0==p?s:p%2?u:d,m=this.svg.rect({width:n,height:a,fill:v,x:h,y:g-a/2});if(function(t,e){e>0&&t.hover(function(){t.attr({fill:o})},function(){t.attr({fill:e%2?u:d})})}(m,p),e.append(m),l>0){var x=this.chart.text({"text-anchor":"start",dx:5,dy:this.chart.theme("timelineTitleFontSize")/3,"font-size":this.chart.theme("timelineTitleFontSize"),fill:this.chart.theme("timelineTitleFontColor"),"font-weight":this.chart.theme("timelineTitleFontWeight")}).translate(h,g),y=t.typeCheck("function",i)?i.apply(this.chart,[f,p]):f;x.html(y),function(t){x.on("mouseover",function(e){c.chart.emit("timeline.title",[t,e])})}(f),e.append(x)}}},this.drawLine=function(){for(var r=this.axis.y(0)-a/2,s=this.axis.get("x").format,o=0;o<n.length;o++){var c=this.axis.x(n[o]);if(o<n.length-1){var u=this.svg.line({stroke:this.chart.theme(0==o?"timelineHorizontalLineColor":"timelineVerticalLineColor"),"stroke-width":1,x1:c,x2:c,y1:r,y2:r+this.axis.area("height"),visibility:0==l&&0==o?"hidden":"visible"});e.append(u)}if(o>0){var d=this.chart.text({"text-anchor":"end",dx:-5,dy:this.chart.theme("timelineColumnFontSize")/2,"font-size":this.chart.theme("timelineColumnFontSize"),fill:this.chart.theme("timelineColumnFontColor")}).translate(c,this.axis.y(0)),p=t.typeCheck("function",s)?s.apply(this.chart,[n[o],o]):n[o];d.text(p),e.append(d)}}var f=this.svg.line({stroke:this.chart.theme("timelineHorizontalLineColor"),"stroke-width":1,x1:h,x2:this.axis.area("width")+i.left,y1:r+a,y2:r+a});e.append(f)},this.drawData=function(){for(var i=this.axis.area("height"),r=this.axis.area("y"),a=this.axis.data.length,n=this.brush.barSize,h=this.brush.activeTooltip,l=this.chart.theme("timelineActiveBarFontSize"),f=this.chart.theme("timelineActiveBarFontColor"),g=0;g<a;g++){var v=this.axis.data[g],m=this.axis.x(this.getValue(v,"stime",0)),x=this.axis.x(this.getValue(v,"etime",this.axis.x.max())),y=this.axis.y(u[this.getValue(v,"key")]),b=t.typeCheck("function",n)?n.apply(this.chart,[v,g]):n,w=this.color(g,0);if(!(x-m<0||isNaN(x))){var k=this.svg.rect({width:x-m,height:b,fill:w,x:m,y:y-b/2,cursor:"pointer"}),B=this.svg.text({"text-anchor":"end","font-size":l,fill:f,x:m+x-m,y:y,dx:-l/2,dy:l/3,visibility:"hidden"}),C=this.svg.rect({width:x-m,height:i-6,"fill-opacity":0,"stroke-width":0,x:m,y:r+3,cursor:"pointer"});if(g<a-1){var T=this.axis.data[g+1],z=this.axis.x(this.getValue(T,"stime",0)),E=this.axis.y(u[this.getValue(T,"key")]),S=this.svg.line({x1:x,y1:y,x2:z,y2:E,stroke:w,"stroke-width":this.brush.lineWidth});e.append(S)}t.typeCheck("function",h)&&B.text(h.apply(this.chart,[v,g])),e.append(k),e.append(B),e.append(C),this.addEvent(k,g),d[g]={r1:k,r2:C,t1:B,color:w,y:y,height:b},"rect"==o?(!function(t){C.on(c.brush.activeEvent,function(e){c.setActiveRect(e.target),c.chart.emit("timeline.active",[t,e])})}(v),C.on("mouseover",function(t){c.setHoverRect(t.target)})):(C.attr({visibility:"hidden"}),function(t){k.on(c.brush.activeEvent,function(e){c.setActiveBar(e.target),c.chart.emit("timeline.active",[t,e])})}(v),k.on("mouseover",function(t){c.setHoverBar(t.target)}))}}if(t.typeCheck("integer",s)&&d.length>0){if(s<0)return;p=s,"rect"==o?this.setActiveRect(d[p].r2.element):this.setActiveBar(d[p].r1.element)}},this.draw=function(){return this.drawGrid(),this.drawLine(),this.drawData(),e.on("mouseout",function(t){"rect"==o?c.setHoverRect(null):c.setHoverBar(null)}),e}};return e.setup=function(){return{barSize:7,lineWidth:1,active:null,activeEvent:"click",activeType:"rect",activeTooltip:null,hideTitle:!1,clip:!1}},e}},k={name:"chart.brush.polygon.column3d",extend:"chart.brush.polygon.core",component:function(){var t=a.include("util.color"),e=a.include("chart.polygon.cube"),i=function(){var i,r;this.createColumn=function(a,n,h,s){var o=i,l=r,c=this.axis.x(h)-o/2,u=this.axis.y(a[n]),d=this.axis.y(0),p=this.axis.z(s)-l/2,f=this.color(s);return this.createPolygon(new e(c,d,p,o,u-d,l),function(e){for(var i=this.svg.group(),r=0;r<e.faces.length;r++){for(var o=e.faces[r],l=this.svg.polygon({fill:f,"fill-opacity":this.chart.theme("polygonColumnBackgroundOpacity"),stroke:t.darken(f,this.chart.theme("polygonColumnBorderOpacity")),"stroke-opacity":this.chart.theme("polygonColumnBorderOpacity")}),c=0;c<o.length;c++){var u=e.vectors[o[c]];l.point(u.x,u.y)}i.append(l)}return 0!=a[n]&&this.addEvent(i,h,s),i})},this.drawBefore=function(){var t=this.brush.padding,e=this.axis.x.rangeBand(),a=this.axis.z.rangeBand();i=this.brush.width>0?this.brush.width:e-2*t,r=this.brush.height>0?this.brush.height:a-2*t},this.draw=function(){for(var t=this.chart.svg.group(),e=this.listData(),i=this.brush.target,r=0;r<e.length;r++)for(var a=0;a<i.length;a++)t.append(this.createColumn(e[r],i[a],r,a));return t}};return i.setup=function(){return{width:0,height:0,padding:20,clip:!1}},i}},B={name:"chart.brush.polygon.line3d",extend:"chart.brush.polygon.core",component:function(){var t=a.include("util.color"),e=a.include("chart.polygon.point"),i=function(){this.createLine=function(i,r,a,n){for(var h=this.color(a,n),s=this.axis.z.rangeBand()-2*this.brush.padding,o=this.axis.x(a),l=this.axis.y(i[a][r]),c=this.axis.z(n)-s/2,u=this.axis.x(a+1),d=this.axis.y(i[a+1][r]),p=this.axis.z(n)+s/2,f=null,g=this.chart.svg.polygon({fill:h,"fill-opacity":this.chart.theme("polygonLineBackgroundOpacity"),stroke:t.darken(h,this.chart.theme("polygonLineBorderOpacity")),"stroke-opacity":this.chart.theme("polygonLineBorderOpacity")}),v=[new e(o,l,c),new e(o,l,p),new e(u,d,p),new e(u,d,c)],m=0;m<v.length;m++)this.createPolygon(v[m],function(t){var e=t.vectors[0];g.point(e.x,e.y),null==f?f=t:e.z>f.vectors[0].z&&(f=t)});return g.order=this.axis.depth-f.max().z,g},this.draw=function(){for(var t=this.chart.svg.group(),e=this.listData(),i=this.brush.target,r=0;r<e.length-1;r++)for(var a=0;a<i.length;a++)t.append(this.createLine(e,i[a],r,a));return t}};return i.setup=function(){return{padding:10,clip:!1}},i}},C={name:"chart.widget.cross",extend:"chart.widget.core",component:function(){var t=a.include("util.base"),e=function(e,i,r){var a,n,h,s,o,l=this,c=0,u=0,d=[];function p(t,e,i){if(!d[t]){var r=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.element.appendChild(r),d[t]=r}d[t].textContent=i}this.drawBefore=function(){i=this.chart.axis(r.axis),c=e.padding("left")+i.area("x"),u=e.padding("top")+i.area("y"),a=e.svg.group({visibility:"hidden"},function(){t.typeCheck("function",r.yFormat)&&(n=e.svg.line({x1:0,y1:0,x2:i.area("width"),y2:0,stroke:e.theme("crossBorderColor"),"stroke-width":e.theme("crossBorderWidth"),opacity:e.theme("crossBorderOpacity")}),o=e.svg.group({},function(){e.svg.polygon({fill:e.theme("crossBalloonBackgroundColor"),"fill-opacity":e.theme("crossBalloonBackgroundOpacity"),points:l.balloonPoints("left",50,18,5)}),e.text({"font-size":e.theme("crossBalloonFontSize"),fill:e.theme("crossBalloonFontColor"),"text-anchor":"middle",x:25,y:12})}).translate(-55,0)),t.typeCheck("function",r.xFormat)&&(h=e.svg.line({x1:0,y1:0,x2:0,y2:i.area("height"),stroke:e.theme("crossBorderColor"),"stroke-width":e.theme("crossBorderWidth"),opacity:e.theme("crossBorderOpacity")}),s=e.svg.group({},function(){e.svg.polygon({fill:e.theme("crossBalloonBackgroundColor"),"fill-opacity":e.theme("crossBalloonBackgroundOpacity"),points:l.balloonPoints("bottom",50,18,5)}),e.text({"font-size":e.theme("crossBalloonFontSize"),fill:e.theme("crossBalloonFontColor"),"text-anchor":"middle",x:25,y:17})}).translate(0,i.area("height")+5))}).translate(c,u)},this.draw=function(){return this.on("axis.mouseover",function(t){a.attr({visibility:"visible"})},r.axis),this.on("axis.mouseout",function(t){a.attr({visibility:"hidden"})},r.axis),this.on("axis.mousemove",function(t){a.attr({visibility:"visible"});var e=t.bgX-c+3,d=t.bgY-u+3;if(n&&n.attr({y1:d,y2:d}),h&&h.attr({x1:e,x2:e}),o){o.translate(-55,d-9);var f=i.y.invert(t.chartY+3),g=r.yFormat.call(l.chart,f);p(0,o.get(1),g)}if(s){s.translate(e-25,i.area("height")+5);f=i.x.invert(t.chartX+3),g=r.xFormat.call(l.chart,f);p(1,s.get(1),g)}},r.axis),a}};return e.setup=function(){return{axis:0,xFormat:null,yFormat:null}},e}},T={name:"chart.widget.legend",extend:"chart.widget.core",component:function(){var t=a.include("util.base"),e=function(e,i,r){var a=[],n={};function h(e){var i=[0];return t.typeCheck("array",e)?i=e:t.typeCheck("integer",e)&&(i=[e]),i}function s(){for(var t=h(r.brush),i=[],a=0;a<t.length;a++)i[a]=e.get("brush",t[a]);return i}function o(t){if(r.filter){a[t.index]||(a[t.index]={});for(var e=0;e<t.target.length;e++)a[t.index][t.target[e]]=!0}}function l(t){var i=[],r=[],h=t[0].index;for(var s in a[h])a[h][s]&&(i.push(s),r.push(n[s]));for(var o=0;o<t.length;o++)e.updateBrush(t[o].index,{target:i,colors:r});e.isRender()||e.render(),e.emit("legend.filter",[i])}this.getLegendIcon=function(i){for(var h=[],o=i.target.length,c=0;c<o;c++){var u=e.svg.group(),d=i.target[c],p=d,f=e.color(c,r.colors||i.colors);n[d]=f,t.typeCheck("function",r.format)&&(p=this.format(d));var g=e.svg.getTextSize(p,{fontSize:e.theme("legendFontSize")});if(r.filter)u.append(e.svg.line({x1:0,x2:17,y1:-2.75,y2:-2.75,stroke:f,"stroke-width":13,"stroke-linecap":"round"})),u.append(e.svg.circle({cx:17,cy:-2.75,r:5.5,fill:e.theme("legendSwitchCircleColor")})),u.append(e.text({x:27,y:0,"font-size":e.theme("legendFontSize"),fill:e.theme("legendFontColor"),"text-anchor":"start"},p)),h.push({icon:u,width:17+g.width+12.5,height:15.5}),function(t,h){h.attr({cursor:"pointer"}),h.on("click",function(o){a[i.index][t]?(h.get(0).attr({stroke:e.theme("legendSwitchDisableColor")}),h.get(2).attr({fill:e.theme("legendSwitchDisableColor")}),h.get(1).attr({cx:0}),a[i.index][t]=!1):(h.get(0).attr({stroke:n[t]}),h.get(2).attr({fill:e.theme("legendFontColor")}),h.get(1).attr({cx:17}),a[i.index][t]=!0),l(r.brushSync?s():[i])})}(d,u);else{var v=e.theme("legendFontSize");if(null!=r.icon){var m=t.typeCheck("function",r.icon)?r.icon.apply(e,[d]):r.icon;u.append(e.text({x:0,y:2,"font-size":v,fill:f},m))}else u.append(e.svg.circle({cx:v/2,cy:-2,r:v/2,fill:f}));u.append(e.text({x:1.2*v,y:0,"font-size":v,fill:e.theme("legendFontColor"),"text-anchor":"start"},p)),h.push({icon:u,width:v+g.width+10,height:15.5})}}return h},this.draw=function(){for(var t=e.svg.group(),i=0,a=0,n=0,s=0,l=0,c=0,u=h(r.brush),d=[],p=0;p<u.length;p++){var f=u[p];if(!(r.brushSync&&p>0)){for(var g=e.get("brush",u[f]),v=this.getLegendIcon(g),m=0;m<v.length;m++)t.append(v[m].icon),v[m].icon.translate(i,a),"bottom"==r.orient||"top"==r.orient?(i+v[m].width>e.area("x2")&&(i=0,a+=v[m].height,c+=v[m].height,v[m].icon.translate(i,a),d.push(n),n=0),i+=v[m].width+12.5,n+=v[m].width+12.5,c<v[m].height&&(c=v[m].height)):(a+=v[m].height,s+=v[m].height,l<v[m].width&&(l=v[m].width));n>0&&d.push(n),d.length>0&&(n=Math.max.apply(Math,d)),o(g)}}if("bottom"==r.orient||"top"==r.orient){a=5+("bottom"==r.orient?e.area("y2")+e.padding("bottom")-c:e.area("y")-e.padding("top"));"start"==r.align?i=e.area("x"):"center"==r.align?i=e.area("x")+(e.area("width")/2-n/2):"end"==r.align&&(i=e.area("x2")-n)}else{i=5+("left"==r.orient?e.area("x")-e.padding("left"):e.area("x2")+e.padding("right")-l);"start"==r.align?a=e.area("y"):"center"==r.align?a=e.area("y")+(e.area("height")/2-s/2):"end"==r.align&&(a=e.area("y2")-s)}return t.translate(Math.floor(i)+r.dx,Math.floor(a)+r.dy),t}};return e.setup=function(){return{orient:"bottom",align:"center",filter:!1,icon:null,dx:0,dy:0,colors:null,brushSync:!1,brush:0,format:null}},e}},z={name:"chart.widget.tooltip",extend:"chart.widget.core",component:function(){var t=a.include("util.base"),e=a.include("util.color"),i=7,r=7,n=function(a,n,h){var s=this,o={},l=0;function c(e,i){var r=null,a=null;if(t.typeCheck("function",h.format)){var n=s.format(i,e);t.typeCheck("object",n)?(r=n.key,a=n.value):a=n}else e&&!i&&(a=e),e&&i&&(r=e,a=s.format(i[e]));return{key:r,value:a}}function u(t){for(var i=t.brush.target,r=0;r<i.length;r++)if(i[r]==t.dataKey)return e.lighten(s.chart.color(r,t.brush.colors));return null}function d(t,e,a){var n=t.bgX-e.width/2,h=t.bgY-e.height-r-i/2,s=2;return"left"!=a&&"right"!=a||(h=t.bgY-e.height/2-i/2),"left"==a?n=t.bgX-e.width-r:"right"==a?(n=t.bgX+r,s=-2):"bottom"==a&&(h=t.bgY+2*r),{x:n,y:h,c:s}}function p(){var e=!1,n=null,p=null,f=null;s.on("mouseover",function(g,v){if(!e&&function(e){var i=s.getIndexArray(s.widget.brush);return-1!=t.inArray(e,i)}(g.brush.index)&&(g.dataKey||g.data)){n=function(e){var r=o[e.brush.index].get(1).get(1),a=0,n=0,s=!1;function u(h){for(var o=0;o<h.length;o++){var u=c(h[o],e.data);r.get(o).attr({x:i}),u.key?r.get(o).get(0).text(u.key):(r.get(o).get(1).attr({"text-anchor":"middle"}),s=!0),t.typeCheck(["null","undefined"],u.value)||r.get(o).get(1).attr({x:0}).text(u.value),a=Math.max(a,r.get(o).size().width)}n=h.length*l}return e.dataKey&&!1===h.all?u([e.dataKey]):u(e.brush.target),{width:a+3*i,height:n+i,onlyValue:s}}(g),p=h.orient,f=a.axis(g.brush.axis);var m=d(v,n,p),x=m.x-a.padding("left"),y=m.y-a.padding("top");h.flip&&("left"==p&&x<0?p="right":"right"==p&&x+n.width>f.area("width")?p="left":"top"==p&&y<0?p="bottom":"bottom"==p&&y+n.height>f.area("height")&&(p="top"));var b=o[g.brush.index],w=b.get(0),k=b.get(1).get(0),B=b.get(1).get(1).translate(0,"bottom"!=p?l:l+r),C=a.theme("tooltipBorderColor")||u(g),T=a.theme("tooltipLineColor")||u(g);k.attr({points:s.balloonPoints(p,n.width,n.height,h.anchor?r:null),stroke:C}),w.attr({stroke:T}),B.each(function(t,e){e.get(1).attr({x:n.onlyValue?n.width/2:n.width-i})}),b.attr({visibility:"visible"}),e=!0}}),s.on("mousemove",function(t,i){if(e){var r=o[t.brush.index],h=r.get(0),s=r.get(1),l=d(i,n,p);h.attr({x1:i.bgX+l.c,y1:a.padding("top")+f.area("y"),x2:i.bgX+l.c,y2:a.padding("top")+f.area("y2")}),s.translate(l.x,l.y)}}),s.on("mouseout",function(t,i){e&&(o[t.brush.index].attr({visibility:"hidden"}),e=!1)})}this.drawBefore=function(){l=1.2*a.theme("tooltipFontSize")},this.draw=function(){for(var t=a.svg.group(),e=this.getIndexArray(this.widget.brush),r=0;r<e.length;r++){var n=a.get("brush",e[r]),s=[""];if(h.all&&n.target.length>1)for(var l=1;l<n.target.length;l++)s.push("");o[n.index]=a.svg.group({visibility:"hidden"},function(){a.svg.line({"stroke-width":a.theme("tooltipLineWidth"),visibility:h.line?"visible":"hidden"}),a.svg.group({},function(){a.svg.polygon({fill:a.theme("tooltipBackgroundColor"),"fill-opacity":a.theme("tooltipBackgroundOpacity"),"stroke-width":a.theme("tooltipBorderWidth")});for(var t=a.texts({"font-size":a.theme("tooltipFontSize"),fill:a.theme("tooltipFontColor")},s,1.2),e=0;e<s.length;e++)t.get(e).append(a.svg.tspan({"text-anchor":"start","font-weight":"bold",x:i})),t.get(e).append(a.svg.tspan({"text-anchor":"end"}))})}),t.append(o[n.index])}return p(),t}};return n.setup=function(){return{orient:"top",anchor:!0,all:!1,line:!1,flip:!1,format:null,brush:0}},n}},E={name:"chart.widget.polygon.rotate3d",extend:"chart.widget.polygon.core",component:function(){var t=a.include("util.base"),e=180,i=function(){var i=this;function r(t){var r=i.chart.axis(t),a=!1,n=0,h=0,s=0,o=0,l=null,c=i.widget.unit,u=r.area("width"),d=r.area("height");function p(t){a&&(a=!1,n=0,h=0)}i.on("axis.mousedown",function(t){if(a)return;a=!0,n=t.chartX,h=t.chartY,s=r.degree.x,o=r.degree.y},t),i.on("axis.mousemove",function(t){if(!a)return;var p=t.chartX-n,f=t.chartY-h,g=s+Math.floor(f/d*e),v=o-Math.floor(p/u*e);if(g%c!=0&&v%c!=0)return;var m=g+":"+v;if(l==m)return;r.set("degree",{x:g,y:v}),i.chart.render(),l=m},t),i.on("axis.mouseup",p,t),i.on("bg.mouseup",p),i.on("chart.mouseup",p)}this.draw=function(){for(var e=t.typeCheck("array",this.widget.axis)?this.widget.axis:[this.widget.axis],i=0;i<e.length;i++)r(e[i])}};return i.setup=function(){return{unit:5,axis:[0]}},i}};a.use([n,h,s,o,l,c,u,d,p,f,{name:"chart.brush.stackarea",extend:"chart.brush.area",component:function(){return function(){this.draw=function(){return this.drawArea(this.getStackXY())}}}},{name:"chart.brush.rangearea",extend:"chart.brush.core",component:function(){return function(){this.draw=function(){for(var t=this.svg.group(),e=this.brush.target,i=this.axis.data,r="range"==this.axis.y.type,a=0;a<e.length;a++){for(var n=this.svg.polygon({fill:this.color(a),"fill-opacity":this.chart.theme("areaBackgroundOpacity"),"stroke-width":0}),h=0;h<i.length;h++){var s=i[h][e[a]];r?n.point(this.axis.x(h),this.axis.y(s[0])):n.point(this.axis.x(s[0]),this.axis.y(h))}for(h=i.length-1;h>=0;h--)s=i[h][e[a]],r?n.point(this.axis.x(h),this.axis.y(s[1])):n.point(this.axis.x(s[1]),this.axis.y(h));t.append(n)}return t}}}},g,v,m,x,y,b,w,k,B,C,T,{name:"chart.widget.title",extend:"chart.widget.core",component:function(){var t=function(t,e,i){var r=0,a=0,n="middle";this.drawBefore=function(){var e=t.axis(i.axis);e?(a="bottom"==i.orient?e.area("y2")+e.padding("bottom")-20:"top"==i.orient?e.area("y")-e.padding("top")+25:e.area("y")+e.area("height")/2,"middle"==i.align?(r=e.area("x")+e.area("width")/2,n="middle"):"start"==i.align?(r=e.area("x")-e.padding("left")+20,n="start"):(r=e.area("x2")+e.padding("right")-20,n="end"),r+=t.area("x"),a+=t.area("y")):(a="bottom"==i.orient?t.area("y2")+t.padding("bottom")-20:"top"==i.orient?20:t.area("y")+t.area("height")/2,"middle"==i.align?(r=t.area("x")+t.area("width")/2,n="middle"):"start"==i.align?(r=t.area("x"),n="start"):(r=t.area("x2"),n="end"))},this.draw=function(){var e=t.svg.getTextSize(i.text),h=e.width/2,s=e.height/2,o=t.text({x:r+i.dx,y:a+i.dy,"text-anchor":n,fill:i.color||t.theme("titleFontColor"),"font-size":i.size||t.theme("titleFontSize"),"font-weight":t.theme("titleFontWeight")},i.text);return"center"==i.orient&&("start"==i.align?o.rotate(-90,r+i.dx+h,a+i.dy+s):"end"==i.align&&o.rotate(90,r+i.dx-h,a+i.dy+s)),o}};return t.setup=function(){return{axis:null,orient:"top",align:"middle",text:"",dx:0,dy:0,size:null,color:null}},t}},z,E]),window.jui=window.JUI=a}}); | ||
!function(t){function e(e){for(var r,h,s=e[0],o=e[1],l=e[2],u=0,d=[];u<s.length;u++)h=s[u],a[h]&&d.push(a[h][0]),a[h]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r]);for(c&&c(e);d.length;)d.shift()();return n.push.apply(n,l||[]),i()}function i(){for(var t,e=0;e<n.length;e++){for(var i=n[e],r=!0,s=1;s<i.length;s++){var o=i[s];0!==a[o]&&(r=!1)}r&&(n.splice(e--,1),t=h(h.s=i[0]))}return t}var r={},a={1:0},n=[];function h(e){if(r[e])return r[e].exports;var i=r[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,h),i.l=!0,i.exports}h.m=t,h.c=r,h.d=function(t,e,i){h.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},h.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},h.t=function(t,e){if(1&e&&(t=h(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(h.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)h.d(i,r,function(e){return t[e]}.bind(null,r));return i},h.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return h.d(e,"a",e),e},h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},h.p="";var s=window.webpackJsonp=window.webpackJsonp||[],o=s.push.bind(s);s.push=e,s=s.slice();for(var l=0;l<s.length;l++)e(s[l]);var c=o;n.push([1,0]),i()}([,function(t,e,i){"use strict";i.r(e);var r=i(0).default,a={name:"chart.brush.bar",extend:"chart.brush.core",component:function(){var t=r.include("util.base"),e=function(){var e,i,r,a,n;this.getBarStyle=function(){return{borderColor:this.chart.theme("barBorderColor"),borderWidth:this.chart.theme("barBorderWidth"),borderOpacity:this.chart.theme("barBorderOpacity"),borderRadius:this.chart.theme("barBorderRadius"),disableOpacity:this.chart.theme("barDisableBackgroundOpacity"),circleColor:this.chart.theme("barPointBorderColor")}},this.getBarElement=function(e,i,r){var a=this.getBarStyle(),n=this.color(e,i),h=this.getData(e)[this.brush.target[i]],s=this.chart.svg.pathRect({width:r.width,height:r.height,fill:n,stroke:a.borderColor,"stroke-width":a.borderWidth,"stroke-opacity":a.borderOpacity});return 0!=h&&this.addEvent(s,e,i),null==this.barList&&(this.barList=[]),this.barList.push(t.extend({element:s,color:n},r)),s},this.setActiveEffect=function(t){for(var e=this.getBarStyle(),i=this.barList,r=0;r<i.length;r++){var a=i[r]==t?1:e.disableOpacity;i[r].element.attr({opacity:a}),i[r].minmax&&i[r].minmax.style(i[r].color,e.circleColor,a)}},this.drawBefore=function(){var t=this.brush.outerPadding,h=this.brush.innerPadding,s=this.brush.target.length;e=this.chart.svg.group(),i=this.axis.x(0),r=this.axis.y.rangeBand(),this.brush.size>0?(n=this.brush.size,a=n*s+(s-1)*h):n=(n=((a=r-2*t)-(s-1)*h)/s)<0?0:n},this.drawETC=function(e){if(t.typeCheck("array",this.barList)){var i=this,r=this.getBarStyle();this.active=this.drawTooltip(),e.append(this.active.tooltip);for(var a=0;a<this.barList.length;a++){var n=this.barList[a],h=this.brush.display;("max"==h&&n.max||"min"==h&&n.min||"all"==h)&&(n.minmax=this.drawTooltip(n.color,r.circleColor,1),n.minmax.control(n.position,n.tooltipX,n.tooltipY,this.format(n.value)),e.append(n.minmax.tooltip)),0!=n.value&&null!=this.brush.activeEvent&&function(t){i.active.style(t.color,r.circleColor,1),t.element.on(i.brush.activeEvent,function(e){i.active.style(t.color,r.circleColor,1),i.active.control(t.position,t.tooltipX,t.tooltipY,i.format(t.value)),i.setActiveEffect(t)}),t.element.attr({cursor:"pointer"})}(n)}null!=(n=this.barList[this.brush.active])&&(this.active.style(n.color,r.circleColor,1),this.active.control(n.position,n.tooltipX,n.tooltipY,this.format(n.value)),this.setActiveEffect(n))}},this.draw=function(){var t=this.getXY(),r=this.getBarStyle();return this.eachData(function(h,s){for(var o=this.offset("y",s)-a/2,l=0;l<this.brush.target.length;l++){var c=h[this.brush.target[l]],u=this.axis.x(c),d=o+n/2,p=u>=i?"right":"left";Math.abs(i-u)<this.brush.minSize&&(u="right"==p?u+this.brush.minSize:u-this.brush.minSize);var f=Math.abs(i-u),g=f<r.borderRadius||n<r.borderRadius?0:r.borderRadius,v=this.getBarElement(s,l,{width:f,height:n,value:c,tooltipX:u,tooltipY:d,position:p,max:t[l].max[s],min:t[l].min[s]});u>=i?(v.round(f,n,0,g,g,0),v.translate(i,o)):(v.round(f,n,g,0,0,g),v.translate(i-f,o)),e.append(v),o+=n+this.brush.innerPadding}}),this.drawETC(e),e},this.drawAnimate=function(t){var e=this.chart.svg,i=this.brush.animate;t.append(e.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.4s",repeatCount:"1",fill:"freeze"})),t.each(function(t,r){if(r.is("util.svg.element.path")){var a=r.data("translate").split(","),n=parseInt(a[0]),h=parseInt(a[1]),s=parseInt(r.attr("width")),o="right"==i?n+s:n-s;r.append(e.animateTransform({attributeName:"transform",type:"translate",from:o+" "+h,to:n+" "+h,begin:"0s",dur:"0.7s",repeatCount:"1",fill:"freeze"}))}})}};return e.setup=function(){return{size:0,minSize:0,outerPadding:2,innerPadding:1,active:null,activeEvent:null,display:null,format:null}},e}},n={name:"chart.brush.stackbar",extend:"chart.brush.bar",component:function(){var t=r.include("util.base"),e=function(e,i,r){var a,n;this.addBarElement=function(t){null==this.barList&&(this.barList=[]),this.barList.push(t)},this.getBarElement=function(t,e){var i=this.getBarStyle(),r=this.color(e),a=this.getData(t)[this.brush.target[e]],n=this.chart.svg.rect({fill:r,stroke:i.borderColor,"stroke-width":i.borderWidth,"stroke-opacity":i.borderOpacity});return 0==a&&n.attr({display:"none"}),0!=a&&this.addEvent(n,t,e),n},this.setActiveEffect=function(e){for(var i=this.getBarStyle(),r=this.barList,a=this.stackTooltips,n=0;n<r.length;n++){var h=e==r[n]?1:i.disableOpacity;a&&(1==h||-1!=t.inArray(n,this.tooltipIndexes)?a[n].attr({opacity:1}):a[n].attr({opacity:0})),r[n].attr({opacity:h})}},this.setActiveEffectOption=function(){var t=this.brush.active;this.barList&&this.barList[t]&&this.setActiveEffect(this.barList[t])},this.setActiveEvent=function(t){var e=this;t.on(e.brush.activeEvent,function(i){e.setActiveEffect(t)})},this.setActiveEventOption=function(t){null!=this.brush.activeEvent&&(this.setActiveEvent(t),t.attr({cursor:"pointer"}))},this.getTargetSize=function(){var t=this.axis.y.rangeBand();if(this.brush.size>0)return this.brush.size;var e=t-2*this.brush.outerPadding;return e<this.brush.minSize?this.brush.minSize:e},this.setActiveTooltips=function(t,e){for(var i=this.brush.display,r="min"==i?t:e,a=0;a<this.stackTooltips.length;a++)a!=r&&"all"!=i||(this.stackTooltips[a].css({opacity:1}),this.tooltipIndexes.push(a))},this.drawStackTooltip=function(t,e,i,r,a,n){var h=this.chart.theme("tooltipPointFontSize"),s="middle",o=0,l=0;"left"==n?(s="start",o=3,l=h/3):"right"==n?(s="end",o=-3,l=h/3):l="top"==n?-h/3:h;var c=this.chart.text({fill:this.chart.theme("tooltipPointFontColor"),"font-size":h,"font-weight":this.chart.theme("tooltipPointFontWeight"),"text-anchor":s,dx:o,dy:l,opacity:0}).text(this.format(i)).translate(r,a);this.stackTooltips[e]=c,t.append(c)},this.drawStackEdge=function(t){for(var e=this.chart.theme("barStackEdgeBorderWidth"),i=1;i<this.edgeData.length;i++)for(var r=this.edgeData[i-1],a=this.edgeData[i],n=0;n<this.brush.target.length;n++)a[n].width>0&&a[n].height>0&&t.append(this.svg.line({x1:r[n].x+r[n].width-r[n].ex,x2:a[n].x+a[n].dx-a[n].ex,y1:r[n].y+r[n].height-r[n].ey,y2:a[n].y+a[n].dy,stroke:a[n].color,"stroke-width":e}))},this.drawBefore=function(){a=e.svg.group(),i.y.rangeBand(),n=this.getTargetSize(),this.stackTooltips=[],this.tooltipIndexes=[],this.edgeData=[]},this.draw=function(){var h=null,s=0,o=null,l=this.axis.x.max(),c=this.axis.get("x").reverse;return this.eachData(function(u,d){for(var p=e.svg.group(),f=this.offset("y",d),g=f-n/2,v=i.x(0),m=0,x=0,y=0;y<r.target.length;y++){var b=u[r.target[y]]+m,w=i.x(b),k={x:v<w?v:w,y:g,width:Math.abs(v-w),height:n},B=this.getBarElement(d,y).attr(k);this.edgeData[d]||(this.edgeData[d]={}),this.edgeData[d][y]=t.extend({color:this.color(y),dx:k.width,dy:0,ex:c?k.width:0,ey:0},k),v=w,m=b,x+=u[r.target[y]],p.append(B)}x>s&&(s=x,h=d),x<l&&(l=x,o=d),this.drawStackTooltip(p,d,x,v,f,c?"right":"left"),this.setActiveEventOption(p),this.addBarElement(p),a.append(p)}),this.brush.edge&&this.drawStackEdge(a),null!=this.brush.display&&this.setActiveTooltips(o,h),this.setActiveEffectOption(),a}};return e.setup=function(){return{outerPadding:15,edge:!1}},e}},h={name:"chart.brush.fullstackbar",extend:"chart.brush.stackbar",component:function(){r.include("util.base");var t=function(t,e,i){var r,a;this.drawBefore=function(){r=t.svg.group(),e.x(0),e.y.rangeBand(),a=this.getTargetSize()},this.drawText=function(t,e,i){return this.chart.text({"font-size":this.chart.theme("barFontSize"),fill:this.chart.theme("barFontColor"),x:e,y:i,"text-anchor":"middle"},t+"%")},this.draw=function(){return this.eachData(function(n,h){for(var s=t.svg.group(),o=this.offset("y",h)-a/2,l=0,c=[],u=0;u<i.target.length;u++){l+=f=n[i.target[u]],c.push(f)}var d=0,p=e.x.max();for(u=c.length-1;u>=0;u--){var f=e.x.rate(c[u],l),g=this.getBarElement(h,u);if(g.attr({x:d,y:o,width:f,height:a}),s.append(g),i.showText){var v=Math.round(c[u]/l*p),m=d+f/2,x=o+a/2+5;s.append(this.drawText(v,m,x))}this.setActiveEventOption(s),d+=f}this.addBarElement(s),r.append(s)}),this.setActiveEffectOption(),r}};return t.setup=function(){return{outerPadding:15,showText:!1}},t}},s={name:"chart.brush.rangebar",extend:"chart.brush.core",component:function(){var t=function(t,e,i){var r,a,n,h,s,o,l,c,u;this.drawBefore=function(){r=t.svg.group(),s=i.outerPadding,o=i.innerPadding,a=e.y.rangeBand(),h=((n=a-2*s)-(i.target.length-1)*o)/i.target.length,l=t.theme("barBorderColor"),c=t.theme("barBorderWidth"),u=t.theme("barBorderOpacity")},this.draw=function(){return this.eachData(function(a,s){for(var d=t.svg.group(),p=this.offset("y",s)-n/2,f=0;f<i.target.length;f++){var g=a[i.target[f]],v=e.x(g[1]),m=e.x(g[0]),x=t.svg.rect({x:m,y:p,height:h,width:Math.abs(m-v),fill:this.color(f),stroke:l,"stroke-width":c,"stroke-opacity":u});this.addEvent(x,s,f),d.append(x),p+=h+o}r.append(d)}),r}};return t.setup=function(){return{outerPadding:2,innerPadding:1}},t}},o={name:"chart.brush.column",extend:"chart.brush.bar",component:function(){return function(){var t,e,i,r,a;this.drawBefore=function(){var n=this.brush.outerPadding,h=this.brush.innerPadding,s=this.brush.target.length;t=this.chart.svg.group(),e=this.axis.y(0),i=this.axis.x.rangeBand(),this.brush.size>0?(r=this.brush.size,a=r*s+(s-1)*h):(a=i-2*n,r=(r=(i-2*n-(s-1)*h)/s)<0?0:r)},this.draw=function(){var i=this.getXY(),n=this.getBarStyle();return this.eachData(function(h,s){for(var o=this.offset("x",s)-a/2,l=0;l<this.brush.target.length;l++){var c=h[this.brush.target[l]],u=o+r/2,d=this.axis.y(c),p=d<=e?"top":"bottom";Math.abs(e-d)<this.brush.minSize&&(d="top"==p?d-this.brush.minSize:d+this.brush.minSize);var f=Math.abs(e-d),g=r<n.borderRadius||f<n.borderRadius?0:n.borderRadius,v=this.getBarElement(s,l,{width:r,height:f,value:c,tooltipX:u,tooltipY:d,position:p,max:i[l].max[s],min:i[l].min[s]});d<=e?(v.round(r,f,g,g,0,0),v.translate(o,d)):(v.round(r,f,0,0,g,g),v.translate(o,e)),t.append(v),o+=r+this.brush.innerPadding}}),this.drawETC(t),t},this.drawAnimate=function(t){var e=this.chart.svg,i=this.brush.animate;t.append(e.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.4s",repeatCount:"1",fill:"freeze"})),t.each(function(t,r){if(r.is("util.svg.element.path")){var a=r.data("translate").split(","),n=parseInt(a[0]),h=parseInt(a[1]),s=parseInt(r.attr("height")),o="top"==i?h-s:h+s;r.append(e.animateTransform({attributeName:"transform",type:"translate",from:n+" "+o,to:n+" "+h,begin:"0s",dur:"0.7s",repeatCount:"1",fill:"freeze"}))}})}}}},l={name:"chart.brush.stackcolumn",extend:"chart.brush.stackbar",component:function(){var t=r.include("util.base");return function(e,i,r){var a,n;this.getTargetSize=function(){var t=this.axis.x.rangeBand();if(this.brush.size>0)return this.brush.size;var e=t-2*this.brush.outerPadding;return e<this.brush.minSize?this.brush.minSize:e},this.drawBefore=function(){a=e.svg.group(),i.y(0),n=this.getTargetSize(),this.stackTooltips=[],this.tooltipIndexes=[],this.edgeData=[]},this.draw=function(){var h=null,s=0,o=null,l=this.axis.y.max(),c=this.axis.get("y").reverse;return this.eachData(function(u,d){for(var p=e.svg.group(),f=this.offset("x",d),g=f-n/2,v=i.y(0),m=0,x=0,y=0;y<r.target.length;y++){var b=u[r.target[y]]+m,w=i.y(b),k={x:g,y:v>w?w:v,width:n,height:Math.abs(v-w)},B=this.getBarElement(d,y).attr(k);this.edgeData[d]||(this.edgeData[d]={}),this.edgeData[d][y]=t.extend({color:this.color(y),dx:0,dy:c?k.height:0,ex:0,ey:c?0:k.height},k),v=w,m=b,x+=u[r.target[y]],p.append(B)}x>s&&(s=x,h=d),x<l&&(l=x,o=d),this.drawStackTooltip(p,d,x,f,v,c?"bottom":"top"),this.setActiveEventOption(p),this.addBarElement(p),a.append(p)}),this.brush.edge&&this.drawStackEdge(a),null!=this.brush.display&&this.setActiveTooltips(o,h),this.setActiveEffectOption(),a}}}},c={name:"chart.brush.fullstackcolumn",extend:"chart.brush.fullstackbar",component:function(){return function(t,e,i){var r,a;this.getTargetSize=function(){var t=this.axis.x.rangeBand(),e=0;return(e=this.brush.size>0?this.brush.size:t-2*this.brush.outerPadding)<0?0:e},this.drawBefore=function(){r=t.svg.group(),e.y(0),a=this.getTargetSize()},this.draw=function(){var n=e.area("height");return this.eachData(function(h,s){for(var o=t.svg.group(),l=this.offset("x",s)-a/2,c=0,u=[],d=0;d<i.target.length;d++)c+=g=h[i.target[d]],u.push(g);var p=0,f=e.y.max();for(d=u.length-1;d>=0;d--){var g=n-e.y.rate(u[d],c),v=this.getBarElement(s,d);if(isNaN(l)||isNaN(p)||isNaN(g)||v.attr({x:l,y:p,width:a,height:g}),o.append(v),i.showText){var m=Math.round(u[d]/c*f),x=l+a/2,y=p+g/2+8;isNaN(x)||isNaN(y)||o.append(this.drawText(m,x,y))}this.setActiveEventOption(o),p+=g}this.addBarElement(o),r.append(o)}),this.setActiveEffectOption(),r}}}},u={name:"chart.brush.rangecolumn",extend:"chart.brush.core",component:function(){var t=function(t,e,i){var r,a,n,h,s,o,l,c,u;this.drawBefore=function(){r=t.svg.group(),s=i.outerPadding,o=i.innerPadding,a=e.x.rangeBand(),h=a-2*s,n=(a-2*s-(i.target.length-1)*o)/i.target.length,l=t.theme("columnBorderColor"),c=t.theme("columnBorderWidth"),u=t.theme("columnBorderOpacity")},this.draw=function(){return this.eachData(function(a,s){for(var d=this.offset("x",s)-h/2,p=0;p<i.target.length;p++){var f=a[i.target[p]],g=e.y(f[1]),v=e.y(f[0]),m=t.svg.rect({x:d,y:g,width:n,height:Math.abs(v-g),fill:this.color(p),stroke:l,"stroke-width":c,"stroke-opacity":u});this.addEvent(m,s,p),r.append(m),d+=n+o}}),r}};return t.setup=function(){return{outerPadding:2,innerPadding:1}},t}},d={name:"chart.brush.line",extend:"chart.brush.core",component:function(){var t=r.include("util.base"),e=function(){var e,i,r,a,n,h;this.setActiveEffect=function(t){for(var e=this.lineList,a=0;a<e.length;a++){var n=t==e[a].element?h:r,s=e[a].element.get(0).attr("stroke");null!=e[a].tooltip&&e[a].tooltip.style(s,i,n),e[a].element.attr({opacity:n})}},this.addLineElement=function(t){this.lineList||(this.lineList=[]),this.lineList.push(t)},this.createLine=function(e,i){var r=e.x,h=e.y,s=e.value,o="curve"==this.brush.symbol?this.curvePoints(r):null,l="curve"==this.brush.symbol?this.curvePoints(h):null,c=null,u=null,d={"stroke-width":a,"stroke-dasharray":n,fill:"transparent",cursor:null!=this.brush.activeEvent?"pointer":"normal"},p=this.svg.group(),f=null;if(e.length>0)for(var g=null,v=null,m=0;m<r.length-1;m++)if(t.typeCheck(["undefined","null"],s[m])||(g=m),t.typeCheck(["undefined","null"],s[m+1])||(v=m+1),null!=g&&null!=v&&g!=v){var x=this.color(m,i),y=this.getOpacity(m);if(c!=x||u!=y?((f=this.svg.path(t.extend({"stroke-opacity":y,stroke:x,x1:r[g]},d))).css({"pointer-events":"stroke"}),f.MoveTo(r[g],h[g]),p.append(f),c=x,u=y):f.attr({x2:r[v]}),"curve"==this.brush.symbol)f.CurveTo(o.p1[g],l.p1[g],o.p2[g],l.p2[g],r[v],h[v]);else{if("step"==this.brush.symbol){var b=r[g]+(r[v]-r[g])/2;f.LineTo(b,h[g]),f.LineTo(b,h[v])}f.LineTo(r[v],h[v])}}return p},this.createTooltip=function(t,e,r){for(var a=this.brush.display,n=0;n<e.x.length;n++)if("max"==a&&e.max[n]||"min"==a&&e.min[n]||"all"==a){var s="max"==a&&e.max[n]?"top":"bottom",o=this.lineList[r].tooltip;if("all"==a||null==o){var l=this.drawTooltip(this.color(r),i,h);l.control(s,+e.x[n],+e.y[n],this.format(e.value[n])),t.append(l.tooltip),this.lineList[r].tooltip=l}}},this.getOpacity=function(e){var i=this.brush.opacity,r=this.chart.theme("lineBorderOpacity");return t.typeCheck("function",i)&&t.typeCheck("number",e)?i.call(this.chart,this.getData(e),e):t.typeCheck("number",i)?i:r},this.drawLine=function(t){for(var i=this,r=0;r<t.length;r++){var a=this.createLine(t[r],r);this.addEvent(a,null,r),e.append(a),this.addLineElement({element:a,tooltip:null}),null!=this.brush.display&&this.createTooltip(e,t[r],r),null!=this.brush.activeEvent&&function(t){t.on(i.brush.activeEvent,function(e){i.setActiveEffect(t)})}(a)}for(r=0;r<t.length;r++)this.brush.active==this.brush.target[r]&&this.setActiveEffect(this.lineList[r].element);return e},this.drawBefore=function(){e=this.chart.svg.group(),i=this.chart.theme("linePointBorderColor"),r=this.chart.theme("lineDisableBorderOpacity"),a=this.chart.theme("lineBorderWidth"),n=this.chart.theme("lineBorderDashArray"),h=this.getOpacity(null)},this.draw=function(){return this.drawLine(this.getXY())},this.drawAnimate=function(t){var e=this.chart.svg;t.each(function(t,i){if(i.is("util.svg.element.path")){var r=i.attributes["stroke-dasharray"],a=i.length();"none"==r?(i.attr({"stroke-dasharray":a}),i.append(e.animate({attributeName:"stroke-dashoffset",from:a,to:"0",begin:"0s",dur:"1s",repeatCount:"1"}))):i.append(e.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.5s",repeatCount:"1",fill:"freeze"}))}})}};return e.setup=function(){return{symbol:"normal",active:null,activeEvent:null,display:null,opacity:null}},e}},p={name:"chart.brush.area",extend:"chart.brush.line",component:function(){var t=r.include("util.base"),e=function(){this.drawArea=function(e){for(var i=this.chart.svg.group(),r=this.axis.y(this.brush.startZero?0:this.axis.y.min()),a=t.typeCheck("number",this.brush.opacity)?this.brush.opacity:this.chart.theme("areaBackgroundOpacity"),n=0;n<e.length;n++){for(var h=this.createLine(e[n],n).children,s=0;s<h.length;s++){var o=h[s];t.typeCheck("function",this.brush.opacity)&&(a=o.attr("stroke-opacity")),e[n].length>0&&(o.LineTo(o.attr("x2"),r),o.LineTo(o.attr("x1"),r),o.ClosePath()),o.attr({fill:o.attr("stroke"),"fill-opacity":a,"stroke-width":0}),i.prepend(o)}this.brush.line&&i.prepend(this.createLine(e[n],n)),this.addEvent(i,null,n)}return i},this.draw=function(){return this.drawArea(this.getXY())},this.drawAnimate=function(t){t.append(this.chart.svg.animate({attributeName:"opacity",from:"0",to:"1",begin:"0s",dur:"1.5s",repeatCount:"1",fill:"freeze"}))}};return e.setup=function(){return{symbol:"normal",active:null,activeEvent:null,display:null,startZero:!0,line:!0}},e}},f={name:"chart.brush.scatter",extend:"chart.brush.core",component:function(){var t=r.include("util.base"),e=function(){this.getSymbolType=function(e,i){var r=this.brush.symbol,a=this.brush.target[e];if(t.typeCheck("function",r)){var n=r.apply(this.chart,[a,i]);return"triangle"==n||"cross"==n||"rectangle"==n||"rect"==n||"circle"==n?{type:"default",uri:n}:{type:"image",uri:n}}return{type:"default",uri:r}},this.createScatter=function(t,e,i,r){var a=this,n=null,h=this.brush.size,s=this.brush.size,o=this.color(e,i),l=this.chart.theme("scatterBorderColor"),c=this.chart.theme("scatterBorderWidth"),u=this.brush.opacity;return"image"==r.type?n=this.chart.svg.image({"xlink:href":r.uri,width:h+c,height:s+c,x:t.x-h/2-c,y:t.y-s/2}):(n="triangle"==r.uri||"cross"==r.uri?this.chart.svg.group({width:h,height:s,opacity:u},function(){"triangle"==r.uri?a.chart.svg.polygon().point(0,s).point(h,s).point(h/2,0):(a.chart.svg.line({stroke:o,"stroke-width":2*c,x1:0,y1:0,x2:h,y2:s}),a.chart.svg.line({stroke:o,"stroke-width":2*c,x1:0,y1:h,x2:s,y2:0}))}).translate(t.x-h/2,t.y-s/2):"rectangle"==r.uri||"rect"==r.uri?this.chart.svg.rect({width:h,height:s,x:t.x-h/2,y:t.y-s/2,opacity:u}):this.chart.svg.ellipse({rx:h/2,ry:s/2,cx:t.x,cy:t.y,opacity:u}),"cross"!=r.uri&&n.attr({fill:o,stroke:l,"stroke-width":c}).hover(function(){if(n!=a.activeScatter){var t={fill:a.chart.theme("scatterHoverColor"),stroke:o,"stroke-width":2*c,opacity:u};if(a.brush.hoverSync)for(var i=0;i<a.cachedSymbol[e].length;i++)t.stroke=a.color(e,i),a.cachedSymbol[e][i].attr(t);else n.attr(t)}},function(){if(n!=a.activeScatter){var t={fill:o,stroke:l,"stroke-width":c,opacity:a.brush.hide?0:u};if(a.brush.hoverSync)for(var i=0;i<a.cachedSymbol[e].length;i++)t.fill=a.color(e,i),a.cachedSymbol[e][i].attr(t);else n.attr(t)}})),n},this.drawScatter=function(e){this.cachedSymbol={};for(var i=this,r=this.chart.svg.group(),a=this.chart.theme("scatterBorderColor"),n=this.chart.theme("scatterBorderWidth"),h=this.brush.opacity,s=!1,o=0;o<e.length;o++)for(var l=0;l<e[o].length;l++)if(this.cachedSymbol[l]||(this.cachedSymbol[l]=[]),!this.brush.hideZero||0!==e[o].value[l]){var c={x:e[o].x[l],y:e[o].y[l],max:e[o].max[l],min:e[o].min[l],value:e[o].value[l]};if(!t.typeCheck(["undefined","null"],c.value)){var u=this.getSymbolType(o,c.value),d=this.createScatter(c,l,o,u),p=this.brush.display;"default"==u.type&&"cross"!=u.uri&&this.cachedSymbol[l].push(d),("max"==p&&c.max||"min"==p&&c.min||"all"==p)&&("all"!=p&&s||(r.append(this.drawTooltip(c.x,c.y,this.format(c.value))),s=!0)),null!=this.brush.activeEvent&&function(t,e,r,s){var o=e.x,l=e.y,c=i.format(e.value);t.on(i.brush.activeEvent,function(e){"default"==s.type&&"cross"!=s.uri&&(null!=i.activeScatter&&i.activeScatter.attr({fill:i.activeScatter.attributes.stroke,stroke:a,"stroke-width":n,opacity:i.brush.hide?0:h}),i.activeScatter=t,i.activeScatter.attr({fill:i.chart.theme("scatterHoverColor"),stroke:r,"stroke-width":2*n,opacity:h})),i.activeTooltip.html(c),i.activeTooltip.translate(o,l)}),t.attr({cursor:"pointer"})}(d,c,this.color(l,o),this.getSymbolType(o,c.value)),this.brush.hide&&d.attr({opacity:0}),this.addEvent(d,l,o),r.append(d)}}return this.activeTooltip=this.drawTooltip(0,0,""),r.append(this.activeTooltip),r},this.drawTooltip=function(t,e,i){return this.chart.text({y:-this.brush.size,"text-anchor":"middle",fill:this.chart.theme("tooltipPointFontColor"),"font-size":this.chart.theme("tooltipPointFontSize"),"font-weight":this.chart.theme("tooltipPointFontWeight"),opacity:this.brush.opacity},i).translate(t,e)},this.draw=function(){return this.drawScatter(this.getXY())},this.drawAnimate=function(){var t=this.chart.area();return this.chart.svg.animateTransform({attributeName:"transform",type:"translate",from:t.x+" "+t.height,to:t.x+" "+t.y,begin:"0s",dur:"0.4s",repeatCount:"1"})}};return e.setup=function(){return{symbol:"circle",size:7,hide:!1,hideZero:!1,hoverSync:!1,activeEvent:null,display:null,opacity:1,clip:!1}},e}},g={name:"chart.brush.bubble",extend:"chart.brush.core",component:function(){var t=r.include("util.base"),e=r.include("util.math"),i=function(){var i=this,r=null,a=null;this.getFormatText=function(e,i){return t.typeCheck("function",this.brush.format)?this.format(this.axis.data[i]):e},this.getBubbleRadius=function(i,n){var h=this.brush.scaleKey;if(null!=h){var s=this.axis.data[n][h];i=t.typeCheck("number",s)?s:i}return e.scaleValue(i,r,a,this.brush.min,this.brush.max)},this.createBubble=function(t,e,i){var r=this.getBubbleRadius(t.value,i),a=this.svg.group().translate(t.x,t.y);if(a.append(this.svg.circle({r:r,fill:e,"fill-opacity":this.chart.theme("bubbleBackgroundOpacity"),stroke:e,"stroke-width":this.chart.theme("bubbleBorderWidth")})),this.brush.showText){var n=this.getFormatText(t.value,i);a.append(this.chart.text({"font-size":this.chart.theme("bubbleFontSize"),fill:this.chart.theme("bubbleFontColor"),"text-anchor":"middle",dy:3}).text(n))}return this.bubbleList.push(a),a},this.setActiveEffect=function(t){for(var e=this.bubbleList,i=0;i<e.length;i++){var r=e[i]==t?1:this.chart.theme("bubbleBackgroundOpacity");e[i].get(0).attr({opacity:r}),e[i].get(1).attr({opacity:r})}},this.drawBubble=function(t){for(var e=this.svg.group(),r=0;r<t.length;r++)for(var a=0;a<t[r].x.length;a++){var n=this.createBubble({x:t[r].x[a],y:t[r].y[a],value:t[r].value[a]},this.color(a,r),a);null!=this.brush.activeEvent&&function(t){t.on(i.brush.activeEvent,function(e){i.setActiveEffect(t)}),t.attr({cursor:"pointer"})}(n),this.addEvent(n,a,r),e.append(n)}var h=this.bubbleList[this.brush.active];return null!=h&&this.setActiveEffect(h),e},this.drawBefore=function(){var t=this.brush.scaleKey;if(null!=t){for(var e=[],i=0;i<this.axis.data.length;i++)e.push(this.axis.data[i][t]);r=Math.min.apply(this,e),a=Math.max.apply(this,e)}else r=this.axis.y.min(),a=this.axis.y.max();this.bubbleList=[]},this.draw=function(){return this.drawBubble(this.getXY())},this.drawAnimate=function(t){t.each(function(t,e){var r=e.children[0];r.append(i.svg.animateTransform({attributeType:"xml",attributeName:"transform",type:"scale",from:"0",to:"1",dur:"0.7s",fill:"freeze",repeatCount:"1"})),r.append(i.svg.animate({attributeType:"xml",attributeName:"fill-opacity",from:"0",to:i.chart.theme("bubbleBackgroundOpacity"),dur:"1.4s",repeatCount:"1",fill:"freeze"}))})}};return i.setup=function(){return{min:5,max:30,scaleKey:null,showText:!1,format:null,active:null,activeEvent:null}},i}},v={name:"chart.brush.pie",extend:"chart.brush.core",component:function(){var t=r.include("util.base"),e=r.include("util.math"),i=r.include("util.color"),a=function(){var r,a=this,n=0,h=0,s=1,o={};this.setActiveEvent=function(t,i,r,a){var n=this.chart.theme("pieActiveDistance"),h=Math.cos(e.radian(a))*n,s=Math.sin(e.radian(a))*n;t.translate(i+h,r+s)},this.setActiveTextEvent=function(t,i,r,a,n,h){var s=h?this.chart.theme("pieActiveDistance"):0,o=i+Math.cos(e.radian(a))*((n+s)/2),l=r+Math.sin(e.radian(a))*((n+s)/2);t.translate(o,l)},this.getFormatText=function(t,e,i){var r=t;return"function"==typeof this.brush.format?this.format(r,e,i):e?r+": "+this.format(e):r},this.drawPie=function(t,i,r,a,n,h){var s=this.chart.svg.group();if(360==n){var o=this.chart.svg.circle({cx:t,cy:i,r:r,fill:h,stroke:this.chart.theme("pieBorderColor")||h,"stroke-width":this.chart.theme("pieBorderWidth")});return s.append(o),s}var l=this.chart.svg.path({fill:h,stroke:this.chart.theme("pieBorderColor")||h,"stroke-width":this.chart.theme("pieBorderWidth")}),c=e.rotate(0,-r,e.radian(a)),u=c.x,d=c.y;return l.MoveTo(u,d),c=e.rotate(u,d,e.radian(n)),s.translate(t,i),l.Arc(r,r,0,n>180?1:0,1,c.x,c.y).LineTo(0,0).ClosePath(),s.append(l),s.order=1,s},this.drawPie3d=function(t,i,r,a,n,h){var s=this.chart.svg.group(),o=this.chart.svg.path({fill:h,stroke:this.chart.theme("pieBorderColor")||h,"stroke-width":this.chart.theme("pieBorderWidth")}),l=e.rotate(0,-r,e.radian(a)),c=l.x,u=l.y;o.MoveTo(c,u),l=e.rotate(c,u,e.radian(n)),s.translate(t,i),o.Arc(r,r,0,n>180?1:0,1,l.x,l.y);var d=l.y+10,p=l.x+5,f=c+5,g=u+10;return o.LineTo(p,d),o.Arc(r,r,0,n>180?1:0,0,f,g),o.ClosePath(),s.append(o),s.order=1,s},this.drawText=function(t,i,r,a,o){var l=this.svg.group({visibility:this.brush.showText?"visible":"hidden"}),c=r+90>180;if(""===o||!o)return l;if("inside"==this.brush.showText){var u=t+Math.cos(e.radian(r))*(a/2),d=i+Math.sin(e.radian(r))*(a/2);(o=this.chart.text({"font-size":this.chart.theme("pieInnerFontSize"),fill:this.chart.theme("pieInnerFontColor"),"text-anchor":"middle",y:3},o)).translate(u,d),l.append(o),l.order=2}else{var p=this.chart.theme("pieOuterLineRate");if(Math.abs(r-n)<2)0==h&&(h=p),h-=.05*p,s-=.25;else h=p,s=1;if(h>1.2){var f=this.chart.theme("pieOuterLineSize"),g=a*h,v=(u=t+Math.cos(e.radian(r))*a,d=i+Math.sin(e.radian(r))*a,t+Math.cos(e.radian(r))*g),m=i+Math.sin(e.radian(r))*g,x=c?v-f:v+f,y=this.svg.path({fill:"transparent",stroke:this.chart.theme("pieOuterLineColor"),"stroke-width":this.chart.theme("pieOuterLineWidth"),"stroke-opacity":s});y.MoveTo(u,d).LineTo(v,m).LineTo(x,m),(o=this.chart.text({"font-size":this.chart.theme("pieOuterFontSize"),fill:this.chart.theme("pieOuterFontColor"),"fill-opacity":s,"text-anchor":c?"end":"start",y:3},o)).translate(x+(c?-3:3),m),l.append(o),l.append(y),l.order=0,n=r}}return l},this.drawUnit=function(e,r,n){for(var h=this.getProperty(e),s=h.centerX,l=h.centerY,c=h.outerRadius,u=this.brush.target,d=this.brush.active,p=0,f=0,g=0;g<u.length;g++)f+=r[u[g]];for(g=0;g<u.length;g++)if(0!=r[u[g]]){var v=(x=r[u[g]])/f*360;if(this.brush["3d"]){var m=this.drawPie3d(s,l,c,p,v,i.darken(this.color(g),.5));n.append(m)}p+=v}p=0;for(g=0;g<u.length;g++){var x,y=p+(v=(x=r[u[g]])/f*360)/2-90,b=360==Math.abs(p-v),w=this.drawPie(s,l,c,p,v,this.color(g)),k=this.drawText(s,l,y,c,this.getFormatText(u[g],x,f));b||(d!=u[g]&&-1==t.inArray(u[g],d)||("inside"==this.brush.showText&&this.setActiveTextEvent(k.get(0),s,l,y,c,!0),this.setActiveEvent(w,s,l,y),o[y]=!0),null!=this.brush.activeEvent&&function(t,e,i,r,n,h){t.on(a.brush.activeEvent,function(s){o[n]?("inside"==a.brush.showText&&a.setActiveTextEvent(e,i,r,n,h,!1),t.translate(i,r),o[n]=!1):("inside"==a.brush.showText&&a.setActiveTextEvent(e,i,r,n,h,!0),a.setActiveEvent(t,i,r,n),o[n]=!0)}),t.attr({cursor:"pointer"})}(w,k.get(0),s,l,y,c)),a.addEvent(w,e,g),n.append(w),n.append(k),p+=v}},this.drawNoData=function(t){var e=this.getProperty(0);t.append(this.drawPie(e.centerX,e.centerY,e.outerRadius,0,360,this.chart.theme("pieNoDataBackgroundColor")))},this.drawBefore=function(){r=this.chart.svg.group()},this.draw=function(){return 0==this.listData().length?this.drawNoData(r):this.eachData(function(t,e){this.drawUnit(e,t,r)}),r},this.getProperty=function(t){var e=this.axis.c(t),i=e.width,r=e.height,a=e.x,n=e.y,h=i;return r<h&&(h=r),{centerX:i/2+a,centerY:r/2+n,outerRadius:h/2}}};return a.setup=function(){return{clip:!1,showText:null,format:null,"3d":!1,active:null,activeEvent:null}},a}},m={name:"chart.brush.donut",extend:"chart.brush.pie",component:function(){var t=r.include("util.base"),e=r.include("util.math"),i=r.include("util.color"),a=function(){var r=this,a={};this.drawDonut=function(t,i,r,a,n,h,s){s["stroke-width"]=a-r,h>=360&&(h=359.9999);var o=this.chart.svg.group(),l=this.chart.svg.path(s),c=(Math.abs(a-r),e.rotate(0,-a,e.radian(n))),u=c.x,d=c.y;return l.MoveTo(u,d),c=e.rotate(u,d,e.radian(h)),o.translate(t,i),l.Arc(a,a,0,h>180?1:0,1,c.x,c.y),l.css({"pointer-events":"stroke"}),o.append(l),o.order=1,o},this.drawDonut3d=function(t,i,r,a,n,h,s){var o=this.chart.svg.group(),l=this.chart.svg.path(s),c=Math.abs(a-r);r=(a+=c/2)-c;var u=e.rotate(0,-a,e.radian(n)),d=u.x,p=u.y,f=e.rotate(0,-r,e.radian(n)),g=f.x,v=f.y;l.MoveTo(d,p),u=e.rotate(d,p,e.radian(h)),f=e.rotate(g,v,e.radian(h)),o.translate(t,i),l.Arc(a,a,0,h>180?1:0,1,u.x,u.y);var m=u.y+10,x=u.x+5,y=f.y+10,b=f.x+5,w=d+5,k=p+10,B=g+5,C=v+10;l.LineTo(x,m),l.Arc(a,a,0,h>180?1:0,0,w,k),l.ClosePath(),o.append(l);var T=this.chart.svg.path(s);return T.MoveTo(g,v),T.Arc(r,r,0,h>180?1:0,1,f.x,f.y),T.LineTo(b,y),T.Arc(r,r,0,h>180?1:0,0,B,C),T.ClosePath(),o.append(T),o.order=1,o},this.drawDonut3dBlock=function(t,i,r,a,n,h,s){var o=this.chart.svg.group(),l=this.chart.svg.path(s),c=Math.abs(a-r);r=(a+=c/2)-c;var u=e.rotate(0,-a,e.radian(n)),d=u.x,p=u.y,f=e.rotate(0,-r,e.radian(n)),g=f.x,v=f.y;l.MoveTo(d,p),u=e.rotate(d,p,e.radian(h)),f=e.rotate(g,v,e.radian(h)),o.translate(t,i);var m=u.y+10,x=u.x+5,y=f.y+10,b=f.x+5,w=this.chart.svg.path(s);return w.MoveTo(u.x,u.y).LineTo(x,m).LineTo(b,y).LineTo(f.x,f.y).ClosePath(),o.append(w),o.order=1,o},this.drawUnit=function(e,n,h){for(var s=this.getProperty(e),o=s.centerX,l=s.centerY,c=s.innerRadius,u=s.outerRadius,d=this.brush.target,p=this.brush.active,f=0,g=0,v=0,m=0;m<d.length;m++)g+=n[d[m]];if(this.brush["3d"]){for(m=0;m<d.length;m++){var x=(b=n[d[m]])/g*360,y=this.drawDonut3dBlock(o,l,c,u,f,x,{fill:i.darken(this.color(m),.5)},m==d.length-1);h.append(y),f+=x}f=0;for(m=0;m<d.length;m++){x=(b=n[d[m]])/g*360,y=this.drawDonut3d(o,l,c,u,f,x,{fill:i.darken(this.color(m),.5)},m==d.length-1);h.append(y),f+=x}}f=0;for(m=0;m<d.length;m++)if(0!=n[d[m]]){var b,w=f+(x=(b=n[d[m]])/g*360)/2-90,k=360==Math.abs(f-x),B="inside"==this.brush.showText?this.brush.size+c+u:u,C=this.drawDonut(o,l,c,u,f,x,{stroke:this.color(m),fill:"transparent"}),T=this.drawText(o,l,w,B,this.getFormatText(d[m],b));k||(p!=d[m]&&-1==t.inArray(d[m],p)||("inside"==this.brush.showText&&this.setActiveTextEvent(T.get(0),o,l,w,B,!0),this.setActiveEvent(C,o,l,w),a[w]=!0),null!=this.brush.activeEvent&&function(t,e,i,n,h,s){t.on(r.brush.activeEvent,function(o){a[h]?("inside"==r.brush.showText&&r.setActiveTextEvent(e,i,n,h,s,!1),t.translate(i,n),a[h]=!1):("inside"==r.brush.showText&&r.setActiveTextEvent(e,i,n,h,s,!0),r.setActiveEvent(t,i,n,h),a[h]=!0)}),t.attr({cursor:"pointer"})}(C,T.get(0),o,l,w,B)),this.addEvent(C,e,m),h.append(C),h.append(T),f+=x,v+=b}this.brush.showValue&&this.drawTotalValue(h,o,l,v)},this.drawNoData=function(t){var e=this.getProperty(0);t.append(this.drawDonut(e.centerX,e.centerY,e.innerRadius,e.outerRadius,0,360,{stroke:this.chart.theme("pieNoDataBackgroundColor"),fill:"transparent"})),this.brush.showValue&&this.drawTotalValue(t,e.centerX,e.centerY,0)},this.drawTotalValue=function(t,e,i,r){var a=this.chart.theme("pieTotalValueFontSize"),n=this.chart.text({"font-size":a,"font-weight":this.chart.theme("pieTotalValueFontWeight"),fill:this.chart.theme("pieTotalValueFontColor"),"text-anchor":"middle",dy:a/3},this.format(r));n.translate(e,i),t.append(n)},this.getProperty=function(t){var e=this.axis.c(t),i=e.width,r=e.height,a=e.x,n=e.y,h=i;r<h&&(h=r),this.brush.size>=h/2&&(this.brush.size=h/4);var s=h/2-this.brush.size/2;return{centerX:i/2+a,centerY:r/2+n,outerRadius:s,innerRadius:s-this.brush.size}}};return a.setup=function(){return{size:50,showValue:!1}},a}};r.define("util.treemap",[],function(){return{sumArray:function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i];return e}}}),r.define("chart.brush.treemap.node",[],function(){return function(t){var e=this;this.text=t.text,this.value=t.value,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.index=null,this.nodenum=null,this.parent=null,this.children=[],this.depth=0,this.reload=function(t){this.nodenum=isNaN(t)?this.nodenum:t,e.parent&&(null==this.parent.index?this.index=""+this.nodenum:this.index=e.parent.index+"."+this.nodenum),this.parent&&"string"==typeof e.index&&(this.depth=this.index.split(".").length),this.children.length>0&&function t(e){for(var i=e.children,r=0;r<i.length;r++)i[r].children.length>0&&t(i[r])}(this)},this.isLeaf=function(){return 0==this.children.length},this.appendChild=function(t){this.children.push(t)},this.insertChild=function(t,e){var i=this.children.splice(0,t);i.push(e),this.children=i.concat(this.children)},this.removeChild=function(t){for(var e=0;e<this.children.length;e++)this.children[e].index==t&&this.children.splice(e,1)},this.lastChild=function(){return this.children.length>0?this.children[this.children.length-1]:null},this.lastChildLeaf=function(t){var e=t||this.lastChild();return e.isLeaf()?e:this.lastChildLeaf(e.lastChild())}}}),r.define("chart.brush.treemap.nodemanager",["util.base","chart.brush.treemap.node"],function(t,e){return function(){var i=this,r=new e({text:null,value:-1,x:-1,y:-1,width:-1,height:-1}),a=t.index();function n(t,i,r){var a=new e(t);return a.parent=r||null,a.reload(i),a}function h(t,e){var i=e.children;if(i.length>0)for(var r=0;r<i.length;r++)t.push(i[r]),i[r].children.length>0&&h(t,i[r])}this.appendNode=function(){var t=arguments[0],e=arguments[1];return e?function(t,e){var r=i.getNode(t),a=n(e,r.children.length,r);return r.appendChild(a),a}(t,e):function(t){var e=n(t,r.children.length,r);return r.appendChild(e),e}(t)},this.insertNode=function(t,e){return 0==r.children.length&&0==parseInt(t)?this.appendNode(e):function(t,e){var r=a.getIndexList(t),h=i.getNodeParent(t),s=r[r.length-1],o=n(e,s,h);return h.insertChild(s,o),o}(t,e)},this.updateNode=function(t,e){var i=this.getNode(t);for(var r in e)i.data[r]=e[r];return i.reload(i.nodenum,!0),i},this.getNode=function(t){if(null==t)return r.children;var e=r.children;if(a.isIndexDepth(t)){var i=a.getIndexList(t);return function t(e,i){if(!i)return null;var r=e.shift();return void 0==r?i:t(e,i.children[r])}(i,e[i.shift()])}return e[t]?e[t]:null},this.getNodeAll=function(t){for(var e=[],i=null==t?r.children:[this.getNode(t)],a=0;a<i.length;a++)i[a]&&(e.push(i[a]),i[a].children.length>0&&h(e,i[a]));return e},this.getNodeParent=function(t){var e=a.getIndexList(t);return 1==e.length?r:2==e.length?this.getNode(e[0]):e.length>2?(e.pop(),this.getNode(e.join("."))):void 0},this.getRoot=function(){return r}}}),r.define("chart.brush.treemap.container",["util.treemap"],function(t){var e=function(i,r,a,n){this.xoffset=i,this.yoffset=r,this.height=n,this.width=a,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(e){var i=[],r=this.xoffset,a=this.yoffset,n=t.sumArray(e)/this.height,h=t.sumArray(e)/this.width;if(this.width>=this.height)for(var s=0;s<e.length;s++)i.push([r,a,r+n,a+e[s]/n]),a+=e[s]/n;else for(s=0;s<e.length;s++)i.push([r,a,r+e[s]/h,a+h]),r+=e[s]/h;return i},this.cutArea=function(t){if(this.width>=this.height){var i=t/this.height,r=this.width-i;return new e(this.xoffset+i,this.yoffset,r,this.height)}var a=t/this.width,n=this.height-a;return new e(this.xoffset,this.yoffset+a,this.width,n)}};return e}),r.define("chart.brush.treemap.calculator",["util.base","util.treemap","chart.brush.treemap.container"],function(t,e,i){function r(t,r,n,h,s){return h=void 0===h?0:h,s=void 0===s?0:s,function(t){var e=[];if(t)for(var i=0;i<t.length;i++)for(var r=0;r<t[i].length;r++)e.push(t[i][r]);return e}(function t(i,r,n,h){var s;var o;var l;if(0===i.length)return void h.push(n.getCoordinates(r));s=n.shortestEdge();o=i[0];!function(t,e,i){var r;if(0===t.length)return!0;(r=t.slice()).push(e);var n=a(t,i),h=a(r,i);return n>=h}(r,o,s)?(l=n.cutArea(e.sumArray(r),h),h.push(n.getCoordinates(r)),t(i,[],l,h)):(r.push(o),t(i.slice(1),r,n,h));return h}(function(t,i){for(var r=[],a=i/e.sumArray(t),n=0;n<t.length;n++)r[n]=t[n]*a;return r}(t,r*n),[],new i(h,s,r,n),[]))}function a(t,i){var r=Math.min.apply(Math,t),a=Math.max.apply(Math,t),n=e.sumArray(t);return Math.max(Math.pow(i,2)*a/Math.pow(n,2),Math.pow(n,2)/(Math.pow(i,2)*r))}function n(i){var r=0;if(t.typeCheck("array",i[0]))for(var a=0;a<i.length;a++)r+=n(i[a]);else r=e.sumArray(i);return r}return function e(i,a,h,s,o){s=void 0===s?0:s,o=void 0===o?0:o;var l,c=[],u=[];if(t.typeCheck("array",i[0])){for(var d=0;d<i.length;d++)c[d]=n(i[d]);for(l=r(c,a,h,s,o),d=0;d<i.length;d++)u.push(e(i[d],l[d][2]-l[d][0],l[d][3]-l[d][1],l[d][0],l[d][1]))}else u=r(i,a,h,s,o);return u}});var x={name:"chart.brush.treemap",extend:"chart.brush.core",component:function(){var t=r.include("util.base"),e=r.include("chart.brush.treemap.calculator"),i=r.include("chart.brush.treemap.nodemanager"),a=3,n=function(){var r=new i,n={};function h(t,e,i,r){r||(r=[]);for(var a=0;a<e.length;a++)0==e[a].children.length?r.push(e[a][t]):h(t,e[a].children,i,[]);return i.push(r),i}function s(t){return 0!=t.width||0!=t.height||0!=t.x||0!=t.y}function o(e,i,r,h,s){var o=e.chart.theme("treemapTitleFontSize"),l=function t(e,i,r){if(0==e.children.length)return{x:Math.min(i,e.x),y:Math.min(r,e.y)};for(var a=0;a<e.children.length;a++)return t(e.children[a],i,r)}(r,e.axis.area("width"),e.axis.area("height")),c=e.chart.text({"font-size":o,"font-weight":"bold",fill:e.chart.theme("treemapTitleFontColor"),x:h+l.x+a,y:s+l.y+o,"text-anchor":"start"},t.typeCheck("function",e.brush.format)?e.format(r):r.text);i.append(c),n[r.index]=!0}function l(t){return t.parent.depth>0?l(t.parent):t.nodenum}this.drawBefore=function(){for(var i=0;i<this.axis.data.length;i++){var a=this.axis.data[i],n=this.getValue(a,"index");r.insertNode(n,{text:this.getValue(a,"text",""),value:this.getValue(a,"value",0),x:this.getValue(a,"x",0),y:this.getValue(a,"y",0),width:this.getValue(a,"width",0),height:this.getValue(a,"height",0)})}var s=r.getNode(),o=h("value",s,[]);!function e(i,a){for(var n=0;n<i.length;n++)if(t.typeCheck("array",i[n]))e(i[n],a[n]);else{var h=r.getNode(i[n]);h.x=a[n][0],h.y=a[n][1],h.width=a[n][2]-a[n][0],h.height=a[n][3]-a[n][1]}}(h("index",s,[]),e(o,this.axis.area("width"),this.axis.area("height")))},this.draw=function(){for(var e=this.svg.group(),i=this.axis.area("x"),h=this.axis.area("y"),c=r.getNodeAll(),u=0;u<c.length;u++)if(this.brush.titleDepth==c[u].depth&&o(this,e,c[u],i,h),s(c[u])){var d=i+c[u].x,p=h+c[u].y,f=c[u].width,g=c[u].height;if(this.brush.showText&&!n[c[u].index]){var v=d+f/2,m=p+g/2,x=this.chart.theme("treemapTextFontSize");"top"==this.brush.textOrient?m=p+x:"bottom"==this.brush.textOrient&&(m=p+g-x/2),"start"==this.brush.textAlign?v=d+a:"end"==this.brush.textAlign&&(v=d+f-a);var y=this.chart.text({"font-size":x,fill:this.chart.theme("treemapTextFontColor"),x:v,y:m,"text-anchor":this.brush.textAlign},t.typeCheck("function",this.brush.format)?this.format(c[u]):c[u].text);e.append(y)}var b=this.svg.rect({stroke:this.chart.theme("treemapNodeBorderColor"),"stroke-width":this.chart.theme("treemapNodeBorderWidth"),x:d,y:p,width:f,height:g,fill:this.color(l(c[u]))});if(t.typeCheck("function",this.brush.nodeColor)){var w=this.brush.nodeColor.call(this.chart,c[u]);b.attr({fill:this.color(w)})}this.addEvent(b,c[u]),e.prepend(b)}return e}};return n.setup=function(){return{textOrient:"top",textAlign:"middle",showText:!0,titleDepth:1,nodeColor:null,clip:!1,format:null}},n}},y={name:"chart.brush.heatmap",extend:"chart.brush.core",component:function(){var t=r.include("util.base"),e=function(){var e=this;this.draw=function(){for(var i=this.chart.theme("heatmapBorderWidth"),r=this.chart.theme("heatmapFontSize"),a=this.svg.group(),n=this.axis.x.rangeBand()-i,h=this.axis.y.rangeBand()-i,s=0;s<this.axis.data.length;s++){var o=this.svg.group(),l=this.color(s,null),c=this.axis.data[s],u=this.getValue(c,"text"),d=this.axis.x(s),p=this.axis.y(s);"none"==l&&(l=this.chart.theme("heatmapBackgroundColor"));var f=this.svg.rect({x:d-n/2,y:p-h/2,width:n,height:h,fill:l,"fill-opacity":this.chart.theme("heatmapBackgroundOpacity"),stroke:this.chart.theme("heatmapBorderColor"),"stroke-opacity":this.chart.theme("heatmapBorderOpacity"),"stroke-width":i}),g=this.chart.text({"text-anchor":"middle",fill:this.chart.theme("heatmapFontColor"),"font-size":r,width:n,height:h,x:d,y:p+r/2}).text(t.typeCheck("function",this.brush.format)?this.format(c):u);this.addEvent(o,s,null),o.append(f),o.append(g),a.append(o),function(t){o.hover(function(){t.attr({"fill-opacity":e.chart.theme("heatmapHoverBackgroundOpacity")})},function(){t.attr({"fill-opacity":e.chart.theme("heatmapBackgroundOpacity")})})}(f)}return a}};return e.setup=function(){return{format:null}},e}},b={name:"chart.brush.timeline",extend:"chart.brush.core",component:function(){var t=r.include("util.base"),e=function(){var e,i,r,a,n,h,s,o,l,c=this,u={},d=[],p=null;this.setActiveRect=function(t){for(var e=0;e<d.length;e++){var i=d[e].r1,r=d[e].r2,a=d[e].color,n=r.element==t;i.attr({fill:n?this.chart.theme("timelineActiveBarBackgroundColor"):a}),r.attr({fill:n?this.chart.theme("timelineActiveLayerBackgroundColor"):this.chart.theme("timelineHoverLayerBackgroundColor"),stroke:n?this.chart.theme("timelineActiveLayerBorderColor"):this.chart.theme("timelineHoverLayerBorderColor"),"fill-opacity":n?this.chart.theme("timelineLayerBackgroundOpacity"):0,"stroke-width":n?1:0}),n&&(p=e)}},this.setHoverRect=function(t){for(var e=0;e<d.length;e++){var i=d[e].r2,r=i.element==t;i.attr({fill:r&&p==e?c.chart.theme("timelineActiveLayerBackgroundColor"):this.chart.theme("timelineHoverLayerBackgroundColor"),stroke:r&&p==e?c.chart.theme("timelineActiveLayerBorderColor"):this.chart.theme("timelineHoverLayerBorderColor"),"fill-opacity":r||p==e?this.chart.theme("timelineLayerBackgroundOpacity"):0,"stroke-width":r||p==e?1:0})}},this.setActiveBar=function(t){for(var e=0;e<d.length;e++){var i=d[e].r1,r=d[e].t1,n=d[e].color,h=d[e].y-a/2,s=d[e].y-d[e].height/2,o=i.element==t;o?(i.attr({fill:this.chart.theme("timelineActiveBarBackgroundColor")||n,height:a,y:h}),r.attr({visibility:"visible"})):(i.attr({fill:n,height:d[e].height,y:s}),r.attr({visibility:"hidden"})),o&&(p=e)}},this.setHoverBar=function(t){for(var e=this.chart.theme("timelineHoverBarBackgroundColor"),i=this.chart.theme("timelineActiveBarBackgroundColor"),r=0;r<d.length;r++){var a=d[r].r1,n=d[r].color,h=a.element==t;a.attr({fill:h&&p!=r?e||n:p==r&&i||n})}},this.drawBefore=function(){e=this.svg.group(),i=this.axis.get("padding"),r=this.axis.y.domain(),a=this.axis.y.rangeBand(),this.axis.x.rangeBand(),n=this.axis.x.ticks(this.axis.get("x").step),s=this.brush.active,o=this.brush.activeType,l=this.brush.hideTitle?0:i.left,h=this.axis.area("x")-l;for(var t=0;t<r.length;t++)u[r[t]]=t},this.drawGrid=function(){for(var i=this.axis.get("y").format,n=this.axis.area("width")+l,s=this.chart.theme("timelineColumnBackgroundColor"),o=this.chart.theme("timelineHoverRowBackgroundColor"),u=this.chart.theme("timelineEvenRowBackgroundColor"),d=this.chart.theme("timelineOddRowBackgroundColor"),p=0;p<r.length;p++){var f=r[p],g=this.axis.y(p),v=0==p?s:p%2?u:d,m=this.svg.rect({width:n,height:a,fill:v,x:h,y:g-a/2});if(function(t,e){e>0&&t.hover(function(){t.attr({fill:o})},function(){t.attr({fill:e%2?u:d})})}(m,p),e.append(m),l>0){var x=this.chart.text({"text-anchor":"start",dx:5,dy:this.chart.theme("timelineTitleFontSize")/3,"font-size":this.chart.theme("timelineTitleFontSize"),fill:this.chart.theme("timelineTitleFontColor"),"font-weight":this.chart.theme("timelineTitleFontWeight")}).translate(h,g),y=t.typeCheck("function",i)?i.apply(this.chart,[f,p]):f;x.html(y),function(t){x.on("mouseover",function(e){c.chart.emit("timeline.title",[t,e])})}(f),e.append(x)}}},this.drawLine=function(){for(var r=this.axis.y(0)-a/2,s=this.axis.get("x").format,o=0;o<n.length;o++){var c=this.axis.x(n[o]);if(o<n.length-1){var u=this.svg.line({stroke:this.chart.theme(0==o?"timelineHorizontalLineColor":"timelineVerticalLineColor"),"stroke-width":1,x1:c,x2:c,y1:r,y2:r+this.axis.area("height"),visibility:0==l&&0==o?"hidden":"visible"});e.append(u)}if(o>0){var d=this.chart.text({"text-anchor":"end",dx:-5,dy:this.chart.theme("timelineColumnFontSize")/2,"font-size":this.chart.theme("timelineColumnFontSize"),fill:this.chart.theme("timelineColumnFontColor")}).translate(c,this.axis.y(0)),p=t.typeCheck("function",s)?s.apply(this.chart,[n[o],o]):n[o];d.text(p),e.append(d)}}var f=this.svg.line({stroke:this.chart.theme("timelineHorizontalLineColor"),"stroke-width":1,x1:h,x2:this.axis.area("width")+i.left,y1:r+a,y2:r+a});e.append(f)},this.drawData=function(){for(var i=this.axis.area("height"),r=this.axis.area("y"),a=this.axis.data.length,n=this.brush.barSize,h=this.brush.activeTooltip,l=this.chart.theme("timelineActiveBarFontSize"),f=this.chart.theme("timelineActiveBarFontColor"),g=0;g<a;g++){var v=this.axis.data[g],m=this.axis.x(this.getValue(v,"stime",0)),x=this.axis.x(this.getValue(v,"etime",this.axis.x.max())),y=this.axis.y(u[this.getValue(v,"key")]),b=t.typeCheck("function",n)?n.apply(this.chart,[v,g]):n,w=this.color(g,0);if(!(x-m<0||isNaN(x))){var k=this.svg.rect({width:x-m,height:b,fill:w,x:m,y:y-b/2,cursor:"pointer"}),B=this.svg.text({"text-anchor":"end","font-size":l,fill:f,x:m+x-m,y:y,dx:-l/2,dy:l/3,visibility:"hidden"}),C=this.svg.rect({width:x-m,height:i-6,"fill-opacity":0,"stroke-width":0,x:m,y:r+3,cursor:"pointer"});if(g<a-1){var T=this.axis.data[g+1],z=this.axis.x(this.getValue(T,"stime",0)),E=this.axis.y(u[this.getValue(T,"key")]),S=this.svg.line({x1:x,y1:y,x2:z,y2:E,stroke:w,"stroke-width":this.brush.lineWidth});e.append(S)}t.typeCheck("function",h)&&B.text(h.apply(this.chart,[v,g])),e.append(k),e.append(B),e.append(C),this.addEvent(k,g),d[g]={r1:k,r2:C,t1:B,color:w,y:y,height:b},"rect"==o?(!function(t){C.on(c.brush.activeEvent,function(e){c.setActiveRect(e.target),c.chart.emit("timeline.active",[t,e])})}(v),C.on("mouseover",function(t){c.setHoverRect(t.target)})):(C.attr({visibility:"hidden"}),function(t){k.on(c.brush.activeEvent,function(e){c.setActiveBar(e.target),c.chart.emit("timeline.active",[t,e])})}(v),k.on("mouseover",function(t){c.setHoverBar(t.target)}))}}if(t.typeCheck("integer",s)&&d.length>0){if(s<0)return;p=s,"rect"==o?this.setActiveRect(d[p].r2.element):this.setActiveBar(d[p].r1.element)}},this.draw=function(){return this.drawGrid(),this.drawLine(),this.drawData(),e.on("mouseout",function(t){"rect"==o?c.setHoverRect(null):c.setHoverBar(null)}),e}};return e.setup=function(){return{barSize:7,lineWidth:1,active:null,activeEvent:"click",activeType:"rect",activeTooltip:null,hideTitle:!1,clip:!1}},e}},w={name:"chart.brush.polygon.column3d",extend:"chart.brush.polygon.core",component:function(){var t=r.include("util.color"),e=r.include("chart.polygon.cube"),i=function(){var i,r;this.createColumn=function(a,n,h,s){var o=i,l=r,c=this.axis.x(h)-o/2,u=this.axis.y(a[n]),d=this.axis.y(0),p=this.axis.z(s)-l/2,f=this.color(s);return this.createPolygon(new e(c,d,p,o,u-d,l),function(e){for(var i=this.svg.group(),r=0;r<e.faces.length;r++){for(var o=e.faces[r],l=this.svg.polygon({fill:f,"fill-opacity":this.chart.theme("polygonColumnBackgroundOpacity"),stroke:t.darken(f,this.chart.theme("polygonColumnBorderOpacity")),"stroke-opacity":this.chart.theme("polygonColumnBorderOpacity")}),c=0;c<o.length;c++){var u=e.vectors[o[c]];l.point(u.x,u.y)}i.append(l)}return 0!=a[n]&&this.addEvent(i,h,s),i})},this.drawBefore=function(){var t=this.brush.padding,e=this.axis.x.rangeBand(),a=this.axis.z.rangeBand();i=this.brush.width>0?this.brush.width:e-2*t,r=this.brush.height>0?this.brush.height:a-2*t},this.draw=function(){for(var t=this.chart.svg.group(),e=this.listData(),i=this.brush.target,r=0;r<e.length;r++)for(var a=0;a<i.length;a++)t.append(this.createColumn(e[r],i[a],r,a));return t}};return i.setup=function(){return{width:0,height:0,padding:20,clip:!1}},i}},k={name:"chart.brush.polygon.line3d",extend:"chart.brush.polygon.core",component:function(){var t=r.include("util.color"),e=r.include("chart.polygon.point"),i=function(){this.createLine=function(i,r,a,n){for(var h=this.color(a,n),s=this.axis.z.rangeBand()-2*this.brush.padding,o=this.axis.x(a),l=this.axis.y(i[a][r]),c=this.axis.z(n)-s/2,u=this.axis.x(a+1),d=this.axis.y(i[a+1][r]),p=this.axis.z(n)+s/2,f=null,g=this.chart.svg.polygon({fill:h,"fill-opacity":this.chart.theme("polygonLineBackgroundOpacity"),stroke:t.darken(h,this.chart.theme("polygonLineBorderOpacity")),"stroke-opacity":this.chart.theme("polygonLineBorderOpacity")}),v=[new e(o,l,c),new e(o,l,p),new e(u,d,p),new e(u,d,c)],m=0;m<v.length;m++)this.createPolygon(v[m],function(t){var e=t.vectors[0];g.point(e.x,e.y),null==f?f=t:e.z>f.vectors[0].z&&(f=t)});return g.order=this.axis.depth-f.max().z,g},this.draw=function(){for(var t=this.chart.svg.group(),e=this.listData(),i=this.brush.target,r=0;r<e.length-1;r++)for(var a=0;a<i.length;a++)t.append(this.createLine(e,i[a],r,a));return t}};return i.setup=function(){return{padding:10,clip:!1}},i}},B={name:"chart.widget.cross",extend:"chart.widget.core",component:function(){var t=r.include("util.base"),e=function(e,i,r){var a,n,h,s,o,l=this,c=0,u=0,d=[];function p(t,e,i){if(!d[t]){var r=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.element.appendChild(r),d[t]=r}d[t].textContent=i}this.drawBefore=function(){i=this.chart.axis(r.axis),c=e.padding("left")+i.area("x"),u=e.padding("top")+i.area("y"),a=e.svg.group({visibility:"hidden"},function(){t.typeCheck("function",r.yFormat)&&(n=e.svg.line({x1:0,y1:0,x2:i.area("width"),y2:0,stroke:e.theme("crossBorderColor"),"stroke-width":e.theme("crossBorderWidth"),opacity:e.theme("crossBorderOpacity")}),o=e.svg.group({},function(){e.svg.polygon({fill:e.theme("crossBalloonBackgroundColor"),"fill-opacity":e.theme("crossBalloonBackgroundOpacity"),points:l.balloonPoints("left",50,18,5)}),e.text({"font-size":e.theme("crossBalloonFontSize"),fill:e.theme("crossBalloonFontColor"),"text-anchor":"middle",x:25,y:12})}).translate(-55,0)),t.typeCheck("function",r.xFormat)&&(h=e.svg.line({x1:0,y1:0,x2:0,y2:i.area("height"),stroke:e.theme("crossBorderColor"),"stroke-width":e.theme("crossBorderWidth"),opacity:e.theme("crossBorderOpacity")}),s=e.svg.group({},function(){e.svg.polygon({fill:e.theme("crossBalloonBackgroundColor"),"fill-opacity":e.theme("crossBalloonBackgroundOpacity"),points:l.balloonPoints("bottom",50,18,5)}),e.text({"font-size":e.theme("crossBalloonFontSize"),fill:e.theme("crossBalloonFontColor"),"text-anchor":"middle",x:25,y:17})}).translate(0,i.area("height")+5))}).translate(c,u)},this.draw=function(){return this.on("axis.mouseover",function(t){a.attr({visibility:"visible"})},r.axis),this.on("axis.mouseout",function(t){a.attr({visibility:"hidden"})},r.axis),this.on("axis.mousemove",function(t){a.attr({visibility:"visible"});var e=t.bgX-c+3,d=t.bgY-u+3;if(n&&n.attr({y1:d,y2:d}),h&&h.attr({x1:e,x2:e}),o){o.translate(-55,d-9);var f=i.y.invert(t.chartY+3),g=r.yFormat.call(l.chart,f);p(0,o.get(1),g)}if(s){s.translate(e-25,i.area("height")+5);f=i.x.invert(t.chartX+3),g=r.xFormat.call(l.chart,f);p(1,s.get(1),g)}},r.axis),a}};return e.setup=function(){return{axis:0,xFormat:null,yFormat:null}},e}},C={name:"chart.widget.legend",extend:"chart.widget.core",component:function(){var t=r.include("util.base"),e=function(e,i,r){var a=[],n={};function h(e){var i=[0];return t.typeCheck("array",e)?i=e:t.typeCheck("integer",e)&&(i=[e]),i}function s(){for(var t=h(r.brush),i=[],a=0;a<t.length;a++)i[a]=e.get("brush",t[a]);return i}function o(t){if(r.filter){a[t.index]||(a[t.index]={});for(var e=0;e<t.target.length;e++)a[t.index][t.target[e]]=!0}}function l(t){var i=[],r=[],h=t[0].index;for(var s in a[h])a[h][s]&&(i.push(s),r.push(n[s]));for(var o=0;o<t.length;o++)e.updateBrush(t[o].index,{target:i,colors:r});e.isRender()||e.render(),e.emit("legend.filter",[i])}this.getLegendIcon=function(i){for(var h=[],o=i.target.length,c=0;c<o;c++){var u=e.svg.group(),d=i.target[c],p=d,f=e.color(c,r.colors||i.colors);n[d]=f,t.typeCheck("function",r.format)&&(p=this.format(d));var g=e.svg.getTextSize(p,{fontSize:e.theme("legendFontSize")});if(r.filter)u.append(e.svg.line({x1:0,x2:17,y1:-2.75,y2:-2.75,stroke:f,"stroke-width":13,"stroke-linecap":"round"})),u.append(e.svg.circle({cx:17,cy:-2.75,r:5.5,fill:e.theme("legendSwitchCircleColor")})),u.append(e.text({x:27,y:0,"font-size":e.theme("legendFontSize"),fill:e.theme("legendFontColor"),"text-anchor":"start"},p)),h.push({icon:u,width:17+g.width+12.5,height:15.5}),function(t,h){h.attr({cursor:"pointer"}),h.on("click",function(o){a[i.index][t]?(h.get(0).attr({stroke:e.theme("legendSwitchDisableColor")}),h.get(2).attr({fill:e.theme("legendSwitchDisableColor")}),h.get(1).attr({cx:0}),a[i.index][t]=!1):(h.get(0).attr({stroke:n[t]}),h.get(2).attr({fill:e.theme("legendFontColor")}),h.get(1).attr({cx:17}),a[i.index][t]=!0),l(r.brushSync?s():[i])})}(d,u);else{var v=e.theme("legendFontSize");if(null!=r.icon){var m=t.typeCheck("function",r.icon)?r.icon.apply(e,[d]):r.icon;u.append(e.text({x:0,y:2,"font-size":v,fill:f},m))}else u.append(e.svg.circle({cx:v/2,cy:-2,r:v/2,fill:f}));u.append(e.text({x:1.2*v,y:0,"font-size":v,fill:e.theme("legendFontColor"),"text-anchor":"start"},p)),h.push({icon:u,width:v+g.width+10,height:15.5})}}return h},this.draw=function(){for(var t=e.svg.group(),i=0,a=0,n=0,s=0,l=0,c=0,u=h(r.brush),d=[],p=0;p<u.length;p++){var f=u[p];if(!(r.brushSync&&p>0)){for(var g=e.get("brush",u[f]),v=this.getLegendIcon(g),m=0;m<v.length;m++)t.append(v[m].icon),v[m].icon.translate(i,a),"bottom"==r.orient||"top"==r.orient?(i+v[m].width>e.area("x2")&&(i=0,a+=v[m].height,c+=v[m].height,v[m].icon.translate(i,a),d.push(n),n=0),i+=v[m].width+12.5,n+=v[m].width+12.5,c<v[m].height&&(c=v[m].height)):(a+=v[m].height,s+=v[m].height,l<v[m].width&&(l=v[m].width));n>0&&d.push(n),d.length>0&&(n=Math.max.apply(Math,d)),o(g)}}if("bottom"==r.orient||"top"==r.orient){a=5+("bottom"==r.orient?e.area("y2")+e.padding("bottom")-c:e.area("y")-e.padding("top"));"start"==r.align?i=e.area("x"):"center"==r.align?i=e.area("x")+(e.area("width")/2-n/2):"end"==r.align&&(i=e.area("x2")-n)}else{i=5+("left"==r.orient?e.area("x")-e.padding("left"):e.area("x2")+e.padding("right")-l);"start"==r.align?a=e.area("y"):"center"==r.align?a=e.area("y")+(e.area("height")/2-s/2):"end"==r.align&&(a=e.area("y2")-s)}return t.translate(Math.floor(i)+r.dx,Math.floor(a)+r.dy),t}};return e.setup=function(){return{orient:"bottom",align:"center",filter:!1,icon:null,dx:0,dy:0,colors:null,brushSync:!1,brush:0,format:null}},e}},T={name:"chart.widget.tooltip",extend:"chart.widget.core",component:function(){var t=r.include("util.base"),e=r.include("util.color"),i=7,a=7,n=function(r,n,h){var s=this,o={},l=0;function c(e,i){var r=null,a=null;if(t.typeCheck("function",h.format)){var n=s.format(i,e);t.typeCheck("object",n)?(r=n.key,a=n.value):a=n}else e&&!i&&(a=e),e&&i&&(r=e,a=s.format(i[e]));return{key:r,value:a}}function u(t){for(var i=t.brush.target,r=0;r<i.length;r++)if(i[r]==t.dataKey)return e.lighten(s.chart.color(r,t.brush.colors));return null}function d(t,e,r){var n=t.bgX-e.width/2,h=t.bgY-e.height-a-i/2,s=2;return"left"!=r&&"right"!=r||(h=t.bgY-e.height/2-i/2),"left"==r?n=t.bgX-e.width-a:"right"==r?(n=t.bgX+a,s=-2):"bottom"==r&&(h=t.bgY+2*a),{x:n,y:h,c:s}}function p(){var e=!1,n=null,p=null,f=null;s.on("mouseover",function(g,v){if(!e&&function(e){var i=s.getIndexArray(s.widget.brush);return-1!=t.inArray(e,i)}(g.brush.index)&&(g.dataKey||g.data)){n=function(e){var r=o[e.brush.index].get(1).get(1),a=0,n=0,s=!1;function u(h){for(var o=0;o<h.length;o++){var u=c(h[o],e.data);r.get(o).attr({x:i}),u.key?r.get(o).get(0).text(u.key):(r.get(o).get(1).attr({"text-anchor":"middle"}),s=!0),t.typeCheck(["null","undefined"],u.value)||r.get(o).get(1).attr({x:0}).text(u.value),a=Math.max(a,r.get(o).size().width)}n=h.length*l}return e.dataKey&&!1===h.all?u([e.dataKey]):u(e.brush.target),{width:a+3*i,height:n+i,onlyValue:s}}(g),p=h.orient,f=r.axis(g.brush.axis);var m=d(v,n,p),x=m.x-r.padding("left"),y=m.y-r.padding("top");h.flip&&("left"==p&&x<0?p="right":"right"==p&&x+n.width>f.area("width")?p="left":"top"==p&&y<0?p="bottom":"bottom"==p&&y+n.height>f.area("height")&&(p="top"));var b=o[g.brush.index],w=b.get(0),k=b.get(1).get(0),B=b.get(1).get(1).translate(0,"bottom"!=p?l:l+a),C=r.theme("tooltipBorderColor")||u(g),T=r.theme("tooltipLineColor")||u(g);k.attr({points:s.balloonPoints(p,n.width,n.height,h.anchor?a:null),stroke:C}),w.attr({stroke:T}),B.each(function(t,e){e.get(1).attr({x:n.onlyValue?n.width/2:n.width-i})}),b.attr({visibility:"visible"}),e=!0}}),s.on("mousemove",function(t,i){if(e){var a=o[t.brush.index],h=a.get(0),s=a.get(1),l=d(i,n,p);h.attr({x1:i.bgX+l.c,y1:r.padding("top")+f.area("y"),x2:i.bgX+l.c,y2:r.padding("top")+f.area("y2")}),s.translate(l.x,l.y)}}),s.on("mouseout",function(t,i){e&&(o[t.brush.index].attr({visibility:"hidden"}),e=!1)})}this.drawBefore=function(){l=1.2*r.theme("tooltipFontSize")},this.draw=function(){for(var t=r.svg.group(),e=this.getIndexArray(this.widget.brush),a=0;a<e.length;a++){var n=r.get("brush",e[a]),s=[""];if(h.all&&n.target.length>1)for(var l=1;l<n.target.length;l++)s.push("");o[n.index]=r.svg.group({visibility:"hidden"},function(){r.svg.line({"stroke-width":r.theme("tooltipLineWidth"),visibility:h.line?"visible":"hidden"}),r.svg.group({},function(){r.svg.polygon({fill:r.theme("tooltipBackgroundColor"),"fill-opacity":r.theme("tooltipBackgroundOpacity"),"stroke-width":r.theme("tooltipBorderWidth")});for(var t=r.texts({"font-size":r.theme("tooltipFontSize"),fill:r.theme("tooltipFontColor")},s,1.2),e=0;e<s.length;e++)t.get(e).append(r.svg.tspan({"text-anchor":"start","font-weight":"bold",x:i})),t.get(e).append(r.svg.tspan({"text-anchor":"end"}))})}),t.append(o[n.index])}return p(),t}};return n.setup=function(){return{orient:"top",anchor:!0,all:!1,line:!1,flip:!1,format:null,brush:0}},n}},z={name:"chart.widget.polygon.rotate3d",extend:"chart.widget.polygon.core",component:function(){var t=r.include("util.base"),e=180,i=function(){var i=this;function r(t){var r=i.chart.axis(t),a=!1,n=0,h=0,s=0,o=0,l=null,c=i.widget.unit,u=r.area("width"),d=r.area("height");function p(t){a&&(a=!1,n=0,h=0)}i.on("axis.mousedown",function(t){if(a)return;a=!0,n=t.chartX,h=t.chartY,s=r.degree.x,o=r.degree.y},t),i.on("axis.mousemove",function(t){if(!a)return;var p=t.chartX-n,f=t.chartY-h,g=s+Math.floor(f/d*e),v=o-Math.floor(p/u*e);if(g%c!=0&&v%c!=0)return;var m=g+":"+v;if(l==m)return;r.set("degree",{x:g,y:v}),i.chart.render(),l=m},t),i.on("axis.mouseup",p,t),i.on("bg.mouseup",p),i.on("chart.mouseup",p)}this.draw=function(){for(var e=t.typeCheck("array",this.widget.axis)?this.widget.axis:[this.widget.axis],i=0;i<e.length;i++)r(e[i])}};return i.setup=function(){return{unit:5,axis:[0]}},i}};r.use([a,n,h,s,o,l,c,u,d,p,{name:"chart.brush.stackarea",extend:"chart.brush.area",component:function(){return function(){this.draw=function(){return this.drawArea(this.getStackXY())}}}},{name:"chart.brush.rangearea",extend:"chart.brush.core",component:function(){return function(){this.draw=function(){for(var t=this.svg.group(),e=this.brush.target,i=this.axis.data,r="range"==this.axis.y.type,a=0;a<e.length;a++){for(var n=this.svg.polygon({fill:this.color(a),"fill-opacity":this.chart.theme("areaBackgroundOpacity"),"stroke-width":0}),h=0;h<i.length;h++){var s=i[h][e[a]];r?n.point(this.axis.x(h),this.axis.y(s[0])):n.point(this.axis.x(s[0]),this.axis.y(h))}for(h=i.length-1;h>=0;h--)s=i[h][e[a]],r?n.point(this.axis.x(h),this.axis.y(s[1])):n.point(this.axis.x(s[1]),this.axis.y(h));t.append(n)}return t}}}},f,g,v,m,x,y,b,w,k,B,C,{name:"chart.widget.title",extend:"chart.widget.core",component:function(){var t=function(t,e,i){var r=0,a=0,n="middle";this.drawBefore=function(){var e=t.axis(i.axis);e?(a="bottom"==i.orient?e.area("y2")+e.padding("bottom")-20:"top"==i.orient?e.area("y")-e.padding("top")+25:e.area("y")+e.area("height")/2,"middle"==i.align?(r=e.area("x")+e.area("width")/2,n="middle"):"start"==i.align?(r=e.area("x")-e.padding("left")+20,n="start"):(r=e.area("x2")+e.padding("right")-20,n="end"),r+=t.area("x"),a+=t.area("y")):(a="bottom"==i.orient?t.area("y2")+t.padding("bottom")-20:"top"==i.orient?20:t.area("y")+t.area("height")/2,"middle"==i.align?(r=t.area("x")+t.area("width")/2,n="middle"):"start"==i.align?(r=t.area("x"),n="start"):(r=t.area("x2"),n="end"))},this.draw=function(){var e=t.svg.getTextSize(i.text),h=e.width/2,s=e.height/2,o=t.text({x:r+i.dx,y:a+i.dy,"text-anchor":n,fill:i.color||t.theme("titleFontColor"),"font-size":i.size||t.theme("titleFontSize"),"font-weight":t.theme("titleFontWeight")},i.text);return"center"==i.orient&&("start"==i.align?o.rotate(-90,r+i.dx+h,a+i.dy+s):"end"==i.align&&o.rotate(90,r+i.dx-h,a+i.dy+s)),o}};return t.setup=function(){return{axis:null,orient:"top",align:"middle",text:"",dx:0,dy:0,size:null,color:null}},t}},T,z]),window.jui=window.JUI=r}]); |
{ | ||
"name": "juijs-chart", | ||
"version": "2.1.7-es6", | ||
"version": "2.1.8-es6", | ||
"sideEffects": false, | ||
@@ -13,2 +13,3 @@ "description": "SVG-based JUI chart that can be used in the browser and Node.js. Support many types of charts. (Dashboard, Map, Topology, Full 3D)", | ||
"files": [ | ||
"bundles", | ||
"dist", | ||
@@ -68,3 +69,3 @@ "examples", | ||
"dependencies": { | ||
"juijs-graph": "0.0.6-es6" | ||
"juijs-graph": "0.1.1-es6" | ||
}, | ||
@@ -71,0 +72,0 @@ "devDependencies": { |
@@ -9,3 +9,3 @@ const path = require('path') | ||
entry: { | ||
vendors: [ 'juijs', 'juijs-graph' ], | ||
vendors: [ 'juijs-graph' ], | ||
chart: path.resolve(__dirname, 'bundles', 'index.js') | ||
@@ -12,0 +12,0 @@ }, |
@@ -7,3 +7,3 @@ const path = require('path'); | ||
entry: { | ||
vendors: [ 'juijs', 'juijs-graph' ], | ||
vendors: [ 'juijs-graph' ], | ||
'jui-chart': path.resolve(__dirname, 'bundles', 'production.js') | ||
@@ -10,0 +10,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 4 instances in 1 package
7632
3
1863448
69
+ Addedjuijs@2.1.10-es6(transitive)
+ Addedjuijs-graph@0.1.1-es6(transitive)
- Removedjquery@3.7.1(transitive)
- Removedjuijs@2.3.0(transitive)
- Removedjuijs-graph@0.0.6-es6(transitive)
Updatedjuijs-graph@0.1.1-es6