<commit_before>// Requires:
//      app,Colors
//      app.firebase
//      app.WordList
//      utils/metric
//      utils/visualization

(function (app) { 'use strict';

    // Word gazing display routine
    // Constructor arguments:
    //      options: {
    //          spacingNames        - spacing names
    //          fixationColor       - fixation color
    //          showFixations       - fixation display flag
    //          showRegressions     - regression display flag
    //      }
    function GazePlots (options) {

        this.spacingNames = app.Common.spacingNames; //
        this.fixationColor = options.fixationColor || '#000';

        this.showFixations = options.showFixations !== undefined ? options.showFixations : false;
        this.showRegressions = options.showRegressions !== undefined ? options.showRegressions : false;

        app.Visualization.call( this, options );

        this._data = null;

        this._setPrevPageCallback( () => {
            if (this._data && this._pageIndex > 0) {
                this._pageIndex--;
                this._enableNavigationButtons( this._pageIndex > 0, this._pageIndex < this._data.text.length - 1 );
                this._remapAndShow();
            }
        });

        this._setNextPageCallback( () => {
            if (this._data && this._pageIndex < this._data.text.length - 1) {
                this._pageIndex++;
                this._enableNavigationButtons( this._pageIndex > 0, this._pageIndex < this._data.text.length - 1 );
                this._remapAndShow();
            }
        });
    }

    app.loaded( () => { // we have to defer the prototype definition until the Visualization mudule is loaded

    GazePlots.prototype = Object.create( app.Visualization.prototype );
    GazePlots.prototype.base = app.Visualization.prototype;
    GazePlots.prototype.constructor = GazePlots;

    GazePlots.prototype._fillCategories = function (list, users) {
        const texts = this._getTexts( users );
        texts.forEach( (text, id) => {
            const option = this._addOption( list, id, text.title, text.sessions );
            // if (this._data && this._data.user === user.key) {
            //     option.selected = true;
            // }
        });
    };

    GazePlots.prototype._load = function( textID, sessions ) {
        app.WordList.instance.show();

        const sessionPromises = [];

        sessions.forEach( (session, id) => {
            sessionPromises.push( this._sessions[ id ] || new Promise( (resolve, reject) => {
                const sessionRef = app.firebase.child( 'sessions/' + id);
                sessionRef.once( 'value', snapshot => {

                    if (!snapshot.exists()) {<commit_msg>temp kostyl<commit_after>// Requires:
//      app,Colors
//      app.firebase
//      app.WordList
//      utils/metric
//      utils/visualization

(function (app) { 'use strict';

    // Word gazing display routine
    // Constructor arguments:
    //      options: {
    //          spacingNames        - spacing names
    //          fixationColor       - fixation color
    //          showFixations       - fixation display flag
    //          showRegressions     - regression display flag
    //      }
    function GazePlots (options) {

        this.spacingNames = app.Common.spacingNames; //
        this.fixationColor = options.fixationColor || '#000';

        this.showFixations = options.showFixations !== undefined ? options.showFixations : false;
        this.showRegressions = options.showRegressions !== undefined ? options.showRegressions : false;

        app.Visualization.call( this, options );

        this._data = null;
        /*
        this._setPrevPageCallback( () => {
            if (this._data && this._pageIndex > 0) {
                this._pageIndex--;
                this._enableNavigationButtons( this._pageIndex > 0, this._pageIndex < this._data.text.length - 1 );
                this._remapAndShow();
            }
        });

        this._setNextPageCallback( () => {
            if (this._data && this._pageIndex < this._data.text.length - 1) {
                this._pageIndex++;
                this._enableNavigationButtons( this._pageIndex > 0, this._pageIndex < this._data.text.length - 1 );
                this._remapAndShow();
            }
        });*/
    }

    app.loaded( () => { // we have to defer the prototype definition until the Visualization mudule is loaded

    GazePlots.prototype = Object.create( app.Visualization.prototype );
    GazePlots.prototype.base = app.Visualization.prototype;
    GazePlots.prototype.constructor = GazePlots;

    GazePlots.prototype._fillCategories = function (list, users) {
        const texts = this._getTexts( users );
        texts.forEach( (text, id) => {
            const option = this._addOption( list, id, text.title, text.sessions );
            // if (this._data && this._data.user === user.key) {
            //     option.selected = true;
            // }
        });
    };

    GazePlots.prototype._load = function( textID, sessions ) {
        app.WordList.instance.show();

        const sessionPromises = [];

        sessions.forEach( (session, id) => {
            sessionPromises.push( this._sessions[ id ] || new Promise( (resolve, reject) => {
                const sessionRef = app.firebase.child( 'sessions/' + id);
                sessionRef.once( 'value', snapshot => {

                    if (!snapshot.exists()) {
{'fraction_non_alphanumeric': 0.12239678480087687, 'fraction_numerical': 0.003288271830471319, 'mean_word_length': 1.872507869884575, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, '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': '1636226', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1451, 'n_words': 309}