mirror of https://github.com/masayuki0812/c3.git
Quite good looking graph derived from d3.js
http://c3js.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4 lines
108 KiB
4 lines
108 KiB
!function(a){"use strict";function b(a){var b=this.internal=new c(a,this);b.loadConfig(a),b.init()}function c(b,c){var d=this;d.d3=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,d.api=c,d.data={},d.cache={},d.axes={}}function d(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+s)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,k);for(c=a.domain(),b=Math.ceil(c[0]);b<c[1];b++)d.push(b);return d.length>0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=m.copy();return b&&(a=m.domain(),c.domain([a[0],a[1]-1])),c}function h(a){return j?j(a):a}function i(i){i.each(function(){function i(a){var b=m(a)+s;return B[0]<b&&b<B[1]?o:0}var j,k,t=a.select(this),u=this.__chart__||m,v=this.__chart__=g(),w=r?r:f(v),x=t.selectAll(".tick").data(w,v),y=x.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),z=x.exit().remove(),A=a.transition(x).style("opacity",1),B=m.rangeExtent?m.rangeExtent():e(m.range()),C=t.selectAll(".domain").data([0]),D=(C.enter().append("path").attr("class","domain"),a.transition(C));y.append("line"),y.append("text");var E=y.select("line"),F=A.select("line"),G=x.select("text").text(h),H=y.select("text"),I=A.select("text");switch(b?(s=Math.ceil((v(1)-v(0))/2),k=l?0:s):s=k=0,n){case"bottom":j=c,E.attr("y2",o),H.attr("y",Math.max(o,0)+q),F.attr("x1",k).attr("x2",k).attr("y2",i),I.attr("x",0).attr("y",Math.max(o,0)+q),G.attr("dy",".71em").style("text-anchor","middle"),D.attr("d","M"+B[0]+","+p+"V0H"+B[1]+"V"+p);break;case"top":j=c,E.attr("y2",-o),H.attr("y",-(Math.max(o,0)+q)),F.attr("x2",0).attr("y2",-o),I.attr("x",0).attr("y",-(Math.max(o,0)+q)),G.attr("dy","0em").style("text-anchor","middle"),D.attr("d","M"+B[0]+","+-p+"V0H"+B[1]+"V"+-p);break;case"left":j=d,E.attr("x2",-o),H.attr("x",-(Math.max(o,0)+q)),F.attr("x2",-o).attr("y2",0),I.attr("x",-(Math.max(o,0)+q)).attr("y",s),G.attr("dy",".32em").style("text-anchor","end"),D.attr("d","M"+-p+","+B[0]+"H0V"+B[1]+"H"+-p);break;case"right":j=d,E.attr("x2",o),H.attr("x",Math.max(o,0)+q),F.attr("x2",o).attr("y2",0),I.attr("x",Math.max(o,0)+q).attr("y",0),G.attr("dy",".32em").style("text-anchor","start"),D.attr("d","M"+p+","+B[0]+"H0V"+B[1]+"H"+p)}if(v.rangeBand){var J=v,K=J.rangeBand()/2;u=v=function(a){return J(a)+K}}else u.rangeBand?u=v:z.call(j,v);y.call(j,u),A.call(j,v)})}var j,k,l,m=a.scale.linear(),n="bottom",o=6,p=6,q=3,r=null,s=0,t=!0;return i.scale=function(a){return arguments.length?(m=a,i):m},i.orient=function(a){return arguments.length?(n=a in{top:1,right:1,bottom:1,left:1}?a+"":"bottom",i):n},i.tickFormat=function(a){return arguments.length?(j=a,i):j},i.tickCentered=function(a){return arguments.length?(l=a,i):l},i.tickOffset=function(){return s},i.ticks=function(){return arguments.length?(k=arguments,i):k},i.tickCulling=function(a){return arguments.length?(t=a,i):t},i.tickValues=function(a){return arguments.length?(r=a,i):r},i}var e,f,g={version:"0.3.0"};g.generate=function(a){return new b(a)},g.chart={fn:b.prototype,internal:{fn:c.prototype}},e=g.chart.fn,f=g.chart.internal.fn,f.init=function(){var a=this,b=a.config;if(a.initParams(),b[_])a.convertUrlToData(b[_],b[db],b[eb],a.initWithData);else if(b[ab])a.initWithData(a.convertJsonToData(b[ab],b[eb]));else if(b[bb])a.initWithData(a.convertRowsToData(b[bb]));else{if(!b[cb])throw Error("url or json or rows or columns is required.");a.initWithData(a.convertColumnsToData(b[cb]))}},f.initParams=function(){var a=this,b=a.d3;a.clipId="c3-"+ +new Date+"-clip",a.clipIdForXAxis=a.clipId+"-xaxis",a.clipIdForYAxis=a.clipId+"-yaxis",a.clipPath=a.getClipPath(a.clipId),a.clipPathForXAxis=a.getClipPath(a.clipIdForXAxis),a.clipPathForYAxis=a.getClipPath(a.clipIdForYAxis),a.dragStart=null,a.dragging=!1,a.cancelClick=!1,a.mouseover=!1,a.transiting=!1,a.color=a.generateColor(),a.levelColor=a.generateLevelColor(),a.dataTimeFormat=$c[B]?b.time.format:b.time.format.utc,a.axisTimeFormat=$c[yb]?b.time.format:b.time.format.utc,a.defaultAxisTimeFormat=a.axisTimeFormat.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),a.hiddenTargetIds=[],a.hiddenLegendIds=[],a.xOrient=$c[vb]?"left":"bottom",a.yOrient=$c[vb]?"bottom":"left",a.y2Orient=$c[vb]?"top":"right",a.subXOrient=$c[vb]?"left":"bottom",a.isLegendRight="right"===$c[mb],a.isLegendInset="inset"===$c[mb],a.isLegendTop="top-left"===$c[nb]||"top-right"===$c[nb],a.isLegendLeft="top-left"===$c[nb]||"bottom-left"===$c[nb],a.legendStep=0,a.legendItemWidth=0,a.legendItemHeight=0,a.legendOpacityForHidden=.15,a.currentMaxTickWidth=0,a.rotated_padding_left=30,a.rotated_padding_right=$c[vb]&&!$c[wb]?0:30,a.rotated_padding_top=5,a.withoutFadeIn={},a.axes.subx=b.selectAll([])},f.initWithData=function(b){var c,d,e=this,f=e.d3,g=e.config,i=!0;se(e.initPie)&&e.initPie(),se(e.initBrush)&&e.initBrush(),se(e.initZoom)&&e.initZoom(),e.selectChart=f.select(g[h]),e.selectChart.empty()&&(e.selectChart=f.select(document.createElement("div")).style("opacity",0),e.observeInserted(e.selectChart),i=!1),e.selectChart.html("").classed("c3",!0),e.data.xs={},e.data.targets=e.convertDataToTargets(b),g[P]&&(e.data.targets=e.data.targets.filter(g[P])),g[O]&&e.addHiddenTargetIds(g[O]===!0?e.mapToIds(e.data.targets):g[O]),e.hasType("gauge")&&(g[lb]=!1),e.updateSizes(),e.updateScales(),e.x.domain(f.extent(e.getXDomain(e.data.targets))),e.y.domain(e.getYDomain(e.data.targets,"y")),e.y2.domain(e.getYDomain(e.data.targets,"y2")),e.subX.domain(e.x.domain()),e.subY.domain(e.y.domain()),e.subY2.domain(e.y2.domain()),e.orgXDomain=e.x.domain(),e.brush&&e.brush.scale(e.subX),g[o]&&e.zoom.scale(e.x),e.svg=e.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return g[t].call(e)}).on("mouseleave",function(){return g[u].call(e)}),e.defs=e.svg.append("defs"),e.defs.append("clipPath").attr("id",e.clipId).append("rect"),e.defs.append("clipPath").attr("id",e.clipIdForXAxis).append("rect"),e.defs.append("clipPath").attr("id",e.clipIdForYAxis).append("rect"),e.updateSvgSize(),c=e.main=e.svg.append("g").attr("transform",e.getTranslate("main")),se(e.initSubchart)&&e.initSubchart(),se(e.initTooltip)&&e.initTooltip(),se(e.initLegend)&&e.initLegend(),c.append("text").attr("class",qe[Od]+" "+qe[Nd]).attr("text-anchor","middle").attr("dominant-baseline","middle"),c.append("g").attr("clip-path",e.clipPath).attr("class",qe[yd]),e.grid=c.append("g").attr("clip-path",e.clipPath).attr("class",qe[Rd]),g[fc]&&e.grid.append("g").attr("class",qe[Td]),g[ic]&&e.grid.append("g").attr("class",qe[Yd]),e.grid.append("g").attr("class",qe[Vd]),e.grid.append("g").attr("class",qe[$d]),g[lc]&&e.grid.append("g").attr("class",qe[Wd]).append("line").attr("class",qe[Wd]),c.append("g").attr("clip-path",e.clipPath).attr("class",qe[ad]),d=c.select("."+qe[ad]).append("g").attr("class",qe[rd]).style("fill-opacity",0),c.select("."+qe[ad]).append("g").attr("class",qe[ed]),c.select("."+qe[ad]).append("g").attr("class",qe[cd]),se(e.initArc)&&e.initArc(),se(e.initGauge)&&e.initGauge(),c.select("."+qe[ad]).append("g").attr("class",qe[gd]),c.insert("rect",g[q]?null:"g."+qe[yd]).attr("class",qe[ud]).attr("width",e.width).attr("height",e.height).style("opacity",0).on("dblclick.zoom",null),g[Nb]&&e.brush.extent(se(g[Nb])?g[Nb](e.getXDomain()):g[Nb]),e.axes.x=c.append("g").attr("class",qe[_d]+" "+qe[ae]).attr("clip-path",e.clipPathForXAxis).attr("transform",e.getTranslate("x")).style("visibility",g[wb]?"visible":"hidden"),e.axes.x.append("text").attr("class",qe[be]).attr("transform",g[vb]?"rotate(-90)":"").style("text-anchor",Ee(e.textAnchorForXAxisLabel,e)),e.axes.y=c.append("g").attr("class",qe[_d]+" "+qe[ce]).attr("clip-path",e.clipPathForYAxis).attr("transform",e.getTranslate("y")).style("visibility",g[Pb]?"visible":"hidden"),e.axes.y.append("text").attr("class",qe[de]).attr("transform",g[vb]?"":"rotate(-90)").style("text-anchor",Ee(e.textAnchorForYAxisLabel,e)),e.axes.y2=c.append("g").attr("class",qe[_d]+" "+qe[ee]).attr("transform",e.getTranslate("y2")).style("visibility",g[Yb]?"visible":"hidden"),e.axes.y2.append("text").attr("class",qe[fe]).attr("transform",g[vb]?"":"rotate(-90)").style("text-anchor",Ee(e.textAnchorForY2AxisLabel,e)),e.updateTargets(e.data.targets),i&&(e.updateDimension(),e.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),null==a.onresize&&(a.onresize=e.generateResize()),a.onresize.add&&(a.onresize.add(function(){g[v].call(e)}),a.onresize.add(function(){e.api.flush()}),a.onresize.add(function(){g[w].call(e)})),e.api.element=e.selectChart.node()},f.smoothLines=function(a,b){var c=this;"grid"===b&&a.each(function(){var a=c.d3.select(this),b=a.attr("x1"),d=a.attr("x2"),e=a.attr("y1"),f=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(d),y1:Math.ceil(e),y2:Math.ceil(f)})})},f.updateSizes=function(){var a=this,b=a.config,c=a.legend?a.getLegendHeight():0,d=a.legend?a.getLegendWidth():0,e=a.isLegendRight||a.isLegendInset?0:c,f=a.hasArcType(),g=b[vb]||f?0:a.getHorizontalAxisHeight("x"),h=b[gb]&&!f?b[hb]+g:0;a.currentWidth=a.getCurrentWidth(),a.currentHeight=a.getCurrentHeight(),b[vb]?(a.margin={top:a.getHorizontalAxisHeight("y2")+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:a.getHorizontalAxisHeight("y")+e+a.getCurrentPaddingBottom(),left:h+(f?0:a.getCurrentPaddingLeft())},a.margin2={top:a.margin.top,right:0/0,bottom:20+e,left:a.rotated_padding_left}):(a.margin={top:4+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:g+h+e+a.getCurrentPaddingBottom(),left:f?0:a.getCurrentPaddingLeft()},a.margin2={top:a.currentHeight-h-e,right:0/0,bottom:g+e,left:a.margin.left}),se(a.updateSizeForLegend)&&a.updateSizeForLegend(c,d),a.width=a.currentWidth-a.margin.left-a.margin.right,a.height=a.currentHeight-a.margin.top-a.margin.bottom,a.width<0&&(a.width=0),a.height<0&&(a.height=0),a.width2=b[vb]?a.margin.left-a.rotated_padding_left-a.rotated_padding_right:a.width,a.height2=b[vb]?a.height:a.currentHeight-a.margin2.top-a.margin2.bottom,a.width2<0&&(a.width2=0),a.height2<0&&(a.height2=0),a.arcWidth=a.width-(a.isLegendRight?d+10:0),a.arcHeight=a.height-(a.isLegendRight?0:10),se(a.updateRadius)&&a.updateRadius(),a.isLegendRight&&f&&(a.margin3.left=a.arcWidth/2+1.1*a.radiusExpanded)},f.updateTargets=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.main;f=j.select("."+qe[gd]).selectAll("."+qe[fd]).data(a).attr("class",Ee(h.classChartText,h)),g=f.enter().append("g").attr("class",Ee(h.classChartText,h)).style("opacity",0).style("pointer-events","none"),g.append("g").attr("class",Ee(h.classTexts,h)),e=j.select("."+qe[ed]).selectAll("."+qe[dd]).data(a).attr("class",Ee(h.classChartBar,h)),d=e.enter().append("g").attr("class",Ee(h.classChartBar,h)).style("opacity",0).style("pointer-events","none"),d.append("g").attr("class",Ee(h.classBars,h)).style("cursor",function(a){return i[S](a)?"pointer":null}),c=j.select("."+qe[cd]).selectAll("."+qe[bd]).data(a).attr("class",Ee(h.classChartLine,h)),b=c.enter().append("g").attr("class",Ee(h.classChartLine,h)).style("opacity",0).style("pointer-events","none"),b.append("g").attr("class",Ee(h.classLines,h)),b.append("g").attr("class",Ee(h.classAreas,h)),b.append("g").attr("class",function(a){return h.generateClass(qe[pd],a.id)}),b.append("g").attr("class",Ee(h.classCircles,h)).style("cursor",function(a){return i[S](a)?"pointer":null}),a.forEach(function(a){j.selectAll("."+qe[pd]+h.getTargetSelectorSuffix(a.id)).selectAll("."+qe[od]).each(function(b){b.value=a.values[b.index].value})}),se(h.updateTargetsForArc)&&h.updateTargetsForArc(a),se(h.updateTargetsForSubchart)&&h.updateTargetsForSubchart(a),h.svg.selectAll("."+qe[_c]).filter(function(a){return h.isTargetToShow(a.id)}).transition().duration(i[x]).style("opacity",1)},f.redraw=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,p,q,r,t,u,v,w,y,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W=this,X=W.main,Y=W.d3,Z=W.config,$=W.getShapeIndices(W.isAreaType),_=W.getShapeIndices(W.isBarType),ab=W.getShapeIndices(W.isLineType),bb=W.hasArcType(),cb=W.filterTargetsToShow(W.data.targets);if(c=f=n=r=Y.selectAll([]),a=a||{},B=Be(a,"withY",!0),C=Be(a,"withSubchart",!0),D=Be(a,"withTransition",!0),G=Be(a,"withTransform",!1),H=Be(a,"withUpdateXDomain",!1),I=Be(a,"withUpdateOrgXDomain",!1),J=Be(a,"withLegend",!1),E=Be(a,"withTransitionForExit",D),F=Be(a,"withTransitionForAxis",D),P=D?Z[x]:0,Q=E?P:0,R=F?P:0,b=b||W.generateAxisTransitions(R),J&&Z[lb]&&W.updateLegend(W.mapToIds(W.data.targets),a,b),W.isCategorized()&&0===cb.length&&W.x.domain([0,W.axes.x.selectAll(".tick").size()]),cb.length?(W.updateXDomain(cb,H,I),Z[Gb]||!Z[Fb]&&!Z[Eb]||(T=W.generateTickValues(W.mapTargetsToUniqueXs(cb),Z[Eb]),W.xAxis.tickValues(T),W.subXAxis.tickValues(T))):(W.xAxis.tickValues([]),W.subXAxis.tickValues([])),W.y.domain(W.getYDomain(cb,"y")),W.y2.domain(W.getYDomain(cb,"y2")),W.axes.x.style("opacity",bb?0:1),W.axes.y.style("opacity",bb?0:1),W.axes.y2.style("opacity",bb?0:1),W.axes.subx.style("opacity",bb?0:1),b.axisX.call(W.xAxis),b.axisY.call(W.yAxis),b.axisY2.call(W.y2Axis),b.axisSubX.call(W.subXAxis),W.updateAxisLabels(D),H&&cb.length)if(Z[Cb]&&T){for(U=1;U<T.length;U++)if(T.length/U<Z[Db]){V=U;break}W.svg.selectAll("."+qe[ae]+" .tick text").each(function(a){var b=T.indexOf(a);b>=0&&Y.select(this).style("display",b%V?"none":"block")})}else W.svg.selectAll("."+qe[ae]+" .tick text").style("display","block");if(!Z[vb]&&Z[Hb]&&W.rotateTickText(W.axes.x,b.axisX,Z[Hb]),K=W.generateDrawArea($,!1),L=W.generateDrawBar(_),M=W.generateDrawLine(ab,!1),N=W.generateXYForText(_,!0),O=W.generateXYForText(_,!1),W.subY.domain(W.y.domain()),W.subY2.domain(W.y2.domain()),W.tooltip.style("display","none"),W.updateXgridFocus(),X.select("text."+qe[Od]+"."+qe[Nd]).attr("x",W.width/2).attr("y",W.height/2).text(Z[fb]).transition().style("opacity",cb.length?0:1),X.select("line."+qe[Wd]).style("visibility","hidden"),Z[fc]&&(d=Z[vb]?{x1:0,x2:W.width,y1:function(a){return W.x(a)-w},y2:function(a){return W.x(a)-w}}:{x1:function(a){return W.x(a)+w},x2:function(a){return W.x(a)+w},y1:0,y2:W.height},(k=function(a){e=W.generateGridData(Z[gc],W.x),w=W.isCategorized()?W.xAxis.tickOffset():0,c=X.select("."+qe[Td]).selectAll("."+qe[Sd]).data(e),c.enter().append("line").attr("class",qe[Sd]),a||c.attr(d).style("opacity",function(){return+Y.select(this).attr(Z[vb]?"y1":"x1")===(Z[vb]?W.height:0)?0:1}),c.exit().remove()})()),f=X.select("."+qe[Vd]).selectAll("."+qe[Ud]).data(Z[hc]),g=f.enter().append("g").attr("class",function(a){return qe[Ud]+(a.class?" "+a.class:"")}),g.append("line").style("opacity",0),g.append("text").attr("text-anchor","end").attr("transform",Z[vb]?"":"rotate(-90)").attr("dx",Z[vb]?0:-W.margin.top).attr("dy",-5).style("opacity",0),f.exit().transition().duration(P).style("opacity",0).remove(),B&&Z[ic]&&(h=X.select("."+qe[Yd]).selectAll("."+qe[Xd]).data(W.y.ticks(Z[kc])),h.enter().append("line").attr("class",qe[Xd]),h.attr("x1",Z[vb]?W.y:0).attr("x2",Z[vb]?W.y:W.width).attr("y1",Z[vb]?0:W.y).attr("y2",Z[vb]?W.height:W.y),h.exit().remove(),W.smoothLines(h,"grid")),B){i=X.select("."+qe[$d]).selectAll("."+qe[Zd]).data(Z[jc]),j=i.enter().append("g").attr("class",function(a){return qe[Zd]+(a.class?" "+a.class:"")}),j.append("line").style("opacity",0),j.append("text").attr("text-anchor","end").attr("transform",Z[vb]?"rotate(-90)":"").attr("dx",Z[vb]?0:-W.margin.top).attr("dy",-5).style("opacity",0);var db=Ee(W.yv,W);i.select("line").transition().duration(P).attr("x1",Z[vb]?db:0).attr("x2",Z[vb]?db:W.width).attr("y1",Z[vb]?0:db).attr("y2",Z[vb]?W.height:db).style("opacity",1),i.select("text").transition().duration(P).attr("x",Z[vb]?0:W.width).attr("y",db).text(function(a){return a.text}).style("opacity",1),i.exit().transition().duration(P).style("opacity",0).remove()}q=X.select("."+qe[yd]).selectAll("."+qe[xd]).data(Z[Qc]),q.enter().append("g").attr("class",Ee(W.classRegion,W)).append("rect").style("fill-opacity",0),q.exit().transition().duration(P).style("opacity",0).remove(),p=X.selectAll("."+qe[Gd]).selectAll("."+qe[Fd]).data(Ee(W.barData,W)),p.enter().append("path").attr("class",Ee(W.classBar,W)).style("stroke",function(a){return W.color(a.id)}).style("fill",function(a){return W.color(a.id)}),p.style("opacity",Ee(W.initialOpacity,W)),p.exit().transition().duration(Q).style("opacity",0).remove(),l=X.selectAll("."+qe[Ed]).selectAll("."+qe[Dd]).data(Ee(W.lineData,W)),l.enter().append("path").attr("class",Ee(W.classLine,W)).style("stroke",W.color),l.style("opacity",Ee(W.initialOpacity,W)).attr("transform",null),l.exit().transition().duration(Q).style("opacity",0).remove(),m=X.selectAll("."+qe[Md]).selectAll("."+qe[Ld]).data(Ee(W.lineData,W)),m.enter().append("path").attr("class",Ee(W.classArea,W)).style("fill",W.color).style("opacity",function(){return W.orgAreaOpacity=+Y.select(this).style("opacity"),0}),m.style("opacity",W.orgAreaOpacity),m.exit().transition().duration(Q).style("opacity",0).remove(),Z[mc]&&(n=X.selectAll("."+qe[Id]).selectAll("."+qe[Hd]).data(Ee(W.lineOrScatterData,W)),n.enter().append("circle").attr("class",Ee(W.classCircle,W)).attr("r",Ee(W.pointR,W)).style("fill",W.color),n.style("opacity",Ee(W.initialOpacity,W)),n.exit().remove()),W.hasDataLabel()&&(r=X.selectAll("."+qe[Pd]).selectAll("."+qe[Od]).data(Ee(W.barOrLineData,W)),r.enter().append("text").attr("class",Ee(W.classText,W)).attr("text-anchor",function(a){return Z[vb]?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(a){return W.color(a)}).style("fill-opacity",0),r.text(function(a){return W.formatByAxisId(W.getAxisId(a.id))(a.value,a.id)}),r.exit().transition().duration(Q).style("fill-opacity",0).remove()),se(W.redrawArc)&&W.redrawArc(P,Q,G),se(W.redrawSubchart)&&W.redrawSubchart(C,b,P,Q,$,_,ab),X.selectAll("."+qe[pd]).filter(Ee(W.isBarType,W)).selectAll("circle").remove(),Z[s]&&(t=X.select("."+qe[rd]).style("cursor",Z[o]?Z[vb]?"ns-resize":"ew-resize":null),Ae(Z[z])&&!W.isSingleX(Z[z])?(t.classed(qe[td])||t.classed(qe[td],!0).classed(qe[sd],!1).selectAll("."+qe[qd]).remove(),u=X.select("."+qe[rd]).selectAll("."+qe[qd]).data([0]),W.generateEventRectsForMultipleXs(u.enter()),u.attr("x",0).attr("y",0).attr("width",W.width).attr("height",W.height)):(t.classed(qe[sd])||t.classed(qe[td],!1).classed(qe[sd],!0).selectAll("."+qe[qd]).remove(),!W.isCustomX()&&!W.isTimeSeries()||W.isCategorized()?(A=W.getEventRectWidth(),y=function(a){return W.x(a.x)-A/2}):(A=function(a){var b=W.getPrevX(a.index),c=W.getNextX(a.index),d=W.data.xs[a.id][a.index],e=(W.x(c?c:d)-W.x(b?b:d))/2;return 0>e?0:e},y=function(a){var b=W.getPrevX(a.index),c=W.data.xs[a.id][a.index];return(W.x(c)+W.x(b?b:c))/2}),v=W.getMaxDataCountTarget(W.data.targets),X.select("."+qe[rd]).datum(v?v.values:[]),u=X.select("."+qe[rd]).selectAll("."+qe[qd]).data(function(a){return a}),W.generateEventRectsForSingleX(u.enter()),u.attr("class",Ee(W.classEvent,W)).attr("x",Z[vb]?0:y).attr("y",Z[vb]?y:0).attr("width",Z[vb]?W.width:A).attr("height",Z[vb]?A:W.height),u.exit().remove()));var eb=Ee(W.xv,W);Y.transition().duration(P).each(function(){var b=[],c=Ee(W.config[vb]?W.circleY:W.circleX,W),d=Ee(W.config[vb]?W.circleX:W.circleY,W);b.push(p.transition().attr("d",L).style("fill",W.color).style("opacity",1)),b.push(l.transition().attr("d",M).style("stroke",W.color).style("opacity",1)),b.push(m.transition().attr("d",K).style("fill",W.color).style("opacity",W.orgAreaOpacity)),b.push(n.transition().style("opacity",Ee(W.opacityForCircle,W)).style("fill",W.color).attr("cx",c).attr("cy",d)),b.push(X.selectAll("."+qe[od]).transition().attr("cx",c).attr("cy",d)),b.push(r.transition().attr("x",N).attr("y",O).style("fill",W.color).style("fill-opacity",a.flow?0:Ee(W.opacityForText,W))),b.push(q.selectAll("rect").transition().attr("x",W.regionX).attr("y",W.regionY).attr("width",W.regionWidth).attr("height",W.regionHeight).style("fill-opacity",function(a){return re(a.opacity)?a.opacity:.1})),b.push(f.select("line").transition().attr("x1",Z[vb]?0:eb).attr("x2",Z[vb]?W.width:eb).attr("y1",Z[vb]?eb:W.margin.top).attr("y2",Z[vb]?eb:W.height).style("opacity",1)),b.push(f.select("text").transition().attr("x",Z[vb]?W.width:0).attr("y",eb).text(function(a){return a.text}).style("opacity",1)),a.flow&&(S=W.generateWait(),b.forEach(function(a){S.add(a)}))}).call(S?S:function(){},function(){var b,e,g,h=1,i=a.flow.index,j=a.flow.length,o=W.getValueOnIndex(W.data.targets[0].values,i),s=W.getValueOnIndex(W.data.targets[0].values,i+j),t=W.x.domain(),v=a.flow.duration||P,w=a.flow.done||function(){},x=W.generateWait();W.data.targets.forEach(function(a){a.values.splice(0,j)}),g=W.updateXDomain(cb,!0,!0),k&&k(!0),a.flow.orgDataCount?b=1===a.flow.orgDataCount||o.x===s.x?W.x(t[0])-W.x(g[0]):W.isTimeSeries()?W.x(t[0])-W.x(g[0]):W.x(o.x)-W.x(s.x):1!==W.data.targets[0].values.length?b=W.x(t[0])-W.x(g[0]):W.isTimeSeries()?(o=W.getValueOnIndex(W.data.targets[0].values,0),s=W.getValueOnIndex(W.data.targets[0].values,W.data.targets[0].values.length-1),b=W.x(o.x)-W.x(s.x)):b=ye(g)/2,h=ye(t)/ye(g),e="translate("+b+",0) scale("+h+",1)",Y.transition().ease("linear").duration(v).each(function(){x.add(W.axes.x.transition().call(W.xAxis)),x.add(p.transition().attr("transform",e)),x.add(l.transition().attr("transform",e)),x.add(m.transition().attr("transform",e)),x.add(n.transition().attr("transform",e)),x.add(r.transition().attr("transform",e)),x.add(q.filter(W.isRegionOnX).transition().attr("transform",e)),x.add(c.transition().attr("transform",e)),x.add(f.transition().attr("transform",e))}).call(x,function(){var a,b=[],e=[],g=[];if(j){for(a=0;j>a;a++)b.push("."+qe[Bd]+"-"+(i+a)),e.push("."+qe[Od]+"-"+(i+a)),g.push("."+qe[qd]+"-"+(i+a));W.svg.selectAll("."+qe[Cd]).selectAll(b).remove(),W.svg.selectAll("."+qe[Pd]).selectAll(e).remove(),W.svg.selectAll("."+qe[rd]).selectAll(g).remove(),W.svg.select("."+qe[Sd]).remove()}c.attr("transform",null).attr(d),f.attr("transform",null),f.select("line").attr("x1",Z[vb]?0:eb).attr("x2",Z[vb]?W.width:eb),f.select("text").attr("x",Z[vb]?W.width:0).attr("y",eb),p.attr("transform",null).attr("d",L),l.attr("transform",null).attr("d",M),m.attr("transform",null).attr("d",K),n.attr("transform",null).attr("cx",Z[vb]?W.circleY:W.circleX).attr("cy",Z[vb]?W.circleX:W.circleY),r.attr("transform",null).attr("x",N).attr("y",O).style("fill-opacity",Ee(W.opacityForText,W)),q.attr("transform",null),q.select("rect").filter(W.isRegionOnX).attr("x",W.regionX).attr("width",W.regionWidth),u.attr("x",Z[vb]?0:y).attr("y",Z[vb]?y:0).attr("width",Z[vb]?W.width:A).attr("height",Z[vb]?A:W.height),w()})}),W.mapToIds(W.data.targets).forEach(function(a){W.withoutFadeIn[a]=!0}),se(W.updateZoom)&&W.updateZoom()},f.updateAndRedraw=function(a){var b,c=this,d=c.config;a=a||{},a.withTransition=Be(a,"withTransition",!0),a.withTransform=Be(a,"withTransform",!1),a.withLegend=Be(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withTransitionForTransform=Be(a,"withTransitionForTransform",a.withTransition),c.updateSizes(),a.withLegend&&d[lb]||(b=c.generateAxisTransitions(a.withTransitionForAxis?d[x]:0),c.updateScales(),c.updateSvgSize(),c.transformAll(a.withTransitionForTransform,b)),c.redraw(a,b)},f.generateEventRectsForSingleX=function(a){var b=this,c=b.d3,d=b.config;a.append("rect").attr("class",Ee(b.classEvent,b)).style("cursor",d[Q]&&d[R]?"pointer":null).on("mouseover",function(a){var c,e,f=a.index;b.dragging||b.hasArcType()||(c=b.data.targets.map(function(a){return b.addName(b.getValueOnIndex(a.values,f))}),e=[],Object.keys(d[D]).forEach(function(a){for(var b=0;b<c.length;b++)if(c[b]&&c[b].id===a){e.push(c[b]),c.shift(b);break}}),c=e.concat(c),d[oc]&&b.expandCircles(f),b.expandBars(f),b.main.selectAll("."+qe[Bd]+"-"+f).each(function(a){d[V].call(g,a)}))}).on("mouseout",function(a){var c=a.index;b.hasArcType()||(b.hideXGridFocus(),b.hideTooltip(),b.unexpandCircles(c),b.unexpandBars(),b.main.selectAll("."+qe[Bd]+"-"+c).each(function(a){d[W].call(b,a)}))}).on("mousemove",function(a){var e,f=a.index,g=b.svg.select("."+qe[qd]+"-"+f);b.dragging||b.hasArcType()||(e=b.filterTargetsToShow(b.data.targets).map(function(a){return b.addName(b.getValueOnIndex(a.values,f))}),d[Sc]&&(b.showTooltip(e,c.mouse(this)),b.showXGridFocus(e)),(!d[Sc]||d[Q]&&!d[R])&&b.main.selectAll("."+qe[Bd]+"-"+f).each(function(){c.select(this).classed(qe[ne],!0),d[Q]&&g.style("cursor",d[R]?"pointer":null),d[Sc]||(b.hideXGridFocus(),b.hideTooltip(),d[R]||(b.unexpandCircles(f),b.unexpandBars()))}).filter(function(a){return"circle"===this.nodeName?b.isWithinCircle(this,b.pointSelectR(a)):"path"===this.nodeName?b.isWithinBar(this):void 0}).each(function(a){d[Q]&&(d[R]||d[S](a))&&g.style("cursor","pointer"),d[Sc]||(b.showTooltip([a],c.mouse(this)),b.showXGridFocus([a]),d[oc]&&b.expandCircles(f,a.id),b.expandBars(f,a.id))}))}).on("click",function(a){var c=a.index;if(!b.hasArcType()&&b.toggleShape)return b.cancelClick?void(b.cancelClick=!1):void b.main.selectAll("."+qe[Bd]+"-"+c).each(function(a){b.toggleShape(this,a,c)})}).call(c.behavior.drag().origin(Object).on("drag",function(){b.drag(c.mouse(this))}).on("dragstart",function(){b.dragstart(c.mouse(this))}).on("dragend",function(){b.dragend()})).on("dblclick.zoom",null)},f.generateEventRectsForMultipleXs=function(a){var b=this,c=b.d3,d=b.config;a.append("rect").attr("x",0).attr("y",0).attr("width",b.width).attr("height",b.height).attr("class",qe[qd]).on("mouseout",function(){b.hasArcType()||(b.hideXGridFocus(),b.hideTooltip(),b.unexpandCircles())}).on("mousemove",function(){var a,e,f,g,h=b.filterTargetsToShow(b.data.targets);b.dragging||b.hasArcType(h)||(a=c.mouse(this),e=b.findClosestFromTargets(h,a),e&&(f=b.isScatterType(e)?[e]:b.filterSameX(h,e.x),g=f.map(function(a){return b.addName(a)}),b.showTooltip(g,a),d[oc]&&(b.unexpandCircles(),b.expandCircles(e.index,e.id)),b.showXGridFocus(g),b.dist(e,a)<100?(b.svg.select("."+qe[qd]).style("cursor","pointer"),b.mouseover||(d[V].call(b,e),b.mouseover=!0)):b.mouseover&&(b.svg.select("."+qe[qd]).style("cursor",null),d[W].call(b,e),b.mouseover=!1)))}).on("click",function(){var a,d,e=b.filterTargetsToShow(b.data.targets);b.hasArcType(e)||(a=c.mouse(this),d=b.findClosestFromTargets(e,a),d&&b.dist(d,a)<100&&b.toggleShape&&b.main.select("."+qe[Id]+b.getTargetSelectorSuffix(d.id)).select("."+qe[Hd]+"-"+d.index).each(function(){b.toggleShape(this,d,d.index)}))}).call(c.behavior.drag().origin(Object).on("drag",function(){b.drag(c.mouse(this))}).on("dragstart",function(){b.dragstart(c.mouse(this))}).on("dragend",function(){b.dragend()})).on("dblclick.zoom",null)},f.isTimeSeries=function(){return"timeseries"===this.config[xb]},f.isCategorized=function(){return this.config[xb].indexOf("categor")>=0},f.isCustomX=function(){var a=this,b=a.config;return!a.isTimeSeries()&&(b[y]||Ae(b[z]))},f.getTranslate=function(a){var b,c,d=this,e=d.config;return"main"===a?(b=xe(d.margin.left),c=xe(d.margin.top)):"context"===a?(b=xe(d.margin2.left),c=xe(d.margin2.top)):"legend"===a?(b=d.margin3.left,c=d.margin3.top):"x"===a?(b=0,c=e[vb]?0:d.height):"y"===a?(b=0,c=e[vb]?d.height:0):"y2"===a?(b=e[vb]?0:d.width,c=e[vb]?1:0):"subx"===a?(b=0,c=e[vb]?0:d.height2):"arc"===a&&(b=d.arcWidth/2,c=d.arcHeight/2),"translate("+b+","+c+")"},f.initialOpacity=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?1:0},f.opacityForCircle=function(a){var b=this;return re(a.value)?b.isScatterType(a)?.5:1:0},f.opacityForText=function(){return this.hasDataLabel()?1:0},f.xx=function(a){return a?this.x(a.x):null},f.xv=function(a){var b=this;return Math.ceil(b.x(b.isTimeSeries()?b.parseDate(a.value):a.value))},f.yv=function(a){var b=this,c=a.axis&&"y2"===a.axis?b.y2:b.y;return Math.ceil(c(a.value))},f.subxx=function(a){return a?this.subX(a.x):null},f.transformMain=function(a,b){var c,d,e,f=this;b&&b.axisX?c=b.axisX:(c=f.main.select("."+qe[ae]),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=f.main.select("."+qe[ce]),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=f.main.select("."+qe[ee]),a&&(e=e.transition())),(a?f.main.transition():f.main).attr("transform",f.getTranslate("main")),c.attr("transform",f.getTranslate("x")),d.attr("transform",f.getTranslate("y")),e.attr("transform",f.getTranslate("y2")),f.main.select("."+qe[id]).attr("transform",f.getTranslate("arc"))},f.transformAll=function(a,b){var c=this;c.transformMain(a,b),$c[gb]&&c.transformContext(a,b),c.legend&&c.transformLegend(a)},f.updateSvgSize=function(){var a=this;a.svg.attr("width",a.currentWidth).attr("height",a.currentHeight),a.svg.select("#"+a.clipId).select("rect").attr("width",a.width).attr("height",a.height),a.svg.select("#"+a.clipIdForXAxis).select("rect").attr("x",Ee(a.getXAxisClipX,a)).attr("y",Ee(a.getXAxisClipY,a)).attr("width",Ee(a.getXAxisClipWidth,a)).attr("height",Ee(a.getXAxisClipHeight,a)),a.svg.select("#"+a.clipIdForYAxis).select("rect").attr("x",Ee(a.getYAxisClipX,a)).attr("y",Ee(a.getYAxisClipY,a)).attr("width",Ee(a.getYAxisClipWidth,a)).attr("height",Ee(a.getYAxisClipHeight,a)),a.svg.select("."+qe[ud]).attr("width",a.width).attr("height",a.height),a.selectChart.style("max-height",a.currentHeight+"px")},f.updateDimension=function(){var a=this;a.config[vb]?(a.axes.x.call(a.xAxis),a.axes.subx.call(a.subXAxis)):(a.axes.y.call(a.yAxis),a.axes.y2.call(a.y2Axis)),a.updateSizes(),a.updateScales(),a.updateSvgSize(),a.transformAll(!1)},f.observeInserted=function(b){var c=this,d=new MutationObserver(function(e){e.forEach(function(e){if("childList"===e.type&&e.previousSibling){d.disconnect();var f=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(f),c.updateDimension(),c.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10)}})});d.observe(b.node(),{attributes:!0,childList:!0,characterData:!0})},f.generateResize=function(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a},f.transformTo=function(a,b,c){var d=this,e=!d.hasArcType(),f=c||{withTransitionForAxis:e};f.withTransitionForTransform=!1,d.transiting=!1,d.setTargetType(a,b),d.updateAndRedraw(f)},f.generateAxisTransitions=function(a){var b=this,c=b.axes;return{axisX:a?c.x.transition().duration(a):c.x,axisY:a?c.y.transition().duration(a):c.y,axisY2:a?c.y2.transition().duration(a):c.y2,axisSubX:a?c.subx.transition().duration(a):c.subx}},f.endall=function(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})},f.generateWait=function(){var a=[],b=function(b,c){var d=setInterval(function(){var b=0;a.forEach(function(a){if(a.empty())return void(b+=1);try{a.transition()}catch(c){b+=1}}),b===a.length&&(clearInterval(d),c&&c())},10)};return b.add=function(b){a.push(b)},b},f.parseDate=function(b){var c,d=this;return c=b instanceof Date?b:"number"==typeof b?new Date(b):d.dataTimeFormat($c[A]).parse(b),(!c||isNaN(+c))&&a.console.error("Failed to parse x '"+b+"' to Date object"),c};var h="bindto",i="size_width",j="size_height",k="padding_left",l="padding_right",m="padding_top",n="padding_bottom",o="zoom_enabled",p="zoom_extent",q="zoom_privileged",r="zoom_onzoom",s="interaction_enabled",t="onmouseover",u="onmouseout",v="onresize",w="onresized",x="transition_duration",y="data_x",z="data_xs",A="data_x_format",B="data_x_localtime",C="data_id_converter",D="data_names",E="data_classes",F="data_groups",G="data_axes",H="data_type",I="data_types",J="data_labels",K="data_order",L="data_regions",M="data_color",N="data_colors",O="data_hide",P="data_filter",Q="data_selection_enabled",R="data_selection_grouped",S="data_selection_isselectable",T="data_selection_multiple",U="data_onclick",V="data_onmouseover",W="data_onmouseout",X="data_onselected",Y="data_onunselected",Z="data_ondragstart",$="data_ondragend",_="data_url",ab="data_json",bb="data_rows",cb="data_columns",db="data_mimeType",eb="data_keys",fb="data_empty_label_text",gb="subchart_show",hb="subchart_size_height",ib="subchart_onbrush",jb="color_pattern",kb="color_threshold",lb="legend_show",mb="legend_position",nb="legend_inset_anchor",ob="legend_inset_x",pb="legend_inset_y",qb="legend_inset_step",rb="legend_item_onclick",sb="legend_item_onmouseover",tb="legend_item_onmouseout",ub="legend_equally",vb="axis_rotated",wb="axis_x_show",xb="axis_x_type",yb="axis_x_localtime",zb="axis_x_categories",Ab="axis_x_tick_centered",Bb="axis_x_tick_format",Cb="axis_x_tick_culling",Db="axis_x_tick_culling_max",Eb="axis_x_tick_count",Fb="axis_x_tick_fit",Gb="axis_x_tick_values",Hb="axis_x_tick_rotate",Ib="axis_x_tick_outer",Jb="axis_x_max",Kb="axis_x_min",Lb="axis_x_padding",Mb="axis_x_height",Nb="axis_x_default",Ob="axis_x_label",Pb="axis_y_show",Qb="axis_y_max",Rb="axis_y_min",Sb="axis_y_center",Tb="axis_y_label",Ub="axis_y_tick_format",Vb="axis_y_tick_outer",Wb="axis_y_padding",Xb="axis_y_ticks",Yb="axis_y2_show",Zb="axis_y2_max",$b="axis_y2_min",_b="axis_y2_center",ac="axis_y2_label",bc="axis_y2_tick_format",cc="axis_y2_tick_outer",dc="axis_y2_padding",ec="axis_y2_ticks",fc="grid_x_show",gc="grid_x_type",hc="grid_x_lines",ic="grid_y_show",jc="grid_y_lines",kc="grid_y_ticks",lc="grid_focus_show",mc="point_show",nc="point_r",oc="point_focus_expand_enabled",pc="point_focus_expand_r",qc="point_select_r",rc="line_connect_null",sc="bar_width",tc="bar_width_ratio",uc="bar_width_max",vc="bar_zerobased",wc="area_zerobased",xc="pie_label_show",yc="pie_label_format",zc="pie_label_threshold",Ac="pie_sort",Bc="pie_expand",Cc="gauge_label_show",Dc="gauge_label_format",Ec="gauge_expand",Fc="gauge_min",Gc="gauge_max",Hc="gauge_units",Ic="gauge_width",Jc="donut_label_show",Kc="donut_label_format",Lc="donut_label_threshold",Mc="donut_width",Nc="donut_sort",Oc="donut_expand",Pc="donut_title",Qc="regions",Rc="tooltip_show",Sc="tooltip_grouped",Tc="tooltip_format_title",Uc="tooltip_format_name",Vc="tooltip_format_value",Wc="tooltip_contents",Xc="tooltip_init_show",Yc="tooltip_init_x",Zc="tooltip_init_position",$c=f.config={}; |
|
$c[h]="#chart",$c[i]=void 0,$c[j]=void 0,$c[k]=void 0,$c[l]=void 0,$c[m]=void 0,$c[n]=void 0,$c[o]=!1,$c[p]=void 0,$c[q]=!1,$c[r]=function(){},$c[s]=!0,$c[t]=function(){},$c[u]=function(){},$c[v]=function(){},$c[w]=function(){},$c[x]=350,$c[y]=void 0,$c[z]={},$c[A]="%Y-%m-%d",$c[B]=!0,$c[C]=function(a){return a},$c[D]={},$c[E]={},$c[F]=[],$c[G]={},$c[H]=void 0,$c[I]={},$c[J]={},$c[K]="desc",$c[L]={},$c[M]=void 0,$c[N]={},$c[O]=!1,$c[P]=void 0,$c[Q]=!1,$c[R]=!1,$c[S]=function(){return!0},$c[T]=!0,$c[U]=function(){},$c[V]=function(){},$c[W]=function(){},$c[X]=function(){},$c[Y]=function(){},$c[Z]=function(){},$c[$]=function(){},$c[_]=void 0,$c[ab]=void 0,$c[bb]=void 0,$c[cb]=void 0,$c[db]=void 0,$c[eb]=void 0,$c[fb]="",$c[gb]=!1,$c[hb]=60,$c[ib]=function(){},$c[jb]=[],$c[kb]={},$c[lb]=!0,$c[mb]="bottom",$c[nb]="top-left",$c[ob]=10,$c[pb]=0,$c[qb]=void 0,$c[rb]=void 0,$c[sb]=void 0,$c[tb]=void 0,$c[ub]=!1,$c[vb]=!1,$c[wb]=!0,$c[xb]="indexed",$c[yb]=!0,$c[zb]=[],$c[Ab]=!1,$c[Bb]=void 0,$c[Cb]={},$c[Db]=10,$c[Eb]=void 0,$c[Fb]=!0,$c[Gb]=null,$c[Hb]=void 0,$c[Ib]=!0,$c[Jb]=null,$c[Kb]=null,$c[Lb]={},$c[Mb]=void 0,$c[Nb]=void 0,$c[Ob]={},$c[Pb]=!0,$c[Qb]=void 0,$c[Rb]=void 0,$c[Sb]=void 0,$c[Tb]={},$c[Ub]=void 0,$c[Vb]=!0,$c[Wb]=void 0,$c[Xb]=10,$c[Yb]=!1,$c[Zb]=void 0,$c[$b]=void 0,$c[_b]=void 0,$c[ac]={},$c[bc]=void 0,$c[cc]=!0,$c[dc]=void 0,$c[ec]=10,$c[fc]=!1,$c[gc]="tick",$c[hc]=[],$c[ic]=!1,$c[jc]=[],$c[kc]=10,$c[lc]=!0,$c[mc]=!0,$c[nc]=2.5,$c[oc]=!0,$c[pc]=void 0,$c[qc]=void 0,$c[rc]=!1,$c[sc]=void 0,$c[tc]=.6,$c[uc]=void 0,$c[vc]=!0,$c[wc]=!0,$c[xc]=!0,$c[yc]=void 0,$c[zc]=.05,$c[Ac]=!0,$c[Bc]=!0,$c[Cc]=!0,$c[Dc]=void 0,$c[Ec]=!0,$c[Fc]=0,$c[Gc]=100,$c[Hc]=void 0,$c[Ic]=void 0,$c[Jc]=!0,$c[Kc]=void 0,$c[Lc]=.05,$c[Mc]=void 0,$c[Nc]=!0,$c[Oc]=!0,$c[Pc]="",$c[Qc]=[],$c[Rc]=!0,$c[Sc]=!0,$c[Tc]=void 0,$c[Uc]=void 0,$c[Vc]=void 0,$c[Wc]=function(a,b,c,d){return this.getTooltipContent?this.getTooltipContent(a,c,c,d):""},$c[Xc]=!1,$c[Yc]=0,$c[Zc]={top:"0px",left:"50px"},f.loadConfig=function(a){function b(){var a=d.shift();return a&&c&&a in c?(c=c[a],b()):a?void 0:c}var c,d,e,f=this.config;Object.keys(f).forEach(function(g){c=a,d=g.split("_"),e=b(),ve(e)&&(f[g]=e)})},f.getScale=function(a,b,c){return(c?this.d3.time.scale():this.d3.scale.linear()).range([a,b])},f.getX=function(a,b,c,d){var e,f=this,g=f.getScale(a,b,f.isTimeSeries()),h=c?g.domain(c):g;f.isCategorized()?(d=d||function(){return 0},g=function(a,b){var c=h(a)+d(a);return b?c:Math.ceil(c)}):g=function(a,b){var c=h(a);return b?c:Math.ceil(c)};for(e in h)g[e]=h[e];return g.orgDomain=function(){return h.domain()},f.isCategorized()&&(g.domain=function(a){return arguments.length?(h.domain(a),g):(a=this.orgDomain(),[a[0],a[1]+1])}),g},f.getY=function(a,b,c){var d=this.getScale(a,b);return c&&d.domain(c),d},f.getYScale=function(a){return"y2"===this.getAxisId(a)?this.y2:this.y},f.getSubYScale=function(a){return"y2"===this.getAxisId(a)?this.subY2:this.subY},f.updateScales=function(){var a=this,b=a.config,c=!a.x;a.xMin=b[vb]?1:0,a.xMax=b[vb]?a.height:a.width,a.yMin=b[vb]?0:a.height,a.yMax=b[vb]?a.width:1,a.subXMin=a.xMin,a.subXMax=a.xMax,a.subYMin=b[vb]?0:a.height2,a.subYMax=b[vb]?a.width2:1,a.x=a.getX(a.xMin,a.xMax,c?void 0:a.x.orgDomain(),function(){return a.xAxis.tickOffset()}),a.y=a.getY(a.yMin,a.yMax,c?void 0:a.y.domain()),a.y2=a.getY(a.yMin,a.yMax,c?void 0:a.y2.domain()),a.subX=a.getX(a.xMin,a.xMax,a.orgXDomain,function(b){return b%1?0:a.subXAxis.tickOffset()}),a.subY=a.getY(a.subYMin,a.subYMax,c?void 0:a.subY.domain()),a.subY2=a.getY(a.subYMin,a.subYMax,c?void 0:a.subY2.domain()),a.xAxisTickFormat=a.getXAxisTickFormat(),a.xAxisTickValues=b[Gb]?b[Gb]:c?void 0:a.xAxis.tickValues(),a.xAxis=a.getXAxis(a.x,a.xOrient,a.xAxisTickFormat,a.xAxisTickValues),a.subXAxis=a.getXAxis(a.subX,a.subXOrient,a.xAxisTickFormat,a.xAxisTickValues),a.yAxis=a.getYAxis(a.y,a.yOrient,b[Ub],b[Xb]),a.y2Axis=a.getYAxis(a.y2,a.y2Orient,b[bc],b[ec]),c||(a.brush&&a.brush.scale(a.subX),b[o]&&a.zoom.scale(a.x)),se(a.updateArc)&&a.updateArc()},f.getYDomainMin=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i[F].length>0)for(g=h.hasNegativeValueInTargets(a),b=0;b<i[F].length;b++)if(e=i[F][b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=0>a?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.getAxisId(f)!==h.getAxisId(d)||!k[d]||g&&+a>0||(k[d][b]+=+a)});return h.d3.min(Object.keys(k).map(function(a){return h.d3.min(k[a])}))},f.getYDomainMax=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i[F].length>0)for(g=h.hasPositiveValueInTargets(a),b=0;b<i[F].length;b++)if(e=i[F][b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=a>0?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.getAxisId(f)!==h.getAxisId(d)||!k[d]||g&&0>+a||(k[d][b]+=+a)});return h.d3.max(Object.keys(k).map(function(a){return h.d3.max(k[a])}))},f.getYDomain=function(a,b){var c,d,e,f,g,h,i,j,k,l,m=this,n=m.config,o=a.filter(function(a){return m.getAxisId(a.id)===b}),p="y2"===b?n[$b]:n[Rb],q="y2"===b?n[Zb]:n[Qb],r=re(p)?p:m.getYDomainMin(o),s=re(q)?q:m.getYDomainMax(o),t="y2"===b?n[_b]:n[Sb],u=m.hasType("bar",o)&&n[vc]||m.hasType("area",o)&&n[wc],v=m.hasDataLabel()&&n[vb],w=m.hasDataLabel()&&!n[vb];return 0===o.length?"y2"===b?m.y2.domain():m.y.domain():(r===s&&(0>r?s=0:r=0),k=r>=0&&s>=0,l=0>=r&&0>=s,u&&(k&&(r=0),l&&(s=0)),c=Math.abs(s-r),d=e=f=.1*c,t&&(g=Math.max(Math.abs(r),Math.abs(s)),s=g-t,r=t-g),v?(h=m.getDataLabelLength(r,s,b,"width"),i=ye(m.y.range()),j=[h[0]/i,h[1]/i],e+=c*(j[1]/(1-j[0]-j[1])),f+=c*(j[0]/(1-j[0]-j[1]))):w&&(h=m.getDataLabelLength(r,s,b,"height"),e+=h[1],f+=h[0]),"y"===b&&n[Wb]&&(e=m.getAxisPadding(n[Wb],"top",d,c),f=m.getAxisPadding(n[Wb],"bottom",d,c)),"y2"===b&&n[dc]&&(e=m.getAxisPadding(n[dc],"top",d,c),f=m.getAxisPadding(n[dc],"bottom",d,c)),u&&(k&&(f=r),l&&(e=-s)),[r-f,s+e])},f.getXDomainMin=function(a){var b=this,c=b.config;return c[Kb]?b.isTimeSeries()?this.parseDate(c[Kb]):c[Kb]:b.d3.min(a,function(a){return b.d3.min(a.values,function(a){return a.x})})},f.getXDomainMax=function(a){var b=this,c=b.config;return c[Jb]?b.isTimeSeries()?this.parseDate(c[Jb]):c[Jb]:b.d3.max(a,function(a){return b.d3.max(a.values,function(a){return a.x})})},f.getXDomainPadding=function(a){var b,c,d,e,f=this,g=f.config,h=this.getEdgeX(a),i=h[1]-h[0];return f.isCategorized()?c=0:f.hasType("bar",a)?(b=f.getMaxDataCount(),c=b>1?i/(b-1)/2:.5):c=.01*i,"object"==typeof g[Lb]&&Ae(g[Lb])?(d=re(g[Lb].left)?g[Lb].left:c,e=re(g[Lb].right)?g[Lb].right:c):d=e="number"==typeof g[Lb]?g[Lb]:c,{left:d,right:e}},f.getXDomain=function(a){var b=this,c=[b.getXDomainMin(a),b.getXDomainMax(a)],d=c[0],e=c[1],f=b.getXDomainPadding(a),g=0,h=0;return d-e!==0||b.isCategorized()||(d=b.isTimeSeries()?new Date(.5*d.getTime()):-.5,e=b.isTimeSeries()?new Date(1.5*e.getTime()):.5),(d||0===d)&&(g=b.isTimeSeries()?new Date(d.getTime()-f.left):d-f.left),(e||0===e)&&(h=b.isTimeSeries()?new Date(e.getTime()+f.right):e+f.right),[g,h]},f.updateXDomain=function(a,b,c,d){var e=this,f=e.config;return c&&(e.x.domain(d?d:e.d3.extent(e.getXDomain(a))),e.orgXDomain=e.x.domain(),f[o]&&e.zoom.scale(e.x).updateScaleExtent(),e.subX.domain(e.x.domain()),e.brush&&e.brush.scale(e.subX)),b&&(e.x.domain(d?d:!e.brush||e.brush.empty()?e.orgXDomain:e.brush.extent()),f[o]&&e.zoom.scale(e.x).updateScaleExtent()),e.x.domain()},f.isX=function(a){var b=this,c=b.config;return c[y]&&a===c[y]||Ae(c[z])&&Ce(c[z],a)},f.isNotX=function(a){return!this.isX(a)},f.getXKey=function(a){var b=this,c=b.config;return c[y]?c[y]:Ae(c[z])?c[z][a]:null},f.getXValuesOfXKey=function(a,b){var c,d=this,e=b&&Ae(b)?d.mapToIds(b):[];return e.forEach(function(b){d.getXKey(b)===a&&(c=d.data.xs[b])}),c},f.getXValue=function(a,b){var c=this;return a in c.data.xs&&c.data.xs[a]&&re(c.data.xs[a][b])?c.data.xs[a][b]:b},f.getOtherTargetXs=function(){var a=this,b=Object.keys(a.data.xs);return b.length?a.data.xs[b[0]]:null},f.getOtherTargetX=function(a){var b=this.getOtherTargetXs();return b&&a<b.length?b[a]:null},f.addXs=function(a){var b=this;Object.keys(a).forEach(function(c){b.config[z][c]=a[c]})},f.isSingleX=function(a){return 1===this.d3.set(Object.keys(a).map(function(b){return a[b]})).size()},f.addName=function(a){var b,c=this;return a&&(b=c.config[D][a.id],a.name=b?b:a.id),a},f.getValueOnIndex=function(a,b){var c=a.filter(function(a){return a.index===b});return c.length?c[0]:null},f.updateTargetX=function(a,b){var c=this;a.forEach(function(a){a.values.forEach(function(d,e){d.x=c.generateTargetX(b[e],a.id,e)}),c.data.xs[a.id]=b})},f.updateTargetXs=function(a,b){var c=this;a.forEach(function(a){b[a.id]&&c.updateTargetX([a],b[a.id])})},f.generateTargetX=function(a,b,c){var d,e=this;return d=e.isTimeSeries()?e.parseDate(a?a:e.getXValue(b,c)):e.isCustomX()&&!e.isCategorized()?re(a)?+a:e.getXValue(b,c):c},f.cloneTarget=function(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}},f.getPrevX=function(a){var b=this,c=b.getValueOnIndex(b.data.targets[0].values,a-1);return c?c.x:null},f.getNextX=function(a){var b=this,c=b.getValueOnIndex(b.data.targets[0].values,a+1);return c?c.x:null},f.getMaxDataCount=function(){var a=this;return a.d3.max(a.data.targets,function(a){return a.values.length})},f.getMaxDataCountTarget=function(a){var b,c=a.length,d=0;return c>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b},f.getEdgeX=function(a){var b,c,d=this.getMaxDataCountTarget(a);return d?(b=d.values[0],c=d.values[d.values.length-1],[b.x,c.x]):[0,0]},f.mapToIds=function(a){return a.map(function(a){return a.id})},f.mapToTargetIds=function(a){var b=this;return a?te(a)?[a]:a:b.mapToIds(b.data.targets)},f.hasTarget=function(a,b){var c,d=this.mapToIds(a);for(c=0;c<d.length;c++)if(d[c]===b)return!0;return!1},f.isTargetToShow=function(a){return this.hiddenTargetIds.indexOf(a)<0},f.isLegendToShow=function(a){return this.hiddenLegendIds.indexOf(a)<0},f.filterTargetsToShow=function(a){var b=this;return a.filter(function(a){return b.isTargetToShow(a.id)})},f.mapTargetsToUniqueXs=function(a){var b=this,c=b.d3.set(b.d3.merge(a.map(function(a){return a.values.map(function(a){return a.x})}))).values();return c.map(b.isTimeSeries()?function(a){return new Date(a)}:function(a){return+a})},f.addHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.concat(a)},f.removeHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(b){return a.indexOf(b)<0})},f.addHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.concat(a)},f.removeHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(b){return a.indexOf(b)<0})},f.getValuesAsIdKeyed=function(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b},f.checkValueInTargets=function(a,b){var c,d,e,f=Object.keys(a);for(c=0;c<f.length;c++)for(e=a[f[c]].values,d=0;d<e.length;d++)if(b(e[d].value))return!0;return!1},f.hasNegativeValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return 0>a})},f.hasPositiveValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return a>0})},f.isOrderDesc=function(){var a=this.config;return a[K]&&"desc"===a[K].toLowerCase()},f.isOrderAsc=function(){var a=this.config;return a[K]&&"asc"===a[K].toLowerCase()},f.orderTargets=function(a){var b=this,c=b.config,d=b.isOrderAsc(),e=b.isOrderDesc();return d||e?a.sort(function(a,b){var c=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(c,0),f=b.values.reduce(c,0);return d?f-e:e-f}):se(c[K])&&a.sort(c[K]),a},f.filterSameX=function(a,b){return this.d3.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})},f.filterRemoveNull=function(a){return a.filter(function(a){return re(a.value)})},f.hasDataLabel=function(){var a=this.config;return"boolean"==typeof a[J]&&a[J]?!0:"object"==typeof a[J]&&Ae(a[J])?!0:!1},f.getDataLabelLength=function(a,b,c,d){var e=this,f=[0,0],g=1.3;return e.selectChart.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){return e.formatByAxisId(c)(a)}).each(function(a,b){f[b]=this.getBoundingClientRect()[d]*g}).remove(),f},f.isNoneArc=function(a){return this.hasTarget(this.data.targets,a.id)},f.isArc=function(a){return"data"in a&&this.hasTarget(this.data.targets,a.data.id)},f.findSameXOfValues=function(a,b){var c,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c<a.length&&d===a[c].x;c++)e.push(a[c]);return e},f.findClosestOfValues=function(a,b,c,d){var e,f=this,g=c?c:0,h=d?d:a.length-1,i=Math.floor((h-g)/2)+g,j=a[i],k=f.x(j.x)-b[f.config[vb]?1:0];return k>0?h=i:g=i,h-g===1||0===g&&0===h?(e=[],(a[g].x||0===a[g].x)&&(e=e.concat(f.findSameXOfValues(a,g))),(a[h].x||0===a[h].x)&&(e=e.concat(f.findSameXOfValues(a,h))),f.findClosest(e,b)):f.findClosestOfValues(a,b,g,h)},f.findClosestFromTargets=function(a,b){var c,d=this;return c=a.map(function(a){return d.findClosestOfValues(a.values,b)}),d.findClosest(c,b)},f.findClosest=function(a,b){var c,d,e=this;return a.forEach(function(a){var f=e.dist(a,b);(c>f||!c)&&(c=f,d=a)}),d},f.dist=function(a,b){var c=this,d=c.config,e="y"===c.getAxisId(a.id)?c.y:c.y2,f=d[vb]?1:0,g=d[vb]?0:1;return Math.pow(c.x(a.x)-b[f],2)+Math.pow(e(a.value)-b[g],2)},f.convertUrlToData=function(a,b,c,d){var e=this,f=b?b:"csv";e.d3.xhr(a,function(a,b){var g;g="json"===f?e.convertJsonToData(JSON.parse(b.response),c):e.convertCsvToData(b.response),d(g)})},f.convertCsvToData=function(a){var b,c=this.d3,d=c.csv.parseRows(a);return 1===d.length?(b=[{}],d[0].forEach(function(a){b[0][a]=null})):b=c.csv.parse(a),b},f.convertJsonToData=function(a,b){var c,d,e=this,f=[];return b?(c=b.value,b.x&&(c.push(b.x),e.config[y]=b.x),f.push(c),a.forEach(function(a){var b=[];c.forEach(function(c){var d=ue(a[c])?null:a[c];b.push(d)}),f.push(b)}),d=e.convertRowsToData(f)):(Object.keys(a).forEach(function(b){f.push([b].concat(a[b]))}),d=e.convertColumnsToData(f)),d},f.convertRowsToData=function(a){var b,c,d=a[0],e={},f=[];for(b=1;b<a.length;b++){for(e={},c=0;c<a[b].length;c++){if(ue(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[d[c]]=a[b][c]}f.push(e)}return f},f.convertColumnsToData=function(a){var b,c,d,e=[];for(b=0;b<a.length;b++)for(d=a[b][0],c=1;c<a[b].length;c++){if(ue(e[c-1])&&(e[c-1]={}),ue(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[c-1][d]=a[b][c]}return e},f.convertDataToTargets=function(a,b){var c,d=this,e=d.config,f=d.d3.keys(a[0]).filter(d.isNotX,d),g=d.d3.keys(a[0]).filter(d.isX,d);return f.forEach(function(c){var f=d.getXKey(c);d.isCustomX()||d.isTimeSeries()?g.indexOf(f)>=0?d.data.xs[c]=(b&&d.data.xs[c]?d.data.xs[c]:[]).concat(a.map(function(a){return a[f]}).filter(re).map(function(a,b){return d.generateTargetX(a,c,b)})):e[y]?d.data.xs[c]=d.getOtherTargetXs():Ae(e[z])&&(d.data.xs[c]=d.getXValuesOfXKey(f,d.data.targets)):d.data.xs[c]=a.map(function(a,b){return b})}),f.forEach(function(a){if(!d.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=f.map(function(b,c){var f=e[C](b);return{id:f,id_org:b,values:a.map(function(a,g){var h=d.getXKey(b),i=a[h],j=d.generateTargetX(i,b,g);return d.isCustomX()&&d.isCategorized()&&0===c&&i&&(0===g&&(e[zb]=[]),e[zb].push(i)),(ue(a[b])||d.data.xs[b].length<=g)&&(j=void 0),{x:j,value:null===a[b]||isNaN(a[b])?null:+a[b],id:f}}).filter(function(a){return ve(a.x)})}}),c.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++}),d.data.xs[a.id].sort(function(a,b){return a-b})}),e[H]&&d.setTargetType(d.mapToIds(c).filter(function(a){return!(a in e[I])}),e[H]),c.forEach(function(a){d.addCache(a.id_org,a)}),c},f.load=function(a,b){var c=this;a&&(b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){c.setTargetType(a.id,b.types?b.types[a.id]:b.type)}),c.data.targets.forEach(function(b){for(var c=0;c<a.length;c++)if(b.id===a[c].id){b.values=a[c].values,a.splice(c,1);break}}),c.data.targets=c.data.targets.concat(a)),c.updateTargets(c.data.targets),c.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),se(b.done)&&b.done()},f.loadFromArgs=function(a){var b=this;a.data?b.load(b.convertDataToTargets(a.data),a):a.url?b.convertUrlToData(a.url,a.mimeType,a.keys,function(c){b.load(b.convertDataToTargets(c),a)}):a.json?b.load(b.convertDataToTargets(b.convertJsonToData(a.json,a.keys)),a):a.rows?b.load(b.convertDataToTargets(b.convertRowsToData(a.rows)),a):a.columns?b.load(b.convertDataToTargets(b.convertColumnsToData(a.columns)),a):b.load(null,a)},f.unload=function(a,b){var c=this;return se(b)||(b=function(){}),a=a.filter(function(a){return c.hasTarget(c.data.targets,a)}),a&&0!==a.length?(c.svg.selectAll(a.map(function(a){return c.selectorTarget(a)})).transition().style("opacity",0).remove().call(c.endall,b),void a.forEach(function(a){c.withoutFadeIn[a]=!1,c.legend&&c.legend.selectAll("."+qe[he]+c.getTargetSelectorSuffix(a)).remove(),c.data.targets=c.data.targets.filter(function(b){return b.id!==a})})):void b()},f.categoryName=function(a){var b=this.config;return a<b[zb].length?b[zb][a]:a},f.getCurrentWidth=function(){var a=this,b=a.config;return b[i]?b[i]:a.getParentWidth()},f.getCurrentHeight=function(){var a=this,b=a.config,c=b[j]?b[j]:a.getParentHeight();return c>0?c:320},f.getCurrentPaddingTop=function(){var a=this.config;return re(a[m])?a[m]:0},f.getCurrentPaddingBottom=function(){var a=this.config;return re(a[n])?a[n]:0},f.getCurrentPaddingLeft=function(){var a=this,b=a.config;return re(b[k])?b[k]:b[vb]?b[wb]?Math.max(we(a.getAxisWidthByAxisId("x")),40):1:b[Pb]?we(a.getAxisWidthByAxisId("y")):1},f.getCurrentPaddingRight=function(){var a=this,b=a.config,c=10,d=a.isLegendRight?a.getLegendWidth()+20:0;return re(b[l])?b[l]+1:b[vb]?c+d:(b[Yb]?we(a.getAxisWidthByAxisId("y2")):c)+d},f.getParentRectValue=function(a){for(var b,c=this.selectChart.node();c&&"BODY"!==c.tagName&&!(b=c.getBoundingClientRect()[a]);)c=c.parentNode;return b},f.getParentWidth=function(){return this.getParentRectValue("width")},f.getParentHeight=function(){var a=this.selectChart.style("height");return a.indexOf("px")>0?+a.replace("px",""):0},f.getSvgLeft=function(){var a=this,b=a.config,c=b[vb]?qe[ae]:qe[ce],d=a.main.select("."+c).node(),e=d?d.getBoundingClientRect():{right:0},f=a.selectChart.node().getBoundingClientRect(),g=a.hasArcType(),h=e.right-f.left-(g?0:a.getCurrentPaddingLeft());return h>0?h:0},f.getAxisWidthByAxisId=function(a){var b=this,c=b.getAxisLabelPositionById(a);return c.isInner?20+b.getMaxTickWidth(a):40+b.getMaxTickWidth(a)},f.getHorizontalAxisHeight=function(a){var b=this,c=b.config;return"x"!==a||c[wb]?"x"===a&&c[Mb]?c[Mb]:"y"!==a||c[Pb]?"y2"!==a||c[Yb]?(b.getAxisLabelPositionById(a).isInner?30:40)+("y2"===a?-10:0):b.rotated_padding_top:!c[lb]||b.isLegendRight||b.isLegendInset?1:10:0},f.getEventRectWidth=function(){var a,b,c,d,e,f,g=this,h=g.getMaxDataCountTarget(g.data.targets);return h?(a=h.values[0],b=h.values[h.values.length-1],c=g.x(b.x)-g.x(a.x),0===c?g.config[vb]?g.height:g.width:(d=g.getMaxDataCount(),e=g.hasType("bar")?(d-(g.isCategorized()?.25:1))/d:1,f=d>1?c*e/(d-1):c,1>f?1:f)):0},f.getShapeIndices=function(a){var b,c,d=this,e=d.config,f={},g=0;return d.filterTargetsToShow(d.data.targets.filter(a,d)).forEach(function(a){for(b=0;b<e[F].length;b++)if(!(e[F][b].indexOf(a.id)<0))for(c=0;c<e[F][b].length;c++)if(e[F][b][c]in f){f[a.id]=f[e[F][b][c]];break}ue(f[a.id])&&(f[a.id]=g++)}),f.__max__=g-1,f},f.getShapeX=function(a,b,c,d){var e=this,f=d?e.subX:e.x;return function(d){var e=d.id in c?c[d.id]:0;return d.x||0===d.x?f(d.x)-a*(b/2-e):0}},f.getShapeY=function(a){var b=this;return function(c){var d=a?b.getSubYScale(c.id):b.getYScale(c.id);return d(c.value)}},f.getShapeOffset=function(a,b,c){var d=this,e=d.orderTargets(d.filterTargetsToShow(d.data.targets.filter(a,d))),f=e.map(function(a){return a.id});return function(a,g){var h=c?d.getSubYScale(a.id):d.getYScale(a.id),i=h(0),j=i;return e.forEach(function(c){c.id!==a.id&&b[c.id]===b[a.id]&&f.indexOf(c.id)<f.indexOf(a.id)&&c.values[g].value*a.value>=0&&(j+=h(c.values[g].value)-i)}),j}},f.getInterpolate=function(a){var b=this;return b.isSplineType(a)?"cardinal":b.isStepType(a)?"step-after":"linear"},f.circleX=function(a){return a.x||0===a.x?this.x(a.x):null},f.circleY=function(a,b){var c=this,d=c.getShapeIndices(c.isLineType),e=c.generateGetLinePoint(d);return c.config[F].length>0?e(a,b)[0][1]:c.getYScale(a.id)(a.value)},f.getCircles=function(a,b){var c=this;return(b?c.main.selectAll("."+qe[Id]+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+qe[Hd]+(re(a)?"-"+a:""))},f.expandCircles=function(a,b){var c=this;c.getCircles(a,b).classed(qe[ne],!0).attr("r",Ee(c.pointExpandedR,c))},f.unexpandCircles=function(a){var b=this;b.getCircles(a).filter(function(){return b.d3.select(this).classed(qe[ne])}).classed(qe[ne],!1).attr("r",Ee(b.pointR,b))},f.pointR=function(a){var b=this,c=b.config;return c[mc]&&!b.isStepType(a)?se(c[nc])?c[nc](a):c[nc]:0},f.pointExpandedR=function(a){var b=this,c=b.config;return c[oc]?c[pc]?c[pc]:1.75*b.pointR(a):b.pointR(a)},f.pointSelectR=function(a){var b=this,c=b.config;return c[qc]?c[qc]:4*b.pointR(a)},f.getBarW=function(a,b){var c=this,d=c.config,e="number"==typeof d[sc]?d[sc]:b?2*a.tickOffset()*d[tc]/b:0;return d[uc]&&e>d[uc]?d[uc]:e},f.getBars=function(a){var b=this;return b.main.selectAll("."+qe[Fd]+(re(a)?"-"+a:""))},f.expandBars=function(a){var b=this;b.getBars(a).classed(qe[ne],!0)},f.unexpandBars=function(a){var b=this;b.getBars(a).classed(qe[ne],!1)},f.generateDrawBar=function(a,b){var c=this,d=c.config,e=c.generateGetBarPoints(a,b);return function(a,b){var c=e(a,b),f=d[vb]?1:0,g=d[vb]?0:1,h="M "+c[0][f]+","+c[0][g]+" L"+c[1][f]+","+c[1][g]+" L"+c[2][f]+","+c[2][g]+" L"+c[3][f]+","+c[3][g]+" z";return h}},f.generateGetBarPoints=function(a,b){var c=this,d=a.__max__+1,e=c.getBarW(c.xAxis,d),f=c.getShapeX(e,d,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isBarType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var d=i.call(c,a.id)(0),j=h(a,b)||d,k=f(a),l=g(a);return c.config[vb]&&(0<a.value&&d>l||a.value<0&&l>d)&&(l=d),[[k,j],[k,l-(d-j)],[k+e,l-(d-j)],[k+e,j]]}},f.generateDrawArea=function(a,b){var c=this,d=c.config,e=c.d3.svg.area(),f=c.generateGetAreaPoint(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d[F].length>0?f(a,b)[0][1]:g.call(c,a.id)(0)},j=function(a,b){return d[F].length>0?f(a,b)[1][1]:g.call(c,a.id)(a.value)};return e=d[vb]?e.x0(i).x1(j).y(h):e.x(h).y0(i).y1(j),function(a){var b,f=c.filterRemoveNull(a.values),g=0,h=0;return c.isAreaType(a)?b=e.interpolate(c.getInterpolate(a))(f):(f[0]&&(g=c.x(f[0].x),h=c.getYScale(a.id)(f[0].value)),b=d[vb]?"M "+h+" "+g:"M "+g+" "+h),b?b:"M 0 0"}},f.generateDrawLine=function(a,b){var c=this,d=c.config,e=c.d3.svg.line(),f=c.generateGetLinePoint(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d[F].length>0?f(a,b)[0][1]:g.call(c,a.id)(a.value)};return e=d[vb]?e.x(i).y(h):e.x(h).y(i),d[rc]||(e=e.defined(function(a){return null!=a.value})),function(a){var f,h=d[rc]?c.filterRemoveNull(a.values):a.values,i=b?c.x:c.subX,j=g.call(c,a.id),k=0,l=0;return c.isLineType(a)?f=d[L][a.id]?c.lineWithRegions(h,i,j,d[L][a.id]):e.interpolate(c.getInterpolate(a))(h):(h[0]&&(k=i(h[0].x),l=j(h[0].value)),f=d[vb]?"M "+l+" "+k:"M "+k+" "+l),f?f:"M 0 0"}},f.generateXYForText=function(a,b){var c=this,d=c.generateGetBarPoints(a,!1),e=b?c.getXForText:c.getYForText;return function(a,b){return e(d(a,b),a,this)}},f.getXForText=function(a,b,c){var d,e,f=this,g=c.getBoundingClientRect();return $c[vb]?(e=f.isBarType(b)?4:6,d=a[2][1]+e*(b.value<0?-1:1)):d=a[0][0]+(a[2][0]-a[0][0])/2,d>f.width?f.width-g.width:d},f.getYForText=function(a,b,c){var d,e=this,f=c.getBoundingClientRect();return d=$c[vb]?(a[0][0]+a[2][0]+.6*f.height)/2:a[2][1]+(b.value<0?f.height:e.isBarType(b)?-3:-6),d<f.height?f.height:d},f.generateGetAreaPoint=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isAreaType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d[vb]&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,j],[k,l-(e-j)]]}},f.generateGetLinePoint=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isLineType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d[vb]&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,l-(e-j)]]}},f.lineWithRegions=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q=this,r=q.config,s=-1,t="M",u=[];if(ve(d))for(e=0;e<d.length;e++)u[e]={},u[e].start=ue(d[e].start)?a[0].x:q.isTimeSeries()?q.parseDate(d[e].start):d[e].start,u[e].end=ue(d[e].end)?a[a.length-1].x:q.isTimeSeries()?q.parseDate(d[e].end):d[e].end;for(o=r[vb]?function(a){return c(a.value)}:function(a){return b(a.x)},p=r[vb]?function(a){return b(a.x)}:function(a){return c(a.value)},g=q.isTimeSeries()?function(a,d,e,f){var g=a.x.getTime(),h=d.x-a.x,j=new Date(g+h*e),k=new Date(g+h*(e+f));return"M"+b(j)+" "+c(i(e))+" "+b(k)+" "+c(i(e+f))}:function(a,d,e,f){return"M"+b(h(e),!0)+" "+c(i(e))+" "+b(h(e+f),!0)+" "+c(i(e+f))},e=0;e<a.length;e++){if(ue(u)||!q.isWithinRegions(a[e].x,u))t+=" "+o(a[e])+" "+p(a[e]);else for(h=q.getScale(a[e-1].x,a[e].x,q.isTimeSeries()),i=q.getScale(a[e-1].value,a[e].value),j=b(a[e].x)-b(a[e-1].x),k=c(a[e].value)-c(a[e-1].value),l=Math.sqrt(Math.pow(j,2)+Math.pow(k,2)),m=2/l,n=2*m,f=m;1>=f;f+=n)t+=g(a[e-1],a[e],f,m);s=a[e].x}return t},f.isWithinCircle=function(a,b){var c=this.d3,d=c.mouse(a),e=c.select(a),f=1*e.attr("cx"),g=1*e.attr("cy");return Math.sqrt(Math.pow(f-d[0],2)+Math.pow(g-d[1],2))<b},f.isWithinBar=function(a){var b=this.d3,c=b.mouse(a),d=a.getBoundingClientRect(),e=a.pathSegList.getItem(0),f=a.pathSegList.getItem(1),g=e.x,h=Math.min(e.y,f.y),i=d.width,j=d.height,k=2,l=g-k,m=g+i+k,n=h+j+k,o=h-k;return l<c[0]&&c[0]<m&&o<c[1]&&c[1]<n},f.isWithinRegions=function(a,b){var c;for(c=0;c<b.length;c++)if(b[c].start<a&&a<=b[c].end)return!0;return!1},f.getTextRect=function(a,b){var c;return this.d3.select("body").selectAll(".dummy").data([a]).enter().append("text").classed(b?b:"",!0).text(a).each(function(){c=this.getBoundingClientRect()}).remove(),c},f.setTargetType=function(a,b){var c=this,d=c.config;c.mapToTargetIds(a).forEach(function(a){c.withoutFadeIn[a]=b===d[I][a],d[I][a]=b}),a||(d[H]=b)},f.hasType=function(a,b){var c=this,d=c.config[I],e=!1;return(b||c.data.targets).forEach(function(b){(d[b.id]&&d[b.id].indexOf(a)>=0||!(b.id in d)&&"line"===a)&&(e=!0)}),e},f.hasArcType=function(a){return this.hasType("pie",a)||this.hasType("donut",a)||this.hasType("gauge",a)},f.isLineType=function(a){var b=this.config,c=te(a)?a:a.id;return!b[I][c]||["line","spline","area","area-spline","step","area-step"].indexOf(b[I][c])>=0},f.isStepType=function(a){var b=te(a)?a:a.id;return["step","area-step"].indexOf(this.config[I][b])>=0},f.isSplineType=function(a){var b=te(a)?a:a.id;return["spline","area-spline"].indexOf(this.config[I][b])>=0},f.isAreaType=function(a){var b=te(a)?a:a.id;return["area","area-spline","area-step"].indexOf(this.config[I][b])>=0},f.isBarType=function(a){var b=te(a)?a:a.id;return"bar"===this.config[I][b]},f.isScatterType=function(a){var b=te(a)?a:a.id;return"scatter"===this.config[I][b]},f.isPieType=function(a){var b=te(a)?a:a.id;return"pie"===this.config[I][b]},f.isGaugeType=function(a){var b=te(a)?a:a.id;return"gauge"===this.config[I][b]},f.isDonutType=function(a){var b=te(a)?a:a.id;return"donut"===this.config[I][b]},f.isArcType=function(a){return this.isPieType(a)||this.isDonutType(a)||this.isGaugeType(a)},f.lineData=function(a){return this.isLineType(a)?[a]:[]},f.arcData=function(a){return this.isArcType(a.data)?[a]:[]},f.barData=function(a){return this.isBarType(a)?a.values:[]},f.lineOrScatterData=function(a){return this.isLineType(a)||this.isScatterType(a)?a.values:[]},f.barOrLineData=function(a){return this.isBarType(a)||this.isLineType(a)?a.values:[]},f.showXGridFocus=function(a){var b=this,c=a.filter(function(a){return a&&re(a.value)});if($c[Rc]&&!b.hasType("scatter")&&!b.hasArcType()){var d=b.main.selectAll("line."+qe[Wd]);d.style("visibility","visible").data([c[0]]).attr($c[vb]?"y1":"x1",Ee(b.xx,b)).attr($c[vb]?"y2":"x2",Ee(b.xx,b)),b.smoothLines(d,"grid")}},f.hideXGridFocus=function(){this.main.select("line."+qe[Wd]).style("visibility","hidden")},f.updateXgridFocus=function(){var a=this,b=a.config;a.main.select("line."+qe[Wd]).attr("x1",b[vb]?0:-10).attr("x2",b[vb]?a.width:-10).attr("y1",b[vb]?-10:0).attr("y2",b[vb]?-10:a.height)},f.generateGridData=function(a,b){var c,d,e,f,g=this,h=[],i=g.main.select("."+qe[ae]).selectAll(".tick").size();if("year"===a)for(c=g.getXDomain(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10),h.length>i&&(h=h.filter(function(a){return(""+a).indexOf(".")<0}));return h},f.getGridFilterToRemove=function(a){return a?function(b){var c=!1;return[].concat(a).forEach(function(d){("value"in d&&b.value===a.value||"class"in d&&b.class===a.class)&&(c=!0)}),c}:function(){return!0}},f.removeGridLines=function(a,b){var c=this,d=c.config,e=c.getGridFilterToRemove(a),f=function(a){return!e(a)},g=b?qe[Vd]:qe[$d],h=b?qe[Ud]:qe.ygridLine;c.main.select("."+g).selectAll("."+h).filter(e).transition().duration(d[x]).style("opacity",0).remove(),b?d[hc]=d[hc].filter(f):d[jc]=d[jc].filter(f)},f.initTooltip=function(){var a,b=this,c=b.config;if(b.tooltip=b.selectChart.style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),c[Xc]){if(b.isTimeSeries()&&te(c[Yc])){for(c[Yc]=b.parseDate(c[Yc]),a=0;a<b.data.targets[0].values.length&&b.data.targets[0].values[a].x-c[Yc]!==0;a++);c[Yc]=a}b.tooltip.html(c[Wc].call(b,b.data.targets.map(function(a){return b.addName(a.values[c[Yc]])}),b.getXAxisTickFormat(),b.getYFormat(b.hasArcType()),b.color)),b.tooltip.style("top",c[Zc].top).style("left",c[Zc].left).style("display","block")}},f.getTooltipContent=function(a,b,c,d){var e,f,g,h,i,j,k=this,l=k.config,m=l[Tc]||b,n=l[Uc]||function(a){return a},o=l[Vc]||c;for(f=0;f<a.length;f++)a[f]&&(a[f].value||0===a[f].value)&&(e||(g=m?m(a[f].x):a[f].x,e="<table class='"+qe[zd]+"'>"+(g||0===g?"<tr><th colspan='2'>"+g+"</th></tr>":"")),i=n(a[f].name),h=o(a[f].value,a[f].ratio,a[f].id,a[f].index),j=k.levelColor?k.levelColor(a[f].value):d(a[f].id),e+="<tr class='"+qe[Ad]+"-"+a[f].id+"'>",e+="<td class='name'><span style='background-color:"+j+"'></span>"+i+"</td>",e+="<td class='value'>"+h+"</td>",e+="</tr>");return e+"</table>"},f.showTooltip=function(a,b){var c,d,e,f,g,h,i,j=this,k=j.config,l=j.hasArcType(),m=a.filter(function(a){return a&&re(a.value)});0!==m.length&&k[Rc]&&(j.tooltip.html(k[Wc].call(j,a,j.getXAxisTickFormat(),j.getYFormat(l),j.color)).style("display","block"),c=j.tooltip.property("offsetWidth"),d=j.tooltip.property("offsetHeight"),l?(f=j.width/2+b[0],h=j.height/2+b[1]+20):(k[vb]?(e=j.getSvgLeft(),f=e+b[0]+100,g=f+c,i=j.getCurrentWidth()-j.getCurrentPaddingRight(),h=j.x(m[0].x)+20):(e=j.getSvgLeft(),f=e+j.getCurrentPaddingLeft()+j.x(m[0].x)+20,g=f+c,i=e+j.getCurrentWidth()-j.getCurrentPaddingRight(),h=b[1]+15),g>i&&(f-=g-i),h+d>j.getCurrentHeight()&&(h-=d+30)),j.tooltip.style("top",h+"px").style("left",f+"px"))},f.hideTooltip=function(){this.tooltip.style("display","none")},f.initLegend=function(){var a=this;a.legend=a.svg.append("g").attr("transform",a.getTranslate("legend")),$c[lb]||(a.legend.style("visibility","hidden"),a.hiddenLegendIds=a.mapToIds(a.data.targets)),a.updateLegend(a.mapToIds(a.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1}) |
|
},f.updateSizeForLegend=function(a,b){var c=this,d={top:c.isLegendTop?c.getCurrentPaddingTop()+$c[pb]+5.5:c.currentHeight-a-c.getCurrentPaddingBottom()-$c[pb],left:c.isLegendLeft?c.getCurrentPaddingLeft()+$c[ob]+.5:c.currentWidth-b-c.getCurrentPaddingRight()-$c[ob]+.5};c.margin3={top:c.isLegendRight?0:c.isLegendInset?d.top:c.currentHeight-a,right:0/0,bottom:0,left:c.isLegendRight?c.currentWidth-b:c.isLegendInset?d.left:0}},f.transformLegend=function(a){var b=this;(a?b.legend.transition():b.legend).attr("transform",b.getTranslate("legend"))},f.updateLegendStep=function(a){this.legendStep=a},f.updateLegendItemWidth=function(a){this.legendItemWidth=a},f.updateLegendItemHeight=function(a){this.legendItemHeight=a},f.getLegendWidth=function(){var a=this;return a.config[lb]?a.isLegendRight||a.isLegendInset?a.legendItemWidth*(a.legendStep+1):a.currentWidth:0},f.getLegendHeight=function(){var a=this,b=a.config,c=0;return b[lb]&&(c=a.isLegendRight?a.currentHeight:a.isLegendInset?b[qb]?Math.max(20,a.legendItemHeight)*(b[qb]+1):a.height:Math.max(20,a.legendItemHeight)*(a.legendStep+1)),c},f.opacityForLegend=function(a){var b=this;return a.classed(qe[ke])?b.legendOpacityForHidden:1},f.opacityForUnfocusedLegend=function(a){var b=this;return a.classed(qe[ke])?b.legendOpacityForHidden:.3},f.toggleFocusLegend=function(a,b){var c=this;c.legend.selectAll("."+qe[he]).transition().duration(100).style("opacity",function(d){var e=c.d3.select(this);return a&&d!==a?b?c.opacityForUnfocusedLegend(e):c.opacityForLegend(e):b?c.opacityForLegend(e):c.opacityForUnfocusedLegend(e)})},f.revertLegend=function(){var a=this,b=a.d3;a.legend.selectAll("."+qe[he]).transition().duration(100).style("opacity",function(){return a.opacityForLegend(b.select(this))})},f.showLegend=function(a){var b=this,c=b.config;c[lb]||(c[lb]=!0,b.legend.style("visibility","visible")),b.removeHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("visibility","visible").transition().style("opacity",function(){return b.opacityForLegend(b.d3.select(this))})},f.hideLegend=function(a){var b=this,c=b.config;c[lb]&&ze(a)&&(c[lb]=!1,b.legend.style("visibility","hidden")),b.addHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("opacity",0).style("visibility","hidden")},f.updateLegend=function(a,b,c){function d(b,c,d){function e(a,b){b||(f=(l-y-k)/2,x>f&&(f=(l-k)/2,y=0,F++)),E[a]=F,C[F]=r.isLegendInset?10:f,z[a]=y,y+=k}var f,g,h=r.getTextRect(b.textContent,qe[he]),i=10*Math.ceil((h.width+u)/10),j=10*Math.ceil((h.height+t)/10),k=r.isLegendRight||r.isLegendInset?j:i,l=r.isLegendRight||r.isLegendInset?r.getLegendHeight():r.getLegendWidth();return d&&(y=0,F=0,v=0,w=0),s[lb]&&!r.isLegendToShow(c)?void(A[c]=B[c]=E[c]=z[c]=0):(A[c]=i,B[c]=j,(!v||i>=v)&&(v=i),(!w||j>=w)&&(w=j),g=r.isLegendRight||r.isLegendInset?w:v,void(s[ub]?(Object.keys(A).forEach(function(a){A[a]=v}),Object.keys(B).forEach(function(a){B[a]=w}),f=(l-g*a.length)/2,x>f?(y=0,F=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}var e,f,h,i,j,k,l,m,n,o,p,q,r=this,s=r.config,t=4,u=36,v=0,w=0,x=10,y=0,z={},A={},B={},C=[0],E={},F=0,G=r.legend.selectAll("."+qe[le]).size();b=b||{},m=Be(b,"withTransition",!0),n=Be(b,"withTransitionForTransform",!0),r.isLegendRight?(e=function(a){return v*E[a]},i=function(a){return C[E[a]]+z[a]}):r.isLegendInset?(e=function(a){return v*E[a]+10},i=function(a){return C[E[a]]+z[a]}):(e=function(a){return C[E[a]]+z[a]},i=function(a){return w*E[a]}),f=function(a,b){return e(a,b)+14},j=function(a,b){return i(a,b)+9},h=function(a,b){return e(a,b)-4},k=function(a,b){return i(a,b)-7},l=r.legend.selectAll("."+qe[he]).data(a).enter().append("g").attr("class",function(a){return r.generateClass(qe[he],a)}).style("visibility",function(a){return r.isLegendToShow(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){se(s[rb])?s[rb].call(g,a):r.api.toggle(a)}).on("mouseover",function(a){r.d3.select(this).classed(qe[le],!0),r.transiting||r.api.focus(a),se(s[sb])&&s[sb].call(r,a)}).on("mouseout",function(a){r.d3.select(this).classed(qe[le],!1),r.transiting||r.api.revert(),se(s[tb])&&s[tb].call(r,a)}),l.append("text").text(function(a){return ve(s[D][a])?s[D][a]:a}).each(function(a,b){d(this,a,0===b)}).style("pointer-events","none").attr("x",r.isLegendRight||r.isLegendInset?f:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:j),l.append("rect").attr("class",qe[ie]).style("fill-opacity",0).attr("x",r.isLegendRight||r.isLegendInset?h:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:k),l.append("rect").attr("class",qe[je]).style("pointer-events","none").style("fill",r.color).attr("x",r.isLegendRight||r.isLegendInset?f:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:i).attr("width",10).attr("height",10),r.isLegendInset&&0!==v&&r.legend.insert("g","."+qe[he]).attr("class",qe[ge]).append("rect").attr("height",r.getLegendHeight()-10).attr("width",v*(F+1)+10),o=r.legend.selectAll("text").data(a).text(function(a){return ve(s[D][a])?s[D][a]:a}).each(function(a,b){d(this,a,0===b)}),(m?o.transition():o).attr("x",f).attr("y",j),p=r.legend.selectAll("rect."+qe[ie]).data(a),(m?p.transition():p).attr("width",function(a){return A[a]}).attr("height",function(a){return B[a]}).attr("x",h).attr("y",k),q=r.legend.selectAll("rect."+qe[je]).data(a),(m?q.transition():q).style("fill",r.color).attr("x",e).attr("y",i),r.legend.selectAll("."+qe[he]).classed(qe[ke],function(a){return!r.isTargetToShow(a)}).transition().style("opacity",function(a){var b=r.d3.select(this);return r.isTargetToShow(a)?!G||b.classed(qe[le])?r.opacityForLegend(b):r.opacityForUnfocusedLegend(b):r.legendOpacityForHidden}),r.updateLegendItemWidth(v),r.updateLegendItemHeight(w),r.updateLegendStep(F),r.updateSizes(),r.updateScales(),r.updateSvgSize(),r.transformAll(n,c)},f.getXAxis=function(a,b,c,e){var f=this,g=f.config,h=d(f.d3,f.isCategorized()).scale(a).orient(b);return h.tickFormat(c).tickValues(e),f.isCategorized()?(h.tickCentered(g[Ab]),ze(g[Cb])&&(g[Cb]=!1)):h.tickOffset=function(){var a=f.getEdgeX(f.data.targets),b=f.x(a[1])-f.x(a[0]),c=b?b:g[vb]?f.height:f.width;return c/f.getMaxDataCount()/2},h},f.getYAxis=function(a,b,c,e){return d(this.d3).scale(a).orient(b).tickFormat(c).ticks(e)},f.getAxisId=function(a){var b=this.config;return a in b[G]?b[G][a]:"y"},f.getXAxisTickFormat=function(){var a=this,b=a.config,c=a.isTimeSeries()?a.defaultAxisTimeFormat:a.isCategorized()?a.categoryName:function(a){return 0>a?a.toFixed(0):a};return b[Bb]&&(se(b[Bb])?c=b[Bb]:a.isTimeSeries()&&(c=function(c){return c?a.axisTimeFormat(b[Bb])(c):""})),function(b){return c.call(a,b)}},f.getAxisLabelOptionByAxisId=function(a){var b,c=this,d=c.config;return"y"===a?b=d[Tb]:"y2"===a?b=d[ac]:"x"===a&&(b=d[Ob]),b},f.getAxisLabelText=function(a){var b=this.getAxisLabelOptionByAxisId(a);return te(b)?b:b?b.text:null},f.setAxisLabelText=function(a,b){var c=this,d=c.config,e=c.getAxisLabelOptionByAxisId(a);te(e)?"y"===a?d[Tb]=b:"y2"===a?d[ac]=b:"x"===a&&(d[Ob]=b):e&&(e.text=b)},f.getAxisLabelPosition=function(a,b){var c=this.getAxisLabelOptionByAxisId(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}},f.getXAxisLabelPosition=function(){return this.getAxisLabelPosition("x",this.config[vb]?"inner-top":"inner-right")},f.getYAxisLabelPosition=function(){return this.getAxisLabelPosition("y",this.config[vb]?"inner-right":"inner-top")},f.getY2AxisLabelPosition=function(){return this.getAxisLabelPosition("y2",this.config[vb]?"inner-right":"inner-top")},f.getAxisLabelPositionById=function(a){return"y2"===a?this.getY2AxisLabelPosition():"y"===a?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},f.textForXAxisLabel=function(){return this.getAxisLabelText("x")},f.textForYAxisLabel=function(){return this.getAxisLabelText("y")},f.textForY2AxisLabel=function(){return this.getAxisLabelText("y2")},f.xForAxisLabel=function(a,b){var c=this;return a?b.isLeft?0:b.isCenter?c.width/2:c.width:b.isBottom?-c.height:b.isMiddle?-c.height/2:0},f.dxForAxisLabel=function(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"},f.textAnchorForAxisLabel=function(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"},f.xForXAxisLabel=function(){return this.xForAxisLabel(!this.config[vb],this.getXAxisLabelPosition())},f.xForYAxisLabel=function(){return this.xForAxisLabel(this.config[vb],this.getYAxisLabelPosition())},f.xForY2AxisLabel=function(){return this.xForAxisLabel(this.config[vb],this.getY2AxisLabelPosition())},f.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.config[vb],this.getXAxisLabelPosition())},f.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.config[vb],this.getYAxisLabelPosition())},f.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.config[vb],this.getY2AxisLabelPosition())},f.dyForXAxisLabel=function(){var a=this,b=a.config,c=a.getXAxisLabelPosition();return b[vb]?c.isInner?"1.2em":-25-a.getMaxTickWidth("x"):c.isInner?"-0.5em":b[Mb]?b[Mb]-10:"3em"},f.dyForYAxisLabel=function(){var a=this,b=a.getYAxisLabelPosition();return a.config[vb]?b.isInner?"-0.5em":"3em":b.isInner?"1.2em":-20-a.getMaxTickWidth("y")},f.dyForY2AxisLabel=function(){var a=this,b=a.getY2AxisLabelPosition();return a.config[vb]?b.isInner?"1.2em":"-2.2em":b.isInner?"-0.5em":30+this.getMaxTickWidth("y2")},f.textAnchorForXAxisLabel=function(){var a=this;return a.textAnchorForAxisLabel(!a.config[vb],a.getXAxisLabelPosition())},f.textAnchorForYAxisLabel=function(){var a=this;return a.textAnchorForAxisLabel(a.config[vb],a.getYAxisLabelPosition())},f.textAnchorForY2AxisLabel=function(){var a=this;return a.textAnchorForAxisLabel(a.config[vb],a.getY2AxisLabelPosition())},f.xForRotatedTickText=function(a){return 10*Math.sin(Math.PI*(a/180))},f.yForRotatedTickText=function(a){return 11.5-2.5*(a/15)},f.rotateTickText=function(a,b,c){a.selectAll(".tick text").style("text-anchor","start"),b.selectAll(".tick text").attr("y",this.yForRotatedTickText(c)).attr("x",this.xForRotatedTickText(c)).attr("transform","rotate("+c+")")},f.getMaxTickWidth=function(a){var b,c,d,e=this,f=e.config,g=0;return e.svg&&(b=e.filterTargetsToShow(e.data.targets),"y"===a?(c=e.y.copy().domain(e.getYDomain(b,"y")),d=e.getYAxis(c,e.yOrient,f[Ub],f[Xb])):"y2"===a?(c=e.y2.copy().domain(e.getYDomain(b,"y2")),d=e.getYAxis(c,e.y2Orient,f[bc],f[ec])):(c=e.x.copy().domain(e.getXDomain(b)),d=e.getXAxis(c,e.xOrient,e.getXAxisTickFormat(),f[Gb]?f[Gb]:e.xAxis.tickValues())),e.main.append("g").call(d).each(function(){e.d3.select(this).selectAll("text").each(function(){var a=this.getBoundingClientRect();g<a.width&&(g=a.width)})}).remove()),e.currentMaxTickWidth=0>=g?e.currentMaxTickWidth:g,e.currentMaxTickWidth},f.updateAxisLabels=function(a){var b=this,c=b.main.select("."+qe[ae]+" ."+qe[be]),d=b.main.select("."+qe[ce]+" ."+qe[de]),e=b.main.select("."+qe[ee]+" ."+qe[fe]);(a?c.transition():c).attr("x",Ee(b.xForXAxisLabel,b)).attr("dx",Ee(b.dxForXAxisLabel,b)).attr("dy",Ee(b.dyForXAxisLabel,b)).text(Ee(b.textForXAxisLabel,b)),(a?d.transition():d).attr("x",Ee(b.xForYAxisLabel,b)).attr("dx",Ee(b.dxForYAxisLabel,b)).attr("dy",Ee(b.dyForYAxisLabel,b)).text(Ee(b.textForYAxisLabel,b)),(a?e.transition():e).attr("x",Ee(b.xForY2AxisLabel,b)).attr("dx",Ee(b.dxForY2AxisLabel,b)).attr("dy",Ee(b.dyForY2AxisLabel,b)).text(Ee(b.textForY2AxisLabel,b))},f.getAxisPadding=function(a,b,c,d){var e="ratio"===a.unit?d:1;return re(a[b])?a[b]*e:c},f.generateTickValues=function(a,b){var c,d,e,f,g,h,i,j=this,k=a;if(b)if(c=se(b)?b():b,1===c)k=[a[0]];else if(2===c)k=[a[0],a[a.length-1]];else if(c>2){for(f=c-2,d=a[0],e=a[a.length-1],g=(e-d)/(f+1),k=[d],h=0;f>h;h++)i=+d+g*(h+1),k.push(j.isTimeSeries()?new Date(i):i);k.push(e)}return j.isTimeSeries()||(k=k.sort(function(a,b){return a-b})),k},f.getClipPath=function(b){var c=a.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"},f.getAxisClipX=function(a){return a?-31:-(this.margin.left-1)},f.getAxisClipY=function(a){return a?-20:-4},f.getXAxisClipX=function(){var a=this;return a.getAxisClipX(!a.config[vb])},f.getXAxisClipY=function(){var a=this;return a.getAxisClipY(!a.config[vb])},f.getYAxisClipX=function(){var a=this;return a.getAxisClipX(a.config[vb])},f.getYAxisClipY=function(){var a=this;return a.getAxisClipY(a.config[vb])},f.getAxisClipWidth=function(a){var b=this;return a?b.width+2+30+30:b.margin.left+20},f.getAxisClipHeight=function(a){var b=this,c=b.config;return a?(c[Mb]?c[Mb]:0)+80:b.height+8},f.getXAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(!a.config[vb])},f.getXAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(!a.config[vb])},f.getYAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(a.config[vb])},f.getYAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(a.config[vb])},f.initPie=function(){var a=this,b=a.d3,c=a.config;a.pie=b.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)}),c[K]&&c[Ac]&&c[Nc]||a.pie.sort(null)},f.updateRadius=function(){var a=this,b=a.config,c=b[Ic]||b[Mc];a.radiusExpanded=Math.min(a.arcWidth,a.arcHeight)/2,a.radius=.95*a.radiusExpanded,a.innerRadiusRatio=c?(a.radius-c)/a.radius:.6,a.innerRadius=a.hasType("donut")||a.hasType("gauge")?a.radius*a.innerRadiusRatio:0},f.updateArc=function(){var a=this;a.svgArc=a.getSvgArc(),a.svgArcExpanded=a.getSvgArcExpanded(),a.svgArcExpandedSub=a.getSvgArcExpanded(.98)},f.updateAngle=function(a){var b=this,c=b.config,d=!1,e=0;if(b.pie(b.filterTargetsToShow(b.data.targets)).sort(b.descByStartAngle).forEach(function(b){d||b.data.id!==a.data.id||(d=!0,a=b,a.index=e),e++}),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),b.isGaugeType(a.data)){var f=c[Fc],g=c[Gc],h=Math.abs(f)+g,i=Math.PI/h;a.startAngle=-1*(Math.PI/2)+i*Math.abs(f),a.endAngle=a.startAngle+i*(a.value>g?g:a.value)}return d?a:null},f.getSvgArc=function(){var a=this,b=a.d3.svg.arc().outerRadius(a.radius).innerRadius(a.innerRadius),c=function(c,d){var e;return d?b(c):(e=a.updateAngle(c),e?b(e):"M 0 0")};return c.centroid=b.centroid,c},f.getSvgArcExpanded=function(a){var b=this,c=b.d3.svg.arc().outerRadius(b.radiusExpanded*(a?a:1)).innerRadius(b.innerRadius);return function(a){var d=b.updateAngle(a);return d?c(d):"M 0 0"}},f.getArc=function(a,b,c){return c||this.isArcType(a.data)?this.svgArc(a,b):"M 0 0"},f.transformForArcLabel=function(a){var b,c,d,e,f,g=this,h=g.updateAngle(a),i="";return h&&!g.hasType("gauge")&&(b=this.svgArc.centroid(h),c=isNaN(b[0])?0:b[0],d=isNaN(b[1])?0:b[1],e=Math.sqrt(c*c+d*d),f=g.radius&&e?(36/g.radius>.375?1.175-36/g.radius:.8)*g.radius/e:0,i="translate("+c*f+","+d*f+")"),i},f.getArcRatio=function(a){var b=this,c=b.hasType("gauge")?Math.PI:2*Math.PI;return a?(a.endAngle-a.startAngle)/c:null},f.convertToArcData=function(a){return this.addName({id:a.data.id,value:a.value,ratio:this.getArcRatio(a),index:a.index})},f.textForArcLabel=function(a){var b,c,d,e,f=this;return f.shouldShowArcLabel()?(b=f.updateAngle(a),c=b?b.value:null,d=f.getArcRatio(b),f.hasType("gauge")||f.meetsArcLabelThreshold(d)?(e=f.getArcLabelFormat(),e?e(c,d):f.defaultArcValueFormat(c,d)):""):""},f.expandArc=function(a,b){var c=this,d=c.svg.selectAll("."+qe[hd]+c.selectorTarget(a)),e=c.svg.selectAll("."+qe[Jd]).filter(function(b){return b.data.id!==a});c.shouldExpand(a)&&d.selectAll("path").transition().duration(50).attr("d",c.svgArcExpanded).transition().duration(100).attr("d",c.svgArcExpandedSub).each(function(a){c.isDonutType(a.data)}),b||e.style("opacity",.3)},f.unexpandArc=function(a){var b=this,c=b.svg.selectAll("."+qe[hd]+b.selectorTarget(a));c.selectAll("path."+qe[Jd]).transition().duration(50).attr("d",b.svgArc),b.svg.selectAll("."+qe[Jd]).style("opacity",1)},f.shouldExpand=function(a){var b=this,c=b.config;return b.isDonutType(a)&&c[Oc]||b.isGaugeType(a)&&c[Ec]||b.isPieType(a)&&c[Bc]},f.shouldShowArcLabel=function(){var a=this,b=a.config,c=!0;return a.hasType("donut")?c=b[Jc]:a.hasType("pie")&&(c=b[xc]),c},f.meetsArcLabelThreshold=function(a){var b=this,c=b.config,d=b.hasType("donut")?c[Lc]:c[zc];return a>=d},f.getArcLabelFormat=function(){var a=this,b=a.config,c=b[yc];return a.hasType("gauge")?c=b[Dc]:a.hasType("donut")&&(c=b[Kc]),c},f.getArcTitle=function(){var a=this;return a.hasType("donut")?a.config[Pc]:""},f.descByStartAngle=function(a,b){return a.startAngle-b.startAngle},f.updateTargetsForArc=function(a){var b,c,d=this,e=d.main;b=e.select("."+qe[id]).selectAll("."+qe[hd]).data(d.pie(a)).attr("class",Ee(d.classChartArc,d)),c=b.enter().append("g").attr("class",Ee(d.classChartArc,d)),c.append("g").attr("class",Ee(d.classArcs,d)),c.append("text").attr("dy",d.hasType("gauge")?"-0.35em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},f.initArc=function(){var a,b=this;a=b.main.select("."+qe[ad]).append("g").attr("class",qe[id]).attr("transform",b.getTranslate("arc")),a.append("text").attr("class",qe[jd]).style("text-anchor","middle").text(b.getArcTitle())},f.redrawArc=function(a,b,c){var d,e=this,f=e.d3,g=e.config,h=e.main;d=h.selectAll("."+qe[Kd]).selectAll("."+qe[Jd]).data(Ee(e.arcData,e)),d.enter().append("path").attr("class",Ee(e.classArc,e)).style("fill",function(a){return e.color(a.data)}).style("cursor",function(a){return g[S](a)?"pointer":null}).style("opacity",0).each(function(a){e.isGaugeType(a.data)&&(a.startAngle=a.endAngle=-1*(Math.PI/2)),this._current=a}).on("mouseover",function(a){var b,c;e.transiting||(b=e.updateAngle(a),c=e.convertToArcData(b),e.expandArc(b.data.id),e.toggleFocusLegend(b.data.id,!0),e.config[V](c,this))}).on("mousemove",function(a){var b=e.updateAngle(a),c=e.convertToArcData(b),d=[c];e.showTooltip(d,f.mouse(this))}).on("mouseout",function(a){var b,c;e.transiting||(b=e.updateAngle(a),c=e.convertToArcData(b),e.unexpandArc(b.data.id),e.revertLegend(),e.hideTooltip(),e.config[W](c,this))}).on("click",function(a,b){var c,d;e.toggleShape&&(c=e.updateAngle(a),d=e.convertToArcData(c),e.toggleShape(this,d,b))}),d.attr("transform",function(a){return!e.isGaugeType(a.data)&&c?"scale(0)":""}).style("opacity",function(a){return a===this._current?0:1}).each(function(){e.transiting=!0}).transition().duration(a).attrTween("d",function(a){var b,c=e.updateAngle(a);return c?(isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),b=f.interpolate(this._current,c),this._current=b(0),function(a){return e.getArc(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",c?"scale(1)":"").style("fill",function(a){return e.levelColor?e.levelColor(a.data.values[0].value):e.color(a.data.id)}).style("opacity",1).call(e.endall,function(){e.transiting=!1}),d.exit().transition().duration(b).style("opacity",0).remove(),h.selectAll("."+qe[hd]).select("text").style("opacity",0).attr("class",function(a){return e.isGaugeType(a.data)?qe[Qd]:""}).text(Ee(e.textForArcLabel,e)).attr("transform",Ee(e.transformForArcLabel,e)).transition().duration(a).style("opacity",function(a){return e.isTargetToShow(a.data.id)&&e.isArcType(a.data)?1:0}),h.select("."+qe[jd]).style("opacity",e.hasType("donut")||e.hasType("gauge")?1:0)},f.initGauge=function(){var a,b=this,c=b.config;b.hasType("gauge")&&(a.append("path").attr("class",qe[kd]).attr("d",function(){var a={data:[{value:c[Gc]}],startAngle:-1*(Math.PI/2),endAngle:Math.PI/2};return b.getArc(a,!0,!0)}),a.append("text").attr("dy",".75em").attr("class",qe[ld]).style("text-anchor","middle").style("pointer-events","none").text(c[Cc]?c[Hc]:""),a.append("text").attr("dx",-1*(b.innerRadius+(b.radius-b.innerRadius)/2)+"px").attr("dy","1.2em").attr("class",qe[nd]).style("text-anchor","middle").style("pointer-events","none").text(c[Cc]?c[Fc]:""),a.append("text").attr("dx",b.innerRadius+(b.radius-b.innerRadius)/2+"px").attr("dy","1.2em").attr("class",qe[md]).style("text-anchor","middle").style("pointer-events","none").text(c[Cc]?c[Gc]:""))},f.regionX=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d[vb]?"start"in a?e(a.start):0:0:d[vb]?0:"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},f.regionY=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d[vb]?0:"end"in a?e(a.end):0:d[vb]?"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0:0},f.regionWidth=function(a){var b,c=this,d=c.config,e=c.regionX(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d[vb]?"end"in a?f(a.end):c.width:c.width:d[vb]?c.width:"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.width,e>b?0:b-e},f.regionHeight=function(a){var b,c=this,d=c.config,e=this.regionY(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d[vb]?c.height:"start"in a?f(a.start):c.height:d[vb]?"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.height:c.height,e>b?0:b-e},f.isRegionOnX=function(a){return!a.axis||"x"===a.axis},f.drag=function(a){var b,c,d,e,f,g,h,i,j=this,k=j.config,l=j.main,m=j.d3;j.hasArcType()||k[Q]&&(!k[o]||j.zoom.altDomain)&&k[T]&&(b=j.dragStart[0],c=j.dragStart[1],d=a[0],e=a[1],f=Math.min(b,d),g=Math.max(b,d),h=k[R]?j.margin.top:Math.min(c,e),i=k[R]?j.height:Math.max(c,e),l.select("."+qe[me]).attr("x",f).attr("y",h).attr("width",g-f).attr("height",i-h),l.selectAll("."+qe[Cd]).selectAll("."+qe[Bd]).filter(function(a){return k[S](a)}).each(function(a,b){var c,d,e,k,l,n,o=m.select(this),p=o.classed(qe[oe]),q=o.classed(qe[pe]),r=!1;if(o.classed(qe[Hd]))c=1*o.attr("cx"),d=1*o.attr("cy"),l=j.togglePoint,r=c>f&&g>c&&d>h&&i>d;else{if(!o.classed(qe[Fd]))return;n=De(this),c=n.x,d=n.y,e=n.width,k=n.height,l=j.toggleBar,r=!(c>g||f>c+e||d>i||h>d+k)}r^q&&(o.classed(qe[pe],!q),o.classed(qe[oe],!p),j.toggle(!p,o,a,b))}))},f.dragstart=function(a){var b=this,c=b.config;b.hasArcType()||c[Q]&&(b.dragStart=a,b.main.select("."+qe[ad]).append("rect").attr("class",qe[me]).style("opacity",.1),b.dragging=!0,b.config[Z]())},f.dragend=function(){var a=this,b=a.config;a.hasArcType()||b[Q]&&(a.main.select("."+qe[me]).transition().duration(100).style("opacity",0).remove(),a.main.selectAll("."+qe[Bd]).classed(qe[pe],!1),a.dragging=!1,a.config[$]())},f.initBrush=function(){var a=this,b=a.d3;a.brush=b.svg.brush().on("brush",function(){a.redrawForBrush()}),a.brush.update=function(){return a.context&&a.context.select("."+a.CLASS[vd]).call(this),this},a.brush.scale=function(b){return a.config[vb]?this.y(b):this.x(b)}},f.initSubchart=function(){var a=this,b=a.config,c=a.context=a.svg.append("g").attr("transform",a.getTranslate("context"));b[gb]||c.style("visibility","hidden"),c.append("g").attr("clip-path",a.clipPath).attr("class",qe[ad]),c.select("."+qe[ad]).append("g").attr("class",qe[ed]),c.select("."+qe[ad]).append("g").attr("class",qe[cd]),c.append("g").attr("clip-path",a.clipPath).attr("class",qe[vd]).call(a.brush).selectAll("rect").attr(b[vb]?"width":"height",b[vb]?a.width2:a.height2),a.axes.subx=c.append("g").attr("class",qe[ae]).attr("transform",a.getTranslate("subx")).attr("clip-path",b[vb]?"":a.clipPathForXAxis)},f.updateTargetsForSubchart=function(a){var b,c,d,e,f=this,g=f.context,h=f.config;h[gb]&&(e=g.select("."+qe[ed]).selectAll("."+qe[dd]).data(a).attr("class",Ee(f.classChartBar,f)),d=e.enter().append("g").style("opacity",0).attr("class",Ee(f.classChartBar,f)),d.append("g").attr("class",Ee(f.classBars,f)),c=g.select("."+qe[cd]).selectAll("."+qe[bd]).data(a).attr("class",Ee(f.classChartLine,f)),b=c.enter().append("g").style("opacity",0).attr("class",Ee(f.classChartLine,f)),b.append("g").attr("class",Ee(f.classLines,f)),b.append("g").attr("class",Ee(f.classAreas,f)))},f.redrawSubchart=function(a,b,c,d,e,f,g){var h,i,j,k,l,m,n=this,o=n.d3,p=n.context,q=n.config;q[gb]&&(o.event&&"zoom"===o.event.type&&n.brush.extent(n.x.orgDomain()).update(),a&&(!q[vb]&&q[Hb]&&n.rotateTickText(n.axes.subx,b.axisSubX,q[Hb]),n.brush.empty()||n.brush.extent(n.x.orgDomain()).update(),k=n.generateDrawArea(e,!0),l=n.generateDrawBar(f,!0),m=n.generateDrawLine(g,!0),j=p.selectAll("."+qe[Gd]).selectAll("."+qe[Fd]).data(Ee(n.barData,n)),j.enter().append("path").attr("class",Ee(n.classBar,n)).style("stroke","none").style("fill",n.color),j.style("opacity",Ee(n.initialOpacity,n)).transition().duration(c).attr("d",l).style("opacity",1),j.exit().transition().duration(c).style("opacity",0).remove(),h=p.selectAll("."+qe[Ed]).selectAll("."+qe[Dd]).data(Ee(n.lineData,n)),h.enter().append("path").attr("class",Ee(n.classLine,n)).style("stroke",n.color),h.style("opacity",Ee(n.initialOpacity,n)).transition().duration(c).attr("d",m).style("opacity",1),h.exit().transition().duration(c).style("opacity",0).remove(),i=p.selectAll("."+qe[Md]).selectAll("."+qe[Ld]).data(Ee(n.lineData,n)),i.enter().append("path").attr("class",Ee(n.classArea,n)).style("fill",n.color).style("opacity",function(){return n.orgAreaOpacity=+o.select(this).style("opacity"),0}),i.style("opacity",0).transition().duration(c).attr("d",k).style("fill",n.color).style("opacity",n.orgAreaOpacity),i.exit().transition().duration(d).style("opacity",0).remove()))},f.redrawForBrush=function(){var a=this,b=a.x;a.redraw({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0}),a.config[ib].call(a,b.orgDomain())},f.transformContext=function(a,b){var c,d=this;b&&b.axisSubX?c=b.axisSubX:(c=d.context.select("."+qe[ae]),a&&(c=c.transition())),d.context.attr("transform",d.getTranslate("context")),c.attr("transform",d.getTranslate("subx"))},f.initZoom=function(){var a=this,b=a.d3,c=a.config;a.zoom=b.behavior.zoom().on("zoomstart",function(){a.zoom.altDomain=b.event.sourceEvent.altKey?a.x.orgDomain():null}).on("zoom",a.redrawForZoom),a.zoom.scale=function(a){return c[vb]?this.y(a):this.x(a)},a.zoom.orgScaleExtent=function(){var b=c[p]?c[p]:[1,10];return[b[0],Math.max(a.getMaxDataCount()/b[1],b[1])]},a.zoom.updateScaleExtent=function(){var b=ye(a.x.orgDomain())/ye(a.orgXDomain),c=a.orgScaleExtent();return a.scaleExtent([c[0]*b,c[1]*b]),this}},f.updateZoom=function(){var a=this,b=a.config[o]?a.zoom:function(){};a.main.select("."+a.CLASS[ud]).call(b),a.main.selectAll("."+a.CLASS[qd]).call(b)},f.redrawForZoom=function(){var a=this,b=a.d3,c=a.config,d=a.zoom,e=a.x,f=a.orgXDomain;if(c[o]&&0!==a.filterTargetsToShow(a.data.targets).length){if("mousemove"===b.event.sourceEvent.type&&d.altDomain)return e.domain(d.altDomain),void d.scale(e).updateScaleExtent();a.isCategorized()&&e.orgDomain()[0]===f[0]&&e.domain([f[0]-1e-10,e.orgDomain()[1]]),a.redraw({withTransition:!1,withY:!1,withSubchart:!1}),"mousemove"===b.event.sourceEvent.type&&(a.cancelClick=!0),c[r].call(g,e.orgDomain())}},f.generateColor=function(){var a=this,b=a.config,c=a.d3,d=b[N],e=Ae(b[jb])?b[jb]:c.scale.category10().range(),f=b[M],g=[];return function(a){var b,c=a.id||a;return d[c]instanceof Function?b=d[c](a):d[c]?b=d[c]:(g.indexOf(c)<0&&g.push(c),b=e[g.indexOf(c)%e.length],d[c]=b),f instanceof Function?f(b,a):b}},f.generateLevelColor=function(){var a=this,b=a.config,c=b[jb],d=b[kb],e="value"===d.unit,f=d.values&&d.values.length?d.values:[],g=d.max||100;return Ae(b[kb])?function(a){var b,d,h=c[c.length-1];for(b=0;b<f.length;b++)if(d=e?a:100*a/g,d<f[b]){h=c[b];break}return h}:null},f.getYFormat=function(a){var b=this,c=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.yFormat,d=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.y2Format;return function(a,e,f){var g="y2"===b.getAxisId(f)?d:c;return g.call(b,a,e)}},f.yFormat=function(a){var b=this,c=b.config,d=c[Ub]?c[Ub]:b.defaultValueFormat;return d(a)},f.y2Format=function(a){var b=this,c=b.config,d=c[bc]?c[bc]:b.defaultValueFormat;return d(a)},f.defaultValueFormat=function(a){return re(a)?+a:""},f.defaultArcValueFormat=function(a,b){return(100*b).toFixed(1)+"%"},f.formatByAxisId=function(a){var b=this.internal,c=b.config[J],d=function(a){return re(a)?+a:""};return se(c.format)?d=c.format:"object"==typeof c.format&&se(c.format[a])&&(d=c.format[a]),d},f.hasCaches=function(a){for(var b=0;b<a.length;b++)if(!(a[b]in this.cache))return!1;return!0},f.addCache=function(a,b){this.cache[a]=this.cloneTarget(b)},f.getCaches=function(a){var b,c=[];for(b=0;b<a.length;b++)a[b]in this.cache&&c.push(this.cloneTarget(this.cache[a[b]]));return c};var _c="target",ad="chart ",bd="chartLine",cd="chartLines",dd="chartBar",ed="chartBars",fd="chartText",gd="chartTexts",hd="chartArc",id="chartArcs",jd="chartArcsTitle",kd="chartArcsBackground",ld="chartArcsGaugeUnit",md="chartArcsGaugeMax",nd="chartArcsGaugeMin",od="selectedCircle",pd="selectedCircles",qd="eventRect",rd="eventRects",sd="eventRectsSingle",td="eventRectsMultiple",ud="zoomRect",vd="brush",wd="focused",xd="region",yd="regions",zd="tooltip",Ad="tooltipName",Bd="shape",Cd="shapes",Dd="line",Ed="lines",Fd="bar",Gd="bars",Hd="circle",Id="circles",Jd="arc",Kd="arcs",Ld="area",Md="areas",Nd="empty",Od="text",Pd="texts",Qd="gaugeValue",Rd="grid",Sd="xgrid",Td="xgrids",Ud="xgridLine",Vd="xgridLines",Wd="xgridFocus",Xd="ygrid",Yd="ygrids",Zd="ygridLine",$d="ygridLines",_d="axis",ae="axisX",be="axisXLabel",ce="axisY",de="axisYLabel",ee="axisY2",fe="axisY2Label",ge="legendBackground",he="legendItem",ie="legendItemEvent",je="legendItemTile",ke="legendItemHidden",le="legendItemFocused",me="dragarea",ne="EXPANDED",oe="SELECTED",pe="INCLUDED",qe=f.CLASS={};qe[_c]="c3-target",qe[ad]="c3-chart",qe[bd]="c3-chart-line",qe[cd]="c3-chart-lines",qe[dd]="c3-chart-bar",qe[ed]="c3-chart-bars",qe[fd]="c3-chart-text",qe[gd]="c3-chart-texts",qe[hd]="c3-chart-arc",qe[id]="c3-chart-arcs",qe[jd]="c3-chart-arcs-title",qe[kd]="c3-chart-arcs-background",qe[ld]="c3-chart-arcs-gauge-unit",qe[md]="c3-chart-arcs-gauge-max",qe[nd]="c3-chart-arcs-gauge-min",qe[od]="c3-selected-circle",qe[pd]="c3-selected-circles",qe[qd]="c3-event-rect",qe[rd]="c3-event-rects",qe[sd]="c3-event-rects-single",qe[td]="c3-event-rects-multiple",qe[ud]="c3-zoom-rect",qe[vd]="c3-brush",qe[wd]="c3-focused",qe[xd]="c3-region",qe[yd]="c3-regions",qe[zd]="c3-tooltip",qe[Ad]="c3-tooltip-name",qe[Bd]="c3-shape",qe[Cd]="c3-shapes",qe[Dd]="c3-line",qe[Ed]="c3-lines",qe[Fd]="c3-bar",qe[Gd]="c3-bars",qe[Hd]="c3-circle",qe[Id]="c3-circles",qe[Jd]="c3-arc",qe[Kd]="c3-arcs",qe[Ld]="c3-area",qe[Md]="c3-areas",qe[Nd]="c3-empty",qe[Od]="c3-text",qe[Pd]="c3-texts",qe[Qd]="c3-gauge-value",qe[Rd]="c3-grid",qe[Sd]="c3-xgrid",qe[Td]="c3-xgrids",qe[Ud]="c3-xgrid-line",qe[Vd]="c3-xgrid-lines",qe[Wd]="c3-xgrid-focus",qe[Xd]="c3-ygrid",qe[Yd]="c3-ygrids",qe[Zd]="c3-ygrid-line",qe[$d]="c3-ygrid-lines",qe[_d]="c3-axis",qe[ae]="c3-axis-x",qe[be]="c3-axis-x-label",qe[ce]="c3-axis-y",qe[de]="c3-axis-y-label",qe[ee]="c3-axis-y2",qe[fe]="c3-axis-y2-label",qe[ge]="c3-legend-background",qe[he]="c3-legend-item",qe[ie]="c3-legend-item-event",qe[je]="c3-legend-item-tile",qe[ke]="c3-legend-item-hidden",qe[le]="c3-legend-item-focused",qe[me]="c3-dragarea",qe[ne]="_expanded_",qe[oe]="_selected_",qe[pe]="_included_",f.generateClass=function(a,b){return" "+a+" "+a+this.getTargetSelectorSuffix(b)},f.classText=function(a){return this.generateClass(qe[Od],a.index)},f.classTexts=function(a){return this.generateClass(qe[Pd],a.id)},f.classShape=function(a){return this.generateClass(qe[Bd],a.index)},f.classShapes=function(a){return this.generateClass(qe[Cd],a.id)},f.classLine=function(a){return this.classShape(a)+this.generateClass(qe[Dd],a.id)},f.classLines=function(a){return this.classShapes(a)+this.generateClass(qe[Ed],a.id)},f.classCircle=function(a){return this.classShape(a)+this.generateClass(qe[Hd],a.index)},f.classCircles=function(a){return this.classShapes(a)+this.generateClass(qe[Id],a.id)},f.classBar=function(a){return this.classShape(a)+this.generateClass(qe[Fd],a.index)},f.classBars=function(a){return this.classShapes(a)+this.generateClass(qe[Gd],a.id)},f.classArc=function(a){return this.classShape(a.data)+this.generateClass(qe[Jd],a.data.id) |
|
},f.classArcs=function(a){return this.classShapes(a.data)+this.generateClass(qe[Kd],a.data.id)},f.classArea=function(a){return this.classShape(a)+this.generateClass(qe[Ld],a.id)},f.classAreas=function(a){return this.classShapes(a)+this.generateClass(qe[Md],a.id)},f.classRegion=function(a,b){return this.generateClass(qe[xd],b)+" "+("class"in a?a.class:"")},f.classEvent=function(a){return this.generateClass(qe[qd],a.index)},f.classTarget=function(a){var b=this,c=b.config[E][a],d="";return c&&(d=" "+qe[_c]+"-"+c),b.generateClass(qe[_c],a)+d},f.classChartText=function(a){return qe[fd]+this.classTarget(a.id)},f.classChartLine=function(a){return qe[bd]+this.classTarget(a.id)},f.classChartBar=function(a){return qe[dd]+this.classTarget(a.id)},f.classChartArc=function(a){return qe[hd]+this.classTarget(a.data.id)},f.getTargetSelectorSuffix=function(a){return a||0===a?"-"+(a.replace?a.replace(/([^a-zA-Z0-9-_])/g,"-"):a):""},f.selectorTarget=function(a){return"."+qe[_c]+this.getTargetSelectorSuffix(a)},f.selectorTargets=function(a){var b=this;return a.length?a.map(function(a){return b.selectorTarget(a)}):null},f.selectorLegend=function(a){return"."+qe[he]+this.getTargetSelectorSuffix(a)},f.selectorLegends=function(a){var b=this;return a.length?a.map(function(a){return b.selectorLegend(a)}):null};var re=f.isValue=function(a){return a||0===a},se=f.isFunction=function(a){return"function"==typeof a},te=f.isString=function(a){return"string"==typeof a},ue=f.isUndefined=function(a){return"undefined"==typeof a},ve=f.isDefined=function(a){return"undefined"!=typeof a},we=f.ceil10=function(a){return 10*Math.ceil(a/10)},xe=f.asHalfPixel=function(a){return Math.ceil(a)+.5},ye=f.diffDomain=function(a){return a[1]-a[0]},ze=f.isEmpty=function(a){return!a||te(a)&&0===a.length||"object"==typeof a&&0===Object.keys(a).length},Ae=f.notEmpty=function(a){return Object.keys(a).length>0},Be=f.getOption=function(a,b,c){return ve(a[b])?a[b]:c},Ce=f.hasValue=function(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c},De=f.getPathBox=function(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}},Ee=f.generateCall=function(a,b){return function(c,d){return a.call(b,c,d)}};e.focus=function(a){function b(a){c.filterTargetsToShow(a).transition().duration(100).style("opacity",1)}var c=this.internal,d=c.svg.selectAll(c.selectorTarget(a)),e=d.filter(Ee(c.isNoneArc,c)),f=d.filter(Ee(c.isArc,c));this.revert(),this.defocus(),b(e.classed(qe[wd],!0)),b(f),c.hasArcType()&&c.expandArc(a,!0),c.toggleFocusLegend(a,!0)},e.defocus=function(a){function b(a){c.filterTargetsToShow(a).transition().duration(100).style("opacity",.3)}var c=this.internal,d=c.svg.selectAll(c.selectorTarget(a)),e=d.filter(Ee(c.isNoneArc,c)),f=d.filter(Ee(c.isArc,c));this.revert(),b(e.classed(qe[wd],!1)),b(f),c.hasArcType()&&c.unexpandArc(a),c.toggleFocusLegend(a,!1)},e.revert=function(a){function b(a){c.filterTargetsToShow(a).transition().duration(100).style("opacity",1)}var c=this.internal,d=c.svg.selectAll(c.selectorTarget(a)),e=d.filter(Ee(c.isNoneArc,c)),f=d.filter(Ee(c.isArc,c));b(e.classed(qe[wd],!1)),b(f),c.hasArcType()&&c.unexpandArc(a),c.revertLegend()},e.show=function(a,b){var c=this.internal;a=c.mapToTargetIds(a),b=b||{},c.removeHiddenTargetIds(a),c.svg.selectAll(c.selectorTargets(a)).transition().style("opacity",1),b.withLegend&&c.showLegend(a),c.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},e.hide=function(a,b){var c=this.internal;a=c.mapToTargetIds(a),b=b||{},c.addHiddenTargetIds(a),c.svg.selectAll(c.selectorTargets(a)).transition().style("opacity",0),b.withLegend&&c.hideLegend(a),c.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},e.toggle=function(a){var b=this.internal;b.isTargetToShow(a)?this.hide(a):this.show(a)},e.zoom=function(){},e.zoom.enable=function(a){var b=this.internal;b.config[o]=a,b.updateAndRedraw()},e.unzoom=function(){var a=this.internal;a.brush.clear().update(),a.redraw({withUpdateXDomain:!0})},e.load=function(a){var b=this.internal,c=b.config;return a.xs&&b.addXs(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){c[E][b]=a.classes[b]}),"categories"in a&&b.isCategorized()&&(c[zb]=a.categories),"cacheIds"in a&&b.hasCaches(a.cacheIds)?void b.load(b.getCaches(a.cacheIds),a.done):void("unload"in a?b.unload(b.mapToTargetIds("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){b.loadFromArgs(a)}):b.loadFromArgs(a))},e.unload=function(a){var b=this.internal;a=a||{},b.unload(b.mapToTargetIds(a.ids),function(){b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),se(a.done)&&a.done()})},e.flow=function(a){var b,c,d,e,f,g,h,i,j=this.internal,k=[],l=j.getMaxDataCount(),m=0,n=0;if(a.json)c=j.convertJsonToData(a.json,a.keys);else if(a.rows)c=j.convertRowsToData(a.rows);else{if(!a.columns)return;c=j.convertColumnsToData(a.columns)}b=j.convertDataToTargets(c,!0),j.data.targets.forEach(function(a){var c,d,e=!1;for(c=0;c<b.length;c++)if(a.id===b[c].id){for(e=!0,a.values[a.values.length-1]&&(n=a.values[a.values.length-1].index+1),m=b[c].values.length,d=0;m>d;d++)b[c].values[d].index=n+d,j.isTimeSeries()||(b[c].values[d].x=n+d);a.values=a.values.concat(b[c].values),b.splice(c,1);break}e||k.push(a.id)}),j.data.targets.forEach(function(a){var b,c;for(b=0;b<k.length;b++)if(a.id===k[b])for(n=a.values[a.values.length-1].index+1,c=0;m>c;c++)a.values.push({id:a.id,index:n+c,x:j.isTimeSeries()?j.getOtherTargetX(n+c):n+c,value:null})}),j.data.targets.length&&b.forEach(function(a){var b,c=[];for(b=j.data.targets[0].values[0].index;n>b;b++)c.push({id:a.id,index:b,x:j.isTimeSeries()?j.getOtherTargetX(b):b,value:null});a.values.forEach(function(a){a.index+=n,j.isTimeSeries()||(a.x+=n)}),a.values=c.concat(a.values)}),j.data.targets=j.data.targets.concat(b),d=j.getMaxDataCount(),f=j.data.targets[0],g=f.values[0],ve(a.to)?(m=0,i=j.isTimeSeries()?j.parseDate(a.to):a.to,f.values.forEach(function(a){a.x<i&&m++})):ve(a.length)&&(m=a.length),l?1===l&&j.isTimeSeries()&&(h=(f.values[f.values.length-1].x-g.x)/2,e=[new Date(+g.x-h),new Date(+g.x+h)],j.updateXDomain(null,!0,!0,e)):(h=j.isTimeSeries()?f.values.length>1?f.values[f.values.length-1].x-g.x:g.x-j.getXDomain(j.data.targets)[0]:1,e=[g.x-h,g.x],j.updateXDomain(null,!0,!0,e)),j.updateTargets(j.data.targets),j.redraw({flow:{index:g.index,length:m,duration:re(a.duration)?a.duration:j.config[x],done:a.done,orgDataCount:l},withLegend:!0,withTransition:l>1})},e.selected=function(a){var b=this.internal,c=b.d3;return c.merge(b.main.selectAll("."+qe[Cd]+b.getTargetSelectorSuffix(a)).selectAll("."+qe[Bd]).filter(function(){return c.select(this).classed(qe[oe])}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},e.select=function(a,b,c){var d=this.internal,e=d.d3,f=d.config;f[Q]&&d.main.selectAll("."+qe[Cd]).selectAll("."+qe[Bd]).each(function(g,h){var i=e.select(this),j=g.data?g.data.id:g.id,k=d.getToggle(this),l=f[R]||!a||a.indexOf(j)>=0,m=!b||b.indexOf(h)>=0,n=i.classed(qe[oe]);i.classed(qe[Dd])||i.classed(qe[Ld])||(l&&m?f[S](g)&&!n&&k(!0,i.classed(qe[oe],!0),g,h):ve(c)&&c&&n&&k(!1,i.classed(qe[oe],!1),g,h))})},e.unselect=function(a,b){var c=this.internal,d=c.d3,e=c.config;e[Q]&&c.main.selectAll("."+qe[Cd]).selectAll("."+qe[Bd]).each(function(f,g){var h=d.select(this),i=f.data?f.data.id:f.id,j=c.getToggle(this),k=e[R]||!a||a.indexOf(i)>=0,l=!b||b.indexOf(g)>=0,m=h.classed(qe[oe]);h.classed(qe[Dd])||h.classed(qe[Ld])||k&&l&&e[S](f)&&m&&j(!1,h.classed(qe[oe],!1),f,g)})},e.transform=function(a,b){var c=this.internal,d=["pie","donut"].indexOf(a)>=0?{withTransform:!0}:null;c.transformTo(b,a,d)},e.groups=function(a){var b=this.internal,c=b.config;return ue(a)?c[F]:(c[F]=a,b.redraw(),c[F])},e.xgrids=function(a){var b=this.internal,c=b.config;return a?(c[hc]=a,b.redraw(),c[hc]):c[hc]},e.xgrids.add=function(a){var b=this.internal;return this.xgrids(b.config[hc].concat(a?a:[]))},e.xgrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!0)},e.ygrids=function(a){var b=this.internal,c=b.config;return a?(c[jc]=a,b.redraw(),c[jc]):c[jc]},e.ygrids.add=function(a){var b=this.internal;return g.ygrids(b.config[jc].concat(a?a:[]))},e.ygrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!1)},e.regions=function(a){var b=this.internal,c=b.config;return a?(c[Qc]=a,b.redraw(),c[Qc]):c[Qc]},e.regions.add=function(a){var b=this.internal,c=b.config;return a?(c[Qc]=c[Qc].concat(a),b.redraw(),c[Qc]):c[Qc]},e.regions.remove=function(a){var b,c,d,e=this.internal,f=e.config;return a=a||{},b=e.getOption(a,"duration",f[x]),c=e.getOption(a,"classes",[qe[xd]]),d=e.main.select("."+qe[yd]).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),f[Qc]=f[Qc].filter(function(a){var b=!1;return a.class?(a.class.split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0}),f[Qc]},e.data=function(){},e.data.get=function(a){var b=this.data.getAsTarget(a);return ve(b)?b.values.map(function(a){return a.value}):void 0},e.data.getAsTarget=function(a){var b=this.data.targets.filter(function(b){return b.id===a});return b.length>0?b[0]:void 0},e.data.names=function(a){var b=this.internal,c=b.config;return arguments.length?(Object.keys(a).forEach(function(b){c[D][b]=a[b]}),b.redraw({withLegend:!0}),c[D]):c[D]},e.data.colors=function(a){var b=this.internal,c=b.config;return arguments.length?(Object.keys(a).forEach(function(b){c[N][b]=a[b]}),b.redraw({withLegend:!0}),c[N]):c[N]},e.category=function(a,b){var c=this.internal,d=c.config;return arguments.length>1&&(d[zb][a]=b,c.redraw()),d[zb][a]},e.categories=function(a){var b=this.internal,c=b.config;return arguments.length?(c[zb]=a,b.redraw(),c[zb]):c[zb]},e.color=function(a){var b=this.internal;return b.color(a)},e.x=function(a){var b=this.internal;return arguments.length&&(b.updateTargetX(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},e.xs=function(a){var b=this.internal;return arguments.length&&(b.updateTargetXs(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},e.axis=function(){},e.axis.labels=function(a){var b=this.internal;arguments.length&&(Object.keys(a).forEach(function(c){b.setAxisLabelText(c,a[c])}),b.updateAxisLabels())},e.axis.max=function(a){var b=this.internal,c=b.config;arguments.length&&("object"==typeof a?(re(a.x)&&(c[Jb]=a.x),re(a.y)&&(c[Qb]=a.y),re(a.y2)&&(c[Zb]=a.y2)):c[Qb]=c[Zb]=a,b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},e.axis.min=function(a){var b=this.internal,c=b.config;arguments.length&&("object"==typeof a?(re(a.x)&&(c[Kb]=a.x),re(a.y)&&(c[Rb]=a.y),re(a.y2)&&(c[$b]=a.y2)):c[Rb]=c[$b]=a,b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},e.axis.range=function(a){arguments.length&&(ve(a.max)&&this.axis.max(a.max),ve(a.min)&&this.axis.min(a.min))},e.legend=function(){},e.legend.show=function(a){var b=this.internal;b.showLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},e.legend.hide=function(a){var b=this.internal;b.hideLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},e.resize=function(a){var b=this.internal,c=b.config;c[i]=a?a.width:null,c[j]=a?a.height:null,this.flush()},e.flush=function(){var a=this.internal;a.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},e.destroy=function(){var b=this.internal;b.data.targets=void 0,b.data.xs={},b.selectChart.classed("c3",!1).html(""),a.onresize=null},"function"==typeof define&&define.amd?define("c3",["d3"],g):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=g:a.c3=g}(window); |