Browse Source

Fix bindto bug

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

2
c3.js

@ -28,7 +28,7 @@
} }
// bindto - id to bind the chart // bindto - id to bind the chart
var __bindto = getConfig(['size','width'], '#chart'); var __bindto = getConfig(['bindto'], '#chart');
var __size_width = getConfig(['size','width'], null), var __size_width = getConfig(['size','width'], null),
__size_height = getConfig(['size','height'], null); __size_height = getConfig(['size','height'], null);

2
c3.min.js vendored

@ -44,7 +44,7 @@ a.values[c.x].value})});pa&&(c=x.select(".chart-bars").selectAll(".chart-bar").d
ra&&ab(a);d3.selectAll(".target").transition().style("opacity",1)}function Ka(a,c){k.data.targets.forEach(function(c){for(var b=0;b<a.length;b++)if(c.id===a[b].id){c.values=a[b].values;a.splice(b,1);break}});k.data.targets=k.data.targets.concat(a);fc(k.data.targets);F();c()}function ab(a,c){var b=jb(a),e,f=n/2-La*Object.keys(a).length/2,g;c=s(c)?{}:c;g=l(c.withTransition)?c.withTransition:!0;e=qa.selectAll(".legend-item").data(b).enter().append("g").attr("class",function(a){return"legend-item legend-item-"+ ra&&ab(a);d3.selectAll(".target").transition().style("opacity",1)}function Ka(a,c){k.data.targets.forEach(function(c){for(var b=0;b<a.length;b++)if(c.id===a[b].id){c.values=a[b].values;a.splice(b,1);break}});k.data.targets=k.data.targets.concat(a);fc(k.data.targets);F();c()}function ab(a,c){var b=jb(a),e,f=n/2-La*Object.keys(a).length/2,g;c=s(c)?{}:c;g=l(c.withTransition)?c.withTransition:!0;e=qa.selectAll(".legend-item").data(b).enter().append("g").attr("class",function(a){return"legend-item legend-item-"+
a}).style("cursor","pointer").on("click",function(a){Uc(a)}).on("mouseover",function(a){d3.selectAll(".legend-item").filter(function(c){return c!==a}).transition().duration(100).style("opacity",0.3);k.focus(a)}).on("mouseout",function(a){d3.selectAll(".legend-item").transition().duration(100).style("opacity",1);k.revert()});e.append("rect").attr("class","legend-item-event").style("fill-opacity",0).attr("x",-200).attr("y",function(){return da/2-16}).attr("width",La).attr("height",24);e.append("rect").attr("class", a}).style("cursor","pointer").on("click",function(a){Uc(a)}).on("mouseover",function(a){d3.selectAll(".legend-item").filter(function(c){return c!==a}).transition().duration(100).style("opacity",0.3);k.focus(a)}).on("mouseout",function(a){d3.selectAll(".legend-item").transition().duration(100).style("opacity",1);k.revert()});e.append("rect").attr("class","legend-item-event").style("fill-opacity",0).attr("x",-200).attr("y",function(){return da/2-16}).attr("width",La).attr("height",24);e.append("rect").attr("class",
"legend-item-tile").style("fill",function(a){return P(a)}).attr("x",-200).attr("y",function(){return da/2-9}).attr("width",10).attr("height",10);e.append("text").text(function(a){return l(Da[a])?Da[a]:a}).attr("x",-200).attr("y",function(a,c){return da/2});qa.selectAll("rect.legend-item-event").data(b).transition().duration(g?250:0).attr("x",function(a,c){return f+La*c});qa.selectAll("rect.legend-item-tile").data(b).transition().duration(g?250:0).attr("x",function(a,c){return f+La*c});qa.selectAll("text").data(b).transition().duration(g? "legend-item-tile").style("fill",function(a){return P(a)}).attr("x",-200).attr("y",function(){return da/2-9}).attr("width",10).attr("height",10);e.append("text").text(function(a){return l(Da[a])?Da[a]:a}).attr("x",-200).attr("y",function(a,c){return da/2});qa.selectAll("rect.legend-item-event").data(b).transition().duration(g?250:0).attr("x",function(a,c){return f+La*c});qa.selectAll("rect.legend-item-tile").data(b).transition().duration(g?250:0).attr("x",function(a,c){return f+La*c});qa.selectAll("text").data(b).transition().duration(g?
250:0).attr("x",function(a,c){return f+La*c+14})}function Ma(a){return l(a)?".target-"+a:".target"}var k={data:{}},Ua={},$="_expanded_",aa="_selected_",wb="_included_",xa=b(["size","width"],"#chart"),Bb=b(["size","width"],null),Cb=b(["size","height"],null),oa=b(["zoom","enabled"],!1);if(!("data"in Q))throw Error("data is required in config");var Va=b(["data","x"],"x"),Vc=b(["data","x_format"],"%Y-%m-%d"),xc=b(["data","id_converter"],function(a){return a}),Da=b(["data","names"],{}),w=b(["data","groups"], 250:0).attr("x",function(a,c){return f+La*c+14})}function Ma(a){return l(a)?".target-"+a:".target"}var k={data:{}},Ua={},$="_expanded_",aa="_selected_",wb="_included_",xa=b(["bindto"],"#chart"),Bb=b(["size","width"],null),Cb=b(["size","height"],null),oa=b(["zoom","enabled"],!1);if(!("data"in Q))throw Error("data is required in config");var Va=b(["data","x"],"x"),Vc=b(["data","x_format"],"%Y-%m-%d"),xc=b(["data","id_converter"],function(a){return a}),Da=b(["data","names"],{}),w=b(["data","groups"],
[]),Mb=b(["data","axes"],{}),X=b(["data","types"],{}),hc=b(["data","regions"],{}),Wc=b(["data","colors"],{}),Z=b(["data","selection","enabled"],!1),ha=b(["data","selection","grouped"],!1),ia=b(["data","selection","isselectable"],function(a){return!0}),pa=b(["subchart","show"],!1),Eb=pa?b(["subchart","size","height"],60):0,Xc=b(["color","pattern"],null),ra=b(["legend","show"],!0),La=b(["legend","item","width"],80),Uc=b(["legend","item","onclick"],function(){}),ic=b(["axis","x","type"],"indexed"),hb= []),Mb=b(["data","axes"],{}),X=b(["data","types"],{}),hc=b(["data","regions"],{}),Wc=b(["data","colors"],{}),Z=b(["data","selection","enabled"],!1),ha=b(["data","selection","grouped"],!1),ia=b(["data","selection","isselectable"],function(a){return!0}),pa=b(["subchart","show"],!1),Eb=pa?b(["subchart","size","height"],60):0,Xc=b(["color","pattern"],null),ra=b(["legend","show"],!0),La=b(["legend","item","width"],80),Uc=b(["legend","item","onclick"],function(){}),ic=b(["axis","x","type"],"indexed"),hb=
b(["axis","x","categories"],[]),pc=b(["axis","x","tick","centered"],!1),Ja=b(["axis","x","default"],null),tc=b(["axis","y","max"],null),rc=b(["axis","y","min"],null),vc=b(["axis","y","center"],null),Mc=b(["axis","y","text"],null);b(["axis","y","rescale"],!0);var eb=b(["axis","y","inner"],!1),Jc=b(["axis","y","format"],function(a){return a}),Ba=b(["axis","y","padding"],null),Ic=b(["axis","y","ticks"],10),Gb=b(["axis","y2","show"],!1),sc=b(["axis","y2","max"],null),qc=b(["axis","y2","min"],null),uc= b(["axis","x","categories"],[]),pc=b(["axis","x","tick","centered"],!1),Ja=b(["axis","x","default"],null),tc=b(["axis","y","max"],null),rc=b(["axis","y","min"],null),vc=b(["axis","y","center"],null),Mc=b(["axis","y","text"],null);b(["axis","y","rescale"],!0);var eb=b(["axis","y","inner"],!1),Jc=b(["axis","y","format"],function(a){return a}),Ba=b(["axis","y","padding"],null),Ic=b(["axis","y","ticks"],10),Gb=b(["axis","y2","show"],!1),sc=b(["axis","y2","max"],null),qc=b(["axis","y2","min"],null),uc=
b(["axis","y2","center"],null);b(["axis","y2","text"],null);b(["axis","y2","rescale"],!0);var db=b(["axis","y2","inner"],!1),Lc=b(["axis","y2","format"],function(a){return a}),Ca=b(["axis","y2","padding"],null),Kc=b(["axis","y2","ticks"],10),e=b(["axis","rotated"],!1),ac=b(["grid","x","show"],!1),Qc=b(["grid","x","type"],"tick"),rb=b(["grid","x","lines"],null),bc=b(["grid","y","show"],!1);b(["grid","y","type"],"tick");var sb=b(["grid","y","lines"],null),tb=b(["point","show"],!0)?b(["point","r"],2.5): b(["axis","y2","center"],null);b(["axis","y2","text"],null);b(["axis","y2","rescale"],!0);var db=b(["axis","y2","inner"],!1),Lc=b(["axis","y2","format"],function(a){return a}),Ca=b(["axis","y2","padding"],null),Kc=b(["axis","y2","ticks"],10),e=b(["axis","rotated"],!1),ac=b(["grid","x","show"],!1),Qc=b(["grid","x","type"],"tick"),rb=b(["grid","x","lines"],null),bc=b(["grid","y","show"],!1);b(["grid","y","type"],"tick");var sb=b(["grid","y","lines"],null),tb=b(["point","show"],!0)?b(["point","r"],2.5):

Loading…
Cancel
Save