<commit_before>/**
 * Created by Pjer on 8/19/2016.
.
 */


Array.prototype.max = function() {
    return Math.max.apply(null, this);
};

Array.prototype.min = function() {
    return Math.min.apply(null, this);
};


var status_jump = "local";

function auto_input() {
    if (status_jump =="local"){

        var end_t = $('#input_func_t')[0];
        end_t.value = "30";
        var step_l = $('#input_func_l')[0];
        step_l.value = "0.01";



        var input_1 = $('#input_func_0')[0];
        input_1.value = "-10*y[0] + 10*y[1]";
        var input_2 = $('#input_func_1')[0];
        input_2.value = "28*y[0] - y[1]-y[0]*y[2]";
        var input_3 = $('#input_func_2')[0];
        input_3.value = "-8/3 * y[2] + y[0] * y[1]";

        var init_1 = $('#input_init_0')[0];
        init_1.value = "10";
        var init_2 = $('#input_init_1')[0];
        init_2.value = "5";
        var init_3 = $('#input_init_2')[0];
        init_3.value = "1.01";
        Materialize.updateTextFields();
    }
}



function getUrlVars() {
    var vars = {};
    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
        function(m,key,value) {
            vars[key] = value;
        });
    return vars;
}

var color = d3.scale.linear()
    .range(["hsl(-180,60%,50%)", "hsl(180,60%,50%)"])
    .interpolate(function(a, b) { var i = d3.interpolateString(a, b); return function(t) { return d3.hsl(i(t)); }; });


//console.log(getUrlVars()["id"]);

var data_raw;
var vis;
var status=0;
var lines;
function vis_data(data,x_max,x_min,y_max,y_min,unstable,lya){
    if(status==1){
        vis.remove();}
    var vis_root = d3.select("#visualisation");
    vis=vis_root.append("svg")
        .attr("width",600)
        .attr("height",500+50);

    var    WIDTH = 600,
        width = 530,
        HEIGHT = 500,
        height = 480,
        MARGINS = {
            top: 20,
            right: 20,
            bottom: 20,
            left: 50
        },
        xScale = d3.scale.linear().range([MARGINS.left, WIDTH - MARGINS.right]).domain([x_min,x_max]),
        yScale = d3.scale.linear().range([HEIGHT - MARGINS.top, MARGINS.bottom]).domain([y_min,y_max]),
        xAxis = d3.svg.axis()
            .scale(xScale),

        yAxis = d3.svg.axis()
            .scale(yScale)
            .orient("left");

    var x = d3.time.scale()
        .range([0, width]);

    var y = d3.scale.linear()
        .range([height, 0]);


    vis.append("svg:g")
        .attr("class","axis")
        .attr("transform", "translate(0," + (HEIGHT - MARGINS.bottom) + ")")
        .call(xAxis);

    vis.append("svg:g")
        .attr("class","axis")
        .attr("transform", "translate(" + (MARGINS.left) + ",0)")
        .call(yAxis);





    var data_length = data[0]["value"].length;
    for (var i=0;i<data_length;i++){
        var lineGen_1 = d3.svg.line()
            .x(function(d) {
                return xScale(d.time);
            })
            .y(function(d) {
                return yScale(d.value[i]);
            })
            .interpolate("basis");




        vis.append('svg:path')
            .attr('class','line')
            .attr('d', lineGen_1(data))
            .attr('stroke', color(i*0.2))
            .attr('stroke-width', 2)
            .attr('fill', 'none');
    }

    lines = document.getElementsByClassName('line');


    var mouseG = vis.append("g")
        .attr("class", "mouse-over-effects");

    mouseG.append("path") // this is the black vertical line to follow mouse
        .attr("class", "mouse-line")
        .style("stroke", "black")
        .style("stroke-width", "1px")
        .style("opacity", "0");

    var mousePerLine = mouseG.selectAll('.mouse-per-line')
        .data(data)
        .enter()
        .append("g")
        .attr("class", "mouse-per-line");

    mousePerLine.append("circle")
        .attr("r", 7)
        .style("stroke", function(d) {
            return color(d.name);
        })
        .style("fill", "none")
        .style("stroke-width", "1px")<commit_msg>legend<commit_after>/**
 * Created by Pjer on 8/19/2016.
.
 */


Array.prototype.max = function() {
    return Math.max.apply(null, this);
};

Array.prototype.min = function() {
    return Math.min.apply(null, this);
};


var status_jump = "local";

function auto_input() {
    if (status_jump =="local"){

        var end_t = $('#input_func_t')[0];
        end_t.value = "30";
        var step_l = $('#input_func_l')[0];
        step_l.value = "0.01";



        var input_1 = $('#input_func_0')[0];
        input_1.value = "-10*y[0] + 10*y[1]";
        var input_2 = $('#input_func_1')[0];
        input_2.value = "28*y[0] - y[1]-y[0]*y[2]";
        var input_3 = $('#input_func_2')[0];
        input_3.value = "-8/3 * y[2] + y[0] * y[1]";

        var init_1 = $('#input_init_0')[0];
        init_1.value = "10";
        var init_2 = $('#input_init_1')[0];
        init_2.value = "5";
        var init_3 = $('#input_init_2')[0];
        init_3.value = "1.01";
        Materialize.updateTextFields();
    }
}



function getUrlVars() {
    var vars = {};
    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
        function(m,key,value) {
            vars[key] = value;
        });
    return vars;
}

var color = d3.scale.linear()
    .range(["hsl(-180,60%,50%)", "hsl(180,60%,50%)"])
    .interpolate(function(a, b) { var i = d3.interpolateString(a, b); return function(t) { return d3.hsl(i(t)); }; });


//console.log(getUrlVars()["id"]);

var data_raw;
var vis;
var status=0;
var lines;
function vis_data(data,x_max,x_min,y_max,y_min,unstable,lya){
    if(status==1){
        vis.remove();}
    var vis_root = d3.select("#visualisation");
    vis=vis_root.append("svg")
        .attr("width",600)
        .attr("height",500+50);

    var    WIDTH = 600,
        width = 530,
        HEIGHT = 500,
        height = 480,
        MARGINS = {
            top: 20,
            right: 20,
            bottom: 20,
            left: 50
        },
        xScale = d3.scale.linear().range([MARGINS.left, WIDTH - MARGINS.right]).domain([x_min,x_max]),
        yScale = d3.scale.linear().range([HEIGHT - MARGINS.top, MARGINS.bottom]).domain([y_min,y_max]),
        xAxis = d3.svg.axis()
            .scale(xScale),

        yAxis = d3.svg.axis()
            .scale(yScale)
            .orient("left");

    var x = d3.time.scale()
        .range([0, width]);

    var y = d3.scale.linear()
        .range([height, 0]);


    vis.append("svg:g")
        .attr("class","axis")
        .attr("transform", "translate(0," + (HEIGHT - MARGINS.bottom) + ")")
        .call(xAxis);

    vis.append("svg:g")
        .attr("class","axis")
        .attr("transform", "translate(" + (MARGINS.left) + ",0)")
        .call(yAxis);





    var data_length = data[0]["value"].length;
    for (var i=0;i<data_length;i++){
        var lineGen_1 = d3.svg.line()
            .x(function(d) {
                return xScale(d.time);
            })
            .y(function(d) {
                return yScale(d.value[i]);
            })
            .interpolate("basis");




        vis.append('svg:path')
            .attr('class','line')
            .attr('d', lineGen_1(data))
            .attr('stroke', color(i*0.2))
            .attr('stroke-width', 2)
            .attr('fill', 'none');

        vis.append('rect')
            .attr('x',80)
            .attr('y',25+20*i)
            .attr('width',30)
            .attr('height',3)
            .attr('fill', color(i*0.2));

        vis.append('text')
            .attr('x',120)
            .attr('y',30+20*i)
            .text('Node'+String(i));

    }

    lines = document.getElementsByClassName('line');


    var mouseG = vis.append("g")
        .attr("class", "mouse-over-effects");

    mouseG.append("path") // this is the black vertical line to follow mouse
        .attr("class", "mouse-line")
        .style("stroke", "black")
        .style("stroke-width", "1px")
        .style("opacity", "0");

    var mousePerLine = mouseG.selectAll('.mouse-per-line')
        .data(data)
        .enter()
        .append("g")
        .attr("class", "mouse-per-line");

    mousePerLine.append("circle")
        .attr("r", 7)
        .style("stroke", function(d) {
            return color(d.name);
        })
        .style("fill", "none")
        .style("stroke-width", "1px")
{'fraction_non_alphanumeric': 0.2009821535513235, 'fraction_numerical': 0.03353695053299796, 'mean_word_length': 2.0385735080058223, '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': '4908974', 'n_tokens_mistral': 3131, 'n_tokens_neox': 2930, 'n_words': 496}