forked from dc-js/dc.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdc.min.js
21 lines (20 loc) · 107 KB
/
dc.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*!
* dc 3.1.3
* http://dc-js.github.io/dc.js/
* Copyright 2012-2019 Nick Zhu & the dc.js Developers
* https://github.com/dc-js/dc.js/blob/master/AUTHORS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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(){function t(nt,t){"use strict";var r,rt={version:"3.1.3",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};function i(t){return t=t||rt.constants.DEFAULT_CHART_GROUP,r[t]||(r[t]=[]),t}rt.chartRegistry=(r={},{has:function(t){for(var e in r)if(0<=r[e].indexOf(t))return!0;return!1},register:function(t,e){e=i(e),r[e].push(t)},deregister:function(t,e){e=i(e);for(var n=0;n<r[e].length;n++)if(r[e][n].anchorName()===t.anchorName()){r[e].splice(n,1);break}},clear:function(t){t?delete r[t]:r={}},list:function(t){return t=i(t),r[t]}}),rt.registerChart=function(t,e){rt.chartRegistry.register(t,e)},rt.deregisterChart=function(t,e){rt.chartRegistry.deregister(t,e)},rt.hasChart=function(t){return rt.chartRegistry.has(t)},rt.deregisterAllCharts=function(t){rt.chartRegistry.clear(t)},rt.filterAll=function(t){for(var e=rt.chartRegistry.list(t),n=0;n<e.length;++n)e[n].filterAll()},rt.refocusAll=function(t){for(var e=rt.chartRegistry.list(t),n=0;n<e.length;++n)e[n].focus&&e[n].focus()},rt.renderAll=function(t){for(var e=rt.chartRegistry.list(t),n=0;n<e.length;++n)e[n].render();null!==rt._renderlet&&rt._renderlet(t)},rt.redrawAll=function(t){for(var e=rt.chartRegistry.list(t),n=0;n<e.length;++n)e[n].redraw();null!==rt._renderlet&&rt._renderlet(t)},rt.disableTransitions=!1,rt.transition=function(t,e,n,r){if(rt.disableTransitions||e<=0)return t;var i=t.transition(r);return(0<=e||void 0!==e)&&(i=i.duration(e)),(0<=n||void 0!==n)&&(i=i.delay(n)),i},rt.optionalTransition=function(t,e,n,r){return t?function(t){return rt.transition(t,e,n,r)}:function(t){return t}},rt.afterTransition=function(t,e){if(t.empty()||!t.duration)e.call(t);else{var n=0;t.each(function(){++n}).on("end",function(){--n||e.call(t)})}},rt.units={},rt.units.integers=function(t,e){return Math.abs(e-t)},rt.units.ordinal=function(){throw new Error("dc.units.ordinal should not be called - it is a placeholder")},rt.units.fp={},rt.units.fp.precision=function(t){var r=function(t,e){var n=Math.abs((e-t)/r.resolution);return rt.utils.isNegligible(n-Math.floor(n))?Math.floor(n):Math.ceil(n)};return r.resolution=t,r},rt.round={},rt.round.floor=function(t){return Math.floor(t)},rt.round.ceil=function(t){return Math.ceil(t)},rt.round.round=function(t){return Math.round(t)},rt.override=function(t,e,n){var r=t[e];t["_"+e]=r,t[e]=n},rt.renderlet=function(t){return arguments.length?(rt._renderlet=t,rt):rt._renderlet},rt.instanceOfChart=function(t){return t instanceof Object&&t.__dcFlag__&&!0},Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),n=e.length;0<=--n&&e.item(n)!==this;);return-1<n}),rt.errors={},rt.errors.Exception=function(t){var e=t||"Unexpected internal error";this.message=e,this.toString=function(){return e},this.stack=(new Error).stack},rt.errors.Exception.prototype=Object.create(Error.prototype),rt.errors.Exception.prototype.constructor=rt.errors.Exception,rt.errors.InvalidStateException=function(){rt.errors.Exception.apply(this,arguments)},rt.errors.InvalidStateException.prototype=Object.create(rt.errors.Exception.prototype),rt.errors.InvalidStateException.prototype.constructor=rt.errors.InvalidStateException,rt.errors.BadArgumentException=function(){rt.errors.Exception.apply(this,arguments)},rt.errors.BadArgumentException.prototype=Object.create(rt.errors.Exception.prototype),rt.errors.BadArgumentException.prototype.constructor=rt.errors.BadArgumentException,rt.dateFormat=nt.timeFormat("%m/%d/%Y"),rt.printers={},rt.printers.filters=function(t){for(var e="",n=0;n<t.length;++n)0<n&&(e+=", "),e+=rt.printers.filter(t[n]);return e},rt.printers.filter=function(t){var e="";return null!=t&&(t instanceof Array?2<=t.length?e="["+t.map(function(t){return rt.utils.printSingleValue(t)}).join(" -> ")+"]":1<=t.length&&(e=rt.utils.printSingleValue(t[0])):e=rt.utils.printSingleValue(t)),e},rt.pluck=function(n,r){return r?function(t,e){return r.call(t,t[n],e)}:function(t){return t[n]}},rt.utils={},rt.utils.printSingleValue=function(t){var e=""+t;return t instanceof Date?e=rt.dateFormat(t):"string"==typeof t?e=t:rt.utils.isFloat(t)?e=rt.utils.printSingleValue.fformat(t):rt.utils.isInteger(t)&&(e=Math.round(t)),e},rt.utils.printSingleValue.fformat=nt.format(".2f"),rt.utils.toTimeFunc=function(t){return"time"+t.charAt(0).toUpperCase()+t.slice(1)},rt.utils.add=function(t,e,n){if("string"==typeof e&&(e=e.replace("%","")),t instanceof Date)return"string"==typeof e&&(e=+e),"millis"===n?new Date(t.getTime()+e):("function"!=typeof(n=n||nt.timeDay)&&(n=nt[rt.utils.toTimeFunc(n)]),n.offset(t,e));if("string"!=typeof e)return t+e;var r=+e/100;return 0<t?t*(1+r):t*(1-r)},rt.utils.subtract=function(t,e,n){if("string"==typeof e&&(e=e.replace("%","")),t instanceof Date)return"string"==typeof e&&(e=+e),"millis"===n?new Date(t.getTime()-e):("function"!=typeof(n=n||nt.timeDay)&&(n=nt[rt.utils.toTimeFunc(n)]),n.offset(t,-e));if("string"!=typeof e)return t-e;var r=+e/100;return t<0?t*(1+r):t*(1-r)},rt.utils.isNumber=function(t){return t===+t},rt.utils.isFloat=function(t){return t===+t&&t!==(0|t)},rt.utils.isInteger=function(t){return t===+t&&t===(0|t)},rt.utils.isNegligible=function(t){return!rt.utils.isNumber(t)||t<rt.constants.NEGLIGIBLE_NUMBER&&t>-rt.constants.NEGLIGIBLE_NUMBER},rt.utils.clamp=function(t,e,n){return t<e?e:n<t?n:t},rt.utils.constant=function(t){return function(){return t}};var a,e,n,o,l,u=0;function h(t,e){for(var n=0;n<t.length;n++)if(t[n].key===e)return t[n]}function c(t){return[0,t.length-1]}function s(t){return[nt.quantile(t,.25),nt.quantile(t,.5),nt.quantile(t,.75)]}return rt.utils.uniqueId=function(){return++u},rt.utils.nameToId=function(t){return t.toLowerCase().replace(/[\s]/g,"_").replace(/[\.']/g,"")},rt.utils.appendOrSelect=function(t,e,n){n=n||e;var r=t.select(e);return r.empty()&&(r=t.append(n)),r},rt.utils.safeNumber=function(t){return rt.utils.isNumber(+t)?+t:0},rt.utils.arraysEqual=function(t,n){return!t&&!n||!(!t||!n)&&(t.length===n.length&&t.every(function(t,e){return t.valueOf()===n[e].valueOf()}))},rt.utils.allChildren=function(t){var e=[];if(e.push(t.path),console.log("currentNode",t),t.children)for(var n=0;n<t.children.length;n++)e=e.concat(rt.utils.allChildren(t.children[n]));return e},rt.utils.toHierarchy=function(t,e){for(var n={key:"root",children:[]},r=0;r<t.length;r++)for(var i=t[r],a=i.key,o=e(i),l=n,u=0;u<a.length;u++){var c,s=a.slice(0,u+1),d=l.children,f=a[u];u+1<a.length?(void 0===(c=h(d,f))&&(c={key:f,children:[],path:s},d.push(c)),l=c):(c={key:f,value:o,data:i,path:s},d.push(c))}return n},rt.utils.getAncestors=function(t){for(var e=[],n=t;n.parent;)e.unshift(n.name),n=n.parent;return e},rt.utils.arraysIdentical=function(t,e){var n=t.length;if(n!==e.length)return!1;for(;n--;)if(t[n]!==e[n])return!1;return!0},"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null===t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(null!==i)for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])}return n},writable:!0,configurable:!0}),rt.logger=((a={enableDebugLog:!(e={}),warn:function(t){return console&&(console.warn?console.warn(t):console.log&&console.log(t)),a}}).warnOnce=function(t){return e[t]||(e[t]=!0,rt.logger.warn(t)),a},a.debug=function(t){return a.enableDebugLog&&console&&(console.debug?console.debug(t):console.log&&console.log(t)),a},a.deprecate=function(t,e){var n=!1;return function(){return n||(a.warn(e),n=!0),t.apply(this,arguments)}},a.annotate=function(t,e){var n=!1;return function(){return n||(console.groupCollapsed(e),console.trace(),console.groupEnd(),n=!0),t.apply(this,arguments)}},a),rt.config=(l=o=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"],(n={}).defaultColors=function(t){return arguments.length?(l=t,n):(l===o&&rt.logger.warnOnce("You are using d3.schemeCategory20c, which has been removed in D3v5. See the explanation at https://github.com/d3/d3/blob/master/CHANGES.md#changes-in-d3-50. DC is using it for backward compatibility, however it will be changed in DCv3.1. You can change it by calling dc.config.defaultColors(newScheme). See https://github.com/d3/d3-scale-chromatic for some alternatives."),l)},n),rt.events={current:null},rt.events.trigger=function(t,e){e?(rt.events.current=t,setTimeout(function(){t===rt.events.current&&t()},e)):t()},rt.filters={},rt.filters.RangedFilter=function(t,e){var n=new Array(t,e);return n.isFiltered=function(t){return t>=this[0]&&t<this[1]},n.filterType="RangedFilter",n},rt.filters.TwoDimensionalFilter=function(t){if(null===t)return null;var e=t;return e.isFiltered=function(t){return t.length&&t.length===e.length&&t[0]===e[0]&&t[1]===e[1]},e.filterType="TwoDimensionalFilter",e},rt.filters.RangedTwoDimensionalFilter=function(t){if(null===t)return null;var r,e=t;return r=e[0]instanceof Array?[[Math.min(t[0][0],t[1][0]),Math.min(t[0][1],t[1][1])],[Math.max(t[0][0],t[1][0]),Math.max(t[0][1],t[1][1])]]:[[t[0],-1/0],[t[1],1/0]],e.isFiltered=function(t){var e,n;return n=t instanceof Array?(e=t[0],t[1]):(e=t,r[0][1]),e>=r[0][0]&&e<r[1][0]&&n>=r[0][1]&&n<r[1][1]},e.filterType="RangedTwoDimensionalFilter",e},rt.filters.HierarchyFilter=function(t){if(null===t)return null;var n=t.slice(0);return n.isFiltered=function(t){if(!(n.length&&t&&t.length&&t.length>=n.length))return!1;for(var e=0;e<n.length;e++)if(t[e]!==n[e])return!1;return!0},n},rt.baseMixin=function(r){var e,n,i,a,o,l;r.__dcFlag__=rt.utils.uniqueId();function u(t){var e=t&&t.getBoundingClientRect&&t.getBoundingClientRect().width;return e&&g<e?e:g}function c(t){var e=t&&t.getBoundingClientRect&&t.getBoundingClientRect().height;return e&&y<e?e:y}var s,d,f,h,g=200,p=u,y=200,v=c,m=!1,x=rt.pluck("key"),A=rt.pluck("value"),b=rt.pluck("key"),_=rt.pluck("key"),k=!1,D=function(t){return r.keyAccessor()(t)+": "+r.valueAccessor()(t)},w=!0,C=!1,S=750,E=0,L=rt.printers.filters,M=["dimension","group"],R=rt.constants.DEFAULT_CHART_GROUP,O=nt.dispatch("preRender","postRender","preRedraw","postRedraw","filtered","zoomed","renderlet","pretransition"),T=[],B=function(t,r){return 0===r.length?t.filter(null):1!==r.length||r[0].isFiltered?1===r.length&&"RangedFilter"===r[0].filterType?t.filterRange(r[0]):t.filterFunction(function(t){for(var e=0;e<r.length;e++){var n=r[e];if(n.isFiltered&&n.isFiltered(t))return!0;if(n<=t&&t<=n)return!0}return!1}):t.filterExact(r[0]),r},F=function(t){return t.all()};function N(){o&&(m?o.attr("viewBox")||o.attr("viewBox","0 0 "+r.width()+" "+r.height()):o.attr("width",r.width()).attr("height",r.height()))}function H(t){if(!r[t]||!r[t]())throw new rt.errors.InvalidStateException("Mandatory attribute chart."+t+" is missing on chart[#"+r.anchorName()+"]")}r.height=function(t){return arguments.length?(v=t?"function"==typeof t?t:rt.utils.constant(t):c,d=void 0,r):(rt.utils.isNumber(d)||(d=v(a.node())),d)},r.width=function(t){return arguments.length?(p=t?"function"==typeof t?t:rt.utils.constant(t):u,s=void 0,r):(rt.utils.isNumber(s)||(s=p(a.node())),s)},r.minWidth=function(t){return arguments.length?(g=t,r):g},r.minHeight=function(t){return arguments.length?(y=t,r):y},r.useViewBoxResizing=function(t){return arguments.length?(m=t,r):m},r.dimension=function(t){return arguments.length?(e=t,r.expireCache(),r):e},r.data=function(t){return arguments.length?(F="function"==typeof t?t:rt.utils.constant(t),r.expireCache(),r):F.call(r,n)},r.group=function(t,e){return arguments.length?(n=t,r._groupName=e,r.expireCache(),r):n},r.ordering=function(t){return arguments.length?(_=t,r.expireCache(),r):_},r._computeOrderedGroups=function(t){return Array.from(t).sort(function(t,e){return _(t)-_(e)})},r.filterAll=function(){return r.filter(null)},r.select=function(t){return a.select(t)},r.selectAll=function(t){return a?a.selectAll(t):null},r.anchor=function(t,e){if(!arguments.length)return i;if(rt.instanceOfChart(t))(i=t.anchor()).children&&(i="#"+t.anchorName()),a=t.root(),l=!0;else{if(!t)throw new rt.errors.BadArgumentException("parent must be defined");i=t.select&&t.classed?t.node():t,(a=nt.select(i)).classed(rt.constants.CHART_CLASS,!0),rt.registerChart(r,e),l=!1}return R=e,r},r.anchorName=function(){var t=r.anchor();return t&&t.id?t.id:t&&t.replace?t.replace("#",""):"dc-chart"+r.chartID()},r.root=function(t){return arguments.length?(a=t,r):a},r.svg=function(t){return arguments.length?(o=t,r):o},r.resetSvg=function(){return r.select("svg").remove(),o=r.root().append("svg"),N(),o},r.filterPrinter=function(t){return arguments.length?(L=t,r):L},r.controlsUseVisibility=function(t){return arguments.length?(C=t,r):C},r.turnOnControls=function(){if(a){var t=r.controlsUseVisibility()?"visibility":"display";r.selectAll(".reset").style(t,null),r.selectAll(".filter").text(L(r.filters())).style(t,null)}return r},r.turnOffControls=function(){if(a){var t=r.controlsUseVisibility()?"visibility":"display",e=r.controlsUseVisibility()?"hidden":"none";r.selectAll(".reset").style(t,e),r.selectAll(".filter").style(t,e).text(r.filter())}return r},r.transitionDuration=function(t){return arguments.length?(S=t,r):S},r.transitionDelay=function(t){return arguments.length?(E=t,r):E},r._mandatoryAttributes=function(t){return arguments.length?(M=t,r):M},r.render=function(){d=s=void 0,O.call("preRender",r,r),M&&M.forEach(H);var t=r._doRender();return f&&f.render(),r._activateRenderlets("postRender"),t},r._activateRenderlets=function(t){O.call("pretransition",r,r),0<r.transitionDuration()&&o?o.transition().duration(r.transitionDuration()).delay(r.transitionDelay()).on("end",function(){O.call("renderlet",r,r),t&&O.call(t,r,r)}):(O.call("renderlet",r,r),t&&O.call(t,r,r))},r.redraw=function(){N(),O.call("preRedraw",r,r);var t=r._doRedraw();return f&&f.render(),r._activateRenderlets("postRedraw"),t},r.commitHandler=function(t){return arguments.length?(h=t,r):h},r.redrawGroup=function(){return h?h(!1,function(t,e){t?console.log(t):rt.redrawAll(r.chartGroup())}):rt.redrawAll(r.chartGroup()),r},r.renderGroup=function(){return h?h(!1,function(t,e){t?console.log(t):rt.renderAll(r.chartGroup())}):rt.renderAll(r.chartGroup()),r},r._invokeFilteredListener=function(t){void 0!==t&&O.call("filtered",r,r,t)},r._invokeZoomedListener=function(){O.call("zoomed",r,r)};var G=function(t,e){return null==e?0<t.length:t.some(function(t){return e<=t&&t<=e})};r.hasFilterHandler=function(t){return arguments.length?(G=t,r):G},r.hasFilter=function(t){return G(T,t)};var P=function(t,e){for(var n=0;n<t.length;n++)if(t[n]<=e&&t[n]>=e){t.splice(n,1);break}return t};r.removeFilterHandler=function(t){return arguments.length?(P=t,r):P};var I=function(t,e){return t.push(e),t};r.addFilterHandler=function(t){return arguments.length?(I=t,r):I};var U=function(t){return[]};return r.resetFilterHandler=function(t){return arguments.length?(U=t,r):U},r.replaceFilter=function(t){return T=U(T),r.filter(t),r},r.filter=function(t){if(!arguments.length)return 0<T.length?T[0]:null;var e=T;return t instanceof Array&&t[0]instanceof Array&&!t.isFiltered?t[0].forEach(function(t){e=G(e,t)?P(e,t):I(e,t)}):e=null===t?U(e):G(e,t)?P(e,t):I(e,t),T=function(t){if(r.dimension()&&r.dimension().filter){var e=B(r.dimension(),t);e&&(t=e)}return t}(e),r._invokeFilteredListener(t),null!==a&&r.hasFilter()?r.turnOnControls():r.turnOffControls(),r},r.filters=function(){return T},r.highlightSelected=function(t){nt.select(t).classed(rt.constants.SELECTED_CLASS,!0),nt.select(t).classed(rt.constants.DESELECTED_CLASS,!1)},r.fadeDeselected=function(t){nt.select(t).classed(rt.constants.SELECTED_CLASS,!1),nt.select(t).classed(rt.constants.DESELECTED_CLASS,!0)},r.resetHighlight=function(t){nt.select(t).classed(rt.constants.SELECTED_CLASS,!1),nt.select(t).classed(rt.constants.DESELECTED_CLASS,!1)},r.onClick=function(t){var e=r.keyAccessor()(t);rt.events.trigger(function(){r.filter(e),r.redrawGroup()})},r.filterHandler=function(t){return arguments.length?(B=t,r):B},r._doRender=function(){return r},r._doRedraw=function(){return r},r.legendables=function(){return[]},r.legendHighlight=function(){},r.legendReset=function(){},r.legendToggle=function(){},r.isLegendableHidden=function(){return!1},r.keyAccessor=function(t){return arguments.length?(x=t,r):x},r.valueAccessor=function(t){return arguments.length?(A=t,r):A},r.label=function(t,e){return arguments.length?(b=t,void 0!==e&&!e||(k=!0),r):b},r.renderLabel=function(t){return arguments.length?(k=t,r):k},r.title=function(t){return arguments.length?(D=t,r):D},r.renderTitle=function(t){return arguments.length?(w=t,r):w},r.renderlet=rt.logger.deprecate(function(t){return r.on("renderlet."+rt.utils.uniqueId(),t),r},'chart.renderlet has been deprecated. Please use chart.on("renderlet.<renderletKey>", renderletFunction)'),r.chartGroup=function(t){return arguments.length?(l||rt.deregisterChart(r,R),R=t,l||rt.registerChart(r,R),r):R},r.expireCache=function(){return r},r.legend=function(t){return arguments.length?((f=t).parent(r),r):f},r.chartID=function(){return r.__dcFlag__},r.options=function(t){var e=["anchor","group","xAxisLabel","yAxisLabel","stack","title","point","getColor","overlayGeoJson"];for(var n in t)"function"==typeof r[n]?t[n]instanceof Array&&-1!==e.indexOf(n)?r[n].apply(r,t[n]):r[n].call(r,t[n]):rt.logger.debug("Not a valid option setter name: "+n);return r},r.on=function(t,e){return O.on(t,e),r},r},rt.marginMixin=function(e){var n={top:10,right:50,bottom:30,left:30};return e.margins=function(t){return arguments.length?(n=t,e):n},e.effectiveWidth=function(){return e.width()-e.margins().left-e.margins().right},e.effectiveHeight=function(){return e.height()-e.margins().top-e.margins().bottom},e},rt.colorMixin=function(e){var n,r=nt.scaleOrdinal(rt.config.defaultColors()),i=!0,a=function(t){return e.keyAccessor()(t)};return e.colors=function(t){return arguments.length?(r=t instanceof Array?nt.scaleQuantize().range(t):"function"==typeof t?t:rt.utils.constant(t),e):r},e.ordinalColors=function(t){return e.colors(nt.scaleOrdinal().range(t))},e.linearColors=function(t){return e.colors(nt.scaleLinear().range(t).interpolate(nt.interpolateHcl))},e.colorAccessor=function(t){return arguments.length?(a=t,i=!1,e):a},e.defaultColorAccessor=function(){return i},e.colorDomain=function(t){return arguments.length?(r.domain(t),e):r.domain()},e.calculateColorDomain=function(){var t=[nt.min(e.data(),e.colorAccessor()),nt.max(e.data(),e.colorAccessor())];return r.domain(t),e},e.getColor=function(t,e){return n?n.call(this,t,e):r(a.call(this,t,e))},e.colorCalculator=function(t){return arguments.length?(n=t,e):n||e.getColor},e},rt.coordinateGridMixin=function(l){var i,n,r,a,e,o,u="grid-line",c="horizontal",s="vertical",d="y-axis-label",f="x-axis-label",h="custom-brush-handle";(l=rt.colorMixin(rt.marginMixin(rt.baseMixin(l)))).colors(nt.scaleOrdinal(nt.schemeCategory10)),l._mandatoryAttributes().push("x");var g,p,y,v,m,x,t,A,b,_=nt.axisBottom(),k=rt.units.integers,D=0,w=nt.timeDay,C=!1,S=0,E=null,L=0,M=!1,R=0,O=nt.brushX(),T=!0,B=!1,F=!1,N=!1,H=!1,G=[1,1/0],P=!0,I=nt.zoom().on("zoom",function(){if(!nt.event.sourceEvent)return;if(nt.event.sourceEvent.type&&-1!==["start","zoom","end"].indexOf(nt.event.sourceEvent.type))return;var t=nt.event.transform.rescaleX(e).domain();l.focus(t,!1)}),U=nt.zoom().on("zoom",null),Y=!1,z=!1,V=0,j=.5,q=0,X=!1;function W(t,e){l.isOrdinal()?(a.bandwidth||(rt.logger.warn("For compatibility with d3v4+, dc.js d3.0 ordinal bar/line/bubble charts need d3.scaleBand() for the x scale, instead of d3.scaleOrdinal(). Replacing .x() with a d3.scaleBand with the same domain - make the same change in your code to avoid this warning!"),a=nt.scaleBand().domain(a.domain())),!l.elasticX()&&0!==a.domain().length||a.domain(l._ordinalXDomain())):l.elasticX()&&a.domain([l.xAxisMin(),l.xAxisMax()]);var n=a.domain();!e&&rt.utils.arraysEqual(p,n)||l.rescale(),p=n,l.isOrdinal()?a.range([0,l.xAxisLength()]).paddingInner(q).paddingOuter(l._useOuterPadding()?j:0):a.range([0,l.xAxisLength()]),_=_.scale(l.x()),function(t){var e=t.select("g."+s);if(N){e.empty()&&(e=t.insert("g",":first-child").attr("class",u+" "+s).attr("transform","translate("+l.margins().left+","+l.margins().top+")"));var n=_.tickValues()?_.tickValues():"function"==typeof a.ticks?a.ticks.apply(a,_.tickArguments()):a.domain(),r=e.selectAll("line").data(n),i=r.enter().append("line").attr("x1",function(t){return a(t)}).attr("y1",l._xAxisY()-l.margins().top).attr("x2",function(t){return a(t)}).attr("y2",0).attr("opacity",0);rt.transition(i,l.transitionDuration(),l.transitionDelay()).attr("opacity",.5),rt.transition(r,l.transitionDuration(),l.transitionDelay()).attr("x1",function(t){return a(t)}).attr("y1",l._xAxisY()-l.margins().top).attr("x2",function(t){return a(t)}).attr("y2",0),r.exit().remove()}else e.selectAll("line").remove()}(t)}function K(){return X?nt.axisRight():nt.axisLeft()}function Z(){return l.anchorName().replace(/[ .#=\[\]"]/g,"-")+"-clip"}function J(){var t=rt.utils.appendOrSelect(i,"defs"),e=Z(),n=rt.utils.appendOrSelect(t,"#"+e,"clipPath").attr("id",e),r=2*V;rt.utils.appendOrSelect(n,"rect").attr("width",l.xAxisLength()+r).attr("height",l.yAxisHeight()+r).attr("transform","translate(-"+V+", -"+V+")")}function Q(t){l.isOrdinal()&&(T=!1),W(l.g(),t),l._prepareYAxis(l.g()),l.plotData(),(l.elasticX()||H||t)&&l.renderXAxis(l.g()),(l.elasticY()||H||t)&&l.renderYAxis(l.g()),t?l.renderBrush(l.g(),!1):l.redrawBrush(l.filter(),H),l.fadeDeselectedArea(l.filter()),H=!1}function $(t,e){var n;n=function(t){return t instanceof Array&&1<t.length}(t)?(l.x().domain(t),rt.filters.RangedFilter(t[0],t[1])):(l.x().domain(o),null),l.replaceFilter(n),l.rescale(),l.redraw(),e||(A&&!rt.utils.arraysEqual(l.filter(),A.filter())&&rt.events.trigger(function(){A.replaceFilter(n),A.redraw()}),l._invokeZoomedListener(),rt.events.trigger(function(){l.redrawGroup()},rt.constants.EVENT_DELAY))}function tt(){I&&I.transform(l.root(),function(t,e,n){var r=(e[1]-e[0])/(t[1]-t[0]),i=-1*n(t[0]);return nt.zoomIdentity.scale(r).translate(i,0)}(l.x().domain(),o,e))}function et(t,e){return t&&2===t.length&&e&&2===e.length?((t[0]>e[1]||t[1]<e[0])&&console.warn("Could not intersect extents, will reset"),[t[0]>e[0]?t[0]:e[0],t[1]<e[1]?t[1]:e[1]]):t}return l.rescale=function(){return H=!(t=void 0),l},l.resizing=function(){return H},l.rangeChart=function(t){return arguments.length?((A=t).focusChart(l),l):A},l.zoomScale=function(t){return arguments.length?(G=t,l):G},l.zoomOutRestrict=function(t){return arguments.length?(P=t,l):P},l._generateG=function(t){i=void 0===t?l.svg():t;var e=window.location.href.split("#")[0];return n=i.append("g"),r=n.append("g").attr("class","chart-body").attr("transform","translate("+l.margins().left+", "+l.margins().top+")").attr("clip-path","url("+e+"#"+Z()+")"),n},l.g=function(t){return arguments.length?(n=t,l):n},l.mouseZoomable=function(t){return arguments.length?(z=t,l):z},l.chartBodyG=function(t){return arguments.length?(r=t,l):r},l.x=function(t){return arguments.length?(o=(a=t).domain(),l.rescale(),l):a},l.xOriginalDomain=function(){return o},l.xUnits=function(t){return arguments.length?(k=t,l):k},l.xAxis=function(t){return arguments.length?(_=t,l):_},l.elasticX=function(t){return arguments.length?(C=t,l):C},l.xAxisPadding=function(t){return arguments.length?(D=t,l):D},l.xAxisPaddingUnit=function(t){return arguments.length?(w=t,l):w},l.xUnitCount=function(){return void 0===t&&(l.isOrdinal()?t=l.x().domain().length:(t=l.xUnits()(l.x().domain()[0],l.x().domain()[1]))instanceof Array&&(t=t.length)),t},l.useRightYAxis=function(t){return arguments.length?(X!==t&&E&&rt.logger.warn("Value of useRightYAxis has been altered, after yAxis was created. You might get unexpected yAxis behavior. Make calls to useRightYAxis sooner in your chart creation process."),X=t,l):X},l.isOrdinal=function(){return l.xUnits()===rt.units.ordinal},l._useOuterPadding=function(){return!0},l._ordinalXDomain=function(){return l._computeOrderedGroups(l.data()).map(l.keyAccessor())},l.renderXAxis=function(t){var e=t.select("g.x");e.empty()&&(e=t.append("g").attr("class","axis x").attr("transform","translate("+l.margins().left+","+l._xAxisY()+")"));var n=t.select("text."+f);n.empty()&&l.xAxisLabel()&&(n=t.append("text").attr("class",f).attr("transform","translate("+(l.margins().left+l.xAxisLength()/2)+","+(l.height()-S)+")").attr("text-anchor","middle")),l.xAxisLabel()&&n.text()!==l.xAxisLabel()&&n.text(l.xAxisLabel()),rt.transition(e,l.transitionDuration(),l.transitionDelay()).attr("transform","translate("+l.margins().left+","+l._xAxisY()+")").call(_),rt.transition(n,l.transitionDuration(),l.transitionDelay()).attr("transform","translate("+(l.margins().left+l.xAxisLength()/2)+","+(l.height()-S)+")")},l._xAxisY=function(){return l.height()-l.margins().bottom},l.xAxisLength=function(){return l.effectiveWidth()},l.xAxisLabel=function(t,e){return arguments.length?(g=t,l.margins().bottom-=S,S=void 0===e?12:e,l.margins().bottom+=S,l):g},l._prepareYAxis=function(t){if(void 0===y||l.elasticY()){void 0===y&&(y=nt.scaleLinear());var e=l.yAxisMin()||0,n=l.yAxisMax()||0;y.domain([e,n]).rangeRound([l.yAxisHeight(),0])}y.range([l.yAxisHeight(),0]),(E=E||K()).scale(y),l._renderHorizontalGridLinesForAxis(t,y,E)},l.renderYAxisLabel=function(t,e,n,r){r=r||R;var i=l.g().select("text."+d+"."+t+"-label"),a=l.margins().top+l.yAxisHeight()/2;i.empty()&&e&&(i=l.g().append("text").attr("transform","translate("+r+","+a+"),rotate("+n+")").attr("class",d+" "+t+"-label").attr("text-anchor","middle").text(e)),e&&i.text()!==e&&i.text(e),rt.transition(i,l.transitionDuration(),l.transitionDelay()).attr("transform","translate("+r+","+a+"),rotate("+n+")")},l.renderYAxisAt=function(t,e,n){var r=l.g().select("g."+t);r.empty()&&(r=l.g().append("g").attr("class","axis "+t).attr("transform","translate("+n+","+l.margins().top+")")),rt.transition(r,l.transitionDuration(),l.transitionDelay()).attr("transform","translate("+n+","+l.margins().top+")").call(e)},l.renderYAxis=function(){var t=X?l.width()-l.margins().right:l._yAxisX();l.renderYAxisAt("y",E,t);var e=X?l.width()-R:R,n=X?90:-90;l.renderYAxisLabel("y",l.yAxisLabel(),n,e)},l._renderHorizontalGridLinesForAxis=function(t,e,n){var r=t.select("g."+c);if(F){var i=n.tickValues()?n.tickValues():e.ticks?e.ticks.apply(e,n.tickArguments()):e.domain();r.empty()&&(r=t.insert("g",":first-child").attr("class",u+" "+c).attr("transform","translate("+l.margins().left+","+l.margins().top+")"));var a=r.selectAll("line").data(i),o=a.enter().append("line").attr("x1",1).attr("y1",function(t){return e(t)}).attr("x2",l.xAxisLength()).attr("y2",function(t){return e(t)}).attr("opacity",0);rt.transition(o,l.transitionDuration(),l.transitionDelay()).attr("opacity",.5),rt.transition(a,l.transitionDuration(),l.transitionDelay()).attr("x1",1).attr("y1",function(t){return e(t)}).attr("x2",l.xAxisLength()).attr("y2",function(t){return e(t)}),a.exit().remove()}else r.selectAll("line").remove()},l._yAxisX=function(){return l.useRightYAxis()?l.width()-l.margins().right:l.margins().left},l.yAxisLabel=function(t,e){return arguments.length?(v=t,l.margins().left-=R,R=void 0===e?12:e,l.margins().left+=R,l):v},l.y=function(t){return arguments.length?(y=t,l.rescale(),l):y},l.yAxis=function(t){return arguments.length?(E=t,l):E=E||K()},l.elasticY=function(t){return arguments.length?(M=t,l):M},l.renderHorizontalGridLines=function(t){return arguments.length?(F=t,l):F},l.renderVerticalGridLines=function(t){return arguments.length?(N=t,l):N},l.xAxisMin=function(){var t=nt.min(l.data(),function(t){return l.keyAccessor()(t)});return rt.utils.subtract(t,D,w)},l.xAxisMax=function(){var t=nt.max(l.data(),function(t){return l.keyAccessor()(t)});return rt.utils.add(t,D,w)},l.yAxisMin=function(){var t=nt.min(l.data(),function(t){return l.valueAccessor()(t)});return rt.utils.subtract(t,L)},l.yAxisMax=function(){var t=nt.max(l.data(),function(t){return l.valueAccessor()(t)});return rt.utils.add(t,L)},l.yAxisPadding=function(t){return arguments.length?(L=t,l):L},l.yAxisHeight=function(){return l.effectiveHeight()},l.round=function(t){return arguments.length?(x=t,l):x},l._rangeBandPadding=function(t){return arguments.length?(q=t,l):q},l._outerRangeBandPadding=function(t){return arguments.length?(j=t,l):j},rt.override(l,"filter",function(t){return arguments.length?(l._filter(t),l.redrawBrush(t,!1),l):l._filter()}),l.brush=function(t){return arguments.length?(O=t,l):O},l.renderBrush=function(t,e){T&&(O.on("start brush end",l._brushing),m=t.append("g").attr("class","brush").attr("transform","translate("+l.margins().left+","+l.margins().top+")"),l.setBrushExtents(),l.createBrushHandlePaths(m,e),l.redrawBrush(l.filter(),e))},l.createBrushHandlePaths=function(t){var e=t.selectAll("path."+h).data([{type:"w"},{type:"e"}]);(e=e.enter().append("path").attr("class",h).merge(e)).attr("d",l.resizeHandlePath)},l.extendBrush=function(t){return t&&l.round()&&(t[0]=l.round()(t[0]),t[1]=l.round()(t[1])),t},l.brushIsEmpty=function(t){return!t||t[1]<=t[0]},l._brushing=function(){if(nt.event.sourceEvent&&(!nt.event.sourceEvent.type||-1===["start","brush","end"].indexOf(nt.event.sourceEvent.type))){var t=nt.event.selection;t=t&&t.map(l.x().invert),t=l.extendBrush(t),l.redrawBrush(t,!1);var e=l.brushIsEmpty(t)?null:rt.filters.RangedFilter(t[0],t[1]);rt.events.trigger(function(){l.applyBrushSelection(e)},rt.constants.EVENT_DELAY)}},l.applyBrushSelection=function(t){l.replaceFilter(t),l.redrawGroup()},l.setBrushExtents=function(t){O.extent([[0,0],[l.effectiveWidth(),l.effectiveHeight()]]),m.call(O)},l.redrawBrush=function(n,t){if(T&&m)if(H&&l.setBrushExtents(t),n){var e=[a(n[0]),a(n[1])],r=rt.optionalTransition(t,l.transitionDuration(),l.transitionDelay())(m);r.call(O.move,e),r.selectAll("path."+h).attr("display",null).attr("transform",function(t,e){return"translate("+a(n[e])+", 0)"}).attr("d",l.resizeHandlePath)}else m.call(O.move,null),m.selectAll("path."+h).attr("display","none");l.fadeDeselectedArea(n)},l.fadeDeselectedArea=function(t){},l.resizeHandlePath=function(t){var e=+("e"===(t=t.type)),n=e?1:-1,r=l.effectiveHeight()/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(6+r)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(8+r)+"V"+(2*r-8)+"M"+4.5*n+","+(8+r)+"V"+(2*r-8)},l.clipPadding=function(t){return arguments.length?(V=t,l):V},l._preprocessData=function(){},l._doRender=function(){return l.resetSvg(),l._preprocessData(),l._generateG(),J(),Q(!0),e=a.copy(),z?l._enableMouseZoom():Y&&l._disableMouseZoom(),l},l._doRedraw=function(){return l._preprocessData(),Q(!1),J(),l},l._enableMouseZoom=function(){Y=!0;var t=[[0,0],[l.effectiveWidth(),l.effectiveHeight()]];if(I.scaleExtent(G).extent(t).duration(l.transitionDuration()),P){var e=Math.max(G[0],1);I.translateExtent(t).scaleExtent([e,G[1]])}l.root().call(I),tt()},l._disableMouseZoom=function(){l.root().call(U)},l.focus=function(t,e){P&&(t=et(t,o),A&&(t=et(t,A.x().domain()))),$(t,e),tt()},l.refocused=function(){return!rt.utils.arraysEqual(l.x().domain(),o)},l.focusChart=function(t){return arguments.length?(b=t,l.on("filtered.dcjs-range-chart",function(t){t.filter()?rt.utils.arraysEqual(t.filter(),b.filter())||rt.events.trigger(function(){b.focus(t.filter(),!0)}):rt.events.trigger(function(){b.x().domain(b.xOriginalDomain(),!0)})}),l):b},l.brushOn=function(t){return arguments.length?(T=t,l):T},l.parentBrushOn=function(t){return arguments.length?(B=t,l):B},l.gBrush=function(){return m},l},rt.stackMixin=function(i){function n(n,t){var r=n.accessor||i.valueAccessor();n.name=String(n.name||t);var e=n.group.all().map(function(t,e){return{x:i.keyAccessor()(t,e),y:n.hidden?null:r(t,e),data:t,layer:n.name,hidden:n.hidden}});n.domainValues=e.filter(function(){if(!i.x())return rt.utils.constant(!0);var e=i.x().domain();if(i.isOrdinal())return function(){return!0};if(i.elasticX())return function(){return!0};return function(t){return t.x>=e[0]&&t.x<=e[e.length-1]}}()),n.values=i.evadeDomainFilter()?e:n.domainValues}var e=nt.stack(),a=[],r={},o=!1,l=!1;function u(t){var e=a.map(rt.pluck("name")).indexOf(t);return a[e]}function c(){var t=i.data().map(function(t){return t.domainValues});return Array.prototype.concat.apply([],t)}function s(t){return!t.hidden}return i.stack=function(t,e,n){if(!arguments.length)return a;arguments.length<=2&&(n=e);var r={group:t};return"string"==typeof e&&(r.name=e),"function"==typeof n&&(r.accessor=n),a.push(r),i},rt.override(i,"group",function(t,e,n){return arguments.length?(a=[],r={},i.stack(t,e),n&&i.valueAccessor(n),i._group(t,e)):i._group()}),i.hidableStacks=function(t){return arguments.length?(o=t,i):o},i.hideStack=function(t){var e=u(t);return e&&(e.hidden=!0),i},i.showStack=function(t){var e=u(t);return e&&(e.hidden=!1),i},i.getValueAccessorByIndex=function(t){return a[t].accessor||i.valueAccessor()},i.yAxisMin=function(){var t=nt.min(c(),function(t){return t.y<0?t.y+t.y0:t.y0});return rt.utils.subtract(t,i.yAxisPadding())},i.yAxisMax=function(){var t=nt.max(c(),function(t){return 0<t.y?t.y+t.y0:t.y0});return rt.utils.add(t,i.yAxisPadding())},i.xAxisMin=function(){var t=nt.min(c(),rt.pluck("x"));return rt.utils.subtract(t,i.xAxisPadding(),i.xAxisPaddingUnit())},i.xAxisMax=function(){var t=nt.max(c(),rt.pluck("x"));return rt.utils.add(t,i.xAxisPadding(),i.xAxisPaddingUnit())},rt.override(i,"title",function(t,e){return t?"function"==typeof t?i._title(t):t===i._groupName&&"function"==typeof e?i._title(e):"function"!=typeof e?r[t]||i._title():(r[t]=e,i):i._title()}),i.stackLayout=function(t){return arguments.length?(e=t,i):e},i.evadeDomainFilter=function(t){return arguments.length?(l=t,i):l},i.data(function(){var r=a.filter(s);if(!r.length)return[];r.forEach(n);var t=r[0].values.map(function(t,e){var n={x:t.x};return r.forEach(function(t){n[t.name]=t.values[e].y}),n}),e=r.map(function(t){return t.name});return i.stackLayout().keys(e)(t).forEach(function(t,n){t.forEach(function(t,e){r[n].values[e].y0=t[0],r[n].values[e].y1=t[1]})}),r}),i._ordinalXDomain=function(){var t=c().map(rt.pluck("data"));return i._computeOrderedGroups(t).map(i.keyAccessor())},i.colorAccessor(function(t){return this.layer||this.name||t.name||t.layer}),i.legendables=function(){return a.map(function(t,e){return{chart:i,name:t.name,hidden:t.hidden||!1,color:i.getColor.call(t,t.values,e)}})},i.isLegendableHidden=function(t){var e=u(t.name);return!!e&&e.hidden},i.legendToggle=function(t){o&&(i.isLegendableHidden(t)?i.showStack(t.name):i.hideStack(t.name),i.renderGroup())},i},rt.capMixin=function(i){var a=1/0,o=!0,e="Others";i.ordering(function(t){return-t.value});var l=function(t,e){var n=nt.sum(e,i.valueAccessor()),r=e.map(i.keyAccessor());return 0<n?t.concat([{others:r,key:i.othersLabel(),value:n}]):t};return i.cappedKeyAccessor=function(t,e){return t.others?t.key:i.keyAccessor()(t,e)},i.cappedValueAccessor=function(t,e){return t.others?t.value:i.valueAccessor()(t,e)},i.data(function(t){if(a===1/0)return i._computeOrderedGroups(t.all());var e,n=t.all();if(n=i._computeOrderedGroups(n),a)if(o)e=n.slice(a),n=n.slice(0,a);else{var r=Math.max(0,n.length-a);e=n.slice(0,r),n=n.slice(r)}return l?l(n,e):n}),i.cap=function(t){return arguments.length?(a=t,i):a},i.takeFront=function(t){return arguments.length?(o=t,i):o},i.othersLabel=function(t){return arguments.length?(e=t,i):e},i.othersGrouper=function(t){return arguments.length?(l=t,i):l},rt.override(i,"onClick",function(t){t.others&&i.filter([t.others]),i._onClick(t)}),i},rt.bubbleMixin=function(r){var e=.3,n=10,i=!1,a=!1;r.BUBBLE_NODE_CLASS="node",r.BUBBLE_CLASS="bubble",r.MIN_RADIUS=10,(r=rt.colorMixin(r)).renderLabel(!0),r.data(function(t){var e=t.all();if(i){var n=r.radiusValueAccessor();e.sort(function(t,e){return nt.descending(n(t),n(e))})}return e});var o=nt.scaleLinear().domain([0,100]),l=function(t){return t.r};r.r=function(t){return arguments.length?(o=t,r):o},r.elasticRadius=function(t){return arguments.length?(a=t,r):a},r.calculateRadiusDomain=function(){a&&r.r().domain([r.rMin(),r.rMax()])},r.radiusValueAccessor=function(t){return arguments.length?(l=t,r):l},r.rMin=function(){return nt.min(r.data(),function(t){return r.radiusValueAccessor()(t)})},r.rMax=function(){return nt.max(r.data(),function(t){return r.radiusValueAccessor()(t)})},r.bubbleR=function(t){var e=r.radiusValueAccessor()(t),n=r.r()(e);return(isNaN(n)||e<=0)&&(n=0),n};function u(t){return r.label()(t)}function c(t){return r.bubbleR(t)>n}function s(t){return c(t)?1:0}function d(t){return c(t)?"all":"none"}r._doRenderLabel=function(t){if(r.renderLabel()){var e=t.select("text");e.empty()&&(e=t.append("text").attr("text-anchor","middle").attr("dy",".3em").on("click",r.onClick)),e.attr("opacity",0).attr("pointer-events",d).text(u),rt.transition(e,r.transitionDuration(),r.transitionDelay()).attr("opacity",s)}},r.doUpdateLabels=function(t){if(r.renderLabel()){var e=t.select("text").attr("pointer-events",d).text(u);rt.transition(e,r.transitionDuration(),r.transitionDelay()).attr("opacity",s)}};function f(t){return r.title()(t)}return r._doRenderTitles=function(t){r.renderTitle()&&t.select("title").empty()&&t.append("title").text(f)},r.doUpdateTitles=function(t){r.renderTitle()&&t.select("title").text(f)},r.sortBubbleSize=function(t){return arguments.length?(i=t,r):i},r.minRadius=function(t){return arguments.length?(r.MIN_RADIUS=t,r):r.MIN_RADIUS},r.minRadiusWithLabel=function(t){return arguments.length?(n=t,r):n},r.maxBubbleRelativeSize=function(t){return arguments.length?(e=t,r):e},r.fadeDeselectedArea=function(t){r.hasFilter()?r.selectAll("g."+r.BUBBLE_NODE_CLASS).each(function(t){r.isSelectedNode(t)?r.highlightSelected(this):r.fadeDeselected(this)}):r.selectAll("g."+r.BUBBLE_NODE_CLASS).each(function(){r.resetHighlight(this)})},r.isSelectedNode=function(t){return r.hasFilter(t.key)},r.onClick=function(t){var e=t.key;rt.events.trigger(function(){r.filter(e),r.redrawGroup()})},r},rt.pieChart=function(t,e){var o,l,u,n,r,c,s="pie-slice",d="pie-label",f="pie-slice-group",h="pie-label-group",g="empty-chart",p="empty",i=0,a=0,y=.5,v=!1,m=rt.capMixin(rt.colorMixin(rt.baseMixin({})));function x(){var t=nt.min([m.width(),m.height()])/2;o=l&&l<t?l:t;var e,n=k(),r=nt.pie().sort(null).value(m.cappedValueAccessor);if(nt.sum(m.data(),m.cappedValueAccessor)?(e=r(m.data()),u.classed(g,!1)):(e=r([{key:p,value:1,others:[p]}]),u.classed(g,!0)),u){var i=u.select("g."+f).selectAll("g."+s).data(e),a=u.select("g."+h).selectAll("text."+d).data(e);!function(t,e){t.exit().remove(),e.exit().remove()}(i,a),function(t,e,n,r){var i=function(t){return t.enter().append("g").attr("class",function(t,e){return s+" _"+e})}(t);(function(t,n){var e=t.append("path").attr("fill",C).on("click",S).attr("d",function(t,e){return E(t,e,n)}),r=rt.transition(e,m.transitionDuration(),m.transitionDelay());r.attrTween&&r.attrTween("d",w)})(i,n),function(t){m.renderTitle()&&t.append("title").text(function(t){return m.title()(t.data)})}(i),function(t,e,n){if(m.renderLabel()){A(t.enter().append("text").attr("class",function(t,e){var n=s+" "+d+" _"+e;return c&&(n+=" external"),n}).on("click",S).on("mouseover",function(t,e){b(e,!0)}).on("mouseout",function(t,e){b(e,!1)}),n),c&&v&&_(e,n)}}(e,r,n)}(i,a,n,e),function(t,e){(function(t,n){var e=u.selectAll("g."+s).data(t).select("path").attr("d",function(t,e){return E(t,e,n)}),r=rt.transition(e,m.transitionDuration(),m.transitionDelay());r.attrTween&&r.attrTween("d",w);r.attr("fill",C)})(t,e),function(t,e){if(m.renderLabel()){A(u.selectAll("text."+d).data(t),e),c&&v&&_(t,e)}}(t,e),function(t){m.renderTitle()&&u.selectAll("g."+s).data(t).select("title").text(function(t){return m.title()(t.data)})}(t)}(e,n),m.hasFilter()?m.selectAll("g."+s).each(function(t){D(t)?m.highlightSelected(this):m.fadeDeselected(this)}):m.selectAll("g."+s).each(function(){m.resetHighlight(this)}),rt.transition(u,m.transitionDuration(),m.transitionDelay()).attr("transform","translate("+m.cx()+","+m.cy()+")")}}function A(t,e){m._applyLabelText(t),rt.transition(t,m.transitionDuration(),m.transitionDelay()).attr("transform",function(t){return function(t,e){var n;n=c?nt.arc().outerRadius(o-a+c).innerRadius(o-a+c).centroid(t):e.centroid(t);return isNaN(n[0])||isNaN(n[1])?"translate(0,0)":"translate("+n+")"}(t,e)}).attr("text-anchor","middle")}function b(t,e){m.select("g.pie-slice._"+t).classed("highlight",e)}function _(t,r){var e=u.selectAll("polyline."+s).data(t);e.exit().remove(),e=e.enter().append("polyline").attr("class",function(t,e){return"pie-path _"+e+" "+s}).on("click",S).on("mouseover",function(t,e){b(e,!0)}).on("mouseout",function(t,e){b(e,!1)}).merge(e);var i=nt.arc().outerRadius(o-a+c).innerRadius(o-a),n=rt.transition(e,m.transitionDuration(),m.transitionDelay());n.attrTween?n.attrTween("points",function(t){var e=this._current||t;e={startAngle:e.startAngle,endAngle:e.endAngle};var n=nt.interpolate(e,t);return this._current=n(0),function(t){var e=n(t);return[r.centroid(e),i.centroid(e)]}}):n.attr("points",function(t){return[r.centroid(t),i.centroid(t)]}),n.style("visibility",function(t){return t.endAngle-t.startAngle<1e-4?"hidden":"visible"})}function k(){return nt.arc().outerRadius(o-a).innerRadius(i)}function D(t){return m.hasFilter(m.cappedKeyAccessor(t.data))}function w(t){t.innerRadius=i;var e=this._current;e=function(t){return!t||isNaN(t.startAngle)||isNaN(t.endAngle)}(e)?{startAngle:0,endAngle:0}:{startAngle:e.startAngle,endAngle:e.endAngle};var n=nt.interpolate(e,t);return this._current=n(0),function(t){return E(n(t),0,k())}}function C(t,e){return m.getColor(t.data,e)}function S(t,e){u.attr("class")!==g&&m.onClick(t.data,e)}function E(t,e,n){var r=n(t,e);return 0<=r.indexOf("NaN")&&(r="M0,0"),r}function L(e,n){m.selectAll("g.pie-slice").each(function(t){e.name===t.data.key&&nt.select(this).classed("highlight",n)})}return m.colorAccessor(m.cappedKeyAccessor),m.title(function(t){return m.cappedKeyAccessor(t)+": "+m.cappedValueAccessor(t)}),m.slicesCap=m.cap,m.label(m.cappedKeyAccessor),m.renderLabel(!0),m.transitionDuration(350),m.transitionDelay(0),m._doRender=function(){return m.resetSvg(),(u=m.svg().append("g").attr("transform","translate("+m.cx()+","+m.cy()+")")).append("g").attr("class",f),u.append("g").attr("class",h),x(),m},m._applyLabelText=function(t){t.text(function(t){return!function(t){return 0===m.cappedValueAccessor(t)}(t.data)&&!function(t){var e=t.endAngle-t.startAngle;return isNaN(e)||e<y}(t)||D(t)?m.label()(t.data):""})},m.externalRadiusPadding=function(t){return arguments.length?(a=t,m):a},m.innerRadius=function(t){return arguments.length?(i=t,m):i},m.radius=function(t){return arguments.length?(l=t,m):l},m.cx=function(t){return arguments.length?(n=t,m):n||m.width()/2},m.cy=function(t){return arguments.length?(r=t,m):r||m.height()/2},m._doRedraw=function(){return x(),m},m.minAngleForLabel=function(t){return arguments.length?(y=t,m):y},m.emptyTitle=function(t){return 0===arguments.length?p:(p=t,m)},m.externalLabels=function(t){return 0===arguments.length?c:(c=t||void 0,m)},m.drawPaths=function(t){return 0===arguments.length?v:(v=t,m)},m.legendables=function(){return m.data().map(function(t,e){var n={name:t.key,data:t.value,others:t.others,chart:m};return n.color=m.getColor(t,e),n})},m.legendHighlight=function(t){L(t,!0)},m.legendReset=function(t){L(t,!1)},m.legendToggle=function(t){m.onClick({key:t.name,others:t.others})},m.anchor(t,e)},rt.sunburstChart=function(t,e){var i,a,o,n,r,l,u="pie-slice",c="empty-chart",s="empty",d=0,f=.5,h=rt.capMixin(rt.colorMixin(rt.baseMixin({})));function g(t){return t.path?t.value:h.cappedValueAccessor(t)}function p(){var t=nt.min([h.width(),h.height()])/2;i=a&&a<t?a:t;var e,n=v();if(nt.sum(h.data(),h.valueAccessor())?((e=m(rt.utils.toHierarchy(h.data(),h.valueAccessor()))).shift(),o.classed(c,!1)):(e=m(rt.utils.toHierarchy([],function(t){return t.value})),o.classed(c,!0)),o){var r=o.selectAll("g."+u).data(e);!function(t,e,n){var r=function(t){return t.enter().append("g").attr("class",function(t,e){return u+" _"+e+" "+u+"-level-"+t.depth})}(t);(function(t,e){var n=t.append("path").attr("fill",A).on("click",_).attr("d",function(t){return k(e,t)}),r=rt.transition(n,h.transitionDuration());r.attrTween&&r.attrTween("d",x)})(r,e),function(t){h.renderTitle()&&t.append("title").text(function(t){return h.title()(t)})}(r),function(t,e){if(h.renderLabel()){var n=o.selectAll("text."+u).data(t);n.exit().remove(),y(n.enter().append("text").attr("class",function(t,e){var n=u+" _"+e;return l&&(n+=" external"),n}).on("click",_),e)}}(n,e)}(r,n,e),function(t,e){(function(t,n){var e=o.selectAll("g."+u).data(t).select("path").attr("d",function(t,e){return k(n,t)}),r=rt.transition(e,h.transitionDuration());r.attrTween&&r.attrTween("d",x);r.attr("fill",A)})(t,e),function(t,e){if(h.renderLabel()){y(o.selectAll("text."+u).data(t),e)}}(t,e),function(t){h.renderTitle()&&o.selectAll("g."+u).data(t).select("title").text(function(t){return h.title()(t)})}(t)}(e,n),function(t){t.exit().remove()}(r),h.hasFilter()?h.selectAll("g."+u).each(function(t){!function(t){return function(t){for(var e=0;e<h.filters().length;e++)if(h.filters()[e].isFiltered(t))return!0;return!1}(t.path)}(t)?h.fadeDeselected(this):h.highlightSelected(this)}):h.selectAll("g."+u).each(function(t){h.resetHighlight(this)}),rt.transition(o,h.transitionDuration(),h.transitionDelay()).attr("transform","translate("+h.cx()+","+h.cy()+")")}}function y(t,e){rt.transition(t,h.transitionDuration()).attr("transform",function(t){return function(t,e){var n;n=l?nt.svg.arc().outerRadius(i+l).innerRadius(i+l).centroid(t):e.centroid(t);return isNaN(n[0])||isNaN(n[1])?"translate(0,0)":"translate("+n+")"}(t,e)}).attr("text-anchor","middle").text(function(t){return function(t){return 0===g(t)}(t)||function(t){var e=t.x1-t.x0;return isNaN(e)||e<f}(t)?"":h.label()(t)})}function v(){return nt.arc().startAngle(function(t){return t.x0}).endAngle(function(t){return t.x1}).innerRadius(function(t){return t.data.path&&1===t.data.path.length?d:Math.sqrt(t.y0)}).outerRadius(function(t){return Math.sqrt(t.y1)})}function m(t){var e=nt.hierarchy(t).sum(function(t){return t.children?0:g(t)}).sort(function(t,e){return nt.ascending(t.data.path,e.data.path)});return nt.partition().size([2*Math.PI,i*i])(e),e.descendants().map(function(t){return t.key=t.data.key,t.path=t.data.path,t})}function x(e){var t=this._current;!function(t){return!t||isNaN(t.x0)||isNaN(t.y0)}(t)||(t={x0:0,x1:0,y0:0,y1:0});var n={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},r=nt.interpolate(t,n);return this._current=r(0),function(t){return k(v(),Object.assign({},e,r(t)))}}function A(t,e){return h.getColor(t.data,e)}function b(t){for(var e=t.path||t.key,n=rt.filters.HierarchyFilter(e),r=function(t){for(var e=rt.filters.HierarchyFilter(t),n=[],r=0;r<h.filters().length;r++){var i=h.filters()[r];(i.isFiltered(t)||e.isFiltered(i))&&n.push(i)}return n}(e),i=!1,a=r.length-1;0<=a;a--){var o=r[a];rt.utils.arraysIdentical(o,e)&&(i=!0),h.filter(r[a])}rt.events.trigger(function(){i||h.filter(n),h.redrawGroup()})}function _(t,e){o.attr("class")!==c&&b(t)}function k(t,e){var n=t(e);return 0<=n.indexOf("NaN")&&(n="M0,0"),n}function D(e,n){h.selectAll("g.pie-slice").each(function(t){e.name===t.key&&nt.select(this).classed("highlight",n)})}return h.colorAccessor(h.cappedKeyAccessor),h.title(function(t){return h.cappedKeyAccessor(t)+": "+g(t)}),h.label(h.cappedKeyAccessor),h.renderLabel(!0),h.transitionDuration(350),h.filterHandler(function(t,r){return 0===r.length?t.filter(null):t.filterFunction(function(t){for(var e=0;e<r.length;e++){var n=r[e];if(n.isFiltered&&n.isFiltered(t))return!0}return!1}),r}),h._doRender=function(){return h.resetSvg(),o=h.svg().append("g").attr("transform","translate("+h.cx()+","+h.cy()+")"),p(),h},h.innerRadius=function(t){return arguments.length?(d=t,h):d},h.radius=function(t){return arguments.length?(a=t,h):a},h.cx=function(t){return arguments.length?(n=t,h):n||h.width()/2},h.cy=function(t){return arguments.length?(r=t,h):r||h.height()/2},h.minAngleForLabel=function(t){return arguments.length?(f=t,h):f},h.emptyTitle=function(t){return 0===arguments.length?s:(s=t,h)},h.externalLabels=function(t){return 0===arguments.length?l:(l=t||void 0,h)},h._doRedraw=function(){return p(),h},h.onClick=_,h.legendables=function(){return h.data().map(function(t,e){var n={name:t.key,data:t.value,others:t.others,chart:h};return n.color=h.getColor(t,e),n})},h.legendHighlight=function(t){D(t,!0)},h.legendReset=function(t){D(t,!1)},h.legendToggle=function(t){h.onClick({key:t.name,others:t.others})},h.anchor(t,e)},rt.barChart=function(t,e){var o,n=3,l=rt.stackMixin(rt.coordinateGridMixin({})),i=2,r=!1,a=!1;function u(t){return rt.utils.safeNumber(Math.abs(l.y()(t.y+t.y0)-l.y()(t.y0)))}function c(t){var e=l.x()(t.x);return r||(e+=o/2),l.isOrdinal()&&void 0!==i&&(e+=i/2),rt.utils.safeNumber(e)}function s(t){var e=l.y()(t.y+t.y0);return t.y<0&&(e-=u(t)),rt.utils.safeNumber(e-n)}function d(t){var e=l.x()(t.x);return r&&(e-=o/2),l.isOrdinal()&&void 0!==i&&(e+=i/2),rt.utils.safeNumber(e)}function f(e,n){return function(){var t=nt.select(this).attr("fill")===e;return n?!t:t}}return rt.override(l,"rescale",function(){return l._rescale(),o=void 0,l}),rt.override(l,"render",function(){return l.round()&&r&&!a&&rt.logger.warn("By default, brush rounding is disabled if bars are centered. See dc.js bar chart API documentation for details."),l._render()}),l.label(function(t){return rt.utils.printSingleValue(t.y0+t.y)},!1),l.plotData=function(){var t=l.chartBodyG().selectAll("g.stack").data(l.data());!function(){if(void 0===o){var t=l.xUnitCount();((o=l.isOrdinal()&&void 0===i?Math.floor(l.x().bandwidth()):i?Math.floor((l.xAxisLength()-(t-1)*i)/t):Math.floor(l.xAxisLength()/(1+l.barPadding())/t))===1/0||isNaN(o)||o<1)&&(o=1)}}();var r=(t=t.enter().append("g").attr("class",function(t,e){return"stack _"+e}).merge(t)).size()-1;t.each(function(t,e){var n=nt.select(this);!function(t,e,n){var r=t.selectAll("rect.bar").data(n.values,rt.pluck("x")),i=r.enter().append("rect").attr("class","bar").attr("fill",rt.pluck("data",l.getColor)).attr("x",d).attr("y",l.yAxisHeight()).attr("height",0),a=i.merge(r);l.renderTitle()&&i.append("title").text(rt.pluck("data",l.title(n.name)));l.isOrdinal()&&a.on("click",l.onClick);rt.transition(a,l.transitionDuration(),l.transitionDelay()).attr("x",d).attr("y",function(t){var e=l.y()(t.y+t.y0);return t.y<0&&(e-=u(t)),rt.utils.safeNumber(e)}).attr("width",o).attr("height",function(t){return u(t)}).attr("fill",rt.pluck("data",l.getColor)).select("title").text(rt.pluck("data",l.title(n.name))),rt.transition(r.exit(),l.transitionDuration(),l.transitionDelay()).attr("x",function(t){return l.x()(t.x)}).attr("width",.9*o).remove()}(n,0,t),l.renderLabel()&&r===e&&function(t,e,n){var r=t.selectAll("text.barLabel").data(n.values,rt.pluck("x")),i=r.enter().append("text").attr("class","barLabel").attr("text-anchor","middle").attr("x",c).attr("y",s).merge(r);l.isOrdinal()&&(i.on("click",l.onClick),i.attr("cursor","pointer"));rt.transition(i,l.transitionDuration(),l.transitionDelay()).attr("x",c).attr("y",s).text(function(t){return l.label()(t)}),rt.transition(r.exit(),l.transitionDuration(),l.transitionDelay()).attr("height",0).remove()}(n,0,t)})},l.fadeDeselectedArea=function(t){var e=l.chartBodyG().selectAll("rect.bar");if(l.isOrdinal())l.hasFilter()?(e.classed(rt.constants.SELECTED_CLASS,function(t){return l.hasFilter(t.x)}),e.classed(rt.constants.DESELECTED_CLASS,function(t){return!l.hasFilter(t.x)})):(e.classed(rt.constants.SELECTED_CLASS,!1),e.classed(rt.constants.DESELECTED_CLASS,!1));else if(l.brushOn()||l.parentBrushOn())if(l.brushIsEmpty(t))e.classed(rt.constants.DESELECTED_CLASS,!1);else{var n=t[0],r=t[1];e.classed(rt.constants.DESELECTED_CLASS,function(t){return t.x<n||t.x>=r})}},l.centerBar=function(t){return arguments.length?(r=t,l):r},rt.override(l,"onClick",function(t){l._onClick(t.data)}),l.barPadding=function(t){return arguments.length?(l._rangeBandPadding(t),i=void 0,l):l._rangeBandPadding()},l._useOuterPadding=function(){return void 0===i},l.outerPadding=l._outerRangeBandPadding,l.gap=function(t){return arguments.length?(i=t,l):i},l.extendBrush=function(t){return t&&l.round()&&(!r||a)&&(t[0]=l.round()(t[0]),t[1]=l.round()(t[1])),t},l.alwaysUseRounding=function(t){return arguments.length?(a=t,l):a},l.legendHighlight=function(t){l.isLegendableHidden(t)||l.g().selectAll("rect.bar").classed("highlight",f(t.color)).classed("fadeout",f(t.color,!0))},l.legendReset=function(){l.g().selectAll("rect.bar").classed("highlight",!1).classed("fadeout",!1)},rt.override(l,"xAxisMax",function(){var t=this._xAxisMax();"resolution"in l.xUnits()&&(t+=l.xUnits().resolution);return t}),l.anchor(t,e)},rt.lineChart=function(t,e){var l,i,u="dc-tooltip",c="yRef",s="xRef",d=rt.stackMixin(rt.coordinateGridMixin({})),a=!1,f=5,n=null,h=1e-6,g=1e-6,r=null,o=null,p=null,y=!0;function v(t,e){return d.getColor.call(t,t.values,e)}function m(){var t=null;if(r)return r;"function"==typeof o?t=o:t={linear:nt.curveLinear,"linear-closed":nt.curveLinearClosed,step:nt.curveStep,"step-before":nt.curveStepBefore,"step-after":nt.curveStepAfter,basis:nt.curveBasis,"basis-open":nt.curveBasisOpen,"basis-closed":nt.curveBasisClosed,bundle:nt.curveBundle,cardinal:nt.curveCardinal,"cardinal-open":nt.curveCardinalOpen,"cardinal-closed":nt.curveCardinalClosed,monotone:nt.curveMonotoneX}[o];return t=t||nt.curveLinear,null!==p&&("function"!=typeof t.tension?rt.logger.warn("tension was specified but the curve/interpolate does not support it."):t=t.tension(p)),t}function x(t){return!t||0<=t.indexOf("NaN")?"M0,0":t}function A(){return n||f}function b(t,e){d.renderTitle()&&(t.select("title").remove(),t.append("title").text(rt.pluck("data",d.title(e.name))))}function _(n,r,i){return function(){var t=nt.select(this),e=t.attr("stroke")===n&&t.attr("stroke-dasharray")===(r instanceof Array?r.join(","):null)||t.attr("fill")===n;return i?!e:e}}return d.transitionDuration(500),d.transitionDelay(0),d._rangeBandPadding(1),d.plotData=function(){var t=d.chartBodyG(),e=t.select("g.stack-list");e.empty()&&(e=t.append("g").attr("class","stack-list"));var n=e.selectAll("g.stack").data(d.data()),r=n.enter().append("g").attr("class",function(t,e){return"stack _"+e});n=r.merge(n),function(t,e){var n=nt.line().x(function(t){return d.x()(t.x)}).y(function(t){return d.y()(t.y+t.y0)}).curve(m());l&&n.defined(l);var r=t.append("path").attr("class","line").attr("stroke",v);i&&r.attr("stroke-dasharray",i);rt.transition(e.select("path.line"),d.transitionDuration(),d.transitionDelay()).attr("stroke",v).attr("d",function(t){return x(n(t.values))})}(r,n),function(t,e){if(a){var n=nt.area().x(function(t){return d.x()(t.x)}).y1(function(t){return d.y()(t.y+t.y0)}).y0(function(t){return d.y()(t.y0)}).curve(m());l&&n.defined(l),t.append("path").attr("class","area").attr("fill",v).attr("d",function(t){return x(n(t.values))}),rt.transition(e.select("path.area"),d.transitionDuration(),d.transitionDelay()).attr("fill",v).attr("d",function(t){return x(n(t.values))})}}(r,n),function(t,e){if("always"===d.xyTipsOn()||!d.brushOn()&&!d.parentBrushOn()&&d.xyTipsOn()){var n=u+"-list",o=t.select("g."+n);o.empty()&&(o=t.append("g").attr("class",n)),e.each(function(t,e){var n=t.values;l&&(n=n.filter(l));var r=o.select("g."+u+"._"+e);r.empty()&&(r=o.append("g").attr("class",u+" _"+e)),function(t){(t.select("path."+c).empty()?t.append("path").attr("class",c):t.select("path."+c)).style("display","none").attr("stroke-dasharray","5,5"),(t.select("path."+s).empty()?t.append("path").attr("class",s):t.select("path."+s)).style("display","none").attr("stroke-dasharray","5,5")}(r);var i=r.selectAll("circle.dot").data(n,rt.pluck("x")),a=i.enter().append("circle").attr("class","dot").attr("cx",function(t){return rt.utils.safeNumber(d.x()(t.x))}).attr("cy",function(t){return rt.utils.safeNumber(d.y()(t.y+t.y0))}).attr("r",A()).style("fill-opacity",h).style("stroke-opacity",g).attr("fill",d.getColor).attr("stroke",d.getColor).on("mousemove",function(){var t=nt.select(this);!function(t){t.style("fill-opacity",.8),t.style("stroke-opacity",.8),t.attr("r",f)}(t),function(t,e){var n=t.attr("cx"),r=t.attr("cy"),i="M"+(d._yAxisX()-d.margins().left)+" "+r+"L"+n+" "+r,a="M"+n+" "+d.yAxisHeight()+"L"+n+" "+r;e.select("path."+c).style("display","").attr("d",i),e.select("path."+s).style("display","").attr("d",a)}(t,r)}).on("mouseout",function(){!function(t){t.style("fill-opacity",h).style("stroke-opacity",g).attr("r",A())}(nt.select(this)),function(t){t.select("path."+c).style("display","none"),t.select("path."+s).style("display","none")}(r)}).merge(i);a.call(b,t),rt.transition(a,d.transitionDuration()).attr("cx",function(t){return rt.utils.safeNumber(d.x()(t.x))}).attr("cy",function(t){return rt.utils.safeNumber(d.y()(t.y+t.y0))}).attr("fill",d.getColor),i.exit().remove()})}}(t,n),d.renderLabel()&&function(t){t.each(function(t,e){var n=nt.select(this).selectAll("text.lineLabel").data(t.values,rt.pluck("x")),r=n.enter().append("text").attr("class","lineLabel").attr("text-anchor","middle").merge(n);rt.transition(r,d.transitionDuration()).attr("x",function(t){return rt.utils.safeNumber(d.x()(t.x))}).attr("y",function(t){var e=d.y()(t.y+t.y0)-3;return rt.utils.safeNumber(e)}).text(function(t){return d.label()(t)}),rt.transition(n.exit(),d.transitionDuration()).attr("height",0).remove()})}(n)},d.curve=function(t){return arguments.length?(r=t,d):r},d.interpolate=rt.logger.deprecate(function(t){return arguments.length?(o=t,d):o},"dc.lineChart.interpolate has been deprecated since version 3.0 use dc.lineChart.curve instead"),d.tension=rt.logger.deprecate(function(t){return arguments.length?(p=t,d):p},"dc.lineChart.tension has been deprecated since version 3.0 use dc.lineChart.curve instead"),d.defined=function(t){return arguments.length?(l=t,d):l},d.dashStyle=function(t){return arguments.length?(i=t,d):i},d.renderArea=function(t){return arguments.length?(a=t,d):a},d.label(function(t){return rt.utils.printSingleValue(t.y0+t.y)},!1),d.xyTipsOn=function(t){return arguments.length?(y=t,d):y},d.dotRadius=function(t){return arguments.length?(f=t,d):f},d.renderDataPoints=function(t){return arguments.length?(n=t?(h=t.fillOpacity||.8,g=t.strokeOpacity||0,t.radius||2):(g=h=1e-6,null),d):{fillOpacity:h,strokeOpacity:g,radius:n}},d.legendHighlight=function(t){d.isLegendableHidden(t)||d.g().selectAll("path.line, path.area").classed("highlight",_(t.color,t.dashstyle)).classed("fadeout",_(t.color,t.dashstyle,!0))},d.legendReset=function(){d.g().selectAll("path.line, path.area").classed("highlight",!1).classed("fadeout",!1)},rt.override(d,"legendables",function(){var t=d._legendables();return i?t.map(function(t){return t.dashstyle=i,t}):t}),d.anchor(t,e)},rt.dataCount=function(t,e){var i=nt.format(",d"),a=rt.baseMixin({}),n=null,r=null,o={some:"",all:""};return a._mandatoryAttributes(["crossfilter","groupAll"]),a.html=function(t){return arguments.length?(t.all&&(o.all=t.all),t.some&&(o.some=t.some),a):o},a.formatNumber=function(t){return arguments.length?(i=t,a):i},a._doRender=function(){var t=a.crossfilter().size(),e=a.groupAll().value(),n=i(t),r=i(e);return t===e&&""!==o.all?a.root().html(o.all.replace("%total-count",n).replace("%filter-count",r)):""!==o.some?a.root().html(o.some.replace("%total-count",n).replace("%filter-count",r)):(a.selectAll(".total-count").text(n),a.selectAll(".filter-count").text(r)),a},a._doRedraw=function(){return a._doRender()},a.crossfilter=function(t){return arguments.length?(n=t,this):n},a.dimension=rt.logger.annotate(a.crossfilter,"consider using dataCount.crossfilter instead of dataCount.dimension for clarity"),a.groupAll=function(t){return arguments.length?(r=t,this):r},a.group=rt.logger.annotate(a.groupAll,"consider using dataCount.groupAll instead of dataCount.group for clarity"),a.anchor(t,e)},rt.dataTable=function(t,e){var o,r="dc-table-row",l=rt.baseMixin({}),u=25,c=[],s=function(t){return t},d=nt.ascending,f=0,h=!0,n=function(){return""};return l._mandatoryAttributes(["dimension"]),l._doRender=function(){return l.selectAll("tbody").remove(),function(t){var e=t.order().selectAll("tr."+r).data(function(t){return t.values}),n=e.enter().append("tr").attr("class",r);c.forEach(function(e,t){n.append("td").attr("class","dc-table-column _"+t).html(function(t){return l._doColumnValueFormat(e,t)})}),e.exit().remove()}(function(){var e=!0;if(c.forEach(function(t){e&="function"==typeof t}),!e){var t=l.selectAll("thead").data([0]);t.exit().remove();var n=(t=t.enter().append("thead").merge(t)).selectAll("tr").data([0]);n.exit().remove();var r=(n=n.enter().append("tr").merge(n)).selectAll("th").data(c);r.exit().remove(),r.enter().append("th").merge(r).attr("class","dc-table-head").html(function(t){return l._doColumnHeaderFormat(t)})}var i=l.root().selectAll("tbody").data(function(){var t;t=d===nt.ascending?l.dimension().bottom(u):l.dimension().top(u);return nt.nest().key(l.section()).sortKeys(d).entries(t.sort(function(t,e){return d(s(t),s(e))}).slice(f,o))}(),function(t){return l.keyAccessor()(t)}),a=i.enter().append("tbody");!0===h&&a.append("tr").attr("class","dc-table-section dc-table-group").append("td").attr("class","dc-table-label").attr("colspan",c.length).html(function(t){return l.keyAccessor()(t)});return i.exit().remove(),a}()),l},l._doColumnValueFormat=function(t,e){return"function"==typeof t?t(e):"string"==typeof t?e[t]:t.format(e)},l._doColumnHeaderFormat=function(t){return"function"==typeof t?l._doColumnHeaderFnToString(t):"string"==typeof t?l._doColumnHeaderCapitalize(t):String(t.label)},l._doColumnHeaderCapitalize=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},l._doColumnHeaderFnToString=function(t){var e=String(t),n=e.indexOf("return ");if(0<=n){var r=e.lastIndexOf(";");if(0<=r)0<=(e=e.substring(n+7,r)).indexOf("numberFormat")&&(e=e.replace("numberFormat",""))}return e},l._doRedraw=function(){return l._doRender()},l.section=function(t){return arguments.length?(n=t,l):n},l.group=rt.logger.annotate(l.section,"consider using dataTable.section instead of dataTable.group for clarity"),l.size=function(t){return arguments.length?(u=t,l):u},l.beginSlice=function(t){return arguments.length?(f=t,l):f},l.endSlice=function(t){return arguments.length?(o=t,l):o},l.columns=function(t){return arguments.length?(c=t,l):c},l.sortBy=function(t){return arguments.length?(s=t,l):s},l.order=function(t){return arguments.length?(d=t,l):d},l.showSections=function(t){return arguments.length?(h=t,l):h},l.showGroups=rt.logger.annotate(l.showSections,"consider using dataTable.showSections instead of dataTable.showGroups for clarity"),l.anchor(t,e)},rt.dataGrid=function(t,e){var n,r="dc-grid-item",i="dc-grid-top",a=rt.baseMixin({}),o=null,l=999,u=function(t){return"you need to provide an html() handling param: "+JSON.stringify(t)},c=function(t){return t},s=nt.ascending,d=0,f=function(t){return"<div class='dc-grid-section dc-grid-group'><h1 class='dc-grid-label'>"+a.keyAccessor()(t)+"</h1></div>"};return a._mandatoryAttributes(["dimension","section"]),a._doRender=function(){return a.selectAll("div."+i).remove(),function(t){var e=t.order().selectAll("div."+r).data(function(t){return t.values});e.exit().remove(),e=e.enter().append("div").attr("class",r).html(function(t){return u(t)}).merge(e)}(function(){var t=a.root().selectAll("div."+i).data(function(){var t=a.dimension().top(l);return nt.nest().key(a.section()).sortKeys(s).entries(t.sort(function(t,e){return s(c(t),c(e))}).slice(d,n))}(),function(t){return a.keyAccessor()(t)}),e=t.enter().append("div").attr("class",i);f&&e.html(function(t){return f(t)});return t.exit().remove(),e}()),a},a._doRedraw=function(){return a._doRender()},a.section=function(t){return arguments.length?(o=t,a):o},a.group=rt.logger.annotate(a.section,"consider using dataGrid.section instead of dataGrid.group for clarity"),a.beginSlice=function(t){return arguments.length?(d=t,a):d},a.endSlice=function(t){return arguments.length?(n=t,a):n},a.size=function(t){return arguments.length?(l=t,a):l},a.html=function(t){return arguments.length?(u=t,a):u},a.htmlSection=function(t){return arguments.length?(f=t,a):f},a.htmlGroup=rt.logger.annotate(a.htmlSection,"consider using dataGrid.htmlSection instead of dataGrid.htmlGroup for clarity"),a.sortBy=function(t){return arguments.length?(c=t,a):c},a.order=function(t){return arguments.length?(s=t,a):s},a.anchor(t,e)},rt.bubbleChart=function(t,e){var n=rt.bubbleMixin(rt.coordinateGridMixin({}));n.transitionDuration(750),n.transitionDelay(0);function r(t){return"translate("+function(t){var e=n.x()(n.keyAccessor()(t));!isNaN(e)&&isFinite(e)||(e=0);return e}(t)+","+function(t){var e=n.y()(n.valueAccessor()(t));!isNaN(e)&&isFinite(e)||(e=0);return e}(t)+")"}return n.plotData=function(){n.calculateRadiusDomain(),n.r().range([n.MIN_RADIUS,n.xAxisLength()*n.maxBubbleRelativeSize()]);var t=n.data(),e=n.chartBodyG().selectAll("g."+n.BUBBLE_NODE_CLASS).data(t,function(t){return t.key});n.sortBubbleSize()&&e.order(),function(t){t.exit().remove()}(e),function(t){rt.transition(t,n.transitionDuration(),n.transitionDelay()).attr("transform",r).select("circle."+n.BUBBLE_CLASS).attr("fill",n.getColor).attr("r",function(t){return n.bubbleR(t)}).attr("opacity",function(t){return 0<n.bubbleR(t)?1:0}),n.doUpdateLabels(t),n.doUpdateTitles(t)}(e=function(t){var e=t.enter().append("g");return e.attr("class",n.BUBBLE_NODE_CLASS).attr("transform",r).append("circle").attr("class",function(t,e){return n.BUBBLE_CLASS+" _"+e}).on("click",n.onClick).attr("fill",n.getColor).attr("r",0),t=e.merge(t),rt.transition(t,n.transitionDuration(),n.transitionDelay()).select("circle."+n.BUBBLE_CLASS).attr("r",function(t){return n.bubbleR(t)}).attr("opacity",function(t){return 0<n.bubbleR(t)?1:0}),n._doRenderLabel(e),n._doRenderTitles(e),t}(e)),n.fadeDeselectedArea(n.filter())},n.renderBrush=function(){},n.redrawBrush=function(t,e){n.fadeDeselectedArea(t)},n.anchor(t,e)},rt.compositeChart=function(t,e){var r,n="sub",l=rt.coordinateGridMixin({}),i=[],a={},o=!1,u=!0,c=!1,s=nt.axisRight(),d=0,f=12,h=!1;function g(t,e){t._generateG(l.g()),t.g().attr("class",n+" _"+e)}function p(){return i.filter(function(t){return!t.useRightYAxis()})}function y(){return i.filter(function(t){return t.useRightYAxis()})}function v(t){return t.map(function(t){return t.yAxisMin()})}function m(t){return t.map(function(t){return t.yAxisMax()})}return l._mandatoryAttributes([]),l.transitionDuration(500),l.transitionDelay(0),rt.override(l,"_generateG",function(){for(var t=this.__generateG(),e=0;e<i.length;++e){var n=i[e];g(n,e),n.dimension()||n.dimension(l.dimension()),n.group()||n.group(l.group()),n.chartGroup(l.chartGroup()),n.svg(l.svg()),n.xUnits(l.xUnits()),n.transitionDuration(l.transitionDuration(),l.transitionDelay()),n.parentBrushOn(l.brushOn()),n.brushOn(!1),n.renderTitle(l.renderTitle()),n.elasticX(l.elasticX())}return t}),l.on("filtered.dcjs-composite-chart",function(t){for(var e=0;e<i.length;++e)i[e].replaceFilter(l.filter())}),l._prepareYAxis=function(){var t=0!==p().length,e=0!==y().length,n=function(t,e){var n,r,i,a,o;t&&(n=nt.min(v(p())),r=rt.utils.add(nt.max(m(p())),l.yAxisPadding()));e&&(i=nt.min(v(y())),a=rt.utils.add(nt.max(m(y())),l.yAxisPadding()));l.alignYAxes()&&t&&e&&(o=function(t,e,n,r){var i=(r-n)/(e-t);return{lyAxisMin:Math.min(t,n/i),lyAxisMax:Math.max(e,r/i),ryAxisMin:Math.min(n,t*i),ryAxisMax:Math.max(r,e*i)}}(n,r,i,a));return o||{lyAxisMin:n,lyAxisMax:r,ryAxisMin:i,ryAxisMax:a}}(t,e);t&&function(t){var e=void 0===l.y()||l.elasticY(),n=e||l.resizing();void 0===l.y()&&l.y(nt.scaleLinear());e&&l.y().domain([t.lyAxisMin,t.lyAxisMax]);n&&l.y().rangeRound([l.yAxisHeight(),0]);l.y().range([l.yAxisHeight(),0]),l.yAxis(l.yAxis().scale(l.y()))}(n),e&&function(t){var e=void 0===l.rightY()||l.elasticY(),n=e||l.resizing();void 0===l.rightY()&&l.rightY(nt.scaleLinear());e&&l.rightY().domain([t.ryAxisMin,t.ryAxisMax]);n&&l.rightY().rangeRound([l.yAxisHeight(),0]);l.rightY().range([l.yAxisHeight(),0]),l.rightYAxis(l.rightYAxis().scale(l.rightY()))}(n),0<p().length&&!h?l._renderHorizontalGridLinesForAxis(l.g(),l.y(),l.yAxis()):0<y().length&&l._renderHorizontalGridLinesForAxis(l.g(),r,s)},l.renderYAxis=function(){0!==p().length&&(l.renderYAxisAt("y",l.yAxis(),l.margins().left),l.renderYAxisLabel("y",l.yAxisLabel(),-90)),0!==y().length&&(l.renderYAxisAt("yr",l.rightYAxis(),l.width()-l.margins().right),l.renderYAxisLabel("yr",l.rightYAxisLabel(),90,l.width()-f))},l.plotData=function(){for(var t=0;t<i.length;++t){var e=i[t];e.g()||g(e,t),o&&e.colors(l.colors()),e.x(l.x()),e.xAxis(l.xAxis()),e.useRightYAxis()?(e.y(l.rightY()),e.yAxis(l.rightYAxis())):(e.y(l.y()),e.yAxis(l.yAxis())),e.plotData(),e._activateRenderlets()}},l.useRightAxisGridLines=function(t){return arguments?(h=t,l):h},l.childOptions=function(t){return arguments.length?(a=t,i.forEach(function(t){t.options(a)}),l):a},l.fadeDeselectedArea=function(t){if(l.brushOn())for(var e=0;e<i.length;++e){i[e].fadeDeselectedArea(t)}},l.rightYAxisLabel=function(t,e){return arguments.length?(d=t,l.margins().right-=f,f=void 0===e?12:e,l.margins().right+=f,l):d},l.compose=function(t){return(i=t).forEach(function(t){t.height(l.height()),t.width(l.width()),t.margins(l.margins()),u&&t.title(l.title()),t.options(a)}),l},l.children=function(){return i},l.shareColors=function(t){return arguments.length?(o=t,l):o},l.shareTitle=function(t){return arguments.length?(u=t,l):u},l.rightY=function(t){return arguments.length?(r=t,l.rescale(),l):r},l.alignYAxes=function(t){return arguments.length?(c=t,l.rescale(),l):c},delete l.yAxisMin,delete l.yAxisMax,rt.override(l,"xAxisMin",function(){return rt.utils.subtract(nt.min(i.map(function(t){return t.xAxisMin()})),l.xAxisPadding(),l.xAxisPaddingUnit())}),rt.override(l,"xAxisMax",function(){return rt.utils.add(nt.max(i.map(function(t){return t.xAxisMax()})),l.xAxisPadding(),l.xAxisPaddingUnit())}),l.legendables=function(){return i.reduce(function(t,e){return o&&e.colors(l.colors()),t.push.apply(t,e.legendables()),t},[])},l.legendHighlight=function(t){for(var e=0;e<i.length;++e){i[e].legendHighlight(t)}},l.legendReset=function(t){for(var e=0;e<i.length;++e){i[e].legendReset(t)}},l.legendToggle=function(){console.log("composite should not be getting legendToggle itself")},l.rightYAxis=function(t){return arguments.length?(s=t,l):s},l.anchor(t,e)},rt.seriesChart=function(t,a){var o=rt.compositeChart(t,a);var n,l={},u=rt.lineChart,c=nt.ascending,s=function(t,e){return nt.ascending(o.keyAccessor()(t),o.keyAccessor()(e))};function d(t){l[t].g()&&l[t].g().remove(),delete l[t]}function e(){Object.keys(l).map(d),l={}}return o._mandatoryAttributes().push("seriesAccessor","chart"),o.shareColors(!0),o._preprocessData=function(){var r,i=[],t=nt.nest().key(n);c&&t.sortKeys(c),s&&t.sortValues(s);var e=t.entries(o.data()).map(function(t,e){var n=l[t.key]||u.call(o,o,a,t.key,e);return l[t.key]||(r=!0),l[t.key]=n,i.push(t.key),n.dimension(o.dimension()).group({all:"function"==typeof t.values?t.values:rt.utils.constant(t.values)},t.key).keyAccessor(o.keyAccessor()).valueAccessor(o.valueAccessor()).brushOn(!1)});Object.keys(l).filter(function(t){return-1===i.indexOf(t)}).forEach(function(t){d(t),r=!0}),o._compose(e),r&&o.legend()&&o.legend().render()},o.chart=function(t){return arguments.length?(u=t,e(),o):u},o.seriesAccessor=function(t){return arguments.length?(n=t,e(),o):n},o.seriesSort=function(t){return arguments.length?(c=t,e(),o):c},o.valueSort=function(t){return arguments.length?(s=t,e(),o):s},o._compose=o.compose,delete o.compose,o},rt.geoChoroplethChart=function(t,e){var a=rt.colorMixin(rt.baseMixin({}));a.colorAccessor(function(t){return t||0});var n,r,i=nt.geoPath(),o=[];function l(t){var e=function(){for(var t={},e=a.data(),n=0;n<e.length;++n)t[a.keyAccessor()(e[n])]=a.valueAccessor()(e[n]);return t}();if(function(t){return d(t).keyAccessor}(t)){var n=function(n){return a.svg().selectAll(function(t){return"g.layer"+t+" g."+d(t).name}(n)).classed("selected",function(t){return u(n,t)}).classed("deselected",function(t){return c(n,t)}).attr("class",function(t){var e=d(n).name+" "+rt.utils.nameToId(d(n).keyAccessor(t));return u(n,t)&&(e+=" selected"),c(n,t)&&(e+=" deselected"),e})}(t);!function(t,n,r){var e=t.select("path").attr("fill",function(){var t=nt.select(this).attr("fill");return t||"none"}).on("click",function(t){return a.onClick(t,n)});rt.transition(e,a.transitionDuration(),a.transitionDelay()).attr("fill",function(t,e){return a.getColor(r[d(n).keyAccessor(t)],e)})}(n,t,e),function(t,r,i){a.renderTitle()&&t.selectAll("title").text(function(t){var e=s(r,t),n=i[e];return a.title()({key:e,value:n})})}(n,t,e)}}function u(t,e){return a.hasFilter()&&a.hasFilter(s(t,e))}function c(t,e){return a.hasFilter()&&!a.hasFilter(s(t,e))}function s(t,e){return d(t).keyAccessor(e)}function d(t){return o[t]}a._doRender=function(){a.resetSvg();for(var t=0;t<o.length;++t){var e=a.svg().append("g").attr("class","layer"+t).selectAll("g."+d(t).name).data(d(t).data);(e=e.enter().append("g").attr("class",d(t).name).merge(e)).append("path").attr("fill","white").attr("d",f()),e.append("title"),l(t)}n=!1},a.onClick=function(t,e){var n=d(e).keyAccessor(t);rt.events.trigger(function(){a.filter(n),a.redrawGroup()})},a._doRedraw=function(){for(var t=0;t<o.length;++t)l(t),n&&a.svg().selectAll("g."+d(t).name+" path").attr("d",f());n=!1},a.overlayGeoJson=function(t,e,n){for(var r=0;r<o.length;++r)if(o[r].name===e)return o[r].data=t,o[r].keyAccessor=n,a;return o.push({name:e,data:t,keyAccessor:n}),a},a.projection=function(t){return arguments.length?(r=t,n=!0,a):r};var f=function(){return void 0===r?(rt.logger.warn("choropleth projection default of geoAlbers is deprecated, in next version projection will need to be set explicitly"),i.projection(nt.geoAlbersUsa())):i.projection(r)};return a.geoJsons=function(){return o},a.geoPath=function(){return i},a.removeGeoJson=function(t){for(var e=[],n=0;n<o.length;++n){var r=o[n];r.name!==t&&e.push(r)}return o=e,a},a.anchor(t,e)},rt.bubbleOverlay=function(t,e){var i,n="bubble-overlay",a="node",o="bubble",l=rt.bubbleMixin(rt.baseMixin({})),u=[];function c(){var e={};return l.data().forEach(function(t){e[l.keyAccessor()(t)]=t}),e}function s(t,e){var n=a+" "+rt.utils.nameToId(t.name),r=i.select("g."+rt.utils.nameToId(t.name));return r.empty()&&(r=i.append("g").attr("class",n).attr("transform","translate("+t.x+","+t.y+")")),r.datum(e[t.name]),r}return l.transitionDuration(750),l.transitionDelay(0),l.radiusValueAccessor(function(t){return t.value}),l.point=function(t,e,n){return u.push({name:t,x:e,y:n}),l},l._doRender=function(){return i=function(){(i=l.select("g."+n)).empty()&&(i=l.svg().append("g").attr("class",n));return i}(),l.r().range([l.MIN_RADIUS,l.width()*l.maxBubbleRelativeSize()]),function(){var r=c();l.calculateRadiusDomain(),u.forEach(function(t){var e=s(t,r),n=e.select("circle."+o);n.empty()&&(n=e.append("circle").attr("class",o).attr("r",0).attr("fill",l.getColor).on("click",l.onClick)),rt.transition(n,l.transitionDuration(),l.transitionDelay()).attr("r",function(t){return l.bubbleR(t)}),l._doRenderLabel(e),l._doRenderTitles(e)})}(),l.fadeDeselectedArea(l.filter()),l},l._doRedraw=function(){return function(){var r=c();l.calculateRadiusDomain(),u.forEach(function(t){var e=s(t,r),n=e.select("circle."+o);rt.transition(n,l.transitionDuration(),l.transitionDelay()).attr("r",function(t){return l.bubbleR(t)}).attr("fill",l.getColor),l.doUpdateLabels(e),l.doUpdateTitles(e)})}(),l.fadeDeselectedArea(l.filter()),l},l.debug=function(t){if(t){var n=l.select("g."+rt.constants.DEBUG_GROUP_CLASS);n.empty()&&(n=l.svg().append("g").attr("class",rt.constants.DEBUG_GROUP_CLASS));var r=n.append("text").attr("x",10).attr("y",20);n.append("rect").attr("width",l.width()).attr("height",l.height()).on("mousemove",function(){var t=nt.mouse(n.node()),e=t[0]+", "+t[1];r.text(e)})}else l.selectAll(".debug").remove();return l},l.anchor(t,e),l},rt.rowChart=function(t,e){var n,i,r,a,o=10,l=15,u=!1,c="0.35em",s=2,d=5,f=!1,h="row",g="titlerow",p=!1,y=rt.capMixin(rt.marginMixin(rt.colorMixin(rt.baseMixin({})))),v=nt.axisBottom();function m(){var t=n.select("g.axis");!function(){if(!i||r){var t=nt.extent(a,y.cappedValueAccessor);0<t[0]&&(t[0]=0),t[1]<0&&(t[1]=0),i=nt.scaleLinear().domain(t).range([0,y.effectiveWidth()])}v.scale(i)}(),t.empty()&&(t=n.append("g").attr("class","axis")),t.attr("transform","translate(0, "+y.effectiveHeight()+")"),rt.transition(t,y.transitionDuration(),y.transitionDelay()).call(v)}function x(){a=y.data(),m(),n.selectAll("g.tick").select("line.grid-line").remove(),n.selectAll("g.tick").append("line").attr("class","grid-line").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",function(){return-y.effectiveHeight()});var t=n.selectAll("g."+h).data(a);!function(t){t.exit().remove()}(t),function(t){var n,e=a.length;n=f||(y.effectiveHeight()-(e+1)*d)/e;u||(l=n/2);var r=t.attr("transform",function(t,e){return"translate(0,"+((e+1)*d+e*n)+")"}).select("rect").attr("height",n).attr("fill",y.getColor).on("click",b).classed("deselected",function(t){return!!y.hasFilter()&&!k(t)}).classed("selected",function(t){return!!y.hasFilter()&&k(t)});rt.transition(r,y.transitionDuration(),y.transitionDelay()).attr("width",function(t){return Math.abs(A()-i(y.cappedValueAccessor(t)))}).attr("transform",_),function(t){y.renderTitle()&&(t.select("title").remove(),t.append("title").text(y.title()))}(t),function(t){if(y.renderLabel()){var e=t.select("text").attr("x",o).attr("y",l).attr("dy",c).on("click",b).attr("class",function(t,e){return h+" _"+e}).text(function(t){return y.label()(t)});rt.transition(e,y.transitionDuration(),y.transitionDelay()).attr("transform",_)}if(y.renderTitleLabel()){var n=t.select("."+g).attr("x",y.effectiveWidth()-s).attr("y",l).attr("dy",c).attr("text-anchor","end").on("click",b).attr("class",function(t,e){return g+" _"+e}).text(function(t){return y.title()(t)});rt.transition(n,y.transitionDuration(),y.transitionDelay()).attr("transform",_)}}(t)}(t=function(t){var e=t.enter().append("g").attr("class",function(t,e){return h+" _"+e});return e.append("rect").attr("width",0),function(t){y.renderLabel()&&t.append("text").on("click",b);y.renderTitleLabel()&&t.append("text").attr("class",g).on("click",b)}(e),e}(t).merge(t))}function A(){var t=i(0);return t===-1/0||t!=t?i(1):t}function b(t){y.onClick(t)}function _(t){var e=i(y.cappedValueAccessor(t)),n=A();return"translate("+(n<e?n:e)+",0)"}function k(t){return y.hasFilter(y.cappedKeyAccessor(t))}return y.rowsCap=y.cap,y._doRender=function(){return y.resetSvg(),n=y.svg().append("g").attr("transform","translate("+y.margins().left+","+y.margins().top+")"),x(),y},y.title(function(t){return y.cappedKeyAccessor(t)+": "+y.cappedValueAccessor(t)}),y.label(y.cappedKeyAccessor),y.x=function(t){return arguments.length?(i=t,y):i},y.renderTitleLabel=function(t){return arguments.length?(p=t,y):p},y._doRedraw=function(){return x(),y},y.xAxis=function(t){return arguments.length?(v=t,this):v},y.fixedBarHeight=function(t){return arguments.length?(f=t,y):f},y.gap=function(t){return arguments.length?(d=t,y):d},y.elasticX=function(t){return arguments.length?(r=t,y):r},y.labelOffsetX=function(t){return arguments.length?(o=t,y):o},y.labelOffsetY=function(t){return arguments.length?(l=t,u=!0,y):l},y.titleLabelOffsetX=function(t){return arguments.length?(s=t,y):s},y.anchor(t,e)},rt.legend=function(){var n,r,o,e={},l=0,u=0,c=12,s=5,d=!1,f=560,h=70,g=!1,p=rt.pluck("name");function y(){return s+c}return e.parent=function(t){return arguments.length?(n=t,e):n},e.render=function(){n.svg().select("g.dc-legend").remove(),o=n.svg().append("g").attr("class","dc-legend").attr("transform","translate("+l+","+u+")");var t=n.legendables();void 0!==r&&(t=t.slice(0,r));var e=o.selectAll("g.dc-legend-item").data(t).enter().append("g").attr("class","dc-legend-item").on("mouseover",function(t){n.legendHighlight(t)}).on("mouseout",function(t){n.legendReset(t)}).on("click",function(t){t.chart.legendToggle(t)});o.selectAll("g.dc-legend-item").classed("fadeout",function(t){return t.chart.isLegendableHidden(t)}),t.some(rt.pluck("dashstyle"))?e.append("line").attr("x1",0).attr("y1",c/2).attr("x2",c).attr("y2",c/2).attr("stroke-width",2).attr("stroke-dasharray",rt.pluck("dashstyle")).attr("stroke",rt.pluck("color")):e.append("rect").attr("width",c).attr("height",c).attr("fill",function(t){return t?t.color:"blue"}),e.append("text").text(p).attr("x",c+2).attr("y",function(){return c/2+(this.clientHeight?this.clientHeight:13)/2-2});var i=0,a=0;e.attr("transform",function(t,e){if(d){var n=!0===g?this.getBBox().width+s:h;f<i+n&&0<i&&(++a,i=0);var r="translate("+i+","+a*y()+")";return i+=n,r}return"translate(0,"+e*y()+")"})},e.x=function(t){return arguments.length?(l=t,e):l},e.y=function(t){return arguments.length?(u=t,e):u},e.gap=function(t){return arguments.length?(s=t,e):s},e.itemHeight=function(t){return arguments.length?(c=t,e):c},e.horizontal=function(t){return arguments.length?(d=t,e):d},e.legendWidth=function(t){return arguments.length?(f=t,e):f},e.itemWidth=function(t){return arguments.length?(h=t,e):h},e.autoItemWidth=function(t){return arguments.length?(g=t,e):g},e.legendText=function(t){return arguments.length?(p=t,e):p},e.maxItems=function(t){return arguments.length?(r=rt.utils.isNumber(t)?t:void 0,e):r},e},rt.htmlLegend=function(){var o,l,u,c,e={},s=rt.pluck("name"),d=!1,f=!1;return e.parent=function(t){return arguments.length?(o=t,e):o},e.render=function(){var t=d?"dc-legend-item-horizontal":"dc-legend-item-vertical";l.select("div.dc-html-legend").remove();var e=l.append("div").attr("class","dc-html-legend");e.attr("style","max-width:"+l.nodes()[0].style.width);var n=o.legendables(),r=o.filters();void 0!==u&&(n=n.slice(0,u));var i=c||t,a=e.selectAll("div."+i).data(n).enter().append("div").classed(i,!0).on("mouseover",o.legendHighlight).on("mouseout",o.legendReset).on("click",o.legendToggle);f&&a.classed(rt.constants.SELECTED_CLASS,function(t){return-1!==r.indexOf(t.name)}),a.append("span").attr("class","dc-legend-item-color").style("background-color",rt.pluck("color")),a.append("span").attr("class","dc-legend-item-label").attr("title",s).text(s)},e.container=function(t){return arguments.length?(l=nt.select(t),e):l},e.legendItemClass=function(t){return arguments.length?(c=t,e):c},e.highlightSelected=function(t){return arguments.length?(f=t,e):f},e.horizontal=function(t){return arguments.length?(d=t,e):d},e.legendText=function(t){return arguments.length?(s=t,e):s},e.maxItems=function(t){return arguments.length?(u=rt.utils.isNumber(t)?t:void 0,e):u},e},rt.scatterPlot=function(t,e){var c=rt.coordinateGridMixin({}),i=nt.symbol(),s=function(t){return t.value},n=c.keyAccessor();c.keyAccessor(function(t){return n(t)[0]}),c.valueAccessor(function(t){return n(t)[1]}),c.colorAccessor(function(){return c._groupName}),c.title(function(t){return c.keyAccessor()(t)+","+c.valueAccessor()(t)+": "+c.existenceAccessor()(t)});function r(t){return"translate("+c.x()(c.keyAccessor()(t))+","+c.y()(c.valueAccessor()(t))+")"}var d=7,f=5,h=3,a=null,o=1,g=0,p=0,y=1,v=null,l=[],u=null,m=null,x=!1;function A(t,e){return s(t)?l[e]?Math.pow(f,2):Math.pow(h,2):Math.pow(g,2)}function b(l){var u=c.context();u.clearRect(0,0,1*(u.canvas.width+2),1*(u.canvas.height+2)),c.data().forEach(function(t,e){var n=!c.filter()||c.filter().isFiltered([t.key[0],t.key[1]]),r=1;r=s(t)?n?y:c.excludedOpacity():p;var i=null;i=v&&!s(t)?v:c.excludedColor()&&!n?c.excludedColor():c.getColor(t);var a=function(t,e){return s(t)?e?f/Math.sqrt(Math.PI):h/Math.sqrt(Math.PI):g/Math.sqrt(Math.PI)}(t,n);if(l){var o=i===l.color;o||(r=.1),o&&(a=d/Math.sqrt(Math.PI))}u.save(),u.globalAlpha=r,u.beginPath(),u.arc(c.x()(c.keyAccessor()(t)),c.y()(c.valueAccessor()(t)),a,0,2*Math.PI,!0),u.fillStyle=i,u.fill(),u.restore()})}function _(t,e){c.renderTitle()&&(t.selectAll("title").remove(),t.append("title").text(function(t){return c.title()(t)}))}function k(t,e){var n=c.chartBodyG().selectAll(".chart-body path.symbol").filter(function(){return t(nt.select(this))}),r=i.size();i.size(Math.pow(e,2)),rt.transition(n,c.transitionDuration(),c.transitionDelay()).attr("d",i),i.size(r)}return c.brush(nt.brush()),i.size(A),rt.override(c,"_filter",function(t){return arguments.length?c.__filter(rt.filters.RangedTwoDimensionalFilter(t)):c.__filter()}),c._resetSvgOld=c.resetSvg,c.resetSvg=function(){if(x){c._resetSvgOld(),c.select("canvas").remove();var t=c.svg();c.root().style("position","relative"),t.style("position","relative");var e=isNaN(parseInt(t.style("left"),10))?0:parseInt(t.style("left"),10),n=isNaN(parseInt(t.style("top"),10))?0:parseInt(t.style("top"),10),r=c.effectiveWidth(),i=c.effectiveHeight(),a=c.margins(),o=window.devicePixelRatio||1;return u=c.root().append("canvas").attr("x",0).attr("y",0).attr("width",r*o).attr("height",i*o).style("width",r+"px").style("height",i+"px").style("position","absolute").style("top",a.top+n+"px").style("left",a.left+e+"px").style("z-index",-1).style("pointer-events","none"),(m=u.node().getContext("2d")).scale(o,o),m.rect(0,0,r,i),m.clip(),m.imageSmoothingQuality="high",c.svg()}return c._resetSvgOld()},c.useCanvas=function(t){return arguments.length?(x=t,c):x},c.canvas=function(t){return arguments.length?(u=t,c):u},c.context=function(){return m},c.plotData=function(){x?b():function(){var t=c.chartBodyG().selectAll("path.symbol").data(c.data());rt.transition(t.exit(),c.transitionDuration(),c.transitionDelay()).attr("opacity",0).remove(),(t=t.enter().append("path").attr("class","symbol").attr("opacity",0).attr("fill",c.getColor).attr("transform",r).merge(t)).call(_,c.data()),t.each(function(t,e){l[e]=!c.filter()||c.filter().isFiltered([c.keyAccessor()(t),c.valueAccessor()(t)])}),rt.transition(t,c.transitionDuration(),c.transitionDelay()).attr("opacity",function(t,e){return s(t)?l[e]?y:c.excludedOpacity():p}).attr("fill",function(t,e){return v&&!s(t)?v:c.excludedColor()&&!l[e]?c.excludedColor():c.getColor(t)}).attr("transform",r).attr("d",i)}()},c.existenceAccessor=function(t){return arguments.length?(s=t,this):s},c.symbol=function(t){return arguments.length?(i.type(t),c):i.type()},c.customSymbol=function(t){return arguments.length?((i=t).size(A),c):i},c.symbolSize=function(t){return arguments.length?(f=t,c):f},c.highlightedSize=function(t){return arguments.length?(d=t,c):d},c.excludedSize=function(t){return arguments.length?(h=t,c):h},c.excludedColor=function(t){return arguments.length?(a=t,c):a},c.excludedOpacity=function(t){return arguments.length?(o=t,c):o},c.hiddenSize=c.emptySize=function(t){return arguments.length?(g=t,c):g},c.emptyColor=function(t){return arguments.length?(v=t,c):v},c.emptyOpacity=function(t){return arguments.length?(p=t,c):p},c.nonemptyOpacity=function(t){return arguments.length?(y=t,c):p},c.legendables=function(){return[{chart:c,name:c._groupName,color:c.getColor()}]},c.legendHighlight=function(e){x?b(e):(k(function(t){return t.attr("fill")===e.color},d),c.chartBodyG().selectAll(".chart-body path.symbol").filter(function(){return nt.select(this).attr("fill")!==e.color}).classed("fadeout",!0))},c.legendReset=function(e){x?b():(k(function(t){return t.attr("fill")===e.color},f),c.chartBodyG().selectAll(".chart-body path.symbol").filter(function(){return nt.select(this).attr("fill")!==e.color}).classed("fadeout",!1))},c.createBrushHandlePaths=function(){},c.extendBrush=function(t){return c.round()&&(t[0]=t[0].map(c.round()),t[1]=t[1].map(c.round())),t},c.brushIsEmpty=function(t){return!t||t[0][0]>=t[1][0]||t[0][1]>=t[1][1]},c._brushing=function(){if(nt.event.sourceEvent&&(!nt.event.sourceEvent.type||-1===["start","brush","end"].indexOf(nt.event.sourceEvent.type))){var t=nt.event.selection,e=c.brushIsEmpty(t);t&&(t=t.map(function(t){return t.map(function(t,e){return(0===e?c.x():c.y()).invert(t)})}),t=c.extendBrush(t),e=e&&c.brushIsEmpty(t)),c.redrawBrush(t,!1);var n=e?null:rt.filters.RangedTwoDimensionalFilter(t);rt.events.trigger(function(){c.replaceFilter(n),c.redrawGroup()},rt.constants.EVENT_DELAY)}},c.redrawBrush=function(t,e){var n=c.brush(),r=c.gBrush();c.brushOn()&&r&&(c.resizing()&&c.setBrushExtents(e),t?(t=t.map(function(t){return t.map(function(t,e){return(0===e?c.x():c.y())(t)})}),rt.optionalTransition(e,c.transitionDuration(),c.transitionDelay())(r).call(n.move,t)):r.call(n.move,t));c.fadeDeselectedArea(t)},c.setBrushY=function(t){t.call(c.brush().y(c.y()))},c.anchor(t,e)},rt.numberDisplay=function(t,e){var n,r="number-display",i=nt.format(".2s"),o=rt.baseMixin({}),l={one:"",some:"",none:""};return o._mandatoryAttributes(["group"]),o.ordering(function(t){return t.value}),o.html=function(t){return arguments.length?(t.none?l.none=t.none:t.one?l.none=t.one:t.some&&(l.none=t.some),t.one?l.one=t.one:t.some&&(l.one=t.some),t.some?l.some=t.some:t.one&&(l.some=t.one),o):l},o.value=function(){return o.data()},o.data(function(t){var e=t.value?t.value():function(t){if(!t.length)return null;var e=o._computeOrderedGroups(t);return e[e.length-1]}(t.all());return o.valueAccessor()(e)}),o.transitionDuration(250),o.transitionDelay(0),o._doRender=function(){var a=o.value(),t=o.selectAll("."+r);t.empty()&&(t=t.data([0]).enter().append("span").attr("class",r).merge(t)),t.transition().duration(o.transitionDuration()).delay(o.transitionDelay()).ease(nt.easeQuad).tween("text",function(){var t=isFinite(n)?n:0,r=nt.interpolateNumber(t||0,a);n=a;var i=this;return function(t){var e=null,n=o.formatNumber()(r(t));0===a&&""!==l.none?e=l.none:1===a&&""!==l.one?e=l.one:""!==l.some&&(e=l.some),i.innerHTML=e?e.replace("%number",n):n}})},o._doRedraw=function(){return o._doRender()},o.formatNumber=function(t){return arguments.length?(i=t,o):i},o.anchor(t,e)},rt.heatMap=function(t,e){var h,n,r,g=nt.ascending,p=nt.ascending,y=nt.scaleBand(),v=nt.scaleBand(),m=6.75,x=6.75,A=rt.colorMixin(rt.marginMixin(rt.baseMixin({})));A._mandatoryAttributes(["group"]),A.title(A.colorAccessor());var i=function(t){return t},a=function(t){return t};A.colsLabel=function(t){return arguments.length?(i=t,A):i},A.rowsLabel=function(t){return arguments.length?(a=t,A):a};var o=function(t){c(0,t)},l=function(t){c(1,t)},u=function(t){var e=t.key;rt.events.trigger(function(){A.filter(rt.filters.TwoDimensionalFilter(e)),A.redrawGroup()})};function c(e,n){var r=A.selectAll(".box-group").filter(function(t){return t.key[e]===n}),i=r.filter(function(t){return!A.hasFilter(t.key)});rt.events.trigger(function(){var t=(i.empty()?r:i).data().map(function(t){return rt.filters.TwoDimensionalFilter(t.key)});A.filter([t]),A.redrawGroup()})}var s=rt.logger.deprecate(function(t){return A._filter(rt.filters.TwoDimensionalFilter(t))},"heatmap.filter taking a coordinate is deprecated - please pass dc.filters.TwoDimensionalFilter instead");return rt.override(A,"filter",function(t){return arguments.length?null===t||"TwoDimensionalFilter"===t.filterType||Array.isArray(t)&&Array.isArray(t[0])&&"TwoDimensionalFilter"===t[0][0].filterType?A._filter(t):s(t):A._filter()}),A.rows=function(t){return arguments.length?(r=t,A):r},A.rowOrdering=function(t){return arguments.length?(p=t,A):p},A.cols=function(t){return arguments.length?(n=t,A):n},A.colOrdering=function(t){return arguments.length?(g=t,A):g},A._doRender=function(){return A.resetSvg(),h=A.svg().append("g").attr("class","heatmap").attr("transform","translate("+A.margins().left+","+A.margins().top+")"),A._doRedraw()},A._doRedraw=function(){var t=A.data(),n=A.rows()||t.map(A.valueAccessor()),r=A.cols()||t.map(A.keyAccessor());p&&(n=n.sort(p)),g&&(r=r.sort(g)),n=v.domain(n),r=y.domain(r);var e=n.domain().length,i=r.domain().length,a=Math.floor(A.effectiveWidth()/i),o=Math.floor(A.effectiveHeight()/e);r.rangeRound([0,A.effectiveWidth()]),n.rangeRound([A.effectiveHeight(),0]);var l=h.selectAll("g.box-group").data(A.data(),function(t,e){return A.keyAccessor()(t,e)+"\0"+A.valueAccessor()(t,e)});l.exit().remove();var u=l.enter().append("g").attr("class","box-group");u.append("rect").attr("class","heat-box").attr("fill","white").attr("x",function(t,e){return r(A.keyAccessor()(t,e))}).attr("y",function(t,e){return n(A.valueAccessor()(t,e))}).on("click",A.boxOnClick()),l=u.merge(l),A.renderTitle()&&(u.append("title"),l.select("title").text(A.title())),rt.transition(l.select("rect"),A.transitionDuration(),A.transitionDelay()).attr("x",function(t,e){return r(A.keyAccessor()(t,e))}).attr("y",function(t,e){return n(A.valueAccessor()(t,e))}).attr("rx",m).attr("ry",x).attr("fill",A.getColor).attr("width",a).attr("height",o);var c=h.select("g.cols");c.empty()&&(c=h.append("g").attr("class","cols axis"));var s=c.selectAll("text").data(r.domain());s.exit().remove(),s=s.enter().append("text").attr("x",function(t){return r(t)+a/2}).style("text-anchor","middle").attr("y",A.effectiveHeight()).attr("dy",12).on("click",A.xAxisOnClick()).text(A.colsLabel()).merge(s),rt.transition(s,A.transitionDuration(),A.transitionDelay()).text(A.colsLabel()).attr("x",function(t){return r(t)+a/2}).attr("y",A.effectiveHeight());var d=h.select("g.rows");d.empty()&&(d=h.append("g").attr("class","rows axis"));var f=d.selectAll("text").data(n.domain());return f.exit().remove(),f=f.enter().append("text").style("text-anchor","end").attr("x",0).attr("dx",-2).attr("y",function(t){return n(t)+o/2}).attr("dy",6).on("click",A.yAxisOnClick()).text(A.rowsLabel()).merge(f),rt.transition(f,A.transitionDuration(),A.transitionDelay()).text(A.rowsLabel()).attr("y",function(t){return n(t)+o/2}),A.hasFilter()?A.selectAll("g.box-group").each(function(t){A.isSelectedNode(t)?A.highlightSelected(this):A.fadeDeselected(this)}):A.selectAll("g.box-group").each(function(){A.resetHighlight(this)}),A},A.boxOnClick=function(t){return arguments.length?(u=t,A):u},A.xAxisOnClick=function(t){return arguments.length?(o=t,A):o},A.yAxisOnClick=function(t){return arguments.length?(l=t,A):l},A.xBorderRadius=function(t){return arguments.length?(m=t,A):m},A.yBorderRadius=function(t){return arguments.length?(x=t,A):x},A.isSelectedNode=function(t){return A.hasFilter(t.key)},A.anchor(t,e)},nt.box=function(){var w=1,C=1,S=0,E=null,L=Number,M=c,R=s,O=null,T=!1,B=.3,F=.8,N=!1,H=!0,G=!1;function e(t){t.each(function(e,t){e=e.map(L).sort(nt.ascending);var n,r,i=nt.select(this),a=e.length;if(0!==a){var o=e.quartiles=R(e),l=M&&M.call(this,e,t),u=l&&l.map(function(t){return e[t]}),c=l?nt.range(0,l[0]).concat(nt.range(l[1]+1,a)):nt.range(a);r=H?(n=e[0],e[a-1]):(n=e[l[0]],e[l[1]]);var s=nt.range(l[0],l[1]+1),d=nt.scaleLinear().domain(E&&E.call(this,e,t)||[n,r]).range([C,0]),f=this.__chart__||nt.scaleLinear().domain([0,1/0]).range(d.range());this.__chart__=d;var h=i.selectAll("line.center").data(u?[u]:[]);h.enter().insert("line","rect").attr("class","center").attr("x1",w/2).attr("y1",function(t){return f(t[0])}).attr("x2",w/2).attr("y2",function(t){return f(t[1])}).style("opacity",1e-6).transition().duration(S).delay(0).style("opacity",1).attr("y1",function(t){return d(t[0])}).attr("y2",function(t){return d(t[1])}),h.transition().duration(S).delay(0).style("opacity",1).attr("x1",w/2).attr("x2",w/2).attr("y1",function(t){return d(t[0])}).attr("y2",function(t){return d(t[1])}),h.exit().transition().duration(S).delay(0).style("opacity",1e-6).attr("y1",function(t){return d(t[0])}).attr("y2",function(t){return d(t[1])}).remove();var g=i.selectAll("rect.box").data([o]);g.enter().append("rect").attr("class","box").attr("x",0).attr("y",function(t){return f(t[2])}).attr("width",w).attr("height",function(t){return f(t[0])-f(t[2])}).style("fill-opacity",T?.1:1).transition().duration(S).delay(0).attr("y",function(t){return d(t[2])}).attr("height",function(t){return d(t[0])-d(t[2])}),g.transition().duration(S).delay(0).attr("width",w).attr("y",function(t){return d(t[2])}).attr("height",function(t){return d(t[0])-d(t[2])});var p=i.selectAll("line.median").data([o[1]]);p.enter().append("line").attr("class","median").attr("x1",0).attr("y1",f).attr("x2",w).attr("y2",f).transition().duration(S).delay(0).attr("y1",d).attr("y2",d),p.transition().duration(S).delay(0).attr("x1",0).attr("x2",w).attr("y1",d).attr("y2",d);var y=i.selectAll("line.whisker").data(u||[]);if(y.enter().insert("line","circle, text").attr("class","whisker").attr("x1",0).attr("y1",f).attr("x2",w).attr("y2",f).style("opacity",1e-6).transition().duration(S).delay(0).attr("y1",d).attr("y2",d).style("opacity",1),y.transition().duration(S).delay(0).attr("x1",0).attr("x2",w).attr("y1",d).attr("y2",d).style("opacity",1),y.exit().transition().duration(S).delay(0).attr("y1",d).attr("y2",d).style("opacity",1e-6).remove(),H){var v=G?"outlierBold":"outlier",m=G?3:5,x=G?function(){return Math.floor(Math.random()*(w*F)+1+(w-w*F)/2)}:function(){return w/2},A=i.selectAll("circle."+v).data(c,Number);A.enter().insert("circle","text").attr("class",v).attr("r",m).attr("cx",x).attr("cy",function(t){return f(e[t])}).style("opacity",1e-6).transition().duration(S).delay(0).attr("cy",function(t){return d(e[t])}).style("opacity",.6),N&&(A.selectAll("title").remove(),A.append("title").text(function(t){return e[t]})),A.transition().duration(S).delay(0).attr("cx",x).attr("cy",function(t){return d(e[t])}).style("opacity",.6),A.exit().transition().duration(S).delay(0).attr("cy",0).style("opacity",1e-6).remove()}if(T){var b=i.selectAll("circle.data").data(s);b.enter().insert("circle","text").attr("class","data").attr("r",3).attr("cx",function(){return Math.floor(Math.random()*(w*F)+1+(w-w*F)/2)}).attr("cy",function(t){return f(e[t])}).style("opacity",1e-6).transition().duration(S).delay(0).attr("cy",function(t){return d(e[t])}).style("opacity",B),N&&(b.selectAll("title").remove(),b.append("title").text(function(t){return e[t]})),b.transition().duration(S).delay(0).attr("cx",function(){return Math.floor(Math.random()*(w*F)+1+(w-w*F)/2)}).attr("cy",function(t){return d(e[t])}).style("opacity",B),b.exit().transition().duration(S).delay(0).attr("cy",0).style("opacity",1e-6).remove()}var _=O||d.tickFormat(8),k=i.selectAll("text.box").data(o);k.enter().append("text").attr("class","box").attr("dy",".3em").attr("dx",function(t,e){return 1&e?6:-6}).attr("x",function(t,e){return 1&e?w:0}).attr("y",f).attr("text-anchor",function(t,e){return 1&e?"start":"end"}).text(_).transition().duration(S).delay(0).attr("y",d),k.transition().duration(S).delay(0).text(_).attr("x",function(t,e){return 1&e?w:0}).attr("y",d);var D=i.selectAll("text.whisker").data(u||[]);D.enter().append("text").attr("class","whisker").attr("dy",".3em").attr("dx",6).attr("x",w).attr("y",f).text(_).style("opacity",1e-6).transition().duration(S).delay(0).attr("y",d).style("opacity",1),D.transition().duration(S).delay(0).text(_).attr("x",w).attr("y",d).style("opacity",1),D.exit().transition().duration(S).delay(0).attr("y",d).style("opacity",1e-6).remove(),delete e.quartiles}}),nt.timerFlush()}return e.width=function(t){return arguments.length?(w=t,e):w},e.height=function(t){return arguments.length?(C=t,e):C},e.tickFormat=function(t){return arguments.length?(O=t,e):O},e.showOutliers=function(t){return arguments.length?(H=t,e):H},e.boldOutlier=function(t){return arguments.length?(G=t,e):G},e.renderDataPoints=function(t){return arguments.length?(T=t,e):T},e.renderTitle=function(t){return arguments.length?(N=t,e):N},e.dataOpacity=function(t){return arguments.length?(B=t,e):B},e.dataWidthPortion=function(t){return arguments.length?(F=t,e):F},e.duration=function(t){return arguments.length?(S=t,e):S},e.domain=function(t){return arguments.length?(E=null===t?t:"function"==typeof t?t:rt.utils.constant(t),e):E},e.value=function(t){return arguments.length?(L=t,e):L},e.whiskers=function(t){return arguments.length?(M=t,e):M},e.quartiles=function(t){return arguments.length?(R=t,e):R},e},rt.boxPlot=function(t,e){var a=rt.coordinateGridMixin({});var n=function(o){return function(t){for(var e=t.quartiles[0],n=t.quartiles[2],r=(n-e)*o,i=-1,a=t.length;t[++i]<e-r;);for(;t[--a]>n+r;);return[i,a]}}(1.5),r=nt.box(),i=null,o=!1,l=.3,u=.8,c=!0,s=!1,d=8,f=function(t,e){return a.isOrdinal()?a.x().bandwidth():t/(1+a.boxPadding())/e};a.x(nt.scaleBand()),a.xUnits(rt.units.ordinal),a.data(function(t){return t.all().map(function(e){return e.map=function(t){return t.call(e,e)},e}).filter(function(t){return 0!==a.valueAccessor()(t).length})}),a.boxPadding=a._rangeBandPadding,a.boxPadding(.8),a.outerPadding=a._outerRangeBandPadding,a.outerPadding(.5),a.boxWidth=function(t){return arguments.length?(f="function"==typeof t?t:rt.utils.constant(t),a):f};function h(t,e){return"translate("+a.x()(a.keyAccessor()(t,e))+", 0)"}function g(){return nt.min(a.data(),function(t){return nt.min(a.valueAccessor()(t))})}function p(){return nt.max(a.data(),function(t){return nt.max(a.valueAccessor()(t))})}function y(){return(p()-g())/a.effectiveHeight()}return a._preprocessData=function(){a.elasticX()&&a.x().domain([])},a.plotData=function(){var t=f(a.effectiveWidth(),a.xUnitCount());r.whiskers(n).width(t).height(a.effectiveHeight()).value(a.valueAccessor()).domain(a.y().domain()).duration(a.transitionDuration()).tickFormat(i).renderDataPoints(o).dataOpacity(l).dataWidthPortion(u).renderTitle(a.renderTitle()).showOutliers(c).boldOutlier(s);var e=a.chartBodyG().selectAll("g.box").data(a.data(),a.keyAccessor());!function(t){rt.transition(t,a.transitionDuration(),a.transitionDelay()).attr("transform",h).call(r).each(function(t){var e=a.getColor(t,0);nt.select(this).select("rect.box").attr("fill",e),nt.select(this).selectAll("circle.data").attr("fill",e)})}(function(t){var e=t.enter().append("g");return e.attr("class","box").attr("transform",h).call(r).on("click",function(t){a.filter(a.keyAccessor()(t)),a.redrawGroup()}),e.merge(t)}(e)),function(t){t.exit().remove().call(r)}(e),a.fadeDeselectedArea(a.filter())},a.fadeDeselectedArea=function(t){if(a.hasFilter())if(a.isOrdinal())a.g().selectAll("g.box").each(function(t){a.isSelectedNode(t)?a.highlightSelected(this):a.fadeDeselected(this)});else{if(!a.brushOn()&&!a.parentBrushOn())return;var n=t[0],r=t[1],i=a.keyAccessor();a.g().selectAll("g.box").each(function(t){var e=i(t);e<n||r<=e?a.fadeDeselected(this):a.highlightSelected(this)})}else a.g().selectAll("g.box").each(function(){a.resetHighlight(this)})},a.isSelectedNode=function(t){return a.hasFilter(a.keyAccessor()(t))},a.yAxisMin=function(){var t=d*y();return rt.utils.subtract(g()-t,a.yAxisPadding())},a.yAxisMax=function(){var t=d*y();return rt.utils.add(p()+t,a.yAxisPadding())},a.tickFormat=function(t){return arguments.length?(i=t,a):i},a.yRangePadding=function(t){return arguments.length?(d=t,a):d},a.renderDataPoints=function(t){return arguments.length?(o=t,a):o},a.dataOpacity=function(t){return arguments.length?(l=t,a):l},a.dataWidthPortion=function(t){return arguments.length?(u=t,a):u},a.showOutliers=function(t){return arguments.length?(c=t,a):c},a.boldOutlier=function(t){return arguments.length?(s=t,a):s},a.anchor(t,e)},rt.selectMenu=function(t,e){var n,r="dc-select-option",i=rt.baseMixin({}),a="Select all",o=!1,l=null,u=null,c=function(t,e){return i.keyAccessor()(t)>i.keyAccessor()(e)?1:i.keyAccessor()(e)>i.keyAccessor()(t)?-1:0},s=function(t){return 0<i.valueAccessor()(t)};i.data(function(t){return t.all().filter(s)}),i._doRender=function(){return i.select("select").remove(),(n=i.root().append("select").classed("dc-select-menu",!0)).append("option").text(a).attr("value",""),i._doRedraw(),i};var d=window.navigator.userAgent;function f(t,e){var n,r=nt.event.target;r.selectedOptions?n=Array.prototype.slice.call(r.selectedOptions).map(function(t){return t.value}):n=[].slice.call(nt.event.target.options).filter(function(t){return t.selected}).map(function(t){return t.value});1===n.length&&""===n[0]?n=l||null:o||1!==n.length||(n=n[0]),i.onChange(n)}return 0<d.indexOf("Trident/")&&-1===d.indexOf("MSIE")&&(i.redraw=i.render),i._doRedraw=function(){return function(){o?n.attr("multiple",!0):n.attr("multiple",null);null!==u?n.attr("size",u):n.attr("size",null)}(),function(){var t=n.selectAll("option."+r).data(i.data(),function(t){return i.keyAccessor()(t)});t.exit().remove(),t.enter().append("option").classed(r,!0).attr("value",function(t){return i.keyAccessor()(t)}).merge(t).text(i.title()),n.selectAll("option."+r).sort(c),n.on("change",f)}(),i.hasFilter()&&o?n.selectAll("option").property("selected",function(t){return void 0!==t&&0<=i.filters().indexOf(String(i.keyAccessor()(t)))}):i.hasFilter()?n.property("value",i.filter()):n.property("value",""),i},i.onChange=function(t){t&&o?i.replaceFilter([t]):t?i.replaceFilter(t):i.filterAll(),rt.events.trigger(function(){i.redrawGroup()})},i.order=function(t){return arguments.length?(c=t,i):c},i.promptText=function(t){return arguments.length?(a=t,i):a},i.filterDisplayed=function(t){return arguments.length?(s=t,i):s},i.multiple=function(t){return arguments.length?(o=t,i):o},i.promptValue=function(t){return arguments.length?(l=t,i):l},i.numberVisible=function(t){return arguments.length?(u=t,i):u},i.size=rt.logger.deprecate(i.numberVisible,"selectMenu.size is ambiguous - use numberVisible instead"),i.anchor(t,e)},rt.textFilterWidget=function(t,e){var n=rt.baseMixin({}),r=function(t){return t.toLowerCase()},i=function(e){return e=r(e),function(t){return-1!==r(t).indexOf(e)}},a="search";return n.group(function(){throw"the group function on textFilterWidget should never be called, please report the issue"}),n._doRender=function(){return n.select("input").remove(),n.root().append("input").classed("dc-text-filter-input",!0).on("input",function(){n.dimension().filterFunction(i(this.value)),rt.events.trigger(function(){rt.redrawAll()},rt.constants.EVENT_DELAY)}),n._doRedraw(),n},n._doRedraw=function(){return n.root().selectAll("input").attr("placeholder",a),n},n.normalize=function(t){return arguments.length?(r=t,n):r},n.placeHolder=function(t){return arguments.length?(a=t,n):a},n.filterFunctionFactory=function(t){return arguments.length?(i=t,n):i},n.anchor(t,e)},rt.cboxMenu=function(t,e){var n,r="dc-cbox-item",i=rt.baseMixin({}),a="Select all",o=!1,l="radio",u=null,c=Math.floor(1e5*Math.random())+1,s=function(t,e){return i.keyAccessor()(t)>i.keyAccessor()(e)?1:i.keyAccessor()(e)>i.keyAccessor()(t)?-1:0},d=function(t){return 0<i.valueAccessor()(t)};function f(t,e){var n;nt.select(nt.event.target).datum()?(n=nt.select(this).selectAll("input").filter(function(t){if(t)return this.checked}).nodes().map(function(t){return t.value}),o||1!==n.length||(n=n[0])):n=u||null,i.onChange(n)}return i.data(function(t){return t.all().filter(d)}),i._doRender=function(){return i._doRedraw()},i._doRedraw=function(){return i.select("ul").remove(),n=i.root().append("ul").classed("dc-cbox-group",!0),function(){var t=n.selectAll("li."+r).data(i.data(),function(t){return i.keyAccessor()(t)});if(t.exit().remove(),(t=t.enter().append("li").classed(r,!0).merge(t)).append("input").attr("type",l).attr("value",function(t){return i.keyAccessor()(t)}).attr("name","domain_"+c).attr("id",function(t,e){return"input_"+c+"_"+e}),t.append("label").attr("for",function(t,e){return"input_"+c+"_"+e}).text(i.title()),o)n.append("li").append("input").attr("type","reset").text(a).on("click",f);else{var e=n.append("li");e.append("input").attr("type",l).attr("value",u).attr("name","domain_"+c).attr("id",function(t,e){return"input_"+c+"_all"}).property("checked",!0),e.append("label").attr("for",function(t,e){return"input_"+c+"_all"}).text(a)}n.selectAll("li."+r).sort(s),n.on("change",f)}(),i.hasFilter()&&o?n.selectAll("input").property("checked",function(t){return t&&0<=i.filters().indexOf(String(i.keyAccessor()(t)))||!1}):i.hasFilter()&&n.selectAll("input").property("checked",function(t){return!!t&&i.keyAccessor()(t)===i.filter()}),i},i.onChange=function(t){t&&o?i.replaceFilter([t]):t?i.replaceFilter(t):i.filterAll(),rt.events.trigger(function(){i.redrawGroup()})},i.order=function(t){return arguments.length?(s=t,i):s},i.promptText=function(t){return arguments.length?(a=t,i):a},i.filterDisplayed=function(t){return arguments.length?(d=t,i):d},i.multiple=function(t){return arguments.length?(l=(o=t)?"checkbox":"radio",i):o},i.promptValue=function(t){return arguments.length?(u=t,i):u},i.anchor(t,e)},rt.abstractBubbleChart=rt.bubbleMixin,rt.baseChart=rt.baseMixin,rt.capped=rt.capMixin,rt.colorChart=rt.colorMixin,rt.coordinateGridChart=rt.coordinateGridMixin,rt.marginable=rt.marginMixin,rt.stackableChart=rt.stackMixin,rt.d3=nt,rt.crossfilter=t,rt}if("function"==typeof define&&define.amd)define(["d3","crossfilter2"],t);else if("object"==typeof module&&module.exports){var e=require("d3"),n=require("crossfilter2");"function"!=typeof n&&(n=n.crossfilter),module.exports=t(e,n)}else this.dc=t(d3,crossfilter)}();
//# sourceMappingURL=dc.min.js.map