<commit_before>import React, { Component } from 'react';
import Chart from 'chart.js';

class Doughnut extends Component {

    componentDidMount () {
        let chartCanvas = this.refs.chart;

        let myChart = new Chart(chartCanvas, {
            type: 'doughnut',
            data: this.props.data,
            options: {
                legend: {
                    display: false
                }
            }
        });

        this.setState({chart: myChart});
    }

    componentDidUpdate () {
        let chart = this.state.chart;
        let data = this.props.data;

        data.datasets.forEach((dataset, i) => { chart.data.datasets[i].data = dataset.data })

        chart.data.labels = data.labels;
        chart.update();
    }

    render () {
        return (
            <div className="card">
                <div className="header">
                    <h4 className="title">{ this.props.title }</h4>
                </div>
                <div className="content">
                    <div id="chartPreferences" className="ct-chart ct-perfect-fourth">
                        <canvas ref={'chart'} ></canvas>
                    </div>
                    <div className="footer">
                        <div className="legend">
                            <div><i className="fa fa-circle text-info" /> { this.props.data.labels[0] } </div>
                            <div><i className="fa fa-circle text-warning" /> { this.props.data.labels[1] } </div>
                            <div><i className="fa fa-circle text-danger" /> { this.props.data.labels[2] } </div>
                        </div>
                        <hr />
                        <div className="stats">
                            <i className="fa fa-clock-o" /> Last updated:
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}

export default Doughnut;<commit_msg>remove last updated from Doughnut charts<commit_after>import React, { Component } from 'react';
import Chart from 'chart.js';

class Doughnut extends Component {

    componentDidMount () {
        let chartCanvas = this.refs.chart;

        let myChart = new Chart(chartCanvas, {
            type: 'doughnut',
            data: this.props.data,
            options: {
                legend: {
                    display: false
                }
            }
        });

        this.setState({chart: myChart});
    }

    componentDidUpdate () {
        let chart = this.state.chart;
        let data = this.props.data;

        data.datasets.forEach((dataset, i) => { chart.data.datasets[i].data = dataset.data })

        chart.data.labels = data.labels;
        chart.update();
    }

    render () {
        return (
            <div className="card">
                <div className="header">
                    <h4 className="title">{ this.props.title }</h4>
                </div>
                <div className="content">
                    <div id="chartPreferences" className="ct-chart ct-perfect-fourth">
                        <canvas ref={'chart'} ></canvas>
                    </div>
                    <div className="footer">
                        <div className="legend">
                            <div><i className="fa fa-circle text-info" /> { this.props.data.labels[0] } </div>
                            <div><i className="fa fa-circle text-warning" /> { this.props.data.labels[1] } </div>
                            <div><i className="fa fa-circle text-danger" /> { this.props.data.labels[2] } </div>
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}

export default Doughnut;
{'fraction_non_alphanumeric': 0.13168503090567052, 'fraction_numerical': 0.0026874496103198066, 'mean_word_length': 1.2890528905289054, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 59, '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': '7047532', 'n_tokens_mistral': 1005, 'n_tokens_neox': 948, 'n_words': 203}