},dimple.aggregateMethod.sum=function(a,b){returna.value=null===a.value||void0===a.value?0:parseFloat(a.value),b.value=null===b.value||void0===b.value?0:parseFloat(b.value),a.value+b.value},dimple.plot.area={stacked:!0,supportedAxes:["x","y","c"],draw:function(a,b,c){vard,e,f,g=this,h=b._positionData,i=[],j=1,k=!1,l={};null!==a._tooltipGroup&&void0!==a._tooltipGroup&&a._tooltipGroup.remove(),(b.x._hasCategories()||b.y._hasCategories())&&(j=0),h.forEach(function(a){varb,c=[],d=!1;for(b=j;b<a.aggField.length;b+=1)c.push(a.aggField[b]);i.forEach(function(a){d=d||a===c.join("/")},this),d||i.push(c.join("/"))},this),null!==b.c&&void0!==b.c&&(b.x._hasCategories()&&b.y._hasMeasure()||b.y._hasCategories()&&b.x._hasMeasure())&&(k=!0,i.forEach(function(d){dimple._addGradient(d,"fill-area-gradient-"+d.join("_").replace(" ",""),b.x._hasCategories()?b.x:b.y,h,a,c,"fill"),dimple._addGradient(d,"stroke-area-gradient-"+d.join("_").replace(" ",""),b.x._hasCategories()?b.x:b.y,h,a,c,"stroke")},this)),d=d3.svg.line().x(function(c){returndimple._helpers.cx(c,a,b)}).y(function(c){returndimple._helpers.cy(c,a,b)}),(null===b.shapes||void0===b.shapes)&&(b.shapes=a._group.selectAll(".area").data(i).enter().append("svg:path").attr("opacity",function(b){returna.getColor(b).opacity})),b.shapes.data(i).transition().duration(c).attr("class",function(a){return"series area "+a.split(" ").join("_")}).attr("d",function(c){vare,f,g,i,j,k,m,n,o=[],p=0;for(e=dimple.filterData(h,"aggField",c),e.sort(function(c,d){vare=0;returnb.x._hasCategories()?e=dimple._helpers.cx(c,a,b)<dimple._helpers.cx(d,a,b)?-1:1:b.y._hasCategories()&&(e=dimple._helpers.cy(c,a,b)<dimple._helpers.cy(d,a,b)?-1:1),e}),i=e.length-1;i>=0;i-=1)if(f=e[i],g={cx:0,cy:0,height:0,width:0,xOffset:0,yOffset:0},b.x._hasCategories()){if(g.cx=f.cx,g.width=f.width,g.xOffset=f.xOffset,void0===l[f.xField])l[f.xField]=[];else{for(p=0,j=0;j<=l[f.xField].length;j+=1)m=l[f.xField][j],(f.cy>=0&&m>=0||f.cy<=0&&0>=m)&&Math.abs(m)<=Math.abs(f.cy)&&Math.abs(m)>Math.abs(p)&&(p=m);g.cy=p}o.push(g),l[f.xField].push(f.cy)}elseif(b.y._hasCategories()){if(g.cy=f.cy,g.height=f.height,g.yOffset=f.yOffset,void0===l[f.yField])l[f.yField]=[];else{for(p=0,k=0;k<=l[f.yField].length;k+=1)n=l[f.yField][k],(f.cx>=0&&n>=0||f.cx<=0&&0>=n)&&Math.abs(n)<=Math.abs(f.cx)&&Math.abs(n)>Math.abs(p)&&(p=n);g.cx=p}o.push(g),l[f.yField].push(f.cx)}returnd(e.concat(o).concat(e[0]))}).call(function(){a.noFormats||this.attr("fill",function(b){returnk?"url(#fill-area-gradient-"+b.join("_").replace(" ","")+")":a.getColor(b).fill}).attr("stroke",function(b){returnk?"url(#stroke-area-gradient-"+b.join("_").replace(" ","")+")":a.getColor(b).stroke}).attr("stroke-width",b.lineWeight)}),b.lineMarkers&&(f=null===b._markerBacks||void0===b._markerBacks?a._group.selectAll(".markerBacks").data(h):b._markerBacks.data(h,function(a){returna.key}),f.enter().append("circle").attr("id",function(a){returna.key}).attr("class","markerBacks").attr("cx",function(c){returndimple._helpers.cx(c,a,b)}).attr("cy",function(c){returndimple._helpers.cy(c,a,b)}).attr("r",0).attr("fill","white").attr("stroke","none"),f.transition().duration(c).attr("cx",function(c){returndimple._helpers.cx(c,a,b)}).attr("cy",function(c){returndimple._helpers.cy(c,a,b)}).attr("r",2+b.lineWeight),f.exit().transition().duration(c).attr("r",0).each("end",function(){d3.select(this).remove()}),b._markerBacks=f),e=null===b._markers||void0===b._markers?a._group.selectAll(".markers").data(h):b._markers.data(h,function(a){returna.key}),e.enter().append("circle").attr("id",function(a){returna.key}).attr("class","markers").on("mouseover",function(c){g.enterEventHandler(c,this,a,b)}).on("mouseleave",function(c){g.leaveEventHandler(c,this,a,b)}).attr("cx",function(c){returndimple._helpers.cx(c,a,b)}).attr("cy",function(c){returndimple._helpers.cy(c,a,b)}).attr("r",0).attr("opacity",function(c){returnb.lineMarkers?a.getColor(c).opacity:0}).call(function(){a.noFormats||this.attr("fill","white").style("stroke-width",b.lineWeight).attr("stroke",function(c){returnk?dimple._h
},dimple._parentWidth=function(a){varb=a.offsetWidth;return(0>=b||null===b||void0===b)&&(b=a.clientWidth),(0>=b||null===b||void0===b)&&(b=null===a.parentNode||void0===a.parentNode?0:dimple._parseXPosition(d3.select(a).attr("width"),a.parentNode)),b},dimple._parseXPosition=function(a,b){varc=0,d=a.toString().split(",");returnd.forEach(function(d){void0!==d&&null!==d&&(isNaN(d)?"%"===d.slice(-1)?c+=dimple._parentWidth(b)*(parseFloat(d.slice(0,d.length-1))/100):"px"===d.slice(-2)?c+=parseFloat(d.slice(0,d.length-2)):c=a:c+=parseFloat(d))},this),c},dimple._parseYPosition=function(a,b){varc=0,d=a.toString().split(",");returnd.forEach(function(d){void0!==d&&null!==d&&(isNaN(d)?"%"===d.slice(-1)?c+=dimple._parentHeight(b)*(parseFloat(d.slice(0,d.length-1))/100):"px"===d.slice(-2)?c+=parseFloat(d.slice(0,d.length-2)):c=a:c+=parseFloat(d))},this),c},dimple._rollUp=function(a,b,c){vard=[];returnb=null!==b&&void0!==b?[].concat(b):[],a.forEach(function(a){vare=-1,f={},g=!0;d.forEach(function(c,d){-1===e&&(g=!0,b.forEach(function(b){g=g&&a[b]===c[b]},this),g&&(e=d))},this),-1!==e?f=d[e]:(b.forEach(function(b){f[b]=a[b]},this),d.push(f),e=d.length-1),c.forEach(function(c){-1===b.indexOf(c)&&(void0===f[c]&&(f[c]=[]),f[c]=f[c].concat(a[c]))},this),d[e]=f},this),d},dimple.filterData=function(a,b,c){vard=a;returnnull!==b&&null!==c&&(null!==c&&void0!==c&&(c=[].concat(c)),d=[],a.forEach(function(a){null===a[b]?d.push(a):c.indexOf([].concat(a[b]).join("/"))>-1&&d.push(a)},this)),d},dimple.getUniqueValues=function(a,b){varc=[];returnnull!==b&&void0!==b&&(b=[].concat(b),a.forEach(function(a){vard="";b.forEach(function(b,c){c>0&&(d+="/"),d+=a[b]},this),-1===c.indexOf(d)&&c.push(d)},this)),c},dimple.newSvg=function(a,b,c){vard=null;if((null===a||void0===a)&&(a="body"),d=d3.select(a),d.empty())throw"The '"+a+"' selector did not match any elements. Please prefix with '#' to select by id or '.' to select by class";returnd.append("svg").attr("width",b).attr("height",c)}}();