From a4805bcb51e6db3113758d90bcc7f6805d1dfced Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Mon, 7 Apr 2014 15:40:59 +0900 Subject: [PATCH] Add type and types param to load API --- c3.js | 22 +++++++++++++++------- c3.min.js | 4 ++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/c3.js b/c3.js index cd4a6b0..ba07dd0 100644 --- a/c3.js +++ b/c3.js @@ -3537,7 +3537,13 @@ .style("opacity", 1); } - function load(targets, done) { + function load(targets, args) { + // set type if args.types || args.type specified + if (args.type || args.types) { + targets.forEach(function (t) { + args.types ? setTargetType(t.id, args.types[t.id]) : setTargetType(t.id, args.type); + }); + } // Update/Add data c3.data.targets.forEach(function (d) { for (var i = 0; i < targets.length; i++) { @@ -3556,23 +3562,25 @@ // Redraw with new targets redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true}); - if (typeof done === 'function') { done(); } + if (typeof args.done === 'function') { + args.done(); + } } function loadFromArgs(args) { // load data if ('data' in args) { - load(convertDataToTargets(args.data), args.done); + load(convertDataToTargets(args.data), args); } else if ('url' in args) { d3.csv(args.url, function (error, data) { - load(convertDataToTargets(data), args.done); + load(convertDataToTargets(data), args); }); } else if ('rows' in args) { - load(convertDataToTargets(convertRowsToData(args.rows)), args.done); + load(convertDataToTargets(convertRowsToData(args.rows)), args); } else if ('columns' in args) { - load(convertDataToTargets(convertColumnsToData(args.columns)), args.done); + load(convertDataToTargets(convertColumnsToData(args.columns)), args); } else { throw Error('url or rows or columns is required.'); @@ -3907,7 +3915,7 @@ }; c3.load = function (args) { - // update xs if exists + // update xs if specified if (args.xs) { addXs(args.xs); } diff --git a/c3.min.js b/c3.min.js index 9fd02a3..6a61d73 100644 --- a/c3.min.js +++ b/c3.min.js @@ -1,3 +1,3 @@ !function(a){"use strict";function b(a){return a||0===a}function c(a){return"undefined"==typeof a}function d(a){return"undefined"!=typeof a}var e={version:"0.1.28"},f={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",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",region:"c3-region",regions:"c3-regions",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",area:"c3-area",text:"c3-text",texts:"c3-texts",grid:"c3-grid",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",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",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};e.generate=function(e){function g(a,b){if(!(a in e))throw Error(b)}function h(a,b){var c,d,f,g=e;for(c=0;cvf&&(vf=0),0>xf&&(xf=0),tf={top:Eg?sf.top:Af-yg-(ji?0:a),right:0/0,bottom:20+(ji?0:a),left:Eg?ni:sf.left},wf=Eg?sf.left-ni-oi:vf,yf=Eg?xf:Af-tf.top-tf.bottom,0>wf&&(wf=0),0>yf&&(yf=0),uf={top:ji?0:Af-a,right:0/0,bottom:0,left:ji?zf-b:0},p(),ji&&Rd(ef.data.targets)&&(uf.left=vf/2+Cf)}function o(){xi.select("line."+f.xgridFocus).attr("x1",Eg?0:-10).attr("x2",Eg?vf:-10).attr("y1",Eg?-10:sf.top).attr("y2",Eg?-10:xf)}function p(){Cf=xf/2,Bf=.95*Cf,Df=Qd(ef.data.targets)?.6*Bf:0}function q(){var a=Eg?f.axisX:f.axisY,b=df.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=df.select(gf).node().getBoundingClientRect(),e=c.right-d.left-t();return e>0?e:0}function r(){return hf?hf:x()}function s(){var a=jf?jf:y();return a>0?a:320}function t(){return Rd(ef.data.targets)?0:kf?kf:Eg||!Rg||Wg?1:v("y")}function u(){var a=1;return Rd(ef.data.targets)?0:lf?lf:ji?P()+($g&&!Eg?v("y2"):a):$g?dh||Eg?a:v("y2"):a}function v(a){var b=gb(a);return b.isInner?20+zb(a):40+zb(a)}function w(a){return"y"!==a||Rg?"y2"!==a||$g?(gb(a).isInner?30:40)+("y2"===a?-10:0):pi:Ag&&!ji?10:1}function x(){return+df.select(gf).style("width").replace("px","")}function y(){return+df.select(gf).style("height").replace("px","")}function z(a){return a?-5:-(sf.left-1)}function A(a){return a?-20:-1}function B(){return z(!Eg)}function C(){return A(!Eg)}function D(){return z(Eg)}function E(){return A(Eg)}function F(a){return a?vf+2+4:sf.left+20}function G(a){return a?80:xf+2}function H(){return F(!Eg)}function I(){return G(!Eg)}function J(){return F(Eg)}function K(){return G(Eg)}function L(){var a=Eg?xf:vf,b=tc(),c=Vb()*(Nd(ef.data.targets)?(b-(Vh?.25:1))/b:.98);return b>1?a*c/(b-1):a}function M(a){ki=a}function N(a){li=a}function O(a){mi=a}function P(){return Ag?ji?li*(ki+1):zf:0}function Q(){return Ag?ji?Af:mi*(ki+1):0}function R(){var a,b=!Qf;If=Eg?1:0,Jf=Eg?xf:vf,Kf=Eg?0:xf,Lf=Eg?vf:1,Mf=If,Nf=Jf,Of=Eg?0:yf,Pf=Eg?wf:1,Qf=T(If,Jf,b?void 0:Qf.domain(),function(){return Wf.tickOffset()}),Rf=U(Kf,Lf),Sf=U(Kf,Lf),Tf=T(If,Jf,Ci,function(a){return a%1?0:Zf.tickOffset()}),Uf=U(Of,Pf),Vf=U(Of,Pf),a=$(),Wf=X(Qf,ei,a),Zf=X(Tf,hi,a),Xf=Y(Rf,fi,Xg,Zg),Yf=Y(Sf,gi,eh,gh),b||(qi.scale(Tf),mf&&ui.scale(Qf)),S()}function S(){Ef=Db(),Ff=Eb(),Gf=Eb(.98)}function T(a,b,e,f){var g=(Uh?df.time.scale():df.scale.linear()).range([a,b]);if(g.orgDomain=function(){return g.domain()},d(e)&&g.domain(e),c(f)&&(f=function(){return 0}),Vh){var h,i=g;g=function(a){return i(a)+f(a)};for(h in i)g[h]=i[h];g.orgDomain=function(){return i.domain()},g.domain=function(a){return arguments.length?(i.domain(a),g):(a=i.domain(),[a[0],a[1]+1])}}return g}function U(a,b){return df.scale.linear().range([a,b])}function V(a){return"y2"===Z(a)?Sf:Rf}function W(a){return"y2"===Z(a)?Vf:Uf}function X(a,b,c){var d=(Vh?Bb():df.svg.axis()).scale(a).orient(b);return d.tickFormat(c),Vh?d.tickCentered(Hg):d.tickOffset=function(){var a=Eg?xf:vf;return a*Vb()/tc()/2},Vh&&d.categories(Gg),d}function Y(a,b,c,d){return df.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function Z(a){return a in eg?eg[a]:"y"}function $(){var a=Uh?bi:Vh?Mc:function(a){return 0>a?a.toFixed(0):a};return Ig&&("function"==typeof Ig?a=Ig:Uh&&(a=function(a){return df.time.format(Ig)(a)})),a}function _(a){var b;return"y"===a?b=Vg:"y2"===a?b=ch:"x"===a&&(b=Qg),b}function ab(a){var b=_(a);return"string"==typeof b?b:b?b.text:null}function bb(a,b){var c=_(a);"string"==typeof c?"y"===a?Vg=b:"y2"===a?ch=b:"x"===a&&(Qg=b):c&&(c.text=b)}function cb(a,b){var c=_(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}}function db(){return cb("x",Eg?"inner-top":"inner-right")}function eb(){return cb("y",Eg?"inner-right":"inner-top")}function fb(){return cb("y2",Eg?"inner-right":"inner-top")}function gb(a){return"y2"===a?fb():"y"===a?eb():db()}function hb(){return ab("x")}function ib(){return ab("y")}function jb(){return ab("y2")}function kb(a,b){return a?b.isLeft?0:b.isCenter?vf/2:vf:b.isBottom?-xf:b.isMiddle?-xf/2:0}function lb(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function mb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function nb(){return kb(!Eg,db())}function ob(){return kb(Eg,eb())}function pb(){return kb(Eg,fb())}function qb(){return lb(!Eg,db())}function rb(){return lb(Eg,eb())}function sb(){return lb(Eg,fb())}function tb(){var a=db();return Eg?a.isInner?"1.2em":-30-zb("x"):a.isInner?"-0.5em":"3em"}function ub(){var a=eb();return Eg?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-zb("y")}function vb(){var a=fb();return Eg?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+zb("y2")}function wb(){return mb(!Eg,db())}function xb(){return mb(Eg,eb())}function yb(){return mb(Eg,fb())}function zb(a){var b=0,c="x"===a?f.axisX:"y"===a?f.axisY:f.axisY2;return df.selectAll("."+c+" .tick text").each(function(){var a=this.getBBox();bb?20:b}function Ab(){xi.select("."+f.axisX+" ."+f.axisXLabel).attr("x",nb).text(hb),xi.select("."+f.axisY+" ."+f.axisYLabel).attr("x",ob).attr("dy",ub).text(ib),xi.select("."+f.axisY2+" ."+f.axisY2Label).attr("x",pb).attr("dy",vb).text(jb)}function Bb(){function a(a,b){a.attr("transform",function(a){return"translate("+(b(a)+p)+", 0)"})}function b(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function c(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function d(a){for(var b=[],c=Math.ceil(a[0]);c0&&b[0]>0&&b.unshift(b[0]-(b[1]-b[0])),b}function e(a,b){var c=a.length-1;return o>=c||b%Math.ceil(c/o)===0}function f(a){return a0)for(g=Kc(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&i[d]&&i[d].forEach(function(a,b){i[d][b]=0>a?a:0}),c=1;c0||(i[d][b]+=+a)});return df.min(Object.keys(i).map(function(a){return df.min(i[a])}))}function Tb(a){var b,c,d,e,f,g,h=vc(a),i=Ic(a);if(dg.length>0)for(g=Lc(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&i[d]&&i[d].forEach(function(a,b){i[d][b]=a>0?a:0}),c=1;c+a||(i[d][b]+=+a)});return df.max(Object.keys(i).map(function(a){return df.max(i[a])}))}function Ub(a,c){var d,e,f,g,h,i,j,k,l=a.filter(function(a){return Z(a.id)===c}),m="y2"===c?ah:Tg,n="y2"===c?_g:Sg,o=b(m)?m:Sb(l),p=b(n)?n:Tb(l),q="y2"===c?bh:Ug,r=id()&&Eg;return 0===l.length?"y2"===c?Sf.domain():Rf.domain():(o===p&&(0>o?p=0:o=0),d=Math.abs(p-o),e=f=g=r?0:.1*d,q&&(h=Math.max(Math.abs(o),Math.abs(p)),p=h-q,o=q-h),r&&(i=jd(o,p),j=$b(Rf.range()),k=[i[0]/j,i[1]/j],f+=d*(k[1]/(1-k[0]-k[1])),g+=d*(k[0]/(1-k[0]-k[1]))),"y"===c&&Yg&&(f=b(Yg.top)?Yg.top:e,g=b(Yg.bottom)?Yg.bottom:e),"y2"===c&&fh&&(f=b(fh.top)?fh.top:e,g=b(fh.bottom)?fh.bottom:e),Nd(l)&&!Kc(l)&&(g=o),[o-g,p+f])}function Vb(a){var b=$b(Ci),c=$b(Qf.domain());return a||0===c?1:b/c}function Wb(a){return Og?Og:df.min(a,function(a){return df.min(a.values,function(a){return a.x})})}function Xb(a){return Ng?Ng:df.max(a,function(a){return df.max(a.values,function(a){return a.x})})}function Yb(a,b){var c,d,e=b[0],f=b[1],g=Math.abs(e-f);return Vh?d=0:Nd(a)?(c=tc(),d=c>1?g/(c-1)/2:.5):d=.01*g,d}function Zb(a){var b=[Wb(a),Xb(a)],c=b[0],d=b[1],e=Yb(a,b),f=Uh?new Date(c.getTime()-e):c-e,g=Uh?new Date(d.getTime()+e):d+e;return[f,g]}function $b(a){return a[1]-a[0]}function _b(a){for(var b=0;bd?0:d}function ec(a){return $f&&a===$f||ge(_f)&&he(_f,a)}function fc(a){return!ec(a)}function gc(a){return $f?$f:ge(_f)?_f[a]:null}function hc(a,b){return a in ef.data.x&&ef.data.x[a]&&ef.data.x[a][b]?ef.data.x[a][b]:b}function ic(a){Object.keys(a).forEach(function(b){_f[b]=a[b]})}function jc(a){var b;return a&&(b=cg[a.id],a.name=b?b:a.id),a}function kc(a,b){a.forEach(function(a){a.values.forEach(function(c,d){c.x=mc(b[d],a.id,d)}),ef.data.x[a.id]=b})}function lc(a,b){a.forEach(function(a){b[a.id]&&kc([a],b[a.id])})}function mc(a,b,c){var d;return d=Uh?a?a instanceof Date?a:be(a):be(hc(b,c)):Wh&&!Vh?a?+a:hc(b,c):c}function nc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0&&(ef.data.x[b]=a.map(function(a){return a[c]})):ef.data.x[b]=a.map(function(a,b){return b})}),c.forEach(function(a){if(!ef.data.x[a])throw new Error('x is not defined for id = "'+a+'".')}),b=c.map(function(b,c){var d=bg(b);return{id:d,id_org:b,values:a.map(function(a,e){var f=gc(b),g=a[f],h=mc(g,b,e);return Wh&&Vh&&0===c&&g&&(0===e&&(Gg=[]),Gg.push(g)),"undefined"==typeof a[b]&&(h=void 0),{x:h,value:null===a[b]||isNaN(a[b])?null:+a[b],id:d}}).filter(function(a){return"undefined"!=typeof a.x})}}),b.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++})}),fg&&Ld(vc(b).filter(function(a){return!(a in gg)}),fg),b.forEach(function(a){ac(a.id_org,a)}),b}function qc(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}}function rc(a){return a>0&&ef.data.targets[0].values[a-1]?ef.data.targets[0].values[a-1].x:void 0}function sc(a){return a1?ef.data.targets.forEach(function(b){b.values.length>c&&(a=b,c=b.values.length)}):a=b?ef.data.targets[0]:null,a}function vc(a){return a.map(function(a){return a.id})}function wc(a){return a?"string"==typeof a?[a]:a:vc(ef.data.targets)}function xc(a,b){var c,d=vc(a);for(c=0;c2){for(e=b-2,c=a[0],d=a[a.length-1],f=(d-c)/(e+1),i=[c],g=0;e>g;g++)h=+c+f*(g+1),i.push(Uh?new Date(h):h);i.push(d)}return i}function Ec(a){ci=ci.concat(a)}function Fc(a){ci=ci.filter(function(b){return a.indexOf(b)<0})}function Gc(a){di=di.concat(a)}function Hc(a){di=di.filter(function(b){return a.indexOf(b)<0})}function Ic(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b}function Jc(a,b){var c,d,e,f=Object.keys(a);for(c=0;ca})}function Lc(a){return Jc(a,function(a){return a>0})}function Mc(a){return a=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c0?g=h:f=h,g-f===1||0===f&&0===g?(e=[],a[f].x&&(e=e.concat(rd(a,f))),a[g].x&&(e=e.concat(rd(a,g))),ud(e,b)):sd(a,b,f,g)}function td(a,b){var c;return c=a.map(function(a){return sd(a.values,b)}),ud(c,b)}function ud(a,b){var c,d;return a.forEach(function(a){var e=ie(a,b);(c>e||!c)&&(c=e,d=a)}),d}function vd(a,b){return df.merge(a.map(function(a){return a.values})).filter(function(a){return a.x===b})}function wd(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}}function xd(){return ig&&"desc"===ig.toLowerCase()}function yd(){return ig&&"asc"===ig.toLowerCase()}function zd(a){var b=yd(),c=xd();return b||c?a.sort(function(a,c){var d=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(d,0),f=c.values.reduce(d,0);return b?f-e:e-f}):"function"==typeof ig&&a.sort(ig),a}function Ad(a,c){var d,e,f,g,h,i,j,k=Rd(ef.data.targets),l=k?ld:kd,m=a.filter(function(a){return a&&b(a.value)});Hh&&0!==m.length&&(Ai.html(Kh(a,$(),l,ai)).style("display","block"),d=Ai.property("offsetWidth"),e=Ai.property("offsetHeight"),k?(g=vf/2+c[0],i=xf/2+c[1]+20):(Eg?(f=q(),g=f+c[0]+100,h=g+d,j=r()-u(),i=Qf(m[0].x)+20):(f=q(),g=f+t()+Qf(m[0].x)+20,h=g+d,j=f+r()-u(),i=c[1]+15),h>j&&(g-=d+60),i+e>s()&&(i-=e+30)),Ai.style("top",i+"px").style("left",g+"px"))}function Bd(){Ai.style("display","none")}function Cd(a){var c=a.filter(function(a){return a&&b(a.value)});Hh&&(Od(ef.data.targets)||Rd(ef.data.targets)||xi.selectAll("line."+f.xgridFocus).style("visibility","visible").data([c[0]]).attr(Eg?"y1":"x1",nd).attr(Eg?"y2":"x2",nd))}function Dd(){xi.select("line."+f.xgridFocus).style("visibility","hidden")}function Ed(a){return a.x||0===a.x?Qf(a.x):null}function Fd(a){return V(a.id)(a.value)}function Gd(){var a,b,d={},e=0;return Bc(yc(Ud)).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function Kd(a,b){return th?th:b?2*a.tickOffset()*uh/b:0}function Ld(a,b){wc(a).forEach(function(a){Ei[a]=b===gg[a],gg[a]=b})}function Md(a,b){var c=!1;return a.forEach(function(a){gg[a.id]===b&&(c=!0),a.id in gg||"line"!==b||(c=!0)}),c}function Nd(a){return Md(a,"bar")}function Od(a){return Md(a,"scatter")}function Pd(a){return Md(a,"pie")}function Qd(a){return Md(a,"donut")}function Rd(a){return Pd(a)||Qd(a)}function Sd(a){var b="string"==typeof a?a:a.id;return!(b in gg)||"line"===gg[b]||"spline"===gg[b]||"area"===gg[b]||"area-spline"===gg[b]}function Td(a){var b="string"==typeof a?a:a.id;return"spline"===gg[b]||"area-spline"===gg[b]}function Ud(a){var b="string"==typeof a?a:a.id;return"bar"===gg[b]}function Vd(a){var b="string"==typeof a?a:a.id;return"scatter"===gg[b]}function Wd(a){var b="string"==typeof a?a:a.id;return"pie"===gg[b]}function Xd(a){var b="string"==typeof a?a:a.id;return"donut"===gg[b]}function Yd(a){return Wd(a)||Xd(a)}function Zd(a){return Ud(a)?a.values:[]}function $d(a){return Sd(a)||Vd(a)?a.values:[]}function _d(a){return Ud(a)||Sd(a)?a.values:[]}function ae(a,b,c){var d=[];return function(e){var f,g=e.id||e;return a[g]instanceof Function?f=a[g](e):g in a?f=a[g]:(d.indexOf(g)<0&&d.push(g),f=b[d.indexOf(g)%b.length]),c instanceof Function?c(f,e):f}}function be(b){var c;if(!b)throw Error(b+" can not be parsed as d3.time with format "+ag+". Maybe 'x' of this data is not defined. See data.x or data.xs option.");try{c=ag?df.time.format(ag).parse(b):new Date(b)}catch(d){c=void 0}return c||a.console.error("Failed to parse x '"+b+"' to Date with format "+ag),c}function ce(a,b){var c=df.mouse(a),d=df.select(a),e=1*d.attr("cx"),f=1*d.attr("cy");return Math.sqrt(Math.pow(e-c[0],2)+Math.pow(f-c[1],2))0}function he(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}function ie(a,b){var c="y"===Z(a.id)?Rf:Sf,d=Eg?1:0,e=Eg?0:1;return Math.pow(Qf(a.x)-b[d],2)+Math.pow(c(a.value)-b[e],2)}function je(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})}function ke(a,b,c){tg(b,a.node()),xi.select("."+f.selectedCircles+_c(b.id)).selectAll("."+f.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return Nc(f.selectedCircle,c)}).attr("cx",Eg?Fd:Ed).attr("cy",Eg?Ed:Fd).attr("stroke",function(){return ai(b)}).attr("r",1.4*sh).transition().duration(100).attr("r",sh)}function le(a,b,c){ug(b,a.node()),xi.select("."+f.selectedCircles+_c(b.id)).selectAll("."+f.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}function me(a,b,c,d){a?ke(b,c,d):le(b,c,d)}function ne(a,b){tg(b,a.node()),a.transition().duration(100).style("fill",function(){return df.rgb(ai(b)).darker(1)})}function oe(a,b){ug(b,a.node()),a.transition().duration(100).style("fill",function(){return ai(b)})}function pe(a,b,c,d){a?ne(b,c,d):oe(b,c,d)}function qe(a){return a.filter(function(a){return b(a.value)})}function re(a,c){return(c?xi.selectAll("."+f.circles+_c(c)):xi).selectAll("."+f.circle+(b(a)?"-"+a:""))}function se(a,b){re(a,b).classed(f.EXPANDED,!0).attr("r",rh)}function te(a){re(a).filter(function(){return df.select(this).classed(f.EXPANDED)}).classed(f.EXPANDED,!1).attr("r",oh)}function ue(a){return xi.selectAll("."+f.bar+(b(a)?"-"+a:""))}function ve(a){ue(a).classed(f.EXPANDED,!0)}function we(a){ue(a).classed(f.EXPANDED,!1)}function xe(a,b){var c=Be(a,b);return function(a,b){var d=c(a,b),e=Eg?1:0,f=Eg?0:1,g="M "+d[0][e]+","+d[0][f]+" L"+d[1][e]+","+d[1][f]+" L"+d[2][e]+","+d[2][f]+" L"+d[3][e]+","+d[3][f]+" z";return g}}function ye(a,b){var c=Be(a,!1),d=b?ze:Ae;return function(a,b){return d(c(a,b),a,this)}}function ze(a,b){var c;return Eg?(c=Ud(b)?4:6,a[2][1]+c*(b.value<0?-1:1)):a[0][0]+(a[2][0]-a[0][0])/2}function Ae(a,b,c){var d=c.getBBox();return Eg?(a[0][0]+a[2][0]+.6*d.height)/2:a[2][1]+(b.value<0?d.height:Ud(b)?-3:-6)}function Be(a,b){var c=a.__max__+1,d=Kd(Wf,c),e=Hd(d,c,a,!!b),f=Id(!!b),g=Jd(a,!!b),h=b?W:V;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return Eg&&(a.value>0&&i>k||a.value<0&&k>i)&&(k=i),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function Ce(a,b,e,f){var g,h,i,j,k,l,m,n,o,p,q,r=-1,s="M",t=[];if(d(f))for(g=0;g=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}return s}function De(b){var c,d,e;if(Bi=df.select(gf),Bi.empty())throw new Error('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(Bi.html(""),Bi.classed("c3",!0),ef.data.x={},ef.data.targets=pc(b),n(),R(),Qf.domain(df.extent(Zb(ef.data.targets))),Rf.domain(Ub(ef.data.targets,"y")),Sf.domain(Ub(ef.data.targets,"y2")),Tf.domain(Qf.domain()),Uf.domain(Rf.domain()),Vf.domain(Sf.domain()),Ci=Qf.domain(),qi.scale(Tf),mf&&ui.scale(Qf),vi=Bi.append("svg").attr("width",vf+sf.left+sf.right).attr("height",xf+sf.top+sf.bottom).on("mouseenter",pf).on("mouseleave",qf),wi=vi.append("defs"),wi.append("clipPath").attr("id",Oh).append("rect").attr("width",vf).attr("height",xf),wi.append("clipPath").attr("id",Ph).append("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),wi.append("clipPath").attr("id",Qh).append("rect").attr("x",D).attr("y",E).attr("width",J).attr("height",K),xi=vi.append("g").attr("transform",ii.main),yi=xg?vi.append("g").attr("transform",ii.context):null,zi=vi.append("g").attr("transform",ii.legend),Ag||(zi.style("visibility","hidden"),di=vc(ef.data.targets)),Ai=df.select(gf).style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),$e(vc(ef.data.targets),{withTransform:!1,withTransitionForTransform:!1}),xi.append("g").attr("class",f.axisX).attr("clip-path",Eg?"":Sh).attr("transform",ii.x).append("text").attr("class",f.axisXLabel).attr("transform",Eg?"rotate(-90)":"").attr("dx",qb).attr("dy",tb).style("text-anchor",wb),Rg&&xi.append("g").attr("class",f.axisY).attr("clip-path",Eg?Th:"").attr("transform",ii.y).append("text").attr("class",f.axisYLabel).attr("transform",Eg?"":"rotate(-90)").attr("dx",rb).attr("dy",ub).style("text-anchor",xb),$g&&xi.append("g").attr("class",f.axisY2).attr("transform",ii.y2).append("text").attr("class",f.axisY2Label).attr("transform",Eg?"":"rotate(-90)").attr("dx",sb).style("text-anchor",yb),d=xi.append("g").attr("clip-path",Rh).attr("class",f.grid),hh&&d.append("g").attr("class",f.xgrids),ge(jh)&&d.append("g").attr("class",f.xgridLines),ph&&d.append("g").attr("class",f.xgridFocus).append("line").attr("class",f.xgridFocus),kh&&d.append("g").attr("class",f.ygrids),ge(lh)&&d.append("g").attr("class",f.ygridLines),xi.append("g").attr("clip-path",Rh).attr("class",f.regions),xi.append("g").attr("clip-path",Rh).attr("class",f.chart),c=xi.select("."+f.chart).append("g").attr("class",f.eventRects).style("fill-opacity",0).style("cursor",mf?Eg?"ns-resize":"ew-resize":null),xi.select("."+f.chart).append("g").attr("class",f.chartBars),xi.select("."+f.chart).append("g").attr("class",f.chartLines),xi.select("."+f.chart).append("g").attr("class",f.chartArcs).attr("transform",ii.arc).append("text").attr("class",f.chartArcsTitle).style("text-anchor","middle").text(Ob()),xi.select("."+f.chart).append("g").attr("class",f.chartTexts),mf&&xi.insert("rect",of?null:"g."+f.grid).attr("class",f.zoomRect).attr("width",vf).attr("height",xf).style("opacity",0).style("cursor",Eg?"ns-resize":"ew-resize").call(ui).on("dblclick.zoom",null),Pg&&qi.extent("function"!=typeof Pg?Pg:Pg(Zb())),xg&&(yi.append("g").attr("clip-path",Rh).attr("class",f.chart),yi.select("."+f.chart).append("g").attr("class",f.chartBars),yi.select("."+f.chart).append("g").attr("class",f.chartLines),yi.append("g").attr("clip-path",Rh).attr("class",f.brush).call(qi).selectAll("rect").attr(Eg?"width":"height",Eg?wf:yf),yi.append("g").attr("class",f.axisX).attr("transform",ii.subx).attr("clip-path",Eg?"":Sh)),Qe(ef.data.targets),Eg?xi.select("."+f.axisX).style("opacity",0).call(Wf):(xi.select("."+f.axisY).style("opacity",0).call(Xf),xi.select("."+f.axisY2).style("opacity",0).call(Yf)),Ke({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1}),Lh){if(Uh&&"string"==typeof Mh){for(Mh=be(Mh),e=0;e0){d=[];for(var g in cg)for(c=0;cg&&h>c&&d>i&&j>d):"path"===this.nodeName&&(m=wd(this),c=m.x,d=m.y,e=m.width,k=m.height,l=pe,q=!(c>h||g>c+e||d>j||i>d+k)),q^p&&(n.classed(f.INCLUDED,!p),n.classed(f.SELECTED,!o),l(!o,n,a,b))}))}function Ie(a){Rd(ef.data.targets)||mg&&(Xh=a,xi.select("."+f.chart).append("rect").attr("class",f.dragarea).style("opacity",.1),Yh=!0,vg())}function Je(){Rd(ef.data.targets)||mg&&(xi.select("."+f.dragarea).transition().duration(100).style("opacity",0).remove(),xi.selectAll("."+f.shape).classed(f.INCLUDED,!1),Yh=!1,wg())}function Ke(a){var c,e,g,h,i,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,M,N,O,P,Q,R,S=Gd(),T=Rd(ef.data.targets),U=Bc(ef.data.targets);if(0!==U.length){if(a=d(a)?a:{},x=d(a.withY)?a.withY:!0,y=d(a.withSubchart)?a.withSubchart:!0,z=d(a.withTransition)?a.withTransition:!0,D=d(a.withTransform)?a.withTransform:!1,E=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,F=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,G=d(a.withLegend)?a.withLegend:!1,A=d(a.withTransitionForExit)?a.withTransitionForExit:z,B=d(a.withTransitionForAxis)?a.withTransitionForAxis:z,C=d(a.withTransitionForHorizontalAxis)?a.withTransitionForHorizontalAxis:z,M=z?rf:0,N=A?M:0,O=B?M:0,G&&Ag&&$e(vc(ef.data.targets),a),F&&(Qf.domain(df.extent(Zb(U))),Ci=Qf.domain(),mf&&ui.scale(Qf).updateScaleExtent(),Tf.domain(Qf.domain()),qi.scale(Tf)),E&&(Qf.domain(qi.empty()?Ci:qi.extent()),mf&&ui.scale(Qf).updateScaleExtent()),Rf.domain(Ub(U,"y")),Sf.domain(Ub(U,"y2")),Od(U)||(P=Dc(Cc(U)).sort(),Wf.tickValues(P),Zf.tickValues(P)),c=xi.select("."+f.axisX).style("opacity",T?0:1),(Eg||C)&&(c=c.transition().duration(O)),c.call(Wf),e=xi.select("."+f.axisY).style("opacity",T?0:1),(!Eg||C)&&(e=e.transition().duration(O)),e.call(Xf),xi.select("."+f.axisY2).style("opacity",T?0:1).transition().duration(O).call(Yf),E&&Jg&&P){for(Q=1;Q=Y;Y++)h.push(new Date(Y+"-01-01 00:00:00"))}else h=Qf.ticks(10);g=xi.select("."+f.xgrids).selectAll("."+f.xgrid).data(h),g.enter().append("line").attr("class",f.xgrid),g.attr("x1",Eg?0:function(a){return Qf(a)-Wf.tickOffset()}).attr("x2",Eg?vf:function(a){return Qf(a)-Wf.tickOffset()}).attr("y1",Eg?function(a){return Qf(a)-Wf.tickOffset()}:sf.top).attr("y2",Eg?function(a){return Qf(a)-Wf.tickOffset()}:xf).style("opacity",function(){return+df.select(this).attr(Eg?"y1":"x1")===(Eg?xf:0)?0:1}),g.exit().remove()}ge(jh)&&(i=xi.select("."+f.xgridLines).selectAll("."+f.xgridLine).data(jh),j=i.enter().append("g").attr("class",function(a){return f.xgridLine+(a.class?a.class:"")}),j.append("line").style("opacity",0),j.append("text").attr("text-anchor","end").attr("transform",Eg?"":"rotate(-90)").attr("dx",Eg?0:-sf.top).attr("dy",-5).style("opacity",0),i.select("line").transition().duration(M).attr("x1",Eg?0:od).attr("x2",Eg?vf:od).attr("y1",Eg?od:sf.top).attr("y2",Eg?od:xf).style("opacity",1),i.select("text").transition().duration(M).attr("x",Eg?vf:0).attr("y",od).text(function(a){return a.text}).style("opacity",1),i.exit().transition().duration(M).style("opacity",0).remove()),x&&kh&&(k=xi.select("."+f.ygrids).selectAll("."+f.ygrid).data(Rf.ticks(mh)),k.enter().append("line").attr("class",f.ygrid),k.attr("x1",Eg?Rf:0).attr("x2",Eg?Rf:vf).attr("y1",Eg?0:Rf).attr("y2",Eg?xf:Rf),k.exit().remove()),x&&ge(lh)&&(l=xi.select("."+f.ygridLines).selectAll("."+f.ygridLine).data(lh),m=l.enter().append("g").attr("class",function(a){return f.ygridLine+(a.class?a.class:"")}),m.append("line").style("opacity",0),m.append("text").attr("text-anchor","end").attr("transform",Eg?"rotate(-90)":"").attr("dx",Eg?0:-sf.top).attr("dy",-5).style("opacity",0),l.select("line").transition().duration(M).attr("x1",Eg?pd:0).attr("x2",Eg?pd:vf).attr("y1",Eg?0:pd).attr("y2",Eg?xf:pd).style("opacity",1),l.select("text").transition().duration(M).attr("x",Eg?0:vf).attr("y",pd).text(function(a){return a.text}).style("opacity",1),l.exit().transition().duration(M).style("opacity",0).remove()),p=xi.selectAll("."+f.bars).selectAll("."+f.bar).data(Zd),p.enter().append("path").attr("d",H).style("stroke","none").style("opacity",0).style("fill",function(a){return ai(a)}).attr("class",Vc),p.style("opacity",ed).transition().duration(M).attr("d",H).style("opacity",1),p.exit().transition().duration(N).style("opacity",0).remove(),r=xi.selectAll("."+f.texts).selectAll("."+f.text).data(_d),r.enter().append("text").attr("class",Oc).attr("text-anchor",function(a){return Eg?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0),r.text(function(a){return md(a.id)(a.value)}).style("fill-opacity",fd).transition().duration(M).attr("x",J).attr("y",K).style("fill-opacity",hd),r.exit().transition().duration(N).style("fill-opacity",0).remove(),xi.selectAll("."+f.line).style("opacity",ed).transition().duration(M).attr("d",ri).style("opacity",1),xi.selectAll("."+f.area).style("opacity",0).transition().duration(M).attr("d",si).style("opacity",Di),n=xi.selectAll("."+f.circles).selectAll("."+f.circle).data($d),n.enter().append("circle").attr("class",Tc).style("opacity",0).attr("r",oh),n.style("opacity",ed).transition().duration(M).style("opacity",gd).attr("cx",Eg?Fd:Ed).attr("cy",Eg?Ed:Fd),n.exit().remove(),xi.selectAll("."+f.chartArc).select("."+f.arc).attr("transform",D?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(M).attrTween("d",function(a){var b,c=Cb(a);return c?(b=df.interpolate(this._current,c),this._current=b(0),function(a){return Fb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",D?"scale(1)":"").style("opacity",1),xi.selectAll("."+f.chartArc).select("text").attr("transform",Gb).style("opacity",0).transition().duration(M).text(Jb).style("opacity",function(a){return zc(a.data.id)&&Yd(a.data)?1:0}),xi.select("."+f.chartArcsTitle).style("opacity",Qd(ef.data.targets)?1:0),xg&&(null!==df.event&&"zoom"===df.event.type&&qi.extent(Qf.orgDomain()).update(),y&&(yi.select("."+f.axisX).style("opacity",T?0:1).transition().duration(M).call(Zf),qi.empty()||qi.extent(Qf.orgDomain()).update(),I=xe(S,!0),s=yi.selectAll("."+f.bars).selectAll("."+f.bar).data(Zd),s.enter().append("path").attr("d",I).style("stroke","none").style("fill",function(a){return ai(a)}).attr("class",Vc),s.style("opacity",ed).transition().duration(M).attr("d",I).style("opacity",1),s.exit().transition().duration(M).style("opacity",0).remove(),yi.selectAll("."+f.line).style("opacity",ed).transition().duration(M).attr("d",ti).style("opacity",1))),xi.selectAll("."+f.selectedCircles).filter(function(a){return Ud(a)}).selectAll("circle").remove(),xi.selectAll("."+f.selectedCircle).transition().duration(M).attr("cx",Eg?Fd:Ed).attr("cy",Eg?Ed:Fd),ge(_f)?(t=xi.select("."+f.eventRects).selectAll("."+f.eventRect).data([0]),Fe(t.enter()),t.attr("x",0).attr("y",0).attr("width",vf).attr("height",xf)):(Wh&&!Vh?(w=function(a,b){var c=rc(b),d=sc(b),e=ef.data.x[a.id][b];return(Qf(d?d:e+50)-Qf(c?c:e-50))/2},v=function(a,b){var c=rc(b),d=ef.data.x[a.id][b];return(Qf(d)+Qf(c?c:d-50))/2}):(w=L(),v=function(a){return Qf(a.x)-w/2}),u=uc(),xi.select("."+f.eventRects).datum(u?u.values:[]),t=xi.select("."+f.eventRects).selectAll("."+f.eventRect).data(function(a){return a}),Ee(t.enter()),t.attr("class",$c).attr("x",Eg?0:v).attr("y",Eg?v:0).attr("width",Eg?vf:w).attr("height",Eg?w:xf),t.exit().remove()),q=xi.select("."+f.regions).selectAll("rect."+f.region).data(Gh),q.enter().append("rect").style("fill-opacity",0),q.attr("class",Zc).attr("x",Eg?0:cc).attr("y",Eg?cc:sf.top).attr("width",Eg?vf:dc).attr("height",Eg?dc:xf).transition().duration(M).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1}),q.exit().transition().duration(M).style("fill-opacity",0).remove(),vc(ef.data.targets).forEach(function(a){Ei[a]=!0})}}function Le(){Ke({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function Me(){return"mousemove"===df.event.sourceEvent.type&&ui.altDomain?(Qf.domain(ui.altDomain),void ui.scale(Qf).updateScaleExtent()):(Vh&&Qf.orgDomain()[0]===Ci[0]&&Qf.domain([Ci[0]-1e-10,Qf.orgDomain()[1]]),Ke({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===df.event.sourceEvent.type&&(Zh=!0)))}function Ne(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function Oe(){vi.attr("width",zf).attr("height",Af),vi.select("#"+Oh).select("rect").attr("width",vf).attr("height",xf),vi.select("#"+Ph).select("rect").attr("width",H),vi.select("#"+Qh).select("rect").attr("width",J),vi.select("."+f.zoomRect).attr("width",vf).attr("height",xf)}function Pe(a){a=a||{},a.withTransition=d(a.withTransition)?a.withTransition:!0,a.withTransform=d(a.withTransform)?a.withTransform:!1,a.withLegend=d(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,n(),R(),Oe(),m(a.withTransition),Ke(a)}function Qe(a){var b,c,d,e,g,h,i,j,k,l,m,n;i=xi.select("."+f.chartTexts).selectAll("."+f.chartText).data(a),j=i.enter().append("g").attr("class",function(a){return f.chartText+Nc(f.target,a.id)}).style("pointer-events","none"),j.append("g").attr("class",Pc).style("fill",function(a){return ai(a)}),e=xi.select("."+f.chartBars).selectAll("."+f.chartBar).data(a),d=e.enter().append("g").attr("class",function(a){return f.chartBar+Nc(f.target,a.id)}).style("pointer-events","none"),d.append("g").attr("class",Wc).style("fill",function(a){return ai(a)}).style("stroke","none").style("cursor",function(a){return og(a)?"pointer":null}),c=xi.select("."+f.chartLines).selectAll("."+f.chartLine).data(a),b=c.enter().append("g").attr("class",function(a){return f.chartLine+Nc(f.target,a.id)}).style("pointer-events","none"),b.append("path").attr("class",Sc).style("opacity",0).style("stroke",function(a){return ai(a)}),b.append("path").attr("class",Yc).style("opacity",function(){return Di=+df.select(this).style("opacity"),0}).style("fill",function(a){return ai(a)}),b.append("g").attr("class",function(a){return Nc(f.selectedCircles,a.id)}),b.append("g").attr("class",Uc).style("fill",function(a){return ai(a)}).style("cursor",function(a){return og(a)?"pointer":null}),a.forEach(function(a){xi.selectAll("."+f.selectedCircles+_c(a.id)).selectAll("."+f.selectedCircle).each(function(b,c){b.value=a.values[c].value})}),h=xi.select("."+f.chartArcs).selectAll("."+f.chartArc).data(Hf(a)),g=h.enter().append("g").attr("class",function(a){return f.chartArc+Nc(f.target,a.data.id)}),g.append("path").attr("class",Xc).style("opacity",0).style("fill",function(a){return ai(a.data)}).style("cursor",function(a){return og(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a,b){var c=Cb(a),d=Ib(c),e=Qb();Kb(c.data.id),Ve(c.data.id),e(d,b)}).on("mousemove",function(a){var b=Cb(a),c=[Ib(b)];Ad(c,df.mouse(this))}).on("mouseout",function(a,b){var c=Cb(a),d=Ib(c),e=Rb();Lb(c.data.id),Xe(),Bd(),e(d,b)}).on("click",function(a,b){var c=Cb(a),d=Ib(c),e=Pb();e(d,b)}),g.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),xg&&(n=yi.select("."+f.chartBars).selectAll("."+f.chartBar).data(a),m=n.enter().append("g").attr("class",function(a){return f.chartBar+Nc(f.target,a.id)}),m.append("g").attr("class",Wc).style("fill",function(a){return ai(a)}),l=yi.select("."+f.chartLines).selectAll("."+f.chartLine).data(a),k=l.enter().append("g").attr("class",function(a){return f.chartLine+Nc(f.target,a.id)}),k.append("path").attr("class",Sc).style("opacity",0).style("stroke",function(a){return ai(a)})),vi.selectAll("."+f.target).filter(function(a){return zc(a.id)}).transition().style("opacity",1)}function Re(a,b){ef.data.targets.forEach(function(b){for(var c=0;cf&&(f=(l-k)/2,w=0,C++)),B[a]=C,A[C]=f,x[a]=w,w+=k}var f,g,h=b.getBBox(),i=10*Math.ceil((h.width+s)/10),j=10*Math.ceil((h.height+r)/10),k=ji?j:i,l=ji?Q():P();return d&&(w=0,C=0,t=0,u=0),Ag&&!Ac(c)?void(y[c]=z[c]=B[c]=x[c]=0):(y[c]=i,z[c]=j,(!t||i>=t)&&(t=i),(!u||j>=u)&&(u=j),g=ji?u:t,void(Dg?(Object.keys(y).forEach(function(a){y[a]=t}),Object.keys(z).forEach(function(a){z[a]=u}),f=(l-g*a.length)/2,v>f?(w=0,C=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}var e,g,h,i,j,k,l,o,p,q,r=4,s=26,t=0,u=0,v=10,w=0,x={},y={},z={},A=[0],B={},C=0;b=b||{},o=d(b.withTransition)?b.withTransition:!0,p=d(b.withTransitionForTransform)?b.withTransitionForTransform:!0,q=d(b.withTransformAll)?b.withTransformAll:!0,ji?(e=function(a){return t*(.2+B[a])},i=function(a){return A[B[a]]+x[a]}):(e=function(a){return A[B[a]]+x[a]},i=function(a){return u*(.2+B[a])}),g=function(a,b){return e(a,b)+14},j=function(a,b){return i(a,b)+9},h=function(a,b){return e(a,b)-4},k=function(a,b){return i(a,b)-7},l=zi.selectAll("."+f.legendItem).data(a).enter().append("g").attr("class",function(a){return Nc(f.legendItem,a)}).style("visibility",function(a){return Ac(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeof Cg?Cg(a):ef.toggle(a)}).on("mouseover",function(a){ef.focus(a)}).on("mouseout",function(){ef.revert()}),l.append("text").text(function(a){return d(cg[a])?cg[a]:a}).each(function(a,b){c(this,a,0===b)}).style("pointer-events","none").attr("x",ji?g:-200).attr("y",ji?-200:j),l.append("rect").attr("class",f.legendItemEvent).style("fill-opacity",0).attr("x",ji?h:-200).attr("y",ji?-200:k).attr("width",function(a){return y[a]}).attr("height",function(a){return z[a]}),l.append("rect").attr("class",f.legendItemTile).style("pointer-events","none").style("fill",function(a){return ai(a)}).attr("x",ji?g:-200).attr("y",ji?-200:i).attr("width",10).attr("height",10),zi.selectAll("text").data(a).text(function(a){return d(cg[a])?cg[a]:a}).each(function(a,b){c(this,a,0===b)}).transition().duration(o?250:0).attr("x",g).attr("y",j),zi.selectAll("rect."+f.legendItemEvent).data(a).transition().duration(o?250:0).attr("x",h).attr("y",k),zi.selectAll("rect."+f.legendItemTile).data(a).transition().duration(o?250:0).attr("x",e).attr("y",i),N(t),O(u),M(C),n(),R(),Oe(),q&&m(p)}function _e(a){return xc(ef.data.targets,a.id)}function af(a){return"data"in a&&xc(ef.data.targets,a.data.id)}function bf(a){var b=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;return b?function(a){return a.value!==b}:c?function(a){return a["class"]!==c}:function(){return!0}}function cf(a,b,c){var d=!Rd(ef.data.targets);Ld(a,b),Pe(c?c:{withTransitionForAxis:d})}var df=a.d3?a.d3:a.require?a.require("d3"):void 0,ef={data:{},axis:{},legend:{}},ff={},gf=h(["bindto"],"#chart"),hf=h(["size","width"]),jf=h(["size","height"]),kf=h(["padding","left"]),lf=h(["padding","right"]),mf=h(["zoom","enabled"],!1),nf=h(["zoom","extent"]),of=h(["zoom","privileged"],!1),pf=h(["onenter"],function(){}),qf=h(["onleave"],function(){}),rf=h(["transition","duration"],350);g("data","data is required in config");var sf,tf,uf,vf,wf,xf,yf,zf,Af,Bf,Cf,Df,Ef,Ff,Gf,Hf,If,Jf,Kf,Lf,Mf,Nf,Of,Pf,Qf,Rf,Sf,Tf,Uf,Vf,Wf,Xf,Yf,Zf,$f=h(["data","x"]),_f=h(["data","xs"],{}),ag=h(["data","x_format"]),bg=h(["data","id_converter"],function(a){return a}),cg=h(["data","names"],{}),dg=h(["data","groups"],[]),eg=h(["data","axes"],{}),fg=h(["data","type"]),gg=h(["data","types"],{}),hg=h(["data","labels"],{}),ig=h(["data","order"]),jg=h(["data","regions"],{}),kg=h(["data","color"]),lg=h(["data","colors"],{}),mg=h(["data","selection","enabled"],!1),ng=h(["data","selection","grouped"],!1),og=h(["data","selection","isselectable"],function(){return!0}),pg=h(["data","selection","multiple"],!0),qg=h(["data","onclick"],function(){}),rg=h(["data","onenter"],function(){}),sg=h(["data","onleave"],function(){}),tg=h(["data","onselected"],function(){}),ug=h(["data","onunselected"],function(){}),vg=h(["data","ondragstart"],function(){}),wg=h(["data","ondragend"],function(){}),xg=h(["subchart","show"],!1),yg=xg?h(["subchart","size","height"],60):0,zg=h(["color","pattern"],[]),Ag=h(["legend","show"],!0),Bg=h(["legend","position"],"bottom"),Cg=h(["legend","item","onclick"]),Dg=h(["legend","equally"],!1),Eg=h(["axis","rotated"],!1),Fg=h(["axis","x","type"],"indexed"),Gg=h(["axis","x","categories"],[]),Hg=h(["axis","x","tick","centered"],!1),Ig=h(["axis","x","tick","format"]),Jg=h(["axis","x","tick","culling"],{}),Kg=h(["axis","x","tick","culling","max"],"categorized"===Fg?1/0:10),Lg=h(["axis","x","tick","count"]),Mg=h(["axis","x","tick","fit"],!1),Ng=h(["axis","x","max"]),Og=h(["axis","x","min"]),Pg=h(["axis","x","default"]),Qg=h(["axis","x","label"],{}),Rg=h(["axis","y","show"],!0),Sg=h(["axis","y","max"]),Tg=h(["axis","y","min"]),Ug=h(["axis","y","center"]),Vg=h(["axis","y","label"],{}),Wg=h(["axis","y","inner"],!1),Xg=h(["axis","y","tick","format"]),Yg=h(["axis","y","padding"],{}),Zg=h(["axis","y","ticks"],10),$g=h(["axis","y2","show"],!1),_g=h(["axis","y2","max"]),ah=h(["axis","y2","min"]),bh=h(["axis","y2","center"]),ch=h(["axis","y2","label"],{}),dh=h(["axis","y2","inner"],!1),eh=h(["axis","y2","tick","format"]),fh=h(["axis","y2","padding"],{}),gh=h(["axis","y2","ticks"],10),hh=h(["grid","x","show"],!1),ih=h(["grid","x","type"],"tick"),jh=h(["grid","x","lines"],[]),kh=h(["grid","y","show"],!1),lh=h(["grid","y","lines"],[]),mh=h(["grid","y","ticks"],10),nh=h(["point","show"],!0),oh=nh?h(["point","r"],2.5):0,ph=h(["point","focus","line","enabled"],!0),qh=h(["point","focus","expand","enabled"],!0),rh=h(["point","focus","expand","r"],qh?4:oh),sh=h(["point","focus","select","r"],8),th=h(["bar","width"]),uh=h(["bar","width","ratio"],.6),vh=h(["pie","label","show"],!0),wh=h(["pie","label","format"]),xh=h(["pie","onclick"],function(){}),yh=h(["pie","onmouseover"],function(){}),zh=h(["pie","onmouseout"],function(){}),Ah=h(["donut","label","show"],!0),Bh=h(["donut","label","format"]),Ch=h(["donut","title"],""),Dh=h(["donut","onclick"],function(){}),Eh=h(["donut","onmouseover"],function(){}),Fh=h(["donut","onmouseout"],function(){}),Gh=h(["regions"],[]),Hh=h(["tooltip","show"],!0),Ih=h(["tooltip","format","title"]),Jh=h(["tooltip","format","value"]),Kh=h(["tooltip","contents"],function(a,b,c,d){var e,g,h,i,j,k=Ih?Ih:b,l=Jh?Jh:c;for(g=0;g"+(h||0===h?""+h+"":"")),j=a[g].name,i=l(a[g].value,a[g].ratio),e+="",e+=""+j+"",e+=""+i+"",e+="");return e+""}),Lh=h(["tooltip","init","show"],!1),Mh=h(["tooltip","init","x"],0),Nh=h(["tooltip","init","position"],{top:"0px",left:"50px"}),Oh=("string"==typeof gf?gf.replace("#",""):gf.id)+"-clip",Ph=Oh+"-xaxis",Qh=Oh+"-yaxis",Rh=i(Oh),Sh=i(Sh),Th=i(Th),Uh="timeseries"===Fg,Vh="categorized"===Fg,Wh=!Uh&&($f||ge(_f)),Xh=null,Yh=!1,Zh=!1,$h=!1,_h=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],ai=ae(lg,ge(zg)?zg:_h,kg),bi=function(){var a=[[df.time.format("%Y/%-m/%-d"),function(){return!0}],[df.time.format("%-m/%-d"),function(a){return a.getMonth()}],[df.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[df.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[df.time.format("%I %p"),function(a){return a.getHours()}],[df.time.format("%I:%M"),function(a){return a.getMinutes()}],[df.time.format(":%S"),function(a){return a.getSeconds()}],[df.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),ci=[],di=[],ei=Eg?"left":"bottom",fi=Eg?Wg?"top":"bottom":Wg?"right":"left",gi=Eg?dh?"bottom":"top":dh?"left":"right",hi=Eg?"left":"bottom",ii={main:function(){return"translate("+sf.left+","+sf.top+")"},context:function(){return"translate("+tf.left+","+tf.top+")"},legend:function(){return"translate("+uf.left+","+uf.top+")"},x:function(){return"translate(0,"+(Eg?0:xf)+")"},y:function(){return"translate(0,"+(Eg?xf:0)+")"},y2:function(){return"translate("+(Eg?0:vf)+","+(Eg?1:0)+")"},subx:function(){return"translate(0,"+(Eg?0:yf)+")"},arc:function(){return"translate("+vf/2+","+xf/2+")"}},ji="right"===Bg,ki=0,li=0,mi=0,ni=30,oi=30,pi=5;Hf=df.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var qi,ri=function(){var a=df.svg.line().x(Eg?function(a){return V(a.id)(a.value)}:nd).y(Eg?nd:function(a){return V(a.id)(a.value)});return function(b){var c,d,e=qe(b.values);return Sd(b)?(a.interpolate(Td(b)?"cardinal":"linear"),jg[b.id]?Ce(e,Qf,V(b.id),jg[b.id]):a(e)):(c=Qf(e[0].x),d=V(b.id)(e[0].value),Eg?"M "+d+" "+c:"M "+c+" "+d)}}(),si=function(){var a;return a=Eg?df.svg.area().x0(function(a){return V(a.id)(0)}).x1(function(a){return V(a.id)(a.value)}).y(nd):df.svg.area().x(nd).y0(function(a){return V(a.id)(0)}).y1(function(a){return V(a.id)(a.value)}),function(b){var c,d,e=qe(b.values);return Md([b],"area")||Md([b],"area-spline")?(a.interpolate(Td(b)?"cardinal":"linear"),a(e)):(c=Qf(e[0].x),d=V(b.id)(e[0].value),Eg?"M "+d+" "+c:"M "+c+" "+d)}}(),ti=function(){var a=df.svg.line().x(Eg?function(a){return W(a.id)(a.value)}:qd).y(Eg?qd:function(a){return W(a.id)(a.value)});return function(b){var c=qe(b.values);return Sd(b)?a(c):"M "+Tf(c[0].x)+" "+W(b.id)(c[0].value)}}(),ui=function(){};qi=df.svg.brush().on("brush",Le),qi.update=function(){return yi&&yi.select("."+f.brush).call(this),this},qi.scale=function(a){return Eg?this.y(a):this.x(a)},mf&&(ui=df.behavior.zoom().on("zoomstart",function(){ui.altDomain=df.event.sourceEvent.altKey?Qf.orgDomain():null}).on("zoom",mf?Me:null),ui.scale=function(a){return Eg?this.y(a):this.x(a)},ui.orgScaleExtent=function(){var a=nf?nf:[1,10];return[a[0],Math.max(tc()/a[1],a[1])]},ui.updateScaleExtent=function(){var a=$b(Qf.orgDomain())/$b(Ci),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var vi,wi,xi,yi,zi,Ai,Bi,Ci,Di,Ei={};if(ef.focus=function(a){function b(a){Bc(a).transition().duration(100).style("opacity",1)}var c=vi.selectAll(ad(a)),d=c.filter(_e),e=c.filter(af);ef.revert(),ef.defocus(),b(d.classed(f.focused,!0)),b(e),Rd(ef.data.targets)&&Kb(a,!0),Ve(a)},ef.defocus=function(a){function b(a){Bc(a).transition().duration(100).style("opacity",.3)}var c=vi.selectAll(ad(a)),d=c.filter(_e),e=c.filter(af);ef.revert(),b(d.classed(f.focused,!1)),b(e),Rd(ef.data.targets)&&Lb(a),We(a)},ef.revert=function(a){function b(a){Bc(a).transition().duration(100).style("opacity",1)}var c=vi.selectAll(ad(a)),d=c.filter(_e),e=c.filter(af);b(d.classed(f.focused,!1)),b(e),Rd(ef.data.targets)&&Lb(a),Xe()},ef.show=function(a,b){a=wc(a),b=b||{},Fc(a),vi.selectAll(bd(a)).transition().style("opacity",1),b.withLegend&&Ye(a),Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withTransitionForHorizontalAxis:!1})},ef.hide=function(a,b){a=wc(a),b=b||{},Ec(a),vi.selectAll(bd(a)).transition().style("opacity",0),b.withLegend&&Ze(a),Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withTransitionForHorizontalAxis:!1})},ef.toggle=function(a){zc(a)?ef.hide(a):ef.show(a)},ef.unzoom=function(){qi.clear().update(),Ke({withUpdateXDomain:!0})},ef.load=function(a){return a.xs&&ic(a.xs),"categories"in a&&Vh&&(Gg=a.categories,Wf.categories(Gg)),"cacheIds"in a&&_b(a.cacheIds)?void Re(bc(a.cacheIds),a.done):void("unload"in a?Te(wc("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){Se(a)}):Se(a))},ef.unload=function(a){Te(wc(a),function(){Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})})},ef.selected=function(a){return df.merge(xi.selectAll("."+f.shapes+_c(a)).selectAll("."+f.shape).filter(function(){return df.select(this).classed(f.SELECTED)}).map(function(a){return a.map(function(a){return a.__data__})}))},ef.select=function(a,b,c){mg&&xi.selectAll("."+f.shapes).selectAll("."+f.shape).each(function(e,g){var h=df.select(this),i="circle"===this.nodeName?ke:ne,j="circle"===this.nodeName?le:oe,k=ng||!a||a.indexOf(e.id)>=0,l=!b||b.indexOf(g)>=0,m=h.classed(f.SELECTED);k&&l?og(e)&&!m&&i(h.classed(f.SELECTED,!0),e,g):d(c)&&c&&m&&j(h.classed(f.SELECTED,!1),e,g)})},ef.unselect=function(a,b){mg&&xi.selectAll("."+f.shapes).selectAll("."+f.shape).each(function(c,d){var e=df.select(this),g="circle"===this.nodeName?le:oe,h=ng||!a||a.indexOf(c.id)>=0,i=!b||b.indexOf(d)>=0,j=e.classed(f.SELECTED);h&&i&&og(c)&&j&&g(e.classed(f.SELECTED,!1),c,d)})},ef.toLine=function(a){cf(a,"line")},ef.toSpline=function(a){cf(a,"spline")},ef.toBar=function(a){cf(a,"bar")},ef.toScatter=function(a){cf(a,"scatter")},ef.toArea=function(a){cf(a,"area")},ef.toAreaSpline=function(a){cf(a,"area-spline")},ef.toPie=function(a){cf(a,"pie",{withTransform:!0})},ef.toDonut=function(a){cf(a,"donut",{withTransform:!0})},ef.groups=function(a){return c(a)?dg:(dg=a,Ke(),dg)},ef.xgrids=function(a){return a?(jh=a,Ke(),jh):jh},ef.xgrids.add=function(a){return a?ef.xgrids(jh.concat(a)):void 0},ef.xgrids.remove=function(a){var b=bf(a);return ef.xgrids(jh.filter(b))},ef.ygrids=function(a){return a?(lh=a,Ke(),lh):lh},ef.ygrids.add=function(a){return a?ef.ygrids(lh.concat(a)):void 0},ef.ygrids.remove=function(a){var b=bf(a);return ef.ygrids(lh.filter(b))},ef.regions=function(a){return c(a)?Gh:(Gh=a,Ke(),Gh)},ef.regions.add=function(a){return c(a)?Gh:(Gh=Gh.concat(a),Ke(),Gh)},ef.regions.remove=function(a,c){var e=[].concat(a);return c=d(c)?c:{},e.forEach(function(a){var d=b(c.duration)?c.duration:0;vi.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),Gh=Gh.filter(function(b){return b.classes.indexOf(a)<0})}),Gh},ef.data.get=function(a){var b=ef.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},ef.data.getAsTarget=function(a){var b=yc(function(b){return b.id===a});return b.length>0?b[0]:void 0},ef.data.names=function(a){return arguments.length?(Object.keys(a).forEach(function(b){cg[b]=a[b]}),$e(vc(ef.data.targets),{withTransition:!0}),cg):cg},ef.x=function(a){return arguments.length&&(kc(ef.data.targets,a),Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),ef.data.x},ef.xs=function(a){return arguments.length&&(lc(ef.data.targets,a),Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),ef.data.x},ef.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){bb(b,a[b])}),Ab())},ef.axis.max=function(a){arguments.length&&("object"==typeof a?(b(a.y)&&(Sg=+a.y),b(a.y2)&&(_g=+a.y2)):Sg=_g=+a,Ke())},ef.axis.min=function(a){arguments.length&&("object"==typeof a?(b(a.y)&&(Tg=+a.y),b(a.y2)&&(ah=+a.y2)):Tg=ah=+a,Ke()) -},ef.axis.range=function(a){arguments.length&&("undefined"!=typeof a.max&&ef.axis.max(a.max),"undefined"!=typeof a.min&&ef.axis.min(a.min))},ef.legend.show=function(a){Ag||(Ag=!0,zi.style("visibility","visible")),Ye(wc(a)),Ke({withTransitionForHorizontalAxis:!1})},ef.legend.hide=function(a){Ag&&fe(a)&&(Ag=!1,zi.style("visibility","hidden")),Ze(wc(a)),Ke({withTransitionForHorizontalAxis:!1})},ef.resize=function(a){hf=a?a.width:null,jf=a?a.height:null,Pe({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},ef.destroy=function(){ef.data.targets=void 0,ef.data.x={},Bi.html(""),a.onresize=null},"url"in e.data)df.csv(e.data.url,function(a,b){De(b)});else if("rows"in e.data)De(nc(e.data.rows));else{if(!("columns"in e.data))throw Error("url or rows or columns is required.");De(oc(e.data.columns))}return ef},"function"==typeof a.define&&a.define.amd?a.define("c3",["d3"],e):a.c3=e}(window); \ No newline at end of file +}Ai.html(Kh(ef.data.targets.map(function(a){return jc(a.values[Mh])}),$(),kd,ai)),Ai.style("top",Nh.top).style("left",Nh.left).style("display","block")}null==a.onresize&&(a.onresize=Ne()),a.onresize.add&&a.onresize.add(function(){Pe({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})})}function Ee(a){a.append("rect").attr("class",$c).style("cursor",mg&&ng?"pointer":null).on("mouseover",function(a,b){if(!Yh&&!Rd(ef.data.targets)){var c,d,e=ef.data.targets.map(function(a){return jc(a.values[b])});if(Object.keys(cg).length>0){d=[];for(var g in cg)for(c=0;cg&&h>c&&d>i&&j>d):"path"===this.nodeName&&(m=wd(this),c=m.x,d=m.y,e=m.width,k=m.height,l=pe,q=!(c>h||g>c+e||d>j||i>d+k)),q^p&&(n.classed(f.INCLUDED,!p),n.classed(f.SELECTED,!o),l(!o,n,a,b))}))}function Ie(a){Rd(ef.data.targets)||mg&&(Xh=a,xi.select("."+f.chart).append("rect").attr("class",f.dragarea).style("opacity",.1),Yh=!0,vg())}function Je(){Rd(ef.data.targets)||mg&&(xi.select("."+f.dragarea).transition().duration(100).style("opacity",0).remove(),xi.selectAll("."+f.shape).classed(f.INCLUDED,!1),Yh=!1,wg())}function Ke(a){var c,e,g,h,i,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,M,N,O,P,Q,R,S=Gd(),T=Rd(ef.data.targets),U=Bc(ef.data.targets);if(0!==U.length){if(a=d(a)?a:{},x=d(a.withY)?a.withY:!0,y=d(a.withSubchart)?a.withSubchart:!0,z=d(a.withTransition)?a.withTransition:!0,D=d(a.withTransform)?a.withTransform:!1,E=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,F=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,G=d(a.withLegend)?a.withLegend:!1,A=d(a.withTransitionForExit)?a.withTransitionForExit:z,B=d(a.withTransitionForAxis)?a.withTransitionForAxis:z,C=d(a.withTransitionForHorizontalAxis)?a.withTransitionForHorizontalAxis:z,M=z?rf:0,N=A?M:0,O=B?M:0,G&&Ag&&$e(vc(ef.data.targets),a),F&&(Qf.domain(df.extent(Zb(U))),Ci=Qf.domain(),mf&&ui.scale(Qf).updateScaleExtent(),Tf.domain(Qf.domain()),qi.scale(Tf)),E&&(Qf.domain(qi.empty()?Ci:qi.extent()),mf&&ui.scale(Qf).updateScaleExtent()),Rf.domain(Ub(U,"y")),Sf.domain(Ub(U,"y2")),Od(U)||(P=Dc(Cc(U)).sort(),Wf.tickValues(P),Zf.tickValues(P)),c=xi.select("."+f.axisX).style("opacity",T?0:1),(Eg||C)&&(c=c.transition().duration(O)),c.call(Wf),e=xi.select("."+f.axisY).style("opacity",T?0:1),(!Eg||C)&&(e=e.transition().duration(O)),e.call(Xf),xi.select("."+f.axisY2).style("opacity",T?0:1).transition().duration(O).call(Yf),E&&Jg&&P){for(Q=1;Q=Y;Y++)h.push(new Date(Y+"-01-01 00:00:00"))}else h=Qf.ticks(10);g=xi.select("."+f.xgrids).selectAll("."+f.xgrid).data(h),g.enter().append("line").attr("class",f.xgrid),g.attr("x1",Eg?0:function(a){return Qf(a)-Wf.tickOffset()}).attr("x2",Eg?vf:function(a){return Qf(a)-Wf.tickOffset()}).attr("y1",Eg?function(a){return Qf(a)-Wf.tickOffset()}:sf.top).attr("y2",Eg?function(a){return Qf(a)-Wf.tickOffset()}:xf).style("opacity",function(){return+df.select(this).attr(Eg?"y1":"x1")===(Eg?xf:0)?0:1}),g.exit().remove()}ge(jh)&&(i=xi.select("."+f.xgridLines).selectAll("."+f.xgridLine).data(jh),j=i.enter().append("g").attr("class",function(a){return f.xgridLine+(a.class?a.class:"")}),j.append("line").style("opacity",0),j.append("text").attr("text-anchor","end").attr("transform",Eg?"":"rotate(-90)").attr("dx",Eg?0:-sf.top).attr("dy",-5).style("opacity",0),i.select("line").transition().duration(M).attr("x1",Eg?0:od).attr("x2",Eg?vf:od).attr("y1",Eg?od:sf.top).attr("y2",Eg?od:xf).style("opacity",1),i.select("text").transition().duration(M).attr("x",Eg?vf:0).attr("y",od).text(function(a){return a.text}).style("opacity",1),i.exit().transition().duration(M).style("opacity",0).remove()),x&&kh&&(k=xi.select("."+f.ygrids).selectAll("."+f.ygrid).data(Rf.ticks(mh)),k.enter().append("line").attr("class",f.ygrid),k.attr("x1",Eg?Rf:0).attr("x2",Eg?Rf:vf).attr("y1",Eg?0:Rf).attr("y2",Eg?xf:Rf),k.exit().remove()),x&&ge(lh)&&(l=xi.select("."+f.ygridLines).selectAll("."+f.ygridLine).data(lh),m=l.enter().append("g").attr("class",function(a){return f.ygridLine+(a.class?a.class:"")}),m.append("line").style("opacity",0),m.append("text").attr("text-anchor","end").attr("transform",Eg?"rotate(-90)":"").attr("dx",Eg?0:-sf.top).attr("dy",-5).style("opacity",0),l.select("line").transition().duration(M).attr("x1",Eg?pd:0).attr("x2",Eg?pd:vf).attr("y1",Eg?0:pd).attr("y2",Eg?xf:pd).style("opacity",1),l.select("text").transition().duration(M).attr("x",Eg?0:vf).attr("y",pd).text(function(a){return a.text}).style("opacity",1),l.exit().transition().duration(M).style("opacity",0).remove()),p=xi.selectAll("."+f.bars).selectAll("."+f.bar).data(Zd),p.enter().append("path").attr("d",H).style("stroke","none").style("opacity",0).style("fill",function(a){return ai(a)}).attr("class",Vc),p.style("opacity",ed).transition().duration(M).attr("d",H).style("opacity",1),p.exit().transition().duration(N).style("opacity",0).remove(),r=xi.selectAll("."+f.texts).selectAll("."+f.text).data(_d),r.enter().append("text").attr("class",Oc).attr("text-anchor",function(a){return Eg?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0),r.text(function(a){return md(a.id)(a.value)}).style("fill-opacity",fd).transition().duration(M).attr("x",J).attr("y",K).style("fill-opacity",hd),r.exit().transition().duration(N).style("fill-opacity",0).remove(),xi.selectAll("."+f.line).style("opacity",ed).transition().duration(M).attr("d",ri).style("opacity",1),xi.selectAll("."+f.area).style("opacity",0).transition().duration(M).attr("d",si).style("opacity",Di),n=xi.selectAll("."+f.circles).selectAll("."+f.circle).data($d),n.enter().append("circle").attr("class",Tc).style("opacity",0).attr("r",oh),n.style("opacity",ed).transition().duration(M).style("opacity",gd).attr("cx",Eg?Fd:Ed).attr("cy",Eg?Ed:Fd),n.exit().remove(),xi.selectAll("."+f.chartArc).select("."+f.arc).attr("transform",D?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(M).attrTween("d",function(a){var b,c=Cb(a);return c?(b=df.interpolate(this._current,c),this._current=b(0),function(a){return Fb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",D?"scale(1)":"").style("opacity",1),xi.selectAll("."+f.chartArc).select("text").attr("transform",Gb).style("opacity",0).transition().duration(M).text(Jb).style("opacity",function(a){return zc(a.data.id)&&Yd(a.data)?1:0}),xi.select("."+f.chartArcsTitle).style("opacity",Qd(ef.data.targets)?1:0),xg&&(null!==df.event&&"zoom"===df.event.type&&qi.extent(Qf.orgDomain()).update(),y&&(yi.select("."+f.axisX).style("opacity",T?0:1).transition().duration(M).call(Zf),qi.empty()||qi.extent(Qf.orgDomain()).update(),I=xe(S,!0),s=yi.selectAll("."+f.bars).selectAll("."+f.bar).data(Zd),s.enter().append("path").attr("d",I).style("stroke","none").style("fill",function(a){return ai(a)}).attr("class",Vc),s.style("opacity",ed).transition().duration(M).attr("d",I).style("opacity",1),s.exit().transition().duration(M).style("opacity",0).remove(),yi.selectAll("."+f.line).style("opacity",ed).transition().duration(M).attr("d",ti).style("opacity",1))),xi.selectAll("."+f.selectedCircles).filter(function(a){return Ud(a)}).selectAll("circle").remove(),xi.selectAll("."+f.selectedCircle).transition().duration(M).attr("cx",Eg?Fd:Ed).attr("cy",Eg?Ed:Fd),ge(_f)?(t=xi.select("."+f.eventRects).selectAll("."+f.eventRect).data([0]),Fe(t.enter()),t.attr("x",0).attr("y",0).attr("width",vf).attr("height",xf)):(Wh&&!Vh?(w=function(a,b){var c=rc(b),d=sc(b),e=ef.data.x[a.id][b];return(Qf(d?d:e+50)-Qf(c?c:e-50))/2},v=function(a,b){var c=rc(b),d=ef.data.x[a.id][b];return(Qf(d)+Qf(c?c:d-50))/2}):(w=L(),v=function(a){return Qf(a.x)-w/2}),u=uc(),xi.select("."+f.eventRects).datum(u?u.values:[]),t=xi.select("."+f.eventRects).selectAll("."+f.eventRect).data(function(a){return a}),Ee(t.enter()),t.attr("class",$c).attr("x",Eg?0:v).attr("y",Eg?v:0).attr("width",Eg?vf:w).attr("height",Eg?w:xf),t.exit().remove()),q=xi.select("."+f.regions).selectAll("rect."+f.region).data(Gh),q.enter().append("rect").style("fill-opacity",0),q.attr("class",Zc).attr("x",Eg?0:cc).attr("y",Eg?cc:sf.top).attr("width",Eg?vf:dc).attr("height",Eg?dc:xf).transition().duration(M).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1}),q.exit().transition().duration(M).style("fill-opacity",0).remove(),vc(ef.data.targets).forEach(function(a){Ei[a]=!0})}}function Le(){Ke({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function Me(){return"mousemove"===df.event.sourceEvent.type&&ui.altDomain?(Qf.domain(ui.altDomain),void ui.scale(Qf).updateScaleExtent()):(Vh&&Qf.orgDomain()[0]===Ci[0]&&Qf.domain([Ci[0]-1e-10,Qf.orgDomain()[1]]),Ke({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===df.event.sourceEvent.type&&(Zh=!0)))}function Ne(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function Oe(){vi.attr("width",zf).attr("height",Af),vi.select("#"+Oh).select("rect").attr("width",vf).attr("height",xf),vi.select("#"+Ph).select("rect").attr("width",H),vi.select("#"+Qh).select("rect").attr("width",J),vi.select("."+f.zoomRect).attr("width",vf).attr("height",xf)}function Pe(a){a=a||{},a.withTransition=d(a.withTransition)?a.withTransition:!0,a.withTransform=d(a.withTransform)?a.withTransform:!1,a.withLegend=d(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,n(),R(),Oe(),m(a.withTransition),Ke(a)}function Qe(a){var b,c,d,e,g,h,i,j,k,l,m,n;i=xi.select("."+f.chartTexts).selectAll("."+f.chartText).data(a),j=i.enter().append("g").attr("class",function(a){return f.chartText+Nc(f.target,a.id)}).style("pointer-events","none"),j.append("g").attr("class",Pc).style("fill",function(a){return ai(a)}),e=xi.select("."+f.chartBars).selectAll("."+f.chartBar).data(a),d=e.enter().append("g").attr("class",function(a){return f.chartBar+Nc(f.target,a.id)}).style("pointer-events","none"),d.append("g").attr("class",Wc).style("fill",function(a){return ai(a)}).style("stroke","none").style("cursor",function(a){return og(a)?"pointer":null}),c=xi.select("."+f.chartLines).selectAll("."+f.chartLine).data(a),b=c.enter().append("g").attr("class",function(a){return f.chartLine+Nc(f.target,a.id)}).style("pointer-events","none"),b.append("path").attr("class",Sc).style("opacity",0).style("stroke",function(a){return ai(a)}),b.append("path").attr("class",Yc).style("opacity",function(){return Di=+df.select(this).style("opacity"),0}).style("fill",function(a){return ai(a)}),b.append("g").attr("class",function(a){return Nc(f.selectedCircles,a.id)}),b.append("g").attr("class",Uc).style("fill",function(a){return ai(a)}).style("cursor",function(a){return og(a)?"pointer":null}),a.forEach(function(a){xi.selectAll("."+f.selectedCircles+_c(a.id)).selectAll("."+f.selectedCircle).each(function(b,c){b.value=a.values[c].value})}),h=xi.select("."+f.chartArcs).selectAll("."+f.chartArc).data(Hf(a)),g=h.enter().append("g").attr("class",function(a){return f.chartArc+Nc(f.target,a.data.id)}),g.append("path").attr("class",Xc).style("opacity",0).style("fill",function(a){return ai(a.data)}).style("cursor",function(a){return og(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a,b){var c=Cb(a),d=Ib(c),e=Qb();Kb(c.data.id),Ve(c.data.id),e(d,b)}).on("mousemove",function(a){var b=Cb(a),c=[Ib(b)];Ad(c,df.mouse(this))}).on("mouseout",function(a,b){var c=Cb(a),d=Ib(c),e=Rb();Lb(c.data.id),Xe(),Bd(),e(d,b)}).on("click",function(a,b){var c=Cb(a),d=Ib(c),e=Pb();e(d,b)}),g.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),xg&&(n=yi.select("."+f.chartBars).selectAll("."+f.chartBar).data(a),m=n.enter().append("g").attr("class",function(a){return f.chartBar+Nc(f.target,a.id)}),m.append("g").attr("class",Wc).style("fill",function(a){return ai(a)}),l=yi.select("."+f.chartLines).selectAll("."+f.chartLine).data(a),k=l.enter().append("g").attr("class",function(a){return f.chartLine+Nc(f.target,a.id)}),k.append("path").attr("class",Sc).style("opacity",0).style("stroke",function(a){return ai(a)})),vi.selectAll("."+f.target).filter(function(a){return zc(a.id)}).transition().style("opacity",1)}function Re(a,b){(b.type||b.types)&&a.forEach(function(a){b.types?Ld(a.id,b.types[a.id]):Ld(a.id,b.type)}),ef.data.targets.forEach(function(b){for(var c=0;cf&&(f=(l-k)/2,w=0,C++)),B[a]=C,A[C]=f,x[a]=w,w+=k}var f,g,h=b.getBBox(),i=10*Math.ceil((h.width+s)/10),j=10*Math.ceil((h.height+r)/10),k=ji?j:i,l=ji?Q():P();return d&&(w=0,C=0,t=0,u=0),Ag&&!Ac(c)?void(y[c]=z[c]=B[c]=x[c]=0):(y[c]=i,z[c]=j,(!t||i>=t)&&(t=i),(!u||j>=u)&&(u=j),g=ji?u:t,void(Dg?(Object.keys(y).forEach(function(a){y[a]=t}),Object.keys(z).forEach(function(a){z[a]=u}),f=(l-g*a.length)/2,v>f?(w=0,C=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}var e,g,h,i,j,k,l,o,p,q,r=4,s=26,t=0,u=0,v=10,w=0,x={},y={},z={},A=[0],B={},C=0;b=b||{},o=d(b.withTransition)?b.withTransition:!0,p=d(b.withTransitionForTransform)?b.withTransitionForTransform:!0,q=d(b.withTransformAll)?b.withTransformAll:!0,ji?(e=function(a){return t*(.2+B[a])},i=function(a){return A[B[a]]+x[a]}):(e=function(a){return A[B[a]]+x[a]},i=function(a){return u*(.2+B[a])}),g=function(a,b){return e(a,b)+14},j=function(a,b){return i(a,b)+9},h=function(a,b){return e(a,b)-4},k=function(a,b){return i(a,b)-7},l=zi.selectAll("."+f.legendItem).data(a).enter().append("g").attr("class",function(a){return Nc(f.legendItem,a)}).style("visibility",function(a){return Ac(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeof Cg?Cg(a):ef.toggle(a)}).on("mouseover",function(a){ef.focus(a)}).on("mouseout",function(){ef.revert()}),l.append("text").text(function(a){return d(cg[a])?cg[a]:a}).each(function(a,b){c(this,a,0===b)}).style("pointer-events","none").attr("x",ji?g:-200).attr("y",ji?-200:j),l.append("rect").attr("class",f.legendItemEvent).style("fill-opacity",0).attr("x",ji?h:-200).attr("y",ji?-200:k).attr("width",function(a){return y[a]}).attr("height",function(a){return z[a]}),l.append("rect").attr("class",f.legendItemTile).style("pointer-events","none").style("fill",function(a){return ai(a)}).attr("x",ji?g:-200).attr("y",ji?-200:i).attr("width",10).attr("height",10),zi.selectAll("text").data(a).text(function(a){return d(cg[a])?cg[a]:a}).each(function(a,b){c(this,a,0===b)}).transition().duration(o?250:0).attr("x",g).attr("y",j),zi.selectAll("rect."+f.legendItemEvent).data(a).transition().duration(o?250:0).attr("x",h).attr("y",k),zi.selectAll("rect."+f.legendItemTile).data(a).transition().duration(o?250:0).attr("x",e).attr("y",i),N(t),O(u),M(C),n(),R(),Oe(),q&&m(p)}function _e(a){return xc(ef.data.targets,a.id)}function af(a){return"data"in a&&xc(ef.data.targets,a.data.id)}function bf(a){var b=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;return b?function(a){return a.value!==b}:c?function(a){return a["class"]!==c}:function(){return!0}}function cf(a,b,c){var d=!Rd(ef.data.targets);Ld(a,b),Pe(c?c:{withTransitionForAxis:d})}var df=a.d3?a.d3:a.require?a.require("d3"):void 0,ef={data:{},axis:{},legend:{}},ff={},gf=h(["bindto"],"#chart"),hf=h(["size","width"]),jf=h(["size","height"]),kf=h(["padding","left"]),lf=h(["padding","right"]),mf=h(["zoom","enabled"],!1),nf=h(["zoom","extent"]),of=h(["zoom","privileged"],!1),pf=h(["onenter"],function(){}),qf=h(["onleave"],function(){}),rf=h(["transition","duration"],350);g("data","data is required in config");var sf,tf,uf,vf,wf,xf,yf,zf,Af,Bf,Cf,Df,Ef,Ff,Gf,Hf,If,Jf,Kf,Lf,Mf,Nf,Of,Pf,Qf,Rf,Sf,Tf,Uf,Vf,Wf,Xf,Yf,Zf,$f=h(["data","x"]),_f=h(["data","xs"],{}),ag=h(["data","x_format"]),bg=h(["data","id_converter"],function(a){return a}),cg=h(["data","names"],{}),dg=h(["data","groups"],[]),eg=h(["data","axes"],{}),fg=h(["data","type"]),gg=h(["data","types"],{}),hg=h(["data","labels"],{}),ig=h(["data","order"]),jg=h(["data","regions"],{}),kg=h(["data","color"]),lg=h(["data","colors"],{}),mg=h(["data","selection","enabled"],!1),ng=h(["data","selection","grouped"],!1),og=h(["data","selection","isselectable"],function(){return!0}),pg=h(["data","selection","multiple"],!0),qg=h(["data","onclick"],function(){}),rg=h(["data","onenter"],function(){}),sg=h(["data","onleave"],function(){}),tg=h(["data","onselected"],function(){}),ug=h(["data","onunselected"],function(){}),vg=h(["data","ondragstart"],function(){}),wg=h(["data","ondragend"],function(){}),xg=h(["subchart","show"],!1),yg=xg?h(["subchart","size","height"],60):0,zg=h(["color","pattern"],[]),Ag=h(["legend","show"],!0),Bg=h(["legend","position"],"bottom"),Cg=h(["legend","item","onclick"]),Dg=h(["legend","equally"],!1),Eg=h(["axis","rotated"],!1),Fg=h(["axis","x","type"],"indexed"),Gg=h(["axis","x","categories"],[]),Hg=h(["axis","x","tick","centered"],!1),Ig=h(["axis","x","tick","format"]),Jg=h(["axis","x","tick","culling"],{}),Kg=h(["axis","x","tick","culling","max"],"categorized"===Fg?1/0:10),Lg=h(["axis","x","tick","count"]),Mg=h(["axis","x","tick","fit"],!1),Ng=h(["axis","x","max"]),Og=h(["axis","x","min"]),Pg=h(["axis","x","default"]),Qg=h(["axis","x","label"],{}),Rg=h(["axis","y","show"],!0),Sg=h(["axis","y","max"]),Tg=h(["axis","y","min"]),Ug=h(["axis","y","center"]),Vg=h(["axis","y","label"],{}),Wg=h(["axis","y","inner"],!1),Xg=h(["axis","y","tick","format"]),Yg=h(["axis","y","padding"],{}),Zg=h(["axis","y","ticks"],10),$g=h(["axis","y2","show"],!1),_g=h(["axis","y2","max"]),ah=h(["axis","y2","min"]),bh=h(["axis","y2","center"]),ch=h(["axis","y2","label"],{}),dh=h(["axis","y2","inner"],!1),eh=h(["axis","y2","tick","format"]),fh=h(["axis","y2","padding"],{}),gh=h(["axis","y2","ticks"],10),hh=h(["grid","x","show"],!1),ih=h(["grid","x","type"],"tick"),jh=h(["grid","x","lines"],[]),kh=h(["grid","y","show"],!1),lh=h(["grid","y","lines"],[]),mh=h(["grid","y","ticks"],10),nh=h(["point","show"],!0),oh=nh?h(["point","r"],2.5):0,ph=h(["point","focus","line","enabled"],!0),qh=h(["point","focus","expand","enabled"],!0),rh=h(["point","focus","expand","r"],qh?4:oh),sh=h(["point","focus","select","r"],8),th=h(["bar","width"]),uh=h(["bar","width","ratio"],.6),vh=h(["pie","label","show"],!0),wh=h(["pie","label","format"]),xh=h(["pie","onclick"],function(){}),yh=h(["pie","onmouseover"],function(){}),zh=h(["pie","onmouseout"],function(){}),Ah=h(["donut","label","show"],!0),Bh=h(["donut","label","format"]),Ch=h(["donut","title"],""),Dh=h(["donut","onclick"],function(){}),Eh=h(["donut","onmouseover"],function(){}),Fh=h(["donut","onmouseout"],function(){}),Gh=h(["regions"],[]),Hh=h(["tooltip","show"],!0),Ih=h(["tooltip","format","title"]),Jh=h(["tooltip","format","value"]),Kh=h(["tooltip","contents"],function(a,b,c,d){var e,g,h,i,j,k=Ih?Ih:b,l=Jh?Jh:c;for(g=0;g"+(h||0===h?""+h+"":"")),j=a[g].name,i=l(a[g].value,a[g].ratio),e+="",e+=""+j+"",e+=""+i+"",e+="");return e+""}),Lh=h(["tooltip","init","show"],!1),Mh=h(["tooltip","init","x"],0),Nh=h(["tooltip","init","position"],{top:"0px",left:"50px"}),Oh=("string"==typeof gf?gf.replace("#",""):gf.id)+"-clip",Ph=Oh+"-xaxis",Qh=Oh+"-yaxis",Rh=i(Oh),Sh=i(Sh),Th=i(Th),Uh="timeseries"===Fg,Vh="categorized"===Fg,Wh=!Uh&&($f||ge(_f)),Xh=null,Yh=!1,Zh=!1,$h=!1,_h=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],ai=ae(lg,ge(zg)?zg:_h,kg),bi=function(){var a=[[df.time.format("%Y/%-m/%-d"),function(){return!0}],[df.time.format("%-m/%-d"),function(a){return a.getMonth()}],[df.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[df.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[df.time.format("%I %p"),function(a){return a.getHours()}],[df.time.format("%I:%M"),function(a){return a.getMinutes()}],[df.time.format(":%S"),function(a){return a.getSeconds()}],[df.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),ci=[],di=[],ei=Eg?"left":"bottom",fi=Eg?Wg?"top":"bottom":Wg?"right":"left",gi=Eg?dh?"bottom":"top":dh?"left":"right",hi=Eg?"left":"bottom",ii={main:function(){return"translate("+sf.left+","+sf.top+")"},context:function(){return"translate("+tf.left+","+tf.top+")"},legend:function(){return"translate("+uf.left+","+uf.top+")"},x:function(){return"translate(0,"+(Eg?0:xf)+")"},y:function(){return"translate(0,"+(Eg?xf:0)+")"},y2:function(){return"translate("+(Eg?0:vf)+","+(Eg?1:0)+")"},subx:function(){return"translate(0,"+(Eg?0:yf)+")"},arc:function(){return"translate("+vf/2+","+xf/2+")"}},ji="right"===Bg,ki=0,li=0,mi=0,ni=30,oi=30,pi=5;Hf=df.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var qi,ri=function(){var a=df.svg.line().x(Eg?function(a){return V(a.id)(a.value)}:nd).y(Eg?nd:function(a){return V(a.id)(a.value)});return function(b){var c,d,e=qe(b.values);return Sd(b)?(a.interpolate(Td(b)?"cardinal":"linear"),jg[b.id]?Ce(e,Qf,V(b.id),jg[b.id]):a(e)):(c=Qf(e[0].x),d=V(b.id)(e[0].value),Eg?"M "+d+" "+c:"M "+c+" "+d)}}(),si=function(){var a;return a=Eg?df.svg.area().x0(function(a){return V(a.id)(0)}).x1(function(a){return V(a.id)(a.value)}).y(nd):df.svg.area().x(nd).y0(function(a){return V(a.id)(0)}).y1(function(a){return V(a.id)(a.value)}),function(b){var c,d,e=qe(b.values);return Md([b],"area")||Md([b],"area-spline")?(a.interpolate(Td(b)?"cardinal":"linear"),a(e)):(c=Qf(e[0].x),d=V(b.id)(e[0].value),Eg?"M "+d+" "+c:"M "+c+" "+d)}}(),ti=function(){var a=df.svg.line().x(Eg?function(a){return W(a.id)(a.value)}:qd).y(Eg?qd:function(a){return W(a.id)(a.value)});return function(b){var c=qe(b.values);return Sd(b)?a(c):"M "+Tf(c[0].x)+" "+W(b.id)(c[0].value)}}(),ui=function(){};qi=df.svg.brush().on("brush",Le),qi.update=function(){return yi&&yi.select("."+f.brush).call(this),this},qi.scale=function(a){return Eg?this.y(a):this.x(a)},mf&&(ui=df.behavior.zoom().on("zoomstart",function(){ui.altDomain=df.event.sourceEvent.altKey?Qf.orgDomain():null}).on("zoom",mf?Me:null),ui.scale=function(a){return Eg?this.y(a):this.x(a)},ui.orgScaleExtent=function(){var a=nf?nf:[1,10];return[a[0],Math.max(tc()/a[1],a[1])]},ui.updateScaleExtent=function(){var a=$b(Qf.orgDomain())/$b(Ci),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var vi,wi,xi,yi,zi,Ai,Bi,Ci,Di,Ei={};if(ef.focus=function(a){function b(a){Bc(a).transition().duration(100).style("opacity",1)}var c=vi.selectAll(ad(a)),d=c.filter(_e),e=c.filter(af);ef.revert(),ef.defocus(),b(d.classed(f.focused,!0)),b(e),Rd(ef.data.targets)&&Kb(a,!0),Ve(a)},ef.defocus=function(a){function b(a){Bc(a).transition().duration(100).style("opacity",.3)}var c=vi.selectAll(ad(a)),d=c.filter(_e),e=c.filter(af);ef.revert(),b(d.classed(f.focused,!1)),b(e),Rd(ef.data.targets)&&Lb(a),We(a)},ef.revert=function(a){function b(a){Bc(a).transition().duration(100).style("opacity",1)}var c=vi.selectAll(ad(a)),d=c.filter(_e),e=c.filter(af);b(d.classed(f.focused,!1)),b(e),Rd(ef.data.targets)&&Lb(a),Xe()},ef.show=function(a,b){a=wc(a),b=b||{},Fc(a),vi.selectAll(bd(a)).transition().style("opacity",1),b.withLegend&&Ye(a),Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withTransitionForHorizontalAxis:!1})},ef.hide=function(a,b){a=wc(a),b=b||{},Ec(a),vi.selectAll(bd(a)).transition().style("opacity",0),b.withLegend&&Ze(a),Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withTransitionForHorizontalAxis:!1})},ef.toggle=function(a){zc(a)?ef.hide(a):ef.show(a)},ef.unzoom=function(){qi.clear().update(),Ke({withUpdateXDomain:!0})},ef.load=function(a){return a.xs&&ic(a.xs),"categories"in a&&Vh&&(Gg=a.categories,Wf.categories(Gg)),"cacheIds"in a&&_b(a.cacheIds)?void Re(bc(a.cacheIds),a.done):void("unload"in a?Te(wc("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){Se(a)}):Se(a))},ef.unload=function(a){Te(wc(a),function(){Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})})},ef.selected=function(a){return df.merge(xi.selectAll("."+f.shapes+_c(a)).selectAll("."+f.shape).filter(function(){return df.select(this).classed(f.SELECTED)}).map(function(a){return a.map(function(a){return a.__data__})}))},ef.select=function(a,b,c){mg&&xi.selectAll("."+f.shapes).selectAll("."+f.shape).each(function(e,g){var h=df.select(this),i="circle"===this.nodeName?ke:ne,j="circle"===this.nodeName?le:oe,k=ng||!a||a.indexOf(e.id)>=0,l=!b||b.indexOf(g)>=0,m=h.classed(f.SELECTED);k&&l?og(e)&&!m&&i(h.classed(f.SELECTED,!0),e,g):d(c)&&c&&m&&j(h.classed(f.SELECTED,!1),e,g)})},ef.unselect=function(a,b){mg&&xi.selectAll("."+f.shapes).selectAll("."+f.shape).each(function(c,d){var e=df.select(this),g="circle"===this.nodeName?le:oe,h=ng||!a||a.indexOf(c.id)>=0,i=!b||b.indexOf(d)>=0,j=e.classed(f.SELECTED);h&&i&&og(c)&&j&&g(e.classed(f.SELECTED,!1),c,d)})},ef.toLine=function(a){cf(a,"line")},ef.toSpline=function(a){cf(a,"spline")},ef.toBar=function(a){cf(a,"bar")},ef.toScatter=function(a){cf(a,"scatter")},ef.toArea=function(a){cf(a,"area")},ef.toAreaSpline=function(a){cf(a,"area-spline")},ef.toPie=function(a){cf(a,"pie",{withTransform:!0})},ef.toDonut=function(a){cf(a,"donut",{withTransform:!0})},ef.groups=function(a){return c(a)?dg:(dg=a,Ke(),dg)},ef.xgrids=function(a){return a?(jh=a,Ke(),jh):jh},ef.xgrids.add=function(a){return a?ef.xgrids(jh.concat(a)):void 0},ef.xgrids.remove=function(a){var b=bf(a);return ef.xgrids(jh.filter(b))},ef.ygrids=function(a){return a?(lh=a,Ke(),lh):lh},ef.ygrids.add=function(a){return a?ef.ygrids(lh.concat(a)):void 0},ef.ygrids.remove=function(a){var b=bf(a);return ef.ygrids(lh.filter(b))},ef.regions=function(a){return c(a)?Gh:(Gh=a,Ke(),Gh)},ef.regions.add=function(a){return c(a)?Gh:(Gh=Gh.concat(a),Ke(),Gh)},ef.regions.remove=function(a,c){var e=[].concat(a);return c=d(c)?c:{},e.forEach(function(a){var d=b(c.duration)?c.duration:0;vi.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),Gh=Gh.filter(function(b){return b.classes.indexOf(a)<0})}),Gh},ef.data.get=function(a){var b=ef.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},ef.data.getAsTarget=function(a){var b=yc(function(b){return b.id===a});return b.length>0?b[0]:void 0},ef.data.names=function(a){return arguments.length?(Object.keys(a).forEach(function(b){cg[b]=a[b]}),$e(vc(ef.data.targets),{withTransition:!0}),cg):cg},ef.x=function(a){return arguments.length&&(kc(ef.data.targets,a),Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),ef.data.x},ef.xs=function(a){return arguments.length&&(lc(ef.data.targets,a),Ke({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),ef.data.x},ef.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){bb(b,a[b])}),Ab())},ef.axis.max=function(a){arguments.length&&("object"==typeof a?(b(a.y)&&(Sg=+a.y),b(a.y2)&&(_g=+a.y2)):Sg=_g=+a,Ke()) +},ef.axis.min=function(a){arguments.length&&("object"==typeof a?(b(a.y)&&(Tg=+a.y),b(a.y2)&&(ah=+a.y2)):Tg=ah=+a,Ke())},ef.axis.range=function(a){arguments.length&&("undefined"!=typeof a.max&&ef.axis.max(a.max),"undefined"!=typeof a.min&&ef.axis.min(a.min))},ef.legend.show=function(a){Ag||(Ag=!0,zi.style("visibility","visible")),Ye(wc(a)),Ke({withTransitionForHorizontalAxis:!1})},ef.legend.hide=function(a){Ag&&fe(a)&&(Ag=!1,zi.style("visibility","hidden")),Ze(wc(a)),Ke({withTransitionForHorizontalAxis:!1})},ef.resize=function(a){hf=a?a.width:null,jf=a?a.height:null,Pe({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},ef.destroy=function(){ef.data.targets=void 0,ef.data.x={},Bi.html(""),a.onresize=null},"url"in e.data)df.csv(e.data.url,function(a,b){De(b)});else if("rows"in e.data)De(nc(e.data.rows));else{if(!("columns"in e.data))throw Error("url or rows or columns is required.");De(oc(e.data.columns))}return ef},"function"==typeof a.define&&a.define.amd?a.define("c3",["d3"],e):a.c3=e}(window); \ No newline at end of file