<commit_before>import React from 'react';

class Chart extends React.Component {
    constructor() {
        super();
        this.margin = {
          top: 15,
          bottom: 40,
          left: 50,
          right: 8
        };
        this.container = null;
    }
    componentDidMount() {
        this.margin.left = this.props.milestones || this.props.goal ? 50 : 8;
        this.props.chart.create(this.container, Object.assign(this.getChartState(), {
          data: []
        }), {
            width: this.container.offsetWidth,
            height: this.container.offsetHeight,
            margin: this.margin,
            id: this.props.graphID
        });
        this.initialUpdate = setTimeout(() => {
          this.props.chart.update(this.container, this.getChartState(), {
            width: this.container.offsetWidth,
            height: this.container.offsetHeight,
            margin: this.margin,
            id: this.props.graphID
          }, true);
        }, 100);
    }

  componentDidUpdate() {
    this.margin.left = this.props.milestones || this.props.goal ? 50 : 8;
    this.props.chart.update(this.container, this.getChartState(), {
      width: this.container.offsetWidth,
      height: this.container.offsetHeight,
      margin: this.margin,
      id: this.props.graphID
    }, this.props.formatting);
  }

  handleRef = (element) => {
    this.container = element;<commit_msg>pass data to chart<commit_after>import React from 'react';

class Chart extends React.Component {
    constructor() {
        super();
        this.margin = {
          top: 15,
          bottom: 40,
          left: 50,
          right: 8
        };
        this.container = null;
    }
    componentDidMount() {
        this.margin.left = this.props.milestones || this.props.goal ? 50 : 8;
        this.props.chart.create(this.container, Object.assign(this.getChartState(), {
          data: this.props.data
        }), {
            width: this.container.offsetWidth,
            height: this.container.offsetHeight,
            margin: this.margin,
            id: this.props.graphID
        });
        this.initialUpdate = setTimeout(() => {
          this.props.chart.update(this.container, this.getChartState(), {
            width: this.container.offsetWidth,
            height: this.container.offsetHeight,
            margin: this.margin,
            id: this.props.graphID
          }, true);
        }, 100);
    }

  componentDidUpdate() {
    this.margin.left = this.props.milestones || this.props.goal ? 50 : 8;
    this.props.chart.update(this.container, this.getChartState(), {
      width: this.container.offsetWidth,
      height: this.container.offsetHeight,
      margin: this.margin,
      id: this.props.graphID
    }, this.props.formatting);
  }

  handleRef = (element) => {
    this.container = element;
{'fraction_non_alphanumeric': 0.1266713581984518, 'fraction_numerical': 0.011259676284306826, 'mean_word_length': 1.9738493723849373, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2052155', 'n_tokens_mistral': 840, 'n_tokens_neox': 796, 'n_words': 149}