Browse Source

Merge branch 'master' into area

Conflicts:
	c3.js
pull/22/head
mikhail samoilov 11 years ago
parent
commit
deba01c903
  1. 2
      bower.json
  2. 11
      c3.css
  3. 1156
      c3.js
  4. 148
      c3.min.js
  5. 7
      htdocs/index.html
  6. 25
      htdocs/samples/chart_area.html
  7. 2
      package.json

2
bower.json

@ -1,7 +1,7 @@
{
"name": "c3",
"main": "c3.min.js",
"version": "0.1.3",
"version": "0.1.6",
"homepage": "https://github.com/masayuki0812/c3",
"authors": [
"Masayuki Tanaka <masayuki0812@mac.com>"

11
c3.css

@ -15,6 +15,15 @@ text {
user-select: none;
}
.chart-arc path {
stroke: #fff;
}
.chart-arc text {
fill: #fff;
font-size: 13px;
}
/*-- Grid --*/
.grid line {
@ -60,7 +69,7 @@ text {
/*-- Focus --*/
.target.focused path {
.target.focused path.-line {
stroke-width: 2px;
}

1156
c3.js

File diff suppressed because it is too large Load Diff

148
c3.min.js vendored

@ -1,67 +1,81 @@
(function(ga){function wc(){function p(e,c){e.attr("transform",function(e){return"translate("+(c(e)+V)+", 0)"})}function s(e,c){e.attr("transform",function(e){return"translate(0,"+c(e)+")"})}function ga(e){var c=e[0];e=e[e.length-1];return c<e?[c,e]:[e,c]}function Ba(e){for(var c=[],p=Math.ceil(e[0]);p<e[1];p++)c.push(p);0<c.length&&0<c[0]&&c.unshift(c[0]-(c[1]-c[0]));return c}function n(n){n.each(function(){var n=e.select(this),ha=Ba(H.domain()),I=n.selectAll(".tick.major").data(ha,String),D=I.enter().insert("g",
"path").attr("class","tick major").style("opacity",1E-6),E=e.transition(I.exit()).style("opacity",1E-6).remove(),P=e.transition(I).style("opacity",1),M,N=H.rangeExtent?H.rangeExtent():ga(H.range()),n=n.selectAll(".domain").data([0]);n.enter().append("path").attr("class","domain");var n=e.transition(n),O=H.copy(),db=this.__chart__||O;this.__chart__=O;D.append("line");D.append("text");var ia=D.select("line"),ra=P.select("line"),sa=I.select("text"),Ra=D.select("text"),ta=P.select("text");V=(O(1)-O(0))/
2;I=c?0:V;switch(w){case "bottom":M=p;ia.attr("y2",A);Ra.attr("y",Math.max(A,0)+B);ra.attr("x1",I).attr("x2",I).attr("y2",A);ta.attr("x",0).attr("y",Math.max(A,0)+B);sa.attr("dy",".71em").style("text-anchor","middle");sa.text(function(e){return ha.length<Q||0===e%Math.ceil(ha.length/Q)?e<W.length?W[e]:e:""});n.attr("d","M"+N[0]+","+X+"V0H"+N[1]+"V"+X);break;case "left":M=s,ia.attr("x2",-A),Ra.attr("x",-(Math.max(A,0)+B)),ra.attr("x2",-A).attr("y2",0),ta.attr("x",-(Math.max(A,0)+B)).attr("y",V),sa.attr("dy",
".32em").style("text-anchor","end"),sa.text(function(e){return ha.length<Q||0===e%Math.ceil(ha.length/Q)?e<W.length?W[e]:e:""}),n.attr("d","M"+-X+","+N[0]+"H0V"+N[1]+"H"+-X)}if(H.ticks)D.call(M,db),P.call(M,O),E.call(M,O);else{var Sa=O.rangeBand()/2,E=function(e){return O(e)+Sa};D.call(M,E);P.call(M,E)}})}var H=e.scale.linear(),w="bottom",A=6,X=6,B=3,c=!1,Q=10,V=0,W=[];n.scale=function(e){if(!arguments.length)return H;H=e;return n};n.orient=function(e){if(!arguments.length)return w;w=e in{top:1,right:1,
bottom:1,left:1}?e+"":"bottom";return n};n.categories=function(e){if(!arguments.length)return W;W=e;return n};n.tickCentered=function(e){if(!arguments.length)return c;c=e;return n};n.tickTextNum=function(e){if(!arguments.length)return Q;Q=e;return n};n.tickOffset=function(){return V};n.ticks=function(){};return n}function s(e){return"undefined"===typeof e}function p(e){return"undefined"!==typeof e}var eb=ga.c3={},e=ga.d3;eb.generate=function(U){var Ab,Bb,Ba,n,H,w,A,X,B;function c(a,b){for(var d=U,
h=0;h<a.length;h++){if(!(a[h]in d))return b;d=d[a[h]]}return d}function Q(){fb=null===Db?+e.select(ua).style("width").replace("px",""):Db;var a=null===Eb?+e.select(ua).style("height").replace("px",""):Eb;va=0<a?a:320;Fb=20+Gb+ja;Hb=Ib?Ib:Jb?gb||f?1:40:20;Ta=Kb?Kb:hb?1:40;Lb=va-Gb-ja;Mb=20+ja;Nb=va-ja;w=0;A=Hb;X=Fb;B=Ta;Ba=Lb;n=Mb;H=Ta;Ab=Nb;Bb=Ta;q=fb-B-A;t=va-w-X;ka=va-Ba-n}function V(){return q+2+B+A}function W(){return 40}function ha(){return B+20}function eb(){return t-w+42}function zb(){Ob=f?
10:0;Pb=f?t:q;ib=f?0:t;jb=f?q:1;l=I(Ob,Pb,p(l)?l.domain():void 0,function(){return J.tickOffset()});y=D(ib,jb,p(y)?y.domain():void 0);R=D(ib,jb,p(R)?R.domain():void 0);Y=I(0,q,p(S)?S:void 0,function(a){return 0===a%1?Ca.tickOffset():0});Ua=D(ka,10);Va=D(ka,10);J=M(l,xc);la=e.svg.axis().scale(y).orient(yc);Wa=e.svg.axis().scale(R).orient(zc);Ca=M(Y,Ac)}function I(a,b,d,h){var m=(z?e.time.scale():e.scale.linear()).range([a,b]);m.orgDomain=function(){return m.domain()};p(d)&&m.domain(d);s(h)&&(h=function(){return 0});
if(Z){var c=m,r,m=function(a){return c(a)+h(a)};for(r in c)m[r]=c[r];m.orgDomain=function(){return c.domain()};m.domain=function(a){if(!arguments.length)return a=c.domain(),[a[0],a[1]+1];c.domain(a);return m}}return m}function D(a,b){return e.scale.linear().range([a,b])}function E(a){return"y2"===N(a)?R:y}function P(a){return"y2"===N(a)?Va:Ua}function M(a,b){var d=(Z?wc():e.svg.axis()).scale(a).orient(b);z&&d.tickFormat(Qb?function(a){return e.time.format(Qb)(a)}:Bc);Z?d.categories(Da).tickCentered(Cc):
d.tickOffset=function(){return 0};return d}function N(a){return a in Rb?Rb[a]:"y"}function O(a){return e.min(a,function(a){return e.min(a.values,function(a){return a.value})})}function db(a){var b={},d,h;a.forEach(function(a){b[a.id]=[];a.values.forEach(function(d){b[a.id].push(d.value)})});for(d=0;d<v.length;d++)for(h=1;h<v[d].length;h++)Ea(v[d][h])&&(s(b[v[d][h]])||b[v[d][h]].forEach(function(a,e){N(v[d][h])===N(v[d][0])&&(b[v[d][0]][e]+=1*a)}));return e.max(Object.keys(b).map(function(a){return e.max(b[a])}))}
function ia(a){var b=Xa(function(b){return N(b.id)===a}),d="y2"===a?Dc:Ec,h="y2"===a?Fc:Gc,d=null!==d?d:O(b),h=null!==h?h:db(b),m=0.1*Math.abs(h-d),e=m,c=m,f="y2"===a?Hc:Ic;null!==f&&(d=Math.max(Math.abs(d),Math.abs(h)),h=d-f,d=f-d);"y"===a&&null!==Fa&&(e=p(Fa.top)?Fa.top:m,c=p(Fa.bottom)?Fa.bottom:m);"y2"===a&&null!==Ga&&(e=p(Ga.top)?Ga.top:m,c=p(Ga.bottom)?Ga.bottom:m);return[Jc(b,"bar")?0:d-c,h+e]}function ra(a){var b;a?(a=l.domain(),b=F.extent()):(a=S,b=l.domain());return(a[1]-a[0])/(b[1]-b[0])}
function sa(a){for(var b=0;b<a.length;b++)if(!(a[b]in Ya))return!1;return!0}function Ra(a){for(var b=[],d=0;d<a.length;d++)a[d]in Ya&&b.push(Sb(Ya[a[d]]));return b}function ta(a){return"start"in a?l(z?ma(a.start):a.start):0}function Sa(a){var b=ta(a);a=("end"in a?l(z?ma(a.end):a.end):q)-b;return 0>a?0:a}function Cb(a){var b=Ha[a.id];a.name=p(b)?b:a.id;return a}function Tb(a){var b=a[0],d={},h=[],m,e;for(m=1;m<a.length;m++){d={};for(e=0;e<a[m].length;e++)d[b[e]]=a[m][e];h.push(d)}return h}function Ub(a){var b=
[],d,h,e;for(d=0;d<a.length;d++)for(e=a[d][0],h=1;h<a[d].length;h++)s(b[h-1])&&(b[h-1]={}),b[h-1][e]=a[d][h];return b}function Ia(a){var b=e.keys(a[0]).filter(function(a){return a!==na}),d=0,h;if(z&&!na)return ga.alert('data.x must be specified when axis.x.type == "timeseries"'),[];a.forEach(function(a){if(z){if(!(na in a))throw Error("'"+na+"' must be included in data");h=ma(a[na]);if(null===h)throw Error("Failed to parse timeseries date in data");a.x=h}else a.x=Vb?a[na]:d++;null===Za&&(Za=new Date(a.x));
kb=new Date(a.x)});b=b.map(function(b){var d=Kc(b);return{id:d,id_org:b,values:a.map(function(a){return{x:a.x,value:null===a[b]||isNaN(a[b])?null:+a[b],id:d}})}});b.forEach(function(a){Ya[a.id_org]=Sb(a)});return b}function Sb(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 wa(){return e.max(k.data.targets,function(a){return a.values.length})}function lb(a){a=s(a)?k.data.targets:a;return a.map(function(a){return a.id})}function mb(a){var b=
lb(),d;for(d=0;d<b.length;d++)if(b[d]===a)return!0;return!1}function Xa(a){return p(a)?k.data.targets.filter(a):k.data.targets}function nb(a){return"-shapes -shapes-"+a.id}function Wb(a){return nb(a)+" -line -line-"+a.id}function Lc(a){return nb(a)+" -circles -circles-"+a.id}function Xb(a){return nb(a)+" -bars -bars-"+a.id}function Mc(a,b){return"-shape -shape-"+b+" -circle -circle-"+b}function Yb(a,b){return"-shape -shape-"+b+" -bar -bar-"+b}function Nc(a,b){return"region region-"+b+" "+("classes"in
a?[].concat(a.classes).join(" "):"")}function $a(a){return l(a.x)}function Ja(a){return l(z?ma(a.value):a.value)}function Zb(a){return y(a.value)}function $(a){return l(a.x)}function aa(a){return E(a.id)(a.value)}function Oc(){var a={},b=0,d,h;Xa(Ea).forEach(function(e){for(d=0;d<v.length;d++)if(!(0>v[d].indexOf(e.id)))for(h=0;h<v[d].length;h++)if(v[d][h]in a){a[e.id]=a[v[d][h]];break}s(a[e.id])&&(a[e.id]=b++)});a.__max__=b-1;return a}function $b(a,b,d,e){var m=e?Y:l;return function(e){var h=e.id in
d?d[e.id]:0;return m(e.x)-a*(b/2-h)}}function ac(a,b,d,e){var m=Object.keys(b);return function(c,f){var g=0,k=e?P(c.id):E(c.id);Xa(Ea).forEach(function(d){d.id!==c.id&&b[d.id]===b[c.id]&&m.indexOf(d.id)<m.indexOf(c.id)&&(g+=a(d.values[f]))});return d?g:k(c.value)-g}}function bc(a,b){var d=null===a?function(a){return a}:function(b){return a-b};return function(a){var e=b?P(a.id):E(a.id);return d(e(a.value))}}function ob(a,b){var d=s(a)?lb():a;"string"===typeof d&&(d=[d]);for(var e=0;e<d.length;e++)ba[d[e]]=
b}function Jc(a,b){var d=!1;a.forEach(function(a){ba[a.id]===b&&(d=!0);a.id in ba||"line"!==b||(d=!0)});return d}function pb(a){a="string"===typeof a?a:a.id;return!(a in ba)||"line"===ba[a]||"spline"===ba[a]}function Ea(a){return"bar"===ba["string"===typeof a?a:a.id]}function Pc(a){return pb(a)?a.values:[]}function cc(a){return Ea(a)?a.values:[]}function dc(a,b){var d=e.mouse(a),h=e.select(a),c=1*h.attr("cx"),h=1*h.attr("cy");return Math.sqrt(Math.pow(c-d[0],2)+Math.pow(h-d[1],2))<b}function ec(a){var b=
e.mouse(a),d=e.select(a);a=1*d.attr("x");var h=1*d.attr("y"),d=1*d.attr("width");return a-10<b[0]&&b[0]<a+d+10&&h-10<b[1]}function Qc(a,b){var d;for(d=0;d<b.length;d++)if(b[d].start<a&&a<=b[d].end)return!0;return!1}function fc(a,b,d){Rc(a,b);g.select(".selected-circles-"+b.id).selectAll(".selected-circle-"+d).data([b]).enter().append("circle").attr("class",function(){return"selected-circle selected-circle-"+d}).attr("cx",f?aa:$).attr("cy",f?$:aa).attr("stroke",function(){return T(b.id)}).attr("r",
1.4*Ka).transition().duration(100).attr("r",Ka)}function qb(a,b,d){Sc(a,b);g.select(".selected-circles-"+b.id).selectAll(".selected-circle-"+d).transition().duration(100).attr("r",0).remove()}function gc(a,b,d,e){a?fc(b,d,e):qb(b,d,e)}function Tc(){}function hc(){}function ic(a,b,d,e){}function jc(a){return a.filter(function(a){return null!==a.value})}function Uc(a,b,d,e){var c,g,r="M",k,l,u,kc,n,q=[];if(p(e))for(c=0;c<e.length;c++)q[c]={},s(e[c].start)?q[c].start=a[0].x:z&&(q[c].start=ma(e[c].start)),
s(e[c].end)?q[c].end=a[a.length-1].x:z&&(q[c].end=ma(e[c].end));kc=f?function(a){return d(a.value)}:function(a){return b(a.x)};n=f?function(a){return b(a.x)}:function(a){return d(a.value)};e=z?function(a,e,c,h){var f=a.x.getTime();a=e.x-a.x;e=new Date(f+a*(c+h));return"M"+b(new Date(f+a*c))+" "+d(l(c))+" "+b(e)+" "+d(l(c+h))}:function(a,e,c,h){return"M"+b(k(c))+" "+d(l(c))+" "+b(k(c+h))+" "+d(l(c+h))};for(c=0;c<a.length;c++)if(s(q)||!Qc(a[c].x,q))r+=" "+kc(a[c])+" "+n(a[c]);else{k=I(a[c-1].x,a[c].x);
l=D(a[c-1].value,a[c].value);g=b(a[c].x)-b(a[c-1].x);u=d(a[c].value)-d(a[c-1].value);g=Math.sqrt(Math.pow(g,2)+Math.pow(u,2));u=2/g;var t=2*u;for(g=u;1>=g;g+=t)r+=e(a[c-1],a[c],g,u)}return r}function rb(a){var b=k.data.targets=Ia(a),d,c;lc=e.select(ua);if(lc.empty())ga.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{Q();zb();l.domain(e.extent(a.map(function(a){return a.x})));y.domain(ia("y"));R.domain(ia("y2"));
Y.domain(l.domain());Ua.domain(y.domain());Va.domain(R.domain());J.ticks(10>a.length?a.length:10);la.ticks(Vc).outerTickSize(0).tickFormat(Wc);Wa.ticks(Xc).outerTickSize(0).tickFormat(Yc);S=l.domain();F.x(Y);oa&&G.x(l);La=e.select(ua).append("svg").attr("width",q+B+A).attr("height",t+w+X).on("mouseenter",Zc).on("mouseleave",$c);ab=La.append("defs");ab.append("clipPath").attr("id",sb).append("rect").attr("y",w).attr("width",q).attr("height",t-w);ab.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",
-1-B).attr("y",-20).attr("width",V).attr("height",W);ab.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-B+1).attr("y",w-1).attr("width",ha).attr("height",eb);g=La.append("g").attr("transform",K.main);x=xa?La.append("g").attr("transform",K.context):null;ya=za?La.append("g").attr("transform",K.legend):null;ca=e.select(ua).style("position","relative").append("div").style("position","absolute").style("width","30%").style("z-index","10").style("visibility","hidden");g.append("g").attr("class",
"x axis").attr("clip-path",f?"":"url(#xaxis-clip)").attr("transform",K.x).call(f?la:J).append("text").attr("class","-axis-x-label").attr("x",q).attr("dy","-.5em").style("text-anchor","end").text(ad);g.append("g").attr("class","y axis").attr("clip-path",f?"url(#yaxis-clip)":"").call(f?J:la).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor","end").text(bd);Jb&&g.append("g").attr("class","y2 axis").attr("transform",K.y2).call(Wa);d=g.append("g").attr("clip-path",
Ma).attr("class","grid");mc&&d.append("g").attr("class","xgrids");tb&&(c=d.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(tb).enter().append("g").attr("class","xgrid-line"),c.append("line").attr("class",function(a){return""+a["class"]}),c.append("text").attr("class",function(a){return""+a["class"]}).attr("text-anchor","end").attr("transform",f?"":"rotate(-90)").attr("dx",f?0:-w).attr("dy",-6).text(function(a){return a.text}));cd&&d.append("g").attr("class","xgrid-focus").append("line").attr("class",
"xgrid-focus").attr("x1",f?0:-10).attr("x2",f?q:-10).attr("y1",f?-10:w).attr("y2",f?-10:t);nc&&d.append("g").attr("class","ygrids");ub&&d.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(ub).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]});g.append("g").attr("clip-path",Ma).attr("class","regions");g.append("g").attr("clip-path",Ma).attr("class","chart");g.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",
oa?"ew-resize":null).selectAll(".event-rects").data(a).enter().append("rect").attr("class",function(a,b){return"event-rect event-rect-"+b}).style("cursor",da&&pa?"pointer":null).on("mouseover",function(a,b){if(!bb){var d=k.data.targets.map(function(a){return Cb(a.values[b])}),c,h;if(0<Object.keys(Ha).length){h=[];for(var p in Ha)for(c=0;c<d.length;c++)if(d[c].id===p){h.push(d[c]);d.shift(c);break}d=h.concat(d)}oc&&g.selectAll(".-circle-"+b).classed(ea,!0).attr("r",pc);g.selectAll(".-bar-"+b).classed(ea,
!0);g.selectAll("line.xgrid-focus").style("visibility","visible").data([d[0]]).attr(f?"y1":"x1",$a).attr(f?"y2":"x2",$a);ca.style("top",e.mouse(this)[1]+30+"px").style("left",(f?e.mouse(this)[0]:l(d[0].x))+60+"px");ca.html(qc(d));ca.style("visibility","visible")}}).on("mouseout",function(a,b){g.select("line.xgrid-focus").style("visibility","hidden");ca.style("visibility","hidden");g.selectAll(".-circle-"+b).filter(function(){return e.select(this).classed(ea)}).classed(ea,!1).attr("r",vb);g.selectAll(".-bar-"+
b).classed(ea,!1)}).on("mousemove",function(a,b){da&&!bb&&(pa||g.selectAll(".-shape-"+b).filter(function(a){return qa(a)}).each(function(){var a=e.select(this).classed(ea,!0);"circle"===this.nodeName&&a.attr("r",pc);e.select(".event-rect-"+b).style("cursor",null)}).filter(function(){var a=e.select(this);if("circle"===this.nodeName)return dc(this,Ka);if("rect"===this.nodeName)return ec(this,a.attr("x"),a.attr("y"))}).each(function(){var a=e.select(this);a.classed(ea)||(a.classed(ea,!0),"circle"===
this.nodeName&&a.attr("r",Ka));e.select(".event-rect-"+b).style("cursor","pointer")}))}).on("click",function(a,b){wb?wb=!1:g.selectAll(".-shape-"+b).each(function(a){var d=e.select(this),c=d.classed(fa),h=!1,f;"circle"===this.nodeName?(h=dc(this,1.5*Ka),f=gc):"rect"===this.nodeName&&(h=ec(this),f=ic);if(pa||h)da&&qa(a)&&(d.classed(fa,!c),f(!c,d,a,b)),dd(a,d)})}).call(e.behavior.drag().origin(Object).on("drag",function(){if(da&&(!oa||G.altDomain)){var a=xb[0],b=xb[1],d=e.mouse(this),c=d[0],d=d[1],
h=Math.min(a,c),f=Math.max(a,c),k=pa?w:Math.min(b,d),l=pa?t:Math.max(b,d);g.select(".dragarea").attr("x",h).attr("y",k).attr("width",f-h).attr("height",l-k);g.selectAll(".-shapes").selectAll(".-shape").filter(function(a){return qa(a)}).each(function(a,b){var d=e.select(this),c=d.classed(fa),g=d.classed(yb),m,r,p,q;m=!1;"circle"===this.nodeName?(m=1*d.attr("cx"),r=1*d.attr("cy"),q=gc,m=h<m&&m<f&&k<r&&r<l):"rect"===this.nodeName&&(m=1*d.attr("x"),r=1*d.attr("y"),p=1*d.attr("width"),q=ic,m=h<m+p&&m<
f&&r<l);m^g&&(d.classed(yb,!g),d.classed(fa,!c),q(!c,d,a,b))})}}).on("dragstart",function(){da&&(xb=e.mouse(this),g.select(".chart").append("rect").attr("class","dragarea").style("opacity",0.1),bb=!0)}).on("dragend",function(){da&&(g.select(".dragarea").transition().duration(100).style("opacity",0).remove(),g.selectAll(".-shape").classed(yb,!1),bb=!1)})).call(G).on("dblclick.zoom",null);g.select(".chart").append("g").attr("class","chart-bars");g.select(".chart").append("g").attr("class","chart-lines");
if(oa)g.insert("rect",ed?null:"g.grid").attr("class","zoom-rect").attr("width",q).attr("height",t).style("opacity",0).style("cursor","ew-resize").call(G).on("dblclick.zoom",null);null!==Na&&F.extent("function"!==typeof Na?Na:z?Na(Za,kb):Na(0,wa()-1));xa&&(x.append("g").attr("clip-path",Ma).attr("class","chart"),x.select(".chart").append("g").attr("class","chart-bars"),x.select(".chart").append("g").attr("class","chart-lines"),x.append("g").attr("clip-path",Ma).attr("class","x brush").call(F).selectAll("rect").attr("height",
ka),x.append("g").attr("class","x axis").attr("transform",K.subx).call(Ca));za&&cb(b);rc(b);C({withTransition:!1,withUpdateXDomain:!0});if(fd){if(z&&"string"===typeof Aa){Aa=ma(Aa);for(a=0;a<b[0].values.length&&0!==b[0].values[a].x-Aa;a++);Aa=a}ca.html(qc(b.map(function(a){return Cb(a.values[Aa])})));ca.style("top",sc.top).style("left",sc.left).style("visibility","visible")}}}function C(a){var b,d,c=Oc(),m=c.__max__+1,n,r,s,v,u;a=p(a)?a:{};b=p(a.withY)?a.withY:!0;v=p(a.withSubchart)?a.withSubchart:
!0;u=p(a.withTransition)?a.withTransition:!0;a=p(a.withUpdateXDomain)?a.withUpdateXDomain:!1;u=u?250:0;a&&(l.domain(F.empty()?S:F.extent()),oa&&G.x(l).updateScaleExtent());y.domain(ia("y"));R.domain(ia("y2"));g.select(".x.axis").transition().duration(f?u:0).call(f?la:J);g.select(".y.axis").transition().duration(f?0:u).call(f?J:la);g.select(".y2.axis").transition().call(Wa);g.select(".x.axis .-axis-x-label").attr("x",q);Ua.domain(y.domain());Va.domain(R.domain());ca.style("visibility","hidden");g.select("line.xgrid-focus").style("visibility",
"hidden").attr("y2",t);if(mc){if("year"===gd)for(a=[],r=Za.getFullYear(),n=kb.getFullYear();r<=n;r++)a.push(new Date(r+"-01-01 00:00:00"));else a=l.ticks(10);a=g.select(".xgrids").selectAll(".xgrid").data(a);a.enter().append("line").attr("class","xgrid");a.exit().remove();g.selectAll(".xgrid").attr("x1",function(a){return l(a)-J.tickOffset()}).attr("x2",function(a){return l(a)-J.tickOffset()}).attr("y1",w).attr("y2",t)}tb&&(a=g.selectAll(".xgrid-lines"),a.selectAll("line").attr("x1",f?0:Ja).attr("x2",
f?q:Ja).attr("y1",f?Ja:w).attr("y2",f?Ja:t),a.selectAll("text").attr("x",f?q:0).attr("y",Ja));b&&nc&&(a=g.select(".ygrids").selectAll(".ygrid").data(y.ticks(10)),a.enter().append("line").attr("class","ygrid"),a.attr("x1",f?y:0).attr("x2",f?y:q).attr("y1",f?0:y).attr("y2",f?t:y).attr("opacity",0).transition().attr("opacity",1),a.exit().remove());b&&ub&&g.select(".ygrid-lines").selectAll(".ygrid-line").attr("y1",Zb).attr("y2",Zb);n=Z?1.2*J.tickOffset()/m:0.6*((f?t:q)*ra(!1)/(wa()-1));r=bc(f?null:t);
b=$b(n,m,c);a=ac(r,c,f);d=g.selectAll(".-bars").selectAll(".-bar").data(cc);d.transition().duration(u).attr("x",f?a:b).attr("y",f?b:a).attr("width",f?r:n).attr("height",f?n:r);d.enter().append("rect").attr("class",Yb).attr("x",f?a:b).attr("y",f?b:a).attr("width",f?r:n).attr("height",f?n:r).style("opacity",0).transition().duration(u).style("opacity",1);d.exit().transition().duration(u).style("opacity",0).remove();g.selectAll(".-line").transition().duration(u).attr("d",hd);b=g.selectAll(".-circles").selectAll(".-circle").data(Pc);
b.transition().duration(u).style("opacity",function(a){return null===a.value?0:1}).attr("cx",f?aa:$).attr("cy",f?$:aa);b.enter().append("circle").style("opacity",function(a){return null===a.value?0:1}).attr("class",Mc).attr("cx",f?aa:$).attr("cy",f?$:aa).attr("r",vb);b.exit().remove();xa&&(null!==e.event&&"zoom"===e.event.type&&F.extent(l.orgDomain()).update(),v&&(x.select(".x.axis").transition().duration(f?u:0).call(f?la:Ca),F.empty()||F.extent(l.orgDomain()).update(),n=Z?1.2*Ca.tickOffset()/m:0.6*
((f?t:q)*ra(!0)/(wa()-1)),r=bc(ka,!0),b=$b(n,m,c,!0),a=ac(r,c,!1,!0),c=x.selectAll(".-bars").selectAll(".-bar").data(cc),c.transition().duration(u).attr("x",b).attr("y",a).attr("width",n).attr("height",r),c.enter().append("rect").attr("class",Yb).attr("x",b).attr("y",a).attr("width",n).attr("height",r).style("opacity",0).transition().style("opacity",1),c.exit().transition().style("opacity",0).remove(),x.selectAll(".-line").transition().duration(u).attr("d",id)));g.selectAll(".selected-circles").filter(function(a){return Ea(a)}).selectAll("circle").remove();
g.selectAll(".selected-circle").transition().duration(u).attr("cx",f?aa:$).attr("cy",f?$:aa);Vb?(s=function(a,b){var d=0<b?k.data.targets[0].values[b-1].x:void 0,c=b<wa()-1?k.data.targets[0].values[b+1].x:void 0;return(l(c?c:a.x+50)-l(d?d:a.x-50))/2},c=function(a,b){var d=0<b?k.data.targets[0].values[b-1].x:void 0;return(l(a.x)+l(d?d:a.x-50))/2}):(s=(f?t:q)*ra()/(wa()-1),c=function(a){return l(a.x)-s/2});g.selectAll(".event-rect").attr("x",f?0:c).attr("y",f?c:0).attr("width",f?q:s).attr("height",
f?s:t);c=g.select(".regions").selectAll("rect.region").data(L);c.enter().append("rect");c.attr("class",Nc).attr("x",f?0:ta).attr("y",f?ta:w).attr("width",f?q:Sa).attr("height",f?Sa:t).style("fill-opacity",function(a){return p(a.opacity)?a.opacity:0.1});c.exit().transition().duration(u).style("fill-opacity",0).remove()}function jd(){"mousemove"===e.event.sourceEvent.type&&G.altDomain?(l.domain(G.altDomain),G.x(l).updateScaleExtent()):(Z&&l.orgDomain()[0]===S[0]&&l.domain([S[0]-1E-10,l.orgDomain()[1]]),
C({withTransition:!1,withY:!1,withSubchart:!1}),"mousemove"===e.event.sourceEvent.type&&(wb=!0))}function rc(a){var b;g.select(".chart-bars").selectAll(".chart-bar").data(a).enter().append("g").attr("class",function(a){return"chart-bar target target-"+a.id}).style("pointer-events","none").style("opacity",0).append("g").attr("class",Xb).style("fill",function(a){return T(a.id)}).style("stroke",function(a){return T(a.id)}).style("stroke-width",0).style("cursor",function(a){return qa(a)?"pointer":null});
b=g.select(".chart-lines").selectAll(".chart-line").data(a).enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}).style("pointer-events","none").style("opacity",0);b.append("path").attr("class",Wb).style("stroke",function(a){return T(a.id)});b.append("g").attr("class",function(a){return"selected-circles selected-circles-"+a.id});b.append("g").attr("class",Lc).style("fill",function(a){return T(a.id)}).style("cursor",function(a){return qa(a)?"pointer":null});a.forEach(function(a){g.selectAll(".selected-circles-"+
a.id).selectAll(".selected-circle").each(function(b){b.value=a.values[b.x].value})});xa&&(b=x.select(".chart-bars").selectAll(".chart-bar").data(a),b=b.enter().append("g").attr("class",function(a){return"chart-bar target target-"+a.id}).style("opacity",0),b.append("g").attr("class",Xb).style("fill",function(a){return T(a.id)}),b=x.select(".chart-lines").selectAll(".chart-line").data(a),b=b.enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}).style("opacity",0),b.append("path").attr("class",
Wb).style("stroke",function(a){return T(a.id)}));za&&cb(a);e.selectAll(".target").transition().style("opacity",1)}function Oa(a,b){k.data.targets.forEach(function(b){for(var c=0;c<a.length;c++)if(b.id===a[c].id){b.values=a[c].values;a.splice(c,1);break}});k.data.targets=k.data.targets.concat(a);rc(k.data.targets);C();b()}function cb(a,b){var d=lb(a),c,f=q/2-Pa*Object.keys(a).length/2,g;b=s(b)?{}:b;g=p(b.withTransition)?b.withTransition:!0;c=ya.selectAll(".legend-item").data(d).enter().append("g").attr("class",
function(a){return"legend-item legend-item-"+a}).style("cursor","pointer").on("click",function(a){kd(a)}).on("mouseover",function(a){e.selectAll(".legend-item").filter(function(b){return b!==a}).transition().duration(100).style("opacity",0.3);k.focus(a)}).on("mouseout",function(){e.selectAll(".legend-item").transition().duration(100).style("opacity",1);k.revert()});c.append("rect").attr("class","legend-item-event").style("fill-opacity",0).attr("x",-200).attr("y",function(){return ja/2-16}).attr("width",
Pa).attr("height",24);c.append("rect").attr("class","legend-item-tile").style("fill",function(a){return T(a)}).attr("x",-200).attr("y",function(){return ja/2-9}).attr("width",10).attr("height",10);c.append("text").text(function(a){return p(Ha[a])?Ha[a]:a}).attr("x",-200).attr("y",function(){return ja/2});ya.selectAll("rect.legend-item-event").data(d).transition().duration(g?250:0).attr("x",function(a,b){return f+Pa*b});ya.selectAll("rect.legend-item-tile").data(d).transition().duration(g?250:0).attr("x",
function(a,b){return f+Pa*b});ya.selectAll("text").data(d).transition().duration(g?250:0).attr("x",function(a,b){return f+Pa*b+14})}function Qa(a){return p(a)?".target-"+a:".target"}var k={data:{}},Ya={},ea="_expanded_",fa="_selected_",yb="_included_",ua=c(["bindto"],"#chart"),Db=c(["size","width"],null),Eb=c(["size","height"],null),Kb=c(["padding","left"],null),Ib=c(["padding","right"],null),oa=c(["zoom","enabled"],!1),tc=c(["zoom","extent"],null),ed=c(["zoom","privileged"],!1),Zc=c(["onenter"],
function(){}),$c=c(["onleave"],function(){});if(!("data"in U))throw Error("data is required in config");var na=c(["data","x"],void 0),ld=c(["data","x_format"],"%Y-%m-%d"),Kc=c(["data","id_converter"],function(a){return a}),Ha=c(["data","names"],{}),v=c(["data","groups"],[]),Rb=c(["data","axes"],{}),ba=c(["data","types"],{}),uc=c(["data","regions"],{}),md=c(["data","colors"],{}),da=c(["data","selection","enabled"],!1),pa=c(["data","selection","grouped"],!1),qa=c(["data","selection","isselectable"],
function(){return!0}),xa=c(["subchart","show"],!1),Gb=xa?c(["subchart","size","height"],60):0,nd=c(["color","pattern"],null),za=c(["legend","show"],!0),Pa=c(["legend","item","width"],80),kd=c(["legend","item","onclick"],function(){}),vc=c(["axis","x","type"],"indexed"),Da=c(["axis","x","categories"],[]),Cc=c(["axis","x","tick","centered"],!1),Qb=c(["axis","x","tick","format"],null),Na=c(["axis","x","default"],null),ad=c(["axis","x","label"],null),Gc=c(["axis","y","max"],null),Ec=c(["axis","y","min"],
null),Ic=c(["axis","y","center"],null),bd=c(["axis","y","label"],null),hb=c(["axis","y","inner"],!1),Wc=c(["axis","y","format"],function(a){return a}),Fa=c(["axis","y","padding"],null),Vc=c(["axis","y","ticks"],10),Jb=c(["axis","y2","show"],!1),Fc=c(["axis","y2","max"],null),Dc=c(["axis","y2","min"],null),Hc=c(["axis","y2","center"],null),gb=c(["axis","y2","inner"],!1),Yc=c(["axis","y2","format"],function(a){return a}),Ga=c(["axis","y2","padding"],null),Xc=c(["axis","y2","ticks"],10),f=c(["axis",
"rotated"],!1),mc=c(["grid","x","show"],!1),gd=c(["grid","x","type"],"tick"),tb=c(["grid","x","lines"],null),nc=c(["grid","y","show"],!1),ub=c(["grid","y","lines"],null),vb=c(["point","show"],!0)?c(["point","r"],2.5):0,cd=c(["point","focus","line","enabled"],!0),oc=c(["point","focus","expand","enabled"],!0),pc=c(["point","focus","expand","r"],oc?4:vb),Ka=c(["point","focus","select","r"],8),dd=c(["point","onclick"],function(){}),Rc=c(["point","onselected"],function(){}),Sc=c(["point","onunselected"],
function(){}),L=c(["regions"],[]),qc=c(["tooltip","contents"],function(a){var b="<table class='-tooltip'><tr><th colspan='2'>"+(z?a[0].x.getFullYear()+"."+(a[0].x.getMonth()+1)+"."+a[0].x.getDate():Z?a[0].x<Da.length?Da[a[0].x]:a[0].x:a[0].x)+"</th></tr>",d,c,e;for(d=0;d<a.length;d++)p(a[d])?(c=p(a[d].value)?(Math.round(100*a[d].value)/100).toFixed(2):"-",e=a[d].name):e=c="-",b+="<tr class='-tooltip-name-"+a[d].id+"'><td class='name'><span style='background-color:"+T(a[d].id)+"'></span>"+e+"</td><td class='value'>"+
c+"</td></tr>";return b+"</table>"}),fd=c(["tooltip","init","show"],!1),Aa=c(["tooltip","init","x"],0),sc=c(["tooltip","init","position"],{top:"0px",left:"50px"}),sb=ua.replace("#","")+"-clip",Ma="url(#"+sb+")",z="timeseries"===vc,Z="categorized"===vc,Vb=!z&&na,xb=null,bb=!1,wb=!1,ja=za?40:0,ma=e.time.format(ld).parse,T=function(a,b){var d=[],c=null!==b?b:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" ");return function(b){if(b in a)return a[b];-1===d.indexOf(b)&&
d.push(b);return c[d.indexOf(b)%c.length]}}(md,nd),Bc=function(){var a=[[e.time.format("%Y/%-m/%-d"),function(){return!0}],[e.time.format("%-m/%-d"),function(a){return a.getMonth()}],[e.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[e.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[e.time.format("%I %p"),function(a){return a.getHours()}],[e.time.format("%I:%M"),function(a){return a.getMinutes()}],[e.time.format(":%S"),function(a){return a.getSeconds()}],[e.time.format(".%L"),
function(a){return a.getMilliseconds()}]];return function(b){for(var d=a.length-1,c=a[d];!c[1](b);)c=a[--d];return c[0](b)}}(),Fb,Mb,Hb,Ta,Lb,Nb,q,t,ka,fb,va,Ob,Pb,ib,jb,l,y,R,Y,Ua,Va,J,la,Wa,Ca,xc=f?"left":"bottom",yc=f?hb?"top":"bottom":hb?"right":"left",zc=f?gb?"bottom":"top":gb?"left":"right",Ac="bottom",K={main:function(){return"translate("+B+","+w+")"},context:function(){return"translate("+H+","+Ba+")"},legend:function(){return"translate("+Bb+","+Ab+")"},y2:function(){return"translate("+(f?
0:q)+","+(f?10:0)+")"},x:function(){return"translate(0,"+t+")"},subx:function(){return"translate(0,"+ka+")"}},hd=function(){var a=e.svg.line().x(f?function(a){return E(a.id)(a.value)}:$a).y(f?$a:function(a){return E(a.id)(a.value)});return function(b){var d=jc(b.values),c;if(pb(b))return"spline"===ba["string"===typeof b?b:b.id]?a.interpolate("cardinal"):a.interpolate("linear"),0<Object.keys(uc).length?Uc(d,l,E(b.id),uc[b.id]):a(d);c=l(d[0].x);b=E(b.id)(d[0].value);return f?"M "+b+" "+c:"M "+c+" "+
b}}(),id=function(){var a=e.svg.line().x(function(a){return Y(a.x)}).y(function(a){return P(a.id)(a.value)});return function(b){var d=jc(b.values);return pb(b)?a(d):"M "+Y(d[0].x)+" "+P(b.id)(d[0].value)}}(),F=e.svg.brush().on("brush",function(){C({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}),G=e.behavior.zoom().on("zoomstart",function(){G.altDomain=e.event.sourceEvent.altKey?l.orgDomain():null}).on("zoom",oa?jd:null);F.update=function(){x&&x.select(".x.brush").call(this);return this};
G.orgScaleExtent=function(){var a=tc?tc:[1,10];return[a[0],Math.max(wa()/a[1],a[1])]};G.updateScaleExtent=function(){var a=l.orgDomain(),a=(a[1]-a[0])/(S[1]-S[0]),b=this.orgScaleExtent();this.scaleExtent([b[0]*a,b[1]*a]);return this};var La,ab,g,x,ya,ca,lc,Za=null,kb=null,S;k.focus=function(a){k.defocus();e.selectAll(Qa(a)).filter(function(a){return mb(a.id)}).classed("focused",!0).transition().duration(100).style("opacity",1)};k.defocus=function(a){e.selectAll(Qa(a)).filter(function(a){return mb(a.id)}).classed("focused",
!1).transition().duration(100).style("opacity",0.3)};k.revert=function(a){e.selectAll(Qa(a)).filter(function(a){return mb(a.id)}).classed("focused",!1).transition().duration(100).style("opacity",1)};k.show=function(a){e.selectAll(Qa(a)).transition().style("opacity",1)};k.hide=function(a){e.selectAll(Qa(a)).transition().style("opacity",0)};k.unzoom=function(){F.clear().update();C({withUpdateXDomain:!0})};k.load=function(a){s(a.done)&&(a.done=function(){});"categories"in a&&Z&&(Da=a.categories,J.categories(Da));
if("cacheIds"in a&&sa(a.cacheIds))Oa(Ra(a.cacheIds),a.done);else if("data"in a)Oa(Ia(a.data),a.done);else if("url"in a)e.csv(a.url,function(b,d){Oa(Ia(d),a.done)});else if("rows"in a)Oa(Ia(Tb(a.rows)),a.done);else if("columns"in a)Oa(Ia(Ub(a.columns)),a.done);else throw Error("url or rows or columns is required.");};k.unload=function(a){k.data.targets=k.data.targets.filter(function(b){return b.id!==a});e.selectAll(".target-"+a).transition().style("opacity",0).remove();za&&(e.selectAll(".legend-item-"+
a).remove(),cb(k.data.targets));0<k.data.targets.length&&C()};k.selected=function(a){a=p(a)?"-"+a:"";return e.merge(g.selectAll(".-shapes"+a).selectAll(".-shape").filter(function(){return e.select(this).classed(fa)}).map(function(a){return a.map(function(a){return a.__data__})}))};k.select=function(a,b,d){da&&g.selectAll(".-shapes").selectAll(".-shape").each(function(c,f){var g="circle"===this.nodeName?fc:Tc,k="circle"===this.nodeName?qb:hc;0<=b.indexOf(f)?qa(c)&&(pa||s(a)||0<=a.indexOf(c.id))&&g(e.select(this).classed(fa,
!0),c,f):p(d)&&d&&k(e.select(this).classed(fa,!1),c,f)})};k.unselect=function(a,b){da&&g.selectAll(".-shapes").selectAll(".-shape").each(function(c,f){var g="circle"===this.nodeName?qb:hc;(s(b)||0<=b.indexOf(f))&&qa(c)&&(pa||s(a)||0<=a.indexOf(c.id))&&g(e.select(this).classed(fa,!1),c,f)})};k.toLine=function(a){ob(a,"line");C()};k.toSpline=function(a){ob(a,"spline");C()};k.toBar=function(a){ob(a,"bar");C()};k.groups=function(a){if(s(a))return v;v=a;C();return v};k.regions=function(a){if(s(a))return L;
L=a;C();return L};k.regions.add=function(a){if(s(a))return L;L=L.concat(a);C();return L};k.regions.remove=function(a,b){var c=[].concat(a);b=p(b)?b:{};c.forEach(function(a){var c=e.selectAll("."+a);p(b.duration)&&(c=c.transition().duration(b.duration).style("fill-opacity",0));c.remove();L=L.filter(function(b){return 0>b.classes.indexOf(a)})});return L};k.data.get=function(a){a=k.data.getAsTarget(a);return p(a)?a.values.map(function(a){return a.value}):void 0};k.data.getAsTarget=function(a){var b=
Xa(function(b){return b.id===a});return 0<b.length?b[0]:void 0};if("url"in U.data)e.csv(U.data.url,function(a,b){rb(b)});else if("rows"in U.data)rb(Tb(U.data.rows));else if("columns"in U.data)rb(Ub(U.data.columns));else throw Error("url or rows or columns is required.");ga.onresize=function(){Q();zb();F.x(Y);oa&&G.x(l);e.select("svg").attr("width",fb).attr("height",va);e.select("#"+sb).select("rect").attr("width",q).attr("height",t);e.select("#xaxis-clip").select("rect").attr("width",V);e.select(".zoom-rect").attr("width",
q).attr("height",t);g.select(".x.axis").attr("transform",K.x);g.select(".y2.axis").attr("transform",K.y2);xa&&(x.select(".x.brush").selectAll("rect").attr("height",ka),x.attr("transform",K.context),x.select(".x.axis").attr("transform",K.subx));za&&(ya.attr("transform",K.legend),cb(k.data.targets,{withTransition:!1}));C({withTransition:!1,withUpdateXDomain:!0})};return k}})(window);
(function(U){function gd(){function p(d,e){d.attr("transform",function(d){return"translate("+(e(d)+da)+", 0)"})}function t(d,e){d.attr("transform",function(d){return"translate(0,"+e(d)+")"})}function U(d){var e=d[0];d=d[d.length-1];return e<d?[e,d]:[d,e]}function Ba(d){for(var e=[],p=Math.ceil(d[0]);p<d[1];p++)e.push(p);0<e.length&&0<e[0]&&e.unshift(e[0]-(e[1]-e[0]));return e}function Ca(d){d=d<V.length?V[d]:d;return W?W(d):d}function n(n){n.each(function(){var n=d.select(this),ka=Ba(s.domain()),
K=n.selectAll(".tick.major").data(ka,String),H=K.enter().insert("g","path").attr("class","tick major").style("opacity",1E-6),I=d.transition(K.exit()).style("opacity",1E-6).remove(),X=d.transition(K).style("opacity",1),O,P=s.rangeExtent?s.rangeExtent():U(s.range()),n=n.selectAll(".domain").data([0]);n.enter().append("path").attr("class","domain");var n=d.transition(n),L=s.copy(),W=this.__chart__||L;this.__chart__=L;H.append("line");H.append("text");var V=H.select("line"),Da=X.select("line"),sa=K.select("text"),
Ya=H.select("text"),Ea=X.select("text");da=(L(1)-L(0))/2;K=ta?0:da;switch(ea){case "bottom":O=p;V.attr("y2",J);Ya.attr("y",Math.max(J,0)+e);Da.attr("x1",K).attr("x2",K).attr("y2",J);Ea.attr("x",0).attr("y",Math.max(J,0)+e);sa.attr("dy",".71em").style("text-anchor","middle");sa.text(function(d){return ka.length<Y||0===d%Math.ceil(ka.length/Y)?Ca(d):""});n.attr("d","M"+P[0]+","+D+"V0H"+P[1]+"V"+D);break;case "left":O=t,V.attr("x2",-J),Ya.attr("x",-(Math.max(J,0)+e)),Da.attr("x2",-J).attr("y2",0),Ea.attr("x",
-(Math.max(J,0)+e)).attr("y",da),sa.attr("dy",".32em").style("text-anchor","end"),sa.text(function(d){return ka.length<Y||0===d%Math.ceil(ka.length/Y)?Ca(d):""}),n.attr("d","M"+-D+","+P[0]+"H0V"+P[1]+"H"+-D)}if(s.ticks)H.call(O,W),X.call(O,L),I.call(O,L);else{var Fa=L.rangeBand()/2,I=function(d){return L(d)+Fa};H.call(O,I);X.call(O,I)}})}var s=d.scale.linear(),ea="bottom",J=6,D=6,e=3,ta=!1,Y=10,da=0,W=null,V=[];n.scale=function(d){if(!arguments.length)return s;s=d;return n};n.orient=function(d){if(!arguments.length)return ea;
ea=d in{top:1,right:1,bottom:1,left:1}?d+"":"bottom";return n};n.categories=function(d){if(!arguments.length)return V;V=d;return n};n.tickCentered=function(d){if(!arguments.length)return ta;ta=d;return n};n.tickTextNum=function(d){if(!arguments.length)return Y;Y=d;return n};n.tickFormat=function(d){if(!arguments.length)return W;W=d;return n};n.tickOffset=function(){return da};n.ticks=function(){};return n}function t(d){return"undefined"===typeof d}function p(d){return"undefined"!==typeof d}var sb=
U.c3={},d=U.d3;sb.generate=function(ca){var Xb,Yb,Ba,Ca,n,s,ea,J,D;function e(a,b){for(var c=ca,k=0;k<a.length;k++){if(!(a[k]in c))return b;c=c[a[k]]}return c}function ta(){tb=null===Za?da():Za;ua=Y();Zb=20+$b+la;ac=bc?bc:cc?ub||h?1:40:20;$a=dc?dc:vb?1:40;ec=ua-$b-la;fc=20+la;gc=ua-la;s=0;ea=ac;J=Zb;D=$a;Ba=ec;Ca=fc;n=$a;Xb=gc;Yb=$a;r=tb-D-ea;q=ua-s-J;ma=ua-Ba-Ca;wb=q/2;ab=0.95*wb}function Y(){var a=null===hc?+d.select(va).style("height").replace("px",""):hc;return 0<a?a:320}function da(){return+d.select(va).style("width").replace("px",
"")}function W(){return r+2+D+ea}function V(){return 40}function ka(){return D+20}function sb(){return q-s+42}function Wb(){ic=h?10:0;jc=h?q:r;xb=h?0:q;yb=h?r:1;m=K(ic,jc,p(m)?m.domain():void 0,function(){return E.tickOffset()});x=H(xb,yb,p(x)?x.domain():void 0);Z=H(xb,yb,p(Z)?Z.domain():void 0);Q=K(0,r,p(R)?R:void 0,function(a){return 0===a%1?Ga.tickOffset():0});bb=H(ma,10);cb=H(ma,10);E=O(m,jd);na=d.svg.axis().scale(x).orient(kd);db=d.svg.axis().scale(Z).orient(ld);Ga=O(Q,md);eb=hd();kc=Da();lc=
Da(0.98)}function K(a,b,c,k){var f=(z?d.time.scale():d.scale.linear()).range([a,b]);f.orgDomain=function(){return f.domain()};p(c)&&f.domain(c);t(k)&&(k=function(){return 0});if($){var wa=f,e,f=function(a){return wa(a)+k(a)};for(e in wa)f[e]=wa[e];f.orgDomain=function(){return wa.domain()};f.domain=function(a){if(!arguments.length)return a=wa.domain(),[a[0],a[1]+1];wa.domain(a);return f}}return f}function H(a,b){return d.scale.linear().range([a,b])}function I(a){return"y2"===P(a)?Z:x}function X(a){return"y2"===
P(a)?cb:bb}function O(a,b){var c=($?gd():d.svg.axis()).scale(a).orient(b);c.tickFormat(L());$?c.categories(Ha).tickCentered(nd):c.tickOffset=function(){return 0};return c}function P(a){return a in mc?mc[a]:"y"}function L(){var a=z?od:$?pd:function(a){return a};fb&&(a="function"===typeof fb?fb:z?function(a){return d.time.format(fb)(a)}:a);return a}function Xa(a){var b=!1;zb(g.data.targets).forEach(function(c){b||c.data.id!==a.data.id||(b=!0,a=c)});return b?a:null}function hd(){var a=d.svg.arc().outerRadius(ab).innerRadius(0),
b=function(b,k){var f;return k?a(b):(f=Xa(b))?a(f):"M 0 0"};b.centroid=a.centroid;return b}function Da(a){var b=d.svg.arc().outerRadius(wb*(a?a:1)).innerRadius(0);return function(a){return(a=Xa(a))?b(a):"M 0 0"}}function sa(a){a=Xa(a);var b,c;b="";a&&(b=eb.centroid(a),a=b[0],b=b[1],c=Math.sqrt(a*a+b*b),b="translate("+0.8*(a/c)*ab+","+0.8*(b/c)*ab+")");return b}function Ya(a){return(100*(a.endAngle-a.startAngle)/(2*Math.PI)).toFixed(1)+"%"}function Ea(a,b){var c=d.selectAll(".chart-arc.target"+(a?
"-"+a:"")),k=d.selectAll(".-arc").filter(function(b){return b.data.id!==a});c.selectAll("path").transition().duration(50).attr("d",kc).transition().duration(100).attr("d",lc);b||k.style("opacity",0.3)}function Fa(a){d.selectAll(".chart-arc.target"+(a?"-"+a:"")).selectAll("path").transition().duration(50).attr("d",eb);d.selectAll(".-arc").style("opacity",1)}function id(a){return d.min(a,function(a){return d.min(a.values,function(a){return a.value})})}function qd(a){var b={},c,k;a.forEach(function(a){b[a.id]=
[];a.values.forEach(function(c){b[a.id].push(c.value)})});for(c=0;c<u.length;c++)for(k=1;k<u[c].length;k++)Ia(u[c][k])&&(t(b[u[c][k]])||b[u[c][k]].forEach(function(a,d){P(u[c][k])===P(u[c][0])&&(b[u[c][0]][d]+=1*a)}));return d.max(Object.keys(b).map(function(a){return d.max(b[a])}))}function gb(a){var b=hb(function(b){return P(b.id)===a}),c="y2"===a?rd:sd,k="y2"===a?td:ud,c=null!==c?c:id(b),k=null!==k?k:qd(b),f=0.1*Math.abs(k-c),d=f,e=f,g="y2"===a?vd:wd;null!==g&&(c=Math.max(Math.abs(c),Math.abs(k)),
k=c-g,c=g-c);"y"===a&&null!==Ja&&(d=p(Ja.top)?Ja.top:f,e=p(Ja.bottom)?Ja.bottom:f);"y2"===a&&null!==Ka&&(d=p(Ka.top)?Ka.top:f,e=p(Ka.bottom)?Ka.bottom:f);return[Ab(b,"bar")?0:c-e,k+d]}function Bb(a){var b;a?(a=m.domain(),b=F.extent()):(a=R,b=m.domain());return(a[1]-a[0])/(b[1]-b[0])}function xd(a){return d.min(a,function(a){return d.min(a.values,function(a){return a.x})})}function yd(a){return d.max(a,function(a){return d.max(a.values,function(a){return a.x})})}function ib(a){var b=[xd(a),yd(a)];
a=b[0];var b=b[1],c=$?0:0.01*Math.abs(a-b);a=z?new Date(a.getTime()-c):a-c;b=z?new Date(b.getTime()+c):b+c;return[a,b]}function zd(a){for(var b=0;b<a.length;b++)if(!(a[b]in jb))return!1;return!0}function Ad(a){for(var b=[],c=0;c<a.length;c++)a[c]in jb&&b.push(nc(jb[a[c]]));return b}function Cb(a){return"start"in a?m(z?oa(a.start):a.start):0}function oc(a){var b=Cb(a);a=("end"in a?m(z?oa(a.end):a.end):r)-b;return 0>a?0:a}function pc(a){return pa&&a===pa||aa&&Bd(aa,a)}function Cd(a){return!pc(a)}function kb(a){var b=
La[a.id];a.name=p(b)?b:a.id;return a}function qc(a){var b=a[0],c={},k=[],f,d;for(f=1;f<a.length;f++){c={};for(d=0;d<a[f].length;d++)c[b[d]]=a[f][d];k.push(c)}return k}function rc(a){var b=[],c,k,d;for(c=0;c<a.length;c++)for(d=a[c][0],k=1;k<a[c].length;k++)t(b[k-1])&&(b[k-1]={}),b[k-1][d]=a[c][k];return b}function Ma(a){var b=d.keys(a[0]).filter(Cd),c=d.keys(a[0]).filter(pc);if(z&&0===c.length)return U.alert('data.x or data.xs must be specified when axis.x.type == "timeseries"'),[];Db&&b.forEach(function(b){var d=
pa?pa:aa?aa[b]:null;0<=c.indexOf(d)&&(g.data.x[b]=a.map(function(a){return a[d]}))});b=b.map(function(b){var c=Dd(b);return{id:c,id_org:b,values:a.map(function(a,d){var e;e=pa?pa:aa?aa[b]:null;e=z?oa(a[e]):Db?a[e]?a[e]:b in g.data.x&&g.data.x[d]?g.data.x[d]:d:d;a.x=e;return{x:e,value:null===a[b]||isNaN(a[b])?null:+a[b],id:c}})}});b.forEach(function(a){var b;a.values=a.values.sort(function(a,b){return(a.x||0===a.x?a.x:Infinity)-(b.x||0===b.x?b.x:Infinity)});b=0;a.values.forEach(function(a){a.index=
b++})});b.forEach(function(a){jb[a.id_org]=nc(a)});return b}function nc(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 Na(){return d.max(g.data.targets,function(a){return a.values.length})}function lb(a){a=t(a)?g.data.targets:a;return a.map(function(a){return a.id})}function sc(a){var b=lb(),c;for(c=0;c<b.length;c++)if(b[c]===a)return!0;return!1}function hb(a){return p(a)?g.data.targets.filter(a):g.data.targets}function pd(a){return a<
Ha.length?Ha[a]:a}function mb(a){return"-shapes -shapes-"+a.id}function tc(a){return mb(a)+" -line -line-"+a.id}function Ed(a){return mb(a)+" -circles -circles-"+a.id}function uc(a){return mb(a)+" -bars -bars-"+a.id}function Fd(a){return mb(a.data)+" -arc -arc-"+a.data.id}function Gd(a,b){return"-shape -shape-"+b+" -circle -circle-"+b}function vc(a,b){return"-shape -shape-"+b+" -bar -bar-"+b}function Hd(a,b){return"region region-"+b+" "+("classes"in a?[].concat(a.classes).join(" "):"")}function nb(a){return m(a.x)}
function Oa(a){return m(z?oa(a.value):a.value)}function wc(a){return x(a.value)}function xc(a,b){var c,k=a[b].x,d=[];for(c=b-1;0<=c&&k===a[c].x;c--)d.push(a[c]);for(c=b;c<a.length&&k===a[c].x;c++)d.push(a[c]);return d}function yc(a,b,c,k){c=c?c:0;k=k?k:a.length-1;var d=Math.floor((k-c)/2)+c;0<m(a[d].x)-b[0]?k=d:c=d;return 1===k-c?(d=[],a[c].x&&(d=d.concat(xc(a,c))),a[k].x&&(d=d.concat(xc(a,k))),zc(d,b)):yc(a,b,c,k)}function Ac(a,b){var c;c=a.map(function(a){return yc(a.values,b)});return zc(c,b)}
function zc(a,b){var c,k;a.forEach(function(a){var d=Eb(a,b);if(d<c||!c)c=d,k=a});return k}function Bc(a,b){S.html(Cc(a)).style("visibility","hidden").style("display","block");var c=S.property("offsetWidth"),d=S.property("offsetHeight");S.style("top",(b[1]+15+d<Y()?b[1]+15:b[1]-d)+"px").style("left",h?b[0]:m(a[0].x)+60+c<(null===Za?da():Za)?m(a[0].x)+60+"px":m(a[0].x)-c+30+"px").style("visibility","visible")}function Dc(a){Ab(g.data.targets,"scatter")||A(g.data.targets)||l.selectAll("line.xgrid-focus").style("visibility",
"visible").data([a]).attr(h?"y1":"x1",nb).attr(h?"y2":"x2",nb)}function Ec(){l.select("line.xgrid-focus").style("visibility","hidden")}function fa(a){return a.x||0===a.x?m(a.x):null}function ga(a){return I(a.id)(a.value)}function Id(){var a={},b=0,c,d;hb(Ia).forEach(function(f){for(c=0;c<u.length;c++)if(!(0>u[c].indexOf(f.id)))for(d=0;d<u[c].length;d++)if(u[c][d]in a){a[f.id]=a[u[c][d]];break}t(a[f.id])&&(a[f.id]=b++)});a.__max__=b-1;return a}function Fc(a,b,c,d){var f=d?Q:m;return b?function(d){var k=
d.id in c?c[d.id]:0;return d.x||0===d.x?f(d.x)-a*(b/2-k):0}:function(){return 0}}function Gc(a,b,c,d){var f=Object.keys(b);return function(e,g){var h=0,l=d?X(e.id):I(e.id);hb(Ia).forEach(function(c){c.id!==e.id&&b[c.id]===b[e.id]&&f.indexOf(c.id)<f.indexOf(e.id)&&(h+=a(c.values[g]))});return c?h:l(e.value)-h}}function Hc(a,b){var c=null===a?function(a){return a}:function(b){return a>b?a-b:0};return function(a){var d=b?X(a.id):I(a.id);return c(d(a.value))}}function Pa(a,b){var c=t(a)?lb():a;"string"===
typeof c&&(c=[c]);for(var d=0;d<c.length;d++)M[c[d]]=b}function Ab(a,b){var c=!1;a.forEach(function(a){M[a.id]===b&&(c=!0);a.id in M||"line"!==b||(c=!0)});return c}function A(a){return Ab(a,"pie")}function Fb(a){a="string"===typeof a?a:a.id;return!(a in M)||"line"===M[a]||"spline"===M[a]}function Ia(a){return"bar"===M["string"===typeof a?a:a.id]}function Ic(a){return"pie"===M["string"===typeof a?a:a.id]}function Jc(a){return Ia(a)?a.values:[]}function Jd(a){var b;(b=Fb(a))||(b="scatter"===M["string"===
typeof a?a:a.id]);return b?a.values:[]}function oa(a){var b;if(!a)throw Error(a+" can not be parsed as d3.time with format "+Gb+". Maybe 'x' of this data is not defined. See data.x or data.xs option.");b=d.time.format(Gb).parse(a);if(!b)throw Error("Failed to parse '"+a+"' with format "+Gb);return b}function Kc(a,b){var c=d.mouse(a),k=d.select(a),f=1*k.attr("cx"),k=1*k.attr("cy");return Math.sqrt(Math.pow(f-c[0],2)+Math.pow(k-c[1],2))<b}function Lc(a){var b=d.mouse(a),c=d.select(a);a=1*c.attr("x");
var k=1*c.attr("y"),c=1*c.attr("width");return a-10<b[0]&&b[0]<a+c+10&&k-10<b[1]}function Kd(a,b){var c;for(c=0;c<b.length;c++)if(b[c].start<a&&a<=b[c].end)return!0;return!1}function Bd(a,b){var c=!1;Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)});return c}function Eb(a,b){return Math.pow(m(a.x)-b[0],2)+Math.pow(x(a.value)-b[1],2)}function Mc(a,b,c){Ld(a,b);l.select(".selected-circles-"+b.id).selectAll(".selected-circle-"+c).data([b]).enter().append("circle").attr("class",function(){return"selected-circle selected-circle-"+
c}).attr("cx",h?ga:fa).attr("cy",h?fa:ga).attr("stroke",function(){return T(b.id)}).attr("r",1.4*Qa).transition().duration(100).attr("r",Qa)}function Hb(a,b,c){Md(a,b);l.select(".selected-circles-"+b.id).selectAll(".selected-circle-"+c).transition().duration(100).attr("r",0).remove()}function Nc(a,b,c,d){a?Mc(b,c,d):Hb(b,c,d)}function Nd(){}function Oc(){}function Pc(a,b,c,d){}function Qc(a){return a.filter(function(a){return null!==a.value})}function Ib(a,b){return(b?l.selectAll(".-circles-"+b):
l).selectAll(".-circle"+(a||0===a?"-"+a:""))}function Jb(a){Ib(a).filter(function(){return d.select(this).classed(ba)}).classed(ba,!1).attr("r",Kb)}function Rc(a){return l.selectAll(".-bar"+(a||0===a?"-"+a:""))}function Od(a,b,c,d){var f,e,g="M",l,m,n,Sc,r,q=[];if(p(d))for(f=0;f<d.length;f++)q[f]={},t(d[f].start)?q[f].start=a[0].x:q[f].start=z?oa(d[f].start):d[f].start,t(d[f].end)?q[f].end=a[a.length-1].x:q[f].end=z?oa(d[f].end):d[f].end;Sc=h?function(a){return c(a.value)}:function(a){return b(a.x)};
r=h?function(a){return b(a.x)}:function(a){return c(a.value)};d=z?function(a,d,k,f){var e=a.x.getTime();a=d.x-a.x;d=new Date(e+a*(k+f));return"M"+b(new Date(e+a*k))+" "+c(m(k))+" "+b(d)+" "+c(m(k+f))}:function(a,d,k,f){return"M"+b(l(k))+" "+c(m(k))+" "+b(l(k+f))+" "+c(m(k+f))};for(f=0;f<a.length;f++)if(t(q)||!Kd(a[f].x,q))g+=" "+Sc(a[f])+" "+r(a[f]);else{l=K(a[f-1].x,a[f].x);m=H(a[f-1].value,a[f].value);e=b(a[f].x)-b(a[f-1].x);n=c(a[f].value)-c(a[f-1].value);e=Math.sqrt(Math.pow(e,2)+Math.pow(n,2));
n=2/e;var s=2*n;for(e=n;1>=e;e+=s)g+=d(a[f-1],a[f],e,n)}return g}function Lb(a){var b,c;ob=d.select(va);if(ob.empty())U.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{ob.html("");g.data.x={};g.data.targets=Ma(a);ta();Wb();m.domain(d.extent(ib(g.data.targets)));x.domain(gb("y"));Z.domain(gb("y2"));Q.domain(m.domain());bb.domain(x.domain());cb.domain(Z.domain());E.ticks(10>a.length?a.length:10);na.ticks(Pd).outerTickSize(0).tickFormat(Qd);
db.ticks(Rd).outerTickSize(0).tickFormat(Sd);R=m.domain();F.x(Q);qa&&B.x(m);Ra=d.select(va).append("svg").attr("width",r+D+ea).attr("height",q+s+J).on("mouseenter",Td).on("mouseleave",Ud);pb=Ra.append("defs");pb.append("clipPath").attr("id",Mb).append("rect").attr("y",s).attr("width",r).attr("height",q-s);pb.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",-1-D).attr("y",-20).attr("width",W).attr("height",V);pb.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-D+
1).attr("y",s-1).attr("width",ka).attr("height",sb);l=Ra.append("g").attr("transform",G.main);y=xa?Ra.append("g").attr("transform",G.context):null;ya=za?Ra.append("g").attr("transform",G.legend):null;S=d.select(va).style("position","relative").append("div").style("position","absolute").style("z-index","10").style("display","none");l.append("g").attr("class","x axis").attr("clip-path",h?"":"url(#xaxis-clip)").attr("transform",G.x).call(h?na:E).append("text").attr("class","-axis-x-label").attr("x",
r).attr("dy","-.5em").style("text-anchor","end").text(Vd);l.append("g").attr("class","y axis").attr("clip-path",h?"url(#yaxis-clip)":"").call(h?E:na).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor","end").text(Wd);cc&&l.append("g").attr("class","y2 axis").attr("transform",G.y2).call(db);b=l.append("g").attr("clip-path",Sa).attr("class","grid");Tc&&b.append("g").attr("class","xgrids");Nb&&(c=b.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(Nb).enter().append("g").attr("class",
"xgrid-line"),c.append("line").attr("class",function(a){return""+a["class"]}),c.append("text").attr("class",function(a){return""+a["class"]}).attr("text-anchor","end").attr("transform",h?"":"rotate(-90)").attr("dx",h?0:-s).attr("dy",-6).text(function(a){return a.text}));Xd&&b.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",h?0:-10).attr("x2",h?r:-10).attr("y1",h?-10:s).attr("y2",h?-10:q);Uc&&b.append("g").attr("class","ygrids");Ob&&b.append("g").attr("class",
"ygrid-lines").selectAll("ygrid-line").data(Ob).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]});l.append("g").attr("clip-path",Sa).attr("class","regions");l.append("g").attr("clip-path",Sa).attr("class","chart");b=l.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",qa?"ew-resize":null);aa?Yd(b):Zd(b,a);l.select(".chart").append("g").attr("class","chart-bars");l.select(".chart").append("g").attr("class","chart-lines");l.select(".chart").append("g").attr("class",
"chart-arcs").attr("transform",G.arc);if(qa)l.insert("rect",$d?null:"g.grid").attr("class","zoom-rect").attr("width",r).attr("height",q).style("opacity",0).style("cursor","ew-resize").call(B).on("dblclick.zoom",null);null!==qb&&F.extent("function"!==typeof qb?qb:qb(ib()));xa&&(y.append("g").attr("clip-path",Sa).attr("class","chart"),y.select(".chart").append("g").attr("class","chart-bars"),y.select(".chart").append("g").attr("class","chart-lines"),y.append("g").attr("clip-path",Sa).attr("class","x brush").call(F).selectAll("rect").attr("height",
ma),y.append("g").attr("class","x axis").attr("transform",G.subx).call(Ga));za&&rb(g.data.targets);Vc(g.data.targets);C({withTransition:!1,withUpdateXDomain:!0});if(ae){if(z&&"string"===typeof Aa){Aa=oa(Aa);for(a=0;a<g.data.targets[0].values.length&&0!==g.data.targets[0].values[a].x-Aa;a++);Aa=a}S.html(Cc(g.data.targets.map(function(a){return kb(a.values[Aa])})));S.style("top",Wc.top).style("left",Wc.left).style("display","block")}null==U.onresize&&(U.onresize=be)}}function Zd(a,b){a.selectAll(".event-rects").data(b).enter().append("rect").attr("class",
function(a,b){return"event-rect event-rect-"+b}).style("cursor",ha&&ra?"pointer":null).on("mouseover",function(a,b){if(!Ta&&!A(g.data.targets)){var d=g.data.targets.map(function(a){return kb(a.values[b])}),e,h;if(0<Object.keys(La).length){h=[];for(var l in La)for(e=0;e<d.length;e++)if(d[e].id===l){h.push(d[e]);d.shift(e);break}d=h.concat(d)}Pb&&Ib(b,void 0).classed(ba,!0).attr("r",Qb);Rc(b).classed(ba,!1);Dc(d[0])}}).on("mouseout",function(a,b){A(g.data.targets)||(Ec(),S.style("display","none"),Jb(b),
Rc(void 0).classed(ba,!1))}).on("mousemove",function(a,b){var e;Ta||A(g.data.targets)||(e=g.data.targets.map(function(a){return kb(a.values[b])}),Bc(e,d.mouse(this)),ha&&(ra||l.selectAll(".-shape-"+b).filter(function(a){return ia(a)}).each(function(){var a=d.select(this).classed(ba,!0);"circle"===this.nodeName&&a.attr("r",Qb);d.select(".event-rect-"+b).style("cursor",null)}).filter(function(){var a=d.select(this);if("circle"===this.nodeName)return Kc(this,Qa);if("rect"===this.nodeName)return Lc(this,
a.attr("x"),a.attr("y"))}).each(function(){var a=d.select(this);a.classed(ba)||(a.classed(ba,!0),"circle"===this.nodeName&&a.attr("r",Qa));d.select(".event-rect-"+b).style("cursor","pointer")})))}).on("click",function(a,b){A(g.data.targets)||(Rb?Rb=!1:l.selectAll(".-shape-"+b).each(function(a){Xc(this,a,b)}))}).call(d.behavior.drag().origin(Object).on("drag",function(){Yc(d.mouse(this))}).on("dragstart",function(){Zc(d.mouse(this))}).on("dragend",function(){$c()})).call(B).on("dblclick.zoom",null)}
function Yd(a){a.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",q).attr("class","event-rect").on("mouseout",function(){A(g.data.targets)||(Ec(),S.style("display","none"),Jb())}).on("mousemove",function(){var a,c,e;Ta||A(g.data.targets)||(a=d.mouse(this),c=Ac(g.data.targets,a),e=[kb(c)],Bc(e,a),Pb&&(Jb(),Ib(c.index,c.id).classed(ba,!0).attr("r",Qb)),Dc(e[0]),100>Eb(c,a)?d.select(".event-rect").style("cursor","pointer"):d.select(".event-rect").style("cursor",null))}).on("click",
function(){var a,c;A(g.data.targets)||(a=d.mouse(this),c=Ac(g.data.targets,a),100>Eb(c,a)&&l.select(".-circles-"+c.id).select(".-circle-"+c.index).each(function(){Xc(this,c,c.index)}))}).call(d.behavior.drag().origin(Object).on("drag",function(){Yc(d.mouse(this))}).on("dragstart",function(){Zc(d.mouse(this))}).on("dragend",function(){$c()})).call(B).on("dblclick.zoom",null)}function Xc(a,b,c){var e=d.select(a),f=e.classed(ja),g=!1,h;"circle"===a.nodeName?(g=Kc(a,1.5*Qa),h=Nc):"rect"===a.nodeName&&
(g=Lc(a),h=Pc);if(ra||g)ha&&ia(b)&&(e.classed(ja,!f),h(!f,e,b,c)),ce(b,e)}function Yc(a){var b,c,e,f,h,m,n;A(g.data.targets)||!ha||qa&&!B.altDomain||(b=Sb[0],c=Sb[1],e=a[0],a=a[1],f=Math.min(b,e),h=Math.max(b,e),m=ra?s:Math.min(c,a),n=ra?q:Math.max(c,a),l.select(".dragarea").attr("x",f).attr("y",m).attr("width",h-f).attr("height",n-m),l.selectAll(".-shapes").selectAll(".-shape").filter(function(a){return ia(a)}).each(function(a,b){var c=d.select(this),e=c.classed(ja),k=c.classed(Tb),g,l,p,q;g=!1;
"circle"===this.nodeName?(g=1*c.attr("cx"),l=1*c.attr("cy"),q=Nc,g=f<g&&g<h&&m<l&&l<n):"rect"===this.nodeName&&(g=1*c.attr("x"),l=1*c.attr("y"),p=1*c.attr("width"),q=Pc,g=f<g+p&&g<h&&l<n);g^k&&(c.classed(Tb,!k),c.classed(ja,!e),q(!e,c,a,b))}))}function Zc(a){!A(g.data.targets)&&ha&&(Sb=a,l.select(".chart").append("rect").attr("class","dragarea").style("opacity",0.1),Ta=!0)}function $c(){!A(g.data.targets)&&ha&&(l.select(".dragarea").transition().duration(100).style("opacity",0).remove(),l.selectAll(".-shape").classed(Tb,
!1),Ta=!1)}function C(a){var b,c,e,f=Id(),n=f.__max__+1,v,t,u,w;a=p(a)?a:{};c=p(a.withY)?a.withY:!0;u=p(a.withSubchart)?a.withSubchart:!0;w=p(a.withTransition)?a.withTransition:!0;b=p(a.withUpdateXDomain)?a.withUpdateXDomain:!1;a=p(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1;v=A(g.data.targets);w=w?250:0;a&&(m.domain(d.extent(ib(g.data.targets))),R=m.domain(),B.x(m).updateScaleExtent(),Q.domain(m.domain()),F.x(Q));b&&(m.domain(F.empty()?R:F.extent()),qa&&B.x(m).updateScaleExtent());x.domain(gb("y"));
Z.domain(gb("y2"));l.select(".x.axis").transition().duration(h?w:0).call(h?na:E).style("opacity",v?0:1);l.select(".y.axis").transition().duration(h?0:w).call(h?E:na).style("opacity",v?0:1);l.select(".y2.axis").transition().call(db).style("opacity",v?0:1);l.select(".x.axis .-axis-x-label").attr("x",r);bb.domain(x.domain());cb.domain(Z.domain());S.style("display","none");l.select("line.xgrid-focus").style("visibility","hidden").attr("y2",q);if(Tc){if("year"===de)for(b=[],v=ib(),a=v[0].getFullYear(),
v=v[1].getFullYear();a<=v;a++)b.push(new Date(a+"-01-01 00:00:00"));else b=m.ticks(10);b=l.select(".xgrids").selectAll(".xgrid").data(b);b.enter().append("line").attr("class","xgrid");b.attr("x1",h?0:function(a){return m(a)-E.tickOffset()}).attr("x2",h?r:function(a){return m(a)-E.tickOffset()}).attr("y1",h?function(a){return m(a)-E.tickOffset()}:s).attr("y2",h?function(a){return m(a)-E.tickOffset()}:q).style("opacity",function(){return+d.select(this).attr(h?"y1":"x1")===(h?q:0)?0:1});b.exit().remove()}Nb&&
(b=l.selectAll(".xgrid-lines"),b.selectAll("line").attr("x1",h?0:Oa).attr("x2",h?r:Oa).attr("y1",h?Oa:s).attr("y2",h?Oa:q),b.selectAll("text").attr("x",h?r:0).attr("y",Oa));c&&Uc&&(b=l.select(".ygrids").selectAll(".ygrid").data(x.ticks(10)),b.enter().append("line").attr("class","ygrid"),b.attr("x1",h?x:0).attr("x2",h?x:r).attr("y1",h?0:x).attr("y2",h?q:x),b.exit().remove());c&&Ob&&l.select(".ygrid-lines").selectAll(".ygrid-line").attr("y1",wc).attr("y2",wc);a=$?n?1.2*E.tickOffset()/n:0:0.6*((h?q:
r)*Bb(!1)/(Na()-1));v=Hc(h?null:q);c=Fc(a,n,f);b=Gc(v,f,h);e=l.selectAll(".-bars").selectAll(".-bar").data(Jc);e.transition().duration(w).attr("x",h?b:c).attr("y",h?c:b).attr("width",h?v:a).attr("height",h?a:v);e.enter().append("rect").attr("class",vc).attr("x",h?b:c).attr("y",h?c:b).attr("width",h?v:a).attr("height",h?a:v).style("opacity",0).transition().duration(w).style("opacity",1);e.exit().transition().duration(w).style("opacity",0).remove();l.selectAll(".chart-line").select(".-line").transition().duration(w).attr("d",
ee);c=l.selectAll(".-circles").selectAll(".-circle").data(Jd);c.transition().duration(w).style("opacity",function(a){return null===a.value?0:1}).attr("cx",h?ga:fa).attr("cy",h?fa:ga);c.enter().append("circle").style("opacity",function(a){return null===a.value?0:1}).attr("class",Gd).attr("cx",h?ga:fa).attr("cy",h?fa:ga).attr("r",Kb);c.exit().remove();l.selectAll(".chart-arc").select(".-arc").style("opacity",function(a){return a===this._current?0:1}).transition().duration(w).attrTween("d",function(a){a=
Xa(a);if(!a)return function(){return"M 0 0"};var b=d.interpolate(this._current,a);this._current=b(0);return function(a){a=b(a);return Ic(a.data)?eb(a,!0):"M 0 0"}}).style("opacity",1);l.selectAll(".chart-arc").select("text").attr("transform",sa).attr("opacity",0).transition().duration(w).text(Ya).attr("opacity",function(a){return Ic(a.data)?1:0});xa&&(null!==d.event&&"zoom"===d.event.type&&F.extent(m.orgDomain()).update(),u&&(y.select(".x.axis").transition().duration(h?w:0).call(h?na:Ga),F.empty()||
F.extent(m.orgDomain()).update(),a=$?n?1.2*Ga.tickOffset()/n:0:0.6*((h?q:r)*Bb(!0)/(Na()-1)),v=Hc(ma,!0),c=Fc(a,n,f,!0),b=Gc(v,f,!1,!0),f=y.selectAll(".-bars").selectAll(".-bar").data(Jc),f.transition().duration(w).attr("x",c).attr("y",b).attr("width",a).attr("height",v),f.enter().append("rect").attr("class",vc).attr("x",c).attr("y",b).attr("width",a).attr("height",v).style("opacity",0).transition().style("opacity",1),f.exit().transition().style("opacity",0).remove(),y.selectAll(".-line").transition().duration(w).attr("d",
fe)));l.selectAll(".selected-circles").filter(function(a){return Ia(a)}).selectAll("circle").remove();l.selectAll(".selected-circle").transition().duration(w).attr("cx",h?ga:fa).attr("cy",h?fa:ga);aa||(Db?(t=function(a,b){var c=0<b?g.data.targets[0].values[b-1].x:void 0,d=b<Na()-1?g.data.targets[0].values[b+1].x:void 0;return(m(d?d:a.x+50)-m(c?c:a.x-50))/2},f=function(a,b){var c=0<b?g.data.targets[0].values[b-1].x:void 0;return(m(a.x)+m(c?c:a.x-50))/2}):(t=(h?q:r)*Bb()/(Na()-1),f=function(a){return m(a.x)-
t/2}),l.selectAll(".event-rect").attr("x",h?0:f).attr("y",h?f:0).attr("width",h?r:t).attr("height",h?t:q));f=l.select(".regions").selectAll("rect.region").data(N);f.enter().append("rect");f.attr("class",Hd).attr("x",h?0:Cb).attr("y",h?Cb:s).attr("width",h?r:oc).attr("height",h?oc:q).style("fill-opacity",function(a){return p(a.opacity)?a.opacity:0.1});f.exit().transition().duration(w).style("fill-opacity",0).remove()}function ge(){"mousemove"===d.event.sourceEvent.type&&B.altDomain?(m.domain(B.altDomain),
B.x(m).updateScaleExtent()):($&&m.orgDomain()[0]===R[0]&&m.domain([R[0]-1E-10,m.orgDomain()[1]]),C({withTransition:!1,withY:!1,withSubchart:!1}),"mousemove"===d.event.sourceEvent.type&&(Rb=!0))}function be(){ta();Wb();F.x(Q);qa&&B.x(m);d.select("svg").attr("width",tb).attr("height",ua);d.select("#"+Mb).select("rect").attr("width",r).attr("height",q);d.select("#xaxis-clip").select("rect").attr("width",W);d.select(".zoom-rect").attr("width",r).attr("height",q);l.select(".x.axis").attr("transform",G.x);
l.select(".y2.axis").attr("transform",G.y2);l.select(".chart-arcs").attr("transform",G.arc);xa&&(y.select(".x.brush").selectAll("rect").attr("height",ma),y.attr("transform",G.context),y.select(".x.axis").attr("transform",G.subx));za&&(ya.attr("transform",G.legend),rb(g.data.targets,{withTransition:!1}));C({withTransition:!1,withUpdateXDomain:!0})}function Vc(a){var b;ad&&Pa(lb(a).filter(function(a){return!(a in M)}),ad);l.select(".chart-bars").selectAll(".chart-bar").data(a).enter().append("g").attr("class",
function(a){return"chart-bar target target-"+a.id}).style("pointer-events","none").style("opacity",0).append("g").attr("class",uc).style("fill",function(a){return T(a.id)}).style("stroke",function(a){return T(a.id)}).style("stroke-width",0).style("cursor",function(a){return ia(a)?"pointer":null});b=l.select(".chart-lines").selectAll(".chart-line").data(a).enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}).style("pointer-events","none").style("opacity",0);b.append("path").attr("class",
tc).style("stroke",function(a){return T(a.id)});b.append("g").attr("class",function(a){return"selected-circles selected-circles-"+a.id});b.append("g").attr("class",Ed).style("fill",function(a){return T(a.id)}).style("cursor",function(a){return ia(a)?"pointer":null});a.forEach(function(a){l.selectAll(".selected-circles-"+a.id).selectAll(".selected-circle").each(function(b){b.value=a.values[b.x].value})});b=l.select(".chart-arcs").selectAll(".chart-arc").data(zb(a)).enter().append("g").attr("class",
function(a){return"chart-arc target target-"+a.data.id}).style("opacity",0);b.append("path").attr("class",Fd).style("fill",function(a){return T(a.data.id)}).style("cursor",function(a){return ia(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a){Ea(a.data.id);bd(a.data.id)}).on("mouseout",function(a){Fa(a.data.id);cd()});b.append("text").attr("dy",".35em").style("text-anchor","middle").style("pointer-events","none");xa&&(b=y.select(".chart-bars").selectAll(".chart-bar").data(a),
b=b.enter().append("g").attr("class",function(a){return"chart-bar target target-"+a.id}).style("opacity",0),b.append("g").attr("class",uc).style("fill",function(a){return T(a.id)}),b=y.select(".chart-lines").selectAll(".chart-line").data(a),b=b.enter().append("g").attr("class",function(a){return"chart-line target target-"+a.id}).style("opacity",0),b.append("path").attr("class",tc).style("stroke",function(a){return T(a.id)}));za&&rb(a);d.selectAll(".target").transition().style("opacity",1)}function Ua(a,
b){g.data.targets.forEach(function(b){for(var d=0;d<a.length;d++)if(b.id===a[d].id){b.values=a[d].values;a.splice(d,1);break}});g.data.targets=g.data.targets.concat(a);Vc(g.data.targets);C({withUpdateOrgXDomain:!0,withUpdateXDomain:!0});b()}function bd(a){d.selectAll(".legend-item").filter(function(b){return b!==a}).transition().duration(100).style("opacity",0.3)}function cd(){d.selectAll(".legend-item").transition().duration(100).style("opacity",1)}function rb(a,b){var c=lb(a),d,e=r/2-Va*Object.keys(a).length/
2,h;b=t(b)?{}:b;h=p(b.withTransition)?b.withTransition:!0;d=ya.selectAll(".legend-item").data(c).enter().append("g").attr("class",function(a){return"legend-item legend-item-"+a}).style("cursor","pointer").on("click",function(a){he(a)}).on("mouseover",function(a){bd(a);g.focus(a)}).on("mouseout",function(){cd();g.revert()});d.append("rect").attr("class","legend-item-event").style("fill-opacity",0).attr("x",-200).attr("y",function(){return la/2-16}).attr("width",Va).attr("height",24);d.append("rect").attr("class",
"legend-item-tile").style("pointer-events","none").style("fill",function(a){return T(a)}).attr("x",-200).attr("y",function(){return la/2-9}).attr("width",10).attr("height",10);d.append("text").text(function(a){return p(La[a])?La[a]:a}).style("pointer-events","none").attr("x",-200).attr("y",function(){return la/2});ya.selectAll("rect.legend-item-event").data(c).transition().duration(h?250:0).attr("x",function(a,b){return e+Va*b});ya.selectAll("rect.legend-item-tile").data(c).transition().duration(h?
250:0).attr("x",function(a,b){return e+Va*b});ya.selectAll("text").data(c).transition().duration(h?250:0).attr("x",function(a,b){return e+Va*b+14})}function Wa(a){return p(a)?".target-"+a:".target"}function Ub(a){return sc(a.id)}function Vb(a){return"data"in a&&sc(a.data.id)}var g={data:{}},jb={},ba="_expanded_",ja="_selected_",Tb="_included_",va=e(["bindto"],"#chart"),Za=e(["size","width"],null),hc=e(["size","height"],null),dc=e(["padding","left"],null),bc=e(["padding","right"],null),qa=e(["zoom",
"enabled"],!1),dd=e(["zoom","extent"],null),$d=e(["zoom","privileged"],!1),Td=e(["onenter"],function(){}),Ud=e(["onleave"],function(){});if(!("data"in ca))throw Error("data is required in config");var pa=e(["data","x"],null),aa=e(["data","xs"],null),Gb=e(["data","x_format"],"%Y-%m-%d"),Dd=e(["data","id_converter"],function(a){return a}),La=e(["data","names"],{}),u=e(["data","groups"],[]),mc=e(["data","axes"],{}),ad=e(["data","type"],null),M=e(["data","types"],{}),ed=e(["data","regions"],{}),ie=e(["data",
"colors"],{}),ha=e(["data","selection","enabled"],!1),ra=e(["data","selection","grouped"],!1),ia=e(["data","selection","isselectable"],function(){return!0}),xa=e(["subchart","show"],!1),$b=xa?e(["subchart","size","height"],60):0,je=e(["color","pattern"],null),za=e(["legend","show"],!0),Va=e(["legend","item","width"],80),he=e(["legend","item","onclick"],function(){}),fd=e(["axis","x","type"],"indexed"),Ha=e(["axis","x","categories"],[]),nd=e(["axis","x","tick","centered"],!1),fb=e(["axis","x","tick",
"format"],null),qb=e(["axis","x","default"],null),Vd=e(["axis","x","label"],null),ud=e(["axis","y","max"],null),sd=e(["axis","y","min"],null),wd=e(["axis","y","center"],null),Wd=e(["axis","y","label"],null),vb=e(["axis","y","inner"],!1),Qd=e(["axis","y","tick","format"],function(a){return a}),Ja=e(["axis","y","padding"],null),Pd=e(["axis","y","ticks"],10),cc=e(["axis","y2","show"],!1),td=e(["axis","y2","max"],null),rd=e(["axis","y2","min"],null),vd=e(["axis","y2","center"],null),ub=e(["axis","y2",
"inner"],!1),Sd=e(["axis","y2","tick","format"],function(a){return a}),Ka=e(["axis","y2","padding"],null),Rd=e(["axis","y2","ticks"],10),h=e(["axis","rotated"],!1),Tc=e(["grid","x","show"],!1),de=e(["grid","x","type"],"tick"),Nb=e(["grid","x","lines"],null),Uc=e(["grid","y","show"],!1),Ob=e(["grid","y","lines"],null),Kb=e(["point","show"],!0)?e(["point","r"],2.5):0,Xd=e(["point","focus","line","enabled"],!0),Pb=e(["point","focus","expand","enabled"],!0),Qb=e(["point","focus","expand","r"],Pb?4:Kb),
Qa=e(["point","focus","select","r"],8),ce=e(["point","onclick"],function(){}),Ld=e(["point","onselected"],function(){}),Md=e(["point","onunselected"],function(){}),N=e(["regions"],[]),Cc=e(["tooltip","contents"],function(a){var b="<table class='-tooltip'><tr><th colspan='2'>"+L()(a[0].x)+"</th></tr>",c,d,e;for(c=0;c<a.length;c++)p(a[c])?(d=p(a[c].value)?(Math.round(100*a[c].value)/100).toFixed(2):"-",e=a[c].name):e=d="-",b+="<tr class='-tooltip-name-"+a[c].id+"'><td class='name'><span style='background-color:"+
T(a[c].id)+"'></span>"+e+"</td><td class='value'>"+d+"</td></tr>";return b+"</table>"}),ae=e(["tooltip","init","show"],!1),Aa=e(["tooltip","init","x"],0),Wc=e(["tooltip","init","position"],{top:"0px",left:"50px"}),Mb=va.replace("#","")+"-clip",Sa="url(#"+Mb+")",z="timeseries"===fd,$="categorized"===fd,Db=!z&&(pa||aa),Sb=null,Ta=!1,Rb=!1,la=za?40:0,T=function(a,b){var c=[],d=null!==b?b:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" ");return function(b){if(b in
a)return a[b];-1===c.indexOf(b)&&c.push(b);return d[c.indexOf(b)%d.length]}}(ie,je),od=function(){var a=[[d.time.format("%Y/%-m/%-d"),function(){return!0}],[d.time.format("%-m/%-d"),function(a){return a.getMonth()}],[d.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[d.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[d.time.format("%I %p"),function(a){return a.getHours()}],[d.time.format("%I:%M"),function(a){return a.getMinutes()}],[d.time.format(":%S"),function(a){return a.getSeconds()}],
[d.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),Zb,fc,ac,$a,ec,gc,r,q,ma,tb,ua,ab,wb,eb,kc,lc,zb,ic,jc,xb,yb,m,x,Z,Q,bb,cb,E,na,db,Ga,jd=h?"left":"bottom",kd=h?vb?"top":"bottom":vb?"right":"left",ld=h?ub?"bottom":"top":ub?"left":"right",md="bottom",G={main:function(){return"translate("+D+","+s+")"},context:function(){return"translate("+n+","+Ba+")"},legend:function(){return"translate("+Yb+","+Xb+")"},
y2:function(){return"translate("+(h?0:r)+","+(h?10:0)+")"},x:function(){return"translate(0,"+q+")"},subx:function(){return"translate(0,"+ma+")"},arc:function(){return"translate("+r/2+","+q/2+")"}};zb=d.layout.pie().value(function(a){return a.values.reduce(function(a,c){return a+c.value},0)});var ee=function(){var a=d.svg.line().x(h?function(a){return I(a.id)(a.value)}:nb).y(h?nb:function(a){return I(a.id)(a.value)});return function(b){var c=Qc(b.values),d;if(Fb(b))return"spline"===M["string"===typeof b?
b:b.id]?a.interpolate("cardinal"):a.interpolate("linear"),ed[b.id]?Od(c,m,I(b.id),ed[b.id]):a(c);d=m(c[0].x);b=I(b.id)(c[0].value);return h?"M "+b+" "+d:"M "+d+" "+b}}(),fe=function(){var a=d.svg.line().x(function(a){return Q(a.x)}).y(function(a){return X(a.id)(a.value)});return function(b){var c=Qc(b.values);return Fb(b)?a(c):"M "+Q(c[0].x)+" "+X(b.id)(c[0].value)}}(),F=d.svg.brush().on("brush",function(){C({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}),B=d.behavior.zoom().on("zoomstart",
function(){B.altDomain=d.event.sourceEvent.altKey?m.orgDomain():null}).on("zoom",qa?ge:null);F.update=function(){y&&y.select(".x.brush").call(this);return this};B.orgScaleExtent=function(){var a=dd?dd:[1,10];return[a[0],Math.max(Na()/a[1],a[1])]};B.updateScaleExtent=function(){var a=m.orgDomain(),a=(a[1]-a[0])/(R[1]-R[0]),b=this.orgScaleExtent();this.scaleExtent([b[0]*a,b[1]*a]);return this};var Ra,pb,l,y,ya,S,ob,R;g.focus=function(a){var b=d.selectAll(Wa(a)),c=b.filter(Ub),b=b.filter(Vb);g.defocus();
c.classed("focused",!0).transition().duration(100).style("opacity",1);b.transition().duration(100).style("opacity",1);A(g.data.targets)&&Ea(a,!0)};g.defocus=function(a){var b=d.selectAll(Wa(a)),c=b.filter(Ub),b=b.filter(Vb);c.classed("focused",!1).transition().duration(100).style("opacity",0.3);b.transition().duration(100).style("opacity",0.3);A(g.data.targets)&&Fa(a)};g.revert=function(a){var b=d.selectAll(Wa(a)),c=b.filter(Ub),b=b.filter(Vb);c.classed("focused",!1).transition().duration(100).style("opacity",
1);b.transition().duration(100).style("opacity",1);A(g.data.targets)&&Fa(a)};g.show=function(a){d.selectAll(Wa(a)).transition().style("opacity",1)};g.hide=function(a){d.selectAll(Wa(a)).transition().style("opacity",0)};g.unzoom=function(){F.clear().update();C({withUpdateXDomain:!0})};g.load=function(a){t(a.done)&&(a.done=function(){});"categories"in a&&$&&(Ha=a.categories,E.categories(Ha));if("cacheIds"in a&&zd(a.cacheIds))Ua(Ad(a.cacheIds),a.done);else if("data"in a)Ua(Ma(a.data),a.done);else if("url"in
a)d.csv(a.url,function(b,c){Ua(Ma(c),a.done)});else if("rows"in a)Ua(Ma(qc(a.rows)),a.done);else if("columns"in a)Ua(Ma(rc(a.columns)),a.done);else throw Error("url or rows or columns is required.");};g.unload=function(a){g.data.targets=g.data.targets.filter(function(b){return b.id!==a});d.selectAll(".target-"+a).transition().style("opacity",0).remove();za&&(d.selectAll(".legend-item-"+a).remove(),rb(g.data.targets));0<g.data.targets.length&&C({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})};g.selected=
function(a){a=p(a)?"-"+a:"";return d.merge(l.selectAll(".-shapes"+a).selectAll(".-shape").filter(function(){return d.select(this).classed(ja)}).map(function(a){return a.map(function(a){return a.__data__})}))};g.select=function(a,b,c){ha&&l.selectAll(".-shapes").selectAll(".-shape").each(function(e,f){var g="circle"===this.nodeName?Mc:Nd,h="circle"===this.nodeName?Hb:Oc;0<=b.indexOf(f)?ia(e)&&(ra||t(a)||0<=a.indexOf(e.id))&&g(d.select(this).classed(ja,!0),e,f):p(c)&&c&&h(d.select(this).classed(ja,
!1),e,f)})};g.unselect=function(a,b){ha&&l.selectAll(".-shapes").selectAll(".-shape").each(function(c,e){var f="circle"===this.nodeName?Hb:Oc;(t(b)||0<=b.indexOf(e))&&ia(c)&&(ra||t(a)||0<=a.indexOf(c.id))&&f(d.select(this).classed(ja,!1),c,e)})};g.toLine=function(a){Pa(a,"line");C()};g.toSpline=function(a){Pa(a,"spline");C()};g.toBar=function(a){Pa(a,"bar");C()};g.toScatter=function(a){Pa(a,"scatter");C()};g.groups=function(a){if(t(a))return u;u=a;C();return u};g.regions=function(a){if(t(a))return N;
N=a;C();return N};g.regions.add=function(a){if(t(a))return N;N=N.concat(a);C();return N};g.regions.remove=function(a,b){var c=[].concat(a);b=p(b)?b:{};c.forEach(function(a){var c=d.selectAll("."+a);p(b.duration)&&(c=c.transition().duration(b.duration).style("fill-opacity",0));c.remove();N=N.filter(function(b){return 0>b.classes.indexOf(a)})});return N};g.data.get=function(a){a=g.data.getAsTarget(a);return p(a)?a.values.map(function(a){return a.value}):void 0};g.data.getAsTarget=function(a){var b=
hb(function(b){return b.id===a});return 0<b.length?b[0]:void 0};g.destroy=function(){g.data.targets=void 0;g.data.x={};ob.html("");U.onresize=null};if("url"in ca.data)d.csv(ca.data.url,function(a,b){Lb(b)});else if("rows"in ca.data)Lb(qc(ca.data.rows));else if("columns"in ca.data)Lb(rc(ca.data.columns));else throw Error("url or rows or columns is required.");return g}})(window);

7
htdocs/index.html

@ -66,7 +66,7 @@
<div class="row">
<div class="col-md-4">
<h3>Load Data</h3>
<p>Load data dinamically.</p>
<p>Load data dynamically.</p>
<p><a class="btn btn-default" href="/samples/data_load.html" role="button">View details &raquo;</a></p>
</div>
</div>
@ -93,6 +93,11 @@
</div>
</div>
<div class="row">
<div class="col-md-4">
<h3>Area Chart</h3>
<p>Display as Filled Area Chart</p>
<p><a class="btn btn-default" href="/samples/chart_area.html" role="button">View details &raquo;</a></p>
</div>
<div class="col-md-4">
<h3>Combination Chart</h3>
<p>Display as Bar Chart</p>

25
htdocs/samples/chart_area.html

@ -0,0 +1,25 @@
<html>
<head>
<link href="/css/c3.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="chart"></div>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="/js/c3.js"></script>
<script>
var chart = c3.generate({
data: {
columns: [
['data1', 300, 350, 300, 0, 0, 0],
['data2', 130, 100, 140, 200, 150, 50]
],
types: {
data1: 'area',
data2: 'area-spline'
}
}
});
</script>
</body>
</html>

2
package.json

@ -1,6 +1,6 @@
{
"name": "c3",
"version": "0.1.3",
"version": "0.1.6",
"description": "D3-based reusable chart library",
"main": "c3.js",
"scripts": {

Loading…
Cancel
Save