class D3Comp extends React.Component {
constructor(props) {
super(props);
// Consts
this.ANIMATION_DURATION = 1000; // ms
this.REACT_LOGO = '';
this.D3_LOGO = '';
// Initialize state
this.state = {
width: window.innerWidth,
height: window.innerHeight,
xyData: this._getRandomXYData()
};
this._d3Digest = this._d3Digest.bind(this);
}
componentDidMount() {
setInterval(() => this.setState({ xyData: this._getRandomXYData() }), this.ANIMATION_DURATION + 100); // Force update
this._d3Digest(); // Init
}
componentDidUpdate(prevProps, prevState) {
this._d3Digest();
}
render() {
return