Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import PropTypes from 'prop-types';
- import React from 'react';
- import ChartPadding from '../tools/ChartPadding';
- var chartOptions = {};
- export default class HistoricDataChart extends React.Component {
- static propTypes = {
- noumenon_name: PropTypes.string.isRequired,
- historic_data: PropTypes.array.isRequired,
- };
- componentDidMount() {
- this.plot();
- }
- componentDidUpdate() {
- this.plot();
- }
- shouldRenderAndPlot()
- {
- return(this.props.historic_data.length > 2);
- }
- plot()
- {
- if( this.shouldRenderAndPlot() )
- {
- this.actuallyPlot();
- }
- }
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement