<commit_before>﻿var reportInterface = new function() {

    // public

    this.addSortHeaders = function(domId) 
    {
        // sort
        _.each($(format("#{0} tr.header td", domId)), function(e) { $(e).append(format('&nbsp;<img class="sortdown" src="{0}arrow_up.png"/>&nbsp;<img class="sortup" src="{0}arrow_down.png"/>', reportState.imagePath)); });

        $(".sortup").unbind().click(function(e) {
            $("#ajaxSpinnerImage").show();

            reportState.sortRowIndex = $(this).parent().index();
            reportState.sortDirection = "up";

            if (reportState.useExpandCollapse)
                reportState.drawData(reportBuilder.sortExpandedData(reportState.serverData, reportState.dimensionsY, reportState.sortRowIndex, reportState.sortDirection));
            else
                reportState.drawData(reportBuilder.sortData(reportState.serverData, reportState.sortRowIndex, reportState.sortDirection));

            $("#ajaxSpinnerImage").hide();
        });

        $(".sortdown").unbind().click(function(e) {
            $("#ajaxSpinnerImage").show();

            reportState.sortRowIndex = $(this).parent().index();
            reportState.sortDirection = "down";

            if (reportState.useExpandCollapse)
                reportState.drawData(reportBuilder.sortExpandedData(reportState.serverData, reportState.dimensionsY, reportState.sortRowIndex, reportState.sortDirection));
            else
                reportState.drawData(reportBuilder.sortData(reportState.serverData, reportState.sortRowIndex, reportState.sortDirection));

            $("#ajaxSpinnerImage").hide();
        });
    };

    // domId
    // allYaxisValues the result of getAllYAxisValues
    // data [{ type: "row|subtotal|grandtotal", values: [{ sortValue: "", displayValue: "", sortValueType: "string" }] ]
    // yAxis [{ id: '', name: ''}, ...]
    // xAxis [{ id: '', name: '', calculate: ... }, ...] 
    // xAxisRestrictions [{ name: '', visible: false }, ...] 
    // xAxisDimValues [value1, value2, ...]
    //
    this.drawTable = function(domId, allYaxisValues, data, yAxis, xAxis, xAxisRestrictions, xAxisDimValues)
    {
        var dataTable = $(format("#{0}", domId));
        var dataTableHTML = "";

        var extraHeaders = _.filter(xAxisRestrictions, function(e) { return e.visible; }).length;<commit_msg>Minor cleanup<commit_after>﻿var reportInterface = new function() {

    // public

    this.addSortHeaders = function(domId) 
    {
        // sort
        _.each($(format("#{0} tr.header td", domId)), function(e) { $(e).append(format('&nbsp;<img class="sortdown" src="{0}arrow_up.png"/>&nbsp;<img class="sortup" src="{0}arrow_down.png"/>', reportState.imagePath)); });

        $(".sortup").unbind().click(function(e) {

            reportState.sortRowIndex = $(this).parent().index();
            reportState.sortDirection = "up";

            if (reportState.useExpandCollapse)
                reportState.drawData(reportBuilder.sortExpandedData(reportState.serverData, reportState.dimensionsY, reportState.sortRowIndex, reportState.sortDirection));
            else
                reportState.drawData(reportBuilder.sortData(reportState.serverData, reportState.sortRowIndex, reportState.sortDirection));
        });

        $(".sortdown").unbind().click(function(e) {

            reportState.sortRowIndex = $(this).parent().index();
            reportState.sortDirection = "down";

            if (reportState.useExpandCollapse)
                reportState.drawData(reportBuilder.sortExpandedData(reportState.serverData, reportState.dimensionsY, reportState.sortRowIndex, reportState.sortDirection));
            else
                reportState.drawData(reportBuilder.sortData(reportState.serverData, reportState.sortRowIndex, reportState.sortDirection));

        });
    };

    // domId
    // allYaxisValues the result of getAllYAxisValues
    // data [{ type: "row|subtotal|grandtotal", values: [{ sortValue: "", displayValue: "", sortValueType: "string" }] ]
    // yAxis [{ id: '', name: ''}, ...]
    // xAxis [{ id: '', name: '', calculate: ... }, ...] 
    // xAxisRestrictions [{ name: '', visible: false }, ...] 
    // xAxisDimValues [value1, value2, ...]
    //
    this.drawTable = function(domId, allYaxisValues, data, yAxis, xAxis, xAxisRestrictions, xAxisDimValues)
    {
        var dataTable = $(format("#{0}", domId));
        var dataTableHTML = "";

        var extraHeaders = _.filter(xAxisRestrictions, function(e) { return e.visible; }).length;
{'fraction_non_alphanumeric': 0.160741885625966, 'fraction_numerical': 0.0026495915213071318, 'mean_word_length': 2.9911894273127753, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5858547', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1269, 'n_words': 200}