<commit_before>String.prototype.repeat = function( num )
{
    return new Array( num + 1 ).join( this );
}

BubbleMenu = {

    width: undefined,
    height: undefined,
    element: undefined,
    raphael: undefined,
    animationTimeout: undefined,
    solutions: [],
    data: undefined,
    zoomCount: 0,
    lifeSavingString: "_",

    init: function () {

        if (BubbleMenu.raphael) {
            this.solutions = [];
            console.log("A raphael object exists")
            console.log(this.raphael)
            BubbleMenu.raphael.remove();
            console.log(this.raphael)
            console.log("A raphael object exists")
            clearTimeout(this.animationTimeout);
        }
        this.data = $.parseJSON(window.data).solutions;
        this.element = $("#bubble-container");
        this.width = this.element.width();
        this.height = this.element.height();
        this.raphael = new Raphael(this.element.get(0), this.width, this.height);
        this.zoomCount += 1
        this.createSolutions();
        this.animate();
    },

    createSolutions: function () {
        var period = this.width / (this.data.length + 1);
        for (var i = 0; i < this.data.length; i++) {
            var pos = (period * (i + 1));
            var uniqueIdGenerator = this.lifeSavingString.repeat(this.zoomCount) + i
            console.log("ABOUT TO CREATE A NEW SOLUTION")

            var solution = new Solution(0, 0, uniqueIdGenerator, this.raphael);
            solution.addEventListeners()
            solution.sprite.attr({'cx': pos.toString()});
            solution.sprite.attr({'cy': this.height.toString()});
            this.solutions.push(solution);<commit_msg>-add zoomCount property to determine number of underscore appends to make each circle id unique from a solution factory -add lifeSavingString as a prefix to circle identifier to allow for proper event binding to raphael dom objects -add (repeat) String prototype method to do stringxnumber multiplication -that was really fun<commit_after>String.prototype.repeat = function( num )
{
    return new Array( num + 1 ).join( this );
}

BubbleMenu = {

    width: undefined,
    height: undefined,
    element: undefined,
    raphael: undefined,
    animationTimeout: undefined,
    solutions: [],
    data: undefined,
    zoomCount: 0,
    lifeSavingString: "_",

    init: function () {

        if (BubbleMenu.raphael) {
            this.solutions = [];
            BubbleMenu.raphael.remove();
            clearTimeout(this.animationTimeout);
        }
        this.data = $.parseJSON(window.data).solutions;
        this.element = $("#bubble-container");
        this.width = this.element.width();
        this.height = this.element.height();
        this.raphael = new Raphael(this.element.get(0), this.width, this.height);
        this.zoomCount += 1
        this.createSolutions();
        this.animate();
    },

    createSolutions: function () {
        var period = this.width / (this.data.length + 1);
        for (var i = 0; i < this.data.length; i++) {
            var pos = (period * (i + 1));
            var uniqueIdGenerator = this.lifeSavingString.repeat(this.zoomCount) + i

            var solution = new Solution(0, 0, uniqueIdGenerator, this.raphael);
            solution.addEventListeners()
            solution.sprite.attr({'cx': pos.toString()});
            solution.sprite.attr({'cy': this.height.toString()});
            this.solutions.push(solution);
{'fraction_non_alphanumeric': 0.12614942528735631, 'fraction_numerical': 0.005172413793103448, 'mean_word_length': 2.3894839337877314, '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': '3612123', 'n_tokens_mistral': 1000, 'n_tokens_neox': 966, 'n_words': 238}