forked from dc-js/dc.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dc.min.js
14 lines (14 loc) · 39.5 KB
/
dc.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
* Copyright 2012 the original author or authors.
* Licensed under the Apache License, Version 2.0 (the "License");
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/function printSingleValue(a){var b=""+a;return a instanceof Date?b=dc.dateFormat(a):typeof a=="string"?b=a:typeof a=="number"&&(b=Math.round(a)),b}function isNegligible(a){return a===undefined||a<dc.constants.NEGLIGIBLE_NUMBER&&a>-dc.constants.NEGLIGIBLE_NUMBER}dc={version:"1.1.0",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},dc.chartRegistry=function(){function b(b){return b||(b=dc.constants.DEFAULT_CHART_GROUP),a[b]||(a[b]=[]),b}var a={};return this.has=function(b){for(var c in a)if(a[c].indexOf(b)>=0)return!0;return!1},this.register=function(c,d){d=b(d),a[d].push(c)},this.clear=function(){a={}},this.list=function(c){return c=b(c),a[c]},this}(),dc.registerChart=function(a,b){dc.chartRegistry.register(a,b)},dc.hasChart=function(a){return dc.chartRegistry.has(a)},dc.deregisterAllCharts=function(){dc.chartRegistry.clear()},dc.filterAll=function(a){var b=dc.chartRegistry.list(a);for(var c=0;c<b.length;++c)b[c].filterAll()},dc.renderAll=function(a){var b=dc.chartRegistry.list(a);for(var c=0;c<b.length;++c)b[c].render();dc._renderlet!==null&&dc._renderlet(a)},dc.redrawAll=function(a){var b=dc.chartRegistry.list(a);for(var c=0;c<b.length;++c)b[c].redraw();dc._renderlet!==null&&dc._renderlet(a)},dc.transition=function(a,b,c){if(b<=0||b===undefined)return a;var d=a.transition().duration(b);return c instanceof Function&&c(d),d},dc.units={},dc.units.integers=function(a,b){return Math.abs(b-a)},dc.units.ordinal=function(a,b,c){return c},dc.units.float={},dc.units.float.precision=function(a){var b=function(a,c,d){return Math.ceil(Math.abs((c-a)/b.resolution))};return b.resolution=a,b},dc.round={},dc.round.floor=function(a){return Math.floor(a)},dc.round.ceil=function(a){return Math.ceil(a)},dc.round.round=function(a){return Math.round(a)},dc.override=function(obj,functionName,newFunction){var existingFunction=obj[functionName];obj[functionName]=function(){var expression="newFunction(";for(var i=0;i<arguments.length;++i)expression+="arguments["+i+"],";return expression+="existingFunction);",eval(expression)}},dc.renderlet=function(a){return arguments.length?(dc._renderlet=a,dc):dc._renderlet},dc.instanceOfChart=function(a){return a instanceof Object&&a.__dc_flag__},dc.errors={},dc.errors.Exception=function(a){var b=a!=null?a:"Unexpected internal error";this.message=b,this.toString=function(){return b}},dc.errors.InvalidStateException=function(){dc.errors.Exception.apply(this,arguments)},dc.dateFormat=d3.time.format("%m/%d/%Y"),dc.printers={},dc.printers.filter=function(a){var b="";return a&&(a instanceof Array?a.length>=2?b="["+printSingleValue(a[0])+" -> "+printSingleValue(a[1])+"]":a.length>=1&&(b=printSingleValue(a[0])):b=printSingleValue(a)),b},dc.utils={},dc.utils.add=function(a,b){if(a instanceof Date){var c=new Date;return c.setTime(a.getTime()),c.setDate(a.getDate()+b),c}return a+b},dc.utils.subtract=function(a,b){if(a instanceof Date){var c=new Date;return c.setTime(a.getTime()),c.setDate(a.getDate()-b),c}return a-b},dc.utils.GroupStack=function(){function d(b){a[b]||(a[b]=[])}var a=[],b=[],c;this.setDataPoint=function(b,c,e){d(b),a[b][c]=e},this.getDataPoint=function(b,c){d(b);var e=a[b][c];return e==undefined&&(e=0),e},this.addGroup=function(a,d){return d||(d=c),b.push([a,d]),b.length-1},this.getGroupByIndex=function(a){return b[a][0]},this.getAccessorByIndex=function(a){return b[a][1]},this.size=function(){return b.length},this.clear=function(){a=[],b=[]},this.setDefaultAccessor=function(a){c=a},this.getDataPoints=function(){return a}},dc.utils.groupMax=function(a,b){var c=d3.max(a.all(),function(a){return b(a)});return isNegligible(c)&&(c=0),c},dc.utils.groupMin=function(a,b){var c=d3.min(a.all(),function(a){return b(a)});return isNegligible(c)&&(c=0),c},dc.utils.nameToId=function(a){return a.toLowerCase().replace(/[\s]/g,"_").replace(/[\.']/g,"")},dc.utils.appendOrSelect=function(a,b){var c=a.select(b);return c.empty()&&(c=a.append(b)),c},dc.events={current:null},dc.events.trigger=function(a,b){if(!b){a();return}dc.events.current=a,setTimeout(function(){a==dc.events.current&&a()},b)},dc.cumulative={},dc.cumulative.Base=function(){this._keyIndex=[],this._map={},this.sanitizeKey=function(a){return a+="",a},this.clear=function(){this._keyIndex=[],this._map={}},this.size=function(){return this._keyIndex.length},this.getValueByKey=function(a){a=this.sanitizeKey(a);var b=this._map[a];return b},this.setValueByKey=function(a,b){return a=this.sanitizeKey(a),this._map[a]=b},this.indexOfKey=function(a){return a=this.sanitizeKey(a),this._keyIndex.indexOf(a)},this.addToIndex=function(a){a=this.sanitizeKey(a),this._keyIndex.push(a)},this.getKeyByIndex=function(a){return this._keyIndex[a]}},dc.cumulative.Sum=function(){dc.cumulative.Base.apply(this,arguments),this.add=function(a,b){b==null&&(b=0),this.getValueByKey(a)==null?(this.addToIndex(a),this.setValueByKey(a,b)):this.setValueByKey(a,this.getValueByKey(a)+b)},this.minus=function(a,b){this.setValueByKey(a,this.getValueByKey(a)-b)},this.cumulativeSum=function(a){var b=this.indexOfKey(a);if(b<0)return 0;var c=0;for(var d=0;d<=b;++d){var e=this.getKeyByIndex(d);c+=this.getValueByKey(e)}return c}},dc.cumulative.Sum.prototype=new dc.cumulative.Base,dc.cumulative.CountUnique=function(){function a(a){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}dc.cumulative.Base.apply(this,arguments),this.add=function(a,b){this.getValueByKey(a)==null&&(this.setValueByKey(a,{}),this.addToIndex(a)),b!=null&&(this.getValueByKey(a)[b]==null&&(this.getValueByKey(a)[b]=0),this.getValueByKey(a)[b]+=1)},this.minus=function(a,b){this.getValueByKey(a)[b]-=1,this.getValueByKey(a)[b]<=0&&delete this.getValueByKey(a)[b]},this.count=function(b){return a(this.getValueByKey(b))},this.cumulativeCount=function(a){var b=this.indexOfKey(a);if(b<0)return 0;var c=0;for(var d=0;d<=b;++d){var e=this.getKeyByIndex(d);c+=this.count(e)}return c}},dc.cumulative.CountUnique.prototype=new dc.cumulative.Base,dc.baseChart=function(a){a.__dc_flag__=!0;var b,c,d,e,f,g=200,h=200,i=function(a){return a.key},j=function(a){return a.value},k=function(a){return a.key},l=!1,m=function(a){return a.key+": "+a.value},n=!1,o=750,p=dc.printers.filter,q=[],r=dc.constants.DEFAULT_CHART_GROUP,s=function(a){},t={preRender:s,postRender:s,preRedraw:s,postRedraw:s,filtered:s};return a.width=function(b){return arguments.length?(g=b,a):g},a.height=function(b){return arguments.length?(h=b,a):h},a.dimension=function(c){return arguments.length?(b=c,a):b},a.group=function(b){return arguments.length?(c=b,a):c},a.orderedGroup=function(){return c.order(function(a){return a.key})},a.filterAll=function(){return a.filter(null)},a.dataAreSet=function(){return b!=undefined&&c!=undefined},a.select=function(a){return e.select(a)},a.selectAll=function(a){return e.selectAll(a)},a.anchor=function(b,c){return arguments.length?(dc.instanceOfChart(b)?(d=b.anchor(),e=b.root()):(d=b,e=d3.select(d),e.classed(dc.constants.CHART_CLASS,!0),dc.registerChart(a,c)),r=c,a):d},a.root=function(b){return arguments.length?(e=b,a):e},a.svg=function(b){return arguments.length?(f=b,a):f},a.resetSvg=function(){return a.select("svg").remove(),a.generateSvg()},a.generateSvg=function(){return f=a.root().append("svg").attr("width",a.width()).attr("height",a.height()),f},a.filterPrinter=function(b){return arguments.length?(p=b,a):p},a.turnOnControls=function(){return a.selectAll(".reset").style("display",null),a.selectAll(".filter").text(p(a.filter())).style("display",null),a},a.turnOffControls=function(){return a.selectAll(".reset").style("display","none"),a.selectAll(".filter").style("display","none").text(a.filter()),a},a.transitionDuration=function(b){return arguments.length?(o=b,a):o},a.render=function(){t.preRender(a);if(b==null)throw new dc.errors.InvalidStateException("Mandatory attribute chart.dimension is missing on chart["+a.anchor()+"]");if(c==null)throw new dc.errors.InvalidStateException("Mandatory attribute chart.group is missing on chart["+a.anchor()+"]");var d=a.doRender();return a.invokeRenderlet(a),t.postRender(a),d},a.redraw=function(){t.preRedraw(a);var b=a.doRedraw();return a.invokeRenderlet(a),t.postRedraw(a),b},a.invokeFilteredListener=function(b,c){c!==undefined&&t.filtered(a,c)},a.filter=function(b){return a.invokeFilteredListener(a,b),a},a.doRender=function(){return a},a.doRedraw=function(){return a},a.keyAccessor=function(b){return arguments.length?(i=b,a):i},a.valueAccessor=function(b){return arguments.length?(j=b,a):j},a.label=function(b){return arguments.length?(k=b,l=!0,a):k},a.renderLabel=function(b){return arguments.length?(l=b,a):l},a.title=function(b){return arguments.length?(m=b,n=!0,a):m},a.renderTitle=function(b){return arguments.length?(n=b,a):n},a.renderlet=function(b){return q.push(b),a},a.invokeRenderlet=function(a){for(var b=0;b<q.length;++b)q[b](a)},a.chartGroup=function(b){return arguments.length?(r=b,a):r},a.on=function(b,c){return t[b]=c,a},a},dc.coordinateGridChart=function(a){function A(b){a.elasticX()&&!a.isOrdinal()&&j.domain([a.xAxisMin(),a.xAxisMax()]),a.isOrdinal()?a.prepareOrdinalXAxis():j.range([0,a.xAxisLength()]),l=l.scale(a.x()).orient("bottom"),B(b)}function B(b){if(y){var d=b.selectAll("g."+e);d.empty()&&(d=b.insert("g",":first-child").attr("class",c+" "+e).attr("transform","translate("+a.yAxisX()+","+a.margins().top+")"));var f=l.tickValues()?l.tickValues():j.ticks(l.ticks()[0]),g=d.selectAll("line").data(f),h=g.enter().append("line").attr("x1",function(a){return j(a)}).attr("y1",a.xAxisY()-a.margins().top).attr("x2",function(a){return j(a)}).attr("y2",0).attr("opacity",0);dc.transition(h,a.transitionDuration()).attr("opacity",1),dc.transition(g,a.transitionDuration()).attr("x1",function(a){return j(a)}).attr("y1",a.xAxisY()-a.margins().top).attr("x2",function(a){return j(a)}).attr("y2",0),g.exit().remove()}}function C(c){if(p==null||a.elasticY())p=d3.scale.linear(),p.domain([a.yAxisMin(),a.yAxisMax()]).rangeRound([a.yAxisHeight(),0]);p.range([a.yAxisHeight(),0]),q=q.scale(p).orient("left").ticks(b),D(c)}function D(b){if(x){var e=b.selectAll("g."+d),f=q.tickValues()?q.tickValues():p.ticks(q.ticks()[0]);e.empty()&&(e=b.insert("g",":first-child").attr("class",c+" "+d).attr("transform","translate("+a.yAxisX()+","+a.margins().top+")"));var g=e.selectAll("line").data(f),h=g.enter().append("line").attr("x1",1).attr("y1",function(a){return p(a)}).attr("x2",a.xAxisLength()).attr("y2",function(a){return p(a)}).attr("opacity",0);dc.transition(h,a.transitionDuration()).attr("opacity",1),dc.transition(g,a.transitionDuration()).attr("x1",1).attr("y1",function(a){return p(a)}).attr("x2",a.xAxisLength()).attr("y2",function(a){return p(a)}),g.exit().remove()}}function E(){return a.xAxisY()-a.margins().top}function F(a){}function G(b){var c=a.extendBrush();a.redrawBrush(h),a.brushIsEmpty(c)?dc.events.trigger(function(){a.filter(null),dc.redrawAll(a.chartGroup())}):dc.events.trigger(function(){a.filter([c[0],c[1]]),dc.redrawAll(a.chartGroup())},dc.constants.EVENT_DELAY)}function H(a){}function I(){return a.anchor().replace("#","")+"-clip"}function J(){var b=dc.utils.appendOrSelect(g,"defs"),c=dc.utils.appendOrSelect(b,"clipPath").attr("id",I());dc.utils.appendOrSelect(c,"rect").attr("x",a.margins().left).attr("y",a.margins().top).attr("width",a.xAxisLength()).attr("height",a.yAxisHeight())}var b=5,c="grid-line",d="horizontal",e="vertical";a=dc.baseChart(a);var f={top:10,right:50,bottom:30,left:30},g,h,i,j,k,l=d3.svg.axis(),m=dc.units.integers,n=0,o=!1,p,q=d3.svg.axis(),r=0,s=!1,t,u=d3.svg.brush(),v=!0,w,x=!1,y=!1,z=!1;return a.generateG=function(b){return b==null?g=a.svg():g=b,h=g.append("g"),i=h.append("g").attr("class","chartBody").attr("clip-path","url(#"+I()+")"),h},a.g=function(b){return arguments.length?(h=b,a):h},a.chartBodyG=function(b){return arguments.length?(i=b,a):i},a.margins=function(b){return arguments.length?(f=b,a):f},a.x=function(b){return arguments.length?(j=b,k=j.domain(),a):j},a.xOriginalDomain=function(){return k},a.xUnits=function(b){return arguments.length?(m=b,a):m},a.xAxis=function(b){return arguments.length?(l=b,a):l},a.elasticX=function(b){return arguments.length?(o=b,a):o},a.xAxisPadding=function(b){return arguments.length?(n=b,a):n},a.xUnitCount=function(){var b=a.xUnits()(a.x().domain()[0],a.x().domain()[1],a.x().domain());return b instanceof Array?b.length:b},a.isOrdinal=function(){return a.xUnits()===dc.units.ordinal},a.prepareOrdinalXAxis=function(b){b||(b=a.xUnitCount());var c=[],d=0,e=a.xAxisLength()/b;for(var f=0;f<b;f++)c[f]=d,d+=e;j.range(c)},a.renderXAxis=function(b){var c=b.selectAll("g.x");c.empty()&&(c=b.append("g").attr("class","axis x").attr("transform","translate("+a.margins().left+","+a.xAxisY()+")")),dc.transition(c,a.transitionDuration()).call(l)},a.xAxisY=function(){return a.height()-a.margins().bottom},a.xAxisLength=function(){return a.width()-a.margins().left-a.margins().right},a.renderYAxis=function(b){var c=b.selectAll("g.y");c.empty()&&(c=b.append("g").attr("class","axis y").attr("transform","translate("+a.yAxisX()+","+a.margins().top+")")),dc.transition(c,a.transitionDuration()).call(q)},a.yAxisX=function(){return a.margins().left},a.y=function(b){return arguments.length?(p=b,a):p},a.yAxis=function(b){return arguments.length?(q=b,a):q},a.elasticY=function(b){return arguments.length?(s=b,a):s},a.renderHorizontalGridLines=function(b){return arguments.length?(x=b,a):x},a.renderVerticalGridLines=function(b){return arguments.length?(y=b,a):y},a.xAxisMin=function(){var b=d3.min(a.group().all(),function(b){return a.keyAccessor()(b)});return dc.utils.subtract(b,n)},a.xAxisMax=function(){var b=d3.max(a.group().all(),function(b){return a.keyAccessor()(b)});return dc.utils.add(b,n)},a.yAxisMin=function(){var b=d3.min(a.group().all(),function(b){return a.valueAccessor()(b)})-r;return b},a.yAxisMax=function(){var b=d3.max(a.group().all(),function(b){return a.valueAccessor()(b)});return dc.utils.add(b,r)},a.yAxisPadding=function(b){return arguments.length?(r=b,a):r},a.yAxisHeight=function(){return a.height()-a.margins().top-a.margins().bottom},a.round=function(b){return arguments.length?(w=b,a):w},a.filter=function(b){return arguments.length?(b?(t=b,a.brush().extent(b),a.dimension().filter(b),a.turnOnControls()):(t=null,a.brush().clear(),a.dimension().filterAll(),a.turnOffControls()),a.invokeFilteredListener(a,b),a):t},a.brush=function(b){return arguments.length?(u=b,a):u},a.renderBrush=function(b){a.isOrdinal()&&(v=!1);if(v){u.on("brushstart",F).on("brush",G).on("brushend",H);var c=b.append("g").attr("class","brush").attr("transform","translate("+a.margins().left+","+a.margins().top+")").call(u.x(a.x()));c.selectAll("rect").attr("height",E()),c.selectAll(".resize").append("path").attr("d",a.resizeHandlePath),t&&a.redrawBrush(b)}},a.extendBrush=function(){var b=u.extent();return a.round()&&(b[0]=b.map(a.round())[0],b[1]=b.map(a.round())[1],h.select(".brush").call(u.extent(b))),b},a.brushIsEmpty=function(a){return u.empty()||!a||a[1]<=a[0]},a.redrawBrush=function(b){if(v){a.filter()&&a.brush().empty()&&a.brush().extent(a.filter());var c=b.select("g.brush");c.call(a.brush().x(a.x())),c.selectAll("rect").attr("height",E())}a.fadeDeselectedArea()},a.fadeDeselectedArea=function(){},a.resizeHandlePath=function(a){var b=+(a=="e"),c=b?1:-1,d=E()/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+"Z"+"M"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)},a.doRender=function(){if(j==null)throw new dc.errors.InvalidStateException("Mandatory attribute chart.x is missing on chart["+a.anchor()+"]");return a.resetSvg(),a.dataAreSet()&&(a.generateG(),J(),A(a.g()),C(a.g()),a.plotData(),a.renderXAxis(a.g()),a.renderYAxis(a.g()),a.renderBrush(a.g())),a},a.doRedraw=function(){return A(a.g()),C(a.g()),a.plotData(),a.elasticY()&&a.renderYAxis(a.g()),(a.elasticX()||z)&&a.renderXAxis(a.g()),a.redrawBrush(a.g()),a},a.subRender=function(){return a.dataAreSet()&&a.plotData(),a},a.brushOn=function(b){return arguments.length?(v=b,a):v},a.getDataWithinXDomain=function(b){var c=[];return a.isOrdinal()?c=b.all():b.all().forEach(function(b){var d=a.keyAccessor()(b);d>=a.x().domain()[0]&&d<=a.x().domain()[1]&&c.push(b)}),c},a.focus=function(b){z=!0,b!=null&&b!=undefined&&b instanceof Array&&b.length>1?a.x().domain(b):a.x().domain(a.xOriginalDomain()),a.redraw()},a.refocused=function(){return z},a},dc.colorChart=function(a){var b=d3.scale.category20c(),c=[0,b.range().length],d=function(d){var e=c[0],f=c[1];isNaN(d)&&(d=0);if(f==null)return b(d);var g=a.colors().range().length,h=(f-e)/g,i=Math.abs(Math.min(g-1,Math.round((d-e)/h)));return a.colors()(i)},e=function(a,b){return b};return a.colors=function(d){if(!arguments.length)return b;if(d instanceof Array){b=d3.scale.ordinal().range(d);var e=[];for(var f=0;f<d.length;++f)e.push(f);b.domain(e)}else b=d;return c=[0,b.range().length],a},a.colorCalculator=function(b){return arguments.length?(d=b,a):d},a.getColor=function(a,b){return d(e(a,b))},a.colorAccessor=function(b){return arguments.length?(e=b,a):e},a.colorDomain=function(b){return arguments.length?(c=b,a):c},a},dc.singleSelectionChart=function(a){var b;return a.hasFilter=function(){return b!=null},a.filter=function(c){return arguments.length?(b=c,a.dataAreSet()&&a.dimension().filter!=undefined&&a.dimension().filter(b),c?a.turnOnControls():a.turnOffControls(),a.invokeFilteredListener(a,c),a):b},a.highlightSelected=function(a){d3.select(a).classed(dc.constants.SELECTED_CLASS,!0),d3.select(a).classed(dc.constants.DESELECTED_CLASS,!1)},a.fadeDeselected=function(a){d3.select(a).classed(dc.constants.SELECTED_CLASS,!1),d3.select(a).classed(dc.constants.DESELECTED_CLASS,!0)},a.resetHighlight=function(a){d3.select(a).classed(dc.constants.SELECTED_CLASS,!1),d3.select(a).classed(dc.constants.DESELECTED_CLASS,!1)},a.onClick=function(b){var c=a.keyAccessor()(b);c==a.filter()?dc.events.trigger(function(){a.filter(null),dc.redrawAll(a.chartGroup())}):dc.events.trigger(function(){a.filter(c),dc.redrawAll(a.chartGroup())})},a},dc.stackableChart=function(a){function g(){d=null,e=null,f=null}function h(b,d){for(var e=0;e<b.length;++e){var f=b[e];d==0?c.setDataPoint(d,e,a.dataPointBaseline()-a.dataPointHeight(f,d)):c.setDataPoint(d,e,c.getDataPoint(d-1,e)-a.dataPointHeight(f,d))}}var b=0,c=new dc.utils.GroupStack,d,e,f;return a.stack=function(b,d){return c.setDefaultAccessor(a.valueAccessor()),c.addGroup(b,d),g(),a},a.allGroups=function(){if(d==null){d=[],d.push(a.group());for(var b=0;b<c.size();++b)d.push(c.getGroupByIndex(b))}return d},a.allValueAccessors=function(){if(e==null){e=[],e.push(a.valueAccessor());for(var b=0;b<c.size();++b)e.push(c.getAccessorByIndex(b))}return e},a.getValueAccessorByIndex=function(b){return a.allValueAccessors()[b]},a.yAxisMin=function(){var b=0,c=a.allGroups();for(var d=0;d<c.length;++d){var e=c[d],f=dc.utils.groupMin(e,a.getValueAccessorByIndex(d));f<b&&(b=f)}return b},a.yAxisMax=function(){var b=0,c=a.allGroups();for(var d=0;d<c.length;++d){var e=c[d];b+=dc.utils.groupMax(e,a.getValueAccessorByIndex(d))}return b=dc.utils.add(b,a.yAxisPadding()),b},a.allKeyAccessors=function(){if(f==null){f=[],f.push(a.keyAccessor());for(var b=0;b<c.size();++b)f.push(a.keyAccessor())}return f},a.getKeyAccessorByIndex=function(b){return a.allKeyAccessors()[b]},a.xAxisMin=function(){var b=null,c=a.allGroups();for(var d=0;d<c.length;++d){var e=c[d],f=dc.utils.groupMin(e,a.getKeyAccessorByIndex(d));if(b==null||b>f)b=f}return dc.utils.subtract(b,a.xAxisPadding())},a.xAxisMax=function(){var b=null,c=a.allGroups();for(var d=0;d<c.length;++d){var e=c[d],f=dc.utils.groupMax(e,a.getKeyAccessorByIndex(d));if(b==null||b<f)b=f}return dc.utils.add(b,a.xAxisPadding())},a.dataPointBaseline=function(){return a.margins().top+a.yAxisHeight()},a.dataPointHeight=function(c,d){var e=a.yAxisHeight()-a.y()(a.getValueAccessorByIndex(d)(c));if(isNaN(e)||e<b)e=b;return e},a.calculateDataPointMatrixForAll=function(a){for(var b=0;b<a.length;++b){var c=a[b],d=c.all();h(d,b)}},a.calculateDataPointMatrixWithinXDomain=function(b){for(var c=0;c<b.length;++c){var d=b[c],e=a.getDataWithinXDomain(d);h(e,c)}},a.getChartStack=function(){return c},a},dc.abstractBubbleChart=function(a){var b=.3,c=10;a.BUBBLE_NODE_CLASS="node",a.BUBBLE_CLASS="bubble",a.MIN_RADIUS=10,a=dc.singleSelectionChart(dc.colorChart(a)),a.renderLabel(!0),a.renderTitle(!1);var d=d3.scale.linear().domain([0,100]),e=function(a){return a.r};a.r=function(b){return arguments.length?(d=b,a):d},a.radiusValueAccessor=function(b){return arguments.length?(e=b,a):e},a.rMin=function(){var b=d3.min(a.group().all(),function(b){return a.radiusValueAccessor()(b)});return b},a.rMax=function(){var b=d3.max(a.group().all(),function(b){return a.radiusValueAccessor()(b)});return b},a.bubbleR=function(b){var c=a.radiusValueAccessor()(b),d=a.r()(c);if(isNaN(d)||c<=0)d=0;return d};var f=function(b){return a.label()(b)},g=function(b){return a.bubbleR(b)>c?1:0};a.doRenderLabel=function(b){if(a.renderLabel()){var c=b.select("text");c.empty()&&(c=b.append("text").attr("text-anchor","middle").attr("dy",".3em").on("click",a.onClick)),c.attr("opacity",0).text(f),dc.transition(c,a.transitionDuration()).attr("opacity",g)}},a.doUpdateLabels=function(b){if(a.renderLabel()){var c=b.selectAll("text").text(f);dc.transition(c,a.transitionDuration()).attr("opacity",g)}};var h=function(b){return a.title()(b)};return a.doRenderTitles=function(b){if(a.renderTitle()){var c=b.select("title");c.empty()&&b.append("title").text(h)}},a.doUpdateTitles=function(b){a.renderTitle()&&b.selectAll("title").text(h)},a.minRadiusWithLabel=function(b){return arguments.length?(c=b,a):c},a.maxBubbleRelativeSize=function(c){return arguments.length?(b=c,a):b},a.initBubbleColor=function(b,c){return this[dc.constants.NODE_INDEX_NAME]=c,a.getColor(b,c)},a.updateBubbleColor=function(b,c){return a.getColor(b,this[dc.constants.NODE_INDEX_NAME])},a.fadeDeselectedArea=function(){a.hasFilter()?a.selectAll("g."+a.BUBBLE_NODE_CLASS).each(function(b){a.isSelectedNode(b)?a.highlightSelected(this):a.fadeDeselected(this)}):a.selectAll("g."+a.BUBBLE_NODE_CLASS).each(function(b){a.resetHighlight(this)})},a.isSelectedNode=function(b){return a.filter()==b.key},a.onClick=function(b){var c=b.key;c==a.filter()?dc.events.trigger(function(){a.filter(null),dc.redrawAll(a.chartGroup())}):dc.events.trigger(function(){a.filter(c),dc.redrawAll(a.chartGroup())})},a},dc.pieChart=function(a,b){function j(){if(i.dataAreSet()){var a=v(),b=i.buildArcs(),c=a(i.orderedGroup().top(Infinity)),e=g.selectAll("g."+d).data(c);k(e,b,c),p(c,b),t(e),u()}}function k(a,b,c){var d=l(a);m(d,b),n(d),o(c,b)}function l(a){var b=a.enter().append("g").attr("class",function(a,b){return d+" "+b});return b}function m(a,b){var c=a.append("path").attr("fill",function(a,b){return i.getColor(a,b)}).on("click",A).attr("d",function(a,c){return B(a,c,b)});c.transition().duration(i.transitionDuration()).attrTween("d",y)}function n(a){i.renderTitle()&&a.append("title").text(function(a){return i.title()(a)})}function o(a,b){if(i.renderLabel()){var c=g.selectAll("text."+d).data(a),f=c.enter().append("text").attr("class",function(a,b){return d+" "+b}).on("click",A);dc.transition(f,i.transitionDuration()).attr("transform",function(a){a.innerRadius=i.innerRadius(),a.outerRadius=e;var c=b.centroid(a);return isNaN(c[0])||isNaN(c[1])?"translate(0,0)":"translate("+c+")"}).attr("text-anchor","middle").text(function(a){var b=a.data;return x(b)||w(a)?"":i.label()(a)})}}function p(a,b){q(a,b),r(a,b),s(a)}function q(a,b){var c=g.selectAll("g."+d).data(a).select("path").attr("d",function(a,c){return B(a,c,b)});dc.transition(c,i.transitionDuration(),function(a){a.attrTween("d",y)}).attr("fill",function(a,b){return i.getColor(a,b)})}function r(a,b){if(i.renderLabel()){var c=g.selectAll("text."+d).data(a);dc.transition(c,i.transitionDuration()).attr("transform",function(a){a.innerRadius=i.innerRadius(),a.outerRadius=e;var c=b.centroid(a);return isNaN(c[0])||isNaN(c[1])?"translate(0,0)":"translate("+c+")"}).attr("text-anchor","middle").text(function(a){var b=a.data;return x(b)||w(a)?"":i.label()(a)})}}function s(a){i.renderTitle()&&g.selectAll("g."+d).data(a).select("title").text(function(a){return i.title()(a)})}function t(a){a.exit().remove()}function u(){i.hasFilter()?i.selectAll("g."+d).each(function(a){i.isSelectedSlice(a)?i.highlightSelected(this):i.fadeDeselected(this)}):i.selectAll("g."+d).each(function(a){i.resetHighlight(this)})}function v(){return d3.layout.pie().sort(null).value(function(a){return i.valueAccessor()(a)})}function w(a){var b=a.endAngle-a.startAngle;return isNaN(b)||b<h}function x(a){return i.valueAccessor()(a)==0}function y(a){a.innerRadius=i.innerRadius();var b=this._current;z(b)&&(b={startAngle:0,endAngle:0});var c=d3.interpolate(b,a);return this._current=c(0),function(a){return B(c(a),0,i.buildArcs())}}function z(a){return a==null||isNaN(a.startAngle)||isNaN(a.endAngle)}function A(a){i.onClick(a.data)}function B(a,b,c){var d=c(a,b);return d.indexOf("NaN")>=0&&(d="M0,0"),d}var c=.5,d="pie-slice",e=90,f=0,g,h=c,i=dc.singleSelectionChart(dc.colorChart(dc.baseChart({})));return i.label(function(a){return i.keyAccessor()(a.data)}),i.renderLabel(!0),i.title(function(a){return i.keyAccessor()(a.data)+": "+i.valueAccessor()(a.data)}),i.transitionDuration(350),i.doRender=function(){return i.resetSvg(),g=i.svg().append("g").attr("transform","translate("+i.cx()+","+i.cy()+")"),j(),i},i.innerRadius=function(a){return arguments.length?(f=a,i):f},i.radius=function(a){return arguments.length?(e=a,i):e},i.cx=function(){return i.width()/2},i.cy=function(){return i.height()/2},i.buildArcs=function(){return d3.svg.arc().outerRadius(e).innerRadius(f)},i.isSelectedSlice=function(a){return i.filter()==i.keyAccessor()(a.data)},i.doRedraw=function(){return j(),i},i.minAngleForLabel=function(a){return arguments.length?(h=a,i):h},i.anchor(a,b)},dc.barChart=function(a,b){function i(a,b){var c=e.chartBodyG().selectAll("rect."+dc.constants.STACK_CLASS+a).data(e.getDataWithinXDomain(b));j(c,a),k(c,a),l(c)}function j(a,b){var a=a.enter().append("rect");a.attr("class","bar "+dc.constants.STACK_CLASS+b).attr("x",function(a,c){return p(this,a,b,c)}).attr("y",e.xAxisY()).attr("width",n),e.isOrdinal()&&a.on("click",e.onClick),e.renderTitle()&&a.append("title").text(e.title()),dc.transition(a,e.transitionDuration()).attr("y",function(a,b){return r(this,a,b)}).attr("height",function(a){return e.dataPointHeight(a,q(this))})}function k(a,b){e.renderTitle()&&a.select("title").text(e.title()),dc.transition(a,e.transitionDuration()).attr("x",function(a,c){return p(this,a,b,c)}).attr("y",function(a,b){return r(this,a,b)}).attr("height",function(a){return e.dataPointHeight(a,q(this))}).attr("width",n)}function l(a){dc.transition(a.exit(),e.transitionDuration()).attr("y",e.xAxisY()).attr("height",0)}function m(){if(h==null||e.refocused())h=e.xUnitCount();return h}function n(a){var b=m(),d=c;e.isOrdinal()?d=Math.floor(e.xAxisLength()/(b+1)):d=Math.floor(e.xAxisLength()/b),d-=f;if(isNaN(d)||d<c)d=c;return d}function o(a,b){a[dc.constants.GROUP_INDEX_NAME]=b}function p(a,b,c,d){o(a,c);var f=e.x()(e.keyAccessor()(b))+e.margins().left;return g&&(f-=n(b)/2),f}function q(a){var b=a[dc.constants.GROUP_INDEX_NAME];return b}function r(a,b,c){var d=q(a);return e.getChartStack().getDataPoint(d,c)}var c=1,d=2,e=dc.stackableChart(dc.coordinateGridChart(dc.singleSelectionChart({}))),f=d,g=!1,h;return e.plotData=function(){var a=e.allGroups();e.calculateDataPointMatrixWithinXDomain(a);for(var b=0;b<a.length;++b)i(b,a[b])},e.fadeDeselectedArea=function(){var a=e.chartBodyG().selectAll("rect.bar"),b=e.brush().extent();if(e.isOrdinal())e.filter()!=null?a.classed(dc.constants.DESELECTED_CLASS,function(a){var b=e.keyAccessor()(a);return b!=e.filter()}):a.classed(dc.constants.DESELECTED_CLASS,!1);else if(!e.brushIsEmpty(b)){var c=b[0],d=b[1];a.classed(dc.constants.DESELECTED_CLASS,function(a){var b=e.keyAccessor()(a);return b<c||b>=d})}else a.classed(dc.constants.DESELECTED_CLASS,!1)},e.centerBar=function(a){return arguments.length?(g=a,e):g},e.gap=function(a){return arguments.length?(f=a,e):f},e.extendBrush=function(){var a=e.brush().extent();return e.round()&&!g&&(a[0]=a.map(e.round())[0],a[1]=a.map(e.round())[1],e.chartBodyG().select(".brush").call(e.brush().extent(a))),a},dc.override(e,"prepareOrdinalXAxis",function(a){return a(e.xUnitCount()+1)}),e.anchor(a,b)},dc.lineChart=function(a,b){function l(a,b){var c=m(a),d=n(c,b),e=o(d,c,a);j&&r(d,c,a,e),i.renderTitle()&&s(d,a)}function m(a){return dc.constants.STACK_CLASS+a}function n(a,b){var c=i.chartBodyG().select("g."+a);return c.empty()&&(c=i.chartBodyG().append("g").attr("class",a)),c.datum(b.all()),c}function o(a,b,c){var d=a.select("path.line");d.empty()&&(d=a.append("path").attr("class","line "+b)),d[0][0][dc.constants.GROUP_INDEX_NAME]=c;var e=d3.svg.line().x(p).y(function(a,b){var c=this[dc.constants.GROUP_INDEX_NAME];return q(a,b,c)});return dc.transition(d,i.transitionDuration(),function(a){a.ease("linear")}).attr("d",e),e}function r(a,b,d,e){var f=a.select("path.area");f.empty()&&(f=a.append("path").attr("class","area "+b)),f[0][0][dc.constants.GROUP_INDEX_NAME]=d;var g=d3.svg.area().x(e.x()).y1(e.y()).y0(function(a,b){var d=this[dc.constants.GROUP_INDEX_NAME];return d==0?i.xAxisY()-c:i.getChartStack().getDataPoint(--d,b)-c});dc.transition(f,i.transitionDuration(),function(a){a.ease("linear")}).attr("d",g)}function s(a,b){var c=a.select("g."+e);c.empty()&&(c=a.append("g").attr("class",e)),t(c);var d=c.selectAll("circle."+f).data(c.datum());d.enter().append("circle").attr("class",f).attr("r",k).style("fill-opacity",1e-6).style("stroke-opacity",1e-6).on("mousemove",function(a){var b=d3.select(this);u(b),v(b,c)}).on("mouseout",function(a){var b=d3.select(this);w(b),x(c)}).append("title").text(i.title()),d.attr("cx",p).attr("cy",function(a,c){return q(a,c,b)}).select("title").text(i.title()),d.exit().remove()}function t(a){var b=a.select("path."+g).empty()?a.append("path").attr("class",g):a.select("path."+g);b.style("display","none").attr("stroke-dasharray","5,5");var c=a.select("path."+h).empty()?a.append("path").attr("class",h):a.select("path."+h);c.style("display","none").attr("stroke-dasharray","5,5")}function u(a){return a.style("fill-opacity",.8),a.style("stroke-opacity",.8),a}function v(a,b){var c=a.attr("cx"),d=a.attr("cy");b.select("path."+g).style("display","").attr("d","M"+i.margins().left+" "+d+"L"+c+" "+d),b.select("path."+h).style("display","").attr("d","M"+c+" "+(i.height()-i.margins().bottom)+"L"+c+" "+d)}function w(a){a.style("fill-opacity",1e-6).style("stroke-opacity",1e-6)}function x(a){a.select("path."+g).style("display","none"),a.select("path."+h).style("display","none")}var c=1,d=5,e="dc-tooltip",f="dot",g="yRef",h="xRef",i=dc.stackableChart(dc.coordinateGridChart({})),j=!1,k=d;i.transitionDuration(500),i.plotData=function(){var a=i.allGroups();i.calculateDataPointMatrixForAll(a);for(var b=0;b<a.length;++b){var c=a[b];l(b,c)}};var p=function(a){return i.margins().left+i.x()(i.keyAccessor()(a))},q=function(a,b,c){return i.getChartStack().getDataPoint(c,b)};return i.renderArea=function(a){return arguments.length?(j=a,i):j},i.dotRadius=function(a){return arguments.length?(k=a,i):k},i.anchor(a,b)},dc.dataCount=function(a,b){var c=d3.format(",d"),d=dc.baseChart({});return d.doRender=function(){return d.selectAll(".total-count").text(c(d.dimension().size())),d.selectAll(".filter-count").text(c(d.group().value())),d},d.doRedraw=function(){return d.doRender()},d.anchor(a,b)},dc.dataTable=function(a,b){function m(){var a=g.root().selectAll("tbody").data(n(),function(a){return g.keyAccessor()(a)}),b=a.enter().append("tbody");return b.append("tr").attr("class",f).append("td").attr("class",c).attr("colspan",i.length).html(function(a){return g.keyAccessor()(a)}),a.exit().remove(),b}function n(){l||(l=crossfilter.quicksort.by(j));var a=g.dimension().top(h);return d3.nest().key(g.group
()).sortKeys(k).entries(l(a,0,a.length))}function o(a){var b=a.order().selectAll("tr."+d).data(function(a){return a.values}),c=b.enter().append("tr").attr("class",d);for(var f=0;f<i.length;++f){var g=i[f];c.append("td").attr("class",e+" _"+f).html(function(a){return g(a)})}return b.exit().remove(),b}var c="dc-table-label",d="dc-table-row",e="dc-table-column",f="dc-table-group",g=dc.baseChart({}),h=25,i=[],j=function(a){return a},k=d3.ascending,l;return g.doRender=function(){return g.selectAll("tbody").remove(),o(m()),g},g.doRedraw=function(){return g.doRender()},g.size=function(a){return arguments.length?(h=a,g):h},g.columns=function(a){return arguments.length?(i=a,g):i},g.sortBy=function(a){return arguments.length?(j=a,g):j},g.order=function(a){return arguments.length?(k=a,g):k},g.anchor(a,b)},dc.bubbleChart=function(a,b){function f(a){var b=a.enter().append("g");b.attr("class",c.BUBBLE_NODE_CLASS).attr("transform",e).append("circle").attr("class",function(a,b){return c.BUBBLE_CLASS+" _"+b}).on("click",c.onClick).attr("fill",c.initBubbleColor).attr("r",0),dc.transition(a,c.transitionDuration()).attr("r",function(a){return c.bubbleR(a)}).attr("opacity",function(a){return c.bubbleR(a)>0?1:0}),c.doRenderLabel(b),c.doRenderTitles(b)}function g(a){dc.transition(a,c.transitionDuration()).attr("transform",e).selectAll("circle."+c.BUBBLE_CLASS).attr("fill",c.updateBubbleColor).attr("r",function(a){return c.bubbleR(a)}).attr("opacity",function(a){return c.bubbleR(a)>0?1:0}),c.doUpdateLabels(a),c.doUpdateTitles(a)}function h(a){a.exit().remove()}function i(a){var b=c.x()(c.keyAccessor()(a))+c.margins().left;return isNaN(b)&&(b=0),b}function j(a){var b=c.margins().top+c.y()(c.valueAccessor()(a));return isNaN(b)&&(b=0),b}var c=dc.abstractBubbleChart(dc.coordinateGridChart({})),d=!1;c.transitionDuration(750);var e=function(a){return"translate("+i(a)+","+j(a)+")"};return c.elasticRadius=function(a){return arguments.length?(d=a,c):d},c.plotData=function(){d&&c.r().domain([c.rMin(),c.rMax()]),c.r().range([c.MIN_RADIUS,c.xAxisLength()*c.maxBubbleRelativeSize()]);var a=c.chartBodyG().selectAll("g."+c.BUBBLE_NODE_CLASS).data(c.group().all());f(a),g(a),h(a),c.fadeDeselectedArea()},c.renderBrush=function(a){},c.redrawBrush=function(a){c.fadeDeselectedArea()},c.anchor(a,b)},dc.compositeChart=function(a,b){function f(a,b){a.generateG(d.g()),a.g().attr("class",c+" _"+b)}function g(){var a=[];for(var b=0;b<e.length;++b)a.push(e[b].yAxisMin());return a}function h(){var a=[];for(var b=0;b<e.length;++b)a.push(e[b].yAxisMax());return a}function i(){var a=[];for(var b=0;b<e.length;++b)a.push(e[b].xAxisMin());return a}function j(){var a=[];for(var b=0;b<e.length;++b)a.push(e[b].xAxisMax());return a}var c="sub",d=dc.coordinateGridChart({}),e=[];return d.transitionDuration(500),dc.override(d,"generateG",function(a){var b=a();for(var c=0;c<e.length;++c){var g=e[c];f(g,c),g.dimension()==null&&g.dimension(d.dimension()),g.group()==null&&g.group(d.group()),g.chartGroup(d.chartGroup()),g.svg(d.svg()),g.height(d.height()),g.width(d.width()),g.margins(d.margins()),g.xUnits(d.xUnits()),g.transitionDuration(d.transitionDuration())}return b}),d.plotData=function(){for(var a=0;a<e.length;++a){var b=e[a];b.g()==null&&f(b,a),b.x(d.x()),b.y(d.y()),b.xAxis(d.xAxis()),b.yAxis(d.yAxis()),b.plotData(),b.invokeRenderlet(b)}},d.fadeDeselectedArea=function(){for(var a=0;a<e.length;++a){var b=e[a];b.brush(d.brush()),b.fadeDeselectedArea()}},d.compose=function(a){return e=a,d},d.children=function(){return e},d.yAxisMin=function(){return d3.min(g())},d.yAxisMax=function(){return dc.utils.add(d3.max(h()),d.yAxisPadding())},d.xAxisMin=function(){return dc.utils.subtract(d3.min(i()),d.xAxisPadding())},d.xAxisMax=function(){return dc.utils.add(d3.max(j()),d.xAxisPadding())},d.anchor(a,b)},dc.geoChoroplethChart=function(a,b){function f(a){var b=dc.utils.groupMax(c.group(),c.valueAccessor()),d=g();if(h(a)){var e=i(a);o(e,a,d,b),p(e,a,d)}}function g(){var a={},b=c.group().all();for(var d=0;d<b.length;++d)a[c.keyAccessor()(b[d])]=c.valueAccessor()(b[d]);return a}function h(a){return n(a).keyAccessor}function i(a){var b=c.svg().selectAll(j(a)).classed("selected",function(b){return k(a,b)}).classed("deselected",function(b){return l(a,b)}).attr("class",function(b){var c=n(a).name,d=dc.utils.nameToId(n(a).keyAccessor(b)),e=c+" "+d;return k(a,b)&&(e+=" selected"),l(a,b)&&(e+=" deselected"),e});return b}function j(a){return"g.layer"+a+" g."+n(a).name}function k(a,b){return c.hasFilter()&&c.filter()==m(a,b)}function l(a,b){return c.hasFilter()&&c.filter()!=m(a,b)}function m(a,b){return n(a).keyAccessor(b)}function n(a){return e[a]}function o(a,b,d,e){var f=a.select("path").attr("fill",function(a){var b=d3.select(this).attr("fill");return b?b:"none"}).on("click",function(a){return c.onClick(a,b)});dc.transition(f,c.transitionDuration()).attr("fill",function(a,e){return c.getColor(d[n(b).keyAccessor(a)],e)})}function p(a,b,d){c.renderTitle()&&a.selectAll("title").text(function(a){var e=m(b,a),f=d[e];return c.title()({key:e,value:f})})}var c=dc.singleSelectionChart(dc.colorChart(dc.baseChart({})));c.colorAccessor(function(a,b){return a});var d=d3.geo.path(),e=[];return c.doRender=function(){c.resetSvg();for(var a=0;a<e.length;++a){var b=c.svg().append("g").attr("class","layer"+a),g=b.selectAll("g."+n(a).name).data(n(a).data).enter().append("g").attr("class",n(a).name);g.append("path").attr("fill","white").attr("d",d),g.append("title"),f(a)}},c.onClick=function(a,b){var d=n(b).keyAccessor(a);d==c.filter()?dc.events.trigger(function(){c.filter(null),dc.redrawAll(c.chartGroup())}):dc.events.trigger(function(){c.filter(d),dc.redrawAll(c.chartGroup())})},c.doRedraw=function(){for(var a=0;a<e.length;++a)f(a)},c.overlayGeoJson=function(a,b,d){return e.push({name:b,data:a,keyAccessor:d}),c},c.projection=function(a){return d.projection(a),c},c.anchor(a,b)},dc.bubbleOverlay=function(a,b){function i(){return g=f.select("g."+c),g.empty()&&(g=f.svg().append("g").attr("class",c)),g}function j(){var a=k();h.forEach(function(b){var c=l(b,a),d=c.select("circle."+e);d.empty()&&(d=c.append("circle").attr("class",e).attr("r",0).attr("fill",f.initBubbleColor).on("click",f.onClick)),dc.transition(d,f.transitionDuration()).attr("r",function(a){return f.bubbleR(a)}),f.doRenderLabel(c),f.doRenderTitles(c)})}function k(){var a={};return f.group().all().forEach(function(b){a[f.keyAccessor()(b)]=b}),a}function l(a,b){var c=d+" "+dc.utils.nameToId(a.name),e=g.select("g."+dc.utils.nameToId(a.name));return e.empty()&&(e=g.append("g").attr("class",c).attr("transform","translate("+a.x+","+a.y+")")),e.datum(b[a.name]),e}function m(){var a=k();h.forEach(function(b){var c=l(b,a),d=c.select("circle."+e);dc.transition(d,f.transitionDuration()).attr("r",function(a){return f.bubbleR(a)}).attr("fill",f.updateBubbleColor),f.doUpdateLabels(c),f.doUpdateTitles(c)})}var c="bubble-overlay",d="node",e="bubble",f=dc.abstractBubbleChart(dc.baseChart({})),g,h=[];return f.transitionDuration(750),f.radiusValueAccessor(function(a){return a.value}),f.point=function(a,b,c){return h.push({name:a,x:b,y:c}),f},f.doRender=function(){return g=i(),f.r().range([f.MIN_RADIUS,f.width()*f.maxBubbleRelativeSize()]),j(),f.fadeDeselectedArea(),f},f.doRedraw=function(){return m(),f.fadeDeselectedArea(),f},f.debug=function(a){if(a){var b=f.select("g."+dc.constants.DEBUG_GROUP_CLASS);b.empty()&&(b=f.svg().append("g").attr("class",dc.constants.DEBUG_GROUP_CLASS));var c=b.append("text").attr("x",10).attr("y",20);b.append("rect").attr("width",f.width()).attr("height",f.height()).on("mousemove",function(){var a=d3.mouse(b.node()),d=a[0]+", "+a[1];c.text(d)})}else f.selectAll(".debug").remove();return f},f.anchor(a,b),f};