<commit_before>function StackDelegate(domain, filename, stackType, defaultNumNodes, summaryStackData) {
    var self = this;
    self.filename = filename;
    self.stackType = stackType;
    self.summaryStackData = summaryStackData;
    self.domain = domain;
    self.defaultNumNodes = defaultNumNodes;
    self.focusNode = null;
    self.filters = ""

    self.log = function log(status) {
        $("#statusBar span").text(status);
    };

    // TODO: Probably remove this
    $('#tabs').on('change.zf.tabs', function (event, tab) {
        //console.log(tab);
    });

    self.getSummaryData = function getSummaryData(callback) {
        var url = self.domain + "/api/data/stackviewer/summary?filename=" + self.filename
                                                          + "&stacktype=" + self.stackType
                                                          + "&numNodes=" + self.defaultNumNodes
                                                          + "&" + self.filters;

        console.log("Fetching Summary Data for " + self.filename);
        //self.log("Fetching Summary Data for " + self.filename);

        $.get(url, function (response, status) {
            json = JSON.parse(response);
            self.summaryStackData = json;

            //self.log("Completed: Get Summary Data for " + self.filename);
            console.log("Completed: Get Summary Data for " + self.filename);

            callback(json);
        });
    }

    self.getCallersData = function getCallersData(nodeName, path, callback) {
        var url = self.domain + "/api/data/stackviewer/callertree?filename=" + self.filename
                                                                  + "&name=" + nodeName
                                                             + "&stacktype=" + self.stackType
                                                              + "&numNodes=" + self.defaultNumNodes
                                                                  + "&path=" + path
                                                                       + "&" + self.filters;

        path = path != "" && path != undefined ? "/" + path : path;
        console.log("Fetching Callers Data for " + nodeName + path);
        //self.log("Fetching Callers Data for " + nodeName + path);

        $.get(url, function (response, status) {
            json = JSON.parse(response);

            //self.log("Completed: Get Callers for " + nodeName + " at path: " + path);
            console.log("Completed: Get Callers for " + nodeName + path);
            
            callback(json, status);
        });
    }
}


var stackDelegate = new StackDelegate(window.opener.domain,
                                    window.opener.filename,
                                    window.opener.stackType,
                                    window.opener.defaultNumNodes,<commit_msg>Updated stackDelegate.js to log out to status bar on page instead of the console<commit_after>function StackDelegate(domain, filename, stackType, defaultNumNodes, summaryStackData) {
    var self = this;
    self.filename = filename;
    self.stackType = stackType;
    self.summaryStackData = summaryStackData;
    self.domain = domain;
    self.defaultNumNodes = defaultNumNodes;
    self.focusNode = null;
    self.filters = ""

    self.log = function log(status) {
        $("#statusBar span").text(status);
    };

    // TODO: Probably remove this
    $('#tabs').on('change.zf.tabs', function (event, tab) {
        //console.log(tab);
    });

    self.getSummaryData = function getSummaryData(callback) {
        var url = self.domain + "/api/data/stackviewer/summary?filename=" + self.filename
                                                          + "&stacktype=" + self.stackType
                                                          + "&numNodes=" + self.defaultNumNodes
                                                          + "&" + self.filters;

        //console.log("Fetching Summary Data for " + self.filename);
        self.log("Fetching Summary Data for " + self.filename);

        $.get(url, function (response, status) {
            json = JSON.parse(response);
            self.summaryStackData = json;

            self.log("Completed: Get Summary Data for " + self.filename);
            //console.log("Completed: Get Summary Data for " + self.filename);

            callback(json);
        });
    }

    self.getCallersData = function getCallersData(nodeName, path, callback) {
        var url = self.domain + "/api/data/stackviewer/callertree?filename=" + self.filename
                                                                  + "&name=" + nodeName
                                                             + "&stacktype=" + self.stackType
                                                              + "&numNodes=" + self.defaultNumNodes
                                                                  + "&path=" + path
                                                                       + "&" + self.filters;

        path = path != "" && path != undefined ? "/" + path : path;
        //console.log("Fetching Callers Data for " + nodeName + path);
        self.log("Fetching Callers Data for " + nodeName + path);

        $.get(url, function (response, status) {
            json = JSON.parse(response);

            self.log("Completed: Get Callers for " + nodeName + path);
            //console.log("Completed: Get Callers for " + nodeName + path);
            
            callback(json, status);
        });
    }
}


var stackDelegate = new StackDelegate(window.opener.domain,
                                    window.opener.filename,
                                    window.opener.stackType,
                                    window.opener.defaultNumNodes,
{'fraction_non_alphanumeric': 0.11197110423116616, 'fraction_numerical': 0.0, 'mean_word_length': 1.3792962356792144, 'pattern_counts': {'":': 0, '<': 3, '<?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': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6609120', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1344, 'n_words': 302}