!function(t,e){var i=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=454)}({454:function(t,e,i){"use strict";i.r(e);var n=i(97);i.n(n),i.d(e,"c3",function(){return n})},455:function(t,e){t.exports=window.d3},97:function(t,e,i){ /* @license C3.js v0.6.14 | (c) C3 Team and other contributors | http://c3js.org/ */ t.exports=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t){var e=this;e.d3=window.d3?window.d3:i(455),e.api=t,e.config=e.getDefaultConfig(),e.data={},e.cache={},e.axes={}}function n(t){this.internal=new e(this),this.internal.loadConfig(t),this.internal.beforeInit(t),this.internal.init(),this.internal.afterInit(t),function t(e,i,n){Object.keys(e).forEach(function(r){i[r]=e[r].bind(n),Object.keys(e[r]).length>0&&t(e[r],i[r],n)})}(n.prototype,this,this)}function r(t,e){this.component=t,this.params=e||{},this.d3=t.d3,this.scale=this.d3.scaleLinear(),this.range,this.orient="bottom",this.innerTickSize=6,this.outerTickSize=this.params.withOuterTick?6:0,this.tickPadding=3,this.tickValues=null,this.tickFormat,this.tickArguments,this.tickOffset=0,this.tickCulling=!0,this.tickCentered,this.tickTextCharSize,this.tickTextRotate=this.params.tickTextRotate,this.tickLength,this.axis=this.generateAxis()}r.prototype.axisX=function(t,e,i){t.attr("transform",function(t){return"translate("+Math.ceil(e(t)+i)+", 0)"})},r.prototype.axisY=function(t,e){t.attr("transform",function(t){return"translate(0,"+Math.ceil(e(t))+")"})},r.prototype.scaleExtent=function(t){var e=t[0],i=t[t.length-1];return e0&&n[0]>0&&n.unshift(n[0]-(n[1]-n[0])),n},r.prototype.copyScale=function(){var t,e=this.scale.copy();return this.params.isCategory&&(t=this.scale.domain(),e.domain([t[0],t[1]-1])),e},r.prototype.textFormatted=function(t){var e=this.tickFormat?this.tickFormat(t):t;return void 0!==e?e:""},r.prototype.updateRange=function(){return this.range=this.scale.rangeExtent?this.scale.rangeExtent():this.scaleExtent(this.scale.range()),this.range},r.prototype.updateTickTextCharSize=function(t){var e=this;if(e.tickTextCharSize)return e.tickTextCharSize;var i={h:11.5,w:5.5};return t.select("text").text(function(t){return e.textFormatted(t)}).each(function(t){var n=this.getBoundingClientRect(),r=e.textFormatted(t),a=n.height,o=r?n.width/r.length:void 0;a&&o&&(i.h=a,i.w=o)}).text(""),e.tickTextCharSize=i,i},r.prototype.isVertical=function(){return"left"===this.orient||"right"===this.orient},r.prototype.tspanData=function(t,e,i){var n=this.params.tickMultiline?this.splitTickText(t,i):[].concat(this.textFormatted(t));return this.params.tickMultiline&&this.params.tickMultilineMax>0&&(n=this.ellipsify(n,this.params.tickMultilineMax)),n.map(function(t){return{index:e,splitted:t,length:n.length}})},r.prototype.splitTickText=function(t,e){var i,n,r,a=this,o=a.textFormatted(t),s=a.params.tickWidth;return"[object Array]"===Object.prototype.toString.call(o)?o:((!s||s<=0)&&(s=a.isVertical()?95:a.params.isCategory?Math.ceil(e(1)-e(0))-12:110),function t(e,o){n=void 0;for(var c=1;c=0;r--){var a=i[r].length;if(i[r]=i[r].substr(0,a-n).padEnd(a,"."),(n-=a)<=0)break}return i},r.prototype.updateTickLength=function(){this.tickLength=Math.max(this.innerTickSize,0)+this.tickPadding},r.prototype.lineY2=function(t){var e=this.scale(t)+(this.tickCentered?0:this.tickOffset);return this.range[0]0?1:-1):this.tickLength},r.prototype.textTransform=function(){var t=this.tickTextRotate;return t?"rotate("+t+")":""},r.prototype.textTextAnchor=function(){var t=this.tickTextRotate;return t?t>0?"start":"end":"middle"},r.prototype.tspanDx=function(){var t=this.tickTextRotate;return t?8*Math.sin(Math.PI*(t/180)):0},r.prototype.tspanDy=function(t,e){var i=this.tickTextCharSize.h;return 0===e&&(i=this.isVertical()?-((t.length-1)*(this.tickTextCharSize.h/2)-3):".71em"),i},r.prototype.generateAxis=function(){var t=this,e=t.d3,i=t.params;function n(r,a){var o;return r.each(function(){var r,s,c,d=n.g=e.select(this),l=this.__chart__||t.scale,u=this.__chart__=t.copyScale(),h=t.tickValues?t.tickValues:t.generateTicks(u),g=d.selectAll(".tick").data(h,u),p=g.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),f=g.exit().remove(),_=g.merge(p);i.isCategory?(t.tickOffset=Math.ceil((u(1)-u(0))/2),s=t.tickCentered?0:t.tickOffset,c=t.tickCentered?t.tickOffset:0):t.tickOffset=s=0,t.updateRange(),t.updateTickLength(),t.updateTickTextCharSize(d.select(".tick"));var x=_.select("line").merge(p.append("line")),y=_.select("text").merge(p.append("text")),m=_.selectAll("text").selectAll("tspan").data(function(e,i){return t.tspanData(e,i,u)}),S=m.enter().append("tspan"),w=S.merge(m).text(function(t){return t.splitted});m.exit().remove();var v=d.selectAll(".domain").data([0]),b=v.enter().append("path").merge(v).attr("class","domain");switch(t.orient){case"bottom":r=t.axisX,x.attr("x1",s).attr("x2",s).attr("y2",function(e,i){return t.lineY2(e,i)}),y.attr("x",0).attr("y",function(e,i){return t.textY(e,i)}).attr("transform",function(e,i){return t.textTransform(e,i)}).style("text-anchor",function(e,i){return t.textTextAnchor(e,i)}),w.attr("x",0).attr("dy",function(e,i){return t.tspanDy(e,i)}).attr("dx",function(e,i){return t.tspanDx(e,i)}),b.attr("d","M"+t.range[0]+","+t.outerTickSize+"V0H"+t.range[1]+"V"+t.outerTickSize);break;case"top":r=t.axisX,x.attr("x1",s).attr("x2",s).attr("y2",function(e,i){return-1*t.lineY2(e,i)}),y.attr("x",0).attr("y",function(e,n){return-1*t.textY(e,n)-(i.isCategory?2:t.tickLength-2)}).attr("transform",function(e,i){return t.textTransform(e,i)}).style("text-anchor",function(e,i){return t.textTextAnchor(e,i)}),w.attr("x",0).attr("dy",function(e,i){return t.tspanDy(e,i)}).attr("dx",function(e,i){return t.tspanDx(e,i)}),b.attr("d","M"+t.range[0]+","+-t.outerTickSize+"V0H"+t.range[1]+"V"+-t.outerTickSize);break;case"left":r=t.axisY,x.attr("x2",-t.innerTickSize).attr("y1",c).attr("y2",c),y.attr("x",-t.tickLength).attr("y",t.tickOffset).style("text-anchor","end"),w.attr("x",-t.tickLength).attr("dy",function(e,i){return t.tspanDy(e,i)}),b.attr("d","M"+-t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+-t.outerTickSize);break;case"right":r=t.axisY,x.attr("x2",t.innerTickSize).attr("y1",c).attr("y2",c),y.attr("x",t.tickLength).attr("y",t.tickOffset).style("text-anchor","start"),w.attr("x",t.tickLength).attr("dy",function(e,i){return t.tspanDy(e,i)}),b.attr("d","M"+t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+t.outerTickSize)}if(u.rangeBand){var T=u,A=T.rangeBand()/2;l=u=function(t){return T(t)+A}}else l.rangeBand?l=u:f.call(r,u,t.tickOffset);p.call(r,l,t.tickOffset),o=(a?_.transition(a):_).style("opacity",1).call(r,u,t.tickOffset)}),o}return n.scale=function(e){return arguments.length?(t.scale=e,n):t.scale},n.orient=function(e){return arguments.length?(t.orient=e in{top:1,right:1,bottom:1,left:1}?e+"":"bottom",n):t.orient},n.tickFormat=function(e){return arguments.length?(t.tickFormat=e,n):t.tickFormat},n.tickCentered=function(e){return arguments.length?(t.tickCentered=e,n):t.tickCentered},n.tickOffset=function(){return t.tickOffset},n.tickInterval=function(){var e,r;return i.isCategory?e=2*t.tickOffset:(r=n.g.select("path.domain").node().getTotalLength()-2*t.outerTickSize,e=r/n.g.selectAll("line").size()),e===1/0?0:e},n.ticks=function(){return arguments.length?(t.tickArguments=arguments,n):t.tickArguments},n.tickCulling=function(e){return arguments.length?(t.tickCulling=e,n):t.tickCulling},n.tickValues=function(e){if("function"==typeof e)t.tickValues=function(){return e(t.scale.domain())};else{if(!arguments.length)return t.tickValues;t.tickValues=e}return n},n};var a={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",dragZoom:"c3-drag-zoom",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcLabelLine:"c3-arc-label-line",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"},o=function(t){return Math.ceil(t)+.5},s=function(t){return 10*Math.ceil(t/10)},c=function(t){return t[1]-t[0]},d=function(t,e,i){return h(t[e])?t[e]:i},l=function(t){var e=t.getBoundingClientRect(),i=[t.pathSegList.getItem(0),t.pathSegList.getItem(1)],n=i[0].x,r=Math.min(i[0].y,i[1].y);return{x:n,y:r,width:e.width,height:e.height}},u=function(t){return Array.isArray(t)},h=function(t){return void 0!==t},g=function(e){return null==e||f(e)&&0===e.length||"object"===t(e)&&0===Object.keys(e).length},p=function(t){return"function"==typeof t},f=function(t){return"string"==typeof t},_=function(t){return void 0===t},x=function(t){return t||0===t},y=function(t){return!g(t)},m=function(t){return"string"==typeof t?t.replace(//g,">"):t},S=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.owner=e,this.d3=e.d3,this.internal=r};S.prototype.init=function(){var t=this.owner,e=t.config,i=t.main;t.axes.x=i.append("g").attr("class",a.axis+" "+a.axisX).attr("clip-path",e.axis_x_inner?"":t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",e.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",a.axisXLabel).attr("transform",e.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=i.append("g").attr("class",a.axis+" "+a.axisY).attr("clip-path",e.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",e.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",a.axisYLabel).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=i.append("g").attr("class",a.axis+" "+a.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",e.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",a.axisY2Label).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},S.prototype.getXAxis=function(t,e,i,n,r,a,o){var s=this.owner,c=s.config,d={isCategory:s.isCategorized(),withOuterTick:r,tickMultiline:c.axis_x_tick_multiline,tickMultilineMax:c.axis_x_tick_multiline?Number(c.axis_x_tick_multilineMax):0,tickWidth:c.axis_x_tick_width,tickTextRotate:o?0:c.axis_x_tick_rotate,withoutTransition:a},l=new this.internal(this,d).axis.scale(t).orient(e);return s.isTimeSeries()&&n&&"function"!=typeof n&&(n=n.map(function(t){return s.parseDate(t)})),l.tickFormat(i).tickValues(n),s.isCategorized()&&(l.tickCentered(c.axis_x_tick_centered),g(c.axis_x_tick_culling)&&(c.axis_x_tick_culling=!1)),l},S.prototype.updateXAxisTickValues=function(t,e){var i,n=this.owner,r=n.config;return(r.axis_x_tick_fit||r.axis_x_tick_count)&&(i=this.generateTickValues(n.mapTargetsToUniqueXs(t),r.axis_x_tick_count,n.isTimeSeries())),e?e.tickValues(i):(n.xAxis.tickValues(i),n.subXAxis.tickValues(i)),i},S.prototype.getYAxis=function(t,e,i,n,r,a,o){var s=this.owner,c=s.config,d={withOuterTick:r,withoutTransition:a,tickTextRotate:o?0:c.axis_y_tick_rotate},l=new this.internal(this,d).axis.scale(t).orient(e).tickFormat(i);return s.isTimeSeriesY()?l.ticks(c.axis_y_tick_time_type,c.axis_y_tick_time_interval):l.tickValues(n),l},S.prototype.getId=function(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"},S.prototype.getXAxisTickFormat=function(){var t=this.owner,e=t.config,i=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(t){return t};return e.axis_x_tick_format&&(p(e.axis_x_tick_format)?i=e.axis_x_tick_format:t.isTimeSeries()&&(i=function(i){return i?t.axisTimeFormat(e.axis_x_tick_format)(i):""})),p(i)?function(e){return i.call(t,e)}:i},S.prototype.getTickValues=function(t,e){return t||(e?e.tickValues():void 0)},S.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},S.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},S.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},S.prototype.getLabelOptionByAxisId=function(t){var e,i=this.owner,n=i.config;return"y"===t?e=n.axis_y_label:"y2"===t?e=n.axis_y2_label:"x"===t&&(e=n.axis_x_label),e},S.prototype.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return f(e)?e:e?e.text:null},S.prototype.setLabelText=function(t,e){var i=this.owner,n=i.config,r=this.getLabelOptionByAxisId(t);f(r)?"y"===t?n.axis_y_label=e:"y2"===t?n.axis_y2_label=e:"x"===t&&(n.axis_x_label=e):r&&(r.text=e)},S.prototype.getLabelPosition=function(e,i){var n=this.getLabelOptionByAxisId(e),r=n&&"object"===t(n)&&n.position?n.position:i;return{isInner:r.indexOf("inner")>=0,isOuter:r.indexOf("outer")>=0,isLeft:r.indexOf("left")>=0,isCenter:r.indexOf("center")>=0,isRight:r.indexOf("right")>=0,isTop:r.indexOf("top")>=0,isMiddle:r.indexOf("middle")>=0,isBottom:r.indexOf("bottom")>=0}},S.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},S.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},S.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},S.prototype.getLabelPositionById=function(t){return"y2"===t?this.getY2AxisLabelPosition():"y"===t?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},S.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},S.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},S.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},S.prototype.xForAxisLabel=function(t,e){var i=this.owner;return t?e.isLeft?0:e.isCenter?i.width/2:i.width:e.isBottom?-i.height:e.isMiddle?-i.height/2:0},S.prototype.dxForAxisLabel=function(t,e){return t?e.isLeft?"0.5em":e.isRight?"-0.5em":"0":e.isTop?"-0.5em":e.isBottom?"0.5em":"0"},S.prototype.textAnchorForAxisLabel=function(t,e){return t?e.isLeft?"start":e.isCenter?"middle":"end":e.isBottom?"start":e.isMiddle?"middle":"end"},S.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},S.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},S.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},S.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},S.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},S.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},S.prototype.dyForXAxisLabel=function(){var t=this.owner,e=t.config,i=this.getXAxisLabelPosition();return e.axis_rotated?i.isInner?"1.2em":-25-(t.config.axis_x_inner?0:this.getMaxTickWidth("x")):i.isInner?"-0.5em":e.axis_x_height?e.axis_x_height-10:"3em"},S.prototype.dyForYAxisLabel=function(){var t=this.owner,e=this.getYAxisLabelPosition();return t.config.axis_rotated?e.isInner?"-0.5em":"3em":e.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},S.prototype.dyForY2AxisLabel=function(){var t=this.owner,e=this.getY2AxisLabelPosition();return t.config.axis_rotated?e.isInner?"1.2em":"-2.2em":e.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},S.prototype.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},S.prototype.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},S.prototype.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},S.prototype.getMaxTickWidth=function(t,e){var i,n,r,a,o=this.owner,s=o.config,c=0;return e&&o.currentMaxTickWidths[t]?o.currentMaxTickWidths[t]:(o.svg&&(i=o.filterTargetsToShow(o.data.targets),"y"===t?(n=o.y.copy().domain(o.getYDomain(i,"y")),r=this.getYAxis(n,o.yOrient,s.axis_y_tick_format,o.yAxisTickValues,!1,!0,!0)):"y2"===t?(n=o.y2.copy().domain(o.getYDomain(i,"y2")),r=this.getYAxis(n,o.y2Orient,s.axis_y2_tick_format,o.y2AxisTickValues,!1,!0,!0)):(n=o.x.copy().domain(o.getXDomain(i)),r=this.getXAxis(n,o.xOrient,o.xAxisTickFormat,o.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(i,r)),(a=o.d3.select("body").append("div").classed("c3",!0)).append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0).append("g").call(r).each(function(){o.d3.select(this).selectAll("text").each(function(){var t=this.getBoundingClientRect();c2){for(o=n-2,r=t[0],a=t[t.length-1],s=(a-r)/(o+1),l=[r],c=0;c=0&&F.select(this).style("display",e%E?"none":"block")})}else k.svg.selectAll("."+a.axisX+" .tick text").style("display","block");x=k.generateDrawArea?k.generateDrawArea(M,!1):void 0,y=k.generateDrawBar?k.generateDrawBar(z):void 0,m=k.generateDrawLine?k.generateDrawLine(H,!1):void 0,S=k.generateXYForText(M,z,H,!0),w=k.generateXYForText(M,z,H,!1),k.updateCircleY(),I=(k.config.axis_rotated?k.circleY:k.circleX).bind(k),R=(k.config.axis_rotated?k.circleX:k.circleY).bind(k),i&&(k.subY.domain(k.getYDomain(Y,"y")),k.subY2.domain(k.getYDomain(Y,"y2"))),k.updateXgridFocus(),D.select("text."+a.text+"."+a.empty).attr("x",k.width/2).attr("y",k.height/2).text(X.data_empty_label_text).transition().style("opacity",Y.length?0:1),p&&k.redrawEventRect(),k.updateGrid(v),k.updateRegion(v),k.updateBar(b),k.updateLine(b),k.updateArea(b),k.updateCircle(I,R),k.hasDataLabel()&&k.updateText(S,w,b),k.redrawTitle&&k.redrawTitle(),k.redrawArc&&k.redrawArc(v,b,c),k.redrawSubchart&&k.redrawSubchart(n,e,v,b,M,z,H),D.selectAll("."+a.selectedCircles).filter(k.isBarType.bind(k)).selectAll("circle").remove(),t.flow&&(C=k.generateFlow({targets:Y,flow:t.flow,duration:t.flow.duration,drawBar:y,drawLine:m,drawArea:x,cx:I,cy:R,xv:N,xForText:S,yForText:w})),k.isTabVisible()&&(v?(L=F.transition().duration(v),A=[],[k.redrawBar(y,!0,L),k.redrawLine(m,!0,L),k.redrawArea(x,!0,L),k.redrawCircle(I,R,!0,L),k.redrawText(S,w,t.flow,!0,L),k.redrawRegion(!0,L),k.redrawGrid(!0,L)].forEach(function(t){t.forEach(function(t){A.push(t)})}),P=k.generateWait(),A.forEach(function(t){P.add(t)}),P(function(){C&&C(),X.onrendered&&X.onrendered.call(k)})):(k.redrawBar(y),k.redrawLine(m),k.redrawArea(x),k.redrawCircle(I,R),k.redrawText(S,w,t.flow),k.redrawRegion(),k.redrawGrid(),C&&C(),X.onrendered&&X.onrendered.call(k))),k.mapToIds(k.data.targets).forEach(function(t){k.withoutFadeIn[t]=!0})},e.prototype.updateAndRedraw=function(t){var e,i=this,n=i.config;(t=t||{}).withTransition=d(t,"withTransition",!0),t.withTransform=d(t,"withTransform",!1),t.withLegend=d(t,"withLegend",!1),t.withUpdateXDomain=d(t,"withUpdateXDomain",!0),t.withUpdateOrgXDomain=d(t,"withUpdateOrgXDomain",!0),t.withTransitionForExit=!1,t.withTransitionForTransform=d(t,"withTransitionForTransform",t.withTransition),i.updateSizes(),t.withLegend&&n.legend_show||(e=i.axis.generateTransitions(t.withTransitionForAxis?n.transition_duration:0),i.updateScales(),i.updateSvgSize(),i.transformAll(t.withTransitionForTransform,e)),i.redraw(t,e)},e.prototype.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},e.prototype.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},e.prototype.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},e.prototype.isCustomX=function(){var t=this.config;return!this.isTimeSeries()&&(t.data_x||y(t.data_xs))},e.prototype.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},e.prototype.getTranslate=function(t){var e,i,n=this,r=n.config;return"main"===t?(e=o(n.margin.left),i=o(n.margin.top)):"context"===t?(e=o(n.margin2.left),i=o(n.margin2.top)):"legend"===t?(e=n.margin3.left,i=n.margin3.top):"x"===t?(e=0,i=r.axis_rotated?0:n.height):"y"===t?(e=0,i=r.axis_rotated?n.height:0):"y2"===t?(e=r.axis_rotated?0:n.width,i=r.axis_rotated?1:0):"subx"===t?(e=0,i=r.axis_rotated?0:n.height2):"arc"===t&&(e=n.arcWidth/2,i=n.arcHeight/2-(n.hasType("gauge")?6:0)),"translate("+e+","+i+")"},e.prototype.initialOpacity=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?1:0},e.prototype.initialOpacityForCircle=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?this.opacityForCircle(t):0},e.prototype.opacityForCircle=function(t){var e=(p(this.config.point_show)?this.config.point_show(t):this.config.point_show)?1:0;return x(t.value)?this.isScatterType(t)?.5:e:0},e.prototype.opacityForText=function(){return this.hasDataLabel()?1:0},e.prototype.xx=function(t){return t?this.x(t.x):null},e.prototype.xv=function(t){var e=this,i=t.value;return e.isTimeSeries()?i=e.parseDate(t.value):e.isCategorized()&&"string"==typeof t.value&&(i=e.config.axis_x_categories.indexOf(t.value)),Math.ceil(e.x(i))},e.prototype.yv=function(t){var e=t.axis&&"y2"===t.axis?this.y2:this.y;return Math.ceil(e(t.value))},e.prototype.subxx=function(t){return t?this.subX(t.x):null},e.prototype.transformMain=function(t,e){var i,n,r,o=this;e&&e.axisX?i=e.axisX:(i=o.main.select("."+a.axisX),t&&(i=i.transition())),e&&e.axisY?n=e.axisY:(n=o.main.select("."+a.axisY),t&&(n=n.transition())),e&&e.axisY2?r=e.axisY2:(r=o.main.select("."+a.axisY2),t&&(r=r.transition())),(t?o.main.transition():o.main).attr("transform",o.getTranslate("main")),i.attr("transform",o.getTranslate("x")),n.attr("transform",o.getTranslate("y")),r.attr("transform",o.getTranslate("y2")),o.main.select("."+a.chartArcs).attr("transform",o.getTranslate("arc"))},e.prototype.transformAll=function(t,e){var i=this;i.transformMain(t,e),i.config.subchart_show&&i.transformContext(t,e),i.legend&&i.transformLegend(t)},e.prototype.updateSvgSize=function(){var t=this,e=t.svg.select(".c3-brush .overlay");t.svg.attr("width",t.currentWidth).attr("height",t.currentHeight),t.svg.selectAll(["#"+t.clipId,"#"+t.clipIdForGrid]).select("rect").attr("width",t.width).attr("height",t.height),t.svg.select("#"+t.clipIdForXAxis).select("rect").attr("x",t.getXAxisClipX.bind(t)).attr("y",t.getXAxisClipY.bind(t)).attr("width",t.getXAxisClipWidth.bind(t)).attr("height",t.getXAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForYAxis).select("rect").attr("x",t.getYAxisClipX.bind(t)).attr("y",t.getYAxisClipY.bind(t)).attr("width",t.getYAxisClipWidth.bind(t)).attr("height",t.getYAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForSubchart).select("rect").attr("width",t.width).attr("height",e.size()?e.attr("height"):0),t.selectChart.style("max-height",t.currentHeight+"px")},e.prototype.updateDimension=function(t){var e=this;t||(e.config.axis_rotated?(e.axes.x.call(e.xAxis),e.axes.subx.call(e.subXAxis)):(e.axes.y.call(e.yAxis),e.axes.y2.call(e.y2Axis))),e.updateSizes(),e.updateScales(),e.updateSvgSize(),e.transformAll(!1)},e.prototype.observeInserted=function(t){var e,i=this;"undefined"!=typeof MutationObserver?(e=new MutationObserver(function(n){n.forEach(function(n){"childList"===n.type&&n.previousSibling&&(e.disconnect(),i.intervalForObserveInserted=window.setInterval(function(){t.node().parentNode&&(window.clearInterval(i.intervalForObserveInserted),i.updateDimension(),i.brush&&i.brush.update(),i.config.oninit.call(i),i.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity",1))},10))})})).observe(t.node(),{attributes:!0,childList:!0,characterData:!0}):window.console.error("MutationObserver not defined.")},e.prototype.bindResize=function(){var t=this,e=t.config;if(t.resizeFunction=t.generateResize(),t.resizeFunction.add(function(){e.onresize.call(t)}),e.resize_auto&&t.resizeFunction.add(function(){void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),t.resizeTimeout=window.setTimeout(function(){delete t.resizeTimeout,t.updateAndRedraw({withUpdateXDomain:!1,withUpdateOrgXDomain:!1,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.brush&&t.brush.update()},100)}),t.resizeFunction.add(function(){e.onresized.call(t)}),t.resizeIfElementDisplayed=function(){null!=t.api&&t.api.element.offsetParent&&t.resizeFunction()},window.attachEvent)window.attachEvent("onresize",t.resizeIfElementDisplayed);else if(window.addEventListener)window.addEventListener("resize",t.resizeIfElementDisplayed,!1);else{var i=window.onresize;i?i.add&&i.remove||(i=t.generateResize()).add(window.onresize):i=t.generateResize(),i.add(t.resizeFunction),window.onresize=function(){t.api.element.offsetParent&&i()}}},e.prototype.bindWindowFocus=function(){var t=this;this.windowFocusHandler||(this.windowFocusHandler=function(){t.redraw()},window.addEventListener("focus",this.windowFocusHandler))},e.prototype.unbindWindowFocus=function(){window.removeEventListener("focus",this.windowFocusHandler),delete this.windowFocusHandler},e.prototype.generateResize=function(){var t=[];function e(){t.forEach(function(t){t()})}return e.add=function(e){t.push(e)},e.remove=function(e){for(var i=0;ie.getTotalLength())break;i--}while(i>0);return i})),"SVGPathSegList"in window||(window.SVGPathSegList=function(t){this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.classname="SVGPathSegList",Object.defineProperty(window.SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new window.SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),window.SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},window.SVGPathSegList.prototype._updateListFromPathMutations=function(t){if(this._pathElement){var e=!1;t.forEach(function(t){"d"==t.attributeName&&(e=!0)}),e&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}},window.SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",window.SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.segmentChanged=function(t){this._writeListToPath()},window.SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(t){t._owningPathSegList=null}),this._list=[],this._writeListToPath()},window.SVGPathSegList.prototype.initialize=function(t){return this._checkPathSynchronizedToList(),this._list=[t],t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype._checkValidIndex=function(t){if(isNaN(t)||t<0||t>=this.numberOfItems)throw"INDEX_SIZE_ERR"},window.SVGPathSegList.prototype.getItem=function(t){return this._checkPathSynchronizedToList(),this._checkValidIndex(t),this._list[t]},window.SVGPathSegList.prototype.insertItemBefore=function(t,e){return this._checkPathSynchronizedToList(),e>this.numberOfItems&&(e=this.numberOfItems),t._owningPathSegList&&(t=t.clone()),this._list.splice(e,0,t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),this._list[e]=t,t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.removeItem=function(t){this._checkPathSynchronizedToList(),this._checkValidIndex(t);var e=this._list[t];return this._list.splice(t,1),this._writeListToPath(),e},window.SVGPathSegList.prototype.appendItem=function(t){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._list.push(t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList._pathSegArrayAsString=function(t){var e="",i=!0;return t.forEach(function(t){i?(i=!1,e+=t._asPathString()):e+=" "+t._asPathString()}),e},window.SVGPathSegList.prototype._parsePath=function(t){if(!t||0==t.length)return[];var e=this,i=function(){this.pathSegList=[]};i.prototype.appendSegment=function(t){this.pathSegList.push(t)};var n=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};n.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},n.prototype._skipOptionalSpaces=function(){for(;this._currentIndex="0"&&t<="9")&&e!=window.SVGPathSeg.PATHSEG_CLOSEPATH?e==window.SVGPathSeg.PATHSEG_MOVETO_ABS?window.SVGPathSeg.PATHSEG_LINETO_ABS:e==window.SVGPathSeg.PATHSEG_MOVETO_REL?window.SVGPathSeg.PATHSEG_LINETO_REL:e:window.SVGPathSeg.PATHSEG_UNKNOWN},n.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var t=this.peekSegmentType();return t==window.SVGPathSeg.PATHSEG_MOVETO_ABS||t==window.SVGPathSeg.PATHSEG_MOVETO_REL},n.prototype._parseNumber=function(){var t=0,e=0,i=1,n=0,r=1,a=1,o=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex"9")&&"."!=this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=s)for(var c=this._currentIndex-1,d=1;c>=s;)e+=d*(this._string.charAt(c--)-"0"),d*=10;if(this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)i*=10,n+=(this._string.charAt(this._currentIndex)-"0")/i,this._currentIndex+=1}if(this._currentIndex!=o&&this._currentIndex+1=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)t*=10,t+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var l=e+n;if(l*=r,t&&(l*=Math.pow(10,a*t)),o!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),l}},n.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var t=!1,e=this._string.charAt(this._currentIndex++);if("0"==e)t=!1;else{if("1"!=e)return;t=!0}return this._skipOptionalSpacesOrDelimiter(),t}},n.prototype.parseSegment=function(){var t=this._string[this._currentIndex],i=this._pathSegTypeFromChar(t);if(i==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((i=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=i,i){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(e);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var n={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(e,n.x,n.y,n.x1,n.y1,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return n={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(e,n.x,n.y,n.x1,n.y1,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return n={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(e,n.x,n.y,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return n={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(e,n.x,n.y,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return n={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(e,n.x,n.y,n.x1,n.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return n={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(e,n.x,n.y,n.x1,n.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return n={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(e,n.x,n.y,n.x1,n.y1,n.arcAngle,n.arcLarge,n.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return n={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(e,n.x,n.y,n.x1,n.y1,n.arcAngle,n.arcLarge,n.arcSweep);default:throw"Unknown path seg type."}};var r=new i,a=new n(t);if(!a.initialCommandIsMoveTo())return[];for(;a.hasMoreData();){var o=a.parseSegment();if(!o)return[];r.appendSegment(o)}return r.pathSegList}),String.prototype.padEnd||(String.prototype.padEnd=function(t,e){return t>>=0,e=String(void 0!==e?e:" "),this.length>t?String(this):((t-=this.length)>e.length&&(e+=e.repeat(t/e.length)),String(this)+e.slice(0,t))}),n.prototype.axis=function(){},n.prototype.axis.labels=function(t){var e=this.internal;arguments.length&&(Object.keys(t).forEach(function(i){e.axis.setLabelText(i,t[i])}),e.axis.updateLabels())},n.prototype.axis.max=function(e){var i=this.internal,n=i.config;if(!arguments.length)return{x:n.axis_x_max,y:n.axis_y_max,y2:n.axis_y2_max};"object"===t(e)?(x(e.x)&&(n.axis_x_max=e.x),x(e.y)&&(n.axis_y_max=e.y),x(e.y2)&&(n.axis_y2_max=e.y2)):n.axis_y_max=n.axis_y2_max=e,i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.prototype.axis.min=function(e){var i=this.internal,n=i.config;if(!arguments.length)return{x:n.axis_x_min,y:n.axis_y_min,y2:n.axis_y2_min};"object"===t(e)?(x(e.x)&&(n.axis_x_min=e.x),x(e.y)&&(n.axis_y_min=e.y),x(e.y2)&&(n.axis_y2_min=e.y2)):n.axis_y_min=n.axis_y2_min=e,i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.prototype.axis.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};h(t.max)&&this.axis.max(t.max),h(t.min)&&this.axis.min(t.min)},n.prototype.category=function(t,e){var i=this.internal,n=i.config;return arguments.length>1&&(n.axis_x_categories[t]=e,i.redraw()),n.axis_x_categories[t]},n.prototype.categories=function(t){var e=this.internal,i=e.config;return arguments.length?(i.axis_x_categories=t,e.redraw(),i.axis_x_categories):i.axis_x_categories},n.prototype.resize=function(t){var e=this.internal.config;e.size_width=t?t.width:null,e.size_height=t?t.height:null,this.flush()},n.prototype.flush=function(){this.internal.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},n.prototype.destroy=function(){var t=this.internal;if(window.clearInterval(t.intervalForObserveInserted),void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),window.detachEvent)window.detachEvent("onresize",t.resizeIfElementDisplayed);else if(window.removeEventListener)window.removeEventListener("resize",t.resizeIfElementDisplayed);else{var e=window.onresize;e&&e.add&&e.remove&&e.remove(t.resizeFunction)}return t.resizeFunction.remove(),t.unbindWindowFocus(),t.selectChart.classed("c3",!1).html(""),Object.keys(t).forEach(function(e){t[e]=null}),null},n.prototype.color=function(t){return this.internal.color(t)},n.prototype.data=function(t){var e=this.internal.data.targets;return void 0===t?e:e.filter(function(e){return[].concat(t).indexOf(e.id)>=0})},n.prototype.data.shown=function(t){return this.internal.filterTargetsToShow(this.data(t))},n.prototype.data.values=function(t){var e,i=null;return t&&(i=(e=this.data(t))[0]?e[0].values.map(function(t){return t.value}):null),i},n.prototype.data.names=function(t){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",t)},n.prototype.data.colors=function(t){return this.internal.updateDataAttributes("colors",t)},n.prototype.data.axes=function(t){return this.internal.updateDataAttributes("axes",t)},n.prototype.flow=function(t){var e,i,n,r,a,o,s,c=this.internal,d=[],l=c.getMaxDataCount(),u=0,g=0;if(t.json)i=c.convertJsonToData(t.json,t.keys);else if(t.rows)i=c.convertRowsToData(t.rows);else{if(!t.columns)return;i=c.convertColumnsToData(t.columns)}e=c.convertDataToTargets(i,!0),c.data.targets.forEach(function(t){var i,n,r=!1;for(i=0;i1?r.values[r.values.length-1].x-a.x:a.x-c.getXDomain(c.data.targets)[0]:1,n=[a.x-o,a.x],c.updateXDomain(null,!0,!0,!1,n)),c.updateTargets(c.data.targets),c.redraw({flow:{index:a.index,length:u,duration:x(t.duration)?t.duration:c.config.transition_duration,done:t.done,orgDataCount:l},withLegend:!0,withTransition:l>1,withTrimXDomain:!1,withUpdateXAxis:!0})},e.prototype.generateFlow=function(t){var e=this,i=e.config,n=e.d3;return function(){var r,o,s,d,l,u,h,g,p,f,_,x=t.targets,y=t.flow,m=t.drawBar,S=t.drawLine,w=t.drawArea,v=t.cx,b=t.cy,T=t.xv,A=t.xForText,P=t.yForText,C=t.duration,L=y.index,V=y.length,G=e.getValueOnIndex(e.data.targets[0].values,L),E=e.getValueOnIndex(e.data.targets[0].values,L+V),O=e.x.domain(),I=y.duration||C,R=y.done||function(){},k=e.generateWait();e.flowing=!0,e.data.targets.forEach(function(t){t.values.splice(0,V)}),s=e.updateXDomain(x,!0,!0),e.updateXGrid&&e.updateXGrid(!0),d=e.xgrid||n.selectAll([]),l=e.xgridLines||n.selectAll([]),u=e.mainRegion||n.selectAll([]),h=e.mainText||n.selectAll([]),g=e.mainBar||n.selectAll([]),p=e.mainLine||n.selectAll([]),f=e.mainArea||n.selectAll([]),_=e.mainCircle||n.selectAll([]),y.orgDataCount?r=1===y.orgDataCount||(G&&G.x)===(E&&E.x)?e.x(O[0])-e.x(s[0]):e.isTimeSeries()?e.x(O[0])-e.x(s[0]):e.x(G.x)-e.x(E.x):1!==e.data.targets[0].values.length?r=e.x(O[0])-e.x(s[0]):e.isTimeSeries()?(G=e.getValueOnIndex(e.data.targets[0].values,0),E=e.getValueOnIndex(e.data.targets[0].values,e.data.targets[0].values.length-1),r=e.x(G.x)-e.x(E.x)):r=c(s)/2,o="translate("+r+",0) scale("+c(O)/c(s)+",1)",e.hideXGridFocus();var D=n.transition().ease(n.easeLinear).duration(I);k.add(e.xAxis(e.axes.x,D)),k.add(g.transition(D).attr("transform",o)),k.add(p.transition(D).attr("transform",o)),k.add(f.transition(D).attr("transform",o)),k.add(_.transition(D).attr("transform",o)),k.add(h.transition(D).attr("transform",o)),k.add(u.filter(e.isRegionOnX).transition(D).attr("transform",o)),k.add(d.transition(D).attr("transform",o)),k.add(l.transition(D).attr("transform",o)),k(function(){var t,n=[],r=[];if(V){for(t=0;t=0&&(e=!0)}),!e)}),o.regions},n.prototype.selected=function(t){var e=this.internal,i=e.d3;return e.main.selectAll("."+a.shapes+e.getTargetSelectorSuffix(t)).selectAll("."+a.shape).filter(function(){return i.select(this).classed(a.SELECTED)}).nodes().map(function(t){var e=t.__data__;return e.data?e.data:e})},n.prototype.select=function(t,e,i){var n=this.internal,r=n.d3,o=n.config;o.data_selection_enabled&&n.main.selectAll("."+a.shapes).selectAll("."+a.shape).each(function(s,c){var d=r.select(this),l=s.data?s.data.id:s.id,u=n.getToggle(this,s).bind(n),g=o.data_selection_grouped||!t||t.indexOf(l)>=0,p=!e||e.indexOf(c)>=0,f=d.classed(a.SELECTED);d.classed(a.line)||d.classed(a.area)||(g&&p?o.data_selection_isselectable(s)&&!f&&u(!0,d.classed(a.SELECTED,!0),s,c):h(i)&&i&&f&&u(!1,d.classed(a.SELECTED,!1),s,c))})},n.prototype.unselect=function(t,e){var i=this.internal,n=i.d3,r=i.config;r.data_selection_enabled&&i.main.selectAll("."+a.shapes).selectAll("."+a.shape).each(function(o,s){var c=n.select(this),d=o.data?o.data.id:o.id,l=i.getToggle(this,o).bind(i),u=r.data_selection_grouped||!t||t.indexOf(d)>=0,h=!e||e.indexOf(s)>=0,g=c.classed(a.SELECTED);c.classed(a.line)||c.classed(a.area)||u&&h&&r.data_selection_isselectable(o)&&g&&l(!1,c.classed(a.SELECTED,!1),o,s)})},n.prototype.show=function(t,e){var i,n=this.internal;t=n.mapToTargetIds(t),e=e||{},n.removeHiddenTargetIds(t),(i=n.svg.selectAll(n.selectorTargets(t))).transition().style("display","initial","important").style("opacity",1,"important").call(n.endall,function(){i.style("opacity",null).style("opacity",1)}),e.withLegend&&n.showLegend(t),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},n.prototype.hide=function(t,e){var i,n=this.internal;t=n.mapToTargetIds(t),e=e||{},n.addHiddenTargetIds(t),(i=n.svg.selectAll(n.selectorTargets(t))).transition().style("opacity",0,"important").call(n.endall,function(){i.style("opacity",null).style("opacity",0),i.style("display","none")}),e.withLegend&&n.hideLegend(t),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},n.prototype.toggle=function(t,e){var i=this,n=this.internal;n.mapToTargetIds(t).forEach(function(t){n.isTargetToShow(t)?i.hide(t,e):i.show(t,e)})},n.prototype.tooltip=function(){},n.prototype.tooltip.show=function(t){var e,i,n=this.internal,r={};t.mouse?r=t.mouse:(t.data?i=t.data:void 0!==t.x&&(e=t.id?n.data.targets.filter(function(e){return e.id===t.id}):n.data.targets,i=n.filterByX(e,t.x).slice(0,1)[0]),r=i?n.getMousePosition(i):null),n.dispatchEvent("mousemove",r),n.config.tooltip_onshow.call(n,i)},n.prototype.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)},n.prototype.transform=function(t,e){var i=this.internal,n=["pie","donut"].indexOf(t)>=0?{withTransform:!0}:null;i.transformTo(e,t,n)},e.prototype.transformTo=function(t,e,i){var n=this,r=!n.hasArcType(),a=i||{withTransitionForAxis:r};a.withTransitionForTransform=!1,n.transiting=!1,n.setTargetType(t,e),n.updateTargets(n.data.targets),n.updateAndRedraw(a)},n.prototype.x=function(t){var e=this.internal;return arguments.length&&(e.updateTargetX(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},n.prototype.xs=function(t){var e=this.internal;return arguments.length&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},n.prototype.zoom=function(t){var e=this.internal;return t?(e.isTimeSeries()&&(t=t.map(function(t){return e.parseDate(t)})),e.config.subchart_show?e.brush.selectionAsValue(t,!0):(e.updateXDomain(null,!0,!1,!1,t),e.redraw({withY:e.config.zoom_rescale,withSubchart:!1})),e.config.zoom_onzoom.call(this,e.x.orgDomain()),t):e.x.domain()},n.prototype.zoom.enable=function(t){var e=this.internal;e.config.zoom_enabled=t,e.updateAndRedraw()},n.prototype.unzoom=function(){var t=this.internal;t.config.subchart_show?t.brush.clear():(t.updateXDomain(null,!0,!1,!1,t.subX.domain()),t.redraw({withY:t.config.zoom_rescale,withSubchart:!1}))},n.prototype.zoom.max=function(t){var e=this.internal,i=e.config,n=e.d3;if(0!==t&&!t)return i.zoom_x_max;i.zoom_x_max=n.max([e.orgXDomain[1],t])},n.prototype.zoom.min=function(t){var e=this.internal,i=e.config,n=e.d3;if(0!==t&&!t)return i.zoom_x_min;i.zoom_x_min=n.min([e.orgXDomain[0],t])},n.prototype.zoom.range=function(t){if(!arguments.length)return{max:this.domain.max(),min:this.domain.min()};h(t.max)&&this.domain.max(t.max),h(t.min)&&this.domain.min(t.min)},e.prototype.initPie=function(){var t=this,e=t.d3;t.pie=e.pie().value(function(t){return t.values.reduce(function(t,e){return t+e.value},0)});var i=t.getOrderFunction();if(i&&(t.isOrderAsc()||t.isOrderDesc())){var n=i;i=function(t,e){return-1*n(t,e)}}t.pie.sort(i||null)},e.prototype.updateRadius=function(){var t=this,e=t.config,i=e.gauge_width||e.donut_width,n=t.filterTargetsToShow(t.data.targets).length*t.config.gauge_arcs_minWidth;t.radiusExpanded=Math.min(t.arcWidth,t.arcHeight)/2*(t.hasType("gauge")?.85:1),t.radius=.95*t.radiusExpanded,t.innerRadiusRatio=i?(t.radius-i)/t.radius:.6,t.innerRadius=t.hasType("donut")||t.hasType("gauge")?t.radius*t.innerRadiusRatio:0,t.gaugeArcWidth=i||(n<=t.radius-t.innerRadius?t.radius-t.innerRadius:n<=t.radius?n:t.radius)},e.prototype.updateArc=function(){var t=this;t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded(),t.svgArcExpandedSub=t.getSvgArcExpanded(.98)},e.prototype.updateAngle=function(t){var e,i,n,r,a=this,o=a.config,s=!1,c=0;return o?(a.pie(a.filterTargetsToShow(a.data.targets)).forEach(function(e){s||e.data.id!==t.data.id||(s=!0,(t=e).index=c),c++}),isNaN(t.startAngle)&&(t.startAngle=0),isNaN(t.endAngle)&&(t.endAngle=t.startAngle),a.isGaugeType(t.data)&&(e=o.gauge_min,i=o.gauge_max,n=Math.PI*(o.gauge_fullCircle?2:1)/(i-e),r=t.value.375?1.175-36/o.radius:.8)*o.radius/r:0)+","+n*a+")";else if(c&&l&&o.filterTargetsToShow(o.data.targets).length>1){var u=Math.sin(c.endAngle-Math.PI/2);d="translate("+(i=Math.cos(c.endAngle-Math.PI/2)*(o.radiusExpanded+25))+","+(n=u*(o.radiusExpanded+15-Math.abs(10*u))+3)+")"}return d},e.prototype.getArcRatio=function(t){var e=this.config,i=Math.PI*(this.hasType("gauge")&&!e.gauge_fullCircle?1:2);return t?(t.endAngle-t.startAngle)/i:null},e.prototype.convertToArcData=function(t){return this.addName({id:t.data.id,value:t.value,ratio:this.getArcRatio(t),index:t.index})},e.prototype.textForArcLabel=function(t){var e,i,n,r,a,o=this;return o.shouldShowArcLabel()?(i=(e=o.updateAngle(t))?e.value:null,n=o.getArcRatio(e),r=t.data.id,o.hasType("gauge")||o.meetsArcLabelThreshold(n)?(a=o.getArcLabelFormat())?a(i,n,r):o.defaultArcValueFormat(i,n):""):""},e.prototype.textForGaugeMinMax=function(t,e){var i=this.getGaugeLabelExtents();return i?i(t,e):t},e.prototype.expandArc=function(t){var e,i=this;i.transiting?e=window.setInterval(function(){i.transiting||(window.clearInterval(e),i.legend.selectAll(".c3-legend-item-focused").size()>0&&i.expandArc(t))},10):(t=i.mapToTargetIds(t),i.svg.selectAll(i.selectorTargets(t,"."+a.chartArc)).each(function(t){i.shouldExpand(t.data.id)&&i.d3.select(this).selectAll("path").transition().duration(i.expandDuration(t.data.id)).attr("d",i.svgArcExpanded).transition().duration(2*i.expandDuration(t.data.id)).attr("d",i.svgArcExpandedSub).each(function(t){i.isDonutType(t.data)})}))},e.prototype.unexpandArc=function(t){var e=this;e.transiting||(t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t,"."+a.chartArc)).selectAll("path").transition().duration(function(t){return e.expandDuration(t.data.id)}).attr("d",e.svgArc),e.svg.selectAll("."+a.arc))},e.prototype.expandDuration=function(t){var e=this.config;return this.isDonutType(t)?e.donut_expand_duration:this.isGaugeType(t)?e.gauge_expand_duration:this.isPieType(t)?e.pie_expand_duration:50},e.prototype.shouldExpand=function(t){var e=this.config;return this.isDonutType(t)&&e.donut_expand||this.isGaugeType(t)&&e.gauge_expand||this.isPieType(t)&&e.pie_expand},e.prototype.shouldShowArcLabel=function(){var t=this.config,e=!0;return this.hasType("donut")?e=t.donut_label_show:this.hasType("pie")&&(e=t.pie_label_show),e},e.prototype.meetsArcLabelThreshold=function(t){var e=this.config;return t>=(this.hasType("donut")?e.donut_label_threshold:e.pie_label_threshold)},e.prototype.getArcLabelFormat=function(){var t=this.config,e=t.pie_label_format;return this.hasType("gauge")?e=t.gauge_label_format:this.hasType("donut")&&(e=t.donut_label_format),e},e.prototype.getGaugeLabelExtents=function(){return this.config.gauge_label_extents},e.prototype.getArcTitle=function(){return this.hasType("donut")?this.config.donut_title:""},e.prototype.updateTargetsForArc=function(t){var e,i=this,n=i.main,r=i.classChartArc.bind(i),o=i.classArcs.bind(i),s=i.classFocus.bind(i);(e=n.select("."+a.chartArcs).selectAll("."+a.chartArc).data(i.pie(t)).attr("class",function(t){return r(t)+s(t.data)}).enter().append("g").attr("class",r)).append("g").attr("class",o),e.append("text").attr("dy",i.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},e.prototype.initArc=function(){var t=this;t.arcs=t.main.select("."+a.chart).append("g").attr("class",a.chartArcs).attr("transform",t.getTranslate("arc")),t.arcs.append("text").attr("class",a.chartArcsTitle).style("text-anchor","middle").text(t.getArcTitle())},e.prototype.redrawArc=function(t,e,i){var n,r,o,s,c=this,d=c.d3,l=c.config,u=c.main,h=c.hasType("gauge");if(r=(n=u.selectAll("."+a.arcs).selectAll("."+a.arc).data(c.arcData.bind(c))).enter().append("path").attr("class",c.classArc.bind(c)).style("fill",function(t){return c.color(t.data)}).style("cursor",function(t){return l.interaction_enabled&&l.data_selection_isselectable(t)?"pointer":null}).each(function(t){c.isGaugeType(t.data)&&(t.startAngle=t.endAngle=l.gauge_startingAngle),this._current=t}).merge(n),h&&(s=(o=u.selectAll("."+a.arcs).selectAll("."+a.arcLabelLine).data(c.arcData.bind(c))).enter().append("rect").attr("class",function(t){return a.arcLabelLine+" "+a.target+" "+a.target+"-"+t.data.id}).merge(o),1===c.filterTargetsToShow(c.data.targets).length?s.style("display","none"):s.style("fill",function(t){return c.levelColor?c.levelColor(t.data.values[0].value):c.color(t.data)}).style("display",l.gauge_labelLine_show?"":"none").each(function(t){var e=0,i=0,n=0,r="";if(c.hiddenTargetIds.indexOf(t.data.id)<0){var a=c.updateAngle(t),o=c.gaugeArcWidth/c.filterTargetsToShow(c.data.targets).length*(a.index+1),s=a.endAngle-Math.PI/2,l=c.radius-o,u=s-(0===l?0:1/l);e=c.radiusExpanded-c.radius+o,i=Math.cos(u)*l,n=Math.sin(u)*l,r="rotate("+180*s/Math.PI+", "+i+", "+n+")"}d.select(this).attr("x",i).attr("y",n).attr("width",e).attr("height",2).attr("transform",r).style("stroke-dasharray","0, "+(e+2)+", 0")})),r.attr("transform",function(t){return!c.isGaugeType(t.data)&&i?"scale(0)":""}).on("mouseover",l.interaction_enabled?function(t){var e,i;c.transiting||(e=c.updateAngle(t))&&(i=c.convertToArcData(e),c.expandArc(e.data.id),c.api.focus(e.data.id),c.toggleFocusLegend(e.data.id,!0),c.config.data_onmouseover(i,this))}:null).on("mousemove",l.interaction_enabled?function(t){var e,i=c.updateAngle(t);i&&(e=[c.convertToArcData(i)],c.showTooltip(e,this))}:null).on("mouseout",l.interaction_enabled?function(t){var e,i;c.transiting||(e=c.updateAngle(t))&&(i=c.convertToArcData(e),c.unexpandArc(e.data.id),c.api.revert(),c.revertLegend(),c.hideTooltip(),c.config.data_onmouseout(i,this))}:null).on("click",l.interaction_enabled?function(t,e){var i,n=c.updateAngle(t);n&&(i=c.convertToArcData(n),c.toggleShape&&c.toggleShape(this,i,e),c.config.data_onclick.call(c.api,i,this))}:null).each(function(){c.transiting=!0}).transition().duration(t).attrTween("d",function(t){var e,i=c.updateAngle(t);return i?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),e=d.interpolate(this._current,i),this._current=e(0),function(i){var n=e(i);return n.data=t.data,c.getArc(n,!0)}):function(){return"M 0 0"}}).attr("transform",i?"scale(1)":"").style("fill",function(t){return c.levelColor?c.levelColor(t.data.values[0].value):c.color(t.data.id)}).call(c.endall,function(){c.transiting=!1}),n.exit().transition().duration(e).style("opacity",0).remove(),u.selectAll("."+a.chartArc).select("text").style("opacity",0).attr("class",function(t){return c.isGaugeType(t.data)?a.gaugeValue:""}).text(c.textForArcLabel.bind(c)).attr("transform",c.transformForArcLabel.bind(c)).style("font-size",function(t){return c.isGaugeType(t.data)&&1===c.filterTargetsToShow(c.data.targets).length?Math.round(c.radius/5)+"px":""}).transition().duration(t).style("opacity",function(t){return c.isTargetToShow(t.data.id)&&c.isArcType(t.data)?1:0}),u.select("."+a.chartArcsTitle).style("opacity",c.hasType("donut")||h?1:0),h){var g=0,p=c.arcs.select("g."+a.chartArcsBackground).selectAll("path."+a.chartArcsBackground).data(c.data.targets);p.enter().append("path").attr("class",function(t,e){return a.chartArcsBackground+" "+a.chartArcsBackground+"-"+e}).merge(p).attr("d",function(t){if(c.hiddenTargetIds.indexOf(t.id)>=0)return"M 0 0";var e={data:[{value:l.gauge_max}],startAngle:l.gauge_startingAngle,endAngle:-1*l.gauge_startingAngle*(l.gauge_fullCircle?Math.PI:1),index:g++};return c.getArc(e,!0,!0)}),p.exit().remove(),c.arcs.select("."+a.chartArcsGaugeUnit).attr("dy",".75em").text(l.gauge_label_show?l.gauge_units:""),c.arcs.select("."+a.chartArcsGaugeMin).attr("dx",-1*(c.innerRadius+(c.radius-c.innerRadius)/(l.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(l.gauge_label_show?c.textForGaugeMinMax(l.gauge_min,!1):""),c.arcs.select("."+a.chartArcsGaugeMax).attr("dx",c.innerRadius+(c.radius-c.innerRadius)/(l.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(l.gauge_label_show?c.textForGaugeMinMax(l.gauge_max,!0):"")}},e.prototype.initGauge=function(){var t=this.arcs;this.hasType("gauge")&&(t.append("g").attr("class",a.chartArcsBackground),t.append("text").attr("class",a.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",a.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",a.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},e.prototype.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},e.prototype.hasCaches=function(t){for(var e=0;e=0?a.focused:"")},e.prototype.classDefocused=function(t){return" "+(this.defocusedTargetIds.indexOf(t.id)>=0?a.defocused:"")},e.prototype.classChartText=function(t){return a.chartText+this.classTarget(t.id)},e.prototype.classChartLine=function(t){return a.chartLine+this.classTarget(t.id)},e.prototype.classChartBar=function(t){return a.chartBar+this.classTarget(t.id)},e.prototype.classChartArc=function(t){return a.chartArc+this.classTarget(t.data.id)},e.prototype.getTargetSelectorSuffix=function(t){return this.generateTargetClass(t).replace(/([?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\])/g,"\\$1")},e.prototype.selectorTarget=function(t,e){return(e||"")+"."+a.target+this.getTargetSelectorSuffix(t)},e.prototype.selectorTargets=function(t,e){var i=this;return(t=t||[]).length?t.map(function(t){return i.selectorTarget(t,e)}):null},e.prototype.selectorLegend=function(t){return"."+a.legendItem+this.getTargetSelectorSuffix(t)},e.prototype.selectorLegends=function(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null},e.prototype.getClipPath=function(t){return"url("+(window.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0?"":document.URL.split("#")[0])+"#"+t+")"},e.prototype.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},e.prototype.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},e.prototype.getAxisClipY=function(t){return t?-20:-this.margin.top},e.prototype.getXAxisClipX=function(){return this.getAxisClipX(!this.config.axis_rotated)},e.prototype.getXAxisClipY=function(){return this.getAxisClipY(!this.config.axis_rotated)},e.prototype.getYAxisClipX=function(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},e.prototype.getYAxisClipY=function(){return this.getAxisClipY(this.config.axis_rotated)},e.prototype.getAxisClipWidth=function(t){var e=Math.max(30,this.margin.left),i=Math.max(30,this.margin.right);return t?this.width+2+e+i:this.margin.left+20},e.prototype.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},e.prototype.getXAxisClipWidth=function(){return this.getAxisClipWidth(!this.config.axis_rotated)},e.prototype.getXAxisClipHeight=function(){return this.getAxisClipHeight(!this.config.axis_rotated)},e.prototype.getYAxisClipWidth=function(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},e.prototype.getYAxisClipHeight=function(){return this.getAxisClipHeight(this.config.axis_rotated)},e.prototype.generateColor=function(){var t=this.config,e=this.d3,i=t.data_colors,n=y(t.color_pattern)?t.color_pattern:e.schemeCategory10,r=t.data_color,a=[];return function(t){var e,o=t.id||t.data&&t.data.id||t;return i[o]instanceof Function?e=i[o](t):i[o]?e=i[o]:(a.indexOf(o)<0&&a.push(o),e=n[a.indexOf(o)%n.length],i[o]=e),r instanceof Function?r(e,t):e}},e.prototype.generateLevelColor=function(){var t=this.config,e=t.color_pattern,i=t.color_threshold,n="value"===i.unit,r=i.values&&i.values.length?i.values:[],a=i.max||100;return y(i)&&y(e)?function(t){var i,o=e[e.length-1];for(i=0;i=0?o.data.xs[i]=(e&&o.data.xs[i]?o.data.xs[i]:[]).concat(t.map(function(t){return t[n]}).filter(x).map(function(t,e){return o.generateTargetX(t,i,e)})):s.data_x?o.data.xs[i]=o.getOtherTargetXs():y(s.data_xs)&&(o.data.xs[i]=o.getXValuesOfXKey(n,o.data.targets)):o.data.xs[i]=t.map(function(t,e){return e})}),n.forEach(function(t){if(!o.data.xs[t])throw new Error('x is not defined for id = "'+t+'".')}),(i=n.map(function(e,i){var n=s.data_idConverter(e);return{id:n,id_org:e,values:t.map(function(t,r){var a,c=t[o.getXKey(e)],d=null===t[e]||isNaN(t[e])?null:+t[e];return o.isCustomX()&&o.isCategorized()&&!_(c)?(0===i&&0===r&&(s.axis_x_categories=[]),-1===(a=s.axis_x_categories.indexOf(c))&&(a=s.axis_x_categories.length,s.axis_x_categories.push(c))):a=o.generateTargetX(c,e,r),(_(t[e])||o.data.xs[e].length<=r)&&(a=void 0),{x:a,value:d,id:n}}).filter(function(t){return h(t.x)})}})).forEach(function(t){var e;s.data_xSort&&(t.values=t.values.sort(function(t,e){return(t.x||0===t.x?t.x:1/0)-(e.x||0===e.x?e.x:1/0)})),e=0,t.values.forEach(function(t){t.index=e++}),o.data.xs[t.id].sort(function(t,e){return t-e})}),o.hasNegativeValue=o.hasNegativeValueInTargets(i),o.hasPositiveValue=o.hasPositiveValueInTargets(i),s.data_type&&o.setTargetType(o.mapToIds(i).filter(function(t){return!(t in s.data_types)}),s.data_type),i.forEach(function(t){o.addCache(t.id_org,t)}),i},e.prototype.isX=function(t){var e,i,n,r=this.config;return r.data_x&&t===r.data_x||y(r.data_xs)&&(e=r.data_xs,i=t,n=!1,Object.keys(e).forEach(function(t){e[t]===i&&(n=!0)}),n)},e.prototype.isNotX=function(t){return!this.isX(t)},e.prototype.getXKey=function(t){var e=this.config;return e.data_x?e.data_x:y(e.data_xs)?e.data_xs[t]:null},e.prototype.getXValuesOfXKey=function(t,e){var i,n=this;return(e&&y(e)?n.mapToIds(e):[]).forEach(function(e){n.getXKey(e)===t&&(i=n.data.xs[e])}),i},e.prototype.getXValue=function(t,e){return t in this.data.xs&&this.data.xs[t]&&x(this.data.xs[t][e])?this.data.xs[t][e]:e},e.prototype.getOtherTargetXs=function(){var t=Object.keys(this.data.xs);return t.length?this.data.xs[t[0]]:null},e.prototype.getOtherTargetX=function(t){var e=this.getOtherTargetXs();return e&&te?1:t>=e?0:NaN})},e.prototype.addHiddenTargetIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e0})},e.prototype.isOrderDesc=function(){var t=this.config;return"string"==typeof t.data_order&&"desc"===t.data_order.toLowerCase()},e.prototype.isOrderAsc=function(){var t=this.config;return"string"==typeof t.data_order&&"asc"===t.data_order.toLowerCase()},e.prototype.getOrderFunction=function(){var t=this.config,e=this.isOrderAsc(),i=this.isOrderDesc();if(e||i){var n=function(t,e){return t+Math.abs(e.value)};return function(t,i){var r=t.values.reduce(n,0),a=i.values.reduce(n,0);return e?a-r:r-a}}if(p(t.data_order))return t.data_order;if(u(t.data_order)){var r=t.data_order;return function(t,e){return r.indexOf(t.id)-r.indexOf(e.id)}}},e.prototype.orderTargets=function(t){var e=this.getOrderFunction();return e&&t.sort(e),t},e.prototype.filterByX=function(t,e){return this.d3.merge(t.map(function(t){return t.values})).filter(function(t){return t.x-e==0})},e.prototype.filterRemoveNull=function(t){return t.filter(function(t){return x(t.value)})},e.prototype.filterByXDomain=function(t,e){return t.map(function(t){return{id:t.id,id_org:t.id_org,values:t.values.filter(function(t){return e[0]<=t.x&&t.x<=e[1]})}})},e.prototype.hasDataLabel=function(){var e=this.config;return!("boolean"!=typeof e.data_labels||!e.data_labels)||!("object"!==t(e.data_labels)||!y(e.data_labels))},e.prototype.getDataLabelLength=function(t,e,i){var n=this,r=[0,0];return n.selectChart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text(function(t){return n.dataLabelFormat(t.id)(t)}).each(function(t,e){r[e]=1.3*this.getBoundingClientRect()[i]}).remove(),r},e.prototype.isNoneArc=function(t){return this.hasTarget(this.data.targets,t.id)},e.prototype.isArc=function(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},e.prototype.findClosestFromTargets=function(t,e){var i,n=this;return i=t.map(function(t){return n.findClosest(t.values,e)}),n.findClosest(i,e)},e.prototype.findClosest=function(t,e){var i,n=this,r=n.config.point_sensitivity;return t.filter(function(t){return t&&n.isBarType(t.id)}).forEach(function(t){var e=n.main.select("."+a.bars+n.getTargetSelectorSuffix(t.id)+" ."+a.bar+"-"+t.index).node();!i&&n.isWithinBar(n.d3.mouse(e),e)&&(i=t)}),t.filter(function(t){return t&&!n.isBarType(t.id)}).forEach(function(t){var a=n.dist(t,e);a0)for(o=s.hasNegativeValueInTargets(t),e=0;e=0})).length)for(n=r[0],o&&l[n]&&l[n].forEach(function(t,e){l[n][e]=t<0?t:0}),i=1;i0||(l[n][e]+=+t)});return s.d3.min(Object.keys(l).map(function(t){return s.d3.min(l[t])}))},e.prototype.getYDomainMax=function(t){var e,i,n,r,a,o,s=this,c=s.config,d=s.mapToIds(t),l=s.getValuesAsIdKeyed(t);if(c.data_groups.length>0)for(o=s.hasPositiveValueInTargets(t),e=0;e=0})).length)for(n=r[0],o&&l[n]&&l[n].forEach(function(t,e){l[n][e]=t>0?t:0}),i=1;i=0&&b>=0,g=v<=0&&b<=0,(x(S)&&h||x(w)&&g)&&(A=!1),A&&(h&&(v=0),g&&(b=0)),a=o=.1*(r=Math.abs(b-v)),void 0!==T&&(b=T+(s=Math.max(Math.abs(v),Math.abs(b))),v=T-s),C?(d=p.getDataLabelLength(v,b,"width"),l=c(p.y.range()),a+=r*((u=[d[0]/l,d[1]/l])[1]/(1-u[0]-u[1])),o+=r*(u[0]/(1-u[0]-u[1]))):L&&(d=p.getDataLabelLength(v,b,"height"),a+=p.axis.convertPixelsToAxisPadding(d[1],r),o+=p.axis.convertPixelsToAxisPadding(d[0],r)),"y"===e&&y(f.axis_y_padding)&&(a=p.axis.getPadding(f.axis_y_padding,"top",a,r),o=p.axis.getPadding(f.axis_y_padding,"bottom",o,r)),"y2"===e&&y(f.axis_y2_padding)&&(a=p.axis.getPadding(f.axis_y2_padding,"top",a,r),o=p.axis.getPadding(f.axis_y2_padding,"bottom",o,r)),A&&(h&&(o=v),g&&(a=-b)),n=[v-o,b+a],P?n.reverse():n)},e.prototype.getXDomainMin=function(t){var e=this,i=e.config;return h(i.axis_x_min)?e.isTimeSeries()?this.parseDate(i.axis_x_min):i.axis_x_min:e.d3.min(t,function(t){return e.d3.min(t.values,function(t){return t.x})})},e.prototype.getXDomainMax=function(t){var e=this,i=e.config;return h(i.axis_x_max)?e.isTimeSeries()?this.parseDate(i.axis_x_max):i.axis_x_max:e.d3.max(t,function(t){return e.d3.max(t.values,function(t){return t.x})})},e.prototype.getXDomainPadding=function(e){var i,n,r,a,o=this.config,s=e[1]-e[0];return n=this.isCategorized()?0:this.hasType("bar")?(i=this.getMaxDataCount())>1?s/(i-1)/2:.5:.01*s,"object"===t(o.axis_x_padding)&&y(o.axis_x_padding)?(r=x(o.axis_x_padding.left)?o.axis_x_padding.left:n,a=x(o.axis_x_padding.right)?o.axis_x_padding.right:n):r=a="number"==typeof o.axis_x_padding?o.axis_x_padding:n,{left:r,right:a}},e.prototype.getXDomain=function(t){var e=this,i=[e.getXDomainMin(t),e.getXDomainMax(t)],n=i[0],r=i[1],a=e.getXDomainPadding(i),o=0,s=0;return n-r!=0||e.isCategorized()||(e.isTimeSeries()?(n=new Date(.5*n.getTime()),r=new Date(1.5*r.getTime())):(n=0===n?1:.5*n,r=0===r?-1:1.5*r)),(n||0===n)&&(o=e.isTimeSeries()?new Date(n.getTime()-a.left):n-a.left),(r||0===r)&&(s=e.isTimeSeries()?new Date(r.getTime()+a.right):r+a.right),[o,s]},e.prototype.updateXDomain=function(t,e,i,n,r){var a=this,o=a.config;return i&&(a.x.domain(r||a.d3.extent(a.getXDomain(t))),a.orgXDomain=a.x.domain(),o.zoom_enabled&&a.zoom.update(),a.subX.domain(a.x.domain()),a.brush&&a.brush.updateScale(a.subX)),e&&a.x.domain(r||(!a.brush||a.brush.empty()?a.orgXDomain:a.brush.selectionAsValue())),n&&a.x.domain(a.trimXDomain(a.x.orgDomain())),a.x.domain()},e.prototype.trimXDomain=function(t){var e=this.getZoomDomain(),i=e[0],n=e[1];return t[0]<=i&&(t[1]=+t[1]+(i-t[0]),t[0]=i),n<=t[1]&&(t[0]=+t[0]-(t[1]-n),t[1]=n),t},e.prototype.drag=function(t){var e,i,n,r,o,s,c,d,u=this,h=u.config,g=u.main,p=u.d3;u.hasArcType()||h.data_selection_enabled&&h.data_selection_multiple&&(e=u.dragStart[0],i=u.dragStart[1],n=t[0],r=t[1],o=Math.min(e,n),s=Math.max(e,n),c=h.data_selection_grouped?u.margin.top:Math.min(i,r),d=h.data_selection_grouped?u.height:Math.max(i,r),g.select("."+a.dragarea).attr("x",o).attr("y",c).attr("width",s-o).attr("height",d-c),g.selectAll("."+a.shapes).selectAll("."+a.shape).filter(function(t){return h.data_selection_isselectable(t)}).each(function(t,e){var i,n,r,h,g,f,_=p.select(this),x=_.classed(a.SELECTED),y=_.classed(a.INCLUDED),m=!1;if(_.classed(a.circle))i=1*_.attr("cx"),n=1*_.attr("cy"),g=u.togglePoint,m=oc&&(s=s.filter(function(t){return(""+t).indexOf(".")<0}));return s},e.prototype.getGridFilterToRemove=function(t){return t?function(e){var i=!1;return[].concat(t).forEach(function(t){("value"in t&&e.value===t.value||"class"in t&&e.class===t.class)&&(i=!0)}),i}:function(){return!0}},e.prototype.removeGridLines=function(t,e){var i=this.config,n=this.getGridFilterToRemove(t),r=function(t){return!n(t)},o=e?a.xgridLines:a.ygridLines,s=e?a.xgridLine:a.ygridLine;this.main.select("."+o).selectAll("."+s).filter(n).transition().duration(i.transition_duration).style("opacity",0).remove(),e?i.grid_x_lines=i.grid_x_lines.filter(r):i.grid_y_lines=i.grid_y_lines.filter(r)},e.prototype.initEventRect=function(){var t=this,e=t.config;t.main.select("."+a.chart).append("g").attr("class",a.eventRects).style("fill-opacity",0),t.eventRect=t.main.select("."+a.eventRects).append("rect").attr("class",a.eventRect),e.zoom_enabled&&t.zoom&&(t.eventRect.call(t.zoom).on("dblclick.zoom",null),e.zoom_initialRange&&t.eventRect.transition().duration(0).call(t.zoom.transform,t.zoomTransform(e.zoom_initialRange)))},e.prototype.redrawEventRect=function(){var t,e,i=this,n=i.d3,r=i.config;function o(){i.svg.select("."+a.eventRect).style("cursor",null),i.hideXGridFocus(),i.hideTooltip(),i.unexpandCircles(),i.unexpandBars()}t=i.width,e=i.height,i.main.select("."+a.eventRects).style("cursor",r.zoom_enabled?r.axis_rotated?"ns-resize":"ew-resize":null),i.eventRect.attr("x",0).attr("y",0).attr("width",t).attr("height",e).on("mouseout",r.interaction_enabled?function(){r&&(i.hasArcType()||o())}:null).on("mousemove",r.interaction_enabled?function(){var t,e,s,c;i.dragging||i.hasArcType(t)||(t=i.filterTargetsToShow(i.data.targets),e=n.mouse(this),s=i.findClosestFromTargets(t,e),!i.mouseover||s&&s.id===i.mouseover.id||(r.data_onmouseout.call(i.api,i.mouseover),i.mouseover=void 0),s?(c=(i.isScatterType(s)||!r.tooltip_grouped?[s]:i.filterByX(t,s.x)).map(function(t){return i.addName(t)}),i.showTooltip(c,this),r.point_focus_expand_enabled&&(i.unexpandCircles(),c.forEach(function(t){i.expandCircles(t.index,t.id,!1)})),i.expandBars(s.index,s.id,!0),i.showXGridFocus(c),(i.isBarType(s.id)||i.dist(s,e)=0}).classed(a.legendItemFocused,e).transition().duration(100).style("opacity",function(){return(e?i.opacityForLegend:i.opacityForUnfocusedLegend).call(i,i.d3.select(this))})},e.prototype.revertLegend=function(){var t=this,e=t.d3;t.legend.selectAll("."+a.legendItem).classed(a.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return t.opacityForLegend(e.select(this))})},e.prototype.showLegend=function(t){var e=this,i=e.config;i.legend_show||(i.legend_show=!0,e.legend.style("visibility","visible"),e.legendHasRendered||e.updateLegendWithDefaults()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",function(){return e.opacityForLegend(e.d3.select(this))})},e.prototype.hideLegend=function(t){var e=this,i=e.config;i.legend_show&&g(t)&&(i.legend_show=!1,e.legend.style("visibility","hidden")),e.addHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("opacity",0).style("visibility","hidden")},e.prototype.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},e.prototype.updateLegend=function(t,e,i){var n,r,o,s,c,l,u,g,p,f,_,x,y,m,S,w,v=this,b=v.config,T=4,A=10,P=0,C=0,L=10,V=b.legend_item_tile_width+5,G=0,E={},O={},I={},R=[0],k={},D=0;function F(e,i,n){var r,o,s=0===n,c=n===t.length-1,d=function(t,e){return v.legendItemTextBox[e]||(v.legendItemTextBox[e]=v.getTextRect(t.textContent,a.legendItem,t)),v.legendItemTextBox[e]}(e,i),l=d.width+V+(!c||v.isLegendRight||v.isLegendInset?A:0)+b.legend_padding,u=d.height+T,h=v.isLegendRight||v.isLegendInset?u:l,g=v.isLegendRight||v.isLegendInset?v.getLegendHeight():v.getLegendWidth();function p(t,e){e||(r=(g-G-h)/2)=P)&&(P=l),(!C||u>=C)&&(C=u),o=v.isLegendRight||v.isLegendInset?C:P,b.legend_equally?(Object.keys(O).forEach(function(t){O[t]=P}),Object.keys(I).forEach(function(t){I[t]=C}),(r=(g-o*t.length)/2)0&&0===w.size()&&(w=v.legend.insert("g","."+a.legendItem).attr("class",a.legendBackground).append("rect")),y=v.legend.selectAll("text").data(t).text(function(t){return h(b.data_names[t])?b.data_names[t]:t}).each(function(t,e){F(this,t,e)}),(_?y.transition():y).attr("x",r).attr("y",c),m=v.legend.selectAll("rect."+a.legendItemEvent).data(t),(_?m.transition():m).attr("width",function(t){return O[t]}).attr("height",function(t){return I[t]}).attr("x",o).attr("y",l),S=v.legend.selectAll("line."+a.legendItemTile).data(t),(_?S.transition():S).style("stroke",v.levelColor?function(t){return v.levelColor(v.cache[t].values[0].value)}:v.color).attr("x1",u).attr("y1",p).attr("x2",g).attr("y2",p),w&&(_?w.transition():w).attr("height",v.getLegendHeight()-12).attr("width",P*(D+1)+10),v.legend.selectAll("."+a.legendItem).classed(a.legendItemHidden,function(t){return!v.isTargetToShow(t)}),v.updateLegendItemWidth(P),v.updateLegendItemHeight(C),v.updateLegendStep(D),v.updateSizes(),v.updateScales(),v.updateSvgSize(),v.transformAll(x,i),v.legendHasRendered=!0},e.prototype.initRegion=function(){this.region=this.main.append("g").attr("clip-path",this.clipPath).attr("class",a.regions)},e.prototype.updateRegion=function(t){var e=this,i=e.config;e.region.style("visibility",e.hasArcType()?"hidden":"visible");var n=e.main.select("."+a.regions).selectAll("."+a.region).data(i.regions),r=n.enter().append("rect").attr("x",e.regionX.bind(e)).attr("y",e.regionY.bind(e)).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)).style("fill-opacity",0);e.mainRegion=r.merge(n).attr("class",e.classRegion.bind(e)),n.exit().transition().duration(t).style("opacity",0).remove()},e.prototype.redrawRegion=function(t,e){var i=this,n=i.mainRegion;return[(t?n.transition(e):n).attr("x",i.regionX.bind(i)).attr("y",i.regionY.bind(i)).attr("width",i.regionWidth.bind(i)).attr("height",i.regionHeight.bind(i)).style("fill-opacity",function(t){return x(t.opacity)?t.opacity:.1})]},e.prototype.regionX=function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated&&"start"in t?n(t.start):0:i.axis_rotated?0:"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},e.prototype.regionY=function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated?0:"end"in t?n(t.end):0:i.axis_rotated&&"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},e.prototype.regionWidth=function(t){var e,i=this,n=i.config,r=i.regionX(t),a="y"===t.axis?i.y:i.y2;return(e="y"===t.axis||"y2"===t.axis?n.axis_rotated&&"end"in t?a(t.end):i.width:n.axis_rotated?i.width:"end"in t?i.x(i.isTimeSeries()?i.parseDate(t.end):t.end):i.width)i.bar_width_max?i.bar_width_max:n},e.prototype.getBars=function(t,e){return(e?this.main.selectAll("."+a.bars+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+a.bar+(x(t)?"-"+t:""))},e.prototype.expandBars=function(t,e,i){i&&this.unexpandBars(),this.getBars(t,e).classed(a.EXPANDED,!0)},e.prototype.unexpandBars=function(t){this.getBars(t).classed(a.EXPANDED,!1)},e.prototype.generateDrawBar=function(t,e){var i=this.config,n=this.generateGetBarPoints(t,e);return function(t,e){var r=n(t,e),a=i.axis_rotated?1:0,o=i.axis_rotated?0:1;return"M "+r[0][a]+","+r[0][o]+" L"+r[1][a]+","+r[1][o]+" L"+r[2][a]+","+r[2][o]+" L"+r[3][a]+","+r[3][o]+" z"}},e.prototype.generateGetBarPoints=function(t,e){var i=this,n=e?i.subXAxis:i.xAxis,r=t.__max__+1,a=i.getBarW(n,r),o=i.getShapeX(a,r,t,!!e),s=i.getShapeY(!!e),c=i.getShapeOffset(i.isBarType,t,!!e),d=a*(i.config.bar_space/2),l=e?i.getSubYScale:i.getYScale;return function(t,e){var n=l.call(i,t.id)(0),r=c(t,e)||n,u=o(t),h=s(t);return i.config.axis_rotated&&(0=0&&(d+=s(r[o].value)-c))}),d}},e.prototype.isWithinShape=function(t,e){var i,n=this,r=n.d3.select(t);return n.isTargetToShow(e.id)?"circle"===t.nodeName?i=n.isStepType(e)?n.isWithinStep(t,n.getYScale(e.id)(e.value)):n.isWithinCircle(t,1.5*n.pointSelectR(e)):"path"===t.nodeName&&(i=!r.classed(a.bar)||n.isWithinBar(n.d3.mouse(t),t)):i=!1,i},e.prototype.getInterpolate=function(t){var e=this,i=e.d3,n={linear:i.curveLinear,"linear-closed":i.curveLinearClosed,basis:i.curveBasis,"basis-open":i.curveBasisOpen,"basis-closed":i.curveBasisClosed,bundle:i.curveBundle,cardinal:i.curveCardinal,"cardinal-open":i.curveCardinalOpen,"cardinal-closed":i.curveCardinalClosed,monotone:i.curveMonotoneX,step:i.curveStep,"step-before":i.curveStepBefore,"step-after":i.curveStepAfter};return e.isSplineType(t)?n[e.config.spline_interpolation_type]||n.cardinal:e.isStepType(t)?n[e.config.line_step_type]:n.linear},e.prototype.initLine=function(){this.main.select("."+a.chart).append("g").attr("class",a.chartLines)},e.prototype.updateTargetsForLine=function(t){var e,i=this,n=i.config,r=i.classChartLine.bind(i),o=i.classLines.bind(i),s=i.classAreas.bind(i),c=i.classCircles.bind(i),d=i.classFocus.bind(i);(e=i.main.select("."+a.chartLines).selectAll("."+a.chartLine).data(t).attr("class",function(t){return r(t)+d(t)}).enter().append("g").attr("class",r).style("opacity",0).style("pointer-events","none")).append("g").attr("class",o),e.append("g").attr("class",s),e.append("g").attr("class",function(t){return i.generateClass(a.selectedCircles,t.id)}),e.append("g").attr("class",c).style("cursor",function(t){return n.data_selection_isselectable(t)?"pointer":null}),t.forEach(function(t){i.main.selectAll("."+a.selectedCircles+i.getTargetSelectorSuffix(t.id)).selectAll("."+a.selectedCircle).each(function(e){e.value=t.values[e.index].value})})},e.prototype.updateLine=function(t){var e=this,i=e.main.selectAll("."+a.lines).selectAll("."+a.line).data(e.lineData.bind(e)),n=i.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color);e.mainLine=n.merge(i).style("opacity",e.initialOpacity.bind(e)).style("shape-rendering",function(t){return e.isStepType(t)?"crispEdges":""}).attr("transform",null),i.exit().transition().duration(t).style("opacity",0)},e.prototype.redrawLine=function(t,e,i){return[(e?this.mainLine.transition(i):this.mainLine).attr("d",t).style("stroke",this.color).style("opacity",1)]},e.prototype.generateDrawLine=function(t,e){var i=this,n=i.config,r=i.d3.line(),a=i.generateGetLinePoints(t,e),o=e?i.getSubYScale:i.getYScale,s=function(t){return(e?i.subxx:i.xx).call(i,t)},c=function(t,e){return n.data_groups.length>0?a(t,e)[0][1]:o.call(i,t.id)(t.value)};return r=n.axis_rotated?r.x(c).y(s):r.x(s).y(c),n.line_connectNull||(r=r.defined(function(t){return null!=t.value})),function(t){var a,s=n.line_connectNull?i.filterRemoveNull(t.values):t.values,c=e?i.subX:i.x,d=o.call(i,t.id),l=0,u=0;return i.isLineType(t)?n.data_regions[t.id]?a=i.lineWithRegions(s,c,d,n.data_regions[t.id]):(i.isStepType(t)&&(s=i.convertValuesToStep(s)),a=r.curve(i.getInterpolate(t))(s)):(s[0]&&(l=c(s[0].x),u=d(s[0].value)),a=n.axis_rotated?"M "+u+" "+l:"M "+l+" "+u),a||"M 0 0"}},e.prototype.generateGetLinePoints=function(t,e){var i=this,n=i.config,r=t.__max__+1,a=i.getShapeX(0,r,t,!!e),o=i.getShapeY(!!e),s=i.getShapeOffset(i.isLineType,t,!!e),c=e?i.getSubYScale:i.getYScale;return function(t,e){var r=c.call(i,t.id)(0),d=s(t,e)||r,l=a(t),u=o(t);return n.axis_rotated&&(00?a(t,e)[0][1]:o.call(i,t.id)(i.getAreaBaseValue(t.id))},d=function(t,e){return n.data_groups.length>0?a(t,e)[1][1]:o.call(i,t.id)(t.value)};return r=n.axis_rotated?r.x0(c).x1(d).y(s):r.x(s).y0(n.area_above?0:c).y1(d),n.line_connectNull||(r=r.defined(function(t){return null!==t.value})),function(t){var e,a=n.line_connectNull?i.filterRemoveNull(t.values):t.values,o=0,s=0;return i.isAreaType(t)?(i.isStepType(t)&&(a=i.convertValuesToStep(a)),e=r.curve(i.getInterpolate(t))(a)):(a[0]&&(o=i.x(a[0].x),s=i.getYScale(t.id)(a[0].value)),e=n.axis_rotated?"M "+s+" "+o:"M "+o+" "+s),e||"M 0 0"}},e.prototype.getAreaBaseValue=function(){return 0},e.prototype.generateGetAreaPoints=function(t,e){var i=this,n=i.config,r=t.__max__+1,a=i.getShapeX(0,r,t,!!e),o=i.getShapeY(!!e),s=i.getShapeOffset(i.isAreaType,t,!!e),c=e?i.getSubYScale:i.getYScale;return function(t,e){var r=c.call(i,t.id)(0),d=s(t,e)||r,l=a(t),u=o(t);return n.axis_rotated&&(00?(t=i.getShapeIndices(i.isLineType),e=i.generateGetLinePoints(t),i.circleY=function(t,i){return e(t,i)[0][1]}):i.circleY=function(t){return i.getYScale(t.id)(t.value)}},e.prototype.getCircles=function(t,e){return(e?this.main.selectAll("."+a.circles+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+a.circle+(x(t)?"-"+t:""))},e.prototype.expandCircles=function(t,e,i){var n=this.pointExpandedR.bind(this);i&&this.unexpandCircles(),this.getCircles(t,e).classed(a.EXPANDED,!0).attr("r",n)},e.prototype.unexpandCircles=function(t){var e=this,i=e.pointR.bind(e);e.getCircles(t).filter(function(){return e.d3.select(this).classed(a.EXPANDED)}).classed(a.EXPANDED,!1).attr("r",i)},e.prototype.pointR=function(t){var e=this.config;return this.isStepType(t)?0:p(e.point_r)?e.point_r(t):e.point_r},e.prototype.pointExpandedR=function(t){var e=this.config;return e.point_focus_expand_enabled?p(e.point_focus_expand_r)?e.point_focus_expand_r(t):e.point_focus_expand_r?e.point_focus_expand_r:1.75*this.pointR(t):this.pointR(t)},e.prototype.pointSelectR=function(t){var e=this.config;return p(e.point_select_r)?e.point_select_r(t):e.point_select_r?e.point_select_r:4*this.pointR(t)},e.prototype.isWithinCircle=function(t,e){var i=this.d3,n=i.mouse(t),r=i.select(t),a=+r.attr("cx"),o=+r.attr("cy");return Math.sqrt(Math.pow(a-n[0],2)+Math.pow(o-n[1],2))0?e:320/(this.hasType("gauge")&&!t.gauge_fullCircle?2:1)},e.prototype.getCurrentPaddingTop=function(){var t=this.config,e=x(t.padding_top)?t.padding_top:0;return this.title&&this.title.node()&&(e+=this.getTitlePadding()),e},e.prototype.getCurrentPaddingBottom=function(){var t=this.config;return x(t.padding_bottom)?t.padding_bottom:0},e.prototype.getCurrentPaddingLeft=function(t){var e=this.config;return x(e.padding_left)?e.padding_left:e.axis_rotated?!e.axis_x_show||e.axis_x_inner?1:Math.max(s(this.getAxisWidthByAxisId("x",t)),40):!e.axis_y_show||e.axis_y_inner?this.axis.getYAxisLabelPosition().isOuter?30:1:s(this.getAxisWidthByAxisId("y",t))},e.prototype.getCurrentPaddingRight=function(){var t=this,e=t.config,i=t.isLegendRight?t.getLegendWidth()+20:0;return x(e.padding_right)?e.padding_right+1:e.axis_rotated?10+i:!e.axis_y2_show||e.axis_y2_inner?2+i+(t.axis.getY2AxisLabelPosition().isOuter?20:0):s(t.getAxisWidthByAxisId("y2"))+i},e.prototype.getParentRectValue=function(t){for(var e,i=this.selectChart.node();i&&"BODY"!==i.tagName;){try{e=i.getBoundingClientRect()[t]}catch(n){"width"===t&&(e=i.offsetWidth)}if(e)break;i=i.parentNode}return e},e.prototype.getParentWidth=function(){return this.getParentRectValue("width")},e.prototype.getParentHeight=function(){var t=this.selectChart.style("height");return t.indexOf("px")>0?+t.replace("px",""):0},e.prototype.getSvgLeft=function(t){var e=this,i=e.config,n=i.axis_rotated||!i.axis_rotated&&!i.axis_y_inner,r=i.axis_rotated?a.axisX:a.axisY,o=e.main.select("."+r).node(),s=o&&n?o.getBoundingClientRect():{right:0},c=e.selectChart.node().getBoundingClientRect(),d=e.hasArcType(),l=s.right-c.left-(d?0:e.getCurrentPaddingLeft(t));return l>0?l:0},e.prototype.getAxisWidthByAxisId=function(t,e){var i=this.axis.getLabelPositionById(t);return this.axis.getMaxTickWidth(t,e)+(i.isInner?20:40)},e.prototype.getHorizontalAxisHeight=function(t){var e=this,i=e.config,n=30;return"x"!==t||i.axis_x_show?"x"===t&&i.axis_x_height?i.axis_x_height:"y"!==t||i.axis_y_show?"y2"!==t||i.axis_y2_show?("x"===t&&!i.axis_rotated&&i.axis_x_tick_rotate&&(n=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-Math.abs(i.axis_x_tick_rotate))/180)),"y"===t&&i.axis_rotated&&i.axis_y_tick_rotate&&(n=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-Math.abs(i.axis_y_tick_rotate))/180)),n+(e.axis.getLabelPositionById(t).isInner?0:10)+("y2"===t?-10:0)):e.rotated_padding_top:!i.legend_show||e.isLegendRight||e.isLegendInset?1:10:8},e.prototype.initBrush=function(t){var e=this,i=e.d3;return e.brush=(e.config.axis_rotated?i.brushY():i.brushX()).on("brush",function(){var t=i.event.sourceEvent;t&&"zoom"===t.type||e.redrawForBrush()}).on("end",function(){var t=i.event.sourceEvent;t&&"zoom"===t.type||e.brush.empty()&&t&&"end"!==t.type&&e.brush.clear()}),e.brush.updateExtent=function(){var t,i=this.scale.range();return t=e.config.axis_rotated?[[0,i[0]],[e.width2,i[1]]]:[[i[0],0],[i[1],e.height2]],this.extent(t),this},e.brush.updateScale=function(t){return this.scale=t,this},e.brush.update=function(t){this.updateScale(t||e.subX).updateExtent(),e.context.select("."+a.brush).call(this)},e.brush.clear=function(){e.context.select("."+a.brush).call(e.brush.move,null)},e.brush.selection=function(){return i.brushSelection(e.context.select("."+a.brush).node())},e.brush.selectionAsValue=function(t,i){var n,r;return t?(e.context&&(n=[this.scale(t[0]),this.scale(t[1])],r=e.context.select("."+a.brush),i&&(r=r.transition()),e.brush.move(r,n)),[]):(n=e.brush.selection()||[0,0],[this.scale.invert(n[0]),this.scale.invert(n[1])])},e.brush.empty=function(){var t=e.brush.selection();return!t||t[0]===t[1]},e.brush.updateScale(t)},e.prototype.initSubchart=function(){var t=this,e=t.config,i=t.context=t.svg.append("g").attr("transform",t.getTranslate("context")),n=e.subchart_show?"visible":"hidden";i.style("visibility",n),i.append("g").attr("clip-path",t.clipPathForSubchart).attr("class",a.chart),i.select("."+a.chart).append("g").attr("class",a.chartBars),i.select("."+a.chart).append("g").attr("class",a.chartLines),i.append("g").attr("clip-path",t.clipPath).attr("class",a.brush),t.axes.subx=i.append("g").attr("class",a.axisX).attr("transform",t.getTranslate("subx")).attr("clip-path",e.axis_rotated?"":t.clipPathForXAxis)},e.prototype.initSubchartBrush=function(){this.initBrush(this.subX).updateExtent(),this.context.select("."+a.brush).call(this.brush)},e.prototype.updateTargetsForSubchart=function(t){var e,i,n,r,o=this,s=o.context,c=o.config,d=o.classChartBar.bind(o),l=o.classBars.bind(o),u=o.classChartLine.bind(o),h=o.classLines.bind(o),g=o.classAreas.bind(o);c.subchart_show&&((n=(r=s.select("."+a.chartBars).selectAll("."+a.chartBar).data(t)).enter().append("g").style("opacity",0)).merge(r).attr("class",d),n.append("g").attr("class",l),(e=(i=s.select("."+a.chartLines).selectAll("."+a.chartLine).data(t)).enter().append("g").style("opacity",0)).merge(i).attr("class",u),e.append("g").attr("class",h),e.append("g").attr("class",g),s.selectAll("."+a.brush+" rect").attr(c.axis_rotated?"width":"height",c.axis_rotated?o.width2:o.height2))},e.prototype.updateBarForSubchart=function(t){var e=this,i=e.context.selectAll("."+a.bars).selectAll("."+a.bar).data(e.barData.bind(e)),n=i.enter().append("path").attr("class",e.classBar.bind(e)).style("stroke","none").style("fill",e.color);i.exit().transition().duration(t).style("opacity",0).remove(),e.contextBar=n.merge(i).style("opacity",e.initialOpacity.bind(e))},e.prototype.redrawBarForSubchart=function(t,e,i){(e?this.contextBar.transition(Math.random().toString()).duration(i):this.contextBar).attr("d",t).style("opacity",1)},e.prototype.updateLineForSubchart=function(t){var e=this,i=e.context.selectAll("."+a.lines).selectAll("."+a.line).data(e.lineData.bind(e)),n=i.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color);i.exit().transition().duration(t).style("opacity",0).remove(),e.contextLine=n.merge(i).style("opacity",e.initialOpacity.bind(e))},e.prototype.redrawLineForSubchart=function(t,e,i){(e?this.contextLine.transition(Math.random().toString()).duration(i):this.contextLine).attr("d",t).style("opacity",1)},e.prototype.updateAreaForSubchart=function(t){var e=this,i=e.d3,n=e.context.selectAll("."+a.areas).selectAll("."+a.area).data(e.lineData.bind(e)),r=n.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=+i.select(this).style("opacity"),0});n.exit().transition().duration(t).style("opacity",0).remove(),e.contextArea=r.merge(n).style("opacity",0)},e.prototype.redrawAreaForSubchart=function(t,e,i){(e?this.contextArea.transition(Math.random().toString()).duration(i):this.contextArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)},e.prototype.redrawSubchart=function(t,e,i,n,r,a,o){var s,c,d,l=this,u=l.d3,h=l.config;l.context.style("visibility",h.subchart_show?"visible":"hidden"),h.subchart_show&&(u.event&&"zoom"===u.event.type&&l.brush.selectionAsValue(l.x.orgDomain()),t&&(l.brush.empty()||l.brush.selectionAsValue(l.x.orgDomain()),s=l.generateDrawArea(r,!0),c=l.generateDrawBar(a,!0),d=l.generateDrawLine(o,!0),l.updateBarForSubchart(i),l.updateLineForSubchart(i),l.updateAreaForSubchart(i),l.redrawBarForSubchart(c,i,i),l.redrawLineForSubchart(d,i,i),l.redrawAreaForSubchart(s,i,i)))},e.prototype.redrawForBrush=function(){var t,e=this,i=e.x,n=e.d3;e.redraw({withTransition:!1,withY:e.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withEventRect:!1,withDimension:!1}),t=n.event.selection||e.brush.scale.range(),e.main.select("."+a.eventRect).call(e.zoom.transform,n.zoomIdentity.scale(e.width/(t[1]-t[0])).translate(-t[0],0)),e.config.subchart_onbrush.call(e.api,i.orgDomain())},e.prototype.transformContext=function(t,e){var i;e&&e.axisSubX?i=e.axisSubX:(i=this.context.select("."+a.axisX),t&&(i=i.transition())),this.context.attr("transform",this.getTranslate("context")),i.attr("transform",this.getTranslate("subx"))},e.prototype.getDefaultSelection=function(){var t=this,e=t.config,i=p(e.axis_x_selection)?e.axis_x_selection(t.getXDomain(t.data.targets)):e.axis_x_selection;return t.isTimeSeries()&&(i=[t.parseDate(i[0]),t.parseDate(i[1])]),i},e.prototype.initText=function(){this.main.select("."+a.chart).append("g").attr("class",a.chartTexts),this.mainText=this.d3.selectAll([])},e.prototype.updateTargetsForText=function(t){var e=this,i=e.classChartText.bind(e),n=e.classTexts.bind(e),r=e.classFocus.bind(e),o=e.main.select("."+a.chartTexts).selectAll("."+a.chartText).data(t),s=o.enter().append("g").attr("class",i).style("opacity",0).style("pointer-events","none");s.append("g").attr("class",n),s.merge(o).attr("class",function(t){return i(t)+r(t)})},e.prototype.updateText=function(t,e,i){var n=this,r=n.config,o=n.barOrLineData.bind(n),s=n.classText.bind(n),c=n.main.selectAll("."+a.texts).selectAll("."+a.text).data(o),d=c.enter().append("text").attr("class",s).attr("text-anchor",function(t){return r.axis_rotated?t.value<0?"end":"start":"middle"}).style("stroke","none").attr("x",t).attr("y",e).style("fill",function(t){return n.color(t)}).style("fill-opacity",0);n.mainText=d.merge(c).text(function(t,e,i){return n.dataLabelFormat(t.id)(t.value,t.id,e,i)}),c.exit().transition().duration(i).style("fill-opacity",0).remove()},e.prototype.redrawText=function(t,e,i,n,r){return[(n?this.mainText.transition(r):this.mainText).attr("x",t).attr("y",e).style("fill",this.color).style("fill-opacity",i?0:this.opacityForText.bind(this))]},e.prototype.getTextRect=function(t,e,i){var n,r=this.d3.select("body").append("div").classed("c3",!0),a=r.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),o=this.d3.select(i).style("font");return a.selectAll(".dummy").data([t]).enter().append("text").classed(e||"",!0).style("font",o).text(t).each(function(){n=this.getBoundingClientRect()}),r.remove(),n},e.prototype.generateXYForText=function(t,e,i,n){var r=this,a=r.generateGetAreaPoints(t,!1),o=r.generateGetBarPoints(e,!1),s=r.generateGetLinePoints(i,!1),c=n?r.getXForText:r.getYForText;return function(t,e){var i=r.isAreaType(t)?a:r.isBarType(t)?o:s;return c.call(r,i(t,e),t,this)}},e.prototype.getXForText=function(t,e,i){var n,r,a=this,o=i.getBoundingClientRect();return a.config.axis_rotated?(r=a.isBarType(e)?4:6,n=t[2][1]+r*(e.value<0?-1:1)):n=a.hasType("bar")?(t[2][0]+t[0][0])/2:t[0][0],null===e.value&&(n>a.width?n=a.width-o.width:n<0&&(n=4)),n},e.prototype.getYForText=function(t,e,i){var n,r=this,a=i.getBoundingClientRect();return r.config.axis_rotated?n=(t[0][0]+t[2][0]+.6*a.height)/2:(n=t[2][1],e.value<0||0===e.value&&!r.hasPositiveValue?(n+=a.height,r.isBarType(e)&&r.isSafari()?n-=3:!r.isBarType(e)&&r.isChrome()&&(n+=3)):n+=r.isBarType(e)?-3:-6),null!==e.value||r.config.axis_rotated||(nthis.height&&(n=this.height-4)),n},e.prototype.initTitle=function(){this.title=this.svg.append("text").text(this.config.title_text).attr("class",this.CLASS.title)},e.prototype.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},e.prototype.xForTitle=function(){var t=this,e=t.config,i=e.title_position||"left";return i.indexOf("right")>=0?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:i.indexOf("center")>=0?(t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2:e.title_padding.left},e.prototype.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},e.prototype.getTitlePadding=function(){return this.yForTitle()+this.config.title_padding.bottom},e.prototype.initTooltip=function(){var t,e=this,i=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",a.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),i.tooltip_init_show){if(e.isTimeSeries()&&f(i.tooltip_init_x)){for(i.tooltip_init_x=e.parseDate(i.tooltip_init_x),t=0;t"+(o||0===o?""+o+"":"")),void 0!==(s=m(p(t[a].value,t[a].ratio,t[a].id,t[a].index,t))))){if(null===t[a].name)continue;c=m(g(t[a].name,t[a].ratio,t[a].id,t[a].index)),d=l.levelColor?l.levelColor(t[a].value):n(t[a].id),r+="",r+=""+c+"",r+=""+s+"",r+=""}return r+""},e.prototype.tooltipPosition=function(t,e,i,n){var r,a,o,s,c,d=this,l=d.config,u=d.d3,h=d.hasArcType(),g=u.mouse(n);return h?(a=(d.width-(d.isLegendRight?d.getLegendWidth():0))/2+g[0],s=(d.hasType("gauge")?d.height:d.height/2)+g[1]+20):(r=d.getSvgLeft(!0),l.axis_rotated?(o=(a=r+g[0]+100)+e,c=d.currentWidth-d.getCurrentPaddingRight(),s=d.x(t[0].x)+20):(o=(a=r+d.getCurrentPaddingLeft(!0)+d.x(t[0].x)+20)+e,c=r+d.currentWidth-d.getCurrentPaddingRight(),s=g[1]+15),o>c&&(a-=o-c+20),s+i>d.currentHeight&&(s-=i+30)),s<0&&(s=0),{top:s,left:a}},e.prototype.showTooltip=function(t,i){var n,r,a,o=this,s=o.config,c=o.hasArcType(),d=t.filter(function(t){return t&&x(t.value)}),l=s.tooltip_position||e.prototype.tooltipPosition;0!==d.length&&s.tooltip_show&&(o.tooltip.html(s.tooltip_contents.call(o,t,o.axis.getXAxisTickFormat(),o.getYFormat(c),o.color)).style("display","block"),n=o.tooltip.property("offsetWidth"),r=o.tooltip.property("offsetHeight"),a=l.call(this,d,n,r,i),o.tooltip.style("top",a.top+"px").style("left",a.left+"px"))},e.prototype.hideTooltip=function(){this.tooltip.style("display","none")},e.prototype.setTargetType=function(t,e){var i=this,n=i.config;i.mapToTargetIds(t).forEach(function(t){i.withoutFadeIn[t]=e===n.data_types[t],n.data_types[t]=e}),t||(n.data_type=e)},e.prototype.hasType=function(t,e){var i=this.config.data_types,n=!1;return(e=e||this.data.targets)&&e.length?e.forEach(function(e){var r=i[e.id];(r&&r.indexOf(t)>=0||!r&&"line"===t)&&(n=!0)}):Object.keys(i).length?Object.keys(i).forEach(function(e){i[e]===t&&(n=!0)}):n=this.config.data_type===t,n},e.prototype.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},e.prototype.isLineType=function(t){var e=this.config,i=f(t)?t:t.id;return!e.data_types[i]||["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[i])>=0},e.prototype.isStepType=function(t){var e=f(t)?t:t.id;return["step","area-step"].indexOf(this.config.data_types[e])>=0},e.prototype.isSplineType=function(t){var e=f(t)?t:t.id;return["spline","area-spline"].indexOf(this.config.data_types[e])>=0},e.prototype.isAreaType=function(t){var e=f(t)?t:t.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[e])>=0},e.prototype.isBarType=function(t){var e=f(t)?t:t.id;return"bar"===this.config.data_types[e]},e.prototype.isScatterType=function(t){var e=f(t)?t:t.id;return"scatter"===this.config.data_types[e]},e.prototype.isPieType=function(t){var e=f(t)?t:t.id;return"pie"===this.config.data_types[e]},e.prototype.isGaugeType=function(t){var e=f(t)?t:t.id;return"gauge"===this.config.data_types[e]},e.prototype.isDonutType=function(t){var e=f(t)?t:t.id;return"donut"===this.config.data_types[e]},e.prototype.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},e.prototype.lineData=function(t){return this.isLineType(t)?[t]:[]},e.prototype.arcData=function(t){return this.isArcType(t.data)?[t]:[]},e.prototype.barData=function(t){return this.isBarType(t)?t.values:[]},e.prototype.lineOrScatterData=function(t){return this.isLineType(t)||this.isScatterType(t)?t.values:[]},e.prototype.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},e.prototype.isSafari=function(){var t=window.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},e.prototype.isChrome=function(){return window.navigator.userAgent.indexOf("Chrome")>=0},e.prototype.initZoom=function(){var t,e=this,i=e.d3,n=e.config;return e.zoom=i.zoom().on("start",function(){if("scroll"===n.zoom_type){var r=i.event.sourceEvent;r&&"brush"===r.type||(t=r,n.zoom_onzoomstart.call(e.api,r))}}).on("zoom",function(){if("scroll"===n.zoom_type){var t=i.event.sourceEvent;t&&"brush"===t.type||(e.redrawForZoom(),n.zoom_onzoom.call(e.api,e.x.orgDomain()))}}).on("end",function(){if("scroll"===n.zoom_type){var r=i.event.sourceEvent;r&&"brush"===r.type||r&&t.clientX===r.clientX&&t.clientY===r.clientY||n.zoom_onzoomend.call(e.api,e.x.orgDomain())}}),e.zoom.updateDomain=function(){return i.event&&i.event.transform&&e.x.domain(i.event.transform.rescaleX(e.subX).domain()),this},e.zoom.updateExtent=function(){return this.scaleExtent([1,1/0]).translateExtent([[0,0],[e.width,e.height]]).extent([[0,0],[e.width,e.height]]),this},e.zoom.update=function(){return this.updateExtent().updateDomain()},e.zoom.updateExtent()},e.prototype.zoomTransform=function(t){var e=[this.x(t[0]),this.x(t[1])];return this.d3.zoomIdentity.scale(this.width/(e[1]-e[0])).translate(-e[0],0)},e.prototype.initDragZoom=function(){var t=this,e=t.d3,i=t.config,n=t.context=t.svg,r=t.margin.left+20.5,o=t.margin.top+.5;if("drag"===i.zoom_type&&i.zoom_enabled){var s=function(e){return e&&e.map(function(e){return t.x.invert(e)})},c=t.dragZoomBrush=e.brushX().on("start",function(){t.api.unzoom(),t.svg.select("."+a.dragZoom).classed("disabled",!1),i.zoom_onzoomstart.call(t.api,e.event.sourceEvent)}).on("brush",function(){i.zoom_onzoom.call(t.api,s(e.event.selection))}).on("end",function(){if(null!=e.event.selection){var n=s(e.event.selection);i.zoom_disableDefaultBehavior||t.api.zoom(n),t.svg.select("."+a.dragZoom).classed("disabled",!0),i.zoom_onzoomend.call(t.api,n)}});n.append("g").classed(a.dragZoom,!0).attr("clip-path",t.clipPath).attr("transform","translate("+r+","+o+")").call(c)}},e.prototype.getZoomDomain=function(){var t=this.config,e=this.d3;return[e.min([this.orgXDomain[0],t.zoom_x_min]),e.max([this.orgXDomain[1],t.zoom_x_max])]},e.prototype.redrawForZoom=function(){var t=this,e=t.d3,i=t.config,n=t.zoom,r=t.x;i.zoom_enabled&&0!==t.filterTargetsToShow(t.data.targets).length&&(n.update(),i.zoom_disableDefaultBehavior||(t.isCategorized()&&r.orgDomain()[0]===t.orgXDomain[0]&&r.domain([t.orgXDomain[0]-1e-10,r.orgDomain()[1]]),t.redraw({withTransition:!1,withY:i.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),e.event.sourceEvent&&"mousemove"===e.event.sourceEvent.type&&(t.cancelClick=!0)))},w}()}});if("object"==typeof i){var n=["object"==typeof module&&"object"==typeof module.exports?module.exports:null,"undefined"!=typeof window?window:null,t&&t!==window?t:null];for(var r in i)n[0]&&(n[0][r]=i[r]),n[1]&&"__esModule"!==r&&(n[1][r]=i[r]),n[2]&&(n[2][r]=i[r])}}(this);