<commit_before>// @flow
import 'chart.js';
import PropTypes from 'prop-types';
import React from 'react';
import { AreaChart } from 'react-chartkick';

// const request = require('superagent');

export default class Chart extends React.Component {
    props: {
        title: string,
        data: {},
    };
    state: {
        title: string,
        data: {},
    };
    static propTypes = {
      title: PropTypes.string.isRequired, // this is passed from the Rails view
    };

    /**
     * @param props - Comes from your rails view.
     * @param _railsContext - Comes from React on Rails
     */
    constructor(props, railsContext) {
      super(props);
      console.log('ON CONSTRUCTION');

      this.state = {
        title: this.props.title,
        data: this.props.data,
      };
    }

    componentDidMount() {

    }

    updateTitle = (title: string) => {
      this.setState({ title });
    };

    render() {
      return (
        <div>
          <AreaChart id={'users-chart'} data={this.state.data} />
        </div>);
    }
}<commit_msg>fix all @flow annotation issues<commit_after>// @flow
import 'chart.js';
import PropTypes from 'prop-types';
import React from 'react';
import { AreaChart } from 'react-chartkick';

// const request = require('superagent');

type chartProps = {
  title: string,
    data: {},
};

type chartState = {
  title: string,
  data: {},
};

export default class Chart extends React.Component {
    props: chartProps;
    state: chartState;
    static propTypes = {
      title: PropTypes.string.isRequired, // this is passed from the Rails view
    };

    /**
     * @param props - Comes from your rails view.
     * @param _railsContext - Comes from React on Rails
     */
    constructor(props: chartProps, railsContext: {}) {
      super(props);
      console.log('ON CONSTRUCTION');

      this.state = {
        title: this.props.title,
        data: this.props.data,
      };
    }

    componentDidMount() {

    }

    updateTitle = (title: string) => {
      this.setState({ title });
    };

    render() {
      return (
        <div>
          <AreaChart id={'users-chart'} data={this.state.data} />
        </div>);
    }
}
{'fraction_non_alphanumeric': 0.13914233576642335, 'fraction_numerical': 0.0, 'mean_word_length': 2.2297496318114876, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6033733', 'n_tokens_mistral': 669, 'n_tokens_neox': 651, 'n_words': 173}