<commit_before> /*
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2014 Mozilla Corporation

Contributors:
<NAME> <EMAIL>
 */

if (Meteor.isClient) {
    var verisstatsResult = new Object;

    Template.incidentsveris.rendered = function () {
        var container=document.getElementById('veris-wrapper')
        container.style.cursor='wait'
        Meteor.apply('verisstats',
            [],
            onResultReceived = function(err,result){
                //debugLog(err,result);
                if (typeof err == 'undefined') {
                    verisstatsResult.status='completed';
                    verisstatsResult.result = result;
                    verisstatsResult.content=result.content;
                    verisstatsResult.data=result.data;
                    container.style.cursor='auto';
                    result.data.forEach(function(d){
                        if ( d.dateOpened && d.dateOpened['$date'] ){
                            //grab just the year from the python datetime object
                            d.yearOpened=moment(d.dateOpened['$date']).format("YYYY");
                            //reformat dateOpened from a python datetime object to month date
                            d.dateOpened=moment(d.dateOpened['$date']).format("MMMM YYYY");
                        }
                    });
                    startPivotTable(result.data);
               } else {
                    //debugLog(err,result);
                    verisstatsResult.status='error';
                    verisstatsResult.error=err;
               }
           });

        container.style.cursor='auto';
        function startPivotTable(tableData){
        $("#veris-wrapper").pivotUI(
                        tableData,
                        {
                            cols: ["phase"],
                            rows: ["tags"]
                        }<commit_msg>fix "too many items" problem in the tags pivot table<commit_after> /*
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2014 Mozilla Corporation

Contributors:
<NAME> <EMAIL>
 */

if (Meteor.isClient) {
    var verisstatsResult = new Object;

    Template.incidentsveris.rendered = function () {
        var container=document.getElementById('veris-wrapper')
        container.style.cursor='wait'
        Meteor.apply('verisstats',
            [],
            onResultReceived = function(err,result){
                //debugLog(err,result);
                if (typeof err == 'undefined') {
                    verisstatsResult.status='completed';
                    verisstatsResult.result = result;
                    verisstatsResult.content=result.content;
                    verisstatsResult.data=result.data;
                    container.style.cursor='auto';
                    result.data.forEach(function(d){
                        if ( d.dateOpened && d.dateOpened['$date'] ){
                            //grab just the year from the python datetime object
                            d.yearOpened=moment(d.dateOpened['$date']).format("YYYY");
                            //reformat dateOpened from a python datetime object to month date
                            d.dateOpened=moment(d.dateOpened['$date']).format("MMMM YYYY");
                        }
                    });
                    startPivotTable(result.data);
               } else {
                    //debugLog(err,result);
                    verisstatsResult.status='error';
                    verisstatsResult.error=err;
               }
           });

        container.style.cursor='auto';
        function startPivotTable(tableData){
        $("#veris-wrapper").pivotUI(
                        tableData,
                        {
                            cols: ["phase"],
                            rows: ["tags"],
                            menuLimit: 500,
                        }
{'fraction_non_alphanumeric': 0.10299714557564224, 'fraction_numerical': 0.004519505233111323, 'mean_word_length': 1.4166666666666667, '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': '3205306', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1002, 'n_words': 227}