<commit_before>'use strict';
const ko = require('knockout');
const Highcharts = require('highcharts');

class BurnDownChartComponent {
    constructor (bdc) {
        this.bdc = ko.observable(bdc);
        this.chart = null;
    }

    drawChart () {
        const data = this.bdc();
        if (!data) { return; }

        this.chart = Highcharts.chart(this.containerId, {
            chart: { type: 'line' },
            title: { text: 'Burn up and down chart' },
            xAxis: {
                labels: {
                    formatter: function () {
                        const v = this.value;
                        const h = Math.floor(v / 60);
                        const m = v % 60;
                        return h ? `${h}時間${m}分` : `${m}分`;
                    }
                },
                title: { text: '総作業時間 (分)' }
            },
            yAxis: {
                labels: { formatter: function () { return this.value + 'pts'; } },
                title: { text: 'タスクコスト (pts)' }
            },
            tooltip: {
                shared: true,
                crosshairs: true
            },
            series: [{
                name: '全タスクコスト',
                data: data.map(p => [p.totalWorkTime, p.taskNum])
            }, {
                name: '残りタスクコスト',
                data: data.map(p => [p.totalWorkTime, p.taskNum - p.completedTaskNum])
            }]
        });
    }

    get componentName () {
        return 'burn_down_chart_component';
    }

    get containerId () {
        return 'burn-down-chart-container';
    }

    register () {
        const that = this;
        ko.components.register(this.componentName, {
            viewModel: function () {
                return that;
            },
            template: `<div id="${this.containerId}" style="width: 100%; height: 400px;"></div>`
        });
    }
}

module.exports = BurnDownChartComponent;<commit_msg>change all task cost to completed task cost on bdc<commit_after>'use strict';
const ko = require('knockout');
const Highcharts = require('highcharts');

class BurnDownChartComponent {
    constructor (bdc) {
        this.bdc = ko.observable(bdc);
        this.chart = null;
    }

    drawChart () {
        const data = this.bdc();
        if (!data) { return; }

        this.chart = Highcharts.chart(this.containerId, {
            chart: { type: 'line' },
            title: { text: 'Burn up and down chart' },
            xAxis: {
                labels: {
                    formatter: function () {
                        const v = this.value;
                        const h = Math.floor(v / 60);
                        const m = v % 60;
                        return h ? `${h}時間${m}分` : `${m}分`;
                    }
                },
                title: { text: '総作業時間 (分)' }
            },
            yAxis: {
                labels: { formatter: function () { return this.value + 'pts'; } },
                title: { text: 'タスクコスト (pts)' }
            },
            tooltip: {
                shared: true,
                crosshairs: true
            },
            series: [{
                name: '完了タスクコスト',
                data: data.map(p => [p.totalWorkTime, p.completedTaskNum])
            }, {
                name: '残りタスクコスト',
                data: data.map(p => [p.totalWorkTime, p.taskNum - p.completedTaskNum])
            }]
        });
    }

    get componentName () {
        return 'burn_down_chart_component';
    }

    get containerId () {
        return 'burn-down-chart-container';
    }

    register () {
        const that = this;
        ko.components.register(this.componentName, {
            viewModel: function () {
                return that;
            },
            template: `<div id="${this.containerId}" style="width: 100%; height: 400px;"></div>`
        });
    }
}

module.exports = BurnDownChartComponent;
{'fraction_non_alphanumeric': 0.13285457809694792, 'fraction_numerical': 0.005129520389843549, 'mean_word_length': 1.2968197879858658, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3438481', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1083, 'n_words': 236}