<commit_before>import React from 'react';
import {render} from 'react-dom';
import InputForm from './InputForm';
import BarChart from './BarChart';
import salesData from './salesData.json';

import './app.css';

class App extends React.Component {
  constructor(props) {
    super(props);
    this.captureYear = this.captureYear.bind(this);

    this.state = {
      yearValue: '',
      chartWidth: 500,
      chartHeight: 300,
      salesData: [],
    };
  }

  captureYear(year) {
    let data = salesData[year];
    if (!data){
      data = [];
    }
    this.setState({
      salesData: data,
      yearValue: year
    });
  }

  render () {
    const {chartHeight, chartWidth, yearValue, salesData, year} = this.state;

    return (
      <section>
        <h1>Welcome to <span>WE MAKE WIDGETS&reg;</span> online!</h1>
        <p>For all your <span>WIDGET&reg;</span> needs, come to us first!  We have a proven track record, and can fulfill your <span>WIDGET&reg;</span> needs, under budget with fast delivery!</p>
        <InputForm captureYear={this.captureYear}/>
        <BarChart
          height = {chartHeight}
          width = {chartWidth}
          data = {salesData}
        />
      </section>
    );
  }<commit_msg>updates to clean up code<commit_after>import React from 'react';
import {render} from 'react-dom';
import InputForm from './InputForm';
import BarChart from './BarChart';
import salesData from './salesData.json';

import './app.css';

class App extends React.Component {
  constructor(props) {
    super(props);
    this.captureYear = this.captureYear.bind(this);

    this.state = {
      yearValue: '',
      chartWidth: 500,
      chartHeight: 300,
      salesData: [],
    };
  }

  captureYear(year) {
    let data = salesData[year];
    if (!data){
      data = [];
    }
    this.setState({
      salesData: data,
      yearValue: year
    });
  }

  render () {
    const {chartHeight, chartWidth, yearValue, salesData} = this.state;

    return (
      <section>
        <h1>Welcome to <span>WE MAKE WIDGETS&reg;</span> online!</h1>
        <p>For all your <span>WIDGET&reg;</span> needs, come to us first!  We have a proven track record, and can fulfill your <span>WIDGET&reg;</span> needs, under budget with fast delivery!</p>
        <InputForm captureYear={this.captureYear}/>
        <BarChart
          height = {chartHeight}
          width = {chartWidth}
          data = {salesData}
        />
      </section>
    );
  }
{'fraction_non_alphanumeric': 0.13708046906591184, 'fraction_numerical': 0.00646987464617873, 'mean_word_length': 2.5751445086705202, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '5027624', 'n_tokens_mistral': 784, 'n_tokens_neox': 760, 'n_words': 205}