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