From 60c86aef9b722c0dc1d1421505304d85a96412f2 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Fri, 16 Aug 2013 15:52:46 +0900 Subject: [PATCH] Add minified js --- c3.min.js | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 c3.min.js diff --git a/c3.min.js b/c3.min.js new file mode 100644 index 0000000..687b8e9 --- /dev/null +++ b/c3.min.js @@ -0,0 +1,57 @@ +(function(Ha){function Za(){function w(c,k){c.attr("transform",function(c){return"translate("+(k(c)+Q)+",0)"})}function c(c,k){c.attr("transform",function(c){return"translate(0,"+k(c)+")"})}function m(c){var k=c[0];c=c[c.length-1];return ks[d].indexOf(p.id)))for(e=0;e=q;q+=diffx2)la+="M"+b(g(q))+" "+d(h(q))+" "+b(g(q+k))+" "+d(h(q+k));return la}function Qa(a){var b=h.data.targets= +z(a),d,e;r.domain(d3.extent(a.map(function(a){return a.x})));A.domain(l(b,"y"));fa.domain(l(b,"y2"));D.domain(r.domain());La.domain(A.domain());Ka.domain(fa.domain());x.ticks(10>a.length?a.length:10);d=g.append("g").attr("clip-path",Ca).attr("class","grid");kb&&d.append("g").attr("class","xgrids");Ra&&(e=d.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(Ra).enter().append("g").attr("class","xgrid-line"),e.append("line").attr("class",function(a){return""+a["class"]}),e.append("text").attr("class", +function(a){return""+a["class"]}).attr("text-anchor","end").attr("transform",f?"":"rotate(-90)").attr("dx",f?0:-t.top).attr("dy",-6).text(function(a){return a.text}));Rb&&d.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",f?0:-10).attr("x2",f?u:-10).attr("y1",f?-10:t.top).attr("y2",f?-10:v);lb&&d.append("g").attr("class","ygrids");Sa&&d.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(Sa).enter().append("line").attr("class",function(a){return"ygrid-line "+ +a["class"]});g.append("g").attr("clip-path",Ca).attr("class","regions");g.append("g").attr("clip-path",Ca).attr("class","chart");g.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).selectAll(".event-rects").data(a).enter().append("rect").attr("class",function(a,b){return"event-rect event-rect-"+b}).style("cursor",function(a){return V&&aa?"pointer":null}).on("mouseover",function(a,b){if(!Da){var d=h.data.targets.map(function(a){return a.values[b]}),e,c;for(e=0;e",d,c,f;for(d=0;d"+f+""+c+"";return b+""}),wb=w.bindto.replace("#","")+"-clip",Ca="url(#"+wb+")",ga="timeseries"===ub,wa="categorized"===ub,Ua=null,Da=!1,ca=ra?40:0,cc=function(a){return function(b){for(var d=a.length- +1,c=a[d];!c[1](b);)c=a[--d];return c[0](b)}}([[d3.time.format("%Y/%-m/%-d"),function(){return!0}],[d3.time.format("%-m/%-d"),function(a){return a.getMonth()}],[d3.time.format("%-m/%-d"),function(a){return 1!=a.getDate()}],[d3.time.format("%-m/%-d"),function(a){return a.getDay()&&1!=a.getDate()}],[d3.time.format("%I %p"),function(a){return a.getHours()}],[d3.time.format("%I:%M"),function(a){return a.getMinutes()}],[d3.time.format(":%S"),function(a){return a.getSeconds()}],[d3.time.format(".%L"),function(a){return a.getMilliseconds()}]]), +t={top:0,right:ob&&!f?50:1,bottom:20+tb+ca,left:40},xb=Fa-tb-ca,dc=Fa-ca,u=Zb-t.left-t.right,v=Fa-t.top-t.bottom,qa=Fa-xb-(20+ca),Jb=d3.time.format($b).parse,ec=f?10:0,fc=f?v:u,yb=f?0:v,zb=f?u:1,r=(ga?d3.time.scale():d3.scale.linear()).range([ec,fc]),A=d3.scale.linear().range([yb,zb]),fa=d3.scale.linear().range([yb,zb]),D=(ga?d3.time.scale():d3.scale.linear()).range([0,u]),La=d3.scale.linear().range([qa,10]),Ka=d3.scale.linear().range([qa,10]),x=wa?Za():d3.svg.axis(),oa=d3.svg.axis(),Wa=d3.svg.axis(), +ha=wa?Za():d3.svg.axis();x.scale(r).orient(f?"left":"bottom");oa.scale(A).orient(f?"bottom":"left");Wa.scale(fa).orient(f?"top":"right");ha.scale(D).orient("bottom");ga&&x.tickFormat(cc);wa?(x.categories(Ga).tickCentered(vb),ha.categories(Ga).tickCentered(vb)):(x.tickOffset=function(){return 0},ha.tickOffset=function(){return 0});wa&&function(){var a=r,b=D,d=Object.keys(r),c,f;r=function(b){return a(b)+x.tickOffset()};D=function(a){return b(a)+ha.tickOffset()};for(f=0;fa?0:a},U=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];0<=d.indexOf(b)||d.push(b);return c[d.indexOf(b)%c.length]}}(ac,bc),da=d3.select(w.bindto).append("svg").attr("width",u+t.left+t.right).attr("height",v+t.top+t.bottom);da.append("defs");da.select("defs").append("clipPath").attr("id",wb).append("rect").attr("y",t.top).attr("width",u).attr("height",v-t.top);da.select("defs").append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",-1).attr("y",-1).attr("width",u+2).attr("height",40);da.select("defs").append("clipPath").attr("id", +"yaxis-clip").append("rect").attr("x",-39).attr("y",t.top-1).attr("width",40).attr("height",v-t.top+2);var g=da.append("g").attr("transform","translate("+t.left+","+t.top+")"),M=null;pa&&(M=da.append("g").attr("transform","translate(40,"+xb+")"));var ua=null;ra&&(ua=da.append("g").attr("transform","translate(40,"+dc+")"));var Ea=d3.select(w.bindto).style("position","relative").append("div").style("position","absolute").style("width","30%").style("z-index","10").style("visibility","hidden"),ea=d3.svg.brush().x(D).on("brush", +function(){N({withTransition:!1,withY:!1,withSubchart:!1})}),Ba=null,Ma=null;h.focus=function(a){h.defocus();d3.selectAll(va(a)).filter(function(a){return Ja(a.id)}).classed("focused",!0).transition().duration(100).style("opacity",1)};h.defocus=function(a){d3.selectAll(va(a)).filter(function(a){return Ja(a.id)}).classed("focused",!1).transition().duration(100).style("opacity",0.3)};h.revert=function(a){d3.selectAll(va(a)).filter(function(a){return Ja(a.id)}).classed("focused",!1).transition().duration(100).style("opacity", +1)};h.show=function(a){d3.selectAll(va(a)).transition().style("opacity",1)};h.hide=function(a){d3.selectAll(va(a)).transition().style("opacity",0)};h.load=function(a){n(a.done)&&(a.done=function(){});if("cacheIds"in a&&ja(a.cacheIds))sa(J(a.cacheIds),a.done);else if("data"in a)sa(z(data),a.done);else if("url"in a)d3.csv(a.url,function(b,d){sa(z(d),a.done)});else if("rows"in a)sa(z(P(a.rows)),a.done);else if("columns"in a)sa(z(Q(a.columns)),a.done);else throw Error("url or rows or columns is required."); +};h.unload=function(a){h.data.targets=h.data.targets.filter(function(b){return b.id!=a});d3.selectAll(".target-"+a).transition().style("opacity",0).remove();ra&&(d3.selectAll(".legend-item-"+a).remove(),Ya(h.data.targets));0b.classes.indexOf(a)})});return E};h.data.get=function(a){a=h.data.getAsTarget(a);return m(a)?a.values.map(function(a){return a.value}):void 0};h.data.getAsTarget=function(a){var b=B(function(b){return b.id==a});return 0