<commit_before>var SeqFeatureStore; if( !SeqFeatureStore) SeqFeatureStore = function() {};

/**
 * Feature storage backend for backward-compatibility with JBrowse 1.2.1 stores.
 * @class
 * @extends SeqFeatureStore.NCList
 */

SeqFeatureStore.NCList_v0 = function(args) {
    SeqFeatureStore.NCList.call( this, args );

    this.fields = {};
    this.track = args.track;
};

SeqFeatureStore.NCList_v0.prototype = new SeqFeatureStore.NCList('');


/**
 * Delete an object member and return the deleted value.
 * @private
 */
SeqFeatureStore.NCList_v0.prototype._del = function( obj, old ) {
    var x = obj[old];
    delete obj[old];
    return x;
};

SeqFeatureStore.NCList_v0.prototype.loadSuccess = function( trackInfo, url ) {

    if( trackInfo ) {

        // munge the trackInfo to make the histogram stuff work with v1 code
        dojo.forEach( trackInfo.histogramMeta, function(m) {
                          m.arrayParams.urlTemplate = m.arrayParams.urlTemplate.replace(/\{chunk\}/,'{Chunk}');
                      });
        trackInfo.histograms = {
            meta: this._del( trackInfo, 'histogramMeta' ),
            stats: this._del( trackInfo, 'histStats' )
        };

        // since the old format had config information inside the
        // trackdata file, yuckily push it up to the track's config
        var renameVar = {
            urlTemplate: "linkTemplate"
        };
        dojo.forEach(
            ['className','arrowheadClass','subfeatureClasses','urlTemplate'],
            function(varname) {
                if( !this.track.config.style ) this.track.config.style = {};
                var dest_varname = renameVar[varname] || varname;
                if( varname in trackInfo )
                    this.track.config.style[dest_varname] = trackInfo[varname];
            },this);

        // remember the field offsets from the old-style trackinfo headers
        this.fields = {};
        var i;
        for (i = 0; i < trackInfo.headers.length; i++) {
            this.fields[trackInfo.headers[i]] = i;<commit_msg>1.2.x backcompat needs to merge the clientConfig vals into the track styles also.  closes #75 (again).<commit_after>var SeqFeatureStore; if( !SeqFeatureStore) SeqFeatureStore = function() {};

/**
 * Feature storage backend for backward-compatibility with JBrowse 1.2.1 stores.
 * @class
 * @extends SeqFeatureStore.NCList
 */

SeqFeatureStore.NCList_v0 = function(args) {
    SeqFeatureStore.NCList.call( this, args );

    this.fields = {};
    this.track = args.track;
};

SeqFeatureStore.NCList_v0.prototype = new SeqFeatureStore.NCList('');


/**
 * Delete an object member and return the deleted value.
 * @private
 */
SeqFeatureStore.NCList_v0.prototype._del = function( obj, old ) {
    var x = obj[old];
    delete obj[old];
    return x;
};

SeqFeatureStore.NCList_v0.prototype.loadSuccess = function( trackInfo, url ) {

    if( trackInfo ) {

        // munge the trackInfo to make the histogram stuff work with v1 code
        dojo.forEach( trackInfo.histogramMeta, function(m) {
                          m.arrayParams.urlTemplate = m.arrayParams.urlTemplate.replace(/\{chunk\}/,'{Chunk}');
                      });
        trackInfo.histograms = {
            meta: this._del( trackInfo, 'histogramMeta' ),
            stats: this._del( trackInfo, 'histStats' )
        };

        // since the old format had style information inside the
        // trackdata file, yuckily push it up to the track's config.style
        var renameVar = {
            urlTemplate: "linkTemplate"
        };
        dojo.forEach(
            ['className','arrowheadClass','subfeatureClasses','urlTemplate','clientConfig'],
            function(varname) {
                if( !this.track.config.style ) this.track.config.style = {};
                var dest_varname = renameVar[varname] || varname;
                if( varname in trackInfo )
                    this.track.config.style[dest_varname] = trackInfo[varname];
            },this);

        // also need to merge Ye Olde clientConfig values into the style object
        if( this.track.config.style.clientConfig ) {
            this.track.config.style = dojo.mixin( this.track.config.style, this.track.config.style.clientConfig );
            delete this.track.config.style.clientConfig;
        }

        // remember the field offsets from the old-style trackinfo headers
        this.fields = {};
        var i;
        for (i = 0; i < trackInfo.headers.length; i++) {
            this.fields[trackInfo.headers[i]] = i;
{'fraction_non_alphanumeric': 0.11642778390297685, 'fraction_numerical': 0.0048511576626240355, 'mean_word_length': 2.3800298062593144, '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': '2862959', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1281, 'n_words': 318}