Browse Source

Fix trivial

pull/1/head
Masayuki Tanaka 11 years ago
parent
commit
85fcd0a6b5
  1. 2
      c3.js
  2. 12
      c3.min.js

2
c3.js

@ -1000,7 +1000,7 @@
.data(data)
.enter().append("rect")
.attr("class", function(d,i){ return "event-rect event-rect-" + i; })
.style("cursor", function(d){ return __data_selection_enabled && __data_selection_grouped ? "pointer" : null; })
.style("cursor", __data_selection_enabled && __data_selection_grouped ? "pointer" : null)
.on('mouseover', function(d,i) {
if (dragging) return; // do nothing if dragging

12
c3.min.js vendored

@ -23,12 +23,12 @@ x.domain(C(c,"y"));O.domain(C(c,"y2"));V.domain(m.domain());Pa.domain(x.domain()
"x axis").attr("clip-path",e?"":"url(#xaxis-clip)").attr("transform",I.x).call(e?ga:M);g.append("g").attr("class","y axis").attr("clip-path",e?"url(#yaxis-clip)":"").call(e?M:ga).append("text").attr("transform","rotate(-90)").attr("dy","1.4em").attr("dx","-.8em").style("text-anchor","end").text(Lc);Fb&&g.append("g").attr("class","y2 axis").attr("transform",I.y2).call(Ra);if(ja)g.append("rect").attr("class","zoom-rect").attr("width",t).attr("height",s).style("opacity",0).style("cursor","ew-resize").call(z).on("dblclick.zoom",
null);d=g.append("g").attr("clip-path",Ha).attr("class","grid");$b&&d.append("g").attr("class","xgrids");qb&&(b=d.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(qb).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",e?"":"rotate(-90)").attr("dx",e?0:-v).attr("dy",-6).text(function(a){return a.text}));Mc&&d.append("g").attr("class",
"xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",e?0:-10).attr("x2",e?t:-10).attr("y1",e?-10:v).attr("y2",e?-10:s);ac&&d.append("g").attr("class","ygrids");rb&&d.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(rb).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]});g.append("g").attr("clip-path",Ha).attr("class","regions");g.append("g").attr("clip-path",Ha).attr("class","chart");g.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",
0).style("cursor",ja?"ew-resize":null).selectAll(".event-rects").data(a).enter().append("rect").attr("class",function(a,c){return"event-rect event-rect-"+c}).style("cursor",function(a){return $&&ka?"pointer":null}).on("mouseover",function(a,c){if(!Za){var d=k.data.targets.map(function(a){return ca(a.values[c])}),b,n;if(0<Object.keys(Da).length){n=[];for(var h in Da)for(b=0;b<d.length;b++)if(d[b].id===h){n.push(d[b]);d.shift(b);break}d=n.concat(d)}bc&&g.selectAll(".-circle-"+c).classed(aa,!0).attr("r",
cc);g.selectAll(".-bar-"+c).classed(aa,!0);g.selectAll("line.xgrid-focus").style("visibility","visible").data([d[0]]).attr(e?"y1":"x1",Xa).attr(e?"y2":"x2",Xa);Z.style("top",d3.mouse(this)[1]+30+"px").style("left",(e?d3.mouse(this)[0]:m(d[0].x))+60+"px");Z.html(dc(d));Z.style("visibility","visible")}}).on("mouseout",function(a,c){g.select("line.xgrid-focus").style("visibility","hidden");Z.style("visibility","hidden");g.selectAll(".-circle-"+c).filter(function(){return d3.select(this).classed(aa)}).classed(aa,
!1).attr("r",sb);g.selectAll(".-bar-"+c).classed(aa,!1)}).on("mousemove",function(a,c){$&&!Za&&(ka||g.selectAll(".-shape-"+c).filter(function(a){return la(a)}).each(function(a){a=d3.select(this).classed(aa,!0);"circle"===this.nodeName&&a.attr("r",cc);d3.select(".event-rect-"+c).style("cursor",null)}).filter(function(a){a=d3.select(this);if("circle"===this.nodeName)return Ub(this,Fa);if("rect"===this.nodeName)return Vb(this,a.attr("x"),a.attr("y"))}).each(function(a){a=d3.select(this);a.classed(aa)||
(a.classed(aa,!0),"circle"===this.nodeName&&a.attr("r",Fa));d3.select(".event-rect-"+c).style("cursor","pointer")}))}).on("click",function(a,c){tb?tb=!1:g.selectAll(".-shape-"+c).each(function(a){var d=d3.select(this),b=d.classed(ba),f=!1,e;"circle"===this.nodeName?(f=Ub(this,1.5*Fa),e=Xb):"rect"===this.nodeName&&(f=Vb(this),e=Zb);if(ka||f)$&&la(a)&&(d.classed(ba,!b),e(!b,d,a,c)),Nc(a,d)})}).call(d3.behavior.drag().origin(Object).on("drag",function(a){if($&&(!ja||z.altDomain)){a=ub[0];var c=ub[1],
d=d3.mouse(this),b=d[0],d=d[1],e=Math.min(a,b),n=Math.max(a,b),k=ka?v:Math.min(c,d),h=ka?s:Math.max(c,d);g.select(".dragarea").attr("x",e).attr("y",k).attr("width",n-e).attr("height",h-k);g.selectAll(".-shapes").selectAll(".-shape").filter(function(a){return la(a)}).each(function(a,c){var d=d3.select(this),b=d.classed(ba),f=d.classed(vb),g,p,m,l;g=!1;"circle"===this.nodeName?(g=1*d.attr("cx"),p=1*d.attr("cy"),l=Xb,g=e<g&&g<n&&k<p&&p<h):"rect"===this.nodeName&&(g=1*d.attr("x"),p=1*d.attr("y"),m=1*
d.attr("width"),l=Zb,g=e<g+m&&g<n&&p<h);g^f&&(d.classed(vb,!f),d.classed(ba,!b),l(!b,d,a,c))})}}).on("dragstart",function(){$&&(ub=d3.mouse(this),g.select(".chart").append("rect").attr("class","dragarea").style("opacity",0.1),Za=!0)}).on("dragend",function(){$&&(g.select(".dragarea").transition().duration(100).style("opacity",0).remove(),g.selectAll(".-shape").classed(vb,!1),Za=!1)})).call(z).on("dblclick.zoom",null);g.select(".chart").append("g").attr("class","chart-bars");g.select(".chart").append("g").attr("class",
0).style("cursor",ja?"ew-resize":null).selectAll(".event-rects").data(a).enter().append("rect").attr("class",function(a,c){return"event-rect event-rect-"+c}).style("cursor",$&&ka?"pointer":null).on("mouseover",function(a,c){if(!Za){var d=k.data.targets.map(function(a){return ca(a.values[c])}),b,n;if(0<Object.keys(Da).length){n=[];for(var h in Da)for(b=0;b<d.length;b++)if(d[b].id===h){n.push(d[b]);d.shift(b);break}d=n.concat(d)}bc&&g.selectAll(".-circle-"+c).classed(aa,!0).attr("r",cc);g.selectAll(".-bar-"+
c).classed(aa,!0);g.selectAll("line.xgrid-focus").style("visibility","visible").data([d[0]]).attr(e?"y1":"x1",Xa).attr(e?"y2":"x2",Xa);Z.style("top",d3.mouse(this)[1]+30+"px").style("left",(e?d3.mouse(this)[0]:m(d[0].x))+60+"px");Z.html(dc(d));Z.style("visibility","visible")}}).on("mouseout",function(a,c){g.select("line.xgrid-focus").style("visibility","hidden");Z.style("visibility","hidden");g.selectAll(".-circle-"+c).filter(function(){return d3.select(this).classed(aa)}).classed(aa,!1).attr("r",
sb);g.selectAll(".-bar-"+c).classed(aa,!1)}).on("mousemove",function(a,c){$&&!Za&&(ka||g.selectAll(".-shape-"+c).filter(function(a){return la(a)}).each(function(a){a=d3.select(this).classed(aa,!0);"circle"===this.nodeName&&a.attr("r",cc);d3.select(".event-rect-"+c).style("cursor",null)}).filter(function(a){a=d3.select(this);if("circle"===this.nodeName)return Ub(this,Fa);if("rect"===this.nodeName)return Vb(this,a.attr("x"),a.attr("y"))}).each(function(a){a=d3.select(this);a.classed(aa)||(a.classed(aa,
!0),"circle"===this.nodeName&&a.attr("r",Fa));d3.select(".event-rect-"+c).style("cursor","pointer")}))}).on("click",function(a,c){tb?tb=!1:g.selectAll(".-shape-"+c).each(function(a){var d=d3.select(this),b=d.classed(ba),f=!1,e;"circle"===this.nodeName?(f=Ub(this,1.5*Fa),e=Xb):"rect"===this.nodeName&&(f=Vb(this),e=Zb);if(ka||f)$&&la(a)&&(d.classed(ba,!b),e(!b,d,a,c)),Nc(a,d)})}).call(d3.behavior.drag().origin(Object).on("drag",function(a){if($&&(!ja||z.altDomain)){a=ub[0];var c=ub[1],d=d3.mouse(this),
b=d[0],d=d[1],e=Math.min(a,b),n=Math.max(a,b),k=ka?v:Math.min(c,d),h=ka?s:Math.max(c,d);g.select(".dragarea").attr("x",e).attr("y",k).attr("width",n-e).attr("height",h-k);g.selectAll(".-shapes").selectAll(".-shape").filter(function(a){return la(a)}).each(function(a,c){var d=d3.select(this),b=d.classed(ba),f=d.classed(vb),g,p,m,l;g=!1;"circle"===this.nodeName?(g=1*d.attr("cx"),p=1*d.attr("cy"),l=Xb,g=e<g&&g<n&&k<p&&p<h):"rect"===this.nodeName&&(g=1*d.attr("x"),p=1*d.attr("y"),m=1*d.attr("width"),l=
Zb,g=e<g+m&&g<n&&p<h);g^f&&(d.classed(vb,!f),d.classed(ba,!b),l(!b,d,a,c))})}}).on("dragstart",function(){$&&(ub=d3.mouse(this),g.select(".chart").append("rect").attr("class","dragarea").style("opacity",0.1),Za=!0)}).on("dragend",function(){$&&(g.select(".dragarea").transition().duration(100).style("opacity",0).remove(),g.selectAll(".-shape").classed(vb,!1),Za=!1)})).call(z).on("dblclick.zoom",null);g.select(".chart").append("g").attr("class","chart-bars");g.select(".chart").append("g").attr("class",
"chart-lines");null!==Ia&&F.extent("function"!==typeof Ia?Ia:E?Ia(Va,hb):Ia(0,Wa()-1));qa&&(w.append("g").attr("clip-path",Ha).attr("class","chart"),w.select(".chart").append("g").attr("class","chart-bars"),w.select(".chart").append("g").attr("class","chart-lines"),w.append("g").attr("clip-path",Ha).attr("class","x brush").call(F).selectAll("rect").attr("height",fa),w.append("g").attr("class","x axis").attr("transform",I.subx).call(za));sa&&$a(c);ec(c);A({withTransition:!1,withUpdateXDomain:!0});
if(Oc){if(E&&"string"==typeof ta){ta=ia(ta);for(a=0;a<c[0].values.length&&0!=c[0].values[a].x-ta;a++);ta=a}Z.html(dc(c.map(function(a){return ca(a.values[ta])})));Z.style("top",fc.top).style("left",fc.left).style("visibility","visible")}}function A(a){var c,d=Ac(),b=d.__max__+1,f,h,p,r,u,q;a=l(a)?a:{};c=l(a.withY)?a.withY:!0;u=l(a.withSubchart)?a.withSubchart:!0;q=l(a.withTransition)?a.withTransition:!0;a=l(a.withUpdateXDomain)?a.withUpdateXDomain:!1;q=q?250:0;a&&(m.domain(F.empty()?P:F.extent()),
ja&&z.x(m).updateScaleExtent());x.domain(C(k.data.targets,"y"));O.domain(C(k.data.targets,"y2"));g.select(".x.axis").transition().duration(e?q:0).call(e?ga:M);g.select(".y.axis").transition().duration(e?0:q).call(e?M:ga);g.select(".y2.axis").transition().call(Ra);Pa.domain(x.domain());Qa.domain(O.domain());Z.style("visibility","hidden");g.select("line.xgrid-focus").style("visibility","hidden").attr("y2",s);if($b){if("year"===Pc)for(a=[],firstYear=Va.getFullYear(),lastYear=hb.getFullYear(),f=firstYear;f<=

Loading…
Cancel
Save