Browse Source

Fix grid.y.lines

pull/34/merge
Masayuki Tanaka 11 years ago
parent
commit
f7c94e7fc3
  1. 5
      c3.css
  2. 28
      c3.js
  3. 159
      c3.min.js

5
c3.css

@ -27,7 +27,10 @@ text {
/*-- Grid --*/ /*-- Grid --*/
.grid line { .grid line {
stroke: #ccc; stroke: #aaa;
}
.grid text {
fill: #aaa;
} }
.xgrid, .ygrid { .xgrid, .ygrid {
stroke-dasharray: 3 3; stroke-dasharray: 3 3;

28
c3.js

@ -1330,7 +1330,7 @@
var orgXDomain; var orgXDomain;
function init(data) { function init(data) {
var eventRect, grid, xgridLine; var eventRect, grid, xgridLines, ygridLines;
var i; var i;
selectChart = d3.select(__bindto); selectChart = d3.select(__bindto);
@ -1458,20 +1458,20 @@
grid.append("g").attr("class", "xgrids"); grid.append("g").attr("class", "xgrids");
} }
if (__grid_x_lines) { if (__grid_x_lines) {
xgridLine = grid.append('g') xgridLines = grid.append('g')
.attr("class", "xgrid-lines") .attr("class", "xgrid-lines")
.selectAll('.xgrid-line') .selectAll('.xgrid-line')
.data(__grid_x_lines) .data(__grid_x_lines)
.enter().append('g') .enter().append('g')
.attr("class", "xgrid-line"); .attr("class", "xgrid-line");
xgridLine.append('line') xgridLines.append('line')
.attr("class", function (d) { return "" + d['class']; }); .attr("class", function (d) { return "" + d['class']; });
xgridLine.append('text') xgridLines.append('text')
.attr("class", function (d) { return "" + d['class']; }) .attr("class", function (d) { return "" + d['class']; })
.attr("text-anchor", "end") .attr("text-anchor", "end")
.attr("transform", __axis_rotated ? "" : "rotate(-90)") .attr("transform", __axis_rotated ? "" : "rotate(-90)")
.attr('dx', __axis_rotated ? 0 : -margin.top) .attr('dx', __axis_rotated ? 0 : -margin.top)
.attr('dy', -6) .attr('dy', -5)
.text(function (d) { return d.text; }); .text(function (d) { return d.text; });
} }
if (__point_focus_line_enabled) { if (__point_focus_line_enabled) {
@ -1490,12 +1490,21 @@
grid.append('g').attr('class', 'ygrids'); grid.append('g').attr('class', 'ygrids');
} }
if (__grid_y_lines) { if (__grid_y_lines) {
grid.append('g') ygridLines = grid.append('g')
.attr('class', 'ygrid-lines') .attr('class', 'ygrid-lines')
.selectAll('ygrid-line') .selectAll('ygrid-line')
.data(__grid_y_lines) .data(__grid_y_lines)
.enter().append('line') .enter().append('g')
.attr("class", function (d) { return "ygrid-line " + d['class']; }); .attr("class", "ygrid-line");
ygridLines.append('line')
.attr("class", function (d) { return "" + d['class']; });
ygridLines.append('text')
.attr("class", function (d) { return "" + d['class']; })
.attr("text-anchor", "end")
.attr("transform", __axis_rotated ? "rotate(-90)" : "")
.attr('dx', __axis_rotated ? 0 : -margin.top)
.attr('dy', -5)
.text(function (d) { return d.text; });
} }
// Area // Area
@ -1981,6 +1990,9 @@
.attr("x2", __axis_rotated ? yv : width) .attr("x2", __axis_rotated ? yv : width)
.attr("y1", __axis_rotated ? 0 : yv) .attr("y1", __axis_rotated ? 0 : yv)
.attr("y2", __axis_rotated ? height : yv); .attr("y2", __axis_rotated ? height : yv);
ygridLines.selectAll('text')
.attr("x", __axis_rotated ? 0 : width)
.attr("y", yv);
} }
// bars // bars

159
c3.min.js vendored

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

Loading…
Cancel
Save