1
0
Fork 0

Fix other charts

This commit is contained in:
Gregory Eremin 2015-03-09 23:24:33 +07:00
parent a9a74f511c
commit 95ee6c8b17
2 changed files with 11 additions and 11 deletions

View File

@ -69,7 +69,8 @@ var OrgStats = React.createClass({
render: function(){
return (
<section className="content">
<BarChart api="/api/stat/orgs/top" params={this.getParams()} items={["repo", "team", "user"]} />
<BarChart key={this.getParams().team} api="/api/stat/orgs/top"
params={this.getParams()} items={["repo", "team", "user"]} />
</section>
);
}
@ -81,7 +82,7 @@ var TeamStats = React.createClass({
return (
<section className="content">
<BarChart key={this.getParams().team} api="/api/stat/teams/top"
params={this.getParams()} items={["repo", "user"]} />
params={this.getParams()} items={["repo", "user"]} />
</section>
);
}
@ -92,7 +93,8 @@ var UserStats = React.createClass({
render: function(){
return (
<section className="content">
<BarChart api="/api/stat/users/top" params={this.getParams()} items={["repo"]} />
<BarChart key={this.getParams().team} api="/api/stat/users/top"
params={this.getParams()} items={["repo"]} />
</section>
);
}
@ -103,7 +105,8 @@ var RepoStats = React.createClass({
render: function(){
return (
<section className="content">
<BarChart api="/api/stat/repos/top" params={this.getParams()} items={["user", "team"]} />
<BarChart key={this.getParams().team} api="/api/stat/repos/top"
params={this.getParams()} items={["user", "team"]} />
</section>
);
}

View File

@ -3,6 +3,7 @@ var SVGNS = "http://www.w3.org/2000/svg",
var BarChart = React.createClass({
mixins: [Router.Navigation, Router.State],
barHeight: 30,
barMargin: 5,
@ -64,18 +65,15 @@ var BarChart = React.createClass({
}
}.bind(this));
s = {
this.setState({
points: points,
min: min,
max: max
};
// console.log(s);
this.setState(s);
});
},
apiParams: function() {
// Deep copy
// Don't use jQuery.extend
// Deep copy, but don't use jQuery.extend
var params = JSON.parse(JSON.stringify(this.props.params));
params['item'] = this.state.item;
return params;
@ -94,7 +92,6 @@ var BarChart = React.createClass({
},
render: function() {
// console.log("State:", this.state)
return (
<div className="barchart-container">
<div className="filters">