<commit_before>function draw_line_graph(chart, ctx, output) {

    if(chart['value_x'].length == 0){
        output.text("Cannot get data. Please check the worker ID.");
    }else{
        output.text("Get data.");
    }
    var dataset = {
        label: chart['label'],
        fillColor: "rgba(220,220,220,0.2)",
        strokeColor: "rgba(220,220,220,1)",
        pointColor: "rgba(220,220,220,1)",
        pointStrokeColor: "#fff",
        pointHighlightFill: "#fff",
        pointHighlightStroke: "rgba(220,220,220,1)",
        data: chart['value_y']
    };
    var data = {
        labels: chart['value_x'],
        datasets: [dataset,]
    };
    var lineChart = new Chart(ctx, {
        type: "line",
        data: data,
    });
    console.log("draw:", chart['label']);
}

function draw_line_graphs(charts) {
    var ctx = [$("#chart1").get(0).getContext("2d"),
               $("#chart2").get(0).getContext("2d"),
               $("#chart3").get(0).getContext("2d")]
    var output = $(document.getElementById('json'));

    for (var i = 0; i < ctx.length; i++) {
        draw_line_graph(charts[i], ctx[i], output);
    }
}

$(function() {
    $('#get').submit(function(event) {
        var post_data = JSON.stringify({
            workerId: document.forms.get.workerId.value,
        });
        console.log("post:", post_data);

        event.preventDefault();<commit_msg>グラフの色を変更<commit_after>function draw_line_graph(chart, ctx, color, output) {

    if(chart['value_x'].length == 0){
        output.text("Cannot get data. Please check the worker ID.");
    }else{
        output.text("Get data.");
    }
    var dataset = {
        label: chart['label'],
        data: chart['value_y']
    };
    $.extend(dataset, color);
    var data = {
        labels: chart['value_x'],
        datasets: [dataset,]
    };
    var lineChart = new Chart(ctx, {
        type: "line",
        data: data,
    });
    console.log("draw:", chart['label']);
}

function draw_line_graphs(charts) {
    var ctx = [$("#chart1").get(0).getContext("2d"),
               $("#chart2").get(0).getContext("2d"),
               $("#chart3").get(0).getContext("2d")]
    var output = $(document.getElementById('json'));
    var colors = [
        {borderColor: "rgba(255,204,51,0.6)",
         backgroundColor: "rgba(255,204,102,0.4)"},
        {borderColor: "rgba(0,102,255,0.6)",
         backgroundColor: "rgba(0,153,255,0.4)"},
        {borderColor: "rgba(255,0,102,0.6)",
         backgroundColor: "rgba(255,51,102,0.4)"},
    ]

    for (var i = 0; i < ctx.length; i++) {
        draw_line_graph(charts[i], ctx[i], colors[i], output);
    }
}

$(function() {
    $('#get').submit(function(event) {
        var post_data = JSON.stringify({
            workerId: document.forms.get.workerId.value,
        });
        console.log("post:", post_data);

        event.preventDefault();
{'fraction_non_alphanumeric': 0.19213365819700662, 'fraction_numerical': 0.04211625478593804, 'mean_word_length': 2.5613382899628254, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4473695', 'n_tokens_mistral': 1003, 'n_tokens_neox': 948, 'n_words': 167}