forked from dc-js/dc.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dc.min.js
4 lines (4 loc) · 70.2 KB
/
dc.min.js
1
2
3
4
!function(){function a(a){"use strict";var b={version:"2.0.0-dev",constants:{CHART_CLASS:"dc-chart",DEBUG_GROUP_CLASS:"debug",STACK_CLASS:"stack",DESELECTED_CLASS:"deselected",SELECTED_CLASS:"selected",NODE_INDEX_NAME:"__index__",GROUP_INDEX_NAME:"__group_index__",DEFAULT_CHART_GROUP:"__default_chart_group__",EVENT_DELAY:40,NEGLIGIBLE_NUMBER:1e-10},_renderlet:null};b.chartRegistry=function(){function a(a){return a||(a=b.constants.DEFAULT_CHART_GROUP),c[a]||(c[a]=[]),a}var c={};return{has:function(a){for(var b in c)if(c[b].indexOf(a)>=0)return!0;return!1},register:function(b,d){d=a(d),c[d].push(b)},deregister:function(b,d){d=a(d);for(var e=0;e<c[d].length;e++)if(c[d][e].anchorName()===b.anchorName()){c[d].splice(e,1);break}},clear:function(a){a?delete c[a]:c={}},list:function(b){return b=a(b),c[b]}}}(),b.registerChart=function(a,c){b.chartRegistry.register(a,c)},b.deregisterChart=function(a,c){b.chartRegistry.deregister(a,c)},b.hasChart=function(a){return b.chartRegistry.has(a)},b.deregisterAllCharts=function(a){b.chartRegistry.clear(a)},b.filterAll=function(a){for(var c=b.chartRegistry.list(a),d=0;d<c.length;++d)c[d].filterAll()},b.refocusAll=function(a){for(var c=b.chartRegistry.list(a),d=0;d<c.length;++d)c[d].focus&&c[d].focus()},b.renderAll=function(a){for(var c=b.chartRegistry.list(a),d=0;d<c.length;++d)c[d].render();null!==b._renderlet&&b._renderlet(a)},b.redrawAll=function(a){for(var c=b.chartRegistry.list(a),d=0;d<c.length;++d)c[d].redraw();null!==b._renderlet&&b._renderlet(a)},b.disableTransitions=!1,b.transition=function(a,c,d){if(0>=c||void 0===c||b.disableTransitions)return a;var e=a.transition().duration(c);return"function"==typeof d&&d(e),e},b.units={},b.units.integers=function(a,b){return Math.abs(b-a)},b.units.ordinal=function(a,b,c){return c},b.units.fp={},b.units.fp.precision=function(a){var c=function(a,d){var e=Math.abs((d-a)/c.resolution);return b.utils.isNegligible(e-Math.floor(e))?Math.floor(e):Math.ceil(e)};return c.resolution=a,c},b.round={},b.round.floor=function(a){return Math.floor(a)},b.round.ceil=function(a){return Math.ceil(a)},b.round.round=function(a){return Math.round(a)},b.override=function(a,b,c){var d=a[b];a["_"+b]=d,a[b]=c},b.renderlet=function(a){return arguments.length?(b._renderlet=a,b):b._renderlet},b.instanceOfChart=function(a){return a instanceof Object&&a.__dc_flag__&&!0},b.errors={},b.errors.Exception=function(a){var b=a||"Unexpected internal error";this.message=b,this.toString=function(){return b}},b.errors.InvalidStateException=function(){b.errors.Exception.apply(this,arguments)},b.dateFormat=a.time.format("%m/%d/%Y"),b.printers={},b.printers.filters=function(a){for(var c="",d=0;d<a.length;++d)d>0&&(c+=", "),c+=b.printers.filter(a[d]);return c},b.printers.filter=function(a){var c="";return a&&(a instanceof Array?a.length>=2?c="["+b.utils.printSingleValue(a[0])+" -> "+b.utils.printSingleValue(a[1])+"]":a.length>=1&&(c=b.utils.printSingleValue(a[0])):c=b.utils.printSingleValue(a)),c},b.pluck=function(a,b){return b?function(c,d){return b.call(c,c[a],d)}:function(b){return b[a]}},b.utils={},b.utils.printSingleValue=function(a){var c=""+a;return a instanceof Date?c=b.dateFormat(a):"string"==typeof a?c=a:b.utils.isFloat(a)?c=b.utils.printSingleValue.fformat(a):b.utils.isInteger(a)&&(c=Math.round(a)),c},b.utils.printSingleValue.fformat=a.format(".2f"),b.utils.add=function(a,b){if("string"==typeof b&&(b=b.replace("%","")),a instanceof Date){"string"==typeof b&&(b=+b);var c=new Date;return c.setTime(a.getTime()),c.setDate(a.getDate()+b),c}if("string"==typeof b){var d=+b/100;return a>0?a*(1+d):a*(1-d)}return a+b},b.utils.subtract=function(a,b){if("string"==typeof b&&(b=b.replace("%","")),a instanceof Date){"string"==typeof b&&(b=+b);var c=new Date;return c.setTime(a.getTime()),c.setDate(a.getDate()-b),c}if("string"==typeof b){var d=+b/100;return 0>a?a*(1+d):a*(1-d)}return a-b},b.utils.isNumber=function(a){return a===+a},b.utils.isFloat=function(a){return a===+a&&a!==(0|a)},b.utils.isInteger=function(a){return a===+a&&a===(0|a)},b.utils.isNegligible=function(a){return!b.utils.isNumber(a)||a<b.constants.NEGLIGIBLE_NUMBER&&a>-b.constants.NEGLIGIBLE_NUMBER},b.utils.clamp=function(a,b,c){return b>a?b:a>c?c:a};var c=0;return b.utils.uniqueId=function(){return++c},b.utils.nameToId=function(a){return a.toLowerCase().replace(/[\s]/g,"_").replace(/[\.']/g,"")},b.utils.appendOrSelect=function(a,b){var c=a.select(b);return c.empty()&&(c=a.append(b)),c},b.utils.safeNumber=function(a){return b.utils.isNumber(+a)?+a:0},b.logger={},b.logger.enableDebugLog=!1,b.logger.warn=function(a){return console&&(console.warn?console.warn(a):console.log&&console.log(a)),b.logger},b.logger.debug=function(a){return b.logger.enableDebugLog&&console&&(console.debug?console.debug(a):console.log&&console.log(a)),b.logger},b.events={current:null},b.events.trigger=function(a,c){return c?(b.events.current=a,void setTimeout(function(){a==b.events.current&&a()},c)):void a()},b.filters={},b.filters.RangedFilter=function(a,b){var c=Array(a,b);return c.isFiltered=function(a){return a>=this[0]&&a<this[1]},c},b.filters.TwoDimensionalFilter=function(a){if(null===a)return null;var b=a;return b.isFiltered=function(a){return a.length&&a.length==b.length&&a[0]==b[0]&&a[1]==b[1]},b},b.filters.RangedTwoDimensionalFilter=function(a){if(null===a)return null;var b,c=a;return b=c[0]instanceof Array?[[Math.min(a[0][0],a[1][0]),Math.min(a[0][1],a[1][1])],[Math.max(a[0][0],a[1][0]),Math.max(a[0][1],a[1][1])]]:[[a[0],-1/0],[a[1],1/0]],c.isFiltered=function(a){var c,d;if(a instanceof Array){if(2!=a.length)return!1;c=a[0],d=a[1]}else c=a,d=b[0][1];return c>=b[0][0]&&c<b[1][0]&&d>=b[0][1]&&d<b[1][1]},c},b.baseMixin=function(c){function d(){return o=c.root().append("svg").attr("width",c.width()).attr("height",c.height())}function e(a){if(!c[a]||!c[a]())throw new b.errors.InvalidStateException("Mandatory attribute chart."+a+" is missing on chart[#"+c.anchorName()+"]")}function f(a){for(var b=0;b<L.length;b++)if(L[b]<=a&&L[b]>=a){L.splice(b,1);break}i(),c._invokeFilteredListener(a)}function g(a){L.push(a),i(),c._invokeFilteredListener(a)}function h(){L=[],i(),c._invokeFilteredListener(null)}function i(){if(c.dimension()&&c.dimension().filter){var a=M(c.dimension(),L);L=a?a:L}}function j(){for(var a=0;a<G.length;++a)G[a](c)}c.__dc_flag__=b.utils.uniqueId();var k,l,m,n,o,p,q,r=200,s=function(a){var b=a&&a.getBoundingClientRect&&a.getBoundingClientRect().width;return b&&b>r?b:r},t=s,u=200,v=function(a){var b=a&&a.getBoundingClientRect&&a.getBoundingClientRect().height;return b&&b>u?b:u},w=v,x=b.pluck("key"),y=b.pluck("value"),z=b.pluck("key"),A=b.pluck("key"),B=!1,C=function(a){return c.keyAccessor()(a)+": "+c.valueAccessor()(a)},D=!1,E=750,F=b.printers.filters,G=[],H=["dimension","group"],I=b.constants.DEFAULT_CHART_GROUP,J=function(){},K={preRender:J,postRender:J,preRedraw:J,postRedraw:J,filtered:J,zoomed:J},L=[],M=function(a,b){return a.filter(null),0===b.length?a.filter(null):a.filterFunction(function(a){for(var c=0;c<b.length;c++){var d=b[c];if(d.isFiltered&&d.isFiltered(a))return!0;if(a>=d&&d>=a)return!0}return!1}),b},N=function(a){return a.all()};return c.width=function(b){return arguments.length?(t=a.functor(b||s),c):t(n.node())},c.height=function(b){return arguments.length?(w=a.functor(b||v),c):w(n.node())},c.minWidth=function(a){return arguments.length?(r=a,c):r},c.minHeight=function(a){return arguments.length?(u=a,c):u},c.dimension=function(a){return arguments.length?(k=a,c.expireCache(),c):k},c.data=function(b){return arguments.length?(N=a.functor(b),c.expireCache(),c):N.call(c,l)},c.group=function(a,b){return arguments.length?(l=a,c._groupName=b,c.expireCache(),c):l},c.ordering=function(a){return arguments.length?(A=a,p=crossfilter.quicksort.by(A),c.expireCache(),c):A},c._computeOrderedGroups=function(a){var b=a.slice(0);return b.length<=1?b:(p||(p=crossfilter.quicksort.by(A)),p(b,0,b.length))},c.filterAll=function(){return c.filter(null)},c.select=function(a){return n.select(a)},c.selectAll=function(a){return n?n.selectAll(a):null},c.anchor=function(d,e){return arguments.length?(b.instanceOfChart(d)?(m=d.anchor(),n=d.root()):(m=d,n=a.select(m),n.classed(b.constants.CHART_CLASS,!0),b.registerChart(c,e)),I=e,c):m},c.anchorName=function(){var a=c.anchor();return a&&a.id?a.id:a&&a.replace?a.replace("#",""):""+c.chartID()},c.root=function(a){return arguments.length?(n=a,c):n},c.svg=function(a){return arguments.length?(o=a,c):o},c.resetSvg=function(){return c.select("svg").remove(),d()},c.filterPrinter=function(a){return arguments.length?(F=a,c):F},c.turnOnControls=function(){return n&&(c.selectAll(".reset").style("display",null),c.selectAll(".filter").text(F(c.filters())).style("display",null)),c},c.turnOffControls=function(){return n&&(c.selectAll(".reset").style("display","none"),c.selectAll(".filter").style("display","none").text(c.filter())),c},c.transitionDuration=function(a){return arguments.length?(E=a,c):E},c._mandatoryAttributes=function(a){return arguments.length?(H=a,c):H},c.render=function(){K.preRender(c),H&&H.forEach(e);var a=c._doRender();return q&&q.render(),c._activateRenderlets("postRender"),a},c._activateRenderlets=function(a){c.transitionDuration()>0&&o?o.transition().duration(c.transitionDuration()).each("end",function(){j(),a&&K[a](c)}):(j(),a&&K[a](c))},c.redraw=function(){K.preRedraw(c);var a=c._doRedraw();return q&&q.render(),c._activateRenderlets("postRedraw"),a},c.redrawGroup=function(){b.redrawAll(c.chartGroup())},c._invokeFilteredListener=function(a){void 0!==a&&K.filtered(c,a)},c._invokeZoomedListener=function(){K.zoomed(c)},c.hasFilter=function(a){return arguments.length?L.some(function(b){return b>=a&&a>=b}):L.length>0},c.replaceFilter=function(a){L=[],c.filter(a)},c.filter=function(a){return arguments.length?(a instanceof Array&&a[0]instanceof Array&&!a.isFiltered?(a[0].forEach(function(a){c.hasFilter(a)?L.splice(L.indexOf(a),1):L.push(a)}),i(),c._invokeFilteredListener(a)):null===a?h():c.hasFilter(a)?f(a):g(a),null!==n&&c.hasFilter()?c.turnOnControls():c.turnOffControls(),c):L.length>0?L[0]:null},c.filters=function(){return L},c.highlightSelected=function(c){a.select(c).classed(b.constants.SELECTED_CLASS,!0),a.select(c).classed(b.constants.DESELECTED_CLASS,!1)},c.fadeDeselected=function(c){a.select(c).classed(b.constants.SELECTED_CLASS,!1),a.select(c).classed(b.constants.DESELECTED_CLASS,!0)},c.resetHighlight=function(c){a.select(c).classed(b.constants.SELECTED_CLASS,!1),a.select(c).classed(b.constants.DESELECTED_CLASS,!1)},c.onClick=function(a){var d=c.keyAccessor()(a);b.events.trigger(function(){c.filter(d),c.redrawGroup()})},c.filterHandler=function(a){return arguments.length?(M=a,c):M},c._doRender=function(){return c},c._doRedraw=function(){return c},c.legendables=function(){return[]},c.legendHighlight=function(){},c.legendReset=function(){},c.legendToggle=function(){},c.isLegendableHidden=function(){return!1},c.keyAccessor=function(a){return arguments.length?(x=a,c):x},c.valueAccessor=function(a){return arguments.length?(y=a,c):y},c.label=function(a){return arguments.length?(z=a,B=!0,c):z},c.renderLabel=function(a){return arguments.length?(B=a,c):B},c.title=function(a){return arguments.length?(C=a,D=!0,c):C},c.renderTitle=function(a){return arguments.length?(D=a,c):D},c.renderlet=function(a){return G.push(a),c},c.chartGroup=function(a){return arguments.length?(I=a,c):I},c.expireCache=function(){return c},c.legend=function(a){return arguments.length?(q=a,q.parent(c),c):q},c.chartID=function(){return c.__dc_flag__},c.options=function(a){for(var d in a)"function"==typeof c[d]?c[d].call(c,a[d]):b.logger.debug("Not a valid option setter name: "+d);return c},c.on=function(a,b){return K[a]=b,c},c},b.marginMixin=function(a){var b={top:10,right:50,bottom:30,left:30};return a.margins=function(c){return arguments.length?(b=c,a):b},a.effectiveWidth=function(){return a.width()-a.margins().left-a.margins().right},a.effectiveHeight=function(){return a.height()-a.margins().top-a.margins().bottom},a},b.colorMixin=function(b){var c=a.scale.category20c(),d=!0,e=function(a){return b.keyAccessor()(a)};return b.colors=function(d){return arguments.length?(c=d instanceof Array?a.scale.quantize().range(d):a.functor(d),b):c},b.ordinalColors=function(c){return b.colors(a.scale.ordinal().range(c))},b.linearColors=function(c){return b.colors(a.scale.linear().range(c).interpolate(a.interpolateHcl))},b.colorAccessor=function(a){return arguments.length?(e=a,d=!1,b):e},b.defaultColorAccessor=function(){return d},b.colorDomain=function(a){return arguments.length?(c.domain(a),b):c.domain()},b.calculateColorDomain=function(){var d=[a.min(b.data(),b.colorAccessor()),a.max(b.data(),b.colorAccessor())];c.domain(d)},b.getColor=function(a,b){return c(e.call(this,a,b))},b.colorCalculator=function(a){return arguments.length?(b.getColor=a,b):b.getColor},b},b.coordinateGridMixin=function(c){function d(a){c.elasticX()&&!c.isOrdinal()?x.domain([c.xAxisMin(),c.xAxisMax()]):c.isOrdinal()&&0===x.domain().length&&x.domain(c._ordinalXDomain()),c.isOrdinal()?x.rangeBands([0,c.xAxisLength()],ab,_):x.range([0,c.xAxisLength()]),G=G.scale(c.x()),e(a)}function e(a){var d=a.selectAll("g."+q);if(S){d.empty()&&(d=a.insert("g",":first-child").attr("class",o+" "+q).attr("transform","translate("+c.margins().left+","+c.margins().top+")"));var e=G.tickValues()?G.tickValues():x.ticks(G.ticks()[0]),f=d.selectAll("line").data(e),g=f.enter().append("line").attr("x1",function(a){return x(a)}).attr("y1",c._xAxisY()-c.margins().top).attr("x2",function(a){return x(a)}).attr("y2",0).attr("opacity",0);b.transition(g,c.transitionDuration()).attr("opacity",1),b.transition(f,c.transitionDuration()).attr("x1",function(a){return x(a)}).attr("y1",c._xAxisY()-c.margins().top).attr("x2",function(a){return x(a)}).attr("y2",0),f.exit().remove()}else d.selectAll("line").remove()}function f(){return c._xAxisY()-c.margins().top}function g(){return c.anchorName()+"-clip"}function h(){var a=b.utils.appendOrSelect(u,"defs"),d=b.utils.appendOrSelect(a,"clipPath").attr("id",g()),e=2*$;b.utils.appendOrSelect(d,"rect").attr("width",c.xAxisLength()+e).attr("height",c.yAxisHeight()+e)}function i(a){c.isOrdinal()&&(Q=!1),d(c.g()),c._prepareYAxis(c.g()),c.plotData(),(c.elasticX()||T||a)&&c.renderXAxis(c.g()),(c.elasticY()||a)&&c.renderYAxis(c.g()),a?c.renderBrush(c.g()):c.redrawBrush(c.g())}function j(){Z?c._enableMouseZoom():Y&&c._disableMouseZoom()}function k(){T=!0,V&&(c.x().domain(l(c.x().domain(),y)),E&&c.x().domain(l(c.x().domain(),E.x().domain())));var a=c.x().domain(),d=b.filters.RangedFilter(a[0],a[1]);c.replaceFilter(d),c.rescale(),c.redraw(),E&&!m(c.filter(),E.filter())&&b.events.trigger(function(){E.replaceFilter(d),E.redraw()}),c._invokeZoomedListener(),b.events.trigger(function(){c.redrawGroup()},b.constants.EVENT_DELAY),T=!m(a,y)}function l(b,c){var d=[];return d[0]=a.max([b[0],c[0]]),d[1]=a.min([b[1],c[1]]),d}function m(a,b){return a||b?a&&b?0===a.length&&0===b.length?!0:a[0].valueOf()===b[0].valueOf()&&a[1].valueOf()===b[1].valueOf()?!0:!1:!1:!0}function n(a){return a instanceof Array&&a.length>1}var o="grid-line",p="horizontal",q="vertical",r="y-axis-label",s="x-axis-label",t=12;c=b.colorMixin(b.marginMixin(b.baseMixin(c))),c.colors(a.scale.category10()),c._mandatoryAttributes().push("x");var u,v,w,x,y,z,A,B,C,D,E,F,G=a.svg.axis().orient("bottom"),H=b.units.integers,I=0,J=!1,K=0,L=a.svg.axis().orient("left"),M=0,N=!1,O=0,P=a.svg.brush(),Q=!0,R=!1,S=!1,T=!1,U=[1,1/0],V=!0,W=a.behavior.zoom().on("zoom",k),X=a.behavior.zoom().on("zoom",null),Y=!1,Z=!1,$=0,_=.5,ab=0,bb=!1;return c.rescale=function(){D=void 0},c.rangeChart=function(a){return arguments.length?(E=a,E.focusChart(c),c):E},c.zoomScale=function(a){return arguments.length?(U=a,c):U},c.zoomOutRestrict=function(a){return arguments.length?(U[0]=a?1:0,V=a,c):V},c._generateG=function(a){return u=void 0===a?c.svg():a,v=u.append("g"),w=v.append("g").attr("class","chart-body").attr("transform","translate("+c.margins().left+", "+c.margins().top+")").attr("clip-path","url(#"+g()+")"),v},c.g=function(a){return arguments.length?(v=a,c):v},c.mouseZoomable=function(a){return arguments.length?(Z=a,c):Z},c.chartBodyG=function(a){return arguments.length?(w=a,c):w},c.x=function(a){return arguments.length?(x=a,y=x.domain(),c):x},c.xOriginalDomain=function(){return y},c.xUnits=function(a){return arguments.length?(H=a,c):H},c.xAxis=function(a){return arguments.length?(G=a,c):G},c.elasticX=function(a){return arguments.length?(J=a,c):J},c.xAxisPadding=function(a){return arguments.length?(I=a,c):I},c.xUnitCount=function(){if(void 0===D){var a=c.xUnits()(c.x().domain()[0],c.x().domain()[1],c.x().domain());D=a instanceof Array?a.length:a}return D},c.useRightYAxis=function(a){return arguments.length?(bb=a,c):bb},c.isOrdinal=function(){return c.xUnits()===b.units.ordinal},c._ordinalXDomain=function(){var a=c._computeOrderedGroups(c.data());return a.map(c.keyAccessor())},c.renderXAxis=function(a){var d=a.selectAll("g.x");d.empty()&&(d=a.append("g").attr("class","axis x").attr("transform","translate("+c.margins().left+","+c._xAxisY()+")"));var e=a.selectAll("text."+s);e.empty()&&c.xAxisLabel()&&(e=a.append("text").attr("transform","translate("+(c.margins().left+c.xAxisLength()/2)+","+(c.height()-K)+")").attr("class",s).attr("text-anchor","middle").text(c.xAxisLabel())),c.xAxisLabel()&&e.text()!=c.xAxisLabel()&&e.text(c.xAxisLabel()),b.transition(d,c.transitionDuration()).call(G)},c._xAxisY=function(){return c.height()-c.margins().bottom},c.xAxisLength=function(){return c.effectiveWidth()},c.xAxisLabel=function(a,b){return arguments.length?(z=a,c.margins().bottom-=K,K=void 0===b?t:b,c.margins().bottom+=K,c):z},c._prepareYAxis=function(b){if(void 0===A||c.elasticY()){A=a.scale.linear();var d=c.yAxisMin()||0,e=c.yAxisMax()||0;A.domain([d,e]).rangeRound([c.yAxisHeight(),0])}A.range([c.yAxisHeight(),0]),L=L.scale(A),bb&&L.orient("right"),c._renderHorizontalGridLinesForAxis(b,A,L)},c.renderYAxisLabel=function(a,b,d,e){e=e||O;var f=c.g().selectAll("text."+r+"."+a+"-label");if(f.empty()&&b){var g=c.margins().top+c.yAxisHeight()/2;f=c.g().append("text").attr("transform","translate("+e+","+g+"),rotate("+d+")").attr("class",r+" "+a+"-label").attr("text-anchor","middle").text(b)}b&&f.text()!=b&&f.text(b)},c.renderYAxisAt=function(a,d,e){var f=c.g().selectAll("g."+a);f.empty()&&(f=c.g().append("g").attr("class","axis "+a).attr("transform","translate("+e+","+c.margins().top+")")),b.transition(f,c.transitionDuration()).call(d)},c.renderYAxis=function(){var a=bb?c.width()-c.margins().right:c._yAxisX();c.renderYAxisAt("y",L,a);var b=bb?c.width()-O:O,d=bb?90:-90;c.renderYAxisLabel("y",c.yAxisLabel(),d,b)},c._renderHorizontalGridLinesForAxis=function(a,d,e){var f=a.selectAll("g."+p);if(R){var g=e.tickValues()?e.tickValues():d.ticks(e.ticks()[0]);f.empty()&&(f=a.insert("g",":first-child").attr("class",o+" "+p).attr("transform","translate("+c.margins().left+","+c.margins().top+")"));var h=f.selectAll("line").data(g),i=h.enter().append("line").attr("x1",1).attr("y1",function(a){return d(a)}).attr("x2",c.xAxisLength()).attr("y2",function(a){return d(a)}).attr("opacity",0);b.transition(i,c.transitionDuration()).attr("opacity",1),b.transition(h,c.transitionDuration()).attr("x1",1).attr("y1",function(a){return d(a)}).attr("x2",c.xAxisLength()).attr("y2",function(a){return d(a)}),h.exit().remove()}else f.selectAll("line").remove()},c._yAxisX=function(){return c.useRightYAxis()?c.width()-c.margins().right:c.margins().left},c.yAxisLabel=function(a,b){return arguments.length?(B=a,c.margins().left-=O,O=void 0===b?t:b,c.margins().left+=O,c):B},c.y=function(a){return arguments.length?(A=a,c):A},c.yAxis=function(a){return arguments.length?(L=a,c):L},c.elasticY=function(a){return arguments.length?(N=a,c):N},c.renderHorizontalGridLines=function(a){return arguments.length?(R=a,c):R},c.renderVerticalGridLines=function(a){return arguments.length?(S=a,c):S},c.xAxisMin=function(){var d=a.min(c.data(),function(a){return c.keyAccessor()(a)});return b.utils.subtract(d,I)},c.xAxisMax=function(){var d=a.max(c.data(),function(a){return c.keyAccessor()(a)});return b.utils.add(d,I)},c.yAxisMin=function(){var d=a.min(c.data(),function(a){return c.valueAccessor()(a)});return b.utils.subtract(d,M)},c.yAxisMax=function(){var d=a.max(c.data(),function(a){return c.valueAccessor()(a)});return b.utils.add(d,M)},c.yAxisPadding=function(a){return arguments.length?(M=a,c):M},c.yAxisHeight=function(){return c.effectiveHeight()},c.round=function(a){return arguments.length?(C=a,c):C},c._rangeBandPadding=function(a){return arguments.length?(ab=a,c):ab},c._outerRangeBandPadding=function(a){return arguments.length?(_=a,c):_},b.override(c,"filter",function(a){return arguments.length?(c._filter(a),a?c.brush().extent(a):c.brush().clear(),c):c._filter()}),c.brush=function(a){return arguments.length?(P=a,c):P},c.renderBrush=function(a){if(Q){P.on("brush",c._brushing),P.on("brushstart",c._disableMouseZoom),P.on("brushend",j);var b=a.append("g").attr("class","brush").attr("transform","translate("+c.margins().left+","+c.margins().top+")").call(P.x(c.x()));c.setBrushY(b),c.setHandlePaths(b),c.hasFilter()&&c.redrawBrush(a)}},c.setHandlePaths=function(a){a.selectAll(".resize").append("path").attr("d",c.resizeHandlePath)},c.setBrushY=function(a){a.selectAll("rect").attr("height",f())},c.extendBrush=function(){var a=P.extent();return c.round()&&(a[0]=a.map(c.round())[0],a[1]=a.map(c.round())[1],v.select(".brush").call(P.extent(a))),a},c.brushIsEmpty=function(a){return P.empty()||!a||a[1]<=a[0]},c._brushing=function(){var a=c.extendBrush();if(c.redrawBrush(v),c.brushIsEmpty(a))b.events.trigger(function(){c.filter(null),c.redrawGroup()},b.constants.EVENT_DELAY);else{var d=b.filters.RangedFilter(a[0],a[1]);b.events.trigger(function(){c.replaceFilter(d),c.redrawGroup()},b.constants.EVENT_DELAY)}},c.redrawBrush=function(a){if(Q){c.filter()&&c.brush().empty()&&c.brush().extent(c.filter());var b=a.select("g.brush");b.call(c.brush().x(c.x())),c.setBrushY(b)}c.fadeDeselectedArea()},c.fadeDeselectedArea=function(){},c.resizeHandlePath=function(a){var b=+("e"==a),c=b?1:-1,d=f()/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)},c.clipPadding=function(a){return arguments.length?($=a,c):$},c._preprocessData=function(){},c._doRender=function(){return c.resetSvg(),c._preprocessData(),c._generateG(),h(),i(!0),j(),c},c._doRedraw=function(){return c._preprocessData(),i(!1),c},c._enableMouseZoom=function(){Y=!0,W.x(c.x()).scaleExtent(U).size([c.width(),c.height()]),c.root().call(W)},c._disableMouseZoom=function(){c.root().call(X)},c.focus=function(a){c.x().domain(n(a)?a:y),W.x(c.x()),k()},c.refocused=function(){return T},c.focusChart=function(a){return arguments.length?(F=a,c.on("filtered",function(a){a.filter()?m(a.filter(),F.filter())||b.events.trigger(function(){F.focus(a.filter())}):b.events.trigger(function(){F.x().domain(F.xOriginalDomain())})}),c):F},c.brushOn=function(a){return arguments.length?(Q=a,c):Q},c},b.stackMixin=function(c){function d(a,b){var d=a.accessor||c.valueAccessor();return a.name=String(a.name||b),a.values=a.group.all().map(function(b,e){return{x:c.keyAccessor()(b,e),y:a.hidden?null:d(b,e),data:b,layer:a.name,hidden:a.hidden}}),a.values=a.values.filter(e()),a.values}function e(){if(!c.x())return a.functor(!0);var b=c.x().domain();return c.isOrdinal()?function(){return!0}:function(a){return a.x>=b[0]&&a.x<=b[b.length-1]}}function f(a){var c=j.map(b.pluck("name")).indexOf(a);return j[c]}function g(){return c.data().reduce(function(a,b){return a.concat(b.values)},[])}function h(a){return!a.hidden}var i=a.layout.stack().values(d),j=[],k={},l=!1;return c.stack=function(a,b,d){if(!arguments.length)return j;arguments.length<=2&&(d=b);var e={group:a};return"string"==typeof b&&(e.name=b),"function"==typeof d&&(e.accessor=d),j.push(e),c},b.override(c,"group",function(a,b,d){return arguments.length?(j=[],k={},c.stack(a,b),d&&c.valueAccessor(d),c._group(a,b)):c._group()}),c.hidableStacks=function(a){return arguments.length?(l=a,c):l},c.hideStack=function(a){var b=f(a);return b&&(b.hidden=!0),c},c.showStack=function(a){var b=f(a);return b&&(b.hidden=!1),c},c.getValueAccessorByIndex=function(a){return j[a].accessor||c.valueAccessor()},c.yAxisMin=function(){var d=a.min(g(),function(a){return a.y+a.y0<a.y0?a.y+a.y0:a.y0});return b.utils.subtract(d,c.yAxisPadding())},c.yAxisMax=function(){var d=a.max(g(),function(a){return a.y+a.y0});return b.utils.add(d,c.yAxisPadding())},c.xAxisMin=function(){var d=a.min(g(),b.pluck("x"));return b.utils.subtract(d,c.xAxisPadding())},c.xAxisMax=function(){var d=a.max(g(),b.pluck("x"));return b.utils.add(d,c.xAxisPadding())},b.override(c,"title",function(a,b){return a?"function"==typeof a?c._title(a):a==c._groupName&&"function"==typeof b?c._title(b):"function"!=typeof b?k[a]||c._title():(k[a]=b,c):c._title()}),c.stackLayout=function(a){return arguments.length?(i=a,c):i},c.data(function(){var a=j.filter(h);return a.length?c.stackLayout()(a):[]}),c._ordinalXDomain=function(){return g().map(b.pluck("x"))},c.colorAccessor(function(a){var b=this.layer||this.name||a.name||a.layer;return b}),c.legendables=function(){return j.map(function(a,b){return{chart:c,name:a.name,hidden:a.hidden||!1,color:c.getColor.call(a,a.values,b)}})},c.isLegendableHidden=function(a){var b=f(a.name);return b?b.hidden:!1},c.legendToggle=function(a){l&&(c.isLegendableHidden(a)?c.showStack(a.name):c.hideStack(a.name),b.renderAll(c.chartGroup()))},c},b.capMixin=function(c){var d=1/0,e="Others",f=function(b){var d=a.sum(b,c.valueAccessor()),f=c.group().all(),g=a.sum(f,c.valueAccessor()),h=b.map(c.keyAccessor()),i=f.map(c.keyAccessor()),j=a.set(h),k=i.filter(function(a){return!j.has(a)});return g>d?b.concat([{others:k,key:e,value:g-d}]):b};return c.cappedKeyAccessor=function(a,b){return a.others?a.key:c.keyAccessor()(a,b)},c.cappedValueAccessor=function(a,b){return a.others?a.value:c.valueAccessor()(a,b)},c.data(function(a){if(1/0==d)return c._computeOrderedGroups(a.all());var b=a.top(d);return b=c._computeOrderedGroups(b),f?f(b):b}),c.cap=function(a){return arguments.length?(d=a,c):d},c.othersLabel=function(a){return arguments.length?(e=a,c):e},c.othersGrouper=function(a){return arguments.length?(f=a,c):f},b.override(c,"onClick",function(a){a.others&&c.filter([a.others]),c._onClick(a)}),c},b.bubbleMixin=function(c){var d=.3,e=10;c.BUBBLE_NODE_CLASS="node",c.BUBBLE_CLASS="bubble",c.MIN_RADIUS=10,c=b.colorMixin(c),c.renderLabel(!0),c.renderTitle(!1),c.data(function(a){return a.top(1/0)});var f=a.scale.linear().domain([0,100]),g=function(a){return a.r};c.r=function(a){return arguments.length?(f=a,c):f},c.radiusValueAccessor=function(a){return arguments.length?(g=a,c):g},c.rMin=function(){var b=a.min(c.data(),function(a){return c.radiusValueAccessor()(a)});return b},c.rMax=function(){var b=a.max(c.data(),function(a){return c.radiusValueAccessor()(a)});return b},c.bubbleR=function(a){var b=c.radiusValueAccessor()(a),d=c.r()(b);return(isNaN(d)||0>=b)&&(d=0),d};var h=function(a){return c.label()(a)},i=function(a){return c.bubbleR(a)>e?1:0};c._doRenderLabel=function(a){if(c.renderLabel()){var d=a.select("text");d.empty()&&(d=a.append("text").attr("text-anchor","middle").attr("dy",".3em").on("click",c.onClick)),d.attr("opacity",0).text(h),b.transition(d,c.transitionDuration()).attr("opacity",i)}},c.doUpdateLabels=function(a){if(c.renderLabel()){var d=a.selectAll("text").text(h);b.transition(d,c.transitionDuration()).attr("opacity",i)}};var j=function(a){return c.title()(a)};return c._doRenderTitles=function(a){if(c.renderTitle()){var b=a.select("title");b.empty()&&a.append("title").text(j)}},c.doUpdateTitles=function(a){c.renderTitle()&&a.selectAll("title").text(j)},c.minRadiusWithLabel=function(a){return arguments.length?(e=a,c):e},c.maxBubbleRelativeSize=function(a){return arguments.length?(d=a,c):d},c.fadeDeselectedArea=function(){c.selectAll("g."+c.BUBBLE_NODE_CLASS).each(c.hasFilter()?function(a){c.isSelectedNode(a)?c.highlightSelected(this):c.fadeDeselected(this)}:function(){c.resetHighlight(this)})},c.isSelectedNode=function(a){return c.hasFilter(a.key)},c.onClick=function(a){var d=a.key;b.events.trigger(function(){c.filter(d),b.redrawAll(c.chartGroup())})},c},b.pieChart=function(c,d){function e(){D=D?D:a.min([M.width(),M.height()])/2;var b,c=r(),d=t();if(a.sum(M.data(),M.valueAccessor())?(b=d(M.data()),E.classed(I,!1)):(b=d([{key:J,value:1,others:[J]}]),E.classed(I,!0)),E){var e=E.selectAll("g."+H).data(b);f(e,c,b),l(b,c),p(e),q()}}function f(a,b,c){var d=g(a);h(d,b),i(d),k(c,b)}function g(a){var b=a.enter().append("g").attr("class",function(a,b){return H+" _"+b});return b}function h(a,c){var d=a.append("path").attr("fill",y).on("click",z).attr("d",function(a,b){return A(a,b,c)});b.transition(d,M.transitionDuration(),function(a){a.attrTween("d",w)})}function i(a){M.renderTitle()&&a.append("title").text(function(a){return M.title()(a)})}function j(a,c){b.transition(a,M.transitionDuration()).attr("transform",function(a){return B(a,c)}).attr("text-anchor","middle").text(function(a){var b=a.data;return v(b)||u(a)?"":M.label()(a.data)})}function k(a,b){if(M.renderLabel()){var c=E.selectAll("text."+H).data(a);c.exit().remove();var d=c.enter().append("text").attr("class",function(a,b){var c=H+" _"+b;return F&&(c+=" external"),c}).on("click",z);j(d,b)}}function l(a,b){m(a,b),n(a,b),o(a)}function m(a,c){var d=E.selectAll("g."+H).data(a).select("path").attr("d",function(a,b){return A(a,b,c)});b.transition(d,M.transitionDuration(),function(a){a.attrTween("d",w)}).attr("fill",y)}function n(a,b){if(M.renderLabel()){var c=E.selectAll("text."+H).data(a);j(c,b)}}function o(a){M.renderTitle()&&E.selectAll("g."+H).data(a).select("title").text(function(a){return M.title()(a.data)})}function p(a){a.exit().remove()}function q(){M.selectAll("g."+H).each(M.hasFilter()?function(a){s(a)?M.highlightSelected(this):M.fadeDeselected(this)}:function(){M.resetHighlight(this)})}function r(){return a.svg.arc().outerRadius(D).innerRadius(K)}function s(a){return M.hasFilter(M.cappedKeyAccessor(a.data))}function t(){return a.layout.pie().sort(null).value(M.cappedValueAccessor)}function u(a){var b=a.endAngle-a.startAngle;return isNaN(b)||L>b}function v(a){return 0===M.cappedValueAccessor(a)}function w(b){b.innerRadius=K;var c=this._current;x(c)&&(c={startAngle:0,endAngle:0});var d=a.interpolate(c,b);return this._current=d(0),function(a){return A(d(a),0,r())}}function x(a){return!a||isNaN(a.startAngle)||isNaN(a.endAngle)}function y(a,b){return M.getColor(a.data,b)}function z(a,b){E.attr("class")!=I&&M.onClick(a.data,b)}function A(a,b,c){var d=c(a,b);return d.indexOf("NaN")>=0&&(d="M0,0"),d}function B(b,c){var d;return d=F?a.svg.arc().outerRadius(D+F).innerRadius(D+F).centroid(b):c.centroid(b),isNaN(d[0])||isNaN(d[1])?"translate(0,0)":"translate("+d+")"}function C(b,c){M.selectAll("g.pie-slice").each(function(d){b.name==d.data.key&&a.select(this).classed("highlight",c)})}var D,E,F,G=.5,H="pie-slice",I="empty-chart",J="empty",K=0,L=G,M=b.capMixin(b.colorMixin(b.baseMixin({})));return M.colorAccessor(M.cappedKeyAccessor),M.title(function(a){return M.cappedKeyAccessor(a)+": "+M.cappedValueAccessor(a)}),M.slicesCap=M.cap,M.label(M.cappedKeyAccessor),M.renderLabel(!0),M.transitionDuration(350),M._doRender=function(){return M.resetSvg(),E=M.svg().append("g").attr("transform","translate("+M.cx()+","+M.cy()+")"),e(),M},M.innerRadius=function(a){return arguments.length?(K=a,M):K},M.radius=function(a){return arguments.length?(D=a,M):D},M.cx=function(){return M.width()/2},M.cy=function(){return M.height()/2},M._doRedraw=function(){return e(),M},M.minAngleForLabel=function(a){return arguments.length?(L=a,M):L},M.emptyTitle=function(a){return 0===arguments.length?J:(J=a,M)},M.externalLabels=function(a){return 0===arguments.length?F:(F=a?a:void 0,M)
},M.legendables=function(){return M.data().map(function(a,b){var c={name:a.key,data:a.value,others:a.others,chart:M};return c.color=M.getColor(a,b),c})},M.legendHighlight=function(a){C(a,!0)},M.legendReset=function(a){C(a,!1)},M.legendToggle=function(a){M.onClick({key:a.name,others:a.others})},M.anchor(c,d)},b.barChart=function(c,d){function e(a){return b.utils.safeNumber(Math.abs(m.y()(a.y+a.y0)-m.y()(a.y0)))}function f(a,c,d){var f=a.selectAll("rect.bar").data(d.values,b.pluck("x"));f.enter().append("rect").attr("class","bar").attr("fill",b.pluck("data",m.getColor)).attr("height",0),m.renderTitle()&&f.append("title").text(b.pluck("data",m.title(d.name))),m.isOrdinal()&&f.on("click",h),b.transition(f,m.transitionDuration()).attr("x",function(a){var c=m.x()(a.x);return o&&(c-=j/2),m.isOrdinal()&&(c+=n/2),b.utils.safeNumber(c)}).attr("y",function(a){var c=m.y()(a.y+a.y0);return a.y<0&&(c-=e(a)),b.utils.safeNumber(c)}).attr("width",j).attr("height",function(a){return e(a)}).attr("fill",b.pluck("data",m.getColor)).select("title").text(b.pluck("data",m.title(d.name))),b.transition(f.exit(),m.transitionDuration()).attr("height",0).remove()}function g(){if(void 0===j){var a=m.xUnitCount();j=Math.floor(m.isOrdinal()&&!n?m.x().rangeBand():n?(m.xAxisLength()-(a-1)*n)/a:m.xAxisLength()/(1+m.barPadding())/a),(1/0==j||isNaN(j)||k>j)&&(j=k)}}function h(a){m.onClick(a.data)}function i(b,c){return function(){var d=a.select(this),e=d.attr("fill")==b;return c?!e:e}}var j,k=1,l=2,m=b.stackMixin(b.coordinateGridMixin({})),n=l,o=!1,p=!1;return b.override(m,"rescale",function(){m._rescale(),j=void 0}),b.override(m,"render",function(){m.round()&&o&&!p&&b.logger.warn("By default, brush rounding is disabled if bars are centered. See dc.js bar chart API documentation for details."),m._render()}),m.plotData=function(){var b=m.chartBodyG().selectAll("g.stack").data(m.data());g(),b.enter().append("g").attr("class",function(a,b){return"stack _"+b}),b.each(function(b,c){var d=a.select(this);f(d,c,b)})},m.fadeDeselectedArea=function(){var a=m.chartBodyG().selectAll("rect.bar"),c=m.brush().extent();if(m.isOrdinal())m.hasFilter()?(a.classed(b.constants.SELECTED_CLASS,function(a){return m.hasFilter(a.x)}),a.classed(b.constants.DESELECTED_CLASS,function(a){return!m.hasFilter(a.x)})):(a.classed(b.constants.SELECTED_CLASS,!1),a.classed(b.constants.DESELECTED_CLASS,!1));else if(m.brushIsEmpty(c))a.classed(b.constants.DESELECTED_CLASS,!1);else{var d=c[0],e=c[1];a.classed(b.constants.DESELECTED_CLASS,function(a){return a.x<d||a.x>=e})}},m.centerBar=function(a){return arguments.length?(o=a,m):o},m.barPadding=function(a){return arguments.length?(m._rangeBandPadding(a),n=0,m):m._rangeBandPadding()},m.outerPadding=m._outerRangeBandPadding,m.gap=function(a){return arguments.length?(n=a,m):n},m.extendBrush=function(){var a=m.brush().extent();return!m.round()||o&&!p||(a[0]=a.map(m.round())[0],a[1]=a.map(m.round())[1],m.chartBodyG().select(".brush").call(m.brush().extent(a))),a},m.alwaysUseRounding=function(a){return arguments.length?(p=a,m):p},m.legendHighlight=function(a){m.isLegendableHidden(a)||m.g().selectAll("rect.bar").classed("highlight",i(a.color)).classed("fadeout",i(a.color,!0))},m.legendReset=function(){m.g().selectAll("rect.bar").classed("highlight",!1).classed("fadeout",!1)},b.override(m,"xAxisMax",function(){var a=this._xAxisMax();if("resolution"in m.xUnits()){var b=m.xUnits().resolution;a+=b}return a}),m.anchor(c,d)},b.lineChart=function(c,d){function e(a,b){return y.getColor.call(a,a.values,b)}function f(c,d){var f=a.svg.line().x(function(a){return y.x()(a.x)}).y(function(a){return y.y()(a.y+a.y0)}).interpolate(E).tension(F);q&&f.defined(q);var g=c.append("path").attr("class","line").attr("stroke",e);r&&g.attr("stroke-dasharray",r),b.transition(d.select("path.line"),y.transitionDuration()).attr("stroke",e).attr("d",function(a){return h(f(a.values))})}function g(c,d){if(z){var f=a.svg.area().x(function(a){return y.x()(a.x)}).y(function(a){return y.y()(a.y+a.y0)}).y0(function(a){return y.y()(a.y0)}).interpolate(E).tension(F);q&&f.defined(q),c.append("path").attr("class","area").attr("fill",e).attr("d",function(a){return h(f(a.values))}),b.transition(d.select("path.area"),y.transitionDuration()).attr("fill",e).attr("d",function(a){return h(f(a.values))})}}function h(a){return!a||a.indexOf("NaN")>=0?"M0,0":a}function i(c,d){if(!y.brushOn()){var e=t+"-list",f=c.select("g."+e);f.empty()&&(f=c.append("g").attr("class",e)),d.each(function(c,d){var e=c.values;q&&(e=e.filter(q));var g=f.select("g."+t+"._"+d);g.empty()&&(g=f.append("g").attr("class",t+" _"+d)),j(g);var h=g.selectAll("circle."+u).data(e,b.pluck("x"));h.enter().append("circle").attr("class",u).attr("r",m()).attr("fill",y.getColor).style("fill-opacity",C).style("stroke-opacity",D).on("mousemove",function(){var b=a.select(this);k(b),l(b,g)}).on("mouseout",function(){var b=a.select(this);n(b),o(g)}).append("title").text(b.pluck("data",y.title(c.name))),h.attr("cx",function(a){return b.utils.safeNumber(y.x()(a.x))}).attr("cy",function(a){return b.utils.safeNumber(y.y()(a.y+a.y0))}).attr("fill",y.getColor).select("title").text(b.pluck("data",y.title(c.name))),h.exit().remove()})}}function j(a){var b=a.select("path."+v).empty()?a.append("path").attr("class",v):a.select("path."+v);b.style("display","none").attr("stroke-dasharray","5,5");var c=a.select("path."+w).empty()?a.append("path").attr("class",w):a.select("path."+w);c.style("display","none").attr("stroke-dasharray","5,5")}function k(a){return a.style("fill-opacity",.8),a.style("stroke-opacity",.8),a.attr("r",A),a}function l(a,b){var c=a.attr("cx"),d=a.attr("cy"),e=y._yAxisX()-y.margins().left,f="M"+e+" "+d+"L"+c+" "+d,g="M"+c+" "+y.yAxisHeight()+"L"+c+" "+d;b.select("path."+v).style("display","").attr("d",f),b.select("path."+w).style("display","").attr("d",g)}function m(){return B||A}function n(a){a.style("fill-opacity",C).style("stroke-opacity",D).attr("r",m())}function o(a){a.select("path."+v).style("display","none"),a.select("path."+w).style("display","none")}function p(b,c,d){return function(){var e=a.select(this),f=e.attr("stroke")==b&&e.attr("stroke-dasharray")==(c instanceof Array?c.join(","):null)||e.attr("fill")==b;return d?!f:f}}var q,r,s=5,t="dc-tooltip",u="dot",v="yRef",w="xRef",x=1e-6,y=b.stackMixin(b.coordinateGridMixin({})),z=!1,A=s,B=null,C=x,D=x,E="linear",F=.7;return y.transitionDuration(500),y._rangeBandPadding(1),y.plotData=function(){var a=y.chartBodyG(),b=a.selectAll("g.stack-list");b.empty()&&(b=a.append("g").attr("class","stack-list"));var c=b.selectAll("g.stack").data(y.data()),d=c.enter().append("g").attr("class",function(a,b){return"stack _"+b});f(d,c),g(d,c),i(a,c)},y.interpolate=function(a){return arguments.length?(E=a,y):E},y.tension=function(a){return arguments.length?(F=a,y):F},y.defined=function(a){return arguments.length?(q=a,y):q},y.dashStyle=function(a){return arguments.length?(r=a,y):r},y.renderArea=function(a){return arguments.length?(z=a,y):z},y.dotRadius=function(a){return arguments.length?(A=a,y):A},y.renderDataPoints=function(a){return arguments.length?(a?(C=a.fillOpacity||.8,D=a.strokeOpacity||.8,B=a.radius||2):(C=x,D=x,B=null),y):{fillOpacity:C,strokeOpacity:D,radius:B}},y.legendHighlight=function(a){y.isLegendableHidden(a)||y.g().selectAll("path.line, path.area").classed("highlight",p(a.color,a.dashstyle)).classed("fadeout",p(a.color,a.dashstyle,!0))},y.legendReset=function(){y.g().selectAll("path.line, path.area").classed("highlight",!1).classed("fadeout",!1)},b.override(y,"legendables",function(){var a=y._legendables();return r?a.map(function(a){return a.dashstyle=r,a}):a}),y.anchor(c,d)},b.dataCount=function(c,d){var e=a.format(",d"),f=b.baseMixin({}),g={some:"",all:""};return f.html=function(a){return arguments.length?(a.all&&(g.all=a.all),a.some&&(g.some=a.some),f):g},f._doRender=function(){var a=f.dimension().size(),b=f.group().value(),c=e(a),d=e(b);return a===b&&""!==g.all?f.root().html(g.all.replace("%total-count",c).replace("%filter-count",d)):""!==g.some?f.root().html(g.some.replace("%total-count",c).replace("%filter-count",d)):(f.selectAll(".total-count").text(c),f.selectAll(".filter-count").text(d)),f},f._doRedraw=function(){return f._doRender()},f.anchor(c,d)},b.dataTable=function(c,d){function e(){var a=l.root().selectAll("tbody").data(f(),function(a){return l.keyAccessor()(a)}),b=a.enter().append("tbody");return b.append("tr").attr("class",k).append("td").attr("class",h).attr("colspan",n.length).html(function(a){return l.keyAccessor()(a)}),a.exit().remove(),b}function f(){var b=l.dimension().top(m);return a.nest().key(l.group()).sortKeys(p).entries(b.sort(function(a,b){return p(o(a),o(b))}))}function g(a){var b=a.order().selectAll("tr."+i).data(function(a){return a.values}),c=b.enter().append("tr").attr("class",i);return n.forEach(function(a,b){c.append("td").attr("class",j+" _"+b).html(a)}),b.exit().remove(),b}var h="dc-table-label",i="dc-table-row",j="dc-table-column",k="dc-table-group",l=b.baseMixin({}),m=25,n=[],o=function(a){return a},p=a.ascending;return l._doRender=function(){return l.selectAll("tbody").remove(),g(e()),l},l._doRedraw=function(){return l._doRender()},l.size=function(a){return arguments.length?(m=a,l):m},l.columns=function(a){return arguments.length?(n=a,l):n},l.sortBy=function(a){return arguments.length?(o=a,l):o},l.order=function(a){return arguments.length?(p=a,l):p},l.anchor(c,d)},b.dataGrid=function(c,d){function e(){var a=l.root().selectAll("div."+k).data(f(),function(a){return l.keyAccessor()(a)}),b=a.enter().append("div").attr("class",k);return q&&b.html(function(a){return q(a)}),a.exit().remove(),b}function f(){var b=l.dimension().top(m);return a.nest().key(l.group()).sortKeys(p).entries(b.sort(function(a,b){return p(o(a),o(b))}))}function g(a){var b=a.order().selectAll("div."+i).data(function(a){return a.values});return b.enter().append("div").attr("class",i).html(function(a){return n(a)}),b.exit().remove(),b}var h="dc-grid-label",i="dc-grid-item",j="dc-grid-group",k="dc-grid-top",l=b.baseMixin({}),m=999,n=function(a){return"you need to provide an html() handling param: "+JSON.stringify(a)},o=function(a){return a},p=a.ascending,q=function(a){return"<div class='"+j+"'><h1 class='"+h+"'>"+l.keyAccessor()(a)+"</h1></div>"};return l._doRender=function(){return l.selectAll("div."+k).remove(),g(e()),l},l._doRedraw=function(){return l._doRender()},l.size=function(a){return arguments.length?(m=a,l):m},l.html=function(a){return arguments.length?(n=a,l):n},l.htmlGroup=function(a){return arguments.length?(q=a,l):q},l.sortBy=function(a){return arguments.length?(o=a,l):o},l.order=function(a){return arguments.length?(p=a,l):p},l.anchor(c,d)},b.bubbleChart=function(a,c){function d(a){var c=a.enter().append("g");c.attr("class",i.BUBBLE_NODE_CLASS).attr("transform",k).append("circle").attr("class",function(a,b){return i.BUBBLE_CLASS+" _"+b}).on("click",i.onClick).attr("fill",i.getColor).attr("r",0),b.transition(a,i.transitionDuration()).selectAll("circle."+i.BUBBLE_CLASS).attr("r",function(a){return i.bubbleR(a)}).attr("opacity",function(a){return i.bubbleR(a)>0?1:0}),i._doRenderLabel(c),i._doRenderTitles(c)}function e(a){b.transition(a,i.transitionDuration()).attr("transform",k).selectAll("circle."+i.BUBBLE_CLASS).attr("fill",i.getColor).attr("r",function(a){return i.bubbleR(a)}).attr("opacity",function(a){return i.bubbleR(a)>0?1:0}),i.doUpdateLabels(a),i.doUpdateTitles(a)}function f(a){a.exit().remove()}function g(a){var b=i.x()(i.keyAccessor()(a));return isNaN(b)&&(b=0),b}function h(a){var b=i.y()(i.valueAccessor()(a));return isNaN(b)&&(b=0),b}var i=b.bubbleMixin(b.coordinateGridMixin({})),j=!1;i.transitionDuration(750);var k=function(a){return"translate("+g(a)+","+h(a)+")"};return i.elasticRadius=function(a){return arguments.length?(j=a,i):j},i.plotData=function(){j&&i.r().domain([i.rMin(),i.rMax()]),i.r().range([i.MIN_RADIUS,i.xAxisLength()*i.maxBubbleRelativeSize()]);var a=i.chartBodyG().selectAll("g."+i.BUBBLE_NODE_CLASS).data(i.data(),function(a){return a.key});d(a),e(a),f(a),i.fadeDeselectedArea()},i.renderBrush=function(){},i.redrawBrush=function(){i.fadeDeselectedArea()},i.anchor(a,c)},b.compositeChart=function(c,d){function e(){(void 0===u.rightY()||u.elasticY())&&(u.rightY(a.scale.linear()),u.rightY().domain([l(),o()]).rangeRound([u.yAxisHeight(),0])),u.rightY().range([u.yAxisHeight(),0]),u.rightYAxis(u.rightYAxis().scale(u.rightY())),u.rightYAxis().orient("right")}function f(){(void 0===u.y()||u.elasticY())&&(u.y(a.scale.linear()),u.y().domain([k(),n()]).rangeRound([u.yAxisHeight(),0])),u.y().range([u.yAxisHeight(),0]),u.yAxis(u.yAxis().scale(u.y())),u.yAxis().orient("left")}function g(a,b){a._generateG(u.g()),a.g().attr("class",s+" _"+b)}function h(){return v.filter(function(a){return!a.useRightYAxis()})}function i(){return v.filter(function(a){return a.useRightYAxis()})}function j(a){return a.map(function(a){return a.yAxisMin()})}function k(){return a.min(j(h()))}function l(){return a.min(j(i()))}function m(a){return a.map(function(a){return a.yAxisMax()})}function n(){return b.utils.add(a.max(m(h())),u.yAxisPadding())}function o(){return b.utils.add(a.max(m(i())),u.yAxisPadding())}function p(){return v.map(function(a){return a.xAxisMin()})}function q(){return v.map(function(a){return a.xAxisMax()})}var r,s="sub",t=12,u=b.coordinateGridMixin({}),v=[],w={},x=!1,y=!0,z=a.svg.axis(),A=0,B=t,C=!1;return u._mandatoryAttributes([]),u.transitionDuration(500),b.override(u,"_generateG",function(){for(var a=this.__generateG(),b=0;b<v.length;++b){var c=v[b];g(c,b),c.dimension()||c.dimension(u.dimension()),c.group()||c.group(u.group()),c.chartGroup(u.chartGroup()),c.svg(u.svg()),c.xUnits(u.xUnits()),c.transitionDuration(u.transitionDuration()),c.brushOn(u.brushOn())}return a}),u._brushing=function(){for(var a=u.extendBrush(),b=u.brushIsEmpty(a),c=0;c<v.length;++c)v[c].filter(null),b||v[c].filter(a)},u._prepareYAxis=function(){0!==h().length&&f(),0!==i().length&&e(),h().length>0&&!C?u._renderHorizontalGridLinesForAxis(u.g(),u.y(),u.yAxis()):i().length>0&&u._renderHorizontalGridLinesForAxis(u.g(),r,z)},u.renderYAxis=function(){0!==h().length&&(u.renderYAxisAt("y",u.yAxis(),u.margins().left),u.renderYAxisLabel("y",u.yAxisLabel(),-90)),0!==i().length&&(u.renderYAxisAt("yr",u.rightYAxis(),u.width()-u.margins().right),u.renderYAxisLabel("yr",u.rightYAxisLabel(),90,u.width()-B))},u.plotData=function(){for(var a=0;a<v.length;++a){var b=v[a];b.g()||g(b,a),x&&b.colors(u.colors()),b.x(u.x()),b.xAxis(u.xAxis()),b.useRightYAxis()?(b.y(u.rightY()),b.yAxis(u.rightYAxis())):(b.y(u.y()),b.yAxis(u.yAxis())),b.plotData(),b._activateRenderlets()}},u.useRightAxisGridLines=function(a){return arguments?(C=a,u):C},u.childOptions=function(a){return arguments.length?(w=a,v.forEach(function(a){a.options(w)}),u):w},u.fadeDeselectedArea=function(){for(var a=0;a<v.length;++a){var b=v[a];b.brush(u.brush()),b.fadeDeselectedArea()}},u.rightYAxisLabel=function(a,b){return arguments.length?(A=a,u.margins().right-=B,B=void 0===b?t:b,u.margins().right+=B,u):A},u.compose=function(a){return v=a,v.forEach(function(a){a.height(u.height()),a.width(u.width()),a.margins(u.margins()),y&&a.title(u.title()),a.options(w)}),u},u.children=function(){return v},u.shareColors=function(a){return arguments.length?(x=a,u):x},u.shareTitle=function(a){return arguments.length?(y=a,u):y},u.rightY=function(a){return arguments.length?(r=a,u):r},delete u.yAxisMin,delete u.yAxisMax,b.override(u,"xAxisMin",function(){return b.utils.subtract(a.min(p()),u.xAxisPadding())}),b.override(u,"xAxisMax",function(){return b.utils.add(a.max(q()),u.xAxisPadding())}),u.legendables=function(){return v.reduce(function(a,b){return x&&b.colors(u.colors()),a.push.apply(a,b.legendables()),a},[])},u.legendHighlight=function(a){for(var b=0;b<v.length;++b){var c=v[b];c.legendHighlight(a)}},u.legendReset=function(a){for(var b=0;b<v.length;++b){var c=v[b];c.legendReset(a)}},u.legendToggle=function(){console.log("composite should not be getting legendToggle itself")},u.rightYAxis=function(a){return arguments.length?(z=a,u):z},u.anchor(c,d)},b.seriesChart=function(c,d){function e(b,c){return a.ascending(i.keyAccessor()(b),i.keyAccessor()(c))}function f(a){j[a].g()&&j[a].g().remove(),delete j[a]}function g(){Object.keys(j).map(f),j={}}var h,i=b.compositeChart(c,d),j={},k=b.lineChart,l=a.ascending,m=e;return i._mandatoryAttributes().push("seriesAccessor","chart"),i.shareColors(!0),i._preprocessData=function(){var b,c=[],e=a.nest().key(h);l&&e.sortKeys(l),m&&e.sortValues(m);var g=e.entries(i.data()),n=g.map(function(e,f){var g=j[e.key]||k.call(i,i,d,e.key,f);return j[e.key]||(b=!0),j[e.key]=g,c.push(e.key),g.dimension(i.dimension()).group({all:a.functor(e.values)},e.key).keyAccessor(i.keyAccessor()).valueAccessor(i.valueAccessor()).brushOn(i.brushOn())});Object.keys(j).filter(function(a){return-1===c.indexOf(a)}).forEach(function(a){f(a),b=!0}),i._compose(n),b&&i.legend()&&i.legend().render()},i.chart=function(a){return arguments.length?(k=a,g(),i):k},i.seriesAccessor=function(a){return arguments.length?(h=a,g(),i):h},i.seriesSort=function(a){return arguments.length?(l=a,g(),i):l},i.valueSort=function(a){return arguments.length?(m=a,g(),i):m},i._compose=i.compose,delete i.compose,i},b.geoChoroplethChart=function(c,d){function e(a){var b=f();if(g(a)){var c=h(a);n(c,a,b),o(c,a,b)}}function f(){for(var a={},b=p.data(),c=0;c<b.length;++c)a[p.keyAccessor()(b[c])]=p.valueAccessor()(b[c]);return a}function g(a){return m(a).keyAccessor}function h(a){var c=p.svg().selectAll(i(a)).classed("selected",function(b){return j(a,b)}).classed("deselected",function(b){return k(a,b)}).attr("class",function(c){var d=m(a).name,e=b.utils.nameToId(m(a).keyAccessor(c)),f=d+" "+e;return j(a,c)&&(f+=" selected"),k(a,c)&&(f+=" deselected"),f});return c}function i(a){return"g.layer"+a+" g."+m(a).name}function j(a,b){return p.hasFilter()&&p.hasFilter(l(a,b))}function k(a,b){return p.hasFilter()&&!p.hasFilter(l(a,b))}function l(a,b){return m(a).keyAccessor(b)}function m(a){return s[a]}function n(c,d,e){var f=c.select("path").attr("fill",function(){var b=a.select(this).attr("fill");return b?b:"none"}).on("click",function(a){return p.onClick(a,d)});b.transition(f,p.transitionDuration()).attr("fill",function(a,b){return p.getColor(e[m(d).keyAccessor(a)],b)})}function o(a,b,c){p.renderTitle()&&a.selectAll("title").text(function(a){var d=l(b,a),e=c[d];return p.title()({key:d,value:e})})}var p=b.colorMixin(b.baseMixin({}));p.colorAccessor(function(a){return a||0});var q,r=a.geo.path(),s=[];return p._doRender=function(){p.resetSvg();for(var a=0;a<s.length;++a){var b=p.svg().append("g").attr("class","layer"+a),c=b.selectAll("g."+m(a).name).data(m(a).data).enter().append("g").attr("class",m(a).name);c.append("path").attr("fill","white").attr("d",r),c.append("title"),e(a)}q=!1},p.onClick=function(a,c){var d=m(c).keyAccessor(a);b.events.trigger(function(){p.filter(d),p.redrawGroup()})},p._doRedraw=function(){for(var a=0;a<s.length;++a)e(a),q&&p.svg().selectAll("g."+m(a).name+" path").attr("d",r);q=!1},p.overlayGeoJson=function(a,b,c){for(var d=0;d<s.length;++d)if(s[d].name==b)return s[d].data=a,s[d].keyAccessor=c,p;return s.push({name:b,data:a,keyAccessor:c}),p},p.projection=function(a){return r.projection(a),q=!0,p},p.geoJsons=function(){return s},p.geoPath=function(){return r},p.removeGeoJson=function(a){for(var b=[],c=0;c<s.length;++c){var d=s[c];d.name!=a&&b.push(d)}return s=b,p},p.anchor(c,d)},b.bubbleOverlay=function(c,d){function e(){return j=n.select("g."+k),j.empty()&&(j=n.svg().append("g").attr("class",k)),j}function f(){var a=g();o.forEach(function(c){var d=h(c,a),e=d.select("circle."+m);e.empty()&&(e=d.append("circle").attr("class",m).attr("r",0).attr("fill",n.getColor).on("click",n.onClick)),b.transition(e,n.transitionDuration()).attr("r",function(a){return n.bubbleR(a)}),n._doRenderLabel(d),n._doRenderTitles(d)})}function g(){var a={};return n.data().forEach(function(b){a[n.keyAccessor()(b)]=b}),a}function h(a,c){var d=l+" "+b.utils.nameToId(a.name),e=j.select("g."+b.utils.nameToId(a.name));return e.empty()&&(e=j.append("g").attr("class",d).attr("transform","translate("+a.x+","+a.y+")")),e.datum(c[a.name]),e}function i(){var a=g();o.forEach(function(c){var d=h(c,a),e=d.select("circle."+m);b.transition(e,n.transitionDuration()).attr("r",function(a){return n.bubbleR(a)}).attr("fill",n.getColor),n.doUpdateLabels(d),n.doUpdateTitles(d)})}var j,k="bubble-overlay",l="node",m="bubble",n=b.bubbleMixin(b.baseMixin({})),o=[];return n.transitionDuration(750),n.radiusValueAccessor(function(a){return a.value}),n.point=function(a,b,c){return o.push({name:a,x:b,y:c}),n},n._doRender=function(){return j=e(),n.r().range([n.MIN_RADIUS,n.width()*n.maxBubbleRelativeSize()]),f(),n.fadeDeselectedArea(),n},n._doRedraw=function(){return i(),n.fadeDeselectedArea(),n},n.debug=function(c){if(c){var d=n.select("g."+b.constants.DEBUG_GROUP_CLASS);d.empty()&&(d=n.svg().append("g").attr("class",b.constants.DEBUG_GROUP_CLASS));var e=d.append("text").attr("x",10).attr("y",20);d.append("rect").attr("width",n.width()).attr("height",n.height()).on("mousemove",function(){var b=a.mouse(d.node()),c=b[0]+", "+b[1];e.text(c)})}else n.selectAll(".debug").remove();return n},n.anchor(c,d),n},b.rowChart=function(c,d){function e(){if(!s||t){var b=a.extent(u,D.cappedValueAccessor);b[0]>0&&(b[0]=0),s=a.scale.linear().domain(b).range([0,D.effectiveWidth()])}E.scale(s)}function f(){var a=r.select("g.axis");e(),a.empty()&&(a=r.append("g").attr("class","axis").attr("transform","translate(0, "+D.effectiveHeight()+")")),b.transition(a,D.transitionDuration()).call(E)}function g(){r.selectAll("g.tick").select("line.grid-line").remove(),r.selectAll("g.tick").append("line").attr("class","grid-line").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",function(){return-D.effectiveHeight()})}function h(){u=D.data(),f(),g();var a=r.selectAll("g."+A).data(u);i(a),j(a),k(a)}function i(a){var b=a.enter().append("g").attr("class",function(a,b){return A+" _"+b});b.append("rect").attr("width",0),m(b),n(a)}function j(a){a.exit().remove()}function k(a){var c,d=u.length;c=z?z:(D.effectiveHeight()-(d+1)*y)/d;var e=a.attr("transform",function(a,b){return"translate(0,"+((b+1)*y+b*c)+")"}).select("rect").attr("height",c).attr("fill",D.getColor).on("click",o).classed("deselected",function(a){return D.hasFilter()?!q(a):!1}).classed("selected",function(a){return D.hasFilter()?q(a):!1});b.transition(e,D.transitionDuration()).attr("width",function(a){var b=s(s(0)==-1/0?1:0);return Math.abs(b-s(D.valueAccessor()(a)))}).attr("transform",p),l(a),n(a)}function l(a){D.renderTitle()&&(a.selectAll("title").remove(),a.append("title").text(D.title()))}function m(a){D.renderLabel()&&a.append("text").on("click",o),D.renderTitleLabel()&&a.append("text").attr("class",B).on("click",o)}function n(a){if(D.renderLabel()){var c=a.select("text").attr("x",v).attr("y",w).on("click",o).attr("class",function(a,b){return A+" _"+b}).text(function(a){return D.label()(a)});b.transition(c,D.transitionDuration()).attr("transform",p)}if(D.renderTitleLabel()){var d=a.select("."+B).attr("x",D.effectiveWidth()-x).attr("y",w).attr("text-anchor","end").on("click",o).attr("class",function(a,b){return B+" _"+b}).text(function(a){return D.title()(a)});b.transition(d,D.transitionDuration()).attr("transform",p)}}function o(a){D.onClick(a)}function p(a){var b=s(D.cappedValueAccessor(a)),c=s(0),d=b>c?c:b;return"translate("+d+",0)"}function q(a){return D.hasFilter(D.cappedKeyAccessor(a))}var r,s,t,u,v=10,w=15,x=2,y=5,z=!1,A="row",B="titlerow",C=!1,D=b.capMixin(b.marginMixin(b.colorMixin(b.baseMixin({})))),E=a.svg.axis().orient("bottom");return D.rowsCap=D.cap,D._doRender=function(){return D.resetSvg(),r=D.svg().append("g").attr("transform","translate("+D.margins().left+","+D.margins().top+")"),h(),D},D.title(function(a){return D.cappedKeyAccessor(a)+": "+D.cappedValueAccessor(a)}),D.label(D.cappedKeyAccessor),D.x=function(a){return arguments.length?(s=a,D):s},D.renderTitleLabel=function(a){return arguments.length?(C=a,D):C},D._doRedraw=function(){return h(),D},D.xAxis=function(){return E},D.fixedBarHeight=function(a){return arguments.length?(z=a,D):z},D.gap=function(a){return arguments.length?(y=a,D):y},D.elasticX=function(a){return arguments.length?(t=a,D):t},D.labelOffsetX=function(a){return arguments.length?(v=a,D):v},D.labelOffsetY=function(a){return arguments.length?(w=a,D):w},D.titleLabelOffsetX=function(a){return arguments.length?(x=a,D):x},D.anchor(c,d)},b.legend=function(){function a(){return j+i}var c,d,e=2,f={},g=0,h=0,i=12,j=5,k=!1,l=560,m=70;return f.parent=function(a){return arguments.length?(c=a,f):c},f.render=function(){c.svg().select("g.dc-legend").remove(),d=c.svg().append("g").attr("class","dc-legend").attr("transform","translate("+g+","+h+")");var f=c.legendables(),j=d.selectAll("g.dc-legend-item").data(f).enter().append("g").attr("class","dc-legend-item").on("mouseover",function(a){c.legendHighlight(a)}).on("mouseout",function(a){c.legendReset(a)}).on("click",function(a){a.chart.legendToggle(a)});d.selectAll("g.dc-legend-item").classed("fadeout",function(a){return a.chart.isLegendableHidden(a)}),f.some(b.pluck("dashstyle"))?j.append("line").attr("x1",0).attr("y1",i/2).attr("x2",i).attr("y2",i/2).attr("stroke-width",2).attr("stroke-dasharray",b.pluck("dashstyle")).attr("stroke",b.pluck("color")):j.append("rect").attr("width",i).attr("height",i).attr("fill",function(a){return a?a.color:"blue"}),j.append("text").text(b.pluck("name")).attr("x",i+e).attr("y",function(){return i/2+(this.clientHeight?this.clientHeight:13)/2-2});var n=0,o=0;j.attr("transform",function(b,c){if(k){var d="translate("+n+","+o*a()+")";return n+m>=l?(++o,n=0):n+=m,d}return"translate(0,"+c*a()+")"})},f.x=function(a){return arguments.length?(g=a,f):g},f.y=function(a){return arguments.length?(h=a,f):h},f.gap=function(a){return arguments.length?(j=a,f):j},f.itemHeight=function(a){return arguments.length?(i=a,f):i},f.horizontal=function(a){return arguments.length?(k=a,f):k},f.legendWidth=function(a){return arguments.length?(l=a,f):l},f.itemWidth=function(a){return arguments.length?(m=a,f):m},f},b.scatterPlot=function(c,d){function e(c,d){var e=g.selectAll(".chart-body path.symbol").filter(function(){return c(a.select(this))}),f=h.size();h.size(Math.pow(d,2)),b.transition(e,g.transitionDuration()).attr("d",h),h.size(f)}function f(a){var c=g.selectAll(".chart-body path.symbol").each(function(b){this.filtered=a&&a.isFiltered(b.key)});b.transition(c,g.transitionDuration()).attr("d",h)}var g=b.coordinateGridMixin({}),h=a.svg.symbol(),i=g.keyAccessor();g.keyAccessor(function(a){return i(a)[0]}),g.valueAccessor(function(a){return i(a)[1]}),g.colorAccessor(function(){return g._groupName});var j=function(a){return"translate("+g.x()(g.keyAccessor()(a))+","+g.y()(g.valueAccessor()(a))+")"},k=3,l=5,m=0;return h.size(function(a){return 0===a.value?m:this.filtered?Math.pow(l,2):Math.pow(k,2)}),b.override(g,"_filter",function(a){return arguments.length?g.__filter(b.filters.RangedTwoDimensionalFilter(a)):g.__filter()}),g.plotData=function(){var a=g.chartBodyG().selectAll("path.symbol").data(g.data());a.enter().append("path").attr("class","symbol").attr("opacity",0).attr("fill",g.getColor).attr("transform",j),b.transition(a,g.transitionDuration()).attr("opacity",function(a){return a.value?1:0}).attr("fill",g.getColor).attr("transform",j).attr("d",h),b.transition(a.exit(),g.transitionDuration()).attr("opacity",0).remove()},g.symbol=function(a){return arguments.length?(h.type(a),g):h.type()},g.symbolSize=function(a){return arguments.length?(k=a,g):k},g.highlightedSize=function(a){return arguments.length?(l=a,g):l},g.hiddenSize=function(a){return arguments.length?(m=a,g):m},g.legendables=function(){return[{chart:g,name:g._groupName,color:g.getColor()}]},g.legendHighlight=function(b){e(function(a){return a.attr("fill")==b.color},l),g.selectAll(".chart-body path.symbol").filter(function(){return a.select(this).attr("fill")!=b.color}).classed("fadeout",!0)},g.legendReset=function(b){e(function(a){return a.attr("fill")==b.color},k),g.selectAll(".chart-body path.symbol").filter(function(){return a.select(this).attr("fill")!=b.color}).classed("fadeout",!1)},g.setHandlePaths=function(){},g.extendBrush=function(){var a=g.brush().extent();return g.round()&&(a[0]=a[0].map(g.round()),a[1]=a[1].map(g.round()),g.g().select(".brush").call(g.brush().extent(a))),a},g.brushIsEmpty=function(a){return g.brush().empty()||!a||a[0][0]>=a[1][0]||a[0][1]>=a[1][1]},g._brushing=function(){var a=g.extendBrush();if(g.redrawBrush(g.g()),g.brushIsEmpty(a))b.events.trigger(function(){g.filter(null),b.redrawAll(g.chartGroup())}),f(!1);else{var c=b.filters.RangedTwoDimensionalFilter(a);b.events.trigger(function(){g.filter(null),g.filter(c),b.redrawAll(g.chartGroup())},b.constants.EVENT_DELAY),f(c)}},g.setBrushY=function(a){a.call(g.brush().y(g.y()))},g.anchor(c,d)},b.numberDisplay=function(c,d){var e="number-display",f=a.format(".2s"),g=b.baseMixin({}),h={one:"",some:"",none:""};return g._mandatoryAttributes(["group"]),g.html=function(a){return arguments.length?(a.none?h.none=a.none:a.one?h.none=a.one:a.some&&(h.none=a.some),a.one?h.one=a.one:a.some&&(h.one=a.some),a.some?h.some=a.some:a.one&&(h.some=a.one),g):h},g.value=function(){return g.data()},g.data(function(a){var b=a.value?a.value():a.top(1)[0];return g.valueAccessor()(b)}),g.transitionDuration(250),g._doRender=function(){var b=g.value(),c=g.selectAll("."+e);c.empty()&&(c=c.data([0]).enter().append("span").attr("class",e)),c.transition().duration(g.transitionDuration()).ease("quad-out-in").tween("text",function(){var c=a.interpolateNumber(this.lastValue||0,b);return this.lastValue=b,function(a){var d=null,e=g.formatNumber()(c(a));0===b&&""!==h.none?d=h.none:1===b&&""!==h.one?d=h.one:""!==h.some&&(d=h.some),this.innerHTML=d?d.replace("%number",e):e}})},g._doRedraw=function(){return g._doRender()},g.formatNumber=function(a){return arguments.length?(f=a,g):f},g.anchor(c,d)},b.heatMap=function(c,d){function e(a,c){var d=m.selectAll(".box-group").filter(function(b){return b.key[a]==c}),e=d.filter(function(a){return!m.hasFilter(a.key)});b.events.trigger(function(){e.empty()?d.each(function(a){m.filter(a.key)}):e.each(function(a){m.filter(a.key)}),m.redrawGroup()})}function f(a,b,c){return!b||c[b-1]!=a}var g,h,i,j=6.75,k=j,l=j,m=b.colorMixin(b.marginMixin(b.baseMixin({})));m._mandatoryAttributes(["group"]),m.title(m.colorAccessor());var n=function(a){e(0,a)},o=function(a){e(1,a)},p=function(a){var c=a.key;b.events.trigger(function(){m.filter(c),m.redrawGroup()})};return b.override(m,"filter",function(a){return arguments.length?m._filter(b.filters.TwoDimensionalFilter(a)):m._filter()}),m.rows=function(b){if(arguments.length)return i=b,m;if(i)return i;var c=m.data().map(m.valueAccessor());return c.sort(a.ascending),a.scale.ordinal().domain(c.filter(f))},m.cols=function(b){if(arguments.length)return h=b,m;if(h)return h;var c=m.data().map(m.keyAccessor());return c.sort(a.ascending),a.scale.ordinal().domain(c.filter(f))},m._doRender=function(){return m.resetSvg(),g=m.svg().append("g").attr("class","heatmap").attr("transform","translate("+m.margins().left+","+m.margins().top+")"),m._doRedraw()},m._doRedraw=function(){var a=m.rows(),c=m.cols(),d=a.domain().length,e=c.domain().length,f=Math.floor(m.effectiveWidth()/e),h=Math.floor(m.effectiveHeight()/d);c.rangeRoundBands([0,m.effectiveWidth()]),a.rangeRoundBands([m.effectiveHeight(),0]);var i=g.selectAll("g.box-group").data(m.data(),function(a,b){return m.keyAccessor()(a,b)+"\x00"+m.valueAccessor()(a,b)}),j=i.enter().append("g").attr("class","box-group");j.append("rect").attr("class","heat-box").attr("fill","white").on("click",m.boxOnClick()),j.append("title").text(m.title()),b.transition(i.selectAll("rect"),m.transitionDuration()).attr("x",function(a,b){return c(m.keyAccessor()(a,b))}).attr("y",function(b,c){return a(m.valueAccessor()(b,c))}).attr("rx",k).attr("ry",l).attr("fill",m.getColor).attr("width",f).attr("height",h),i.exit().remove();
var n=g.selectAll("g.cols");n.empty()&&(n=g.append("g").attr("class","cols axis")),n.selectAll("text").data(c.domain()).enter().append("text").attr("x",function(a){return c(a)+f/2}).style("text-anchor","middle").attr("y",m.effectiveHeight()).attr("dy",12).on("click",m.xAxisOnClick()).text(function(a){return a});var o=g.selectAll("g.rows");return o.empty()&&(o=g.append("g").attr("class","rows axis")),o.selectAll("text").data(a.domain()).enter().append("text").attr("dy",6).style("text-anchor","end").attr("x",0).attr("dx",-2).on("click",m.yAxisOnClick()).text(function(a){return a}),b.transition(o.selectAll("text"),m.transitionDuration()).text(function(a){return a}).attr("y",function(b){return a(b)+h/2}),m.selectAll("g.box-group").each(m.hasFilter()?function(a){m.isSelectedNode(a)?m.highlightSelected(this):m.fadeDeselected(this)}:function(){m.resetHighlight(this)}),m},m.boxOnClick=function(a){return arguments.length?(p=a,m):p},m.xAxisOnClick=function(a){return arguments.length?(n=a,m):n},m.yAxisOnClick=function(a){return arguments.length?(o=a,m):o},m.xBorderRadius=function(a){return arguments.length&&(k=a),k},m.yBorderRadius=function(a){return arguments.length&&(l=a),l},m.isSelectedNode=function(a){return m.hasFilter(a.key)},m.anchor(c,d)},function(){function b(a){return[0,a.length-1]}function c(b){return[a.quantile(b,.25),a.quantile(b,.5),a.quantile(b,.75)]}a.box=function(){function d(b){b.each(function(b,c){b=b.map(i).sort(a.ascending);var d=a.select(this),m=b.length,n=b[0],o=b[m-1],p=b.quartiles=k(b),q=j&&j.call(this,b,c),r=q&&q.map(function(a){return b[a]}),s=q?a.range(0,q[0]).concat(a.range(q[1]+1,m)):a.range(m),t=a.scale.linear().domain(h&&h.call(this,b,c)||[n,o]).range([f,0]),u=this.__chart__||a.scale.linear().domain([0,1/0]).range(t.range());this.__chart__=t;var v=d.selectAll("line.center").data(r?[r]:[]);v.enter().insert("line","rect").attr("class","center").attr("x1",e/2).attr("y1",function(a){return u(a[0])}).attr("x2",e/2).attr("y2",function(a){return u(a[1])}).style("opacity",1e-6).transition().duration(g).style("opacity",1).attr("y1",function(a){return t(a[0])}).attr("y2",function(a){return t(a[1])}),v.transition().duration(g).style("opacity",1).attr("y1",function(a){return t(a[0])}).attr("y2",function(a){return t(a[1])}),v.exit().transition().duration(g).style("opacity",1e-6).attr("y1",function(a){return t(a[0])}).attr("y2",function(a){return t(a[1])}).remove();var w=d.selectAll("rect.box").data([p]);w.enter().append("rect").attr("class","box").attr("x",0).attr("y",function(a){return u(a[2])}).attr("width",e).attr("height",function(a){return u(a[0])-u(a[2])}).transition().duration(g).attr("y",function(a){return t(a[2])}).attr("height",function(a){return t(a[0])-t(a[2])}),w.transition().duration(g).attr("y",function(a){return t(a[2])}).attr("height",function(a){return t(a[0])-t(a[2])});var x=d.selectAll("line.median").data([p[1]]);x.enter().append("line").attr("class","median").attr("x1",0).attr("y1",u).attr("x2",e).attr("y2",u).transition().duration(g).attr("y1",t).attr("y2",t),x.transition().duration(g).attr("y1",t).attr("y2",t);var y=d.selectAll("line.whisker").data(r||[]);y.enter().insert("line","circle, text").attr("class","whisker").attr("x1",0).attr("y1",u).attr("x2",e).attr("y2",u).style("opacity",1e-6).transition().duration(g).attr("y1",t).attr("y2",t).style("opacity",1),y.transition().duration(g).attr("y1",t).attr("y2",t).style("opacity",1),y.exit().transition().duration(g).attr("y1",t).attr("y2",t).style("opacity",1e-6).remove();var z=d.selectAll("circle.outlier").data(s,Number);z.enter().insert("circle","text").attr("class","outlier").attr("r",5).attr("cx",e/2).attr("cy",function(a){return u(b[a])}).style("opacity",1e-6).transition().duration(g).attr("cy",function(a){return t(b[a])}).style("opacity",1),z.transition().duration(g).attr("cy",function(a){return t(b[a])}).style("opacity",1),z.exit().transition().duration(g).attr("cy",function(a){return t(b[a])}).style("opacity",1e-6).remove();var A=l||t.tickFormat(8),B=d.selectAll("text.box").data(p);B.enter().append("text").attr("class","box").attr("dy",".3em").attr("dx",function(a,b){return 1&b?6:-6}).attr("x",function(a,b){return 1&b?e:0}).attr("y",u).attr("text-anchor",function(a,b){return 1&b?"start":"end"}).text(A).transition().duration(g).attr("y",t),B.transition().duration(g).text(A).attr("y",t);var C=d.selectAll("text.whisker").data(r||[]);C.enter().append("text").attr("class","whisker").attr("dy",".3em").attr("dx",6).attr("x",e).attr("y",u).text(A).style("opacity",1e-6).transition().duration(g).attr("y",t).style("opacity",1),C.transition().duration(g).text(A).attr("y",t).style("opacity",1),C.exit().transition().duration(g).attr("y",t).style("opacity",1e-6).remove()}),a.timer.flush()}var e=1,f=1,g=0,h=null,i=Number,j=b,k=c,l=null;return d.width=function(a){return arguments.length?(e=a,d):e},d.height=function(a){return arguments.length?(f=a,d):f},d.tickFormat=function(a){return arguments.length?(l=a,d):l},d.duration=function(a){return arguments.length?(g=a,d):g},d.domain=function(b){return arguments.length?(h=null==b?b:a.functor(b),d):h},d.value=function(a){return arguments.length?(i=a,d):i},d.whiskers=function(a){return arguments.length?(j=a,d):j},d.quartiles=function(a){return arguments.length?(k=a,d):k},d}}(),b.boxPlot=function(c,d){function e(a){var b=a.enter().append("g");b.attr("class","box").attr("transform",p).call(m).on("click",function(a){i.filter(a.key),i.redrawGroup()})}function f(c){b.transition(c,i.transitionDuration()).attr("transform",p).call(m).each(function(){a.select(this).select("rect.box").attr("fill",i.getColor)})}function g(a){a.exit().remove().call(m)}function h(a){return function(b){for(var c=b.quartiles[0],d=b.quartiles[2],e=(d-c)*a,f=-1,g=b.length;b[++f]<c-e;);for(;b[--g]>d+e;);return[f,g]}}var i=b.coordinateGridMixin({}),j=1.5,k=h,l=k(j),m=a.box(),n=null,o=function(a,b){return i.isOrdinal()?i.x().rangeBand():a/(1+i.boxPadding())/b};i.yAxisPadding(12),i.x(a.scale.ordinal()),i.xUnits(b.units.ordinal),i.data(function(a){return a.all().map(function(a){return a.map=function(b){return b.call(a,a)},a}).filter(function(a){var b=i.valueAccessor()(a);return 0!==b.length})}),i.boxPadding=i._rangeBandPadding,i.boxPadding(.8),i.outerPadding=i._outerRangeBandPadding,i.outerPadding(.5),i.boxWidth=function(b){return arguments.length?(o=a.functor(b),i):o};var p=function(a,b){var c=i.x()(i.keyAccessor()(a,b));return"translate("+c+",0)"};return i._preprocessData=function(){i.elasticX()&&i.x().domain([])},i.plotData=function(){var a=o(i.effectiveWidth(),i.xUnitCount());m.whiskers(l).width(a).height(i.effectiveHeight()).value(i.valueAccessor()).domain(i.y().domain()).duration(i.transitionDuration()).tickFormat(n);var b=i.chartBodyG().selectAll("g.box").data(i.data(),function(a){return a.key});e(b),f(b),g(b),i.fadeDeselectedArea()},i.fadeDeselectedArea=function(){i.g().selectAll("g.box").each(i.hasFilter()?function(a){i.isSelectedNode(a)?i.highlightSelected(this):i.fadeDeselected(this)}:function(){i.resetHighlight(this)})},i.isSelectedNode=function(a){return i.hasFilter(a.key)},i.yAxisMin=function(){var c=a.min(i.data(),function(b){return a.min(i.valueAccessor()(b))});return b.utils.subtract(c,i.yAxisPadding())},i.yAxisMax=function(){var c=a.max(i.data(),function(b){return a.max(i.valueAccessor()(b))});return b.utils.add(c,i.yAxisPadding())},i.tickFormat=function(a){return arguments.length?(n=a,i):n},i.anchor(c,d)},b.abstractBubbleChart=b.bubbleMixin,b.baseChart=b.baseMixin,b.capped=b.capMixin,b.colorChart=b.colorMixin,b.coordinateGridChart=b.coordinateGridMixin,b.marginable=b.marginMixin,b.stackableChart=b.stackMixin,b}"function"==typeof define&&define.amd?define(["d3"],a):"object"==typeof module&&module.exports?module.exports=a(d3):this.dc=a(d3)}();
//# sourceMappingURL=dc.min.js.map