diff --git a/c3.js b/c3.js index 0760c33..d3d9363 100644 --- a/c3.js +++ b/c3.js @@ -5074,7 +5074,7 @@ /*-- Load data and init chart with defined functions --*/ function initWithUrl(args) { - var type = args.mineType ? args.mineType : 'csv'; + var type = args.mimeType ? args.mimeType : 'csv'; d3.xhr(config.data.url, function (error, data) { var d; if (type === 'json') { diff --git a/c3.min.js b/c3.min.js index 698818b..782fe0e 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}function e(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+s)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,k);for(c=a.domain(),b=Math.ceil(c[0]);b0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=m.copy();return b&&(a=m.domain(),c.domain([a[0],a[1]-1])),c}function h(a){return j?j(a):a}function i(i){i.each(function(){function i(a){var b=m(a)+s;return B[0]=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"}function k(a){return Math.ceil(a)+.5}function l(a,b){var c,d,e;b&&b.axisX?c=b.axisX:(c=kk.select("."+g.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=kk.select("."+g.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=kk.select("."+g.axisY2),a&&(e=e.transition())),kk.attr("transform",Zj.main),c.attr("transform",Zj.x),d.attr("transform",Zj.y),e.attr("transform",Zj.y2),kk.select("."+g.chartArcs).attr("transform",Zj.arc)}function m(a,b){var c;b&&b.axisSubX?c=b.axisSubX:(c=lk.select("."+g.axisX),a&&(c=c.transition())),lk.attr("transform",Zj.context),c.attr("transform",Zj.subx)}function n(a){(a?mk.transition():mk).attr("transform",Zj.legend)}function o(a,b){l(a,b),Mh&&m(a,b),n(a)}function p(){var a=V(),b=U(),c=$j?0:a,d=we(kg.data.targets),e=Wh||d?0:A("x"),f=Mh&&!d?Nh+e:0;Jg=t(),Kg=u(),Wh?(Cg={top:A("y2")+v(),right:d?0:y(),bottom:A("y")+c+w(),left:f+(d?0:x())},Dg={top:Cg.top,right:0/0,bottom:20+c,left:dk}):(Cg={top:4+v(),right:d?0:y(),bottom:e+f+c+w(),left:d?0:x()},Dg={top:Kg-f-c,right:0/0,bottom:e+c,left:Cg.left}),Eg={top:$j?0:Kg-a,right:0/0,bottom:0,left:$j?Jg-b:0},Fg=Jg-Cg.left-Cg.right,Hg=Kg-Cg.top-Cg.bottom,0>Fg&&(Fg=0),0>Hg&&(Hg=0),Gg=Wh?Cg.left-dk-ek:Fg,Ig=Wh?Hg:Kg-Dg.top-Dg.bottom,0>Gg&&(Gg=0),0>Ig&&(Ig=0),Og=Fg-($j?b+10:0),Pg=Hg-($j?0:10),r(),$j&&d&&(Eg.left=Og/2+1.1*Mg)}function q(){kk.select("line."+g.xgridFocus).attr("x1",Wh?0:-10).attr("x2",Wh?Fg:-10).attr("y1",Wh?-10:Cg.top).attr("y2",Wh?-10:Hg)}function r(){var a;Mg=Math.min(Og,Pg)/2,Lg=.95*Mg,a=ij?(Lg-ij)/Lg:.6,Ng=ve(kg.data.targets)||ue(kg.data.targets)?Lg*a:0}function s(){var a=Wh?g.axisX:g.axisY,b=kk.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=ok.node().getBoundingClientRect(),e=we(kg.data.targets),f=c.right-d.left-(e?0:x());return f>0?f:0}function t(){return ng?ng:C()}function u(){var a=og?og:D();return a>0?a:320}function v(){return rg?rg:0}function w(){return sg?sg:0}function x(){return pg?pg:Wh?Xh?Math.max($e(z("x")),40):1:!ni||si?1:$e(z("y"))}function y(){var a=10,b=$j?U()+20:0;return qg?qg:Wh?a+b:(!wi||Bi?a:$e(z("y2")))+b}function z(a){var b=pb(a);return b.isInner?20+Ib(a):40+Ib(a)}function A(a){return"x"!==a||Xh?"x"===a&&ki?ki:"y"!==a||ni?"y2"!==a||wi?(pb(a).isInner?30:40)+("y2"===a?-10:0):fk:Qh&&!$j?10:1:0}function B(a){for(var b,c=ok.node();c&&"BODY"!==c.tagName&&!(b=c.getBoundingClientRect()[a]);)c=c.parentNode;return b}function C(){return B("width")}function D(){var a=ok.style("height");return a.indexOf("px")>0?+a.replace("px",""):0}function E(a){return a?-31:-(Cg.left-1)}function F(a){return a?-20:-4}function G(){return E(!Wh)}function H(){return F(!Wh)}function I(){return E(Wh)}function J(){return F(Wh)}function K(a){return a?Fg+2+30+30:Cg.left+20}function L(a){return a?(ki?ki:0)+80:Hg+8}function M(){return K(!Wh)}function N(){return L(!Wh)}function O(){return K(Wh)}function P(){return L(Wh)}function Q(){var a,b,c,d,e,f,g=Oc(kg.data.targets);return g?(a=g.values[0],b=g.values[g.values.length-1],c=ah(b.x)-ah(a.x),0===c?Wh?Hg:Fg:(d=Nc(),e=re(kg.data.targets)?(d-(Gj?.25:1))/d:1,f=d>1?c*e/(d-1):c,1>f?1:f)):0}function R(a){_j=a}function S(a){ak=a}function T(a){bk=a}function U(){return Qh?$j?ak*(_j+1):Jg:0}function V(){return Qh?$j?Kg:bk*(_j+1):0}function W(){var a,b,c=!ah;Ug=Wh?1:0,Vg=Wh?Hg:Fg,Wg=Wh?0:Hg,Xg=Wh?Fg:1,Yg=Ug,Zg=Vg,$g=Wh?0:Ig,_g=Wh?Gg:1,ah=Z(Ug,Vg,c?void 0:ah.domain(),function(){return gh.tickOffset()}),bh=$(Wg,Xg,c?void 0:bh.domain()),ch=$(Wg,Xg,c?void 0:ch.domain()),dh=Z(Ug,Vg,pk,function(a){return a%1?0:jh.tickOffset()}),eh=$($g,_g,c?void 0:eh.domain()),fh=$($g,_g,c?void 0:fh.domain()),a=eb(),b=fi?fi:c?void 0:gh.tickValues(),gh=bb(ah,Vj,a,b),jh=bb(dh,Yj,a,b),hh=cb(bh,Wj,ti,vi),ih=cb(ch,Xj,Ci,Ei),c||(gk.scale(dh),tg&&hk.scale(ah)),X()}function X(){Qg=Lb(),Rg=Mb(),Sg=Mb(.98)}function Y(a,b,c){return(c?jg.time.scale():jg.scale.linear()).range([a,b])}function Z(a,b,c,d){var e,f=Y(a,b,Fj),g=c?f.domain(c):f;Gj?(d=d||function(){return 0},f=function(a,b){var c=g(a)+d(a);return b?c:Math.ceil(c)}):f=function(a,b){var c=g(a);return b?c:Math.ceil(c)};for(e in g)f[e]=g[e];return f.orgDomain=function(){var a=g.domain();return pk&&pk[0]===a[0]&&pk[1]a?a.toFixed(0):a};return ai&&("function"==typeof ai?a=ai:Fj&&(a=function(a){return a?Qj(ai)(a):""})),a}function fb(a){var b;return"y"===a?b=ri:"y2"===a?b=Ai:"x"===a&&(b=mi),b}function gb(a){var b=fb(a);return"string"==typeof b?b:b?b.text:null}function hb(a,b){var c=fb(a);"string"==typeof c?"y"===a?ri=b:"y2"===a?Ai=b:"x"===a&&(mi=b):c&&(c.text=b)}function ib(a){return 10*Math.sin(Math.PI*(a/180))}function jb(a){return 11.5-2.5*(a/15)}function kb(a,b,c){a.selectAll(".tick text").style("text-anchor","start"),b.selectAll(".tick text").attr("y",jb(c)).attr("x",ib(c)).attr("transform","rotate("+c+")")}function lb(a,b){var c=fb(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 mb(){return lb("x",Wh?"inner-top":"inner-right")}function nb(){return lb("y",Wh?"inner-right":"inner-top")}function ob(){return lb("y2",Wh?"inner-right":"inner-top")}function pb(a){return"y2"===a?ob():"y"===a?nb():mb()}function qb(){return gb("x")}function rb(){return gb("y")}function sb(){return gb("y2")}function tb(a,b){return a?b.isLeft?0:b.isCenter?Fg/2:Fg:b.isBottom?-Hg:b.isMiddle?-Hg/2:0}function ub(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function vb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function wb(){return tb(!Wh,mb())}function xb(){return tb(Wh,nb())}function yb(){return tb(Wh,ob())}function zb(){return ub(!Wh,mb())}function Ab(){return ub(Wh,nb())}function Bb(){return ub(Wh,ob())}function Cb(){var a=mb();return Wh?a.isInner?"1.2em":-25-Ib("x"):a.isInner?"-0.5em":ki?ki-10:"3em"}function Db(){var a=nb();return Wh?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-Ib("y")}function Eb(){var a=ob();return Wh?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+Ib("y2")}function Fb(){return vb(!Wh,mb())}function Gb(){return vb(Wh,nb())}function Hb(){return vb(Wh,ob())}function Ib(a){var b=0,c="x"===a?g.axisX:"y"===a?g.axisY:g.axisY2;return jg.selectAll("."+c+" .tick text").each(function(){var a=this.getBoundingClientRect();bb?0:b}function Jb(a){var b=kk.select("."+g.axisX+" ."+g.axisXLabel),c=kk.select("."+g.axisY+" ."+g.axisYLabel),d=kk.select("."+g.axisY2+" ."+g.axisY2Label);(a?b.transition():b).attr("x",wb).attr("dx",zb).attr("dy",Cb).text(qb),(a?c.transition():c).attr("x",xb).attr("dx",Ab).attr("dy",Db).attr("dy",Db).text(rb),(a?d.transition():d).attr("x",yb).attr("dx",Bb).attr("dy",Eb).text(sb)}function Kb(a){var b=!1;if(Tg(Vc(kg.data.targets)).forEach(function(c){b||c.data.id!==a.data.id||(b=!0,a=c)}),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),Ee(a.data)){var c=cj,d=dj,e=Math.abs(c)+d,f=Math.PI/e;a.startAngle=-1*(Math.PI/2)+f*Math.abs(c),a.endAngle=a.startAngle+f*(a.value>d?d:a.value)}return b?a:null}function Lb(){var a=jg.svg.arc().outerRadius(Lg).innerRadius(Ng),b=function(b,c){var d;return c?a(b):(d=Kb(b),d?a(d):"M 0 0")};return b.centroid=a.centroid,b}function Mb(a){var b=jg.svg.arc().outerRadius(Mg*(a?a:1)).innerRadius(Ng);return function(a){var c=Kb(a);return c?b(c):"M 0 0"}}function Nb(a,b,c){return c||Ge(a.data)?Qg(a,b):"M 0 0"}function Ob(a){var b,c,d,e,f,g=Kb(a),h="";return g&&!ue(kg.data.targets)&&(b=Qg.centroid(g),c=b[0],d=b[1],e=Math.sqrt(c*c+d*d),f=(36/Lg>.375?1.175-36/Lg:.8)*Lg/e,h="translate("+c*f+","+d*f+")"),h}function Pb(a){var b=ue(kg.data.targets)?Math.PI:2*Math.PI;return a?(a.endAngle-a.startAngle)/b:null}function Qb(a){return Ac({id:a.data.id,value:a.value,ratio:Pb(a)})}function Rb(a){var b,c,d,e;return Ub()?(b=Kb(a),c=b?b.value:null,d=Pb(b),Vb(d)?(e=Wb(),e?e(c,d):Qd(c,d)):""):""}function Sb(a,b){var c=ik.selectAll("."+g.chartArc+Cd(a)),d=ik.selectAll("."+g.arc).filter(function(b){return b.data.id!==a});Me(a)&&c.selectAll("path").transition().duration(50).attr("d",Rg).transition().duration(100).attr("d",Sg).each(function(a){Fe(a.data)}),b||d.style("opacity",.3)}function Tb(a){var b=ik.selectAll("."+g.chartArc+Cd(a));b.selectAll("path."+g.arc).transition().duration(50).attr("d",Qg),ik.selectAll("."+g.arc).style("opacity",1)}function Ub(){var a=!0;return ve(kg.data.targets)?a=jj:te(kg.data.targets)&&(a=Ui),a}function Vb(a){var b=ve(kg.data.targets)?lj:Wi;return a>=b}function Wb(){var a=Vi;return ue(kg.data.targets)?a=aj:ve(kg.data.targets)&&(a=kj),a}function Xb(){return ve(kg.data.targets)?nj:""}function Yb(){var a=Yi;return ue(kg.data.targets)?a=ej:ve(kg.data.targets)&&(a=oj),"function"==typeof a?a:function(){}}function Zb(){var a=Zi;return ue(kg.data.targets)?a=fj:ve(kg.data.targets)&&(a=pj),"function"==typeof a?a:function(){}}function $b(){var a=$i;return ue(kg.data.targets)?a=gj:ve(kg.data.targets)&&(a=qj),"function"==typeof a?a:function(){}}function _b(a,c,d,e){var f="ratio"===a.unit?e:1;return b(a[c])?a[c]*f:d}function ac(a){var b,c,d,e,f,g,h=Qc(a),i=ad(a);if(qh.length>0)for(g=cd(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 jg.min(Object.keys(i).map(function(a){return jg.min(i[a])}))}function bc(a){var b,c,d,e,f,g,h=Qc(a),i=ad(a);if(qh.length>0)for(g=dd(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 jg.max(Object.keys(i).map(function(a){return jg.max(i[a])}))}function cc(a,c){var d,e,f,g,h,i,j,k,l=a.filter(function(a){return db(a.id)===c}),m="y2"===c?yi:pi,n="y2"===c?xi:oi,o=b(m)?m:ac(l),p=b(n)?n:bc(l),q="y2"===c?zi:qi,r=Kd()&&Wh;return 0===l.length?"y2"===c?ch.domain():bh.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=Ld(o,p),j=ic(bh.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&&ui&&(f=_b(ui,"top",e,d),g=_b(ui,"bottom",e,d)),"y2"===c&&Di&&(f=_b(Di,"top",e,d),g=_b(Di,"bottom",e,d)),re(l)&&!cd(l)&&(g=o),[o-g,p+f])}function dc(a){return ii?Fj?Pe(ii):ii:jg.min(a,function(a){return jg.min(a.values,function(a){return a.x})})}function ec(a){return hi?Fj?Pe(hi):hi:jg.max(a,function(a){return jg.max(a.values,function(a){return a.x})})}function fc(a){var c,d,e,f,g=Pc(a),h=g[1]-g[0];return Gj?d=0:re(a)?(c=Nc(),d=c>1?h/(c-1)/2:.5):d=.01*h,"object"==typeof ji&&Ue(ji)?(e=b(ji.left)?ji.left:d,f=b(ji.right)?ji.right:d):e=f="number"==typeof ji?ji:d,{left:e,right:f}}function gc(a){var b=[dc(a),ec(a)],c=b[0],d=b[1],e=fc(a),f=0,g=0;return c-d!==0||Gj||(c=Fj?new Date(.5*c.getTime()):-.5,d=Fj?new Date(1.5*d.getTime()):.5),(c||0===c)&&(f=Fj?new Date(c.getTime()-e.left):c-e.left),(d||0===d)&&(g=Fj?new Date(d.getTime()+e.right):d+e.right),[f,g]}function hc(a,b,c){c&&(ah.domain(jg.extent(gc(a))),pk=ah.domain(),tg&&hk.scale(ah).updateScaleExtent(),dh.domain(ah.domain()),gk.scale(dh)),b&&(ah.domain(gk.empty()?pk:gk.extent()),tg&&hk.scale(ah).updateScaleExtent())}function ic(a){return a[1]-a[0]}function jc(a){for(var b=0;bb?0:b-c}function pc(a){var b,c=nc(a),d="y"===a.axis?bh:ch;return b="y"===a.axis||"y2"===a.axis?Wh?Hg:"start"in a?d(a.start):Hg:Wh?"end"in a?ah(Fj?Pe(a.end):a.end):Hg:Hg,c>b?0:b-c}function qc(a){return!a.axis||"x"===a.axis}function rc(a){return kh&&a===kh||Ue(lh)&&Ve(lh,a)}function sc(a){return!rc(a)}function tc(a){return kh?kh:Ue(lh)?lh[a]:null}function uc(a,b){var c,d=b&&Ue(b)?Qc(b):[];return d.forEach(function(b){tc(b)===a&&(c=kg.data.xs[b])}),c}function vc(a,b){return a in kg.data.xs&&kg.data.xs[a]&&kg.data.xs[a][b]?kg.data.xs[a][b]:b}function wc(){var a=Object.keys(kg.data.xs);return a.length?kg.data.xs[a[0]]:null}function xc(a){var b=wc();return b&&a=0?kg.data.xs[d]=(c&&kg.data.xs[d]?kg.data.xs[d]:[]).concat(a.map(function(a){return a[e]}).filter(b).map(function(a,b){return Ec(a,d,b)})):kh?kg.data.xs[d]=wc():Ue(lh)&&(kg.data.xs[d]=uc(e,kg.data.targets)):kg.data.xs[d]=a.map(function(a,b){return b})}),e.forEach(function(a){if(!kg.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),d=e.map(function(b,c){var d=nh(b);return{id:d,id_org:b,values:a.map(function(a,e){var f=tc(b),g=a[f],h=Ec(g,b,e);return Hj&&Gj&&0===c&&g&&(0===e&&($h=[]),$h.push(g)),("undefined"==typeof a[b]||kg.data.xs[b].length<=e)&&(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})}}),d.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++})}),sh&&pe(Qc(d).filter(function(a){return!(a in th)}),sh),d.forEach(function(a){kc(a.id_org,a)}),d}function Kc(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 Lc(a){var b=Bc(kg.data.targets[0].values,a-1);return b?b.x:null}function Mc(a){var b=Bc(kg.data.targets[0].values,a+1);return b?b.x:null}function Nc(){return jg.max(kg.data.targets,function(a){return a.values.length})}function Oc(a){var b,c=a.length,d=0;return c>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b}function Pc(a){var b,c,d=Oc(a);return d?(b=d.values[0],c=d.values[d.values.length-1],[b.x,c.x]):[0,0]}function Qc(a){return a.map(function(a){return a.id})}function Rc(a){return a?"string"==typeof a?[a]:a:Qc(kg.data.targets)}function Sc(a,b){var c,d=Qc(a);for(c=0;c2){for(f=c-2,d=a[0],e=a[a.length-1],g=(e-d)/(f+1),j=[d],h=0;f>h;h++)i=+d+g*(h+1),j.push(Fj?new Date(i):i);j.push(e)}return Fj||(j=j.sort(function(a,b){return a-b})),j}function Yc(a){Sj=Sj.concat(a)}function Zc(a){Sj=Sj.filter(function(b){return a.indexOf(b)<0})}function $c(a){Tj=Tj.concat(a)}function _c(a){Tj=Tj.filter(function(b){return a.indexOf(b)<0})}function ad(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b}function bd(a,b){var c,d,e,f=Object.keys(a);for(c=0;ca})}function dd(a){return bd(a,function(a){return a>0})}function ed(a){return a<$h.length?$h[a]:a}function fd(a,b){return" "+a+" "+a+Bd(b)}function gd(a){return fd(g.text,a.index)}function hd(a){return fd(g.texts,a.id)}function id(a){return fd(g.shape,a.index)}function jd(a){return fd(g.shapes,a.id)}function kd(a){return id(a)+fd(g.line,a.id)}function ld(a){return jd(a)+fd(g.lines,a.id)}function md(a){return id(a)+fd(g.circle,a.index)}function nd(a){return jd(a)+fd(g.circles,a.id)}function od(a){return id(a)+fd(g.bar,a.index)}function pd(a){return jd(a)+fd(g.bars,a.id)}function qd(a){return id(a.data)+fd(g.arc,a.data.id)}function rd(a){return jd(a.data)+fd(g.arcs,a.data.id)}function sd(a){return id(a)+fd(g.area,a.id)}function td(a){return jd(a)+fd(g.areas,a.id)}function ud(a,b){return fd(g.region,b)+" "+("class"in a?a.class:"")}function vd(a){return fd(g.eventRect,a.index)}function wd(a){var b=ph[a],c="";return b&&(c=" "+g.target+"-"+b),fd(g.target,a)+c}function xd(a){return g.chartText+wd(a.id)}function yd(a){return g.chartLine+wd(a.id)}function zd(a){return g.chartBar+wd(a.id)}function Ad(a){return g.chartArc+wd(a.data.id)}function Bd(a){return a||0===a?"-"+(a.replace?a.replace(/([^a-zA-Z0-9-_])/g,"-"):a):""}function Cd(a){return"."+g.target+Bd(a)}function Dd(a){return a.length?a.map(function(a){return Cd(a)}):null}function Ed(a){return"."+g.legendItem+Bd(a)}function Fd(a){return a.length?a.map(function(a){return Ed(a)}):null}function Gd(a){return null!==a.value&&rk[a.id]?1:0}function Hd(a){var b=Jd(a);return Gd(a)*b}function Id(a){return b(a.value)?Ce(a)?.5:1:0}function Jd(){return Kd()?1:0}function Kd(){return"boolean"==typeof uh&&uh?!0:"object"==typeof uh&&Ue(uh)?!0:!1}function Ld(a,b){var c=[],d=1.3;return ok.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){return Rd(a.id)(a.value,a.id)}).each(function(a,b){c[b]=this.getBoundingClientRect().width*d}).remove(),c}function Md(a){var b=a&&!ue(kg.data.targets)?Qd:Nd,c=a&&!ue(kg.data.targets)?Qd:Od;return function(a,d,e){var f="y2"===db(e)?c:b;return f(a,d)}}function Nd(a){var b=ti?ti:Pd;return b(a)}function Od(a){var b=Ci?Ci:Pd;return b(a)}function Pd(a){return b(a)?+a:""}function Qd(a,b){return(100*b).toFixed(1)+"%"}function Rd(a){var c=function(a){return b(a)?+a:""},d=db(a),e=c;return"function"==typeof uh.format?e=uh.format:"object"==typeof uh.format&&"function"==typeof uh.format[d]&&(e=uh.format[d]),e}function Sd(a){return a?ah(a.x):null}function Td(a){return Math.ceil(ah(Fj?Pe(a.value):a.value))}function Ud(a){var b=a.axis&&"y2"===a.axis?ch:bh;return Math.ceil(b(a.value))}function Vd(a){return a?dh(a.x):null}function Wd(a,b){var c,d=a[b].x,e=[];for(c=b-1;c>=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||0===a[f].x)&&(e=e.concat(Wd(a,f))),(a[g].x||0===a[g].x)&&(e=e.concat(Wd(a,g))),Zd(e,b)):Xd(a,b,f,g)}function Yd(a,b){var c;return c=a.map(function(a){return Xd(a.values,b)}),Zd(c,b)}function Zd(a,b){var c,d;return a.forEach(function(a){var e=We(a,b);(c>e||!c)&&(c=e,d=a)}),d}function $d(a,b){return jg.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})}function _d(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 ae(){return vh&&"desc"===vh.toLowerCase()}function be(){return vh&&"asc"===vh.toLowerCase()}function ce(a){var b=be(),c=ae();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 vh&&a.sort(vh),a}function de(a,c){var d,e,f,g,h,i,j,k=we(kg.data.targets),l=a.filter(function(a){return a&&b(a.value)});0!==l.length&&sj&&(nk.html(vj(a,eb(),Md(k),Oj)).style("display","block"),d=nk.property("offsetWidth"),e=nk.property("offsetHeight"),k?(g=Fg/2+c[0],i=Hg/2+c[1]+20):(Wh?(f=s(),g=f+c[0]+100,h=g+d,j=t()-y(),i=ah(l[0].x)+20):(f=s(),g=f+x()+ah(l[0].x)+20,h=g+d,j=f+t()-y(),i=c[1]+15),h>j&&(g-=h-j),i+e>u()&&(i-=e+30)),nk.style("top",i+"px").style("left",g+"px"))}function ee(){nk.style("display","none")}function fe(a){var c=a.filter(function(a){return a&&b(a.value)});if(sj&&!se(kg.data.targets)&&!we(kg.data.targets)){var d=kk.selectAll("line."+g.xgridFocus);d.style("visibility","visible").data([c[0]]).attr(Wh?"y1":"x1",Sd).attr(Wh?"y2":"x2",Sd),Nf(d,"grid")}}function ge(){kk.select("line."+g.xgridFocus).style("visibility","hidden")}function he(a,b){var c,d,e,f,h=[],i=kk.select("."+g.axisX).selectAll(".tick").size();if("year"===a)for(c=gc(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10),h.length>i&&(h=h.filter(function(a){return(""+a).indexOf(".")<0}));return h}function ie(a){var b,d,e={},f=0;return Vc(kg.data.targets.filter(a)).forEach(function(a){for(b=0;b0&&(i+=g(c.values[f].value)-h)}),i}}function me(a){return a.x||0===a.x?ah(a.x):null}function ne(a,b){var c=ie(xe),d=Df(c);return qh.length>0?d(a,b)[0][1]:_(a.id)(a.value)}function oe(a,b){return"number"==typeof Si?Si:b?2*a.tickOffset()*Ti/b:0}function pe(a,b){Rc(a).forEach(function(a){rk[a]=b===th[a],th[a]=b}),a||(sh=b)}function qe(a,b){var c=!1;return a.forEach(function(a){th[a.id]===b&&(c=!0),a.id in th||"line"!==b||(c=!0)}),c}function re(a){return qe(a,"bar")}function se(a){return qe(a,"scatter")}function te(a){return"pie"===sh||qe(a,"pie")}function ue(a){return qe(a,"gauge")}function ve(a){return"donut"===sh||qe(a,"donut")}function we(a){return te(a)||ve(a)||ue(a)}function xe(a){var b="string"==typeof a?a:a.id;return!th[b]||["line","spline","area","area-spline","step","area-step"].indexOf(th[b])>=0}function ye(a){var b="string"==typeof a?a:a.id;return["step","area-step"].indexOf(th[b])>=0}function ze(a){var b="string"==typeof a?a:a.id;return["spline","area-spline"].indexOf(th[b])>=0}function Ae(a){var b="string"==typeof a?a:a.id;return["area","area-spline","area-step"].indexOf(th[b])>=0}function Be(a){var b="string"==typeof a?a:a.id;return"bar"===th[b]}function Ce(a){var b="string"==typeof a?a:a.id;return"scatter"===th[b]}function De(a){var b="string"==typeof a?a:a.id;return"pie"===th[b]}function Ee(a){var b="string"==typeof a?a:a.id;return"gauge"===th[b]}function Fe(a){var b="string"==typeof a?a:a.id;return"donut"===th[b]}function Ge(a){return De(a)||Fe(a)||Ee(a)}function He(a){return xe(a)?[a]:[]}function Ie(a){return Ge(a.data)?[a]:[]}function Je(a){return Be(a)?a.values:[]}function Ke(a){return xe(a)||Ce(a)?a.values:[]}function Le(a){return Be(a)||xe(a)?a.values:[]}function Me(a){return Fe(a)&&mj||Ee(a)&&bj||De(a)&&Xi}function Ne(a,b,c){var d=[];return function(e){var f,g=e.id||e;return a[g]instanceof Function?f=a[g](e):a[g]?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 Oe(a,b){var c="value"===b.unit,d=b.values&&b.values.length?b.values:[],e=b.max||100;return function(b){var f,g,h=a[a.length-1];for(f=0;f0}function Ve(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}function We(a,b){var c="y"===db(a.id)?bh:ch,d=Wh?1:0,e=Wh?0:1;return Math.pow(ah(a.x)-b[d],2)+Math.pow(c(a.value)-b[e],2)}function Xe(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})}function Ye(){var a=[],b=function(b,c){var d=setInterval(function(){var b=0;a.forEach(function(a){if(a.empty())return void(b+=1);try{a.transition()}catch(c){b+=1}}),b===a.length&&(clearInterval(d),c&&c())},10)};return b.add=function(b){a.push(b)},b}function Ze(a,b,c){return d(a[b])?a[b]:c }function $e(a){return 10*Math.ceil(a/10)}function _e(a,b){var c;return jg.select("body").selectAll(".dummy").data([a]).enter().append("text").classed(b?b:"",!0).text(a).each(function(){c=this.getBoundingClientRect()}).remove(),c}function af(a){return ze(a)?"cardinal":ye(a)?"step-after":"linear"}function bf(){return jg.selectAll([])}function cf(a,b,c){Ih(b,a.node()),kk.select("."+g.selectedCircles+Bd(b.id)).selectAll("."+g.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return fd(g.selectedCircle,c)}).attr("cx",Wh?ne:me).attr("cy",Wh?me:ne).attr("stroke",function(){return Oj(b)}).attr("r",1.4*of(b)).transition().duration(100).attr("r",of)}function df(a,b,c){Jh(b,a.node()),kk.select("."+g.selectedCircles+Bd(b.id)).selectAll("."+g.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}function ef(a,b,c,d){a?cf(b,c,d):df(b,c,d)}function ff(a,b){Ih(b,a.node()),a.transition().duration(100).style("fill",function(){return jg.rgb(Oj(b)).brighter(.75)})}function gf(a,b){Jh(b,a.node()),a.transition().duration(100).style("fill",function(){return Oj(b)})}function hf(a,b,c,d){a?ff(b,c,d):gf(b,c,d)}function jf(a,b,c,d){hf(a,b,c.data,d)}function kf(a){return"circle"===a.nodeName?ef:jg.select(a).classed(g.bar)?hf:jf}function lf(a){return a.filter(function(a){return b(a.value)})}function mf(a){return Li&&!ye(a)?"function"==typeof Mi?Mi(a):Mi:0}function nf(a){return Oi?Pi?Pi:1.75*mf(a):mf(a)}function of(a){return Qi?Qi:4*mf(a)}function pf(a,c){return(c?kk.selectAll("."+g.circles+Bd(c)):kk).selectAll("."+g.circle+(b(a)?"-"+a:""))}function qf(a,b){pf(a,b).classed(g.EXPANDED,!0).attr("r",nf)}function rf(a){pf(a).filter(function(){return jg.select(this).classed(g.EXPANDED)}).classed(g.EXPANDED,!1).attr("r",mf)}function sf(a){return kk.selectAll("."+g.bar+(b(a)?"-"+a:""))}function tf(a){sf(a).classed(g.EXPANDED,!0)}function uf(a){sf(a).classed(g.EXPANDED,!1)}function vf(a,b){var c=jg.svg.area(),d=Bf(a,b),e=b?ab:_,f=function(a,b){return qh.length>0?d(a,b)[0][1]:e(a.id)(0)},g=function(a,b){return qh.length>0?d(a,b)[1][1]:e(a.id)(a.value)};return c=Wh?c.x0(f).x1(g).y(Sd):c.x(Sd).y0(f).y1(g),function(a){var b,d,e=lf(a.values);return Ae(a)?c.interpolate(af(a))(e):(b=ah(e[0].x),d=_(a.id)(e[0].value),Wh?"M "+d+" "+b:"M "+b+" "+d)}}function wf(a,b){var c=jg.svg.line(),d=Df(a,b),e=b?ab:_,f=b?Vd:Sd,g=function(a,b){return qh.length>0?d(a,b)[0][1]:e(a.id)(a.value)};return c=Wh?c.x(g).y(f):c.x(f).y(g),Ri||(c=c.defined(function(a){return null!=a.value})),function(a){var d=Ri?lf(a.values):a.values,f=b?f:dh,g=e(a.id),h=0,i=0;return xe(a)?wh[a.id]?Ef(d,f,g,wh[a.id]):c.interpolate(af(a))(d):(d[0]&&(h=f(d[0].x),i=g(d[0].value)),Wh?"M "+i+" "+h:"M "+h+" "+i)}}function xf(a,b){var c=Cf(a,b);return function(a,b){var d=c(a,b),e=Wh?1:0,f=Wh?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 yf(a,b){var c=Cf(a,!1),d=b?zf:Af;return function(a,b){return d(c(a,b),a,this)}}function zf(a,b){var c;return Wh?(c=Be(b)?4:6,a[2][1]+c*(b.value<0?-1:1)):a[0][0]+(a[2][0]-a[0][0])/2}function Af(a,b,c){var d=c.getBoundingClientRect();return Wh?(a[0][0]+a[2][0]+.6*d.height)/2:a[2][1]+(b.value<0?d.height:Be(b)?-3:-6)}function Bf(a,b){var c=a.__max__+1,d=je(0,c,a,!!b),e=ke(!!b),f=le(Ae,a,!!b),g=b?ab:_;return function(a,b){var c=g(a.id)(0),h=f(a,b)||c,i=d(a),j=e(a);return Wh&&(0j||a.value<0&&j>c)&&(j=c),[[i,h],[i,j-(c-h)]]}}function Cf(a,b){var c=a.__max__+1,d=oe(gh,c),e=je(d,c,a,!!b),f=ke(!!b),g=le(Be,a,!!b),h=b?ab:_;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return Wh&&(0k||a.value<0&&k>c)&&(k=c),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function Df(a,b){var c=a.__max__+1,d=je(0,c,a,!!b),e=ke(!!b),f=le(xe,a,!!b),g=b?ab:_;return function(a,b){var c=g(a.id)(0),h=f(a,b)||c,i=d(a),j=e(a);return Wh&&(0j||a.value<0&&j>c)&&(j=c),[[i,j-(c-h)]]}}function Ef(a,b,e,f){var g,h,i,j,k,l,m,n,o,p,q,r,s=-1,t="M",u=[];if(d(f))for(g=0;g=h;h+=p)t+=i(a[g-1],a[g],h,o);s=a[g].x}return t}function Ff(b){var c=new MutationObserver(function(d){d.forEach(function(d){if("childList"===d.type&&d.previousSibling){c.disconnect();var e=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(e),Of({withUpdateTranslate:!0,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10)}})});c.observe(b.node(),{attributes:!0,childList:!0,characterData:!0})}function Gf(b){var c,d,e,f,h=!0;if(ok=jg.select(mg),ok.empty()&&(ok=jg.select(document.createElement("div")).style("opacity",0),Ff(ok),h=!1),ok.html("").classed("c3",!0),kg.data.xs={},kg.data.targets=Jc(b),Ah&&(kg.data.targets=kg.data.targets.filter(Ah)),zh&&Yc(zh===!0?Qc(kg.data.targets):zh),ue(kg.data.targets)&&(Qh=!1),p(),W(),ah.domain(jg.extent(gc(kg.data.targets))),bh.domain(cc(kg.data.targets,"y")),ch.domain(cc(kg.data.targets,"y2")),dh.domain(ah.domain()),eh.domain(bh.domain()),fh.domain(ch.domain()),pk=ah.domain(),gk.scale(dh),tg&&hk.scale(ah),ik=ok.append("svg").style("overflow","hidden").on("mouseenter",xg).on("mouseleave",yg),jk=ik.append("defs"),jk.append("clipPath").attr("id",zj).append("rect"),jk.append("clipPath").attr("id",Aj).append("rect"),jk.append("clipPath").attr("id",Bj).append("rect"),Sf(),kk=ik.append("g").attr("transform",Zj.main),lk=ik.append("g").attr("transform",Zj.context),mk=ik.append("g").attr("transform",Zj.legend),Mh||lk.style("visibility","hidden"),Qh||(mk.style("visibility","hidden"),Tj=Qc(kg.data.targets)),nk=ok.style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),dg(Qc(kg.data.targets),{withTransform:!1,withTransitionForTransform:!1}),e=kk.append("g").attr("clip-path",Cj).attr("class",g.grid),Fi&&e.append("g").attr("class",g.xgrids),Ue(Hi)&&e.append("g").attr("class",g.xgridLines),Ni&&e.append("g").attr("class",g.xgridFocus).append("line").attr("class",g.xgridFocus),Ii&&e.append("g").attr("class",g.ygrids),Ue(Ji)&&e.append("g").attr("class",g.ygridLines),kk.append("g").attr("clip-path",Cj).attr("class",g.regions),kk.append("g").attr("clip-path",Cj).attr("class",g.chart),d=kk.select("."+g.chart).append("g").attr("class",g.eventRects).style("fill-opacity",0).style("cursor",tg?Wh?"ns-resize":"ew-resize":null),kk.select("."+g.chart).append("g").attr("class",g.chartBars),kk.select("."+g.chart).append("g").attr("class",g.chartLines),c=kk.select("."+g.chart).append("g").attr("class",g.chartArcs).attr("transform",Zj.arc),c.append("text").attr("class",g.chartArcsTitle).style("text-anchor","middle").text(Xb()),ue(kg.data.targets)&&(c.append("path").attr("class",g.chartArcsBackground).attr("d",function(){var a={data:[{value:dj}],startAngle:-1*(Math.PI/2),endAngle:Math.PI/2};return Nb(a,!0,!0)}),c.append("text").attr("dy",".75em").attr("class",g.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none").text(_i?hj:""),c.append("text").attr("dx",-1*(Ng+(Lg-Ng)/2)+"px").attr("dy","1.2em").attr("class",g.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none").text(_i?cj:""),c.append("text").attr("dx",Ng+(Lg-Ng)/2+"px").attr("dy","1.2em").attr("class",g.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none").text(_i?dj:"")),kk.select("."+g.chart).append("g").attr("class",g.chartTexts),tg&&kk.insert("rect",vg?null:"g."+g.grid).attr("class",g.zoomRect).attr("width",Fg).attr("height",Hg).style("opacity",0).style("cursor",Wh?"ns-resize":"ew-resize").call(hk).on("dblclick.zoom",null),li&&gk.extent("function"!=typeof li?li:li(gc())),Uj.x=kk.append("g").attr("class",g.axis+" "+g.axisX).attr("clip-path",Dj).attr("transform",Zj.x).style("visibility",Xh?"visible":"hidden"),Uj.x.append("text").attr("class",g.axisXLabel).attr("transform",Wh?"rotate(-90)":"").style("text-anchor",Fb),Uj.y=kk.append("g").attr("class",g.axis+" "+g.axisY).attr("clip-path",Ej).attr("transform",Zj.y).style("visibility",ni?"visible":"hidden"),Uj.y.append("text").attr("class",g.axisYLabel).attr("transform",Wh?"":"rotate(-90)").style("text-anchor",Gb),Uj.y2=kk.append("g").attr("class",g.axis+" "+g.axisY2).attr("transform",Zj.y2).style("visibility",wi?"visible":"hidden"),Uj.y2.append("text").attr("class",g.axisY2Label).attr("transform",Wh?"":"rotate(-90)").style("text-anchor",Hb),lk.append("g").attr("clip-path",Cj).attr("class",g.chart),lk.select("."+g.chart).append("g").attr("class",g.chartBars),lk.select("."+g.chart).append("g").attr("class",g.chartLines),lk.append("g").attr("clip-path",Cj).attr("class",g.brush).call(gk).selectAll("rect").attr(Wh?"width":"height",Wh?Gg:Ig),Uj.subx=lk.append("g").attr("class",g.axisX).attr("transform",Zj.subx).attr("clip-path",Wh?"":Dj),Vf(kg.data.targets),h&&Of({withUpdateTranslate:!0,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1}),wj){if(Fj&&"string"==typeof xj){for(xj=Pe(xj),f=0;ff&&h>c&&d>i&&j>d;else{if(!n.classed(g.bar))return;m=_d(this),c=m.x,d=m.y,e=m.width,k=m.height,l=hf,q=!(c>h||f>c+e||d>j||i>d+k)}q^p&&(n.classed(g.INCLUDED,!p),n.classed(g.SELECTED,!o),l(!o,n,a,b))}))}function Lf(a){we(kg.data.targets)||Bh&&(Ij=a,kk.select("."+g.chart).append("rect").attr("class",g.dragarea).style("opacity",.1),Jj=!0,Kh())}function Mf(){we(kg.data.targets)||Bh&&(kk.select("."+g.dragarea).transition().duration(100).style("opacity",0).remove(),kk.selectAll("."+g.shape).classed(g.INCLUDED,!1),Jj=!1,Lh())}function Nf(a,b){"grid"===b&&a.each(function(){var a=jg.select(this),b=a.attr("x1"),c=a.attr("x2"),d=a.attr("y1"),e=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(c),y1:Math.ceil(d),y2:Math.ceil(e)})})}function Of(a,c){var d,e,f,h,i,j,k,l,m,n,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T,U,V,X,Y,Z,$,_,ab,bb,cb,db=ie(Ae),eb=ie(Be),fb=ie(xe),gb=we(kg.data.targets),hb=Ye(),ib=Vc(kg.data.targets);if(d=h=r=v=bf(),a=a||{},F=Ze(a,"withY",!0),G=Ze(a,"withSubchart",!0),H=Ze(a,"withTransition",!0),K=Ze(a,"withTransform",!1),L=Ze(a,"withUpdateXDomain",!1),M=Ze(a,"withUpdateOrgXDomain",!1),O=Ze(a,"withUpdateTranslate",!1),N=Ze(a,"withLegend",!1),I=Ze(a,"withTransitionForExit",H),J=Ze(a,"withTransitionForAxis",H),Z=H?Bg:0,$=I?Z:0,_=J?Z:0,c=c||Tf(_),O&&(Wh?(Uj.x.call(gh),Uj.subx.call(jh)):(Uj.y.call(hh),Uj.y2.call(ih)),p(),W(),Sf(),o(!1)),N&&Qh&&dg(Qc(kg.data.targets),a,c),Gj&&0===ib.length&&ah.domain([0,Uj.x.selectAll(".tick").size()]),ib.length&&(hc(ib,L,M),fi||!ei&&!di||(ab=Xc(Wc(ib),di),gh.tickValues(ab),jh.tickValues(ab))),bh.domain(cc(ib,"y")),ch.domain(cc(ib,"y2")),Uj.x.style("opacity",gb?0:1),Uj.y.style("opacity",gb?0:1),Uj.y2.style("opacity",gb?0:1),Uj.subx.style("opacity",gb?0:1),c.axisX.call(gh),c.axisY.call(hh),c.axisY2.call(ih),c.axisSubX.call(jh),Jb(H),L&&ib.length)if(bi&&ab){for(bb=1;bb=0&&jg.select(this).style("display",b%cb?"none":"block")})}else ik.selectAll("."+g.axisX+" .tick text").style("display","block");!Wh&&gi&&kb(Uj.x,c.axisX,gi),P=vf(db,!1),S=xf(eb),U=wf(fb,!1),X=yf(eb,!0),Y=yf(eb,!1),eh.domain(bh.domain()),fh.domain(ch.domain()),nk.style("display","none"),q(),kk.select("line."+g.xgridFocus).style("visibility","hidden"),Fi&&(f=he(Gi,ah),C=Gj?gh.tickOffset():0,e=Wh?{x1:0,x2:Fg,y1:function(a){return ah(a)-C},y2:function(a){return ah(a)-C}}:{x1:function(a){return ah(a)+C},x2:function(a){return ah(a)+C},y1:Cg.top,y2:Hg},d=kk.select("."+g.xgrids).selectAll("."+g.xgrid).data(f),d.enter().append("line").attr("class",g.xgrid),d.attr(e).style("opacity",function(){return+jg.select(this).attr(Wh?"y1":"x1")===(Wh?Hg:0)?0:1}),d.exit().remove()),Ue(Hi)&&(h=kk.select("."+g.xgridLines).selectAll("."+g.xgridLine).data(Hi),i=h.enter().append("g").attr("class",function(a){return g.xgridLine+(a.class?a.class:"")}),i.append("line").style("opacity",0),i.append("text").attr("text-anchor","end").attr("transform",Wh?"":"rotate(-90)").attr("dx",Wh?0:-Cg.top).attr("dy",-5).style("opacity",0),h.exit().transition().duration(Z).style("opacity",0).remove()),F&&Ii&&(j=kk.select("."+g.ygrids).selectAll("."+g.ygrid).data(bh.ticks(Ki)),j.enter().append("line").attr("class",g.ygrid),j.attr("x1",Wh?bh:0).attr("x2",Wh?bh:Fg).attr("y1",Wh?0:bh).attr("y2",Wh?Hg:bh),j.exit().remove(),Nf(j,"grid")),F&&Ue(Ji)&&(k=kk.select("."+g.ygridLines).selectAll("."+g.ygridLine).data(Ji),l=k.enter().append("g").attr("class",function(a){return g.ygridLine+(a.class?a.class:"")}),l.append("line").style("opacity",0),l.append("text").attr("text-anchor","end").attr("transform",Wh?"rotate(-90)":"").attr("dx",Wh?0:-Cg.top).attr("dy",-5).style("opacity",0),k.select("line").transition().duration(Z).attr("x1",Wh?Ud:0).attr("x2",Wh?Ud:Fg).attr("y1",Wh?0:Ud).attr("y2",Wh?Hg:Ud).style("opacity",1),k.select("text").transition().duration(Z).attr("x",Wh?0:Fg).attr("y",Ud).text(function(a){return a.text}).style("opacity",1),k.exit().transition().duration(Z).style("opacity",0).remove()),u=kk.select("."+g.regions).selectAll("."+g.region).data(rj),u.enter().append("g").attr("class",ud).append("rect").style("fill-opacity",0),u.exit().transition().duration(Z).style("opacity",0).remove(),s=kk.selectAll("."+g.bars).selectAll("."+g.bar).data(Je),s.enter().append("path").attr("class",od).style("stroke",function(a){return Oj(a.id)}).style("fill",function(a){return Oj(a.id)}),s.style("opacity",Gd),s.exit().transition().duration($).style("opacity",0).remove(),m=kk.selectAll("."+g.lines).selectAll("."+g.line).data(He),m.enter().append("path").attr("class",kd).style("stroke",Oj),m.style("opacity",Gd).attr("transform",null),m.exit().transition().duration($).style("opacity",0).remove(),n=kk.selectAll("."+g.areas).selectAll("."+g.area).data(He),n.enter().append("path").attr("class",sd).style("fill",Oj).style("opacity",function(){return qk=+jg.select(this).style("opacity"),0}),n.style("opacity",qk),n.exit().transition().duration($).style("opacity",0).remove(),Li&&(r=kk.selectAll("."+g.circles).selectAll("."+g.circle).data(Ke),r.enter().append("circle").attr("class",md).attr("r",mf).style("fill",Oj),r.style("opacity",Gd),r.exit().remove()),Kd()&&(v=kk.selectAll("."+g.texts).selectAll("."+g.text).data(Le),v.enter().append("text").attr("class",gd).attr("text-anchor",function(a){return Wh?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",Oj).style("fill-opacity",0),v.text(function(a){return Rd(a.id)(a.value,a.id)}).style("fill-opacity",Hd),v.exit().transition().duration($).style("fill-opacity",0).remove()),t=kk.selectAll("."+g.arcs).selectAll("."+g.arc).data(Ie),t.enter().append("path").attr("class",qd).style("fill",function(a){return Oj(a.data)}).style("cursor",function(a){return Dh(a)?"pointer":null}).style("opacity",0).each(function(a){Ee(a.data)&&(a.startAngle=a.endAngle=-1*(Math.PI/2)),this._current=a}).on("mouseover",function(a,b){var c,d,e;Mj||(c=Kb(a),d=Qb(c),e=Zb(),Sb(c.data.id),_f(c.data.id,!0),e(d,b))}).on("mousemove",function(a){var b=Kb(a),c=Qb(b),d=[c];de(d,jg.mouse(this))}).on("mouseout",function(a,b){var c,d,e;Mj||(c=Kb(a),d=Qb(c),e=$b(),Tb(c.data.id),ag(),ee(),e(d,b))}).on("click",function(a,b){var c=Kb(a),d=Qb(c),e=Yb();Jf(this,a,b),e(d,b)}),t.attr("transform",function(a){return!Ee(a.data)&&K?"scale(0)":""}).style("opacity",function(a){return a===this._current?0:1}).each(function(){Mj=!0}).transition().duration(Z).attrTween("d",function(a){var b,c=Kb(a);return c?(isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),b=jg.interpolate(this._current,c),this._current=b(0),function(a){return Nb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",K?"scale(1)":"").style("fill",function(a){return Pj?Pj(a.data.values[0].value):Oj(a.data.id)}).style("opacity",1).call(Xe,function(){Mj=!1}),t.exit().transition().duration($).style("opacity",0).remove(),kk.selectAll("."+g.chartArc).select("text").style("opacity",0).attr("class",function(a){return Ee(a.data)?g.gaugeValue:""}).text(Rb).attr("transform",Ob).transition().duration(Z).style("opacity",function(a){return Tc(a.data.id)&&Ge(a.data)?1:0}),kk.select("."+g.chartArcsTitle).style("opacity",ve(kg.data.targets)||ue(kg.data.targets)?1:0),Mh&&(jg.event&&"zoom"===jg.event.type&&gk.extent(ah.orgDomain()).update(),G&&(!Wh&&gi&&kb(Uj.subx,c.axisSubX,gi),gk.empty()||gk.extent(ah.orgDomain()).update(),R=vf(db,!0),T=xf(eb,!0),V=wf(fb,!0),y=lk.selectAll("."+g.bars).selectAll("."+g.bar).data(Je),y.enter().append("path").attr("class",od).style("stroke","none").style("fill",Oj),y.style("opacity",Gd).transition().duration(Z).attr("d",T).style("opacity",1),y.exit().transition().duration(Z).style("opacity",0).remove(),w=lk.selectAll("."+g.lines).selectAll("."+g.line).data(He),w.enter().append("path").attr("class",kd).style("stroke",Oj),w.style("opacity",Gd).transition().duration(Z).attr("d",V).style("opacity",1),w.exit().transition().duration(Z).style("opacity",0).remove(),x=lk.selectAll("."+g.areas).selectAll("."+g.area).data(He),x.enter().append("path").attr("class",sd).style("fill",Oj).style("opacity",function(){return qk=+jg.select(this).style("opacity"),0}),x.style("opacity",0).transition().duration(Z).attr("d",R).style("fill",Oj).style("opacity",qk),x.exit().transition().duration($).style("opacity",0).remove())),kk.selectAll("."+g.selectedCircles).filter(function(a){return Be(a)}).selectAll("circle").remove(),wg&&(z=kk.select("."+g.eventRects),Ue(lh)&&!zc(lh)?(z.classed(g.eventRectsMultiple)||z.classed(g.eventRectsMultiple,!0).classed(g.eventRectsSingle,!1).selectAll("."+g.eventRect).remove(),A=kk.select("."+g.eventRects).selectAll("."+g.eventRect).data([0]),If(A.enter()),A.attr("x",0).attr("y",0).attr("width",Fg).attr("height",Hg)):(z.classed(g.eventRectsSingle)||z.classed(g.eventRectsMultiple,!1).classed(g.eventRectsSingle,!0).selectAll("."+g.eventRect).remove(),!Hj&&!Fj||Gj?(E=Q(),D=function(a){return ah(a.x)-E/2}):(E=function(a){var b=Lc(a.index),c=Mc(a.index),d=kg.data.xs[a.id][a.index];return(ah(c?c:d)-ah(b?b:d))/2},D=function(a){var b=Lc(a.index),c=kg.data.xs[a.id][a.index];return(ah(c)+ah(b?b:c))/2}),B=Oc(kg.data.targets),kk.select("."+g.eventRects).datum(B?B.values:[]),A=kk.select("."+g.eventRects).selectAll("."+g.eventRect).data(function(a){return a}),Hf(A.enter()),A.attr("class",vd).attr("x",Wh?0:D).attr("y",Wh?D:0).attr("width",Wh?Fg:E).attr("height",Wh?E:Hg),A.exit().remove())),jg.transition().duration(Z).each(function(){hb.add(s.transition().attr("d",S).style("fill",Oj).style("opacity",1)),hb.add(m.transition().attr("d",U).style("stroke",Oj).style("opacity",1)),hb.add(n.transition().attr("d",P).style("fill",Oj).style("opacity",qk)),hb.add(r.transition().style("opacity",Id).style("fill",Oj).attr("cx",Wh?ne:me).attr("cy",Wh?me:ne)),hb.add(kk.selectAll("."+g.selectedCircle).transition().attr("cx",Wh?ne:me).attr("cy",Wh?me:ne)),hb.add(v.transition().attr("x",X).attr("y",Y).style("fill",Oj).style("fill-opacity",Jd)),hb.add(u.selectAll("rect").transition().attr("x",mc).attr("y",nc).attr("width",oc).attr("height",pc).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1})),hb.add(h.select("line").transition().attr("x1",Wh?0:Td).attr("x2",Wh?Fg:Td).attr("y1",Wh?Td:Cg.top).attr("y2",Wh?Td:Hg).style("opacity",1)),hb.add(h.select("text").transition().attr("x",Wh?Fg:0).attr("y",Td).text(function(a){return a.text}).style("opacity",1))}).call(hb,a.flow?function(){var b,c,e=1,f=a.flow.index,i=a.flow.length,j=Bc(kg.data.targets[0].values,f),k=Bc(kg.data.targets[0].values,f+i),l=ah.domain(),o=a.flow.duration||Z,p=a.flow.onend||function(){},q=Ye();kg.data.targets.forEach(function(a){a.values.splice(0,i)}),hc(ib,!0,!0),b=ah(j.x)-ah(k.x),Fj&&(b=.9*b,e=ic(l)/ic(ah.domain())),c="translate("+b+",0) scale("+e+",1)",jg.transition().ease("linear").duration(o).each(function(){q.add(Uj.x.transition().call(gh)),q.add(s.transition().attr("transform",c)),q.add(m.transition().attr("transform",c)),q.add(n.transition().attr("transform",c)),q.add(r.transition().attr("transform",c)),q.add(v.transition().attr("transform",c)),q.add(u.filter(qc).transition().attr("transform",c)),q.add(d.transition().attr("transform",c)),q.add(h.transition().attr("transform",c))}).call(q,function(){var a,b=[],c=[],e=[];for(a=0;i>a;a++)b.push("."+g.shape+"-"+(f+a)),c.push("."+g.text+"-"+(f+a)),e.push("."+g.eventRect+"-"+(f+a));ik.selectAll("."+g.shapes).selectAll(b).remove(),ik.selectAll("."+g.texts).selectAll(c).remove(),ik.selectAll("."+g.eventRects).selectAll(e).remove(),ik.select("."+g.xgrid).remove(),d.attr("transform",null),h.attr("transform",null),h.select("line").attr("x1",Wh?0:Td).attr("x2",Wh?Fg:Td),h.select("text").attr("x",Wh?Fg:0).attr("y",Td),s.attr("transform",null).attr("d",S),m.attr("transform",null).attr("d",U),n.attr("transform",null).attr("d",P),r.attr("transform",null).attr("cx",Wh?ne:me).attr("cy",Wh?me:ne),v.attr("transform",null).attr("x",X).attr("y",Y),u.attr("transform",null),u.select("rect").filter(qc).attr("x",mc),A.attr("x",Wh?0:D).attr("y",Wh?D:0).attr("width",Wh?Fg:E).attr("height",Wh?E:Hg),p()})}:null),Qc(kg.data.targets).forEach(function(a){rk[a]=!0})}function Pf(){Of({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function Qf(){if(0!==Vc(kg.data.targets).length){if("mousemove"===jg.event.sourceEvent.type&&hk.altDomain)return ah.domain(hk.altDomain),void hk.scale(ah).updateScaleExtent();Gj&&ah.orgDomain()[0]===pk[0]&&ah.domain([pk[0]-1e-10,ah.orgDomain()[1]]),Of({withTransition:!1,withY:!1,withSubchart:!1}),"mousemove"===jg.event.sourceEvent.type&&(Kj=!0)}}function Rf(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function Sf(){ik.attr("width",Jg).attr("height",Kg),ik.select("#"+zj).select("rect").attr("width",Fg).attr("height",Hg),ik.select("#"+Aj).select("rect").attr("x",G).attr("y",H).attr("width",M).attr("height",N),ik.select("#"+Bj).select("rect").attr("x",I).attr("y",J).attr("width",O).attr("height",P),ik.select("."+g.zoomRect).attr("width",Fg).attr("height",Hg),ok.style("max-height",Kg+"px")}function Tf(a){return{axisX:a?Uj.x.transition().duration(a):Uj.x,axisY:a?Uj.y.transition().duration(a):Uj.y,axisY2:a?Uj.y2.transition().duration(a):Uj.y2,axisSubX:a?Uj.subx.transition().duration(a):Uj.subx}}function Uf(a){var b;a=a||{},a.withTransition=Ze(a,"withTransition",!0),a.withTransform=Ze(a,"withTransform",!1),a.withLegend=Ze(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withLegend&&Qh||(b=Tf(a.withTransitionForAxis?Bg:0),p(),W(),Sf(),o(a.withTransition,b)),Of(a,b)}function Vf(a){var b,c,d,e,f,h,i,j,k,l,m,n;i=kk.select("."+g.chartTexts).selectAll("."+g.chartText).data(a).attr("class",xd),j=i.enter().append("g").attr("class",xd).style("opacity",0).style("pointer-events","none"),j.append("g").attr("class",hd),e=kk.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",zd),d=e.enter().append("g").attr("class",zd).style("opacity",0).style("pointer-events","none"),d.append("g").attr("class",pd).style("cursor",function(a){return Dh(a)?"pointer":null}),c=kk.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",yd),b=c.enter().append("g").attr("class",yd).style("opacity",0).style("pointer-events","none"),b.append("g").attr("class",ld),b.append("g").attr("class",td),b.append("g").attr("class",function(a){return fd(g.selectedCircles,a.id)}),b.append("g").attr("class",nd).style("cursor",function(a){return Dh(a)?"pointer":null}),a.forEach(function(a){kk.selectAll("."+g.selectedCircles+Bd(a.id)).selectAll("."+g.selectedCircle).each(function(b){b.value=a.values[b.index].value})}),h=kk.select("."+g.chartArcs).selectAll("."+g.chartArc).data(Tg(a)).attr("class",Ad),f=h.enter().append("g").attr("class",Ad),f.append("g").attr("class",rd),f.append("text").attr("dy",ue(kg.data.targets)?"-0.35em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),Mh&&(n=lk.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",zd),m=n.enter().append("g").style("opacity",0).attr("class",zd),m.append("g").attr("class",pd),l=lk.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",yd),k=l.enter().append("g").style("opacity",0).attr("class",yd),k.append("g").attr("class",ld),k.append("g").attr("class",td)),ik.selectAll("."+g.target).filter(function(a){return Tc(a.id)}).transition().duration(Bg).style("opacity",1)}function Wf(a,b){b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){b.types?pe(a.id,b.types[a.id]):pe(a.id,b.type)}),kg.data.targets.forEach(function(b){for(var c=0;cf&&(f=(m-l)/2,z=0,F++)),E[a]=F,D[F]=f,A[a]=z,z+=l}var f,h,i=_e(b.textContent,g.legendItem),j=10*Math.ceil((i.width+v)/10),k=10*Math.ceil((i.height+u)/10),l=$j?k:j,m=$j?V():U();return d&&(z=0,F=0,w=0,x=0),Qh&&!Uc(c)?void(B[c]=C[c]=E[c]=A[c]=0):(B[c]=j,C[c]=k,(!w||j>=w)&&(w=j),(!x||k>=x)&&(x=k),h=$j?x:w,void(Vh?(Object.keys(B).forEach(function(a){B[a]=w}),Object.keys(C).forEach(function(a){C[a]=x}),f=(m-h*a.length)/2,y>f?(z=0,F=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}var f,h,i,j,k,l,m,n,q,r,s,t,u=4,v=36,w=0,x=0,y=10,z=0,A={},B={},C={},D=[0],E={},F=0,G=mk.selectAll("."+g.legendItemFocused).size();b=b||{},n=Ze(b,"withTransition",!0),q=Ze(b,"withTransitionForTransform",!0),$j?(f=function(a){return w*E[a]},j=function(a){return D[E[a]]+A[a]}):(f=function(a){return D[E[a]]+A[a]},j=function(a){return x*E[a]}),h=function(a,b){return f(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return f(a,b)-4},l=function(a,b){return j(a,b)-7},m=mk.selectAll("."+g.legendItem).data(a).enter().append("g").attr("class",function(a){return fd(g.legendItem,a) -}).style("visibility",function(a){return Uc(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeof Sh?Sh(a):kg.toggle(a)}).on("mouseover",function(a){jg.select(this).classed(g.legendItemFocused,!0),Mj||kg.focus(a),"function"==typeof Th&&Th(a)}).on("mouseout",function(a){jg.select(this).classed(g.legendItemFocused,!1),Mj||kg.revert(),"function"==typeof Uh&&Uh(a)}),m.append("text").text(function(a){return d(oh[a])?oh[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",$j?h:-200).attr("y",$j?-200:k),m.append("rect").attr("class",g.legendItemEvent).style("fill-opacity",0).attr("x",$j?i:-200).attr("y",$j?-200:l),m.append("rect").attr("class",g.legendItemTile).style("pointer-events","none").style("fill",Oj).attr("x",$j?h:-200).attr("y",$j?-200:j).attr("width",10).attr("height",10),r=mk.selectAll("text").data(a).text(function(a){return d(oh[a])?oh[a]:a}).each(function(a,b){e(this,a,0===b)}),(n?r.transition():r).attr("x",h).attr("y",k),s=mk.selectAll("rect."+g.legendItemEvent).data(a),(n?s.transition():s).attr("width",function(a){return B[a]}).attr("height",function(a){return C[a]}).attr("x",i).attr("y",l),t=mk.selectAll("rect."+g.legendItemTile).data(a),(n?t.transition():t).style("fill",Oj).attr("x",f).attr("y",j),mk.selectAll("."+g.legendItem).classed(g.legendItemHidden,function(a){return!Tc(a)}).transition().style("opacity",function(a){var b=jg.select(this);return Tc(a)?!G||b.classed(g.legendItemFocused)?Zf(b):$f(b):ck}),S(w),T(x),R(F),p(),W(),Sf(),o(q,c)}function eg(a){return Sc(kg.data.targets,a.id)}function fg(a){return"data"in a&&Sc(kg.data.targets,a.data.id)}function gg(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 hg(a,b,c){var d=!we(kg.data.targets);Mj=!1,pe(a,b),Uf(c||{withTransitionForAxis:d})}function ig(a){var b=a.mineType?a.mineType:"csv";jg.xhr(f.data.url,function(a,c){var d;d="json"===b?Gc(JSON.parse(c.response)):Fc(c.response),Gf(d)})}var jg=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,kg={data:{},axis:{},legend:{}},lg={},mg=i(["bindto"],"#chart"),ng=i(["size","width"]),og=i(["size","height"]),pg=i(["padding","left"]),qg=i(["padding","right"]),rg=i(["padding","top"]),sg=i(["padding","bottom"]),tg=i(["zoom","enabled"],!1),ug=i(["zoom","extent"]),vg=i(["zoom","privileged"],!1),wg=i(["interaction","enabled"],!0),xg=i(["onenter"],function(){}),yg=i(["onleave"],function(){}),zg=i(["onresize"],function(){}),Ag=i(["onresized"],function(){}),Bg=i(["transition","duration"],350);h("data","data is required in config");var Cg,Dg,Eg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,Og,Pg,Qg,Rg,Sg,Tg,Ug,Vg,Wg,Xg,Yg,Zg,$g,_g,ah,bh,ch,dh,eh,fh,gh,hh,ih,jh,kh=i(["data","x"]),lh=i(["data","xs"],{}),mh=i(["data","x_format"]),nh=i(["data","id_converter"],function(a){return a}),oh=i(["data","names"],{}),ph=i(["data","classes"],{}),qh=i(["data","groups"],[]),rh=i(["data","axes"],{}),sh=i(["data","type"]),th=i(["data","types"],{}),uh=i(["data","labels"],{}),vh=i(["data","order"]),wh=i(["data","regions"],{}),xh=i(["data","color"]),yh=i(["data","colors"],{}),zh=i(["data","hide"],!1),Ah=i(["data","filter"]),Bh=i(["data","selection","enabled"],!1),Ch=i(["data","selection","grouped"],!1),Dh=i(["data","selection","isselectable"],function(){return!0}),Eh=i(["data","selection","multiple"],!0),Fh=i(["data","onclick"],function(){}),Gh=i(["data","onenter"],function(){}),Hh=i(["data","onleave"],function(){}),Ih=i(["data","onselected"],function(){}),Jh=i(["data","onunselected"],function(){}),Kh=i(["data","ondragstart"],function(){}),Lh=i(["data","ondragend"],function(){}),Mh=i(["subchart","show"],!1),Nh=i(["subchart","size","height"],60),Oh=i(["color","pattern"],[]),Ph=i(["color","threshold"],{}),Qh=i(["legend","show"],!0),Rh=i(["legend","position"],"bottom"),Sh=i(["legend","item","onclick"]),Th=i(["legend","item","onmouseover"]),Uh=i(["legend","item","onmouseout"]),Vh=i(["legend","equally"],!1),Wh=i(["axis","rotated"],!1),Xh=i(["axis","x","show"],!0),Yh=i(["axis","x","type"],"indexed"),Zh=i(["axis","x","localtime"],!0),$h=i(["axis","x","categories"],[]),_h=i(["axis","x","tick","centered"],!1),ai=i(["axis","x","tick","format"]),bi=i(["axis","x","tick","culling"],{}),ci=i(["axis","x","tick","culling","max"],10),di=i(["axis","x","tick","count"]),ei=i(["axis","x","tick","fit"],!0),fi=i(["axis","x","tick","values"],null),gi=i(["axis","x","tick","rotate"]),hi=i(["axis","x","max"],null),ii=i(["axis","x","min"],null),ji=i(["axis","x","padding"],{}),ki=i(["axis","x","height"]),li=i(["axis","x","default"]),mi=i(["axis","x","label"],{}),ni=i(["axis","y","show"],!0),oi=i(["axis","y","max"]),pi=i(["axis","y","min"]),qi=i(["axis","y","center"]),ri=i(["axis","y","label"],{}),si=i(["axis","y","inner"],!1),ti=i(["axis","y","tick","format"]),ui=i(["axis","y","padding"]),vi=i(["axis","y","ticks"],10),wi=i(["axis","y2","show"],!1),xi=i(["axis","y2","max"]),yi=i(["axis","y2","min"]),zi=i(["axis","y2","center"]),Ai=i(["axis","y2","label"],{}),Bi=i(["axis","y2","inner"],!1),Ci=i(["axis","y2","tick","format"]),Di=i(["axis","y2","padding"]),Ei=i(["axis","y2","ticks"],10),Fi=i(["grid","x","show"],!1),Gi=i(["grid","x","type"],"tick"),Hi=i(["grid","x","lines"],[]),Ii=i(["grid","y","show"],!1),Ji=i(["grid","y","lines"],[]),Ki=i(["grid","y","ticks"],10),Li=i(["point","show"],!0),Mi=i(["point","r"],2.5),Ni=i(["point","focus","line","enabled"],!0),Oi=i(["point","focus","expand","enabled"],!0),Pi=i(["point","focus","expand","r"]),Qi=i(["point","focus","select","r"]),Ri=i(["line","connect_null"],!1),Si=i(["bar","width"]),Ti=i(["bar","width","ratio"],.6),Ui=i(["pie","label","show"],!0),Vi=i(["pie","label","format"]),Wi=i(["pie","label","threshold"],.05),Xi=i(["pie","expand"],!0),Yi=i(["pie","onclick"],function(){}),Zi=i(["pie","onmouseover"],function(){}),$i=i(["pie","onmouseout"],function(){}),_i=i(["gauge","label","show"],!0),aj=i(["gauge","label","format"]),bj=i(["gauge","expand"],!0),cj=i(["gauge","min"],0),dj=i(["gauge","max"],100),ej=i(["gauge","onclick"],function(){}),fj=i(["gauge","onmouseover"],function(){}),gj=i(["gauge","onmouseout"],function(){}),hj=i(["gauge","units"]),ij=i(["gauge","width"]),jj=i(["donut","label","show"],!0),kj=i(["donut","label","format"]),lj=i(["donut","label","threshold"],.05),mj=i(["donut","expand"],!0),nj=i(["donut","title"],""),oj=i(["donut","onclick"],function(){}),pj=i(["donut","onmouseover"],function(){}),qj=i(["donut","onmouseout"],function(){}),rj=i(["regions"],[]),sj=i(["tooltip","show"],!0),tj=i(["tooltip","format","title"]),uj=i(["tooltip","format","value"]),vj=i(["tooltip","contents"],function(a,b,c,d){var e,f,h,i,j,k,l=tj?tj:b,m=uj?uj:c;for(f=0;f"+(h||0===h?""+h+"":"")),j=a[f].name,i=m(a[f].value,a[f].ratio,a[f].id,a[f].index),k=Pj?Pj(a[f].value):d(a[f].id),e+="",e+=""+j+"",e+=""+i+"",e+="");return e+""}),wj=i(["tooltip","init","show"],!1),xj=i(["tooltip","init","x"],0),yj=i(["tooltip","init","position"],{top:"0px",left:"50px"}),zj="c3-"+ +new Date+"-clip",Aj=zj+"-xaxis",Bj=zj+"-yaxis",Cj=j(zj),Dj=j(Aj),Ej=j(Bj),Fj="timeseries"===Yh,Gj="categorized"===Yh,Hj=!Fj&&(kh||Ue(lh)),Ij=null,Jj=!1,Kj=!1,Lj=!1,Mj=!1,Nj=jg.scale.category10().range(),Oj=Ne(yh,Ue(Oh)?Oh:Nj,xh),Pj=Ue(Ph)?Oe(Oh,Ph):null,Qj=Zh?jg.time.format:jg.time.format.utc,Rj=Qj.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),Sj=[],Tj=[],Uj={},Vj=Wh?"left":"bottom",Wj=Wh?si?"top":"bottom":si?"right":"left",Xj=Wh?Bi?"bottom":"top":Bi?"left":"right",Yj=Wh?"left":"bottom",Zj={main:function(){return"translate("+k(Cg.left)+","+k(Cg.top)+")"},context:function(){return"translate("+k(Dg.left)+","+k(Dg.top)+")"},legend:function(){return"translate("+Eg.left+","+Eg.top+")"},x:function(){return"translate(0,"+(Wh?0:Hg)+")"},y:function(){return"translate(0,"+(Wh?Hg:0)+")"},y2:function(){return"translate("+(Wh?0:Fg)+","+(Wh?1:0)+")"},subx:function(){return"translate(0,"+(Wh?0:Ig)+")"},arc:function(){return"translate("+Og/2+","+Pg/2+")"}},$j="right"===Rh,_j=0,ak=0,bk=0,ck=.15,dk=30,ek=Wh&&!Xh?0:30,fk=5;Tg=jg.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var gk,hk=function(){};gk=jg.svg.brush().on("brush",Pf),gk.update=function(){return lk&&lk.select("."+g.brush).call(this),this},gk.scale=function(a){return Wh?this.y(a):this.x(a)},tg&&(hk=jg.behavior.zoom().on("zoomstart",function(){hk.altDomain=jg.event.sourceEvent.altKey?ah.orgDomain():null}).on("zoom",tg?Qf:null),hk.scale=function(a){return Wh?this.y(a):this.x(a)},hk.orgScaleExtent=function(){var a=ug?ug:[1,10];return[a[0],Math.max(Nc()/a[1],a[1])]},hk.updateScaleExtent=function(){var a=ic(ah.orgDomain())/ic(pk),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var ik,jk,kk,lk,mk,nk,ok,pk,qk,rk={};if(kg.focus=function(a){function b(a){Vc(a).transition().duration(100).style("opacity",1)}var c=ik.selectAll(Cd(a)),d=c.filter(eg),e=c.filter(fg);kg.revert(),kg.defocus(),b(d.classed(g.focused,!0)),b(e),we(kg.data.targets)&&Sb(a,!0),_f(a,!0)},kg.defocus=function(a){function b(a){Vc(a).transition().duration(100).style("opacity",.3)}var c=ik.selectAll(Cd(a)),d=c.filter(eg),e=c.filter(fg);kg.revert(),b(d.classed(g.focused,!1)),b(e),we(kg.data.targets)&&Tb(a),_f(a,!1)},kg.revert=function(a){function b(a){Vc(a).transition().duration(100).style("opacity",1)}var c=ik.selectAll(Cd(a)),d=c.filter(eg),e=c.filter(fg);b(d.classed(g.focused,!1)),b(e),we(kg.data.targets)&&Tb(a),ag()},kg.show=function(a,b){a=Rc(a),b=b||{},Zc(a),ik.selectAll(Dd(a)).transition().style("opacity",1),b.withLegend&&bg(a),Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},kg.hide=function(a,b){a=Rc(a),b=b||{},Yc(a),ik.selectAll(Dd(a)).transition().style("opacity",0),b.withLegend&&cg(a),Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},kg.toggle=function(a){Tc(a)?kg.hide(a):kg.show(a)},kg.unzoom=function(){gk.clear().update(),Of({withUpdateXDomain:!0})},kg.load=function(a){return a.xs&&yc(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){ph[b]=a.classes[b]}),"categories"in a&&Gj&&($h=a.categories),"cacheIds"in a&&jc(a.cacheIds)?void Wf(lc(a.cacheIds),a.done):void("unload"in a?Yf(Rc("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){Xf(a)}):Xf(a))},kg.unload=function(a,b){Yf(Rc(a),function(){Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeof b&&b()})},kg.flow=function(a){var b,c,d=Jc(Ic(a.columns),!0),e=[];kg.data.targets.forEach(function(a){var f,g,h=!1;for(f=0;ff;f++)a.values.push({id:a.id,index:c+f,x:Fj?xc(c+f):c+f,value:null})}),d.forEach(function(a){var b,d=[];for(b=kg.data.targets[0].values[0].index;c>b;b++)d.push({id:a.id,index:b,x:Fj?xc(b):b,value:null});a.values.forEach(function(a){a.index+=c,Fj||(a.x+=c)}),a.values=d.concat(a.values)}),kg.data.targets=kg.data.targets.concat(d),Vf(kg.data.targets),Of({flow:{index:kg.data.targets[0].values[0].index,length:b,duration:a.duration,onend:a.onend},withLegend:!0})},kg.selected=function(a){return jg.merge(kk.selectAll("."+g.shapes+Bd(a)).selectAll("."+g.shape).filter(function(){return jg.select(this).classed(g.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},kg.select=function(a,b,c){Bh&&kk.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(e,f){var h=jg.select(this),i=e.data?e.data.id:e.id,j=kf(this),k=Ch||!a||a.indexOf(i)>=0,l=!b||b.indexOf(f)>=0,m=h.classed(g.SELECTED);h.classed(g.line)||h.classed(g.area)||(k&&l?Dh(e)&&!m&&j(!0,h.classed(g.SELECTED,!0),e,f):d(c)&&c&&m&&j(!1,h.classed(g.SELECTED,!1),e,f))})},kg.unselect=function(a,b){Bh&&kk.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(c,d){var e=jg.select(this),f=c.data?c.data.id:c.id,h=kf(this),i=Ch||!a||a.indexOf(f)>=0,j=!b||b.indexOf(d)>=0,k=e.classed(g.SELECTED);e.classed(g.line)||e.classed(g.area)||i&&j&&Dh(c)&&k&&h(!1,e.classed(g.SELECTED,!1),c,d)})},kg.toLine=function(a){hg(a,"line")},kg.toSpline=function(a){hg(a,"spline")},kg.toBar=function(a){hg(a,"bar")},kg.toScatter=function(a){hg(a,"scatter")},kg.toArea=function(a){hg(a,"area")},kg.toAreaSpline=function(a){hg(a,"area-spline")},kg.toPie=function(a){hg(a,"pie",{withTransform:!0})},kg.toDonut=function(a){hg(a,"donut",{withTransform:!0})},kg.groups=function(a){return c(a)?qh:(qh=a,Of(),qh)},kg.xgrids=function(a){return a?(Hi=a,Of(),Hi):Hi},kg.xgrids.add=function(a){return a?kg.xgrids(Hi.concat(a)):void 0},kg.xgrids.remove=function(a){var b=gg(a);return kg.xgrids(Hi.filter(b))},kg.ygrids=function(a){return a?(Ji=a,Of(),Ji):Ji},kg.ygrids.add=function(a){return a?kg.ygrids(Ji.concat(a)):void 0},kg.ygrids.remove=function(a){var b=gg(a);return kg.ygrids(Ji.filter(b))},kg.regions=function(a){return a?(rj=a,Of(),rj):rj},kg.regions.add=function(a){return a?(rj=rj.concat(a),Of(),rj):rj},kg.regions.remove=function(a){var b,c,d;return a=a||{},b=Ze(a,"duration",Bg),c=Ze(a,"classes",[g.region]),d=kk.select("."+g.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),rj=rj.filter(function(a){var b=!1;return a.class?(a.class.split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0})},kg.data.get=function(a){var b=kg.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},kg.data.getAsTarget=function(a){var b=kg.data.targets.filter(function(b){return b.id===a});return b.length>0?b[0]:void 0},kg.data.names=function(a){return arguments.length?(Object.keys(a).forEach(function(b){oh[b]=a[b]}),Of({withLegend:!0}),oh):oh},kg.data.colors=function(a){return arguments.length?(Object.keys(a).forEach(function(b){yh[b]=a[b]}),Of({withLegend:!0}),yh):yh},kg.x=function(a){return arguments.length&&(Cc(kg.data.targets,a),Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),kg.data.xs},kg.xs=function(a){return arguments.length&&(Dc(kg.data.targets,a),Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),kg.data.xs},kg.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){hb(b,a[b])}),Jb())},kg.axis.max=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(hi=+a.x),b(a.y)&&(oi=+a.y),b(a.y2)&&(xi=+a.y2)):oi=xi=+a,Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},kg.axis.min=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(ii=+a.x),b(a.y)&&(pi=+a.y),b(a.y2)&&(yi=+a.y2)):pi=yi=+a,Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},kg.axis.range=function(a){arguments.length&&("undefined"!=typeof a.max&&kg.axis.max(a.max),"undefined"!=typeof a.min&&kg.axis.min(a.min))},kg.legend.show=function(a){bg(Rc(a)),Of({withLegend:!0})},kg.legend.hide=function(a){cg(Rc(a)),Of({withLegend:!0})},kg.resize=function(a){ng=a?a.width:null,og=a?a.height:null,kg.flush(),kg.flush()},kg.flush=function(){Uf({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},kg.destroy=function(){kg.data.targets=void 0,kg.data.xs={},ok.classed("c3",!1).html(""),a.onresize=null},f.data.url)ig(f.data);else if(f.data.json)Gf(Gc(f.data.json));else if(f.data.rows)Gf(Hc(f.data.rows));else{if(!f.data.columns)throw Error("url or json or rows or columns is required.");Gf(Ic(f.data.columns))}return kg},"function"==typeof define&&define.amd?define("c3",["d3"],f):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=f:a.c3=f}(window); \ No newline at end of file +}).style("visibility",function(a){return Uc(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeof Sh?Sh(a):kg.toggle(a)}).on("mouseover",function(a){jg.select(this).classed(g.legendItemFocused,!0),Mj||kg.focus(a),"function"==typeof Th&&Th(a)}).on("mouseout",function(a){jg.select(this).classed(g.legendItemFocused,!1),Mj||kg.revert(),"function"==typeof Uh&&Uh(a)}),m.append("text").text(function(a){return d(oh[a])?oh[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",$j?h:-200).attr("y",$j?-200:k),m.append("rect").attr("class",g.legendItemEvent).style("fill-opacity",0).attr("x",$j?i:-200).attr("y",$j?-200:l),m.append("rect").attr("class",g.legendItemTile).style("pointer-events","none").style("fill",Oj).attr("x",$j?h:-200).attr("y",$j?-200:j).attr("width",10).attr("height",10),r=mk.selectAll("text").data(a).text(function(a){return d(oh[a])?oh[a]:a}).each(function(a,b){e(this,a,0===b)}),(n?r.transition():r).attr("x",h).attr("y",k),s=mk.selectAll("rect."+g.legendItemEvent).data(a),(n?s.transition():s).attr("width",function(a){return B[a]}).attr("height",function(a){return C[a]}).attr("x",i).attr("y",l),t=mk.selectAll("rect."+g.legendItemTile).data(a),(n?t.transition():t).style("fill",Oj).attr("x",f).attr("y",j),mk.selectAll("."+g.legendItem).classed(g.legendItemHidden,function(a){return!Tc(a)}).transition().style("opacity",function(a){var b=jg.select(this);return Tc(a)?!G||b.classed(g.legendItemFocused)?Zf(b):$f(b):ck}),S(w),T(x),R(F),p(),W(),Sf(),o(q,c)}function eg(a){return Sc(kg.data.targets,a.id)}function fg(a){return"data"in a&&Sc(kg.data.targets,a.data.id)}function gg(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 hg(a,b,c){var d=!we(kg.data.targets);Mj=!1,pe(a,b),Uf(c||{withTransitionForAxis:d})}function ig(a){var b=a.mimeType?a.mimeType:"csv";jg.xhr(f.data.url,function(a,c){var d;d="json"===b?Gc(JSON.parse(c.response)):Fc(c.response),Gf(d)})}var jg=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,kg={data:{},axis:{},legend:{}},lg={},mg=i(["bindto"],"#chart"),ng=i(["size","width"]),og=i(["size","height"]),pg=i(["padding","left"]),qg=i(["padding","right"]),rg=i(["padding","top"]),sg=i(["padding","bottom"]),tg=i(["zoom","enabled"],!1),ug=i(["zoom","extent"]),vg=i(["zoom","privileged"],!1),wg=i(["interaction","enabled"],!0),xg=i(["onenter"],function(){}),yg=i(["onleave"],function(){}),zg=i(["onresize"],function(){}),Ag=i(["onresized"],function(){}),Bg=i(["transition","duration"],350);h("data","data is required in config");var Cg,Dg,Eg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,Og,Pg,Qg,Rg,Sg,Tg,Ug,Vg,Wg,Xg,Yg,Zg,$g,_g,ah,bh,ch,dh,eh,fh,gh,hh,ih,jh,kh=i(["data","x"]),lh=i(["data","xs"],{}),mh=i(["data","x_format"]),nh=i(["data","id_converter"],function(a){return a}),oh=i(["data","names"],{}),ph=i(["data","classes"],{}),qh=i(["data","groups"],[]),rh=i(["data","axes"],{}),sh=i(["data","type"]),th=i(["data","types"],{}),uh=i(["data","labels"],{}),vh=i(["data","order"]),wh=i(["data","regions"],{}),xh=i(["data","color"]),yh=i(["data","colors"],{}),zh=i(["data","hide"],!1),Ah=i(["data","filter"]),Bh=i(["data","selection","enabled"],!1),Ch=i(["data","selection","grouped"],!1),Dh=i(["data","selection","isselectable"],function(){return!0}),Eh=i(["data","selection","multiple"],!0),Fh=i(["data","onclick"],function(){}),Gh=i(["data","onenter"],function(){}),Hh=i(["data","onleave"],function(){}),Ih=i(["data","onselected"],function(){}),Jh=i(["data","onunselected"],function(){}),Kh=i(["data","ondragstart"],function(){}),Lh=i(["data","ondragend"],function(){}),Mh=i(["subchart","show"],!1),Nh=i(["subchart","size","height"],60),Oh=i(["color","pattern"],[]),Ph=i(["color","threshold"],{}),Qh=i(["legend","show"],!0),Rh=i(["legend","position"],"bottom"),Sh=i(["legend","item","onclick"]),Th=i(["legend","item","onmouseover"]),Uh=i(["legend","item","onmouseout"]),Vh=i(["legend","equally"],!1),Wh=i(["axis","rotated"],!1),Xh=i(["axis","x","show"],!0),Yh=i(["axis","x","type"],"indexed"),Zh=i(["axis","x","localtime"],!0),$h=i(["axis","x","categories"],[]),_h=i(["axis","x","tick","centered"],!1),ai=i(["axis","x","tick","format"]),bi=i(["axis","x","tick","culling"],{}),ci=i(["axis","x","tick","culling","max"],10),di=i(["axis","x","tick","count"]),ei=i(["axis","x","tick","fit"],!0),fi=i(["axis","x","tick","values"],null),gi=i(["axis","x","tick","rotate"]),hi=i(["axis","x","max"],null),ii=i(["axis","x","min"],null),ji=i(["axis","x","padding"],{}),ki=i(["axis","x","height"]),li=i(["axis","x","default"]),mi=i(["axis","x","label"],{}),ni=i(["axis","y","show"],!0),oi=i(["axis","y","max"]),pi=i(["axis","y","min"]),qi=i(["axis","y","center"]),ri=i(["axis","y","label"],{}),si=i(["axis","y","inner"],!1),ti=i(["axis","y","tick","format"]),ui=i(["axis","y","padding"]),vi=i(["axis","y","ticks"],10),wi=i(["axis","y2","show"],!1),xi=i(["axis","y2","max"]),yi=i(["axis","y2","min"]),zi=i(["axis","y2","center"]),Ai=i(["axis","y2","label"],{}),Bi=i(["axis","y2","inner"],!1),Ci=i(["axis","y2","tick","format"]),Di=i(["axis","y2","padding"]),Ei=i(["axis","y2","ticks"],10),Fi=i(["grid","x","show"],!1),Gi=i(["grid","x","type"],"tick"),Hi=i(["grid","x","lines"],[]),Ii=i(["grid","y","show"],!1),Ji=i(["grid","y","lines"],[]),Ki=i(["grid","y","ticks"],10),Li=i(["point","show"],!0),Mi=i(["point","r"],2.5),Ni=i(["point","focus","line","enabled"],!0),Oi=i(["point","focus","expand","enabled"],!0),Pi=i(["point","focus","expand","r"]),Qi=i(["point","focus","select","r"]),Ri=i(["line","connect_null"],!1),Si=i(["bar","width"]),Ti=i(["bar","width","ratio"],.6),Ui=i(["pie","label","show"],!0),Vi=i(["pie","label","format"]),Wi=i(["pie","label","threshold"],.05),Xi=i(["pie","expand"],!0),Yi=i(["pie","onclick"],function(){}),Zi=i(["pie","onmouseover"],function(){}),$i=i(["pie","onmouseout"],function(){}),_i=i(["gauge","label","show"],!0),aj=i(["gauge","label","format"]),bj=i(["gauge","expand"],!0),cj=i(["gauge","min"],0),dj=i(["gauge","max"],100),ej=i(["gauge","onclick"],function(){}),fj=i(["gauge","onmouseover"],function(){}),gj=i(["gauge","onmouseout"],function(){}),hj=i(["gauge","units"]),ij=i(["gauge","width"]),jj=i(["donut","label","show"],!0),kj=i(["donut","label","format"]),lj=i(["donut","label","threshold"],.05),mj=i(["donut","expand"],!0),nj=i(["donut","title"],""),oj=i(["donut","onclick"],function(){}),pj=i(["donut","onmouseover"],function(){}),qj=i(["donut","onmouseout"],function(){}),rj=i(["regions"],[]),sj=i(["tooltip","show"],!0),tj=i(["tooltip","format","title"]),uj=i(["tooltip","format","value"]),vj=i(["tooltip","contents"],function(a,b,c,d){var e,f,h,i,j,k,l=tj?tj:b,m=uj?uj:c;for(f=0;f"+(h||0===h?""+h+"":"")),j=a[f].name,i=m(a[f].value,a[f].ratio,a[f].id,a[f].index),k=Pj?Pj(a[f].value):d(a[f].id),e+="",e+=""+j+"",e+=""+i+"",e+="");return e+""}),wj=i(["tooltip","init","show"],!1),xj=i(["tooltip","init","x"],0),yj=i(["tooltip","init","position"],{top:"0px",left:"50px"}),zj="c3-"+ +new Date+"-clip",Aj=zj+"-xaxis",Bj=zj+"-yaxis",Cj=j(zj),Dj=j(Aj),Ej=j(Bj),Fj="timeseries"===Yh,Gj="categorized"===Yh,Hj=!Fj&&(kh||Ue(lh)),Ij=null,Jj=!1,Kj=!1,Lj=!1,Mj=!1,Nj=jg.scale.category10().range(),Oj=Ne(yh,Ue(Oh)?Oh:Nj,xh),Pj=Ue(Ph)?Oe(Oh,Ph):null,Qj=Zh?jg.time.format:jg.time.format.utc,Rj=Qj.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),Sj=[],Tj=[],Uj={},Vj=Wh?"left":"bottom",Wj=Wh?si?"top":"bottom":si?"right":"left",Xj=Wh?Bi?"bottom":"top":Bi?"left":"right",Yj=Wh?"left":"bottom",Zj={main:function(){return"translate("+k(Cg.left)+","+k(Cg.top)+")"},context:function(){return"translate("+k(Dg.left)+","+k(Dg.top)+")"},legend:function(){return"translate("+Eg.left+","+Eg.top+")"},x:function(){return"translate(0,"+(Wh?0:Hg)+")"},y:function(){return"translate(0,"+(Wh?Hg:0)+")"},y2:function(){return"translate("+(Wh?0:Fg)+","+(Wh?1:0)+")"},subx:function(){return"translate(0,"+(Wh?0:Ig)+")"},arc:function(){return"translate("+Og/2+","+Pg/2+")"}},$j="right"===Rh,_j=0,ak=0,bk=0,ck=.15,dk=30,ek=Wh&&!Xh?0:30,fk=5;Tg=jg.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var gk,hk=function(){};gk=jg.svg.brush().on("brush",Pf),gk.update=function(){return lk&&lk.select("."+g.brush).call(this),this},gk.scale=function(a){return Wh?this.y(a):this.x(a)},tg&&(hk=jg.behavior.zoom().on("zoomstart",function(){hk.altDomain=jg.event.sourceEvent.altKey?ah.orgDomain():null}).on("zoom",tg?Qf:null),hk.scale=function(a){return Wh?this.y(a):this.x(a)},hk.orgScaleExtent=function(){var a=ug?ug:[1,10];return[a[0],Math.max(Nc()/a[1],a[1])]},hk.updateScaleExtent=function(){var a=ic(ah.orgDomain())/ic(pk),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var ik,jk,kk,lk,mk,nk,ok,pk,qk,rk={};if(kg.focus=function(a){function b(a){Vc(a).transition().duration(100).style("opacity",1)}var c=ik.selectAll(Cd(a)),d=c.filter(eg),e=c.filter(fg);kg.revert(),kg.defocus(),b(d.classed(g.focused,!0)),b(e),we(kg.data.targets)&&Sb(a,!0),_f(a,!0)},kg.defocus=function(a){function b(a){Vc(a).transition().duration(100).style("opacity",.3)}var c=ik.selectAll(Cd(a)),d=c.filter(eg),e=c.filter(fg);kg.revert(),b(d.classed(g.focused,!1)),b(e),we(kg.data.targets)&&Tb(a),_f(a,!1)},kg.revert=function(a){function b(a){Vc(a).transition().duration(100).style("opacity",1)}var c=ik.selectAll(Cd(a)),d=c.filter(eg),e=c.filter(fg);b(d.classed(g.focused,!1)),b(e),we(kg.data.targets)&&Tb(a),ag()},kg.show=function(a,b){a=Rc(a),b=b||{},Zc(a),ik.selectAll(Dd(a)).transition().style("opacity",1),b.withLegend&&bg(a),Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},kg.hide=function(a,b){a=Rc(a),b=b||{},Yc(a),ik.selectAll(Dd(a)).transition().style("opacity",0),b.withLegend&&cg(a),Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},kg.toggle=function(a){Tc(a)?kg.hide(a):kg.show(a)},kg.unzoom=function(){gk.clear().update(),Of({withUpdateXDomain:!0})},kg.load=function(a){return a.xs&&yc(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){ph[b]=a.classes[b]}),"categories"in a&&Gj&&($h=a.categories),"cacheIds"in a&&jc(a.cacheIds)?void Wf(lc(a.cacheIds),a.done):void("unload"in a?Yf(Rc("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){Xf(a)}):Xf(a))},kg.unload=function(a,b){Yf(Rc(a),function(){Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeof b&&b()})},kg.flow=function(a){var b,c,d=Jc(Ic(a.columns),!0),e=[];kg.data.targets.forEach(function(a){var f,g,h=!1;for(f=0;ff;f++)a.values.push({id:a.id,index:c+f,x:Fj?xc(c+f):c+f,value:null})}),d.forEach(function(a){var b,d=[];for(b=kg.data.targets[0].values[0].index;c>b;b++)d.push({id:a.id,index:b,x:Fj?xc(b):b,value:null});a.values.forEach(function(a){a.index+=c,Fj||(a.x+=c)}),a.values=d.concat(a.values)}),kg.data.targets=kg.data.targets.concat(d),Vf(kg.data.targets),Of({flow:{index:kg.data.targets[0].values[0].index,length:b,duration:a.duration,onend:a.onend},withLegend:!0})},kg.selected=function(a){return jg.merge(kk.selectAll("."+g.shapes+Bd(a)).selectAll("."+g.shape).filter(function(){return jg.select(this).classed(g.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},kg.select=function(a,b,c){Bh&&kk.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(e,f){var h=jg.select(this),i=e.data?e.data.id:e.id,j=kf(this),k=Ch||!a||a.indexOf(i)>=0,l=!b||b.indexOf(f)>=0,m=h.classed(g.SELECTED);h.classed(g.line)||h.classed(g.area)||(k&&l?Dh(e)&&!m&&j(!0,h.classed(g.SELECTED,!0),e,f):d(c)&&c&&m&&j(!1,h.classed(g.SELECTED,!1),e,f))})},kg.unselect=function(a,b){Bh&&kk.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(c,d){var e=jg.select(this),f=c.data?c.data.id:c.id,h=kf(this),i=Ch||!a||a.indexOf(f)>=0,j=!b||b.indexOf(d)>=0,k=e.classed(g.SELECTED);e.classed(g.line)||e.classed(g.area)||i&&j&&Dh(c)&&k&&h(!1,e.classed(g.SELECTED,!1),c,d)})},kg.toLine=function(a){hg(a,"line")},kg.toSpline=function(a){hg(a,"spline")},kg.toBar=function(a){hg(a,"bar")},kg.toScatter=function(a){hg(a,"scatter")},kg.toArea=function(a){hg(a,"area")},kg.toAreaSpline=function(a){hg(a,"area-spline")},kg.toPie=function(a){hg(a,"pie",{withTransform:!0})},kg.toDonut=function(a){hg(a,"donut",{withTransform:!0})},kg.groups=function(a){return c(a)?qh:(qh=a,Of(),qh)},kg.xgrids=function(a){return a?(Hi=a,Of(),Hi):Hi},kg.xgrids.add=function(a){return a?kg.xgrids(Hi.concat(a)):void 0},kg.xgrids.remove=function(a){var b=gg(a);return kg.xgrids(Hi.filter(b))},kg.ygrids=function(a){return a?(Ji=a,Of(),Ji):Ji},kg.ygrids.add=function(a){return a?kg.ygrids(Ji.concat(a)):void 0},kg.ygrids.remove=function(a){var b=gg(a);return kg.ygrids(Ji.filter(b))},kg.regions=function(a){return a?(rj=a,Of(),rj):rj},kg.regions.add=function(a){return a?(rj=rj.concat(a),Of(),rj):rj},kg.regions.remove=function(a){var b,c,d;return a=a||{},b=Ze(a,"duration",Bg),c=Ze(a,"classes",[g.region]),d=kk.select("."+g.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),rj=rj.filter(function(a){var b=!1;return a.class?(a.class.split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0})},kg.data.get=function(a){var b=kg.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},kg.data.getAsTarget=function(a){var b=kg.data.targets.filter(function(b){return b.id===a});return b.length>0?b[0]:void 0},kg.data.names=function(a){return arguments.length?(Object.keys(a).forEach(function(b){oh[b]=a[b]}),Of({withLegend:!0}),oh):oh},kg.data.colors=function(a){return arguments.length?(Object.keys(a).forEach(function(b){yh[b]=a[b]}),Of({withLegend:!0}),yh):yh},kg.x=function(a){return arguments.length&&(Cc(kg.data.targets,a),Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),kg.data.xs},kg.xs=function(a){return arguments.length&&(Dc(kg.data.targets,a),Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),kg.data.xs},kg.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){hb(b,a[b])}),Jb())},kg.axis.max=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(hi=+a.x),b(a.y)&&(oi=+a.y),b(a.y2)&&(xi=+a.y2)):oi=xi=+a,Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},kg.axis.min=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(ii=+a.x),b(a.y)&&(pi=+a.y),b(a.y2)&&(yi=+a.y2)):pi=yi=+a,Of({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},kg.axis.range=function(a){arguments.length&&("undefined"!=typeof a.max&&kg.axis.max(a.max),"undefined"!=typeof a.min&&kg.axis.min(a.min))},kg.legend.show=function(a){bg(Rc(a)),Of({withLegend:!0})},kg.legend.hide=function(a){cg(Rc(a)),Of({withLegend:!0})},kg.resize=function(a){ng=a?a.width:null,og=a?a.height:null,kg.flush(),kg.flush()},kg.flush=function(){Uf({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},kg.destroy=function(){kg.data.targets=void 0,kg.data.xs={},ok.classed("c3",!1).html(""),a.onresize=null},f.data.url)ig(f.data);else if(f.data.json)Gf(Gc(f.data.json));else if(f.data.rows)Gf(Hc(f.data.rows));else{if(!f.data.columns)throw Error("url or json or rows or columns is required.");Gf(Ic(f.data.columns))}return kg},"function"==typeof define&&define.amd?define("c3",["d3"],f):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=f:a.c3=f}(window); \ No newline at end of file diff --git a/htdocs/samples/data_url.html b/htdocs/samples/data_url.html index d2cad82..a5a2f82 100644 --- a/htdocs/samples/data_url.html +++ b/htdocs/samples/data_url.html @@ -21,7 +21,7 @@ bindto: '#chart2', data: { url: '/data/c3_test.json', - mineType: 'json' + mimeType: 'json' } });