From 851a8be5afefba37d1ce26b5e7c0a8daaea9a8f8 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Tue, 28 Jan 2014 15:54:25 +0900 Subject: [PATCH] Update c3.min.js --- c3.min.js | 136 +++++++++++++++++++++++++++--------------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/c3.min.js b/c3.min.js index baecd49..4fb663a 100644 --- a/c3.min.js +++ b/c3.min.js @@ -1,68 +1,68 @@ -(function(P){function vc(){function n(e,d){e.attr("transform",function(e){return"translate("+(d(e)+X)+", 0)"})}function t(e,d){e.attr("transform",function(e){return"translate(0,"+d(e)+")"})}function P(e){var d=e[0];e=e[e.length-1];return da?0:a}function Eb(a){var b=Ha[a.id];a.name=n(b)?b:a.id;return a}function Vb(a){var b=a[0],c={},g=[],p,e;for(p=1;pw[c].indexOf(e.id)))for(g=0;g=q;q+=v)k+=e(a[d-1],a[d],q,u)}return k}function tb(a){var b,c;ab=e.select(ua);if(ab.empty())P.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{ab.html("");k.data.x=void 0; -k.data.targets=Ia(a);R();Bb();m.domain(e.extent(a.map(function(a){return a.x})));y.domain(ja("y"));S.domain(ja("y2"));$.domain(m.domain());Ua.domain(y.domain());Va.domain(S.domain());J.ticks(10>a.length?a.length:10);ma.ticks(Uc).outerTickSize(0).tickFormat(Vc);Wa.ticks(Wc).outerTickSize(0).tickFormat(Xc);T=m.domain();F.x($);oa&&G.x(m);La=e.select(ua).append("svg").attr("width",s+B+A).attr("height",r+v+Z).on("mouseenter",Yc).on("mouseleave",Zc);bb=La.append("defs");bb.append("clipPath").attr("id", -ub).append("rect").attr("y",v).attr("width",s).attr("height",r-v);bb.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",-1-B).attr("y",-20).attr("width",X).attr("height",Y);bb.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-B+1).attr("y",v-1).attr("width",ia).attr("height",fb);h=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;ea=e.select(ua).style("position","relative").append("div").style("position", -"absolute").style("width","30%").style("z-index","10").style("visibility","hidden");h.append("g").attr("class","x axis").attr("clip-path",f?"":"url(#xaxis-clip)").attr("transform",K.x).call(f?ma:J).append("text").attr("class","-axis-x-label").attr("x",s).attr("dy","-.5em").style("text-anchor","end").text($c);h.append("g").attr("class","y axis").attr("clip-path",f?"url(#yaxis-clip)":"").call(f?J:ma).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor", -"end").text(ad);Lb&&h.append("g").attr("class","y2 axis").attr("transform",K.y2).call(Wa);b=h.append("g").attr("clip-path",Ma).attr("class","grid");lc&&b.append("g").attr("class","xgrids");vb&&(c=b.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(vb).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:-v).attr("dy",-6).text(function(a){return a.text}));bd&&b.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",f?0:-10).attr("x2",f?s:-10).attr("y1",f?-10:v).attr("y2",f?-10:r);mc&&b.append("g").attr("class","ygrids");wb&&b.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(wb).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]});h.append("g").attr("clip-path",Ma).attr("class","regions");h.append("g").attr("clip-path", -Ma).attr("class","chart");h.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",fa&&pa?"pointer":null).on("mouseover",function(a,b){if(!cb){var c=k.data.targets.map(function(a){return Eb(a.values[b])}),d,n;if(0",c,d,e;for(c=0;c"+e+""+d+"";return b+""}),ed=d(["tooltip","init","show"],!1),Aa=d(["tooltip","init","x"],0),rc= -d(["tooltip","init","position"],{top:"0px",left:"50px"}),ub=ua.replace("#","")+"-clip",Ma="url(#"+ub+")",z="timeseries"===uc,aa="categorized"===uc,lb=!z&&U,zb=null,cb=!1,yb=!1,ka=za?40:0,na=e.time.format(ld).parse,V=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]}}(md,nd),Ac=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 c=a.length-1,d= -a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),Hb,Ob,Jb,Ta,Nb,Pb,s,r,la,gb,va,Qb,Rb,jb,kb,m,y,S,$,Ua,Va,J,ma,Wa,Ca,wc=f?"left":"bottom",xc=f?ib?"top":"bottom":ib?"right":"left",yc=f?hb?"bottom":"top":hb?"left":"right",zc="bottom",K={main:function(){return"translate("+B+","+v+")"},context:function(){return"translate("+H+","+Ba+")"},legend:function(){return"translate("+Db+","+Cb+")"},y2:function(){return"translate("+(f?0:s)+","+(f?10:0)+")"},x:function(){return"translate(0,"+r+")"},subx:function(){return"translate(0,"+ -la+")"}},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 c=kc(b.values),d;if(rb(b))return"spline"===da["string"===typeof b?b:b.id]?a.interpolate("cardinal"):a.interpolate("linear"),0b.classes.indexOf(a)})});return L};k.data.get=function(a){a=k.data.getAsTarget(a);return n(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 0a?0:a}function nb(a){var b=Ga[a.id];a.name=n(b)?b:a.id;return a}function Wb(a){var b=a[0],d={},g=[],p,e;for(p=1;pw[d].indexOf(e.id)))for(g=0;g=h;h+=v)s+=e(a[c-1],a[c],h,u)}return s}function wb(a){var b,d;bb=e.select(ua);if(bb.empty())M.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{bb.html("");h.data.x=void 0; +h.data.targets=Ha(a);R();O();l.domain(e.extent(a.map(function(a){return a.x})));z.domain(Q("y"));T.domain(Q("y2"));ca.domain(l.domain());Va.domain(z.domain());Wa.domain(T.domain());I.ticks(10>a.length?a.length:10);na.ticks(Wc).outerTickSize(0).tickFormat(Xc);Xa.ticks(Yc).outerTickSize(0).tickFormat(Zc);U=l.domain();E.x(ca);pa&&F.x(l);Ka=e.select(ua).append("svg").attr("width",r+C+B).attr("height",q+v+ba).on("mouseenter",$c).on("mouseleave",ad);cb=Ka.append("defs");cb.append("clipPath").attr("id", +xb).append("rect").attr("y",v).attr("width",r).attr("height",q-v);cb.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",-1-C).attr("y",-20).attr("width",Z).attr("height",hb);cb.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-C+1).attr("y",v-1).attr("width",xc).attr("height",N);k=Ka.append("g").attr("transform",J.main);x=wa?Ka.append("g").attr("transform",J.context):null;xa=ya?Ka.append("g").attr("transform",J.legend):null;X=e.select(ua).style("position","relative").append("div").style("position", +"absolute").style("z-index","10").style("display","none");k.append("g").attr("class","x axis").attr("clip-path",f?"":"url(#xaxis-clip)").attr("transform",J.x).call(f?na:I).append("text").attr("class","-axis-x-label").attr("x",r).attr("dy","-.5em").style("text-anchor","end").text(bd);k.append("g").attr("class","y axis").attr("clip-path",f?"url(#yaxis-clip)":"").call(f?I:na).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor","end").text(cd);Kb&& +k.append("g").attr("class","y2 axis").attr("transform",J.y2).call(Xa);b=k.append("g").attr("clip-path",La).attr("class","grid");mc&&b.append("g").attr("class","xgrids");yb&&(d=b.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(yb).enter().append("g").attr("class","xgrid-line"),d.append("line").attr("class",function(a){return""+a["class"]}),d.append("text").attr("class",function(a){return""+a["class"]}).attr("text-anchor","end").attr("transform",f?"":"rotate(-90)").attr("dx",f? +0:-v).attr("dy",-6).text(function(a){return a.text}));dd&&b.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",f?0:-10).attr("x2",f?r:-10).attr("y1",f?-10:v).attr("y2",f?-10:q);nc&&b.append("g").attr("class","ygrids");zb&&b.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(zb).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]});k.append("g").attr("clip-path",La).attr("class","regions");k.append("g").attr("clip-path", +La).attr("class","chart");k.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",pa?"ew-resize":null).selectAll(".event-rects").data(a).enter().append("rect").attr("class",function(a,b){return"event-rect event-rect-"+b}).style("cursor",ha&&qa?"pointer":null).on("mouseover",function(a,b){if(!db){var d=h.data.targets.map(function(a){return nb(a.values[b])}),e,c;if(0",d,c,e;for(d=0;d"+e+""+c+"";return b+""}),gd=c(["tooltip","init","show"],!1),za=c(["tooltip","init","x"],0),sc=c(["tooltip","init","position"],{top:"0px",left:"50px"}),xb=ua.replace("#","")+"-clip",La="url(#"+xb+")",A="timeseries"===vc,da="categorized"===vc,ob=!A&&V,Cb=null,db=!1,Bb=!1,la=ya?40:0,oa=e.time.format(nd).parse,W=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]}}(od,pd),Cc=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)}}(),Gb,Nb,Ib,Ua,Mb,Ob,r,q,ma,ib,ta,Qb,Rb,lb,mb,l,z,T,ca,Va,Wa,I,na,Xa,Ba,yc=f?"left":"bottom",zc=f?kb?"top":"bottom":kb?"right":"left",Ac=f?jb?"bottom":"top":jb?"left":"right",Bc="bottom",J={main:function(){return"translate("+C+","+v+")"},context:function(){return"translate("+G+","+Aa+")"},legend:function(){return"translate("+ +Fb+","+Eb+")"},y2:function(){return"translate("+(f?0:r)+","+(f?10:0)+")"},x:function(){return"translate(0,"+q+")"},subx:function(){return"translate(0,"+ma+")"}},jd=function(){var a=e.svg.line().x(f?function(a){return y(a.id)(a.value)}:ab).y(f?ab:function(a){return y(a.id)(a.value)});return function(b){var d=lc(b.values),c;if(ub(b))return"spline"===ga["string"===typeof b?b:b.id]?a.interpolate("cardinal"):a.interpolate("linear"),0b.classes.indexOf(a)})});return K};h.data.get=function(a){a=h.data.getAsTarget(a);return n(a)?a.values.map(function(a){return a.value}):void 0};h.data.getAsTarget=function(a){var b= +Ya(function(b){return b.id===a});return 0