Use consistent function definition order
This commit is contained in:
parent
790156f28d
commit
e29c2ed1b7
|
@ -20,12 +20,6 @@ var BarChart = React.createClass({
|
|||
};
|
||||
},
|
||||
|
||||
calculateViewBoxWidth: function() {
|
||||
this.setState({
|
||||
canvasWidth: this.refs.svg.getDOMNode().offsetWidth
|
||||
});
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.calculateViewBoxWidth();
|
||||
window.addEventListener('resize', this.calculateViewBoxWidth);
|
||||
|
@ -38,6 +32,12 @@ var BarChart = React.createClass({
|
|||
}, this.fetchData);
|
||||
},
|
||||
|
||||
calculateViewBoxWidth: function() {
|
||||
this.setState({
|
||||
canvasWidth: this.refs.svg.getDOMNode().offsetWidth
|
||||
});
|
||||
},
|
||||
|
||||
handleFilter: function(thing, i) {
|
||||
if (thing === 'item' && this.props.items[i] !== this.state.item) {
|
||||
this.setState({
|
||||
|
@ -198,7 +198,7 @@ var Bar = React.createClass({
|
|||
anim.setAttributeNS(null, 'attributeName', 'width');
|
||||
anim.setAttributeNS(null, 'from', this.state.lastw);
|
||||
anim.setAttributeNS(null, 'to', this.props.width);
|
||||
anim.setAttributeNS(null, 'dur', '300ms');
|
||||
anim.setAttributeNS(null, 'dur', '250ms');
|
||||
anim.setAttributeNS(null, 'repeatCount', '1');
|
||||
bar.appendChild(anim);
|
||||
anim.beginElement();
|
||||
|
|
|
@ -15,6 +15,12 @@ var StackedAreaChart = React.createClass({
|
|||
};
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.fetchData();
|
||||
this.calculateViewBoxWidth();
|
||||
window.addEventListener('resize', this.calculateViewBoxWidth);
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(newProps) {
|
||||
this.setState({
|
||||
'item': newProps.items[0],
|
||||
|
@ -28,12 +34,6 @@ var StackedAreaChart = React.createClass({
|
|||
});
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.fetchData();
|
||||
this.calculateViewBoxWidth();
|
||||
window.addEventListener('resize', this.calculateViewBoxWidth);
|
||||
},
|
||||
|
||||
handleFilter: function(thing, i) {
|
||||
if (this.props.items[i] !== this.state.item) {
|
||||
this.setState({
|
||||
|
|
Loading…
Reference in New Issue