<commit_before>
var threeNgApp = angular.module("threeNgApp", []);


//Simple ThreeJS vector string formatter
var vecToString = function (vec) {
    return vec.x.toString() + ", " + vec.y.toString() + ", " + vec.z.toString();
};

//Make a 2-second tween translation of an object between two points.
var makeTween = function (object, startVec, endVec) {
    var tween = new TWEEN.Tween({ x : startVec.x, y : startVec.y, z : startVec.z, theItem: object})
        .to({ x : endVec.x, y : endVec.y, z : endVec.z}, 2000)
        .easing(TWEEN.Easing.Linear.None)
        .onStart(function () {
            this.theItem.position.x = this.x;
            this.theItem.position.y = this.y;
            this.theItem.position.z = this.z;
            this.theItem.geometry.verticesNeedUpdate = true;
            this.theItem.geometry.normalsNeedUpdate = true;
        })
        .onUpdate(function () {
            this.theItem.position.x = this.x;
            this.theItem.position.y = this.y;
            this.theItem.position.z = this.z;
            this.theItem.geometry.verticesNeedUpdate = true;
            this.theItem.geometry.normalsNeedUpdate = true;
                        //console.log("Object: " + vecToString(this.theItem.position));
        })
        .onComplete(function () {
            this.theItem.geometry.verticesNeedUpdate = true;
            this.theItem.geometry.normalsNeedUpdate = true;
        });
    return tween;
};

//Make a set of tween translation animations on an object in sequence from a list of points in a path
var makeAnimationChain = function (object, pointList) {
    var tweens = [];
    var idx, currentVector, nextVector, tween;
    if (pointList.length < 2) {
        return;
    }
    for (idx = 0; idx !== pointList.length; idx = idx + 1) {
        currentVector = {x : pointList[idx][0], y : pointList[idx][1], z : pointList[idx][2]};
        nextVector = {x : pointList[idx + 1][0], y : pointList[idx + 1][1], z : pointList[idx + 1][2]};
        tween = makeTween(object, currentVector, nextVector);
        tweens.push(tween);
        if (idx > 0) {
            tweens[idx - 1].chain(tweens[idx]);
        }
        if (idx === pointList.length - 2) {
            break;
        }
    }
    return tweens;
};


//Main (and only) angular controller for the body of index.html
threeNgApp.controller("RenderCtrl", function ($scope, $http) {
    $scope.debug = false;
    $scope.orbitSpeed = 0;
    $scope.continueRender = true;
    $scope.statusMessage = "Initializing...";

    //Create color values from RGB inputs
    $scope.colorByTriple = function (red, blue, green) {
        this.color = blue + (green << 8) + (red << 16);
    };

    //Create color values from hex strings
    $scope.color = function (hexValue) {
        this.color = parseInt(hexValue, 16);
    };

    //Create a new color with RGB values scaled by a factor.
    $scope.scaleColor = function (color, scale) {
        var red;
        var green;
        var blue;
        red =   (color.color & 0xff0000) >> 16;<commit_msg>add window-resize support for graphics<commit_after>
var threeNgApp = angular.module("threeNgApp", []);


//Simple ThreeJS vector string formatter
var vecToString = function (vec) {
    return vec.x.toString() + ", " + vec.y.toString() + ", " + vec.z.toString();
};

//Make a 2-second tween translation of an object between two points.
var makeTween = function (object, startVec, endVec) {
    var tween = new TWEEN.Tween({ x : startVec.x, y : startVec.y, z : startVec.z, theItem: object})
        .to({ x : endVec.x, y : endVec.y, z : endVec.z}, 2000)
        .easing(TWEEN.Easing.Linear.None)
        .onStart(function () {
            this.theItem.position.x = this.x;
            this.theItem.position.y = this.y;
            this.theItem.position.z = this.z;
            this.theItem.geometry.verticesNeedUpdate = true;
            this.theItem.geometry.normalsNeedUpdate = true;
        })
        .onUpdate(function () {
            this.theItem.position.x = this.x;
            this.theItem.position.y = this.y;
            this.theItem.position.z = this.z;
            this.theItem.geometry.verticesNeedUpdate = true;
            this.theItem.geometry.normalsNeedUpdate = true;
                        //console.log("Object: " + vecToString(this.theItem.position));
        })
        .onComplete(function () {
            this.theItem.geometry.verticesNeedUpdate = true;
            this.theItem.geometry.normalsNeedUpdate = true;
        });
    return tween;
};

//Make a set of tween translation animations on an object in sequence from a list of points in a path
var makeAnimationChain = function (object, pointList) {
    var tweens = [];
    var idx, currentVector, nextVector, tween;
    if (pointList.length < 2) {
        return;
    }
    for (idx = 0; idx !== pointList.length; idx = idx + 1) {
        currentVector = {x : pointList[idx][0], y : pointList[idx][1], z : pointList[idx][2]};
        nextVector = {x : pointList[idx + 1][0], y : pointList[idx + 1][1], z : pointList[idx + 1][2]};
        tween = makeTween(object, currentVector, nextVector);
        tweens.push(tween);
        if (idx > 0) {
            tweens[idx - 1].chain(tweens[idx]);
        }
        if (idx === pointList.length - 2) {
            break;
        }
    }
    return tweens;
};


//Main (and only) angular controller for the body of index.html
threeNgApp.controller("RenderCtrl", function ($scope, $window, $http) {
    $scope.debug = false;
    $scope.orbitSpeed = 0;
    $scope.continueRender = true;
    $scope.statusMessage = "Initializing...";
    $scope.setResize = function () {
        $scope.camera.aspect = window.innerWidth / window.innerHeight;
        $scope.camera.updateProjectionMatrix();
        $scope.renderer.setSize(window.innerWidth / 2.5, window.innerHeight / 2);
    };
    $window.addEventListener('resize', $scope.setResize);
    //Create color values from RGB inputs
    $scope.colorByTriple = function (red, blue, green) {
        this.color = blue + (green << 8) + (red << 16);
    };

    //Create color values from hex strings
    $scope.color = function (hexValue) {
        this.color = parseInt(hexValue, 16);
    };

    //Create a new color with RGB values scaled by a factor.
    $scope.scaleColor = function (color, scale) {
        var red;
        var green;
        var blue;
        red =   (color.color & 0xff0000) >> 16;
{'fraction_non_alphanumeric': 0.13556942277691109, 'fraction_numerical': 0.010764430577223089, 'mean_word_length': 2.326933056564608, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '2232363', 'n_tokens_mistral': 2048, 'n_tokens_neox': 1980, 'n_words': 496}